能力值:
( LV2,RANK:10 )
|
-
-
2 楼
谢谢 学习了
|
能力值:
( LV2,RANK:10 )
|
-
-
3 楼
这可是个好函数,mark...
|
能力值:
( LV9,RANK:260 )
|
-
-
4 楼
貌似标志 = 6 是 GetCursor
|
能力值:
( LV2,RANK:10 )
|
-
-
5 楼
学习中
长见识了
|
能力值:
( LV9,RANK:260 )
|
-
-
6 楼
翻了下2k的代码。这家伙作用真多:
ULONG_PTR NtUserGetThreadState(
IN USERTHREADSTATECLASS ThreadState)
{
PTHREADINFO ptiCurrent = PtiCurrentShared();
BEGINRECV_SHARED(ULONG_PTR, 0);
switch (ThreadState) {
case UserThreadStateFocusWindow:
retval = (ULONG_PTR)HW(ptiCurrent->pq->spwndFocus);
break;
case UserThreadStateActiveWindow:
retval = (ULONG_PTR)HW(ptiCurrent->pq->spwndActive);
break;
case UserThreadStateCaptureWindow:
retval = (ULONG_PTR)HW(ptiCurrent->pq->spwndCapture);
break;
case UserThreadStateDefaultImeWindow:
retval = (ULONG_PTR)HW(ptiCurrent->spwndDefaultIme);
break;
case UserThreadStateDefaultInputContext:
retval = (ULONG_PTR)PtoH(ptiCurrent->spDefaultImc);
break;
case UserThreadStateImeCompatFlags:
UserAssert(ptiCurrent->ppi != NULL);
retval = (DWORD)(ptiCurrent->ppi->dwImeCompatFlags);
break;
case UserThreadStatePreviousKeyboardLayout:
retval = (ULONG_PTR)(ptiCurrent->hklPrev);
break;
case UserThreadStateIsWinlogonThread:
// Client IMM checks if the process is Login;
// to prevent switching dictionaries, etc.
// LATER: gpidLogin per WinStation ?
retval = (DWORD)(GetCurrentProcessId() == gpidLogon);
break;
case UserThreadStateIsConImeThread:
UserAssert(ptiCurrent->rpdesk != NULL);
retval = (DWORD)(PtiFromThreadId(ptiCurrent->rpdesk->dwConsoleIMEThreadId) == ptiCurrent);
break;
case UserThreadStateInputState:
retval = (DWORD)_GetInputState();
break;
case UserThreadStateCursor:
retval = (ULONG_PTR)PtoH(ptiCurrent->pq->spcurCurrent);
break;
case UserThreadStateChangeBits:
retval = ptiCurrent->pcti->fsChangeBits;
break;
case UserThreadStatePeekMessage:
/*
* Update the last read time so that hung app painting won't occur.
*/
SET_TIME_LAST_READ(ptiCurrent);
retval = (DWORD)FALSE;
break;
case UserThreadStateExtraInfo:
retval = ptiCurrent->pq->ExtraInfo;
break;
case UserThreadStateInSendMessage:
if (ptiCurrent->psmsCurrent != NULL) {
if (ptiCurrent->psmsCurrent->ptiSender != NULL) {
retval = ISMEX_SEND;
} else if (ptiCurrent->psmsCurrent->flags & (SMF_CB_REQUEST | SMF_CB_REPLY)) {
retval = ISMEX_CALLBACK;
} else {
retval = ISMEX_NOTIFY;
}
if (ptiCurrent->psmsCurrent->flags & SMF_REPLY) {
retval |= ISMEX_REPLIED;
}
} else {
retval = ISMEX_NOSEND;
}
break;
case UserThreadStateMessageTime:
retval = ptiCurrent->timeLast;
break;
case UserThreadStateIsForeground:
retval = (ptiCurrent->pq == gpqForeground);
break;
case UserThreadConnect:
retval = TRUE;
break;
default:
RIPMSG1(RIP_WARNING, "NtUserGetThreadState invalid ThreadState:%#x", ThreadState);
MSGERROR(0);
}
ENDRECV_SHARED();
}
|
|
|