mirror of
https://github.com/reactos/reactos.git
synced 2025-05-22 18:45:00 +00:00
[HH] Check LoadLibrary and GetProcAddress return value (#6082)
Handle failure cases.
This commit is contained in:
parent
d795021a75
commit
9ea2222967
1 changed files with 7 additions and 4 deletions
|
@ -15,11 +15,14 @@ WinMain(HINSTANCE hInst,
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
hModule = LoadLibraryA("hhctrl.ocx");
|
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;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue