It seems to be GetModuleFileName16 that checks exe version on whether
to return long or short paths, not GetModuleFileNameA.
diff --git a/loader/module.c b/loader/module.c
index 53ea615..bac3f6a 100644
--- a/loader/module.c
+++ b/loader/module.c
@@ -1296,6 +1296,11 @@
/***********************************************************************
* GetModuleFileNameA (KERNEL32.235)
+ *
+ * GetModuleFileNameA seems to *always* return the long path;
+ * it's only GetModuleFileName16 that decides between short/long path
+ * by checking if exe version >= 4.0.
+ * (SDK docu doesn't mention this)
*/
DWORD WINAPI GetModuleFileNameA(
HMODULE hModule, /* [in] module handle (32bit) */
@@ -1307,10 +1312,7 @@
if (!wm) /* can happen on start up or the like */
return 0;
- if (PE_HEADER(wm->module)->OptionalHeader.MajorOperatingSystemVersion >= 4.0)
- lstrcpynA( lpFileName, wm->filename, size );
- else
- lstrcpynA( lpFileName, wm->short_filename, size );
+ lstrcpynA( lpFileName, wm->filename, size );
TRACE("%s\n", lpFileName );
return strlen(lpFileName);