Small fix for GetCurrentDirectoryA()

Felix Nawothnig felix.nawothnig at t-online.de
Fri Jun 10 00:26:33 CDT 2005


This makes Yoda Stories (which is shipped with a broken wavmix32.dll) 
run out of the box.

ChangeLog:
When emulating Win9x return ERROR_INVALID_PARAMETER if a bad buffer is 
passed to GetCurrentDirectoryA().
-------------- next part --------------
Index: path.c
===================================================================
RCS file: /home/wine/wine/dlls/kernel/path.c,v
retrieving revision 1.19
diff -u -p -r1.19 path.c
--- path.c	1 Mar 2005 10:42:22 -0000	1.19
+++ path.c	10 Jun 2005 05:18:40 -0000
@@ -1313,6 +1313,10 @@ UINT WINAPI GetCurrentDirectoryA( UINT b
     WCHAR bufferW[MAX_PATH];
     DWORD ret;
 
+    /* WaveMix v1.72 depends on this. */
+    if ((GetVersion() & 0x80000000) && IsBadWritePtr(buf, buflen))
+        return ERROR_INVALID_PARAMETER;       
+
     ret = GetCurrentDirectoryW(MAX_PATH, bufferW);
 
     if (!ret) return 0;


More information about the wine-patches mailing list