Author: dchapyshev
Date: Sat Apr 18 18:11:31 2009
New Revision: 40575

URL: http://svn.reactos.org/svn/reactos?rev=40575&view=rev
Log:
- Re-simplify CreateProcessW (like r40484)

Modified:
    trunk/reactos/dll/win32/kernel32/process/procsup.c

Modified: trunk/reactos/dll/win32/kernel32/process/procsup.c
URL: 
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/process/procsup.c?rev=40575&r1=40574&r2=40575&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/process/procsup.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/process/procsup.c [iso-8859-1] Sat Apr 18 
18:11:31 2009
@@ -720,34 +720,12 @@
 
     if (lpCurrentDirectory)
     {
-        LPWSTR FilePart, Buffer = NULL;
-
-        Buffer = RtlAllocateHeap(RtlGetProcessHeap(),
-                                 0,
-                                 (MAX_PATH + 1) * sizeof(WCHAR));
-
-        if (!Buffer)
-        {
-            SetLastErrorByStatus(STATUS_NO_MEMORY);
-            return FALSE;
-        }
-
-        if (GetFullPathNameW(lpCurrentDirectory, MAX_PATH, Buffer, &FilePart) 
> MAX_PATH)
-        {
-            RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer);
+        if ((GetFileAttributesW(lpCurrentDirectory) == 
INVALID_FILE_ATTRIBUTES) ||
+            !(GetFileAttributesW(lpCurrentDirectory) & 
FILE_ATTRIBUTE_DIRECTORY))
+        {
             SetLastError(ERROR_DIRECTORY);
             return FALSE;
         }
-
-        if ((GetFileAttributesW(Buffer) == INVALID_FILE_ATTRIBUTES) ||
-            !(GetFileAttributesW(Buffer) & FILE_ATTRIBUTE_DIRECTORY))
-        {
-            RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer);
-            SetLastError(ERROR_DIRECTORY);
-            return FALSE;
-        }
-
-        RtlFreeHeap(RtlGetProcessHeap(), 0, Buffer);
     }
 
     /*

Reply via email to