MSI: blanks the property buffers even if the property is not found

Mike McCormack mike at codeweavers.com
Wed Dec 22 03:57:44 CST 2004


ChangeLog:
<aric at codeweavers.com>
* blanks the property buffers even if the property is not found
-------------- next part --------------
diff -ur dlls/msi.old/package.c dlls/msi/package.c
--- dlls/msi.old/package.c	2004-12-22 18:45:34.000000000 +0900
+++ dlls/msi/package.c	2004-12-22 18:56:48.000000000 +0900
@@ -768,6 +768,10 @@
     UINT rc;
 
     rc = MSI_GetPropertyRow(package, szName, &row);
+
+    if (*pchValueBuf > 0)
+        szValueBuf[0] = 0;
+
     if (rc == ERROR_SUCCESS)
     {
         rc = MSI_RecordGetStringW(row,1,szValueBuf,pchValueBuf);
@@ -778,7 +782,7 @@
         TRACE("returning %s for property %s\n", debugstr_w(szValueBuf),
             debugstr_w(szName));
     else if (rc == ERROR_MORE_DATA)
-        TRACE("need %i sized buffer for %s\n", *pchValueBuf,
+        TRACE("need %ld sized buffer for %s\n", *pchValueBuf,
             debugstr_w(szName));
     else
     {
@@ -796,6 +800,9 @@
     UINT rc, len;
     LPWSTR szwName;
 
+    if (*pchValueBuf > 0)
+        szValueBuf[0] = 0;
+    
     len = MultiByteToWideChar( CP_ACP, 0, szName, -1, NULL, 0 );
     szwName = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
     if (!szwName)
@@ -812,6 +819,9 @@
     if (rc == ERROR_SUCCESS)
         TRACE("returning %s for property %s\n", debugstr_a(szValueBuf),
             debugstr_a(szName));
+    else if (rc == ERROR_MORE_DATA)
+        TRACE("need %ld sized buffer for %s\n", *pchValueBuf,
+            debugstr_a(szName));
     else
     {
         *pchValueBuf = 0;


More information about the wine-patches mailing list