msi: return ERROR_MORE_DATA when needed

Aric Stewart aric at codeweavers.com
Mon Sep 5 14:03:34 CDT 2005


check the length of the buffer when returning strings so that if the 
buffer is not large enough return ERROR_MORE_DATA instead of ERROR_SUCCESS
-------------- next part --------------
Index: dlls/msi/suminfo.c
===================================================================
RCS file: /home/wine/wine/dlls/msi/suminfo.c,v
retrieving revision 1.19
diff -u -r1.19 suminfo.c
--- dlls/msi/suminfo.c	6 Jul 2005 10:33:30 -0000	1.19
+++ dlls/msi/suminfo.c	5 Sep 2005 19:03:17 -0000
@@ -544,6 +544,7 @@
 {
     MSISUMMARYINFO *si;
     PROPVARIANT *prop;
+    UINT rc = ERROR_SUCCESS;
 
     TRACE("%ld %d %p %p %p %p %p\n", handle, uiProperty, puiDataType,
           piValue, pftValue, str, pcchValueBuf);
@@ -583,6 +584,12 @@
                 if( str->str.a )
                     lstrcpynA(str->str.a, prop->u.pszVal, *pcchValueBuf );
             }
+
+            if (len > *pcchValueBuf)
+                rc = ERROR_MORE_DATA;
+            else
+                rc = ERROR_SUCCESS;
+
             *pcchValueBuf = len;
         }
         break;
@@ -597,7 +604,7 @@
         break;
     }
     msiobj_release( &si->hdr );
-    return ERROR_SUCCESS;
+    return rc;
 }
 
 UINT WINAPI MsiSummaryInfoGetPropertyA(


More information about the wine-patches mailing list