[KERNEL32]
authorThomas Faber <thomas.faber@reactos.org>
Sun, 20 May 2012 14:06:09 +0000 (14:06 +0000)
committerThomas Faber <thomas.faber@reactos.org>
Sun, 20 May 2012 14:06:09 +0000 (14:06 +0000)
- Swap GetFullPathName success/failure cases in BasePushProcessParameters. Fixes kernel32:GetModuleFileName test.
See issue #6786 for more details.

svn path=/trunk/; revision=56643

reactos/dll/win32/kernel32/client/path.c
reactos/dll/win32/kernel32/client/proc.c

index c22dcd8..48224db 100644 (file)
@@ -307,7 +307,7 @@ BasepComputeProcessPath(IN PBASE_SEARCH_PATH_TYPE PathOrder,
             }
             break;
 
             }
             break;
 
-        /* Add the current applicaiton path */
+        /* Add the current application path */
         case BaseSearchPathApp:
             if ((AppName) && (AppNameEnd))
             {
         case BaseSearchPathApp:
             if ((AppName) && (AppNameEnd))
             {
index 5ef7edd..3975f81 100644 (file)
@@ -778,8 +778,7 @@ BasePushProcessParameters(IN ULONG ParameterFlags,
     if ((Size) && (Size <= (MAX_PATH + 4)))
     {
         /* Get the DLL Path */
     if ((Size) && (Size <= (MAX_PATH + 4)))
     {
         /* Get the DLL Path */
-        DllPathString = BaseComputeProcessDllPath((LPWSTR)ApplicationPathName,
-                                                  lpEnvironment);
+        DllPathString = BaseComputeProcessDllPath(FullPath, lpEnvironment);
         if (!DllPathString)
         {
             /* Fail */
         if (!DllPathString)
         {
             /* Fail */
@@ -789,12 +788,13 @@ BasePushProcessParameters(IN ULONG ParameterFlags,
 
         /* Initialize Strings */
         RtlInitUnicodeString(&DllPath, DllPathString);
 
         /* Initialize Strings */
         RtlInitUnicodeString(&DllPath, DllPathString);
-        RtlInitUnicodeString(&ImageName, ApplicationPathName);
+        RtlInitUnicodeString(&ImageName, FullPath);
     }
     else
     {
     }
     else
     {
-        /* Get the DLL Path */
-        DllPathString = BaseComputeProcessDllPath(FullPath, lpEnvironment);
+        /* Couldn't get the path name. Just take the original path */
+        DllPathString = BaseComputeProcessDllPath((LPWSTR)ApplicationPathName,
+                                                  lpEnvironment);
         if (!DllPathString)
         {
             /* Fail */
         if (!DllPathString)
         {
             /* Fail */
@@ -804,7 +804,7 @@ BasePushProcessParameters(IN ULONG ParameterFlags,
 
         /* Initialize Strings */
         RtlInitUnicodeString(&DllPath, DllPathString);
 
         /* Initialize Strings */
         RtlInitUnicodeString(&DllPath, DllPathString);
-        RtlInitUnicodeString(&ImageName, FullPath);
+        RtlInitUnicodeString(&ImageName, ApplicationPathName);
     }
 
     /* Initialize Strings */
     }
 
     /* Initialize Strings */
@@ -1656,7 +1656,7 @@ GetStartupInfoA(IN LPSTARTUPINFOA lpStartupInfo)
                         /* Someone beat us to it, use their data instead */
                         StartupInfo = BaseAnsiStartupInfo;
                         Status = STATUS_SUCCESS;
                         /* 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);
                     }
                         /* We're going to free our own stuff, but not raise */
                         RtlFreeAnsiString(&TitleString);
                     }