Author: jgardou
Date: Mon Nov 5 20:23:01 2012
New Revision: 57676
URL:
http://svn.reactos.org/svn/reactos?rev=57676&view=rev
Log:
[WIN32SS/USER]
- Bake a parameter for NtUserFindExistingCursorIcon to differentiate between icons and
cursors
Modified:
trunk/reactos/win32ss/user/ntuser/cursoricon_new.c
trunk/reactos/win32ss/user/user32/windows/cursoricon_new.c
Modified: trunk/reactos/win32ss/user/ntuser/cursoricon_new.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/ntuser/cursor…
==============================================================================
--- trunk/reactos/win32ss/user/ntuser/cursoricon_new.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/ntuser/cursoricon_new.c [iso-8859-1] Mon Nov 5 20:23:01
2012
@@ -175,13 +175,15 @@
IntFindExistingCurIconObject(
PUNICODE_STRING pustrModule,
PUNICODE_STRING pustrRsrc,
- LONG cxDesired,
- LONG cyDesired)
+ FINDEXISTINGCURICONPARAM* param)
{
PCURICON_OBJECT CurIcon;
LIST_FOR_EACH(CurIcon, &gCurIconList, CURICON_OBJECT, ListEntry)
{
+ /* See if we are looking for an icon or a cursor */
+ if(CurIcon->bIcon != param->bIcon)
+ continue;
/* See if module names match */
if(RtlCompareUnicodeString(pustrModule, &CurIcon->ustrModule, TRUE) == 0)
{
@@ -196,7 +198,7 @@
else if(RtlCompareUnicodeString(pustrRsrc, &CurIcon->ustrRsrc, TRUE)
!= 0)
continue;
- if ((cxDesired == CurIcon->Size.cx) &&(cyDesired ==
CurIcon->Size.cy))
+ if ((param->cx == CurIcon->Size.cx) &&(param->cy ==
CurIcon->Size.cy))
{
if (! ReferenceCurIconByProcess(CurIcon))
{
@@ -765,12 +767,12 @@
NtUserFindExistingCursorIcon(
_In_ PUNICODE_STRING pustrModule,
_In_ PUNICODE_STRING pustrRsrc,
- _In_ LONG cxDesired,
- _In_ LONG cyDesired)
+ _In_ FINDEXISTINGCURICONPARAM* param)
{
PCURICON_OBJECT CurIcon;
HICON Ret = NULL;
UNICODE_STRING ustrModuleSafe, ustrRsrcSafe;
+ FINDEXISTINGCURICONPARAM paramSafe;
NTSTATUS Status;
TRACE("Enter NtUserFindExistingCursorIcon\n");
@@ -782,9 +784,20 @@
Status = ProbeAndCaptureUnicodeString(&ustrModuleSafe, UserMode, pustrModule);
if(!NT_SUCCESS(Status))
goto done;
+
+ _SEH2_TRY
+ {
+ ProbeForRead(param, sizeof(*param), 1);
+ paramSafe = *param;
+ }
+ _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+ {
+ Status = _SEH2_GetExceptionCode();
+ }
+ _SEH2_END
UserEnterExclusive();
- CurIcon = IntFindExistingCurIconObject(&ustrModuleSafe, &ustrRsrcSafe,
cxDesired, cyDesired);
+ CurIcon = IntFindExistingCurIconObject(&ustrModuleSafe, &ustrRsrcSafe,
¶mSafe);
if (CurIcon)
Ret = CurIcon->Self;
UserLeave();
Modified: trunk/reactos/win32ss/user/user32/windows/cursoricon_new.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/user32/window…
==============================================================================
--- trunk/reactos/win32ss/user/user32/windows/cursoricon_new.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/user32/windows/cursoricon_new.c [iso-8859-1] Mon Nov 5
20:23:01 2012
@@ -757,6 +757,7 @@
if(fuLoad & LR_SHARED)
{
DWORD size = MAX_PATH;
+ FINDEXISTINGCURICONPARAM param;
TRACE("Checking for an LR_SHARED cursor/icon.\n");
/* Prepare the resource name string */
@@ -791,7 +792,10 @@
} while(TRUE);
/* Ask win32k */
- hCurIcon = NtUserFindExistingCursorIcon(&ustrModule, &ustrRsrc,
cxDesired, cyDesired);
+ param.bIcon = bIcon;
+ param.cx = cxDesired;
+ param.cy = cyDesired;
+ hCurIcon = NtUserFindExistingCursorIcon(&ustrModule, &ustrRsrc,
¶m);
if(hCurIcon)
{
/* Woohoo, got it! */
@@ -1185,7 +1189,7 @@
}
/* Call the relevant function */
- ret = CURSORICON_LoadImageW(hModule, ustrRsrc.Buffer, cxDesired, cyDesired,
bIcon, fuFlags & LR_DEFAULTSIZE);
+ ret = CURSORICON_LoadImageW(hModule, ustrRsrc.Buffer, cxDesired, cyDesired,
fuFlags & LR_DEFAULTSIZE, bIcon);
FreeLibrary(hModule);