X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=reactos%2Fsubsystems%2Fwin32%2Fwin32k%2Fntuser%2Fsimplecall.c;h=87d8c07dc3ac56799b9efd39b3fcbbf443ea6c1c;hp=1e74111f4f5e010ec47f37df053397be8d79b5a9;hb=f106ac2d2bf2095f95c0b9b9ed250e37e2cadc9c;hpb=80b43e7b1371c0b7269185689758f5e1a4488611 diff --git a/reactos/subsystems/win32/win32k/ntuser/simplecall.c b/reactos/subsystems/win32/win32k/ntuser/simplecall.c index 1e74111f4f5..87d8c07dc3a 100644 --- a/reactos/subsystems/win32/win32k/ntuser/simplecall.c +++ b/reactos/subsystems/win32/win32k/ntuser/simplecall.c @@ -162,13 +162,15 @@ NtUserCallOneParam( { PSMWP psmwp; HDWP hDwp = NULL; - if (Param < 0) + INT count = (INT)Param; + + if (count < 0) { EngSetLastError(ERROR_INVALID_PARAMETER); RETURN(0); } /* Windows allows zero count, in which case it allocates context for 8 moves */ - if (Param == 0) Param = 8; + if (count == 0) count = 8; psmwp = (PSMWP) UserCreateObject( gHandleTable, NULL, @@ -176,13 +178,13 @@ NtUserCallOneParam( otSMWP, sizeof(SMWP)); if (!psmwp) RETURN(0); - psmwp->acvr = ExAllocatePoolWithTag(PagedPool, Param * sizeof(CVR), USERTAG_SWP); + psmwp->acvr = ExAllocatePoolWithTag(PagedPool, count * sizeof(CVR), USERTAG_SWP); if (!psmwp->acvr) { UserDeleteObject(hDwp, otSMWP); RETURN(0); } - RtlZeroMemory(psmwp->acvr, Param * sizeof(CVR)); + RtlZeroMemory(psmwp->acvr, count * sizeof(CVR)); psmwp->bHandle = TRUE; psmwp->ccvr = 0; // actualCount psmwp->ccvrAlloc = Param; // suggestedCount