From 25b7228274902fef682df818f70a5f675952d0ea Mon Sep 17 00:00:00 2001 From: Hans Leidekker Date: Fri, 30 Mar 2012 17:54:30 +0200 Subject: [PATCH] msi: Reimplement MsiEnumComponents on top of MsiEnumComponentsEx. --- dlls/msi/registry.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/dlls/msi/registry.c b/dlls/msi/registry.c index bc67ab2e40f..31e7b4fee1f 100644 --- a/dlls/msi/registry.c +++ b/dlls/msi/registry.c @@ -1205,7 +1205,9 @@ UINT WINAPI MsiEnumComponentsA(DWORD index, LPSTR lpguid) DWORD r; WCHAR szwGuid[GUID_SIZE]; - TRACE("%d %p\n", index, lpguid); + TRACE("%u, %p\n", index, lpguid); + + if (!lpguid) return ERROR_INVALID_PARAMETER; r = MsiEnumComponentsW(index, szwGuid); if( r == ERROR_SUCCESS ) @@ -1216,23 +1218,11 @@ UINT WINAPI MsiEnumComponentsA(DWORD index, LPSTR lpguid) UINT WINAPI MsiEnumComponentsW(DWORD index, LPWSTR lpguid) { - HKEY hkey; - REGSAM access = KEY_WOW64_64KEY | KEY_ALL_ACCESS; - WCHAR szKeyName[SQUISH_GUID_SIZE]; - DWORD r; - - TRACE("%d %p\n", index, lpguid); + TRACE("%u, %p\n", index, lpguid); - r = RegCreateKeyExW(HKEY_LOCAL_MACHINE, szInstaller_Components, 0, NULL, 0, access, NULL, &hkey, NULL); - if( r != ERROR_SUCCESS ) - return ERROR_NO_MORE_ITEMS; + if (!lpguid) return ERROR_INVALID_PARAMETER; - r = RegEnumKeyW(hkey, index, szKeyName, SQUISH_GUID_SIZE); - if( r == ERROR_SUCCESS ) - unsquash_guid(szKeyName, lpguid); - - RegCloseKey(hkey); - return r; + return MsiEnumComponentsExW( szAllSid, MSIINSTALLCONTEXT_ALL, index, lpguid, NULL, NULL, NULL ); } UINT WINAPI MsiEnumComponentsExA( LPCSTR user_sid, DWORD ctx, DWORD index, CHAR guid[39], -- 2.11.4.GIT