Set version to 9.
[wine/wine64.git] / dlls / msi / msi.c
blob7bb462075571691f5340d14316bdfabed04d24c6
1 /*
2 * Implementation of the Microsoft Installer (msi.dll)
4 * Copyright 2002,2003 Mike McCormack for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #define NONAMELESSUNION
23 #include <stdarg.h>
25 #include "windef.h"
26 #include "winbase.h"
27 #include "winreg.h"
28 #include "winnls.h"
29 #include "shlwapi.h"
30 #include "wine/debug.h"
31 #include "msi.h"
32 #include "msiquery.h"
33 #include "msipriv.h"
34 #include "objidl.h"
35 #include "wincrypt.h"
37 WINE_DEFAULT_DEBUG_CHANNEL(msi);
39 const WCHAR szInstaller[] = {
40 'S','o','f','t','w','a','r','e','\\',
41 'M','i','c','r','o','s','o','f','t','\\',
42 'W','i','n','d','o','w','s','\\',
43 'C','u','r','r','e','n','t','V','e','r','s','i','o','n','\\',
44 'I','n','s','t','a','l','l','e','r',0 };
46 const WCHAR szFeatures[] = {
47 'F','e','a','t','u','r','e','s',0 };
48 const WCHAR szComponents[] = {
49 'C','o','m','p','o','n','e','n','t','s',0 };
52 * .MSI file format
54 * A .msi file is a structured storage file.
55 * It should contain a number of streams.
58 BOOL unsquash_guid(LPCWSTR in, LPWSTR out)
60 DWORD i,n=0;
62 out[n++]='{';
63 for(i=0; i<8; i++)
64 out[n++] = in[7-i];
65 out[n++]='-';
66 for(i=0; i<4; i++)
67 out[n++] = in[11-i];
68 out[n++]='-';
69 for(i=0; i<4; i++)
70 out[n++] = in[15-i];
71 out[n++]='-';
72 for(i=0; i<2; i++)
74 out[n++] = in[17+i*2];
75 out[n++] = in[16+i*2];
77 out[n++]='-';
78 for( ; i<8; i++)
80 out[n++] = in[17+i*2];
81 out[n++] = in[16+i*2];
83 out[n++]='}';
84 out[n]=0;
85 return TRUE;
88 BOOL squash_guid(LPCWSTR in, LPWSTR out)
90 DWORD i,n=0;
92 if(in[n++] != '{')
93 return FALSE;
94 for(i=0; i<8; i++)
95 out[7-i] = in[n++];
96 if(in[n++] != '-')
97 return FALSE;
98 for(i=0; i<4; i++)
99 out[11-i] = in[n++];
100 if(in[n++] != '-')
101 return FALSE;
102 for(i=0; i<4; i++)
103 out[15-i] = in[n++];
104 if(in[n++] != '-')
105 return FALSE;
106 for(i=0; i<2; i++)
108 out[17+i*2] = in[n++];
109 out[16+i*2] = in[n++];
111 if(in[n++] != '-')
112 return FALSE;
113 for( ; i<8; i++)
115 out[17+i*2] = in[n++];
116 out[16+i*2] = in[n++];
118 out[32]=0;
119 if(in[n++] != '}')
120 return FALSE;
121 if(in[n])
122 return FALSE;
123 return TRUE;
126 VOID MSI_CloseDatabase( VOID *arg )
128 MSIDATABASE *db = (MSIDATABASE *) arg;
130 free_cached_tables( db );
131 IStorage_Release( db->storage );
134 UINT WINAPI MsiOpenDatabaseA(
135 LPCSTR szDBPath, LPCSTR szPersist, MSIHANDLE *phDB)
137 HRESULT r = ERROR_FUNCTION_FAILED;
138 LPWSTR szwDBPath = NULL, szwPersist = NULL;
139 UINT len;
141 TRACE("%s %s %p\n", debugstr_a(szDBPath), debugstr_a(szPersist), phDB);
143 if( szDBPath )
145 len = MultiByteToWideChar( CP_ACP, 0, szDBPath, -1, NULL, 0 );
146 szwDBPath = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
147 if( !szwDBPath )
148 goto end;
149 MultiByteToWideChar( CP_ACP, 0, szDBPath, -1, szwDBPath, len );
152 if( szPersist )
154 len = MultiByteToWideChar( CP_ACP, 0, szPersist, -1, NULL, 0 );
155 szwPersist = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
156 if( !szwPersist )
157 goto end;
158 MultiByteToWideChar( CP_ACP, 0, szPersist, -1, szwPersist, len );
161 r = MsiOpenDatabaseW( szwDBPath, szwPersist, phDB );
163 end:
164 if( szwPersist )
165 HeapFree( GetProcessHeap(), 0, szwPersist );
166 if( szwDBPath )
167 HeapFree( GetProcessHeap(), 0, szwDBPath );
169 return r;
172 UINT WINAPI MsiOpenDatabaseW(
173 LPCWSTR szDBPath, LPCWSTR szPersist, MSIHANDLE *phDB)
175 IStorage *stg = NULL;
176 HRESULT r;
177 MSIHANDLE handle;
178 MSIDATABASE *db;
179 UINT ret;
181 TRACE("%s %s %p\n",debugstr_w(szDBPath),debugstr_w(szPersist), phDB);
183 if( !phDB )
184 return ERROR_INVALID_PARAMETER;
186 r = StgOpenStorage( szDBPath, NULL, STGM_DIRECT|STGM_READ|STGM_SHARE_DENY_WRITE, NULL, 0, &stg);
187 if( FAILED( r ) )
189 FIXME("open failed r = %08lx!\n",r);
190 return ERROR_FUNCTION_FAILED;
193 handle = alloc_msihandle(MSIHANDLETYPE_DATABASE, sizeof (MSIDATABASE), MSI_CloseDatabase );
194 if( !handle )
196 FIXME("Failed to allocate a handle\n");
197 ret = ERROR_FUNCTION_FAILED;
198 goto end;
201 db = msihandle2msiinfo( handle, MSIHANDLETYPE_DATABASE );
202 if( !db )
204 FIXME("Failed to get handle pointer \n");
205 ret = ERROR_FUNCTION_FAILED;
206 goto end;
208 db->storage = stg;
209 ret = load_string_table( db, &db->strings);
210 if( ret != ERROR_SUCCESS )
211 goto end;
213 *phDB = handle;
215 IStorage_AddRef( stg );
216 end:
217 if( stg )
218 IStorage_Release( stg );
220 return ret;
223 UINT WINAPI MsiOpenProductA(LPCSTR szProduct, MSIHANDLE *phProduct)
225 FIXME("%s %p\n",debugstr_a(szProduct), phProduct);
226 return ERROR_CALL_NOT_IMPLEMENTED;
229 UINT WINAPI MsiOpenProductW(LPCWSTR szProduct, MSIHANDLE *phProduct)
231 FIXME("%s %p\n",debugstr_w(szProduct), phProduct);
232 return ERROR_CALL_NOT_IMPLEMENTED;
235 UINT WINAPI MsiOpenPackageA(LPCSTR szPackage, MSIHANDLE *phPackage)
237 FIXME("%s %p\n",debugstr_a(szPackage), phPackage);
238 return ERROR_CALL_NOT_IMPLEMENTED;
241 UINT WINAPI MsiOpenPackageW(LPCWSTR szPackage, MSIHANDLE *phPackage)
243 FIXME("%s %p\n",debugstr_w(szPackage), phPackage);
244 return ERROR_CALL_NOT_IMPLEMENTED;
247 UINT WINAPI MsiOpenPackageExA(LPCSTR szPackage, DWORD dwOptions, MSIHANDLE *phPackage)
249 FIXME("%s 0x%08lx %p\n",debugstr_a(szPackage), dwOptions, phPackage);
250 return ERROR_CALL_NOT_IMPLEMENTED;
253 UINT WINAPI MsiOpenPackageExW(LPCWSTR szPackage, DWORD dwOptions, MSIHANDLE *phPackage)
255 FIXME("%s 0x%08lx %p\n",debugstr_w(szPackage), dwOptions, phPackage);
256 return ERROR_CALL_NOT_IMPLEMENTED;
259 UINT WINAPI MsiAdvertiseProductA(LPCSTR szPackagePath, LPCSTR szScriptfilePath, LPCSTR szTransforms, LANGID lgidLanguage)
261 FIXME("%s %s %s 0x%08x\n",debugstr_a(szPackagePath), debugstr_a(szScriptfilePath), debugstr_a(szTransforms), lgidLanguage);
262 return ERROR_CALL_NOT_IMPLEMENTED;
265 UINT WINAPI MsiAdvertiseProductW(LPCWSTR szPackagePath, LPCWSTR szScriptfilePath, LPCWSTR szTransforms, LANGID lgidLanguage)
267 FIXME("%s %s %s 0x%08x\n",debugstr_w(szPackagePath), debugstr_w(szScriptfilePath), debugstr_w(szTransforms), lgidLanguage);
268 return ERROR_CALL_NOT_IMPLEMENTED;
271 UINT WINAPI MsiAdvertiseProductExA(
272 LPCSTR szPackagePath, LPCSTR szScriptfilePath, LPCSTR szTransforms, LANGID lgidLanguage, DWORD dwPlatform, DWORD dwOptions)
274 FIXME("%s %s %s 0x%08x 0x%08lx 0x%08lx\n",
275 debugstr_a(szPackagePath), debugstr_a(szScriptfilePath), debugstr_a(szTransforms), lgidLanguage, dwPlatform, dwOptions);
276 return ERROR_CALL_NOT_IMPLEMENTED;
279 UINT WINAPI MsiAdvertiseProductExW(
280 LPCWSTR szPackagePath, LPCWSTR szScriptfilePath, LPCWSTR szTransforms, LANGID lgidLanguage, DWORD dwPlatform, DWORD dwOptions)
282 FIXME("%s %s %s 0x%08x 0x%08lx 0x%08lx\n",
283 debugstr_w(szPackagePath), debugstr_w(szScriptfilePath), debugstr_w(szTransforms), lgidLanguage, dwPlatform, dwOptions);
284 return ERROR_CALL_NOT_IMPLEMENTED;
287 UINT WINAPI MsiInstallProductA(LPCSTR szPackagePath, LPCSTR szCommandLine)
289 LPWSTR szwPath = NULL, szwCommand = NULL;
290 UINT r = ERROR_FUNCTION_FAILED; /* FIXME: check return code */
292 TRACE("%s %s\n",debugstr_a(szPackagePath), debugstr_a(szCommandLine));
294 if( szPackagePath )
296 UINT len = MultiByteToWideChar( CP_ACP, 0, szPackagePath, -1, NULL, 0 );
297 szwPath = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
298 if( !szwPath )
299 goto end;
300 MultiByteToWideChar( CP_ACP, 0, szPackagePath, -1, szwPath, len );
303 if( szCommandLine )
305 UINT len = MultiByteToWideChar( CP_ACP, 0, szCommandLine, -1, NULL, 0 );
306 szwCommand = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
307 if( !szwCommand )
308 goto end;
309 MultiByteToWideChar( CP_ACP, 0, szCommandLine, -1, szwCommand, len );
312 r = MsiInstallProductW( szwPath, szwCommand );
314 end:
315 if( szwPath )
316 HeapFree( GetProcessHeap(), 0, szwPath );
318 if( szwCommand )
319 HeapFree( GetProcessHeap(), 0, szwCommand );
321 return r;
324 UINT WINAPI MsiInstallProductW(LPCWSTR szPackagePath, LPCWSTR szCommandLine)
326 FIXME("%s %s\n",debugstr_w(szPackagePath), debugstr_w(szCommandLine));
328 return ERROR_CALL_NOT_IMPLEMENTED;
331 UINT WINAPI MsiConfigureProductA(
332 LPCSTR szProduct, int iInstallLevel, INSTALLSTATE eInstallState)
334 FIXME("%s %d %d\n",debugstr_a(szProduct), iInstallLevel, eInstallState);
335 return ERROR_CALL_NOT_IMPLEMENTED;
338 UINT WINAPI MsiConfigureProductW(
339 LPCWSTR szProduct, int iInstallLevel, INSTALLSTATE eInstallState)
341 FIXME("%s %d %d\n",debugstr_w(szProduct), iInstallLevel, eInstallState);
342 return ERROR_CALL_NOT_IMPLEMENTED;
345 UINT WINAPI MsiGetProductCodeA(LPCSTR szComponent, LPSTR szBuffer)
347 FIXME("%s %s\n",debugstr_a(szComponent), debugstr_a(szBuffer));
348 return ERROR_CALL_NOT_IMPLEMENTED;
351 UINT WINAPI MsiGetProductCodeW(LPCWSTR szComponent, LPWSTR szBuffer)
353 FIXME("%s %s\n",debugstr_w(szComponent), debugstr_w(szBuffer));
354 return ERROR_CALL_NOT_IMPLEMENTED;
357 UINT WINAPI MsiGetProductInfoA(LPCSTR szProduct, LPCSTR szAttribute, LPSTR szBuffer, DWORD *pcchValueBuf)
359 FIXME("%s %s %p %p\n",debugstr_a(szProduct), debugstr_a(szAttribute), szBuffer, pcchValueBuf);
360 return ERROR_CALL_NOT_IMPLEMENTED;
363 UINT WINAPI MsiGetProductInfoW(LPCWSTR szProduct, LPCWSTR szAttribute, LPWSTR szBuffer, DWORD *pcchValueBuf)
365 FIXME("%s %s %p %p\n",debugstr_w(szProduct), debugstr_w(szAttribute), szBuffer, pcchValueBuf);
366 return ERROR_CALL_NOT_IMPLEMENTED;
369 UINT WINAPI MsiDatabaseImportA(LPCSTR szFolderPath, LPCSTR szFilename)
371 FIXME("%s %s\n",debugstr_a(szFolderPath), debugstr_a(szFilename));
372 return ERROR_CALL_NOT_IMPLEMENTED;
375 UINT WINAPI MsiDatabaseImportW(LPCWSTR szFolderPath, LPCWSTR szFilename)
377 FIXME("%s %s\n",debugstr_w(szFolderPath), debugstr_w(szFilename));
378 return ERROR_CALL_NOT_IMPLEMENTED;
381 UINT WINAPI MsiEnableLogA(DWORD dwLogMode, LPCSTR szLogFile, BOOL fAppend)
383 FIXME("%08lx %s %d\n", dwLogMode, debugstr_a(szLogFile), fAppend);
384 return ERROR_SUCCESS;
385 /* return ERROR_CALL_NOT_IMPLEMENTED; */
388 UINT WINAPI MsiEnableLogW(DWORD dwLogMode, LPCWSTR szLogFile, BOOL fAppend)
390 FIXME("%08lx %s %d\n", dwLogMode, debugstr_w(szLogFile), fAppend);
391 return ERROR_CALL_NOT_IMPLEMENTED;
394 INSTALLSTATE WINAPI MsiQueryProductStateA(LPCSTR szProduct)
396 FIXME("%s\n", debugstr_a(szProduct));
397 return 0;
400 INSTALLSTATE WINAPI MsiQueryProductStateW(LPCWSTR szProduct)
402 FIXME("%s\n", debugstr_w(szProduct));
403 return 0;
406 INSTALLUILEVEL WINAPI MsiSetInternalUI(INSTALLUILEVEL dwUILevel, HWND *phWnd)
408 FIXME("%08x %p\n", dwUILevel, phWnd);
409 return dwUILevel;
412 UINT WINAPI MsiLoadStringA(DWORD a, DWORD b, DWORD c, DWORD d, DWORD e, DWORD f)
414 FIXME("%08lx %08lx %08lx %08lx %08lx %08lx\n",a,b,c,d,e,f);
415 return ERROR_CALL_NOT_IMPLEMENTED;
418 UINT WINAPI MsiLoadStringW(DWORD a, DWORD b, DWORD c, DWORD d, DWORD e, DWORD f)
420 FIXME("%08lx %08lx %08lx %08lx %08lx %08lx\n",a,b,c,d,e,f);
421 return ERROR_CALL_NOT_IMPLEMENTED;
424 UINT WINAPI MsiMessageBoxA(DWORD a, DWORD b, DWORD c, DWORD d, DWORD e, DWORD f)
426 FIXME("%08lx %08lx %08lx %08lx %08lx %08lx\n",a,b,c,d,e,f);
427 return ERROR_CALL_NOT_IMPLEMENTED;
430 UINT WINAPI MsiMessageBoxW(DWORD a, DWORD b, DWORD c, DWORD d, DWORD e, DWORD f)
432 FIXME("%08lx %08lx %08lx %08lx %08lx %08lx\n",a,b,c,d,e,f);
433 return ERROR_CALL_NOT_IMPLEMENTED;
436 UINT WINAPI MsiEnumProductsA(DWORD index, LPSTR lpguid)
438 DWORD r;
439 WCHAR szwGuid[GUID_SIZE];
441 TRACE("%ld %p\n",index,lpguid);
443 r = MsiEnumProductsW(index, szwGuid);
444 if( r == ERROR_SUCCESS )
445 WideCharToMultiByte(CP_ACP, 0, szwGuid, -1, lpguid, GUID_SIZE, NULL, NULL);
447 return r;
450 UINT WINAPI MsiEnumProductsW(DWORD index, LPWSTR lpguid)
452 HKEY hkey = 0, hkeyFeatures = 0;
453 DWORD r;
454 WCHAR szKeyName[33];
456 TRACE("%ld %p\n",index,lpguid);
458 r = RegOpenKeyW(HKEY_LOCAL_MACHINE, szInstaller, &hkey);
459 if( r != ERROR_SUCCESS )
460 goto end;
462 r = RegOpenKeyW(hkey, szFeatures, &hkeyFeatures);
463 if( r != ERROR_SUCCESS )
464 goto end;
466 r = RegEnumKeyW(hkeyFeatures, index, szKeyName, GUID_SIZE);
468 unsquash_guid(szKeyName, lpguid);
470 end:
472 if( hkeyFeatures )
473 RegCloseKey(hkeyFeatures);
474 if( hkey )
475 RegCloseKey(hkey);
477 return r;
480 UINT WINAPI MsiEnumFeaturesA(LPCSTR szProduct, DWORD index,
481 LPSTR szFeature, LPSTR szParent)
483 DWORD r;
484 WCHAR szwFeature[GUID_SIZE], szwParent[GUID_SIZE];
485 LPWSTR szwProduct = NULL;
487 TRACE("%s %ld %p %p\n",debugstr_a(szProduct),index,szFeature,szParent);
489 if( szProduct )
491 UINT len = MultiByteToWideChar( CP_ACP, 0, szProduct, -1, NULL, 0 );
492 szwProduct = HeapAlloc( GetProcessHeap(), 0, len * sizeof (WCHAR) );
493 if( szwProduct )
494 MultiByteToWideChar( CP_ACP, 0, szProduct, -1, szwProduct, len );
495 else
496 return ERROR_FUNCTION_FAILED;
499 r = MsiEnumFeaturesW(szwProduct, index, szwFeature, szwParent);
500 if( r == ERROR_SUCCESS )
502 WideCharToMultiByte(CP_ACP, 0, szwFeature, -1,
503 szFeature, GUID_SIZE, NULL, NULL);
504 WideCharToMultiByte(CP_ACP, 0, szwParent, -1,
505 szParent, GUID_SIZE, NULL, NULL);
508 if( szwProduct )
509 HeapFree( GetProcessHeap(), 0, szwProduct);
511 return r;
514 UINT WINAPI MsiEnumFeaturesW(LPCWSTR szProduct, DWORD index,
515 LPWSTR szFeature, LPWSTR szParent)
517 HKEY hkey = 0, hkeyFeatures = 0, hkeyProduct = 0;
518 DWORD r, sz;
519 WCHAR szRegName[GUID_SIZE];
521 TRACE("%s %ld %p %p\n",debugstr_w(szProduct),index,szFeature,szParent);
523 if( !squash_guid(szProduct, szRegName) )
524 return ERROR_INVALID_PARAMETER;
526 r = RegOpenKeyW(HKEY_LOCAL_MACHINE, szInstaller, &hkey);
527 if( r != ERROR_SUCCESS )
528 goto end;
530 r = RegOpenKeyW(hkey, szFeatures, &hkeyFeatures);
531 if( r != ERROR_SUCCESS )
532 goto end;
534 r = RegOpenKeyW(hkeyFeatures, szRegName, &hkeyProduct);
535 if( r != ERROR_SUCCESS )
536 goto end;
538 sz = GUID_SIZE;
539 r = RegEnumValueW(hkeyProduct, index, szFeature, &sz, NULL, NULL, NULL, NULL);
541 end:
542 if( hkeyProduct )
543 RegCloseKey(hkeyProduct);
544 if( hkeyFeatures )
545 RegCloseKey(hkeyFeatures);
546 if( hkey )
547 RegCloseKey(hkey);
549 return r;
552 UINT WINAPI MsiEnumComponentsA(DWORD index, LPSTR lpguid)
554 DWORD r;
555 WCHAR szwGuid[GUID_SIZE];
557 TRACE("%ld %p\n",index,lpguid);
559 r = MsiEnumComponentsW(index, szwGuid);
560 if( r == ERROR_SUCCESS )
561 WideCharToMultiByte(CP_ACP, 0, szwGuid, -1, lpguid, GUID_SIZE, NULL, NULL);
563 return r;
566 UINT WINAPI MsiEnumComponentsW(DWORD index, LPWSTR lpguid)
568 HKEY hkey = 0, hkeyComponents = 0;
569 DWORD r;
570 WCHAR szKeyName[33];
572 TRACE("%ld %p\n",index,lpguid);
574 r = RegOpenKeyW(HKEY_LOCAL_MACHINE, szInstaller, &hkey);
575 if( r != ERROR_SUCCESS )
576 goto end;
578 r = RegOpenKeyW(hkey, szComponents, &hkeyComponents);
579 if( r != ERROR_SUCCESS )
580 goto end;
582 r = RegEnumKeyW(hkeyComponents, index, szKeyName, GUID_SIZE);
584 unsquash_guid(szKeyName, lpguid);
586 end:
588 if( hkeyComponents )
589 RegCloseKey(hkeyComponents);
590 if( hkey )
591 RegCloseKey(hkey);
593 return r;
596 UINT WINAPI MsiEnumClientsA(LPCSTR szComponent, DWORD index, LPSTR szProduct)
598 DWORD r;
599 WCHAR szwProduct[GUID_SIZE];
600 LPWSTR szwComponent = NULL;
602 TRACE("%s %ld %p\n",debugstr_a(szComponent),index,szProduct);
604 if( szComponent )
606 UINT len = MultiByteToWideChar( CP_ACP, 0, szComponent, -1, NULL, 0 );
607 szwComponent = HeapAlloc( GetProcessHeap(), 0, len * sizeof (WCHAR) );
608 if( szwComponent )
609 MultiByteToWideChar( CP_ACP, 0, szComponent, -1, szwComponent, len );
610 else
611 return ERROR_FUNCTION_FAILED;
614 r = MsiEnumClientsW(szComponent?szwComponent:NULL, index, szwProduct);
615 if( r == ERROR_SUCCESS )
617 WideCharToMultiByte(CP_ACP, 0, szwProduct, -1,
618 szProduct, GUID_SIZE, NULL, NULL);
621 if( szwComponent )
622 HeapFree( GetProcessHeap(), 0, szwComponent);
624 return r;
627 UINT WINAPI MsiEnumClientsW(LPCWSTR szComponent, DWORD index, LPWSTR szProduct)
629 HKEY hkey = 0, hkeyComponents = 0, hkeyComp = 0;
630 DWORD r, sz;
631 WCHAR szRegName[GUID_SIZE], szValName[GUID_SIZE];
633 TRACE("%s %ld %p\n",debugstr_w(szComponent),index,szProduct);
635 if( !squash_guid(szComponent, szRegName) )
636 return ERROR_INVALID_PARAMETER;
638 r = RegOpenKeyW(HKEY_LOCAL_MACHINE, szInstaller, &hkey);
639 if( r != ERROR_SUCCESS )
640 goto end;
642 r = RegOpenKeyW(hkey, szComponents, &hkeyComponents);
643 if( r != ERROR_SUCCESS )
644 goto end;
646 r = RegOpenKeyW(hkeyComponents, szRegName, &hkeyComp);
647 if( r != ERROR_SUCCESS )
648 goto end;
650 sz = GUID_SIZE;
651 r = RegEnumValueW(hkeyComp, index, szValName, &sz, NULL, NULL, NULL, NULL);
652 if( r != ERROR_SUCCESS )
653 goto end;
655 unsquash_guid(szValName, szProduct);
657 end:
658 if( hkeyComp )
659 RegCloseKey(hkeyComp);
660 if( hkeyComponents )
661 RegCloseKey(hkeyComponents);
662 if( hkey )
663 RegCloseKey(hkey);
665 return r;
668 UINT WINAPI MsiEnumComponentQualifiersA(
669 LPSTR szComponent, DWORD iIndex, LPSTR lpQualifierBuf, DWORD* pcchQualifierBuf, LPSTR lpApplicationDataBuf, DWORD* pcchApplicationDataBuf)
671 FIXME("%s 0x%08lx %p %p %p %p\n", debugstr_a(szComponent), iIndex, lpQualifierBuf, pcchQualifierBuf, lpApplicationDataBuf, pcchApplicationDataBuf);
672 return ERROR_CALL_NOT_IMPLEMENTED;
675 UINT WINAPI MsiEnumComponentQualifiersW(
676 LPWSTR szComponent, DWORD iIndex, LPWSTR lpQualifierBuf, DWORD* pcchQualifierBuf, LPWSTR lpApplicationDataBuf, DWORD* pcchApplicationDataBuf)
678 FIXME("%s 0x%08lx %p %p %p %p\n", debugstr_w(szComponent), iIndex, lpQualifierBuf, pcchQualifierBuf, lpApplicationDataBuf, pcchApplicationDataBuf);
679 return ERROR_CALL_NOT_IMPLEMENTED;
682 UINT WINAPI MsiProvideAssemblyA(
683 LPCSTR szAssemblyName, LPCSTR szAppContext, DWORD dwInstallMode, DWORD dwAssemblyInfo, LPSTR lpPathBuf, DWORD* pcchPathBuf)
685 FIXME("%s %s 0x%08lx 0x%08lx %p %p\n",
686 debugstr_a(szAssemblyName), debugstr_a(szAppContext), dwInstallMode, dwAssemblyInfo, lpPathBuf, pcchPathBuf);
687 return ERROR_CALL_NOT_IMPLEMENTED;
690 UINT WINAPI MsiProvideAssemblyW(
691 LPCWSTR szAssemblyName, LPCWSTR szAppContext, DWORD dwInstallMode, DWORD dwAssemblyInfo, LPWSTR lpPathBuf, DWORD* pcchPathBuf)
693 FIXME("%s %s 0x%08lx 0x%08lx %p %p\n",
694 debugstr_w(szAssemblyName), debugstr_w(szAppContext), dwInstallMode, dwAssemblyInfo, lpPathBuf, pcchPathBuf);
695 return ERROR_CALL_NOT_IMPLEMENTED;
698 UINT WINAPI MsiProvideComponentFromDescriptorA( LPCSTR szDescriptor, LPSTR szPath, DWORD *pcchPath, DWORD *pcchArgs )
700 FIXME("%s %p %p %p\n", debugstr_a(szDescriptor), szPath, pcchPath, pcchArgs );
701 return ERROR_CALL_NOT_IMPLEMENTED;
704 UINT WINAPI MsiProvideComponentFromDescriptorW( LPCWSTR szDescriptor, LPWSTR szPath, DWORD *pcchPath, DWORD *pcchArgs )
706 FIXME("%s %p %p %p\n", debugstr_w(szDescriptor), szPath, pcchPath, pcchArgs );
707 return ERROR_CALL_NOT_IMPLEMENTED;
710 HRESULT WINAPI MsiGetFileSignatureInformationA(
711 LPCSTR szSignedObjectPath, DWORD dwFlags, PCCERT_CONTEXT* ppcCertContext, BYTE* pbHashData, DWORD* pcbHashData)
713 FIXME("%s 0x%08lx %p %p %p\n", debugstr_a(szSignedObjectPath), dwFlags, ppcCertContext, pbHashData, pcbHashData);
714 return ERROR_CALL_NOT_IMPLEMENTED;
717 HRESULT WINAPI MsiGetFileSignatureInformationW(
718 LPCWSTR szSignedObjectPath, DWORD dwFlags, PCCERT_CONTEXT* ppcCertContext, BYTE* pbHashData, DWORD* pcbHashData)
720 FIXME("%s 0x%08lx %p %p %p\n", debugstr_w(szSignedObjectPath), dwFlags, ppcCertContext, pbHashData, pcbHashData);
721 return ERROR_CALL_NOT_IMPLEMENTED;
724 HRESULT WINAPI MSI_DllGetVersion(DLLVERSIONINFO *pdvi)
726 TRACE("%p\n",pdvi);
728 if (pdvi->cbSize != sizeof(DLLVERSIONINFO))
729 return E_INVALIDARG;
731 pdvi->dwMajorVersion = MSI_MAJORVERSION;
732 pdvi->dwMinorVersion = MSI_MINORVERSION;
733 pdvi->dwBuildNumber = MSI_BUILDNUMBER;
734 pdvi->dwPlatformID = 1;
736 return S_OK;
739 BOOL WINAPI MSI_DllCanUnloadNow(void)
741 return FALSE;