Win32 Perl has always had GetModulePathName()
At least my cursory grep didn't find that function in the perl source
Sorry, my transcription error (s/Path/File/):
perllib.c:171: GetModuleFileName(NULL, szModuleName, sizeof(szModul
win32.c:135: GetModuleFileName((HMODULE)((w32_perldll_handle == INV
win32.c:136: ? GetModuleHandle(NULL)
It looks like it's just getting the name from whatever the compiler sets up as argv.
No, Win32 Perl has never figured out $^X based on argv (except before it was released). The function called is os2_execname(aTHX) (yes, Win32 is consider OS/2-ish).