Opened 13 years ago

Closed 12 years ago

#32 closed defect (fixed)

Libpathstrict and DosLoadModule

Reported by: abwillis Owned by: abwillis
Priority: minor Milestone: general enhancement
Component: odin Version:
Severity: low Keywords:
Cc:

Description

When DosLoadModule? loads a DLL with the name having .DLL it will search for the file minus the DLL in the name. If the name does not have an extension or the extension is in lower case (.dll) then it will load. Odin has a number of obvious uses of DosLoadModule? with .DLL. There are some places where the file name is supplied by variable name... we may need to lowercase some variables if there are any reports of failures with libpathstrict.

Change History (5)

comment:1 Changed 13 years ago by abwillis

Here are the ones I have found: Index: custombuild/initterm.cpp =================================================================== --- custombuild/initterm.cpp (revision 21579) +++ custombuild/initterm.cpp (working copy) @@ -111,7 +111,7 @@

return 0UL;

char szErrName[CCHMAXPATH];

  • rc = DosLoadModule?(szErrName, sizeof(szErrName), "XXODIN32.DLL", &hModule);

+ rc = DosLoadModule?(szErrName, sizeof(szErrName), "XXODIN32", &hModule);

if(rc != 0) {

return 0;

}

Index: twain_32/initterm.cpp =================================================================== --- twain_32/initterm.cpp (revision 21579) +++ twain_32/initterm.cpp (working copy) @@ -122,7 +122,7 @@

return 0UL;

}

#else

  • rc = DosLoadModule?( szLoadError, sizeof(szLoadError), "TWAINOS2.DLL", &hTWAIN);

+ rc = DosLoadModule?( szLoadError, sizeof(szLoadError), "TWAINOS2", &hTWAIN);

if(rc==0) {

rc = DosQueryProcAddr?(hTWAIN, 0, "DSM_Entry",(PFN*)&TWAINOS2_DSM_Entry);

@@ -152,7 +152,7 @@

return 0UL;

}

#else

  • rc = DosLoadModule?( szLoadError, sizeof(szLoadError), "TWAIN.DLL", &hTWAIN);

+ rc = DosLoadModule?( szLoadError, sizeof(szLoadError), "TWAIN", &hTWAIN);

if(rc==0) {

rc = DosQueryProcAddr?(hTWAIN, 0, "DSM_Entry",(PFN*)&TWAINOS2_DSM_Entry);

Index: kernel32/osliblvm.cpp =================================================================== --- kernel32/osliblvm.cpp (revision 21579) +++ kernel32/osliblvm.cpp (working copy) @@ -60,7 +60,7 @@

APIRET rc; CHAR szModuleFailure[CCHMAXPATH];

  • rc = DosLoadModule?(szModuleFailure, sizeof(szModuleFailure), "LVM.DLL", (HMODULE *)&hModLVM);

+ rc = DosLoadModule?(szModuleFailure, sizeof(szModuleFailure), "LVM", (HMODULE *)&hModLVM);

if(rc) {

return FALSE;

}

Index: kernel32/initkernel32.cpp =================================================================== --- kernel32/initkernel32.cpp (revision 21579) +++ kernel32/initkernel32.cpp (working copy) @@ -228,7 +228,7 @@

/* Setup codepage info */ CODEPAGE_Init();

  • if( IsDBCSEnv() && DosLoadModule?( szModName, sizeof( szModName ), "OS2IM.DLL", &imHandle ) == 0 )

+ if( IsDBCSEnv() && DosLoadModule?( szModName, sizeof( szModName ), "OS2IM", &imHandle ) == 0 )

DosQueryProcAddr?( imHandle, 140, NULL, &pfnImSetMsgQueueProperty );

InitSystemInfo?(ulSysinfo);

Index: peldr/pe.cpp =================================================================== --- peldr/pe.cpp (revision 21579) +++ peldr/pe.cpp (working copy) @@ -260,7 +260,7 @@

}

#endif

  • rc = DosLoadModule?(exeName, sizeof(exeName), "PMWIN.DLL", &hmodPMWin);

+ rc = DosLoadModule?(exeName, sizeof(exeName), "PMWIN", &hmodPMWin);

rc = DosQueryProcAddr?(hmodPMWin, ORD_WIN32INITIALIZE, NULL, (PFN *)&MyWinInitialize?); rc = DosQueryProcAddr?(hmodPMWin, ORD_WIN32TERMINATE, NULL, (PFN *)&MyWinTerminate?); rc = DosQueryProcAddr?(hmodPMWin, ORD_WIN32CREATEMSGQUEUE, NULL, (PFN *)&MyWinCreateMsgQueue?);

@@ -278,7 +278,7 @@

}

errorMod[0] = 0;

  • rc = DosLoadModule?(errorMod, sizeof(errorMod), "KERNEL32.DLL", &hmodKernel32);

+ rc = DosLoadModule?(errorMod, sizeof(errorMod), "KERNEL32", &hmodKernel32);

if(rc) {

sprintf(fullpath, szNoKernel32Msg, rc, errorMod); MyWinMessageBox?(HWND_DESKTOP, NULL, fullpath, szErrorTitle, 0, MB_OK | MB_ERROR | MB_MOVEABLE);

@@ -342,7 +342,7 @@

return(1);

failerror:

  • rc = DosLoadModule?(exeName, sizeof(exeName), "PMWIN.DLL", &hmodPMWin);

+ rc = DosLoadModule?(exeName, sizeof(exeName), "PMWIN", &hmodPMWin);

rc = DosQueryProcAddr?(hmodPMWin, ORD_WIN32INITIALIZE, NULL, (PFN *)&MyWinInitialize?); rc = DosQueryProcAddr?(hmodPMWin, ORD_WIN32TERMINATE, NULL, (PFN *)&MyWinTerminate?); rc = DosQueryProcAddr?(hmodPMWin, ORD_WIN32CREATEMSGQUEUE, NULL, (PFN *)&MyWinCreateMsgQueue?);

comment:2 Changed 13 years ago by abwillis

Committed revision r21580. Committed revision r21581. Committed revision r21582. Committed revision r21583.

comment:3 Changed 13 years ago by dmik

Frankly saying, I didn't get the description. From my experience, OS/2 will search for "lib.dll" whether you specify "lib", "lib.dll" or "lib.DLL" (when not using LIBPATHSTRICT=T). With LIBPATHSTRICT=T, it seems to treat "lib.DLL"/"lib.dll" not equal to "lib" and more over it fails to load them if it has already loaded "lib.dll" referred as "lib". Is this what you mean?

Anyway, your corrections definitely make sense WRT #31.

Also, please don't break a single logical changeset to pieces w/o a good reason -- the more revisions you have the more time is necessary to review them which in this case is a waste.

comment:4 Changed 12 years ago by abwillis

Owner: set to abwillis
Severity: low

comment:5 Changed 12 years ago by abwillis

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.