Commit 13c965cc authored by Alexandre Julliard's avatar Alexandre Julliard

Make sure GetModuleFileName16 does not return garbage even if the path

is not valid (thanks to Andreas Mohr).
parent 2850b662
......@@ -1329,10 +1329,9 @@ INT16 WINAPI GetModuleFileName16( HINSTANCE16 hModule, LPSTR lpFileName,
if (!hModule) hModule = GetCurrentTask();
if (!(pModule = NE_GetPtr( hModule ))) return 0;
lstrcpynA( lpFileName, NE_MODULE_NAME(pModule), nSize );
if (pModule->expected_version >= 0x400)
GetLongPathNameA(NE_MODULE_NAME(pModule), lpFileName, nSize);
else
lstrcpynA( lpFileName, NE_MODULE_NAME(pModule), nSize );
TRACE("%s\n", lpFileName );
return strlen(lpFileName);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment