Make sure GetModuleFileName16 does not return garbage even if the path
is not valid (thanks to Andreas Mohr).
This commit is contained in:
parent
2850b6628e
commit
13c965cc9f
|
@ -1329,10 +1329,9 @@ INT16 WINAPI GetModuleFileName16( HINSTANCE16 hModule, LPSTR lpFileName,
|
||||||
if (!hModule) hModule = GetCurrentTask();
|
if (!hModule) hModule = GetCurrentTask();
|
||||||
|
|
||||||
if (!(pModule = NE_GetPtr( hModule ))) return 0;
|
if (!(pModule = NE_GetPtr( hModule ))) return 0;
|
||||||
|
lstrcpynA( lpFileName, NE_MODULE_NAME(pModule), nSize );
|
||||||
if (pModule->expected_version >= 0x400)
|
if (pModule->expected_version >= 0x400)
|
||||||
GetLongPathNameA(NE_MODULE_NAME(pModule), lpFileName, nSize);
|
GetLongPathNameA(NE_MODULE_NAME(pModule), lpFileName, nSize);
|
||||||
else
|
|
||||||
lstrcpynA( lpFileName, NE_MODULE_NAME(pModule), nSize );
|
|
||||||
TRACE("%s\n", lpFileName );
|
TRACE("%s\n", lpFileName );
|
||||||
return strlen(lpFileName);
|
return strlen(lpFileName);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue