[ros-diffs] [tfaber] 56643: [KERNEL32] - Swap GetFullPathName success/failure cases in BasePushProcessParameters. Fixes kernel32:GetModuleFileName test. See issue #6786 for more details.

tfaber at svn.reactos.org tfaber at svn.reactos.org
Sun May 20 14:06:10 UTC 2012


Author: tfaber
Date: Sun May 20 14:06:09 2012
New Revision: 56643

URL: http://svn.reactos.org/svn/reactos?rev=56643&view=rev
Log:
[KERNEL32]
- Swap GetFullPathName success/failure cases in BasePushProcessParameters. Fixes kernel32:GetModuleFileName test.
See issue #6786 for more details.

Modified:
    trunk/reactos/dll/win32/kernel32/client/path.c
    trunk/reactos/dll/win32/kernel32/client/proc.c

Modified: trunk/reactos/dll/win32/kernel32/client/path.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/path.c?rev=56643&r1=56642&r2=56643&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/path.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/path.c [iso-8859-1] Sun May 20 14:06:09 2012
@@ -307,7 +307,7 @@
             }
             break;
 
-        /* Add the current applicaiton path */
+        /* Add the current application path */
         case BaseSearchPathApp:
             if ((AppName) && (AppNameEnd))
             {

Modified: trunk/reactos/dll/win32/kernel32/client/proc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/kernel32/client/proc.c?rev=56643&r1=56642&r2=56643&view=diff
==============================================================================
--- trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/kernel32/client/proc.c [iso-8859-1] Sun May 20 14:06:09 2012
@@ -778,6 +778,21 @@
     if ((Size) && (Size <= (MAX_PATH + 4)))
     {
         /* Get the DLL Path */
+        DllPathString = BaseComputeProcessDllPath(FullPath, lpEnvironment);
+        if (!DllPathString)
+        {
+            /* Fail */
+            SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+            return FALSE;
+        }
+
+        /* Initialize Strings */
+        RtlInitUnicodeString(&DllPath, DllPathString);
+        RtlInitUnicodeString(&ImageName, FullPath);
+    }
+    else
+    {
+        /* Couldn't get the path name. Just take the original path */
         DllPathString = BaseComputeProcessDllPath((LPWSTR)ApplicationPathName,
                                                   lpEnvironment);
         if (!DllPathString)
@@ -790,21 +805,6 @@
         /* Initialize Strings */
         RtlInitUnicodeString(&DllPath, DllPathString);
         RtlInitUnicodeString(&ImageName, ApplicationPathName);
-    }
-    else
-    {
-        /* Get the DLL Path */
-        DllPathString = BaseComputeProcessDllPath(FullPath, lpEnvironment);
-        if (!DllPathString)
-        {
-            /* Fail */
-            SetLastError(ERROR_NOT_ENOUGH_MEMORY);
-            return FALSE;
-        }
-
-        /* Initialize Strings */
-        RtlInitUnicodeString(&DllPath, DllPathString);
-        RtlInitUnicodeString(&ImageName, FullPath);
     }
 
     /* Initialize Strings */
@@ -1656,7 +1656,7 @@
                         /* Someone beat us to it, use their data instead */
                         StartupInfo = BaseAnsiStartupInfo;
                         Status = STATUS_SUCCESS;
-                        
+
                         /* We're going to free our own stuff, but not raise */
                         RtlFreeAnsiString(&TitleString);
                     }




More information about the Ros-diffs mailing list