Commit d235b137 authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexandre Julliard

GetModuleFileName32A() returns long filename if app sets osversion >=

4.0. Also moved the long filename hackery to GetLongPathName32A() so it can be used by win32 programs.
parent c1190fe2
...@@ -256,7 +256,7 @@ HMODULE32 MODULE_FindModule32( ...@@ -256,7 +256,7 @@ HMODULE32 MODULE_FindModule32(
LPSTR xlname,xdotptr; LPSTR xlname,xdotptr;
assert (wm->longname); assert (wm->longname);
xlname = strrchr(wm->longname,'/'); xlname = strrchr(wm->longname,'\\');
if (!xlname) if (!xlname)
xlname = wm->longname; xlname = wm->longname;
else else
...@@ -636,21 +636,14 @@ DWORD WINAPI GetModuleFileName32A( ...@@ -636,21 +636,14 @@ DWORD WINAPI GetModuleFileName32A(
DWORD size /* [in] size of filenamebuffer */ DWORD size /* [in] size of filenamebuffer */
) { ) {
WINE_MODREF *wm = MODULE32_LookupHMODULE(PROCESS_Current(),hModule); WINE_MODREF *wm = MODULE32_LookupHMODULE(PROCESS_Current(),hModule);
char *p;
if (!wm) /* can happen on start up or the like */ if (!wm) /* can happen on start up or the like */
return 0; return 0;
/* FIXME: we should probably get a real long name, but wm->longname if (PE_HEADER(wm->module)->OptionalHeader.MajorOperatingSystemVersion >= 4.0)
* is currently a UNIX filename! lstrcpyn32A( lpFileName, wm->longname, size );
* Use the module name to at least get the long version of the filename. else
*/ lstrcpyn32A( lpFileName, wm->shortname, size );
lstrcpyn32A( lpFileName, wm->shortname, size );
if ( (p = strrchr( lpFileName, '\\' )) ) {
p++;
size -= (p-lpFileName);
lstrcpyn32A( p, wm->modname, size);
}
TRACE(module, "%s\n", lpFileName ); TRACE(module, "%s\n", lpFileName );
return strlen(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