Blank the property buffers even if the property is not found.
authorAric Stewart <aric@codeweavers.com>
Wed, 22 Dec 2004 18:47:54 +0000 (18:47 +0000)
committerAlexandre Julliard <julliard@winehq.org>
Wed, 22 Dec 2004 18:47:54 +0000 (18:47 +0000)
dlls/msi/package.c

index 0ea4b66acf5b24e0f1888ad4eb8422ce3df478eb..c6ecb4a1d5b9b8a8a15ece73c4f98f1a418cbdd3 100644 (file)
@@ -768,6 +768,10 @@ UINT MSI_GetPropertyW(MSIPACKAGE *package, LPCWSTR szName,
     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);
@@ -796,6 +800,9 @@ UINT MSI_GetPropertyA(MSIPACKAGE *package, LPCSTR szName,
     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 @@ UINT MSI_GetPropertyA(MSIPACKAGE *package, LPCSTR szName,
     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;