From 9f1b81977be6d9da65a8545d9a0193a561f18db9 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Thu, 15 Jul 2004 19:00:35 +0000 Subject: [PATCH] Don't get system directory from the environment, use GetSystemDirectory instead. --- dlls/win32s/w32skernel.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/dlls/win32s/w32skernel.c b/dlls/win32s/w32skernel.c index 13fe443e894..4bdc411b88d 100644 --- a/dlls/win32s/w32skernel.c +++ b/dlls/win32s/w32skernel.c @@ -32,14 +32,12 @@ */ LPSTR WINAPI GetWin32sDirectory(void) { - static char sysdir[0x80]; - LPSTR text; + static const char win32s[] = "\\win32s"; - GetEnvironmentVariableA("winsysdir", sysdir, 0x80); - if (!sysdir) return NULL; - strcat(sysdir, "\\WIN32S"); - text = HeapAlloc(GetProcessHeap(), 0, strlen(sysdir)+1); - strcpy(text, sysdir); + int len = GetSystemDirectoryA( NULL, 0 ); + LPSTR text = HeapAlloc( GetProcessHeap(), 0, len + sizeof(win32s) - 1 ); + GetSystemDirectoryA( text, len ); + strcat( text, win32s ); return text; } @@ -60,4 +58,3 @@ HTASK16 WINAPI GetCurrentTask32(void) { return NtCurrentTeb()->htask16; } - -- 2.11.4.GIT