- This fixes the handle problem we were seeing which was caused by a failing NtUserFindExistingCursorIcon call in user32. It was incompatible with the new code and thus, creating a new icon for all LR_SHARED resources.
- The new code is correct, and will be re-enabled once I've finished the cursoricon object rewrite (which will make it compatible with windows)
- You'll probably need to 'make win32k_clean' before building
svn path=/trunk/; revision=31687
if (hIcon && 0 != (fuLoad & LR_SHARED))
{
-#if 0
+#if 1
NtUserSetCursorIconData((HICON)hIcon, NULL, NULL, hinst, hResInfo,
(HRSRC)NULL);
#else
return pbi->bmiHeader.biBitCount;
}
-
+#if 0
static BOOL
SetCursorIconData(
HANDLE Handle,
LPWSTR lpResName,
PICONINFO pIconInfo)
{
+
UNICODE_STRING Res;
if (!Handle || !pIconInfo)
RtlInitUnicodeString(&Res, lpResName);
return NtUserSetCursorIconData(Handle, hMod, &Res, pIconInfo);
+
}
return hNewIcon;
}
-
+#endif
/*
* @unimplemented
return CopyBmp(hnd, type, desiredx, desiredy, flags);
case IMAGE_ICON:
- return CopyIcoCur(hnd, type, desiredx, desiredy, flags);
+ //return CopyIcoCur(hnd, type, desiredx, desiredy, flags);
+ return CopyIcon(hnd);
case IMAGE_CURSOR:
{
NTAPI
NtUserSetCursorIconData(
HANDLE Handle,
+ PBOOL fIcon,
+ POINT *Hotspot,
HMODULE hModule,
- PUNICODE_STRING pstrResName,
- PICONINFO pIconInfo);
+ HRSRC hRsrc,
+ HRSRC hGroupRsrc);
DWORD
NTAPI
/*
* @implemented
*/
+#if 0
BOOL
NTAPI
NtUserSetCursorIconData(
UserLeave();
END_CLEANUP;
}
+#else
+BOOL
+STDCALL
+NtUserSetCursorIconData(
+ HANDLE hCurIcon,
+ PBOOL fIcon,
+ POINT *Hotspot,
+ HMODULE hModule,
+ HRSRC hRsrc,
+ HRSRC hGroupRsrc)
+{
+ PCURICON_OBJECT CurIcon;
+ PWINSTATION_OBJECT WinSta;
+ NTSTATUS Status;
+ POINT SafeHotspot;
+ BOOL Ret = FALSE;
+ DECLARE_RETURN(BOOL);
+
+ DPRINT("Enter NtUserSetCursorIconData\n");
+ UserEnterExclusive();
+
+ WinSta = IntGetWinStaObj();
+ if(WinSta == NULL)
+ {
+ RETURN( FALSE);
+ }
+
+ if(!(CurIcon = UserGetCurIconObject(hCurIcon)))
+ {
+ ObDereferenceObject(WinSta);
+ RETURN(FALSE);
+ }
+
+ CurIcon->hModule = hModule;
+ CurIcon->hRsrc = hRsrc;
+ CurIcon->hGroupRsrc = hGroupRsrc;
+
+ /* Copy fields */
+ if(fIcon)
+ {
+ Status = MmCopyFromCaller(&CurIcon->IconInfo.fIcon, fIcon, sizeof(BOOL));
+ if(!NT_SUCCESS(Status))
+ {
+ SetLastNtError(Status);
+ goto done;
+ }
+ }
+ else
+ {
+ if(!Hotspot)
+ Ret = TRUE;
+ }
+
+ if(Hotspot)
+ {
+ Status = MmCopyFromCaller(&SafeHotspot, Hotspot, sizeof(POINT));
+ if(NT_SUCCESS(Status))
+ {
+ CurIcon->IconInfo.xHotspot = SafeHotspot.x;
+ CurIcon->IconInfo.yHotspot = SafeHotspot.y;
+
+ Ret = TRUE;
+ }
+ else
+ SetLastNtError(Status);
+ }
+
+ if(!fIcon && !Hotspot)
+ {
+ Ret = TRUE;
+ }
+
+done:
+ ObDereferenceObject(WinSta);
+ RETURN( Ret);
+
+CLEANUP:
+ DPRINT("Leave NtUserSetCursorIconData, ret=%i\n",_ret_);
+ UserLeave();
+ END_CLEANUP;
+}
+#endif
/*
* @unimplemented
}
DPRINT1("Handle Count by Type:\n Free = %d Window = %d Menu = %d CursorIcon = %d Hook = %d\n CallProc = %d Accel = %d Monitor = %d\n",
iFree, iWindow, iMenu, iCursorIcon, iHook, iCallProc, iAccel, iMonitor );
+
+ ASSERT(FALSE);
//#endif
return NULL;
#if 0
NtUserSetConsoleReserveKeys 2
NtUserSetCursor 1
NtUserSetCursorContents 2
-NtUserSetCursorIconData 4
+NtUserSetCursorIconData 6 #4
NtUserSetDbgTag 2
NtUserSetFocus 1
NtUserSetImeHotKey 5