Author: aandrejevic
Date: Wed May 6 21:56:15 2015
New Revision: 67580
URL:
http://svn.reactos.org/svn/reactos?rev=67580&view=rev
Log:
[NTVDM]
Try to find the shortened full path in DosLoadExecutable, and use that whenever
possible.
Modified:
trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c
Modified: trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/mvdm/ntvdm/dos/…
==============================================================================
--- trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/mvdm/ntvdm/dos/dos32krnl/process.c [iso-8859-1] Wed May 6
21:56:15 2015
@@ -255,6 +255,8 @@
WORD LoadSegment;
WORD MaxAllocSize;
DWORD i, FileSize;
+ CHAR FullPath[MAX_PATH];
+ CHAR ShortFullPath[MAX_PATH];
/* Buffer for command line conversion: 1 byte for size; 127 bytes for contents */
CHAR CmdLineBuffer[1 + DOS_CMDLINE_LENGTH];
@@ -264,6 +266,17 @@
ExecutablePath,
Parameters,
ReturnAddress);
+
+ /* Try to get the full path to the executable */
+ if (GetFullPathNameA(ExecutablePath, sizeof(FullPath), FullPath, NULL))
+ {
+ /* Try to shorten the full path */
+ if (GetShortPathNameA(FullPath, ShortFullPath, sizeof(ShortFullPath)))
+ {
+ /* Use the shortened full path from now on */
+ ExecutablePath = ShortFullPath;
+ }
+ }
/* Open a handle to the executable */
FileHandle = CreateFileA(ExecutablePath,