- Fall back onto some of the previous win32k icon handling code, and fix user32 to suit.

- 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
This commit is contained in:
Ged Murphy 2008-01-09 16:04:34 +00:00
parent 092498cbd7
commit 1300cdce17
5 changed files with 97 additions and 7 deletions

View file

@ -268,7 +268,7 @@ LoadCursorIconImage(
if (hIcon && 0 != (fuLoad & LR_SHARED))
{
#if 0
#if 1
NtUserSetCursorIconData((HICON)hIcon, NULL, NULL, hinst, hResInfo,
(HRSRC)NULL);
#else
@ -762,7 +762,7 @@ GetIconCurBpp(PICONINFO pIconInfo)
return pbi->bmiHeader.biBitCount;
}
#if 0
static BOOL
SetCursorIconData(
HANDLE Handle,
@ -770,6 +770,7 @@ SetCursorIconData(
LPWSTR lpResName,
PICONINFO pIconInfo)
{
UNICODE_STRING Res;
if (!Handle || !pIconInfo)
@ -778,6 +779,7 @@ SetCursorIconData(
RtlInitUnicodeString(&Res, lpResName);
return NtUserSetCursorIconData(Handle, hMod, &Res, pIconInfo);
}
@ -840,7 +842,7 @@ CopyIcoCur(HANDLE hIconCur,
return hNewIcon;
}
#endif
/*
* @unimplemented
@ -873,7 +875,8 @@ CopyImage(
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:
{

View file

@ -2067,9 +2067,11 @@ BOOL
NTAPI
NtUserSetCursorIconData(
HANDLE Handle,
PBOOL fIcon,
POINT *Hotspot,
HMODULE hModule,
PUNICODE_STRING pstrResName,
PICONINFO pIconInfo);
HRSRC hRsrc,
HRSRC hGroupRsrc);
DWORD
NTAPI

View file

@ -1187,6 +1187,7 @@ CLEANUP:
/*
* @implemented
*/
#if 0
BOOL
NTAPI
NtUserSetCursorIconData(
@ -1272,7 +1273,89 @@ CLEANUP:
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

View file

@ -108,6 +108,8 @@ __inline static PUSER_HANDLE_ENTRY alloc_user_entry(PUSER_HANDLE_TABLE ht)
}
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

View file

@ -519,7 +519,7 @@ NtUserSetClipboardViewer 1
NtUserSetConsoleReserveKeys 2
NtUserSetCursor 1
NtUserSetCursorContents 2
NtUserSetCursorIconData 4
NtUserSetCursorIconData 6 #4
NtUserSetDbgTag 2
NtUserSetFocus 1
NtUserSetImeHotKey 5