Fix incorrect use of bytes needed parameter in QueryServiceConfigW

yaworsky at migusoft.ru yaworsky at migusoft.ru
Wed Mar 9 21:03:00 CST 2005


Hello,

QueryServiceConfigA should be fixed too

ChangeLog:
 Correct incorrect use of arguments to QueryServiceConfigA.
 Spotted by Troy Rollo.

Index: dlls/advapi32/service.c
===================================================================
RCS file: /home/wine/wine/dlls/advapi32/service.c,v
retrieving revision 1.85
diff -u -r1.85 service.c
--- dlls/advapi32/service.c	4 Mar 2005 12:32:50 -0000	1.85
+++ dlls/advapi32/service.c	5 Mar 2005 06:55:28 -0000
@@ -1655,15 +1655,15 @@
     if( ( r == ERROR_SUCCESS ) && ( type == REG_SZ ) )
         total += sz;
 
+    *pcbBytesNeeded = total;
+
     /* if there's not enough memory, return an error */
-    if( total > *pcbBytesNeeded )
+    if( total > cbBufSize )
     {
-        *pcbBytesNeeded = total;
         SetLastError( ERROR_INSUFFICIENT_BUFFER );
         return FALSE;
     }
 
-    *pcbBytesNeeded = total;
     ZeroMemory( lpServiceConfig, total );
 
     sz = sizeof val;



More information about the wine-patches mailing list