mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[HH] Check LoadLibrary and GetProcAddress return value (#6082)
Handle failure cases.
This commit is contained in:
@@ -15,11 +15,14 @@ WinMain(HINSTANCE hInst,
|
||||
int ret = -1;
|
||||
|
||||
hModule = LoadLibraryA("hhctrl.ocx");
|
||||
doWinMain = (DOWINMAIN*) GetProcAddress(hModule, "doWinMain");
|
||||
if (hModule)
|
||||
{
|
||||
doWinMain = (DOWINMAIN*)GetProcAddress(hModule, "doWinMain");
|
||||
if (doWinMain)
|
||||
ret = doWinMain(hInst, cmdline);
|
||||
|
||||
ret = doWinMain(hInst, cmdline);
|
||||
|
||||
FreeLibrary(hModule);
|
||||
FreeLibrary(hModule);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user