msi: fix bad code
Aric Stewart
aric at codeweavers.com
Fri Feb 18 07:01:02 CST 2005
I had alot of problems with my code for finding the PackageCode. This
fixes them.
-------------- next part --------------
Index: dlls/msi/action.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/action.c,v
retrieving revision 1.87
diff -u -u -r1.87 action.c
--- dlls/msi/action.c 14 Feb 2005 11:07:55 -0000 1.87
+++ dlls/msi/action.c 18 Feb 2005 12:58:36 -0000
@@ -4738,13 +4738,14 @@
HeapFree(GetProcessHeap(),0,buffer);
FIXME("Need to write more keys to the user registry\n");
- hDb= msiobj_findhandle( &package->db->hdr );
+ hDb= alloc_msihandle( &package->db->hdr );
rc = MsiGetSummaryInformationW(hDb, NULL, 0, &hSumInfo);
+ MsiCloseHandle(hDb);
if (rc == ERROR_SUCCESS)
{
WCHAR guidbuffer[0x200];
size = 0x200;
- rc = MsiSummaryInfoGetPropertyW(hSumInfo, 8, NULL, NULL, NULL,
+ rc = MsiSummaryInfoGetPropertyW(hSumInfo, 9, NULL, NULL, NULL,
guidbuffer, &size);
if (rc == ERROR_SUCCESS)
{
@@ -4753,10 +4754,9 @@
LPWSTR ptr = strchrW(guidbuffer,';');
if (ptr) *ptr = 0;
squash_guid(guidbuffer,squashed);
- size = strlenW(guidbuffer)*sizeof(WCHAR);
- RegSetValueExW(hukey,szPackageCode,0,REG_SZ, (LPSTR)guidbuffer,
+ size = strlenW(squashed)*sizeof(WCHAR);
+ RegSetValueExW(hukey,szPackageCode,0,REG_SZ, (LPSTR)squashed,
size);
-
}
else
{
More information about the wine-patches
mailing list