Fix Win10's GetUserProfileDirectory() problem in stable-2.0 branch. stable-2.0
authorRyan C. Gordon <icculus@icculus.org>
Wed, 03 Oct 2018 22:44:29 -0400
branchstable-2.0
changeset 1647 ea88839fe34f
parent 1389 090cb9c74b87
Fix Win10's GetUserProfileDirectory() problem in stable-2.0 branch.
platform/windows.c
--- a/platform/windows.c	Fri Feb 17 20:48:02 2017 -0500
+++ b/platform/windows.c	Wed Oct 03 22:44:29 2018 -0400
@@ -451,7 +451,6 @@
         if (OpenProcessToken(processHandle, TOKEN_QUERY, &accessToken))
         {
             DWORD psize = 0;
-            WCHAR dummy = 0;
             LPWSTR wstr = NULL;
             BOOL rc = 0;
 
@@ -460,7 +459,7 @@
              *  psize. Also note that the second parameter can't be
              *  NULL or the function fails.
              */	
-    		rc = pGetUserProfileDirectoryW(accessToken, &dummy, &psize);
+    		rc = pGetUserProfileDirectoryW(accessToken, NULL, &psize);
             assert(!rc);  /* !!! FIXME: handle this gracefully. */
             (void)rc;