mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 08:25:03 +00:00
[WIN32SS] Try to load the module before fetching an icon, instead of failing on a module that is not available in the current process. CORE-10292 #resolve
svn path=/trunk/; revision=71609
This commit is contained in:
parent
b85cf60213
commit
a44dfe6c76
1 changed files with 5 additions and 4 deletions
|
@ -1867,11 +1867,12 @@ CURSORICON_CopyImage(
|
||||||
TRACE("Got module %wZ, resource %p (%S).\n", &ustrModule,
|
TRACE("Got module %wZ, resource %p (%S).\n", &ustrModule,
|
||||||
ustrRsrc.Buffer, IS_INTRESOURCE(ustrRsrc.Buffer) ? L"" : ustrRsrc.Buffer);
|
ustrRsrc.Buffer, IS_INTRESOURCE(ustrRsrc.Buffer) ? L"" : ustrRsrc.Buffer);
|
||||||
|
|
||||||
/* Get the module handle */
|
/* Get the module handle or load the module */
|
||||||
if (!GetModuleHandleExW(0, ustrModule.Buffer, &hModule))
|
hModule = LoadLibraryExW(ustrModule.Buffer, NULL, LOAD_LIBRARY_AS_IMAGE_RESOURCE | LOAD_LIBRARY_AS_DATAFILE);
|
||||||
|
if (!hModule)
|
||||||
{
|
{
|
||||||
/* This should never happen */
|
DWORD err = GetLastError();
|
||||||
ERR("Invalid handle? Module='%wZ', error %lu.\n", &ustrModule, GetLastError());
|
ERR("Unable to load/use module '%wZ' in process %lu, error %lu.\n", &ustrModule, GetCurrentProcessId(), err);
|
||||||
SetLastError(ERROR_INVALID_PARAMETER);
|
SetLastError(ERROR_INVALID_PARAMETER);
|
||||||
goto leave;
|
goto leave;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue