mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +00:00
[WIN32K]
A pointer is not a handle. A handle is not a pointer. At least in most cases. Defining STRICT in win32k revealed horrible things... svn path=/trunk/; revision=56478
This commit is contained in:
parent
bbbd338d81
commit
e0f1c20325
16 changed files with 77 additions and 74 deletions
|
@ -165,7 +165,7 @@ EngRealizeBrush(
|
|||
psurfRealize = SURFACE_ShareLockSurface(hbmpRealize);
|
||||
|
||||
/* Already delete the pattern bitmap (will be kept until dereferenced) */
|
||||
EngDeleteSurface(hbmpRealize);
|
||||
EngDeleteSurface((HSURF)hbmpRealize);
|
||||
|
||||
if (!psurfRealize)
|
||||
{
|
||||
|
|
|
@ -477,11 +477,11 @@ EngSetPointerShape(
|
|||
|
||||
failure:
|
||||
/* Cleanup surfaces */
|
||||
if (hbmMask) EngDeleteSurface(hbmMask);
|
||||
if (hbmMask) EngDeleteSurface((HSURF)hbmMask);
|
||||
if (psurfMask) SURFACE_ShareUnlockSurface(psurfMask);
|
||||
if (hbmColor) EngDeleteSurface(hbmColor);
|
||||
if (hbmColor) EngDeleteSurface((HSURF)hbmColor);
|
||||
if (psurfColor) SURFACE_ShareUnlockSurface(psurfColor);
|
||||
if (hbmSave) EngDeleteSurface(hbmSave);
|
||||
if (hbmSave) EngDeleteSurface((HSURF)hbmSave);
|
||||
if (psurfSave) SURFACE_ShareUnlockSurface(psurfSave);
|
||||
|
||||
return SPS_ERROR;
|
||||
|
|
|
@ -832,7 +832,7 @@ NtGdiGetDhpdev(
|
|||
for (ppdev = gppdevList; ppdev; ppdev = ppdev->ppdevNext)
|
||||
{
|
||||
/* Compare with the given HDEV */
|
||||
if (ppdev == hdev)
|
||||
if (ppdev == (PPDEVOBJ)hdev)
|
||||
{
|
||||
/* Found the PDEV! Get it's dhpdev and break */
|
||||
dhpdev = ppdev->dhpdev;
|
||||
|
|
|
@ -138,7 +138,7 @@ NtGdiAlphaBlend(
|
|||
DPRINT("Locking DCs\n");
|
||||
ahDC[0] = hDCDest;
|
||||
ahDC[1] = hDCSrc ;
|
||||
if (!GDIOBJ_bLockMultipleObjects(2, ahDC, apObj, GDIObjType_DC_TYPE))
|
||||
if (!GDIOBJ_bLockMultipleObjects(2, (HGDIOBJ*)ahDC, apObj, GDIObjType_DC_TYPE))
|
||||
{
|
||||
DPRINT1("Invalid dc handle (dest=0x%08x, src=0x%08x) passed to NtGdiAlphaBlend\n", hDCDest, hDCSrc);
|
||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||
|
@ -286,7 +286,7 @@ NtGdiTransparentBlt(
|
|||
DPRINT("Locking DCs\n");
|
||||
ahDC[0] = hdcDst;
|
||||
ahDC[1] = hdcSrc ;
|
||||
if (!GDIOBJ_bLockMultipleObjects(2, ahDC, apObj, GDIObjType_DC_TYPE))
|
||||
if (!GDIOBJ_bLockMultipleObjects(2, (HGDIOBJ*)ahDC, apObj, GDIObjType_DC_TYPE))
|
||||
{
|
||||
DPRINT1("Invalid dc handle (dest=0x%08x, src=0x%08x) passed to NtGdiAlphaBlend\n", hdcDst, hdcSrc);
|
||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||
|
@ -440,7 +440,7 @@ NtGdiMaskBlt(
|
|||
DPRINT("Locking DCs\n");
|
||||
ahDC[0] = hdcDest;
|
||||
ahDC[1] = UsesSource ? hdcSrc : NULL;
|
||||
if (!GDIOBJ_bLockMultipleObjects(2, ahDC, apObj, GDIObjType_DC_TYPE))
|
||||
if (!GDIOBJ_bLockMultipleObjects(2, (HGDIOBJ*)ahDC, apObj, GDIObjType_DC_TYPE))
|
||||
{
|
||||
DPRINT1("Invalid dc handle (dest=0x%08x, src=0x%08x) passed to NtGdiAlphaBlend\n", hdcDest, hdcSrc);
|
||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||
|
@ -635,7 +635,7 @@ GreStretchBltMask(
|
|||
ahDC[0] = hDCDest;
|
||||
ahDC[1] = UsesSource ? hDCSrc : NULL;
|
||||
ahDC[2] = UsesMask ? hDCMask : NULL;
|
||||
if (!GDIOBJ_bLockMultipleObjects(3, ahDC, apObj, GDIObjType_DC_TYPE))
|
||||
if (!GDIOBJ_bLockMultipleObjects(3, (HGDIOBJ*)ahDC, apObj, GDIObjType_DC_TYPE))
|
||||
{
|
||||
DPRINT1("Invalid dc handle (dest=0x%08x, src=0x%08x) passed to NtGdiAlphaBlend\n", hDCDest, hDCSrc);
|
||||
EngSetLastError(ERROR_INVALID_HANDLE);
|
||||
|
|
|
@ -3346,7 +3346,7 @@ NtGdiCombineRgn(
|
|||
ahrgn[0] = hrgnDst;
|
||||
ahrgn[1] = hrgnSrc1;
|
||||
ahrgn[2] = iMode != RGN_COPY ? hrgnSrc2 : NULL;
|
||||
if (!GDIOBJ_bLockMultipleObjects(3, ahrgn, (PVOID*)aprgn, GDIObjType_RGN_TYPE))
|
||||
if (!GDIOBJ_bLockMultipleObjects(3, (HGDIOBJ*)ahrgn, (PVOID*)aprgn, GDIObjType_RGN_TYPE))
|
||||
{
|
||||
DPRINT1("NtGdiCombineRgn: %p, %p, %p, %d\n",
|
||||
hrgnDst, hrgnSrc1, hrgnSrc2, iMode);
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
/* INCLUDES ******************************************************************/
|
||||
|
||||
#define _NO_COM
|
||||
#define STRICT
|
||||
|
||||
/* DDK/NDK/SDK headers */
|
||||
#undef NTDDI_VERSION
|
||||
|
|
|
@ -533,7 +533,7 @@ DxEngLockHdev(HDEV hDev)
|
|||
|
||||
DPRINT1("hDev : 0x%08lx\n",hDev);
|
||||
|
||||
Resource = ppdev->hsemDevLock;
|
||||
Resource = (PERESOURCE)ppdev->hsemDevLock;
|
||||
|
||||
if (Resource)
|
||||
{
|
||||
|
@ -564,7 +564,7 @@ APIENTRY
|
|||
DxEngUnlockHdev(HDEV hDev)
|
||||
{
|
||||
PPDEVOBJ ppdev = (PPDEVOBJ)hDev;
|
||||
PERESOURCE Resource = ppdev->hsemDevLock;
|
||||
PERESOURCE Resource = (PERESOURCE)ppdev->hsemDevLock;
|
||||
|
||||
DPRINT1("ReactX Calling : DxEngUnlockHdev \n");
|
||||
|
||||
|
@ -674,7 +674,7 @@ BOOLEAN
|
|||
APIENTRY
|
||||
DxEngIsHdevLockedByCurrentThread(HDEV hDev)
|
||||
{ // Based on EngIsSemaphoreOwnedByCurrentThread w/o the Ex call.
|
||||
PERESOURCE pSem = ((PPDEVOBJ)hDev)->hsemDevLock;
|
||||
PERESOURCE pSem = (PERESOURCE)(((PPDEVOBJ)hDev)->hsemDevLock);
|
||||
return pSem->OwnerEntry.OwnerThread == (ERESOURCE_THREAD)PsGetCurrentThread();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/*
|
||||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS Win32k subsystem
|
||||
* PURPOSE: Caret functions
|
||||
|
@ -164,7 +164,8 @@ BOOL FASTCALL co_UserHideCaret(PWND Window OPTIONAL)
|
|||
|
||||
if(ThreadQueue->CaretInfo->Visible)
|
||||
{
|
||||
IntKillTimer(ThreadQueue->CaretInfo->hWnd, IDCARETTIMER, TRUE);
|
||||
PWND pwnd = UserGetWindowObject(ThreadQueue->CaretInfo->hWnd);
|
||||
IntKillTimer(pwnd, IDCARETTIMER, TRUE);
|
||||
|
||||
co_IntHideCaret(ThreadQueue->CaretInfo);
|
||||
ThreadQueue->CaretInfo->Visible = 0;
|
||||
|
@ -247,7 +248,8 @@ NtUserCreateCaret(
|
|||
|
||||
if (ThreadQueue->CaretInfo->Visible)
|
||||
{
|
||||
IntKillTimer(hWnd, IDCARETTIMER, TRUE);
|
||||
PWND pwnd = UserGetWindowObject(hWnd);
|
||||
IntKillTimer(pwnd, IDCARETTIMER, TRUE);
|
||||
co_IntHideCaret(ThreadQueue->CaretInfo);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ REGISTER_SYSCLASS DefaultServerClasses[] =
|
|||
CS_GLOBALCLASS|CS_DBLCLKS,
|
||||
NULL,
|
||||
0,
|
||||
IDC_ARROW,
|
||||
(HICON)IDC_ARROW,
|
||||
(HBRUSH)(COLOR_BACKGROUND + 1),
|
||||
FNID_DESKTOP,
|
||||
ICLS_DESKTOP
|
||||
|
@ -24,7 +24,7 @@ REGISTER_SYSCLASS DefaultServerClasses[] =
|
|||
CS_VREDRAW|CS_HREDRAW|CS_SAVEBITS,
|
||||
NULL, // Use User32 procs
|
||||
sizeof(LONG),
|
||||
IDC_ARROW,
|
||||
(HICON)IDC_ARROW,
|
||||
NULL,
|
||||
FNID_SWITCH,
|
||||
ICLS_SWITCH
|
||||
|
@ -33,7 +33,7 @@ REGISTER_SYSCLASS DefaultServerClasses[] =
|
|||
CS_DBLCLKS|CS_SAVEBITS,
|
||||
NULL, // Use User32 procs
|
||||
sizeof(LONG),
|
||||
IDC_ARROW,
|
||||
(HICON)IDC_ARROW,
|
||||
(HBRUSH)(COLOR_MENU + 1),
|
||||
FNID_MENU,
|
||||
ICLS_MENU
|
||||
|
@ -42,7 +42,7 @@ REGISTER_SYSCLASS DefaultServerClasses[] =
|
|||
CS_DBLCLKS|CS_VREDRAW|CS_HREDRAW|CS_PARENTDC,
|
||||
NULL, // Use User32 procs
|
||||
sizeof(SBWND)-sizeof(WND),
|
||||
IDC_ARROW,
|
||||
(HICON)IDC_ARROW,
|
||||
NULL,
|
||||
FNID_SCROLLBAR,
|
||||
ICLS_SCROLLBAR
|
||||
|
@ -51,7 +51,7 @@ REGISTER_SYSCLASS DefaultServerClasses[] =
|
|||
0,
|
||||
NULL, // Use User32 procs
|
||||
0,
|
||||
IDC_ARROW,
|
||||
(HICON)IDC_ARROW,
|
||||
0,
|
||||
FNID_ICONTITLE,
|
||||
ICLS_ICONTITLE
|
||||
|
@ -60,7 +60,7 @@ REGISTER_SYSCLASS DefaultServerClasses[] =
|
|||
CS_GLOBALCLASS,
|
||||
NULL, // Use User32 procs
|
||||
0,
|
||||
IDC_ARROW,
|
||||
(HICON)IDC_ARROW,
|
||||
NULL,
|
||||
FNID_MESSAGEWND,
|
||||
ICLS_HWNDMESSAGE
|
||||
|
|
|
@ -173,7 +173,7 @@ IntSynthesizeDib(PWINSTATION_OBJECT pWinStaObj, HBITMAP hBm)
|
|||
{
|
||||
pMemObj->cbData = sizeof(BITMAPINFOHEADER) + bi.bmiHeader.biSizeImage;
|
||||
memcpy(pMemObj->Data, &bi, sizeof(BITMAPINFOHEADER));
|
||||
NtGdiGetDIBitsInternal(hdc, pMemObj->Data, 0, bm.bmHeight, (LPBYTE)pMemObj->Data + sizeof(BITMAPINFOHEADER), &bi, DIB_RGB_COLORS, 0, 0);
|
||||
NtGdiGetDIBitsInternal(hdc, hBm, 0, bm.bmHeight, (LPBYTE)pMemObj->Data + sizeof(BITMAPINFOHEADER), &bi, DIB_RGB_COLORS, 0, 0);
|
||||
IntAddFormatedData(pWinStaObj, CF_DIB, hMem, TRUE, TRUE);
|
||||
}
|
||||
|
||||
|
@ -478,7 +478,7 @@ BOOL APIENTRY
|
|||
NtUserCloseClipboard(VOID)
|
||||
{
|
||||
BOOL bRet;
|
||||
|
||||
|
||||
UserEnterExclusive();
|
||||
bRet = UserCloseClipboard();
|
||||
UserLeave();
|
||||
|
@ -714,7 +714,7 @@ NtUserGetPriorityClipboardFormat(UINT *paFormatPriorityList, INT cFormats)
|
|||
pWinStaObj = IntGetWinStaForCbAccess();
|
||||
if (!pWinStaObj)
|
||||
goto cleanup;
|
||||
|
||||
|
||||
if (pWinStaObj->pClipBase == NULL)
|
||||
{
|
||||
iRet = 0;
|
||||
|
@ -1002,7 +1002,7 @@ NtUserSetClipboardViewer(HWND hWndNewViewer)
|
|||
cleanup:
|
||||
if(pWinStaObj)
|
||||
ObDereferenceObject(pWinStaObj);
|
||||
|
||||
|
||||
UserLeave();
|
||||
|
||||
return hWndNext;
|
||||
|
|
|
@ -237,7 +237,7 @@ IntParseDesktopPath(PEPROCESS Process,
|
|||
pwstrDesktop = wcschr(DesktopPath->Buffer, L'\\');
|
||||
if(pwstrDesktop != NULL)
|
||||
{
|
||||
*pwstrDesktop = 0;
|
||||
*pwstrDesktop = 0;
|
||||
pwstrDesktop++;
|
||||
pwstrWinsta = DesktopPath->Buffer;
|
||||
}
|
||||
|
@ -245,7 +245,7 @@ IntParseDesktopPath(PEPROCESS Process,
|
|||
{
|
||||
pwstrDesktop = DesktopPath->Buffer;
|
||||
pwstrWinsta = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
TRACE("IntParseDesktopPath pwstrWinsta:%S pwstrDesktop:%S\n", pwstrWinsta, pwstrDesktop);
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ IntParseDesktopPath(PEPROCESS Process,
|
|||
if(!pwstrDesktop)
|
||||
pwstrDesktop = L"Default";
|
||||
}
|
||||
|
||||
|
||||
if(*hWinSta == NULL)
|
||||
{
|
||||
swprintf(wstrWinstaFullName, L"%wZ\\%ws", &gustrWindowStationsDir, pwstrWinsta);
|
||||
|
@ -371,7 +371,7 @@ IntValidateDesktopHandle(
|
|||
(PVOID*)Object,
|
||||
NULL);
|
||||
|
||||
TRACE("IntValidateDesktopHandle: handle:0x%x obj:0x%x access:0x%x Status:0x%x\n",
|
||||
TRACE("IntValidateDesktopHandle: handle:0x%x obj:0x%x access:0x%x Status:0x%x\n",
|
||||
Desktop, *Object, DesiredAccess, Status);
|
||||
|
||||
if (!NT_SUCCESS(Status))
|
||||
|
@ -1042,7 +1042,7 @@ NtUserCreateDesktop(
|
|||
/*
|
||||
* Try to open already existing desktop
|
||||
*/
|
||||
|
||||
|
||||
Status = ObOpenObjectByName(
|
||||
ObjectAttributes,
|
||||
ExDesktopObjectType,
|
||||
|
@ -1087,7 +1087,7 @@ NtUserCreateDesktop(
|
|||
KernelMode,
|
||||
(PVOID)&DesktopObject,
|
||||
NULL);
|
||||
if (!NT_SUCCESS(Status))
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
ERR("Failed to reference desktop object\n");
|
||||
RETURN(NULL);
|
||||
|
@ -1243,7 +1243,7 @@ CLEANUP:
|
|||
{
|
||||
ExFreePoolWithTag(DesktopName.Buffer, TAG_STRING);
|
||||
}
|
||||
if (!NoHooks && ptiCurrent)
|
||||
if (!NoHooks && ptiCurrent)
|
||||
{
|
||||
ptiCurrent->TIF_flags &= ~TIF_DISABLEHOOKS;
|
||||
ptiCurrent->pClientInfo->dwTIFlags = ptiCurrent->TIF_flags;
|
||||
|
@ -1355,7 +1355,7 @@ NtUserOpenInputDesktop(
|
|||
dwDesiredAccess,
|
||||
ExDesktopObjectType,
|
||||
UserMode,
|
||||
&hdesk);
|
||||
(PHANDLE)&hdesk);
|
||||
|
||||
ObDereferenceObject(pdesk);
|
||||
|
||||
|
@ -1818,12 +1818,12 @@ IntSetThreadDesktop(IN HDESK hDesktop,
|
|||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
pdeskOld = pti->rpdesk;
|
||||
hdeskOld = pti->hdesk;
|
||||
pctiOld = pti->pcti;
|
||||
|
||||
/* do the switch */
|
||||
/* do the switch */
|
||||
if(pdesk != NULL)
|
||||
{
|
||||
pti->rpdesk = pdesk;
|
||||
|
@ -1855,7 +1855,7 @@ IntSetThreadDesktop(IN HDESK hDesktop,
|
|||
pci->pDeskInfo = NULL;
|
||||
pci->pClientThreadInfo = NULL;
|
||||
}
|
||||
|
||||
|
||||
/* clean up the old desktop */
|
||||
if(pdeskOld != NULL)
|
||||
{
|
||||
|
|
|
@ -15,7 +15,7 @@ DBG_DEFAULT_CHANNEL(UserHook);
|
|||
|
||||
typedef struct _HOOKPACK
|
||||
{
|
||||
PHOOK pHk;
|
||||
PHOOK pHk;
|
||||
LPARAM lParam;
|
||||
PVOID pHookStructs;
|
||||
} HOOKPACK, *PHOOKPACK;
|
||||
|
@ -42,7 +42,7 @@ IntLoadHookModule(int iHookID, HHOOK hHook, BOOL Unload)
|
|||
{
|
||||
if(!Unload && !(ppi->W32PF_flags & W32PF_APIHOOKLOADED))
|
||||
{
|
||||
/* A callback in user mode can trigger UserLoadApiHook to be called and
|
||||
/* A callback in user mode can trigger UserLoadApiHook to be called and
|
||||
as a result IntLoadHookModule will be called recursively.
|
||||
To solve this we set the flag that means that the appliaction has
|
||||
loaded the api hook before the callback and in case of error we remove it */
|
||||
|
@ -80,11 +80,11 @@ IntLoadHookModule(int iHookID, HHOOK hHook, BOOL Unload)
|
|||
}
|
||||
|
||||
/*
|
||||
IntHookModuleUnloaded:
|
||||
Sends a internal message to all threads of the requested desktop
|
||||
and notifies them that a global hook was destroyed
|
||||
and an injected module must be unloaded.
|
||||
As a result, IntLoadHookModule will be called for all the threads that
|
||||
IntHookModuleUnloaded:
|
||||
Sends a internal message to all threads of the requested desktop
|
||||
and notifies them that a global hook was destroyed
|
||||
and an injected module must be unloaded.
|
||||
As a result, IntLoadHookModule will be called for all the threads that
|
||||
will receive the special purpose internal message.
|
||||
*/
|
||||
BOOL
|
||||
|
@ -106,7 +106,7 @@ IntHookModuleUnloaded(PDESKTOP pdesk, int iHookID, HHOOK hHook)
|
|||
/* FIXME: Do some more security checks here */
|
||||
|
||||
/* FIXME: The first check is a reactos specific hack for system threads */
|
||||
if(!PsIsSystemProcess(ptiCurrent->ppi->peProcess) &&
|
||||
if(!PsIsSystemProcess(ptiCurrent->ppi->peProcess) &&
|
||||
ptiCurrent->ppi != ppiCsr)
|
||||
{
|
||||
if(ptiCurrent->ppi->W32PF_flags & W32PF_APIHOOKLOADED)
|
||||
|
@ -129,8 +129,8 @@ IntHookModuleUnloaded(PDESKTOP pdesk, int iHookID, HHOOK hHook)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL
|
||||
FASTCALL
|
||||
BOOL
|
||||
FASTCALL
|
||||
UserLoadApiHook()
|
||||
{
|
||||
return IntLoadHookModule(WH_APIHOOK, 0, FALSE);
|
||||
|
@ -436,7 +436,7 @@ co_IntCallDebugHook(PHOOK Hook,
|
|||
break;
|
||||
|
||||
case HCBT_ACTIVATE:
|
||||
Size = sizeof(CBTACTIVATESTRUCT);
|
||||
Size = sizeof(CBTACTIVATESTRUCT);
|
||||
break;
|
||||
|
||||
case HCBT_CREATEWND: /* Handle ANSI? */
|
||||
|
@ -876,8 +876,8 @@ co_UserCallNextHookEx(PHOOK Hook,
|
|||
}
|
||||
}
|
||||
|
||||
if (!BadChk)
|
||||
{
|
||||
if (!BadChk)
|
||||
{
|
||||
lResult = co_HOOK_CallHookNext(Hook, Code, wParam, (LPARAM)(lParam ? &EventMsg : NULL));
|
||||
|
||||
if (lParam)
|
||||
|
@ -917,14 +917,14 @@ co_UserCallNextHookEx(PHOOK Hook,
|
|||
case WH_FOREGROUNDIDLE:
|
||||
case WH_KEYBOARD:
|
||||
case WH_SHELL:
|
||||
lResult = co_HOOK_CallHookNext(Hook, Code, wParam, lParam);
|
||||
lResult = co_HOOK_CallHookNext(Hook, Code, wParam, lParam);
|
||||
break;
|
||||
|
||||
default:
|
||||
ERR("Unsupported HOOK Id -> %d\n",Hook->HookId);
|
||||
break;
|
||||
}
|
||||
return lResult;
|
||||
return lResult;
|
||||
}
|
||||
|
||||
PHOOK
|
||||
|
@ -932,7 +932,7 @@ FASTCALL
|
|||
IntGetHookObject(HHOOK hHook)
|
||||
{
|
||||
PHOOK Hook;
|
||||
|
||||
|
||||
if (!hHook)
|
||||
{
|
||||
EngSetLastError(ERROR_INVALID_HOOK_HANDLE);
|
||||
|
@ -1274,7 +1274,7 @@ co_HOOK_CallHooks( INT HookId,
|
|||
continue;
|
||||
}
|
||||
UserRefObjectCo(Hook, &Ref);
|
||||
|
||||
|
||||
/* Hook->Thread is null, we hax around this with Hook->head.pti. */
|
||||
ptiHook = Hook->head.pti;
|
||||
|
||||
|
@ -1421,7 +1421,7 @@ CLEANUP:
|
|||
|
||||
HHOOK
|
||||
APIENTRY
|
||||
NtUserSetWindowsHookAW( int idHook,
|
||||
NtUserSetWindowsHookAW( int idHook,
|
||||
HOOKPROC lpfn,
|
||||
BOOL Ansi)
|
||||
{
|
||||
|
@ -1523,7 +1523,7 @@ NtUserSetWindowsHookEx( HINSTANCE Mod,
|
|||
RETURN( NULL);
|
||||
}
|
||||
|
||||
if ( (ptiHook->TIF_flags & (TIF_CSRSSTHREAD|TIF_SYSTEMTHREAD)) &&
|
||||
if ( (ptiHook->TIF_flags & (TIF_CSRSSTHREAD|TIF_SYSTEMTHREAD)) &&
|
||||
(HookId == WH_GETMESSAGE ||
|
||||
HookId == WH_CALLWNDPROC ||
|
||||
HookId == WH_CBT ||
|
||||
|
@ -1539,7 +1539,7 @@ NtUserSetWindowsHookEx( HINSTANCE Mod,
|
|||
}
|
||||
}
|
||||
else /* System-global hook */
|
||||
{
|
||||
{
|
||||
ptiHook = pti; // gptiCurrent;
|
||||
if ( !Mod &&
|
||||
(HookId == WH_GETMESSAGE ||
|
||||
|
@ -1570,7 +1570,7 @@ NtUserSetWindowsHookEx( HINSTANCE Mod,
|
|||
}
|
||||
ObDereferenceObject(WinStaObj);
|
||||
|
||||
Hook = UserCreateObject(gHandleTable, NULL, &Handle, otHook, sizeof(HOOK));
|
||||
Hook = UserCreateObject(gHandleTable, NULL, (PHANDLE)&Handle, otHook, sizeof(HOOK));
|
||||
|
||||
if (!Hook)
|
||||
{
|
||||
|
|
|
@ -750,7 +750,7 @@ cleanup:
|
|||
if (hbm)
|
||||
GreDeleteObject(hbm);
|
||||
if (hdc)
|
||||
UserReleaseDC(hWnd, hdc, FALSE);
|
||||
UserReleaseDC(pWnd, hdc, FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -33,7 +33,7 @@ RegOpenKey(
|
|||
NULL);
|
||||
|
||||
/* Open the key */
|
||||
Status = ZwOpenKey(&hkey, KEY_READ, &ObjectAttributes);
|
||||
Status = ZwOpenKey((PHANDLE)&hkey, KEY_READ, &ObjectAttributes);
|
||||
if (NT_SUCCESS(Status))
|
||||
{
|
||||
*phkey = hkey;
|
||||
|
@ -198,7 +198,7 @@ RegReadUserSetting(
|
|||
NULL);
|
||||
|
||||
/* Open the key */
|
||||
Status = ZwOpenKey(&hkey, KEY_READ, &ObjectAttributes);
|
||||
Status = ZwOpenKey((PHANDLE)&hkey, KEY_READ, &ObjectAttributes);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
return FALSE;
|
||||
|
@ -292,7 +292,7 @@ RegWriteUserSetting(
|
|||
Status = RtlAppendUnicodeToString(&usKeyName, pwszKeyName);
|
||||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("RtlAppendUnicodeToString failed with Status=%lx, buf:%d,%d\n",
|
||||
DPRINT1("RtlAppendUnicodeToString failed with Status=%lx, buf:%d,%d\n",
|
||||
Status, usKeyName.Length, usKeyName.MaximumLength);
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -305,7 +305,7 @@ RegWriteUserSetting(
|
|||
NULL);
|
||||
|
||||
/* Open or create the key */
|
||||
Status = ZwCreateKey(&hkey,
|
||||
Status = ZwCreateKey((PHANDLE)&hkey,
|
||||
KEY_READ | KEY_WRITE,
|
||||
&ObjectAttributes,
|
||||
0,
|
||||
|
|
|
@ -117,7 +117,7 @@ UserSetCursor(
|
|||
/* Get the screen DC */
|
||||
if(!(hdcScreen = IntGetScreenDC()))
|
||||
{
|
||||
return (HCURSOR)0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
OldCursor = MessageQueue->CursorObject;
|
||||
|
@ -517,7 +517,7 @@ co_MsqInsertMouseMessage(MSG* Msg, DWORD flags, ULONG_PTR dwExtraInfo, BOOL Hook
|
|||
if (co_HOOK_CallHooks(WH_MOUSE_LL, HC_ACTION, Msg->message, (LPARAM) &MouseHookData))
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/* Get the desktop window */
|
||||
pwndDesktop = UserGetDesktopWindow();
|
||||
if (!pwndDesktop) return;
|
||||
|
@ -1727,8 +1727,8 @@ co_MsqPeekHardwareMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
|
|||
3: handle to the window whose messages are to be retrieved.
|
||||
*/
|
||||
if ( ( !Window || // 1
|
||||
( Window == HWND_BOTTOM && CurrentMessage->Msg.hwnd == NULL ) || // 2
|
||||
( Window != HWND_BOTTOM && Window->head.h == CurrentMessage->Msg.hwnd ) ) && // 3
|
||||
( Window->head.h == HWND_BOTTOM && CurrentMessage->Msg.hwnd == NULL ) || // 2
|
||||
( Window->head.h != HWND_BOTTOM && Window->head.h == CurrentMessage->Msg.hwnd ) ) && // 3
|
||||
( ( ( MsgFilterLow == 0 && MsgFilterHigh == 0 ) && CurrentMessage->QS_Flags & QSflags ) ||
|
||||
( MsgFilterLow <= CurrentMessage->Msg.message && MsgFilterHigh >= CurrentMessage->Msg.message ) ) )
|
||||
{
|
||||
|
@ -1790,8 +1790,8 @@ MsqPeekMessage(IN PUSER_MESSAGE_QUEUE MessageQueue,
|
|||
3: handle to the window whose messages are to be retrieved.
|
||||
*/
|
||||
if ( ( !Window || // 1
|
||||
( Window == HWND_BOTTOM && CurrentMessage->Msg.hwnd == NULL ) || // 2
|
||||
( Window != HWND_BOTTOM && Window->head.h == CurrentMessage->Msg.hwnd ) ) && // 3
|
||||
( Window->head.h == HWND_BOTTOM && CurrentMessage->Msg.hwnd == NULL ) || // 2
|
||||
( Window->head.h != HWND_BOTTOM && Window->head.h == CurrentMessage->Msg.hwnd ) ) && // 3
|
||||
( ( ( MsgFilterLow == 0 && MsgFilterHigh == 0 ) && CurrentMessage->QS_Flags & QSflags ) ||
|
||||
( MsgFilterLow <= CurrentMessage->Msg.message && MsgFilterHigh >= CurrentMessage->Msg.message ) ) )
|
||||
{
|
||||
|
|
|
@ -188,7 +188,7 @@ NtUserCallOneParam(
|
|||
RtlZeroMemory(psmwp->acvr, count * sizeof(CVR));
|
||||
psmwp->bHandle = TRUE;
|
||||
psmwp->ccvr = 0; // actualCount
|
||||
psmwp->ccvrAlloc = count; // suggestedCount
|
||||
psmwp->ccvrAlloc = count; // suggestedCount
|
||||
RETURN((DWORD_PTR)hDwp);
|
||||
}
|
||||
|
||||
|
@ -634,7 +634,7 @@ NtUserCallHwnd(
|
|||
UserRefObjectCo(Window, &Ref);
|
||||
|
||||
HelpId = IntGetProp(Window, gpsi->atomContextHelpIdProp);
|
||||
|
||||
|
||||
UserDerefObjectCo(Window);
|
||||
UserLeave();
|
||||
return (DWORD)HelpId->Data;
|
||||
|
@ -665,7 +665,7 @@ NtUserCallHwndParam(
|
|||
switch (Routine)
|
||||
{
|
||||
case HWNDPARAM_ROUTINE_KILLSYSTEMTIMER:
|
||||
return IntKillTimer(hWnd, (UINT_PTR)Param, TRUE);
|
||||
return IntKillTimer(UserGetWindowObject(hWnd), (UINT_PTR)Param, TRUE);
|
||||
|
||||
case HWNDPARAM_ROUTINE_SETWNDCONTEXTHLPID:
|
||||
{
|
||||
|
@ -702,7 +702,7 @@ NtUserCallHwndParam(
|
|||
UserRefObjectCo(pWnd, &Ref);
|
||||
|
||||
if (pWnd->head.pti->ppi == PsGetCurrentProcessWin32Process() &&
|
||||
pWnd->cbwndExtra == DLGWINDOWEXTRA &&
|
||||
pWnd->cbwndExtra == DLGWINDOWEXTRA &&
|
||||
!(pWnd->state & WNDS_SERVERSIDEWINDOWPROC))
|
||||
{
|
||||
if (Param)
|
||||
|
@ -716,7 +716,7 @@ NtUserCallHwndParam(
|
|||
pWnd->state &= ~WNDS_DIALOGWINDOW;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
UserDerefObjectCo(pWnd);
|
||||
UserLeave();
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue