本文整理汇总了C++中UserEnterExclusive函数的典型用法代码示例。如果您正苦于以下问题:C++ UserEnterExclusive函数的具体用法?C++ UserEnterExclusive怎么用?C++ UserEnterExclusive使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了UserEnterExclusive函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NtUserCallHwnd
DWORD
APIENTRY
NtUserCallHwnd(
HWND hWnd,
DWORD Routine)
{
switch (Routine)
{
case HWND_ROUTINE_GETWNDCONTEXTHLPID:
{
PWND Window;
PPROPERTY HelpId;
USER_REFERENCE_ENTRY Ref;
UserEnterExclusive();
if (!(Window = UserGetWindowObject(hWnd)))
{
UserLeave();
return 0;
}
UserRefObjectCo(Window, &Ref);
HelpId = IntGetProp(Window, gpsi->atomContextHelpIdProp);
UserDerefObjectCo(Window);
UserLeave();
return (DWORD)HelpId->Data;
}
case HWND_ROUTINE_REGISTERSHELLHOOKWINDOW:
if (IntIsWindow(hWnd))
return IntRegisterShellHookWindow(hWnd);
return FALSE;
break;
case HWND_ROUTINE_DEREGISTERSHELLHOOKWINDOW:
if (IntIsWindow(hWnd))
return IntDeRegisterShellHookWindow(hWnd);
return FALSE;
case HWND_ROUTINE_SETMSGBOX:
{
PWND Window;
UserEnterExclusive();
if ((Window = UserGetWindowObject(hWnd)))
{
Window->state |= WNDS_MSGBOX;
}
UserLeave();
return FALSE;
}
}
STUB;
return 0;
}
示例2: NtUserShowScrollBar
DWORD APIENTRY
NtUserShowScrollBar(HWND hWnd, int nBar, DWORD bShow)
{
PWND Window;
DECLARE_RETURN(DWORD);
DWORD ret;
USER_REFERENCE_ENTRY Ref;
TRACE("Enter NtUserShowScrollBar\n");
UserEnterExclusive();
if (!(Window = UserGetWindowObject(hWnd)))
{
RETURN(0);
}
UserRefObjectCo(Window, &Ref);
ret = co_UserShowScrollBar(Window, nBar, (nBar == SB_VERT) ? 0 : bShow,
(nBar == SB_HORZ) ? 0 : bShow);
UserDerefObjectCo(Window);
RETURN(ret);
CLEANUP:
TRACE("Leave NtUserShowScrollBar, ret%lu\n", _ret_);
UserLeave();
END_CLEANUP;
}
示例3: NtUserSetClipboardData
HANDLE APIENTRY
NtUserSetClipboardData(UINT fmt, HANDLE hData, PSETCLIPBDATA pUnsafeScd)
{
SETCLIPBDATA scd;
HANDLE hRet;
TRACE("NtUserSetClipboardData(%x %p %p)\n", fmt, hData, pUnsafeScd);
_SEH2_TRY
{
ProbeForRead(pUnsafeScd, sizeof(*pUnsafeScd), 1);
RtlCopyMemory(&scd, pUnsafeScd, sizeof(scd));
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{
SetLastNtError(_SEH2_GetExceptionCode());
_SEH2_YIELD(return NULL;)
}
_SEH2_END
UserEnterExclusive();
/* Call internal function */
hRet = UserSetClipboardData(fmt, hData, &scd);
UserLeave();
return hRet;
}
示例4: NtUserHideCaret
BOOL
APIENTRY
NtUserHideCaret(HWND hWnd OPTIONAL)
{
PWND Window = NULL;
USER_REFERENCE_ENTRY Ref;
DECLARE_RETURN(BOOL);
BOOL ret;
TRACE("Enter NtUserHideCaret\n");
UserEnterExclusive();
if(hWnd && !(Window = UserGetWindowObject(hWnd)))
{
RETURN(FALSE);
}
if (Window) UserRefObjectCo(Window, &Ref);
ret = co_UserHideCaret(Window);
if (Window) UserDerefObjectCo(Window);
RETURN(ret);
CLEANUP:
TRACE("Leave NtUserHideCaret, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
}
示例5: NtUserCloseClipboard
BOOL APIENTRY
NtUserCloseClipboard(VOID)
{
BOOL ret = FALSE;
UserEnterExclusive();
if (intIsClipboardOpenByMe())
{
ClipboardWindow = NULL;
ClipboardThread = NULL;
ret = TRUE;
}
else
{
EngSetLastError(ERROR_CLIPBOARD_NOT_OPEN);
}
recentlySetClipboard = FALSE;
UserLeave();
if (sendDrawClipboardMsg && WindowsChain)
{
/* only send message to the first window in the chain, then they'll do the chain */
/* commented because it makes a crash in co_MsqSendMessage
ASSERT(WindowsChain->window);
ASSERT(WindowsChain->window->hSelf);
ERR("Clipboard: sending WM_DRAWCLIPBOARD to %p\n", WindowsChain->window->hSelf);
co_IntSendMessage(WindowsChain->window->hSelf, WM_DRAWCLIPBOARD, 0, 0);
*/
}
return ret;
}
示例6: NtUserCallNoParam
/*
* @unimplemented
*/
DWORD_PTR
APIENTRY
NtUserCallNoParam(DWORD Routine)
{
DWORD_PTR Result = 0;
DECLARE_RETURN(DWORD_PTR);
TRACE("Enter NtUserCallNoParam\n");
UserEnterExclusive();
switch(Routine)
{
case NOPARAM_ROUTINE_CREATEMENU:
Result = (DWORD_PTR)UserCreateMenu(FALSE);
break;
case NOPARAM_ROUTINE_CREATEMENUPOPUP:
Result = (DWORD_PTR)UserCreateMenu(TRUE);
break;
case NOPARAM_ROUTINE_DESTROY_CARET:
Result = (DWORD_PTR)co_IntDestroyCaret(PsGetCurrentThread()->Tcb.Win32Thread);
break;
case NOPARAM_ROUTINE_INIT_MESSAGE_PUMP:
Result = (DWORD_PTR)IntInitMessagePumpHook();
break;
case NOPARAM_ROUTINE_UNINIT_MESSAGE_PUMP:
Result = (DWORD_PTR)IntUninitMessagePumpHook();
break;
case NOPARAM_ROUTINE_GETMESSAGEEXTRAINFO:
Result = (DWORD_PTR)MsqGetMessageExtraInfo();
break;
case NOPARAM_ROUTINE_MSQCLEARWAKEMASK:
RETURN( (DWORD_PTR)IntMsqClearWakeMask());
case NOPARAM_ROUTINE_GETMSESSAGEPOS:
{
PTHREADINFO pti = PsGetCurrentThreadWin32Thread();
RETURN( (DWORD_PTR)MAKELONG(pti->ptLast.x, pti->ptLast.y));
}
case NOPARAM_ROUTINE_RELEASECAPTURE:
RETURN( (DWORD_PTR)IntReleaseCapture());
default:
ERR("Calling invalid routine number 0x%x in NtUserCallNoParam\n", Routine);
EngSetLastError(ERROR_INVALID_PARAMETER);
break;
}
RETURN(Result);
CLEANUP:
TRACE("Leave NtUserCallNoParam, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
}
示例7: NtUserNotifyWinEvent
VOID
APIENTRY
NtUserNotifyWinEvent(
DWORD Event,
HWND hWnd,
LONG idObject,
LONG idChild)
{
PWND Window = NULL;
USER_REFERENCE_ENTRY Ref;
UserEnterExclusive();
/* Validate input */
if (hWnd && (hWnd != INVALID_HANDLE_VALUE))
{
Window = UserGetWindowObject(hWnd);
if (!Window)
{
UserLeave();
return;
}
}
if (gpsi->dwInstalledEventHooks & GetMaskFromEvent(Event))
{
if (Window) UserRefObjectCo(Window, &Ref);
IntNotifyWinEvent( Event, Window, idObject, idChild, WEF_SETBYWNDPTI);
if (Window) UserDerefObjectCo(Window);
}
UserLeave();
}
示例8: DECLARE_RETURN
UINT_PTR
APIENTRY
NtUserSetTimer
(
HWND hWnd,
UINT_PTR nIDEvent,
UINT uElapse,
TIMERPROC lpTimerFunc
)
{
PWND Window;
DECLARE_RETURN(UINT_PTR);
TRACE("Enter NtUserSetTimer\n");
UserEnterExclusive();
Window = UserGetWindowObject(hWnd);
UserLeave();
RETURN(IntSetTimer(Window, nIDEvent, uElapse, lpTimerFunc, TMRF_TIFROMWND));
CLEANUP:
TRACE("Leave NtUserSetTimer, ret=%i\n", _ret_);
END_CLEANUP;
}
示例9: NtUserRemoveProp
HANDLE APIENTRY
NtUserRemoveProp(HWND hWnd, ATOM Atom)
{
PWND Window;
PPROPERTY Prop;
HANDLE Data;
DECLARE_RETURN(HANDLE);
TRACE("Enter NtUserRemoveProp\n");
UserEnterExclusive();
if (!(Window = UserGetWindowObject(hWnd)))
{
RETURN( NULL);
}
Prop = IntGetProp(Window, Atom);
if (Prop == NULL)
{
RETURN(NULL);
}
Data = Prop->Data;
RemoveEntryList(&Prop->PropListEntry);
UserHeapFree(Prop);
Window->PropListItems--;
RETURN(Data);
CLEANUP:
TRACE("Leave NtUserRemoveProp, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
}
示例10: Win32kThreadCallback
NTSTATUS
APIENTRY
Win32kThreadCallback(struct _ETHREAD *Thread,
PSW32THREADCALLOUTTYPE Type)
{
NTSTATUS Status;
UserEnterExclusive();
ASSERT(NtCurrentTeb());
if (Type == PsW32ThreadCalloutInitialize)
{
ASSERT(PsGetThreadWin32Thread(Thread) == NULL);
Status = UserCreateThreadInfo(Thread);
}
else
{
ASSERT(PsGetThreadWin32Thread(Thread) != NULL);
Status = UserDestroyThreadInfo(Thread);
}
UserLeave();
return Status;
}
示例11: NtUserChangeClipboardChain
BOOL APIENTRY
NtUserChangeClipboardChain(HWND hWndRemove, HWND hWndNewNext)
{
BOOL bRet = FALSE;
PWND pWindowRemove;
PWINSTATION_OBJECT pWinStaObj;
TRACE("NtUserChangeClipboardChain(%p, %p)\n", hWndRemove, hWndNewNext);
UserEnterExclusive();
pWinStaObj = IntGetWinStaForCbAccess();
if (!pWinStaObj)
goto cleanup;
pWindowRemove = UserGetWindowObject(hWndRemove);
if (pWindowRemove && pWinStaObj->spwndClipViewer)
{
if(pWindowRemove == pWinStaObj->spwndClipViewer)
pWinStaObj->spwndClipViewer = UserGetWindowObject(hWndNewNext);
if(pWinStaObj->spwndClipViewer)
bRet = (BOOL)co_IntSendMessage(pWinStaObj->spwndClipViewer->head.h, WM_CHANGECBCHAIN, (WPARAM)hWndRemove, (LPARAM)hWndNewNext);
}
ObDereferenceObject(pWinStaObj);
cleanup:
UserLeave();
return bRet;
}
示例12: NtUserSetThreadState
DWORD
APIENTRY
NtUserSetThreadState(
DWORD Set,
DWORD Flags)
{
PTHREADINFO pti;
DWORD Ret = 0;
// Test the only flags user can change.
if (Set & ~(QF_FF10STATUS|QF_DIALOGACTIVE|QF_TABSWITCHING|QF_FMENUSTATUS|QF_FMENUSTATUSBREAK)) return 0;
if (Flags & ~(QF_FF10STATUS|QF_DIALOGACTIVE|QF_TABSWITCHING|QF_FMENUSTATUS|QF_FMENUSTATUSBREAK)) return 0;
UserEnterExclusive();
pti = PsGetCurrentThreadWin32Thread();
if (pti->MessageQueue)
{
Ret = pti->MessageQueue->QF_flags; // Get the queue flags.
if (Set)
pti->MessageQueue->QF_flags |= (Set&Flags); // Set the queue flags.
else
{
if (Flags) pti->MessageQueue->QF_flags &= ~Flags; // Clr the queue flags.
}
}
UserLeave();
return Ret;
}
示例13: NtUserActivateKeyboardLayout
/*
* NtUserActivateKeyboardLayout
*
* Activates specified layout for thread or process
*/
HKL
APIENTRY
NtUserActivateKeyboardLayout(
HKL hKl,
ULONG Flags)
{
PKL pKl = NULL;
HKL hkl = NULL;
PTHREADINFO pti;
UserEnterExclusive();
pti = PsGetCurrentThreadWin32Thread();
/* hKl can have special value HKL_NEXT or HKL_PREV */
if (hKl == (HKL)HKL_NEXT)
{
/* Get next keyboard layout starting with current */
if (pti->KeyboardLayout)
pKl = pti->KeyboardLayout->pklNext;
}
else if (hKl == (HKL)HKL_PREV)
{
/* Get previous keyboard layout starting with current */
if (pti->KeyboardLayout)
pKl = pti->KeyboardLayout->pklNext;
}
else
pKl = UserHklToKbl(hKl);
if (!pKl)
{
ERR("Invalid HKL %p!\n", hKl);
goto cleanup;
}
hkl = pKl->hkl;
/* FIXME: KLF_RESET
KLF_SHIFTLOCK */
if (Flags & KLF_REORDER)
gspklBaseLayout = pKl;
if (pKl != pti->KeyboardLayout)
{
/* Activate layout for current thread */
pKl = co_UserActivateKbl(pti, pKl, Flags);
/* Send shell message */
if (!(Flags & KLF_NOTELLSHELL))
co_IntShellHookNotify(HSHELL_LANGUAGE, 0, (LPARAM)hkl);
}
cleanup:
UserLeave();
return hkl;
}
示例14: NtUserSBGetParms
BOOL
APIENTRY
NtUserSBGetParms(
HWND hWnd,
int fnBar,
PSBDATA pSBData,
LPSCROLLINFO lpsi)
{
NTSTATUS Status;
PWND Window;
SCROLLINFO psi;
DWORD sz;
BOOL Ret;
DECLARE_RETURN(BOOL);
USER_REFERENCE_ENTRY Ref;
TRACE("Enter NtUserGetScrollInfo\n");
UserEnterExclusive();
Status = MmCopyFromCaller(&psi.cbSize, &(lpsi->cbSize), sizeof(UINT));
if(!NT_SUCCESS(Status) ||
!((psi.cbSize == sizeof(SCROLLINFO)) || (psi.cbSize == sizeof(SCROLLINFO) - sizeof(psi.nTrackPos))))
{
SetLastNtError(Status);
RETURN(FALSE);
}
sz = psi.cbSize;
Status = MmCopyFromCaller(&psi, lpsi, sz);
if (!NT_SUCCESS(Status))
{
SetLastNtError(Status);
RETURN(FALSE);
}
if(!(Window = UserGetWindowObject(hWnd)))
{
RETURN(FALSE);
}
UserRefObjectCo(Window, &Ref);
Ret = co_IntGetScrollInfo(Window, fnBar, &psi);
UserDerefObjectCo(Window);
Status = MmCopyToCaller(lpsi, &psi, sz);
if(!NT_SUCCESS(Status))
{
SetLastNtError(Status);
RETURN( FALSE);
}
RETURN( Ret);
CLEANUP:
TRACE("Leave NtUserGetScrollInfo, ret=%i\n",_ret_);
UserLeave();
END_CLEANUP;
}
示例15: NtUserOpenClipboard
BOOL APIENTRY
NtUserOpenClipboard(HWND hWnd, DWORD Unknown1)
{
BOOL bRet;
UserEnterExclusive();
bRet = UserOpenClipboard(hWnd);
UserLeave();
return bRet;
}