Author: mjansen
Date: Fri Jun 10 20:57:26 2016
New Revision: 71609
URL:
http://svn.reactos.org/svn/reactos?rev=71609&view=rev
Log:
[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
Modified:
trunk/reactos/win32ss/user/user32/windows/cursoricon.c
Modified: trunk/reactos/win32ss/user/user32/windows/cursoricon.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
==============================================================================
--- trunk/reactos/win32ss/user/user32/windows/cursoricon.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/windows/cursoricon.c [iso-8859-1] Fri Jun 10
20:57:26 2016
@@ -1867,11 +1867,12 @@
TRACE("Got module %wZ, resource %p (%S).\n", &ustrModule,
ustrRsrc.Buffer, IS_INTRESOURCE(ustrRsrc.Buffer) ? L"" :
ustrRsrc.Buffer);
- /* Get the module handle */
- if (!GetModuleHandleExW(0, ustrModule.Buffer, &hModule))
- {
- /* This should never happen */
- ERR("Invalid handle? Module='%wZ', error %lu.\n",
&ustrModule, GetLastError());
+ /* Get the module handle or load the module */
+ hModule = LoadLibraryExW(ustrModule.Buffer, NULL, LOAD_LIBRARY_AS_IMAGE_RESOURCE
| LOAD_LIBRARY_AS_DATAFILE);
+ if (!hModule)
+ {
+ DWORD err = GetLastError();
+ ERR("Unable to load/use module '%wZ' in process %lu, error
%lu.\n", &ustrModule, GetCurrentProcessId(), err);
SetLastError(ERROR_INVALID_PARAMETER);
goto leave;
}