ExpandEnvironmentStrings returns the number of TCHARs, not bytes
Modified: trunk/reactos/subsys/system/services/config.c

Modified: trunk/reactos/subsys/system/services/config.c
--- trunk/reactos/subsys/system/services/config.c	2005-12-30 22:02:59 UTC (rev 20470)
+++ trunk/reactos/subsys/system/services/config.c	2005-12-30 23:42:04 UTC (rev 20471)
@@ -269,7 +269,7 @@
             dwError = GetLastError();
             goto done;
         }
-        expanded = HeapAlloc(GetProcessHeap(), 0, dwSizeNeeded);
+        expanded = HeapAlloc(GetProcessHeap(), 0, dwSizeNeeded * sizeof(WCHAR));
         if (dwSizeNeeded < ExpandEnvironmentStringsW((LPCWSTR)ptr, expanded, dwSizeNeeded))
         {
             dwError = GetLastError();