mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-05 20:19:29 +00:00
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 (!(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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue