Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

userk.h File Reference

#include "wbasek.h"
#include "csrmsg.h"
#include <winnls.h>
#include <wincon.h>
#include <winuser.h>
#include <winuserp.h>
#include <wowuserp.h>
#include <user.h>
#include "ptag.h"
#include "globals.h"
#include "ddemlsvr.h"
#include "strid.h"
#include "ntuser.h"

Go to the source code of this file.

Classes

struct  tagPERFINFO
struct  _HANDLEPAGE
struct  tagWPINFO
struct  tagCRITSTACK
struct  tagGENERIC_DEVICE_INFO
struct  tagMOUSE_DEVICE_INFO
struct  tagKEYBOARD_DEVICE_INFO
struct  tagDEVICEINFO
struct  tagDEVICE_TEMPLATE
struct  tagMOUSEEVENT
struct  tagHARDERRORHANDLER
struct  tagTERMINAL
struct  tagWin32AllocStats
struct  tagPOOLRECORD
struct  tagAAS
struct  _LOCKRECORD
struct  _LOCK
struct  tagCVR
struct  tagSMWP
struct  tagCLIPDATA
struct  tagUSERSTARTUPINFO
struct  tagTLBLOCK
struct  tagKBDFILE
struct  tagKL
struct  tagKBDLANGTOGGLE
struct  tagDESKTOP
struct  tagDESKWND
struct  tagWINDOWSTATION
struct  tagCAPTIONCACHE
struct  tagSYSCFGICO
struct  tagACCELTABLE
struct  tagPOPUPMENU
struct  tagMENUWND
struct  tagCHECKPOINT
struct  tagCLIP
struct  tagSVR_INSTANCE_INFO
struct  tagPUBOBJ
struct  tagQMSG
struct  _MOVESIZEDATA
struct  tagMLIST
struct  tagQ
struct  tagATTACHINFO
struct  tagWOWTHREADINFO
struct  tagTDB
struct  tagMENUANIDC
struct  tagMENUSTATE
struct  tagLASTINPUT
struct  GRAYMENU
struct  tagTHREADINFO
struct  tagWOWPROCESSINFO
struct  tagDESKTOPVIEW
struct  tagW32JOB
struct  tagPROCESSINFO
struct  _LPKDRAWSWITCHWND
struct  tagDCE
struct  tagBWL
struct  tagSPB
struct  _CREATESTRUCTEX
struct  _MDICREATESTRUCTEX
struct  _CWPSTRUCTEX
struct  _CWPRETSTRUCTEX
struct  tagSMS
struct  tagINTERSENDMSGEX
struct  tagASYNCSENDMSG
struct  tagHOOKMSGSTRUCT
union  tagBROADCASTMSG
struct  tagHOTKEY
struct  tagDRAWICONCB
struct  SCANCODEMAP
struct  tagTIMER
struct  tagDISPLAYRESOURCE
struct  tagPROFILEVALUEINFO
struct  tagFREELIST
struct  tagDDEIMP
struct  tagDDECONV
struct  tagXSTATE
struct  tagMONITORPOS
struct  tagMONITORRECTS
struct  tagEVENTHOOK
struct  tagNOTIFY
struct  tagSwitchWndInfo
struct  tagSWITCHWND
struct  tagHOTKEYSTRUCT
struct  tagPOWERSTATE
struct  tagFADE
struct  tagTOOLTIP
struct  tagTOOLTIPWND
struct  tagPROFINTINFO

Defines

#define GET_X_LPARAM(lp)   ((int)(short)LOWORD(lp))
#define GET_Y_LPARAM(lp)   ((int)(short)HIWORD(lp))
#define BC_INVERT   0x00000001
#define BC_NOMIRROR   0x00000002
#define HEBREW_UI_LANGID()   (gpsi->UILangID == MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT))
#define OEMRESOURCE   1
#define CCACHEDCAPTIONS   5
#define RIT_PROCESSINPUT   0x01
#define RIT_STOPINPUT   0x02
#define PtiCurrent()   (gptiCurrent)
#define PtiCurrentShared()   ((PTHREADINFO)(W32GetCurrentThread()))
#define CheckPtiSysPeek(where, pq, newIdSysPeek)
#define CheckSysLock(where, pq, pti)
#define SHUTDOWN_KNOWN_PROCESS   1
#define SHUTDOWN_UNKNOWN_PROCESS   2
#define SHUTDOWN_CANCEL   3
#define PpiCurrent()   ((PPROCESSINFO)(W32GetCurrentProcess()))
#define PtiFromThread(Thread)   ((PTHREADINFO)((Thread)->Tcb.Win32Thread))
#define PpiFromProcess(Process)   ((PPROCESSINFO)((PW32PROCESS)(Process)->Win32Process))
#define GetCurrentProcessId()   (PsGetCurrentThread()->Cid.UniqueProcess)
#define ISCSRSS()   (PsGetCurrentProcess() == gpepCSRSS)
#define CheckForClientDeath()
#define DATAALIGN   sizeof(DWORD)
#define CHARALIGN   sizeof(WCHAR)
#define ProbeForReadBuffer(Address, Count, Alignment)
#define ProbeForWriteBuffer(Address, Count, Alignment)
#define ProbeAndReadSize(Address)
#define ProbeAndReadBlendfunction(Address)
#define ProbePoint(Address)
#define ProbeAndReadPoint(Address)
#define ProbeRect(Address)
#define ProbeAndReadRect(Address)
#define ProbeMessage(Address)
#define ProbeAndReadMessage(Address)
#define ProbeAndReadLargeString(Address)
#define ProbeAndReadWindowPlacement(Address)
#define ProbeAndReadMenuItem(Address)
#define ProbeAndReadMenuInfo(Address)
#define ProbeAndReadScrollInfo(Address)
#define ProbeAndReadPopupParams(Address)
#define ProbeAndReadPaintStruct(Address)
#define ProbeAndReadCreateStruct(Address)
#define ProbeAndReadMDICreateStruct(Address)
#define ProbeAndReadCopyDataStruct(Address)
#define ProbeAndReadCompareItemStruct(Address)
#define ProbeAndReadDeleteItemStruct(Address)
#define ProbeAndReadHelp(Address)
#define ProbeAndReadHelpInfo(Address)
#define ProbeAndReadDrawItemStruct(Address)
#define ProbeAndReadHookInfo(Address)
#define ProbeAndReadCBTActivateStruct(Address)
#define ProbeAndReadKbdHook(Address)
#define ProbeAndReadMsllHook(Address)
#define ProbeAndReadMouseHook(Address)
#define ProbeAndReadCBTCreateStruct(Address)
#define ProbeAndReadTrackMouseEvent(Address)
#define ProbeAndReadWindowPos(Address)
#define ProbeAndReadCursorFind(Address)
#define ProbeAndReadSetClipBData(Address)
#define ProbeAndReadBroadcastSystemMsgParams(Address)
#define ProbeAndReadCursorData(Address)
#define ProbeForReadUnicodeStringBuffer(String)
#define ProbeForReadUnicodeStringFullBuffer(String)
#define ProbeForReadUnicodeStringBufferOrId(String)
#define ProbeAndReadCandidateForm(Address)
#define ProbeAndReadCompositionForm(Address)
#define ProbeAndReadLogFontW(Address)
#define ProbeForWritePoint(Address)
#define ProbeForWriteRect(Address)
#define ProbeForWriteMessage(Address)
#define ProbeForWritePaintStruct(Address)
#define ProbeForWriteDropStruct(Address)
#define ProbeForWriteScrollInfo(Address)
#define ProbeForWriteStyleStruct(Address)
#define ProbeForWriteMeasureItemStruct(Address)
#define ProbeForWriteCreateStruct(Address)
#define ProbeForWriteEvent(Address)
#define ProbeForWriteWindowPlacement(Address)
#define ProbeForWriteGetClipData(Address)
#define ProbeForWriteMDINextMenu(Address)
#define ProbeForWritePoint5(Address)
#define ProbeForWriteNCCalcSize(Address)
#define ProbeForWriteWindowPos(Address)
#define ProbeForWriteCandidateForm(Address)
#define ProbeForWriteCompositionForm(Address)
#define ProbeForWriteLogFontW(Address)
#define ProbeForWriteReconvertString(Address)
#define ProbeForReadReconvertString(pReconv)   ProbeForRead((pReconv), (pReconv)->dwSize, 1)
#define ProbeForWriteImeCharPosition(Address)
#define ProbeAndReadMenuGetObjectInfo(Address)
#define CheckLock(p)
#define TRACE_INIT(str)   {}
#define TRACE_SWITCH(str)   {}
#define TRACE(s)
#define TRACEVOID(s)
#define TRACETHUNK(t)
#define TRACECALLBACK(t)
#define TRACECALLBACKMSG(t)
#define RevalidateHwnd(hwnd)   HMValidateHandleNoSecure(hwnd, TYPE_WINDOW)
#define RevalidateCatHwnd(hwnd)   HMValidateCatHandleNoSecure(hwnd, TYPE_WINDOW)
#define HtoPq(h)   ((PVOID)HMObjectFromHandle(h))
#define HtoPqCat(h)   ((PVOID)HMCatObjectFromHandle(h))
#define HtoP(h)   ((PVOID)HMObjectFromHandle(h))
#define HtoPCat(h)   ((PVOID)HMCatObjectFromHandle(h))
#define PW(hwnd)   ((PWND)HtoP(hwnd))
#define PWCat(hwnd)   ((PWND)HtoPCat(hwnd))
#define TID(pti)   HandleToUlong((pti) == NULL ? NULL : (pti)->pEThread->Cid.UniqueThread)
#define TIDq(pti)   HandleToUlong((pti)->pEThread->Cid.UniqueThread)
#define Lock(ppobj, pobj)   HMAssignmentLock((PVOID *)ppobj, (PVOID)pobj)
#define Unlock(ppobj)   HMAssignmentUnlock((PVOID *)ppobj)
#define HMUnlockObject(pobj)   ( (--((PHEAD)pobj)->cLockObj == 0) ? HMUnlockObjectInternal(pobj) : pobj )
#define HMChangeOwnerProcess(pobj, pti)   HMChangeOwnerPheProcess(HMPheFromObject(pobj), pti)
#define HMLockObject(p)   (((PHEAD)p)->cLockObj++)
#define ThreadLock(_pobj_, _ptl_)
#define ThreadLockAlways(_pobj_, _ptl_)
#define ThreadLockNever(_ptl_)
#define ThreadLockAlwaysWithPti(_pti_, _pobj_, _ptl_)
#define ThreadLockNeverWithPti(_pti_, _ptl_)
#define ThreadLockWithPti(_pti_, _pobj_, _ptl_)
#define ThreadUnlock(ptl)   ThreadUnlock1()
#define LogDesktop(pdesk, tag, bLock, extra)
#define ThreadLockObject(pobj, ptl)
#define ThreadLockExchangeObject(pobj, ptl)
#define ThreadUnlockObject(ptl)
#define UnlockWinSta(ppwinsta)   UnlockObjectAssignment(ppwinsta)
#define LockWinSta(ppwinsta, pwinsta)
#define LockDesktop(ppdesk, pdesk, tag, extra)
#define UnlockDesktop(ppdesk, tag, extra)   UnlockObjectAssignment(ppdesk)
#define ThreadLockDesktop(pti, pdesk, ptl, tag)
#define ThreadLockExchangeDesktop(pti, pdesk, ptl, tag)
#define ThreadUnlockDesktop(pti, ptl, tag)   ThreadUnlockObject(ptl)
#define ThreadLockWinSta(pti, pwinsta, ptl)
#define ThreadLockExchangeWinSta(pti, pwinsta, ptl)
#define _ThreadLockPti(pti, pobj, ptl)   LockW32Thread((PW32THREAD)pobj, ptl)
#define ThreadLockPti(pti, pobj, ptl)
#define ThreadUnlockWinSta(pti, ptl)   ThreadUnlockObject(ptl)
#define ThreadUnlockPti(pti, ptl)   UnlockW32Thread(ptl)
#define ThreadLockPool(_pti_, _ppool_, _ptl_)   PushW32ThreadLock(_ppool_, _ptl_, UserFreePool)
#define ThreadUnlockPool(_pti_, _ptl_)   PopW32ThreadLock(_ptl_)
#define ThreadUnlockAndFreePool(_pti_, _ptl_)   PopAndFreeAlwaysW32ThreadLock(_ptl_)
#define ThreadLockPoolCleanup(_pti_, _ppool_, _ptl_, _pfn_)   PushW32ThreadLock(_ppool_, _ptl_, _pfn_)
#define ThreadUnlockPoolCleanup(_pti_, _ptl_)   PopW32ThreadLock(_ptl_)
#define ThreadUnlockAndCleanupPool(_pti_, _ptl_)   PopAndFreeAlwaysW32ThreadLock(_ptl_)
#define ThreadLockDesktopHandle(_pti, _ptl_, _hdesk_)   PushW32ThreadLock(_hdesk_, _ptl_, CloseProtectedHandle)
#define ThreadUnlockDesktopHandle(_ptl_)   PopAndFreeAlwaysW32ThreadLock(_ptl_)
#define ThreadLockSFWLockCount(_ptl_)
#define ThreadUnlockSFWLockCount(_ptl_)
#define HBITMAP_RLE   ((HBITMAP)0xffffffff)
#define MAX_MOUSEPOINTS   64
#define PREVPOINT(i)   ((i == 0) ? (MAX_MOUSEPOINTS - 1) : ((i - 1) % MAX_MOUSEPOINTS))
#define NEXTPOINT(i)   ((i + 1) % MAX_MOUSEPOINTS)
#define NEXTPOINTCOUNT(c)
#define SAVEPOINT(xc, yc, resX, resY, t, e)
#define MAX_STACK_CALLS   8
#define CheckCritIn()
#define CheckDeviceInfoListCritIn()
#define CheckCritInShared()
#define CheckCritOut()
#define CheckDeviceInfoListCritOut()
#define BEGINATOMICCHECK()
#define BEGINATOMICDEVICEINFOLISTCHECK()
#define BeginAtomicCheck()
#define BeginAtomicDeviceInfoListCheck()
#define ENDATOMICCHECK()
#define ENDATOMICDEVICEINFOLISTCHECK()
#define EndAtomicCheck()
#define EndAtomicDeviceInfoListCheck()
#define EXITATOMICCHECK()
#define ISATOMICCHECK()
#define ISATOMICDEVICEINFOLISTCHECK()
#define DIAGNOSE_IO   1
#define LOGTIME(gt)   gt = MonotonicTick();
#define MAXIMUM_ITEMS_READ   10
#define NELEM_BUTTONQUEUE   16
#define MAXIMUM_READ_RETRIES   5
#define DEVICE_TYPE_MOUSE   0
#define DEVICE_TYPE_KEYBOARD   1
#define DEVICE_TYPE_MAX   1
#define GDIAF_ARRIVED   (USHORT)0x0001
#define GDIAF_QUERYREMOVE   (USHORT)0x0002
#define GDIAF_REMOVECANCELLED   (USHORT)0x0004
#define GDIAF_DEPARTED   (USHORT)0x0008
#define GDIAF_IME_STATUS   (USHORT)0x0010
#define GDIAF_REFRESH_MOUSE   (USHORT)0x0020
#define GDIAF_FREEME   (USHORT)0x0080
#define GDIAF_PNPWAITING   (USHORT)0x0100
#define GDIAF_RETRYREAD   (USHORT)0x0200
#define GDIAF_RECONNECT   (USHORT)0x0400
#define GDIF_NOTPNP   0x01
#define GDIF_READING   0x02
#define GDIF_READERMUSTFREE   0x04
#define GDIF_PNPMUSTFREE   0x08
#define GDIF_DBGREAD   0x10
#define TEST_GTERMF(f)   TEST_FLAG(gdwGTERMFlags, f)
#define TEST_BOOL_GTERMF(f)   TEST_BOOL_FLAG(gdwGTERMFlags, f)
#define SET_GTERMF(f)   SET_FLAG(gdwGTERMFlags, f)
#define CLEAR_GTERMF(f)   CLEAR_FLAG(gdwGTERMFlags, f)
#define SET_OR_CLEAR_GTERMF(f, fSet)   SET_OR_CLEAR_FLAG(gdwGTERMFlags, f, fSet)
#define TOGGLE_GTERMF(f)   TOGGLE_FLAG(gdwGTERMFlags, f)
#define GTERMF_MOUSE   0x00000001
#define TERMF_INITIALIZED   0x00000001
#define TERMF_NOIO   0x00000002
#define TERMF_STOPINPUT   0x00000004
#define TERMF_DTINITSUCCESS   0x00000008
#define TERMF_DTINITFAILED   0x00000010
#define TERMF_DTDESTROYED   0x00000020
#define DEFINE_POOLTAG(value, index)   value
#define DECLARE_POOLTAG(name, value, index)
#define IsValidTag(p, tag)   TRUE
#define RECORD_STACK_TRACE_SIZE   6
#define POOL_HEAVY_ALLOCS   0x00000001
#define POOL_CAPTURE_STACK   0x00000002
#define POOL_FAIL_ALLOCS   0x00000004
#define POOL_FAIL_BY_INDEX   0x00000008
#define POOL_TAIL_CHECK   0x00000010
#define POOL_KEEP_FREE_RECORD   0x00000020
#define POOL_KEEP_FAIL_RECORD   0x00000040
#define POOL_BREAK_FOR_LEAKS   0x00000080
#define CleanupPoolAllocations()
#define InitPoolLimitations()
#define CleanUpPoolLimitations()
#define InitSectionTrace()
#define CleanUpSections()
#define CXYDESKPATTERN   8
#define CheckHwnd(x)   TRUE
#define CheckHwndNull(x)   TRUE
#define VALIDATECLASSANDSIZE(pwnd, message, wParam, lParam, inFNID, initmessage)
#define CopyRgn(hrgnDst, hrgnSrc)   GreCombineRgn(hrgnDst, hrgnSrc, NULL, RGN_COPY)
#define IntersectRgn(hrgnResult, hrgnA, hrgnB)   GreCombineRgn(hrgnResult, hrgnA, hrgnB, RGN_AND)
#define SubtractRgn(hrgnResult, hrgnA, hrgnB)   GreCombineRgn(hrgnResult, hrgnA, hrgnB, RGN_DIFF)
#define UnionRgn(hrgnResult, hrgnA, hrgnB)   GreCombineRgn(hrgnResult, hrgnA, hrgnB, RGN_OR)
#define XorRgn(hrgnResult, hrgnA, hrgnB)   GreCombineRgn(hrgnResult, hrgnA, hrgnB, RGN_XOR)
#define IDC_DEFAULT   0x0001
#define IDC_CHILDRENONLY   0x0002
#define IDC_CLIENTONLY   0x0004
#define IDC_MOVEBLT   0x0008
#define IDC_NOMOUSE   0x0010
#define RSPB_NO_INVALIDATE   0
#define RSPB_INVALIDATE   1
#define RSPB_INVALIDATE_SSB   2
#define SCMS_FLAGS_ANSI   0x0001
#define SCMS_FLAGS_INONLY   0x0002
#define CallClientProcA(pwnd, msg, wParam, lParam, xpfn)
#define CallClientProcW(pwnd, msg, wParam, lParam, xpfn)
#define CallClientWorkerProc(pwnd, msg, wParam, lParam, xpfn)   SfnDWORD(pwnd, msg, wParam, lParam, 0, xpfn, TRUE, NULL)
#define ScSendMessageSMS(pwnd, msg, wParam, lParam, xParam, xpfn, dwSCMSFlags, psms)
#define ScSendMessage(pwnd, msg, wParam, lParam, xParam, xpfn, dwSCMSFlags)   ScSendMessageSMS(pwnd, msg, wParam, lParam, xParam, xpfn, dwSCMSFlags, NULL)
#define SERVERSTRINGMAXSIZE   40
#define ServerLoadString(hmod, id, p, cch)   RtlLoadStringOrError(id, p, cch, 0)
#define ServerLoadStringEx(hmod, id, p, cch, wLang)   RtlLoadStringOrError(id, p, cch, wLang)
#define AW_USE   1
#define AW_TRY   2
#define AW_SKIP   3
#define AW_TRY2   4
#define AW_SKIP2   5 /* used internally in xxxActivateWindow() */
#define AW_USE2   6 /* nc mouse activation added by craigc */
#define GETDESKINFO(pti)   ((pti)->pDeskInfo)
#define SET_TIME_LAST_READ(pti)   ((pti)->pcti->timeLastRead = NtGetTickCount())
#define GET_TIME_LAST_READ(pti)   ((pti)->pcti->timeLastRead)
#define abs(A)   (((A) < 0)? -(A) : (A))
#define N_ELEM(a)   (sizeof(a)/sizeof(a[0]))
#define LAST_ELEM(a)   ( (a) [ N_ELEM(a) - 1 ] )
#define PLAST_ELEM(a)   (&LAST_ELEM(a))
#define RETURN_IF_ACCESS_DENIED(amGranted, amRequested, r)   if (!CheckGrantedAccess((amGranted), (amRequested))) return r
#define LOCKRECORD_STACK   8
#define LOCKRECORD_MARKDESTROY   IntToPtr( 0xFFFFFFFF )
#define KERNEL_STACK_MINIMUM_RESERVE   (4*1024)
#define NEEDSSYNCPAINT(pwnd)   TestWF(pwnd, WFSENDERASEBKGND | WFSENDNCPAINT)
#define RE_VISNEW   0x0001
#define RE_VISOLD   0x0002
#define RE_VALID   0x0004
#define RE_INVALID   0x0008
#define RE_SPB   0x0010
#define RE_VALIDSUM   0x0020
#define RE_INVALIDSUM   0x0040
#define THREADS_PER_TLBLOCK   16
#define KL_UNLOADED   0x20000000
#define KL_RESET   0x40000000
#define KLT_ALT   1
#define KLT_LEFTSHIFT   2
#define KLT_ALTLEFTSHIFT   3
#define KLT_RIGHTSHIFT   4
#define KLT_ALTRIGHTSHIFT   5
#define KLT_ALTBOTHSHIFTS   7
#define KLT_NONE   8
#define DF_DYING   0x80000000
#define DF_DESKWNDDESTROYED   0x40000000
#define DF_DESTROYED   0x20000000
#define DF_HOTTRACKING   0x10000000
#define DF_TOOLTIPSHOWING   0x08000000
#define DF_TOOLTIPACTIVE   0x04000000
#define DF_TOOLTIP   (DF_TOOLTIPACTIVE | DF_TOOLTIPSHOWING)
#define DF_TRACKMOUSELEAVE   0x02000000
#define DF_TRACKMOUSEHOVER   0x01000000
#define DF_TRACKMOUSEEVENT   (DF_TRACKMOUSELEAVE | DF_TRACKMOUSEHOVER)
#define DF_MOUSEMOVETRK   (DF_HOTTRACKING | DF_TOOLTIPACTIVE | DF_TRACKMOUSELEAVE | DF_TRACKMOUSEHOVER)
#define DF_MENUINUSE   0x00800000
#define DF_NEWDISPLAYSETTINGS   0x00400000
#define DF_DESKCREATED   0x00200000
#define CAPTIONTOOLTIPLEN   100
#define GW_DESKTOP_ID   1
#define DESKTOP_ALLOC_TRACE_SIZE   6
#define DTAG_CLASS   0x0001
#define DTAG_DESKTOPINFO   0x0002
#define DTAG_CLIENTTHREADINFO   0x0003
#define DTAG_TEXT   0x0004
#define DTAG_HANDTABL   0x0005
#define DTAG_SBINFO   0x0006
#define DTAG_MENUITEM   0x0007
#define DTAG_MENUTEXT   0x0008
#define DTAG_IMETEXT   0x0009
#define DTAG_PROPLIST   0x000A
#define DesktopAllocAlways(pdesk, uSize, tag)   Win32HeapAlloc(pdesk->pheapDesktop, uSize, tag, 0)
#define DesktopFree(pdesk, p)   Win32HeapFree(pdesk->pheapDesktop, p)
#define WSF_SWITCHLOCK   0x0001
#define WSF_OPENLOCK   0x0002
#define WSF_NOIO   0x0004
#define WSF_SHUTDOWN   0x0008
#define WSF_DYING   0x0010
#define WSF_REALSHUTDOWN   0x0020
#define SYSICO(name)   (gasysico[OIC_##name##_DEFAULT - OIC_FIRST_DEFAULT].spcur)
#define SYSCUR(name)   (gasyscur[OCR_##name##_DEFAULT - OCR_FIRST_DEFAULT].spcur)
#define PWNDDESKTOP(p)   ((p)->head.rpdesk->pDeskInfo->spwnd)
#define PWNDMESSAGE(p)   ((p)->head.rpdesk->spwndMessage)
#define PWNDTOOLTIP(p)   ((p)->head.rpdesk->spwndTooltip)
#define PWNDPARENT(p)   (p->spwndParent ? p->spwndParent : PWNDDESKTOP(p))
#define ISAMENU(pwwnd)   (GETFNID(pwnd) == FNID_MENU)
#define dpHorzRes   HORZRES
#define dpVertRes   VERTRES
#define DUMMY_TEXT_HANDLE   0xFFFF
#define DATA_NOT_BANKED   0xFFFF
#define FREEHOLD   0
#define MOUSEHOLD   -1 /* Mouse button held down and dragging */
#define KEYBDHOLD   1
#define QEVENT_SHOWWINDOW   0x0001
#define QEVENT_CANCELMODE   0x0002
#define QEVENT_SETWINDOWPOS   0x0003
#define QEVENT_UPDATEKEYSTATE   0x0004
#define QEVENT_DEACTIVATE   0x0005
#define QEVENT_ACTIVATE   0x0006
#define QEVENT_POSTMESSAGE   0x0007
#define QEVENT_EXECSHELL   0x0008
#define QEVENT_CANCELMENU   0x0009
#define QEVENT_DESTROYWINDOW   0x000A
#define QEVENT_ASYNCSENDMSG   0x000B
#define QEVENT_HUNGTHREAD   0x000C
#define QEVENT_CANCELMOUSEMOVETRK   0x000D
#define QEVENT_NOTIFYWINEVENT   0x000E
#define QEVENT_RITACCESSIBILITY   0x000F
#define QEVENT_RITSOUND   0x0010
#define QEVENT_APPCOMMAND   0x0011
#define RITSOUND_UPSIREN   0x0000
#define RITSOUND_DOWNSIREN   0x0001
#define RITSOUND_LOWBEEP   0x0002
#define RITSOUND_HIGHBEEP   0x0003
#define RITSOUND_KEYCLICK   0x0004
#define RITSOUND_DOBEEP   0x0005
#define PEM_ACTIVATE_RESTORE   0x0001
#define PEM_ACTIVATE_NOZORDER   0x0002
#define DDR_START   0
#define DDR_ENDACCEPT   1
#define DDR_ENDCANCEL   2
#define PSEUDO_EVENT_ON   ((HANDLE)IntToPtr( 0xFFFFFFFF ))
#define PSEUDO_EVENT_OFF   ((HANDLE)IntToPtr( 0x00000000 ))
#define INIT_PSEUDO_EVENT(ph)   *ph = PSEUDO_EVENT_OFF;
#define SET_PSEUDO_EVENT(phE)
#define RESET_PSEUDO_EVENT(phE)
#define CLOSE_PSEUDO_EVENT(phE)
#define POLL_EVENT_CNT   5
#define IEV_IDLE   0
#define IEV_INPUT   1
#define IEV_EXEC   2
#define IEV_TASK   3
#define IEV_WOWEXEC   4
#define TDBF_SETUP   1
#define DTM_SETUPAPPRAN   (WM_USER+90)
#define LINP_KEYBOARD   0x00000001
#define LINP_SCREENSAVER   0x00000002
#define LINP_LOWPOWER   0x00000004
#define LINP_POWEROFF   0x00000008
#define LINP_POWERTIMEOUTS   (LINP_LOWPOWER | LINP_POWEROFF)
#define LINP_INPUTTIMEOUTS   (LINP_SCREENSAVER | LINP_LOWPOWER | LINP_POWEROFF)
#define IS_THREAD_RESTRICTED(pti, r)
#define IS_CURRENT_THREAD_RESTRICTED(r)
#define PWNDTOPSBTRACK(pwnd)   (((GETPTI(pwnd)->pSBTrack)))
#define CLIBS   32
#define GH_SIZE   8
#define JP_DELTA   4
#define LPK_TABBEDTEXTOUT   0x01
#define LPK_PSMTEXTOUT   0x02
#define LPK_DRAWTEXTEX   0x04
#define LPK_EDITCONTROL   0x08
#define LPK_INSTALLED   0x0f
#define CALL_LPK(ptiCurrent)
#define DCE_SIZE_CACHEINIT   5
#define DCE_SIZE_CACHETHRESHOLD   32
#define DCE_RELEASED   0
#define DCE_FREED   1
#define DCE_NORELEASE   2
#define DCUNUSED   0x00 /* Unused cache entry */
#define DCC   0x01 /* Client area */
#define DCW   0x02 /* Window area */
#define DCSAVEDVISRGN   0x04
#define DCCLIPRGN   0x08
#define DCNOCHILDCLIP   0x10 /* Nochildern clip */
#define DCSAVEVIS   0x20 /* Save visrgn before calculating */
#define DCCACHE   0x40
#define BWL_CHWNDINIT   32 /* initial # slots pre-allocated */
#define BWL_CHWNDMORE   8 /* # slots to obtain when required */
#define BWL_ENUMCHILDREN   1
#define BWL_ENUMLIST   2
#define BWL_ENUMOWNERLIST   4
#define BWL_ENUMIMELAST   0x08
#define BWL_REMOVEIMECHILD   0x10
#define SPB_SAVESCREENBITS   0x0001
#define SPB_LOCKUPDATE   0x0002
#define SPB_DRAWBUFFER   0x0004
#define AnySpbs()   (gpDispInfo->pspbFirst != NULL)
#define FJOURNALRECORD()   (GETDESKINFO(PtiCurrent())->aphkStart[WH_JOURNALRECORD + 1] != NULL)
#define FJOURNALPLAYBACK()   (GETDESKINFO(PtiCurrent())->aphkStart[WH_JOURNALPLAYBACK + 1] != NULL)
#define TESTHMODLOADED(pti, x)   ((pti)->ppi->dwhmodLibLoadedMask & (1 << (x)))
#define SETHMODLOADED(pti, x, hmod)
#define CLEARHMODLOADED(pti, x)
#define PFNHOOK(phk)
#define SMF_REPLY   0x0001
#define SMF_RECEIVERDIED   0x0002
#define SMF_SENDERDIED   0x0004
#define SMF_RECEIVERFREE   0x0008
#define SMF_RECEIVEDMESSAGE   0x0010
#define SMF_CB_REQUEST   0x0100
#define SMF_CB_REPLY   0x0200
#define SMF_CB_CLIENT   0x0400
#define SMF_CB_SERVER   0x0800
#define SMF_WOWRECEIVE   0x1000
#define SMF_WOWSEND   0x2000
#define SMF_RECEIVERBUSY   0x4000
#define ISM_CALLBACK   0x0001
#define ISM_TIMEOUT   0x0002
#define ISM_REQUEST   0x0010
#define ISM_REPLY   0x0020
#define ISM_CB_CLIENT   0x0100
#define IsHooked(pti, fsHook)   ((fsHook & (pti->fsHooks | pti->pDeskInfo->fsHooks)) != 0)
#define IsGlobalHooked(pti, fsHook)   ((fsHook & pti->pDeskInfo->fsHooks) != 0)
#define BMSG_SENDMSG   0x0000
#define BMSG_SENDNOTIFYMSG   0x0001
#define BMSG_POSTMSG   0x0002
#define BMSG_SENDMSGCALLBACK   0x0003
#define BMSG_SENDMSGTIMEOUT   0x0004
#define BMSG_SENDNOTIFYMSGPROCESS   0x0005
#define PWND_INPUTOWNER   (PWND)1
#define PWND_FOCUS   (PWND)NULL
#define PWND_ERROR   (PWND)0x10
#define PWND_TOP   (PWND)0
#define PWND_BOTTOM   (PWND)1
#define PWND_GROUPTOTOP   ((PWND)-1)
#define PWND_TOPMOST   ((PWND)-1)
#define PWND_NOTOPMOST   ((PWND)-2)
#define PWND_BROADCAST   ((PWND)-1)
#define IDHOT_DEBUG   (-5)
#define IDHOT_DEBUGSERVER   (-6)
#define IDHOT_WINDOWS   (-7)
#define KEYBOARD_MENU   ((LPARAM)-1)
#define NO_CAP_CLIENT   0 /* no capture; in client area */
#define NO_CAP_SYS   1 /* no capture; in sys area */
#define CLIENT_CAPTURE   2 /* client-relative capture */
#define WINDOW_CAPTURE   3 /* window-relative capture */
#define SCREEN_CAPTURE   4 /* screen-relative capture */
#define FULLSCREEN_CAPTURE   5 /* capture entire machine */
#define CLIENT_CAPTURE_INTERNAL   6 /* client-relative capture (Win 3.1 style; won't release) */
#define CH_HELPPREFIX   0x08
#define xxxRedrawScreen()
#define CCVR_WORKSPACE   4
#define KSPEED_MASK   0x001F
#define KDELAY_MASK   0x0060
#define KDELAY_SHIFT   5
#define PROP_CHECKPOINT   MAKEINTATOM(atomCheckpointProp)
#define PROP_DDETRACK   MAKEINTATOM(atomDDETrack)
#define PROP_QOS   MAKEINTATOM(atomQOS)
#define PROP_DDEIMP   MAKEINTATOM(atomDDEImp)
#define PROP_WNDOBJ   MAKEINTATOM(atomWndObj)
#define PROP_IMELEVEL   MAKEINTATOM(atomImeLevel)
#define PROP_LAYER   MAKEINTATOM(atomLayer)
#define WinFlags   ((WORD)(&__WinFlags))
#define MOUSE_SENSITIVITY_MIN   1
#define MOUSE_SENSITIVITY_DEFAULT   10
#define MOUSE_SENSITIVITY_MAX   20
#define SCANCODE_NUMPAD_PLUS   (0x4e)
#define SCANCODE_NUMPAD_DOT   (0x53)
#define NUMPAD_HEXMODE_LL   (1)
#define NUMPAD_HEXMODE_HL   (2)
#define MODIFIER_FOR_ALT_NUMPAD(wModBit)
#define WOAHACK_CHECKALTKEYSTATE   1
#define WOAHACK_IGNOREALTKEYDOWN   2
#define DSP_ERASE   0x0001
#define DSP_FRAME   0x0002
#define DSP_ENUMCLIPPEDCHILDREN   0x0004
#define DSP_WM_SYNCPAINT   0x0008
#define DSP_NOCHECKPARENTS   0x0010
#define DSP_ALLCHILDREN   0x0020
#define KILLRITTIMER(pwnd, nID)   FindTimer(pwnd, nID, TMRF_RIT, TRUE)
#define DPO   0x00FA0089 /* destination, pattern, or */
#define SMESSAGEPROTO(func)
#define xxxReceiveMessages(pti)   while ((pti)->pcti->fsWakeBits & QS_SENDMESSAGE) { xxxReceiveMessage((pti)); }
#define MINMAX_KEEPHIDDEN   0x1
#define MINMAX_ANIMATE   0x10000
#define WHT_IGNOREDISABLED   0x00000001
#define SFW_STARTUP   0x0001
#define SFW_SWITCH   0x0002
#define SFW_NOZORDER   0x0004
#define SFW_SETFOCUS   0x0008
#define SFW_ACTIVATERESTORE   0x0010
#define ATW_MOUSE   0x0001
#define ATW_SETFOCUS   0x0002
#define ATW_ASYNC   0x0004
#define ATW_NOZORDER   0x0008
#define NTW_PREVIOUS   1
#define NTW_IGNORETOOLWINDOW   2
#define UnlockProcess   ObDereferenceObject
#define UnlockThread   ObDereferenceObject
#define ValidateProcessSessionId(pEProcess)
#define ValidateThreadSessionId(pEThread)
#define DEFAULT_WINSTA   L"\\Windows\\WindowStations\\WinSta0"
#define POBJECT_NAME(pobj)
#define FindClassAtom(lpszClassName)   (IS_PTR(lpszClassName) ? UserFindAtom(lpszClassName) : PTR_TO_ID(lpszClassName))
#define DMI_INVERT   0x00000001
#define DMI_GRAYED   0x00000002
#define MNXBORDER   (SYSMET(CXBORDER) + SYSMET(CXEDGE))
#define MNYBORDER   (SYSMET(CYBORDER) + SYSMET(CYEDGE))
#define MNXSPACE   (SYSMET(CXEDGE))
#define MNLEFTMARGIN   (SYSMET(CXEDGE))
#define MNUS_DEFAULT   0x00000001
#define MNUS_DELETE   0x00000002
#define MNUS_DRAWFRAME   0x00000004
#define MNIS_MEASUREBMP   -1
#define MNSW_RETURNSIZE   0
#define MNSW_SIZE   MNUS_DEFAULT
#define MNSW_DRAWFRAME   MNUS_DRAWFRAME
#define PAS_RIGHT   (TPM_HORPOSANIMATION >> TPM_FIRSTANIBITPOS)
#define PAS_LEFT   (TPM_HORNEGANIMATION >> TPM_FIRSTANIBITPOS)
#define PAS_DOWN   (TPM_VERPOSANIMATION >> TPM_FIRSTANIBITPOS)
#define PAS_UP   (TPM_VERNEGANIMATION >> TPM_FIRSTANIBITPOS)
#define PAS_OUT   0x10
#define PAS_HORZ   (PAS_LEFT | PAS_RIGHT)
#define PAS_VERT   (PAS_UP | PAS_DOWN)
#define CXMENU3DEDGE   1
#define CYMENU3DEDGE   1
#define SCROLL_NORMAL   0
#define SCROLL_DIRECT   1
#define SCROLL_MENU   2
#define Validateppopupmenu(ppopupmenu)
#define MNGetpItemIndex   _MNGetpItemIndex
#define SMS_NOMENU   (PMENU)(-1)
#define NCA_ACTIVE   0x00000001
#define NCA_FORCEFRAMEOFF   0x00000002
#define UPIsDWORDRange(uSetting)   ((uSetting) >= SPI_STARTDWORDRANGE && (uSetting) < SPI_MAXDWORDRANGE)
#define UPDWORDIndex(uSetting)   (1 + (((uSetting) - SPI_STARTDWORDRANGE) / 2))
#define UPIsBOOLRange(uSetting)   ((uSetting) >= SPI_STARTBOOLRANGE && (uSetting) < SPI_MAXBOOLRANGE)
#define UPBOOLIndex(uSetting)   (((uSetting) - SPI_STARTBOOLRANGE) / 2)
#define UPBOOLPointer(pdw, uSetting)   (pdw + (UPBOOLIndex(uSetting) / 32))
#define UPBOOLMask(uSetting)   (1 << (UPBOOLIndex(uSetting) - ((UPBOOLIndex(uSetting) / 32) * 32)))
#define TestUPBOOL(pdw, uSetting)   (*UPBOOLPointer(pdw, uSetting) & UPBOOLMask(uSetting))
#define SetUPBOOL(pdw, uSetting)   (*UPBOOLPointer(pdw, uSetting) |= UPBOOLMask(uSetting))
#define ClearUPBOOL(pdw, uSetting)
#define TestUP(uSetting)   TestUPBOOL(gpdwCPUserPreferencesMask, SPI_GET ## uSetting)
#define SetUP(uSetting)   SetUPBOOL(gpdwCPUserPreferencesMask, SPI_GET ## uSetting)
#define ClearUP(uSetting)   ClearUPBOOL(gpdwCPUserPreferencesMask, SPI_GET ## uSetting)
#define IndexUP(uSetting)   (1 << (((uSetting) - SPI_STARTBOOLRANGE) / 2))
#define TestEffectUP(uSetting)
#define TestEffectInvertUP(uSetting)   (TestUP(uSetting) || !TestUP(UIEFFECTS))
#define PropagetUPBOOLTogpsi(uSetting)
#define UNDERLINE_RECALC   0x7FFFFFFF
#define UnrealizeObject(hbr)   /* NOP for NT */
#define RDW_HASWINDOWRGN   0x8000
#define GETTOPMOSTINSERTAFTER(pwnd)   (gHardErrorHandler.pti == NULL ? NULL : GetTopMostInsertAfter(pwnd))
#define SMIN_CLEAR   0
#define SMIN_SET   1
#define xxxPeekMessage(lpmsg, hwnd, wMsgMin, wMsgMax, wRemoveMsg)   xxxInternalGetMessage(lpmsg, hwnd, wMsgMin, wMsgMax, wRemoveMsg, FALSE)
#define xxxGetMessage(lpmsg, hwnd, wMsgMin, wMsgMax)   xxxInternalGetMessage(lpmsg, hwnd, wMsgMin, wMsgMax, PM_REMOVE, TRUE)
#define WMSG_MAGIC_VALUE   0xBABE
#define TestRawKeyDown(vk)   TestKeyDownBit(gafRawKeyState, vk)
#define SetRawKeyDown(vk)   SetKeyDownBit(gafRawKeyState, vk)
#define ClearRawKeyDown(vk)   ClearKeyDownBit(gafRawKeyState, vk)
#define TestRawKeyToggle(vk)   TestKeyToggleBit(gafRawKeyState, vk)
#define SetRawKeyToggle(vk)   SetKeyToggleBit(gafRawKeyState, vk)
#define ClearRawKeyToggle(vk)   ClearKeyToggleBit(gafRawKeyState, vk)
#define ToggleRawKeyToggle(vk)   ToggleKeyToggleBit(gafRawKeyState, vk)
#define xxxSetWindowLongPtr   xxxSetWindowLong
#define __GetWindowLong(pwnd, index)   ((LONG)(*(DWORD UNALIGNED *)((BYTE *)((pwnd) + 1) + (index))))
#define __GetWindowLongPtr(pwnd, index)   ((LONG_PTR)(*(ULONG_PTR UNALIGNED *)((BYTE *)((pwnd) + 1) + (index))))
#define _GetWindowLong   __GetWindowLong
#define _GetWindowLongPtr   __GetWindowLongPtr
#define STW_SAME   ((PWND) 1)
#define FDoTray()   (SYSMET(ARRANGE) & ARW_HIDE)
#define FCallHookTray()   (IsHooked(PtiCurrent(), WHF_SHELL))
#define FPostTray(p)   (p->pDeskInfo->spwndTaskman)
#define FCallTray(p)   (FDoTray() && ( FCallHookTray()|| FPostTray(p) ))
#define FTopLevel(pwnd)   (pwnd->spwndParent == PWNDDESKTOP(pwnd))
#define FHas31TrayStyles(pwnd)
#define xxxSetScrollInfo(a, b, c, d)   xxxSetScrollBar((a),(b),(c),(d))
#define LockQCursor(pq, pcur)   Lock(&pq->spcurCurrent, pcur)
#define GETPCI(pcur)   ((PCURSINFO)&(pcur->CI_FIRST))
#define DbgValidateHooks(phk, iType)
#define CXF_IS_SERVER   0x0001
#define CXF_TERMINATE_POSTED   0x0002
#define CXF_PARTNER_WINDOW_DIED   0x0004
#define CXF_INTRA_PROCESS   0x8000
#define xxxSetClassLongPtr   xxxSetClassLong
#define ACTIVATE_ARRAY_SIZE   5
#define WHERE_NOONE_CAN_SEE_ME   ((int) -32000)
#define OCR_APPSTARTING   32650
#define WEF_USEPWNDTHREAD   0x0001
#define WEF_DEFERNOTIFY   0x0002
#define WEF_ASYNC   0x0004
#define WEF_POSTED   0x0008
#define DeferWinEventNotify()
#define IsWinEventNotifyDeferred()   (gdwDeferWinEvent > 0)
#define IsWinEventNotifyDeferredOK()   (!IsWinEventNotifyDeferred() || ISATOMICCHECK())
#define zzzEndDeferWinEventNotify()
#define EndDeferWinEventNotifyWithoutProcessing()
#define zzzWindowEvent(event, pwnd, idObject, idChild, dwFlags)
#define LANGTOGGLEKEYS_SIZE   3
#define ACCF_DEFAULTFILTERKEYSON   0x00000001
#define ACCF_DEFAULTSTICKYKEYSON   0x00000002
#define ACCF_DEFAULTMOUSEKEYSON   0x00000004
#define ACCF_DEFAULTTOGGLEKEYSON   0x00000008
#define ACCF_DEFAULTTIMEOUTON   0x00000010
#define ACCF_DEFAULTKEYBOARDPREF   0x00000020
#define ACCF_DEFAULTSCREENREADER   0x00000040
#define ACCF_DEFAULTHIGHCONTRASTON   0x00000080
#define ACCF_ACCESSENABLED   0x00000100
#define ACCF_IGNOREBREAKCODE   0x00000400
#define ACCF_FKMAKECODEPROCESSED   0x00000800
#define ACCF_MKVIRTUALMOUSE   0x00001000
#define ACCF_MKREPEATVK   0x00002000
#define ACCF_FIRSTTICK   0x00004000
#define ACCF_SHOWSOUNDSON   0x00008000
#define PUDF_ANIMATE   0x00010000
#define ACCF_KEYBOARDPREF   0x00020000
#define ACCF_SCREENREADER   0x00040000
#define PUDF_BEEP   0x00080000 /* Warning beeps allowed? */
#define PUDF_EXTENDEDSOUNDS   0x00100000 /* Extended sounds enabling */
#define PUDF_DRAGFULLWINDOWS   0x00200000 /* Drag xor rect or full windows */
#define PUDF_ICONTITLEWRAP   0x00400000 /* Wrap icon titles or just use single line */
#define PUDF_FONTSARELOADED   0x00800000
#define PUDF_POPUPINUSE   0x01000000
#define PUDF_MENUSTATEINUSE   0x02000000
#define PUDF_VDMBOUNDSACTIVE   0x04000000
#define PUDF_ALLOWFOREGROUNDACTIVATE   0x08000000
#define PUDF_DRAGGINGFULLWINDOW   0x10000000
#define PUDF_LOCKFULLSCREEN   0x20000000
#define PUDF_GSMWPINUSE   0x40000000
#define TEST_ACCF(f)   TEST_FLAG(gdwPUDFlags, f)
#define TEST_BOOL_ACCF(f)   TEST_BOOL_FLAG(gdwPUDFlags, f)
#define SET_ACCF(f)   SET_FLAG(gdwPUDFlags, f)
#define CLEAR_ACCF(f)   CLEAR_FLAG(gdwPUDFlags, f)
#define SET_OR_CLEAR_ACCF(f, fSet)   SET_OR_CLEAR_FLAG(gdwPUDFlags, f, fSet)
#define TOGGLE_ACCF(f)   TOGGLE_FLAG(gdwPUDFlags, f)
#define TEST_PUDF(f)   TEST_FLAG(gdwPUDFlags, f)
#define TEST_BOOL_PUDF(f)   TEST_BOOL_FLAG(gdwPUDFlags, f)
#define SET_PUDF(f)   SET_FLAG(gdwPUDFlags, f)
#define CLEAR_PUDF(f)   CLEAR_FLAG(gdwPUDFlags, f)
#define SET_OR_CLEAR_PUDF(f, fSet)   SET_OR_CLEAR_FLAG(gdwPUDFlags, f, fSet)
#define TOGGLE_PUDF(f)   TOGGLE_FLAG(gdwPUDFlags, f)
#define POWERON_PHASE   -1
#define LOWPOWER_PHASE   1
#define POWEROFF_PHASE   2
#define TestALPHA(uSetting)   (!gbDisableAlpha && TestEffectUP(uSetting))
#define HTEXSCROLLFIRST   60
#define HTSCROLLUP   60
#define HTSCROLLDOWN   61
#define HTSCROLLUPPAGE   62
#define HTSCROLLDOWNPAGE   63
#define HTSCROLLTHUMB   64
#define HTEXSCROLLLAST   64
#define HTEXMENUFIRST   65
#define HTMDISYSMENU   65
#define HTMDIMAXBUTTON   66
#define HTMDIMINBUTTON   67
#define HTMDICLOSE   68
#define HTMENUITEM   69
#define HTEXMENULAST   69
#define SHRSTR(ppi, s)   SharedRebaseToClient(ppi, gpsi->s)
#define STR_COLORSTART   STR_SCROLLBAR
#define STR_COLOREND   STR_GRADIENTINACTIVECAPTION
#define FADE_SHOW   0x00000001
#define FADE_COMPLETED   0x00000002
#define FADE_SHOWN   0x00000004
#define FADE_WINDOW   0x00000008
#define FADE_MENU   0x00000010
#define FADE_TOOLTIP   0x00000020
#define INITIAL_USER_HANDLE_QUOTA   10000
#define MINIMUM_USER_HANDLE_QUOTA   200
#define INITIAL_POSTMESSAGE_LIMIT   10000
#define MINIMUM_POSTMESSAGE_LIMIT   4000
#define PMAP_COLORS   0
#define PMAP_CURSORS   1
#define PMAP_WINDOWSM   2
#define PMAP_WINDOWSU   3
#define PMAP_DESKTOP   4
#define PMAP_ICONS   5
#define PMAP_FONTS   6
#define PMAP_TRUETYPE   7
#define PMAP_KBDLAYOUT   8
#define PMAP_INPUT   9
#define PMAP_COMPAT   10
#define PMAP_SUBSYSTEMS   11
#define PMAP_BEEP   12
#define PMAP_MOUSE   13
#define PMAP_KEYBOARD   14
#define PMAP_STICKYKEYS   15
#define PMAP_KEYBOARDRESPONSE   16
#define PMAP_MOUSEKEYS   17
#define PMAP_TOGGLEKEYS   18
#define PMAP_TIMEOUT   19
#define PMAP_SOUNDSENTRY   20
#define PMAP_SHOWSOUNDS   21
#define PMAP_AEDEBUG   22
#define PMAP_NETWORK   23
#define PMAP_METRICS   24
#define PMAP_UKBDLAYOUT   25
#define PMAP_UKBDLAYOUTTOGGLE   26
#define PMAP_WINLOGON   27
#define PMAP_KEYBOARDPREF   28
#define PMAP_SCREENREADER   29
#define PMAP_HIGHCONTRAST   30
#define PMAP_IMECOMPAT   31
#define PMAP_IMM   32
#define PMAP_POOLLIMITS   33
#define PMAP_COMPAT32   34
#define PMAP_SETUPPROGRAMNAMES   35
#define PMAP_INPUTMETHOD   36
#define PMAP_COMPAT2   37
#define PMAP_MOUCLASS_PARAMS   38
#define PMAP_KBDCLASS_PARAMS   39
#define PMAP_LAST   39
#define MAXPROFILEBUF   256
#define POLICY_NONE   0x0001
#define POLICY_USER   0x0002
#define POLICY_MACHINE   0x0004
#define POLICY_ALL   (POLICY_NONE | POLICY_USER | POLICY_MACHINE)
#define BORDER_EXTRA   3
#define DBGIncModalMenuCount()
#define DBGDecModalMenuCount()
#define UP(uSetting)   UPDWORDValue(SPI_GET ## uSetting)
#define IMESHOWSTATUS_NOTINITIALIZED   ((BOOL)0xffff)
#define IsWndImeRelated(pwnd)
#define HF_DESKTOPHOOK   0
#define HF_PROTECTED   1
#define HF_LIMIT   2
#define HMONITOR_PRIMARY   ((HMONITOR)0x00010000)
#define REBASESHAREDPTR(p)   (p)
#define REBASESHAREDPTRALWAYS(p)   (p)
#define REMOVE_FROM_LIST(type, pstart, pitem, next)
#define HH_DRIVERENTRY   0x00000001
#define HH_USERINITIALIZE   0x00000002
#define HH_INITVIDEO   0x00000004
#define HH_REMOTECONNECT   0x00000008
#define HH_REMOTEDISCONNECT   0x00000010
#define HH_REMOTERECONNECT   0x00000020
#define HH_REMOTELOGOFF   0x00000040
#define HH_DRIVERUNLOAD   0x00000080
#define HH_GRECLEANUP   0x00000100
#define HH_USERKCLEANUP   0x00000200
#define HH_INITIATEWIN32KCLEANUP   0x00000400
#define HH_ALLDTGONE   0x00000800
#define HH_RITGONE   0x00001000
#define HH_RITCREATED   0x00002000
#define HH_LOADCURSORS   0x00004000
#define HH_KBDLYOUTGLOBALCLEANUP   0x00008000
#define HH_KBDLYOUTFREEWINSTA   0x00010000
#define HH_CLEANUPRESOURCES   0x00020000
#define HH_DISCONNECTDESKTOP   0x00040000
#define HH_DTQUITPOSTED   0x00080000
#define HYDRA_HINT(ev)   (gdwHydraHint |= ev)
#define DbgTrackAddDesktop(pdesk)
#define DbgTrackRemoveDesktop(pdesk)
#define DbgDumpTrackedDesktops(b)
#define TRACE_HYDAPI(m)
#define TRACE_DESKTOP(m)
#define TRACE_RIT(m)

Typedefs

typedef tagEVENTHOOKPEVENTHOOK
typedef tagNOTIFYPNOTIFY
typedef tagPERFINFO PERFHANDLEINFO
typedef tagPERFINFOPPERFHANDLEINFO
typedef _HANDLEPAGE HANDLEPAGE
typedef _HANDLEPAGEPHANDLEPAGE
typedef tagWPINFO WPINFO
typedef tagCRITSTACK CRITSTACK
typedef tagCRITSTACKPCRITSTACK
typedef tagGENERIC_DEVICE_INFO GENERIC_DEVICE_INFO
typedef tagGENERIC_DEVICE_INFOPGENERIC_DEVICE_INFO
typedef tagMOUSE_DEVICE_INFO MOUSE_DEVICE_INFO
typedef tagMOUSE_DEVICE_INFOPMOUSE_DEVICE_INFO
typedef tagKEYBOARD_DEVICE_INFO KEYBOARD_DEVICE_INFO
typedef tagKEYBOARD_DEVICE_INFOPKEYBOARD_DEVICE_INFO
typedef tagDEVICEINFO DEVICEINFO
typedef tagDEVICEINFOPDEVICEINFO
typedef tagDEVICE_TEMPLATE DEVICE_TEMPLATE
typedef tagDEVICE_TEMPLATEPDEVICE_TEMPLATE
typedef tagMOUSEEVENT MOUSEEVENT
typedef tagMOUSEEVENTPMOUSEEVENT
typedef tagHARDERRORHANDLER HARDERRORHANDLER
typedef tagHARDERRORHANDLERPHARDERRORHANDLER
typedef tagTERMINAL TERMINAL
typedef tagTERMINALPTERMINAL
typedef tagWin32AllocStats Win32AllocStats
typedef tagWin32AllocStatsPWin32AllocStats
typedef tagPOOLRECORD POOLRECORD
typedef tagPOOLRECORDPPOOLRECORD
typedef tagAAS AAS
typedef _LOCKRECORD LOCKRECORD
typedef _LOCK LOCK
typedef _LOCKPLOCK
typedef tagCVR CVR
typedef tagCVRPCVR
typedef tagSMWP SMWP
typedef tagSMWPPSMWP
typedef tagCLIPDATA CLIPDATA
typedef tagCLIPDATAPCLIPDATA
typedef tagUSERSTARTUPINFO USERSTARTUPINFO
typedef tagUSERSTARTUPINFOPUSERSTARTUPINFO
typedef tagTLBLOCK TLBLOCK
typedef tagTLBLOCKPTLBLOCK
typedef tagKBDFILE KBDFILE
typedef tagKBDFILEPKBDFILE
typedef tagKL KL
typedef tagKLPKL
typedef tagKBDLANGTOGGLE KBDLANGTOGGLE
typedef tagDESKTOP DESKTOP
typedef tagDESKWND DESKWND
typedef tagDESKWNDPDESKWND
typedef tagWINDOWSTATION WINDOWSTATION
typedef tagCAPTIONCACHE CAPTIONCACHE
typedef tagSYSCFGICO SYSCFGICO
typedef tagACCELTABLE ACCELTABLE
typedef tagACCELTABLELPACCELTABLE
typedef tagPOPUPMENU POPUPMENU
typedef tagMENUWND MENUWND
typedef tagMENUWNDPMENUWND
typedef tagCHECKPOINT CHECKPOINT
typedef tagCHECKPOINTPCHECKPOINT
typedef tagCLIP CLIP
typedef tagCLIPPCLIP
typedef tagSVR_INSTANCE_INFO SVR_INSTANCE_INFO
typedef tagSVR_INSTANCE_INFOPSVR_INSTANCE_INFO
typedef tagPUBOBJ PUBOBJ
typedef tagPUBOBJPPUBOBJ
typedef tagQMSG QMSG
typedef _MOVESIZEDATA MOVESIZEDATA
typedef _MOVESIZEDATAPMOVESIZEDATA
typedef tagMLIST MLIST
typedef tagMLISTPMLIST
typedef tagQ Q
typedef tagATTACHINFO ATTACHINFO
typedef tagATTACHINFOPATTACHINFO
typedef tagWOWTHREADINFO WOWTHREADINFO
typedef tagWOWTHREADINFOPWOWTHREADINFO
typedef tagTDB TDB
typedef tagMENUANIDC MENUANIDC
typedef tagMENUSTATE MENUSTATE
typedef tagMENUSTATEPMENUSTATE
typedef tagLASTINPUT LASTINPUT
typedef tagLASTINPUT PLASTINPUT
typedef GRAYMENUPGRAYMENU
typedef tagSMS *KPTR_MODIFIER PSMS
typedef tagTHREADINFO THREADINFO
typedef tagWOWPROCESSINFO WOWPROCESSINFO
typedef tagWOWPROCESSINFOPWOWPROCESSINFO
typedef tagDESKTOPVIEW DESKTOPVIEW
typedef tagDESKTOPVIEWPDESKTOPVIEW
typedef tagW32JOB W32JOB
typedef tagW32JOBPW32JOB
typedef tagPROCESSINFO PROCESSINFO
typedef _LPKDRAWSWITCHWND LPKDRAWSWITCHWND
typedef tagDCE DCE
typedef tagBWL BWL
typedef tagBWLPBWL
typedef tagSPB SPB
typedef _CREATESTRUCTEX CREATESTRUCTEX
typedef _CREATESTRUCTEXPCREATESTRUCTEX
typedef _MDICREATESTRUCTEX MDICREATESTRUCTEX
typedef _MDICREATESTRUCTEXPMDICREATESTRUCTEX
typedef _CWPSTRUCTEX CWPSTRUCTEX
typedef _CWPSTRUCTEXPCWPSTRUCTEX
typedef _CWPRETSTRUCTEX CWPRETSTRUCTEX
typedef _CWPRETSTRUCTEXPCWPRETSTRUCTEX
typedef tagSMS SMS
typedef tagINTERSENDMSGEX INTRSENDMSGEX
typedef tagINTERSENDMSGEXPINTRSENDMSGEX
typedef tagASYNCSENDMSG ASYNCSENDMSG
typedef tagASYNCSENDMSGPASYNCSENDMSG
typedef tagHOOKMSGSTRUCT HOOKMSGSTRUCT
typedef tagHOOKMSGSTRUCTPHOOKMSGSTRUCT
typedef tagBROADCASTMSG BROADCASTMSG
typedef tagBROADCASTMSGPBROADCASTMSG
typedef tagHOTKEY HOTKEY
typedef tagHOTKEYPHOTKEY
typedef tagDRAWICONCB DRAWICONCB
typedef tagDRAWICONCBPDRAWICONCB
typedef * PSCANCODEMAP
typedef BITMAPINFOHEADER * PBMPHEADER
typedef BITMAPINFOHEADER * LPBMPHEADER
typedef tagTIMER TIMER
typedef tagTIMERPTIMER
typedef LRESULT(APIENTRY * SFNSCSENDMESSAGE )(PWND, UINT, WPARAM, LPARAM, ULONG_PTR, PROC, DWORD, PSMS)
typedef tagDISPLAYRESOURCE DISPLAYRESOURCE
typedef tagDISPLAYRESOURCEPDISPLAYRESOURCE
typedef tagPROFILEVALUEINFO PROFILEVALUEINFO
typedef tagPROFILEVALUEINFOPPROFILEVALUEINFO
typedef VOID(CALLBACK * MSGWAITCALLBACK )(DWORD DeviceType)
typedef tagFREELIST FREELIST
typedef tagFREELISTPFREELIST
typedef tagDDEIMP DDEIMP
typedef tagDDEIMPPDDEIMP
typedef tagDDECONV DDECONV
typedef tagDDECONVPDDECONV
typedef DWORDFNDDERESPONSE )(PDWORD pmsg, LPARAM *plParam, PDDECONV pDdeConv)
typedef FNDDERESPONSEPFNDDERESPONSE
typedef tagXSTATE XSTATE
typedef tagXSTATEPXSTATE
typedef tagMONITORPOS MONITORPOS
typedef tagMONITORPOSPMONITORPOS
typedef tagMONITORRECTS MONITORRECTS
typedef tagMONITORRECTSPMONITORRECTS
typedef tagEVENTHOOK EVENTHOOK
typedef tagNOTIFY NOTIFY
typedef HWND * PHWND
typedef tagSwitchWndInfo SWITCHWNDINFO
typedef tagSwitchWndInfoPSWINFO
typedef tagSWITCHWND SWITCHWND
typedef tagSWITCHWNDPSWITCHWND
typedef tagHOTKEYSTRUCT HOTKEYSTRUCT
typedef tagHOTKEYSTRUCTPHOTKEYSTRUCT
typedef tagPOWERSTATE POWERSTATE
typedef tagPOWERSTATEPPOWERSTATE
typedef tagFADE FADE
typedef tagFADEPFADE
typedef tagTOOLTIP TOOLTIP
typedef tagTOOLTIPWND TOOLTIPWND
typedef tagTOOLTIPWNDPTOOLTIPWND
typedef tagPROFINTINFO PROFINTINFO
typedef tagPROFINTINFOPPROFINTINFO

Functions

NTSTATUS OpenEffectiveToken (PHANDLE phToken)
NTSTATUS GetProcessLuid (PETHREAD Thread OPTIONAL, PLUID LuidProcess)
BOOLEAN IsRestricted (PETHREAD Thread)
NTSTATUS CreateSystemThread (PKSTART_ROUTINE lpThreadAddress, PVOID pvContext, PHANDLE phThread)
NTSTATUS InitSystemThread (PUNICODE_STRING pstrThreadName)
PKEVENT CreateKernelEvent (IN EVENT_TYPE Type, IN BOOLEAN State)
NTSTATUS ProtectHandle (IN HANDLE Handle, IN BOOLEAN Protect)
VOID __inline FreeKernelEvent (PVOID *pp)
BOOL HMInitHandleTable (PVOID pBase)
PVOID HMAllocObject (PTHREADINFO pti, PDESKTOP pdesk, BYTE btype, DWORD size)
BOOL HMFreeObject (PVOID pobj)
BOOL HMMarkObjectDestroy (PVOID pobj)
BOOL HMDestroyObject (PVOID pobj)
PVOID FASTCALL HMAssignmentLock (PVOID *ppobj, PVOID pobj)
PVOID FASTCALL HMAssignmentUnlock (PVOID *ppobj)
NTSTATUS HMGetStats (HANDLE hProcess, int iPidType, PVOID pResults, UINT cjResultSize)
HANDLE KernelPtoH (PVOID pObj)
void HMDestroyUnlockedObject (PHE phe)
void HMCleanupGrantedHandle (HANDLE h)
PVOID HMUnlockObjectInternal (PVOID pobj)
VOID HMChangeOwnerThread (PVOID pobj, PTHREADINFO pti)
VOID HMChangeOwnerPheProcess (PHE phe, PTHREADINFO pti)
PVOID __inline ThreadLockExchange (PVOID pobj, PTL ptl)
PVOID __inline ThreadLockExchangeAlways (PVOID pobj, PTL ptl)
PVOID ThreadUnlock1 (VOID)
VOID LockObjectAssignment (PVOID *, PVOID)
VOID UnlockObjectAssignment (PVOID *)
VOID UserDereferenceObject (PVOID pobj)
void CleanupDecSFWLockCount (PVOID pIgnore)
ULONG MonotonicTick ()
VOID ProcessKeyboardInput (PDEVICEINFO pDeviceInfo)
VOID ProcessMouseInput (PDEVICEINFO pDeviceInfo)
VOID RequestDeviceChange (PDEVICEINFO pDeviceInfo, USHORT usAction, BOOL fInDeviceInfoListCrit)
VOID RetryReadInput ()
VOID NTAPI InputApc (IN PVOID ApcContext, IN PIO_STATUS_BLOCK IoStatusBlock, IN ULONG Reserved)
ULONG GetDeviceChangeInfo (VOID)
VOID InitializeMediaChange (HANDLE)
NTSTATUS UserCommitDesktopMemory (PVOID pBase, PVOID *ppCommit, PSIZE_T pCommitSize)
NTSTATUS UserCommitSharedMemory (PVOID pBase, PVOID *ppCommit, PSIZE_T pCommitSize)
PWIN32HEAP UserCreateHeap (HANDLE hSection, ULONG ulViewOffset, PVOID pvBaseAddress, DWORD dwSize, PRTL_HEAP_COMMIT_ROUTINE pfnCommit)
PVOID __inline SharedAlloc (ULONG cb)
BOOL __inline SharedFree (PVOID pv)
NTSTATUS CommitReadOnlyMemory (HANDLE hSection, PSIZE_T pulCommit, DWORD dwCommitOffset, int *pdCommit)
void DeleteMaybeSpecialRgn (HRGN hrgn)
BOOL zzzInvalidateDCCache (PWND pwndInvalid, DWORD flags)
void RtlInitUnicodeStringOrId (PUNICODE_STRING pstrName, LPWSTR lpstrName)
int RtlLoadStringOrError (UINT, LPTSTR, int, WORD)
HANDLE xxxClientLoadImage (PUNICODE_STRING pstrName, ATOM atomModName, WORD wImageType, int cxSize, int cySize, UINT LR_flags, BOOL fWallpaper)
HANDLE xxxClientCopyImage (IN HANDLE hImage, IN UINT uImageType, IN int cxDesired, IN int cyDesired, IN UINT LR_flags)
PMENU xxxClientLoadMenu (HANDLE hmod, PUNICODE_STRING pstrName)
int xxxClientAddFontResourceW (PUNICODE_STRING, DWORD, DESIGNVECTOR *)
VOID ClientFontSweep (VOID)
VOID ClientLoadLocalT1Fonts ()
VOID ClientLoadRemoteT1Fonts ()
NTSTATUS InitializeClientPfnArrays (CONST PFNCLIENT *ppfnClientA, CONST PFNCLIENT *ppfnClientW, CONST PFNCLIENTWORKER *ppfnClientWorker, HANDLE hModUser)
VOID _SetRipFlags (DWORD, DWORD)
VOID _SetDbgTag (int, DWORD)
BOOL xxxActivateApp (PWND pwnd, AAS *paas)
void DestroySMWP (PSMWP psmwp)
PKL HKLtoPKL (PTHREADINFO pti, HKL hkl)
PVOID DesktopAlloc (PDESKTOP pdesk, UINT uSize, DWORD tag)
DWORD WaitOnPseudoEvent (HANDLE *phE, DWORD dwMilliseconds)
VOID xxxInternalKeyEventDirect (BYTE bVk, WORD wScan, DWORD dwFlags, DWORD dwTime, ULONG_PTR dwExtraInfo)
UINT xxxSendInput (UINT nInputs, LPINPUT pInputs)
BOOL _BlockInput (BOOL fBlockIt)
int _GetMouseMovePointsEx (CONST MOUSEMOVEPOINT *ppt, MOUSEMOVEPOINT *pptBuf, UINT nPoints, DWORD resolution)
VOID xxxProcessKeyEvent (PKE pke, ULONG_PTR ExtraInformation, BOOL bInjected)
VOID xxxButtonEvent (DWORD ButtonNumber, POINT ptPointer, BOOL fBreak, DWORD time, ULONG_PTR ExtraInfo, BOOL bInjected, BOOL fDblClk)
VOID xxxMoveEvent (LONG dx, LONG dy, DWORD dwFlags, ULONG_PTR dwExtraInfo, DWORD time, BOOL bInjected)
PDEVICEINFO StartDeviceRead (PDEVICEINFO pDeviceInfo)
NTSTATUS DeviceNotify (IN PPLUGPLAY_NOTIFY_HDR pNotification, IN PDEVICEINFO pDeviceInfo)
LONG CalculateMouseSensitivity (LONG lSens)
PDEVICEINFO FreeDeviceInfo (PDEVICEINFO pMouseInfo)
VOID QueueMouseEvent (USHORT ButtonFlags, USHORT ButtonData, ULONG_PTR ExtraInfo, POINT ptMouse, LONG time, BOOL bInjected, BOOL bWakeRIT)
BOOL UnqueueMouseEvent (PMOUSEEVENT pme)
BYTE VKFromVSC (PKE pke, BYTE bPrefix, LPBYTE afKeyState)
BOOL KEOEMProcs (PKE pke)
BOOL xxxKELocaleProcs (PKE pke)
BOOL xxxKENLSProcs (PKE pke, ULONG_PTR dwExtraInformation)
VOID xxxKeyEvent (USHORT usVk, WORD wScanCode, DWORD time, ULONG_PTR ExtraInfo, BOOL bInjected)
void xxxSimpleDoSyncPaint (PWND pwnd)
VOID xxxDoSyncPaint (PWND pwnd, DWORD flags)
void xxxInternalDoSyncPaint (PWND pwnd, DWORD flags)
BOOL xxxDrawAnimatedRects (PWND pwndClip, int idAnimation, LPRECT lprcStart, LPRECT lprcEnd)
UINT_PTR InternalSetTimer (PWND pwnd, UINT_PTR nIDEvent, UINT dwElapse, TIMERPROC_PWND pTimerFunc, UINT flags)
VOID FreeTimer (PTIMER ptmr)
 SMESSAGEPROTO (SENTDDEMSG)
 SMESSAGEPROTO (DDEINIT)
 SMESSAGEPROTO (DWORD)
 SMESSAGEPROTO (INWPARAMCHAR)
 SMESSAGEPROTO (INWPARAMDBCSCHAR)
 SMESSAGEPROTO (GETTEXTLENGTHS)
 SMESSAGEPROTO (GETDBCSTEXTLENGTHS)
 SMESSAGEPROTO (INLPCREATESTRUCT)
 SMESSAGEPROTO (INLPDROPSTRUCT)
 SMESSAGEPROTO (INOUTLPPOINT5)
 SMESSAGEPROTO (INOUTLPSCROLLINFO)
 SMESSAGEPROTO (INOUTLPRECT)
 SMESSAGEPROTO (INOUTNCCALCSIZE)
 SMESSAGEPROTO (OUTLPRECT)
 SMESSAGEPROTO (INLPMDICREATESTRUCT)
 SMESSAGEPROTO (INLPCOMPAREITEMSTRUCT)
 SMESSAGEPROTO (INLPDELETEITEMSTRUCT)
 SMESSAGEPROTO (INLPHLPSTRUCT)
 SMESSAGEPROTO (INLPHELPINFOSTRUCT)
 SMESSAGEPROTO (INLPDRAWITEMSTRUCT)
 SMESSAGEPROTO (INOUTLPMEASUREITEMSTRUCT)
 SMESSAGEPROTO (INSTRING)
 SMESSAGEPROTO (INPOSTEDSTRING)
 SMESSAGEPROTO (OUTSTRING)
 SMESSAGEPROTO (INCNTOUTSTRING)
 SMESSAGEPROTO (POUTLPINT)
 SMESSAGEPROTO (POPTINLPUINT)
 SMESSAGEPROTO (INOUTLPWINDOWPOS)
 SMESSAGEPROTO (INLPWINDOWPOS)
 SMESSAGEPROTO (INLBOXSTRING)
 SMESSAGEPROTO (OUTLBOXSTRING)
 SMESSAGEPROTO (INCBOXSTRING)
 SMESSAGEPROTO (OUTCBOXSTRING)
 SMESSAGEPROTO (INOUTDRAG)
 SMESSAGEPROTO (FULLSCREEN)
 SMESSAGEPROTO (INPAINTCLIPBRD)
 SMESSAGEPROTO (INSIZECLIPBRD)
 SMESSAGEPROTO (OUTDWORDDWORD)
 SMESSAGEPROTO (OUTDWORDINDWORD)
 SMESSAGEPROTO (OPTOUTLPDWORDOPTOUTLPDWORD)
 SMESSAGEPROTO (COPYGLOBALDATA)
 SMESSAGEPROTO (COPYDATA)
 SMESSAGEPROTO (INDESTROYCLIPBRD)
 SMESSAGEPROTO (INOUTNEXTMENU)
 SMESSAGEPROTO (INOUTSTYLECHANGE)
 SMESSAGEPROTO (IMAGEIN)
 SMESSAGEPROTO (IMAGEOUT)
 SMESSAGEPROTO (INDEVICECHANGE)
 SMESSAGEPROTO (INOUTMENUGETOBJECT)
 SMESSAGEPROTO (POWERBROADCAST)
 SMESSAGEPROTO (LOGONNOTIFY)
 SMESSAGEPROTO (IMECONTROL)
 SMESSAGEPROTO (IMEREQUEST)
 SMESSAGEPROTO (INLPKDRAWSWITCHWND)
DWORD _GetWindowContextHelpId (PWND pwnd)
BOOL _SetWindowContextHelpId (PWND pwnd, DWORD dwContextId)
void xxxSendHelpMessage (PWND pwnd, int iType, int iCtrlId, HANDLE hItemHandle, DWORD dwContextId)
HPALETTE _SelectPalette (HDC hdc, HPALETTE hpalette, BOOL fForceBackground)
int xxxRealizePalette (HDC hdc)
VOID xxxFlushPalette (PWND pwnd)
VOID xxxBroadcastPaletteChanged (PWND pwnd, BOOL fForceDesktop)
PCURSOR SearchIconCache (PCURSOR pCursorCache, ATOM atomModName, PUNICODE_STRING pstrResName, PCURSOR pCursorSrc, PCURSORFIND pcfSearch)
VOID ZombieCursor (PCURSOR pcur)
BOOL IsSmallerThanScreen (PWND pwnd)
BOOL zzzSetSystemCursor (PCURSOR pcur, DWORD id)
BOOL zzzSetSystemImage (PCURSOR pcur, PCURSOR pcurOld)
BOOL _InternalGetIconInfo (IN PCURSOR pcur, OUT PICONINFO piconinfo, OUT OPTIONAL PUNICODE_STRING pstrModName, OUT OPTIONAL PUNICODE_STRING pstrResName, OUT OPTIONAL LPDWORD pbpp, IN BOOL fInternalCursor)
VOID LinkCursor (PCURSOR pcur)
BOOL _SetCursorIconData (PCURSOR pcur, PUNICODE_STRING pstrModName, PUNICODE_STRING pstrResName, PCURSORDATA pData, DWORD cbData)
PCURSOR _GetCursorFrameInfo (PCURSOR pcur, int iFrame, PJIF pjifRate, LPINT pccur)
PCURSOR _FindExistingCursorIcon (ATOM atomModName, PUNICODE_STRING pstrResName, PCURSOR pcurSrc, PCURSORFIND pcfSearch)
HCURSOR _CreateEmptyCursorObject (BOOL fPublic)
BOOL _GetUserObjectInformation (HANDLE h, int nIndex, PVOID pvInfo, DWORD nLength, LPDWORD lpnLengthNeeded)
BOOL _SetUserObjectInformation (HANDLE h, int nIndex, PVOID pvInfo, DWORD nLength)
DWORD xxxWaitForInputIdle (ULONG_PTR idProcess, DWORD dwMilliseconds, BOOL fSharedWow)
VOID StartScreenSaver (BOOL bOnlyIfSecure)
UINT InternalMapVirtualKeyEx (UINT wCode, UINT wType, PKBDTABLES pKbdTbl)
SHORT InternalVkKeyScanEx (WCHAR cChar, PKBDTABLES pKbdTbl)
PWND ParentNeedsPaint (PWND pwnd)
VOID SetHungFlag (PWND pwnd, WORD wFlag)
VOID ClearHungFlag (PWND pwnd, WORD wFlag)
BOOL _DdeSetQualityOfService (PWND pwndClient, CONST PSECURITY_QUALITY_OF_SERVICE pqosNew, PSECURITY_QUALITY_OF_SERVICE pqosOld)
BOOL _DdeGetQualityOfService (PWND pwndClient, PWND pwndServer, PSECURITY_QUALITY_OF_SERVICE pqos)
BOOL QueryTrackMouseEvent (LPTRACKMOUSEEVENT lpTME)
void CancelMouseHover (PQ pq)
void ResetMouseTracking (PQ pq, PWND pwnd)
void _SetIMEShowStatus (BOOL fShow)
BOOL _GetIMEShowStatus (VOID)
PWND _FindWindowEx (PWND pwndParent, PWND pwndChild, LPCWSTR pszClass, LPCWSTR pszName, DWORD dwType)
UINT APIENTRY GreSetTextAlign (HDC, UINT)
UINT APIENTRY GreGetTextAlign (HDC)
PWND FASTCALL ValidateHwnd (HWND hwnd)
NTSTATUS ValidateHwinsta (HWINSTA, KPROCESSOR_MODE, ACCESS_MASK, PWINDOWSTATION *)
NTSTATUS ValidateHdesk (HDESK, KPROCESSOR_MODE, ACCESS_MASK, PDESKTOP *)
PMENU ValidateHmenu (HMENU hmenu)
PMONITOR ValidateHmonitor (HMONITOR hmonitor)
HRGN UserValidateCopyRgn (HRGN)
BOOL ValidateHandleSecure (HANDLE h)
NTSTATUS UserJobCallout (PKWIN32_JOBCALLOUT_PARAMETERS Parm)
BOOL RemoveProcessFromJob (PPROCESSINFO ppi)
BOOL xxxActivateDebugger (UINT fsModifiers)
void ClientDied (void)
VOID SendMsgCleanup (PTHREADINFO ptiCurrent)
VOID ReceiverDied (PSMS psms, PSMS *ppsmsUnlink)
LRESULT xxxInterSendMsgEx (PWND, UINT, WPARAM, LPARAM, PTHREADINFO, PTHREADINFO, PINTRSENDMSGEX)
VOID ClearSendMessages (PWND pwnd)
PPCLS GetClassPtr (ATOM atom, PPROCESSINFO ppi, HANDLE hModule)
BOOL ReferenceClass (PCLS pcls, PWND pwnd)
VOID DereferenceClass (PWND pwnd)
ULONG_PTR MapClientToServerPfn (ULONG_PTR dw)
VOID xxxReceiveMessage (PTHREADINFO)
PBWL BuildHwndList (PWND pwnd, UINT flags, PTHREADINFO ptiOwner)
VOID FreeHwndList (PBWL pbwl)
PWND xxxMinMaximize (PWND pwnd, UINT cmd, DWORD dwFlags)
void xxxMinimizeHungWindow (PWND pwnd)
VOID xxxInitSendValidateMinMaxInfo (PWND pwnd, LPMINMAXINFO lpmmi)
HRGN CreateEmptyRgn (void)
HRGN CreateEmptyRgnPublic (void)
HRGN SetOrCreateRectRgnIndirectPublic (HRGN *phrgn, LPCRECT lprc)
BOOL SetEmptyRgn (HRGN hrgn)
BOOL SetRectRgnIndirect (HRGN hrgn, LPCRECT lprc)
NTSTATUS xxxRegisterForDeviceClassNotifications ()
BOOL xxxInitInput (PTERMINAL)
VOID InitMice ()
void UpdateMouseInfo (void)
BOOL OpenMouse (PDEVICEINFO pMouseInfo)
void ProcessDeviceChanges (DWORD DeviceType)
PDEVICEINFO CreateDeviceInfo (DWORD DeviceType, PUNICODE_STRING SymbolicLinkName, BYTE bFlags)
void InitKeyboard (void)
UINT xxxHardErrorControl (DWORD, HANDLE, PDESKRESTOREDATA)
VOID SetKeyboardRate (UINT nKeySpeed)
VOID RecolorDeskPattern ()
BOOL xxxInitWindowStation (PWINDOWSTATION)
VOID zzzInternalSetCursorPos (int x, int y)
VOID UpdateKeyLights (BOOL bInjected)
VOID SetDebugHotKeys ()
VOID BoundCursor (LPPOINT lppt)
void DestroyKF (PKBDFILE pkf)
VOID DestroyKL (PKL pkl)
BOOL xxxSetDeskPattern (PUNICODE_STRING pProfileUserName, LPWSTR lpPat, BOOL fCreation)
BOOL xxxSetDeskWallpaper (PUNICODE_STRING pProfileUserName, LPWSTR lpszFile)
HPALETTE CreateDIBPalette (LPBITMAPINFOHEADER pbmih, UINT colors)
BOOL CalcVisRgn (HRGN *hrgn, PWND pwndOrg, PWND pwndClip, DWORD flags)
NTSTATUS xxxCreateThreadInfo (PETHREAD, BOOL)
BOOL DestroyProcessInfo (PW32PROCESS)
VOID xxxDesktopThread (PTERMINAL pTerm)
VOID ForceEmptyClipboard (PWINDOWSTATION)
NTSTATUS zzzInitTask (UINT dwExpWinVer, DWORD dwAppCompatFlags, PUNICODE_STRING pstrModName, PUNICODE_STRING pstrBaseFileName, DWORD hTaskWow, DWORD dwHotkey, DWORD idTask, DWORD dwX, DWORD dwY, DWORD dwXSize, DWORD dwYSize)
VOID DestroyTask (PPROCESSINFO ppi, PTHREADINFO ptiToRemove)
void PostInputMessage (PQ pq, PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam, DWORD time, ULONG_PTR dwExtraInfo)
BOOL xxxSleepThread (UINT fsWakeMask, DWORD Timeout, BOOL fForegroundIdle)
VOID SetWakeBit (PTHREADINFO pti, UINT wWakeBit)
VOID WakeSomeone (PQ pq, UINT message, PQMSG pqmsg)
VOID ClearWakeBit (PTHREADINFO pti, UINT wWakeBit, BOOL fSysCheck)
NTSTATUS xxxInitProcessInfo (PW32PROCESS)
PTHREADINFO PtiFromThreadId (DWORD idThread)
BOOL zzzAttachThreadInput (PTHREADINFO ptiAttach, PTHREADINFO ptiAttachTo, BOOL fAttach)
BOOL zzzReattachThreads (BOOL fJournalAttach)
PQ AllocQueue (PTHREADINFO, PQ)
VOID FreeQueue (PQ pq)
VOID FreeCachedQueues (VOID)
VOID CleanupGDI (VOID)
VOID CleanupResources (VOID)
void zzzDestroyQueue (PQ pq, PTHREADINFO pti)
PQMSG AllocQEntry (PMLIST pml)
__inline void FreeQEntry (PQMSG pqmsg)
void DelQEntry (PMLIST pml, PQMSG pqmsg)
void zzzAttachToQueue (PTHREADINFO pti, PQ pqAttach, PQ pqJournal, BOOL fJoiningForeground)
VOID xxxProcessEventMessage (PTHREADINFO ptiCurrent, PQMSG pqmsg)
VOID xxxProcessSetWindowPosEvent (PSMWP psmwpT)
VOID xxxProcessAsyncSendMessage (PASYNCSENDMSG pmsg)
BOOL PostEventMessage (PTHREADINFO pti, PQ pq, DWORD dwQEvent, PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam)
BOOL DoPaint (PWND pwndFilter, LPMSG lpMsg)
BOOL DoTimer (PWND pwndFilter)
BOOL CheckPwndFilter (PWND pwnd, PWND pwndFilter)
HWND xxxWindowHitTest (PWND pwnd, POINT pt, int *pipos, DWORD dwHitTestFlags)
HWND xxxWindowHitTest2 (PWND pwnd, POINT pt, int *pipos, DWORD dwHitTestFlags)
PWND SpeedHitTest (PWND pwndParent, POINT pt)
VOID xxxDeactivate (PTHREADINFO pti, DWORD tidSetForeground)
BOOL xxxSetForegroundWindow2 (PWND pwnd, PTHREADINFO ptiCurrent, DWORD fFlags)
VOID SetForegroundThread (PTHREADINFO pti)
VOID xxxSendFocusMessages (PTHREADINFO pti, PWND pwndReceive)
BOOL FBadWindow (PWND pwnd)
BOOL xxxActivateThisWindow (PWND pwnd, DWORD tidLoseForeground, DWORD fFlags)
BOOL xxxActivateWindow (PWND pwnd, UINT cmd)
PWND NextTopWindow (PTHREADINFO pti, PWND pwnd, PWND pwndSkip, DWORD flags)
int xxxMouseActivate (PTHREADINFO pti, PWND pwnd, UINT message, WPARAM wParam, LPPOINT lppt, int ht)
int UT_GetParentDCClipBox (PWND pwnd, HDC hdc, LPRECT lprc)
VOID UpdateAsyncKeyState (PQ pq, UINT wVK, BOOL fBreak)
void PostUpdateKeyStateEvent (PQ pq)
void ProcessUpdateKeyStateEvent (PQ pq, CONST PBYTE pbKeyState, CONST PBYTE pbRecentDown)
BOOL InternalSetProp (PWND pwnd, LPWSTR pszKey, HANDLE hData, DWORD dwFlags)
HANDLE InternalRemoveProp (PWND pwnd, LPWSTR pszKey, BOOL fInternal)
VOID DeleteProperties (PWND pwnd)
CHECKPOINTCkptRestore (PWND pwnd, LPCRECT lprcWindow)
UINT_PTR _SetTimer (PWND pwnd, UINT_PTR nIDEvent, UINT dwElapse, TIMERPROC_PWND pTimerFunc)
BOOL KillTimer2 (PWND pwnd, UINT_PTR nIDEvent, BOOL fSystemTimer)
VOID DestroyThreadsTimers (PTHREADINFO pti)
VOID DecTimerCount (PTHREADINFO pti)
VOID zzzInternalShowCaret ()
VOID zzzInternalHideCaret ()
VOID zzzInternalDestroyCaret ()
VOID ChangeAcquireResourceType (VOID)
VOID EnterCrit (VOID)
VOID EnterSharedCrit (VOID)
VOID LeaveCrit (VOID)
VOID _AssertCritIn (VOID)
VOID _AssertDeviceInfoListCritIn (VOID)
VOID _AssertCritInShared (VOID)
VOID _AssertCritOut (VOID)
VOID _AssertDeviceInfoListCritOut (VOID)
NTSTATUS _KeUserModeCallback (IN ULONG ApiNumber, IN PVOID InputBuffer, IN ULONG InputLength, OUT PVOID *OutputBuffer, OUT PULONG OutputLength)
NTSTATUS __inline LockProcessByClientId (HANDLE dwProcessId, PEPROCESS *ppEProcess)
NTSTATUS __inline LockThreadByClientId (HANDLE dwThreadId, PETHREAD *ppEThread)
BOOL IsSAS (BYTE vk, UINT *pfsModifiers)
BOOL xxxDoHotKeyStuff (UINT vk, BOOL fBreak, DWORD fsReserveKeys)
PHOTKEY IsHotKey (UINT fsModifiers, UINT vk)
BOOL InitCreateUserCrit (VOID)
PMDEV InitVideo (BOOL bReenumerationNeeded)
BOOL InitUserScreen ()
VOID InitLoadResources ()
VOID xxxUserResetDisplayDevice ()
PSECURITY_DESCRIPTOR CreateSecurityDescriptor (PACCESS_ALLOWED_ACE paceList, DWORD cbAce, BOOLEAN fDaclDefaulted)
PACCESS_ALLOWED_ACE AllocAce (PACCESS_ALLOWED_ACE pace, BYTE bType, BYTE bFlags, ACCESS_MASK am, PSID psid, LPDWORD lpdwLength)
BOOL CheckGrantedAccess (ACCESS_MASK, ACCESS_MASK)
BOOL AccessCheckObject (PVOID, ACCESS_MASK, KPROCESSOR_MODE, CONST GENERIC_MAPPING *)
BOOL InitSecurity (VOID)
BOOL IsPrivileged (PPRIVILEGE_SET ppSet)
BOOL CheckWinstaWriteAttributesAccess (void)
NTSTATUS xxxUserDuplicateObject (HANDLE SourceProcessHandle, HANDLE SourceHandle, HANDLE TargetProcessHandle, PHANDLE TargetHandle, ACCESS_MASK DesiredAccess, ULONG HandleAttributes, ULONG Options)
HWINSTA xxxConnectService (PUNICODE_STRING, HDESK *)
NTSTATUS TestForInteractiveUser (PLUID pluidCaller)
NTSTATUS _UserTestForWinStaAccess (PUNICODE_STRING pstrWinSta, BOOL fInherit)
HDESK xxxResolveDesktop (HANDLE hProcess, PUNICODE_STRING pstrDesktop, HWINSTA *phwinsta, BOOL fInherit, BOOL *pbShutDown)
NTSTATUS xxxResolveDesktopForWOW (IN OUT PUNICODE_STRING pstrDesktop)
WORD xxxClientWOWGetProcModule (WNDPROC_PWND pfn)
PVOID _MapDesktopObject (HANDLE h)
PDESKTOPVIEW GetDesktopView (PPROCESSINFO ppi, PDESKTOP pdesk)
VOID TerminateConsole (PDESKTOP)
VOID DestroyWindowStation (IN PEPROCESS Process OPTIONAL, IN PVOID Object, IN ACCESS_MASK GrantedAccess, IN ULONG ProcessHandleCount, IN ULONG SystemHandleCount)
VOID FreeWindowStation (IN PWINDOWSTATION WindowStation)
NTSTATUS ParseWindowStation (IN PVOID ParseObject, IN PVOID ObjectType, IN OUT PACCESS_STATE AccessState, IN KPROCESSOR_MODE AccessMode, IN ULONG Attributes, IN OUT PUNICODE_STRING CompleteName, IN OUT PUNICODE_STRING RemainingName, IN OUT PVOID Context OPTIONAL, IN PSECURITY_QUALITY_OF_SERVICE SecurityQos OPTIONAL, OUT PVOID *Object)
BOOLEAN OkayToCloseWindowStation (IN PEPROCESS Process OPTIONAL, IN PVOID Object, IN HANDLE Handle)
VOID MapDesktop (IN OB_OPEN_REASON OpenReason, IN PEPROCESS Process OPTIONAL, IN PVOID Object, IN ACCESS_MASK GrantedAccess, IN ULONG HandleCount)
VOID UnmapDesktop (IN PEPROCESS Process OPTIONAL, IN PVOID Object, IN ACCESS_MASK GrantedAccess, IN ULONG ProcessHandleCount, IN ULONG SystemHandleCount)
VOID FreeDesktop (IN PVOID Desktop)
NTSTATUS ParseDesktop (IN PVOID ParseObject, IN PVOID ObjectType, IN OUT PACCESS_STATE AccessState, IN KPROCESSOR_MODE AccessMode, IN ULONG Attributes, IN OUT PUNICODE_STRING CompleteName, IN OUT PUNICODE_STRING RemainingName, IN OUT PVOID Context OPTIONAL, IN PSECURITY_QUALITY_OF_SERVICE SecurityQos OPTIONAL, OUT PVOID *Object)
BOOLEAN OkayToCloseDesktop (IN PEPROCESS Process OPTIONAL, IN PVOID Object, IN HANDLE Handle)
VOID UserSleep (DWORD dwMilliseconds)
BOOL UserBeep (DWORD dwFreq, DWORD dwDuration)
NTSTATUS UserRtlCreateAtomTable (ULONG NumberOfBuckets)
ATOM UserAddAtom (LPCWSTR lpAtom, BOOL bPin)
ATOM UserFindAtom (LPCWSTR lpAtom)
ATOM UserDeleteAtom (ATOM atom)
UINT UserGetAtomName (ATOM atom, LPWSTR lpch, int cchMax)
VOID ChangeForegroundKeyboardTable (PKL pklOld, PKL pklNew)
HKL xxxLoadKeyboardLayoutEx (PWINDOWSTATION, HANDLE, HKL, UINT, LPCWSTR, UINT, UINT)
HKL xxxActivateKeyboardLayout (PWINDOWSTATION pwinsta, HKL hkl, UINT Flags, PWND pwnd)
HKL xxxInternalActivateKeyboardLayout (PKL pkl, UINT Flags, PWND pwnd)
BOOL GetKbdLangSwitch (PUNICODE_STRING pProfileUserName)
BOOL xxxUnloadKeyboardLayout (PWINDOWSTATION, HKL)
VOID RemoveKeyboardLayoutFile (PKBDFILE pkf)
HKL _GetKeyboardLayout (DWORD idThread)
UINT _GetKeyboardLayoutList (PWINDOWSTATION pwinsta, UINT nItems, HKL *lpBuff)
VOID xxxFreeKeyboardLayouts (PWINDOWSTATION, BOOL bUnlock)
DWORD xxxDragObject (PWND pwndParent, PWND xhwndFrom, UINT wFmt, ULONG_PTR dwData, PCURSOR xpcur)
BOOL xxxDragDetect (PWND pwnd, POINT pt)
BOOL xxxIsDragging (PWND pwnd, POINT ptScreen, UINT uMsg)
HKL GetActiveHKL ()
void xxxDrawMenuItem (HDC hdc, PMENU pMenu, PITEM pItem, DWORD dwFlags)
BOOL xxxRealDrawMenuItem (HDC hdc, PGRAYMENU lpGray, int cx, int cy)
void xxxDrawMenuBarUnderlines (PWND pwnd, BOOL fShow)
__inline BOOL IsRootPopupMenu (PPOPUPMENU ppopupmenu)
__inline BOOL ExitMenuLoop (PMENUSTATE pMenuState, PPOPUPMENU ppopupmenu)
__inline PMENUSTATE GetpMenuState (PWND pwnd)
__inline PPOPUPMENU GetpGlobalPopupMenu (PWND pwnd)
__inline BOOL IsInsideMenuLoop (PTHREADINFO pti)
__inline BOOL IsMenuStarted (PTHREADINFO pti)
__inline PITEM MNGetToppItem (PMENU pMenu)
__inline BOOL MNIsItemSelected (PPOPUPMENU ppopupmenu)
__inline PITEM MNGetSelectedpitem (PPOPUPMENU ppopupmenu)
__inline BOOL MNIsScrollArrowSelected (PPOPUPMENU ppopupmenu)
__inline BOOL IsModelessMenuNotificationWindow (PWND pwnd)
__inline BOOL IsRecursedMenuState (PMENUSTATE pMenuState, PPOPUPMENU ppopupmenu)
__inline BOOL IsMDIItem (PITEM pitem)
void xxxDrawDragRect (PMOVESIZEDATA pmsd, LPRECT lprc, UINT flags)
void GetMonitorMaxArea (PWND pwnd, PMONITOR pMonitor, LPRECT *pprc)
VOID SetForegroundPriorityProcess (PPROCESSINFO ppi, PTHREADINFO pti, BOOL fSetForegound)
VOID SetForegroundPriority (PTHREADINFO pti, BOOL fSetForeground)
void xxxUpdateTray (PWND pwnd)
void xxxMNUpdateShownMenu (PPOPUPMENU ppopup, PITEM pItem, UINT uFlags)
UINT xxxMNFindChar (PMENU pMenu, UINT ch, INT idxC, INT *lpr)
UINT MNFindItemInColumn (PMENU pMenu, UINT idxB, int dir, BOOL fRoot)
void MNAnimate (PMENUSTATE pMenuState, BOOL fIterate)
void MNDrawFullNC (PWND pwnd, HDC hdcIn, PPOPUPMENU ppopup)
void MNDrawArrow (HDC hdcIn, PPOPUPMENU ppopup, UINT uArrow)
void MNEraseBackground (HDC hdc, PMENU pmenu, int x, int y, int cx, int cy)
PMENUSTATE xxxMNAllocMenuState (PTHREADINFO ptiCurrent, PTHREADINFO ptiNotify, PPOPUPMENU ppopupmenuRoot)
void xxxMNEndMenuState (BOOL fFreePopup)
BOOL MNEndMenuStateNotify (PMENUSTATE pMenuState)
void MNFlushDestroyedPopups (PPOPUPMENU ppopupmenu, BOOL fUnlock)
BOOL MNSetupAnimationDC (PMENUSTATE pMenuState)
BOOL MNCreateAnimationBitmap (PMENUSTATE pMenuState, UINT cx, UINT cy)
void MNDestroyAnimationBitmap (PMENUSTATE pMenuState)
PMENUSTATE xxxMNStartMenuState (PWND pwnd, DWORD cmd, LPARAM lParam)
__inline void LockMenuState (PMENUSTATE pMenuState)
BOOL xxxUnlockMenuState (PMENUSTATE pMenuState)
__inline UINT _MNGetpItemIndex (PMENU pmenu, PITEM pitem)
void xxxMNDismiss (PMENUSTATE pMenuState)
PITEM MNGetpItem (PPOPUPMENU ppopup, UINT uIndex)
void xxxMNSetCapture (PPOPUPMENU ppopup)
void xxxMNReleaseCapture (void)
void MNCheckButtonDownState (PMENUSTATE pMenuState)
PWND GetMenuStateWindow (PMENUSTATE pMenuState)
PVOID LockPopupMenu (PPOPUPMENU ppopup, PMENU *pspmenu, PMENU pmenu)
PVOID UnlockPopupMenu (PPOPUPMENU ppopup, PMENU *pspmenu)
PVOID LockWndMenu (PWND pwnd, PMENU *pspmenu, PMENU pmenu)
PVOID UnlockWndMenu (PWND pwnd, PMENU *pspmenu)
UINT MNSetTimerToCloseHierarchy (PPOPUPMENU ppopup)
BOOL xxxMNSetTop (PPOPUPMENU ppopup, int iNewTop)
LRESULT xxxMenuWindowProc (PWND, UINT, WPARAM, LPARAM)
VOID xxxMNButtonUp (PPOPUPMENU ppopupMenu, PMENUSTATE pMenuState, UINT posItemHit, LPARAM lParam)
VOID xxxMNButtonDown (PPOPUPMENU ppopupMenu, PMENUSTATE pMenuState, UINT posItemHit, BOOL fClick)
PITEM xxxMNSelectItem (PPOPUPMENU ppopupMenu, PMENUSTATE pMenuState, UINT itemPos)
BOOL xxxMNSwitchToAlternateMenu (PPOPUPMENU ppopupMenu)
void xxxMNCancel (PMENUSTATE pMenuState, UINT uMsg, UINT cmd, LPARAM lParam)
VOID xxxMNKeyDown (PPOPUPMENU ppopupMenu, PMENUSTATE pMenuState, UINT key)
BOOL xxxMNDoubleClick (PMENUSTATE pMenuState, PPOPUPMENU ppopup, int idxItem)
VOID xxxMNCloseHierarchy (PPOPUPMENU ppopupMenu, PMENUSTATE pMenuState)
PWND xxxMNOpenHierarchy (PPOPUPMENU ppopupMenu, PMENUSTATE pMenuState)
void LockMFMWFPWindow (PULONG_PTR puHitArea, ULONG_PTR uNewHitArea)
void UnlockMFMWFPWindow (PULONG_PTR puHitArea)
BOOL IsMFMWFPWindow (ULONG_PTR uHitArea)
LONG_PTR xxxMNFindWindowFromPoint (PPOPUPMENU ppopupMenu, PUINT pIndex, POINTS screenPt)
VOID xxxMNMouseMove (PPOPUPMENU ppopupMenu, PMENUSTATE pMenuState, POINTS screenPt)
int xxxMNCompute (PMENU pMenu, PWND pwndNotify, DWORD yMenuTop, DWORD xMenuLeft, DWORD cxMax, LPDWORD lpdwHeight)
VOID xxxMNRecomputeBarIfNeeded (PWND pwndNotify, PMENU pMenu)
VOID xxxMenuDraw (HDC hdc, PMENU pMenu)
UINT MNFindNextValidItem (PMENU pMenu, int i, int dir, UINT flags)
VOID MNFreeItem (PMENU pMenu, PITEM pItem, BOOL fFreeItemPopup)
BOOL xxxMNStartMenu (PPOPUPMENU ppopupMenu, int mn)
VOID MNPositionSysMenu (PWND pwnd, PMENU pSysMenu)
PITEM xxxMNInvertItem (PPOPUPMENU ppopupmenu, PMENU pMenu, int itemNumber, PWND pwndNotify, BOOL fOn)
VOID xxxSendMenuSelect (PWND pwndNotify, PWND pwndMenu, PMENU pMenu, int idx)
BOOL xxxSetSystemMenu (PWND pwnd, PMENU pMenu)
BOOL xxxSetDialogSystemMenu (PWND pwnd)
VOID xxxMNChar (PPOPUPMENU ppopupMenu, PMENUSTATE pMenuState, UINT character)
PPOPUPMENU MNAllocPopup (BOOL fForceAlloc)
VOID MNFreePopup (PPOPUPMENU ppopupmenu)
VOID xxxMNKeyFilter (PPOPUPMENU ppopupMenu, PMENUSTATE pMenuState, UINT ch)
int xxxMenuBarCompute (PMENU pMenu, PWND pwndNotify, DWORD yMenuTop, DWORD xMenuLeft, int cxMax)
VOID xxxEndMenu (PMENUSTATE pMenuState)
BOOL xxxCallHandleMenuMessages (PMENUSTATE pMenuState, PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam)
BOOL xxxHandleMenuMessages (LPMSG lpmsg, PMENUSTATE pMenuState, PPOPUPMENU ppopupmenu)
void xxxEndMenuLoop (PMENUSTATE pMenuState, PPOPUPMENU ppopupmenu)
int xxxMNLoop (PPOPUPMENU ppopupMenu, PMENUSTATE pMenuState, LPARAM lParam, BOOL fDblClk)
VOID xxxSetSysMenu (PWND pwnd)
PMENU xxxGetSysMenuHandle (PWND pwnd)
PMENU xxxGetSysMenu (PWND pwnd, BOOL fSubMenu)
PMENU MakeMenuRtoL (PMENU pMenu, BOOL bRtoL)
HDC CreateCompatiblePublicDC (HDC hdc, HBITMAP *pbmDCGray)
void xxxPSMTextOut (HDC hdc, int xLeft, int yTop, LPWSTR lpsz, int cch, DWORD dwFlags)
BOOL xxxPSMGetTextExtent (HDC hdc, LPWSTR lpstr, int cch, PSIZE psize)
void xxxClientPSMTextOut (HDC hdc, int xLeft, int yTop, PUNICODE_STRING lpsz, int cch, DWORD dwFlags)
int xxxClientLpkDrawTextEx (HDC hdc, int xLeft, int yTop, LPCWSTR lpsz, int nCount, BOOL fDraw, UINT wFormat, LPDRAWTEXTDATA lpDrawInfo, UINT bAction, int iCharSet)
BOOL xxxClientExtTextOutW (HDC hdc, int x, int y, int flOpts, RECT *prcl, LPCWSTR pwsz, UINT cwc, INT *pdx)
BOOL xxxClientGetTextExtentPointW (HDC hdc, LPCWSTR lpstr, int cch, PSIZE psize)
NTSTATUS xxxClientRegisterDragDrop (HWND hwnd)
NTSTATUS xxxClientRevokeDragDrop (HWND hwnd)
NTSTATUS xxxClientLoadOLE (VOID)
void xxxMNSetGapState (ULONG_PTR uHitArea, UINT uIndex, UINT uFlags, BOOL fSet)
BOOL xxxMNDragOver (POINT *ppt, PMNDRAGOVERINFO pmndoi)
BOOL xxxMNDragLeave (VOID)
void xxxMNUpdateDraggingInfo (PMENUSTATE pMenuState, ULONG_PTR uHitArea, UINT uIndex)
VOID xxxSBTrackInit (PWND pwnd, LPARAM lParam, int curArea, UINT uType)
VOID SBCtlSetup (PSBWND psbwnd)
void CalcSBStuff (PWND pwnd, PSBCALC pSBCalc, BOOL fVert)
void CalcSBStuff2 (PSBCALC pSBCalc, LPRECT lprc, CONST PSBDATA pw, BOOL fVert)
BOOL xxxEnableScrollBar (PWND pwnd, UINT wSBflags, UINT wArrows)
void DrawSize (PWND pwnd, HDC hdc, int cxFrame, int cyFrame)
int xxxScrollWindowEx (PWND pwnd, int dx, int dy, LPRECT prcScroll, LPRECT prcClip, HRGN hrgnUpdate, LPRECT prcUpdate, DWORD flags)
void xxxDoScrollMenu (PWND pwndNotify, PWND pwndSB, BOOL fVert, LPARAM lParam)
BOOL xxxInternalEnumWindow (PWND pwndNext, WNDENUMPROC_PWND lpfn, LPARAM lParam, UINT fEnumChildren)
VOID ISV_InitMinMaxInfo (PWND pwnd, PPOINT aptMinMaxWnd)
VOID ISV_ValidateMinMaxInfo (PWND pwnd, PPOINT aptMinMaxWnd)
WORD _SetWindowWord (PWND pwnd, int index, WORD value)
DWORD xxxSetWindowLong (PWND pwnd, int index, DWORD value, BOOL bAnsi)
ULONG_PTR xxxSetWindowData (PWND pwnd, int index, ULONG_PTR dwData, BOOL bAnsi)
LONG xxxSetWindowStyle (PWND pwnd, int gwl, DWORD styleNew)
BOOL FCallerOk (PWND pwnd)
int IntersectVisRect (HDC, int, int, int, int)
PCURSOR xxxGetWindowSmIcon (PWND pwnd, BOOL fDontSendMsg)
VOID xxxDrawCaptionBar (PWND pwnd, HDC hdc, UINT fFlags)
VOID xxxDrawScrollBar (PWND pwnd, HDC hdc, BOOL fVert)
VOID xxxTrackBox (PWND, UINT, WPARAM, LPARAM, PSBCALC)
VOID xxxTrackThumb (PWND, UINT, WPARAM, LPARAM, PSBCALC)
VOID xxxEndScroll (PWND pwnd, BOOL fCancel)
VOID xxxDrawWindowFrame (PWND pwnd, HDC hdc, BOOL fHungRedraw, BOOL fActive)
BOOL xxxInternalPaintDesktop (PWND pwnd, HDC hdc, BOOL fPaint)
VOID xxxSysCommand (PWND pwnd, DWORD cmd, LPARAM lParam)
VOID xxxHandleNCMouseGuys (PWND pwnd, UINT message, int htArea, LPARAM lParam)
void xxxCreateClassSmIcon (PCLS pcls)
HICON xxxCreateWindowSmIcon (PWND pwnd, HICON hIconBig, BOOL fCopyFromRes)
BOOL DestroyWindowSmIcon (PWND pwnd)
BOOL DestroyClassSmIcon (PCLS pcls)
UINT DWP_GetHotKey (PWND)
UINT DWP_SetHotKey (PWND, DWORD)
VOID xxxDWP_DoNCActivate (PWND pwnd, DWORD dwFlags, HRGN hrgnClip)
VOID xxxDWP_ProcessVirtKey (UINT key)
BOOL xxxDWP_EraseBkgnd (PWND pwnd, UINT msg, HDC hdc)
VOID SetTiledRect (PWND pwnd, LPRECT lprc, PMONITOR pMonitor)
VOID LinkWindow (PWND pwnd, PWND pwndInsert, PWND pwndParent)
VOID UnlinkWindow (PWND pwndUnlink, PWND pwndParent)
VOID xxxDW_DestroyOwnedWindows (PWND pwndParent)
VOID xxxDW_SendDestroyMessages (PWND pwnd)
VOID xxxFreeWindow (PWND pwnd, PTL ptlpwndFree)
VOID xxxFW_DestroyAllChildren (PWND pwnd)
PHOTKEY FindHotKey (PTHREADINFO pti, PWND pwnd, int id, UINT fsModifiers, UINT vk, BOOL fUnregister, PBOOL pfKeysExist)
NTSTATUS _BuildNameList (PWINDOWSTATION pwinsta, PNAMELIST pNameList, UINT cbNameList, PUINT pcbNeeded)
VOID xxxHelpLoop (PWND pwnd)
NTSTATUS _BuildPropList (PWND pwnd, PROPSET aPropSet[], UINT cPropMax, PUINT pcPropReturned)
BOOL xxxSendEraseBkgnd (PWND pwnd, HDC hdcBeginPaint, HRGN hrgnUpdate)
LONG xxxSetScrollBar (PWND pwnd, int code, LPSCROLLINFO lpsi, BOOL fRedraw)
VOID IncPaintCount (PWND pwnd)
VOID DecPaintCount (PWND pwnd)
PPROP CreateProp (PWND pwnd)
VOID xxxRecreateSmallIcons (PWND pwnd)
VOID TransferWakeBit (PTHREADINFO pti, UINT message)
BOOL SysHasKanji (VOID)
LONG xxxBroadcastMessage (PWND, UINT, WPARAM, LPARAM, UINT, PBROADCASTMSG)
VOID zzzSetFMouseMoved ()
VOID TimersProc (VOID)
VOID PostMove (PQ pq)
VOID DestroyWindowsTimers (PWND pwnd)
UINT_PTR StartTimers (VOID)
LRESULT xxxTooltipWndProc (PWND, UINT, WPARAM, LPARAM)
LRESULT xxxSwitchWndProc (PWND, UINT, WPARAM, LPARAM)
LRESULT xxxDesktopWndProc (PWND, UINT, WPARAM, LPARAM)
LRESULT xxxSBWndProc (PSBWND, UINT, WPARAM, LPARAM)
VOID DrawThumb2 (PWND, PSBCALC, HDC, HBRUSH, BOOL, UINT)
UINT GetWndSBDisableFlags (PWND, BOOL)
HANDLE _ConvertMemHandle (LPBYTE lpData, int cbData)
VOID zzzRegisterSystemThread (DWORD flags, DWORD reserved)
VOID zzzUpdateCursorImage ()
void zzzCalcStartCursorHide (PW32PROCESS Process, DWORD timeAdd)
BOOL FinalUserInit ()
BOOL LW_RegisterWindows (BOOL fSystem)
BOOL xxxSystemParametersInfo (UINT wFlag, DWORD wParam, LPVOID lParam, UINT flags)
PWINDOWSTATION CheckClipboardAccess (void)
PCLIP FindClipFormat (PWINDOWSTATION pwinsta, UINT format)
BOOL InternalSetClipboardData (PWINDOWSTATION pwinsta, UINT format, HANDLE hData, BOOL fGlobalHandle, BOOL fIncSerialNumber)
VOID DisownClipboard (PWND pwndClipOwner)
VOID CaretBlinkProc (PWND pwnd, UINT message, UINT_PTR id, LPARAM lParam)
VOID xxxRedrawFrame (PWND pwnd)
VOID xxxRedrawFrameAndHook (PWND pwnd)
VOID BltColor (HDC, HBRUSH, HDC, int, int, int, int, int, int, UINT)
VOID StoreMessage (LPMSG pmsg, PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam, DWORD time)
VOID StoreQMessage (PQMSG pqmsg, PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam, DWORD time, DWORD dwQEvent, ULONG_PTR dwExtraInfo)
void __inline StoreQMessagePti (PQMSG pqmsg, PTHREADINFO pti)
VOID xxxSendSizeMessage (PWND pwnd, UINT cmdSize)
VOID xxxCheckFocus (PWND pwnd)
VOID OffsetChildren (PWND pwnd, int dx, int dy, LPRECT prcHitTest)
VOID xxxMoveSize (PWND pwnd, UINT cmdMove, DWORD wptStart)
VOID xxxShowOwnedWindows (PWND pwndOwner, UINT cmdShow, HRGN hrgnHung)
VOID xxxAdjustSize (PWND pwnd, LPINT lpcx, LPINT lpcy)
VOID xxxNextWindow (PQ pq, DWORD wParam)
VOID xxxOldNextWindow (UINT flags)
VOID xxxCancelCoolSwitch (void)
VOID xxxCancelTracking (VOID)
VOID xxxCancelTrackingForThread (PTHREADINFO ptiCancel)
VOID xxxCapture (PTHREADINFO pti, PWND pwnd, UINT code)
UINT SystoChar (UINT message, LPARAM lParam)
PHOOK PhkFirstValid (PTHREADINFO pti, int nFilterType)
PHOOK PhkFirstGlobalValid (PTHREADINFO pti, int nFilterType)
VOID FreeHook (PHOOK phk)
int xxxCallHook (int, WPARAM, LPARAM, int)
LRESULT xxxCallHook2 (PHOOK, int, WPARAM, LPARAM, LPBOOL)
BOOL xxxCallMouseHook (UINT message, PMOUSEHOOKSTRUCTEX pmhs, BOOL fRemove)
VOID xxxCallJournalRecordHook (PQMSG pqmsg)
DWORD xxxCallJournalPlaybackHook (PQMSG pqmsg)
VOID SetJournalTimer (DWORD dt, UINT msgJournal)
VOID FreeThreadsWindowHooks (VOID)
BOOL xxxSnapWindow (PWND pwnd)
BOOL DefSetText (PWND pwnd, PLARGE_STRING pstrText)
PWND DSW_GetTopLevelCreatorWindow (PWND pwnd)
VOID xxxCalcClientRect (PWND pwnd, LPRECT lprc, BOOL fHungRedraw)
VOID xxxUpdateClientRect (PWND pwnd)
BOOL AllocateUnicodeString (PUNICODE_STRING pstrDst, PUNICODE_STRING pstrSrc)
HANDLE CreateDesktopHeap (PWIN32HEAP *ppheapRet, ULONG ulHeapSize)
BOOL xxxSetInternalWindowPos (PWND pwnd, UINT cmdShow, LPRECT lprcWin, LPPOINT lpptMin)
VOID xxxMetricsRecalc (UINT wFlags, int dx, int dy, int dyCaption, int dyMenu)
VOID xxxBroadcastDisplaySettingsChange (PDESKTOP, BOOL)
BOOL xxxUpdatePerUserSystemParameters (HANDLE hToken, BOOL bUserLoggedOn)
VOID SaveVolatileUserSettings (VOID)
void MenuRecalc (void)
int GetHmodTableIndex (PUNICODE_STRING pstrName)
VOID AddHmodDependency (int iatom)
VOID RemoveHmodDependency (int iatom)
HANDLE xxxLoadHmodIndex (int iatom, BOOL bWx86KnownDll)
VOID xxxDoSysExpunge (PTHREADINFO pti)
VOID DestroyThreadsObjects (VOID)
VOID MarkThreadsObjects (PTHREADINFO pti)
VOID FreeMessageList (PMLIST pml)
VOID DestroyThreadsHotKeys (VOID)
VOID DestroyWindowsHotKeys (PWND pwnd)
VOID DestroyClass (PPCLS ppcls)
VOID PatchThreadWindows (PTHREADINFO)
VOID DestroyCacheDCEntries (PTHREADINFO)
VOID DestroyProcessesClasses (PPROCESSINFO)
VOID InsertTask (PPROCESSINFO ppi, PTDB ptdbNew)
BOOL xxxSleepTask (BOOL fInputIdle, HANDLE)
BOOL xxxUserYield (PTHREADINFO pti)
VOID xxxDirectedYield (DWORD dwThreadId)
VOID DirectedScheduleTask (PTHREADINFO ptiOld, PTHREADINFO ptiNew, BOOL bSendMsg, PSMS psms)
VOID WakeWowTask (PTHREADINFO Pti)
_inline VOID EnterWowCritSect (PTHREADINFO pti, PWOWPROCESSINFO pwpi)
_inline VOID ExitWowCritSect (PTHREADINFO pti, PWOWPROCESSINFO pwpi)
BOOL xxxFillWindow (PWND pwndBrush, PWND pwndPaint, HDC hdc, HBRUSH hbr)
HBRUSH xxxGetControlBrush (PWND pwnd, HDC hdc, UINT msg)
HBRUSH xxxGetControlColor (PWND pwndParent, PWND pwndCtl, HDC hdc, UINT message)
PSBINFO _InitPwSB (PWND)
BOOL _KillSystemTimer (PWND pwnd, UINT_PTR nIDEvent)
BOOL xxxPaintRect (PWND, PWND, HDC, HBRUSH, LPRECT)
PCLS InternalRegisterClassEx (LPWNDCLASSEX lpwndcls, WORD fnid, DWORD flags)
PCURSOR GetClassIcoCur (PWND pwnd, int index)
PCURSOR xxxSetClassIcon (PWND pwnd, PCLS pcls, PCURSOR pCursor, int gcw)
ULONG_PTR xxxSetClassData (PWND pwnd, int index, ULONG_PTR dwData, BOOL bAnsi)
ULONG_PTR SetClassCursor (PWND pwnd, PCLS pcls, DWORD index, ULONG_PTR dwData)
PWND xxxCreateWindowEx (DWORD dwStyle, PLARGE_STRING pstrClass, PLARGE_STRING pstrName, DWORD style, int x, int y, int cx, int cy, PWND pwndParent, PMENU pmenu, HANDLE hModule, LPVOID pCreateParams, DWORD dwExpWinVerAndFlags)
BOOL xxxDestroyWindow (PWND pwnd)
LRESULT xxxSendMessageFF (PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam, ULONG_PTR xParam)
LONG xxxSendMessageBSM (PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam, LPBROADCASTSYSTEMMSGPARAMS pbsmParams)
LRESULT xxxSendMessageEx (PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam, ULONG_PTR xParam)
LRESULT xxxSendMessage (PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam)
LRESULT xxxSendMessageTimeout (PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam, UINT fuFlags, UINT uTimeout, PLONG_PTR lpdwResult)
BOOL xxxSendNotifyMessage (PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam)
void QueueNotifyMessage (PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam)
BOOL xxxSendMessageCallback (PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam, SENDASYNCPROC lpResultCallBack, ULONG_PTR dwData, BOOL bClientReqest)
BOOL _ReplyMessage (LRESULT lRet)
int xxxTranslateAccelerator (PWND pwnd, LPACCELTABLE pat, LPMSG lpMsg)
BOOL xxxSetMenu (PWND pwnd, PMENU pmenu, BOOL fRedraw)
VOID ChangeMenuOwner (PMENU pMenu, PPROCESSINFO ppi)
int xxxMenuBarDraw (PWND pwnd, HDC hdc, int cxFrame, int cyFrame)
BOOL xxxDrawMenuBar (PWND pwnd)
BOOL xxxSetMenuItemInfo (PMENU pMenu, UINT nPos, BOOL fByPosition, LPMENUITEMINFOW lpmii, PUNICODE_STRING pstrItem)
BOOL _SetMenuContextHelpId (PMENU pMenu, DWORD dwContextHelpId)
BOOL _SetMenuFlagRtoL (PMENU pMenu)
BOOL xxxInsertMenuItem (PMENU pMenu, UINT wIndex, BOOL fByPosition, LPMENUITEMINFOW lpmii, PUNICODE_STRING pstrItem)
BOOL xxxRemoveMenu (PMENU pMenu, UINT nPos, UINT dwFlags)
BOOL xxxDeleteMenu (PMENU pMenu, UINT nPos, UINT dwFlags)
BOOL xxxSetMenuInfo (PMENU pMenu, LPCMENUINFO lpmi)
BOOL xxxTrackPopupMenuEx (PMENU pmenu, UINT dwFlags, int x, int y, PWND pwnd, CONST TPMPARAMS *pparams)
LONG FindBestPos (int x, int y, int cx, int cy, LPRECT prcExclude, UINT wFlags, PPOPUPMENU ppopupmenu, PMONITOR pMonitor)
BOOL _SetMenuDefaultItem (PMENU pMenu, UINT wId, BOOL fByPosition)
int xxxMenuItemFromPoint (PWND pwnd, PMENU pMenu, POINT ptScreen)
BOOL xxxGetMenuItemRect (PWND pwnd, PMENU pMenu, UINT uIndex, LPRECT lprcScreen)
PPOPUPMENU MNGetPopupFromMenu (PMENU pMenu, PMENUSTATE *ppMenuState)
PVOID LockDesktopMenu (PMENU *ppmenu, PMENU pmenu)
PVOID UnlockDesktopMenu (PMENU *ppmenu)
PMENU xxxLoadSysDesktopMenu (PMENU *ppmenu, UINT uMenuId)
__inline PVOID UnlockDesktopSysMenu (PMENU *ppmenu)
BOOL xxxShowWindow (PWND pwnd, DWORD cmdShowAnimate)
BOOL _ShowWindowAsync (PWND pwnd, int cmdShow, UINT uWPFlags)
BOOL xxxShowOwnedPopups (PWND pwndOwner, BOOL fShow)
BOOL xxxSetWindowRgn (PWND pwnd, HRGN hrgn, BOOL fRedraw)
void SelectWindowRgn (PWND pwnd, HRGN hrgnClip)
PWND GetTopMostInsertAfter (PWND pwnd)
__inline BOOL FSwpTopmost (PWND pwnd)
PWND CalcForegroundInsertAfter (PWND pwnd)
BOOL xxxSetWindowPos (PWND pwnd, PWND pwndInsertAfter, int x, int y, int cx, int cy, UINT flags)
PSMWP InternalBeginDeferWindowPos (int cwndGuess)
BOOL AllocateCvr (PSMWP psmwp, int cwndHint)
PSMWP _BeginDeferWindowPos (int cwndGuess)
PSMWP _DeferWindowPos (PSMWP psmwp, PWND pwnd, PWND pwndInsertAfter, int x, int y, int cx, int cy, UINT rgf)
BOOL xxxEndDeferWindowPosEx (PSMWP psmwp, BOOL fAsync)
BOOL xxxMoveWindow (PWND pwnd, int x, int y, int cx, int cy, BOOL fRedraw)
VOID xxxHandleWindowPosChanged (PWND pwnd, PWINDOWPOS ppos)
VOID IncVisWindows (PWND pwnd)
VOID DecVisWindows (PWND pwnd)
BOOL FVisCountable (PWND pwnd)
VOID SetVisible (PWND pwnd, UINT flags)
VOID ClrFTrueVis (PWND pwnd)
VOID SetWindowState (PWND pwnd, DWORD flags)
VOID ClearWindowState (PWND pwnd, DWORD flags)
BOOL xxxUpdateWindows (PWND pwnd, HRGN hrgn)
VOID SetMinimize (PWND pwnd, UINT uFlags)
LRESULT xxxDefWindowProc (PWND, UINT, WPARAM, LPARAM)
PWND DWP_GetEnabledPopup (PWND pwndStart)
BOOL xxxWaitMessage (VOID)
VOID IdleTimerProc (VOID)
VOID zzzWakeInputIdle (PTHREADINFO pti)
VOID SleepInputIdle (PTHREADINFO pti)
BOOL xxxInternalGetMessage (LPMSG lpmsg, HWND hwnd, UINT wMsgFilterMin, UINT wMsgFilterMax, UINT wRemoveMsg, BOOL fGetMessage)
DWORD _GetMessagePos (VOID)
LRESULT xxxDispatchMessage (LPMSG lpmsg)
UINT GetMouseKeyFlags (PQ pq)
BOOL _PostMessage (PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam)
BOOL IPostQuitMessage (PTHREADINFO pti, int nExitCode)
BOOL _PostQuitMessage (int nExitCode)
BOOL _PostThreadMessage (PTHREADINFO pti, UINT message, WPARAM wParam, LPARAM lParam)
BOOL xxxTranslateMessage (LPMSG pmsg, UINT flags)
BOOL _GetInputState (VOID)
DWORD _GetQueueStatus (UINT)
DWORD xxxMsgWaitForMultipleObjects (DWORD nCount, PVOID *apObjects, MSGWAITCALLBACK pfnNonMsg, PKWAIT_BLOCK WaitBlockArray)
BOOL FHungApp (PTHREADINFO pti, DWORD dwTimeFromLastRead)
VOID xxxRedrawHungWindow (PWND pwnd, HRGN hrgnFullDrag)
VOID xxxRedrawHungWindowFrame (PWND pwnd, BOOL fActive)
void zzzActiveCursorTracking (PWND pwnd)
PWND GetActiveTrackPwnd (PWND pwnd, Q **ppq)
int xxxActiveWindowTracking (PWND pwnd, UINT uMsg, int iHitTest)
VOID xxxHungAppDemon (PWND pwnd, UINT message, UINT_PTR nID, LPARAM lParam)
VOID xxxSwitchToThisWindow (PWND pwnd, BOOL fAltTab)
int xxxToUnicodeEx (UINT wVirtKey, UINT wScanCode, CONST BYTE *lpKeyState, LPWSTR pwszBuff, int cchBuff, UINT wFlags, HKL hkl)
int xxxInternalToUnicode (UINT wVirtKey, UINT wScanCode, CONST IN PBYTE pfvk, OUT PWCHAR awchChars, INT cChar, UINT uiTMFlags, OUT PDWORD pdwFlags, HKL hkl)
BOOL _RegisterHotKey (PWND pwnd, int id, UINT fsModifiers, UINT vk)
BOOL _UnregisterHotKey (PWND pwnd, int id)
PWND xxxSetFocus (PWND pwnd)
BOOL CanForceForeground (PPROCESSINFO ppi)
BOOL xxxStubSetForegroundWindow (PWND pwnd)
BOOL xxxSetForegroundWindow (PWND pwnd, BOOL fFlash)
PWND xxxSetActiveWindow (PWND pwnd)
BOOL xxxAllowSetForegroundWindow (DWORD dwProcessId)
BOOL _LockSetForegroundWindow (UINT uLockCode)
BOOL xxxInvalidateRect (PWND pwnd, LPRECT lprc, BOOL fErase)
BOOL xxxValidateRect (PWND pwnd, LPRECT lprc)
BOOL xxxInvalidateRgn (PWND pwnd, HRGN hrgn, BOOL fErase)
BOOL xxxValidateRgn (PWND pwnd, HRGN hrgn)
BOOL xxxUpdateWindow (PWND pwnd)
BOOL xxxGetUpdateRect (PWND pwnd, LPRECT lprc, BOOL fErase)
int xxxGetUpdateRgn (PWND pwnd, HRGN hrgn, BOOL fErase)
int _ExcludeUpdateRgn (HDC hdc, PWND pwnd)
int CalcWindowRgn (PWND pwnd, HRGN hrgn, BOOL fClient)
VOID DeleteUpdateRgn (PWND pwnd)
BOOL xxxRedrawWindow (PWND pwnd, LPRECT lprcUpdate, HRGN hrgnUpdate, DWORD flags)
BOOL IntersectWithParents (PWND pwnd, LPRECT lprc)
VOID xxxInternalInvalidate (PWND pwnd, HRGN hrgnUpdate, DWORD flags)
BOOL xxxEnableWindow (PWND pwnd, BOOL fEnable)
int xxxGetWindowText (PWND pwnd, LPWSTR psz, int cchMax)
PWND xxxSetParent (PWND pwnd, PWND pwndNewParent)
BOOL xxxFlashWindow (PWND pwnd, DWORD dwFlags, DWORD dwTimeout)
__inline DWORD GetFlashWindowState (PWND pwnd)
__inline void SetFlashWindowState (PWND pwnd, DWORD dwState)
__inline void RemoveFlashWindowState (PWND pwnd)
BOOL _GetWindowPlacement (PWND pwnd, PWINDOWPLACEMENT pwp)
BOOL xxxSetWindowPlacement (PWND pwnd, PWINDOWPLACEMENT pwp)
BOOL ValidateParentDepth (PWND pwnd, PWND pwndParent)
BOOL ValidateOwnerDepth (PWND pwnd, PWND pwndOwner)
void WPUpdateCheckPointSettings (PWND pwnd, UINT uWPFlags)
HDC _GetDC (PWND pwnd)
HDC _GetDCEx (PWND pwnd, HRGN hrgnClip, DWORD flags)
HDC _GetWindowDC (PWND pwnd)
BOOL _ReleaseDC (HDC hdc)
UINT ReleaseCacheDC (HDC hdc, BOOL fEndPaint)
HDC CreateCacheDC (PWND, DWORD, PMONITOR)
BOOL DestroyCacheDC (PDCE *, HDC)
VOID InvalidateDce (PDCE pdce)
void DeleteHrgnClip (PDCE pdce)
PWND WindowFromCacheDC (HDC hdc)
PWND FastWindowFromDC (HDC hdc)
VOID DelayedDestroyCacheDC (VOID)
PDCE LookupDC (HDC hdc)
HDC GetMonitorDC (PDCE pdceOrig, PMONITOR pMonitor)
BOOL GetDCOrgOnScreen (HDC hdc, LPPOINT ppt)
__inline VOID MarkDCEInvalid (PDCE pdce)
HDC xxxBeginPaint (PWND pwnd, PAINTSTRUCT *lpps)
BOOL xxxEndPaint (PWND pwnd, PAINTSTRUCT *lpps)
PWND xxxSetCapture (PWND pwnd)
BOOL xxxReleaseCapture (VOID)
SHORT _GetAsyncKeyState (int vk)
BOOL _SetKeyboardState (CONST BYTE *pKeyboard)
int _GetKeyboardType (int nTypeFlag)
VOID RegisterPerUserKeyboardIndicators (PUNICODE_STRING pProfileUserName)
VOID UpdatePerUserKeyboardIndicators (PUNICODE_STRING pProfileUserName)
int _GetKeyNameText (LONG lParam, LPWSTR lpString, int nSize)
BOOL _KillTimer (PWND pwnd, UINT_PTR nIDEvent)
PTIMER FindTimer (PWND pwnd, UINT_PTR nID, UINT flags, BOOL fKill)
VOID xxxSystemTimerProc (PWND pwnd, UINT msg, UINT_PTR id, LPARAM lParam)
BOOL zzzDestroyCaret (VOID)
BOOL xxxCreateCaret (PWND, HBITMAP, int, int)
BOOL zzzShowCaret (PWND)
BOOL zzzHideCaret (PWND)
BOOL _SetCaretBlinkTime (UINT)
BOOL zzzSetCaretPos (int, int)
BOOL xxxOldMessageBeep (VOID)
BOOL xxxMessageBeep (UINT wType)
VOID PlayEventSound (UINT idSound)
PWND _ChildWindowFromPointEx (PWND pwndParent, POINT pt, UINT i)
PWND xxxWindowFromPoint (POINT pt)
PWND FAR SizeBoxHwnd (PWND pwnd)
BOOL xxxOpenClipboard (PWND pwnd, LPBOOL lpfEmptyClient)
BOOL xxxCloseClipboard (PWINDOWSTATION pwinsta)
UINT _EnumClipboardFormats (UINT fmt)
BOOL xxxEmptyClipboard (PWINDOWSTATION pwinsta)
HANDLE xxxGetClipboardData (PWINDOWSTATION pwinsta, UINT fmt, PGETCLIPBDATA gcd)
BOOL _IsClipboardFormatAvailable (UINT fmt)
int _GetPriorityClipboardFormat (UINT *lpPriorityList, int cfmts)
PWND xxxSetClipboardViewer (PWND pwndClipViewerNew)
BOOL xxxChangeClipboardChain (PWND pwndRemove, PWND pwndNewNext)
VOID SetDialogPointer (PWND pwnd, LONG_PTR lPtr)
VOID ZapActiveAndFocus (VOID)
BOOL xxxSetShellWindow (PWND pwnd, PWND pwndBkGnd)
BOOL _SetProgmanWindow (PWND pwnd)
BOOL _SetTaskmanWindow (PWND pwnd)
void xxxSetTrayWindow (PDESKTOP pdesk, PWND pwnd, PMONITOR pMonitor)
BOOL xxxAddFullScreen (PWND pwnd, PMONITOR pMonitor)
BOOL xxxRemoveFullScreen (PWND pwnd, PMONITOR pMonitor)
BOOL xxxCheckFullScreen (PWND pwnd, PSIZERECT psrc)
BOOL IsTrayWindow (PWND)
BOOL IsVSlick (PWND pwnd)
BOOL Is31TrayWindow (PWND pwnd)
BOOL xxxMakeWindowForegroundWithState (PWND, BYTE)
void FullScreenCleanup ()
LONG xxxUserChangeDisplaySettings (PUNICODE_STRING pstrDeviceName, LPDEVMODEW pDevMode, HWND hwnd, PDESKTOP pdesk, DWORD dwFlags, PVOID lParam, MODE PreviousMode)
BOOL xxxbFullscreenSwitch (BOOL bFullscreenSwitch, HWND hwnd)
BOOL xxxShowScrollBar (PWND, UINT, BOOL)
BOOL xxxDrawState (HDC hdcDraw, HBRUSH hbrFore, LPARAM lData, int x, int y, int cx, int cy, UINT uFlags)
BOOL _ScrollDC (HDC, int, int, LPRECT, LPRECT, HRGN, LPRECT)
VOID SpbCheckRect (PWND pwnd, LPRECT lprc, DWORD flags)
VOID SpbCheck (VOID)
PSPB FindSpb (PWND pwnd)
VOID FreeSpb (PSPB pspb)
VOID FreeAllSpbs (void)
VOID CreateSpb (PWND pwnd, UINT flags, HDC hdcScreen)
UINT RestoreSpb (PWND pwnd, HRGN hrgnUncovered, HDC *phdcScreen)
VOID SpbCheckPwnd (PWND pwnd)
VOID SpbCheckDce (PDCE pdce)
BOOL LockWindowUpdate2 (PWND pwndLock, BOOL fThreadOverride)
BOOL FAR BitBltSysBmp (HDC hdc, int x, int y, UINT i)
BOOL APIENTRY xxxSetSysColors (PUNICODE_STRING pProfileUserName, int count, PUINT pIndex, LPDWORD pClrVal, UINT uOptions)
VOID SetSysColor (UINT icol, DWORD rgb, UINT uOptions)
UINT xxxArrangeIconicWindows (PWND pwnd)
BOOL _SetSystemMenu (PWND pwnd, PMENU pMenu)
PICON _CreateIconIndirect (PICONINFO piconinfo)
PCURSOR _CreateCursor (HANDLE hModule, int iXhotspot, int iYhotspot, int iWidth, int iHeight, LPBYTE lpANDplane, LPBYTE lpXORplane)
PICON _CreateIcon (HANDLE hModule, int iWidth, int iHeight, BYTE bPlanes, BYTE bBitsPixel, LPBYTE lpANDplane, LPBYTE lpXORplane)
void DestroyUnlockedCursor (void *)
BOOL _DestroyCursor (PCURSOR, DWORD)
HANDLE _CreateAcceleratorTable (LPACCEL, int)
BOOL _GetCursorPos (LPPOINT)
PCURSOR zzzSetCursor (PCURSOR pcur)
BOOL zzzSetCursorPos (int x, int y)
int zzzShowCursor (BOOL fShow)
BOOL zzzClipCursor (LPCRECT prcClip)
BOOL _SetCursorContents (PCURSOR pcur, PCURSOR pcurNew)
void SetPointer (BOOL fSet)
void zzzHideCursorNoCapture (void)
BOOL _DrawIconEx (HDC hdc, int x, int y, PCURSOR pcur, int cx, int cy, UINT istepIfAniCur, HBRUSH hbrush, UINT diFlags)
BOOL BltIcon (HDC hdc, int x, int y, int cx, int cy, HDC hdcSrc, PCURSOR pcursor, BOOL fMask, LONG rop)
void DBGValidateQueueStates (PDESKTOP pdesk)
HDESK xxxCreateDesktop (POBJECT_ATTRIBUTES, KPROCESSOR_MODE, PUNICODE_STRING, LPDEVMODEW, DWORD, DWORD)
HDESK xxxOpenDesktop (POBJECT_ATTRIBUTES, KPROCESSOR_MODE, DWORD, DWORD, BOOL *)
BOOL OpenDesktopCompletion (PDESKTOP pdesk, HDESK hdesk, DWORD dwFlags, BOOL *)
BOOL xxxSwitchDesktop (PWINDOWSTATION, PDESKTOP, BOOL)
VOID zzzSetDesktop (PTHREADINFO pti, PDESKTOP pdesk, HDESK hdesk)
HDESK xxxGetInputDesktop (VOID)
BOOL xxxSetThreadDesktop (HDESK, PDESKTOP)
HDESK xxxGetThreadDesktop (DWORD, HDESK, KPROCESSOR_MODE)
BOOL xxxCloseDesktop (HDESK, KPROCESSOR_MODE)
BOOL xxxEnumDesktops (FARPROC, LONG, BOOL)
DWORD _SetDesktopConsoleThread (PDESKTOP pdesk, DWORD dwThreadId)
VOID xxxRealizeDesktop (PWND pwnd)
NTSTATUS CreateGlobalAtomTable (PVOID *ppAtomTable)
HWINSTA xxxCreateWindowStation (POBJECT_ATTRIBUTES ObjA, KPROCESSOR_MODE OwnershipMode, DWORD amRequest, HANDLE hKbdLayoutFile, DWORD offTable, PCWSTR pwszKLID, UINT uKbdInputLocale)
HWINSTA _OpenWindowStation (POBJECT_ATTRIBUTES, DWORD, KPROCESSOR_MODE)
BOOL _CloseWindowStation (HWINSTA hwinsta)
BOOL xxxSetProcessWindowStation (HWINSTA, KPROCESSOR_MODE)
BOOL _LockWorkStation (VOID)
NTSTATUS ReferenceWindowStation (PETHREAD Thread, HWINSTA hwinsta, ACCESS_MASK amDesiredAccess, PWINDOWSTATION *ppwinsta, BOOL fUseDesktop)
PROC zzzSetWindowsHookAW (int nFilterType, PROC pfnFilterProc, DWORD dwFlags)
BOOL zzzUnhookWindowsHookEx (PHOOK phk)
BOOL zzzUnhookWindowsHook (int nFilterType, PROC pfnFilterProc)
LRESULT xxxCallNextHookEx (int nCode, WPARAM wParam, LPARAM lParam)
BOOL _CallMsgFilter (LPMSG lpMsg, int nCode)
void zzzCancelJournalling (void)
LRESULT fnHkINLPCWPEXSTRUCT (PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam, ULONG_PTR xParam)
LRESULT fnHkINLPCWPRETEXSTRUCT (PWND pwnd, UINT message, WPARAM wParam, LPARAM lParam, ULONG_PTR xParam)
__inline BOOL IsShellProcess (PPROCESSINFO ppi)
__inline DWORD GetAppCompatFlags2ForPti (PTHREADINFO pti, WORD wVer)
VOID ClearWakeMask (VOID)
ULONG GetTaskName (PTHREADINFO pti, PWSTR Buffer, ULONG BufferLength)
PQMSG FindQMsg (PTHREADINFO, PMLIST, PWND, UINT, UINT, BOOL)
void zzzShowStartGlass (DWORD dwTimeout)
DWORD _GetChangeBits (VOID)
NTSTATUS xxxSetCsrssThreadDesktop (PDESKTOP pdesk, PDESKRESTOREDATA pdrdRestore)
NTSTATUS xxxRestoreCsrssThreadDesktop (PDESKRESTOREDATA pdrdRestore)
PQ GetJournallingQueue (PTHREADINFO pti)
void ClearAppStarting (PPROCESSINFO ppi)
LONG xxxClientShutdown (PWND pwnd, WPARAM wParam)
BOOL xxxRegisterUserHungAppHandlers (PFNW32ET pfnW32EndTask, HANDLE hEventWowExec)
BOOL CreateTerminalInput (PTERMINAL)
VOID LW_LoadSomeStrings (VOID)
VOID LW_LoadProfileInitData ()
VOID xxxODI_ColorInit (PUNICODE_STRING pProfileUserName)
HRGN InitCreateRgn (VOID)
VOID xxxUpdateSystemCursorsFromRegistry (PUNICODE_STRING pProfileUserName)
VOID xxxUpdateSystemIconsFromRegistry (PUNICODE_STRING pProfileUserName)
void RegisterLPK (DWORD)
HBITMAP CreateCaptionStrip ()
BOOL LW_BrushInit (VOID)
VOID xxxLW_LoadFonts (BOOL bRemote)
VOID _LoadCursorsAndIcons (VOID)
void UnloadCursorsAndIcons (VOID)
void IncrMBox (void)
void DecrMBox (void)
void InitAnsiOem (PCHAR pOemToAnsi, PCHAR pAnsiToOem)
int xxxAddFontResourceW (LPWSTR lpFile, FLONG flags, DESIGNVECTOR *pdv)
void EnforceColorDependentSettings (void)
VOID xxxUpdatePerUserAccessPackSettings (PUNICODE_STRING pProfileUserName)
VOID GetWindowNCMetrics (LPNONCLIENTMETRICS lpnc)
HFONT FAR PASCAL CreateFontFromWinIni (PUNICODE_STRING pProfileUserName, LPLOGFONT lplf, UINT idFont)
VOID SetMinMetrics (PUNICODE_STRING pProfileUserName, LPMINIMIZEDMETRICS lpmin)
BOOL xxxSetWindowNCMetrics (PUNICODE_STRING pProfileUserName, LPNONCLIENTMETRICS lpnc, BOOL fSizeChange, int clNewBorder)
BOOL SetIconMetrics (PUNICODE_STRING pProfileUserName, LPICONMETRICS lpicon)
BOOL xxxSetNCFonts (PUNICODE_STRING pProfileUserName, LPNONCLIENTMETRICS lpnc)
BOOL CreateBitmapStrip (VOID)
BOOL UpdateWinIniInt (PUNICODE_STRING pProfileUserName, UINT idSection, UINT wKeyNameId, int value)
void FAR SetDesktopMetrics ()
void SetMsgBox (PWND pwnd)
BOOL _RegisterShellHookWindow (PWND pwnd)
BOOL _DeregisterShellHookWindow (PWND pwnd)
BOOL xxxSendMinRectMessages (PWND pwnd, RECT *lpRect)
void PostShellHookMessages (UINT message, LPARAM lParam)
VOID _ResetDblClk (VOID)
VOID xxxSimulateShiftF10 (VOID)
BOOL VWPLAdd (PVWPL *ppvwpl, PWND pwnd, DWORD dwThreshold)
BOOL VWPLRemove (PVWPL *ppvwpl, PWND pwnd)
PWND VWPLNext (PVWPL pvwpl, PWND pwndPrev, DWORD *pnPrev)
BOOL xxxDDETrackSendHook (PWND pwndTo, DWORD message, WPARAM wParam, LPARAM lParam)
DWORD xxxDDETrackPostHook (PUINT pmessage, PWND pwndTo, WPARAM wParam, LPARAM *plParam, BOOL fSent)
VOID FreeDdeXact (PXSTATE pxs)
VOID xxxDDETrackGetMessageHook (PMSG pmsg)
VOID xxxDDETrackWindowDying (PWND pwnd, PDDECONV pDdeConv)
VOID FreeDdeConv (PDDECONV pDdeConv)
BOOL _ImpersonateDdeClientWindow (PWND pwndClient, PWND pwndServer)
HBITMAP _ConvertBitmap (HBITMAP hBitmap)
PMONITORRECTS SnapshotMonitorRects (void)
void xxxDesktopRecalc (PMONITORRECTS pmrOld)
BOOL _SetDoubleClickTime (UINT)
BOOL APIENTRY _SwapMouseButton (BOOL fSwapButtons)
VOID xxxDestroyThreadInfo (VOID)
PMENU xxxGetSystemMenu (PWND pWnd, BOOL bRevert)
BOOL _DestroyMenu (PMENU pMenu)
DWORD _CheckMenuItem (PMENU pMenu, UINT wIDCheckItem, UINT wCheck)
DWORD xxxEnableMenuItem (PMENU pMenu, UINT wIDEnableItem, UINT wEnable)
WINUSERAPI UINT _GetMenuItemID (PMENU pMenu, int nPos)
WINUSERAPI UINT _GetMenuItemCount (PMENU pMenu)
PMENU _GetMenu (PWND pWnd)
PWND _GetNextQueueWindow (PWND pwnd, BOOL fDir, BOOL fAltEsc)
UINT_PTR _SetSystemTimer (PWND pwnd, UINT_PTR nIDEvent, DWORD dwElapse, TIMERPROC_PWND pTimerFunc)
BOOL _SetClipboardData (UINT fmt, HANDLE hData, BOOL fGlobalHandle, BOOL fIncSerialNumber)
WORD _SetClassWord (PWND pwnd, int index, WORD value)
DWORD xxxSetClassLong (PWND pwnd, int index, DWORD value, BOOL bAnsi)
ATOM xxxRegisterClassEx (LPWNDCLASSEX pwc, PCLSMENUNAME pcmn, WORD fnid, DWORD dwFlags, LPDWORD pdwWOW)
BOOL xxxHiliteMenuItem (PWND pwnd, PMENU pmenu, UINT cmd, UINT flags)
HANDLE xxxGetInputEvent (DWORD dwWakeMask)
BOOL _UnregisterClass (LPCWSTR lpszClassName, HANDLE hModule, PCLSMENUNAME pcmn)
ATOM _GetClassInfoEx (HANDLE hModule, LPCWSTR lpszClassName, LPWNDCLASSEX pwc, LPWSTR *ppszMenuName, BOOL bAnsi)
PWND _WindowFromDC (HDC hdc)
PCLS _GetWOWClass (HANDLE hModule, LPCWSTR lpszClassName)
LRESULT xxxHkCallHook (PHOOK phk, int nCode, WPARAM wParam, LPARAM lParam)
PHOOK zzzSetWindowsHookEx (HANDLE hmod, PUNICODE_STRING pstrLib, PTHREADINFO ptiThread, int nFilterType, PROC pfnFilterProc, DWORD dwFlags)
DWORD GetDebugHookLParamSize (WPARAM wParam, PDEBUGHOOKINFO pdebughookstruct)
BOOL _RegisterLogonProcess (DWORD dwProcessId, BOOL fSecure)
UINT _LockWindowStation (PWINDOWSTATION pwinsta)
BOOL _UnlockWindowStation (PWINDOWSTATION pwinsta)
UINT _SetWindowStationUser (PWINDOWSTATION pwinsta, PLUID pluidUser, PSID psidUser, DWORD cbsidUser)
BOOL _SetDesktopBitmap (PDESKTOP pdesk, HBITMAP hbitmap, DWORD dwStyle)
BOOL _SetLogonNotifyWindow (PWND pwnd)
BOOL _RegisterTasklist (PWND pwndTasklist)
LONG_PTR _SetMessageExtraInfo (LONG_PTR)
VOID xxxRemoveEvents (PQ pq, int nQueue, DWORD flags)
PPCLS _InnerGetClassPtr (ATOM atom, PPCLS ppclsList, HANDLE hModule)
DWORD ClientGetListboxString (PWND hwnd, UINT msg, WPARAM wParam, PVOID lParam, ULONG_PTR xParam, PROC xpfn, DWORD dwSCMSFlags, BOOL bNotString, PSMS psms)
HANDLE ClientLoadLibrary (PUNICODE_STRING pstrLib, BOOL bWx86KnownDll)
BOOL ClientFreeLibrary (HANDLE hmod)
BOOL xxxClientGetCharsetInfo (LCID lcid, PCHARSETINFO pcs)
BOOL ClientExitProcess (PFNW32ET pfn, DWORD dwExitCode)
BOOL ClientGrayString (GRAYSTRINGPROC pfnOutProc, HDC hdc, DWORD lpData, int nCount)
BOOL CopyFromClient (LPBYTE lpByte, LPBYTE lpByteClient, DWORD cch, BOOL fString, BOOL fAnsi)
BOOL CopyToClient (LPBYTE lpByte, LPBYTE lpByteClient, DWORD cchMax, BOOL fAnsi)
VOID ClientNoMemoryPopup (VOID)
NTSTATUS ClientThreadSetup (VOID)
VOID ClientDeliverUserApc (VOID)
BOOL ClientImmLoadLayout (HKL, PIMEINFOEX)
DWORD ClientImmProcessKey (HWND, HKL, UINT, LPARAM, DWORD)
NTSTATUS xxxUserModeCallback (ULONG uApi, PVOID pIn, ULONG cbIn, PVOID pOut, ULONG cbOut)
PCURSOR ClassSetSmallIcon (PCLS pcls, PCURSOR pcursor, BOOL fServerCreated)
BOOL _GetTextMetricsW (HDC hdc, LPTEXTMETRICW ptm)
int xxxDrawMenuBarTemp (PWND pwnd, HDC hdc, LPRECT lprc, PMENU pMenu, HFONT hFont)
BOOL xxxDrawCaptionTemp (PWND pwnd, HDC hdc, LPRECT lprc, HFONT hFont, PCURSOR pcursor, PUNICODE_STRING pstrText OPTIONAL, UINT flags)
WORD xxxTrackCaptionButton (PWND pwnd, UINT hit)
void GiveForegroundActivateRight (HANDLE hPid)
BOOL HasForegroundActivateRight (HANDLE hPid)
BOOL FRemoveForegroundActivate (PTHREADINFO pti)
void RestoreForegroundActivate ()
void CancelForegroundActivate ()
BOOL MinToTray (PWND pwnd)
void xxxUpdateThreadsWindows (PTHREADINFO pti, PWND pwnd, HRGN hrgnFullDrag)
NTSTATUS xxxQueryInformationThread (IN HANDLE hThread, IN USERTHREADINFOCLASS ThreadInfoClass, OUT PVOID ThreadInformation, IN ULONG ThreadInformationLength, OUT PULONG ReturnLength OPTIONAL)
NTSTATUS xxxSetInformationThread (IN HANDLE hThread, IN USERTHREADINFOCLASS ThreadInfoClass, IN PVOID ThreadInformation, IN ULONG ThreadInformationLength)
NTSTATUS SetInformationProcess (IN HANDLE hProcess, IN USERPROCESSINFOCLASS ProcessInfoClass, IN PVOID ProcessInformation, IN ULONG ProcessInformationLength)
NTSTATUS xxxConsoleControl (IN CONSOLECONTROL ConsoleControl, IN PVOID ConsoleInformation, IN ULONG ConsoleInformationLength)
VOID xxxWindowEvent (DWORD event, PWND pwnd, LONG idObject, LONG idChild, DWORD dwFlags)
VOID xxxFlushDeferredWindowEvents ()
BOOL xxxClientCallWinEventProc (WINEVENTPROC pfn, PEVENTHOOK pEventHook, PNOTIFY pNotify)
void DestroyEventHook (PEVENTHOOK)
VOID FreeThreadsWinEvents (PTHREADINFO pti)
BOOL _UnhookWinEvent (PEVENTHOOK peh)
VOID DestroyNotify (PNOTIFY pNotify)
PEVENTHOOK xxxProcessNotifyWinEvent (PNOTIFY pNotify)
PEVENTHOOK _SetWinEventHook (DWORD eventMin, DWORD eventMax, HMODULE hmodWinEventProc, PUNICODE_STRING pstrLib, WINEVENTPROC pfnWinEventProc, HANDLE hEventProcess, DWORD idEventThread, DWORD dwFlags)
BOOL _GetGUIThreadInfo (PTHREADINFO pti, PGUITHREADINFO pgui)
BOOL xxxGetTitleBarInfo (PWND pwnd, PTITLEBARINFO ptbi)
BOOL _GetComboBoxInfo (PWND pwnd, PCOMBOBOXINFO ptbi)
DWORD _GetListBoxInfo (PWND pwnd)
BOOL _GetScrollBarInfo (PWND pwnd, LONG idObject, PSCROLLBARINFO ptbi)
PWND _GetAncestor (PWND pwnd, UINT gaFlags)
PWND _RealChildWindowFromPoint (PWND pwndParent, POINT pt)
BOOL _GetAltTabInfo (int iItem, PALTTABINFO pati, LPWSTR lpszItemText, UINT cchItemText, BOOL bAnsi)
BOOL xxxGetMenuBarInfo (PWND pwnd, long idObject, long idItem, PMENUBARINFO pmbi)
NTSTATUS InitializePowerRequestList (HANDLE hPowerRequestEvent)
VOID CleanupPowerRequestList (VOID)
VOID DeletePowerRequestList (VOID)
VOID xxxUserPowerCalloutWorker (VOID)
int FindNCHitEx (PWND pwnd, int ht, POINT pt)
void xxxTrackMouseMove (PWND pwnd, int htEx, UINT message)
BOOL xxxHotTrack (PWND pwnd, int htEx, BOOL fDraw)
void xxxResetTooltip (PTOOLTIPWND pttwnd)
void xxxCancelMouseMoveTracking (DWORD dwDTFlags, PWND pwndTrack, int htEx, DWORD dwDTCancel)
__inline PVOID DesktopRebaseToClient (PTHREADINFO pti, PVOID p)
__inline PVOID SharedRebaseToClient (PPROCESSINFO ppi, PVOID p)
HDC CreateFade (PWND pwnd, RECT *prc, DWORD dwTime, DWORD dwFlags)
void StartFade (void)
void StopFade (void)
void ShowFade (void)
void AnimateFade (void)
__inline DWORD TestFadeFlags (DWORD dwFlags)
HANDLE xxxSetLayeredWindow (PWND pwnd, BOOL fRepaintBehind)
BOOL UnsetLayeredWindow (PWND pwnd)
void TrackLayeredZorder (PWND pwnd)
VOID UpdateLayeredSprite (PDCE pdce)
BOOL _UpdateLayeredWindow (PWND pwnd, HDC hdcDst, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc, COLORREF crKey, BLENDFUNCTION *pblend, DWORD dwFlags)
BOOL _SetLayeredWindowAttributes (PWND pwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags)
BOOL RecreateRedirectionBitmap (PWND pwnd)
PWND GetLayeredWindow (PWND pwnd)
__inline BOOL FLayeredOrRedirected (PWND pwnd)
void InternalInvalidate3 (PWND pwnd, HRGN hrgn, DWORD flags)
BOOL UserSetFont (PUNICODE_STRING pProfileUserName, LPLOGFONTW lplf, UINT idFont, HFONT *phfont)
HICON DWP_GetIcon (PWND pwnd, UINT uType)
BOOL xxxRedrawTitle (PWND pwnd, UINT wFlags)
DWORD GetContextHelpId (PWND pwnd)
HANDLE xxxClientCopyImage (HANDLE hImage, UINT type, int cxNew, int cyNew, UINT flags)
VOID _WOWCleanup (HANDLE hInstance, DWORD hTaskWow)
VOID _WOWModuleUnload (HANDLE hModule)
PUNICODE_STRING CreateProfileUserName (TL *ptl)
void FreeProfileUserName (PUNICODE_STRING pProfileUserName, TL *ptl)
HANDLE OpenCacheKeyEx (PUNICODE_STRING pProfileUserName OPTIONAL, UINT idSection, ACCESS_MASK amRequest, PDWORD pdwPolicyFlags)
BOOL CheckDesktopPolicy (PUNICODE_STRING pProfileUserName OPTIONAL, PCWSTR lpKeyName)
BOOL CheckDesktopPolicyChange (PUNICODE_STRING pProfileUserName OPTIONAL)
DWORD FastGetProfileKeysW (PUNICODE_STRING pProfileUserName OPTIONAL, UINT idSection, LPCWSTR pszDefault, LPWSTR *ppszKeys)
DWORD FastGetProfileDwordW (PUNICODE_STRING pProfileUserName OPTIONAL, UINT idSection, LPCWSTR lpKeyName, DWORD dwDefault)
DWORD FastGetProfileStringW (PUNICODE_STRING pProfileUserName OPTIONAL, UINT idSection, LPCWSTR lpKeyName, LPCWSTR lpDefault, LPWSTR lpReturnedString, DWORD nSize)
UINT FastGetProfileIntW (PUNICODE_STRING pProfileUserName OPTIONAL, UINT idSection, LPCWSTR lpKeyName, UINT nDefault)
BOOL FastWriteProfileStringW (PUNICODE_STRING pProfileUserName OPTIONAL, UINT idSection, LPCWSTR lpKeyName, LPCWSTR lpString)
int FastGetProfileIntFromID (PUNICODE_STRING pProfileUserName OPTIONAL, UINT idSection, UINT idKey, int def)
DWORD FastGetProfileStringFromIDW (PUNICODE_STRING pProfileUserName OPTIONAL, UINT idSection, UINT idKey, LPCWSTR lpDefault, LPWSTR lpReturnedString, DWORD cch)
BOOL FastWriteProfileValue (PUNICODE_STRING pProfileUserName OPTIONAL, UINT idSection, LPCWSTR lpKeyName, UINT uType, LPBYTE lpStruct, UINT cbSizeStruct)
DWORD FastGetProfileValue (PUNICODE_STRING pProfileUserName OPTIONAL, UINT idSection, LPCWSTR lpKeyName, LPBYTE lpDefault, LPBYTE lpReturn, UINT cbSizeReturn)
BOOL FastGetProfileIntsW (PUNICODE_STRING pProfileUserName OPTIONAL, PPROFINTINFO ppii)
BOOL FastUpdateWinIni (PUNICODE_STRING pProfileUserName OPTIONAL, UINT idSection, UINT wKeyNameId, LPWSTR lpszValue)
VOID RecreateSmallIcons (PWND pwnd)
__inline int GetCaptionHeight (PWND pwnd)
__inline void InitTooltipDelay (PTOOLTIPWND pttwnd)
__inline PPROFILEVALUEINFO UPDWORDPointer (UINT uSetting)
__inline int ComputeTickDelta (IN DWORD dwCurTick, IN DWORD dwLastTick)
__inline int ComputePastTickDelta (IN DWORD dwCurTick, IN DWORD dwLastTick)
__inline DWORD SubtractTick (IN DWORD dwTime, IN int nDelta)
__inline BOOL IsTimeFromLastInput (DWORD dwTimeout)
__inline BOOL IsTimeFromLastRITEvent (DWORD dwTimeout)
__inline BOOL IsForegroundLocked ()
__inline BOOL GiveUpForeground ()
__inline void IncSFWLockCount ()
__inline void DecSFWLockCount ()
__inline DWORD UPDWORDValue (UINT uSetting)
PIMC CreateInputContext (IN ULONG_PTR dwClientImcData)
BOOL DestroyInputContext (IN PIMC pImc)
VOID FreeInputContext (IN PIMC pImc)
HIMC AssociateInputContext (IN PWND pWnd, IN PIMC pImc)
AIC_STATUS AssociateInputContextEx (IN PWND pWnd, IN PIMC pImc, IN DWORD dwFlag)
BOOL UpdateInputContext (IN PIMC pImc, IN UPDATEINPUTCONTEXTCLASS UpdateType, IN ULONG_PTR UpdateValue)
VOID xxxFocusSetInputContext (IN PWND pwnd, IN BOOL fActivate, IN BOOL fQueueMsg)
UINT BuildHimcList (PTHREADINFO pti, UINT cHimcMax, HIMC *phimcFirst)
PWND xxxCreateDefaultImeWindow (IN PWND pwnd, IN ATOM atomT, IN HANDLE hInst)
BOOL xxxImmActivateThreadsLayout (PTHREADINFO pti, PTLBLOCK ptlBlockPrev, PKL pkl)
VOID xxxImmActivateAndUnloadThreadsLayout (IN PTHREADINFO *ptiList, IN UINT nEntries, IN PTLBLOCK ptlBlockPrev, PKL pklCurrent, DWORD dwHklReplace)
VOID xxxImmActivateLayout (IN PTHREADINFO pti, IN PKL pkl)
VOID xxxImmUnloadThreadsLayout (IN PTHREADINFO *ptiList, IN UINT nEntry, IN PTLBLOCK ptlBlockPrev, IN DWORD dwFlag)
VOID xxxImmUnloadLayout (IN PTHREADINFO pti, IN DWORD dwFlag)
PIMEINFOEX xxxImmLoadLayout (IN HKL hKL)
BOOL GetImeInfoEx (IN PWINDOWSTATION pwinsta, IN PIMEINFOEX piiex, IN IMEINFOEXCLASS SearchType)
BOOL SetImeInfoEx (IN PWINDOWSTATION pwinsta, IN PIMEINFOEX piiex)
DWORD xxxImmProcessKey (IN PQ pq, IN PWND pwnd, IN UINT message, IN WPARAM wParam, IN LPARAM lParam)
BOOL GetImeHotKey (DWORD dwHotKeyID, PUINT puModifiers, PUINT puVKey, HKL *phKL)
BOOL SetImeHotKey (DWORD dwHotKeyID, UINT uModifiers, UINT uVKey, HKL hKL, DWORD dwAction)
PIMEHOTKEYOBJ CheckImeHotKey (PQ pq, UINT uVKey, LPARAM lParam)
BOOL ImeCanDestroyDefIME (IN PWND pwndDefaultIme, IN PWND pwndDestroy)
BOOL IsChildSameThread (IN PWND pwndParent, IN PWND pwndChild)
BOOL ImeCanDestroyDefIMEforChild (IN PWND pwndDefaultIme, IN PWND pwndDestroy)
VOID ImeCheckTopmost (IN PWND pwnd)
VOID ImeSetFutureOwner (IN PWND pwndDefaultIme, IN PWND pwndOrgOwner)
VOID ImeSetTopmostChild (IN PWND pwndRoot, IN BOOL fFlag)
VOID ImeSetTopmost (IN PWND pwndRoot, IN BOOL fFlag, IN PWND pwndInsertBefore)
PSOFTKBDDATA ProbeAndCaptureSoftKbdData (PSOFTKBDDATA Source)
VOID xxxNotifyIMEStatus (IN PWND pwnd, IN DWORD dwOpen, IN DWORD dwConversion)
BOOL xxxSetIMEShowStatus (IN BOOL fShow)
VOID xxxBroadcastImeShowStatusChange (IN PWND pwndDefIme, IN BOOL fShow)
VOID xxxCheckImeShowStatusInThread (IN PWND pwndDefIme)
__inline VOID EnterMouseCrit ()
__inline VOID LeaveMouseCrit ()
__inline VOID EnterDeviceInfoListCrit ()
__inline VOID LeaveDeviceInfoListCrit ()
__inline VOID LockCaptureWindow (PQ pq, PWND pwnd)
__inline VOID UnlockCaptureWindow (PQ pq)
BOOL SetHandleFlag (HANDLE, DWORD, BOOL)
BOOL CheckHandleFlag (HANDLE, DWORD)
VOID SetHandleInUse (HANDLE)
BOOL CheckHandleInUse (HANDLE)
__inline NTSTATUS CloseProtectedHandle (HANDLE handle)
__inline VOID EnterHandleFlagsCrit ()
__inline VOID LeaveHandleFlagsCrit ()
BOOL xxxEnumDisplayMonitors (HDC hdc, LPRECT lprcClip, MONITORENUMPROC lpfnEnum, LPARAM dwData, BOOL fInternal)
BOOL xxxClientMonitorEnumProc (HMONITOR hMonitor, HDC hdcMonitor, LPRECT lprc, LPARAM dwData, MONITORENUMPROC xpfnProc)
void ClipPointToDesktop (LPPOINT lppt)
void DestroyMonitor (PMONITOR pMonitor)
BOOL GetHDevName (HMONITOR hMon, PWCHAR pName)
ULONG HdevFromMonitor (PMONITOR pMonitor)
__inline PDISPLAYINFO GetDispInfo (void)
__inline PMONITOR GetPrimaryMonitor (void)
VOID _QueryUserHandles (IN LPDWORD lpIn, IN DWORD dwInLength, OUT DWORD pdwResult[][TYPE_CTYPES])
NTSTATUS RemoteConnect (IN PDOCONNECTDATA pDoConnectData, IN ULONG DisplayDriverNameLength, IN PWCHAR DisplayDriverName)
NTSTATUS xxxRemoteDisconnect (VOID)
NTSTATUS xxxRemoteReconnect (IN PDORECONNECTDATA pDoReconnectData)
NTSTATUS RemoteLogoff (VOID)
BOOL PrepareForLogoff (UINT uFlags)
NTSTATUS xxxRemoteStopScreenUpdates (BOOL fDisableGraphics)
VOID xxxPushKeyEvent (BYTE bVk, BYTE bScan, DWORD dwFlags, DWORD dwExtraInfo)
NTSTATUS RemoteThinwireStats (OUT PVOID Stats)
NTSTATUS RemoteNtSecurity (VOID)
NTSTATUS xxxRemoteShadowSetup (VOID)
NTSTATUS RemoteShadowStart (IN PVOID pThinwireData, ULONG ThinwireDataLength)
NTSTATUS xxxRemoteShadowStop (VOID)
NTSTATUS RemoteShadowCleanup (IN PVOID pThinwireData, ULONG ThinwireDataLength)
NTSTATUS xxxRemotePassthruEnable (VOID)
NTSTATUS RemotePassthruDisable (VOID)
NTSTATUS CtxDisplayIOCtl (ULONG DisplayIOCtlFlags, PUCHAR pDisplayIOCtlData, ULONG cbDisplayIOCtlData)
DWORD RemoteConnectState (VOID)
BOOL _GetWinStationInfo (WSINFO *pWsInfo)
NTSTATUS RemoteRedrawRectangle (WORD Left, WORD Top, WORD Right, WORD Bottom)
NTSTATUS RemoteRedrawScreen (VOID)
NTSTATUS RemoteDisableScreen (VOID)
VOID NlsKbdSendIMEProc (DWORD dwImeOpen, DWORD dwImeConversion)

Variables

PTHREADINFO _ptiCrit (VOID)
PTHREADINFO _ptiCritShared (VOID)
POBJECT_TYPEExWindowStationObjectType
POBJECT_TYPEExDesktopObjectType
POBJECT_TYPEExEventObjectType
DEVICE_TEMPLATE aDeviceTemplate []
PWIN32HEAP gpvSharedAlloc
PWND PwndForegroundCapture (VOID)
ULONG gSessionId
PWND HotKeyToWindow (DWORD)
PWND GetLastTopMostWindow (VOID)
PWND _GetActiveWindow (VOID)
ATOM gaFlashWState
PCURSOR _GetCursor (VOID)
PWINDOWSTATION _GetProcessWindowStation (HWINSTA *)
PMENU _CreateMenu (VOID)
PMENU _CreatePopupMenu (VOID)
HANDLE ghCanActivateForegroundPIDs [ACTIVATE_ARRAY_SIZE]


Define Documentation

#define __GetWindowLong pwnd,
index   )     ((LONG)(*(DWORD UNALIGNED *)((BYTE *)((pwnd) + 1) + (index))))
 

Definition at line 5789 of file userk.h.

Referenced by DBGGetWindowLong().

#define __GetWindowLongPtr pwnd,
index   )     ((LONG_PTR)(*(ULONG_PTR UNALIGNED *)((BYTE *)((pwnd) + 1) + (index))))
 

Definition at line 5790 of file userk.h.

Referenced by DBGGetWindowLongPtr().

#define _GetWindowLong   __GetWindowLong
 

Definition at line 5797 of file userk.h.

Referenced by GetWindowWord(), NtUserQueryWindow(), and xxxRedrawHungWindow().

#define _GetWindowLongPtr   __GetWindowLongPtr
 

Definition at line 5798 of file userk.h.

#define _ThreadLockPti pti,
pobj,
ptl   )     LockW32Thread((PW32THREAD)pobj, ptl)
 

Definition at line 1680 of file userk.h.

#define abs  )     (((A) < 0)? -(A) : (A))
 

Definition at line 2354 of file userk.h.

Referenced by ComboBoxWndProcWorker(), ConsoleWindowProc(), DIBtoDIBV5(), DoMouseAccel(), KeSetBasePriorityThread(), MLEditWndProc(), ReaderMouseMove(), ReaderProcInternal(), SBSetParms(), SizeOfDib(), SizeRect(), TestRectBogus(), xxxLBBlockHilite(), and xxxNewITopEx().

#define ACCF_ACCESSENABLED   0x00000100
 

Definition at line 6573 of file userk.h.

Referenced by ProcessKeyboardInput(), ProcessMouseInput(), and SetAccessEnabledFlag().

#define ACCF_DEFAULTFILTERKEYSON   0x00000001
 

Definition at line 6565 of file userk.h.

Referenced by xxxUpdatePerUserAccessPackSettings().

#define ACCF_DEFAULTHIGHCONTRASTON   0x00000080
 

Definition at line 6572 of file userk.h.

Referenced by xxxUpdatePerUserAccessPackSettings().

#define ACCF_DEFAULTKEYBOARDPREF   0x00000020
 

Definition at line 6570 of file userk.h.

Referenced by xxxUpdatePerUserAccessPackSettings().

#define ACCF_DEFAULTMOUSEKEYSON   0x00000004
 

Definition at line 6567 of file userk.h.

Referenced by xxxUpdatePerUserAccessPackSettings().

#define ACCF_DEFAULTSCREENREADER   0x00000040
 

Definition at line 6571 of file userk.h.

Referenced by xxxUpdatePerUserAccessPackSettings().

#define ACCF_DEFAULTSTICKYKEYSON   0x00000002
 

Definition at line 6566 of file userk.h.

Referenced by xxxUpdatePerUserAccessPackSettings().

#define ACCF_DEFAULTTIMEOUTON   0x00000010
 

Definition at line 6569 of file userk.h.

Referenced by xxxUpdatePerUserAccessPackSettings().

#define ACCF_DEFAULTTOGGLEKEYSON   0x00000008
 

Definition at line 6568 of file userk.h.

Referenced by xxxUpdatePerUserAccessPackSettings().

#define ACCF_FIRSTTICK   0x00004000
 

Definition at line 6578 of file userk.h.

Referenced by SoundSentryTimer().

#define ACCF_FKMAKECODEPROCESSED   0x00000800
 

Definition at line 6575 of file userk.h.

Referenced by FilterKeys(), and xxxFKAcceptanceDelayTimer().

#define ACCF_IGNOREBREAKCODE   0x00000400
 

Definition at line 6574 of file userk.h.

Referenced by FilterKeys().

#define ACCF_KEYBOARDPREF   0x00020000
 

Definition at line 6586 of file userk.h.

Referenced by LoadCPUserPreferences(), xxxDrawMenuBarUnderlines(), xxxDrawMenuItemText(), xxxSystemParametersInfo(), and xxxUpdatePerUserAccessPackSettings().

#define ACCF_MKREPEATVK   0x00002000
 

Definition at line 6577 of file userk.h.

Referenced by MouseKeys(), TurnOffMouseKeys(), xxxMKButtonClick(), xxxMKMouseMove(), and xxxMKToggleMouseKeys().

#define ACCF_MKVIRTUALMOUSE   0x00001000
 

Definition at line 6576 of file userk.h.

Referenced by InitMice(), MKHideMouseCursor(), and MKShowMouseCursor().

#define ACCF_SCREENREADER   0x00040000
 

Definition at line 6587 of file userk.h.

Referenced by xxxSystemParametersInfo(), and xxxUpdatePerUserAccessPackSettings().

#define ACCF_SHOWSOUNDSON   0x00008000
 

Definition at line 6579 of file userk.h.

Referenced by SetAccessEnabledFlag(), xxxAccessTimeOutTimer(), xxxSystemParametersInfo(), and xxxUpdatePerUserAccessPackSettings().

#define ACTIVATE_ARRAY_SIZE   5
 

Definition at line 6335 of file userk.h.

Referenced by GiveForegroundActivateRight(), and HasForegroundActivateRight().

 
#define AnySpbs  )     (gpDispInfo->pspbFirst != NULL)
 

Definition at line 3657 of file userk.h.

Referenced by _ScrollDC(), BltValidInit(), CreateCacheDC(), CreateSpb(), FreeAllSpbs(), FreeSpb(), SpbCheck(), xxxDWP_SetRedraw(), xxxInternalInvalidate(), xxxScrollWindowEx(), and zzzBltValidBits().

#define ATW_ASYNC   0x0004
 

Definition at line 4446 of file userk.h.

Referenced by xxxActivateThisWindow(), and xxxProcessEventMessage().

#define ATW_MOUSE   0x0001
 

Definition at line 4444 of file userk.h.

Referenced by xxxActivateThisWindow(), and xxxActivateWindow().

#define ATW_NOZORDER   0x0008
 

Definition at line 4447 of file userk.h.

Referenced by xxxActivateThisWindow(), xxxActiveWindowTracking(), and xxxProcessEventMessage().

#define ATW_SETFOCUS   0x0002
 

Definition at line 4445 of file userk.h.

Referenced by xxxActivateThisWindow(), xxxActivateWindow(), xxxMenuWindowProc(), xxxProcessEventMessage(), and xxxSetForegroundWindow2().

#define AW_SKIP   3
 

Definition at line 2325 of file userk.h.

Referenced by xxxActivateWindow(), xxxDestroyWindow(), xxxMinMaximize(), and xxxShowWindow().

#define AW_SKIP2   5 /* used internally in xxxActivateWindow() */
 

Definition at line 2327 of file userk.h.

Referenced by xxxActivateWindow(), and xxxMenuWindowProc().

#define AW_TRY   2
 

Definition at line 2324 of file userk.h.

Referenced by xxxActivateWindow(), xxxDestroyWindow(), and xxxMouseActivate().

#define AW_TRY2   4
 

Definition at line 2326 of file userk.h.

Referenced by xxxActivateWindow(), and xxxMouseActivate().

#define AW_USE   1
 

Definition at line 2323 of file userk.h.

Referenced by xxxActivateWindow(), xxxSetActiveWindow(), xxxSetForegroundWindow(), xxxShowWindow(), and xxxSwpActivate().

#define AW_USE2   6 /* nc mouse activation added by craigc */
 

Definition at line 2328 of file userk.h.

Referenced by xxxActivateWindow(), and xxxHandleNCMouseGuys().

#define BC_INVERT   0x00000001
 

Definition at line 28 of file userk.h.

#define BC_NOMIRROR   0x00000002
 

Definition at line 29 of file userk.h.

Referenced by BltColor(), and DrawMenuItemCheckMark().

 
#define BeginAtomicCheck  ) 
 

Definition at line 1840 of file userk.h.

Referenced by xxxCreateDesktop().

 
#define BEGINATOMICCHECK  ) 
 

Definition at line 1838 of file userk.h.

Referenced by CreateDeviceInfo(), CreateFade(), CreateRedirectionBitmap(), DestroyProcessInfo(), DestroyTask(), DestroyThreadsObjects(), HMDestroyUnlockedObject(), LockWindowUpdate2(), ProcessDeviceChanges(), ResetSystemColors(), SpbTransfer(), UnsetLayeredWindow(), UpdateLayeredSprite(), UserJobCallout(), xxxCapture(), xxxCreateThreadInfo(), xxxCreateWindowStation(), xxxHardErrorControl(), xxxProcessNotifyWinEvent(), xxxRedrawHungWindow(), xxxSetLayeredWindow(), zzzBltValidBits(), zzzChangeStates(), zzzReattachThreads(), and zzzRecalc2().

 
#define BeginAtomicDeviceInfoListCheck  ) 
 

Definition at line 1841 of file userk.h.

 
#define BEGINATOMICDEVICEINFOLISTCHECK  ) 
 

Definition at line 1839 of file userk.h.

Referenced by NlsKbdSendIMENotification(), and ProcessDeviceChanges().

#define BMSG_POSTMSG   0x0002
 

Definition at line 3791 of file userk.h.

Referenced by _PostMessage().

#define BMSG_SENDMSG   0x0000
 

Definition at line 3789 of file userk.h.

Referenced by xxxSendMessageTimeout(), and xxxSystemBroadcastMessage().

#define BMSG_SENDMSGCALLBACK   0x0003
 

Definition at line 3792 of file userk.h.

Referenced by xxxSendMessageCallback().

#define BMSG_SENDMSGTIMEOUT   0x0004
 

Definition at line 3793 of file userk.h.

Referenced by xxxSendMessageTimeout().

#define BMSG_SENDNOTIFYMSG   0x0001
 

Definition at line 3790 of file userk.h.

Referenced by xxxBroadcastDisplaySettingsChange(), xxxSendMessageCallback(), xxxSendNotifyMessage(), xxxSystemBroadcastMessage(), and xxxUserResetDisplayDevice().

#define BMSG_SENDNOTIFYMSGPROCESS   0x0005
 

Definition at line 3794 of file userk.h.

#define BORDER_EXTRA   3
 

Definition at line 6913 of file userk.h.

Referenced by SetNCMetrics(), xxxMoveSize(), and xxxSystemParametersInfo().

#define BWL_CHWNDINIT   32 /* initial # slots pre-allocated */
 

Definition at line 3630 of file userk.h.

#define BWL_CHWNDMORE   8 /* # slots to obtain when required */
 

Definition at line 3631 of file userk.h.

Referenced by ExpandWindowList().

#define BWL_ENUMCHILDREN   1
 

Definition at line 3633 of file userk.h.

Referenced by AssociateInputContextEx(), DestroyInputContext(), InternalBuildHwndList(), NtUserBuildHwndList(), xxxHelpLoop(), and xxxMetricsRecalc().

#define BWL_ENUMIMELAST   0x08
 

Definition at line 3637 of file userk.h.

Referenced by BuildHwndList(), and NtUserBuildHwndList().

#define BWL_ENUMLIST   2
 

Definition at line 3634 of file userk.h.

Referenced by _FindWindowEx(), AssociateInputContextEx(), CancelInputState(), DestroyInputContext(), InitSwitchWndInfo(), InternalBuildHwndList(), NtUserBuildHwndList(), xxxActivateThisWindow(), xxxArrangeIconicWindows(), xxxCheckImeShowStatus(), xxxClientShutdown(), xxxDeactivate(), xxxDefWindowProc(), xxxDesktopRecalc(), xxxDWPPrint(), xxxInternalDoSyncPaint(), xxxMetricsRecalc(), xxxSendBSMtoDesktop(), xxxSetClassIcon(), and xxxShowOwnedWindows().

#define BWL_ENUMOWNERLIST   4
 

Definition at line 3635 of file userk.h.

Referenced by BuildHwndList().

#define BWL_REMOVEIMECHILD   0x10
 

Definition at line 3638 of file userk.h.

Referenced by BuildHwndList().

#define CALL_LPK ptiCurrent   ) 
 

Value:

((PpiCurrent()->dwLpkEntryPoints & LPK_INSTALLED) && \ !((ptiCurrent)->TIF_flags & (TIF_INCLEANUP | TIF_SYSTEMTHREAD)))

Definition at line 3529 of file userk.h.

Referenced by DrawTextExWorker(), DT_DrawStr(), DT_GetExtentMinusPrefixes(), GetNextWordbreak(), MNRecalcTabStrings(), xxxDrawCaptionTemp(), xxxDrawItemUnderline(), xxxDrawMenuBarUnderlines(), xxxDrawMenuItemText(), xxxMB_FindLongestString(), and xxxPSMTextOut().

#define CallClientProcA pwnd,
msg,
wParam,
lParam,
xpfn   ) 
 

Value:

SfnDWORD(pwnd, msg, wParam, lParam, xpfn, \ ((PROC)(gpsi->apfnClientW.pfnDispatchMessage)), TRUE, NULL)

Definition at line 2251 of file userk.h.

Referenced by xxxDispatchMessage(), xxxReceiveMessage(), and xxxSendMessageCallback().

#define CallClientProcW pwnd,
msg,
wParam,
lParam,
xpfn   ) 
 

Value:

SfnDWORD(pwnd, msg, wParam, lParam, xpfn, \ ((PROC)(gpsi->apfnClientW.pfnDispatchMessage)), TRUE, NULL)

Definition at line 2254 of file userk.h.

Referenced by xxxDispatchMessage().

#define CallClientWorkerProc pwnd,
msg,
wParam,
lParam,
xpfn   )     SfnDWORD(pwnd, msg, wParam, lParam, 0, xpfn, TRUE, NULL)
 

Definition at line 2257 of file userk.h.

Referenced by xxxFreeWindow().

#define CAPTIONTOOLTIPLEN   100
 

Definition at line 2595 of file userk.h.

Referenced by xxxShowTooltip().

#define CCACHEDCAPTIONS   5
 

Definition at line 37 of file userk.h.

Referenced by _DestroyCursor(), CreateBitmapStrip(), and DrawCaptionIcon().

#define CCVR_WORKSPACE   4
 

Definition at line 3871 of file userk.h.

#define CH_HELPPREFIX   0x08
 

Definition at line 3855 of file userk.h.

Referenced by xxxMNCompute(), xxxMNFindChar(), and xxxRealDrawMenuItem().

#define CHARALIGN   sizeof(WCHAR)
 

Definition at line 148 of file userk.h.

Referenced by MESSAGECALL(), NtUserDrawCaptionTemp(), NtUserfnHkINLPCBTCREATESTRUCT(), NtUserGetAltTabInfo(), NtUserGetClipboardFormatName(), NtUserGetIconInfo(), NtUserGetKeyboardLayoutName(), NtUserGetKeyNameText(), NtUserInternalGetWindowText(), NtUserLoadKeyboardLayoutEx(), NtUserOpenWindowStation(), NtUserSystemParametersInfo(), and NtUserToUnicodeEx().

 
#define CheckCritIn  ) 
 

Definition at line 1833 of file userk.h.

Referenced by _CsDdeUninitialize(), _CsUpdateInstance(), _GetClassInfoEx(), _GetKeyboardLayout(), _GetWinStationInfo(), _ReleaseDC(), _ReplyMessage(), _SetClassWord(), _UnregisterClass(), _UserSoundSentryWorker(), _UserTestForWinStaAccess(), AccessProceduresStream(), BuildHwndList(), ChangeForegroundKeyboardTable(), CleanupDirtyDesktops(), CloseDevice(), CreateDeviceInfo(), CreateProfileUserName(), DecTimerCount(), DestroyProcessInfo(), DestroySMWP(), DestroyTask(), DirectedScheduleTask(), DoTimer(), FilterKeys(), FKActivationTimer(), FKBounceKeyTimer(), FreeHwndList(), FreeListFree(), FreeProfileUserName(), FreeTimer(), GetActiveHKL(), GetActiveTrackPwnd(), GetCPD(), GetHDevName(), GetModifierBits(), HighContrastHotKey(), HMAllocObject(), IdleTimerProc(), InitPreviousUserString(), InsertTask(), InternalBeginDeferWindowPos(), InternalRegisterClassEx(), InternalSetTimer(), InterQueueMsgCleanup(), IsHotKey(), IsSAS(), JobCalloutAddProcess(), JobCalloutTerminate(), KEOEMProcs(), MapScancode(), MouseKeys(), OpenCacheKeyEx(), OpenDevice(), OpenMultiplePortDevice(), PhkFirstGlobalValid(), PhkFirstValid(), PostEventMessage(), PostMove(), PrepareForLogoff(), ProcessDeviceChanges(), RegisterForDeviceChangeNotifications(), RemoteDisableScreen(), RemoteOpenCacheKeyEx(), RemoteRedrawRectangle(), RemoteRedrawScreen(), RemoteSyncToggleKeys(), RemoveProcessFromJob(), SendMsgCleanup(), SetProcessFlags(), SetWakeBit(), StoreMessage(), StoreQMessage(), ToggleKeys(), UnlinkHook(), UnregisterForDeviceChangeNotifications(), UpdateAsyncKeyState(), UpdateJob(), UpdateKeyLights(), UpdateMouseInfo(), UpdateRawKeyState(), UserAssociateHwnd(), UserGetClientRgn(), UserGetCurrentDesktopId(), UserGetHwnd(), UserVisrgnFromHwnd(), UtilityManager(), VKFromVSC(), WaitOnPseudoEvent(), xxxAccessTimeOutTimer(), xxxBroadcastImeShowStatusChange(), xxxButtonEvent(), xxxCallHook2(), xxxCancelCoolSwitch(), xxxChangeMonitorFlags(), xxxCleanupDdeConv(), xxxCreateDesktop(), xxxCreateDesktop2(), xxxCreateThreadInfo(), xxxCsDdeInitialize(), xxxCsEvent(), xxxDesktopThread(), xxxDestroyThreadDDEObject(), xxxDirectedYield(), xxxDoButtonEvent(), xxxDoHotKeyStuff(), xxxEventWndProc(), xxxFKAcceptanceDelayTimer(), xxxFKRepeatRateTimer(), xxxFreeListFree(), xxxHardwareMouseKeyUp(), xxxICO_00(), xxxInitProcessInfo(), xxxInitTerminal(), xxxInternalGetMessage(), xxxInterSendMsgEx(), xxxKELocaleProcs(), xxxKENLSProcs(), xxxKeyEvent(), xxxMessageEvent(), xxxMKButtonSetState(), xxxMKMoveAccelCursorTimer(), xxxMKMoveConstCursorTimer(), xxxNumpadCursor(), xxxProcessKeyEvent(), xxxReceiveMessage(), xxxRedrawHungWindow(), xxxRegisterForDeviceClassNotifications(), xxxRemoteStopScreenUpdates(), xxxResolveDesktop(), xxxSendMessageCallback(), xxxSendMessageTimeout(), xxxSendMessageToUI(), xxxSetClassLongPtr(), xxxSetDeskPattern(), xxxSetIMEShowStatus(), xxxSetProcessInitState(), xxxSleepTask(), xxxSleepThread(), xxxStickyKeys(), xxxSwitchDesktop(), xxxToggleKeysTimer(), xxxTurnOffStickyKeys(), xxxUpdateModifierState(), xxxUserDuplicateObject(), xxxUserNotifyProcessCreate(), and zzzAttachThreadInput().

 
#define CheckCritInShared  ) 
 

Definition at line 1835 of file userk.h.

Referenced by _GetWOWClass(), GetModificationNumber(), PhkNextValid(), and ValidateHandleSecure().

 
#define CheckCritOut  ) 
 

Definition at line 1836 of file userk.h.

Referenced by CreateSystemThread(), DeviceCDROMNotify(), DeviceClassCDROMNotify(), DeviceClassNotify(), DeviceNotify(), EnterCrit(), InitSystemThread(), LeaveCrit(), LockProcessByClientId(), ProcessMouseInput(), QueueMouseEvent(), RawInputThread(), RequestDeviceChange(), UserBeep(), xxxMoveEvent(), and xxxMoveEventAbsolute().

 
#define CheckDeviceInfoListCritIn  ) 
 

Definition at line 1834 of file userk.h.

Referenced by FreeDeviceInfo(), and RequestDeviceChange().

 
#define CheckDeviceInfoListCritOut  ) 
 

Definition at line 1837 of file userk.h.

Referenced by DeviceNotify(), EnterCrit(), ProcessMouseInput(), and RequestDeviceChange().

 
#define CheckForClientDeath  ) 
 

Definition at line 97 of file userk.h.

Referenced by xxxGetInputEvent(), xxxInternalGetMessage(), xxxMsgWaitForMultipleObjects(), xxxSleepTask(), xxxSleepThread(), and xxxWaitForInputIdle().

#define CheckHwnd  )     TRUE
 

Definition at line 2159 of file userk.h.

#define CheckHwndNull  )     TRUE
 

Definition at line 2160 of file userk.h.

#define CheckLock  ) 
 

Definition at line 1080 of file userk.h.

#define CheckPtiSysPeek where,
pq,
newIdSysPeek   ) 
 

Definition at line 69 of file userk.h.

Referenced by DestroyThreadsMessages(), RedistributeInput(), xxxScanSysQueue(), and xxxSkipSysMsg().

#define CheckSysLock where,
pq,
pti   ) 
 

Definition at line 70 of file userk.h.

Referenced by RedistributeInput(), xxxInternalGetMessage(), xxxScanSysQueue(), and zzzDestroyQueue().

 
#define CleanupPoolAllocations  ) 
 

Definition at line 2120 of file userk.h.

Referenced by Win32KDriverUnload().

 
#define CleanUpPoolLimitations  ) 
 

Definition at line 2122 of file userk.h.

Referenced by Win32KDriverUnload().

 
#define CleanUpSections  ) 
 

Definition at line 2128 of file userk.h.

Referenced by Win32KDriverUnload().

#define CLEAR_ACCF  )     CLEAR_FLAG(gdwPUDFlags, f)
 

Definition at line 6604 of file userk.h.

Referenced by FilterKeys(), InitMice(), MKHideMouseCursor(), MouseKeys(), SoundSentryTimer(), TurnOffMouseKeys(), xxxAccessTimeOutTimer(), and xxxUpdatePerUserAccessPackSettings().

#define CLEAR_GTERMF  )     CLEAR_FLAG(gdwGTERMFlags, f)
 

Definition at line 1999 of file userk.h.

Referenced by InitMice(), MKHideMouseCursor(), and ProcessDeviceChanges().

#define CLEAR_PUDF  )     CLEAR_FLAG(gdwPUDFlags, f)
 

Definition at line 6611 of file userk.h.

Referenced by CancelForegroundActivate(), DestroySMWP(), EndShutdown(), FullScreenCleanup(), MNFreePopup(), SetVDMCursorBounds(), xxxMakeWindowForegroundWithState(), xxxMNEndMenuState(), and xxxMoveSize().

#define CLEARHMODLOADED pti,
 ) 
 

Value:

((pti)->ppi->ahmodLibLoaded[x] = NULL, \ (pti)->ppi->dwhmodLibLoadedMask &= ~(1 << (x)))

Definition at line 3668 of file userk.h.

Referenced by xxxDoSysExpunge().

#define ClearRawKeyDown vk   )     ClearKeyDownBit(gafRawKeyState, vk)
 

Definition at line 5736 of file userk.h.

Referenced by ResetPushState(), and UpdateRawKeyState().

#define ClearRawKeyToggle vk   )     ClearKeyToggleBit(gafRawKeyState, vk)
 

Definition at line 5739 of file userk.h.

Referenced by ChangeForegroundKeyboardTable(), ResetPushState(), UpdateKeyLights(), and UpdatePerUserKeyboardIndicators().

#define ClearUP uSetting   )     ClearUPBOOL(gpdwCPUserPreferencesMask, SPI_GET ## uSetting)
 

Definition at line 5264 of file userk.h.

#define ClearUPBOOL pdw,
uSetting   ) 
 

Value:

{ \ UserAssert(UPIsBOOLRange(uSetting)); \ *UPBOOLPointer(pdw, uSetting) &= ~UPBOOLMask(uSetting); \ }

Definition at line 5253 of file userk.h.

Referenced by xxxSystemParametersInfo().

#define CLIBS   32
 

Definition at line 3404 of file userk.h.

Referenced by GetHmodTableIndex().

#define CLIENT_CAPTURE   2 /* client-relative capture */
 

Definition at line 3849 of file userk.h.

Referenced by xxxCapture(), xxxScanSysQueue(), and xxxSetCapture().

#define CLIENT_CAPTURE_INTERNAL   6 /* client-relative capture (Win 3.1 style; won't release) */
 

Definition at line 3853 of file userk.h.

Referenced by xxxCapture(), and xxxMoveSize().

#define CLOSE_PSEUDO_EVENT phE   ) 
 

Value:

CheckCritIn(); \ if (*(phE) == PSEUDO_EVENT_ON) *(phE) = PSEUDO_EVENT_OFF; \ else if (*(phE) != PSEUDO_EVENT_OFF) { \ KeSetEvent(*(phE), EVENT_INCREMENT, FALSE); \ ObDereferenceObject(*(phE)); \ *(phE) = PSEUDO_EVENT_OFF; \ }

Definition at line 3078 of file userk.h.

Referenced by DestroyProcessInfo(), and DestroyTask().

#define CopyRgn hrgnDst,
hrgnSrc   )     GreCombineRgn(hrgnDst, hrgnSrc, NULL, RGN_COPY)
 

Definition at line 2217 of file userk.h.

Referenced by _ExcludeUpdateRgn(), _GetDCEx(), CombineOldNewVis(), GetNCUpdateRgn(), InternalInvalidate3(), InternalScrollDC(), UserValidateCopyRgn(), xxxRedrawHungWindow(), xxxRedrawWindow(), xxxScrollWindowEx(), and zzzBltValidBits().

#define CXF_INTRA_PROCESS   0x8000
 

Definition at line 6184 of file userk.h.

#define CXF_IS_SERVER   0x0001
 

Definition at line 6181 of file userk.h.

Referenced by AddConvProp(), NewConversation(), xxxCleanupDdeConv(), xxxDDETrackGetMessageHook(), and xxxDDETrackPostHook().

#define CXF_PARTNER_WINDOW_DIED   0x0004
 

Definition at line 6183 of file userk.h.

Referenced by xxxCleanupDdeConv(), xxxDDETrackPostHook(), and xxxDDETrackWindowDying().

#define CXF_TERMINATE_POSTED   0x0002
 

Definition at line 6182 of file userk.h.

Referenced by AbnormalDDEPost(), FreeDdeConv(), SpontaneousTerminate(), xxxCleanupDdeConv(), xxxDDETrackGetMessageHook(), xxxDDETrackPostHook(), and xxxDDETrackWindowDying().

#define CXMENU3DEDGE   1
 

Definition at line 4819 of file userk.h.

Referenced by MNDrawMenu3DHotTracking(), and xxxRealDrawMenuItem().

#define CXYDESKPATTERN   8
 

Definition at line 2154 of file userk.h.

Referenced by RecolorDeskPattern(), and xxxSetDeskPattern().

#define CYMENU3DEDGE   1
 

Definition at line 4820 of file userk.h.

Referenced by MNDrawMenu3DHotTracking(), and xxxRealDrawMenuItem().

#define DATA_NOT_BANKED   0xFFFF
 

Definition at line 2935 of file userk.h.

#define DATAALIGN   sizeof(DWORD)
 

Definition at line 147 of file userk.h.

Referenced by _GetComboBoxInfo(), _GetListBoxInfo(), _GetWinStationInfo(), NtUserCopyAcceleratorTable(), NtUserCreateAcceleratorTable(), NtUserDdeGetQualityOfService(), NtUserDrawIconEx(), NtUserEvent(), NtUserfnHkINLPDEBUGHOOKSTRUCT(), NtUserGetAltTabInfo(), NtUserGetClassInfo(), NtUserGetComboBoxInfo(), NtUserGetCursorInfo(), NtUserGetGUIThreadInfo(), NtUserGetIconInfo(), NtUserGetKeyboardLayoutList(), NtUserGetMouseMovePointsEx(), NtUserGetPriorityClipboardFormat(), NtUserGetScrollBarInfo(), NtUserGetTitleBarInfo(), NtUserOpenWindowStation(), NtUserSendInput(), NtUserSetObjectInformation(), NtUserSetSysColors(), and NtUserSystemParametersInfo().

 
#define DBGDecModalMenuCount  ) 
 

Definition at line 7019 of file userk.h.

Referenced by xxxMNEndMenuState(), and xxxMNLoop().

#define DbgDumpTrackedDesktops  ) 
 

Definition at line 7417 of file userk.h.

Referenced by Win32kNtUserCleanup().

 
#define DBGIncModalMenuCount  ) 
 

Definition at line 7018 of file userk.h.

Referenced by xxxMNAllocMenuState().

#define DbgTrackAddDesktop pdesk   ) 
 

Definition at line 7415 of file userk.h.

Referenced by xxxCreateDesktop2().

#define DbgTrackRemoveDesktop pdesk   ) 
 

Definition at line 7416 of file userk.h.

Referenced by FreeDesktop().

#define DbgValidateHooks phk,
iType   ) 
 

Definition at line 6024 of file userk.h.

Referenced by FreeHook(), PhkFirstGlobalValid(), PhkFirstValid(), PhkNextValid(), xxxHkCallHook(), and zzzSetWindowsHookEx().

#define DCC   0x01 /* Client area */
 

Definition at line 3608 of file userk.h.

#define DCCACHE   0x40
 

Definition at line 3614 of file userk.h.

#define DCCLIPRGN   0x08
 

Definition at line 3611 of file userk.h.

#define DCE_FREED   1
 

Definition at line 3601 of file userk.h.

Referenced by ReleaseCacheDC(), and xxxFreeWindow().

#define DCE_NORELEASE   2
 

Definition at line 3602 of file userk.h.

Referenced by _ReleaseDC(), ReleaseCacheDC(), and xxxFreeWindow().

#define DCE_RELEASED   0
 

Definition at line 3600 of file userk.h.

Referenced by ReleaseCacheDC(), and xxxFreeWindow().

#define DCE_SIZE_CACHEINIT   5
 

Definition at line 3597 of file userk.h.

Referenced by InitUserScreen().

#define DCE_SIZE_CACHETHRESHOLD   32
 

Definition at line 3598 of file userk.h.

Referenced by ReleaseCacheDC().

#define DCNOCHILDCLIP   0x10 /* Nochildern clip */
 

Definition at line 3612 of file userk.h.

#define DCSAVEDVISRGN   0x04
 

Definition at line 3610 of file userk.h.

#define DCSAVEVIS   0x20 /* Save visrgn before calculating */
 

Definition at line 3613 of file userk.h.

#define DCUNUSED   0x00 /* Unused cache entry */
 

Definition at line 3607 of file userk.h.

#define DCW   0x02 /* Window area */
 

Definition at line 3609 of file userk.h.

#define DDR_ENDACCEPT   1
 

Definition at line 3048 of file userk.h.

Referenced by xxxMS_TrackMove().

#define DDR_ENDCANCEL   2
 

Definition at line 3049 of file userk.h.

Referenced by xxxCancelTrackingForThread(), xxxMS_TrackMove(), xxxReleaseCapture(), and xxxTrackInitSize().

#define DDR_START   0
 

Definition at line 3047 of file userk.h.

Referenced by xxxDrawDragRect(), and xxxMoveSize().

#define DECLARE_POOLTAG name,
value,
index   ) 
 

Definition at line 2048 of file userk.h.

#define DEFAULT_WINSTA   L"\\Windows\\WindowStations\\WinSta0"
 

Definition at line 4567 of file userk.h.

Referenced by _UserTestForWinStaAccess().

 
#define DeferWinEventNotify  ) 
 

Value:

Definition at line 6469 of file userk.h.

Referenced by DestroyProcessInfo(), LockWindowUpdate2(), xxxCapture(), xxxCreateCaret(), xxxCreateDesktop(), xxxCreateThreadInfo(), xxxCreateWindowStation(), xxxHardErrorControl(), xxxSetProcessInitState(), zzzBltValidBits(), zzzCancelJournalling(), zzzInitTask(), zzzReattachThreads(), zzzRecalc2(), zzzSetFMouseMoved(), and zzzShowCursor().

#define DEFINE_POOLTAG value,
index   )     value
 

Definition at line 2046 of file userk.h.

#define DESKTOP_ALLOC_TRACE_SIZE   6
 

Definition at line 2604 of file userk.h.

#define DesktopAllocAlways pdesk,
uSize,
tag   )     Win32HeapAlloc(pdesk->pheapDesktop, uSize, tag, 0)
 

Definition at line 2694 of file userk.h.

Referenced by ClassAlloc(), and zzzSetDesktop().

#define DesktopFree pdesk,
 )     Win32HeapFree(pdesk->pheapDesktop, p)
 

Definition at line 2697 of file userk.h.

Referenced by _DestroyMenu(), ClassFree(), CreateProp(), DefSetText(), DeleteProperties(), FreeItemString(), HMFreeObject(), UnlockSubMenu(), xxxCreateDefaultImeWindow(), xxxDestroyThreadInfo(), xxxFreeWindow(), xxxInsertMenuItem(), xxxRemoveDeleteMenuHelper(), xxxSetLPITEMInfo(), xxxSetScrollBar(), and zzzSetDesktop().

#define DEVICE_TYPE_KEYBOARD   1
 

Definition at line 1895 of file userk.h.

Referenced by DeviceClassNotify(), NlsKbdSendIMENotification(), OpenDevice(), ProcessDeviceChanges(), ProcessKeyboardInput(), RawInputThread(), and UpdateKeyLights().

#define DEVICE_TYPE_MAX   1
 

Definition at line 1896 of file userk.h.

Referenced by CreateDeviceInfo(), OpenMultiplePortDevice(), Win32kNtUserCleanup(), and xxxRegisterForDeviceClassNotifications().

#define DEVICE_TYPE_MOUSE   0
 

Definition at line 1894 of file userk.h.

Referenced by DeviceClassNotify(), OpenDevice(), ProcessDeviceChanges(), RawInputThread(), UpdateMouseInfo(), xxxDesktopThread(), and xxxMsgWaitForMultipleObjects().

#define DF_DESKCREATED   0x00200000
 

Definition at line 2591 of file userk.h.

Referenced by CleanupDirtyDesktops(), OkayToCloseDesktop(), and xxxCreateDesktop().

#define DF_DESKWNDDESTROYED   0x40000000
 

Definition at line 2579 of file userk.h.

Referenced by FreeDesktop(), GNT_NextTopScan(), ValidateHdesk(), xxxCreateWindowEx(), xxxDesktopThread(), xxxSwitchDesktop(), and zzzSetDesktop().

#define DF_DESTROYED   0x20000000
 

Definition at line 2580 of file userk.h.

Referenced by DesktopAlloc(), DestroyDesktop(), RemoteRedrawScreen(), ValidateHdesk(), xxxCreateThreadInfo(), xxxCreateWindowEx(), xxxSetCsrssThreadDesktop(), and xxxSwitchDesktop().

#define DF_DYING   0x80000000
 

Definition at line 2578 of file userk.h.

Referenced by FreeDesktop(), ValidateHdesk(), xxxCreateWindowEx(), xxxDesktopThread(), xxxSwitchDesktop(), and zzzSetDesktop().

#define DF_HOTTRACKING   0x10000000
 

Definition at line 2581 of file userk.h.

Referenced by xxxCancelMouseMoveTracking(), and xxxTrackMouseMove().

#define DF_MENUINUSE   0x00800000
 

Definition at line 2589 of file userk.h.

Referenced by MNFreePopup(), xxxMNCloseHierarchy(), xxxMNEndMenuState(), and xxxMNOpenHierarchy().

#define DF_MOUSEMOVETRK   (DF_HOTTRACKING | DF_TOOLTIPACTIVE | DF_TRACKMOUSELEAVE | DF_TRACKMOUSEHOVER)
 

Definition at line 2588 of file userk.h.

Referenced by xxxDesktopThread(), xxxFreeWindow(), xxxProcessEventMessage(), xxxTrackMouseMove(), and zzzSetFMouseMoved().

#define DF_NEWDISPLAYSETTINGS   0x00400000
 

Definition at line 2590 of file userk.h.

Referenced by UserSetDelayedChangeBroadcastForAllDesktops(), and xxxSwitchDesktop().

#define DF_TOOLTIP   (DF_TOOLTIPACTIVE | DF_TOOLTIPSHOWING)
 

Definition at line 2584 of file userk.h.

Referenced by xxxCancelMouseMoveTracking(), xxxProcessEventMessage(), xxxResetTooltip(), xxxTooltipWndProc(), and xxxTrackMouseMove().

#define DF_TOOLTIPACTIVE   0x04000000
 

Definition at line 2583 of file userk.h.

Referenced by xxxProcessEventMessage(), and xxxTrackMouseMove().

#define DF_TOOLTIPSHOWING   0x08000000
 

Definition at line 2582 of file userk.h.

Referenced by xxxCancelMouseMoveTracking(), xxxDesktopThread(), xxxFreeWindow(), and xxxProcessEventMessage().

#define DF_TRACKMOUSEEVENT   (DF_TRACKMOUSELEAVE | DF_TRACKMOUSEHOVER)
 

Definition at line 2587 of file userk.h.

Referenced by QueryTrackMouseEvent(), xxxCapture(), and xxxTrackMouseMove().

#define DF_TRACKMOUSEHOVER   0x01000000
 

Definition at line 2586 of file userk.h.

Referenced by QueryTrackMouseEvent(), TrackMouseEvent(), xxxCancelMouseMoveTracking(), xxxScanSysQueue(), and xxxSystemTimerProc().

#define DF_TRACKMOUSELEAVE   0x02000000
 

Definition at line 2585 of file userk.h.

Referenced by QueryTrackMouseEvent(), TrackMouseEvent(), xxxCancelMouseMoveTracking(), and xxxProcessEventMessage().

#define DIAGNOSE_IO   1
 

Definition at line 1852 of file userk.h.

#define DMI_GRAYED   0x00000002
 

Definition at line 4708 of file userk.h.

#define DMI_INVERT   0x00000001
 

Definition at line 4707 of file userk.h.

Referenced by xxxDrawMenuItem(), and xxxMNInvertItem().

#define dpHorzRes   HORZRES
 

Definition at line 2927 of file userk.h.

#define DPO   0x00FA0089 /* destination, pattern, or */
 

Definition at line 4073 of file userk.h.

#define dpVertRes   VERTRES
 

Definition at line 2928 of file userk.h.

#define DSP_ALLCHILDREN   0x0020
 

Definition at line 4036 of file userk.h.

Referenced by DoQueuedSyncPaint(), xxxInternalDoSyncPaint(), and xxxInternalInvalidate().

#define DSP_ENUMCLIPPEDCHILDREN   0x0004
 

Definition at line 4033 of file userk.h.

Referenced by DoQueuedSyncPaint(), xxxEndDeferWindowPosEx(), xxxInternalDoSyncPaint(), and xxxInternalInvalidate().

#define DSP_ERASE   0x0001
 

Definition at line 4031 of file userk.h.

Referenced by xxxSimpleDoSyncPaint().

#define DSP_FRAME   0x0002
 

Definition at line 4032 of file userk.h.

Referenced by xxxSimpleDoSyncPaint().

#define DSP_NOCHECKPARENTS   0x0010
 

Definition at line 4035 of file userk.h.

#define DSP_WM_SYNCPAINT   0x0008
 

Definition at line 4034 of file userk.h.

#define DTAG_CLASS   0x0001
 

Definition at line 2624 of file userk.h.

Referenced by ClassAlloc().

#define DTAG_CLIENTTHREADINFO   0x0003
 

Definition at line 2626 of file userk.h.

Referenced by zzzSetDesktop().

#define DTAG_DESKTOPINFO   0x0002
 

Definition at line 2625 of file userk.h.

Referenced by xxxCreateDesktop2().

#define DTAG_HANDTABL   0x0005
 

Definition at line 2628 of file userk.h.

Referenced by HMAllocObject().

#define DTAG_IMETEXT   0x0009
 

Definition at line 2632 of file userk.h.

Referenced by xxxCreateDefaultImeWindow().

#define DTAG_MENUITEM   0x0007
 

Definition at line 2630 of file userk.h.

Referenced by xxxInsertMenuItem(), xxxRemoveDeleteMenuHelper(), and xxxSetLPITEMInfo().

#define DTAG_MENUTEXT   0x0008
 

Definition at line 2631 of file userk.h.

Referenced by xxxSetLPITEMInfo().

#define DTAG_PROPLIST   0x000A
 

Definition at line 2633 of file userk.h.

Referenced by CreateProp().

#define DTAG_SBINFO   0x0006
 

Definition at line 2629 of file userk.h.

Referenced by _InitPwSB().

#define DTAG_TEXT   0x0004
 

Definition at line 2627 of file userk.h.

Referenced by DefSetText().

#define DTM_SETUPAPPRAN   (WM_USER+90)
 

Definition at line 3187 of file userk.h.

Referenced by DestroyTask(), and xxxDestroyThreadInfo().

#define DUMMY_TEXT_HANDLE   0xFFFF
 

Definition at line 2934 of file userk.h.

 
#define EndAtomicCheck  ) 
 

Definition at line 1844 of file userk.h.

Referenced by xxxCreateDesktop().

 
#define ENDATOMICCHECK  ) 
 

Definition at line 1842 of file userk.h.

Referenced by CreateDeviceInfo(), CreateFade(), CreateRedirectionBitmap(), DestroyProcessInfo(), DestroyTask(), DestroyThreadsObjects(), HMDestroyUnlockedObject(), LockWindowUpdate2(), ProcessDeviceChanges(), ResetSystemColors(), SpbTransfer(), UnsetLayeredWindow(), UpdateLayeredSprite(), UserJobCallout(), xxxCapture(), xxxCreateThreadInfo(), xxxCreateWindowStation(), xxxHardErrorControl(), xxxProcessNotifyWinEvent(), xxxRedrawHungWindow(), xxxSetLayeredWindow(), zzzBltValidBits(), zzzChangeStates(), zzzReattachThreads(), and zzzRecalc2().

 
#define EndAtomicDeviceInfoListCheck  ) 
 

Definition at line 1845 of file userk.h.

 
#define ENDATOMICDEVICEINFOLISTCHECK  ) 
 

Definition at line 1843 of file userk.h.

Referenced by NlsKbdSendIMENotification(), and ProcessDeviceChanges().

 
#define EndDeferWinEventNotifyWithoutProcessing  ) 
 

Value:

UserAssert(IsWinEventNotifyDeferred()); \ UserAssert(FWINABLE() || gnDeferredWinEvents == 0); \ CheckCritIn(); \ --gdwDeferWinEvent

Definition at line 6488 of file userk.h.

Referenced by DestroyProcessInfo(), xxxCreateThreadInfo(), and xxxSetProcessInitState().

 
#define EXITATOMICCHECK  ) 
 

Definition at line 1846 of file userk.h.

Referenced by CreateDeviceInfo(), xxxCreateWindowStation(), and zzzReattachThreads().

#define FADE_COMPLETED   0x00000002
 

Definition at line 6743 of file userk.h.

Referenced by AnimateFade(), and StopFade().

#define FADE_MENU   0x00000010
 

Definition at line 6746 of file userk.h.

Referenced by MNAnimate(), and xxxMenuWindowProc().

#define FADE_SHOW   0x00000001
 

Definition at line 6742 of file userk.h.

Referenced by AnimateFade(), ShowFade(), StopFade(), xxxMenuWindowProc(), and xxxTooltipWndProc().

#define FADE_SHOWN   0x00000004
 

Definition at line 6744 of file userk.h.

Referenced by ShowFade().

#define FADE_TOOLTIP   0x00000020
 

Definition at line 6747 of file userk.h.

Referenced by xxxTooltipWndProc().

#define FADE_WINDOW   0x00000008
 

Definition at line 6745 of file userk.h.

Referenced by CreateFade(), DeleteFadeSprite(), and UpdateFade().

 
#define FCallHookTray  )     (IsHooked(PtiCurrent(), WHF_SHELL))
 

Definition at line 5831 of file userk.h.

Referenced by IsTrayWindow(), xxxMinMaximize(), xxxSetTrayWindow(), xxxSysCommand(), xxxSystemParametersInfo(), and xxxUpdateTray().

#define FCallTray  )     (FDoTray() && ( FCallHookTray()|| FPostTray(p) ))
 

Definition at line 5833 of file userk.h.

Referenced by xxxAddFullScreen(), and xxxRemoveFullScreen().

 
#define FDoTray  )     (SYSMET(ARRANGE) & ARW_HIDE)
 

Definition at line 5830 of file userk.h.

Referenced by IsTrayWindow(), xxxDefWindowProc(), xxxMinMaximize(), xxxSysCommand(), and xxxUpdateTray().

#define FHas31TrayStyles pwnd   ) 
 

Value:

(TestWF(pwnd, WFFULLSCREEN) || \ (TestWF(pwnd, WFSYSMENU | WFMINBOX) && \ (TestWF(pwnd, WFCAPTION) || TestWF(pwnd, WFMINIMIZED))))

Definition at line 5845 of file userk.h.

Referenced by Is31TrayWindow(), IsTrayWindow(), and xxxUpdateTray().

#define FindClassAtom lpszClassName   )     (IS_PTR(lpszClassName) ? UserFindAtom(lpszClassName) : PTR_TO_ID(lpszClassName))
 

Definition at line 4682 of file userk.h.

Referenced by _FindWindowEx(), _GetClassInfoEx(), _UnregisterClass(), and InternalRegisterClassEx().

 
#define FJOURNALPLAYBACK  )     (GETDESKINFO(PtiCurrent())->aphkStart[WH_JOURNALPLAYBACK + 1] != NULL)
 

Definition at line 3663 of file userk.h.

Referenced by ClearWakeBit(), xxxInternalGetMessage(), xxxKeyEvent(), xxxScanSysQueue(), zzzAttachThreadInput(), zzzInitTask(), and zzzRegisterSystemThread().

 
#define FJOURNALRECORD  )     (GETDESKINFO(PtiCurrent())->aphkStart[WH_JOURNALRECORD + 1] != NULL)
 

Definition at line 3662 of file userk.h.

Referenced by xxxInternalGetMessage(), xxxKeyEvent(), zzzAttachThreadInput(), zzzInitTask(), and zzzRegisterSystemThread().

#define FPostTray  )     (p->pDeskInfo->spwndTaskman)
 

Definition at line 5832 of file userk.h.

Referenced by IsTrayWindow(), xxxMinMaximize(), xxxSetTrayWindow(), xxxSysCommand(), and xxxUpdateTray().

#define FREEHOLD   0
 

Definition at line 2968 of file userk.h.

#define FTopLevel pwnd   )     (pwnd->spwndParent == PWNDDESKTOP(pwnd))
 

Definition at line 5844 of file userk.h.

Referenced by FVisCountable(), IsTrayWindow(), VisWindow(), xxxDrawDragRect(), xxxSetLayeredWindow(), and xxxUpdateTray().

#define FULLSCREEN_CAPTURE   5 /* capture entire machine */
 

Definition at line 3852 of file userk.h.

Referenced by xxxCapture(), and xxxMakeWindowForegroundWithState().

#define GDIAF_ARRIVED   (USHORT)0x0001
 

Definition at line 1899 of file userk.h.

Referenced by CreateDeviceInfo(), ProcessDeviceChanges(), and UpdateMouseInfo().

#define GDIAF_DEPARTED   (USHORT)0x0008
 

Definition at line 1902 of file userk.h.

Referenced by DeviceNotify(), and ProcessDeviceChanges().

#define GDIAF_FREEME   (USHORT)0x0080
 

Definition at line 1905 of file userk.h.

Referenced by FreeDeviceInfo(), InputApc(), RequestDeviceChange(), and StartDeviceRead().

#define GDIAF_IME_STATUS   (USHORT)0x0010
 

Definition at line 1903 of file userk.h.

Referenced by NlsKbdSendIMENotification(), and ProcessDeviceChanges().

#define GDIAF_PNPWAITING   (USHORT)0x0100
 

Definition at line 1906 of file userk.h.

Referenced by DeviceNotify(), FreeDeviceInfo(), ProcessDeviceChanges(), RequestDeviceChange(), and Win32kNtUserCleanup().

#define GDIAF_QUERYREMOVE   (USHORT)0x0002
 

Definition at line 1900 of file userk.h.

Referenced by DeviceNotify(), and ProcessDeviceChanges().

#define GDIAF_RECONNECT   (USHORT)0x0400
 

Definition at line 1908 of file userk.h.

Referenced by ProcessDeviceChanges(), and UpdateMouseInfo().

#define GDIAF_REFRESH_MOUSE   (USHORT)0x0020
 

Definition at line 1904 of file userk.h.

Referenced by ProcessDeviceChanges(), and ProcessMouseInput().

#define GDIAF_REMOVECANCELLED   (USHORT)0x0004
 

Definition at line 1901 of file userk.h.

Referenced by DeviceNotify(), and ProcessDeviceChanges().

#define GDIAF_RETRYREAD   (USHORT)0x0200
 

Definition at line 1907 of file userk.h.

Referenced by ProcessDeviceChanges(), and StartDeviceRead().

#define GDIF_DBGREAD   0x10
 

Definition at line 1917 of file userk.h.

Referenced by StartDeviceRead().

#define GDIF_NOTPNP   0x01
 

Definition at line 1911 of file userk.h.

Referenced by OpenDevice(), OpenMultiplePortDevice(), RegisterForDeviceChangeNotifications(), and UnregisterForDeviceChangeNotifications().

#define GDIF_PNPMUSTFREE   0x08
 

Definition at line 1915 of file userk.h.

Referenced by FreeDeviceInfo().

#define GDIF_READERMUSTFREE   0x04
 

Definition at line 1914 of file userk.h.

Referenced by FreeDeviceInfo().

#define GDIF_READING   0x02
 

Definition at line 1912 of file userk.h.

Referenced by FreeDeviceInfo(), InputApc(), StartDeviceRead(), and Win32kNtUserCleanup().

#define GET_TIME_LAST_READ pti   )     ((pti)->pcti->timeLastRead)
 

Definition at line 2348 of file userk.h.

Referenced by FHungApp().

#define GET_X_LPARAM lp   )     ((int)(short)LOWORD(lp))
 

Definition at line 25 of file userk.h.

#define GET_Y_LPARAM lp   )     ((int)(short)HIWORD(lp))
 

Definition at line 26 of file userk.h.

 
#define GetCurrentProcessId  )     (PsGetCurrentThread()->Cid.UniqueProcess)
 

Definition at line 92 of file userk.h.

Referenced by _LockWindowStation(), _SetLogonNotifyWindow(), _SetWindowStationUser(), _UnlockWindowStation(), CheckDesktopPolicy(), GetColorMatchingModule(), ImmGetImeMenuItemsWorker(), NtUserGetThreadState(), NtUserProcessConnect(), ServiceMessageBox(), SetLastDDEMLError(), xxxRedrawHungWindow(), xxxSnapWindow(), and xxxUpdatePerUserSystemParameters().

#define GETDESKINFO pti   )     ((pti)->pDeskInfo)
 

Definition at line 2345 of file userk.h.

Referenced by _SetProgmanWindow(), _SetTaskmanWindow(), DestroyTask(), InitSwitchWndInfo(), PostShellHookMessages(), xxxDestroyThreadInfo(), xxxDoHotKeyStuff(), xxxMetricsRecalc(), xxxSendMinRectMessages(), and xxxSetShellWindow().

#define GETPCI pcur   )     ((PCURSINFO)&(pcur->CI_FIRST))
 

Definition at line 5956 of file userk.h.

Referenced by SetPointer(), and zzzUpdateCursorImage().

#define GETTOPMOSTINSERTAFTER pwnd   )     (gHardErrorHandler.pti == NULL ? NULL : GetTopMostInsertAfter(pwnd))
 

Definition at line 5501 of file userk.h.

Referenced by CheckTopmost(), and xxxCreateWindowEx().

#define GH_SIZE   8
 

Definition at line 3433 of file userk.h.

Referenced by NtUserUserHandleGrantAccess().

#define GTERMF_MOUSE   0x00000001
 

Definition at line 2003 of file userk.h.

Referenced by AllocQueue(), InitMice(), MKHideMouseCursor(), MKShowMouseCursor(), ProcessDeviceChanges(), xxxSetThreadDesktop(), and zzzSetDesktop().

#define GW_DESKTOP_ID   1
 

Definition at line 2601 of file userk.h.

Referenced by InitVideo(), and xxxCreateDesktop2().

#define HBITMAP_RLE   ((HBITMAP)0xffffffff)
 

Definition at line 1745 of file userk.h.

 
#define HEBREW_UI_LANGID  )     (gpsi->UILangID == MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT))
 

Definition at line 33 of file userk.h.

Referenced by BitBltSysBmp(), and xxxDrawCaptionBar().

#define HF_DESKTOPHOOK   0
 

Definition at line 7289 of file userk.h.

Referenced by _GetUserObjectInformation(), _SetUserObjectInformation(), OpenDesktopCompletion(), xxxCloseDesktop(), xxxCreateDesktop(), and zzzSetDesktop().

#define HF_LIMIT   2
 

Definition at line 7291 of file userk.h.

Referenced by CheckHandleFlag(), and SetHandleFlag().

#define HF_PROTECTED   1
 

Definition at line 7290 of file userk.h.

Referenced by EnterHandleFlagsCrit(), NtUserOpenInputDesktop(), OkayToCloseDesktop(), OkayToCloseWindowStation(), xxxCreateDesktop(), xxxGetInputDesktop(), xxxGetThreadDesktop(), xxxOpenDesktop(), xxxSetProcessWindowStation(), and zzzSetDesktop().

#define HH_ALLDTGONE   0x00000800
 

Definition at line 7394 of file userk.h.

Referenced by InitiateWin32kCleanup().

#define HH_CLEANUPRESOURCES   0x00020000
 

Definition at line 7400 of file userk.h.

Referenced by CleanupResources().

#define HH_DISCONNECTDESKTOP   0x00040000
 

Definition at line 7401 of file userk.h.

Referenced by xxxCreateDesktop().

#define HH_DRIVERENTRY   0x00000001
 

Definition at line 7383 of file userk.h.

#define HH_DRIVERUNLOAD   0x00000080
 

Definition at line 7390 of file userk.h.

Referenced by Win32KDriverUnload().

#define HH_DTQUITPOSTED   0x00080000
 

Definition at line 7402 of file userk.h.

Referenced by InitiateWin32kCleanup().

#define HH_GRECLEANUP   0x00000100
 

Definition at line 7391 of file userk.h.

Referenced by Win32KDriverUnload().

#define HH_INITIATEWIN32KCLEANUP   0x00000400
 

Definition at line 7393 of file userk.h.

Referenced by InitiateWin32kCleanup().

#define HH_INITVIDEO   0x00000004
 

Definition at line 7385 of file userk.h.

Referenced by InitVideo().

#define HH_KBDLYOUTFREEWINSTA   0x00010000
 

Definition at line 7399 of file userk.h.

Referenced by FreeWindowStation().

#define HH_KBDLYOUTGLOBALCLEANUP   0x00008000
 

Definition at line 7398 of file userk.h.

Referenced by Win32kNtUserCleanup().

#define HH_LOADCURSORS   0x00004000
 

Definition at line 7397 of file userk.h.

Referenced by _LoadCursorsAndIcons().

#define HH_REMOTECONNECT   0x00000008
 

Definition at line 7386 of file userk.h.

Referenced by RemoteConnect().

#define HH_REMOTEDISCONNECT   0x00000010
 

Definition at line 7387 of file userk.h.

Referenced by xxxRemoteDisconnect().

#define HH_REMOTELOGOFF   0x00000040
 

Definition at line 7389 of file userk.h.

Referenced by RemoteLogoff().

#define HH_REMOTERECONNECT   0x00000020
 

Definition at line 7388 of file userk.h.

Referenced by xxxRemoteReconnect().

#define HH_RITCREATED   0x00002000
 

Definition at line 7396 of file userk.h.

Referenced by RawInputThread().

#define HH_RITGONE   0x00001000
 

Definition at line 7395 of file userk.h.

Referenced by InitiateWin32kCleanup().

#define HH_USERINITIALIZE   0x00000002
 

Definition at line 7384 of file userk.h.

Referenced by UserInitialize().

#define HH_USERKCLEANUP   0x00000200
 

Definition at line 7392 of file userk.h.

Referenced by Win32KDriverUnload().

#define HMChangeOwnerProcess pobj,
pti   )     HMChangeOwnerPheProcess(HMPheFromObject(pobj), pti)
 

Definition at line 1191 of file userk.h.

Referenced by LockDesktopMenu(), ZombieCursor(), and zzzSetSystemImage().

#define HMLockObject  )     (((PHEAD)p)->cLockObj++)
 

Definition at line 1197 of file userk.h.

Referenced by AddConvProp(), HMAssignmentLock(), ThreadLockExchange(), and ThreadLockExchangeAlways().

#define HMONITOR_PRIMARY   ((HMONITOR)0x00010000)
 

Definition at line 7319 of file userk.h.

#define HMUnlockObject pobj   )     ( (--((PHEAD)pobj)->cLockObj == 0) ? HMUnlockObjectInternal(pobj) : pobj )
 

Definition at line 1186 of file userk.h.

Referenced by HMAssignmentLock(), HMAssignmentUnlock(), ThreadLockExchange(), ThreadLockExchangeAlways(), ThreadUnlock1(), UnlinkConv(), and xxxLoadKeyboardLayoutEx().

#define HTEXMENUFIRST   65
 

Definition at line 6704 of file userk.h.

Referenced by xxxSystemTimerProc().

#define HTEXMENULAST   69
 

Definition at line 6710 of file userk.h.

Referenced by xxxSystemTimerProc().

#define HTEXSCROLLFIRST   60
 

Definition at line 6697 of file userk.h.

Referenced by xxxSystemTimerProc().

#define HTEXSCROLLLAST   64
 

Definition at line 6703 of file userk.h.

Referenced by xxxSystemTimerProc().

#define HTMDICLOSE   68
 

Definition at line 6708 of file userk.h.

Referenced by FindNCHitEx(), IsTooltipHittest(), and xxxHotTrack().

#define HTMDIMAXBUTTON   66
 

Definition at line 6706 of file userk.h.

Referenced by FindNCHitEx(), IsTooltipHittest(), and xxxHotTrack().

#define HTMDIMINBUTTON   67
 

Definition at line 6707 of file userk.h.

Referenced by FindNCHitEx(), IsTooltipHittest(), and xxxHotTrack().

#define HTMDISYSMENU   65
 

Definition at line 6705 of file userk.h.

Referenced by FindNCHitEx().

#define HTMENUITEM   69
 

Definition at line 6709 of file userk.h.

Referenced by FindNCHitEx(), and xxxHotTrack().

#define HtoP  )     ((PVOID)HMObjectFromHandle(h))
 

Definition at line 1170 of file userk.h.

Referenced by NtUserDdeInitialize(), SLEditWndProc(), xxxGetMenuBarInfo(), xxxImmProcessKey(), and xxxUpdateSystemIconsFromRegistry().

#define HtoPCat  )     ((PVOID)HMCatObjectFromHandle(h))
 

Definition at line 1171 of file userk.h.

#define HtoPq  )     ((PVOID)HMObjectFromHandle(h))
 

Definition at line 1168 of file userk.h.

#define HtoPqCat  )     ((PVOID)HMCatObjectFromHandle(h))
 

Definition at line 1169 of file userk.h.

Referenced by HMFreeObject().

#define HTSCROLLDOWN   61
 

Definition at line 6699 of file userk.h.

Referenced by HitTestScrollBar(), and xxxHotTrack().

#define HTSCROLLDOWNPAGE   63
 

Definition at line 6701 of file userk.h.

Referenced by HitTestScrollBar(), and xxxHotTrack().

#define HTSCROLLTHUMB   64
 

Definition at line 6702 of file userk.h.

Referenced by HitTestScrollBar(), and xxxHotTrack().

#define HTSCROLLUP   60
 

Definition at line 6698 of file userk.h.

Referenced by HitTestScrollBar(), and xxxHotTrack().

#define HTSCROLLUPPAGE   62
 

Definition at line 6700 of file userk.h.

Referenced by HitTestScrollBar(), and xxxHotTrack().

#define HYDRA_HINT ev   )     (gdwHydraHint |= ev)
 

Definition at line 7404 of file userk.h.

Referenced by _LoadCursorsAndIcons(), CleanupResources(), FreeWindowStation(), InitiateWin32kCleanup(), InitVideo(), RawInputThread(), RemoteConnect(), RemoteLogoff(), UserInitialize(), Win32KDriverUnload(), Win32kNtUserCleanup(), xxxCreateDesktop(), xxxRemoteDisconnect(), and xxxRemoteReconnect().

#define IDC_CHILDRENONLY   0x0002
 

Definition at line 2233 of file userk.h.

Referenced by xxxScrollWindowEx(), zzzBltValidBits(), and zzzInvalidateDCCache().

#define IDC_CLIENTONLY   0x0004
 

Definition at line 2234 of file userk.h.

Referenced by xxxScrollWindowEx(), zzzBltValidBits(), and zzzInvalidateDCCache().

#define IDC_DEFAULT   0x0001
 

Definition at line 2232 of file userk.h.

Referenced by LockWindowUpdate2(), UnsetLayeredWindow(), xxxDWP_SetRedraw(), xxxMinimizeHungWindow(), xxxSetLayeredWindow(), xxxSetParent(), xxxSetWindowStyle(), and zzzInvalidateDCCache().

#define IDC_MOVEBLT   0x0008
 

Definition at line 2235 of file userk.h.

Referenced by zzzBltValidBits(), and zzzInvalidateDCCache().

#define IDC_NOMOUSE   0x0010
 

Definition at line 2236 of file userk.h.

Referenced by UnsetLayeredWindow(), xxxSetLayeredWindow(), and zzzInvalidateDCCache().

#define IDHOT_DEBUG   (-5)
 

Definition at line 3835 of file userk.h.

Referenced by SetDebugHotKeys(), and xxxDoHotKeyStuff().

#define IDHOT_DEBUGSERVER   (-6)
 

Definition at line 3836 of file userk.h.

Referenced by SetDebugHotKeys(), and xxxDoHotKeyStuff().

#define IDHOT_WINDOWS   (-7)
 

Definition at line 3837 of file userk.h.

Referenced by RawInputThread(), and xxxDoHotKeyStuff().

#define IEV_EXEC   2
 

Definition at line 3151 of file userk.h.

Referenced by xxxPollAndWaitForSingleObject().

#define IEV_IDLE   0
 

Definition at line 3149 of file userk.h.

Referenced by xxxPollAndWaitForSingleObject().

#define IEV_INPUT   1
 

Definition at line 3150 of file userk.h.

Referenced by xxxPollAndWaitForSingleObject().

#define IEV_TASK   3
 

Definition at line 3152 of file userk.h.

Referenced by xxxSleepTask().

#define IEV_WOWEXEC   4
 

Definition at line 3153 of file userk.h.

Referenced by xxxSleepTask().

#define IMESHOWSTATUS_NOTINITIALIZED   ((BOOL)0xffff)
 

Definition at line 7072 of file userk.h.

Referenced by xxxSetIMEShowStatus(), and xxxUpdatePerUserSystemParameters().

#define IndexUP uSetting   )     (1 << (((uSetting) - SPI_STARTBOOLRANGE) / 2))
 

Definition at line 5266 of file userk.h.

#define INIT_PSEUDO_EVENT ph   )     *ph = PSEUDO_EVENT_OFF;
 

Definition at line 3060 of file userk.h.

Referenced by xxxUserNotifyProcessCreate().

#define INITIAL_POSTMESSAGE_LIMIT   10000
 

Definition at line 6833 of file userk.h.

#define INITIAL_USER_HANDLE_QUOTA   10000
 

Definition at line 6830 of file userk.h.

Referenced by Win32UserInitialize().

 
#define InitPoolLimitations  ) 
 

Definition at line 2121 of file userk.h.

 
#define InitSectionTrace  ) 
 

Definition at line 2127 of file userk.h.

#define IntersectRgn hrgnResult,
hrgnA,
hrgnB   )     GreCombineRgn(hrgnResult, hrgnA, hrgnB, RGN_AND)
 

Definition at line 2219 of file userk.h.

Referenced by _GetDCEx(), CalcWindowRgn(), CalcWindowVisRgn(), CreateSpb(), GetNCUpdateRgn(), GetTrueClipRgn(), InternalInvalidate2(), InternalScrollDC(), RestoreSpb(), SetMonitorRegion(), SmartRectInRegion(), UserSetDCVisRgn(), ValidateParents(), xxxDrawDragRect(), xxxGetUpdateRgn(), xxxRedrawHungWindow(), and zzzBltValidBits().

#define IS_CURRENT_THREAD_RESTRICTED  ) 
 

Value:

((PtiCurrent()->TIF_flags & TIF_RESTRICTED) ? \ (PtiCurrent()->ppi->pW32Job->restrictions & (r)) : \ FALSE)

Definition at line 3289 of file userk.h.

Referenced by NtUserActivateKeyboardLayout(), NtUserChangeDisplaySettings(), NtUserCreateDesktop(), NtUserGetDC(), NtUserGetDCEx(), NtUserSetClipboardData(), NtUserSwitchDesktop(), and NtUserSystemParametersInfo().

#define IS_THREAD_RESTRICTED pti,
 ) 
 

Value:

((pti->TIF_flags & TIF_RESTRICTED) ? \ (pti->ppi->pW32Job->restrictions & (r)) : \ FALSE)

Definition at line 3284 of file userk.h.

Referenced by NtUserGetClipboardData(), NtUserSetSysColors(), UserGetDesktopDC(), UserGlobalAtomTableCallout(), and ValidateHwnd().

#define ISAMENU pwwnd   )     (GETFNID(pwnd) == FNID_MENU)
 

Definition at line 2800 of file userk.h.

Referenced by xxxMenuWindowProc().

 
#define ISATOMICCHECK  ) 
 

Definition at line 1847 of file userk.h.

Referenced by ChangeAcquireResourceType(), EnterCrit(), EnterSharedCrit(), LeaveCrit(), and zzzSetDesktop().

 
#define ISATOMICDEVICEINFOLISTCHECK  ) 
 

Definition at line 1848 of file userk.h.

 
#define ISCSRSS  )     (PsGetCurrentProcess() == gpepCSRSS)
 

Definition at line 95 of file userk.h.

Referenced by GetDeviceChangeInfo(), InitializeClientPfnArrays(), RemoteConnect(), RemoteLogoff(), RemoteNtSecurity(), RemotePassthruDisable(), RemoteRedrawRectangle(), RemoteShadowCleanup(), RemoteShadowStart(), RemoteThinwireStats(), SetInformationProcess(), VideoPortCalloutThread(), xxxConsoleControl(), xxxHardErrorControl(), xxxQueryInformationThread(), xxxRemoteDisconnect(), xxxRemotePassthruEnable(), xxxRemoteReconnect(), xxxRemoteShadowSetup(), xxxRemoteShadowStop(), xxxRemoteStopScreenUpdates(), xxxRestoreCsrssThreadDesktop(), xxxSetCsrssThreadDesktop(), xxxSetInformationThread(), xxxUserChangeDisplaySettings(), and xxxUserPowerEventCalloutWorker().

#define IsGlobalHooked pti,
fsHook   )     ((fsHook & pti->pDeskInfo->fsHooks) != 0)
 

Definition at line 3777 of file userk.h.

Referenced by xxxCapture(), xxxMoveEventAbsolute(), and zzzInvalidateDCCache().

#define IsHooked pti,
fsHook   )     ((fsHook & (pti->fsHooks | pti->pDeskInfo->fsHooks)) != 0)
 

Definition at line 3774 of file userk.h.

#define ISM_CALLBACK   0x0001
 

Definition at line 3755 of file userk.h.

Referenced by _ReplyMessage(), ReceiverDied(), xxxInterSendMsgEx(), xxxReceiveMessage(), and xxxSendMessageCallback().

#define ISM_CB_CLIENT   0x0100
 

Definition at line 3759 of file userk.h.

Referenced by _ReplyMessage(), ReceiverDied(), xxxInterSendMsgEx(), xxxReceiveMessage(), and xxxSendMessageCallback().

#define ISM_REPLY   0x0020
 

Definition at line 3758 of file userk.h.

Referenced by _ReplyMessage(), ReceiverDied(), xxxInterSendMsgEx(), and xxxReceiveMessage().

#define ISM_REQUEST   0x0010
 

Definition at line 3757 of file userk.h.

#define ISM_TIMEOUT   0x0002
 

Definition at line 3756 of file userk.h.

Referenced by xxxCallHook2(), and xxxSendMessageTimeout().

#define IsValidTag p,
tag   )     TRUE
 

Definition at line 2069 of file userk.h.

 
#define IsWinEventNotifyDeferred  )     (gdwDeferWinEvent > 0)
 

Definition at line 6471 of file userk.h.

Referenced by xxxEndScroll(), xxxNextWindow(), and zzzRecalcThreadAttachment().

 
#define IsWinEventNotifyDeferredOK  )     (!IsWinEventNotifyDeferred() || ISATOMICCHECK())
 

Definition at line 6472 of file userk.h.

Referenced by LeaveCrit(), LockWindowUpdate2(), ResetSharedDesktops(), xxxBeginPaint(), xxxCalcClientRect(), xxxCallJournalPlaybackHook(), xxxCancelCoolSwitch(), xxxCapture(), xxxCreateCaret(), xxxCreateDesktop(), xxxCreateThreadInfo(), xxxCreateWindowEx(), xxxCreateWindowStation(), xxxDesktopThread(), xxxDesktopWndProc(), xxxDestroyThreadInfo(), xxxDoHotKeyStuff(), xxxDragObject(), xxxDWP_SetCursor(), xxxDWP_SetRedraw(), xxxEnableSBCtlArrows(), xxxEnableWindow(), xxxEnableWndSBArrows(), xxxEndDeferWindowPosEx(), xxxFlushDeferredWindowEvents(), xxxGetInputEvent(), xxxHelpLoop(), xxxInternalGetMessage(), xxxMakeWindowForegroundWithState(), xxxMoveSize(), xxxMoveSwitchWndHilite(), xxxMS_TrackMove(), xxxMsgWaitForMultipleObjects(), xxxOldNextWindow(), xxxProcessEventMessage(), xxxSBTrackLoop(), xxxSBWndProc(), xxxScanSysQueue(), xxxScrollWindowEx(), xxxSetProcessInitState(), xxxSetScrollBar(), xxxSetWindowData(), xxxSetWindowStyle(), xxxShowSwitchWindow(), xxxSleepThread(), xxxSwitchDesktop(), xxxSwitchWndProc(), xxxSystemParametersInfo(), xxxTrackBox(), xxxTrackCaptionButton(), xxxTrackInitSize(), and xxxUpdatePerUserSystemParameters().

#define IsWndImeRelated pwnd   ) 
 

Value:

(pwnd->pcls->atomClassName == gpsi->atomSysClass[ICLS_IME] || \ TestCF(pwnd, CFIME))

Definition at line 7226 of file userk.h.

Referenced by NtUserSetImeOwnerWindow().

#define JP_DELTA   4
 

Definition at line 3438 of file userk.h.

Referenced by JobCalloutAddProcess().

#define KDELAY_MASK   0x0060
 

Definition at line 3886 of file userk.h.

Referenced by SetKeyboardRate(), and xxxSystemParametersInfo().

#define KDELAY_SHIFT   5
 

Definition at line 3887 of file userk.h.

Referenced by SetKeyboardRate(), and xxxSystemParametersInfo().

#define KERNEL_STACK_MINIMUM_RESERVE   (4*1024)
 

Definition at line 2385 of file userk.h.

Referenced by xxxSendMessageTimeout().

#define KEYBDHOLD   1
 

Definition at line 2970 of file userk.h.

Referenced by xxxHandleMenuMessages(), xxxMNKeyFilter(), xxxMNMouseMove(), and xxxMNOpenHierarchy().

#define KEYBOARD_MENU   ((LPARAM)-1)
 

Definition at line 3842 of file userk.h.

Referenced by xxxDefWindowProc(), and xxxScanSysQueue().

#define KILLRITTIMER pwnd,
nID   )     FindTimer(pwnd, nID, TMRF_RIT, TRUE)
 

Definition at line 4068 of file userk.h.

Referenced by AccessTimeOutReset(), FilterKeys(), FKActivationTimer(), MouseKeys(), ProcessMouseInput(), StopFilterKeysTimers(), ToggleKeys(), UserKillTimer(), and zzzUpdateCursorImage().

#define KL_RESET   0x40000000
 

Definition at line 2521 of file userk.h.

#define KL_UNLOADED   0x20000000
 

Definition at line 2520 of file userk.h.

Referenced by _GetKeyboardLayoutList(), FreeWindowStation(), HKLtoPKL(), xxxInternalUnloadKeyboardLayout(), and xxxLoadKeyboardLayoutEx().

#define KLT_ALT   1
 

Definition at line 2542 of file userk.h.

#define KLT_ALTBOTHSHIFTS   7
 

Definition at line 2567 of file userk.h.

Referenced by xxxScanSysQueue().

#define KLT_ALTLEFTSHIFT   3
 

Definition at line 2552 of file userk.h.

Referenced by xxxScanSysQueue().

#define KLT_ALTRIGHTSHIFT   5
 

Definition at line 2562 of file userk.h.

Referenced by xxxScanSysQueue().

#define KLT_LEFTSHIFT   2
 

Definition at line 2547 of file userk.h.

#define KLT_NONE   8
 

Definition at line 2572 of file userk.h.

Referenced by xxxNextWindow(), and xxxScanSysQueue().

#define KLT_RIGHTSHIFT   4
 

Definition at line 2557 of file userk.h.

#define KSPEED_MASK   0x001F
 

Definition at line 3885 of file userk.h.

Referenced by SetKeyboardRate(), and xxxSystemParametersInfo().

#define LANGTOGGLEKEYS_SIZE   3
 

Definition at line 6558 of file userk.h.

Referenced by xxxScanSysQueue().

#define LAST_ELEM  )     ( (a) [ N_ELEM(a) - 1 ] )
 

Definition at line 2357 of file userk.h.

#define LINP_INPUTTIMEOUTS   (LINP_SCREENSAVER | LINP_LOWPOWER | LINP_POWEROFF)
 

Definition at line 3272 of file userk.h.

Referenced by ProcessQueuedMouseEvents(), xxxProcessKeyEvent(), and xxxSystemParametersInfo().

#define LINP_KEYBOARD   0x00000001
 

Definition at line 3267 of file userk.h.

Referenced by ProcessQueuedMouseEvents(), xxxProcessKeyEvent(), xxxTrackPopupMenuEx(), and zzzActiveCursorTracking().

#define LINP_LOWPOWER   0x00000004
 

Definition at line 3269 of file userk.h.

Referenced by IdleTimerProc(), and xxxSysCommand().

#define LINP_POWEROFF   0x00000008
 

Definition at line 3270 of file userk.h.

Referenced by IdleTimerProc(), and xxxSysCommand().

#define LINP_POWERTIMEOUTS   (LINP_LOWPOWER | LINP_POWEROFF)
 

Definition at line 3271 of file userk.h.

Referenced by ProcessQueuedMouseEvents(), xxxProcessKeyEvent(), xxxSysCommand(), and xxxSystemParametersInfo().

#define LINP_SCREENSAVER   0x00000002
 

Definition at line 3268 of file userk.h.

#define Lock ppobj,
pobj   )     HMAssignmentLock((PVOID *)ppobj, (PVOID)pobj)
 

Definition at line 1181 of file userk.h.

#define LockDesktop ppdesk,
pdesk,
tag,
extra   ) 
 

Value:

{ \ if (pdesk != NULL) \ { \ UserAssert(OBJECT_TO_OBJECT_HEADER(pdesk)->Type == *ExDesktopObjectType); \ } \ LockObjectAssignment(ppdesk, pdesk); \ }

Definition at line 1640 of file userk.h.

Referenced by _DestroyMenu(), CleanupDirtyDesktops(), DestroyClass(), DestroyDesktop(), DestroyWindowStation(), HMAllocObject(), HMChangeOwnerThread(), InternalRegisterClassEx(), ReferenceClass(), RemoteDisableScreen(), RemoteRedrawScreen(), xxxCreateDesktop2(), xxxCreateThreadInfo(), xxxDesktopThread(), xxxDestroyThreadInfo(), xxxSetThreadDesktop(), xxxSwitchDesktop(), and zzzSetDesktop().

#define LockQCursor pq,
pcur   )     Lock(&pq->spcurCurrent, pcur)
 

Definition at line 5944 of file userk.h.

Referenced by AllocQueue(), CleanupResources(), zzzAttachToQueue(), zzzDestroyQueue(), and zzzSetCursor().

#define LOCKRECORD_MARKDESTROY   IntToPtr( 0xFFFFFFFF )
 

Definition at line 2372 of file userk.h.

Referenced by HMMarkObjectDestroy().

#define LOCKRECORD_STACK   8
 

Definition at line 2371 of file userk.h.

Referenced by Idf().

#define LockWinSta ppwinsta,
pwinsta   ) 
 

Value:

{ \ if (pwinsta != NULL) \ { \ UserAssert(OBJECT_TO_OBJECT_HEADER(pwinsta)->Type == *ExWindowStationObjectType); \ } \ LockObjectAssignment(ppwinsta, pwinsta); \ }

Definition at line 1631 of file userk.h.

Referenced by xxxCreateDesktop2(), xxxCreateWindowStation(), and xxxSetProcessWindowStation().

#define LogDesktop pdesk,
tag,
bLock,
extra   ) 
 

Definition at line 1539 of file userk.h.

Referenced by _GetUserObjectInformation(), _SetUserObjectInformation(), LockObjectAssignment(), NtUserBuildHwndList(), NtUserSetThreadDesktop(), NtUserSwitchDesktop(), UnlockObjectAssignment(), ValidateHdesk(), xxxCloseDesktop(), xxxConsoleControl(), xxxCreateDesktop(), xxxCreateDesktop2(), xxxCreateDisconnectDesktop(), xxxCreateWindowStation(), xxxGetThreadDesktop(), xxxOpenDesktop(), xxxResolveDesktop(), xxxRestoreCsrssThreadDesktop(), xxxSetCsrssThreadDesktop(), and zzzSetDesktop().

#define LOGTIME gt   )     gt = MonotonicTick();
 

Definition at line 1855 of file userk.h.

Referenced by ProcessMouseInput(), QueueMouseEvent(), StartDeviceRead(), and UnqueueMouseEvent().

#define LOWPOWER_PHASE   1
 

Definition at line 6630 of file userk.h.

Referenced by IdleTimerProc(), and xxxSysCommand().

#define LPK_DRAWTEXTEX   0x04
 

Definition at line 3525 of file userk.h.

Referenced by DT_InitDrawTextInfo().

#define LPK_EDITCONTROL   0x08
 

Definition at line 3526 of file userk.h.

#define LPK_INSTALLED   0x0f
 

Definition at line 3527 of file userk.h.

Referenced by xxxDrawItemUnderline().

#define LPK_PSMTEXTOUT   0x02
 

Definition at line 3524 of file userk.h.

#define LPK_TABBEDTEXTOUT   0x01
 

Definition at line 3523 of file userk.h.

#define MAX_MOUSEPOINTS   64
 

Definition at line 1758 of file userk.h.

Referenced by _GetMouseMovePointsEx(), NtUserGetMouseMovePointsEx(), and UpdateUserScreen().

#define MAX_STACK_CALLS   8
 

Definition at line 1788 of file userk.h.

#define MAXIMUM_ITEMS_READ   10
 

Definition at line 1863 of file userk.h.

#define MAXIMUM_READ_RETRIES   5
 

Definition at line 1869 of file userk.h.

Referenced by StartDeviceRead().

#define MAXPROFILEBUF   256
 

Definition at line 6881 of file userk.h.

#define MINIMUM_POSTMESSAGE_LIMIT   4000
 

Definition at line 6834 of file userk.h.

Referenced by Win32UserInitialize().

#define MINIMUM_USER_HANDLE_QUOTA   200
 

Definition at line 6831 of file userk.h.

Referenced by Win32UserInitialize().

#define MINMAX_ANIMATE   0x10000
 

Definition at line 4323 of file userk.h.

Referenced by xxxMinMaximize(), and xxxShowWindow().

#define MINMAX_KEEPHIDDEN   0x1
 

Definition at line 4322 of file userk.h.

Referenced by NtUserMinMaximize(), xxxCreateWindowEx(), xxxMinMaximize(), and xxxProcessHungThreadEvent().

#define MNGetpItemIndex   _MNGetpItemIndex
 

Definition at line 4892 of file userk.h.

Referenced by xxxInsertMenuItem(), and xxxRemoveDeleteMenuHelper().

#define MNIS_MEASUREBMP   -1
 

Definition at line 4793 of file userk.h.

Referenced by MenuRecalc(), xxxInsertMenuItem(), xxxMNGetBitmapSize(), xxxMNItemSize(), and xxxSetLPITEMInfo().

#define MNLEFTMARGIN   (SYSMET(CXEDGE))
 

Definition at line 4783 of file userk.h.

Referenced by xxxMNCompute(), xxxMNItemSize(), and xxxRealDrawMenuItem().

#define MNSW_DRAWFRAME   MNUS_DRAWFRAME
 

Definition at line 4802 of file userk.h.

Referenced by xxxMenuWindowProc().

#define MNSW_RETURNSIZE   0
 

Definition at line 4800 of file userk.h.

Referenced by xxxMenuWindowProc().

#define MNSW_SIZE   MNUS_DEFAULT
 

Definition at line 4801 of file userk.h.

Referenced by xxxMNOpenHierarchy(), and xxxTrackPopupMenuEx().

#define MNUS_DEFAULT   0x00000001
 

Definition at line 4788 of file userk.h.

Referenced by xxxEnableMenuItem(), xxxSetLPITEMInfo(), and xxxSetMenuInfo().

#define MNUS_DELETE   0x00000002
 

Definition at line 4789 of file userk.h.

Referenced by xxxMNUpdateShownMenu(), and xxxRemoveDeleteMenuHelper().

#define MNUS_DRAWFRAME   0x00000004
 

Definition at line 4790 of file userk.h.

Referenced by xxxMNUpdateShownMenu(), and xxxSetMenuInfo().

#define MNXBORDER   (SYSMET(CXBORDER) + SYSMET(CXEDGE))
 

Definition at line 4780 of file userk.h.

Referenced by MNEraseBackground(), and xxxMenuWindowProc().

#define MNXSPACE   (SYSMET(CXEDGE))
 

Definition at line 4782 of file userk.h.

Referenced by xxxDrawMenuBarUnderlines(), xxxMNCompute(), xxxMNItemSize(), and xxxRealDrawMenuItem().

#define MNYBORDER   (SYSMET(CYBORDER) + SYSMET(CYEDGE))
 

Definition at line 4781 of file userk.h.

Referenced by MNEraseBackground(), and xxxMenuWindowProc().

#define MODIFIER_FOR_ALT_NUMPAD wModBit   ) 
 

Value:

(((wModBits) == KBDALT) || ((wModBits) == (KBDALT | KBDSHIFT)) || \ ((wModBits) == (KBDKANA | KBDALT)) || ((wModBits) == (KBDKANA | KBDALT | KBDSHIFT)))

Definition at line 3996 of file userk.h.

#define MOUSE_SENSITIVITY_DEFAULT   10
 

Definition at line 3956 of file userk.h.

Referenced by GetMouseCoord(), and xxxUpdatePerUserSystemParameters().

#define MOUSE_SENSITIVITY_MAX   20
 

Definition at line 3957 of file userk.h.

Referenced by xxxSystemParametersInfo(), and xxxUpdatePerUserSystemParameters().

#define MOUSE_SENSITIVITY_MIN   1
 

Definition at line 3955 of file userk.h.

#define MOUSEHOLD   -1 /* Mouse button held down and dragging */
 

Definition at line 2969 of file userk.h.

Referenced by xxxHandleMenuMessages(), xxxMNLoop(), xxxMNMouseMove(), xxxSendMenuSelect(), and xxxTrackPopupMenuEx().

#define N_ELEM  )     (sizeof(a)/sizeof(a[0]))
 

Definition at line 2356 of file userk.h.

#define NCA_ACTIVE   0x00000001
 

Definition at line 5035 of file userk.h.

Referenced by xxxDefWindowProc(), xxxDWP_DoNCActivate(), xxxEndMenuLoop(), and xxxMenuWindowProc().

#define NCA_FORCEFRAMEOFF   0x00000002
 

Definition at line 5036 of file userk.h.

Referenced by xxxDWP_DoNCActivate(), xxxEndMenuLoop(), and xxxMenuWindowProc().

#define NEEDSSYNCPAINT pwnd   )     TestWF(pwnd, WFSENDERASEBKGND | WFSENDNCPAINT)
 

Definition at line 2402 of file userk.h.

Referenced by xxxFreeWindow().

#define NELEM_BUTTONQUEUE   16
 

Definition at line 1864 of file userk.h.

Referenced by QueueMouseEvent(), and UnqueueMouseEvent().

#define NEXTPOINT  )     ((i + 1) % MAX_MOUSEPOINTS)
 

Definition at line 1763 of file userk.h.

#define NEXTPOINTCOUNT c   ) 
 

Value:

{ \ if (c < MAX_MOUSEPOINTS) \ c++; \ }

Definition at line 1766 of file userk.h.

#define NO_CAP_CLIENT   0 /* no capture; in client area */
 

Definition at line 3847 of file userk.h.

Referenced by xxxCancelTrackingForThread(), xxxCapture(), xxxMouseActivate(), xxxReleaseCapture(), and xxxScanSysQueue().

#define NO_CAP_SYS   1 /* no capture; in sys area */
 

Definition at line 3848 of file userk.h.

Referenced by MNItemHitTest(), and xxxScanSysQueue().

#define NTW_IGNORETOOLWINDOW   2
 

Definition at line 4454 of file userk.h.

Referenced by IsTopmostRealApp(), NextTopWindow(), and xxxActivateWindow().

#define NTW_PREVIOUS   1
 

Definition at line 4453 of file userk.h.

Referenced by NextTopWindow(), xxxNextWindow(), and xxxOldNextWindow().

#define NUMPAD_HEXMODE_HL   (2)
 

Definition at line 3994 of file userk.h.

Referenced by NumPadScanCodeToHex(), xxxInternalToUnicode(), xxxScanSysQueue(), and xxxTranslateAccelerator().

#define NUMPAD_HEXMODE_LL   (1)
 

Definition at line 3993 of file userk.h.

Referenced by xxxDoHotKeyStuff(), and xxxKeyEvent().

#define OCR_APPSTARTING   32650
 

Definition at line 6424 of file userk.h.

#define OEMRESOURCE   1
 

Definition at line 35 of file userk.h.

#define PAS_DOWN   (TPM_VERPOSANIMATION >> TPM_FIRSTANIBITPOS)
 

Definition at line 4809 of file userk.h.

Referenced by FindBestPos(), xxxMNPositionHierarchy(), and xxxTrackPopupMenuEx().

#define PAS_HORZ   (PAS_LEFT | PAS_RIGHT)
 

Definition at line 4812 of file userk.h.

Referenced by FindBestPos(), MNAnimate(), xxxMenuWindowProc(), xxxMNPositionHierarchy(), and xxxTrackPopupMenuEx().

#define PAS_LEFT   (TPM_HORNEGANIMATION >> TPM_FIRSTANIBITPOS)
 

Definition at line 4808 of file userk.h.

Referenced by FindBestPos(), MNAnimate(), xxxMNOpenHierarchy(), xxxMNPositionHierarchy(), and xxxTrackPopupMenuEx().

#define PAS_OUT   0x10
 

Definition at line 4811 of file userk.h.

Referenced by xxxMenuWindowProc(), xxxMNOpenHierarchy(), and xxxTrackPopupMenuEx().

#define PAS_RIGHT   (TPM_HORPOSANIMATION >> TPM_FIRSTANIBITPOS)
 

Definition at line 4807 of file userk.h.

Referenced by FindBestPos(), xxxMNOpenHierarchy(), xxxMNPositionHierarchy(), and xxxTrackPopupMenuEx().

#define PAS_UP   (TPM_VERNEGANIMATION >> TPM_FIRSTANIBITPOS)
 

Definition at line 4810 of file userk.h.

Referenced by FindBestPos(), MNAnimate(), xxxMNPositionHierarchy(), and xxxTrackPopupMenuEx().

#define PAS_VERT   (PAS_UP | PAS_DOWN)
 

Definition at line 4813 of file userk.h.

Referenced by FindBestPos(), MNAnimate(), xxxMenuWindowProc(), and xxxTrackPopupMenuEx().

#define PEM_ACTIVATE_NOZORDER   0x0002
 

Definition at line 3018 of file userk.h.

Referenced by xxxProcessEventMessage(), and xxxSetForegroundWindow2().

#define PEM_ACTIVATE_RESTORE   0x0001
 

Definition at line 3017 of file userk.h.

Referenced by xxxProcessEventMessage(), and xxxSetForegroundWindow2().

#define PFNHOOK phk   ) 
 

Value:

(phk->ihmod == -1 ? (PROC)phk->offPfn : \ (PROC)(((ULONG_PTR)(PtiCurrent()->ppi->ahmodLibLoaded[phk->ihmod])) + \ ((ULONG_PTR)(phk->offPfn))))

Definition at line 3670 of file userk.h.

Referenced by xxxGetEventProc(), xxxHkCallHook(), and zzzUnhookWindowsHook().

#define PLAST_ELEM  )     (&LAST_ELEM(a))
 

Definition at line 2358 of file userk.h.

#define PMAP_AEDEBUG   22
 

Definition at line 6861 of file userk.h.

Referenced by SetDebugHotKeys().

#define PMAP_BEEP   12
 

Definition at line 6851 of file userk.h.

Referenced by LW_LoadResources(), and xxxSystemParametersInfo().

#define PMAP_COLORS   0
 

Definition at line 6839 of file userk.h.

Referenced by xxxODI_ColorInit().

#define PMAP_COMPAT   10
 

Definition at line 6849 of file userk.h.

#define PMAP_COMPAT2   37
 

Definition at line 6876 of file userk.h.

Referenced by SetAppCompatFlags().

#define PMAP_COMPAT32   34
 

Definition at line 6873 of file userk.h.

Referenced by SetAppCompatFlags().

#define PMAP_CURSORS   1
 

Definition at line 6840 of file userk.h.

Referenced by xxxUpdateSystemCursorsFromRegistry().

#define PMAP_DESKTOP   4
 

Definition at line 6843 of file userk.h.

Referenced by CheckDesktopPolicy(), CheckDesktopPolicyChange(), GetDeskWallpaperName(), OpenCacheKeyEx(), xxxSetDeskPattern(), xxxSetDeskWallpaper(), xxxSystemParametersInfo(), and xxxUpdatePerUserSystemParameters().

#define PMAP_FONTS   6
 

Definition at line 6845 of file userk.h.

Referenced by bEnumerateRegistryFonts().

#define PMAP_HIGHCONTRAST   30
 

Definition at line 6869 of file userk.h.

Referenced by xxxSystemParametersInfo(), and xxxUpdatePerUserAccessPackSettings().

#define PMAP_ICONS   5
 

Definition at line 6844 of file userk.h.

Referenced by xxxUpdateSystemIconsFromRegistry().

#define PMAP_IMECOMPAT   31
 

Definition at line 6870 of file userk.h.

Referenced by SetAppImeCompatFlags().

#define PMAP_IMM   32
 

Definition at line 6871 of file userk.h.

Referenced by IsIMMEnabledSystem().

#define PMAP_INPUT   9
 

Definition at line 6848 of file userk.h.

Referenced by OpenMultiplePortDevice().

#define PMAP_INPUTMETHOD   36
 

Definition at line 6875 of file userk.h.

Referenced by xxxSetIMEShowStatus(), and xxxUpdatePerUserSystemParameters().

#define PMAP_KBDCLASS_PARAMS   39
 

Definition at line 6878 of file userk.h.

#define PMAP_KBDLAYOUT   8
 

Definition at line 6847 of file userk.h.

Referenced by InitScancodeMap().

#define PMAP_KEYBOARD   14
 

Definition at line 6853 of file userk.h.

Referenced by RegisterPerUserKeyboardIndicators(), UpdatePerUserKeyboardIndicators(), xxxSystemParametersInfo(), and xxxUpdatePerUserSystemParameters().

#define PMAP_KEYBOARDPREF   28
 

Definition at line 6867 of file userk.h.

Referenced by xxxSystemParametersInfo(), and xxxUpdatePerUserAccessPackSettings().

#define PMAP_KEYBOARDRESPONSE   16
 

Definition at line 6855 of file userk.h.

Referenced by SetFilterKeys(), and xxxUpdatePerUserAccessPackSettings().

#define PMAP_LAST   39
 

Definition at line 6879 of file userk.h.

Referenced by FastGetProfileDwordW(), FastGetProfileIntFromID(), FastGetProfileIntW(), FastGetProfileKeysW(), FastGetProfileStringFromIDW(), FastGetProfileStringW(), FastGetProfileValue(), FastUpdateWinIni(), FastWriteProfileStringW(), FastWriteProfileValue(), OpenCacheKeyEx(), and RemoteOpenCacheKeyEx().

#define PMAP_METRICS   24
 

Definition at line 6863 of file userk.h.

Referenced by CreateFontFromWinIni(), MetricGetID(), SetWindowMetricFont(), SetWindowMetricInt(), and xxxUpdatePerUserSystemParameters().

#define PMAP_MOUCLASS_PARAMS   38
 

Definition at line 6877 of file userk.h.

#define PMAP_MOUSE   13
 

Definition at line 6852 of file userk.h.

Referenced by LW_LoadResources(), xxxSystemParametersInfo(), and xxxUpdatePerUserSystemParameters().

#define PMAP_MOUSEKEYS   17
 

Definition at line 6856 of file userk.h.

Referenced by SetMouseKeys(), and xxxUpdatePerUserAccessPackSettings().

#define PMAP_NETWORK   23
 

Definition at line 6862 of file userk.h.

Referenced by xxxUpdatePerUserSystemParameters().

#define PMAP_POOLLIMITS   33
 

Definition at line 6872 of file userk.h.

#define PMAP_SCREENREADER   29
 

Definition at line 6868 of file userk.h.

Referenced by xxxSystemParametersInfo(), and xxxUpdatePerUserAccessPackSettings().

#define PMAP_SETUPPROGRAMNAMES   35
 

Definition at line 6874 of file userk.h.

Referenced by CreateSetupNameArray().

#define PMAP_SHOWSOUNDS   21
 

Definition at line 6860 of file userk.h.

Referenced by xxxSystemParametersInfo(), and xxxUpdatePerUserAccessPackSettings().

#define PMAP_SOUNDSENTRY   20
 

Definition at line 6859 of file userk.h.

Referenced by SetSoundSentry(), and xxxUpdatePerUserAccessPackSettings().

#define PMAP_STICKYKEYS   15
 

Definition at line 6854 of file userk.h.

Referenced by xxxSystemParametersInfo(), and xxxUpdatePerUserAccessPackSettings().

#define PMAP_SUBSYSTEMS   11
 

Definition at line 6850 of file userk.h.

Referenced by InitCreateUserSubsystem().

#define PMAP_TIMEOUT   19
 

Definition at line 6858 of file userk.h.

Referenced by xxxSystemParametersInfo(), and xxxUpdatePerUserAccessPackSettings().

#define PMAP_TOGGLEKEYS   18
 

Definition at line 6857 of file userk.h.

Referenced by xxxSystemParametersInfo(), and xxxUpdatePerUserAccessPackSettings().

#define PMAP_TRUETYPE   7
 

Definition at line 6846 of file userk.h.

Referenced by xxxUpdatePerUserSystemParameters().

#define PMAP_UKBDLAYOUT   25
 

Definition at line 6864 of file userk.h.

Referenced by xxxUpdatePerUserSystemParameters().

#define PMAP_UKBDLAYOUTTOGGLE   26
 

Definition at line 6865 of file userk.h.

Referenced by GetKbdLangSwitch().

#define PMAP_WINDOWSM   2
 

Definition at line 6841 of file userk.h.

Referenced by LW_LoadProfileInitData(), and Win32UserInitialize().

#define PMAP_WINDOWSU   3
 

Definition at line 6842 of file userk.h.

Referenced by xxxSystemParametersInfo(), and xxxUpdatePerUserSystemParameters().

#define PMAP_WINLOGON   27
 

Definition at line 6866 of file userk.h.

Referenced by bEnumerateRegistryFonts().

#define POBJECT_NAME pobj   ) 
 

Value:

Definition at line 4569 of file userk.h.

Referenced by _GetUserObjectInformation(), ParseDesktop(), xxxHardErrorControl(), and xxxSwitchDesktop().

#define POLICY_ALL   (POLICY_NONE | POLICY_USER | POLICY_MACHINE)
 

Definition at line 6886 of file userk.h.

Referenced by OpenCacheKeyEx().

#define POLICY_MACHINE   0x0004
 

Definition at line 6885 of file userk.h.

Referenced by CheckDesktopPolicy(), CheckDesktopPolicyChange(), and OpenCacheKeyEx().

#define POLICY_NONE   0x0001
 

Definition at line 6883 of file userk.h.

Referenced by OpenCacheKeyEx().

#define POLICY_USER   0x0002
 

Definition at line 6884 of file userk.h.

Referenced by CheckDesktopPolicy(), CheckDesktopPolicyChange(), and OpenCacheKeyEx().

#define POLL_EVENT_CNT   5
 

Definition at line 3147 of file userk.h.

Referenced by xxxPollAndWaitForSingleObject(), and xxxSleepTask().

#define POOL_BREAK_FOR_LEAKS   0x00000080
 

Definition at line 2084 of file userk.h.

#define POOL_CAPTURE_STACK   0x00000002
 

Definition at line 2078 of file userk.h.

#define POOL_FAIL_ALLOCS   0x00000004
 

Definition at line 2079 of file userk.h.

#define POOL_FAIL_BY_INDEX   0x00000008
 

Definition at line 2080 of file userk.h.

#define POOL_HEAVY_ALLOCS   0x00000001
 

Definition at line 2077 of file userk.h.

#define POOL_KEEP_FAIL_RECORD   0x00000040
 

Definition at line 2083 of file userk.h.

#define POOL_KEEP_FREE_RECORD   0x00000020
 

Definition at line 2082 of file userk.h.

#define POOL_TAIL_CHECK   0x00000010
 

Definition at line 2081 of file userk.h.

#define POWEROFF_PHASE   2
 

Definition at line 6631 of file userk.h.

Referenced by IdleTimerProc(), and xxxSysCommand().

#define POWERON_PHASE   -1
 

Definition at line 6629 of file userk.h.

Referenced by xxxSysCommand().

 
#define PpiCurrent  )     ((PPROCESSINFO)(W32GetCurrentProcess()))
 

Definition at line 84 of file userk.h.

Referenced by _DestroyCursor(), _FindExistingCursorIcon(), _GetComboBoxInfo(), _GetDCEx(), _GetListBoxInfo(), _GetProcessWindowStation(), _LockSetForegroundWindow(), _MapDesktopObject(), _SetClassWord(), _SetDoubleClickTime(), _SetSystemTimer(), _SetTimer(), _SwapMouseButton(), _WOWCleanup(), _WOWModuleUnload(), CheckHandleFlag(), CheckWHFBits(), CheckWinstaWriteAttributesAccess(), CleanupResources(), DelayedDestroyCacheDC(), DestroyCacheDC(), DestroyClassBrush(), DT_InitDrawTextInfo(), FinalUserInit(), HMChangeOwnerThread(), IsHandleEntrySecure(), NtUserAlterWindowStyle(), NtUserGetAsyncKeyState(), NtUserGetCaretBlinkTime(), NtUserGetClipCursor(), NtUserGetDoubleClickTime(), NtUserInitTask(), NtUserModifyUserStartupInfoFlags(), NtUserSetAppImeLevel(), NtUserSetWindowFNID(), NtUserSystemParametersInfo(), OpenDesktopCompletion(), RegisterLPK(), SetAppCompatFlags(), SetAppImeCompatFlags(), SetDialogPointer(), SetHandleFlag(), TestWindowProcess(), UnlinkCursor(), UnloadCursorsAndIcons(), UserCommitDesktopMemory(), UserCommitSharedMemory(), xxxAllowSetForegroundWindow(), xxxClientLoadOLE(), xxxCloseDesktop(), xxxCreateDesktop(), xxxCreateThreadInfo(), xxxDestroyThreadInfo(), xxxDrawItemUnderline(), xxxFreeWindow(), xxxGetControlColor(), xxxGetThreadDesktop(), xxxHkCallHook(), xxxImmActivateThreadsLayout(), xxxInterSendMsgEx(), xxxRegisterUserHungAppHandlers(), xxxSetClassLongPtr(), xxxSetWindowData(), xxxSetWindowLongPtr(), xxxSetWindowStyle(), xxxSystemParametersInfo(), xxxUserNotifyConsoleApplication(), xxxWindowHitTest2(), and zzzShowStartGlass().

#define PpiFromProcess Process   )     ((PPROCESSINFO)((PW32PROCESS)(Process)->Win32Process))
 

Definition at line 89 of file userk.h.

Referenced by CheckAllowForeground(), FreeView(), GetThreadsWithPKL(), InitiateShutdown(), MapDesktop(), ProcessDeviceChanges(), ReferenceWindowStation(), SetGlobalCursorLevel(), SetInformationProcess(), xxxAllowSetForegroundWindow(), xxxCreateDesktop(), xxxGetThreadDesktop(), xxxResolveDesktop(), xxxSetProcessWindowStation(), and xxxUserNotifyConsoleApplication().

#define PREVPOINT  )     ((i == 0) ? (MAX_MOUSEPOINTS - 1) : ((i - 1) % MAX_MOUSEPOINTS))
 

Definition at line 1760 of file userk.h.

Referenced by _GetMouseMovePointsEx().

#define ProbeAndReadBlendfunction Address   ) 
 

Value:

(((Address) >= (BLENDFUNCTION * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile BLENDFUNCTION * const)MM_USER_PROBE_ADDRESS) : (*(volatile BLENDFUNCTION *)(Address)))

Definition at line 169 of file userk.h.

Referenced by NtUserUpdateLayeredWindow().

#define ProbeAndReadBroadcastSystemMsgParams Address   ) 
 

Value:

(((Address) >= (BROADCASTSYSTEMMSGPARAMS * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile BROADCASTSYSTEMMSGPARAMS * const)MM_USER_PROBE_ADDRESS) : (*(volatile BROADCASTSYSTEMMSGPARAMS *)(Address)))

Definition at line 575 of file userk.h.

Referenced by xxxWrapSendMessageBSM().

#define ProbeAndReadCandidateForm Address   ) 
 

Value:

(((Address) >= (CANDIDATEFORM * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile CANDIDATEFORM * const)MM_USER_PROBE_ADDRESS) : (*(volatile CANDIDATEFORM *)(Address)))

Definition at line 668 of file userk.h.

Referenced by MESSAGECALL().

#define ProbeAndReadCBTActivateStruct Address   ) 
 

Value:

(((Address) >= (CBTACTIVATESTRUCT * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile CBTACTIVATESTRUCT * const)MM_USER_PROBE_ADDRESS) : (*(volatile CBTACTIVATESTRUCT *)(Address)))

Definition at line 441 of file userk.h.

Referenced by NtUserfnHkINLPCBTACTIVATESTRUCT().

#define ProbeAndReadCBTCreateStruct Address   ) 
 

Value:

(((Address) >= (CBT_CREATEWND * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile CBT_CREATEWND * const)MM_USER_PROBE_ADDRESS) : (*(volatile CBT_CREATEWND *)(Address)))

Definition at line 510 of file userk.h.

Referenced by NtUserfnHkINLPCBTCREATESTRUCT().

#define ProbeAndReadCompareItemStruct Address   ) 
 

Value:

(((Address) >= (COMPAREITEMSTRUCT * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile COMPAREITEMSTRUCT * const)MM_USER_PROBE_ADDRESS) : (*(volatile COMPAREITEMSTRUCT *)(Address)))

Definition at line 363 of file userk.h.

Referenced by MESSAGECALL().

#define ProbeAndReadCompositionForm Address   ) 
 

Value:

(((Address) >= (COMPOSITIONFORM * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile COMPOSITIONFORM * const)MM_USER_PROBE_ADDRESS) : (*(volatile COMPOSITIONFORM *)(Address)))

Definition at line 681 of file userk.h.

Referenced by MESSAGECALL().

#define ProbeAndReadCopyDataStruct Address   ) 
 

Value:

(((Address) >= (COPYDATASTRUCT * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile COPYDATASTRUCT * const)MM_USER_PROBE_ADDRESS) : (*(volatile COPYDATASTRUCT *)(Address)))

Definition at line 350 of file userk.h.

Referenced by MESSAGECALL().

#define ProbeAndReadCreateStruct Address   ) 
 

Value:

(((Address) >= (CREATESTRUCTW * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile CREATESTRUCTW * const)MM_USER_PROBE_ADDRESS) : (*(volatile CREATESTRUCTW *)(Address)))

Definition at line 324 of file userk.h.

Referenced by MESSAGECALL().

#define ProbeAndReadCursorData Address   ) 
 

Value:

(((Address) >= (CURSORDATA * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile CURSORDATA * const)MM_USER_PROBE_ADDRESS) : (*(volatile CURSORDATA *)(Address)))

Definition at line 588 of file userk.h.

Referenced by NtUserSetCursorIconData().

#define ProbeAndReadCursorFind Address   ) 
 

Value:

(((Address) >= (CURSORFIND * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile CURSORFIND * const)MM_USER_PROBE_ADDRESS) : (*(volatile CURSORFIND *)(Address)))

Definition at line 549 of file userk.h.

Referenced by NtUserFindExistingCursorIcon().

#define ProbeAndReadDeleteItemStruct Address   ) 
 

Value:

(((Address) >= (DELETEITEMSTRUCT * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile DELETEITEMSTRUCT * const)MM_USER_PROBE_ADDRESS) : (*(volatile DELETEITEMSTRUCT *)(Address)))

Definition at line 376 of file userk.h.

Referenced by MESSAGECALL().

#define ProbeAndReadDrawItemStruct Address   ) 
 

Value:

(((Address) >= (DRAWITEMSTRUCT * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile DRAWITEMSTRUCT * const)MM_USER_PROBE_ADDRESS) : (*(volatile DRAWITEMSTRUCT *)(Address)))

Definition at line 415 of file userk.h.

Referenced by MESSAGECALL().

#define ProbeAndReadHelp Address   ) 
 

Value:

(((Address) >= (HLP * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile HLP * const)MM_USER_PROBE_ADDRESS) : (*(volatile HLP *)(Address)))

Definition at line 389 of file userk.h.

Referenced by MESSAGECALL().

#define ProbeAndReadHelpInfo Address   ) 
 

Value:

(((Address) >= (HELPINFO * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile HELPINFO * const)MM_USER_PROBE_ADDRESS) : (*(volatile HELPINFO *)(Address)))

Definition at line 402 of file userk.h.

Referenced by MESSAGECALL().

#define ProbeAndReadHookInfo Address   ) 
 

Value:

(((Address) >= (DEBUGHOOKINFO * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile DEBUGHOOKINFO * const)MM_USER_PROBE_ADDRESS) : (*(volatile DEBUGHOOKINFO *)(Address)))

Definition at line 428 of file userk.h.

Referenced by NtUserfnHkINLPDEBUGHOOKSTRUCT().

#define ProbeAndReadKbdHook Address   ) 
 

Value:

(((Address) >= (KBDLLHOOKSTRUCT * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile KBDLLHOOKSTRUCT * const)MM_USER_PROBE_ADDRESS) : (*(volatile KBDLLHOOKSTRUCT *)(Address)))

Definition at line 454 of file userk.h.

Referenced by NtUserfnHkINLPKBDLLHOOKSTRUCT().

#define ProbeAndReadLargeString Address   ) 
 

Value:

(((Address) >= (LARGE_STRING * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile LARGE_STRING * const)MM_USER_PROBE_ADDRESS) : (*(volatile LARGE_STRING *)(Address)))

Definition at line 233 of file userk.h.

Referenced by NtUserCreateWindowEx(), NtUserDefSetText(), and NtUserSendNotifyMessage().

#define ProbeAndReadLogFontW Address   ) 
 

Value:

(((Address) >= (LOGFONTW * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile LOGFONTW * const)MM_USER_PROBE_ADDRESS) : (*(volatile LOGFONTW *)(Address)))

Definition at line 694 of file userk.h.

Referenced by MESSAGECALL().

#define ProbeAndReadMDICreateStruct Address   ) 
 

Value:

(((Address) >= (MDICREATESTRUCT * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile MDICREATESTRUCT * const)MM_USER_PROBE_ADDRESS) : (*(volatile MDICREATESTRUCT *)(Address)))

Definition at line 337 of file userk.h.

Referenced by MESSAGECALL().

#define ProbeAndReadMenuGetObjectInfo Address   ) 
 

Value:

(((Address) >= (MENUGETOBJECTINFO * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile MENUGETOBJECTINFO * const)MM_USER_PROBE_ADDRESS) : (*(volatile MENUGETOBJECTINFO *)(Address)))

Definition at line 1069 of file userk.h.

Referenced by MESSAGECALL().

#define ProbeAndReadMenuInfo Address   ) 
 

Value:

(((Address) >= (MENUINFO * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile MENUINFO * const)MM_USER_PROBE_ADDRESS) : (*(volatile MENUINFO *)(Address)))

Definition at line 272 of file userk.h.

Referenced by NtUserThunkedMenuInfo().

#define ProbeAndReadMenuItem Address   ) 
 

Value:

(((Address) >= (MENUITEMINFO * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile MENUITEMINFO * const)MM_USER_PROBE_ADDRESS) : (*(volatile MENUITEMINFO *)(Address)))

Definition at line 259 of file userk.h.

Referenced by NtUserThunkedMenuItemInfo().

#define ProbeAndReadMessage Address   ) 
 

Value:

(((Address) >= (MSG * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile MSG * const)MM_USER_PROBE_ADDRESS) : (*(volatile MSG *)(Address)))

Definition at line 220 of file userk.h.

Referenced by NtUserDispatchMessage(), NtUserfnHkINLPMSG(), NtUserTranslateAccelerator(), and NtUserTranslateMessage().

#define ProbeAndReadMouseHook Address   ) 
 

Value:

(((Address) >= (MOUSEHOOKSTRUCTEX * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile MOUSEHOOKSTRUCTEX * const)MM_USER_PROBE_ADDRESS) : (*(volatile MOUSEHOOKSTRUCTEX *)(Address)))

Definition at line 479 of file userk.h.

Referenced by NtUserfnHkINLPMOUSEHOOKSTRUCTEX().

#define ProbeAndReadMsllHook Address   ) 
 

Value:

(((Address) >= (MSLLHOOKSTRUCT * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile MSLLHOOKSTRUCT * const)MM_USER_PROBE_ADDRESS) : (*(volatile MSLLHOOKSTRUCT *)(Address)))

Definition at line 466 of file userk.h.

Referenced by NtUserfnHkINLPMSLLHOOKSTRUCT().

#define ProbeAndReadPaintStruct Address   ) 
 

Value:

(((Address) >= (PAINTSTRUCT * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile PAINTSTRUCT * const)MM_USER_PROBE_ADDRESS) : (*(volatile PAINTSTRUCT *)(Address)))

Definition at line 311 of file userk.h.

Referenced by MESSAGECALL(), and NtUserEndPaint().

#define ProbeAndReadPoint Address   ) 
 

Value:

(((Address) >= (POINT * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile POINT * const)MM_USER_PROBE_ADDRESS) : (*(volatile POINT *)(Address)))

Definition at line 186 of file userk.h.

Referenced by NtUserMNDragOver(), NtUserSetInternalWindowPos(), and NtUserUpdateLayeredWindow().

#define ProbeAndReadPopupParams Address   ) 
 

Value:

(((Address) >= (TPMPARAMS * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile TPMPARAMS * const)MM_USER_PROBE_ADDRESS) : (*(volatile TPMPARAMS *)(Address)))

Definition at line 298 of file userk.h.

Referenced by NtUserTrackPopupMenuEx().

#define ProbeAndReadRect Address   ) 
 

Value:

(((Address) >= (RECT * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile RECT * const)MM_USER_PROBE_ADDRESS) : (*(volatile RECT *)(Address)))

Definition at line 203 of file userk.h.

Referenced by MESSAGECALL(), NtUserClipCursor(), NtUserDrawAnimatedRects(), NtUserDrawCaption(), NtUserDrawCaptionTemp(), NtUserDrawMenuBarTemp(), NtUserEnumDisplayMonitors(), NtUserfnHkINLPRECT(), NtUserInvalidateRect(), NtUserRedrawWindow(), NtUserScrollDC(), NtUserScrollWindowEx(), NtUserSetInternalWindowPos(), and NtUserValidateRect().

#define ProbeAndReadScrollInfo Address   ) 
 

Value:

(((Address) >= (SCROLLINFO * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile SCROLLINFO * const)MM_USER_PROBE_ADDRESS) : (*(volatile SCROLLINFO *)(Address)))

Definition at line 285 of file userk.h.

Referenced by NtUserSetScrollInfo().

#define ProbeAndReadSetClipBData Address   ) 
 

Value:

(((Address) >= (SETCLIPBDATA * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile SETCLIPBDATA * const)MM_USER_PROBE_ADDRESS) : (*(volatile SETCLIPBDATA *)(Address)))

Definition at line 562 of file userk.h.

Referenced by NtUserSetClipboardData().

#define ProbeAndReadSize Address   ) 
 

Value:

(((Address) >= (SIZE * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile SIZE * const)MM_USER_PROBE_ADDRESS) : (*(volatile SIZE *)(Address)))

Definition at line 165 of file userk.h.

Referenced by NtUserUpdateLayeredWindow().

#define ProbeAndReadTrackMouseEvent Address   ) 
 

Value:

(((Address) >= (TRACKMOUSEEVENT * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile TRACKMOUSEEVENT * const)MM_USER_PROBE_ADDRESS) : (*(volatile TRACKMOUSEEVENT *)(Address)))

Definition at line 523 of file userk.h.

Referenced by NtUserTrackMouseEvent().

#define ProbeAndReadWindowPlacement Address   ) 
 

Value:

(((Address) >= (WINDOWPLACEMENT * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile WINDOWPLACEMENT * const)MM_USER_PROBE_ADDRESS) : (*(volatile WINDOWPLACEMENT *)(Address)))

Definition at line 246 of file userk.h.

Referenced by NtUserSetWindowPlacement().

#define ProbeAndReadWindowPos Address   ) 
 

Value:

(((Address) >= (WINDOWPOS * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile WINDOWPOS * const)MM_USER_PROBE_ADDRESS) : (*(volatile WINDOWPOS *)(Address)))

Definition at line 536 of file userk.h.

Referenced by MESSAGECALL().

#define ProbeForReadBuffer Address,
Count,
Alignment   ) 
 

Value:

{ \ if ((ULONG)(Count) > (ULONG)(MAXULONG / sizeof(*(Address)))) { \ ExRaiseAccessViolation(); \ } \ ProbeForRead(Address, (ULONG)(Count) * sizeof(*(Address)), Alignment); \ }

Definition at line 151 of file userk.h.

Referenced by MESSAGECALL(), NtUserCreateAcceleratorTable(), NtUserGetPriorityClipboardFormat(), NtUserSendInput(), NtUserSetSysColors(), and ProbeAndCaptureSoftKbdData().

#define ProbeForReadReconvertString pReconv   )     ProbeForRead((pReconv), (pReconv)->dwSize, 1)
 

Definition at line 1039 of file userk.h.

#define ProbeForReadUnicodeStringBuffer String   ) 
 

Value:

if (((ULONG_PTR)((String).Buffer) & (sizeof(WCHAR) - 1)) != 0) { \ ExRaiseDatatypeMisalignment(); \ } else if ((((ULONG_PTR)((String).Buffer) + ((String).Length) + sizeof(UNICODE_NULL)) < (ULONG_PTR)((String).Buffer)) || \ (((ULONG_PTR)((String).Buffer) + ((String).Length) + sizeof(UNICODE_NULL)) > (ULONG_PTR)MM_USER_PROBE_ADDRESS)) { \ ExRaiseAccessViolation(); \ } else if (((String).Length) > ((String).MaximumLength)) { \ ExRaiseAccessViolation(); \ }

Definition at line 612 of file userk.h.

Referenced by GetHmodTableIndex(), NtUserCreateWindowStation(), NtUserFindExistingCursorIcon(), NtUserFindWindowEx(), NtUserGetWOWClass(), NtUserInitTask(), NtUserRegisterWindowMessage(), NtUserResolveDesktop(), NtUserSendNotifyMessage(), NtUserSetCursorIconData(), NtUserSystemParametersInfo(), NtUserThunkedMenuItemInfo(), and SetAppCompatFlags().

#define ProbeForReadUnicodeStringBufferOrId String   ) 
 

Value:

if (IS_PTR((String).Buffer)) { \ ProbeForReadUnicodeStringBuffer(String); \ }

Definition at line 654 of file userk.h.

Referenced by NtUserFindExistingCursorIcon(), NtUserFindWindowEx(), NtUserGetClassInfo(), NtUserRegisterClassExWOW(), NtUserSetClassLongPtr(), NtUserSetCursorIconData(), and NtUserUnregisterClass().

#define ProbeForReadUnicodeStringFullBuffer String   ) 
 

Value:

if (((ULONG_PTR)((String).Buffer) & (sizeof(WCHAR) - 1)) != 0) { \ ExRaiseDatatypeMisalignment(); \ } else if ((((ULONG_PTR)((String).Buffer) + ((String).MaximumLength)) < (ULONG_PTR)((String).Buffer)) || \ (((ULONG_PTR)((String).Buffer) + ((String).MaximumLength)) > (ULONG_PTR)MM_USER_PROBE_ADDRESS)) { \ ExRaiseAccessViolation(); \ } else if (((String).Length) > ((String).MaximumLength)) { \ ExRaiseAccessViolation(); \ }

Definition at line 634 of file userk.h.

Referenced by NtUserResolveDesktopForWOW().

#define ProbeForWriteBuffer Address,
Count,
Alignment   ) 
 

Value:

{ \ if ((ULONG)(Count) > (ULONG)(MAXULONG / sizeof(*(Address)))) { \ ExRaiseAccessViolation(); \ } \ ProbeForWrite(Address, (ULONG)(Count) * sizeof(*(Address)), Alignment); \ }

Definition at line 158 of file userk.h.

Referenced by MESSAGECALL(), NtUserBuildHimcList(), NtUserBuildHwndList(), NtUserBuildPropList(), NtUserCopyAcceleratorTable(), NtUserGetAltTabInfo(), NtUserGetClipboardFormatName(), NtUserGetKeyboardLayoutList(), NtUserGetKeyNameText(), NtUserGetMouseMovePointsEx(), NtUserInternalGetWindowText(), NtUserSystemParametersInfo(), and NtUserToUnicodeEx().

#define ProbeForWriteCandidateForm Address   ) 
 

Value:

{ \ if ((Address) >= (CANDIDATEFORM * const)MM_USER_PROBE_ADDRESS) { \ *(volatile ULONG * const)MM_USER_PROBE_ADDRESS = 0; \ } \ \ *(volatile CANDIDATEFORM *)(Address) = *(volatile CANDIDATEFORM *)(Address); \ }

Definition at line 981 of file userk.h.

Referenced by MESSAGECALL().

#define ProbeForWriteCompositionForm Address   ) 
 

Value:

{ \ if ((Address) >= (COMPOSITIONFORM * const)MM_USER_PROBE_ADDRESS) { \ *(volatile ULONG * const)MM_USER_PROBE_ADDRESS = 0; \ } \ \ *(volatile COMPOSITIONFORM *)(Address) = *(volatile COMPOSITIONFORM *)(Address);\ }

Definition at line 998 of file userk.h.

Referenced by MESSAGECALL().

#define ProbeForWriteCreateStruct Address   ) 
 

Value:

{ \ if ((Address) >= (CREATESTRUCTW * const)MM_USER_PROBE_ADDRESS) { \ *(volatile ULONG * const)MM_USER_PROBE_ADDRESS = 0; \ } \ \ *(volatile CREATESTRUCTW *)(Address) = *(volatile CREATESTRUCTW *)(Address);\ }

Definition at line 844 of file userk.h.

Referenced by NtUserfnHkINLPCBTCREATESTRUCT().

#define ProbeForWriteDropStruct Address   ) 
 

Value:

{ \ if ((Address) >= (DROPSTRUCT * const)MM_USER_PROBE_ADDRESS) { \ *(volatile ULONG * const)MM_USER_PROBE_ADDRESS = 0; \ } \ \ *(volatile DROPSTRUCT *)(Address) = *(volatile DROPSTRUCT *)(Address); \ }

Definition at line 776 of file userk.h.

Referenced by MESSAGECALL().

#define ProbeForWriteEvent Address   ) 
 

Value:

{ \ if ((Address) >= (EVENTMSG * const)MM_USER_PROBE_ADDRESS) { \ *(volatile ULONG * const)MM_USER_PROBE_ADDRESS = 0; \ } \ \ *(volatile EVENTMSG *)(Address) = *(volatile EVENTMSG *)(Address); \ }

Definition at line 861 of file userk.h.

Referenced by NtUserfnHkOPTINLPEVENTMSG().

#define ProbeForWriteGetClipData Address   ) 
 

Value:

{ \ if ((Address) >= (GETCLIPBDATA * const)MM_USER_PROBE_ADDRESS) { \ *(volatile ULONG * const)MM_USER_PROBE_ADDRESS = 0; \ } \ \ *(volatile GETCLIPBDATA *)(Address) = *(volatile GETCLIPBDATA *)(Address);\ }

Definition at line 895 of file userk.h.

#define ProbeForWriteImeCharPosition Address   ) 
 

Value:

{ \ if ((Address) >= (PrivateIMECHARPOSITION* const)MM_USER_PROBE_ADDRESS) { \ *(volatile ULONG* const)MM_USER_PROBE_ADDRESS = 0; \ } \ \ *(volatile PrivateIMECHARPOSITION*)(Address) = *(volatile PrivateIMECHARPOSITION*)(Address); \ }

Definition at line 1050 of file userk.h.

#define ProbeForWriteLogFontW Address   ) 
 

Value:

{ \ if ((Address) >= (LOGFONTW * const)MM_USER_PROBE_ADDRESS) { \ *(volatile ULONG * const)MM_USER_PROBE_ADDRESS = 0; \ } \ \ *(volatile LOGFONTW *)(Address) = *(volatile LOGFONTW *)(Address); \ }

Definition at line 1015 of file userk.h.

Referenced by MESSAGECALL().

#define ProbeForWriteMDINextMenu Address   ) 
 

Value:

{ \ if ((Address) >= (MDINEXTMENU * const)MM_USER_PROBE_ADDRESS) { \ *(volatile ULONG * const)MM_USER_PROBE_ADDRESS = 0; \ } \ \ *(volatile MDINEXTMENU *)(Address) = *(volatile MDINEXTMENU *)(Address); \ }

Definition at line 912 of file userk.h.

Referenced by MESSAGECALL().

#define ProbeForWriteMeasureItemStruct Address   ) 
 

Value:

{ \ if ((Address) >= (MEASUREITEMSTRUCT * const)MM_USER_PROBE_ADDRESS) { \ *(volatile ULONG * const)MM_USER_PROBE_ADDRESS = 0; \ } \ \ *(volatile MEASUREITEMSTRUCT *)(Address) = *(volatile MEASUREITEMSTRUCT *)(Address);\ }

Definition at line 827 of file userk.h.

Referenced by MESSAGECALL().

#define ProbeForWriteMessage Address   ) 
 

Value:

{ \ if ((Address) >= (MSG * const)MM_USER_PROBE_ADDRESS) { \ *(volatile ULONG * const)MM_USER_PROBE_ADDRESS = 0; \ } \ \ *(volatile MSG *)(Address) = *(volatile MSG *)(Address); \ }

Definition at line 742 of file userk.h.

Referenced by NtUserCallMsgFilter(), and NtUserQuerySendMessage().

#define ProbeForWriteNCCalcSize Address   ) 
 

Value:

{ \ if ((Address) >= (NCCALCSIZE_PARAMS * const)MM_USER_PROBE_ADDRESS) { \ *(volatile ULONG * const)MM_USER_PROBE_ADDRESS = 0; \ } \ \ *(volatile NCCALCSIZE_PARAMS *)(Address) = *(volatile NCCALCSIZE_PARAMS *)(Address);\ }

Definition at line 946 of file userk.h.

Referenced by MESSAGECALL().

#define ProbeForWritePaintStruct Address   ) 
 

Value:

{ \ if ((Address) >= (PAINTSTRUCT * const)MM_USER_PROBE_ADDRESS) { \ *(volatile ULONG * const)MM_USER_PROBE_ADDRESS = 0; \ } \ \ *(volatile PAINTSTRUCT *)(Address) = *(volatile PAINTSTRUCT *)(Address); \ }

Definition at line 759 of file userk.h.

#define ProbeForWritePoint Address   ) 
 

Value:

{ \ if ((Address) >= (POINT * const)MM_USER_PROBE_ADDRESS) { \ *(volatile ULONG * const)MM_USER_PROBE_ADDRESS = 0; \ } \ \ *(volatile POINT *)(Address) = *(volatile POINT *)(Address); \ }

Definition at line 708 of file userk.h.

Referenced by NtUserGetCaretPos(), and NtUserGetInternalWindowPos().

#define ProbeForWritePoint5 Address   ) 
 

Value:

{ \ if ((Address) >= (POINT5 * const)MM_USER_PROBE_ADDRESS) { \ *(volatile ULONG * const)MM_USER_PROBE_ADDRESS = 0; \ } \ \ *(volatile POINT5 *)(Address) = *(volatile POINT5 *)(Address);\ }

Definition at line 929 of file userk.h.

Referenced by MESSAGECALL().

#define ProbeForWriteReconvertString Address   ) 
 

Value:

{ \ if ((Address) >= (RECONVERTSTRING* const)MM_USER_PROBE_ADDRESS) { \ *(volatile ULONG* const)MM_USER_PROBE_ADDRESS = 0; \ } \ \ *(volatile RECONVERTSTRING*)(Address) = *(volatile RECONVERTSTRING*)(Address); \ *((volatile BYTE*)(Address) + (Address)->dwSize) = *((volatile BYTE*)(Address) + (Address)->dwSize); \ }

Definition at line 1030 of file userk.h.

#define ProbeForWriteRect Address   ) 
 

Value:

{ \ if ((Address) >= (RECT * const)MM_USER_PROBE_ADDRESS) { \ *(volatile ULONG * const)MM_USER_PROBE_ADDRESS = 0; \ } \ \ *(volatile RECT *)(Address) = *(volatile RECT *)(Address); \ }

Definition at line 725 of file userk.h.

Referenced by MESSAGECALL(), NtUserGetClipCursor(), and NtUserGetInternalWindowPos().

#define ProbeForWriteScrollInfo Address   ) 
 

Value:

{ \ if ((Address) >= (SCROLLINFO * const)MM_USER_PROBE_ADDRESS) { \ *(volatile ULONG * const)MM_USER_PROBE_ADDRESS = 0; \ } \ \ *(volatile SCROLLINFO *)(Address) = *(volatile SCROLLINFO *)(Address); \ }

Definition at line 793 of file userk.h.

Referenced by MESSAGECALL(), and NtUserSBGetParms().

#define ProbeForWriteStyleStruct Address   ) 
 

Value:

{ \ if ((Address) >= (STYLESTRUCT * const)MM_USER_PROBE_ADDRESS) { \ *(volatile ULONG * const)MM_USER_PROBE_ADDRESS = 0; \ } \ \ *(volatile STYLESTRUCT *)(Address) = *(volatile STYLESTRUCT *)(Address); \ }

Definition at line 810 of file userk.h.

Referenced by MESSAGECALL().

#define ProbeForWriteWindowPlacement Address   ) 
 

Value:

{ \ if ((Address) >= (WINDOWPLACEMENT * const)MM_USER_PROBE_ADDRESS) { \ *(volatile ULONG * const)MM_USER_PROBE_ADDRESS = 0; \ } \ \ *(volatile WINDOWPLACEMENT *)(Address) = *(volatile WINDOWPLACEMENT *)(Address);\ }

Definition at line 878 of file userk.h.

Referenced by NtUserGetWindowPlacement().

#define ProbeForWriteWindowPos Address   ) 
 

Value:

{ \ if ((Address) >= (WINDOWPOS * const)MM_USER_PROBE_ADDRESS) { \ *(volatile ULONG * const)MM_USER_PROBE_ADDRESS = 0; \ } \ \ *(volatile WINDOWPOS *)(Address) = *(volatile WINDOWPOS *)(Address);\ }

Definition at line 963 of file userk.h.

Referenced by MESSAGECALL().

#define ProbeMessage Address   ) 
 

Value:

(((Address) >= (MSG * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile DWORD * const)MM_USER_PROBE_ADDRESS) : (*(volatile DWORD *)(Address)))

Definition at line 216 of file userk.h.

#define ProbePoint Address   ) 
 

Value:

(((Address) >= (POINT * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile DWORD * const)MM_USER_PROBE_ADDRESS) : (*(volatile DWORD *)(Address)))

Definition at line 182 of file userk.h.

#define ProbeRect Address   ) 
 

Value:

(((Address) >= (RECT * const)MM_USER_PROBE_ADDRESS) ? \ (*(volatile DWORD * const)MM_USER_PROBE_ADDRESS) : (*(volatile DWORD *)(Address)))

Definition at line 199 of file userk.h.

#define PROP_CHECKPOINT   MAKEINTATOM(atomCheckpointProp)
 

Definition at line 3892 of file userk.h.

Referenced by CkptRestore(), ParkIcon(), xxxArrangeIconicWindows(), xxxCalcValidRects(), xxxDesktopRecalc(), xxxInitSendValidateMinMaxInfo(), and xxxMetricsRecalc().

#define PROP_DDEIMP   MAKEINTATOM(atomDDEImp)
 

Definition at line 3895 of file userk.h.

Referenced by AddConvProp(), MESSAGECALL(), and xxxFreeWindow().

#define PROP_DDETRACK   MAKEINTATOM(atomDDETrack)
 

Definition at line 3893 of file userk.h.

Referenced by AddConvProp(), FindDdeConv(), UnlinkConv(), xxxCleanupDdeConv(), and xxxFreeWindow().

#define PROP_IMELEVEL   MAKEINTATOM(atomImeLevel)
 

Definition at line 3897 of file userk.h.

Referenced by NtUserGetAppImeLevel(), and NtUserSetAppImeLevel().

#define PROP_LAYER   MAKEINTATOM(atomLayer)
 

Definition at line 3898 of file userk.h.

Referenced by _GetDCEx(), _SetLayeredWindowAttributes(), _UpdateLayeredWindow(), CreateRedirectionBitmap(), RecreateRedirectionBitmap(), RemoveRedirectionBitmap(), UpdateLayeredSprite(), and zzzBltValidBits().

#define PROP_QOS   MAKEINTATOM(atomQOS)
 

Definition at line 3894 of file userk.h.

Referenced by _DdeGetQualityOfService(), _DdeSetQualityOfService(), and MESSAGECALL().

#define PROP_WNDOBJ   MAKEINTATOM(atomWndObj)
 

Definition at line 3896 of file userk.h.

Referenced by InvalidateGDIWindows(), UserAssociateHwnd(), UserGetHwnd(), and xxxFreeWindow().

#define PropagetUPBOOLTogpsi uSetting   ) 
 

Value:

UserAssert((DWORD)(PUSIF_ ## uSetting) == (DWORD)UPBOOLMask(SPI_GET ## uSetting)); \ COPY_FLAG(gpsi->PUSIFlags, TestUP(## uSetting), PUSIF_ ## uSetting)

Definition at line 5286 of file userk.h.

Referenced by LoadCPUserPreferences(), and xxxSystemParametersInfo().

#define PSEUDO_EVENT_OFF   ((HANDLE)IntToPtr( 0x00000000 ))
 

Definition at line 3059 of file userk.h.

Referenced by WaitOnPseudoEvent().

#define PSEUDO_EVENT_ON   ((HANDLE)IntToPtr( 0xFFFFFFFF ))
 

Definition at line 3058 of file userk.h.

Referenced by WaitOnPseudoEvent().

 
#define PtiCurrent  )     (gptiCurrent)
 

Definition at line 58 of file userk.h.

Referenced by _BeginDeferWindowPos(), _BlockInput(), _CallMsgFilter(), _CreateAcceleratorTable(), _CreateEmptyCursorObject(), _CsDdeUninitialize(), _DestroyMenu(), _EnumClipboardFormats(), _GetClassInfoEx(), _GetDC(), _GetDCEx(), _GetDesktopWindow(), _GetKeyboardLayout(), _GetMessagePos(), _GetMessageWindow(), _GetNextQueueWindow(), _PostMessage(), _PostQuitMessage(), _RegisterHotKey(), _ReplyMessage(), _ResetDblClk(), _SetCaretBlinkTime(), _SetKeyboardState(), _SetMessageExtraInfo(), _SetProgmanWindow(), _SetTaskmanWindow(), _SetUserObjectInformation(), _SetWinEventHook(), _UnhookWinEvent(), _UnregisterClass(), _UnregisterHotKey(), _WOWModuleUnload(), AnimateWindow(), AssociateInputContextEx(), AsyncWindowPos(), bEnumerateRegistryFonts(), BMPtoDIB(), BuildHimcList(), BuildHwndList(), CancelInputState(), CaretBlinkProc(), CleanupGDI(), ClearQueueServerEvent(), ClearWakeMask(), ClearWindowState(), CreateCacheDC(), CreateProfileUserName(), Createpxs(), DestroyClass(), DestroyInputContext(), DestroyNotify(), DestroyThreadsHotKeys(), DestroyThreadsObjects(), DisownClipboard(), DispatchMessageWorker(), DoPaint(), DoTimer(), DrawSwitchWndHilite(), ECGetControlBrush(), ExitWindowsWorker(), FAllowForegroundActivate(), FCallerOk(), FindImeHotKeyByKey(), FreeDDEHandle(), FreeProfileUserName(), FreeThreadsWindowHooks(), GetCPD(), GetCursorHeight(), GetLastTopMostWindow(), GetTopMostInsertAfter(), GetWindowThreadProcessId(), ImmRequestMessageAorW(), ImmSetActiveContext(), InitiateWin32kCleanup(), InitSwitchWndInfo(), InternalCreateMenu(), InternalInvalidate3(), InternalRegisterClassEx(), InternalSetClipboardData(), IsTopmostRealApp(), LockDesktopMenu(), LockWindowUpdate2(), MNFreePopup(), MNItemHitTest(), MungeClipData(), NtUserBuildHimcList(), NtUserBuildHwndList(), NtUserCallNextHookEx(), NtUserCreateWindowEx(), NtUserDdeGetQualityOfService(), NtUserDdeInitialize(), NtUserDdeSetQualityOfService(), NtUserDisableThreadIme(), NtUserDrawCaptionTemp(), NtUserEndMenu(), NtUserFlashWindowEx(), NtUserGetClipboardData(), NtUserGetDC(), NtUserGetDCEx(), NtUserImpersonateDdeClientWindow(), NtUserPaintDesktop(), NtUserPostThreadMessage(), NtUserResolveDesktop(), NtUserResolveDesktopForWOW(), NtUserSendInput(), NtUserSetSysColors(), NtUserSetThreadDesktop(), NtUserSetThreadLayoutHandles(), NtUserSetThreadState(), NtUserSwitchDesktop(), NtUserSystemParametersInfo(), NtUserToUnicodeEx(), NtUserTrackPopupMenuEx(), NtUserTranslateAccelerator(), NtUserYieldTask(), PhkNextValid(), PlayEventSound(), PostShellHookMessages(), PrepareForLogoff(), PseudoDestroyClassWindows(), QueryTrackMouseEvent(), QueuePowerRequest(), ResetSharedDesktops(), SendIMEMessageAll(), SendMessageWorker(), SetJournalTimer(), SetWindowState(), TestInputContextProcess(), TestWindowProcess(), ThreadUnlock1(), TrackFullscreenMode(), TrackMouseEvent(), TranslateInjectedVKey(), UpdateInputContext(), UpdateKeyLights(), UpdatePerUserKeyboardIndicators(), UserGetCurrentDesktopId(), UserGetDesktopDC(), UserRedrawDesktop(), UserThreadCallout(), UT_CaretSet(), UT_InvertCaret(), ValidateHdesk(), WantImeWindow(), xxxActivateKeyboardLayout(), xxxActivateOnMinimize(), xxxActivateThisWindow(), xxxActivateWindow(), xxxBeginPaint(), xxxButtonEvent(), xxxCallHook(), xxxCallHook2(), xxxCallJournalPlaybackHook(), xxxCallJournalRecordHook(), xxxCallMouseHook(), xxxCallNextHookEx(), xxxCancelCoolSwitch(), xxxCancelMouseMoveTracking(), xxxCancelTracking(), xxxChangeClipboardChain(), xxxCheckFocus(), xxxCheckImeShowStatus(), xxxClientShutdown2(), xxxCloseClipboard(), xxxCloseDesktop(), xxxConnectService(), xxxConsoleControl(), xxxCreateCaret(), xxxCreateDesktop(), xxxCreateWindowEx(), xxxCreateWindowStation(), xxxCsDdeInitialize(), xxxCsEvent(), xxxDDETrackPostHook(), xxxDDETrackSendHook(), xxxDeactivate(), xxxDefWindowProc(), xxxDesktopWndProc(), xxxDestroyThreadInfo(), xxxDestroyWindow(), xxxDirectedYield(), xxxDispatchMessage(), xxxDoButtonEvent(), xxxDoHotKeyStuff(), xxxDoSend(), xxxDoSyncPaint(), xxxDragObject(), xxxDrawClipboard(), xxxDrawDragRect(), xxxDW_SendDestroyMessages(), xxxDWP_DoCancelMode(), xxxDWP_ProcessVirtKey(), xxxDWP_SetCursor(), xxxEnableWindow(), xxxEndDeferWindowPosEx(), xxxEndMenu(), xxxEndPaint(), xxxEndScroll(), xxxEnumDisplayMonitors(), xxxFreeKeyboardLayouts(), xxxFreeListFree(), xxxFreeWindow(), xxxFW_DestroyAllChildren(), xxxGetClipboardData(), xxxGetEventProc(), xxxGetInputEvent(), xxxGetScrollMenu(), xxxGetSysMenuHandle(), xxxGetThreadDesktop(), xxxHandleMenuMessages(), xxxHardErrorControl(), xxxHelpLoop(), xxxHkCallHook(), xxxHotTrackMenu(), xxxImmLoadLayout(), xxxImmProcessKey(), xxxInitSendValidateMinMaxInfo(), xxxInternalActivateKeyboardLayout(), xxxInternalDoSyncPaint(), xxxInternalGetMessage(), xxxInternalKeyEventDirect(), xxxInternalUnloadKeyboardLayout(), xxxInterSendMsgEx(), xxxInvalidateDesktopOnPaletteChange(), xxxIsDragging(), xxxKeyEvent(), xxxLoadHmodIndex(), xxxLoadKeyboardLayoutEx(), xxxMenuDraw(), xxxMenuWindowProc(), xxxMessageBeep(), xxxMessageEvent(), xxxMetricsRecalc(), xxxMinMaximize(), xxxMNAllocMenuState(), xxxMNCancel(), xxxMNCloseHierarchy(), xxxMNCompute(), xxxMNDragLeave(), xxxMNDragOver(), xxxMNEndMenuState(), xxxMNKeyDown(), xxxMNLoop(), xxxMNOpenHierarchy(), xxxMNReleaseCapture(), xxxMNSetCapture(), xxxMNStartMenuState(), xxxMouseEventDirect(), xxxMoveSize(), xxxMS_TrackMove(), xxxMsgWaitForMultipleObjects(), xxxNextWindow(), xxxNotifyImeShowStatus(), xxxOldNextWindow(), xxxOpenClipboard(), xxxOpenDesktop(), xxxPaintRect(), xxxPollAndWaitForSingleObject(), xxxProcessEventMessage(), xxxProcessNotifyWinEvent(), xxxQueryInformationThread(), xxxRealDrawMenuItem(), xxxRedrawWindow(), xxxRegisterClassEx(), xxxReleaseCapture(), xxxResetDisplayDevice(), xxxResolveDesktop(), xxxRestoreCsrssThreadDesktop(), xxxSBTrackInit(), xxxSBTrackLoop(), xxxSBWndProc(), xxxScrollWindowEx(), xxxSendBSMtoDesktop(), xxxSendClipboardMessage(), xxxSendEraseBkgnd(), xxxSendInput(), xxxSendMessageBSM(), xxxSendMessageCallback(), xxxSendMessageTimeout(), xxxSendMessageToUI(), xxxSendMinRectMessages(), xxxSendNCPaint(), xxxSetActiveWindow(), xxxSetCapture(), xxxSetClassIcon(), xxxSetClipboardViewer(), xxxSetCsrssThreadDesktop(), xxxSetDeskWallpaper(), xxxSetFocus(), xxxSetForegroundWindow(), xxxSetForegroundWindow2(), xxxSetShellWindow(), xxxSetThreadDesktop(), xxxSetWindowPlacement(), xxxShowTooltip(), xxxShowWindow(), xxxSimpleDoSyncPaint(), xxxSleepTask(), xxxSleepThread(), xxxSnapWindow(), xxxSwitchDesktop(), xxxSwitchWndProc(), xxxSwpActivate(), xxxSysCommand(), xxxSystemBroadcastMessage(), xxxSystemParametersInfo(), xxxTM_MoveDragRect(), xxxTrackCaptionButton(), xxxTrackInitSize(), xxxTrackMouseMove(), xxxTrackPopupMenuEx(), xxxTranslateAccelerator(), xxxTranslateMessage(), xxxUnloadKeyboardLayout(), xxxUpdateOtherThreadsWindows(), xxxUpdateWindows(), xxxUserChangeDisplaySettings(), xxxUserPowerCalloutWorker(), xxxUserPowerStateCalloutWorker(), xxxWaitForInputIdle(), xxxWindowEvent(), xxxWindowHitTest2(), ZapActiveAndFocus(), zzzChangeStates(), zzzClipCursor(), zzzInitTask(), zzzInternalDestroyCaret(), zzzInternalHideCaret(), zzzInternalShowCaret(), zzzInvalidateDCCache(), zzzReattachThreads(), zzzRecalc2(), zzzRecalcThreadAttachment(), zzzRegisterSystemThread(), zzzSetCaretPos(), zzzSetCursor(), zzzSetDesktop(), zzzSetSBCaretPos(), zzzSetSystemImage(), zzzSetWindowsHookAW(), zzzSetWindowsHookEx(), zzzShowCursor(), and zzzUnhookWindowsHook().

 
#define PtiCurrentShared  )     ((PTHREADINFO)(W32GetCurrentThread()))
 

Definition at line 59 of file userk.h.

Referenced by _GetGUIThreadInfo(), _GetKeyboardLayout(), _GetKeyNameText(), _GetKeyState(), _GetQueueStatus(), _GetUserObjectInformation(), _GetWOWClass(), CheckClipboardAccess(), CreateInputContext(), DrawTextExWorker(), DT_DrawStr(), DT_GetExtentMinusPrefixes(), GetAppCompatFlags(), GetAppCompatFlags2(), GetAppImeCompatFlags(), GetNextWordbreak(), InitSystemThread(), MNRecalcTabStrings(), NtUserGetAppImeLevel(), NtUserGetAsyncKeyState(), NtUserGetCaretPos(), NtUserGetForegroundWindow(), NtUserGetKeyboardLayoutName(), NtUserGetKeyboardState(), NtUserGetKeyState(), NtUserGetThreadState(), NtUserMapVirtualKeyEx(), NtUserQuerySendMessage(), NtUserQueryWindow(), NtUserVkKeyScanEx(), OpenDevice(), ProcessDeviceChanges(), ProcessMouseInput(), RawInputThread(), RegisterForDeviceChangeNotifications(), RemoteDisableScreen(), RemoteRedrawScreen(), UnregisterForDeviceChangeNotifications(), UserGetDesktopDC(), UserScreenAccessCheck(), ValidateHmenu(), ValidateHwnd(), xxxCreateDefaultImeWindow(), xxxDesktopThread(), xxxDrawCaptionTemp(), xxxDrawItemUnderline(), xxxDrawMenuBarUnderlines(), xxxDrawMenuItemText(), xxxImmActivateAndUnloadThreadsLayout(), xxxImmActivateLayout(), xxxImmActivateThreadsLayout(), xxxImmUnloadLayout(), xxxImmUnloadThreadsLayout(), xxxInternalToUnicode(), xxxMB_FindLongestString(), xxxPSMTextOut(), and zzzHideCursorNoCapture().

#define PtiFromThread Thread   )     ((PTHREADINFO)((Thread)->Tcb.Win32Thread))
 

Definition at line 87 of file userk.h.

Referenced by InitiateShutdown(), PtiFromThreadId(), ReferenceWindowStation(), TerminateConsole(), UserGlobalAtomTableCallout(), xxxHardErrorControl(), xxxQueryInformationThread(), xxxSetInformationThread(), and xxxUserNotifyProcessCreate().

#define PUDF_ALLOWFOREGROUNDACTIVATE   0x08000000
 

Definition at line 6596 of file userk.h.

Referenced by CancelForegroundActivate(), RestoreForegroundActivate(), xxxInitProcessInfo(), xxxSetProcessInitState(), xxxUserNotifyConsoleApplication(), and zzzShowStartGlass().

#define PUDF_ANIMATE   0x00010000
 

Definition at line 6584 of file userk.h.

Referenced by _ShowWindowAsync(), NtUserMinMaximize(), NtUserShowWindow(), xxxbFullscreenSwitch(), xxxCreateWindowEx(), xxxDefWindowProc(), xxxDestroyWindow(), xxxMinimizeHungWindow(), xxxMNCloseHierarchy(), xxxSetInternalWindowPos(), xxxSetParent(), xxxSetSPIMetrics(), xxxSetWindowPlacement(), xxxShowScrollBar(), xxxSysCommand(), xxxSystemParametersInfo(), and xxxUpdatePerUserSystemParameters().

#define PUDF_BEEP   0x00080000 /* Warning beeps allowed? */
 

Definition at line 6588 of file userk.h.

Referenced by LW_LoadResources(), xxxMessageBeep(), xxxOldMessageBeep(), and xxxSystemParametersInfo().

#define PUDF_DRAGFULLWINDOWS   0x00200000 /* Drag xor rect or full windows */
 

Definition at line 6590 of file userk.h.

Referenced by xxxMoveSize(), xxxSystemParametersInfo(), and xxxUpdatePerUserSystemParameters().

#define PUDF_DRAGGINGFULLWINDOW   0x10000000
 

Definition at line 6597 of file userk.h.

Referenced by xxxBeginPaint(), and xxxMoveSize().

#define PUDF_EXTENDEDSOUNDS   0x00100000 /* Extended sounds enabling */
 

Definition at line 6589 of file userk.h.

Referenced by LW_LoadResources(), and PlayEventSound().

#define PUDF_FONTSARELOADED   0x00800000
 

Definition at line 6592 of file userk.h.

Referenced by bEnumerateRegistryFonts(), and EndShutdown().

#define PUDF_GSMWPINUSE   0x40000000
 

Definition at line 6599 of file userk.h.

Referenced by DestroySMWP(), and InternalBeginDeferWindowPos().

#define PUDF_ICONTITLEWRAP   0x00400000 /* Wrap icon titles or just use single line */
 

Definition at line 6591 of file userk.h.

Referenced by SetIconMetrics(), and xxxSystemParametersInfo().

#define PUDF_LOCKFULLSCREEN   0x20000000
 

Definition at line 6598 of file userk.h.

Referenced by FullScreenCleanup(), LockWindowUpdate2(), xxxMakeWindowForegroundWithState(), and xxxUserChangeDisplaySettings().

#define PUDF_MENUSTATEINUSE   0x02000000
 

Definition at line 6594 of file userk.h.

Referenced by xxxMNAllocMenuState(), and xxxMNEndMenuState().

#define PUDF_POPUPINUSE   0x01000000
 

Definition at line 6593 of file userk.h.

Referenced by MNAllocPopup(), and MNFreePopup().

#define PUDF_VDMBOUNDSACTIVE   0x04000000
 

Definition at line 6595 of file userk.h.

Referenced by BoundCursor(), and SetVDMCursorBounds().

#define PW hwnd   )     ((PWND)HtoP(hwnd))
 

Definition at line 1172 of file userk.h.

Referenced by CheckTopmost(), TrackZorder(), ValidateSmwp(), xxxArrangeIconicWindows(), xxxCalcValidRects(), xxxDoHotKeyStuff(), xxxEndDeferWindowPosEx(), xxxHkCallHook(), ZOrderByOwner(), ZOrderByOwner2(), and zzzBltValidBits().

#define PWCat hwnd   )     ((PWND)HtoPCat(hwnd))
 

Definition at line 1173 of file userk.h.

Referenced by ValidateZorder().

#define PWND_BOTTOM   (PWND)1
 

Definition at line 3829 of file userk.h.

Referenced by LinkWindow(), ValidateZorder(), xxxCreateDesktop(), xxxCreateWindowEx(), xxxNextWindow(), xxxOldNextWindow(), xxxSetShellWindow(), and xxxSwitchToThisWindow().

#define PWND_BROADCAST   ((PWND)-1)
 

Definition at line 3833 of file userk.h.

Referenced by _PostMessage(), NtUserPostMessage(), NtUserSendMessageCallback(), NtUserSendNotifyMessage(), xxxActivateThisWindow(), xxxBroadcastPaletteChanged(), xxxDesktopWndProc(), xxxSendMessageCallback(), xxxSendMessageFF(), xxxSendMessageTimeout(), xxxSendNotifyMessage(), xxxSetDeskPattern(), xxxSetSysColors(), and xxxSystemParametersInfo().

#define PWND_ERROR   (PWND)0x10
 

Definition at line 3827 of file userk.h.

#define PWND_FOCUS   (PWND)NULL
 

Definition at line 3826 of file userk.h.

Referenced by _RegisterHotKey(), DestroyThreadsHotKeys(), and FindHotKey().

#define PWND_GROUPTOTOP   ((PWND)-1)
 

Definition at line 3830 of file userk.h.

#define PWND_INPUTOWNER   (PWND)1
 

Definition at line 3825 of file userk.h.

Referenced by _RegisterHotKey(), DestroyThreadsHotKeys(), FindHotKey(), RawInputThread(), SetDebugHotKeys(), and xxxDoHotKeyStuff().

#define PWND_NOTOPMOST   ((PWND)-2)
 

Definition at line 3832 of file userk.h.

#define PWND_TOP   (PWND)0
 

Definition at line 3828 of file userk.h.

Referenced by CheckOnTop(), ImeSetTopmost(), LinkWindow(), ResetSharedDesktops(), ValidateZorder(), xxxActivateThisWindow(), xxxCreateWindowEx(), xxxMenuWindowProc(), xxxMetricsRecalc(), xxxMNOpenHierarchy(), xxxProcessEventMessage(), xxxSetForegroundWindow2(), xxxSetInternalWindowPos(), xxxSetWindowPlacement(), xxxSetWindowRgn(), xxxShowTooltip(), xxxSysCommand(), and xxxTrackPopupMenuEx().

#define PWND_TOPMOST   ((PWND)-1)
 

Definition at line 3831 of file userk.h.

Referenced by xxxMNOpenHierarchy(), xxxShowSwitchWindow(), and xxxTrackPopupMenuEx().

#define PWNDDESKTOP  )     ((p)->head.rpdesk->pDeskInfo->spwnd)
 

Definition at line 2790 of file userk.h.

Referenced by _ChildWindowFromPointEx(), _GetAncestor(), _GetWindowPlacement(), _RealChildWindowFromPoint(), _UserSoundSentryWorker(), CkptRestore(), CreateSpb(), DoQueuedSyncPaint(), ImeCanDestroyDefIMEforChild(), LinkWindow(), LockWindowUpdate2(), NextTopWindow(), SelectWindowRgn(), SetHungFlag(), SetTiledRect(), ValidateWindowPos(), xxxActivateThisWindow(), xxxBroadcastPaletteChanged(), xxxCalcValidRects(), xxxCreateWindowEx(), xxxDefWindowProc(), xxxDestroyWindow(), xxxDrawAnimatedRects(), xxxDrawDragRect(), xxxDWP_SetCursor(), xxxDWPPrint(), xxxEndDeferWindowPosEx(), xxxGetUpdateRect(), xxxGetUpdateRgn(), xxxHandleWindowPosChanged(), xxxInitSendValidateMinMaxInfo(), xxxMakeWindowForegroundWithState(), xxxMetricsRecalc(), xxxMinimizeHungWindow(), xxxMinMaximize(), xxxMouseActivate(), xxxMoveSize(), xxxMoveWindow(), xxxMS_TrackMove(), xxxPaintRect(), xxxRedrawHungWindow(), xxxRedrawWindow(), xxxScrollWindowEx(), xxxSetInternalWindowPos(), xxxSetParent(), xxxSetWindowData(), xxxSetWindowPlacement(), xxxSetWindowStyle(), xxxShowOwnedWindows(), xxxShowWindow(), xxxSnapWindow(), xxxTooltipHandleTimer(), xxxUpdateWindow2(), zzzBltValidBits(), zzzChangeStates(), and zzzInvalidateDCCache().

#define PWNDMESSAGE  )     ((p)->head.rpdesk->spwndMessage)
 

Definition at line 2791 of file userk.h.

Referenced by _GetAncestor(), LinkWindow(), xxxCreateWindowEx(), xxxResetTooltip(), and xxxSetParent().

#define PWNDPARENT  )     (p->spwndParent ? p->spwndParent : PWNDDESKTOP(p))
 

Definition at line 2798 of file userk.h.

#define PWNDTOOLTIP  )     ((p)->head.rpdesk->spwndTooltip)
 

Definition at line 2792 of file userk.h.

Referenced by xxxCancelMouseMoveTracking().

#define PWNDTOPSBTRACK pwnd   )     (((GETPTI(pwnd)->pSBTrack)))
 

Definition at line 3397 of file userk.h.

Referenced by _SBGetParms(), DrawThumb2(), xxxContScroll(), xxxDrawScrollBar(), xxxDWP_DoCancelMode(), xxxEndScroll(), xxxMoveThumb(), xxxSBTrackInit(), xxxSBTrackLoop(), xxxSetScrollBar(), xxxTrackBox(), and xxxTrackThumb().

#define QEVENT_ACTIVATE   0x0006
 

Definition at line 2993 of file userk.h.

Referenced by xxxActivateThisWindow(), xxxProcessEventMessage(), xxxSetForegroundWindow(), xxxSetForegroundWindow2(), and zzzReattachThreads().

#define QEVENT_APPCOMMAND   0x0011
 

Definition at line 3005 of file userk.h.

Referenced by xxxKeyEvent(), and xxxProcessEventMessage().

#define QEVENT_ASYNCSENDMSG   0x000B
 

Definition at line 2998 of file userk.h.

Referenced by CleanEventMessage(), xxxProcessEventMessage(), and xxxScanSysQueue().

#define QEVENT_CANCELMENU   0x0009
 

Definition at line 2996 of file userk.h.

#define QEVENT_CANCELMODE   0x0002
 

Definition at line 2989 of file userk.h.

Referenced by xxxButtonEvent(), and xxxProcessEventMessage().

#define QEVENT_CANCELMOUSEMOVETRK   0x000D
 

Definition at line 3000 of file userk.h.

Referenced by xxxProcessEventMessage(), xxxTrackMouseMove(), and zzzSetFMouseMoved().

#define QEVENT_DEACTIVATE   0x0005
 

Definition at line 2992 of file userk.h.

Referenced by xxxActivateThisWindow(), xxxProcessEventMessage(), and xxxSetForegroundWindow2().

#define QEVENT_DESTROYWINDOW   0x000A
 

Definition at line 2997 of file userk.h.

Referenced by xxxFW_DestroyAllChildren(), and xxxProcessEventMessage().

#define QEVENT_EXECSHELL   0x0008
 

Definition at line 2995 of file userk.h.

#define QEVENT_HUNGTHREAD   0x000C
 

Definition at line 2999 of file userk.h.

Referenced by xxxMinimizeHungWindow(), and xxxProcessEventMessage().

#define QEVENT_NOTIFYWINEVENT   0x000E
 

Definition at line 3001 of file userk.h.

Referenced by CleanEventMessage(), xxxProcessEventMessage(), and xxxProcessNotifyWinEvent().

#define QEVENT_POSTMESSAGE   0x0007
 

Definition at line 2994 of file userk.h.

Referenced by xxxProcessEventMessage(), and xxxSwitchToThisWindow().

#define QEVENT_RITACCESSIBILITY   0x000F
 

Definition at line 3002 of file userk.h.

Referenced by PostAccessibility(), and xxxProcessEventMessage().

#define QEVENT_RITSOUND   0x0010
 

Definition at line 3003 of file userk.h.

Referenced by FKActivationTimer(), PostRitSound(), and xxxProcessEventMessage().

#define QEVENT_SETWINDOWPOS   0x0003
 

Definition at line 2990 of file userk.h.

Referenced by AsyncWindowPos(), CleanEventMessage(), and xxxProcessEventMessage().

#define QEVENT_SHOWWINDOW   0x0001
 

Definition at line 2988 of file userk.h.

Referenced by _ShowWindowAsync(), and xxxProcessEventMessage().

#define QEVENT_UPDATEKEYSTATE   0x0004
 

Definition at line 2991 of file userk.h.

Referenced by CleanEventMessage(), PostUpdateKeyStateEvent(), RedistributeInput(), xxxProcessEventMessage(), and xxxScanSysQueue().

#define RDW_HASWINDOWRGN   0x8000
 

Definition at line 5492 of file userk.h.

Referenced by InternalInvalidate2().

#define RE_INVALID   0x0008
 

Definition at line 2428 of file userk.h.

Referenced by zzzBltValidBits().

#define RE_INVALIDSUM   0x0040
 

Definition at line 2431 of file userk.h.

Referenced by zzzBltValidBits().

#define RE_SPB   0x0010
 

Definition at line 2429 of file userk.h.

#define RE_VALID   0x0004
 

Definition at line 2427 of file userk.h.

Referenced by zzzBltValidBits().

#define RE_VALIDSUM   0x0020
 

Definition at line 2430 of file userk.h.

Referenced by zzzBltValidBits().

#define RE_VISNEW   0x0001
 

Definition at line 2425 of file userk.h.

Referenced by CombineOldNewVis(), and zzzBltValidBits().

#define RE_VISOLD   0x0002
 

Definition at line 2426 of file userk.h.

Referenced by BltValidInit(), CombineOldNewVis(), and zzzBltValidBits().

#define REBASESHAREDPTR  )     (p)
 

Definition at line 7343 of file userk.h.

Referenced by _MonitorFromPoint(), and _MonitorFromRect().

#define REBASESHAREDPTRALWAYS  )     (p)
 

Definition at line 7344 of file userk.h.

Referenced by _MonitorFromPoint(), and _MonitorFromRect().

#define RECORD_STACK_TRACE_SIZE   6
 

Definition at line 2071 of file userk.h.

#define REMOVE_FROM_LIST type,
pstart,
pitem,
next   ) 
 

Value:

{ \ type** pp; \ \ for (pp = &pstart; *pp != NULL; pp = &(*pp)->next) { \ if (*pp == pitem) { \ *pp = pitem->next; \ break; \ } \ } \ } \

Definition at line 7370 of file userk.h.

Referenced by ClearAppStarting(), DestroyMonitor(), DestroyProcessInfo(), and JobCalloutTerminate().

#define RESET_PSEUDO_EVENT phE   ) 
 

Value:

CheckCritIn(); \ if (*(phE) == PSEUDO_EVENT_ON) *(phE) = PSEUDO_EVENT_OFF; \ else if (*(phE) != PSEUDO_EVENT_OFF) { \ KeClearEvent(*(phE)); \ }

Definition at line 3071 of file userk.h.

Referenced by SleepInputIdle(), and xxxUserNotifyProcessCreate().

#define RETURN_IF_ACCESS_DENIED amGranted,
amRequested,
 )     if (!CheckGrantedAccess((amGranted), (amRequested))) return r
 

Definition at line 2364 of file userk.h.

Referenced by _SwapMouseButton(), CreateInputContext(), InternalCreateMenu(), NtUserGetClipCursor(), ReferenceWindowStation(), xxxCreateWindowEx(), and xxxSystemParametersInfo().

#define RevalidateCatHwnd hwnd   )     HMValidateCatHandleNoSecure(hwnd, TYPE_WINDOW)
 

Definition at line 1166 of file userk.h.

Referenced by ValidateZorder(), and xxxDDETrackGetMessageHook().

#define RevalidateHwnd hwnd   )     HMValidateHandleNoSecure(hwnd, TYPE_WINDOW)
 

Definition at line 1165 of file userk.h.

#define RIT_PROCESSINPUT   0x01
 

Definition at line 39 of file userk.h.

#define RIT_STOPINPUT   0x02
 

Definition at line 40 of file userk.h.

#define RITSOUND_DOBEEP   0x0005
 

Definition at line 3012 of file userk.h.

Referenced by FKActivationTimer(), and xxxProcessEventMessage().

#define RITSOUND_DOWNSIREN   0x0001
 

Definition at line 3008 of file userk.h.

Referenced by FKActivationTimer(), HighContrastHotKey(), TurnOffMouseKeys(), xxxAccessTimeOutTimer(), xxxProcessEventMessage(), xxxStickyKeys(), xxxToggleKeysTimer(), and xxxTwoKeysDown().

#define RITSOUND_HIGHBEEP   0x0003
 

Definition at line 3010 of file userk.h.

Referenced by ToggleKeys(), xxxMKToggleMouseKeys(), xxxProcessEventMessage(), and xxxStickyKeys().

#define RITSOUND_KEYCLICK   0x0004
 

Definition at line 3011 of file userk.h.

Referenced by FilterKeys(), xxxFKAcceptanceDelayTimer(), xxxFKRepeatRateTimer(), and xxxProcessEventMessage().

#define RITSOUND_LOWBEEP   0x0002
 

Definition at line 3009 of file userk.h.

Referenced by ToggleKeys(), xxxMKToggleMouseKeys(), xxxProcessEventMessage(), and xxxStickyKeys().

#define RITSOUND_UPSIREN   0x0000
 

Definition at line 3007 of file userk.h.

Referenced by FKActivationTimer(), HighContrastHotKey(), MouseKeys(), xxxProcessEventMessage(), xxxStickyKeys(), and xxxToggleKeysTimer().

#define RSPB_INVALIDATE   1
 

Definition at line 2243 of file userk.h.

Referenced by RestoreSpb().

#define RSPB_INVALIDATE_SSB   2
 

Definition at line 2244 of file userk.h.

Referenced by RestoreSpb(), and zzzBltValidBits().

#define RSPB_NO_INVALIDATE   0
 

Definition at line 2242 of file userk.h.

Referenced by RestoreSpb(), and zzzBltValidBits().

#define SAVEPOINT xc,
yc,
resX,
resY,
t,
 ) 
 

Value:

{ \ /* \ * (xc, yc) is the point and (resX, resY) is the resolution \ */ \ gaptMouse[gptInd].x = MAKELONG(LOWORD(xc), LOWORD(resX)); \ gaptMouse[gptInd].y = MAKELONG(LOWORD(yc), LOWORD(resY)); \ gaptMouse[gptInd].time = t; \ gaptMouse[gptInd].dwExtraInfo = e; \ \ gptInd = NEXTPOINT(gptInd); \ }

Definition at line 1772 of file userk.h.

Referenced by GetMouseCoord(), and zzzSetCursorPos().

#define SCANCODE_NUMPAD_DOT   (0x53)
 

Definition at line 3984 of file userk.h.

Referenced by xxxInternalToUnicode(), and xxxKeyEvent().

#define SCANCODE_NUMPAD_PLUS   (0x4e)
 

Definition at line 3981 of file userk.h.

Referenced by xxxInternalToUnicode(), and xxxKeyEvent().

#define SCMS_FLAGS_ANSI   0x0001
 

Definition at line 2248 of file userk.h.

Referenced by xxxHkCallHook(), and xxxWrapCallWindowProc().

#define SCMS_FLAGS_INONLY   0x0002
 

Definition at line 2249 of file userk.h.

Referenced by xxxHkCallHook().

#define SCREEN_CAPTURE   4 /* screen-relative capture */
 

Definition at line 3851 of file userk.h.

Referenced by MNItemHitTest(), xxxHelpLoop(), xxxMNSetCapture(), and xxxOldNextWindow().

#define SCROLL_DIRECT   1
 

Definition at line 4826 of file userk.h.

Referenced by xxxSBTrackInit(), xxxSBWndProc(), and xxxSysCommand().

#define SCROLL_MENU   2
 

Definition at line 4827 of file userk.h.

Referenced by xxxDoScrollMenu(), and xxxSBTrackInit().

#define SCROLL_NORMAL   0
 

Definition at line 4825 of file userk.h.

Referenced by xxxSBWndProc(), and xxxSysCommand().

#define ScSendMessage pwnd,
msg,
wParam,
lParam,
xParam,
xpfn,
dwSCMSFlags   )     ScSendMessageSMS(pwnd, msg, wParam, lParam, xParam, xpfn, dwSCMSFlags, NULL)
 

Definition at line 2263 of file userk.h.

Referenced by xxxWrapCallWindowProc().

#define ScSendMessageSMS pwnd,
msg,
wParam,
lParam,
xParam,
xpfn,
dwSCMSFlags,
psms   ) 
 

Value:

(((msg) & ~MSGFLAG_MASK) >= WM_USER) ? \ SfnDWORD(pwnd, msg, wParam, lParam, xParam, xpfn, dwSCMSFlags, psms) : \ gapfnScSendMessage[MessageTable[msg & 0xffff].iFunction](pwnd, msg, wParam, lParam, xParam, xpfn, dwSCMSFlags, psms)

Definition at line 2259 of file userk.h.

Referenced by xxxHkCallHook().

#define ServerLoadString hmod,
id,
p,
cch   )     RtlLoadStringOrError(id, p, cch, 0)
 

Definition at line 2272 of file userk.h.

Referenced by _EndTask(), CheckDesktopPolicy(), FastGetProfileIntFromID(), FastGetProfileIntsW(), FastGetProfileStringFromIDW(), FastGetProfileValue(), FastUpdateWinIni(), FastWriteProfileValue(), GetDeskWallpaperName(), GetHardErrorText(), GetVersionInfo(), LW_LoadSomeStrings(), SetEndTaskDlgStatus(), UpdateWinIniInt(), xxxDesktopPaintCallback(), xxxSetDeskPattern(), xxxSystemParametersInfo(), and xxxUpdatePerUserSystemParameters().

#define ServerLoadStringEx hmod,
id,
p,
cch,
wLang   )     RtlLoadStringOrError(id, p, cch, wLang)
 

Definition at line 2274 of file userk.h.

#define SERVERSTRINGMAXSIZE   40
 

Definition at line 2269 of file userk.h.

Referenced by FastGetProfileValue(), and FastWriteProfileValue().

#define SET_ACCF  )     SET_FLAG(gdwPUDFlags, f)
 

Definition at line 6603 of file userk.h.

Referenced by FilterKeys(), MKShowMouseCursor(), SoundSentryTimer(), xxxFKAcceptanceDelayTimer(), and xxxUpdatePerUserAccessPackSettings().

#define SET_GTERMF  )     SET_FLAG(gdwGTERMFlags, f)
 

Definition at line 1998 of file userk.h.

Referenced by MKShowMouseCursor(), and ProcessDeviceChanges().

#define SET_OR_CLEAR_ACCF f,
fSet   )     SET_OR_CLEAR_FLAG(gdwPUDFlags, f, fSet)
 

Definition at line 6605 of file userk.h.

Referenced by MouseKeys(), SetAccessEnabledFlag(), xxxSystemParametersInfo(), and xxxUpdatePerUserAccessPackSettings().

#define SET_OR_CLEAR_GTERMF f,
fSet   )     SET_OR_CLEAR_FLAG(gdwGTERMFlags, f, fSet)
 

Definition at line 2000 of file userk.h.

#define SET_OR_CLEAR_PUDF f,
fSet   )     SET_OR_CLEAR_FLAG(gdwPUDFlags, f, fSet)
 

Definition at line 6612 of file userk.h.

Referenced by LW_LoadResources(), SetIconMetrics(), xxxMoveSize(), xxxSetSPIMetrics(), xxxSystemParametersInfo(), and xxxUpdatePerUserSystemParameters().

#define SET_PSEUDO_EVENT phE   ) 
 

Value:

CheckCritIn(); \ if (*(phE) == PSEUDO_EVENT_OFF) *(phE) = PSEUDO_EVENT_ON; \ else if (*(phE) != PSEUDO_EVENT_ON) { \ KeSetEvent(*(phE), EVENT_INCREMENT, FALSE); \ ObDereferenceObject(*(phE)); \ *(phE) = PSEUDO_EVENT_ON; \ }

Definition at line 3062 of file userk.h.

Referenced by xxxSetProcessInitState(), and zzzWakeInputIdle().

#define SET_PUDF  )     SET_FLAG(gdwPUDFlags, f)
 

Definition at line 6610 of file userk.h.

Referenced by bEnumerateRegistryFonts(), InternalBeginDeferWindowPos(), MNAllocPopup(), RestoreForegroundActivate(), SetVDMCursorBounds(), xxxMakeWindowForegroundWithState(), xxxMNAllocMenuState(), xxxSetProcessInitState(), xxxUserNotifyConsoleApplication(), and zzzShowStartGlass().

#define SET_TIME_LAST_READ pti   )     ((pti)->pcti->timeLastRead = NtGetTickCount())
 

Definition at line 2347 of file userk.h.

Referenced by NtUserGetThreadState(), xxxCallHook2(), xxxCreateThreadInfo(), xxxInternalGetMessage(), xxxSetInformationThread(), and xxxSleepThread().

#define SETHMODLOADED pti,
x,
hmod   ) 
 

Value:

((pti)->ppi->ahmodLibLoaded[x] = hmod, \ (pti)->ppi->dwhmodLibLoadedMask |= (1 << (x)))

Definition at line 3666 of file userk.h.

Referenced by xxxLoadHmodIndex().

#define SetRawKeyDown vk   )     SetKeyDownBit(gafRawKeyState, vk)
 

Definition at line 5735 of file userk.h.

Referenced by UpdateRawKeyState().

#define SetRawKeyToggle vk   )     SetKeyToggleBit(gafRawKeyState, vk)
 

Definition at line 5738 of file userk.h.

Referenced by ChangeForegroundKeyboardTable(), UpdateKeyLights(), and UpdatePerUserKeyboardIndicators().

#define SetUP uSetting   )     SetUPBOOL(gpdwCPUserPreferencesMask, SPI_GET ## uSetting)
 

Definition at line 5263 of file userk.h.

#define SetUPBOOL pdw,
uSetting   )     (*UPBOOLPointer(pdw, uSetting) |= UPBOOLMask(uSetting))
 

Definition at line 5250 of file userk.h.

Referenced by xxxSystemParametersInfo().

#define SFW_ACTIVATERESTORE   0x0010
 

Definition at line 4438 of file userk.h.

Referenced by xxxKeyEvent(), xxxNextWindow(), and xxxSetForegroundWindow2().

#define SFW_NOZORDER   0x0004
 

Definition at line 4436 of file userk.h.

Referenced by xxxActiveWindowTracking(), and xxxSetForegroundWindow2().

#define SFW_SETFOCUS   0x0008
 

Definition at line 4437 of file userk.h.

Referenced by xxxSetFocus(), and xxxSetForegroundWindow2().

#define SFW_STARTUP   0x0001
 

Definition at line 4434 of file userk.h.

Referenced by xxxMinMaximize(), and xxxSetForegroundWindow2().

#define SFW_SWITCH   0x0002
 

Definition at line 4435 of file userk.h.

Referenced by xxxActiveWindowTracking(), xxxKeyEvent(), xxxNextWindow(), and xxxSetForegroundWindow2().

#define SHRSTR ppi,
 )     SharedRebaseToClient(ppi, gpsi->s)
 

Definition at line 6729 of file userk.h.

#define SHUTDOWN_CANCEL   3
 

Definition at line 78 of file userk.h.

Referenced by ConsoleClientShutdown(), UnlockConsole(), and UserClientShutdown().

#define SHUTDOWN_KNOWN_PROCESS   1
 

Definition at line 76 of file userk.h.

Referenced by ConsoleClientShutdown(), NonConsoleProcessShutdown(), UnlockConsole(), UserClientShutdown(), and xxxQueryInformationThread().

#define SHUTDOWN_UNKNOWN_PROCESS   2
 

Definition at line 77 of file userk.h.

Referenced by ConsoleClientShutdown(), UserClientShutdown(), and xxxQueryInformationThread().

#define SMESSAGEPROTO func   ) 
 

Value:

LRESULT CALLBACK Sfn ## func( \ PWND pwnd, UINT msg, WPARAM wParam, LPARAM lParam, \ ULONG_PTR xParam, PROC xpfnWndProc, DWORD dwSCMSFlags, PSMS psms)

Definition at line 4081 of file userk.h.

#define SMF_CB_CLIENT   0x0400
 

Definition at line 3734 of file userk.h.

Referenced by _ReplyMessage(), ReceiverDied(), xxxInterSendMsgEx(), and xxxReceiveMessage().

#define SMF_CB_REPLY   0x0200
 

Definition at line 3733 of file userk.h.

Referenced by NtUserGetThreadState(), xxxInterSendMsgEx(), and xxxReceiveMessage().

#define SMF_CB_REQUEST   0x0100
 

Definition at line 3732 of file userk.h.

Referenced by _ReplyMessage(), NtUserGetThreadState(), ReceiverDied(), xxxInterSendMsgEx(), and xxxReceiveMessage().

#define SMF_CB_SERVER   0x0800
 

Definition at line 3735 of file userk.h.

Referenced by xxxInterSendMsgEx().

#define SMF_RECEIVEDMESSAGE   0x0010
 

Definition at line 3731 of file userk.h.

Referenced by xxxInterSendMsgEx(), xxxReceiveMessage(), and xxxSleepTask().

#define SMF_RECEIVERBUSY   0x4000
 

Definition at line 3738 of file userk.h.

Referenced by ReceiverDied(), xxxInterSendMsgEx(), xxxReceiveMessage(), and xxxSleepTask().

#define SMF_RECEIVERDIED   0x0002
 

Definition at line 3728 of file userk.h.

Referenced by ReceiverDied(), and xxxReceiveMessage().

#define SMF_RECEIVERFREE   0x0008
 

Definition at line 3730 of file userk.h.

Referenced by ReceiverDied(), xxxInterSendMsgEx(), and xxxReceiveMessage().

#define SMF_REPLY   0x0001
 

Definition at line 3727 of file userk.h.

Referenced by _ReplyMessage(), NtUserGetThreadState(), ReceiverDied(), xxxHkCallHook(), xxxInterSendMsgEx(), xxxReceiveMessage(), and xxxSleepTask().

#define SMF_SENDERDIED   0x0004
 

Definition at line 3729 of file userk.h.

Referenced by _ReplyMessage(), ReceiverDied(), xxxHkCallHook(), and xxxReceiveMessage().

#define SMF_WOWRECEIVE   0x1000
 

Definition at line 3736 of file userk.h.

Referenced by DirectedScheduleTask().

#define SMF_WOWSEND   0x2000
 

Definition at line 3737 of file userk.h.

Referenced by DirectedScheduleTask().

#define SMIN_CLEAR   0
 

Definition at line 5534 of file userk.h.

Referenced by xxxCreateWindowEx(), xxxMinMaximize(), and xxxMS_TrackMove().

#define SMIN_SET   1
 

Definition at line 5535 of file userk.h.

Referenced by SetMinimize(), and xxxMinMaximize().

#define SMS_NOMENU   (PMENU)(-1)
 

Definition at line 4936 of file userk.h.

Referenced by xxxMNCancel(), and xxxSendMenuSelect().

#define SPB_DRAWBUFFER   0x0004
 

Definition at line 3655 of file userk.h.

#define SPB_LOCKUPDATE   0x0002
 

Definition at line 3654 of file userk.h.

Referenced by CreateSpb(), FBitsTouch(), FindSpb(), and LockWindowUpdate2().

#define SPB_SAVESCREENBITS   0x0001
 

Definition at line 3653 of file userk.h.

Referenced by CreateSpb(), FreeSpb(), and RestoreSpb().

#define STR_COLOREND   STR_GRADIENTINACTIVECAPTION
 

Definition at line 6737 of file userk.h.

Referenced by xxxODI_ColorInit().

#define STR_COLORSTART   STR_SCROLLBAR
 

Definition at line 6736 of file userk.h.

Referenced by xxxODI_ColorInit().

#define STW_SAME   ((PWND) 1)
 

Definition at line 5823 of file userk.h.

Referenced by xxxAddFullScreen(), xxxEndDeferWindowPosEx(), xxxRemoveFullScreen(), and xxxSetTrayWindow().

#define SubtractRgn hrgnResult,
hrgnA,
hrgnB   )     GreCombineRgn(hrgnResult, hrgnA, hrgnB, RGN_DIFF)
 

Definition at line 2221 of file userk.h.

Referenced by _ExcludeUpdateRgn(), _GetDCEx(), CalcWindowVisRgn(), InternalInvalidate2(), InternalInvalidate3(), InternalScrollDC(), LockWindowUpdate2(), PreventInterMonitorBlts(), RestoreSpb(), SpbCheckRect2(), UserSetDCVisRgn(), xxxDrawDragRect(), and zzzBltValidBits().

#define SYSCUR name   )     (gasyscur[OCR_##name##_DEFAULT - OCR_FIRST_DEFAULT].spcur)
 

Definition at line 2773 of file userk.h.

Referenced by AllocQueue(), LW_RegisterWindows(), xxxCreateThreadInfo(), xxxDragObject(), xxxDWP_SetCursor(), xxxHelpLoop(), xxxMoveSize(), xxxScanSysQueue(), xxxTrackInitSize(), and zzzUpdateCursorImage().

#define SYSICO name   )     (gasysico[OIC_##name##_DEFAULT - OIC_FIRST_DEFAULT].spcur)
 

Definition at line 2772 of file userk.h.

Referenced by _LoadCursorsAndIcons(), DrawIconCallBack(), xxxGetWindowSmIcon(), xxxPaintIconsInSwitchWindow(), and xxxRealDrawMenuItem().

#define TDBF_SETUP   1
 

Definition at line 3177 of file userk.h.

Referenced by DestroyTask(), and zzzInitTask().

#define TERMF_DTDESTROYED   0x00000020
 

Definition at line 2011 of file userk.h.

Referenced by xxxDesktopThread().

#define TERMF_DTINITFAILED   0x00000010
 

Definition at line 2010 of file userk.h.

Referenced by xxxDesktopThread(), and xxxInitTerminal().

#define TERMF_DTINITSUCCESS   0x00000008
 

Definition at line 2009 of file userk.h.

Referenced by xxxDesktopThread().

#define TERMF_INITIALIZED   0x00000001
 

Definition at line 2006 of file userk.h.

Referenced by xxxCreateWindowStation(), and xxxInitTerminal().

#define TERMF_NOIO   0x00000002
 

Definition at line 2007 of file userk.h.

Referenced by xxxCreateDesktop(), xxxCreateWindowStation(), xxxDesktopThread(), and xxxInitTerminal().

#define TERMF_STOPINPUT   0x00000004
 

Definition at line 2008 of file userk.h.

#define TEST_ACCF  )     TEST_FLAG(gdwPUDFlags, f)
 

Definition at line 6601 of file userk.h.

Referenced by FilterKeys(), MKHideMouseCursor(), MouseKeys(), ProcessKeyboardInput(), ProcessMouseInput(), SetAccessEnabledFlag(), SoundSentryTimer(), xxxAccessTimeOutTimer(), xxxMKButtonClick(), xxxMKMouseMove(), and xxxMKToggleMouseKeys().

#define TEST_BOOL_ACCF  )     TEST_BOOL_FLAG(gdwPUDFlags, f)
 

Definition at line 6602 of file userk.h.

Referenced by LoadCPUserPreferences(), SoundSentryTimer(), xxxDrawMenuBarUnderlines(), xxxDrawMenuItemText(), xxxSystemParametersInfo(), and xxxUpdatePerUserAccessPackSettings().

#define TEST_BOOL_GTERMF  )     TEST_BOOL_FLAG(gdwGTERMFlags, f)
 

Definition at line 1997 of file userk.h.

#define TEST_BOOL_PUDF  )     TEST_BOOL_FLAG(gdwPUDFlags, f)
 

Definition at line 6609 of file userk.h.

Referenced by xxxMoveSize(), xxxSystemParametersInfo(), and xxxUpdatePerUserSystemParameters().

#define TEST_GTERMF  )     TEST_FLAG(gdwGTERMFlags, f)
 

Definition at line 1996 of file userk.h.

Referenced by AllocQueue(), MKShowMouseCursor(), xxxSetThreadDesktop(), and zzzSetDesktop().

#define TEST_PUDF  )     TEST_FLAG(gdwPUDFlags, f)
 

Definition at line 6608 of file userk.h.

Referenced by _ShowWindowAsync(), BoundCursor(), CancelForegroundActivate(), DestroySMWP(), EndShutdown(), InternalBeginDeferWindowPos(), LockWindowUpdate2(), MNAllocPopup(), MNFreePopup(), NtUserMinMaximize(), NtUserShowWindow(), PlayEventSound(), xxxBeginPaint(), xxxbFullscreenSwitch(), xxxCreateWindowEx(), xxxDefWindowProc(), xxxDestroyWindow(), xxxInitProcessInfo(), xxxMessageBeep(), xxxMinimizeHungWindow(), xxxMNAllocMenuState(), xxxMNCloseHierarchy(), xxxMNEndMenuState(), xxxOldMessageBeep(), xxxSetInternalWindowPos(), xxxSetParent(), xxxSetWindowPlacement(), xxxShowScrollBar(), xxxSysCommand(), and xxxUserChangeDisplaySettings().

#define TestALPHA uSetting   )     (!gbDisableAlpha && TestEffectUP(uSetting))
 

Definition at line 6672 of file userk.h.

Referenced by CreateBitmapStrip(), FCursorShadowed(), MNFadeSelection(), xxxAnimateCaption(), xxxDrawCaptionBar(), xxxMenuWindowProc(), and xxxTooltipWndProc().

#define TestEffectInvertUP uSetting   )     (TestUP(uSetting) || !TestUP(UIEFFECTS))
 

Definition at line 5280 of file userk.h.

Referenced by xxxDrawMenuBarUnderlines(), and xxxDrawMenuItemText().

#define TestEffectUP uSetting   ) 
 

Value:

((*gpdwCPUserPreferencesMask & \ (IndexUP(SPI_GET ## uSetting) | IndexUP(SPI_GETUIEFFECTS))) == \ (IndexUP(SPI_GET ## uSetting) | IndexUP(SPI_GETUIEFFECTS)))

Definition at line 5272 of file userk.h.

Referenced by xxxMenuWindowProc(), xxxShowTooltip(), xxxTooltipWndProc(), and xxxTrackMouseMove().

#define TESTHMODLOADED pti,
 )     ((pti)->ppi->dwhmodLibLoadedMask & (1 << (x)))
 

Definition at line 3665 of file userk.h.

Referenced by xxxCallHook2(), xxxDoSysExpunge(), xxxGetEventProc(), and xxxLoadHmodIndex().

#define TestRawKeyDown vk   )     TestKeyDownBit(gafRawKeyState, vk)
 

Definition at line 5734 of file userk.h.

Referenced by AdjustPushState(), NlsNumpadModeProc(), UpdateRawKeyState(), xxxAltGr(), xxxKeyEvent(), xxxNumpadCursor(), and xxxProcessKeyEvent().

#define TestRawKeyToggle vk   )     TestKeyToggleBit(gafRawKeyState, vk)
 

Definition at line 5737 of file userk.h.

Referenced by RemoteSyncToggleKeys(), and xxxNumpadCursor().

#define TestUP uSetting   )     TestUPBOOL(gpdwCPUserPreferencesMask, SPI_GET ## uSetting)
 

Definition at line 5262 of file userk.h.

Referenced by xxxActiveWindowTracking(), xxxDWP_SetCursor(), xxxMouseActivate(), xxxProcessEventMessage(), xxxSetForegroundWindow2(), xxxSystemParametersInfo(), xxxSystemTimerProc(), and xxxTrackMouseMove().

#define TestUPBOOL pdw,
uSetting   )     (*UPBOOLPointer(pdw, uSetting) & UPBOOLMask(uSetting))
 

Definition at line 5247 of file userk.h.

Referenced by xxxSystemParametersInfo().

#define ThreadLock _pobj_,
_ptl_   ) 
 

Value:

{ \ \ PTHREADINFO _pti_; \ PVOID __pobj_ = (_pobj_); \ \ _pti_ = PtiCurrent(); \ (_ptl_)->next = _pti_->ptl; \ _pti_->ptl = (_ptl_); \ (_ptl_)->pobj = __pobj_; \ if (__pobj_ != NULL) { \ HMLockObject(__pobj_); \ } \ }

Definition at line 1203 of file userk.h.

#define ThreadLockAlways _pobj_,
_ptl_   ) 
 

Value:

{ \ \ PTHREADINFO _pti_; \ PVOID __pobj_ = (_pobj_); \ \ _pti_ = PtiCurrent(); \ (_ptl_)->next = _pti_->ptl; \ _pti_->ptl = (_ptl_); \ (_ptl_)->pobj = __pobj_; \ HMLockObject(__pobj_); \ }

Definition at line 1227 of file userk.h.

#define ThreadLockAlwaysWithPti _pti_,
_pobj_,
_ptl_   ) 
 

Value:

{ \ PVOID __pobj_ = (_pobj_); \ (_ptl_)->next = _pti_->ptl; \ _pti_->ptl = (_ptl_); \ (_ptl_)->pobj = __pobj_; \ HMLockObject(__pobj_); \ }

Definition at line 1268 of file userk.h.

#define ThreadLockDesktop pti,
pdesk,
ptl,
tag   ) 
 

Value:

{ \ UserAssert(pdesk == NULL || OBJECT_TO_OBJECT_HEADER(pdesk)->Type == *ExDesktopObjectType);\ ThreadLockObject(pdesk, ptl); \ }

Definition at line 1652 of file userk.h.

Referenced by NtUserSwitchDesktop(), RemoteDisableScreen(), RemoteRedrawScreen(), xxxCreateThreadInfo(), xxxDesktopThread(), xxxFreeWindow(), xxxSendMessageBSM(), xxxSystemBroadcastMessage(), and zzzSetDesktop().

#define ThreadLockDesktopHandle _pti,
_ptl_,
_hdesk_   )     PushW32ThreadLock(_hdesk_, _ptl_, CloseProtectedHandle)
 

Definition at line 1722 of file userk.h.

Referenced by xxxSwitchDesktop().

#define ThreadLockExchangeDesktop pti,
pdesk,
ptl,
tag   ) 
 

Value:

{ \ UserAssert(pdesk == NULL || OBJECT_TO_OBJECT_HEADER(pdesk)->Type == *ExDesktopObjectType);\ ThreadLockExchangeObject(pdesk, ptl); \ }

Definition at line 1658 of file userk.h.

Referenced by xxxSendMessageBSM(), and xxxSystemBroadcastMessage().

#define ThreadLockExchangeObject pobj,
ptl   ) 
 

Value:

{ \ UserAssert(!(PpiCurrent()->W32PF_Flags & W32PF_TERMINATED)); \ UserAssert(pobj == NULL || OBJECT_TO_OBJECT_HEADER(pobj)->PointerCount != 0); \ if (pobj != NULL) { \ ObReferenceObject(pobj); \ } \ ExchangeW32ThreadLock(pobj, ptl); \ }

Definition at line 1565 of file userk.h.

#define ThreadLockExchangeWinSta pti,
pwinsta,
ptl   ) 
 

Value:

{ \ UserAssert(pwinsta == NULL || OBJECT_TO_OBJECT_HEADER(pwinsta)->Type == *ExWindowStationObjectType);\ ThreadLockExchangeObject(pwinsta, ptl); \ }

Definition at line 1674 of file userk.h.

Referenced by xxxSendMessageBSM(), and xxxSystemBroadcastMessage().

#define ThreadLockNever _ptl_   ) 
 

Value:

{ \ \ PTHREADINFO _pti_; \ \ _pti_ = PtiCurrent(); \ (_ptl_)->next = _pti_->ptl; \ _pti_->ptl = (_ptl_); \ (_ptl_)->pobj = NULL; \ }

Definition at line 1247 of file userk.h.

Referenced by xxxRedrawHungWindow(), xxxScrollWindowEx(), xxxSendChildNCPaint(), xxxUpdateOtherThreadsWindows(), xxxUpdateThreadsWindows(), xxxUpdateWindow2(), and xxxWindowHitTest().

#define ThreadLockNeverWithPti _pti_,
_ptl_   ) 
 

Value:

{ \ (_ptl_)->next = _pti_->ptl; \ _pti_->ptl = (_ptl_); \ (_ptl_)->pobj = NULL; \ }

Definition at line 1285 of file userk.h.

#define ThreadLockObject pobj,
ptl   ) 
 

Value:

{ \ UserAssert(!(PpiCurrent()->W32PF_Flags & W32PF_TERMINATED)); \ UserAssert(pobj == NULL || OBJECT_TO_OBJECT_HEADER(pobj)->PointerCount != 0); \ PushW32ThreadLock(pobj, ptl, UserDereferenceObject); \ if (pobj != NULL) { \ ObReferenceObject(pobj); \ } \ }

Definition at line 1555 of file userk.h.

Referenced by xxxPollAndWaitForSingleObject().

#define ThreadLockPool _pti_,
_ppool_,
_ptl_   )     PushW32ThreadLock(_ppool_, _ptl_, UserFreePool)
 

Definition at line 1704 of file userk.h.

Referenced by bEnumerateRegistryFonts(), BMPtoDIB(), CreateProfileUserName(), MESSAGECALL(), NtUserDrawCaptionTemp(), NtUserResolveDesktop(), NtUserResolveDesktopForWOW(), NtUserSendInput(), NtUserSetSysColors(), NtUserSystemParametersInfo(), NtUserToUnicodeEx(), QueuePowerRequest(), xxxConnectService(), xxxCsEvent(), xxxDragObject(), xxxDrawMenuBarUnderlines(), xxxDrawMenuItemText(), xxxImmLoadLayout(), xxxMessageEvent(), xxxNextWindow(), xxxOldNextWindow(), xxxResetDisplayDevice(), and xxxSystemParametersInfo().

#define ThreadLockPoolCleanup _pti_,
_ppool_,
_ptl_,
_pfn_   )     PushW32ThreadLock(_ppool_, _ptl_, _pfn_)
 

Definition at line 1713 of file userk.h.

Referenced by xxxEndDeferWindowPosEx(), xxxFreeListFree(), xxxProcessEventMessage(), and xxxUserPowerCalloutWorker().

#define ThreadLockPti pti,
pobj,
ptl   ) 
 

Value:

{ \ _ThreadLockPti(pti, pobj, ptl); \ }

Definition at line 1692 of file userk.h.

Referenced by xxxActivateThisWindow(), xxxCancelTracking(), xxxDeactivate(), xxxImmActivateAndUnloadThreadsLayout(), xxxImmActivateThreadsLayout(), xxxImmUnloadThreadsLayout(), xxxSetForegroundWindow2(), and xxxWindowEvent().

#define ThreadLockSFWLockCount _ptl_   ) 
 

Value:

{ \ IncSFWLockCount(); \ /* Pass a fake pObj or the cleanup function won't be called */ \ PushW32ThreadLock(&guSFWLockCount, _ptl_, CleanupDecSFWLockCount); \ }

Definition at line 1729 of file userk.h.

Referenced by xxxHkCallHook().

#define ThreadLockWinSta pti,
pwinsta,
ptl   ) 
 

Value:

{ \ UserAssert(pwinsta == NULL || OBJECT_TO_OBJECT_HEADER(pwinsta)->Type == *ExWindowStationObjectType);\ ThreadLockObject(pwinsta, ptl); \ }

Definition at line 1668 of file userk.h.

Referenced by DisownClipboard(), NtUserGetClipboardData(), xxxChangeClipboardChain(), xxxCloseClipboard(), xxxDesktopThread(), xxxEmptyClipboard(), xxxSendMessageBSM(), xxxSetClipboardViewer(), xxxSnapWindow(), and xxxSystemBroadcastMessage().

#define ThreadLockWithPti _pti_,
_pobj_,
_ptl_   ) 
 

Value:

{ \ PVOID __pobj_ = (_pobj_); \ (_ptl_)->next = _pti_->ptl; \ _pti_->ptl = (_ptl_); \ (_ptl_)->pobj = __pobj_; \ if (__pobj_ != NULL) { \ HMLockObject(__pobj_); \ } \ }

Definition at line 1301 of file userk.h.

#define THREADS_PER_TLBLOCK   16
 

Definition at line 2473 of file userk.h.

Referenced by xxxImmActivateAndUnloadThreadsLayout(), xxxImmActivateThreadsLayout(), and xxxImmUnloadThreadsLayout().

#define ThreadUnlock ptl   )     ThreadUnlock1()
 

Definition at line 1362 of file userk.h.

#define ThreadUnlockAndCleanupPool _pti_,
_ptl_   )     PopAndFreeAlwaysW32ThreadLock(_ptl_)
 

Definition at line 1719 of file userk.h.

#define ThreadUnlockAndFreePool _pti_,
_ptl_   )     PopAndFreeAlwaysW32ThreadLock(_ptl_)
 

Definition at line 1710 of file userk.h.

Referenced by bEnumerateRegistryFonts(), FreeProfileUserName(), MESSAGECALL(), NtUserDrawCaptionTemp(), NtUserResolveDesktop(), NtUserResolveDesktopForWOW(), NtUserSystemParametersInfo(), NtUserToUnicodeEx(), xxxCsEvent(), xxxDragObject(), xxxDrawMenuBarUnderlines(), xxxDrawMenuItemText(), xxxImmLoadLayout(), xxxMessageEvent(), xxxResetDisplayDevice(), and xxxSystemParametersInfo().

#define ThreadUnlockDesktop pti,
ptl,
tag   )     ThreadUnlockObject(ptl)
 

Definition at line 1664 of file userk.h.

Referenced by NtUserSwitchDesktop(), RemoteDisableScreen(), RemoteRedrawScreen(), xxxCreateThreadInfo(), xxxDesktopThread(), xxxFreeWindow(), xxxSendMessageBSM(), xxxSystemBroadcastMessage(), and zzzSetDesktop().

#define ThreadUnlockDesktopHandle _ptl_   )     PopAndFreeAlwaysW32ThreadLock(_ptl_)
 

Definition at line 1725 of file userk.h.

Referenced by xxxSwitchDesktop().

#define ThreadUnlockObject ptl   ) 
 

Value:

{ \ PopAndFreeW32ThreadLock(ptl); \ } \

Definition at line 1575 of file userk.h.

Referenced by xxxPollAndWaitForSingleObject().

#define ThreadUnlockPool _pti_,
_ptl_   )     PopW32ThreadLock(_ptl_)
 

Definition at line 1707 of file userk.h.

Referenced by BMPtoDIB(), NtUserSendInput(), NtUserSetSysColors(), QueuePowerRequest(), xxxConnectService(), xxxImmLoadLayout(), xxxNextWindow(), and xxxOldNextWindow().

#define ThreadUnlockPoolCleanup _pti_,
_ptl_   )     PopW32ThreadLock(_ptl_)
 

Definition at line 1716 of file userk.h.

Referenced by xxxEndDeferWindowPosEx(), xxxFreeListFree(), xxxProcessEventMessage(), and xxxUserPowerCalloutWorker().

#define ThreadUnlockPti pti,
ptl   )     UnlockW32Thread(ptl)
 

Definition at line 1699 of file userk.h.

Referenced by xxxActivateThisWindow(), xxxCancelTracking(), xxxDeactivate(), xxxImmActivateAndUnloadThreadsLayout(), xxxImmActivateThreadsLayout(), xxxImmUnloadThreadsLayout(), xxxSetForegroundWindow2(), and xxxWindowEvent().

#define ThreadUnlockSFWLockCount _ptl_   ) 
 

Value:

{ \ DecSFWLockCount(); \ PopW32ThreadLock(_ptl_); \ }

Definition at line 1736 of file userk.h.

Referenced by xxxHkCallHook().

#define ThreadUnlockWinSta pti,
ptl   )     ThreadUnlockObject(ptl)
 

Definition at line 1698 of file userk.h.

Referenced by DisownClipboard(), NtUserGetClipboardData(), xxxChangeClipboardChain(), xxxCloseClipboard(), xxxDesktopThread(), xxxEmptyClipboard(), xxxSendMessageBSM(), xxxSetClipboardViewer(), xxxSnapWindow(), and xxxSystemBroadcastMessage().

#define TID pti   )     HandleToUlong((pti) == NULL ? NULL : (pti)->pEThread->Cid.UniqueThread)
 

Definition at line 1174 of file userk.h.

Referenced by xxxSetForegroundWindow2().

#define TIDq pti   )     HandleToUlong((pti)->pEThread->Cid.UniqueThread)
 

Definition at line 1175 of file userk.h.

Referenced by CancelInputState(), CreateNotify(), UT_CaretSet(), xxxActivateThisWindow(), xxxCallHook2(), xxxCreateCaret(), xxxSetForegroundWindow2(), xxxWindowEvent(), and zzzSetDesktop().

#define TOGGLE_ACCF  )     TOGGLE_FLAG(gdwPUDFlags, f)
 

Definition at line 6606 of file userk.h.

#define TOGGLE_GTERMF  )     TOGGLE_FLAG(gdwGTERMFlags, f)
 

Definition at line 2001 of file userk.h.

#define TOGGLE_PUDF  )     TOGGLE_FLAG(gdwPUDFlags, f)
 

Definition at line 6613 of file userk.h.

#define ToggleRawKeyToggle vk   )     ToggleKeyToggleBit(gafRawKeyState, vk)
 

Definition at line 5740 of file userk.h.

Referenced by UpdateRawKeyState().

#define TRACE  ) 
 

Definition at line 1118 of file userk.h.

#define TRACE_DESKTOP  ) 
 

Definition at line 7443 of file userk.h.

Referenced by DestroyDesktop(), xxxDesktopThread(), and xxxSwitchDesktop().

#define TRACE_HYDAPI  ) 
 

Definition at line 7427 of file userk.h.

Referenced by CtxDisplayIOCtl(), InitiateWin32kCleanup(), RemoteConnect(), RemoteDisableScreen(), RemoteLogoff(), RemoteNtSecurity(), RemotePassthruDisable(), RemoteRedrawRectangle(), RemoteRedrawScreen(), RemoteShadowCleanup(), RemoteShadowStart(), RemoteThinwireStats(), UnloadCursorsAndIcons(), Win32KDriverUnload(), Win32kNtUserCleanup(), xxxRemoteDisconnect(), xxxRemotePassthruEnable(), xxxRemoteReconnect(), xxxRemoteShadowSetup(), xxxRemoteShadowStop(), and xxxRemoteStopScreenUpdates().

#define TRACE_INIT str   )     {}
 

Definition at line 1116 of file userk.h.

Referenced by InitCreateObjectDirectory(), InitCreateSharedSection(), InitCreateUserCrit(), InitCreateUserSubsystem(), InitFunctionTables(), InitLoadResources(), InitMapSharedSection(), InitMessageTables(), InitOLEFormats(), InitUserScreen(), NtUserInitialize(), NtUserProcessConnect(), UpdateUserScreen(), UserInitialize(), UserThreadCallout(), Win32UserInitialize(), xxxbFullscreenSwitch(), xxxConnectService(), xxxCreateDesktop(), xxxOpenDesktop(), xxxSwitchDesktop(), xxxUserChangeDisplaySettings(), xxxUserProcessCallout(), and xxxUserResetDisplayDevice().

#define TRACE_RIT  ) 
 

Definition at line 7444 of file userk.h.

Referenced by InitiateWin32kCleanup().

#define TRACE_SWITCH str   )     {}
 

Definition at line 1117 of file userk.h.

Referenced by FullScreenCleanup(), ResetSharedDesktops(), xxxMakeWindowForegroundWithState(), and xxxUserChangeDisplaySettings().

#define TRACECALLBACK  ) 
 

Definition at line 1121 of file userk.h.

#define TRACECALLBACKMSG  ) 
 

Definition at line 1122 of file userk.h.

#define TRACETHUNK  ) 
 

Definition at line 1120 of file userk.h.

Referenced by MESSAGECALL().

#define TRACEVOID  ) 
 

Definition at line 1119 of file userk.h.

Referenced by NtUserAlterWindowStyle(), NtUserEndMenu(), NtUserModifyUserStartupInfoFlags(), NtUserNotifyIMEStatus(), NtUserNotifyWinEvent(), NtUserSetDbgTag(), NtUserSetRipFlags(), NtUserSetThreadLayoutHandles(), and NtUserSetThreadState().

#define UNDERLINE_RECALC   0x7FFFFFFF
 

Definition at line 5295 of file userk.h.

Referenced by _SetMenuDefaultItem(), MenuRecalc(), xxxDrawItemUnderline(), and xxxSetLPITEMInfo().

#define UnionRgn hrgnResult,
hrgnA,
hrgnB   )     GreCombineRgn(hrgnResult, hrgnA, hrgnB, RGN_OR)
 

Definition at line 2223 of file userk.h.

Referenced by InternalInvalidate3(), InternalScrollDC(), PreventInterMonitorBlts(), UpdateUserScreen(), xxxBeginPaint(), xxxShowOwnedWindows(), and zzzBltValidBits().

#define Unlock ppobj   )     HMAssignmentUnlock((PVOID *)ppobj)
 

Definition at line 1182 of file userk.h.

#define UnlockDesktop ppdesk,
tag,
extra   )     UnlockObjectAssignment(ppdesk)
 

Definition at line 1649 of file userk.h.

Referenced by _DestroyMenu(), CleanupDirtyDesktops(), DestroyClass(), DestroyDesktop(), DestroyProcessInfo(), DestroyWindowStation(), HMFreeObject(), InitiateWin32kCleanup(), InternalRegisterClassEx(), UnlinkHook(), UserDeleteW32Thread(), xxxCloseDesktop(), xxxCreateDesktop(), xxxDesktopThread(), and xxxDestroyThreadInfo().

#define UnlockProcess   ObDereferenceObject
 

Definition at line 4486 of file userk.h.

Referenced by CheckAllowForeground(), SetInformationProcess(), UserSetConsoleProcessWindowStation(), xxxActivateDebugger(), xxxAllowSetForegroundWindow(), xxxUserNotifyConsoleApplication(), xxxUserNotifyProcessCreate(), and xxxWaitForInputIdle().

#define UnlockThread   ObDereferenceObject
 

Definition at line 4487 of file userk.h.

Referenced by PtiFromThreadId(), TerminateConsole(), xxxHardErrorControl(), xxxQueryInformationThread(), xxxSetInformationThread(), and xxxUserNotifyProcessCreate().

#define UnlockWinSta ppwinsta   )     UnlockObjectAssignment(ppwinsta)
 

Definition at line 1628 of file userk.h.

Referenced by DestroyProcessInfo(), DestroyWindowStation(), and FreeDesktop().

#define UnrealizeObject hbr   )     /* NOP for NT */
 

Definition at line 5308 of file userk.h.

#define UP uSetting   )     UPDWORDValue(SPI_GET ## uSetting)
 

Definition at line 7066 of file userk.h.

Referenced by CanForceForeground(), LoadCPUserPreferences(), xxxDWP_SetCursor(), xxxSetForegroundWindow(), and xxxTrackMouseMove().

#define UPBOOLIndex uSetting   )     (((uSetting) - SPI_STARTBOOLRANGE) / 2)
 

Definition at line 5232 of file userk.h.

#define UPBOOLMask uSetting   )     (1 << (UPBOOLIndex(uSetting) - ((UPBOOLIndex(uSetting) / 32) * 32)))
 

Definition at line 5244 of file userk.h.

#define UPBOOLPointer pdw,
uSetting   )     (pdw + (UPBOOLIndex(uSetting) / 32))
 

Definition at line 5238 of file userk.h.

#define UPDWORDIndex uSetting   )     (1 + (((uSetting) - SPI_STARTDWORDRANGE) / 2))
 

Definition at line 5220 of file userk.h.

#define UPIsBOOLRange uSetting   )     ((uSetting) >= SPI_STARTBOOLRANGE && (uSetting) < SPI_MAXBOOLRANGE)
 

Definition at line 5226 of file userk.h.

Referenced by NtUserSystemParametersInfo(), and xxxSystemParametersInfo().

#define UPIsDWORDRange uSetting   )     ((uSetting) >= SPI_STARTDWORDRANGE && (uSetting) < SPI_MAXDWORDRANGE)
 

Definition at line 5213 of file userk.h.

Referenced by NtUserSystemParametersInfo(), and xxxSystemParametersInfo().

#define VALIDATECLASSANDSIZE pwnd,
message,
wParam,
lParam,
inFNID,
initmessage   ) 
 

Definition at line 2174 of file userk.h.

#define Validateppopupmenu ppopupmenu   ) 
 

Definition at line 4885 of file userk.h.

Referenced by LockPopupMenu(), MNFreePopup(), xxxMenuWindowProc(), xxxMNCancel(), xxxMNChar(), xxxMNCloseHierarchy(), xxxMNDestroyHandler(), and xxxMNLoop().

#define ValidateProcessSessionId pEProcess   ) 
 

Definition at line 4498 of file userk.h.

Referenced by InitMapSharedSection(), UserCommitSharedMemory(), and xxxCreateThreadInfo().

#define ValidateThreadSessionId pEThread   ) 
 

Definition at line 4499 of file userk.h.

Referenced by InitSystemThread().

#define WEF_ASYNC   0x0004
 

Definition at line 6466 of file userk.h.

Referenced by CreateNotify(), FreeThreadsWinEvents(), UpdateLayeredSprite(), xxxDestroyThreadInfo(), xxxFlushDeferredWindowEvents(), xxxProcessEventMessage(), xxxProcessNotifyWinEvent(), xxxSetConsoleCaretInfo(), and xxxWindowEvent().

#define WEF_DEFERNOTIFY   0x0002
 

Definition at line 6465 of file userk.h.

Referenced by RemoveNotify(), xxxFlushDeferredWindowEvents(), xxxProcessNotifyWinEvent(), and xxxWindowEvent().

#define WEF_POSTED   0x0008
 

Definition at line 6467 of file userk.h.

Referenced by FreeThreadsWinEvents(), xxxProcessEventMessage(), and xxxProcessNotifyWinEvent().

#define WEF_USEPWNDTHREAD   0x0001
 

Definition at line 6464 of file userk.h.

Referenced by NtUserNotifyWinEvent(), xxxActivateThisWindow(), xxxCalcClientRect(), xxxCancelCoolSwitch(), xxxCapture(), xxxDestroyWindow(), xxxEnableSBCtlArrows(), xxxEnableWndSBArrows(), xxxMinMaximize(), xxxMoveSwitchWndHilite(), xxxSBWndProc(), xxxSendChangedMsgs(), xxxSetParent(), xxxSetScrollBar(), xxxShowSwitchWindow(), xxxWindowEvent(), zzzChangeStates(), zzzDrawInvertScrollArea(), and zzzUpdateCursorImage().

#define WHERE_NOONE_CAN_SEE_ME   ((int) -32000)
 

Definition at line 6365 of file userk.h.

Referenced by ParkIcon(), xxxArrangeIconicWindows(), and xxxCalcValidRects().

#define WHT_IGNOREDISABLED   0x00000001
 

Definition at line 4415 of file userk.h.

Referenced by xxxScanSysQueue(), xxxWindowFromPoint(), and xxxWindowHitTest2().

#define WINDOW_CAPTURE   3 /* window-relative capture */
 

Definition at line 3850 of file userk.h.

Referenced by xxxSBTrackInit(), and xxxScanSysQueue().

#define WinFlags   ((WORD)(&__WinFlags))
 

Definition at line 3900 of file userk.h.

#define WMSG_MAGIC_VALUE   0xBABE
 

Definition at line 5563 of file userk.h.

#define WOAHACK_CHECKALTKEYSTATE   1
 

Definition at line 4016 of file userk.h.

Referenced by xxxHandleMenuMessages(), and xxxMNKeyDown().

#define WOAHACK_IGNOREALTKEYDOWN   2
 

Definition at line 4017 of file userk.h.

Referenced by xxxHandleMenuMessages(), and xxxMNKeyDown().

#define WSF_DYING   0x0010
 

Definition at line 2706 of file userk.h.

Referenced by ForceEmptyClipboard(), FreeWindowStation(), and xxxEmptyClipboard().

#define WSF_NOIO   0x0004
 

Definition at line 2704 of file userk.h.

Referenced by _BlockInput(), _GetUserObjectInformation(), CheckAllowForeground(), FreeWindowStation(), InitiateShutdown(), NtUserGetAsyncKeyState(), NtUserOpenInputDesktop(), NtUserSwitchDesktop(), ReorderKeyboardLayouts(), WantImeWindow(), xxxButtonEvent(), xxxCreateDesktop(), xxxCreateDesktop2(), xxxCreateWindowStation(), xxxDesktopThread(), xxxFreeImeKeyboardLayouts(), xxxInternalKeyEventDirect(), xxxLoadKeyboardLayoutEx(), xxxMouseEventDirect(), xxxQueryInformationThread(), xxxResolveDesktop(), xxxSetProcessWindowStation(), xxxSnapWindow(), xxxSwitchDesktop(), xxxTrackMouseMove(), xxxUpdatePerUserSystemParameters(), and zzzSetWindowsHookEx().

#define WSF_OPENLOCK   0x0002
 

Definition at line 2703 of file userk.h.

Referenced by _LockWindowStation(), _UnlockWindowStation(), DestroyProcessInfo(), EndShutdown(), InitiateShutdown(), OpenDesktopCompletion(), and xxxCreateDesktop2().

#define WSF_REALSHUTDOWN   0x0020
 

Definition at line 2708 of file userk.h.

Referenced by InitiateShutdown(), OpenDesktopCompletion(), and xxxQueryInformationThread().

#define WSF_SHUTDOWN   0x0008
 

Definition at line 2705 of file userk.h.

Referenced by _LockWindowStation(), _UnlockWindowStation(), EndShutdown(), InitiateShutdown(), and xxxCreateDesktop2().

#define WSF_SWITCHLOCK   0x0001
 

Definition at line 2702 of file userk.h.

Referenced by _LockWindowStation(), _UnlockWindowStation(), InitiateShutdown(), RemoteDisableScreen(), RemoteRedrawScreen(), xxxDesktopThread(), xxxDoHotKeyStuff(), and xxxSwitchDesktop().

#define XorRgn hrgnResult,
hrgnA,
hrgnB   )     GreCombineRgn(hrgnResult, hrgnA, hrgnB, RGN_XOR)
 

Definition at line 2225 of file userk.h.

#define xxxGetMessage lpmsg,
hwnd,
wMsgMin,
wMsgMax   )     xxxInternalGetMessage(lpmsg, hwnd, wMsgMin, wMsgMax, PM_REMOVE, TRUE)
 

Definition at line 5555 of file userk.h.

Referenced by NtUserGetMessage(), xxxHelpLoop(), and xxxSBTrackLoop().

#define xxxPeekMessage lpmsg,
hwnd,
wMsgMin,
wMsgMax,
wRemoveMsg   )     xxxInternalGetMessage(lpmsg, hwnd, wMsgMin, wMsgMax, wRemoveMsg, FALSE)
 

Definition at line 5553 of file userk.h.

Referenced by NtUserPeekMessage(), xxxDefWindowProc(), xxxDesktopThread(), xxxDragObject(), xxxHelpLoop(), xxxIsDragging(), xxxMNDoubleClick(), xxxMNLoop(), xxxMNRemoveMessage(), xxxMoveSize(), xxxMS_FlushWigglies(), xxxOldNextWindow(), xxxRestoreCsrssThreadDesktop(), xxxSetCsrssThreadDesktop(), and xxxTrackCaptionButton().

#define xxxReceiveMessages pti   )     while ((pti)->pcti->fsWakeBits & QS_SENDMESSAGE) { xxxReceiveMessage((pti)); }
 

Definition at line 4316 of file userk.h.

Referenced by RawInputThread(), xxxInternalGetMessage(), xxxPollAndWaitForSingleObject(), xxxSleepThread(), and xxxUserYield().

 
#define xxxRedrawScreen  ) 
 

Value:

xxxInternalInvalidate(PtiCurrent()->rpdesk->pDeskInfo->spwnd, \ HRGN_FULL, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_ALLCHILDREN)

Definition at line 3863 of file userk.h.

Referenced by SPISetIconMetrics(), xxxSetAndDrawMinMetrics(), xxxSetAndDrawNCMetrics(), xxxSetDeskPattern(), xxxSetSysColors(), and xxxSystemParametersInfo().

#define xxxSetClassLongPtr   xxxSetClassLong
 

Definition at line 6242 of file userk.h.

Referenced by NtUserSetClassLongPtr().

#define xxxSetScrollInfo a,
b,
c,
 )     xxxSetScrollBar((a),(b),(c),(d))
 

Definition at line 5881 of file userk.h.

#define xxxSetWindowLongPtr   xxxSetWindowLong
 

Definition at line 5787 of file userk.h.

Referenced by NtUserSetWindowLongPtr(), and xxxCsDdeInitialize().

 
#define zzzEndDeferWinEventNotify  ) 
 

Value:

UserAssert(IsWinEventNotifyDeferred()); \ UserAssert(FWINABLE() || gnDeferredWinEvents == 0); \ CheckCritIn(); \ if (--gdwDeferWinEvent == 0) { \ if (FWINABLE() && (gpPendingNotifies != NULL)) { \ xxxFlushDeferredWindowEvents(); \ } \ } \ UserAssert(FWINABLE() || gnDeferredWinEvents == 0)

Definition at line 6473 of file userk.h.

Referenced by LockWindowUpdate2(), xxxCapture(), xxxCreateCaret(), xxxCreateDesktop(), xxxCreateWindowStation(), xxxHardErrorControl(), zzzBltValidBits(), zzzCancelJournalling(), zzzInitTask(), zzzReattachThreads(), zzzRecalc2(), zzzSetFMouseMoved(), and zzzShowCursor().

#define zzzWindowEvent event,
pwnd,
idObject,
idChild,
dwFlags   ) 
 

Value:

xxxWindowEvent(event, pwnd, idObject, idChild, \ IsWinEventNotifyDeferred() ? (dwFlags) | WEF_DEFERNOTIFY : (dwFlags))

Definition at line 6494 of file userk.h.

Referenced by xxxCapture(), zzzChangeStates(), zzzDrawInvertScrollArea(), zzzInternalDestroyCaret(), zzzInternalHideCaret(), zzzInternalShowCaret(), zzzSetCaretPos(), and zzzUpdateCursorImage().


Typedef Documentation

typedef struct tagAAS AAS
 

Referenced by xxxDeactivate().

typedef struct tagACCELTABLE ACCELTABLE
 

typedef struct tagASYNCSENDMSG ASYNCSENDMSG
 

typedef struct tagATTACHINFO ATTACHINFO
 

Referenced by zzzAttachThreadInput().

typedef union tagBROADCASTMSG BROADCASTMSG
 

Referenced by xxxSendMessageTimeout().

typedef struct tagBWL BWL
 

Referenced by BuildHwndList().

typedef struct tagCAPTIONCACHE CAPTIONCACHE
 

Referenced by DrawCaptionIcon().

typedef struct tagCHECKPOINT CHECKPOINT
 

Referenced by xxxArrangeIconicWindows().

typedef struct tagCLIP CLIP
 

Referenced by InternalSetClipboardData().

typedef struct tagCLIPDATA CLIPDATA
 

Referenced by _ConvertMemHandle().

typedef struct _CREATESTRUCTEX CREATESTRUCTEX
 

Referenced by MESSAGECALL(), and xxxCreateWindowEx().

typedef struct tagCRITSTACK CRITSTACK
 

typedef struct tagCVR CVR
 

Referenced by _DeferWindowPos(), and DestroySMWP().

typedef struct _CWPRETSTRUCTEX CWPRETSTRUCTEX
 

Referenced by xxxSendMessageTimeout().

typedef struct _CWPSTRUCTEX CWPSTRUCTEX
 

Referenced by xxxSendMessageTimeout().

typedef struct tagDCE DCE
 

Referenced by CreateCacheDC().

typedef struct tagDDECONV DDECONV
 

Referenced by NewConversation().

typedef struct tagDDEIMP DDEIMP
 

Referenced by MESSAGECALL().

typedef struct tagDESKTOP DESKTOP
 

Referenced by Win32UserInitialize(), xxxCreateDesktop2(), and xxxSetDeskPattern().

typedef struct tagDESKTOPVIEW DESKTOPVIEW
 

typedef struct tagDESKWND DESKWND
 

Referenced by LW_RegisterWindows().

typedef struct tagDEVICE_TEMPLATE DEVICE_TEMPLATE
 

typedef struct tagDEVICEINFO DEVICEINFO
 

Referenced by UpdateMouseInfo().

typedef struct tagDISPLAYRESOURCE DISPLAYRESOURCE
 

Referenced by InitLoadResources().

typedef struct tagDRAWICONCB DRAWICONCB
 

typedef struct tagEVENTHOOK EVENTHOOK
 

typedef struct tagFADE FADE
 

typedef DWORD( FNDDERESPONSE)(PDWORD pmsg, LPARAM *plParam, PDDECONV pDdeConv)
 

Definition at line 6166 of file userk.h.

typedef struct tagFREELIST FREELIST
 

Referenced by FreeListAdd().

typedef struct tagGENERIC_DEVICE_INFO GENERIC_DEVICE_INFO
 

typedef struct _HANDLEPAGE HANDLEPAGE
 

Referenced by HMInitHandleTable().

typedef struct tagHARDERRORHANDLER HARDERRORHANDLER
 

typedef struct tagHOOKMSGSTRUCT HOOKMSGSTRUCT
 

Referenced by xxxCallHook2().

typedef struct tagHOTKEY HOTKEY
 

Referenced by _RegisterHotKey().

typedef struct tagHOTKEYSTRUCT HOTKEYSTRUCT
 

Referenced by DWP_SetHotKey().

typedef struct tagINTERSENDMSGEX INTRSENDMSGEX
 

Referenced by _ReplyMessage(), and xxxCallHook2().

typedef struct tagKBDFILE KBDFILE
 

typedef struct tagKBDLANGTOGGLE KBDLANGTOGGLE
 

typedef struct tagKEYBOARD_DEVICE_INFO KEYBOARD_DEVICE_INFO
 

typedef struct tagKL KL
 

typedef struct tagLASTINPUT LASTINPUT
 

typedef struct _LOCK LOCK
 

Referenced by KiIA32InterceptLock().

typedef struct _LOCKRECORD LOCKRECORD
 

Referenced by Idf().

typedef struct tagACCELTABLE * LPACCELTABLE
 

Referenced by _CreateAcceleratorTable().

typedef BITMAPINFOHEADER * LPBMPHEADER
 

Definition at line 4010 of file userk.h.

typedef struct _LPKDRAWSWITCHWND LPKDRAWSWITCHWND
 

typedef struct _MDICREATESTRUCTEX MDICREATESTRUCTEX
 

Referenced by MESSAGECALL().

typedef struct tagMENUANIDC MENUANIDC
 

Referenced by xxxMNAllocMenuState().

typedef struct tagMENUSTATE MENUSTATE
 

Referenced by xxxMNAllocMenuState().

typedef struct tagMENUWND MENUWND
 

Referenced by InitFunctionTables().

typedef struct tagMLIST MLIST
 

typedef struct tagMONITORPOS MONITORPOS
 

Referenced by SnapshotMonitorRects().

typedef struct tagMONITORRECTS MONITORRECTS
 

Referenced by SnapshotMonitorRects().

typedef struct tagMOUSE_DEVICE_INFO MOUSE_DEVICE_INFO
 

typedef struct tagMOUSEEVENT MOUSEEVENT
 

typedef struct _MOVESIZEDATA MOVESIZEDATA
 

Referenced by xxxMoveSize().

typedef VOID(CALLBACK* MSGWAITCALLBACK)(DWORD DeviceType)
 

Definition at line 5571 of file userk.h.

Referenced by xxxDesktopThread(), and xxxMsgWaitForMultipleObjects().

typedef struct tagNOTIFY NOTIFY
 

typedef struct tagASYNCSENDMSG * PASYNCSENDMSG
 

Referenced by CleanEventMessage().

typedef struct tagATTACHINFO * PATTACHINFO
 

typedef BITMAPINFOHEADER* PBMPHEADER
 

Definition at line 4010 of file userk.h.

typedef union tagBROADCASTMSG * PBROADCASTMSG
 

Referenced by xxxSendMessageTimeout().

typedef struct tagBWL * PBWL
 

typedef struct tagCHECKPOINT * PCHECKPOINT
 

Referenced by ParkIcon().

typedef struct tagCLIP * PCLIP
 

typedef struct tagCLIPDATA * PCLIPDATA
 

Referenced by _ConvertMemHandle(), and NtUserCreateLocalMemHandle().

typedef struct _CREATESTRUCTEX * PCREATESTRUCTEX
 

Referenced by xxxDefWindowProc().

typedef struct tagCRITSTACK * PCRITSTACK
 

typedef struct tagCVR * PCVR
 

typedef struct _CWPRETSTRUCTEX * PCWPRETSTRUCTEX
 

Referenced by xxxHkCallHook().

typedef struct _CWPSTRUCTEX * PCWPSTRUCTEX
 

Referenced by xxxHkCallHook().

typedef struct tagDDECONV * PDDECONV
 

Referenced by xxxFreeWindow().

typedef struct tagDDEIMP * PDDEIMP
 

Referenced by MESSAGECALL(), and xxxFreeWindow().

typedef struct tagDESKTOPVIEW * PDESKTOPVIEW
 

typedef struct tagDESKWND * PDESKWND
 

typedef struct tagDEVICE_TEMPLATE * PDEVICE_TEMPLATE
 

Referenced by InputApc().

typedef struct tagDEVICEINFO * PDEVICEINFO
 

typedef struct tagDISPLAYRESOURCE * PDISPLAYRESOURCE
 

typedef struct tagDRAWICONCB * PDRAWICONCB
 

typedef struct tagPERFINFO PERFHANDLEINFO
 

typedef struct tagEVENTHOOK * PEVENTHOOK
 

Definition at line 62 of file userk.h.

typedef struct tagFADE * PFADE
 

typedef FNDDERESPONSE* PFNDDERESPONSE
 

Definition at line 6167 of file userk.h.

typedef struct tagFREELIST * PFREELIST
 

typedef struct tagGENERIC_DEVICE_INFO * PGENERIC_DEVICE_INFO
 

typedef GRAYMENU* PGRAYMENU
 

Definition at line 3281 of file userk.h.

Referenced by xxxDrawMenuItem().

typedef struct _HANDLEPAGE * PHANDLEPAGE
 

typedef struct tagHARDERRORHANDLER * PHARDERRORHANDLER
 

typedef struct tagHOOKMSGSTRUCT * PHOOKMSGSTRUCT
 

Referenced by xxxReceiveMessage().

typedef struct tagHOTKEY * PHOTKEY
 

typedef struct tagHOTKEYSTRUCT * PHOTKEYSTRUCT
 

typedef HWND* PHWND
 

Definition at line 6522 of file userk.h.

Referenced by _RemoveNonTaskWindows(), DrawIconCallBack(), InitSwitchWndInfo(), NextPrevPhwnd(), xxxCheckImeShowStatus(), xxxDesktopRecalc(), xxxMetricsRecalc(), and xxxPaintIconsInSwitchWindow().

typedef struct tagINTERSENDMSGEX * PINTRSENDMSGEX
 

Referenced by xxxSendMessageTimeout().

typedef struct tagKBDFILE * PKBDFILE
 

typedef struct tagKEYBOARD_DEVICE_INFO * PKEYBOARD_DEVICE_INFO
 

typedef struct tagKL * PKL
 

typedef struct tagLASTINPUT PLASTINPUT
 

typedef struct _LOCK * PLOCK
 

typedef struct _MDICREATESTRUCTEX * PMDICREATESTRUCTEX
 

typedef struct tagMENUSTATE * PMENUSTATE
 

Referenced by IsMDIItem(), and LockMenuState().

typedef struct tagMENUWND * PMENUWND
 

Referenced by xxxDesktopThread().

typedef struct tagMLIST * PMLIST
 

Referenced by AdjustForCoalescing().

typedef struct tagMONITORPOS * PMONITORPOS
 

Referenced by SnapshotMonitorRects().

typedef struct tagMONITORRECTS * PMONITORRECTS
 

Referenced by xxxResetDisplayDevice().

typedef struct tagMOUSE_DEVICE_INFO * PMOUSE_DEVICE_INFO
 

typedef struct tagMOUSEEVENT * PMOUSEEVENT
 

Referenced by UnqueueMouseEvent().

typedef struct _MOVESIZEDATA * PMOVESIZEDATA
 

typedef struct tagNOTIFY * PNOTIFY
 

Definition at line 63 of file userk.h.

typedef struct tagPOOLRECORD POOLRECORD
 

typedef struct tagPOPUPMENU POPUPMENU
 

typedef struct tagPOWERSTATE POWERSTATE
 

typedef struct tagPERFINFO * PPERFHANDLEINFO
 

typedef struct tagPOOLRECORD * PPOOLRECORD
 

typedef struct tagPOWERSTATE * PPOWERSTATE
 

typedef struct tagPROFILEVALUEINFO * PPROFILEVALUEINFO
 

Referenced by LoadCPUserPreferences().

typedef struct tagPROFINTINFO * PPROFINTINFO
 

Referenced by FastGetProfileIntsW().

typedef struct tagPUBOBJ * PPUBOBJ
 

Referenced by DestroyProcessInfo().

typedef struct tagPROCESSINFO PROCESSINFO
 

Referenced by ClearAppStarting().

typedef struct tagPROFILEVALUEINFO PROFILEVALUEINFO
 

typedef struct tagPROFINTINFO PROFINTINFO
 

Referenced by xxxSetDeskWallpaper().

typedef * PSCANCODEMAP
 

Referenced by InitScancodeMap().

typedef struct tagSMS* KPTR_MODIFIER PSMS
 

Definition at line 3297 of file userk.h.

Referenced by _ReplyMessage(), AllocSMS(), DoQueuedSyncPaint(), InitiateWin32kCleanup(), InterQueueMsgCleanup(), NtUserQuerySendMessage(), ReceiverDied(), SendMsgCleanup(), Win32kNtUserCleanup(), xxxInterSendMsgEx(), xxxReceiveMessage(), and xxxSleepTask().

typedef struct tagSMWP * PSMWP
 

Referenced by xxxArrangeIconicWindows().

typedef struct tagSVR_INSTANCE_INFO * PSVR_INSTANCE_INFO
 

typedef struct tagSwitchWndInfo * PSWINFO
 

typedef struct tagSWITCHWND * PSWITCHWND
 

Referenced by Getpswi().

typedef struct tagTERMINAL * PTERMINAL
 

typedef struct tagTIMER * PTIMER
 

typedef struct tagTLBLOCK * PTLBLOCK
 

Referenced by xxxImmActivateThreadsLayout().

typedef struct tagTOOLTIPWND * PTOOLTIPWND
 

Referenced by xxxFreeWindow(), and xxxProcessEventMessage().

typedef struct tagPUBOBJ PUBOBJ
 

Referenced by AddPublicObject().

typedef struct tagUSERSTARTUPINFO * PUSERSTARTUPINFO
 

Referenced by xxxCreateThreadInfo().

typedef struct tagW32JOB * PW32JOB
 

Referenced by PrepareForLogoff().

typedef struct tagWin32AllocStats * PWin32AllocStats
 

typedef struct tagWOWPROCESSINFO * PWOWPROCESSINFO
 

Referenced by xxxRegisterUserHungAppHandlers().

typedef struct tagWOWTHREADINFO * PWOWTHREADINFO
 

typedef struct tagXSTATE * PXSTATE
 

Referenced by FindQMsg().

typedef struct tagQ Q
 

typedef struct tagQMSG QMSG
 

Referenced by xxxScanSysQueue().

typedef LRESULT(APIENTRY * SFNSCSENDMESSAGE)(PWND, UINT, WPARAM, LPARAM, ULONG_PTR, PROC, DWORD, PSMS)
 

Definition at line 4078 of file userk.h.

typedef struct tagSMS SMS
 

Referenced by InitSMSLookaside().

typedef struct tagSMWP SMWP
 

Referenced by AsyncWindowPos().

typedef struct tagSPB SPB
 

Referenced by CreateSpb().

typedef struct tagSVR_INSTANCE_INFO SVR_INSTANCE_INFO
 

Referenced by xxxCsDdeInitialize().

typedef struct tagSWITCHWND SWITCHWND
 

Referenced by LW_RegisterWindows().

typedef struct tagSwitchWndInfo SWITCHWNDINFO
 

Referenced by InitSwitchWndInfo().

typedef struct tagSYSCFGICO SYSCFGICO
 

typedef struct tagTDB TDB
 

Referenced by zzzInitTask().

typedef struct tagTERMINAL TERMINAL
 

typedef struct tagTHREADINFO THREADINFO
 

Referenced by SetGlobalCursorLevel().

typedef struct tagTIMER TIMER
 

Referenced by InternalSetTimer().

typedef struct tagTLBLOCK TLBLOCK
 

Referenced by xxxImmActivateThreadsLayout().

typedef struct tagTOOLTIP TOOLTIP
 

Referenced by ZeroTooltip().

typedef struct tagTOOLTIPWND TOOLTIPWND
 

Referenced by LW_RegisterWindows(), and ZeroTooltip().

typedef struct tagUSERSTARTUPINFO USERSTARTUPINFO
 

typedef struct tagW32JOB W32JOB
 

Referenced by CreateW32Job().

typedef struct tagWin32AllocStats Win32AllocStats
 

typedef struct tagWINDOWSTATION WINDOWSTATION
 

Referenced by Win32UserInitialize(), and xxxCreateWindowStation().

typedef struct tagWOWPROCESSINFO WOWPROCESSINFO
 

Referenced by DestroyProcessInfo(), and xxxRegisterUserHungAppHandlers().

typedef struct tagWOWTHREADINFO WOWTHREADINFO
 

Referenced by xxxUserNotifyProcessCreate().

typedef struct tagWPINFO WPINFO
 

typedef struct tagXSTATE XSTATE
 

Referenced by Createpxs().


Function Documentation

VOID _AssertCritIn VOID   ) 
 

VOID _AssertCritInShared VOID   ) 
 

VOID _AssertCritOut VOID   ) 
 

VOID _AssertDeviceInfoListCritIn VOID   ) 
 

VOID _AssertDeviceInfoListCritOut VOID   ) 
 

PSMWP _BeginDeferWindowPos int  cwndGuess  ) 
 

Definition at line 272 of file swp.c.

References AllocateCvr(), tagSMWP::bHandle, DBGCheskSMWP, HMAllocObject(), HMFreeObject(), NULL, PtiCurrent, TRUE, and TYPE_SETWINDOWPOS.

00273 { 00274 PSMWP psmwp; 00275 00276 psmwp = (PSMWP)HMAllocObject(PtiCurrent(), NULL, TYPE_SETWINDOWPOS, sizeof(SMWP)); 00277 if (psmwp == NULL) { 00278 return NULL; 00279 } 00280 00281 if (cwndHint == 0) { 00282 cwndHint = 8; 00283 } 00284 00285 if (!AllocateCvr(psmwp, cwndHint)) { 00286 HMFreeObject(psmwp); 00287 return NULL; 00288 } 00289 00290 psmwp->bHandle = TRUE; 00291 DBGCheskSMWP(psmwp); 00292 return psmwp; 00293 }

BOOL _BlockInput BOOL  fBlockIt  ) 
 

Definition at line 3498 of file ntinput.c.

References tagTHREADINFO::amdesk, tagWINDOWSTATION::dwWSF_Flags, FALSE, gptiBlockInput, grpdeskRitInput, NULL, PtiCurrent, tagTHREADINFO::rpdesk, tagDESKTOP::rpwinstaParent, RtlAreAllAccessesGranted(), tagTHREADINFO::TIF_flags, TIF_INCLEANUP, TRUE, and WSF_NOIO.

Referenced by NtUserBlockInput().

03499 { 03500 PTHREADINFO ptiCurrent; 03501 03502 ptiCurrent = PtiCurrent(); 03503 03504 /* 03505 * The calling thread must be on the active desktop and have journal 03506 * playback access to that desktop if it wants to block input. 03507 * (Unblocking is less restricted) 03508 */ 03509 if (fBlockIt && 03510 (ptiCurrent->rpdesk != grpdeskRitInput || 03511 !RtlAreAllAccessesGranted(ptiCurrent->amdesk, DESKTOP_JOURNALPLAYBACK))) { 03512 03513 RIPNTERR0(STATUS_ACCESS_DENIED, RIP_WARNING, 03514 "BlockInput failed: Non active desktop or access denied"); 03515 return FALSE; 03516 } 03517 UserAssert(!(ptiCurrent->rpdesk->rpwinstaParent->dwWSF_Flags & WSF_NOIO)); 03518 03519 /* 03520 * If we are enabling input 03521 * * Is it disabled? No, then fail the call 03522 * * Is it disabled but we aren't the dude in control? Yes, then 03523 * fail the call. 03524 * If we are disabling input 03525 * * Is it enabled? No, then fail the call 03526 * * Set us up as the dude in control 03527 */ 03528 03529 if (fBlockIt) { 03530 /* 03531 * Is input blocked right now? 03532 */ 03533 if (gptiBlockInput != NULL) { 03534 return FALSE; 03535 } 03536 03537 /* 03538 * Is this thread exiting? If so, fail the call now. User's 03539 * cleanup code won't get a chance to whack this back if so. 03540 */ 03541 if (ptiCurrent->TIF_flags & TIF_INCLEANUP) { 03542 return FALSE; 03543 } 03544 03545 /* 03546 * Set blocking on. 03547 */ 03548 gptiBlockInput = ptiCurrent; 03549 } else { 03550 /* 03551 * Fail if input is not blocked, or blocked by another thread 03552 */ 03553 if (gptiBlockInput != ptiCurrent) { 03554 return FALSE; 03555 } 03556 03557 /* 03558 * This thread was blocking input, so now clear the block. 03559 */ 03560 gptiBlockInput = NULL; 03561 } 03562 03563 return TRUE; 03564 }

NTSTATUS _BuildNameList PWINDOWSTATION  pwinsta,
PNAMELIST  pNameList,
UINT  cbNameList,
PUINT  pcbNeeded
 

Definition at line 1264 of file winsta.c.

References AccessCheckObject(), tagNAMELIST::awchNames, tagNAMELIST::cb, tagNAMELIST::cNames, DesktopMapping, DWORD, FALSE, grpWinStaList, KernelMode, _OBJECT_HEADER_NAME_INFO::Name, NTSTATUS(), NULL, OBJECT_HEADER_TO_NAME_INFO, OBJECT_TO_OBJECT_HEADER, PBYTE, tagWINDOWSTATION::rpdeskList, Status, UINT, and WinStaMapping.

Referenced by NtUserBuildNameList().

01269 { 01270 PBYTE pobj; 01271 PWCHAR ccxpwchDest, ccxpwchMax; 01272 ACCESS_MASK amDesired; 01273 POBJECT_HEADER pHead; 01274 POBJECT_HEADER_NAME_INFO pNameInfo; 01275 DWORD iNext; 01276 NTSTATUS Status; 01277 CONST GENERIC_MAPPING *pGenericMapping; 01278 01279 /* 01280 * Note -- NameList is client-side, and so must be protected. 01281 */ 01282 01283 try { 01284 ccxpNameList->cNames = 0; 01285 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 01286 return STATUS_ACCESS_VIOLATION; 01287 } 01288 01289 ccxpwchDest = ccxpNameList->awchNames; 01290 ccxpwchMax = (PWCHAR)((PBYTE)ccxpNameList + cbNameList - sizeof(WCHAR)); 01291 01292 /* 01293 * If we're enumerating windowstations, pwinsta is NULL. Otherwise, 01294 * we're enumerating desktops. 01295 */ 01296 if (pwinsta == NULL) { 01297 pobj = (PBYTE)grpWinStaList; 01298 amDesired = WINSTA_ENUMERATE; 01299 pGenericMapping = &WinStaMapping; 01300 iNext = FIELD_OFFSET(WINDOWSTATION, rpwinstaNext); 01301 } else { 01302 pobj = (PBYTE)pwinsta->rpdeskList; 01303 amDesired = DESKTOP_ENUMERATE; 01304 pGenericMapping = &DesktopMapping; 01305 iNext = FIELD_OFFSET(DESKTOP, rpdeskNext); 01306 } 01307 01308 Status = STATUS_SUCCESS; 01309 *pcbNeeded = 0; 01310 while (pobj != NULL) { 01311 01312 if (AccessCheckObject(pobj, amDesired, KernelMode, pGenericMapping)) { 01313 01314 /* 01315 * Find object name 01316 */ 01317 pHead = OBJECT_TO_OBJECT_HEADER(pobj); 01318 pNameInfo = OBJECT_HEADER_TO_NAME_INFO(pHead); 01319 01320 /* 01321 * If we run out of space, reset the buffer 01322 * and continue so we can compute the needed 01323 * space. 01324 */ 01325 if ((PWCHAR)((PBYTE)ccxpwchDest + pNameInfo->Name.Length + 01326 sizeof(WCHAR)) >= ccxpwchMax) { 01327 *pcbNeeded += (UINT)((PBYTE)ccxpwchDest - (PBYTE)ccxpNameList); 01328 ccxpwchDest = ccxpNameList->awchNames; 01329 Status = STATUS_BUFFER_TOO_SMALL; 01330 } 01331 01332 try { 01333 ccxpNameList->cNames++; 01334 01335 /* 01336 * Copy and terminate the string 01337 */ 01338 RtlCopyMemory(ccxpwchDest, pNameInfo->Name.Buffer, 01339 pNameInfo->Name.Length); 01340 (PBYTE)ccxpwchDest += pNameInfo->Name.Length; 01341 *ccxpwchDest++ = 0; 01342 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 01343 return STATUS_ACCESS_VIOLATION; 01344 } 01345 } 01346 01347 pobj = *(PBYTE*)(pobj + iNext); 01348 } 01349 01350 /* 01351 * Put an empty string on the end. 01352 */ 01353 try { 01354 *ccxpwchDest++ = 0; 01355 01356 ccxpNameList->cb = (UINT)((PBYTE)ccxpwchDest - (PBYTE)ccxpNameList); 01357 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 01358 return STATUS_ACCESS_VIOLATION; 01359 } 01360 01361 *pcbNeeded += (UINT)((PBYTE)ccxpwchDest - (PBYTE)ccxpNameList); 01362 01363 return Status; 01364 }

NTSTATUS _BuildPropList PWND  pwnd,
PROPSET  aPropSet[],
UINT  cPropMax,
PUINT  pcPropReturned
 

Definition at line 141 of file kernel/winprop.c.

References tagPROPLIST::aprop, _PROPSET::atom, tagPROP::atomKey, DWORD, tagPROP::fs, _PROPSET::hData, tagPROP::hData, tagPROPLIST::iFirstFree, NTSTATUS(), NULL, tagWND::ppropList, PROPF_INTERNAL, Status, and UINT.

Referenced by NtUserBuildPropList().

00146 { 00147 UINT i; 00148 PPROPLIST ppropList; 00149 PPROP pProp; 00150 DWORD iRetCnt = 0; // The number of Props returned 00151 DWORD iProp = 0; 00152 PPROPSET pPropSetLast = (aPropSet + cPropMax - 1); 00153 NTSTATUS Status; 00154 00155 /* 00156 * If the Window does not have a property list then we're done 00157 */ 00158 ppropList = pwnd->ppropList; 00159 if (ppropList == NULL) { 00160 *pcPropNeeded = 0; 00161 return STATUS_SUCCESS; 00162 } 00163 00164 /* 00165 * For each element in the property list enumerate it. 00166 * (only if it is not internal!) 00167 */ 00168 Status = STATUS_SUCCESS; 00169 pProp = ppropList->aprop; 00170 for (i = ppropList->iFirstFree; i > 0; i--) { 00171 00172 /* 00173 * if we run out of space in shared memory return 00174 * STATUS_BUFFER_TOO_SMALL 00175 */ 00176 if (&aPropSet[iProp] > pPropSetLast) { 00177 00178 /* 00179 * Reset to the beginning of the output 00180 * buffer so we can continue and compute 00181 * the needed space. 00182 */ 00183 iProp = 0; 00184 Status = STATUS_BUFFER_TOO_SMALL; 00185 } 00186 00187 if (!(pProp->fs & PROPF_INTERNAL)) { 00188 aPropSet[iProp].hData = pProp->hData; 00189 aPropSet[iProp].atom = pProp->atomKey; 00190 iProp++; 00191 iRetCnt++; 00192 } 00193 pProp++; 00194 } 00195 00196 /* 00197 * Return the number of PROPLISTs given back to the client 00198 */ 00199 00200 *pcPropNeeded = iRetCnt; 00201 00202 return Status; 00203 }

BOOL _CallMsgFilter LPMSG  lpMsg,
int  nCode
 

Definition at line 1210 of file hooks.c.

References BOOL, FALSE, IsHooked, PtiCurrent, TRUE, WHF_MSGFILTER, WHF_SYSMSGFILTER, and xxxCallHook().

Referenced by NtUserCallMsgFilter(), xxxMNLoop(), xxxMoveSize(), xxxOldNextWindow(), xxxSBTrackLoop(), and xxxSendMenuSelect().

01213 { 01214 PTHREADINFO pti; 01215 01216 pti = PtiCurrent(); 01217 01218 /* 01219 * First call WH_SYSMSGFILTER. If it returns non-zero, don't 01220 * bother calling WH_MSGFILTER, just return TRUE. Otherwise 01221 * return what WH_MSGFILTER gives us. 01222 */ 01223 if (IsHooked(pti, WHF_SYSMSGFILTER) && xxxCallHook(nCode, 0, (LPARAM)pmsg, 01224 WH_SYSMSGFILTER)) { 01225 return TRUE; 01226 } 01227 01228 if (IsHooked(pti, WHF_MSGFILTER)) { 01229 return (BOOL)xxxCallHook(nCode, 0, (LPARAM)pmsg, WH_MSGFILTER); 01230 } 01231 01232 return FALSE; 01233 }

DWORD _CheckMenuItem PMENU  pMenu,
UINT  wIDCheckItem,
UINT  wCheck
 

Definition at line 546 of file mnsys.c.

References DWORD, MenuItemState(), NULL, and UINT.

Referenced by NtUserCheckMenuItem().

00550 { 00551 return MenuItemState(pMenu, wIDCheckItem, wCheck, (UINT)MF_CHECKED, NULL); 00552 }

PWND _ChildWindowFromPointEx PWND  pwndParent,
POINT  pt,
UINT  i
 

Definition at line 47 of file winwhere.c.

References tagWND::hrgnClip, LayerHitTest(), NULL, PtInRect(), PWNDDESKTOP, tagWND::rcClient, tagWND::rcWindow, tagWND::spwndChild, tagWND::spwndNext, TestWF, WEFLAYERED, WEFTRANSPARENT, WFDISABLED, and WFVISIBLE.

Referenced by NtUserChildWindowFromPointEx(), and xxxQueryDropObject().

00051 { 00052 if (pwnd != PWNDDESKTOP(pwnd)) { 00053 #ifdef USE_MIRRORING 00054 if (TestWF(pwnd, WEFLAYOUTRTL)) { 00055 pt.x = pwnd->rcClient.right - pt.x; 00056 } else 00057 #endif 00058 { 00059 pt.x += pwnd->rcClient.left; 00060 } 00061 pt.y += pwnd->rcClient.top; 00062 } 00063 00064 // _ClientToScreen(pwndParent, (LPPOINT)&pt); 00065 00066 if (PtInRect(&pwnd->rcClient, pt)) { 00067 00068 PWND pwndChild; 00069 00070 if (pwnd->hrgnClip != NULL) { 00071 if (!GrePtInRegion(pwnd->hrgnClip, pt.x, pt.y)) 00072 return NULL; 00073 } 00074 00075 if (TestWF(pwnd, WEFLAYERED)) { 00076 if (!LayerHitTest(pwnd, pt)) 00077 return NULL; 00078 } 00079 00080 /* 00081 * Enumerate the children, skipping disabled and invisible ones 00082 * if so desired. Still doesn't work for WS_EX_TRANSPARENT windows. 00083 */ 00084 for (pwndChild = pwnd->spwndChild; 00085 pwndChild; 00086 pwndChild = pwndChild->spwndNext) { 00087 00088 /* 00089 * Skip windows as desired. 00090 */ 00091 if ((uFlags & CWP_SKIPINVISIBLE) && !TestWF(pwndChild, WFVISIBLE)) 00092 continue; 00093 00094 if ((uFlags & CWP_SKIPDISABLED) && TestWF(pwndChild, WFDISABLED)) 00095 continue; 00096 00097 if ((uFlags & CWP_SKIPTRANSPARENT) && TestWF(pwndChild, WEFTRANSPARENT)) 00098 continue; 00099 00100 if (PtInRect(&pwndChild->rcWindow, pt)) { 00101 00102 if (pwndChild->hrgnClip != NULL) { 00103 if (!GrePtInRegion(pwndChild->hrgnClip, pt.x, pt.y)) 00104 continue; 00105 } 00106 if (TestWF(pwndChild, WEFLAYERED)) { 00107 if (!LayerHitTest(pwndChild, pt)) 00108 continue; 00109 } 00110 return(pwndChild); 00111 } 00112 } 00113 00114 return pwnd; 00115 } 00116 00117 return NULL; 00118 }

BOOL _CloseWindowStation HWINSTA  hwinsta  ) 
 

Definition at line 1055 of file winsta.c.

References _GetProcessWindowStation(), BOOL, FALSE, and NT_SUCCESS.

Referenced by NtUserCloseWindowStation(), and NtUserResolveDesktop().

01057 { 01058 HWINSTA hwinstaCurrent; 01059 01060 _GetProcessWindowStation(&hwinstaCurrent); 01061 if (hwinsta != hwinstaCurrent) { 01062 return NT_SUCCESS(ZwClose(hwinsta)); 01063 } 01064 return FALSE; 01065 }

HBITMAP _ConvertBitmap HBITMAP  hBitmap  ) 
 

HANDLE _ConvertMemHandle LPBYTE  lpData,
int  cbData
 

Definition at line 88 of file ntuser/kernel/clipbrd.c.

References tagCLIPDATA::abData, tagCLIPDATA::cbData, CLIPDATA, FALSE, HMAllocObject(), HMFreeObject(), NULL, PCLIPDATA, PtoHq, and TYPE_CLIPDATA.

Referenced by MungeClipData(), NtUserConvertMemHandle(), xxxGetDummyDib(), and xxxGetDummyDibV5().

00091 { 00092 PCLIPDATA pClipData; 00093 00094 pClipData = HMAllocObject(NULL, 00095 NULL, 00096 TYPE_CLIPDATA, 00097 FIELD_OFFSET(CLIPDATA, abData) + cbData); 00098 00099 if (pClipData == NULL) 00100 return NULL; 00101 00102 pClipData->cbData = cbData; 00103 00104 try { 00105 RtlCopyMemory(&pClipData->abData, ccxlpData, cbData); 00106 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00107 HMFreeObject(pClipData); 00108 return NULL; 00109 } 00110 00111 return PtoHq(pClipData); 00112 }

HANDLE _CreateAcceleratorTable LPACCEL  ,
int 
 

Definition at line 217 of file mnaccel.c.

References tagACCELTABLE::accel, APIENTRY, tagACCELTABLE::cAccel, FALSE, FLASTKEY, HMAllocObject(), HMFreeObject(), LPACCELTABLE, NULL, PtiCurrent, and TYPE_ACCELTABLE.

Referenced by NtUserCreateAcceleratorTable().

00220 { 00221 LPACCELTABLE pat; 00222 int size; 00223 00224 size = cbAccel + sizeof(ACCELTABLE) - sizeof(ACCEL); 00225 00226 pat = (LPACCELTABLE)HMAllocObject(PtiCurrent(), NULL, TYPE_ACCELTABLE, size); 00227 if (pat == NULL) 00228 return NULL; 00229 00230 try { 00231 RtlCopyMemory(pat->accel, ccxpaccel, cbAccel); 00232 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00233 HMFreeObject(pat); 00234 return NULL; 00235 } 00236 00237 pat->cAccel = cbAccel / sizeof(ACCEL); 00238 pat->accel[pat->cAccel - 1].fVirt |= FLASTKEY; 00239 00240 return pat; 00241 }

PCURSOR _CreateCursor HANDLE  hModule,
int  iXhotspot,
int  iYhotspot,
int  iWidth,
int  iHeight,
LPBYTE  lpANDplane,
LPBYTE  lpXORplane
 

HCURSOR _CreateEmptyCursorObject BOOL  fPublic  ) 
 

Definition at line 26 of file loadbits.c.

References ACON, HMAllocObject(), max, NULL, PtiCurrent, PtoH, TIF_CSRSSTHREAD, TIF_SYSTEMTHREAD, and TYPE_CURSOR.

00028 { 00029 PCURSOR pcurT; 00030 00031 /* 00032 * Create the cursor object. 00033 */ 00034 pcurT = (PCURSOR)HMAllocObject(PtiCurrent(), 00035 NULL, 00036 TYPE_CURSOR, 00037 max(sizeof(CURSOR), 00038 sizeof(ACON))); 00039 00040 if (fPublic && (pcurT != NULL)) { 00041 pcurT->head.ppi = NULL; 00042 UserAssert(PtiCurrent()->TIF_flags & (TIF_CSRSSTHREAD | TIF_SYSTEMTHREAD)); 00043 } 00044 00045 return (HCURSOR)PtoH(pcurT); 00046 }

PICON _CreateIcon HANDLE  hModule,
int  iWidth,
int  iHeight,
BYTE  bPlanes,
BYTE  bBitsPixel,
LPBYTE  lpANDplane,
LPBYTE  lpXORplane
 

PICON _CreateIconIndirect PICONINFO  piconinfo  ) 
 

BOOL _DdeGetQualityOfService PWND  pwndClient,
PWND  pwndServer,
PSECURITY_QUALITY_OF_SERVICE  pqos
 

Definition at line 2218 of file kernel/ddetrack.c.

References _GetProp(), BOOL, FALSE, FindDdeConv(), GETPWNDPPI, gqosDefault, NULL, tagDDECONV::pddei, PROP_QOS, PROPF_INTERNAL, tagDDEIMP::qos, and TRUE.

Referenced by NtUserDdeGetQualityOfService().

02222 { 02223 PDDECONV pDdeConv; 02224 PSECURITY_QUALITY_OF_SERVICE pqosClient; 02225 02226 if (pwndServer == NULL) { 02227 /* 02228 * Special case to support DDEML-RAW conversations that need to get 02229 * the QOS prior to initiation completion. 02230 */ 02231 pqosClient = _GetProp(pwndClient, PROP_QOS, PROPF_INTERNAL); 02232 if (pqosClient == NULL) { 02233 *pqos = gqosDefault; 02234 } else { 02235 *pqos = *pqosClient; 02236 } 02237 return(TRUE); 02238 } 02239 if (GETPWNDPPI(pwndClient) == GETPWNDPPI(pwndServer)) { 02240 *pqos = gqosDefault; 02241 return(TRUE); 02242 } 02243 pDdeConv = FindDdeConv(pwndClient, pwndServer); 02244 if (pDdeConv == NULL) { 02245 return(FALSE); 02246 } 02247 if (pDdeConv->pddei == NULL) { 02248 return(FALSE); 02249 } 02250 *pqos = pDdeConv->pddei->qos; 02251 return(TRUE); 02252 }

BOOL _DdeSetQualityOfService PWND  pwndClient,
CONST PSECURITY_QUALITY_OF_SERVICE  pqosNew,
PSECURITY_QUALITY_OF_SERVICE  pqosOld
 

Definition at line 2176 of file kernel/ddetrack.c.

References BOOL, FALSE, gqosDefault, InternalRemoveProp(), InternalSetProp(), NULL, PROP_QOS, PROPF_INTERNAL, and TRUE.

Referenced by NtUserDdeSetQualityOfService().

02180 { 02181 PSECURITY_QUALITY_OF_SERVICE pqosUser; 02182 PSECURITY_QUALITY_OF_SERVICE pqosAlloc = NULL; 02183 BOOL fRet; 02184 02185 /* 02186 * ASSUME: calling process is owner of pwndClient - ensured in thunk. 02187 */ 02188 pqosUser = (PSECURITY_QUALITY_OF_SERVICE)InternalRemoveProp(pwndClient, 02189 PROP_QOS, PROPF_INTERNAL); 02190 if (pqosUser == NULL) { 02191 if (RtlEqualMemory(pqosNew, &gqosDefault, sizeof(SECURITY_QUALITY_OF_SERVICE))) { 02192 return(TRUE); // no PROP_QOS property implies default QOS 02193 } 02194 pqosAlloc = (PSECURITY_QUALITY_OF_SERVICE)UserAllocPoolZInit( 02195 sizeof(SECURITY_QUALITY_OF_SERVICE), TAG_DDE2); 02196 if (pqosAlloc == NULL) { 02197 return(FALSE); // memory allocation failure - can't change from default 02198 } 02199 pqosUser = pqosAlloc; 02200 } 02201 *pqosOld = *pqosUser; 02202 *pqosUser = *pqosNew; 02203 02204 fRet = InternalSetProp(pwndClient, PROP_QOS, pqosUser, PROPF_INTERNAL); 02205 if ((fRet == FALSE) && (pqosAlloc != NULL)) { 02206 UserFreePool(pqosAlloc); 02207 } 02208 02209 return fRet; 02210 }

PSMWP _DeferWindowPos PSMWP  psmwp,
PWND  pwnd,
PWND  pwndInsertAfter,
int  x,
int  y,
int  cx,
int  cy,
UINT  rgf
 

Definition at line 365 of file swp.c.

References tagSMWP::acvr, tagSMWP::ccvr, tagSMWP::ccvrAlloc, CVR, cy, DBGCheskSMWP, DestroySMWP(), DWORD, tagCVR::hrgnClip, tagCVR::hrgnInterMonitor, HWInsertAfter(), HWq, NULL, tagCVR::pos, ppos, TestWF, and WFBOTTOMMOST.

Referenced by AddSelfAndOwnees(), NtUserDeferWindowPos(), xxxArrangeIconicWindows(), xxxDesktopRecalc(), xxxMinMaximize(), xxxSetWindowPos(), and xxxSetWindowRgn().

00374 { 00375 PWINDOWPOS ppos; 00376 PCVR pcvr; 00377 00378 DBGCheskSMWP(psmwp); 00379 if (psmwp->ccvr + 1 > psmwp->ccvrAlloc) { 00380 00381 /* 00382 * Make space for 4 more windows 00383 */ 00384 DWORD dwNewAlloc = psmwp->ccvrAlloc + 4; 00385 00386 pcvr = (PCVR)UserReAllocPoolWithQuota(psmwp->acvr, 00387 psmwp->ccvrAlloc * sizeof(CVR), 00388 sizeof(CVR) * dwNewAlloc, 00389 TAG_SWP); 00390 00391 if (pcvr == NULL) { 00392 DestroySMWP(psmwp); 00393 return NULL; 00394 } 00395 00396 psmwp->acvr = pcvr; 00397 psmwp->ccvrAlloc = dwNewAlloc; 00398 } 00399 00400 pcvr = &psmwp->acvr[psmwp->ccvr++]; 00401 ppos = &pcvr->pos; 00402 00403 ppos->hwnd = HWq(pwnd); 00404 ppos->hwndInsertAfter = (TestWF(pwnd, WFBOTTOMMOST)) ? 00405 HWND_BOTTOM : HWInsertAfter(pwndInsertAfter); 00406 ppos->x = x; 00407 ppos->y = y; 00408 ppos->cx = cx; 00409 ppos->cy = cy; 00410 ppos->flags = flags; 00411 00412 pcvr->hrgnClip = NULL; 00413 pcvr->hrgnInterMonitor = NULL; 00414 00415 return psmwp; 00416 }

BOOL _DeregisterShellHookWindow PWND  pwnd  ) 
 

Definition at line 3655 of file rare.c.

References BOOL, ClrWF, FALSE, tagWND::head, NULL, tagDESKTOPINFO::pvwplShellHook, TRUE, VWPLRemove(), and WFSHELLHOOKWND.

Referenced by xxxFreeWindow().

03655 { 03656 PDESKTOPINFO pdeskinfo; 03657 03658 if (pwnd->head.rpdesk == NULL) 03659 return FALSE; 03660 03661 pdeskinfo = pwnd->head.rpdesk->pDeskInfo; 03662 03663 if (VWPLRemove(&(pdeskinfo->pvwplShellHook), pwnd)) { 03664 ClrWF(pwnd, WFSHELLHOOKWND); 03665 } 03666 return TRUE; 03667 }

BOOL _DestroyCursor PCURSOR  ,
DWORD 
 

Definition at line 539 of file loadbits.c.

References BOOL, CCACHEDCAPTIONS, CURSOR_ALWAYSDESTROY, CURSOR_CALLFROMCLIENT, CURSOR_THREADCLEANUP, CURSORF_ACON, CURSORF_FROMRESOURCE, CURSORF_LRSHARED, CURSORF_SECRET, DestroyAniIcon(), DestroyEmptyCursorObject(), FALSE, gcachedCaptions, GETPPI, HMMarkObjectDestroy(), NULL, pacon, PpiCurrent, tagCAPTIONCACHE::spcursor, TRUE, Unlock, and UserDeleteAtom().

Referenced by _SetCursorContents(), DestroyAniIcon(), DestroyClassSmIcon(), DestroyUnlockedCursor(), DestroyWindowSmIcon(), NtUserDestroyCursor(), xxxDWP_SetIcon(), and zzzSetSystemImage().

00542 { 00543 PPROCESSINFO ppi; 00544 PPROCESSINFO ppiCursor; 00545 int i; 00546 extern BOOL DestroyAniIcon(PACON pacon); 00547 00548 if (pcur == NULL) { 00549 UserAssert(FALSE); 00550 return(TRUE); 00551 } 00552 ppi = PpiCurrent(); 00553 ppiCursor = GETPPI(pcur); 00554 00555 /* 00556 * Remove this icon from the caption icon cache. 00557 */ 00558 for (i = 0; i < CCACHEDCAPTIONS; i++) { 00559 if (gcachedCaptions[i].spcursor == pcur) { 00560 Unlock( &(gcachedCaptions[i].spcursor) ); 00561 } 00562 } 00563 00564 /* 00565 * First step in destroying an cursor 00566 */ 00567 switch (cmdDestroy) { 00568 00569 case CURSOR_ALWAYSDESTROY: 00570 00571 /* 00572 * Always destroy? then don't do any checking... 00573 */ 00574 break; 00575 00576 case CURSOR_CALLFROMCLIENT: 00577 00578 /* 00579 * Can't destroy public cursors/icons. 00580 */ 00581 if (ppiCursor == NULL) 00582 /* 00583 * Fake success if its a resource loaded icon because 00584 * this is how win95 responded. 00585 */ 00586 return !!(pcur->CURSORF_flags & CURSORF_FROMRESOURCE); 00587 00588 /* 00589 * If this cursor was loaded from a resource, don't free it till the 00590 * process exits. This is the way we stay compatible with win3.0's 00591 * cursors which were actually resources. Resources under win3 have 00592 * reference counting and other "features" like handle values that 00593 * never change. Read more in the comment in 00594 * ServerLoadCreateCursorIcon(). 00595 */ 00596 if (pcur->CURSORF_flags & (CURSORF_LRSHARED | CURSORF_SECRET)) { 00597 return TRUE; 00598 } 00599 00600 /* 00601 * One thread can't destroy the objects created by another. 00602 */ 00603 if (ppiCursor != ppi) { 00604 RIPERR0(ERROR_DESTROY_OBJECT_OF_OTHER_THREAD, RIP_ERROR, "DestroyCursor: cursor belongs to another process"); 00605 return FALSE; 00606 } 00607 00608 /* 00609 * fall through. 00610 */ 00611 00612 case CURSOR_THREADCLEANUP: 00613 00614 /* 00615 * Don't destroy public objects either (pretend it worked though). 00616 */ 00617 if (ppiCursor == NULL) 00618 return TRUE; 00619 break; 00620 } 00621 00622 /* 00623 * First mark the object for destruction. This tells the locking code that 00624 * we want to destroy this object when the lock count goes to 0. If this 00625 * returns FALSE, we can't destroy the object yet. 00626 */ 00627 if (!HMMarkObjectDestroy((PHEAD)pcur)) 00628 return FALSE; 00629 00630 if (pcur->strName.Length != 0) { 00631 UserFreePool((LPSTR)pcur->strName.Buffer); 00632 } 00633 00634 if (pcur->atomModName != 0) { 00635 UserDeleteAtom(pcur->atomModName); 00636 } 00637 00638 /* 00639 * If this is an ACON call its special routine to destroy it. 00640 */ 00641 if (pcur->CURSORF_flags & CURSORF_ACON) { 00642 DestroyAniIcon((PACON)pcur); 00643 } else { 00644 if (pcur->hbmMask != NULL) { 00645 GreDeleteObject(pcur->hbmMask); 00646 GreDecQuotaCount((PW32PROCESS)(pcur->head.ppi)); 00647 } 00648 if (pcur->hbmColor != NULL) { 00649 GreDeleteObject(pcur->hbmColor); 00650 GreDecQuotaCount((PW32PROCESS)(pcur->head.ppi)); 00651 } 00652 if (pcur->hbmAlpha != NULL) { 00653 /* 00654 * This is an internal GDI object, and so not covered by quota. 00655 */ 00656 GreDeleteObject(pcur->hbmAlpha); 00657 } 00658 } 00659 00660 /* 00661 * Ok to destroy... Free the handle (which will free the object and the 00662 * handle). 00663 */ 00664 DestroyEmptyCursorObject(pcur); 00665 return TRUE; 00666 }

BOOL _DestroyMenu PMENU  pMenu  ) 
 

Definition at line 27 of file mndstry.c.

References BOOL, tagMENU::cItems, DesktopFree, FALSE, tagMENU::head, HMFreeObject(), HMMarkObjectDestroy(), LockDesktop, MNFreeItem(), NULL, PtiCurrent, tagMENU::rgItems, tagMENU::spwndNotify, TRUE, Unlock, and UnlockDesktop.

Referenced by MNFreeItem(), NtUserDestroyMenu(), xxxDesktopThread(), xxxFreeWindow(), xxxGetSystemMenu(), xxxLoadSysDesktopMenu(), xxxSetLPITEMInfo(), xxxSetSystemMenu(), and xxxUpdatePerUserSystemParameters().

00029 { 00030 PITEM pItem; 00031 int i; 00032 PDESKTOP rpdeskLock; 00033 00034 if (pMenu == NULL) 00035 return FALSE; 00036 00037 /* 00038 * If the object is locked, just mark it for destroy and don't 00039 * free it yet. 00040 */ 00041 if (!HMMarkObjectDestroy(pMenu)) 00042 return TRUE; 00043 00044 /* 00045 * Go down the item list and free the items 00046 */ 00047 pItem = pMenu->rgItems; 00048 for (i = pMenu->cItems; i--; ++pItem) 00049 MNFreeItem(pMenu, pItem, TRUE); 00050 00051 /* 00052 * free the menu items 00053 */ 00054 if (pMenu->rgItems) 00055 DesktopFree(pMenu->head.rpdesk, pMenu->rgItems); 00056 00057 /* 00058 * Because menus are the only objects on the desktop owned 00059 * by the process and process cleanup is done after thread 00060 * cleanup, this may be the last reference to the desktop. 00061 * We must lock the desktop before unlocking 00062 * the parent desktop reference and freeing the menu to 00063 * ensure that the desktop will not be freed until after 00064 * the menu is freed. Don't use static locks because 00065 * the pti for this thread will not be valid during 00066 * process cleanup. 00067 */ 00068 rpdeskLock = NULL; 00069 LockDesktop(&rpdeskLock, pMenu->head.rpdesk, LDL_FN_DESTROYMENU, (ULONG_PTR)PtiCurrent()); 00070 00071 /* 00072 * Unlock all menu objects. 00073 */ 00074 Unlock(&pMenu->spwndNotify); 00075 00076 HMFreeObject(pMenu); 00077 00078 UnlockDesktop(&rpdeskLock, LDU_FN_DESTROYMENU, (ULONG_PTR)PtiCurrent()); 00079 00080 return TRUE; 00081 }

BOOL _DrawIconEx HDC  hdc,
int  x,
int  y,
PCURSOR  pcur,
int  cx,
int  cy,
UINT  istepIfAniCur,
HBRUSH  hbrush,
UINT  diFlags
 

Definition at line 93 of file wmicon.c.

References BltIcon(), BOOL, CURSORF_ACON, cy, FALSE, GetCHeight, GetCWidth, ghdcMem, NULL, and TRUE.

Referenced by DrawCaptionIcon(), NtUserDrawIconEx(), xxxPaintIconsInSwitchWindow(), and xxxRealDrawMenuItem().

00103 { 00104 BOOL fSuccess = FALSE; 00105 00106 /* 00107 * If this is an animated cursor, just grab the ith frame and use it 00108 * for drawing. 00109 */ 00110 if (pcur->CURSORF_flags & CURSORF_ACON) { 00111 00112 if ((int)istepIfAniCur >= ((PACON)pcur)->cicur) { 00113 RIPERR0(ERROR_INVALID_PARAMETER, RIP_WARNING, "DrawIconEx, icon step out of range."); 00114 goto Done; 00115 } 00116 00117 pcur = ((PACON)pcur)->aspcur[((PACON)pcur)->aicur[istepIfAniCur]]; 00118 } 00119 00120 /* 00121 * Setup defaults. 00122 */ 00123 cx = GetCWidth(cx, diFlags, pcur->cx); 00124 cy = GetCHeight(cy, diFlags, (pcur->cy / 2)); 00125 00126 if (hbr) { 00127 00128 HBITMAP hbmpT = NULL; 00129 HDC hdcT; 00130 HBITMAP hbmpOld; 00131 POLYPATBLT PolyData; 00132 00133 if (hdcT = GreCreateCompatibleDC(hdc)) { 00134 00135 if (hbmpT = GreCreateCompatibleBitmap(hdc, cx, cy)) { 00136 POINT pt; 00137 BOOL bRet; 00138 00139 hbmpOld = GreSelectBitmap(hdcT, hbmpT); 00140 00141 /* 00142 * Set new dc's brush origin in same relative 00143 * location as passed-in dc's. 00144 */ 00145 bRet = GreGetBrushOrg(hdc, &pt); 00146 /* 00147 * Bug 292396 - joejo 00148 * Stop overactive asserts by replacing with RIPMSG. 00149 */ 00150 if (bRet != TRUE) { 00151 RIPMSG0(RIP_WARNING, "DrawIconEx, GreGetBrushOrg failed."); 00152 } 00153 00154 bRet = GreSetBrushOrg(hdcT, pt.x, pt.y, NULL); 00155 if (bRet != TRUE) { 00156 RIPMSG0(RIP_WARNING, "DrawIconEx, GreSetBrushOrg failed."); 00157 } 00158 00159 PolyData.x = 0; 00160 PolyData.y = 0; 00161 PolyData.cx = cx; 00162 PolyData.cy = cy; 00163 PolyData.BrClr.hbr = hbr; 00164 00165 bRet = GrePolyPatBlt(hdcT, PATCOPY, &PolyData, 1, PPB_BRUSH); 00166 if (bRet != TRUE) { 00167 RIPMSG0(RIP_WARNING, "DrawIconEx, GrePolyPatBlt failed."); 00168 } 00169 00170 /* 00171 * Output the image to the temporary memoryDC. 00172 */ 00173 BltIcon(hdcT, 0, 0, cx, cy, ghdcMem, pcur, TRUE, SRCAND); 00174 BltIcon(hdcT, 0, 0, cx, cy, ghdcMem, pcur, FALSE, SRCINVERT); 00175 00176 /* 00177 * Blt the bitmap to the original DC. 00178 */ 00179 GreBitBlt(hdc, x, y, cx, cy, hdcT, 0, 0, SRCCOPY, (COLORREF)-1); 00180 00181 GreSelectBitmap(hdcT, hbmpOld); 00182 00183 bRet = GreDeleteObject(hbmpT); 00184 if (bRet != TRUE) { 00185 RIPMSG0(RIP_WARNING, "DrawIconEx, GreDeleteObject failed. Possible Leak"); 00186 } 00187 00188 fSuccess = TRUE; 00189 } 00190 00191 GreDeleteDC(hdcT); 00192 } 00193 00194 } else { 00195 00196 if (diFlags & DI_MASK) { 00197 00198 BltIcon(hdc, 00199 x, 00200 y, 00201 cx, 00202 cy, 00203 ghdcMem, 00204 pcur, 00205 TRUE, 00206 ((diFlags & DI_IMAGE) ? SRCAND : SRCCOPY)); 00207 } 00208 00209 if (diFlags & DI_IMAGE) { 00210 00211 BltIcon(hdc, 00212 x, 00213 y, 00214 cx, 00215 cy, 00216 ghdcMem, 00217 pcur, 00218 FALSE, 00219 ((diFlags & DI_MASK) ? SRCINVERT : SRCCOPY)); 00220 } 00221 00222 fSuccess = TRUE; 00223 } 00224 00225 Done: 00226 00227 return fSuccess; 00228 }

UINT _EnumClipboardFormats UINT  fmt  ) 
 

Definition at line 597 of file ntuser/kernel/clipbrd.c.

References CheckClipboardAccess(), tagWINDOWSTATION::cNumClipFormats, FindClipFormat(), tagCLIP::fmt, NULL, tagWINDOWSTATION::pClipBase, tagWINDOWSTATION::ptiClipLock, PtiCurrent, and UINT.

00599 { 00600 PWINDOWSTATION pwinsta; 00601 UINT fmtRet; 00602 00603 if ((pwinsta = CheckClipboardAccess()) == NULL) 00604 return 0; 00605 00606 /* 00607 * If the current thread doesn't have the clipboard open or if there 00608 * is no clipboard, return 0 for no formats. 00609 */ 00610 if (pwinsta->ptiClipLock != PtiCurrent()) { 00611 RIPERR0(ERROR_CLIPBOARD_NOT_OPEN, RIP_WARNING, "EnumClipboardFormat: clipboard not open"); 00612 return 0; 00613 } 00614 00615 fmtRet = 0; 00616 00617 if (pwinsta->pClipBase != NULL) { 00618 00619 PCLIP pClip; 00620 00621 /* 00622 * Find the next clipboard format. If the format is 0, start from 00623 * the beginning. 00624 */ 00625 if (fmt != 0) { 00626 00627 /* 00628 * Find the next clipboard format. NOTE that this routine locks 00629 * the clipboard handle and updates pwinsta->pClipBase with the 00630 * starting address of the clipboard. 00631 */ 00632 if ((pClip = FindClipFormat(pwinsta, fmt)) != NULL) 00633 pClip++; 00634 00635 } else { 00636 pClip = pwinsta->pClipBase; 00637 } 00638 00639 /* 00640 * Find the new format before unlocking the clipboard. 00641 */ 00642 if (pClip && (pClip < &pwinsta->pClipBase[pwinsta->cNumClipFormats])) { 00643 00644 fmtRet = pClip->fmt; 00645 } 00646 } 00647 00648 /* 00649 * Return the new clipboard format. 00650 */ 00651 return fmtRet; 00652 }

int _ExcludeUpdateRgn HDC  hdc,
PWND  pwnd
 

Definition at line 1462 of file update.c.

References CopyRgn, FALSE, ghrgnInv1, gpDispInfo, HRGN_FULL, tagDISPLAYINFO::hrgnScreen, tagWND::hrgnUpdate, NULL, and SubtractRgn.

Referenced by NtUserExcludeUpdateRgn(), and UT_InvertCaret().

01465 { 01466 POINT pt; 01467 01468 if (pwnd->hrgnUpdate == NULL) { 01469 01470 RECT rc; 01471 01472 /* 01473 * Pass FALSE for fXForm since &rc isn't used. 01474 */ 01475 return GreGetClipBox(hdc, &rc, FALSE); 01476 01477 } else if (pwnd->hrgnUpdate == HRGN_FULL) { 01478 01479 return GreIntersectClipRect(hdc, 0, 0, 0, 0); 01480 01481 } else { 01482 01483 /* 01484 * If no clip rgn exists, then subtract from a device-sized clip rgn. 01485 * (GetClipRgn returns clip rgn in screen coordinates). 01486 */ 01487 GreGetDCOrg(hdc, &pt); 01488 if (GreGetRandomRgn(hdc, ghrgnInv1, 1) != 1) { 01489 CopyRgn(ghrgnInv1, gpDispInfo->hrgnScreen); 01490 } else { 01491 01492 /* 01493 * Gets returned in dc coords - translate to screen. 01494 */ 01495 GreOffsetRgn(ghrgnInv1, pt.x, pt.y); 01496 } 01497 01498 SubtractRgn(ghrgnInv1, ghrgnInv1, pwnd->hrgnUpdate); 01499 01500 /* 01501 * Map to dc coords before select 01502 */ 01503 GreOffsetRgn(ghrgnInv1, -pt.x, -pt.y); 01504 01505 return GreExtSelectClipRgn(hdc, ghrgnInv1, RGN_COPY); 01506 } 01507 }

PCURSOR _FindExistingCursorIcon ATOM  atomModName,
PUNICODE_STRING  pstrResName,
PCURSOR  pcurSrc,
PCURSORFIND  pcfSearch
 

Definition at line 357 of file loadbits.c.

References gpcurFirst, NULL, PpiCurrent, tagCURSORFIND::rt, and SearchIconCache().

Referenced by NtUserFindExistingCursorIcon().

00362 { 00363 PCURSOR pcurT = NULL; 00364 00365 /* 00366 * If rt is zero we're doing an indirect create, so matching with 00367 * a previously loaded cursor/icon would be inappropriate. 00368 */ 00369 if (pcfSearch->rt && atomModName) { 00370 00371 pcurT = SearchIconCache(PpiCurrent()->pCursorCache, 00372 atomModName, 00373 cczpstrResName, 00374 pcurSrc, 00375 pcfSearch); 00376 if (pcurT == NULL) { 00377 pcurT = SearchIconCache(gpcurFirst, 00378 atomModName, 00379 cczpstrResName, 00380 pcurSrc, 00381 pcfSearch); 00382 } 00383 } 00384 00385 return pcurT; 00386 }

PWND _FindWindowEx PWND  pwndParent,
PWND  pwndChild,
LPCWSTR  pszClass,
LPCWSTR  pszName,
DWORD  dwType
 

Definition at line 524 of file kernel/winmgr.c.

References _GetDesktopWindow(), _GetMessageWindow(), tagCLS::atomClassName, BOOL, _LARGE_UNICODE_STRING::Buffer, BuildHwndList(), BWL_ENUMLIST, FALSE, FindClassAtom, FreeHwndList(), FW_16BIT, FW_32BIT, FW_BOTH, GETPTI, _LARGE_UNICODE_STRING::Length, NULL, tagWND::pcls, RevalidateHwnd, tagBWL::rghwnd, tagWND::spwndChild, tagWND::spwndNext, tagWND::spwndParent, tagWND::strName, szNull, TIF_16BIT, and TRUE.

Referenced by NtUserFindWindowEx().

00530 { 00531 /* 00532 * Note that the Class and Name pointers are client-side addresses. 00533 */ 00534 00535 PBWL pbwl; 00536 HWND *phwnd; 00537 PWND pwnd; 00538 WORD atomClass = 0; 00539 LPCWSTR lpName; 00540 BOOL fTryMessage = FALSE; 00541 00542 if (ccxlpszClass != NULL) { 00543 00544 atomClass = FindClassAtom(ccxlpszClass); 00545 00546 if (atomClass == 0) { 00547 return NULL; 00548 } 00549 } 00550 00551 /* 00552 * Setup parent window 00553 */ 00554 if (!pwndParent) { 00555 pwndParent = _GetDesktopWindow(); 00556 /* 00557 * If we are starting from the root and no child window 00558 * was specified, then check the message window tree too 00559 * in case we don't find it on the desktop tree. 00560 */ 00561 00562 if (!pwndChild) 00563 fTryMessage = TRUE; 00564 } 00565 00566 TryAgain: 00567 /* 00568 * Setup first child 00569 */ 00570 if (!pwndChild) { 00571 pwndChild = pwndParent->spwndChild; 00572 } else { 00573 if (pwndChild->spwndParent != pwndParent) { 00574 RIPMSG0(RIP_WARNING, 00575 "FindWindowEx: Child window doesn't have proper parent"); 00576 return NULL; 00577 } 00578 00579 pwndChild = pwndChild->spwndNext; 00580 } 00581 00582 /* 00583 * Generate a list of top level windows. 00584 */ 00585 if ((pbwl = BuildHwndList(pwndChild, BWL_ENUMLIST, NULL)) == NULL) { 00586 return NULL; 00587 } 00588 00589 /* 00590 * Set pwnd to NULL in case the window list is empty. 00591 */ 00592 pwnd = NULL; 00593 00594 try { 00595 for (phwnd = pbwl->rghwnd; *phwnd != (HWND)1; phwnd++) { 00596 00597 /* 00598 * Validate this hwnd since we left the critsec earlier (below 00599 * in the loop we send a message! 00600 */ 00601 if ((pwnd = RevalidateHwnd(*phwnd)) == NULL) 00602 continue; 00603 00604 /* 00605 * make sure this window is of the right type 00606 */ 00607 if (dwType != FW_BOTH) { 00608 if (((dwType == FW_16BIT) && !(GETPTI(pwnd)->TIF_flags & TIF_16BIT)) || 00609 ((dwType == FW_32BIT) && (GETPTI(pwnd)->TIF_flags & TIF_16BIT))) 00610 continue; 00611 } 00612 00613 /* 00614 * If the class is specified and doesn't match, skip this window 00615 */ 00616 if (!atomClass || (atomClass == pwnd->pcls->atomClassName)) { 00617 if (!ccxlpszName) 00618 break; 00619 00620 if (pwnd->strName.Length) { 00621 lpName = pwnd->strName.Buffer; 00622 } else { 00623 lpName = szNull; 00624 } 00625 00626 /* 00627 * Is the text the same? If so, return with this window! 00628 */ 00629 if (_wcsicmp(ccxlpszName, lpName) == 0) 00630 break; 00631 } 00632 00633 /* 00634 * The window did not match. 00635 */ 00636 pwnd = NULL; 00637 } 00638 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00639 pwnd = NULL; 00640 } 00641 00642 FreeHwndList(pbwl); 00643 00644 if (!pwnd && fTryMessage) { 00645 fTryMessage = FALSE; 00646 pwndParent = _GetMessageWindow(); 00647 pwndChild = NULL; 00648 goto TryAgain; 00649 } 00650 00651 return ((*phwnd == (HWND)1) ? NULL : pwnd); 00652 }

BOOL _GetAltTabInfo int  iItem,
PALTTABINFO  pati,
LPWSTR  lpszItemText,
UINT  cchItemText,
BOOL  bAnsi
 

Definition at line 2635 of file tmswitch.c.

References _LARGE_UNICODE_STRING::Buffer, CXICONSLOT, CYICONSLOT, FALSE, Getpswi(), gspwndAltTab, tagSwitchWndInfo::iCurCol, tagSwitchWndInfo::iCurRow, tagSwitchWndInfo::iNoOfColumns, tagSwitchWndInfo::iNoOfRows, tagSwitchWndInfo::iTotalTasks, _LARGE_UNICODE_STRING::Length, NULL, NullTerminateString(), tagSwitchWndInfo::pbwl, tagSwitchWndInfo::ptFirstRowStart, RevalidateHwnd, tagBWL::rghwnd, RtlUnicodeToMultiByteN(), tagWND::strName, TextCopy(), and TRUE.

Referenced by NtUserGetAltTabInfo().

02641 { 02642 PSWINFO pswCurrent; 02643 02644 if (!gspwndAltTab || ((pswCurrent = Getpswi(gspwndAltTab)) == NULL)) { 02645 RIPERR0(ERROR_NOT_FOUND, RIP_WARNING, "no Alt-Tab window"); 02646 return FALSE; 02647 } 02648 02649 /* 02650 * Fill in general information 02651 */ 02652 pati->cItems = pswCurrent->iTotalTasks; 02653 pati->cColumns = pswCurrent->iNoOfColumns; 02654 pati->cRows = pswCurrent->iNoOfRows; 02655 02656 pati->iColFocus = pswCurrent->iCurCol; 02657 pati->iRowFocus = pswCurrent->iCurRow; 02658 02659 pati->cxItem = CXICONSLOT; 02660 pati->cyItem = CYICONSLOT; 02661 pati->ptStart = pswCurrent->ptFirstRowStart; 02662 02663 /* 02664 * Fill in specific information if asked. 02665 */ 02666 if (cchItemText && (iItem >= 0)) { 02667 PWND pwndCur; 02668 02669 pwndCur = NULL; 02670 02671 try { 02672 if ((iItem < pswCurrent->iTotalTasks) && 02673 (pwndCur = RevalidateHwnd(pswCurrent->pbwl->rghwnd[iItem]))) { 02674 if (bAnsi) { 02675 LPSTR ccxpszItemText = (LPSTR)ccxpwszItemText; 02676 ULONG cch; 02677 RtlUnicodeToMultiByteN(ccxpszItemText, cchItemText - 1, 02678 &cch, pwndCur->strName.Buffer, pwndCur->strName.Length); 02679 ccxpszItemText[cch] = '\0'; 02680 } else { 02681 TextCopy(&pwndCur->strName, ccxpwszItemText, cchItemText); 02682 } 02683 } else { 02684 // no such item 02685 NullTerminateString(ccxpwszItemText, bAnsi); 02686 } 02687 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 02688 return FALSE; 02689 } 02690 } 02691 02692 return TRUE; 02693 }

PWND _GetAncestor PWND  pwnd,
UINT  gaFlags
 

Definition at line 460 of file winable2.c.

References _GetParent(), NULL, PWNDDESKTOP, PWNDMESSAGE, and tagWND::spwndParent.

Referenced by NtUserGetAncestor().

00461 { 00462 PWND pwndParent; 00463 00464 /* 00465 * If we start with the desktop return NULL. 00466 */ 00467 if (pwnd == PWNDDESKTOP(pwnd)) 00468 return NULL; 00469 00470 switch (gaFlags) { 00471 case GA_PARENT: 00472 pwnd = pwnd->spwndParent; 00473 break; 00474 00475 case GA_ROOT: 00476 while ((pwnd->spwndParent != PWNDDESKTOP(pwnd)) && 00477 (pwnd->spwndParent != PWNDMESSAGE(pwnd))) { 00478 pwnd = pwnd->spwndParent; 00479 } 00480 break; 00481 00482 case GA_ROOTOWNER: 00483 while (pwndParent = _GetParent(pwnd)) { 00484 pwnd = pwndParent; 00485 } 00486 break; 00487 } 00488 00489 return pwnd; 00490 }

SHORT _GetAsyncKeyState int  vk  ) 
 

Definition at line 87 of file keyboard.c.

References ClearAsyncKeyStateRecentDown, CVKKEYSTATE, SHORT, TestAsyncKeyStateDown, TestAsyncKeyStateRecentDown, and UINT.

Referenced by NtUserGetAsyncKeyState(), xxxMNOpenHierarchy(), xxxNextWindow(), xxxPaintIconsInSwitchWindow(), xxxPaintSwitchWindow(), and xxxShowSwitchWindow().

00089 { 00090 SHORT sKeyState; 00091 00092 if ((UINT)vk >= CVKKEYSTATE) { 00093 RIPERR1(ERROR_INVALID_PARAMETER, 00094 RIP_WARNING, 00095 "Invalid parameter \"vk\" (%ld) to _GetAsyncKeyState", 00096 vk); 00097 00098 return 0; 00099 } 00100 00101 /* 00102 * See if this key went down since the last time state for it was 00103 * read. Clear the flag if so. 00104 */ 00105 sKeyState = 0; 00106 if (TestAsyncKeyStateRecentDown(vk)) { 00107 ClearAsyncKeyStateRecentDown(vk); 00108 sKeyState = 1; 00109 } 00110 00111 /* 00112 * Set the keyup/down bit. 00113 */ 00114 if (TestAsyncKeyStateDown(vk)) 00115 sKeyState |= 0x8000; 00116 00117 /* 00118 * Don't return the toggle bit since it's a new bit and might 00119 * cause compatibility problems. 00120 */ 00121 return sKeyState; 00122 }

DWORD _GetChangeBits VOID   ) 
 

ATOM _GetClassInfoEx HANDLE  hModule,
LPCWSTR  lpszClassName,
LPWNDCLASSEX  pwc,
LPWSTR *  ppszMenuName,
BOOL  bAnsi
 

Definition at line 678 of file class.c.

References tagCLS::atomClassName, CheckCritIn, CPD_ANSI_TO_UNICODE, CPD_CLASS, CPD_UNICODE_TO_ANSI, CSF_ANSIPROC, tagCLS::CSF_flags, CSF_SERVERSIDEPROC, CURSORF_SECRET, tagTHREADINFO::dwExpWinVer, DWORD, FindClassAtom, tagCLS::fnid, GetClassPtr(), GetCPD(), hModClient, hModuleWin, tagCLS::lpszClientAnsiMenuName, tagCLS::lpszClientUnicodeMenuName, MapClientNeuterToClientPfn(), MapServerToClientPfn(), NULL, tagTHREADINFO::ppi, PtiCurrent, PtoH, TIF_16BIT, tagTHREADINFO::TIF_flags, and VER40.

Referenced by NtUserGetClassInfo().

00684 { 00685 PCLS pcls; 00686 PPCLS ppcls; 00687 ATOM atomT; 00688 PTHREADINFO ptiCurrent; 00689 DWORD dwCPDType = 0; 00690 00691 CheckCritIn(); 00692 00693 ptiCurrent = PtiCurrent(); 00694 00695 /* 00696 * These are done first so if we don't find the class, and therefore 00697 * fail, the return thank won't try to copy back these (nonexistant) 00698 * strings. 00699 */ 00700 pwc->lpszMenuName = NULL; 00701 pwc->lpszClassName = NULL; 00702 00703 /* 00704 * Is this class registered as a private class? 00705 */ 00706 00707 /* 00708 * bradg (3/9/95) - Must first check to see if an ATOM has been passed. 00709 */ 00710 atomT = FindClassAtom(ccxlpszClassName); 00711 00712 /* 00713 * Windows 3.1 does not perform the class search with 00714 * a null hModule. If an application supplies a NULL 00715 * hModule, they search on hModuleWin instead. 00716 */ 00717 00718 if (hModule == NULL) 00719 hModule = hModClient; 00720 00721 ppcls = GetClassPtr(atomT, ptiCurrent->ppi, hModule); 00722 00723 00724 if (ppcls == NULL) { 00725 RIPERR0(ERROR_CLASS_DOES_NOT_EXIST, RIP_VERBOSE, "GetClassInfo: Class does not exist"); 00726 return 0; 00727 } 00728 00729 pcls = *ppcls; 00730 00731 /* 00732 * Copy all the fields common to CLS and WNDCLASS structures except 00733 * the lpszMenuName and lpszClassName which will be filled in by the 00734 * client-side piece of GetClassInfo. 00735 */ 00736 00737 /* 00738 * Return public bits only 00739 */ 00740 pwc->style = pcls->style & CS_VALID; 00741 00742 /* 00743 * Corel Depth 6.0 calls GetClassInfo (COMBOBOX) and registers a class 00744 * using the same name and style bits. This works OK on Win95 because 00745 * their "system" (combo, edit, etc) classes are not CS_GLOBALCLASS 00746 * So we got to mask this bit out for our classes 00747 */ 00748 00749 /* 00750 * Bug 17998. If the app is 32bit and WinVer is less than 4.0 don't mask 00751 * out the CS_GLOBALCLASS bit. 00752 */ 00753 00754 if ( (pcls->fnid != 0) && 00755 ((LOWORD(ptiCurrent->dwExpWinVer) >= VER40) || (ptiCurrent->TIF_flags & TIF_16BIT)) ) { 00756 pwc->style &= ~CS_GLOBALCLASS; 00757 } 00758 00759 00760 pwc->cbClsExtra = pcls->cbclsExtra; 00761 pwc->cbWndExtra = pcls->cbwndExtra; 00762 00763 /* 00764 * Stop 32-bit apps from inadvertantly using hModuleWin as their hInstance 00765 * when they register a window class. FritzS 00766 */ 00767 00768 if (LOWORD(ptiCurrent->dwExpWinVer) >= VER40) { 00769 /* 00770 * This is actually, Win95 behavior -- the USER.EXE hModule gets thunked to NULL on 00771 * the way out of the 16->32 bit thunk. Note -- if we ever need to support 16-bit 00772 * 4.0 apps (shudder), this may need to change. FritzS 00773 */ 00774 if (hModule == hModClient) { 00775 pwc->hInstance = NULL; 00776 } else { 00777 pwc->hInstance = hModule; 00778 } 00779 } else { 00780 /* 00781 * Win NT 3.1/3.51 returned the hInstance from the class. 00782 * Note that this is incompatible with Win 3.1. WoW has hacks for 16-bit apps. 00783 */ 00784 00785 if ((pcls->hModule == hModuleWin) || (pcls->hModule == hModClient)) { 00786 pwc->hInstance = hModClient; 00787 } else { 00788 pwc->hInstance = pcls->hModule; 00789 } 00790 } 00791 00792 pwc->hIcon = PtoH(pcls->spicn); 00793 pwc->hCursor = PtoH(pcls->spcur); 00794 pwc->hbrBackground = pcls->hbrBackground; 00795 00796 /* 00797 * Need to hide the small icon if it's USER created 00798 */ 00799 if (pcls->spicnSm && (pcls->spicnSm->CURSORF_flags & CURSORF_SECRET)) 00800 pwc->hIconSm = NULL; 00801 else 00802 pwc->hIconSm = PtoH(pcls->spicnSm); 00803 00804 /* 00805 * If its a server proc then map it to a client proc. If not we may have 00806 * to create a CPD. 00807 */ 00808 if (pcls->CSF_flags & CSF_SERVERSIDEPROC) { 00809 pwc->lpfnWndProc = 00810 (WNDPROC)MapServerToClientPfn((ULONG_PTR)pcls->lpfnWndProc, bAnsi); 00811 } else { 00812 pwc->lpfnWndProc = (WNDPROC)MapClientNeuterToClientPfn(pcls, 0, bAnsi); 00813 00814 /* 00815 * If the client mapping didn't change the window proc then see if 00816 * we need a callproc handle. 00817 */ 00818 if (pwc->lpfnWndProc == (WNDPROC)pcls->lpfnWndProc) { 00819 /* 00820 * Need to return a CallProc handle if there is an Ansi/Unicode mismatch 00821 */ 00822 if (bAnsi != !!(pcls->CSF_flags & CSF_ANSIPROC)) { 00823 dwCPDType |= bAnsi ? CPD_ANSI_TO_UNICODE : CPD_UNICODE_TO_ANSI; 00824 } 00825 } 00826 } 00827 00828 if (dwCPDType) { 00829 ULONG_PTR dwCPD; 00830 00831 dwCPD = GetCPD(pcls, dwCPDType | CPD_CLASS, (ULONG_PTR)pwc->lpfnWndProc); 00832 00833 if (dwCPD) { 00834 pwc->lpfnWndProc = (WNDPROC)dwCPD; 00835 } else { 00836 RIPMSG0(RIP_WARNING, "GetClassInfo unable to alloc CPD returning handle\n"); 00837 } 00838 } 00839 00840 /* 00841 * Return the stashed pointer to the client-side menu name string. 00842 */ 00843 if (bAnsi) { 00844 *ppszMenuName = (LPWSTR)pcls->lpszClientAnsiMenuName; 00845 } else { 00846 *ppszMenuName = pcls->lpszClientUnicodeMenuName; 00847 } 00848 return pcls->atomClassName; 00849 }

BOOL _GetComboBoxInfo PWND  pwnd,
PCOMBOBOXINFO  ptbi
 

Definition at line 778 of file winable2.c.

References tagCLS::atomClassName, tagSERVERINFO::atomSysClass, BOOL, tagCBox::buttonrc, tagCBox::CBoxStyle, DATAALIGN, tagCBox::editrc, FALSE, tagCBox::fButtonPressed, FNID_COMBOBOX, FNID_COMBOLISTBOX, GETFNID, GETPTI, gpsi, HEAD, HW, HWCCX, ICLS_COMBOBOX, ICLS_COMBOLISTBOX, KeAttachProcess(), KeDetachProcess(), NULL, tagLBIV::pcbox, tagWND::pcls, PpiCurrent, ProbeForRead, tagCBox::spwnd, tagCBox::spwndEdit, tagCBox::spwndList, and TRUE.

Referenced by NtUserGetComboBoxInfo().

00779 { 00780 PCLS pcls; 00781 COMBOBOXINFO cbi = { 00782 sizeof cbi, 00783 }; 00784 BOOL fOtherProcess; 00785 BOOL bRetval = FALSE; 00786 WORD wWindowType = 0; 00787 00788 /* 00789 * Make sure it is a combobox or a dropdown 00790 */ 00791 pcls = pwnd->pcls; 00792 00793 00794 if ((GETFNID(pwnd) == FNID_COMBOBOX) || 00795 (pcls->atomClassName == gpsi->atomSysClass[ICLS_COMBOBOX])) { 00796 wWindowType = FNID_COMBOBOX; 00797 } else if ((GETFNID(pwnd) == FNID_COMBOLISTBOX) || 00798 (pcls->atomClassName == gpsi->atomSysClass[ICLS_COMBOLISTBOX])) { 00799 wWindowType = FNID_COMBOLISTBOX; 00800 } else { 00801 RIPERR1(ERROR_WINDOW_NOT_COMBOBOX, RIP_WARNING, 00802 "pwnd %#p not a combobox or dropdown", pwnd); 00803 return FALSE; 00804 } 00805 00806 /* 00807 * Validate combo structure 00808 */ 00809 if (pcbi->cbSize != sizeof(COMBOBOXINFO)) { 00810 RIPERR1(ERROR_INVALID_PARAMETER, RIP_WARNING, "COMBOBOXINFO.cbSize %d is wrong", pcbi->cbSize); 00811 return FALSE; 00812 } 00813 00814 if (fOtherProcess = (GETPTI(pwnd)->ppi != PpiCurrent())) { 00815 KeAttachProcess(&GETPTI(pwnd)->ppi->Process->Pcb); 00816 } 00817 00818 try { 00819 PCBOX ccxPcboxSnap; 00820 PWND ccxPwndSnap; 00821 HWND ccxHwndSnap; 00822 00823 /* 00824 * Snap and probe the CBOX structure, since it is client side. 00825 */ 00826 if (wWindowType == FNID_COMBOBOX) { 00827 ccxPcboxSnap = ((PCOMBOWND)pwnd)->pcbox; 00828 } else { 00829 PLBIV ccxPlbSnap; 00830 /* 00831 * If this is a listbox, we must snap and probe the LBIV structure 00832 * in order to get to the CBOX structure. 00833 */ 00834 ccxPlbSnap = ((PLBWND)pwnd)->pLBIV; 00835 if (!ccxPlbSnap) { 00836 goto errorexit; 00837 } 00838 ProbeForRead(ccxPlbSnap, sizeof(LBIV), DATAALIGN); 00839 ccxPcboxSnap = ccxPlbSnap->pcbox; 00840 } 00841 if (!ccxPcboxSnap) { 00842 goto errorexit; 00843 } 00844 ProbeForRead(ccxPcboxSnap, sizeof(CBOX), DATAALIGN); 00845 00846 /* 00847 * Get the combo information now 00848 */ 00849 00850 /* 00851 * Snap and probe the client side pointer to the Combo window 00852 */ 00853 ccxPwndSnap = ccxPcboxSnap->spwnd; 00854 ProbeForRead(ccxPwndSnap, sizeof(HEAD), DATAALIGN); 00855 cbi.hwndCombo = HWCCX(ccxPwndSnap); 00856 00857 /* 00858 * Snap & probe the client side pointer to the Edit window. 00859 * To compare spwndEdit and pwnd, we should compare handles 00860 * since spwndEdit is a client-side address and pwnd is a 00861 * kernel-mode address, 00862 */ 00863 00864 ccxPwndSnap = ccxPcboxSnap->spwndEdit; 00865 /* 00866 * If combobox is not fully initialized and spwndEdit is NULL, 00867 * we should fail. 00868 */ 00869 ProbeForRead(ccxPwndSnap, sizeof(HEAD), DATAALIGN); 00870 ccxHwndSnap = HWCCX(ccxPwndSnap); 00871 if (ccxHwndSnap == HW(pwnd)) { 00872 /* 00873 * ComboBox doesn't have Edit control. 00874 */ 00875 cbi.hwndItem = NULL; 00876 } else { 00877 cbi.hwndItem = HWCCX(ccxPwndSnap); 00878 } 00879 00880 /* 00881 * Snap and probe the client side pointer to the List window 00882 */ 00883 ccxPwndSnap = ccxPcboxSnap->spwndList; 00884 /* 00885 * If combobox is not fully initialized and spwndList is NULL, 00886 * we should fail. 00887 */ 00888 ProbeForRead(ccxPwndSnap, sizeof(HEAD), DATAALIGN); 00889 cbi.hwndList = HWCCX(ccxPwndSnap); 00890 00891 /* 00892 * Snap the rest of the combo information. 00893 * We don't need to probe any of these, since there are no more indirections. 00894 */ 00895 cbi.rcItem = ccxPcboxSnap->editrc; 00896 cbi.rcButton = ccxPcboxSnap->buttonrc; 00897 00898 /* 00899 * Button state 00900 */ 00901 cbi.stateButton = 0; 00902 if (ccxPcboxSnap->CBoxStyle == CBS_SIMPLE) { 00903 cbi.stateButton |= STATE_SYSTEM_INVISIBLE; 00904 } 00905 if (ccxPcboxSnap->fButtonPressed) { 00906 cbi.stateButton |= STATE_SYSTEM_PRESSED; 00907 } 00908 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00909 goto errorexit; 00910 } 00911 00912 *pcbi = cbi; 00913 bRetval = TRUE; 00914 00915 errorexit: 00916 if (fOtherProcess) { 00917 KeDetachProcess(); 00918 } 00919 return bRetval; 00920 }

PCURSOR _GetCursorFrameInfo PCURSOR  pcur,
int  iFrame,
PJIF  pjifRate,
LPINT  pccur
 

Definition at line 183 of file kernel/acons.c.

References CURSORF_ACON, NULL, and pacon.

Referenced by NtUserGetCursorFrameInfo().

00188 { 00189 /* 00190 * If this is only a single cursor (not an ACON) just return it and 00191 * a frame count of 1. 00192 */ 00193 if (!(pcur->CURSORF_flags & CURSORF_ACON)) { 00194 *pccur = 1; 00195 *pjifRate = 0; 00196 return pcur; 00197 } 00198 00199 /* 00200 * Return the useful cursor information for the specified frame 00201 * of the ACON. 00202 */ 00203 #define pacon ((PACON)pcur) 00204 if (iFrame < 0 || iFrame >= pacon->cicur) 00205 return NULL; 00206 00207 *pccur = pacon->cicur; 00208 *pjifRate = pacon->ajifRate[iFrame]; 00209 00210 return pacon->aspcur[pacon->aicur[iFrame]]; 00211 #undef pacon 00212 }

BOOL _GetCursorPos LPPOINT   ) 
 

HDC _GetDC PWND  pwnd  ) 
 

Definition at line 148 of file dc.c.

References _GetDCEx(), NULL, tagDESKTOP::pDeskInfo, PtiCurrent, and tagDESKTOPINFO::spwnd.

Referenced by NtUserGetDC(), UT_InvertCaret(), xxxDesktopWndProc(), xxxMNInvertItem(), and xxxRealizeDesktop().

00150 { 00151 /* 00152 * Special case for NULL: For backward compatibility we want to return 00153 * a window DC for the desktop that does not exclude its children. 00154 */ 00155 if (pwnd == NULL) { 00156 00157 PDESKTOP pdesk = PtiCurrent()->rpdesk; 00158 00159 if (pdesk) { 00160 return _GetDCEx(pdesk->pDeskInfo->spwnd, 00161 NULL, 00162 DCX_WINDOW | DCX_CACHE); 00163 } 00164 00165 /* 00166 * The thread has no desktop. Fail the call. 00167 */ 00168 return NULL; 00169 } 00170 00171 return _GetDCEx(pwnd, NULL, DCX_USESTYLE); 00172 }

HDC _GetDCEx PWND  pwnd,
HRGN  hrgnClip,
DWORD  flags
 

Definition at line 608 of file dc.c.

References _GetProp(), BOOL, CalcVisRgn(), CFCLASSDC, CFOWNDC, CFPARENTDC, CopyRgn, CreateCacheDC(), CreateEmptyRgn(), CreateEmptyRgnPublic(), tagDCE::DCX_flags, DecrementFreeDCECount(), DelayedDestroyCacheDC(), DeleteHrgnClip(), DWORD, FALSE, GetLayeredWindow(), GETPTI, ghrgnGDC, gpDispInfo, tagDCE::hdc, tagDISPLAYINFO::hDev, HRGN_FULL, HRGN_SPECIAL_LAST, tagDCE::hrgnClip, tagDCE::hrgnClipPublic, IntersectRgn, IsVisible(), NULL, tagWND::pcls, tagCLS::pdce, tagDISPLAYINFO::pdceFirst, tagDCE::pdceNext, tagDCE::pMonitor, PpiCurrent, PROP_LAYER, PtiCurrent, tagDCE::ptiOwner, tagDCE::pwndClip, tagDCE::pwndOrg, tagWND::rcWindow, ResetOrg(), SetEmptyRgn(), SpbCheckDce(), tagWND::spwndParent, SubtractRgn, TestCF, TestWF, TRUE, UpdateLayeredSprite(), WFCLIPCHILDREN, WFCLIPSIBLINGS, WFMINIMIZED, WFVISIBLE, and WFWIN31COMPAT.

Referenced by _GetDC(), _GetWindowDC(), _UserSoundSentryWorker(), DrawSwitchWndHilite(), GetTooltipDC(), MNDrawArrow(), MNDrawFullNC(), NtUserGetDCEx(), StopFade(), UserGetDesktopDC(), xxxBeginPaint(), xxxDefWindowProc(), xxxDrawAnimatedRects(), xxxDrawDragRect(), xxxDrawMenuBarUnderlines(), xxxDWP_DoNCActivate(), xxxHotTrackMenu(), xxxMenuWindowProc(), xxxMNCompute(), xxxMoveSwitchWndHilite(), xxxPaintIconsInSwitchWindow(), xxxPaintSwitchWindow(), xxxRedrawHungWindow(), xxxRedrawHungWindowFrame(), xxxScrollWindowEx(), xxxSendEraseBkgnd(), and xxxTrackCaptionButton().

00612 { 00613 HRGN hrgn; 00614 HDC hdcMatch; 00615 PWND pwndClip; 00616 PWND pwndOrg; 00617 PDCE pdce; 00618 PDCE *ppdce; 00619 PDCE *ppdceNotInUse; 00620 DWORD DCX_flagsMatch; 00621 BOOL bpwndOrgVisible; 00622 PWND pwndLayer; 00623 HBITMAP hbmLayer; 00624 BOOL fVisRgnError = FALSE; 00625 00626 /* 00627 * Lock the device while we're playing with visrgns. 00628 */ 00629 GreLockDisplay(gpDispInfo->hDev); 00630 00631 if (pwnd == NULL) 00632 pwnd = PtiCurrent()->rpdesk->pDeskInfo->spwnd; 00633 00634 hdcMatch = NULL; 00635 pwndOrg = pwndClip = pwnd; 00636 00637 bpwndOrgVisible = IsVisible(pwndOrg); 00638 00639 if (PpiCurrent()->W32PF_Flags & W32PF_OWNDCCLEANUP) { 00640 DelayedDestroyCacheDC(); 00641 } 00642 00643 /* 00644 * If necessary, compute DCX flags from window style. 00645 */ 00646 if (DCX_flags & DCX_USESTYLE) { 00647 00648 DCX_flags &= ~(DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN | DCX_PARENTCLIP); 00649 00650 if (!(DCX_flags & DCX_WINDOW)) { 00651 00652 if (TestCF(pwndOrg, CFPARENTDC)) 00653 DCX_flags |= DCX_PARENTCLIP; 00654 00655 /* 00656 * If the DCX_CACHE flag is present, override OWNDC/CLASSDC. 00657 * Otherwise, calculate from appropriate style bits. 00658 */ 00659 if (!(DCX_flags & DCX_CACHE) && !TestCF(pwndOrg, CFOWNDC)) { 00660 if (TestCF(pwndOrg, CFCLASSDC)) { 00661 /* 00662 * Look for a non-cache entry that matches hdc... 00663 */ 00664 if (pwndOrg->pcls->pdce != NULL) { 00665 hdcMatch = pwndOrg->pcls->pdce->hdc; 00666 } 00667 } else { 00668 DCX_flags |= DCX_CACHE; 00669 } 00670 } 00671 00672 if (TestWF(pwndOrg, WFCLIPCHILDREN)) 00673 DCX_flags |= DCX_CLIPCHILDREN; 00674 00675 if (TestWF(pwndOrg, WFCLIPSIBLINGS)) 00676 DCX_flags |= DCX_CLIPSIBLINGS; 00677 00678 /* 00679 * Minimized windows never exclude their children. 00680 */ 00681 if (TestWF(pwndOrg, WFMINIMIZED)) { 00682 DCX_flags &= ~DCX_CLIPCHILDREN; 00683 00684 if (pwndOrg->pcls->spicn) 00685 DCX_flags |= DCX_CACHE; 00686 } 00687 00688 } else { 00689 if (TestWF(pwndClip, WFCLIPSIBLINGS)) 00690 DCX_flags |= DCX_CLIPSIBLINGS; 00691 00692 DCX_flags |= DCX_CACHE; 00693 00694 /* 00695 * Window DCs never exclude children. 00696 */ 00697 } 00698 } 00699 00700 /* 00701 * Deal with all the Win 3.0-compatible clipping rules: 00702 * 00703 * DCX_NOCLIPCHILDREN overrides: 00704 * DCX_PARENTCLIP/CS_OWNDC/CS_CLASSDC 00705 * DCX_PARENTCLIP overrides: 00706 * DCX_CLIPSIBLINGS/DCX_CLIPCHILDREN/CS_OWNDC/CS_CLASSDC 00707 */ 00708 if (DCX_flags & DCX_NOCLIPCHILDREN) { 00709 DCX_flags &= ~(DCX_PARENTCLIP | DCX_CLIPCHILDREN); 00710 DCX_flags |= DCX_CACHE; 00711 } 00712 00713 /* 00714 * Deal with layered windows. 00715 */ 00716 if ((pwndLayer = GetLayeredWindow(pwndOrg)) != NULL && 00717 (hbmLayer = _GetProp(pwndLayer, PROP_LAYER, TRUE)) != NULL) { 00718 00719 /* 00720 * Get a layered redirection DC. 00721 */ 00722 DCX_flags |= DCX_LAYERED; 00723 00724 /* 00725 * When the window we're getting the DC for is the layered and 00726 * redirected window, don't allow to clip to its parent, since 00727 * clipping must not exceed the size of the backing bitmap. 00728 */ 00729 if (pwndOrg == pwndLayer) { 00730 DCX_flags &= ~DCX_PARENTCLIP; 00731 } 00732 00733 /* 00734 * Convert hrgnClip from screen to the redirection DC coordinates. 00735 */ 00736 if (hrgnClip > HRGN_SPECIAL_LAST) { 00737 GreOffsetRgn(hrgnClip, -pwndLayer->rcWindow.left, 00738 -pwndLayer->rcWindow.top); 00739 } 00740 } else { 00741 pwndLayer = NULL; 00742 hbmLayer = NULL; 00743 } 00744 00745 if (DCX_flags & DCX_PARENTCLIP) { 00746 00747 PWND pwndParent; 00748 00749 /* 00750 * If this window has no parent. This can occur if the app is 00751 * calling GetDC in response to a CBT_CREATEWND callback. In this 00752 * case, the parent is not yet setup. 00753 */ 00754 if (pwndOrg->spwndParent == NULL) 00755 pwndParent = PtiCurrent()->rpdesk->pDeskInfo->spwnd; 00756 else 00757 pwndParent = pwndOrg->spwndParent; 00758 00759 /* 00760 * Always get the DC from the cache. 00761 */ 00762 DCX_flags |= DCX_CACHE; 00763 00764 /* 00765 * We can't use a shared DC if the visibility of the 00766 * child does not match the parent's, or if a 00767 * CLIPSIBLINGS or CLIPCHILDREN DC is requested. 00768 * 00769 * In 3.1, we pay attention to the CLIPSIBLINGS and CLIPCHILDREN 00770 * bits of CS_PARENTDC windows, by overriding CS_PARENTDC if 00771 * either of these flags are requested. 00772 * 00773 * BACKWARD COMPATIBILITY HACK 00774 * 00775 * If parent is CLIPCHILDREN, get a cache DC, but don't 00776 * use parent's DC. Windows PowerPoint depends on this 00777 * behavior in order to draw the little gray rect between 00778 * its scroll bars correctly. 00779 */ 00780 if (!(DCX_flags & (DCX_CLIPSIBLINGS | DCX_CLIPCHILDREN)) && 00781 (TestWF(pwndOrg, WFWIN31COMPAT) || !TestWF(pwndParent, WFCLIPCHILDREN)) && 00782 TestWF(pwndParent, WFVISIBLE) == TestWF(pwndOrg, WFVISIBLE)) { 00783 00784 pwndClip = pwndParent; 00785 00786 #if DBG 00787 if (DCX_flags & DCX_CLIPCHILDREN) 00788 RIPMSG0(RIP_WARNING, "WS_CLIPCHILDREN overridden by CS_PARENTDC"); 00789 if (DCX_flags & DCX_CLIPSIBLINGS) 00790 RIPMSG0(RIP_WARNING, "WS_CLIPSIBLINGS overridden by CS_PARENTDC"); 00791 #endif 00792 /* 00793 * Make sure flags reflect hwndClip rather than hwndOrg. 00794 * But, we must never clip the children (since that's who 00795 * wants to do the drawing!) 00796 */ 00797 DCX_flags &= ~(DCX_CLIPCHILDREN | DCX_CLIPSIBLINGS); 00798 if (TestWF(pwndClip, WFCLIPSIBLINGS)) 00799 DCX_flags |= DCX_CLIPSIBLINGS; 00800 } 00801 } 00802 00803 /* 00804 * Make sure we don't return an OWNDC if the calling thread didn't 00805 * create this window - need to returned cached always in this case. 00806 * 00807 * Win95 does not contain this code. Why? 00808 */ 00809 if (!(DCX_flags & DCX_CACHE)) { 00810 if (pwndOrg == NULL || GETPTI(pwndOrg) != PtiCurrent()) 00811 DCX_flags |= DCX_CACHE; 00812 } 00813 00814 DCX_flagsMatch = DCX_flags & DCX_MATCHMASK; 00815 00816 if (!(DCX_flags & DCX_CACHE)) { 00817 00818 /* 00819 * Handle CS_OWNDC and CS_CLASSDC cases specially. Based on the 00820 * supplied match information, we need to find the appropriate DCE. 00821 */ 00822 for (ppdce = &gpDispInfo->pdceFirst; (pdce = *ppdce); ppdce = &pdce->pdceNext) { 00823 00824 if (pdce->DCX_flags & DCX_CACHE) 00825 continue; 00826 00827 /* 00828 * Look for the entry that matches hdcMatch or pwndOrg... 00829 */ 00830 if (!(pdce->pwndOrg == pwndOrg || pdce->hdc == hdcMatch)) 00831 continue; 00832 00833 /* 00834 * NOTE: The "Multiple-BeginPaint()-of-OWNDC-Window" Conundrum 00835 * 00836 * There is a situation having to do with OWNDC or CLASSDC window 00837 * DCs that can theoretically arise that is handled specially 00838 * here and in ReleaseCacheDC(). These DCs are identified with 00839 * the DCX_CACHE bit CLEAR. 00840 * 00841 * In the case where BeginPaint() (or a similar operation) is 00842 * called more than once without an intervening EndPaint(), the 00843 * DCX_INTERSECTRGN (or DCX_EXCLUDERGN) bit may already be set 00844 * when we get here. 00845 * 00846 * Theoretically, the correct thing to do is to save the current 00847 * hrgnClip, and set up the new one here. In ReleaseCacheDC, the 00848 * saved hrgnClip is restored and the visrgn recomputed. 00849 * 00850 * All of this is only necessary if BOTH calls involve an 00851 * hrgnClip that causes the visrgn to be changed (i.e., the 00852 * simple hrgnClip test clears the INTERSECTRGN or EXCLUDERGN bit 00853 * fails), which is not at all likely. 00854 * 00855 * When this code encounters this multiple-BeginPaint case it 00856 * punts by honoring the new EXCLUDE/INTERSECTRGN bits, but it 00857 * first restores the DC to a wide-open visrgn before doing so. 00858 * This means that the first EndPaint() will restore the visrgn 00859 * to a wide-open DC, rather than clipped to the first 00860 * BeginPaint()'s update rgn. This is a good punt, because worst 00861 * case an app does a bit more drawing than it should. 00862 */ 00863 if ((pdce->DCX_flags & (DCX_EXCLUDERGN | DCX_INTERSECTRGN)) && 00864 (DCX_flags & (DCX_EXCLUDERGN | DCX_INTERSECTRGN))) { 00865 00866 RIPMSG0(RIP_WARNING, "Nested BeginPaint() calls, please fix Your app!"); 00867 DeleteHrgnClip(pdce); 00868 } 00869 00870 if (pdce->DCX_flags & DCX_LAYERED) { 00871 /* 00872 * We're giving out the same DC again. Since it may not have 00873 * been released, transfer any accumulated bits if needed. 00874 */ 00875 UpdateLayeredSprite(pdce); 00876 00877 /* 00878 * As this point, the DC may get converted back to a screen 00879 * DC, so we must select the screen surface back into the DC. 00880 */ 00881 UserVerify(GreSelectRedirectionBitmap(pdce->hdc, NULL)); 00882 } 00883 00884 /* 00885 * If we matched exactly, no recomputation necessary 00886 * (we found a CS_OWNDC or a CS_CLASSDC that is already set up) 00887 * Otherwise, we have a CS_CLASSDC that needs recomputation. 00888 */ 00889 if ( pdce->pwndOrg == pwndOrg && 00890 bpwndOrgVisible && 00891 (pdce->DCX_flags & DCX_LAYERED) == (DCX_flags & DCX_LAYERED) && 00892 !(pdce->DCX_flags & DCX_PWNDORGINVISIBLE)) { 00893 00894 goto HaveComputedEntry; 00895 } 00896 00897 goto RecomputeEntry; 00898 } 00899 00900 RIPMSG1(RIP_WARNING, "Couldn't find DC for %p - bad code path", pwndOrg); 00901 00902 NullExit: 00903 00904 GreUnlockDisplay(gpDispInfo->hDev); 00905 return NULL; 00906 00907 } else { 00908 00909 /* 00910 * Make a quick pass through the cache, looking for an 00911 * exact match. 00912 */ 00913 SearchAgain: 00914 00915 #if DBG 00916 if (fDisableCache) 00917 goto SearchFailed; 00918 #endif 00919 00920 /* 00921 * CONSIDER (adams): Put this check into the loop above so we don't 00922 * touch all these pages twice? 00923 */ 00924 for (ppdce = &gpDispInfo->pdceFirst; (pdce = *ppdce); ppdce = &pdce->pdceNext) { 00925 00926 /* 00927 * If we find an entry that is not in use and whose clip flags 00928 * and clip window match, we can use it. 00929 * 00930 * NOTE: DCX_INTERSECT/EXCLUDERGN cache entries always have 00931 * DCX_INUSE set, so we'll never erroneously match one here. 00932 */ 00933 UserAssert(!(pdce->DCX_flags & (DCX_INTERSECTRGN | DCX_EXCLUDERGN)) || 00934 (pdce->DCX_flags & DCX_INUSE)); 00935 00936 if ((pdce->pwndClip == pwndClip) && 00937 pdce->pMonitor == NULL && 00938 (DCX_flagsMatch == (pdce->DCX_flags & (DCX_MATCHMASK | DCX_INUSE | DCX_INVALID)))) { 00939 00940 /* 00941 * Special case for icon - bug 9103 (win31) 00942 */ 00943 if (TestWF(pwndClip, WFMINIMIZED) && 00944 (pdce->pwndOrg != pdce->pwndClip)) { 00945 continue; 00946 } 00947 00948 /* 00949 * If the pwndOrg of the DC we found is not visible and 00950 * the pwndOrg we're looking for is visble, then 00951 * the visrgn is no good, we can't reuse it so keep 00952 * looking. 00953 */ 00954 if (bpwndOrgVisible && pdce->DCX_flags & DCX_PWNDORGINVISIBLE) { 00955 continue; 00956 } 00957 00958 /* 00959 * Set INUSE before performing any GDI operations, just 00960 * in case DCHook() has a mind to recalculate the visrgn... 00961 */ 00962 pdce->DCX_flags |= DCX_INUSE; 00963 00964 /* 00965 * We found an entry with the proper visrgn. 00966 * If the origin doesn't match, update the CE and reset it. 00967 */ 00968 if (pwndOrg != pdce->pwndOrg) { 00969 /* 00970 * Need to flush any dirty rectangle stuff now. 00971 */ 00972 SpbCheckDce(pdce); 00973 00974 pdce->pwndOrg = pwndOrg; 00975 ResetOrg(NULL, pdce, FALSE); 00976 } 00977 00978 goto HaveComputedEntry; 00979 } 00980 } 00981 00982 #if DBG 00983 SearchFailed: 00984 #endif 00985 00986 /* 00987 * Couldn't find an exact match. Find some invalid or non-inuse 00988 * entry we can reuse. 00989 */ 00990 ppdceNotInUse = NULL; 00991 for (ppdce = &gpDispInfo->pdceFirst; (pdce = *ppdce); ppdce = &pdce->pdceNext) { 00992 00993 /* 00994 * Skip non-cache entries 00995 */ 00996 if (!(pdce->DCX_flags & DCX_CACHE)) 00997 continue; 00998 00999 /* 01000 * Skip monitor-specific entires 01001 */ 01002 if (pdce->pMonitor != NULL) 01003 continue; 01004 01005 if (pdce->DCX_flags & DCX_INVALID) { 01006 break; 01007 } else if (!(pdce->DCX_flags & DCX_INUSE)) { 01008 01009 /* 01010 * Remember the non-inuse one, but keep looking for an invalid. 01011 */ 01012 ppdceNotInUse = ppdce; 01013 } 01014 } 01015 01016 /* 01017 * If we broke out of the loop, we found an invalid entry to reuse. 01018 * Otherwise see if we found a non-inuse entry to reuse. 01019 */ 01020 if (pdce == NULL && ((ppdce = ppdceNotInUse) == NULL)) { 01021 01022 /* 01023 * Create another DCE if we need it. 01024 */ 01025 if (!CreateCacheDC(pwndOrg, 01026 DCX_INVALID | DCX_CACHE | 01027 (DCX_flags & DCX_LAYERED), 01028 NULL)) { 01029 goto NullExit; 01030 } 01031 01032 goto SearchAgain; 01033 } 01034 01035 /* 01036 * We've chosen an entry to reuse: now fill it in and recompute it. 01037 */ 01038 pdce = *ppdce; 01039 01040 RecomputeEntry: 01041 01042 /* 01043 * Any non-invalid entries that we reuse might still have some bounds 01044 * that need to be used to invalidate SPBs. Apply them here. 01045 */ 01046 if (!(pdce->DCX_flags & DCX_INVALID)) 01047 SpbCheckDce(pdce); 01048 01049 /* 01050 * We want to compute only the matchable visrgn at first, 01051 * so we don't set up hrgnClip, or set the EXCLUDERGN or INTERSECTRGN 01052 * bits yet -- we'll deal with those later. 01053 */ 01054 pdce->DCX_flags = DCX_flagsMatch | DCX_INUSE; 01055 01056 #if DBG 01057 /* 01058 * We're about to select the visrgn into the DC, even though it's 01059 * not yet completely setup. Turn off the visrgn validation for now. 01060 * It will be turned on before this function returns. 01061 */ 01062 GreValidateVisrgn(pdce->hdc, FALSE); 01063 #endif 01064 01065 /* 01066 * Now recompute the visrgn (minus any hrgnClip shenanigans) 01067 */ 01068 hrgn = NULL; 01069 if (CalcVisRgn(&hrgn, pwndOrg, pwndClip, DCX_flagsMatch) == FALSE) { 01070 pdce->DCX_flags |= DCX_PWNDORGINVISIBLE; 01071 } 01072 01073 pdce->pwndOrg = pwndOrg; 01074 pdce->pwndClip = pwndClip; 01075 pdce->hrgnClip = NULL; // Just in case... 01076 pdce->hrgnClipPublic = NULL; 01077 01078 ResetOrg(hrgn, pdce, TRUE); 01079 01080 if (hrgn == NULL) { 01081 fVisRgnError = TRUE; 01082 } 01083 01084 /* 01085 * When we arrive here, pdce (and *ppdce) point to 01086 * a cache entry whose visrgn and origin are set up. 01087 * All that remains to be done is to deal with EXCLUDE/INTERSECTRGN 01088 */ 01089 HaveComputedEntry: 01090 01091 /* 01092 * If the window clipping flags have changed in the window 01093 * since the last time this dc was invalidated, then recompute 01094 * this dc entry. 01095 */ 01096 if ((pdce->DCX_flags & DCX_MATCHMASK) != (DCX_flags & DCX_MATCHMASK)) 01097 goto RecomputeEntry; 01098 01099 /* 01100 * Let's check these assertions just in case... 01101 */ 01102 UserAssert(pdce); 01103 UserAssert(*ppdce == pdce); 01104 UserAssert(pdce->DCX_flags & DCX_INUSE); 01105 UserAssert(!(pdce->DCX_flags & DCX_INVALID)); 01106 UserAssert((pdce->DCX_flags & DCX_MATCHMASK) == (DCX_flags & DCX_MATCHMASK)); 01107 01108 /* 01109 * Move the dce to the head of the list so it's easy to find later. 01110 */ 01111 if (pdce != gpDispInfo->pdceFirst) { 01112 *ppdce = pdce->pdceNext; 01113 pdce->pdceNext = gpDispInfo->pdceFirst; 01114 gpDispInfo->pdceFirst = pdce; 01115 } 01116 01117 #if DBG 01118 /* 01119 * We're about to mess with the visrgn in this DC, even though it's 01120 * not yet completely setup. Turn off the visrgn validation for now. 01121 * It will be turned on before this function returns. 01122 */ 01123 GreValidateVisrgn(pdce->hdc, FALSE); 01124 #endif 01125 01126 /* 01127 * Time to deal with DCX_INTERSECTRGN or DCX_EXCLUDERGN. 01128 * 01129 * We handle these two bits specially, because cache entries 01130 * with these bits set cannot be reused with the bits set. This 01131 * is because the area described in hrgnClip would have to be 01132 * compared along with the bit, which is a pain, especially since 01133 * they'd never match very often anyhow. 01134 * 01135 * What we do instead is to save the visrgn of the window before 01136 * applying either of these two flags, which is then restored 01137 * at ReleaseCacheDC() time, along with the clearing of these bits. 01138 * This effectively converts a cache entry with either of these 01139 * bits set into a "normal" cache entry that can be matched. 01140 */ 01141 if (DCX_flags & DCX_INTERSECTRGN) { 01142 01143 if (hrgnClip != HRGN_FULL) { 01144 01145 SetEmptyRgn(ghrgnGDC); 01146 01147 /* 01148 * Save the visrgn for reuse on ReleaseDC(). 01149 * (do this BEFORE we set hrgnClip & pdce->flag bit, 01150 * so that if a DCHook() callback occurs it recalculates 01151 * without hrgnClip) 01152 */ 01153 UserAssertMsg0(!pdce->hrgnSavedVis, 01154 "Nested SaveVisRgn attempt in _GetDCEx"); 01155 01156 /* 01157 * get the current vis region into hrgnSavedVis. Temporarily 01158 * store a dummy one in the DC. 01159 */ 01160 01161 pdce->hrgnSavedVis = CreateEmptyRgn(); 01162 01163 GreSelectVisRgn(pdce->hdc,pdce->hrgnSavedVis, SVR_SWAP); 01164 01165 pdce->hrgnClip = hrgnClip; 01166 01167 if (DCX_flags & DCX_NODELETERGN) 01168 pdce->DCX_flags |= DCX_NODELETERGN; 01169 01170 pdce->DCX_flags |= DCX_INTERSECTRGN; 01171 01172 if (hrgnClip == NULL) { 01173 01174 pdce->hrgnClipPublic = NULL; 01175 01176 } else { 01177 01178 IntersectRgn(ghrgnGDC, pdce->hrgnSavedVis, hrgnClip); 01179 01180 /* 01181 * Make a copy of the hrgnClip and make it public 01182 * so that we can use it in calculations in HungDraw. 01183 */ 01184 pdce->hrgnClipPublic = CreateEmptyRgnPublic(); 01185 CopyRgn(pdce->hrgnClipPublic, hrgnClip); 01186 } 01187 01188 /* 01189 * Clear the SAVEDRGNINVALID bit, since we're just 01190 * about to set it properly now. If the dce later 01191 * gets invalidated, it'll set this bit so we know 01192 * to recompute it when we restore the visrgn. 01193 */ 01194 pdce->DCX_flags &= ~DCX_SAVEDRGNINVALID; 01195 01196 /* 01197 * Select in the new region. we use the SWAP_REGION mode 01198 * so that ghrgnGDC always has a valid rgn 01199 */ 01200 01201 GreSelectVisRgn(pdce->hdc, ghrgnGDC, SVR_SWAP); 01202 } 01203 } else if (DCX_flags & DCX_EXCLUDERGN) { 01204 01205 if (hrgnClip != NULL) { 01206 01207 SetEmptyRgn(ghrgnGDC); 01208 01209 /* 01210 * Save the visrgn for reuse on ReleaseDC(). 01211 * (do this BEFORE we set hrgnClip & pdce->flag bit, 01212 * so that if a DCHook() callback occurs it recalculates 01213 * without hrgnClip) 01214 */ 01215 UserAssertMsg0(!pdce->hrgnSavedVis, 01216 "Nested SaveVisRgn attempt in _GetDCEx"); 01217 01218 /* 01219 * get the current vis region into hrgnSavedVis. Temporarily 01220 * store a dummy one in the DC. 01221 */ 01222 pdce->hrgnSavedVis = CreateEmptyRgn(); 01223 01224 GreSelectVisRgn(pdce->hdc,pdce->hrgnSavedVis, SVR_SWAP); 01225 01226 pdce->hrgnClip = hrgnClip; 01227 01228 if (DCX_flags & DCX_NODELETERGN) 01229 pdce->DCX_flags |= DCX_NODELETERGN; 01230 01231 pdce->DCX_flags |= DCX_EXCLUDERGN; 01232 01233 if (hrgnClip == HRGN_FULL) { 01234 01235 pdce->hrgnClipPublic = HRGN_FULL; 01236 01237 } else { 01238 01239 SubtractRgn(ghrgnGDC, pdce->hrgnSavedVis, hrgnClip); 01240 01241 /* 01242 * Make a copy of the hrgnClip and make it public 01243 * so that we can use it in calculations in HungDraw. 01244 */ 01245 pdce->hrgnClipPublic = CreateEmptyRgnPublic(); 01246 CopyRgn(pdce->hrgnClipPublic, hrgnClip); 01247 } 01248 01249 /* 01250 * Clear the SAVEDRGNINVALID bit, since we're just 01251 * about to set it properly now. If the dce later 01252 * gets invalidated, it'll set this bit so we know 01253 * to recompute it when we restore the visrgn. 01254 */ 01255 pdce->DCX_flags &= ~DCX_SAVEDRGNINVALID; 01256 01257 /* 01258 * Select in the new region. we use the SWAP_REGION mode 01259 * so that ghrgnGDC always has a valid rgn 01260 */ 01261 01262 GreSelectVisRgn(pdce->hdc, ghrgnGDC, SVR_SWAP); 01263 } 01264 } 01265 } 01266 01267 if (pdce->DCX_flags & DCX_LAYERED) { 01268 UserAssert(pwndLayer != NULL); 01269 UserAssert(hbmLayer != NULL); 01270 01271 UserVerify(GreSelectRedirectionBitmap(pdce->hdc, hbmLayer)); 01272 01273 /* 01274 * Enable bounds accumulation, so we know if there was any drawing 01275 * done into that DC and the actual rect we need to update when 01276 * this DC is released. 01277 */ 01278 GreGetBounds(pdce->hdc, NULL, GGB_ENABLE_WINMGR); 01279 01280 /* 01281 * In case the visrgn couldn't be allocated, clear it in the 01282 * dc again, since we just selected a new surface. 01283 */ 01284 if (fVisRgnError) { 01285 GreSelectVisRgn(pdce->hdc, NULL, SVR_DELETEOLD); 01286 } 01287 } 01288 01289 /* 01290 * Whew! Set ownership and return the bloody DC. 01291 * Only set ownership for cache dcs. Own dcs have already been owned. 01292 * The reason why we don't want to set the ownership over again is 01293 * because the console sets its owndcs to PUBLIC so gdisrv can use 01294 * them without asserting. We don't want to set the ownership back 01295 * again. 01296 */ 01297 if (pdce->DCX_flags & DCX_CACHE) { 01298 01299 if (!GreSetDCOwner(pdce->hdc, OBJECT_OWNER_CURRENT)) { 01300 RIPMSG1(RIP_WARNING, "GetDCEx: SetDCOwner Failed %lX", pdce->hdc); 01301 } 01302 01303 /* 01304 * Decrement the Free DCE Count. This should always be >= 0, 01305 * since we'll create a new dce if the cache is all in use. 01306 */ 01307 DecrementFreeDCECount(); 01308 01309 pdce->ptiOwner = PtiCurrent(); 01310 } 01311 01312 #ifdef USE_MIRRORING 01313 if (TestWF(pwnd, WEFLAYOUTRTL) && !(DCX_flags & DCX_NOMIRROR)) { 01314 GreSetLayout(pdce->hdc, -1, LAYOUT_RTL); 01315 } 01316 #endif 01317 01318 #if DBG 01319 GreValidateVisrgn(pdce->hdc, TRUE); 01320 #endif 01321 01322 GreUnlockDisplay(gpDispInfo->hDev); 01323 01324 return pdce->hdc; 01325 }

BOOL _GetGUIThreadInfo PTHREADINFO  pti,
PGUITHREADINFO  pgui
 

Definition at line 36 of file winable2.c.

References tagQ::caret, tagDESKTOP::cciConsole, tagCARET::cx, tagCARET::cy, FALSE, tagPOPUPMENU::fHasMenuBar, tagPOPUPMENU::fIsSysMenu, _MOVESIZEDATA::fTrackCancelled, GETPTI, gpqForeground, HW, HWq, tagCARET::iHideLevel, NULL, tagMENUSTATE::pGlobalPopupMenu, tagTHREADINFO::pMenuState, tagTHREADINFO::pmsd, tagTHREADINFO::ppi, tagTHREADINFO::pq, PtiCurrentShared, tagTHREADINFO::rpdesk, SetRectEmpty, tagCARET::spwnd, _MOVESIZEDATA::spwnd, tagQ::spwndActive, tagQ::spwndCapture, tagQ::spwndFocus, tagPOPUPMENU::spwndNotify, TRUE, W32PF_CONSOLEHASFOCUS, tagCARET::x, and tagCARET::y.

Referenced by NtUserGetGUIThreadInfo().

00037 { 00038 PQ pq; 00039 00040 /* 00041 * Validate threadinfo structure 00042 */ 00043 if (pgui->cbSize != sizeof(GUITHREADINFO)) { 00044 RIPERR1(ERROR_INVALID_PARAMETER, RIP_WARNING, "GUITHREADINFO.cbSize %d is wrong", pgui->cbSize); 00045 return FALSE; 00046 } 00047 00048 /* 00049 * Is this a valid initialized GUI thread? 00050 */ 00051 if (pti != NULL) { 00052 if ((pq = pti->pq) == NULL) { 00053 // does this ever happen? 00054 RIPMSG1(RIP_ERROR, "GetGUIThreadInfo: No queue for pti %lx", pti); 00055 return FALSE; 00056 } 00057 } else { 00058 /* 00059 * Use the foreground queue. To get menu state information we must also 00060 * figure out the right pti. This matches _GetForegroundWindow() logic. 00061 */ 00062 if ((pq = gpqForeground) == NULL) { 00063 // this does sometimes happen... 00064 RIPMSG0(RIP_WARNING, "GetGUIThreadInfo: No foreground queue"); 00065 return FALSE; 00066 } 00067 00068 if (pq->spwndActive && (GETPTI(pq->spwndActive)->pq == pq)) { 00069 pti = GETPTI(pq->spwndActive); 00070 if (PtiCurrentShared()->rpdesk != pti->rpdesk) { 00071 RIPERR0(ERROR_ACCESS_DENIED, RIP_VERBOSE, "Foreground window on different desktop"); 00072 return FALSE; 00073 } 00074 } 00075 } 00076 00077 UserAssert(pq != NULL); 00078 00079 /* 00080 * For C2 security, verify that pq and pti are on the current thread's desktop. 00081 * We can't directly determine which desktop pq belongs to, but we can at 00082 * least ensure that any caret info we return is not from another desktop 00083 */ 00084 if (pq->caret.spwnd && 00085 (GETPTI(pq->caret.spwnd)->rpdesk != PtiCurrentShared()->rpdesk)) { 00086 RIPERR0(ERROR_ACCESS_DENIED, RIP_VERBOSE, "Foreground caret on different desktop"); 00087 return FALSE; 00088 } 00089 if (pti && (pti->rpdesk != PtiCurrentShared()->rpdesk)) { 00090 RIPERR0(ERROR_ACCESS_DENIED, RIP_VERBOSE, "Foreground thread on different desktop"); 00091 return FALSE; 00092 } 00093 00094 pgui->flags = 0; 00095 pgui->hwndMoveSize = NULL; 00096 pgui->hwndMenuOwner = NULL; 00097 00098 /* 00099 * Get Menu information from the THREADINFO 00100 */ 00101 if (pti != NULL) { 00102 if (pti->pmsd && !pti->pmsd->fTrackCancelled && pti->pmsd->spwnd) { 00103 pgui->flags |= GUI_INMOVESIZE; 00104 pgui->hwndMoveSize = HWq(pti->pmsd->spwnd); 00105 } 00106 00107 if (pti->pMenuState && pti->pMenuState->pGlobalPopupMenu) { 00108 pgui->flags |= GUI_INMENUMODE; 00109 00110 if (pti->pMenuState->pGlobalPopupMenu->fHasMenuBar) { 00111 if (pti->pMenuState->pGlobalPopupMenu->fIsSysMenu) { 00112 pgui->flags |= GUI_SYSTEMMENUMODE; 00113 } 00114 } else { 00115 pgui->flags |= GUI_POPUPMENUMODE; 00116 } 00117 00118 if (pti->pMenuState->pGlobalPopupMenu->spwndNotify) 00119 pgui->hwndMenuOwner = HWq(pti->pMenuState->pGlobalPopupMenu->spwndNotify); 00120 } 00121 } 00122 00123 /* 00124 * Get the rest of the information from the queue 00125 */ 00126 pgui->hwndActive = HW(pq->spwndActive); 00127 pgui->hwndFocus = HW(pq->spwndFocus); 00128 pgui->hwndCapture = HW(pq->spwndCapture); 00129 00130 pgui->hwndCaret = NULL; 00131 00132 if (pq->caret.spwnd) { 00133 pgui->hwndCaret = HWq(pq->caret.spwnd); 00134 00135 /* 00136 * These coords are always relative to the client of hwndCaret 00137 * of course. 00138 */ 00139 pgui->rcCaret.left = pq->caret.x; 00140 pgui->rcCaret.right = pgui->rcCaret.left + pq->caret.cx; 00141 pgui->rcCaret.top = pq->caret.y; 00142 pgui->rcCaret.bottom = pgui->rcCaret.top + pq->caret.cy; 00143 00144 if (pq->caret.iHideLevel == 0) 00145 pgui->flags |= GUI_CARETBLINKING; 00146 } else if (pti && (pti->ppi->W32PF_Flags & W32PF_CONSOLEHASFOCUS)) { 00147 /* 00148 * The thread is running in the console window with focus. Pull 00149 * out the info from the console pseudo caret. 00150 */ 00151 pgui->hwndCaret = pti->rpdesk->cciConsole.hwnd; 00152 pgui->rcCaret = pti->rpdesk->cciConsole.rc; 00153 } else { 00154 SetRectEmpty(&pgui->rcCaret); 00155 } 00156 00157 return TRUE; 00158 }

BOOL _GetIMEShowStatus VOID   ) 
 

Definition at line 2705 of file ntimm.c.

References BOOL, FALSE, and gfIMEShowStatus.

Referenced by xxxSystemParametersInfo().

02706 { 02707 return gfIMEShowStatus != FALSE; 02708 }

BOOL _GetInputState VOID   ) 
 

Definition at line 4206 of file queue.c.

References _GetQueueStatus(), BOOL, FALSE, QS_TEST, QS_TEST_AND_CLEAR, and TRUE.

Referenced by NtUserGetThreadState().

04207 { 04208 if (LOWORD(_GetQueueStatus(QS_TEST_AND_CLEAR)) & QS_TEST) { 04209 return TRUE; 04210 } else { 04211 return FALSE; 04212 } 04213 }

HKL _GetKeyboardLayout DWORD  idThread  ) 
 

Definition at line 1469 of file kbdlyout.c.

References CheckCritIn, tagKL::hkl, NULL, PtiCurrent, PtiCurrentShared, and tagTHREADINFO::spklActive.

Referenced by GetActiveHKL().

01471 { 01472 PTHREADINFO ptiT; 01473 PLIST_ENTRY pHead, pEntry; 01474 01475 CheckCritIn(); 01476 01477 /* 01478 * If idThread is NULL return hkl of the current thread 01479 */ 01480 if (idThread == 0) { 01481 PKL pklActive = PtiCurrentShared()->spklActive; 01482 01483 if (pklActive == NULL) { 01484 return (HKL)0; 01485 } 01486 return pklActive->hkl; 01487 } 01488 /* 01489 * Look for idThread 01490 */ 01491 pHead = &PtiCurrent()->rpdesk->PtiList; 01492 for (pEntry = pHead->Flink; pEntry != pHead; pEntry = pEntry->Flink) { 01493 ptiT = CONTAINING_RECORD(pEntry, THREADINFO, PtiLink); 01494 if (ptiT->pEThread->Cid.UniqueThread == (HANDLE)LongToHandle( idThread )) { 01495 if (ptiT->spklActive == NULL) { 01496 return (HKL)0; 01497 } 01498 return ptiT->spklActive->hkl; 01499 } 01500 } 01501 /* 01502 * idThread doesn't exist 01503 */ 01504 return (HKL)0; 01505 }

UINT _GetKeyboardLayoutList PWINDOWSTATION  pwinsta,
UINT  nItems,
HKL *  lpBuff
 

Definition at line 1507 of file kbdlyout.c.

References EXCEPTION_EXECUTE_HANDLER, tagKL::hkl, KL_UNLOADED, NULL, tagWINDOWSTATION::spklList, and UINT.

Referenced by NtUserGetKeyboardLayoutList().

01511 { 01512 UINT nHKL = 0; 01513 PKL pkl, pklFirst; 01514 01515 if (!pwinsta) { 01516 return 0; 01517 } 01518 01519 pkl = pwinsta->spklList; 01520 01521 /* 01522 * Windowstations that do not take input could have no layouts 01523 */ 01524 if (pkl == NULL) { 01525 // SetLastError() ???? 01526 return 0; 01527 } 01528 01529 /* 01530 * The client/server thunk sets nItems to 0 if ccxlpBuff == NULL 01531 */ 01532 UserAssert(ccxlpBuff || (nItems == 0)); 01533 01534 pklFirst = pkl; 01535 if (nItems) { 01536 try { 01537 do { 01538 if (!(pkl->dwKL_Flags & KL_UNLOADED)) { 01539 if (nItems-- == 0) { 01540 break; 01541 } 01542 nHKL++; 01543 *ccxlpBuff++ = pkl->hkl; 01544 } 01545 pkl = pkl->pklNext; 01546 } while (pkl != pklFirst); 01547 } except (EXCEPTION_EXECUTE_HANDLER) { 01548 RIPERR1(ERROR_INVALID_PARAMETER, RIP_ERROR, 01549 "_GetKeyBoardLayoutList: exception writing ccxlpBuff %lx", ccxlpBuff); 01550 return 0; 01551 } 01552 } else do { 01553 if (!(pkl->dwKL_Flags & KL_UNLOADED)) { 01554 nHKL++; 01555 } 01556 pkl = pkl->pklNext; 01557 } while (pkl != pklFirst); 01558 01559 return nHKL; 01560 }

int _GetKeyboardType int  nTypeFlag  ) 
 

Definition at line 3070 of file ntinput.c.

References gKeyboardInfo, gpKbdNlsTbl, and NULL.

03071 { 03072 03073 switch (nTypeFlag) { 03074 case 0: 03075 return gKeyboardInfo.KeyboardIdentifier.Type; 03076 03077 case 1: 03078 // FE_SB 03079 { 03080 int OEMId = 0; 03081 // 03082 // If this keyboard layout is compatible with 101 or 106 03083 // Japanese keyboard, we just return 101 or 106's keyboard 03084 // id, not this keyboard's one to let application handle 03085 // this keyboard as 101 or 106 Japanese keyboard. 03086 // 03087 if (gpKbdNlsTbl != NULL) { 03088 if (gpKbdNlsTbl->LayoutInformation & NLSKBD_INFO_EMURATE_101_KEYBOARD) { 03089 return (MICROSOFT_KBD_101_TYPE); 03090 } 03091 if (gpKbdNlsTbl->LayoutInformation & NLSKBD_INFO_EMURATE_106_KEYBOARD) { 03092 return (MICROSOFT_KBD_106_TYPE); 03093 } 03094 } 03095 03096 // 03097 // PSS ID Number: Q130054 03098 // Article last modified on 05-16-1995 03099 // 03100 // 3.10 1.20 | 3.50 1.20 03101 // WINDOWS | WINDOWS NT 03102 // 03103 // --------------------------------------------------------------------- 03104 // The information in this article applies to: 03105 // - Microsoft Windows Software Development Kit (SDK) for Windows 03106 // version 3.1 03107 // - Microsoft Win32 Software Development Kit (SDK) version 3.5 03108 // - Microsoft Win32s version 1.2 03109 // --------------------------------------------------------------------- 03110 // SUMMARY 03111 // ======= 03112 // Because of the variety of computer manufacturers (NEC, Fujitsu, IBMJ, and 03113 // so on) in Japan, sometimes Windows-based applications need to know which 03114 // OEM (original equipment manufacturer) manufactured the computer that is 03115 // running the application. This article explains how. 03116 // 03117 // MORE INFORMATION 03118 // ================ 03119 // There is no documented way to detect the manufacturer of the computer that 03120 // is currently running an application. However, a Windows-based application 03121 // can detect the type of OEM Windows by using the return value of the 03122 // GetKeyboardType() function. 03123 // 03124 // If an application uses the GetKeyboardType API, it can get OEM ID by 03125 // specifying "1" (keyboard subtype) as argument of the function. Each OEM ID 03126 // is listed here: 03127 // 03128 // OEM Windows OEM ID 03129 // ------------------------------ 03130 // Microsoft 00H (DOS/V) 03131 // all AX 01H 03132 // EPSON 04H 03133 // Fujitsu 05H 03134 // IBMJ 07H 03135 // Matsushita 0AH 03136 // NEC 0DH 03137 // Toshiba 12H 03138 // 03139 // Application programs can use these OEM IDs to distinguish the type of OEM 03140 // Windows. Note, however, that this method is not documented, so Microsoft 03141 // may not support it in the future version of Windows. 03142 // 03143 // As a rule, application developers should write hardware-independent code, 03144 // especially when making Windows-based applications. If they need to make a 03145 // hardware-dependent application, they must prepare the separated program 03146 // file for each different hardware architecture. 03147 // 03148 // Additional reference words: 3.10 1.20 3.50 1.20 kbinf 03149 // KBCategory: kbhw 03150 // KBSubcategory: wintldev 03151 // ============================================================================= 03152 // Copyright Microsoft Corporation 1995. 03153 03154 if (gpKbdNlsTbl != NULL) { 03155 // 03156 // Get OEM (Windows) ID. 03157 // 03158 OEMId = ((int)gpKbdNlsTbl->OEMIdentifier) << 8; 03159 } 03160 // 03161 // The format of KeyboardIdentifier.Subtype : 03162 // 03163 // 0 - 3 bits = keyboard subtype 03164 // 4 - 7 bits = kernel mode kerboard driver provider id. 03165 // 03166 // Kernel mode keyboard dirver provier | ID 03167 // ------------------------------------+----- 03168 // Microsoft | 00H 03169 // all AX | 01H 03170 // Toshiba | 02H 03171 // EPSON | 04H 03172 // Fujitsu | 05H 03173 // IBMJ | 07H 03174 // Matsushita | 0AH 03175 // NEC | 0DH 03176 // 03177 03178 // 03179 // And here is the format of return value. 03180 // 03181 // 0 - 7 bits = Keyboard Subtype. 03182 // 8 - 15 bits = OEM (Windows) Id. 03183 // 16 - 31 bits = not used. 03184 // 03185 return (int)(OEMId | (gKeyboardInfo.KeyboardIdentifier.Subtype & 0x0F)); 03186 } 03187 03188 case 2: 03189 return gKeyboardInfo.NumberOfFunctionKeys; 03190 } 03191 return 0; 03192 }

int _GetKeyNameText LONG  lParam,
LPWSTR  lpString,
int  nSize
 

Definition at line 408 of file xlate.c.

References APIENTRY, BYTE, InternalMapVirtualKeyEx(), L, LOBYTE, NULL, tagKBDFILE::pKbdTbl, PtiCurrentShared, tagKL::spkf, tagTHREADINFO::spklActive, TRUE, UINT, and wcsncpycch().

Referenced by NtUserGetKeyNameText().

00412 { 00413 BYTE Vsc = LOBYTE(HIWORD(lParam)); 00414 PVSC_LPWSTR pKN; 00415 PTHREADINFO ptiT = PtiCurrentShared(); 00416 PKBDTABLES pKbdTbl; 00417 UINT Vk; 00418 UINT Char; 00419 00420 /* 00421 * NOTE -- lpStr can be a client-side address, so access through it 00422 * must be guarded with try blocks. 00423 */ 00424 00425 if (cchSize < 1) 00426 return 0; 00427 00428 /* 00429 * If bit 25 set (don't care about left vs. right) then: 00430 * 1) convert right-Shift into left-Shift 00431 * 2) clear the extended bit for Ctrl and Alt only (effectively converting 00432 * right-Ctrl & right-Alt into left-Ctrl & right-Alt) 00433 * For Windows '95 compatibility, the DONTCARE_BIT doesn't apply to other 00434 * extended keys (eg: NumPad cursor movement keys, NumPad Enter). Some 00435 * applications (Word '95) depend on this. #37796 00436 */ 00437 if (lParam & DONTCARE_BIT) { 00438 if (Vsc == SCANCODE_RSHIFT) { 00439 Vsc = SCANCODE_LSHIFT; 00440 } 00441 if (lParam & EXTENDED_BIT) { 00442 if ((Vsc == SCANCODE_CTRL) || (Vsc == SCANCODE_ALT)) { 00443 lParam &= ~EXTENDED_BIT; 00444 } 00445 } 00446 lParam &= ~DONTCARE_BIT; 00447 } 00448 00449 if (ptiT->spklActive == (PKL)NULL) { 00450 return 0; 00451 } 00452 pKbdTbl = ptiT->spklActive->spkf->pKbdTbl; 00453 00454 /* 00455 * Scan pKbdTbl->pKeyNames[] or pKeyNamesExt[] for matching Virtual Scan Code 00456 */ 00457 if (lParam & EXTENDED_BIT) { 00458 pKN = pKbdTbl->pKeyNamesExt; 00459 } else { 00460 pKN = pKbdTbl->pKeyNames; 00461 } 00462 00463 if (pKN) { 00464 while (pKN->vsc != 0) { 00465 if (Vsc == pKN->vsc) { 00466 00467 try { 00468 cchSize = wcsncpycch(ccxlpStr, pKN->pwsz, cchSize); 00469 cchSize--; 00470 ccxlpStr[cchSize] = L'\0'; 00471 } except(W32ExceptionHandler(TRUE, RIP_ERROR)) { 00472 return 0; 00473 } 00474 return cchSize; 00475 } 00476 pKN++; 00477 } 00478 } 00479 00480 /* 00481 * The name of the key was not found in the table, so we 00482 * now attempt to construct the key name from the character produced by 00483 * the key. Translate Scancode -> Virtual Key -> character. 00484 */ 00485 00486 /* 00487 * Translate Scancode to Virtual Key (ignoring modifier keys etc.) 00488 */ 00489 Vk = InternalMapVirtualKeyEx((UINT)Vsc, 1, pKbdTbl); 00490 if (Vk == 0) { 00491 return 0; 00492 } 00493 00494 /* 00495 * Now translate Virtual Key to character (ignoring modifier keys etc.) 00496 */ 00497 Char = InternalMapVirtualKeyEx((UINT)Vk, 2, pKbdTbl); 00498 if (Char == 0) { 00499 return 0; 00500 } 00501 00502 if (Char & 0x80000000) { 00503 LPWSTR *ppwsz; 00504 00505 ppwsz = pKbdTbl->pKeyNamesDead; 00506 if (ppwsz) { 00507 while (*ppwsz != NULL) { 00508 if (*ppwsz[0] == (WCHAR)Char) { 00509 try { 00510 cchSize = wcsncpycch(ccxlpStr, (*ppwsz)+1, cchSize); 00511 cchSize--; 00512 ccxlpStr[cchSize] = L'\0'; 00513 } except(W32ExceptionHandler(TRUE, RIP_ERROR)) { 00514 return 0; 00515 } 00516 return cchSize; 00517 } 00518 ppwsz++; 00519 } 00520 } 00521 } 00522 00523 /* 00524 * Construct a single character name (adding null-terminator if possible) 00525 */ 00526 try { 00527 ccxlpStr[0] = (WCHAR)Char; 00528 if (cchSize >= 2) { 00529 ccxlpStr[1] = L'\0'; 00530 } 00531 } except(W32ExceptionHandler(TRUE, RIP_ERROR)) { 00532 return 0; 00533 } 00534 return 1; 00535 }

DWORD _GetListBoxInfo PWND  pwnd  ) 
 

Definition at line 946 of file winable2.c.

References tagCLS::atomClassName, tagSERVERINFO::atomSysClass, BOOL, tagLBIV::cMac, DATAALIGN, DWORD, FALSE, tagLBIV::fMultiColumn, FNID_LISTBOX, GETFNID, GETPTI, gpsi, ICLS_LISTBOX, tagLBIV::itemsPerColumn, KeAttachProcess(), KeDetachProcess(), tagWND::pcls, PpiCurrent, and ProbeForRead.

Referenced by NtUserGetListBoxInfo().

00947 { 00948 PCLS pcls; 00949 DWORD dwRet = 0; 00950 BOOL fOtherProcess; 00951 00952 /* 00953 * Make sure it is a combobox or a dropdown 00954 */ 00955 pcls = pwnd->pcls; 00956 if ((pcls->atomClassName != gpsi->atomSysClass[ICLS_LISTBOX]) && 00957 (GETFNID(pwnd) != FNID_LISTBOX)) { 00958 RIPERR1(ERROR_INVALID_PARAMETER, RIP_WARNING, "pwnd %#p is not a listbox", pwnd); 00959 return 0; 00960 } 00961 00962 if (fOtherProcess = (GETPTI(pwnd)->ppi != PpiCurrent())) { 00963 KeAttachProcess(&GETPTI(pwnd)->ppi->Process->Pcb); 00964 } 00965 00966 try { 00967 PLBIV ccxPlbSnap; 00968 00969 /* 00970 * Snap and probe the pointer to the LBIV, since it is client-side. 00971 */ 00972 ccxPlbSnap = ((PLBWND)pwnd)->pLBIV; 00973 if (!ccxPlbSnap) { 00974 goto errorexit; 00975 } 00976 ProbeForRead(ccxPlbSnap, sizeof(LBIV), DATAALIGN); 00977 00978 if (ccxPlbSnap->fMultiColumn) { 00979 dwRet = ccxPlbSnap->itemsPerColumn; 00980 } else { 00981 dwRet = ccxPlbSnap->cMac; 00982 } 00983 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00984 dwRet = 0; 00985 } 00986 00987 errorexit: 00988 if (fOtherProcess) { 00989 KeDetachProcess(); 00990 } 00991 00992 return dwRet; 00993 }

PMENU _GetMenu PWND  pWnd  ) 
 

WINUSERAPI UINT _GetMenuItemCount PMENU  pMenu  ) 
 

WINUSERAPI UINT _GetMenuItemID PMENU  pMenu,
int  nPos
 

DWORD _GetMessagePos VOID   ) 
 

Definition at line 1205 of file ntuser/kernel/input.c.

References DWORD, PtiCurrent, tagTHREADINFO::ptLast, and SHORT.

Referenced by xxxContScroll(), xxxEndScroll(), xxxMS_TrackMove(), xxxSendHelpMessage(), and xxxSysCommand().

01206 { 01207 PTHREADINFO pti; 01208 01209 pti = PtiCurrent(); 01210 01211 return MAKELONG((SHORT)pti->ptLast.x, (SHORT)pti->ptLast.y); 01212 }

int _GetMouseMovePointsEx CONST MOUSEMOVEPOINT *  ppt,
MOUSEMOVEPOINT *  pptBuf,
UINT  nPoints,
DWORD  resolution
 

Definition at line 3652 of file ntinput.c.

References BOOL, DWORD, FALSE, gaptMouse, gptInd, MAX_MOUSEPOINTS, min, PREVPOINT, SYSMET, TRUE, and UINT.

Referenced by NtUserGetMouseMovePointsEx().

03657 { 03658 UINT uInd, uStart, nPointsRetrieved, i; 03659 BOOL bFound = FALSE; 03660 int x, y; 03661 DWORD resX, resY; 03662 03663 uStart = PREVPOINT(gptInd); 03664 03665 /* 03666 * Search the point in the global buffer and get the first occurance. 03667 */ 03668 uInd = uStart; 03669 03670 do { 03671 /* 03672 * The resolutions can be zero only if the buffer is still not full 03673 */ 03674 if (HIWORD(gaptMouse[uInd].x) == 0 || HIWORD(gaptMouse[uInd].y) == 0) { 03675 break; 03676 } 03677 03678 resX = (DWORD)HIWORD(gaptMouse[uInd].x) + 1; 03679 resY = (DWORD)HIWORD(gaptMouse[uInd].y) + 1; 03680 03681 if ((int)resX != SYSMET(CXVIRTUALSCREEN)) { 03682 UserAssert(resX == 0x10000); 03683 x = (LOWORD(gaptMouse[uInd].x) * SYSMET(CXVIRTUALSCREEN)) / resX; 03684 } else { 03685 x = LOWORD(gaptMouse[uInd].x); 03686 } 03687 03688 if ((int)resY != SYSMET(CYVIRTUALSCREEN)) { 03689 UserAssert(resY == 0x10000); 03690 y = (LOWORD(gaptMouse[uInd].y) * SYSMET(CYVIRTUALSCREEN)) / resY; 03691 } else { 03692 y = LOWORD(gaptMouse[uInd].y); 03693 } 03694 03695 if (x == ppt->x && y == ppt->y) { 03696 03697 /* 03698 * If the timestamp was provided check to see if it's the right 03699 * timestamp. 03700 */ 03701 if (ppt->time != 0 && ppt->time != gaptMouse[uInd].time) { 03702 uInd = PREVPOINT(uInd); 03703 RIPMSG4(RIP_VERBOSE, 03704 "GetMouseMovePointsEx: Found point (%x, %y) but timestamp %x diff from %x", 03705 x, y, ppt->time, gaptMouse[uInd].time); 03706 continue; 03707 } 03708 03709 bFound = TRUE; 03710 break; 03711 } 03712 uInd = PREVPOINT(uInd); 03713 03714 } while (uInd != uStart); 03715 03716 /* 03717 * The point might not be in the buffer anymore. 03718 */ 03719 if (!bFound) { 03720 RIPERR2(ERROR_POINT_NOT_FOUND, RIP_VERBOSE, 03721 "GetMouseMovePointsEx: point not found (%x, %y)", ppt->x, ppt->y); 03722 return -1; 03723 } 03724 03725 /* 03726 * See how many points we can retrieve. 03727 */ 03728 nPointsRetrieved = (uInd <= uStart ? uInd + MAX_MOUSEPOINTS - uStart : uInd - uStart); 03729 03730 nPointsRetrieved = min(nPointsRetrieved, nPoints); 03731 03732 /* 03733 * Copy the points to the app buffer 03734 */ 03735 try { 03736 for (i = 0; i < nPointsRetrieved; i++) { 03737 03738 resX = (DWORD)HIWORD(gaptMouse[uInd].x) + 1; 03739 resY = (DWORD)HIWORD(gaptMouse[uInd].y) + 1; 03740 03741 /* 03742 * If one of the resolution is 0 then we're done 03743 */ 03744 if (HIWORD(gaptMouse[uInd].x) == 0 || HIWORD(gaptMouse[uInd].y) == 0) { 03745 break; 03746 } 03747 03748 /* 03749 * LOWORD(gaptMouse[uInd].x) contains the x point on the 03750 * scale specified by HIWORD(gaptMouse[uInd].x) 03751 */ 03752 if (resolution == GMMP_USE_HIGH_RESOLUTION_POINTS) { 03753 ccxpptBuf[i].x = ((DWORD)LOWORD(gaptMouse[uInd].x) * 0xFFFF) / (resX - 1); 03754 03755 ccxpptBuf[i].y = ((DWORD)LOWORD(gaptMouse[uInd].y) * 0xFFFF) / (resY - 1); 03756 03757 } else { 03758 UserAssert(resolution == GMMP_USE_DISPLAY_POINTS); 03759 03760 ccxpptBuf[i].x = (LOWORD(gaptMouse[uInd].x) * SYSMET(CXVIRTUALSCREEN)) / resX; 03761 03762 ccxpptBuf[i].y = (LOWORD(gaptMouse[uInd].y) * SYSMET(CYVIRTUALSCREEN)) / resY; 03763 } 03764 ccxpptBuf[i].time = gaptMouse[uInd].time; 03765 ccxpptBuf[i].dwExtraInfo = gaptMouse[uInd].dwExtraInfo; 03766 03767 03768 uInd = PREVPOINT(uInd); 03769 } 03770 } except(W32ExceptionHandler(FALSE, RIP_WARNING)) { 03771 } 03772 return i; 03773 }

PWND _GetNextQueueWindow PWND  pwnd,
BOOL  fDir,
BOOL  fAltEsc
 

Definition at line 99 of file tmswitch.c.

References _GetWindow(), BOOL, FALSE, GetLastTopMostWindow(), GetTopLevelWindow(), gptiRit, grpdeskRitInput, gspwndAltTab, NULL, tagDESKTOP::pDeskInfo, PtiCurrent, tagDESKTOPINFO::spwnd, tagWND::spwndChild, tagWND::spwndLastActive, tagWND::spwndOwner, tagWND::spwndParent, TestWF, TRUE, WEFNOACTIVATE, WEFTOOLWINDOW, WEFTOPMOST, WFBOTTOMMOST, WFDISABLED, and WFVISIBLE.

Referenced by InitSwitchWndInfo(), xxxNextWindow(), xxxOldNextWindow(), xxxSwitchToThisWindow(), and zzzReattachThreads().

00103 { 00104 PWND pwndAltTab; 00105 PWND pwndNext; 00106 PWND pwndT; 00107 PWND pwndDesktop; 00108 BOOL bBeenHereAlready = FALSE; 00109 PTHREADINFO ptiAltTab; 00110 00111 /* 00112 * HACK: We have a problem with direct-draw full apps where an alttab 00113 * window is created on a queue owned other than the RIT. This 00114 * shows up by alt-tabbing away from ROIDS.EXE during fullscreen. 00115 * 00116 * What is happening is on a ALT-TAB, from xxxSysCommand(), the 00117 * thread is not a rit. xxxSysCommand() calls xxxOldNextWindow 00118 * which finds that the current-thread doesn't have a switch 00119 * window, and then creates one on the current-thread-queue. 00120 * 00121 * The hack here is to make sure the calling thread is the RIT 00122 * before allowing any cool-switch creation. 00123 * 00124 * 21-Mar-1996 : Chriswil 00125 */ 00126 #if 0 00127 ptiAltTab = PtiCurrent(); 00128 #else 00129 ptiAltTab = gptiRit; 00130 #endif 00131 00132 /* 00133 * If the window we receive is Null then use the last topmost window 00134 */ 00135 if (!pwnd) { 00136 pwnd = GetLastTopMostWindow(); 00137 if (!pwnd) { 00138 return NULL; 00139 } 00140 } 00141 00142 pwndAltTab = gspwndAltTab; 00143 00144 pwnd = pwndNext = GetTopLevelWindow(pwnd); 00145 if (!pwndNext) 00146 return NULL; 00147 00148 /* 00149 * Get the window's desktop 00150 */ 00151 if ((pwndDesktop = pwndNext->spwndParent) == NULL) { 00152 pwndDesktop = grpdeskRitInput->pDeskInfo->spwnd; 00153 pwnd = pwndNext = pwndDesktop->spwndChild; 00154 } 00155 00156 while (TRUE) { 00157 00158 if (pwndNext == NULL) 00159 return NULL; 00160 00161 /* 00162 * Get the next window 00163 */ 00164 pwndNext = _GetWindow(pwndNext, fPrev ? GW_HWNDPREV : GW_HWNDNEXT); 00165 00166 if (!pwndNext) { 00167 00168 pwndNext = fPrev ? _GetWindow(pwndDesktop->spwndChild, GW_HWNDLAST) 00169 : pwndDesktop->spwndChild; 00170 /* 00171 * To avoid searching the child chain forever, bale out if we get 00172 * to the end (beginning) of the chain twice. 00173 * This happens if pwnd is a partially destroyed window that has 00174 * been unlinked from its siblings but not yet unlinked from the 00175 * parent. (Happens while sending WM_NCDESTROY in xxxFreeWindow) 00176 */ 00177 if (bBeenHereAlready) { 00178 RIPMSG1(RIP_WARNING, "pwnd %#p is no longer a sibling", pwnd); 00179 return NULL; 00180 } 00181 00182 bBeenHereAlready = TRUE; 00183 } 00184 00185 /* 00186 * If we have gone all the way around with no success, return NULL. 00187 */ 00188 if (!pwndNext || (pwndNext == pwnd)) 00189 return NULL; 00190 00191 /* 00192 * Ignore the following windows: 00193 * Switch window 00194 * Tool Windows 00195 * NoActivate Windows 00196 * Hidden windows 00197 * Disabled windows 00198 * Topmost windows if via Alt+Esc 00199 * Bottommost windows if via Alt+Esc 00200 * 00201 * If we're doing Alt-Esc processing, we have to skip topmost windows. 00202 * 00203 * Because topmost windows don't really go to the back when we 00204 * send them there, alt-esc would never enumerate non-topmost windows. 00205 * So, although we're allowed to start enumeration at a topmost window, 00206 * we only allow enumeration of non-topmost windows, so the user can 00207 * enumerate his presumably more important applications. 00208 */ 00209 if ((pwndNext != pwndAltTab) && 00210 // BradG - Win95 is missing the check for Tool Windows 00211 (!TestWF(pwndNext, WEFTOOLWINDOW)) && 00212 (!TestWF(pwndNext, WEFNOACTIVATE)) && 00213 (TestWF(pwndNext, WFVISIBLE)) && 00214 ((pwndNext->spwndLastActive == NULL) || (!TestWF(pwndNext->spwndLastActive, WFDISABLED)) && 00215 (!fAltEsc || (!TestWF(pwndNext, WEFTOPMOST) && !TestWF(pwndNext, WFBOTTOMMOST))))) { 00216 /* 00217 * If this window is owned, don't return it unless it is the most 00218 * recently active window in its owner/ownee group. 00219 */ 00220 /* 00221 * Hard loop to find top level owner 00222 */ 00223 for (pwndT = pwndNext; pwndT->spwndOwner; pwndT = pwndT->spwndOwner) 00224 ; 00225 00226 /* 00227 * Don't return it unless it is the most recently active 00228 * window in its owner/ownee group. 00229 */ 00230 if (pwndNext == pwndT->spwndLastActive) 00231 return pwndNext; 00232 } 00233 } 00234 }

int _GetPriorityClipboardFormat UINT *  lpPriorityList,
int  cfmts
 

Referenced by NtUserGetPriorityClipboardFormat().

DWORD _GetQueueStatus UINT   ) 
 

Definition at line 4228 of file queue.c.

References DWORD, tagCLIENTTHREADINFO::fsChangeBits, tagCLIENTTHREADINFO::fsWakeBits, tagCLIENTTHREADINFO::fsWakeBitsJournal, tagTHREADINFO::pcti, PtiCurrentShared, and UINT.

Referenced by _GetInputState().

04230 { 04231 PTHREADINFO ptiCurrent; 04232 UINT fsChangeBits; 04233 04234 ptiCurrent = PtiCurrentShared(); 04235 04236 flags &= (QS_ALLINPUT | QS_ALLPOSTMESSAGE | QS_TRANSFER); 04237 04238 fsChangeBits = ptiCurrent->pcti->fsChangeBits; 04239 04240 /* 04241 * Clear out the change bits the app is looking at 04242 * so it'll know what changed since it's last call 04243 * to GetQueueStatus(). 04244 */ 04245 ptiCurrent->pcti->fsChangeBits &= ~flags; 04246 04247 /* 04248 * Return the current change/wake-bits. 04249 */ 04250 return MAKELONG(fsChangeBits & flags, 04251 (ptiCurrent->pcti->fsWakeBits | ptiCurrent->pcti->fsWakeBitsJournal) & flags); 04252 }

BOOL _GetScrollBarInfo PWND  pwnd,
LONG  idObject,
PSCROLLBARINFO  ptbi
 

Definition at line 309 of file winable2.c.

References BOOL, CalcSBStuff(), CalcSBStuff2(), FALSE, GetRect(), GetWndSBDisableFlags(), GRECT_CLIENT, GRECT_CLIENTCOORDS, LTUPFLAG, OffsetRect(), PSBWND, tagSBCALC::pxBottom, tagSBCALC::pxDownArrow, tagSBCALC::pxLeft, tagSBCALC::pxRight, tagSBCALC::pxThumbBottom, tagSBCALC::pxThumbTop, tagSBCALC::pxTop, tagSBCALC::pxUpArrow, tagWND::rcClient, tagWND::rcWindow, RTDNFLAG, TestWF, TRUE, UINT, WFHPRESENT, WFHSCROLL, WFLINEDNBUTTONDOWN, WFLINEUPBUTTONDOWN, WFPAGEDNBUTTONDOWN, WFPAGEUPBUTTONDOWN, WFSCROLLBUTTONDOWN, WFVERTSCROLLTRACK, WFVPRESENT, and WFVSCROLL.

Referenced by NtUserGetScrollBarInfo().

00310 { 00311 UINT wDisable; 00312 BOOL fVertical; 00313 SBCALC SBCalc; 00314 00315 /* 00316 * Validate scrollbarinfo structure 00317 */ 00318 if (psbi->cbSize != sizeof(SCROLLBARINFO)) { 00319 RIPERR1(ERROR_INVALID_PARAMETER, RIP_WARNING, "SCROLLBARINFO.cbSize %d is wrong", psbi->cbSize); 00320 return FALSE; 00321 } 00322 00323 RtlZeroMemory(&psbi->rgstate, sizeof(psbi->rgstate)); 00324 00325 /* 00326 * Calculate where everything is. 00327 */ 00328 if (idObject == OBJID_CLIENT) { 00329 RECT rc; 00330 wDisable = ((PSBWND)pwnd)->wDisableFlags; 00331 fVertical = ((PSBWND)pwnd)->fVert; 00332 GetRect(pwnd, &rc, GRECT_CLIENT | GRECT_CLIENTCOORDS); 00333 CalcSBStuff2(&SBCalc, &rc, (PSBDATA)&((PSBWND)pwnd)->SBCalc, ((PSBWND)pwnd)->fVert); 00334 } else { 00335 /* 00336 * Is this window scrollbar here? 00337 */ 00338 if (idObject == OBJID_VSCROLL) { 00339 fVertical = TRUE; 00340 if (! TestWF(pwnd, WFVSCROLL)) { 00341 // No scrollbar. 00342 psbi->rgstate[INDEX_SCROLLBAR_SELF] |= STATE_SYSTEM_INVISIBLE; 00343 } else if (! TestWF(pwnd, WFVPRESENT)) { 00344 // Window too short to display it. 00345 psbi->rgstate[INDEX_SCROLLBAR_SELF] |= STATE_SYSTEM_OFFSCREEN; 00346 } 00347 } else if (idObject == OBJID_HSCROLL) { 00348 fVertical = FALSE; 00349 if (! TestWF(pwnd, WFHSCROLL)) { 00350 // No scrollbar. 00351 psbi->rgstate[INDEX_SCROLLBAR_SELF] |= STATE_SYSTEM_INVISIBLE; 00352 } else if (! TestWF(pwnd, WFHPRESENT)) { 00353 psbi->rgstate[INDEX_SCROLLBAR_SELF] |= STATE_SYSTEM_OFFSCREEN; 00354 } 00355 } else { 00356 RIPERR1(ERROR_INVALID_PARAMETER, RIP_WARNING, "invalid idObject %d", idObject); 00357 return FALSE; 00358 } 00359 00360 if (psbi->rgstate[INDEX_SCROLLBAR_SELF] & STATE_SYSTEM_INVISIBLE) 00361 return TRUE; 00362 00363 wDisable = GetWndSBDisableFlags(pwnd, fVertical); 00364 00365 if (!(psbi->rgstate[INDEX_SCROLLBAR_SELF] & STATE_SYSTEM_OFFSCREEN)) 00366 CalcSBStuff(pwnd, &SBCalc, fVertical); 00367 } 00368 00369 /* 00370 * Setup button states. 00371 */ 00372 if (wDisable & LTUPFLAG) { 00373 psbi->rgstate[INDEX_SCROLLBAR_UP] |= STATE_SYSTEM_UNAVAILABLE; 00374 psbi->rgstate[INDEX_SCROLLBAR_UPPAGE] |= STATE_SYSTEM_UNAVAILABLE; 00375 } 00376 00377 if (wDisable & RTDNFLAG) { 00378 psbi->rgstate[INDEX_SCROLLBAR_DOWN] |= STATE_SYSTEM_UNAVAILABLE; 00379 psbi->rgstate[INDEX_SCROLLBAR_DOWNPAGE] |= STATE_SYSTEM_UNAVAILABLE; 00380 } 00381 00382 if ((wDisable & (LTUPFLAG | RTDNFLAG)) == (LTUPFLAG | RTDNFLAG)) 00383 psbi->rgstate[INDEX_SCROLLBAR_SELF] |= STATE_SYSTEM_UNAVAILABLE; 00384 00385 /* 00386 * Button pressed? 00387 */ 00388 if (TestWF(pwnd, WFSCROLLBUTTONDOWN) && 00389 ((idObject != OBJID_VSCROLL) || TestWF(pwnd, WFVERTSCROLLTRACK))) { 00390 if (TestWF(pwnd, WFLINEUPBUTTONDOWN)) 00391 psbi->rgstate[INDEX_SCROLLBAR_UP] |= STATE_SYSTEM_PRESSED; 00392 00393 if (TestWF(pwnd, WFPAGEUPBUTTONDOWN)) 00394 psbi->rgstate[INDEX_SCROLLBAR_UPPAGE] |= STATE_SYSTEM_PRESSED; 00395 00396 if (TestWF(pwnd, WFPAGEDNBUTTONDOWN)) 00397 psbi->rgstate[INDEX_SCROLLBAR_DOWNPAGE] |= STATE_SYSTEM_PRESSED; 00398 00399 if (TestWF(pwnd, WFLINEDNBUTTONDOWN)) 00400 psbi->rgstate[INDEX_SCROLLBAR_DOWN] |= STATE_SYSTEM_PRESSED; 00401 } 00402 00403 /* 00404 * Fill in area locations. 00405 */ 00406 if (!(psbi->rgstate[INDEX_SCROLLBAR_SELF] & STATE_SYSTEM_OFFSCREEN)) { 00407 if (fVertical) { 00408 psbi->rcScrollBar.left = SBCalc.pxLeft; 00409 psbi->rcScrollBar.top = SBCalc.pxTop; 00410 psbi->rcScrollBar.right = SBCalc.pxRight; 00411 psbi->rcScrollBar.bottom = SBCalc.pxBottom; 00412 } else { 00413 psbi->rcScrollBar.left = SBCalc.pxTop; 00414 psbi->rcScrollBar.top = SBCalc.pxLeft; 00415 psbi->rcScrollBar.right = SBCalc.pxBottom; 00416 psbi->rcScrollBar.bottom = SBCalc.pxRight; 00417 } 00418 00419 if (idObject == OBJID_CLIENT) { 00420 OffsetRect(&psbi->rcScrollBar, pwnd->rcClient.left, pwnd->rcClient.top); 00421 } else { 00422 OffsetRect(&psbi->rcScrollBar, pwnd->rcWindow.left, pwnd->rcWindow.top); 00423 } 00424 00425 psbi->dxyLineButton = (SBCalc.pxUpArrow - SBCalc.pxTop); 00426 psbi->xyThumbTop = (SBCalc.pxThumbTop - SBCalc.pxTop); 00427 psbi->xyThumbBottom = (SBCalc.pxThumbBottom - SBCalc.pxTop); 00428 00429 /* 00430 * Is the thumb all the way to the left/top? If so, page up is 00431 * not visible. 00432 */ 00433 if (SBCalc.pxThumbTop == SBCalc.pxUpArrow) 00434 psbi->rgstate[INDEX_SCROLLBAR_UPPAGE] |= STATE_SYSTEM_INVISIBLE; 00435 00436 /* 00437 * Is the thumb all the way to the right/down? If so, page down 00438 * is not visible. 00439 */ 00440 if (SBCalc.pxThumbBottom == SBCalc.pxDownArrow) 00441 psbi->rgstate[INDEX_SCROLLBAR_DOWNPAGE] |= STATE_SYSTEM_INVISIBLE; 00442 } 00443 00444 return TRUE; 00445 }

BOOL _GetTextMetricsW HDC  hdc,
LPTEXTMETRICW  ptm
 

Definition at line 1187 of file kernel/server.c.

References BOOL, and fret().

Referenced by GetCharDimensions(), xxxDrawCaptionTemp(), and xxxPSMTextOut().

01190 { 01191 TMW_INTERNAL tmi; 01192 BOOL fret; 01193 01194 fret = GreGetTextMetricsW(hdc, &tmi); 01195 01196 *ptm = tmi.tmw; 01197 01198 return fret; 01199 }

BOOL _GetUserObjectInformation HANDLE  h,
int  nIndex,
PVOID  pvInfo,
DWORD  nLength,
LPDWORD  lpnLengthNeeded
 

Definition at line 626 of file w32/ntuser/kernel/security.c.

References BOOL, CheckHandleFlag(), DWORD, ExDesktopObjectType, ExWindowStationObjectType, FALSE, _OBJECT_HANDLE_INFORMATION::HandleAttributes, HF_DESKTOPHOOK, LogDesktop, _OBJECT_TYPE::Name, NT_SUCCESS, NTSTATUS(), NULL, ObDereferenceObject, OBJECT_TO_OBJECT_HEADER, ObReferenceObjectByHandle(), PBYTE, POBJECT_NAME, tagWINDOWSTATION::psidUser, PtiCurrentShared, RtlLengthSid(), Status, TRUE, _OBJECT_HEADER::Type, UserMode, and WSF_NOIO.

Referenced by NtUserGetObjectInformation().

00632 { 00633 PUSEROBJECTFLAGS puof; 00634 BOOL fSuccess = TRUE; 00635 PVOID pObject; 00636 POBJECT_HEADER pHead; 00637 DWORD dwLengthNeeded = 0; 00638 OBJECT_HANDLE_INFORMATION ohi; 00639 PUNICODE_STRING pstrInfo; 00640 PWINDOWSTATION pwinsta; 00641 NTSTATUS Status; 00642 00643 /* 00644 * Validate the object 00645 */ 00646 Status = ObReferenceObjectByHandle( 00647 h, 00648 0, 00649 NULL, 00650 UserMode, // this is always called from the client side 00651 &pObject, 00652 &ohi); 00653 if (!NT_SUCCESS(Status)) { 00654 RIPNTERR0(Status, RIP_VERBOSE, "ObReferenceObjectByHandle Failed"); 00655 return FALSE; 00656 } 00657 00658 pHead = OBJECT_TO_OBJECT_HEADER(pObject); 00659 if (pHead->Type != *ExWindowStationObjectType && 00660 pHead->Type != *ExDesktopObjectType) { 00661 RIPERR0(ERROR_INVALID_FUNCTION, RIP_WARNING, "Object is not a USER object"); 00662 ObDereferenceObject(pObject); 00663 return FALSE; 00664 } 00665 00666 #ifdef LOGDESKTOPLOCKS 00667 if (OBJECT_TO_OBJECT_HEADER(pObject)->Type == *ExDesktopObjectType) { 00668 LogDesktop(pObject, LD_REF_FN_GETUSEROBJECTINFORMATION, TRUE, (ULONG_PTR)PtiCurrentShared()); 00669 } 00670 #endif 00671 00672 try { 00673 switch (nIndex) { 00674 case UOI_FLAGS: 00675 dwLengthNeeded = sizeof(USEROBJECTFLAGS); 00676 if (nLength < sizeof(USEROBJECTFLAGS)) { 00677 RIPERR0(ERROR_INSUFFICIENT_BUFFER, RIP_VERBOSE, ""); 00678 fSuccess = FALSE; 00679 break; 00680 } 00681 puof = ccxpvInfo; 00682 puof->fInherit = (ohi.HandleAttributes & OBJ_INHERIT) ? TRUE : FALSE; 00683 puof->fReserved = 0; 00684 puof->dwFlags = 0; 00685 if (pHead->Type == *ExDesktopObjectType) { 00686 if (CheckHandleFlag(h, HF_DESKTOPHOOK)) 00687 puof->dwFlags |= DF_ALLOWOTHERACCOUNTHOOK; 00688 } else { 00689 if (!(((PWINDOWSTATION)pObject)->dwWSF_Flags & WSF_NOIO)) 00690 puof->dwFlags |= WSF_VISIBLE; 00691 } 00692 break; 00693 00694 case UOI_NAME: 00695 pstrInfo = POBJECT_NAME(pObject); 00696 goto docopy; 00697 00698 case UOI_TYPE: 00699 pstrInfo = &pHead->Type->Name; 00700 docopy: 00701 if (pstrInfo) { 00702 dwLengthNeeded = pstrInfo->Length + sizeof(WCHAR); 00703 if (dwLengthNeeded > nLength) { 00704 RIPERR0(ERROR_INSUFFICIENT_BUFFER, RIP_VERBOSE, ""); 00705 fSuccess = FALSE; 00706 break; 00707 } 00708 RtlCopyMemory(ccxpvInfo, pstrInfo->Buffer, pstrInfo->Length); 00709 *(PWCHAR)((PBYTE)ccxpvInfo + pstrInfo->Length) = 0; 00710 } else { 00711 dwLengthNeeded = 0; 00712 } 00713 break; 00714 00715 case UOI_USER_SID: 00716 if (pHead->Type == *ExWindowStationObjectType) 00717 pwinsta = pObject; 00718 else 00719 pwinsta = ((PDESKTOP)pObject)->rpwinstaParent; 00720 if (pwinsta->psidUser == NULL) { 00721 dwLengthNeeded = 0; 00722 } else { 00723 dwLengthNeeded = RtlLengthSid(pwinsta->psidUser); 00724 if (dwLengthNeeded > nLength) { 00725 RIPERR0(ERROR_INSUFFICIENT_BUFFER, RIP_VERBOSE, ""); 00726 fSuccess = FALSE; 00727 break; 00728 } 00729 RtlCopyMemory(ccxpvInfo, pwinsta->psidUser, dwLengthNeeded); 00730 } 00731 break; 00732 00733 default: 00734 RIPERR0(ERROR_INVALID_PARAMETER, RIP_VERBOSE, ""); 00735 fSuccess = FALSE; 00736 break; 00737 } 00738 } except (W32ExceptionHandler(TRUE, RIP_WARNING)) { 00739 fSuccess = FALSE; 00740 } 00741 00742 *lpnLengthNeeded = dwLengthNeeded; 00743 00744 #ifdef LOGDESKTOPLOCKS 00745 if (OBJECT_TO_OBJECT_HEADER(pObject)->Type == *ExDesktopObjectType) { 00746 LogDesktop(pObject, LD_DEREF_FN_GETUSEROBJECTINFORMATION, FALSE, (ULONG_PTR)PtiCurrentShared()); 00747 } 00748 #endif 00749 00750 ObDereferenceObject(pObject); 00751 00752 return fSuccess; 00753 }

DWORD _GetWindowContextHelpId PWND  pwnd  ) 
 

Definition at line 15 of file kernel/help.c.

References _GetProp(), tagSERVERINFO::atomContextHelpIdProp, DWORD, gpsi, MAKEINTATOM, and PROPF_INTERNAL.

00016 { 00017 return (DWORD)(ULONG_PTR)_GetProp(pWnd, MAKEINTATOM(gpsi->atomContextHelpIdProp), 00018 PROPF_INTERNAL); 00019 }

HDC _GetWindowDC PWND  pwnd  ) 
 

Definition at line 201 of file dc.c.

References _GetDCEx(), NULL, TestWF, WFMINIMIZED, and WFWIN40COMPAT.

Referenced by _UserSoundSentryWorker(), DrawCtlThumb(), InvertScrollHilite(), NtUserGetWindowDC(), xxxDrawThumb(), xxxEnableWndSBArrows(), xxxMNInvertItem(), xxxMoveThumb(), xxxRedrawTitle(), xxxSBWndProc(), xxxSnapWindow(), and zzzDrawInvertScrollArea().

00203 { 00204 00205 #if 0 00206 00207 /* 00208 * For WIN31 and previous apps, we want to actually return back a 00209 * client DC. Before WIN40, the window rect and client rect were the 00210 * same, and there was this terrible hack to grab the window dc when 00211 * painting because window DCs never clip anything. Otherwise the 00212 * children of the minimized window would be clipped out of the fake 00213 * client area. So apps would call GetWindowDC() to redraw their icons, 00214 * since GetDC() would clip empty if the window had a class icon. 00215 */ 00216 if (TestWF(pwnd, WFMINIMIZED) && !TestWF(pwnd, WFWIN40COMPAT)) 00217 return(_GetDCEx(pwnd, hrgnClip, DCX_INTERNAL | DCX_CACHE | DCX_USESTYLE)); 00218 #endif 00219 00220 return _GetDCEx(pwnd, NULL, DCX_WINDOW | DCX_USESTYLE); 00221 }

BOOL _GetWindowPlacement PWND  pwnd,
PWINDOWPLACEMENT  pwp
 

Definition at line 679 of file kernel/winmgr.c.

References _MonitorFromRect(), BOOL, CopyRect, FALSE, tagCHECKPOINT::fDragged, tagCHECKPOINT::fMaxInitialized, tagCHECKPOINT::fMinInitialized, tagCHECKPOINT::fWasMaximizedBeforeMinimized, OffsetRect(), tagCHECKPOINT::ptMax, tagCHECKPOINT::ptMin, PWNDDESKTOP, tagMONITOR::rcMonitor, tagCHECKPOINT::rcNormal, tagMONITOR::rcWork, tagWND::spwndParent, TestWF, TestwndChild, TRUE, UpdateCheckpoint(), WEFTOOLWINDOW, WFMAXIMIZED, WFMINIMIZED, and WFREALLYMAXIMIZABLE.

Referenced by NtUserGetInternalWindowPos(), and NtUserGetWindowPlacement().

00682 { 00683 CHECKPOINT * pcp; 00684 00685 /* 00686 * this will set the normal or the minimize point in the checkpoint, 00687 * so that all elements will be up to date. 00688 */ 00689 pcp = UpdateCheckpoint(pwnd); 00690 00691 if (!pcp) 00692 return FALSE; 00693 00694 if (TestWF(pwnd, WFMINIMIZED)) { 00695 pwp->showCmd = SW_SHOWMINIMIZED; 00696 } else if (TestWF(pwnd, WFMAXIMIZED)) { 00697 pwp->showCmd = SW_SHOWMAXIMIZED; 00698 } else { 00699 pwp->showCmd = SW_SHOWNORMAL; 00700 } 00701 00702 CopyRect(&pwp->rcNormalPosition, &pcp->rcNormal); 00703 00704 if (pcp->fMinInitialized) { 00705 pwp->ptMinPosition = pcp->ptMin; 00706 } else { 00707 pwp->ptMinPosition.x = pwp->ptMinPosition.y = -1; 00708 } 00709 00710 /* 00711 * We never ever save the position of "normal" maximized windows. Other 00712 * wise, when the size border changes dimensions, the max pos would be 00713 * invalid, and you would never be able to reset it. 00714 */ 00715 if (pcp->fMaxInitialized && !TestWF(pwnd, WFREALLYMAXIMIZABLE)) { 00716 pwp->ptMaxPosition = pcp->ptMax; 00717 } else { 00718 pwp->ptMaxPosition.x = pwp->ptMaxPosition.y = -1; 00719 } 00720 00721 if ((pwnd->spwndParent == PWNDDESKTOP(pwnd)) && 00722 !TestWF(pwnd, WEFTOOLWINDOW)) { 00723 00724 PMONITOR pMonitor; 00725 00726 pMonitor = _MonitorFromRect(&pwp->rcNormalPosition, MONITOR_DEFAULTTOPRIMARY); 00727 00728 /* 00729 * Convert min, normal positions to be relative to the working area. 00730 * The max pos already is (always is saved that way). 00731 * 00732 * working area, except for maximized position, which is always 00733 * working area relative. 00734 */ 00735 if (pcp->fMinInitialized) { 00736 pwp->ptMinPosition.x -= (pMonitor->rcWork.left - pMonitor->rcMonitor.left); 00737 pwp->ptMinPosition.y -= (pMonitor->rcWork.top - pMonitor->rcMonitor.top); 00738 } 00739 00740 OffsetRect(&pwp->rcNormalPosition, 00741 pMonitor->rcMonitor.left - pMonitor->rcWork.left, 00742 pMonitor->rcMonitor.top - pMonitor->rcWork.top); 00743 } 00744 00745 pwp->flags = 0; 00746 00747 /* 00748 * B#3276 00749 * Don't allow WPF_SETMINPOSITION on top-level windows. 00750 */ 00751 if (TestwndChild(pwnd) && pcp->fDragged) 00752 pwp->flags |= WPF_SETMINPOSITION; 00753 00754 if (pcp->fWasMaximizedBeforeMinimized || TestWF(pwnd, WFMAXIMIZED)) 00755 pwp->flags |= WPF_RESTORETOMAXIMIZED; 00756 00757 pwp->length = sizeof(WINDOWPLACEMENT); 00758 00759 return TRUE; 00760 }

BOOL _GetWinStationInfo WSINFO *  pWsInfo  ) 
 

Definition at line 872 of file w32/ntuser/kernel/misc.c.

References CheckCritIn, DATAALIGN, FALSE, gWinStationInfo, ProbeForWrite(), and TRUE.

00874 { 00875 CheckCritIn(); 00876 00877 try { 00878 00879 ProbeForWrite(pWsInfo, sizeof(gWinStationInfo), DATAALIGN); 00880 RtlCopyMemory(pWsInfo, &gWinStationInfo, sizeof(gWinStationInfo)); 00881 00882 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00883 return FALSE; 00884 } 00885 00886 return TRUE; 00887 }

PCLS _GetWOWClass HANDLE  hModule,
LPCWSTR  lpszClassName
 

Definition at line 616 of file class.c.

References CheckCritInShared, GetClassPtr(), NULL, tagCLS::pclsClone, tagCLS::pclsNext, tagTHREADINFO::ppi, PtiCurrentShared, tagTHREADINFO::rpdesk, tagCLS::rpdeskParent, and UserFindAtom().

Referenced by NtUserGetWOWClass().

00619 { 00620 PCLS pcls; 00621 PPCLS ppcls = NULL; 00622 ATOM atomT; 00623 PTHREADINFO ptiCurrent; 00624 00625 CheckCritInShared(); 00626 00627 ptiCurrent = PtiCurrentShared(); 00628 00629 /* 00630 * Is this class registered as a private class? 00631 */ 00632 atomT = UserFindAtom(ccxlpszClassName); 00633 if (atomT != 0) 00634 ppcls = GetClassPtr(atomT, ptiCurrent->ppi, hModule); 00635 if (ppcls == NULL) { 00636 RIPERR0(ERROR_CLASS_DOES_NOT_EXIST, RIP_VERBOSE, ""); 00637 return NULL; 00638 } 00639 00640 pcls = *ppcls; 00641 00642 if (ptiCurrent->rpdesk != pcls->rpdeskParent) { 00643 pcls = pcls->pclsClone; 00644 while (pcls != NULL) { 00645 if (ptiCurrent->rpdesk == pcls->rpdeskParent) { 00646 goto Done; 00647 } 00648 pcls = pcls->pclsNext; 00649 } 00650 RIPERR0(ERROR_CLASS_DOES_NOT_EXIST, RIP_VERBOSE, ""); 00651 return NULL; 00652 } 00653 Done: 00654 return pcls; 00655 }

BOOL _ImpersonateDdeClientWindow PWND  pwndClient,
PWND  pwndServer
 

Definition at line 2256 of file kernel/ddetrack.c.

References BOOL, tagDDEIMP::ClientContext, FALSE, FindDdeConv(), NT_SUCCESS, NTSTATUS(), NULL, tagDDECONV::pddei, PsGetCurrentThread, SeImpersonateClientEx(), Status, and TRUE.

Referenced by NtUserImpersonateDdeClientWindow().

02259 { 02260 PDDECONV pDdeConv; 02261 NTSTATUS Status; 02262 02263 /* 02264 * Locate token used in the conversation 02265 */ 02266 pDdeConv = FindDdeConv(pwndClient, pwndServer); 02267 if (pDdeConv == NULL || pDdeConv->pddei == NULL) 02268 return(FALSE); 02269 02270 /* 02271 * Stick the token into the dde server thread 02272 */ 02273 Status = SeImpersonateClientEx(&pDdeConv->pddei->ClientContext, 02274 PsGetCurrentThread()); 02275 if (!NT_SUCCESS(Status)) { 02276 RIPNTERR0(Status, RIP_VERBOSE, ""); 02277 return FALSE; 02278 } 02279 return TRUE; 02280 }

PSBINFO _InitPwSB PWND   ) 
 

Definition at line 183 of file miscutil.c.

References DesktopAlloc(), DTAG_SBINFO, tagWND::head, tagSBINFO::Horz, NULL, tagSBDATA::posMax, tagWND::pSBInfo, SBINFO, and tagSBINFO::Vert.

Referenced by CalcSBStuff(), xxxDefWindowProc(), xxxEnableWndSBArrows(), xxxSetScrollBar(), and xxxShowScrollBar().

00185 { 00186 if (pwnd->pSBInfo) { 00187 00188 /* 00189 * If memory is already allocated, don't bother to do it again. 00190 */ 00191 return pwnd->pSBInfo; 00192 } 00193 00194 pwnd->pSBInfo = (PSBINFO)DesktopAlloc(pwnd->head.rpdesk, 00195 sizeof(SBINFO), 00196 DTAG_SBINFO); 00197 00198 if (pwnd->pSBInfo != NULL) { 00199 00200 /* 00201 * rgw[0] = 0; */ /* LPTR zeros all 6 words 00202 */ 00203 00204 /* 00205 * rgw[1] = 0; 00206 */ 00207 00208 /* 00209 * rgw[3] = 0; 00210 */ 00211 00212 /* 00213 * rgw[4] = 0; 00214 */ 00215 pwnd->pSBInfo->Vert.posMax = 100; 00216 pwnd->pSBInfo->Horz.posMax = 100; 00217 } 00218 00219 return pwnd->pSBInfo; 00220 }

PPCLS _InnerGetClassPtr ATOM  atom,
PPCLS  ppclsList,
HANDLE  hModule
 

Definition at line 997 of file class.c.

References CSF_WOWDEFERDESTROY, and NULL.

Referenced by _UnregisterClass(), GetClassPtr(), and InternalRegisterClassEx().

01001 { 01002 if (atom == 0) 01003 return NULL; 01004 01005 while (*ppcls != NULL) { 01006 if ((*ppcls)->atomClassName == atom && 01007 (hModule == NULL || HIWORD((ULONG_PTR)(*ppcls)->hModule) == HIWORD((ULONG_PTR)hModule)) && 01008 !((*ppcls)->CSF_flags & CSF_WOWDEFERDESTROY)) { 01009 return ppcls; 01010 } 01011 01012 ppcls = (PPCLS)*ppcls; 01013 } 01014 01015 return NULL; 01016 }

BOOL _InternalGetIconInfo IN PCURSOR  pcur,
OUT PICONINFO  piconinfo,
OUT OPTIONAL PUNICODE_STRING  pstrModName,
OUT OPTIONAL PUNICODE_STRING  pstrResName,
OUT OPTIONAL LPDWORD  pbpp,
IN BOOL  fInternalCursor
 

Definition at line 395 of file loadbits.c.

References BOOL, CURSORF_ACON, FALSE, ghdcMem, ghdcMem2, HDCBITS, IS_PTR, NULL, PTR_TO_ID, RtlCopyUnicodeString(), TRUE, UserGetAtomName(), and USHORT.

Referenced by GetCursorHeight(), and NtUserGetIconInfo().

00402 { 00403 HBITMAP hbmBitsT; 00404 HBITMAP hbmDstT; 00405 HBITMAP hbmMask; 00406 HBITMAP hbmColor; 00407 00408 /* 00409 * Note -- while the STRING structures are in kernel mode memory, the 00410 * buffers are in user-mode memory. So all use of the buffers should 00411 * be protected bytry blocks. 00412 */ 00413 00414 /* 00415 * If this is an animated cursor, just grab the first frame and return 00416 * the info for it. 00417 */ 00418 if (pcur->CURSORF_flags & CURSORF_ACON) 00419 pcur = ((PACON)pcur)->aspcur[0]; 00420 00421 /* 00422 * Make copies of the bitmaps 00423 * 00424 * If the color bitmap is around, then there is no XOR mask in the 00425 * hbmMask bitmap. 00426 */ 00427 hbmMask = GreCreateBitmap( 00428 pcur->cx, 00429 (pcur->hbmColor && !fInternalCursor) ? pcur->cy / 2 : pcur->cy, 00430 1, 00431 1, 00432 NULL); 00433 00434 if (hbmMask == NULL) 00435 return FALSE; 00436 00437 00438 hbmColor = NULL; 00439 00440 if (pcur->hbmColor != NULL) { 00441 00442 hbmColor = GreCreateCompatibleBitmap(HDCBITS(), 00443 pcur->cx, 00444 pcur->cy / 2); 00445 00446 if (hbmColor == NULL) { 00447 GreDeleteObject(hbmMask); 00448 return FALSE; 00449 } 00450 } 00451 00452 hbmBitsT = GreSelectBitmap(ghdcMem2, pcur->hbmMask); 00453 hbmDstT = GreSelectBitmap(ghdcMem, hbmMask); 00454 00455 GreBitBlt(ghdcMem, 00456 0, 00457 0, 00458 pcur->cx, 00459 (pcur->hbmColor && !fInternalCursor) ? pcur->cy / 2 : pcur->cy, 00460 ghdcMem2, 00461 0, 00462 0, 00463 SRCCOPY, 00464 0x00ffffff); 00465 00466 if (hbmColor != NULL) { 00467 00468 GreSelectBitmap(ghdcMem2, pcur->hbmColor); 00469 GreSelectBitmap(ghdcMem, hbmColor); 00470 00471 GreBitBlt(ghdcMem, 00472 0, 00473 0, 00474 pcur->cx, 00475 pcur->cy / 2, 00476 ghdcMem2, 00477 0, 00478 0, 00479 SRCCOPY, 00480 0); 00481 } 00482 00483 GreSelectBitmap(ghdcMem2, hbmBitsT); 00484 GreSelectBitmap(ghdcMem, hbmDstT); 00485 00486 /* 00487 * Fill in the iconinfo structure. make copies of the bitmaps. 00488 */ 00489 try { 00490 00491 ccxpiconinfo->fIcon = (pcur->rt == PTR_TO_ID(RT_ICON)); 00492 ccxpiconinfo->xHotspot = pcur->xHotspot; 00493 ccxpiconinfo->yHotspot = pcur->yHotspot; 00494 ccxpiconinfo->hbmMask = hbmMask; 00495 ccxpiconinfo->hbmColor = hbmColor; 00496 00497 if (pstrInstanceName != NULL) { 00498 00499 if (pcur->atomModName) { 00500 pstrInstanceName->Length = (USHORT) 00501 UserGetAtomName(pcur->atomModName, 00502 pstrInstanceName->Buffer, 00503 (int) (pstrInstanceName->MaximumLength / sizeof(WCHAR)) 00504 * sizeof(WCHAR)); 00505 } else { 00506 pstrInstanceName->Length = 0; 00507 } 00508 } 00509 00510 if (pstrResName != NULL) { 00511 00512 if (IS_PTR(pcur->strName.Buffer)) { 00513 RtlCopyUnicodeString(pstrResName, &pcur->strName); 00514 } else { 00515 *pstrResName = pcur->strName; 00516 } 00517 } 00518 00519 if (ccxpbpp) 00520 *ccxpbpp = pcur->bpp; 00521 00522 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00523 GreDeleteObject(hbmMask); 00524 GreDeleteObject(hbmColor); 00525 return FALSE; 00526 } 00527 00528 return TRUE; 00529 }

BOOL _IsClipboardFormatAvailable UINT  fmt  ) 
 

NTSTATUS _KeUserModeCallback IN ULONG  ApiNumber,
IN PVOID  InputBuffer,
IN ULONG  InputLength,
OUT PVOID *  OutputBuffer,
OUT PULONG  OutputLength
 

BOOL _KillSystemTimer PWND  pwnd,
UINT_PTR  nIDEvent
 

Definition at line 431 of file timers.c.

References BOOL, KillTimer2(), and TRUE.

Referenced by _SetCaretBlinkTime(), CaretBlinkProc(), DecrementRedirectedCount(), StopFade(), TrackMouseEvent(), xxxCancelMouseMoveTracking(), xxxEndScroll(), xxxFlashWindow(), xxxSystemTimerProc(), zzzInternalDestroyCaret(), and zzzSetCaretPos().

00434 { 00435 return KillTimer2(pwnd, nIDEvent, TRUE); 00436 }

BOOL _KillTimer PWND  pwnd,
UINT_PTR  nIDEvent
 

Definition at line 414 of file timers.c.

References BOOL, FALSE, and KillTimer2().

Referenced by KillTooltipTimer(), MNAnimate(), NtUserKillTimer(), xxxMenuWindowProc(), xxxMNCloseHierarchy(), xxxMNDestroyHandler(), xxxMNDoScroll(), xxxMNOpenHierarchy(), xxxMNSelectItem(), and xxxTrackPopupMenuEx().

00417 { 00418 return KillTimer2(pwnd, nIDEvent, FALSE); 00419 }

VOID _LoadCursorsAndIcons VOID   ) 
 

Definition at line 1568 of file w32/ntuser/kernel/init.c.

References CURSORF_LRSHARED, FALSE, gasyscur, gasysico, gpcurFirst, gpepCSRSS, gpsi, HH_LOADCURSORS, HYDRA_HINT, tagSYSCFGICO::Id, IS_PTR, Lock, NULL, PsGetCurrentProcess, PtoH, PTR_TO_ID, SYSICO, SYSMET, and VOID().

01569 { 01570 PCURSOR pcur; 01571 int i; 01572 01573 pcur = gpcurFirst; 01574 01575 /* 01576 * Only CSR can call this (and only once). 01577 */ 01578 if (PsGetCurrentProcess() != gpepCSRSS) { 01579 return; 01580 } 01581 01582 HYDRA_HINT(HH_LOADCURSORS); 01583 01584 while (pcur) { 01585 01586 UserAssert(!IS_PTR(pcur->strName.Buffer)); 01587 01588 switch (pcur->rt) { 01589 case RT_ICON: 01590 UserAssert((LONG_PTR)pcur->strName.Buffer >= OIC_FIRST_DEFAULT); 01591 01592 UserAssert((LONG_PTR)pcur->strName.Buffer < 01593 OIC_FIRST_DEFAULT + COIC_CONFIGURABLE); 01594 01595 i = PTR_TO_ID(pcur->strName.Buffer) - OIC_FIRST_DEFAULT; 01596 pcur->strName.Buffer = (LPWSTR)gasysico[i].Id; 01597 01598 if (pcur->CURSORF_flags & CURSORF_LRSHARED) { 01599 UserAssert(gasysico[i].spcur == NULL); 01600 Lock(&gasysico[i].spcur, pcur); 01601 } else { 01602 UserAssert(gpsi->hIconSmWindows == NULL); 01603 UserAssert((int)pcur->cx == SYSMET(CXSMICON)); 01604 /* 01605 * The special small winlogo icon is not shared. 01606 */ 01607 gpsi->hIconSmWindows = PtoH(pcur); 01608 } 01609 break; 01610 01611 case RT_CURSOR: 01612 UserAssert((LONG_PTR)pcur->strName.Buffer >= OCR_FIRST_DEFAULT); 01613 01614 UserAssert((LONG_PTR)pcur->strName.Buffer < 01615 OCR_FIRST_DEFAULT + COCR_CONFIGURABLE); 01616 01617 i = PTR_TO_ID(pcur->strName.Buffer) - OCR_FIRST_DEFAULT; 01618 pcur->strName.Buffer = (LPWSTR)gasyscur[i].Id; 01619 Lock(&gasyscur[i].spcur ,pcur); 01620 break; 01621 01622 default: 01623 UserAssert(FALSE); // should be nothing in the cache but these! 01624 } 01625 01626 pcur = pcur->pcurNext; 01627 } 01628 01629 /* 01630 * copy special icon handles to global spots for later use. 01631 */ 01632 gpsi->hIcoWindows = PtoH(SYSICO(WINLOGO)); 01633 }

BOOL _LockSetForegroundWindow UINT  uLockCode  ) 
 

Definition at line 1167 of file focusact.c.

References BOOL, CanForceForeground(), DWORD, FALSE, gppiLockSFW, NULL, PpiCurrent, and TRUE.

01169 { 01170 DWORD dwError; 01171 PPROCESSINFO ppiCurrent = PpiCurrent(); 01172 01173 switch (uLockCode) { 01174 case LSFW_LOCK: 01175 /* 01176 * If the caller cannot lock it or already locked, fail the call 01177 */ 01178 if (CanForceForeground(ppiCurrent) && (gppiLockSFW == NULL)) { 01179 gppiLockSFW = ppiCurrent; 01180 TAGMSG1(DBGTAG_FOREGROUND, "_LockSetForegroundWindow locked by %#p", ppiCurrent); 01181 } else { 01182 dwError = ERROR_ACCESS_DENIED; 01183 goto FailIt; 01184 } 01185 break; 01186 01187 case LSFW_UNLOCK: 01188 /* 01189 * If the caller didn't lock it, fail the call 01190 */ 01191 if (ppiCurrent == gppiLockSFW) { 01192 gppiLockSFW = NULL; 01193 TAGMSG0(DBGTAG_FOREGROUND, "_LockSetForegroundWindow UNLOCKED"); 01194 } else { 01195 dwError = ERROR_ACCESS_DENIED; 01196 goto FailIt; 01197 } 01198 break; 01199 01200 default: 01201 dwError = ERROR_INVALID_PARAMETER; 01202 goto FailIt; 01203 } 01204 01205 return TRUE; 01206 01207 FailIt: 01208 RIPERR0(dwError, RIP_VERBOSE, ""); 01209 return FALSE; 01210 }

UINT _LockWindowStation PWINDOWSTATION  pwinsta  ) 
 

Definition at line 57 of file logon.c.

References BOOL, tagWINDOWSTATION::dwWSF_Flags, FALSE, GetCurrentProcessId, gpidLogon, grpdeskLogon, NULL, OBJECT_TO_OBJECT_HEADER, tagWINDOWSTATION::rpdeskList, tagDESKTOP::rpdeskNext, TRUE, UINT, WSF_OPENLOCK, WSF_SHUTDOWN, and WSF_SWITCHLOCK.

Referenced by NtUserLockWindowStation().

00059 { 00060 PDESKTOP pdesk; 00061 BOOL fBusy = FALSE; 00062 00063 /* 00064 * Make sure the caller is the logon process 00065 */ 00066 if (GetCurrentProcessId() != gpidLogon) { 00067 RIPERR0(ERROR_ACCESS_DENIED, 00068 RIP_WARNING, 00069 "Access denied in _LockWindowStation"); 00070 00071 return WSS_ERROR; 00072 } 00073 00074 /* 00075 * Prevent desktop switches 00076 */ 00077 pwinsta->dwWSF_Flags |= WSF_SWITCHLOCK; 00078 00079 /* 00080 * Determine whether the station is busy 00081 */ 00082 pdesk = pwinsta->rpdeskList; 00083 while (pdesk != NULL) { 00084 if (pdesk != grpdeskLogon && 00085 OBJECT_TO_OBJECT_HEADER(pdesk)->HandleCount != 0) { 00086 00087 /* 00088 * This desktop is open, thus the station is busy 00089 */ 00090 fBusy = TRUE; 00091 break; 00092 } 00093 pdesk = pdesk->rpdeskNext; 00094 } 00095 00096 if (pwinsta->dwWSF_Flags & WSF_SHUTDOWN) 00097 pwinsta->dwWSF_Flags |= WSF_OPENLOCK; 00098 00099 /* 00100 * Unlock opens if the station is busy and is not in the middle 00101 * of shutting down. 00102 */ 00103 if (fBusy) 00104 return WSS_BUSY; 00105 else 00106 return WSS_IDLE; 00107 }

BOOL _LockWorkStation VOID   ) 
 

Definition at line 1517 of file winsta.c.

References _PostMessage(), BOOL, gspwndLogonNotify, NULL, and TRUE.

Referenced by NtUserLockWorkStation().

01519 { 01520 UserAssert(gspwndLogonNotify != NULL); 01521 01522 _PostMessage(gspwndLogonNotify, 01523 WM_LOGONNOTIFY, LOGON_LOCKWORKSTATION, 0); 01524 01525 return TRUE; 01526 }

PVOID _MapDesktopObject HANDLE  h  ) 
 

Definition at line 2798 of file desktop.c.

References GetDesktopView(), HMObjectFlags, HMValidateHandle(), NULL, OCF_DESKTOPHEAP, PBYTE, PDESKOBJHEAD, PpiCurrent, TYPE_GENERIC, and tagDESKTOPVIEW::ulClientDelta.

02800 { 02801 PDESKOBJHEAD pobj; 02802 PDESKTOPVIEW pdv; 02803 02804 /* 02805 * Validate the handle 02806 */ 02807 pobj = HMValidateHandle(h, TYPE_GENERIC); 02808 if (pobj == NULL) 02809 return NULL; 02810 02811 UserAssert(HMObjectFlags(pobj) & OCF_DESKTOPHEAP); 02812 02813 /* 02814 * Locate the client's view of the desktop. Realistically, 02815 * this should never fail for valid objects. 02816 */ 02817 pdv = GetDesktopView(PpiCurrent(), pobj->rpdesk); 02818 if (pdv == NULL) { 02819 RIPMSG1(RIP_WARNING, "MapDesktopObject: can not map handle %#p", h); 02820 return NULL; 02821 } 02822 02823 UserAssert(pdv->ulClientDelta != 0); 02824 return (PVOID)((PBYTE)pobj - pdv->ulClientDelta); 02825 }

__inline UINT _MNGetpItemIndex PMENU  pmenu,
PITEM  pitem
 

Definition at line 4894 of file userk.h.

References UINT.

04905 {return (UINT)(((ULONG_PTR)pitem - (ULONG_PTR)pmenu->rgItems) / sizeof(ITEM));}

HWINSTA _OpenWindowStation POBJECT_ATTRIBUTES  ,
DWORD  ,
KPROCESSOR_MODE 
 

Definition at line 1019 of file winsta.c.

References ExWindowStationObjectType, NT_SUCCESS, NTSTATUS(), NULL, ObOpenObjectByName(), and Status.

Referenced by _UserTestForWinStaAccess(), NtUserOpenWindowStation(), xxxResolveDesktop(), and xxxResolveDesktopForWOW().

01023 { 01024 HWINSTA hwinsta; 01025 NTSTATUS Status; 01026 01027 /* 01028 * Obja is client-side. Ob interfaces protect and capture is 01029 * appropriate. 01030 */ 01031 Status = ObOpenObjectByName( 01032 pObjA, 01033 *ExWindowStationObjectType, 01034 AccessMode, 01035 NULL, 01036 dwDesiredAccess, 01037 NULL, 01038 &hwinsta); 01039 if (!NT_SUCCESS(Status)) { 01040 RIPNTERR0(Status, RIP_VERBOSE, ""); 01041 hwinsta = NULL; 01042 } 01043 return hwinsta; 01044 }

BOOL _PostMessage PWND  pwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 981 of file ntuser/kernel/input.c.

References _PostThreadMessage(), AdjustForCoalescing(), AllocQEntry(), BMSG_POSTMSG, BOOL, DO_POST, DWORD, FALSE, GETPTI, HWq, tagQ::idSysLock, tagTHREADINFO::mlPost, NULL, PostUpdateKeyStateEvent(), tagTHREADINFO::pq, PtiCurrent, tagQ::ptiSysLock, PWND_BROADCAST, SetWakeBit(), StoreQMessage(), TESTSYNCONLYMESSAGE, ThreadLockAlwaysWithPti, ThreadUnlock, TRUE, xxxBroadcastMessage(), and xxxDDETrackPostHook().

Referenced by _LockWorkStation(), AbnormalDDEPost(), DestroyTask(), FreeDdeConv(), HighContrastHotKey(), IdleTimerProc(), NotifyLogon(), NtUserEndMenu(), NtUserPostMessage(), PlayEventSound(), PostAccessNotification(), PostShellHookMessages(), RemoteLogoff(), RemoteNtSecurity(), StartScreenSaver(), TrackMouseEvent(), xxxAccessTimeOutTimer(), xxxButtonEvent(), xxxCancelMouseMoveTracking(), xxxCancelTrackingForThread(), xxxDDETrackSendHook(), xxxDDETrackWindowDying(), xxxDefWindowProc(), xxxDestroyThreadInfo(), xxxDoHotKeyStuff(), xxxDWP_ProcessVirtKey(), xxxFlashWindow(), xxxHandleMenuMessages(), xxxImmProcessKey(), xxxMenuWindowProc(), xxxMessageBeep(), xxxMinMaximize(), xxxMNCancel(), xxxMNLoop(), xxxMNStartMenuState(), xxxNextWindow(), xxxOldNextWindow(), xxxProcessEventMessage(), xxxRemoteDisconnect(), xxxRemoteReconnect(), xxxScanSysQueue(), xxxSendBSMtoDesktop(), xxxSysCommand(), xxxSystemParametersInfo(), xxxSystemTimerProc(), xxxTranslateMessage(), and xxxUserPowerEventCalloutWorker().

00986 { 00987 PQMSG pqmsg; 00988 BOOL fPwndUnlock; 00989 BOOL fRet; 00990 DWORD dwPostCode; 00991 TL tlpwnd; 00992 PTHREADINFO pti; 00993 00994 /* 00995 * First check to see if this message takes DWORDs only. If it does not, 00996 * fail the post. Cannot allow an app to post a message with pointers or 00997 * handles in it - this can cause the server to fault and cause other 00998 * problems - such as causing apps in separate address spaces to fault. 00999 * (or even an app in the same address space to fault!) 01000 */ 01001 if (TESTSYNCONLYMESSAGE(message, wParam)) { 01002 RIPERR1(ERROR_MESSAGE_SYNC_ONLY, 01003 RIP_WARNING, 01004 "Invalid parameter \"message\" (%ld) to _PostMessage", 01005 message); 01006 01007 return FALSE; 01008 } 01009 01010 /* 01011 * Is this a BroadcastMsg()? 01012 */ 01013 if (pwnd == PWND_BROADCAST) { 01014 xxxBroadcastMessage(NULL, message, wParam, lParam, BMSG_POSTMSG, NULL); 01015 return TRUE; 01016 } 01017 01018 pti = PtiCurrent(); 01019 01020 /* 01021 * Is this posting to the current thread info? 01022 */ 01023 if (pwnd == NULL) { 01024 return _PostThreadMessage(pti, message, wParam, lParam); 01025 } 01026 01027 fPwndUnlock = FALSE; 01028 if (message >= WM_DDE_FIRST && message <= WM_DDE_LAST) { 01029 ThreadLockAlwaysWithPti(pti, pwnd, &tlpwnd); 01030 dwPostCode = xxxDDETrackPostHook(&message, pwnd, wParam, &lParam, FALSE); 01031 01032 if (dwPostCode != DO_POST) { 01033 ThreadUnlock(&tlpwnd); 01034 return (BOOL)dwPostCode; 01035 } 01036 01037 fPwndUnlock = TRUE; 01038 } 01039 01040 pti = GETPTI(pwnd); 01041 01042 /* 01043 * Check to see if this message is in the multimedia coalescing range. 01044 * If so, see if it can be coalesced with the previous message. 01045 */ 01046 AdjustForCoalescing(&pti->mlPost, HWq(pwnd), message); 01047 01048 /* 01049 * Allocate a key state update event if needed. 01050 */ 01051 if (message >= WM_KEYFIRST && message <= WM_KEYLAST) { 01052 PostUpdateKeyStateEvent(pti->pq); 01053 } 01054 01055 /* 01056 * Put this message on the 'post' list. 01057 */ 01058 fRet = FALSE; 01059 if ((pqmsg = AllocQEntry(&pti->mlPost)) != NULL) { 01060 /* 01061 * Set the QS_POSTMESSAGE bit so the thread knows it has a message. 01062 */ 01063 StoreQMessage(pqmsg, pwnd, message, wParam, lParam, 0, 0, 0); 01064 SetWakeBit(pti, QS_POSTMESSAGE | QS_ALLPOSTMESSAGE); 01065 01066 /* 01067 * If it's a hotkey, set the QS_HOTKEY bit since we have a separate 01068 * bit for those messages. 01069 */ 01070 if (message == WM_HOTKEY) 01071 SetWakeBit(pti, QS_HOTKEY); 01072 01073 fRet = TRUE; 01074 } else { 01075 RIPMSG1(RIP_WARNING, "_PostMessage: Failed to alloc Q entry: target pti=0x%p", 01076 pti); 01077 } 01078 01079 /* 01080 * Are we posting to the thread currently reading from the input queue? 01081 * If so, update idSysLock with this pqmsg so that the input queue will 01082 * not be unlocked until this message is read. 01083 */ 01084 if (pti == pti->pq->ptiSysLock) 01085 pti->pq->idSysLock = (ULONG_PTR)pqmsg; 01086 01087 if (fPwndUnlock) 01088 ThreadUnlock(&tlpwnd); 01089 01090 return fRet; 01091 }

BOOL _PostQuitMessage int  nExitCode  ) 
 

Definition at line 1109 of file ntuser/kernel/input.c.

References BOOL, IPostQuitMessage(), and PtiCurrent.

Referenced by xxxFreeWindow().

01110 { 01111 return IPostQuitMessage(PtiCurrent(), nExitCode); 01112 }

BOOL _PostThreadMessage PTHREADINFO  pti,
UINT  message,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 1123 of file ntuser/kernel/input.c.

References AdjustForCoalescing(), AllocQEntry(), BOOL, FALSE, tagQ::idSysLock, tagTHREADINFO::mlPost, NULL, tagTHREADINFO::pq, tagQ::ptiSysLock, SetWakeBit(), StoreQMessage(), TESTSYNCONLYMESSAGE, tagTHREADINFO::TIF_flags, TIF_GUITHREADINITIALIZED, TIF_INCLEANUP, and TRUE.

Referenced by _PostMessage(), EndShutdown(), InitiateWin32kCleanup(), NtUserPostThreadMessage(), TerminateConsole(), xxxDoHotKeyStuff(), xxxSysCommand(), and zzzCancelJournalling().

01128 { 01129 PQMSG pqmsg; 01130 01131 if ((pti == NULL) || 01132 !(pti->TIF_flags & TIF_GUITHREADINITIALIZED) || 01133 (pti->TIF_flags & TIF_INCLEANUP)) { 01134 01135 RIPERR0(ERROR_INVALID_THREAD_ID, RIP_VERBOSE, ""); 01136 return FALSE; 01137 } 01138 01139 /* 01140 * First check to see if this message takes DWORDs only. If it does not, 01141 * fail the post. Cannot allow an app to post a message with pointers or 01142 * handles in it - this can cause the server to fault and cause other 01143 * problems - such as causing apps in separate address spaces to fault. 01144 * (or even an app in the same address space to fault!) 01145 */ 01146 if (TESTSYNCONLYMESSAGE(message, wParam)) { 01147 RIPERR1(ERROR_MESSAGE_SYNC_ONLY, 01148 RIP_WARNING, 01149 "Invalid parameter \"message\" (%ld) to _PostThreadMessage", 01150 message); 01151 01152 return FALSE; 01153 } 01154 01155 /* 01156 * Check to see if this message is in the multimedia coalescing range. 01157 * If so, see if it can be coalesced with the previous message. 01158 */ 01159 AdjustForCoalescing(&pti->mlPost, NULL, message); 01160 01161 /* 01162 * Put this message on the 'post' list. 01163 */ 01164 if ((pqmsg = AllocQEntry(&pti->mlPost)) == NULL) { 01165 RIPMSG1(RIP_WARNING, "_PostThreadMessage: Failed to alloc Q entry: Target pti=0x%p", 01166 pti); 01167 return FALSE; 01168 } 01169 01170 /* 01171 * Set the QS_POSTMESSAGE bit so the thread knows it has a message. 01172 */ 01173 StoreQMessage(pqmsg, NULL, message, wParam, lParam, 0, 0, 0); 01174 SetWakeBit(pti, QS_POSTMESSAGE | QS_ALLPOSTMESSAGE); 01175 01176 /* 01177 * If it's a hotkey, set the QS_HOTKEY bit since we have a separate 01178 * bit for those messages. 01179 */ 01180 if (message == WM_HOTKEY) 01181 SetWakeBit(pti, QS_HOTKEY); 01182 01183 /* 01184 * Are we posting to the thread currently reading from the input queue? 01185 * If so, update idSysLock with this pqmsg so that the input queue will 01186 * not be unlocked until this message is read. 01187 */ 01188 if (pti == pti->pq->ptiSysLock) 01189 pti->pq->idSysLock = (ULONG_PTR)pqmsg; 01190 01191 return TRUE; 01192 }

VOID _QueryUserHandles IN LPDWORD  lpIn,
IN DWORD  dwInLength,
OUT DWORD  pdwResult[][TYPE_CTYPES]
 

Referenced by NtUserQueryUserCounters().

PWND _RealChildWindowFromPoint PWND  pwndParent,
POINT  pt
 

Definition at line 505 of file winable2.c.

References tagCLS::atomClassName, tagSERVERINFO::atomSysClass, BFTYPEMASK, FNID_BUTTON, GETFNID, gpsi, tagWND::hrgnClip, ICLS_BUTTON, LOBYTE, NULL, tagWND::pcls, PtInRect(), PWNDDESKTOP, tagWND::rcClient, tagWND::rcWindow, tagWND::spwndChild, tagWND::spwndNext, TestWF, and WFVISIBLE.

Referenced by NtUserRealChildWindowFromPoint().

00506 { 00507 PWND pwndChild; 00508 PWND pwndSave; 00509 00510 if (pwndParent != PWNDDESKTOP(pwndParent)) { 00511 pt.x += pwndParent->rcClient.left; 00512 pt.y += pwndParent->rcClient.top; 00513 } 00514 00515 /* 00516 * Is this point even in the parent? 00517 */ 00518 if (!PtInRect(&pwndParent->rcClient, pt) || 00519 (pwndParent->hrgnClip && !GrePtInRegion(pwndParent->hrgnClip, pt.x, pt.y))) { 00520 // Nope 00521 return NULL; 00522 } 00523 00524 pwndSave = NULL; 00525 00526 /* 00527 * Loop through the children. 00528 */ 00529 for (pwndChild = pwndParent->spwndChild; pwndChild; pwndChild = pwndChild->spwndNext) { 00530 if (!TestWF(pwndChild, WFVISIBLE)) 00531 continue; 00532 00533 /* 00534 * Is this point in the child's window? 00535 */ 00536 if (!PtInRect(&pwndChild->rcWindow, pt) || 00537 (pwndChild->hrgnClip && !GrePtInRegion(pwndChild->hrgnClip, pt.x, pt.y))) 00538 continue; 00539 00540 /* 00541 * OK, we are in somebody's window. Is this by chance a group box? 00542 */ 00543 if ((pwndChild->pcls->atomClassName == gpsi->atomSysClass[ICLS_BUTTON]) || 00544 (GETFNID(pwndChild) == FNID_BUTTON)) { 00545 if (TestWF(pwndChild, BFTYPEMASK) == LOBYTE(BS_GROUPBOX)) { 00546 pwndSave = pwndChild; 00547 continue; 00548 } 00549 } 00550 00551 return pwndChild; 00552 } 00553 00554 /* 00555 * Did we save a groupbox which turned out to have nothing behind it 00556 * at that point? 00557 */ 00558 if (pwndSave) { 00559 return pwndSave; 00560 } else { 00561 return pwndParent; 00562 } 00563 }

BOOL _RegisterHotKey PWND  pwnd,
int  id,
UINT  fsModifiers,
UINT  vk
 

Definition at line 125 of file hotkeys.c.

References BOOL, CheckWinstaWriteAttributesAccess(), FALSE, FindHotKey(), tagHOTKEY::fsModifiers, GETPTI, gfsSASModifiers, gpepCSRSS, gphkFirst, gpidLogon, grpWinStaList, gvkSAS, HOTKEY, tagHOTKEY::id, Lock, NULL, tagHOTKEY::phkNext, PsGetCurrentProcess, tagHOTKEY::pti, PtiCurrent, PWND_FOCUS, PWND_INPUTOWNER, tagHOTKEY::spwnd, TRUE, tagHOTKEY::vk, and tagHOTKEY::wFlags.

Referenced by NtUserRegisterHotKey(), RawInputThread(), SetDebugHotKeys(), and xxxSetShellWindow().

00130 { 00131 PHOTKEY phk; 00132 BOOL fKeysExist; 00133 PTHREADINFO ptiCurrent; 00134 BOOL bSAS = FALSE; 00135 WORD wFlags; 00136 00137 wFlags = fsModifiers & MOD_SAS; 00138 fsModifiers &= ~MOD_SAS; 00139 00140 ptiCurrent = PtiCurrent(); 00141 00142 /* 00143 * Blow it off if the caller is not the windowstation init thread 00144 * and doesn't have the proper access rights 00145 */ 00146 if (PsGetCurrentProcess() != gpepCSRSS) { 00147 if (grpWinStaList && !CheckWinstaWriteAttributesAccess()) { 00148 return FALSE; 00149 } 00150 } 00151 00152 /* 00153 * If VK_PACKET is specified, just bail out, since VK_PACKET is 00154 * not a real keyboard input. 00155 */ 00156 if (vk == VK_PACKET) { 00157 return FALSE; 00158 } 00159 00160 /* 00161 * If this is the SAS check that winlogon is the one registering it. 00162 */ 00163 if (wFlags & MOD_SAS) { 00164 if (PsGetCurrentProcess()->UniqueProcessId == gpidLogon) { 00165 bSAS = TRUE; 00166 } 00167 } 00168 00169 /* 00170 * Can't register hotkey for a window of another queue. 00171 * Return FALSE in this case. 00172 */ 00173 if ((pwnd != PWND_FOCUS) && (pwnd != PWND_INPUTOWNER)) { 00174 if (GETPTI(pwnd) != ptiCurrent) { 00175 RIPERR0(ERROR_WINDOW_OF_OTHER_THREAD, RIP_VERBOSE, ""); 00176 return FALSE; 00177 } 00178 } 00179 00180 phk = FindHotKey(ptiCurrent, pwnd, id, fsModifiers, vk, FALSE, &fKeysExist); 00181 00182 /* 00183 * If the keys have already been registered, return FALSE. 00184 */ 00185 if (fKeysExist) { 00186 RIPERR0(ERROR_HOTKEY_ALREADY_REGISTERED, RIP_WARNING, "Hotkey already exists"); 00187 return FALSE; 00188 } 00189 00190 if (phk == NULL) { 00191 /* 00192 * This hotkey doesn't exist yet. 00193 */ 00194 phk = (PHOTKEY)UserAllocPool(sizeof(HOTKEY), TAG_HOTKEY); 00195 00196 /* 00197 * If the allocation failed, bail out. 00198 */ 00199 if (phk == NULL) { 00200 return FALSE; 00201 } 00202 00203 phk->pti = ptiCurrent; 00204 00205 if ((pwnd != PWND_FOCUS) && (pwnd != PWND_INPUTOWNER)) { 00206 phk->spwnd = NULL; 00207 Lock(&phk->spwnd, pwnd); 00208 } else { 00209 phk->spwnd = pwnd; 00210 } 00211 phk->fsModifiers = (WORD)fsModifiers; 00212 phk->wFlags = wFlags; 00213 00214 phk->vk = vk; 00215 phk->id = id; 00216 00217 /* 00218 * Link the new hotkey to the front of the list. 00219 */ 00220 phk->phkNext = gphkFirst; 00221 gphkFirst = phk; 00222 00223 } else { 00224 00225 /* 00226 * Hotkey already exists, reset the keys. 00227 */ 00228 phk->fsModifiers = (WORD)fsModifiers; 00229 phk->wFlags = wFlags; 00230 phk->vk = vk; 00231 } 00232 00233 if (bSAS) { 00234 /* 00235 * store the SAS on the terminal. 00236 */ 00237 gvkSAS = vk; 00238 gfsSASModifiers = fsModifiers; 00239 } 00240 00241 return TRUE; 00242 }

BOOL _RegisterLogonProcess DWORD  dwProcessId,
BOOL  fSecure
 

Definition at line 25 of file logon.c.

References BOOL, FALSE, gpidLogon, IsPrivileged(), psTcb, and TRUE.

00028 { 00029 UNREFERENCED_PARAMETER(fSecure); 00030 00031 /* 00032 * Allow only one logon process and then only if it has TCB 00033 * privilege. 00034 */ 00035 if (gpidLogon != 0 || !IsPrivileged(&psTcb)) { 00036 RIPERR0(ERROR_ACCESS_DENIED, 00037 RIP_WARNING, 00038 "Access denied in _RegisterLogonProcess"); 00039 00040 return FALSE; 00041 } 00042 00043 gpidLogon = (HANDLE)LongToHandle( dwProcessId ); 00044 return TRUE; 00045 }

BOOL _RegisterShellHookWindow PWND  pwnd  ) 
 

Definition at line 3628 of file rare.c.

References BOOL, FALSE, tagWND::head, NULL, tagDESKTOPINFO::pvwplShellHook, SetWF, TRUE, VWPLAdd(), and WFSHELLHOOKWND.

03628 { 03629 PDESKTOPINFO pdeskinfo; 03630 03631 if (pwnd->head.rpdesk == NULL) 03632 return FALSE; 03633 03634 pdeskinfo = pwnd->head.rpdesk->pDeskInfo; 03635 03636 /* 03637 * Add pwnd to the desktop's Volatile Window Pointer List (VWPL) of 03638 * ShellHook windows. If this call initializes the VWPL, set the 03639 * (re)allocation threshhold to 2 PWNDs (we know we never have more than 03640 * 2 windows in this list anyway) 03641 */ 03642 if (VWPLAdd(&(pdeskinfo->pvwplShellHook), pwnd, 2)) { 03643 SetWF(pwnd, WFSHELLHOOKWND); 03644 return TRUE; 03645 } 03646 return FALSE; 03647 }

BOOL _RegisterTasklist PWND  pwndTasklist  ) 
 

Definition at line 583 of file syscmd.c.

References BOOL, GETPTI, ghwndSwitch, gptiTasklist, HWq, PsGetCurrentThread, TIF_DONTATTACHQUEUE, and TRUE.

Referenced by NtUserRegisterTasklist().

00585 { 00586 #ifdef LATER 00587 // 00588 // JimA - ??? Why do this? 00589 // 00590 PETHREAD Thread; 00591 00592 Thread = PsGetCurrentThread(); 00593 pRitCSRThread->ThreadHandle = Thread->ThreadHandle; 00594 #endif 00595 00596 gptiTasklist = GETPTI(pwndTasklist); 00597 ghwndSwitch = HWq(pwndTasklist); 00598 00599 /* 00600 * Don't allow an app to call AttachThreadInput() on task man - 00601 * we want taskman to be unsynchronized at all times (so the user 00602 * can bring it up and kill other apps). 00603 */ 00604 GETPTI(pwndTasklist)->TIF_flags |= TIF_DONTATTACHQUEUE; 00605 00606 return TRUE; 00607 }

BOOL _ReleaseDC HDC  hdc  ) 
 

Definition at line 183 of file dc.c.

References BOOL, CheckCritIn, DCE_NORELEASE, FALSE, ReleaseCacheDC(), and TRUE.

Referenced by _UserSoundSentryWorker(), CreateTooltipBitmap(), DrawCtlThumb(), DrawSwitchWndHilite(), InitTooltipAnimation(), InvertScrollHilite(), MNAnimate(), MNDrawArrow(), MNDrawFullNC(), StopFade(), TooltipAnimate(), TooltipGetSize(), UserReleaseDC(), UT_InvertCaret(), xxxDefWindowProc(), xxxDesktopWndProc(), xxxDrawAnimatedRects(), xxxDrawDragRect(), xxxDrawMenuBarUnderlines(), xxxDrawThumb(), xxxDWP_DoNCActivate(), xxxEnableWndSBArrows(), xxxHotTrackMenu(), xxxMenuWindowProc(), xxxMNCompute(), xxxMNInvertItem(), xxxMoveSwitchWndHilite(), xxxMoveThumb(), xxxPaintIconsInSwitchWindow(), xxxPaintSwitchWindow(), xxxRealizeDesktop(), xxxRedrawHungWindow(), xxxRedrawHungWindowFrame(), xxxRedrawTitle(), xxxSBWndProc(), xxxScrollWindowEx(), xxxSnapWindow(), xxxTrackCaptionButton(), and zzzDrawInvertScrollArea().

00185 { 00186 CheckCritIn(); 00187 00188 return (ReleaseCacheDC(hdc, FALSE) == DCE_NORELEASE ? FALSE : TRUE); 00189 }

BOOL _ReplyMessage LRESULT  lRet  ) 
 

Definition at line 198 of file kernel/sendmsg.c.

References BOOL, CheckCritIn, DirectedScheduleTask(), tagINTERSENDMSGEX::dwData, FALSE, tagINTERSENDMSGEX::fuCall, INTRSENDMSGEX, ISM_CALLBACK, ISM_CB_CLIENT, ISM_REPLY, L, tagINTERSENDMSGEX::lpResultCallBack, tagINTERSENDMSGEX::lRet, NULL, PSMS, tagTHREADINFO::psmsCurrent, PtiCurrent, SetWakeBit(), SMF_CB_CLIENT, SMF_CB_REQUEST, SMF_REPLY, SMF_SENDERDIED, ThreadLockWithPti, ThreadUnlock, TIF_16BIT, tagTHREADINFO::TIF_flags, TRUE, xxxInterSendMsgEx(), and xxxSleepTask().

00200 { 00201 PTHREADINFO ptiCurrent; 00202 PSMS psms; 00203 00204 CheckCritIn(); 00205 00206 ptiCurrent = PtiCurrent(); 00207 00208 /* 00209 * Are we processing a SendMessage? 00210 */ 00211 psms = ptiCurrent->psmsCurrent; 00212 if (psms == NULL) 00213 return FALSE; 00214 00215 /* 00216 * See if the reply has been made already. 00217 */ 00218 if (psms->flags & SMF_REPLY) 00219 return FALSE; 00220 00221 /* 00222 * Blow off the rest of the call if the SMS came 00223 * from xxxSendNotifyMessage(). Obviously there's 00224 * no one around to reply to in the case. 00225 */ 00226 if (psms->ptiSender != NULL) { 00227 00228 /* 00229 * Reply to this message. The sender should not free the SMS 00230 * because the receiver still considers it valid. Thus we 00231 * mark it with a special bit indicating it has been replied 00232 * to. We wait until both the sender and receiver are done 00233 * with the sms before we free it. 00234 */ 00235 psms->lRet = lRet; 00236 psms->flags |= SMF_REPLY; 00237 00238 /* 00239 * Wake up the sender. 00240 * ??? why don't we test that psms == ptiSender->psmsSent? 00241 */ 00242 SetWakeBit(psms->ptiSender, QS_SMSREPLY); 00243 } else if (psms->flags & SMF_CB_REQUEST) { 00244 00245 /* 00246 * From SendMessageCallback REQUEST callback. Send the message 00247 * back with a the REPLY value. 00248 */ 00249 TL tlpwnd; 00250 INTRSENDMSGEX ism; 00251 00252 psms->flags |= SMF_REPLY; 00253 00254 if (!(psms->flags & SMF_SENDERDIED)) { 00255 ism.fuCall = ISM_CALLBACK | ISM_REPLY; 00256 if (psms->flags & SMF_CB_CLIENT) 00257 ism.fuCall |= ISM_CB_CLIENT; 00258 ism.lpResultCallBack = psms->lpResultCallBack; 00259 ism.dwData = psms->dwData; 00260 ism.lRet = lRet; 00261 00262 ThreadLockWithPti(ptiCurrent, psms->spwnd, &tlpwnd); 00263 00264 xxxInterSendMsgEx(psms->spwnd, psms->message, 0L, 0L, 00265 NULL, psms->ptiCallBackSender, &ism ); 00266 00267 ThreadUnlock(&tlpwnd); 00268 } 00269 } 00270 00271 /* 00272 * We have 4 conditions to satisfy: 00273 * 00274 * 16 - 16 : receiver yields if sender is waiting for this reply 00275 * 32 - 16 : receiver yields if sender is waiting for this reply 00276 * 16 - 32 : no yield required 00277 * 32 - 32 : No yielding required. 00278 */ 00279 if (psms->ptiSender && 00280 (psms->ptiSender->TIF_flags & TIF_16BIT || ptiCurrent->TIF_flags & TIF_16BIT)) { 00281 00282 DirectedScheduleTask(ptiCurrent, psms->ptiSender, FALSE, psms); 00283 if (ptiCurrent->TIF_flags & TIF_16BIT && psms->ptiSender->psmsSent == psms) { 00284 xxxSleepTask(TRUE, NULL); 00285 } 00286 } 00287 00288 return TRUE; 00289 }

VOID _ResetDblClk VOID   ) 
 

Definition at line 3768 of file rare.c.

References L, PtiCurrent, and VOID().

03769 { 03770 PtiCurrent()->pq->timeDblClk = 0L; 03771 }

BOOL _ScrollDC HDC  ,
int  ,
int  ,
LPRECT  ,
LPRECT  ,
HRGN  ,
LPRECT 
 

Definition at line 653 of file scrollw.c.

References AnySpbs, BOOL, FastWindowFromDC(), HRGN_FULL, tagWND::hrgnUpdate, InternalScrollDC(), NULL, OffsetRect(), tagWND::rcClient, SpbCheckRect(), TRUE, and UnionRect().

Referenced by NtUserScrollDC(), and xxxPaintIconsInSwitchWindow().

00661 { 00662 RECT rcSrc; 00663 RECT rcSpb; 00664 PWND pwnd; 00665 HRGN hrgnInvalid; 00666 BOOL fRet; 00667 00668 /* 00669 * ScrollDC does not scroll update region. Under WinNT, an app calling 00670 * GetUpdateRgn() then ScrollDC() then InvalidateRgn() will not get 00671 * any new update region that happened between the Get and Scroll. Under 00672 * Win3.1, that was not a problem because no other app ran during this 00673 * time. So pass hrgnInvalid - this will affect the hrgnUpdate and 00674 * prcUpdate values being returned from ScrollDC with the update region. 00675 */ 00676 hrgnInvalid = NULL; 00677 if ((pwnd = FastWindowFromDC(hdc)) != NULL) { 00678 00679 hrgnInvalid = pwnd->hrgnUpdate; 00680 00681 if (hrgnInvalid == HRGN_FULL) { 00682 00683 /* 00684 * This is a fix for winhell, a performance testing app 00685 * written by some guy working for a windows magazine. 00686 * this app scrolls it's window while it is completely 00687 * invalid. We normaly won't scroll invalid bits but 00688 * but we make the exception here 00689 */ 00690 hrgnInvalid = NULL; 00691 } 00692 } 00693 00694 fRet = InternalScrollDC(hdc, 00695 dx, 00696 dy, 00697 prcSrc, 00698 prcClip, 00699 hrgnInvalid, 00700 hrgnUpdate, 00701 prcUpdate, 00702 TRUE) != ERROR; 00703 00704 /* 00705 * InternalScrollDC() only scrolls those areas inside the visible region. 00706 * This means it does no operations on parts of the window if the window 00707 * isn't visible. This means SPBs don't get properly invalidated. This 00708 * could be seen by starting a dir, then moving another window with the 00709 * mouse (and keeping the mouse down until the dir finished). The 00710 * screen is remembered with an SPB, and the dir window doesn't get 00711 * properly invalidated because of this. 00712 */ 00713 if (pwnd != NULL && AnySpbs()) { 00714 00715 if (prcSrc) { 00716 00717 rcSrc = *prcSrc; 00718 OffsetRect(&rcSrc, pwnd->rcClient.left, pwnd->rcClient.top); 00719 00720 rcSpb = rcSrc; 00721 OffsetRect(&rcSpb, dx, dy); 00722 UnionRect(&rcSpb, &rcSpb, &rcSrc); 00723 00724 } else { 00725 rcSpb = pwnd->rcClient; 00726 } 00727 00728 SpbCheckRect(pwnd, &rcSpb, 0); 00729 } 00730 00731 return fRet; 00732 }

HPALETTE _SelectPalette HDC  hdc,
HPALETTE  hpalette,
BOOL  fForceBackground
 

Definition at line 51 of file palette.c.

References _GetDesktopWindow(), _IsChild(), BOOL, FALSE, GETPTI, GetTopLevelWindow(), gpqForeground, tagWND::head, IsTopmostRealApp(), NULL, PUSIF_PALETTEDISPLAY, SetWF, tagQ::spwndActive, TEST_PUSIF, TestWF, TIF_PALETTEAWARE, TRUE, WEFTOOLWINDOW, WFHASPALETTE, and WindowFromCacheDC().

Referenced by BMPtoDIB(), ConvertToDDB(), DIBtoBMP(), NtUserSelectPalette(), xxxDrawWallpaper(), and xxxInternalPaintDesktop().

00055 { 00056 PWND pwndTop; 00057 BOOL fBackgroundPalette = TRUE; 00058 PWND pwnd = NULL; 00059 /* 00060 * If we are not forcing palette into background, find out where it does 00061 * actually belong. Don't ever select the default palette in as a 00062 * foreground palette because this confuses gdi. Many apps do a 00063 * (oldPal = SelectPalette) (myPal); Draw; SelectObject(oldPal). 00064 * and we don't want to allow this to go through. 00065 */ 00066 if (!fForceBackground && 00067 TEST_PUSIF(PUSIF_PALETTEDISPLAY) && 00068 (hpal != GreGetStockObject(DEFAULT_PALETTE))) { 00069 00070 if (pwnd = WindowFromCacheDC(hdc)) { 00071 00072 PWND pwndActive; 00073 00074 /* 00075 * don't "select" palette unless on a palette device 00076 */ 00077 pwndTop = GetTopLevelWindow(pwnd); 00078 00079 if (!TestWF(pwndTop, WFHASPALETTE)) { 00080 00081 if (pwndTop != _GetDesktopWindow()) 00082 GETPTI(pwndTop)->TIF_flags |= TIF_PALETTEAWARE; 00083 00084 SetWF(pwndTop, WFHASPALETTE); 00085 } 00086 00087 /* 00088 * Hack-o-rama: 00089 * Windows get foreground use of the palette if 00090 * * They are the foreground's active window 00091 * * The current process is the shell and they are the 00092 * topmost valid non-toolwindow in the zorder. 00093 * 00094 * This makes our tray friendly on palettized displays. 00095 * Currently, if you run a palette app and click on the tray, 00096 * the palette app goes all weird. Broderbund apps go 00097 * completely black. This is because they get forced to be 00098 * background always, even though the shell isn't really 00099 * palettized. 00100 * 00101 * Note: this palette architecture sucks. Apps get forced to 00102 * be background palette users even if the foreground thread 00103 * couldn't care less about the palette. Should go by zorder 00104 * if so, but in a more clean way than this. 00105 * 00106 * We really only care about the tray && the background. 00107 * Cabinet dudes don't matter so much. 00108 */ 00109 pwndActive = (gpqForeground ? gpqForeground->spwndActive : NULL); 00110 00111 #if 0 00112 if (pwndActive && 00113 (pwndTop != pwnd->head.rpdesk->pDeskInfo->spwndShell) && 00114 ((pwndActive == pwnd) || _IsChild(pwndActive, pwnd) || IsTopmostRealApp(pwnd)) && 00115 !TestWF(pwnd, WEFTOOLWINDOW)) { 00116 00117 fBackgroundPalette = FALSE; 00118 } 00119 #else 00120 if ((pwndTop != pwndTop->head.rpdesk->pDeskInfo->spwnd) && 00121 (pwndTop != pwndTop->head.rpdesk->pDeskInfo->spwndShell) && 00122 (pwndActive != NULL) && 00123 ((pwndActive == pwnd) || 00124 _IsChild(pwndActive, pwnd) || 00125 IsTopmostRealApp(pwnd)) && 00126 !TestWF(pwnd, WEFTOOLWINDOW)) { 00127 00128 fBackgroundPalette = FALSE; 00129 } 00130 #endif 00131 } 00132 } 00133 00134 return GreSelectPalette(hdc, hpal, fBackgroundPalette); 00135 }

BOOL _SetCaretBlinkTime UINT   ) 
 

Definition at line 513 of file caret.c.

References _KillSystemTimer(), _SetSystemTimer(), BOOL, tagQ::caret, CaretBlinkProc(), CheckWinstaWriteAttributesAccess(), FALSE, gpsi, tagCARET::hTimer, IDSYS_CARET, tagTHREADINFO::pq, PtiCurrent, tagCARET::spwnd, and TRUE.

Referenced by xxxUpdatePerUserSystemParameters().

00515 { 00516 PQ pq; 00517 PTHREADINFO ptiCurrent = PtiCurrent(); 00518 00519 /* 00520 * Blow it off if the caller doesn't have the proper access rights 00521 */ 00522 if (!CheckWinstaWriteAttributesAccess()) { 00523 return FALSE; 00524 } 00525 00526 gpsi->dtCaretBlink = cmsBlink; 00527 00528 pq = ptiCurrent->pq; 00529 00530 if (pq->caret.spwnd) { 00531 _KillSystemTimer(pq->caret.spwnd, IDSYS_CARET); 00532 pq->caret.hTimer = _SetSystemTimer(pq->caret.spwnd, IDSYS_CARET, 00533 gpsi->dtCaretBlink, CaretBlinkProc); 00534 } 00535 00536 return TRUE; 00537 }

WORD _SetClassWord PWND  pwnd,
int  index,
WORD  value
 

Definition at line 863 of file class.c.

References BYTE, CheckCritIn, GETPTI, NULL, tagWND::pcls, tagCLS::pclsBase, tagCLS::pclsClone, tagCLS::pclsNext, and PpiCurrent.

Referenced by NtUserSetClassWord().

00867 { 00868 WORD wOld; 00869 WORD UNALIGNED *pw; 00870 PCLS pcls; 00871 00872 CheckCritIn(); 00873 00874 if (GETPTI(pwnd)->ppi != PpiCurrent()) { 00875 RIPERR1(ERROR_ACCESS_DENIED, RIP_WARNING, "SetClassWord: different process: index 0x%lx", index); 00876 return 0; 00877 } 00878 00879 pcls = pwnd->pcls->pclsBase; 00880 if ((index < 0) || (index + (int)sizeof(WORD) > pcls->cbclsExtra)) { 00881 RIPERR0(ERROR_INVALID_INDEX, RIP_WARNING, "SetClassWord: invalid index"); 00882 return 0; 00883 } else { 00884 pw = (WORD UNALIGNED *)((BYTE *)(pcls + 1) + index); 00885 wOld = *pw; 00886 *pw = value; 00887 pcls = pcls->pclsClone; 00888 while (pcls != NULL) { 00889 pw = (WORD UNALIGNED *)((BYTE *)(pcls + 1) + index); 00890 *pw = value; 00891 pcls = pcls->pclsNext; 00892 } 00893 return wOld; 00894 } 00895 }

BOOL _SetClipboardData UINT  fmt,
HANDLE  hData,
BOOL  fGlobalHandle,
BOOL  fIncSerialNumber
 

Definition at line 953 of file ntuser/kernel/clipbrd.c.

References BOOL, CheckClipboardAccess(), DUMMY_MAX_HANDLE, DUMMY_TEXT_HANDLE, FALSE, InternalSetClipboardData(), and NULL.

Referenced by NtUserSetClipboardData(), and xxxSnapWindow().

00958 { 00959 PWINDOWSTATION pwinsta; 00960 BOOL fRet; 00961 00962 if ((pwinsta = CheckClipboardAccess()) == NULL) 00963 return FALSE; 00964 00965 /* 00966 * Check if the Data handle is DUMMY_TEXT_HANDLE; If so, return an 00967 * error. DUMMY_TEXT_HANDLE will be used as a valid clipboard handle 00968 * only by USER. If any app tries to pass it as a handle, it should 00969 * get an error! 00970 */ 00971 if ((hData >= DUMMY_TEXT_HANDLE) && (hData <= DUMMY_MAX_HANDLE)) { 00972 RIPMSG0(RIP_WARNING, "Clipboard: SetClipboardData called with dummy-handle"); 00973 return FALSE; 00974 } 00975 00976 if (fRet = InternalSetClipboardData(pwinsta, fmt, hData, fGlobalHandle, fIncSerialNumber)) { 00977 00978 /* 00979 * The set object must remain PUBLIC, so that other processes 00980 * can view/manipulate the handles when requested. 00981 */ 00982 switch (fmt) { 00983 case CF_BITMAP: 00984 GreSetBitmapOwner(hData, OBJECT_OWNER_PUBLIC); 00985 break; 00986 00987 case CF_PALETTE: 00988 GreSetPaletteOwner(hData, OBJECT_OWNER_PUBLIC); 00989 break; 00990 } 00991 } 00992 00993 return fRet; 00994 }

BOOL _SetCursorContents PCURSOR  pcur,
PCURSOR  pcurNew
 

Definition at line 695 of file loadbits.c.

References _DestroyCursor(), BOOL, CURSOR_THREADCLEANUP, CURSORF_ACON, and TRUE.

Referenced by NtUserSetCursorContents().

00698 { 00699 HBITMAP hbmpT; 00700 00701 if (!(pcur->CURSORF_flags & CURSORF_ACON)) { 00702 00703 /* 00704 * Swap bitmaps. 00705 */ 00706 hbmpT = pcur->hbmMask; 00707 pcur->hbmMask = pcurNew->hbmMask; 00708 pcurNew->hbmMask = hbmpT; 00709 00710 hbmpT = pcur->hbmColor; 00711 pcur->hbmColor = pcurNew->hbmColor; 00712 pcurNew->hbmColor = hbmpT; 00713 00714 /* 00715 * Remember hotspot info and size info 00716 */ 00717 pcur->xHotspot = pcurNew->xHotspot; 00718 pcur->yHotspot = pcurNew->yHotspot; 00719 pcur->cx = pcurNew->cx; 00720 pcur->cy = pcurNew->cy; 00721 } 00722 00723 /* 00724 * Destroy the cursor we copied from. 00725 */ 00726 _DestroyCursor(pcurNew, CURSOR_THREADCLEANUP); 00727 00728 return (BOOL)TRUE; 00729 }

BOOL _SetCursorIconData PCURSOR  pcur,
PUNICODE_STRING  pstrModName,
PUNICODE_STRING  pstrResName,
PCURSORDATA  pData,
DWORD  cbData
 

Definition at line 319 of file kernel/acons.c.

References ACON, tagCURSORDATA::aicur, tagCURSORDATA::ajifRate, AllocateUnicodeString(), tagCURSORDATA::aspcur, BOOL, tagCURSORDATA::cpcur, CURSOR, CURSORF_ACON, tagCURSORDATA::CURSORF_flags, DWORD, FALSE, HMValidateHandle(), LinkCursor(), Lock, NULL, pacon, PBYTE, PCURSORDATA, tagCURSORDATA::rt, TRUE, TYPE_CURSOR, Unlock, and UserAddAtom().

Referenced by CopyIcoCur(), CreateAniIcon(), CreateIcoCur(), CreateIcoCurIndirect(), CreateIconIndirect(), and NtUserSetCursorIconData().

00325 { 00326 #define pacon ((PACON)pcur) 00327 int i; 00328 #if DBG 00329 BOOL fSuccess; 00330 #endif 00331 00332 pcur->CURSORF_flags |= pcurData->CURSORF_flags; 00333 pcur->rt = pcurData->rt; 00334 00335 if (pcurData->CURSORF_flags & CURSORF_ACON) { 00336 UserAssert(pacon->aspcur == NULL); 00337 RtlCopyMemory(&pacon->cpcur, 00338 &pcurData->cpcur, 00339 sizeof(ACON) - FIELD_OFFSET(ACON, cpcur)); 00340 } else { 00341 RtlCopyMemory(&pcur->CI_COPYSTART, 00342 &pcurData->CI_COPYSTART, 00343 sizeof(CURSOR) - FIELD_OFFSET(CURSOR, CI_COPYSTART)); 00344 } 00345 00346 /* 00347 * Save name of the cursor resource 00348 */ 00349 if (cczpstrName->Length != 0){ 00350 /* 00351 * AllocateUnicodeString guards access to src Buffer with 00352 * a try block. 00353 */ 00354 00355 if (!AllocateUnicodeString(&pcur->strName, cczpstrName)) 00356 return FALSE; 00357 } else { 00358 pcur->strName = *cczpstrName; 00359 } 00360 00361 /* 00362 * Save the module name 00363 */ 00364 if (cczpstrModName->Buffer) { 00365 /* 00366 * UserAddAtom guards access to the string with a try block. 00367 */ 00368 pcur->atomModName = UserAddAtom(cczpstrModName->Buffer, FALSE); 00369 if (pcur->atomModName == 0) { 00370 return FALSE; 00371 } 00372 } 00373 00374 if (pcur->CURSORF_flags & CURSORF_ACON) { 00375 00376 /* 00377 * Stash away animated icon info. 00378 */ 00379 pacon = (PACON)pcur; 00380 pacon->aspcur = UserAllocPool(cbData, TAG_CURSOR); 00381 if (pacon->aspcur == NULL) 00382 return FALSE; 00383 00384 /* 00385 * Copy the handle array. Do this in a try/except so the 00386 * buffer will be freed if pcurData goes away. Even though 00387 * cursor destruction would free the array, a fault will 00388 * leave the contents in an undetermined state and cause 00389 * problems during cursor destruction. 00390 */ 00391 try { 00392 RtlCopyMemory(pacon->aspcur, pcurData->aspcur, cbData); 00393 pacon->aicur = (DWORD *)((PBYTE)pacon->aspcur + (ULONG_PTR)pcurData->aicur); 00394 pacon->ajifRate = (PJIF)((PBYTE)pacon->aspcur + (ULONG_PTR)pcurData->ajifRate); 00395 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00396 UserFreePool(pacon->aspcur); 00397 pacon->aspcur = NULL; 00398 return FALSE; 00399 } 00400 00401 /* 00402 * Convert handles into pointers and lock them in. 00403 */ 00404 for (i = 0; i < pacon->cpcur; i++) { 00405 PCURSOR pcurT; 00406 00407 pcurT = (PCURSOR) HMValidateHandle(pacon->aspcur[i], TYPE_CURSOR); 00408 if (pcurT) { 00409 pacon->aspcur[i] = NULL; 00410 Lock(&pacon->aspcur[i], pcurT); 00411 } else { 00412 while (--i >= 0) { 00413 Unlock(&pacon->aspcur[i]); 00414 } 00415 00416 UserFreePool(pacon->aspcur); 00417 pacon->aspcur = NULL; 00418 RIPMSG0(RIP_WARNING, "SetCursorIconData: invalid cursor handle for animated cursor"); 00419 return FALSE; 00420 } 00421 } 00422 } else { 00423 00424 PW32PROCESS W32Process = W32GetCurrentProcess(); 00425 00426 /* 00427 * Make the cursor and its bitmaps public - LAST THING! 00428 */ 00429 UserAssert(pcur->hbmMask); 00430 UserAssert(pcur->cx); 00431 UserAssert(pcur->cy); 00432 00433 /* 00434 * Make the cursor public so that it can be shared across processes. 00435 * Charge the curson to this very process GDI quota even if it's public. 00436 */ 00437 #if DBG 00438 fSuccess = 00439 #endif 00440 GreSetBitmapOwner(pcur->hbmMask, OBJECT_OWNER_PUBLIC); 00441 UserAssert(fSuccess); 00442 GreIncQuotaCount(W32Process); 00443 if (pcur->hbmColor) { 00444 #if DBG 00445 fSuccess = 00446 #endif 00447 GreSetBitmapOwner(pcur->hbmColor, OBJECT_OWNER_PUBLIC); 00448 UserAssert(fSuccess); 00449 GreIncQuotaCount(W32Process); 00450 } 00451 } 00452 00453 LinkCursor(pcur); 00454 00455 return TRUE; 00456 #undef pacon 00457 }

VOID _SetDbgTag int  ,
DWORD 
 

Definition at line 287 of file rare.c.

References COPY_FLAG, and gpsi.

Referenced by NtUserSetDbgTag(), and SetDbgTag().

00288 { 00289 #if DEBUGTAGS 00290 if (gpsi && tag < DBGTAG_Max && !(dwDBGTAGFlags & ~DBGTAG_VALIDUSERFLAGS)) { 00291 COPY_FLAG(gpsi->adwDBGTAGFlags[tag], dwDBGTAGFlags, DBGTAG_VALIDUSERFLAGS); 00292 } 00293 #else 00294 UNREFERENCED_PARAMETER(tag); 00295 UNREFERENCED_PARAMETER(dwDBGTAGFlags); 00296 #endif 00297 }

BOOL _SetDesktopBitmap PDESKTOP  pdesk,
HBITMAP  hbitmap,
DWORD  dwStyle
 

DWORD _SetDesktopConsoleThread PDESKTOP  pdesk,
DWORD  dwThreadId
 

BOOL _SetDoubleClickTime UINT   ) 
 

Definition at line 74 of file sysmet.c.

References APIENTRY, BOOL, CheckWinstaWriteAttributesAccess(), FALSE, gdtDblClk, gpsi, InitTooltipDelay(), NULL, PpiCurrent, tagWINDOWSTATION::rpdeskList, tagDESKTOP::rpdeskNext, tagDESKTOP::spwndTooltip, and TRUE.

Referenced by xxxSystemParametersInfo().

00076 { 00077 PWINDOWSTATION pwinsta = PpiCurrent()->rpwinsta; 00078 00079 /* 00080 * Blow it off if the caller doesn't have the proper access rights 00081 */ 00082 if (!CheckWinstaWriteAttributesAccess()) { 00083 return FALSE; 00084 } 00085 00086 if (!dtTime) { 00087 dtTime = 500; 00088 } else if (dtTime > 5000) { 00089 dtTime = 5000; 00090 } 00091 00092 gdtDblClk = dtTime; 00093 gpsi->dtLBSearch = dtTime * 4; // dtLBSearch = 4 * gdtDblClk 00094 gpsi->dtScroll = gpsi->dtLBSearch / 5; // dtScroll = 4/5 * gdtDblClk 00095 /* 00096 * This value should be set through SPI_SETMENUSHOWDELAY 00097 * gdtMNDropDown = gpsi->dtScroll; // gdtMNDropDown = 4/5 * gdtDblClk 00098 */ 00099 00100 /* 00101 * Recalculate delays for tooltip windows on all desktops. 00102 */ 00103 if (pwinsta != NULL) { 00104 PDESKTOP pdesk; 00105 for (pdesk = pwinsta->rpdeskList; pdesk; pdesk = pdesk->rpdeskNext) { 00106 InitTooltipDelay((PTOOLTIPWND)pdesk->spwndTooltip); 00107 } 00108 } 00109 00110 return TRUE; 00111 }

void _SetIMEShowStatus BOOL  fShow  ) 
 

BOOL _SetKeyboardState CONST BYTE pKeyboard  ) 
 

Definition at line 136 of file keyboard.c.

References BOOL, ClearAsyncKeyStateToggle, ClearKeyStateDown, ClearKeyStateToggle, gpsi, tagTHREADINFO::pq, PtiCurrent, SetAsyncKeyStateToggle, SetKeyStateDown, SetKeyStateToggle, TRUE, and UpdateKeyLights().

Referenced by NtUserSetKeyboardState().

00138 { 00139 int i; 00140 PQ pq; 00141 PTHREADINFO ptiCurrent = PtiCurrent(); 00142 00143 pq = ptiCurrent->pq; 00144 00145 /* 00146 * Copy in the new state table. 00147 */ 00148 for (i = 0; i < 256; i++, pb++) { 00149 if (*pb & 0x80) { 00150 SetKeyStateDown(pq, i); 00151 } else { 00152 ClearKeyStateDown(pq, i); 00153 } 00154 00155 if (*pb & 0x01) { 00156 SetKeyStateToggle(pq, i); 00157 } else { 00158 ClearKeyStateToggle(pq, i); 00159 } 00160 } 00161 00162 /* 00163 * Update the key cache index. 00164 */ 00165 gpsi->dwKeyCache++; 00166 00167 #ifdef LATER 00168 // scottlu 6-9-91 00169 // I don't think we ought to do this unless someone really complains. This 00170 // could have bad side affects, especially considering that terminal 00171 // apps will want to do this, and terminal apps could easily not respond 00172 // to input for awhile, causing this state to change unexpectedly while 00173 // a user is using some other application. - scottlu. 00174 00175 /* DavidPe 02/05/92 00176 * How about if we only do it when the calling app is foreground? 00177 */ 00178 00179 /* 00180 * Propagate the toggle bits for the keylight keys to the 00181 * async keystate table and update the keylights. 00182 * 00183 * THIS could be evil in a de-synced environment, but to do this 00184 * in a totally "synchronous" way is hard. 00185 */ 00186 if (pb[VK_CAPITAL] & 0x01) { 00187 SetAsyncKeyStateToggle(VK_CAPITAL); 00188 } else { 00189 ClearAsyncKeyStateToggle(VK_CAPITAL); 00190 } 00191 00192 if (pb[VK_NUMLOCK] & 0x01) { 00193 SetAsyncKeyStateToggle(VK_NUMLOCK); 00194 } else { 00195 ClearAsyncKeyStateToggle(VK_NUMLOCK); 00196 } 00197 00198 if (pb[VK_SCROLL] & 0x01) { 00199 SetAsyncKeyStateToggle(VK_SCROLL); 00200 } else { 00201 ClearAsyncKeyStateToggle(VK_SCROLL); 00202 } 00203 00204 UpdateKeyLights(TRUE); 00205 #endif 00206 00207 return TRUE; 00208 }

BOOL _SetLayeredWindowAttributes PWND  pwnd,
COLORREF  crKey,
BYTE  bAlpha,
DWORD  dwFlags
 

Definition at line 230 of file sprite.c.

References _GetProp(), BOOL, ConvertRedirectionDCs(), CreateRedirectionBitmap(), dwFlags, FALSE, ghdcMem, gpDispInfo, tagDISPLAYINFO::hDev, NULL, PROP_LAYER, PtoHq, tagWND::rcWindow, TestWF, TRUE, and WEFLAYERED.

Referenced by NtUserSetLayeredWindowAttributes().

00232 { 00233 BOOL bRet; 00234 BLENDFUNCTION blend; 00235 HBITMAP hbm; 00236 00237 if (!TestWF(pwnd, WEFLAYERED)) { 00238 RIPERR1(ERROR_INVALID_PARAMETER, RIP_WARNING, 00239 "SetLayeredWindowAttributes: not a sprite %X", pwnd); 00240 return FALSE; 00241 } 00242 00243 if ((hbm = _GetProp(pwnd, PROP_LAYER, TRUE)) == NULL) { 00244 HBITMAP hbmNew; 00245 00246 if ((hbmNew = CreateRedirectionBitmap(pwnd)) == NULL) { 00247 return FALSE; 00248 } 00249 00250 ConvertRedirectionDCs(pwnd, hbmNew); 00251 } 00252 00253 blend.BlendOp = AC_SRC_OVER; 00254 blend.BlendFlags = 0; 00255 blend.AlphaFormat = 0; 00256 blend.SourceConstantAlpha = bAlpha; 00257 00258 dwFlags |= ULW_NEW_ATTRIBUTES; // Notify gdi that these are new attributes 00259 00260 if (hbm != NULL) { 00261 HBITMAP hbmOld; 00262 SIZE size; 00263 POINT ptSrc = {0,0}; 00264 00265 hbmOld = GreSelectBitmap(ghdcMem, hbm); 00266 00267 size.cx = pwnd->rcWindow.right - pwnd->rcWindow.left; 00268 size.cy = pwnd->rcWindow.bottom - pwnd->rcWindow.top; 00269 00270 bRet = GreUpdateSprite(gpDispInfo->hDev, PtoHq(pwnd), NULL, NULL, 00271 NULL, &size, ghdcMem, &ptSrc, crKey, &blend, dwFlags, NULL); 00272 00273 GreSelectBitmap(ghdcMem, hbmOld); 00274 } else { 00275 bRet = GreUpdateSprite(gpDispInfo->hDev, PtoHq(pwnd), NULL, NULL, 00276 NULL, NULL, NULL, NULL, crKey, &blend, dwFlags, NULL); 00277 } 00278 00279 return bRet; 00280 }

BOOL _SetLogonNotifyWindow PWND  pwnd  ) 
 

Definition at line 153 of file logon.c.

References BOOL, FALSE, GetCurrentProcessId, gpidLogon, gspwndLogonNotify, Lock, and TRUE.

Referenced by NtUserSetLogonNotifyWindow().

00155 { 00156 /* 00157 * Make sure the caller is the logon process 00158 */ 00159 if (GetCurrentProcessId() != gpidLogon) { 00160 RIPERR0(ERROR_ACCESS_DENIED, 00161 RIP_WARNING, 00162 "Access denied in _SetLogonNotifyWindow"); 00163 00164 return FALSE; 00165 } 00166 00167 Lock(&gspwndLogonNotify, pwnd); 00168 00169 return TRUE; 00170 }

BOOL _SetMenuContextHelpId PMENU  pMenu,
DWORD  dwContextHelpId
 

Definition at line 999 of file mnchange.c.

References BOOL, tagMENU::dwContextHelpId, and TRUE.

Referenced by NtUserSetMenuContextHelpId().

01000 { 01001 01002 // Set the new context help Id; 01003 pMenu->dwContextHelpId = dwContextHelpId; 01004 01005 return TRUE; 01006 }

BOOL _SetMenuDefaultItem PMENU  pMenu,
UINT  wId,
BOOL  fByPosition
 

Definition at line 567 of file mnsys.c.

References BOOL, tagMENU::cItems, ClearMFS, FALSE, MFMWFP_NOITEM, MNLookUpItem(), NULL, tagMENU::rgItems, SetMFS, TestMFS, TestMFT, TRUE, UINT, tagITEM::ulWidth, tagITEM::ulX, and UNDERLINE_RECALC.

Referenced by _SetCloseDefault(), NtUserSetMenuDefaultItem(), xxxDefWindowProc(), and xxxSetSysMenu().

00568 { 00569 UINT iItem; 00570 UINT cItems; 00571 PITEM pItem; 00572 PITEM pItemFound; 00573 PMENU pMenuFound; 00574 00575 // 00576 // We need to check if wId actually exists on this menu. 0xFFFF means 00577 // clear all default items. 00578 // 00579 00580 if (wID != MFMWFP_NOITEM) 00581 { 00582 pItemFound = MNLookUpItem(pMenu, wID, fByPosition, &pMenuFound); 00583 00584 // item must be on same menu and can't be a separator 00585 if ((pItemFound == NULL) || (pMenuFound != pMenu) || TestMFT(pItemFound, MFT_SEPARATOR)) 00586 return(FALSE); 00587 00588 } 00589 else 00590 pItemFound = NULL; 00591 00592 pItem = pMenu->rgItems; 00593 cItems = pMenu->cItems; 00594 00595 // Walk the menu list, clearing MFS_DEFAULT from all other items, and 00596 // setting MFS_DEFAULT on the requested one. 00597 for (iItem = 0; iItem < cItems; iItem++, pItem++) { 00598 // 00599 // Note we don't change the state of lpItemFound if it exists. This 00600 // is so that below, where we try to set the default, we can tell 00601 // if we need to recalculate the underline. 00602 // 00603 00604 if (TestMFS(pItem, MFS_DEFAULT) && (pItem != pItemFound)) 00605 { 00606 // 00607 // We are changing the default item. As such, it will be drawn 00608 // with a different font than the one used to calculate it, if 00609 // the menu has already been drawn once. We need to ensure 00610 // that the underline gets drawn in the right place the next 00611 // time the menu comes up. Cause it to recalculate. 00612 // 00613 // We do NOT do this if the item 00614 // (a) isn't default--otherwise we'll recalculate the 00615 // underline for every system menu item every time we go into 00616 // menu mode because sysmenu init will call SetMenuDefaultItem. 00617 // (b) isn't the item we're going to set as the default. 00618 // That way we don't recalculate the underline when the item 00619 // isn't changing state. 00620 // 00621 ClearMFS(pItem, MFS_DEFAULT); 00622 pItem->ulX = UNDERLINE_RECALC; 00623 pItem->ulWidth = 0; 00624 } 00625 } 00626 00627 if (wID != MFMWFP_NOITEM) 00628 { 00629 if (!TestMFS(pItemFound, MFS_DEFAULT)) 00630 { 00631 // 00632 // We are changing from non-default to default. Clear out 00633 // the underline info. If the menu has never painted, this 00634 // won't do anything. But it matters a lot if it has. 00635 // 00636 SetMFS(pItemFound, MFS_DEFAULT); 00637 pItemFound->ulX = UNDERLINE_RECALC; 00638 pItemFound->ulWidth = 0; 00639 } 00640 } 00641 00642 return(TRUE); 00643 }

BOOL _SetMenuFlagRtoL PMENU  pMenu  ) 
 

Definition at line 1008 of file mnchange.c.

References BOOL, MFRTL, SetMF, and TRUE.

Referenced by NtUserSetMenuFlagRtoL().

01009 { 01010 01011 // This is a right-to-left menu being created; 01012 SetMF(pMenu, MFRTL); 01013 01014 return TRUE; 01015 }

LONG_PTR _SetMessageExtraInfo LONG_PTR   ) 
 

Definition at line 6485 of file ntuser/kernel/input.c.

References tagQ::ExtraInfo, tagTHREADINFO::pq, and PtiCurrent.

06486 { 06487 LONG_PTR lRet; 06488 PTHREADINFO pti = PtiCurrent(); 06489 06490 lRet = pti->pq->ExtraInfo; 06491 pti->pq->ExtraInfo = lData; 06492 return lRet; 06493 }

BOOL _SetProgmanWindow PWND  pwnd  ) 
 

Definition at line 48 of file miscutil.c.

References BOOL, FALSE, GETDESKINFO, Lock, NULL, PtiCurrent, tagDESKTOPINFO::spwndProgman, and TRUE.

00048 { 00049 00050 PDESKTOPINFO pdeskinfo = GETDESKINFO(PtiCurrent()); 00051 00052 if (pwnd != NULL) { 00053 // Fail the call if another shell window exists 00054 if (pdeskinfo->spwndProgman != NULL) 00055 return(FALSE); 00056 } 00057 00058 Lock(&pdeskinfo->spwndProgman, pwnd); 00059 00060 return(TRUE); 00061 }

VOID _SetRipFlags DWORD  ,
DWORD 
 

Definition at line 264 of file rare.c.

References DWORD, gpsi, RIPF_VALIDUSERFLAGS, VOID(), tagSERVERINFO::wRIPFlags, and tagSERVERINFO::wRIPPID.

Referenced by NtUserSetRipFlags(), and SetRipFlags().

00266 { 00267 if (gpsi) { 00268 if ((dwRipFlags != (DWORD)-1) && !(dwRipFlags & ~RIPF_VALIDUSERFLAGS)) { 00269 gpsi->wRIPFlags = (WORD)((gpsi->wRIPFlags & ~RIPF_VALIDUSERFLAGS) | dwRipFlags); 00270 } 00271 if (dwPID != (DWORD)-1) { 00272 gpsi->wRIPPID = (WORD)dwPID; 00273 } 00274 } 00275 }

BOOL _SetSystemMenu PWND  pwnd,
PMENU  pMenu
 

UINT_PTR _SetSystemTimer PWND  pwnd,
UINT_PTR  nIDEvent,
DWORD  dwElapse,
TIMERPROC_PWND  pTimerFunc
 

Definition at line 78 of file timers.c.

References GETPTI, InternalSetTimer(), and PpiCurrent.

Referenced by _SetCaretBlinkTime(), NtUserSetSystemTimer(), xxxContScroll(), xxxCreateCaret(), xxxTrackBox(), and zzzSetCaretPos().

00083 { 00084 /* 00085 * Prevent apps from setting a Timer with a window proc to another app 00086 */ 00087 if (pwnd && PpiCurrent() != GETPTI(pwnd)->ppi) { 00088 00089 RIPERR1(ERROR_ACCESS_DENIED, 00090 RIP_WARNING, 00091 "Calling SetSystemTimer with window of another process %lX", 00092 pwnd); 00093 00094 return 0; 00095 } 00096 00097 return InternalSetTimer(pwnd, nIDEvent, dwElapse, pTimerFunc, TMRF_SYSTEM); 00098 }

BOOL _SetTaskmanWindow PWND  pwnd  ) 
 

Definition at line 63 of file miscutil.c.

References BOOL, FALSE, GETDESKINFO, Lock, NULL, PtiCurrent, tagDESKTOPINFO::spwndTaskman, and TRUE.

00063 { 00064 00065 PDESKTOPINFO pdeskinfo = GETDESKINFO(PtiCurrent()); 00066 00067 if (pwnd != NULL) { 00068 // Fail the call if another shell window exists 00069 if (pdeskinfo->spwndTaskman != NULL) 00070 return(FALSE); 00071 } 00072 00073 Lock(&pdeskinfo->spwndTaskman, pwnd); 00074 00075 return(TRUE); 00076 }

UINT_PTR _SetTimer PWND  pwnd,
UINT_PTR  nIDEvent,
UINT  dwElapse,
TIMERPROC_PWND  pTimerFunc
 

Definition at line 45 of file timers.c.

References GETPTI, InternalSetTimer(), and PpiCurrent.

Referenced by MNSetTimerToAutoDismiss(), MNSetTimerToCloseHierarchy(), MNSetTimerToOpenHierarchy(), NtUserSetTimer(), xxxMenuWindowProc(), and xxxMNDoScroll().

00050 { 00051 /* 00052 * Prevent apps from setting a Timer with a window proc to another app 00053 */ 00054 if (pwnd && (PpiCurrent() != GETPTI(pwnd)->ppi)) { 00055 00056 RIPERR1(ERROR_ACCESS_DENIED, 00057 RIP_WARNING, 00058 "Calling SetTimer with window of another process %lX", 00059 pwnd); 00060 00061 return 0; 00062 } 00063 00064 return InternalSetTimer(pwnd, nIDEvent, dwElapse, pTimerFunc, 0); 00065 }

BOOL _SetUserObjectInformation HANDLE  h,
int  nIndex,
PVOID  pvInfo,
DWORD  nLength
 

Definition at line 764 of file w32/ntuser/kernel/security.c.

References BOOL, DWORD, ExDesktopObjectType, ExWindowStationObjectType, FALSE, HF_DESKTOPHOOK, LogDesktop, NT_SUCCESS, NTSTATUS(), NULL, ObDereferenceObject, OBJECT_TO_OBJECT_HEADER, ObReferenceObjectByHandle(), PtiCurrent, SetHandleFlag(), Status, TRUE, _OBJECT_HEADER::Type, and UserMode.

Referenced by NtUserSetObjectInformation().

00769 { 00770 PUSEROBJECTFLAGS puof; 00771 BOOL fSuccess = TRUE; 00772 PVOID pObject; 00773 POBJECT_HEADER pHead; 00774 DWORD dwLengthNeeded = 0; 00775 OBJECT_HANDLE_INFORMATION ohi; 00776 OBJECT_HANDLE_FLAG_INFORMATION ofi; 00777 NTSTATUS Status; 00778 00779 /* 00780 * Validate the object 00781 */ 00782 Status = ObReferenceObjectByHandle( 00783 h, 00784 0, 00785 NULL, 00786 UserMode, // this is always called from the client side 00787 &pObject, 00788 &ohi); 00789 if (!NT_SUCCESS(Status)) { 00790 RIPNTERR0(Status, RIP_VERBOSE, "ObReferenceObjectByHandle Failed"); 00791 return FALSE; 00792 } 00793 00794 pHead = OBJECT_TO_OBJECT_HEADER(pObject); 00795 if (pHead->Type != *ExWindowStationObjectType && 00796 pHead->Type != *ExDesktopObjectType) { 00797 RIPERR0(ERROR_INVALID_FUNCTION, RIP_WARNING, "Object is not a USER object"); 00798 ObDereferenceObject(pObject); 00799 return FALSE; 00800 } 00801 00802 #ifdef LOGDESKTOPLOCKS 00803 if (OBJECT_TO_OBJECT_HEADER(pObject)->Type == *ExDesktopObjectType) { 00804 LogDesktop(pObject, LD_REF_FN_SETUSEROBJECTINFORMATION, TRUE, (ULONG_PTR)PtiCurrent()); 00805 } 00806 #endif 00807 00808 try { 00809 switch (nIndex) { 00810 case UOI_FLAGS: 00811 if (nLength < sizeof(USEROBJECTFLAGS)) { 00812 RIPERR0(ERROR_INVALID_DATA, RIP_VERBOSE, ""); 00813 fSuccess = FALSE; 00814 break; 00815 } 00816 puof = ccxpvInfo; 00817 ZwQueryObject(h, ObjectHandleFlagInformation, 00818 &ofi, sizeof(ofi), NULL); 00819 ofi.Inherit = (puof->fInherit != FALSE); 00820 ZwSetInformationObject(h, ObjectHandleFlagInformation, 00821 &ofi, sizeof(ofi)); 00822 if (pHead->Type == *ExDesktopObjectType) { 00823 SetHandleFlag(h, HF_DESKTOPHOOK, 00824 puof->dwFlags & DF_ALLOWOTHERACCOUNTHOOK); 00825 } 00826 break; 00827 default: 00828 RIPERR0(ERROR_INVALID_PARAMETER, RIP_VERBOSE, ""); 00829 fSuccess = FALSE; 00830 break; 00831 } 00832 } except (W32ExceptionHandler(TRUE, RIP_WARNING)) { 00833 fSuccess = FALSE; 00834 } 00835 00836 #ifdef LOGDESKTOPLOCKS 00837 if (OBJECT_TO_OBJECT_HEADER(pObject)->Type == *ExDesktopObjectType) { 00838 LogDesktop(pObject, LD_DEREF_FN_SETUSEROBJECTINFORMATION, FALSE, (ULONG_PTR)PtiCurrent()); 00839 } 00840 #endif 00841 00842 ObDereferenceObject(pObject); 00843 00844 return fSuccess; 00845 }

BOOL _SetWindowContextHelpId PWND  pwnd,
DWORD  dwContextId
 

Definition at line 22 of file kernel/help.c.

References tagSERVERINFO::atomContextHelpIdProp, BOOL, gpsi, InternalRemoveProp(), InternalSetProp(), MAKEINTATOM, PROPF_INTERNAL, PROPF_NOPOOL, and TRUE.

00023 { 00024 //If dwContextId is NULL, then this implies that the caller wants to 00025 // remove the dwContextId associated with this Window. 00026 if(dwContextId == 0) { 00027 InternalRemoveProp(pWnd, MAKEINTATOM(gpsi->atomContextHelpIdProp), 00028 PROPF_INTERNAL); 00029 return(TRUE); 00030 } 00031 00032 return (InternalSetProp(pWnd, MAKEINTATOM(gpsi->atomContextHelpIdProp), 00033 (HANDLE)LongToHandle( dwContextId ), PROPF_INTERNAL | PROPF_NOPOOL)); 00034 }

UINT _SetWindowStationUser PWINDOWSTATION  pwinsta,
PLUID  pluidUser,
PSID  psidUser,
DWORD  cbsidUser
 

Definition at line 1459 of file winsta.c.

References FALSE, GetCurrentProcessId, gpidLogon, tagWINDOWSTATION::luidUser, NULL, tagWINDOWSTATION::psidUser, TRUE, and UINT.

Referenced by NtUserSetWindowStationUser().

01464 { 01465 01466 /* 01467 * Make sure the caller is the logon process 01468 */ 01469 if (GetCurrentProcessId() != gpidLogon) { 01470 RIPERR0(ERROR_ACCESS_DENIED, 01471 RIP_WARNING, 01472 "Access denied in _SetWindowStationUser: caller must be in the logon process"); 01473 01474 return FALSE; 01475 } 01476 01477 if (pwinsta->psidUser != NULL) 01478 UserFreePool(pwinsta->psidUser); 01479 01480 if (ccxpsidUser != NULL) { 01481 pwinsta->psidUser = UserAllocPoolWithQuota(cbsidUser, TAG_SECURITY); 01482 if (pwinsta->psidUser == NULL) { 01483 RIPERR0(ERROR_OUTOFMEMORY, 01484 RIP_WARNING, 01485 "Memory allocation failed in _SetWindowStationUser"); 01486 01487 return FALSE; 01488 } 01489 try { 01490 RtlCopyMemory(pwinsta->psidUser, ccxpsidUser, cbsidUser); 01491 } except (W32ExceptionHandler(TRUE, RIP_WARNING)) { 01492 01493 UserFreePool(pwinsta->psidUser); 01494 pwinsta->psidUser = NULL; 01495 return FALSE; 01496 } 01497 } else { 01498 pwinsta->psidUser = NULL; 01499 } 01500 01501 pwinsta->luidUser = *pluidUser; 01502 01503 return TRUE; 01504 }

WORD _SetWindowWord PWND  pwnd,
int  index,
WORD  value
 

Definition at line 133 of file ntuser/kernel/getset.c.

References tagBUTN::buttonState, BYTE, CBFNID, tagWND::cbwndExtra, DWORD, tagWND::dwUserData, FALSE, FCallerOk(), FNID_BUTTON, FNID_DIALOG, FNID_MDICLIENT, GETFNID, ProbeAndReadUlong, TestWF, UINT, and WFDIALOGWINDOW.

Referenced by NtUserSetWindowWord().

00137 { 00138 WORD wOld; 00139 00140 /* 00141 * Don't allow setting of words belonging to a system thread if the caller 00142 * is not a system thread. Same goes for winlogon. 00143 */ 00144 if (!FCallerOk(pwnd)) { 00145 RIPERR0(ERROR_INVALID_INDEX, RIP_VERBOSE, ""); 00146 return 0; 00147 } 00148 00149 /* 00150 * Applications can not set a WORD into a dialog Proc or any of the 00151 * non-public reserved bytes in DLGWINDOWEXTRA (usersrv stores pointers 00152 * theres) 00153 */ 00154 if (TestWF(pwnd, WFDIALOGWINDOW)) { 00155 if (((index >= DWLP_DLGPROC) && (index < DWLP_MSGRESULT)) || 00156 ((index > DWLP_USER+sizeof(LONG_PTR)-sizeof(WORD)) && (index < DLGWINDOWEXTRA))) { 00157 RIPERR3(ERROR_INVALID_INDEX, RIP_WARNING, 00158 "SetWindowWord: Trying to set WORD of a windowproc pwnd=(%#p) index=(%ld) fnid (%lX)", 00159 pwnd, index, (DWORD)pwnd->fnid); 00160 return 0; 00161 } else { 00162 00163 /* 00164 * If this is really a dialog and not some other server class 00165 * where usersrv has stored some data (Windows Compuserve - 00166 * wincim - does this) then store the data now that we have 00167 * verified the index limits. 00168 */ 00169 if (GETFNID(pwnd) == FNID_DIALOG) 00170 goto DoSetWord; 00171 } 00172 } 00173 00174 if (index == GWLP_USERDATA) { 00175 wOld = (WORD)pwnd->dwUserData; 00176 pwnd->dwUserData = MAKELONG(value, HIWORD(pwnd->dwUserData)); 00177 return wOld; 00178 } 00179 00180 // fix for RedShift, they call SetWindowWord 00181 // tn play with the low word of the style dword 00182 if (index == GWL_STYLE) { 00183 wOld = (WORD)pwnd->style; 00184 pwnd->style = MAKELONG(value, HIWORD(pwnd->style)); 00185 return wOld; 00186 } 00187 00188 if (GETFNID(pwnd) != 0) { 00189 if (index >= 0 && 00190 (index < (int)(CBFNID(pwnd->fnid)-sizeof(WND)))) { 00191 switch (GETFNID(pwnd)) { 00192 case FNID_MDICLIENT: 00193 if (index == 0) 00194 break; 00195 goto DoDefault; 00196 00197 case FNID_BUTTON: 00198 /* 00199 * CorelDraw, Direct Access 1.0 and WordPerfect 6.0 do a 00200 * get/set on the first button window word. Allow this 00201 * for compatibility. 00202 */ 00203 if (index == 0) { 00204 /* 00205 * Since we now use a lookaside buffer for the control's 00206 * private data, we need to indirect into this structure. 00207 */ 00208 PBUTN pbutn = ((PBUTNWND)pwnd)->pbutn; 00209 if (!pbutn || (LONG_PTR)pbutn == (LONG_PTR)-1) { 00210 return 0; 00211 } else { 00212 try { 00213 wOld = (WORD)ProbeAndReadUlong(&pbutn->buttonState); 00214 pbutn->buttonState = value; 00215 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00216 wOld = 0; 00217 } 00218 return wOld; 00219 } 00220 } 00221 goto DoDefault; 00222 00223 default: 00224 DoDefault: 00225 RIPERR3(ERROR_INVALID_INDEX, 00226 RIP_WARNING, 00227 "SetWindowWord: Trying to set private server data pwnd=(%#p) index=(%ld) fnid (%lX)", 00228 pwnd, index, (DWORD)pwnd->fnid); 00229 return 0; 00230 break; 00231 } 00232 } 00233 } 00234 00235 DoSetWord: 00236 if ((index < 0) || ((UINT)index + sizeof(WORD) > (UINT)pwnd->cbwndExtra)) { 00237 RIPERR0(ERROR_INVALID_INDEX, RIP_WARNING,"SetWindowWord Fails because of invalid index"); 00238 return 0; 00239 } else { 00240 WORD UNALIGNED *pw; 00241 00242 pw = (WORD UNALIGNED *)((BYTE *)(pwnd + 1) + index); 00243 wOld = *pw; 00244 *pw = value; 00245 return (WORD)wOld; 00246 } 00247 }

PEVENTHOOK _SetWinEventHook DWORD  eventMin,
DWORD  eventMax,
HMODULE  hmodWinEventProc,
PUNICODE_STRING  pstrLib,
WINEVENTPROC  pfnWinEventProc,
HANDLE  hEventProcess,
DWORD  idEventThread,
DWORD  dwFlags
 

Definition at line 674 of file kernel/winable.c.

References AddHmodDependency(), dwFlags, tagEVENTHOOK::eventMax, tagEVENTHOOK::eventMin, FALSE, tagEVENTHOOK::fDestroyed, tagEVENTHOOK::fIgnoreOwnProcess, tagEVENTHOOK::fIgnoreOwnThread, tagEVENTHOOK::fSync, GetHmodTableIndex(), gpWinEventHooks, tagEVENTHOOK::hEventProcess, HMAllocObject(), tagEVENTHOOK::idEventThread, tagEVENTHOOK::ihmod, NULL, tagEVENTHOOK::offPfn, tagEVENTHOOK::pehNext, PtiCurrent, PtiFromThreadId(), SET_SRVIF, SRVIF_WINEVENTHOOKS, tagTHREADINFO::TIF_flags, TIF_GUITHREADINITIALIZED, TIF_INCLEANUP, TYPE_WINEVENTHOOK, and UINT.

Referenced by NtUserSetWinEventHook().

00683 { 00684 PEVENTHOOK pEventNew; 00685 PTHREADINFO ptiCurrent; 00686 00687 int ihmod; 00688 00689 ptiCurrent = PtiCurrent(); 00690 00691 // 00692 // If exiting, fail the call. 00693 // 00694 if (ptiCurrent->TIF_flags & TIF_INCLEANUP) { 00695 RIPMSG1(RIP_ERROR, "SetWinEventHook: Fail call - thread %#p in cleanup", ptiCurrent); 00696 return NULL; 00697 } 00698 00699 /* 00700 * Check to see if filter proc is valid. 00701 */ 00702 if (pfnWinEventProc == NULL) { 00703 RIPERR0(ERROR_INVALID_FILTER_PROC, RIP_VERBOSE, "pfnWinEventProc == NULL"); 00704 return NULL; 00705 } 00706 00707 if (eventMin > eventMax) { 00708 RIPERR0(ERROR_INVALID_HOOK_FILTER, RIP_VERBOSE, "eventMin > eventMax"); 00709 return NULL; 00710 } 00711 00712 if (dwFlags & WINEVENT_INCONTEXT) { 00713 /* 00714 * WinEventProc to be called in context of hooked thread, so needs a DLL 00715 */ 00716 if (hmodWinEventProc == NULL) { 00717 RIPERR0(ERROR_HOOK_NEEDS_HMOD, RIP_VERBOSE, ""); 00718 return NULL; 00719 } else if (pstrLib == NULL) { 00720 /* 00721 * If we got an hmod, we should get a DLL name too! 00722 */ 00723 RIPERR1(ERROR_DLL_NOT_FOUND, RIP_ERROR, 00724 "hmod %#p, but no lib name", hmodWinEventProc); 00725 return NULL; 00726 } 00727 ihmod = GetHmodTableIndex(pstrLib); 00728 if (ihmod == -1) { 00729 RIPERR0(ERROR_MOD_NOT_FOUND, RIP_VERBOSE, ""); 00730 return NULL; 00731 } 00732 } else { 00733 ihmod = -1; // means no DLL is required 00734 hmodWinEventProc = 0; 00735 } 00736 00737 /* 00738 * Check the thread id, check it is a GUI thread. 00739 */ 00740 if (idEventThread != 0) { 00741 PTHREADINFO ptiT; 00742 00743 ptiT = PtiFromThreadId(idEventThread); 00744 if ((ptiT == NULL) || 00745 !(ptiT->TIF_flags & TIF_GUITHREADINITIALIZED)) { 00746 RIPERR1(ERROR_INVALID_THREAD_ID, RIP_VERBOSE, "pti %#p", ptiT); 00747 return NULL; 00748 } 00749 } 00750 00751 // 00752 // Create the window for async events first. Creating it might yield, 00753 // so we want to do this before we've touched our event array. 00754 // 00755 // NOTE that USER itself will not pass on window creation/destruction 00756 // notifications for 00757 // * IME windows 00758 // * OLE windows 00759 // * RPC windows 00760 // * Event windows 00761 // 00762 00763 // 00764 // Get a new event. 00765 // 00766 pEventNew = (PEVENTHOOK)HMAllocObject(ptiCurrent, NULL, 00767 TYPE_WINEVENTHOOK, sizeof(EVENTHOOK)); 00768 if (!pEventNew) 00769 return NULL; 00770 00771 // 00772 // Fill in the new event. 00773 // 00774 pEventNew->eventMin = (UINT)eventMin; 00775 pEventNew->eventMax = (UINT)eventMax; 00776 00777 // pEventNew->f32Bit = ((dwFlags & WINEVENT_32BITCALLER) != 0); 00778 pEventNew->fIgnoreOwnThread = ((dwFlags & WINEVENT_SKIPOWNTHREAD) != 0); 00779 pEventNew->fIgnoreOwnProcess = ((dwFlags & WINEVENT_SKIPOWNPROCESS) != 0); 00780 pEventNew->fDestroyed = FALSE; 00781 pEventNew->fSync = ((dwFlags & WINEVENT_INCONTEXT) != 0); 00782 00783 pEventNew->hEventProcess = hEventProcess; 00784 pEventNew->idEventThread = idEventThread; 00785 // pEventNew->cInUse = 0; 00786 00787 pEventNew->ihmod = ihmod; 00788 00789 /* 00790 * Add a dependency on this module - meaning, increment a count 00791 * that simply counts the number of hooks set into this module. 00792 */ 00793 if (pEventNew->ihmod >= 0) { 00794 AddHmodDependency(pEventNew->ihmod); 00795 } 00796 00797 /* 00798 * If pfnWinEventProc is in caller's process and no DLL is involved, 00799 * then pEventNew->offPfn is the actual address. 00800 */ 00801 pEventNew->offPfn = ((ULONG_PTR)pfnWinEventProc) - ((ULONG_PTR)hmodWinEventProc); 00802 00803 // 00804 // 00805 // Link our event into the master list. 00806 // 00807 // Note that we count on USER to not generate any events when installing 00808 // our hook. The caller can't handle it yet since he hasn't got back 00809 // his event handle from this call. 00810 // 00811 pEventNew->pehNext = gpWinEventHooks; 00812 gpWinEventHooks = pEventNew; 00813 SET_SRVIF(SRVIF_WINEVENTHOOKS); 00814 00815 return pEventNew; 00816 }

BOOL _ShowWindowAsync PWND  pwnd,
int  cmdShow,
UINT  uWPFlags
 

Definition at line 25 of file showwin.c.

References BOOL, GETPTI, HWq, NULL, PostEventMessage(), PUDF_ANIMATE, QEVENT_SHOWWINDOW, and TEST_PUDF.

Referenced by NtUserShowWindowAsync(), and xxxSetWindowPlacement().

00026 { 00027 00028 return PostEventMessage( 00029 GETPTI(pwnd), 00030 GETPTI(pwnd)->pq, 00031 QEVENT_SHOWWINDOW, 00032 NULL, 00033 uWPFlags, 00034 (WPARAM)HWq(pwnd), 00035 cmdShow | TEST_PUDF(PUDF_ANIMATE)); 00036 }

BOOL APIENTRY _SwapMouseButton BOOL  fSwapButtons  ) 
 

Definition at line 25 of file sysmet.c.

References tagPROCESSINFO::amwinsta, APIENTRY, BOOL, FALSE, gbMouseButtonsRecentlySwapped, PpiCurrent, RETURN_IF_ACCESS_DENIED, and SYSMET.

Referenced by xxxSystemParametersInfo().

00027 { 00028 BOOL fSwapOld; 00029 PPROCESSINFO ppiCurrent = PpiCurrent(); 00030 00031 /* 00032 * Blow it off if the caller doesn't have the proper access rights 00033 */ 00034 RETURN_IF_ACCESS_DENIED(ppiCurrent->amwinsta, 00035 WINSTA_READATTRIBUTES | WINSTA_WRITEATTRIBUTES, 00036 FALSE); 00037 00038 if (!(ppiCurrent->W32PF_Flags & W32PF_IOWINSTA)) { 00039 RIPERR0(ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION, 00040 RIP_WARNING, 00041 "SwapMouseButton invalid on a non-interactive WindowStation."); 00042 00043 return FALSE; 00044 } 00045 00046 fSwapOld = SYSMET(SWAPBUTTON); 00047 SYSMET(SWAPBUTTON) = fSwapButtons; 00048 00049 /* 00050 * Give xxxButtonEvent a hint that a mouse button event may have to be 00051 * left/right swapped to correspond with our current async key state. 00052 * Toggle the global since an even number of SwapMouseButtons has no effect. 00053 */ 00054 if (fSwapButtons != fSwapOld) { 00055 gbMouseButtonsRecentlySwapped = !gbMouseButtonsRecentlySwapped; 00056 } 00057 00058 /* 00059 * Return previous state 00060 */ 00061 return fSwapOld; 00062 }

BOOL _UnhookWinEvent PEVENTHOOK  peh  ) 
 

Definition at line 827 of file kernel/winable.c.

References DBGVERIFYEVENTHOOK, DestroyEventHook(), FALSE, GETPTI, HMIsMarkDestroy, PtiCurrent, and TRUE.

Referenced by NtUserUnhookWinEvent().

00828 { 00829 DBGVERIFYEVENTHOOK(pEventUnhook); 00830 00831 if (HMIsMarkDestroy(pEventUnhook) || (GETPTI(pEventUnhook) != PtiCurrent())) { 00832 // 00833 // We do this to avoid someone calling UnhookWinEvent() the first 00834 // time, then somehow getting control again and calling it a second 00835 // time before we've managed to free up the event since someone was 00836 // in the middle of using it at the first UWE call. 00837 // 00838 00839 RIPERR0(ERROR_INVALID_HANDLE, RIP_WARNING, "_UnhookWinEvent: Invalid event hook"); 00840 return FALSE; 00841 } 00842 00843 // 00844 // Purge this baby if all notifications are done. 00845 // * if there are SYNC ones pending, the caller will clean this up 00846 // upon the return from calling the event 00847 // * if there are ASYNC ones pending, the receiver will not call 00848 // the event and clean it up when he gets it. 00849 // 00850 00851 // 00852 // NOTE that DestroyEventHook() does not yield! 00853 // 00854 DestroyEventHook(pEventUnhook); 00855 00856 return TRUE; 00857 }

BOOL _UnlockWindowStation PWINDOWSTATION  pwinsta  ) 
 

Definition at line 119 of file logon.c.

References BOOL, tagWINDOWSTATION::dwWSF_Flags, FALSE, GetCurrentProcessId, gpidLogon, TRUE, WSF_OPENLOCK, WSF_SHUTDOWN, and WSF_SWITCHLOCK.

Referenced by NtUserUnlockWindowStation().

00121 { 00122 00123 /* 00124 * Make sure the caller is the logon process 00125 */ 00126 if (GetCurrentProcessId() != gpidLogon) { 00127 RIPERR0(ERROR_ACCESS_DENIED, 00128 RIP_WARNING, 00129 "Access denied in _UnlockWindowStation"); 00130 00131 return FALSE; 00132 } 00133 00134 /* 00135 * If shutdown is occuring, only remove the switch lock. 00136 */ 00137 if (pwinsta->dwWSF_Flags & WSF_SHUTDOWN) 00138 pwinsta->dwWSF_Flags &= ~WSF_SWITCHLOCK; 00139 else 00140 pwinsta->dwWSF_Flags &= ~(WSF_OPENLOCK | WSF_SWITCHLOCK); 00141 return TRUE; 00142 }

BOOL _UnregisterClass LPCWSTR  lpszClassName,
HANDLE  hModule,
PCLSMENUNAME  pcmn
 

Definition at line 555 of file class.c.

References _InnerGetClassPtr(), BOOL, CheckCritIn, DestroyClass(), DWORD, FALSE, FindClassAtom, NULL, tagPROCESSINFO::pclsPrivateList, tagPROCESSINFO::pclsPublicList, tagTHREADINFO::ppi, tagCLSMENUNAME::pszClientAnsiMenuName, PtiCurrent, tagCLSMENUNAME::pusMenuName, tagCLSMENUNAME::pwszClientUnicodeMenuName, and TRUE.

Referenced by NtUserUnregisterClass().

00559 { 00560 ATOM atomT; 00561 PPCLS ppcls; 00562 PTHREADINFO ptiCurrent; 00563 00564 CheckCritIn(); 00565 00566 ptiCurrent = PtiCurrent(); 00567 00568 /* 00569 * Check whether the given ClassName is already registered by the 00570 * Application with the given handle. 00571 * Return error, if either the Class does not exist or it does not 00572 * belong to the calling process. 00573 */ 00574 00575 /* 00576 * bradg (3/9/95) - Must first check to see if an ATOM has been passed 00577 */ 00578 atomT = FindClassAtom(ccxlpszClassName); 00579 00580 ppcls = _InnerGetClassPtr(atomT, &ptiCurrent->ppi->pclsPrivateList, hModule); 00581 if (ppcls == NULL) { 00582 /* 00583 * Maybe this is a public class. 00584 */ 00585 ppcls = _InnerGetClassPtr(atomT, &ptiCurrent->ppi->pclsPublicList, NULL); 00586 if (ppcls == NULL) { 00587 RIPERR1(ERROR_CLASS_DOES_NOT_EXIST, RIP_WARNING, "UnregisterClass: Class does not exist; atom=%lX", (DWORD)atomT); 00588 return FALSE; 00589 } 00590 } 00591 00592 /* 00593 * If any windows created with this class still exist return an error. 00594 */ 00595 if ((*ppcls)->cWndReferenceCount != 0) { 00596 RIPERR0(ERROR_CLASS_HAS_WINDOWS, RIP_WARNING, "UnregisterClass: Class still has window"); 00597 return FALSE; 00598 } 00599 00600 /* 00601 * Return client side pointers for cleanup 00602 */ 00603 pcmn->pszClientAnsiMenuName = (*ppcls)->lpszClientAnsiMenuName; 00604 pcmn->pwszClientUnicodeMenuName = (*ppcls)->lpszClientUnicodeMenuName; 00605 pcmn->pusMenuName = NULL; 00606 00607 /* 00608 * Release the Window class and related information. 00609 */ 00610 DestroyClass(ppcls); 00611 00612 return TRUE; 00613 }

BOOL _UnregisterHotKey PWND  pwnd,
int  id
 

Definition at line 255 of file hotkeys.c.

References BOOL, FALSE, FindHotKey(), NULL, PtiCurrent, and TRUE.

Referenced by NtUserUnregisterHotKey(), and SetDebugHotKeys().

00258 { 00259 PHOTKEY phk; 00260 BOOL fKeysExist; 00261 PTHREADINFO ptiCurrent = PtiCurrent(); 00262 phk = FindHotKey(ptiCurrent, pwnd, id, 0, 0, TRUE, &fKeysExist); 00263 00264 /* 00265 * No hotkey to unregister, return FALSE. 00266 */ 00267 if (phk == NULL) { 00268 RIPERR0(ERROR_HOTKEY_NOT_REGISTERED, RIP_VERBOSE, ""); 00269 return FALSE; 00270 } 00271 00272 return TRUE; 00273 }

BOOL _UpdateLayeredWindow PWND  pwnd,
HDC  hdcDst,
POINT *  pptDst,
SIZE *  psize,
HDC  hdcSrc,
POINT *  pptSrc,
COLORREF  crKey,
BLENDFUNCTION *  pblend,
DWORD  dwFlags
 

Definition at line 625 of file sprite.c.

References _GetProp(), BOOL, dwFlags, FALSE, gpDispInfo, tagDISPLAYINFO::hDev, NULL, PROP_LAYER, PtoHq, tagWND::rcClient, tagWND::rcWindow, SetRectRelative(), TestWF, TRUE, and WEFLAYERED.

Referenced by NtUserUpdateLayeredWindow(), UpdateFade(), and xxxSetLayeredWindow().

00635 { 00636 int dx, dy, dcx, dcy; 00637 BOOL fMove = FALSE, fSize = FALSE; 00638 00639 /* 00640 * Verify that we're called with a real layered window. 00641 */ 00642 if (!TestWF(pwnd, WEFLAYERED) || 00643 _GetProp(pwnd, PROP_LAYER, TRUE) != NULL) { 00644 RIPERR1(ERROR_INVALID_PARAMETER, RIP_WARNING, 00645 "_UpdateLayeredWindow: can't call on window %X", pwnd); 00646 return FALSE; 00647 } 00648 00649 if (!GreUpdateSprite(gpDispInfo->hDev, PtoHq(pwnd), NULL, hdcDst, pptDst, 00650 psize, hdcSrc, pptSrc, crKey, pblend, dwFlags, NULL)) { 00651 RIPMSG1(RIP_WARNING, "_UpdateLayeredWindow: !UpdateSprite %X", pwnd); 00652 return FALSE; 00653 } 00654 00655 /* 00656 * Figure out relative adjustments in position and size. 00657 */ 00658 if (pptDst != NULL) { 00659 dx = pptDst->x - pwnd->rcWindow.left; 00660 dy = pptDst->y - pwnd->rcWindow.top; 00661 if (dx != 0 || dy != 0) { 00662 fMove = TRUE; 00663 } 00664 } else { 00665 dx = 0; 00666 dy = 0; 00667 } 00668 if (psize != NULL) { 00669 dcx = psize->cx - (pwnd->rcWindow.right - pwnd->rcWindow.left); 00670 dcy = psize->cy - (pwnd->rcWindow.bottom - pwnd->rcWindow.top); 00671 if (dcx != 0 || dcy != 0) { 00672 fSize = TRUE; 00673 } 00674 } else { 00675 dcx = 0; 00676 dcy = 0; 00677 } 00678 00679 if (fMove || fSize) { 00680 /* 00681 * Adjust the client rect position and size relative to 00682 * the window rect. 00683 */ 00684 SetRectRelative(&pwnd->rcWindow, dx, dy, dcx, dcy); 00685 SetRectRelative(&pwnd->rcClient, dx, dy, dcx, dcy); 00686 00687 /* 00688 * Since the client rect could be smaller than the window 00689 * rect make sure the client rect doesn't underflow! 00690 */ 00691 if ((dcx < 0) && (pwnd->rcClient.left < pwnd->rcWindow.left)) { 00692 pwnd->rcClient.left = pwnd->rcWindow.left; 00693 pwnd->rcClient.right = pwnd->rcWindow.left; 00694 } 00695 if ((dcy < 0) && (pwnd->rcClient.top < pwnd->rcWindow.top)) { 00696 pwnd->rcClient.top = pwnd->rcWindow.top; 00697 pwnd->rcClient.bottom = pwnd->rcWindow.top; 00698 } 00699 /* 00700 * BUGBUG: should jiggle the mouse, do this when SetFMouseMoved 00701 * doesn't leave crit. 00702 * 00703 * SetFMouseMoved(); 00704 */ 00705 } 00706 00707 return TRUE; 00708 }

NTSTATUS _UserTestForWinStaAccess PUNICODE_STRING  pstrWinSta,
BOOL  fInherit
 

Definition at line 295 of file w32/ntuser/kernel/security.c.

References _OpenWindowStation(), AccessCheckObject(), CheckCritIn, DEFAULT_WINSTA, FALSE, gbSecureDesktop, grpWinStaList, KernelMode, KPROCESSOR_MODE, luidSystem, tagWINDOWSTATION::luidUser, NT_SUCCESS, NTSTATUS(), NULL, OpenEffectiveToken(), PBYTE, RtlEqualLuid(), RtlEqualUnicodeString(), RtlInitUnicodeString(), Status, TRUE, UserMode, and WinStaMapping.

Referenced by xxxResolveDesktop().

00299 { 00300 PTOKEN_STATISTICS pStats; 00301 ULONG BytesRequired; 00302 PWINDOWSTATION pwinsta; 00303 HWINSTA hwsta = NULL; 00304 OBJECT_ATTRIBUTES ObjAttr; 00305 POBJECT_ATTRIBUTES pObjAttr = NULL; 00306 PUNICODE_STRING pstrStatic; 00307 NTSTATUS Status = STATUS_SUCCESS; 00308 SIZE_T cbObjA; 00309 UNICODE_STRING strDefWinSta; 00310 HANDLE htoken; 00311 00312 CheckCritIn(); 00313 00314 UserAssert(NtCurrentTeb()); 00315 UserAssert(pstrWinSta->Buffer == NtCurrentTeb()->StaticUnicodeBuffer); 00316 00317 /* 00318 * If we are testing against Default WindowStation (WinSta0) retreive 00319 * pwinsta from the top of the grpwinstaList instead of doing an 00320 * OpenWindowStation() 00321 * 00322 * !!! 00323 * 00324 * This relies on the fact that there is only ONE interactive 00325 * windowstation and that it is the first one in the list. 00326 * If multiple windowstations are ever supported 00327 * a lookup will have to be done instead. 00328 */ 00329 RtlInitUnicodeString(&strDefWinSta, DEFAULT_WINSTA); 00330 if (RtlEqualUnicodeString(pstrWinSta, &strDefWinSta, TRUE)) { 00331 00332 00333 if (!NT_SUCCESS(Status = OpenEffectiveToken(&htoken))) { 00334 return Status; 00335 } 00336 00337 Status = ZwQueryInformationToken( 00338 htoken, // Handle 00339 TokenStatistics, // TokenInformationClass 00340 NULL, // TokenInformation 00341 0, // TokenInformationLength 00342 &BytesRequired // ReturnLength 00343 ); 00344 00345 if (Status != STATUS_BUFFER_TOO_SMALL) { 00346 ZwClose(htoken); 00347 return Status; 00348 } 00349 00350 // 00351 // Allocate space for the user info 00352 // 00353 00354 pStats = (PTOKEN_STATISTICS)UserAllocPoolWithQuota(BytesRequired, TAG_SECURITY); 00355 if (pStats == NULL) { 00356 Status = STATUS_NO_MEMORY; 00357 ZwClose(htoken); 00358 return Status; 00359 } 00360 00361 // 00362 // Read in the user info 00363 // 00364 00365 if (!NT_SUCCESS(Status = ZwQueryInformationToken( 00366 htoken, // Handle 00367 TokenStatistics, // TokenInformationClass 00368 pStats, // TokenInformation 00369 BytesRequired, // TokenInformationLength 00370 &BytesRequired // ReturnLength 00371 ))) { 00372 ZwClose(htoken); 00373 UserFreePool(pStats); 00374 return Status; 00375 } 00376 00377 /* 00378 * Make sure that current process has access to this window station 00379 */ 00380 Status = STATUS_ACCESS_DENIED; 00381 00382 if (grpWinStaList != NULL) { 00383 00384 /* 00385 * !!! 00386 * 00387 * This relies on the fact that there is only ONE interactive 00388 * windowstation and that it is the first one in the list. 00389 * If multiple windowstations are ever supported 00390 * a lookup will have to be done here. 00391 */ 00392 pwinsta = grpWinStaList; 00393 00394 /* 00395 * For now we will just do the user luid test till we figure out 00396 * what fInherit means for a Multi-User system 00397 */ 00398 if (fInherit) { 00399 if ( (RtlEqualLuid(&pStats->AuthenticationId, &pwinsta->luidUser)) || 00400 (RtlEqualLuid(&pStats->AuthenticationId, &luidSystem)) || 00401 (AccessCheckObject(pwinsta, GENERIC_EXECUTE, (KPROCESSOR_MODE)(gbSecureDesktop ? UserMode : KernelMode), &WinStaMapping)) ) { 00402 Status = STATUS_SUCCESS; 00403 } 00404 } else { 00405 /* Bug 42905. Service Controller clears the flag 00406 * ScStartupInfo.dwFlags &= (~STARTF_DESKTOPINHERIT) to make services 00407 * running under the context of system non-interactive. Hence if fInherit 00408 * is false don't do the SystemLuid and AccessCheckObject tests. 00409 */ 00410 00411 if (RtlEqualLuid(&pStats->AuthenticationId, &pwinsta->luidUser)) { 00412 Status = STATUS_SUCCESS; 00413 } 00414 } 00415 } 00416 00417 ZwClose(htoken); 00418 UserFreePool(pStats); 00419 return Status; 00420 } 00421 00422 if (gbSecureDesktop) { 00423 /* 00424 * Since we don't have a pointer to the WindowStation Object we will do 00425 * a OpenWindowStation() to make sure we have the desired access. 00426 */ 00427 cbObjA = sizeof(*pObjAttr) + sizeof(*pstrStatic); 00428 Status = ZwAllocateVirtualMemory(NtCurrentProcess(), 00429 &pObjAttr, 0, &cbObjA, MEM_COMMIT, PAGE_READWRITE); 00430 pstrStatic = (PUNICODE_STRING)((PBYTE)pObjAttr + sizeof(*pObjAttr)); 00431 00432 if (NT_SUCCESS(Status)) { 00433 00434 /* 00435 * Note -- the string must be in client-space or the 00436 * address validation in OpenWindowStation will fail. 00437 * 00438 * This code is called from xxxResolveDesktop and the buffer of the passed-in string 00439 * is in the teb already. 00440 */ 00441 try { 00442 *pstrStatic = *pstrWinSta; 00443 InitializeObjectAttributes( pObjAttr, 00444 pstrStatic, 00445 OBJ_CASE_INSENSITIVE, 00446 NULL, 00447 NULL 00448 ); 00449 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00450 Status = GetExceptionCode(); 00451 } 00452 00453 if (NT_SUCCESS(Status)) { 00454 hwsta = _OpenWindowStation(pObjAttr, GENERIC_EXECUTE, UserMode); 00455 } 00456 } else { 00457 return Status; 00458 } 00459 00460 if (pObjAttr != NULL) { 00461 ZwFreeVirtualMemory(NtCurrentProcess(), &pObjAttr, &cbObjA, 00462 MEM_RELEASE); 00463 } 00464 } else { 00465 InitializeObjectAttributes( &ObjAttr, 00466 pstrWinSta, 00467 OBJ_CASE_INSENSITIVE, 00468 NULL, 00469 NULL 00470 ); 00471 hwsta = _OpenWindowStation(&ObjAttr, GENERIC_EXECUTE, KernelMode); 00472 } 00473 00474 if (!hwsta) { 00475 return STATUS_ACCESS_DENIED; 00476 } 00477 00478 Status = ZwClose(hwsta); 00479 00480 UserAssert(NT_SUCCESS(Status)); 00481 return Status; 00482 }

PWND _WindowFromDC HDC  hdc  ) 
 

Definition at line 1995 of file dc.c.

References tagDCE::DCX_flags, gpDispInfo, tagDCE::hdc, NULL, tagDISPLAYINFO::pdceFirst, tagDCE::pdceNext, and tagDCE::pwndOrg.

Referenced by xxxAnimateCaption().

01997 { 01998 PDCE pdce; 01999 02000 for (pdce = gpDispInfo->pdceFirst; pdce; pdce = pdce->pdceNext) { 02001 02002 if (!(pdce->DCX_flags & DCX_INUSE) || (pdce->DCX_flags & DCX_CREATEDC)) 02003 continue; 02004 02005 if (pdce->hdc == hdc) 02006 return pdce->pwndOrg; 02007 } 02008 02009 return NULL; 02010 }

VOID _WOWCleanup HANDLE  hInstance,
DWORD  hTaskWow
 

Definition at line 218 of file w32/ntuser/kernel/cleanup.c.

References tagSHAREDINFO::aheList, tagSERVERINFO::apfnClientA, _HANDLEENTRY::bFlags, tagHANDLETYPEINFO::bObjectCreateFlags, _HANDLEENTRY::bType, CSF_WOWDEFERDESTROY, DestroyClass(), DWORD, gahti, giheLast, gpsi, gSharedInfo, HANDLEF_DESTROY, HMDestroyUnlockedObject(), tagTDB::hTaskWow, tagWND::lpfnWndProc, NULL, OCF_PROCESSOWNED, tagPROCESSINFO::pclsPrivateList, tagPROCESSINFO::pclsPublicList, _PFNCLIENT::pfnDefWindowProc, _HANDLEENTRY::phead, _HANDLEENTRY::pOwner, tagTHREADINFO::ppi, PpiCurrent, PPROCOBJHEAD, tagTHREADINFO::ptdb, TestWF, TIF_16BIT, tagTHREADINFO::TIF_flags, TYPE_CALLPROC, TYPE_FREE, TYPE_WINDOW, VOID(), WFSERVERSIDEPROC, and WNDPROC_PWND.

Referenced by xxxDestroyThreadInfo().

00221 { 00222 PPROCESSINFO ppi = PpiCurrent(); 00223 PPCLS ppcls; 00224 PHE pheT, pheMax; 00225 int i; 00226 00227 if (hInstance != NULL) { 00228 00229 /* 00230 * Task cleanup 00231 */ 00232 00233 PWND pwnd; 00234 hTaskWow = (DWORD) LOWORD(hTaskWow); 00235 /* 00236 * Task exit called by wow. This loop will Pseudo-Destroy windows 00237 * created by this task. 00238 */ 00239 pheMax = &gSharedInfo.aheList[giheLast]; 00240 for (pheT = gSharedInfo.aheList; pheT <= pheMax; pheT++) { 00241 PTHREADINFO ptiTest = (PTHREADINFO)pheT->pOwner; 00242 if ((pheT->bType == TYPE_WINDOW) && 00243 (ptiTest->TIF_flags & TIF_16BIT) && 00244 (ptiTest->ptdb) && 00245 (ptiTest->ptdb->hTaskWow == hTaskWow) && 00246 (ptiTest->ppi == ppi)) { 00247 00248 pwnd = (PWND) pheT->phead; 00249 if (!TestWF(pwnd, WFSERVERSIDEPROC)) { 00250 pwnd->lpfnWndProc = (WNDPROC_PWND)gpsi->apfnClientA.pfnDefWindowProc; 00251 } 00252 } 00253 } 00254 return; 00255 } 00256 00257 /* 00258 * If we get here, we are in thread cleanup and all of the thread's windows 00259 * have been destroyed or disassociated with any classes. If a class 00260 * marked for destruction at this point still has windows, they must 00261 * belong to a dll. 00262 */ 00263 00264 /* 00265 * Destroy private classes marked for destruction 00266 */ 00267 ppcls = &(ppi->pclsPrivateList); 00268 for (i = 0; i < 2; ++i) { 00269 while (*ppcls != NULL) { 00270 if ((*ppcls)->hTaskWow == hTaskWow && 00271 ((*ppcls)->CSF_flags & CSF_WOWDEFERDESTROY)) { 00272 if ((*ppcls)->cWndReferenceCount == 0) { 00273 DestroyClass(ppcls); 00274 } else { 00275 RIPMSG0(RIP_ERROR, "Windows remain for a WOW class marked for destruction"); 00276 ppcls = &((*ppcls)->pclsNext); 00277 } 00278 } else 00279 ppcls = &((*ppcls)->pclsNext); 00280 } 00281 00282 /* 00283 * Destroy public classes marked for destruction 00284 */ 00285 ppcls = &(ppi->pclsPublicList); 00286 } 00287 00288 /* 00289 * Destroy menus, cursors, icons and accel tables identified by hTaskWow 00290 */ 00291 pheMax = &gSharedInfo.aheList[giheLast]; 00292 for (pheT = gSharedInfo.aheList; pheT <= pheMax; pheT++) { 00293 00294 /* 00295 * Check against free before we look at ppi... because pq is stored 00296 * in the object itself, which won't be there if TYPE_FREE. 00297 */ 00298 if (pheT->bType == TYPE_FREE) 00299 continue; 00300 00301 /* 00302 * Destroy those objects created by this task. 00303 */ 00304 if ( !(gahti[pheT->bType].bObjectCreateFlags & OCF_PROCESSOWNED) || 00305 (PPROCESSINFO)pheT->pOwner != ppi || 00306 (((PPROCOBJHEAD)pheT->phead)->hTaskWow != hTaskWow) || 00307 (pheT->bType == TYPE_CALLPROC) /* Do not destroy CALLPROCDATA objects. 00308 * These should only get nuked when the 00309 * process goes away or when the class 00310 * is nuked. 00311 */ 00312 ) { 00313 00314 continue; 00315 } 00316 00317 /* 00318 * Make sure this object isn't already marked to be destroyed - we'll 00319 * do no good if we try to destroy it now since it is locked. 00320 */ 00321 if (pheT->bFlags & HANDLEF_DESTROY) { 00322 continue; 00323 } 00324 00325 /* 00326 * Destroy this object. 00327 */ 00328 HMDestroyUnlockedObject(pheT); 00329 } 00330 }

VOID _WOWModuleUnload HANDLE  hModule  ) 
 

Definition at line 99 of file w32/ntuser/kernel/cleanup.c.

References tagSHAREDINFO::aheList, tagSERVERINFO::apfnClientA, tagSERVERINFO::apfnClientW, tagCLS::atomClassName, tagSERVERINFO::atomSysClass, _HANDLEENTRY::bType, tagCLS::CSF_flags, CSF_WOWCLASS, CSF_WOWDEFERDESTROY, DestroyClass(), giheLast, gpfnwp, gpsi, gSharedInfo, ICLS_BUTTON, ICLS_MAX, tagWND::lpfnWndProc, NULL, tagPROCESSINFO::pclsPrivateList, tagPROCESSINFO::pclsPublicList, _PFNCLIENT::pfnDefWindowProc, _HANDLEENTRY::phead, _HANDLEENTRY::pOwner, tagTHREADINFO::ppi, PpiCurrent, PseudoDestroyClassWindows(), PtiCurrent, PWCFromPCLS, TestWF, TIF_16BIT, tagTHREADINFO::TIF_flags, TYPE_WINDOW, VOID(), WFSERVERSIDEPROC, and WNDPROC_PWND.

00099 { 00100 PPROCESSINFO ppi = PpiCurrent(); 00101 PHE pheT, pheMax; 00102 PPCLS ppcls; 00103 int i; 00104 00105 UserAssert(gpfnwp[0]); 00106 00107 /* 00108 * PseudoDestroy windows with wndprocs from this hModule 00109 * If its a wow16 wndproc, check if the hMod16 is this module 00110 * and Nuke matches. 00111 */ 00112 pheMax = &gSharedInfo.aheList[giheLast]; 00113 for (pheT = gSharedInfo.aheList; pheT <= pheMax; pheT++) { 00114 PTHREADINFO ptiTest = (PTHREADINFO)pheT->pOwner; 00115 PWND pwnd; 00116 if ((pheT->bType == TYPE_WINDOW) && 00117 (ptiTest->TIF_flags & TIF_16BIT) && 00118 (ptiTest->ppi == ppi)) { 00119 00120 pwnd = (PWND) pheT->phead; 00121 if (!TestWF(pwnd, WFSERVERSIDEPROC) && 00122 IsWOWProc(pwnd->lpfnWndProc) && 00123 (pwnd->hMod16 == (WORD)(ULONG_PTR)hModule)) { 00124 pwnd->lpfnWndProc = (WNDPROC_PWND)gpsi->apfnClientA.pfnDefWindowProc; 00125 } 00126 } 00127 } 00128 00129 /* 00130 * Destroy private classes identified by hInstance that are not 00131 * referenced by any windows. Mark in-use classes for later 00132 * destruction. 00133 */ 00134 ppcls = &(ppi->pclsPrivateList); 00135 00136 for (i = 0; i < 2; ++i) { 00137 while (*ppcls != NULL) { 00138 00139 PWC pwc; 00140 PCLS pcls; 00141 00142 if (HIWORD((ULONG_PTR)(*ppcls)->hModule) == (WORD)(ULONG_PTR)hModule) { 00143 if ((*ppcls)->cWndReferenceCount == 0) { 00144 DestroyClass(ppcls); 00145 /* 00146 * DestroyClass does *ppcls = pcls->pclsNext; 00147 * so we just want continue here 00148 */ 00149 } else { 00150 00151 /* 00152 * Zap all the windows around that belong to this class. 00153 */ 00154 PseudoDestroyClassWindows(PtiCurrent()->rpdesk->pDeskInfo->spwnd, *ppcls); 00155 00156 /* 00157 * Win 3.1 does not distinguish between Dll's and Exe's 00158 */ 00159 (*ppcls)->CSF_flags |= CSF_WOWDEFERDESTROY; 00160 ppcls = &((*ppcls)->pclsNext); 00161 } 00162 continue; 00163 } 00164 00165 pcls = *ppcls; 00166 00167 if ((pcls->CSF_flags & CSF_WOWCLASS) && ((WORD)(ULONG_PTR)hModule == (pwc = PWCFromPCLS(pcls))->hMod16)) { 00168 00169 ATOM atom; 00170 int iSel; 00171 00172 /* 00173 * See if the window's class atom matches any of 00174 * the system ones. If so, jam in the original window proc. 00175 * Otherwise, use DefWindowProc 00176 */ 00177 atom = (*ppcls)->atomClassName; 00178 for (iSel = ICLS_BUTTON; iSel < ICLS_MAX; iSel++) { 00179 if ((gpfnwp[iSel]) && (atom == gpsi->atomSysClass[iSel])) { 00180 (*ppcls)->lpfnWndProc = (WNDPROC_PWND)gpfnwp[iSel]; 00181 break; 00182 } 00183 } 00184 if (iSel == ICLS_MAX) 00185 (*ppcls)->lpfnWndProc = (WNDPROC_PWND)gpsi->apfnClientW.pfnDefWindowProc; 00186 } 00187 00188 ppcls = &((*ppcls)->pclsNext); 00189 } 00190 00191 /* 00192 * Destroy public classes identified by hInstance that are not 00193 * referenced by any windows. Mark in-use classes for later 00194 * destruction. 00195 */ 00196 ppcls = &(ppi->pclsPublicList); 00197 } 00198 return; 00199 00200 }

BOOL AccessCheckObject PVOID  ,
ACCESS_MASK  ,
KPROCESSOR_MODE  ,
CONST GENERIC_MAPPING * 
 

Definition at line 555 of file w32/ntuser/kernel/security.c.

References BOOL, KeyMapping, NTSTATUS(), ObCheckObjectAccess(), SeCreateAccessState(), SeDeleteAccessState(), Status, and TRUE.

Referenced by _BuildNameList(), _UserTestForWinStaAccess(), OpenCacheKeyEx(), ReferenceWindowStation(), and xxxMouseEventDirect().

00560 { 00561 NTSTATUS Status; 00562 ACCESS_STATE AccessState; 00563 BOOLEAN fAccessGranted; 00564 AUX_ACCESS_DATA AuxData; 00565 BOOLEAN bMutexLocked = (pGenericMapping == (&KeyMapping)); 00566 /* 00567 * Due to a resource problem in the object manager, we must pass in a TRUE 00568 * when checking access for registry keys, even if we do not explicitly have 00569 * the object type mutex. If we do not, we can get into a deadlock situation with this mutex 00570 * and the CmpRegistry lock. 00571 */ 00572 00573 SeCreateAccessState(&AccessState, &AuxData, amRequest, (PGENERIC_MAPPING)pGenericMapping); 00574 fAccessGranted = ObCheckObjectAccess( 00575 pobj, 00576 &AccessState, 00577 bMutexLocked, 00578 AccessMode, 00579 &Status); 00580 SeDeleteAccessState(&AccessState); 00581 return (BOOL)(fAccessGranted == TRUE); 00582 }

VOID AddHmodDependency int  iatom  ) 
 

Definition at line 136 of file libmgmt.c.

References acatomSysDepends, catomSysTableEntries, and VOID().

Referenced by _SetWinEventHook(), and zzzSetWindowsHookEx().

00138 { 00139 UserAssert(iatom >= 0); 00140 if (iatom < catomSysTableEntries) { 00141 acatomSysDepends[iatom]++; 00142 } 00143 }

PACCESS_ALLOWED_ACE AllocAce PACCESS_ALLOWED_ACE  pace,
BYTE  bType,
BYTE  bFlags,
ACCESS_MASK  am,
PSID  psid,
LPDWORD  lpdwLength
 

Definition at line 37 of file w32/ntuser/kernel/security.c.

References DWORD, NULL, PBYTE, RtlCopySid(), RtlLengthSid(), and USHORT.

Referenced by InitSecurity(), and xxxConnectService().

00044 { 00045 PACCESS_ALLOWED_ACE paceNew; 00046 DWORD iEnd; 00047 DWORD dwLength, dwLengthSid; 00048 00049 /* 00050 * Allocate space for the ACE. 00051 */ 00052 dwLengthSid = RtlLengthSid(psid); 00053 dwLength = dwLengthSid + sizeof(ACE_HEADER) + sizeof(ACCESS_MASK); 00054 if (pace == NULL) { 00055 iEnd = 0; 00056 pace = UserAllocPoolWithQuota(dwLength, TAG_SECURITY); 00057 if (pace == NULL) 00058 return NULL; 00059 } else { 00060 iEnd = *lpdwLength; 00061 paceNew = UserAllocPoolWithQuota(iEnd + dwLength, TAG_SECURITY); 00062 if (paceNew == NULL) 00063 return NULL; 00064 RtlCopyMemory(paceNew, pace, iEnd); 00065 UserFreePool(pace); 00066 pace = paceNew; 00067 } 00068 *lpdwLength = dwLength + iEnd; 00069 00070 /* 00071 * Insert the new ACE. 00072 */ 00073 paceNew = (PACCESS_ALLOWED_ACE)((PBYTE)pace + iEnd); 00074 paceNew->Header.AceType = bType; 00075 paceNew->Header.AceSize = (USHORT)dwLength; 00076 paceNew->Header.AceFlags = bFlags; 00077 paceNew->Mask = am; 00078 RtlCopySid(dwLengthSid, &paceNew->SidStart, psid); 00079 return pace; 00080 }

BOOL AllocateCvr PSMWP  psmwp,
int  cwndHint
 

Definition at line 203 of file swp.c.

References tagSMWP::acvr, BOOL, tagSMWP::ccvr, tagSMWP::ccvrAlloc, FALSE, NULL, and TRUE.

Referenced by _BeginDeferWindowPos(), InternalBeginDeferWindowPos(), and Win32UserInitialize().

00204 { 00205 PCVR acvr; 00206 00207 UserAssert(cwndHint != 0); 00208 acvr = (PCVR)UserAllocPoolWithQuota(sizeof(CVR) * cwndHint, TAG_SWP); 00209 00210 if (acvr == NULL) { 00211 return FALSE; 00212 } 00213 00214 /* 00215 * Initialize psmwp related fields. 00216 * CVR array is initialized by _DeferWindowPos 00217 */ 00218 00219 psmwp->acvr = acvr; 00220 psmwp->ccvrAlloc = cwndHint; 00221 psmwp->ccvr = 0; 00222 return TRUE; 00223 }

BOOL AllocateUnicodeString PUNICODE_STRING  pstrDst,
PUNICODE_STRING  pstrSrc
 

Definition at line 155 of file w32/ntuser/kernel/random.c.

References FALSE, NULL, RtlInitUnicodeString(), and TRUE.

Referenced by _SetCursorIconData(), InternalRegisterClassEx(), and xxxSetClassData().

00158 { 00159 if (cczpstrSrc == NULL) { 00160 RtlInitUnicodeString(pstrDst, NULL); 00161 return TRUE; 00162 } 00163 00164 pstrDst->Buffer = UserAllocPoolWithQuota(cczpstrSrc->Length+sizeof(UNICODE_NULL), TAG_TEXT); 00165 if (pstrDst->Buffer == NULL) { 00166 return FALSE; 00167 } 00168 00169 try { 00170 RtlCopyMemory(pstrDst->Buffer, cczpstrSrc->Buffer, cczpstrSrc->Length); 00171 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00172 UserFreePool(pstrDst->Buffer); 00173 pstrDst->Buffer = NULL; 00174 return FALSE; 00175 } 00176 pstrDst->MaximumLength = cczpstrSrc->Length+sizeof(UNICODE_NULL); 00177 pstrDst->Length = cczpstrSrc->Length; 00178 pstrDst->Buffer[pstrDst->Length / sizeof(WCHAR)] = 0; 00179 00180 return TRUE; 00181 }

PQMSG AllocQEntry PMLIST  pml  ) 
 

Definition at line 3208 of file queue.c.

References tagMLIST::cMsgs, DebugValidateMLIST, DebugValidateMLISTandQMSG, ExAllocateFromPagedLookasideList(), gUserPostMessageLimit, NULL, tagQMSG::pqmsgNext, tagQMSG::pqmsgPrev, tagMLIST::pqmsgRead, tagMLIST::pqmsgWriteLast, and QEntryLookaside.

Referenced by _PostMessage(), _PostThreadMessage(), DestroyProcessInfo(), DoTimer(), PostEventMessage(), PostInputMessage(), and xxxSetForegroundWindow2().

03210 { 03211 PQMSG pqmsg; 03212 03213 DebugValidateMLIST(pml); 03214 03215 if (pml->cMsgs >= gUserPostMessageLimit) { 03216 RIPMSG3(RIP_WARNING, "AllocQEntry: # of post messages exceeds the limit(%d) in pti=0x%p, pml=0x%p", 03217 gUserPostMessageLimit, W32GetCurrentThread(), pml); 03218 return NULL; 03219 } 03220 03221 /* 03222 * Allocate a Q message structure. 03223 */ 03224 if ((pqmsg = ExAllocateFromPagedLookasideList(QEntryLookaside)) == NULL) { 03225 return NULL; 03226 } 03227 03228 RtlZeroMemory(pqmsg, sizeof(*pqmsg)); 03229 03230 if (pml->pqmsgWriteLast != NULL) { 03231 pml->pqmsgWriteLast->pqmsgNext = pqmsg; 03232 pqmsg->pqmsgPrev = pml->pqmsgWriteLast; 03233 pml->pqmsgWriteLast = pqmsg; 03234 } else { 03235 pml->pqmsgWriteLast = pml->pqmsgRead = pqmsg; 03236 } 03237 03238 pml->cMsgs++; 03239 03240 DebugValidateMLISTandQMSG(pml, pqmsg); 03241 03242 return pqmsg; 03243 }

PQ AllocQueue PTHREADINFO  ,
PQ 
 

Definition at line 2102 of file queue.c.

References tagQ::afKeyState, CBKEYSTATE, tagQ::cLockCount, DebugValidateMLIST, ExAllocateFromPagedLookasideList(), gafAsyncKeyState, GTERMF_MOUSE, tagQ::iCursorLevel, LockQCursor, tagQ::mlInput, NULL, tagTHREADINFO::pq, QLookaside, SYSCUR, TEST_GTERMF, and USHORT.

Referenced by xxxCreateThreadInfo(), xxxHardErrorControl(), xxxSetThreadDesktop(), xxxSwitchDesktop(), zzzJournalAttach(), and zzzRecalcThreadAttachment().

02106 { 02107 USHORT cLockCount; 02108 02109 if (pq == NULL) { 02110 pq = ExAllocateFromPagedLookasideList(QLookaside); 02111 if (pq == NULL) { 02112 return NULL; 02113 } 02114 cLockCount = 0; 02115 } else { 02116 DebugValidateMLIST(&pq->mlInput); 02117 /* 02118 * Preserve lock count. 02119 */ 02120 cLockCount = pq->cLockCount; 02121 } 02122 RtlZeroMemory(pq, sizeof(Q)); 02123 pq->cLockCount = cLockCount; 02124 02125 /* 02126 * This is a new queue; we need to update its key state table before 02127 * the first input event is put in the queue. 02128 * We do this by copying the current keystate table and NULLing the recent 02129 * down state table. If a key is really down it will be updated when 02130 * we get it repeats. 02131 * 02132 * He is the old way that did not work because if the first key was say an 02133 * alt key the Async table would be updated, then the UpdateKeyState 02134 * message and it would look like the alt key was PREVIOUSLY down. 02135 * 02136 * The queue will get updated when it first reads input: to allow the 02137 * app to query the key state before it calls GetMessage, set its initial 02138 * key state to the asynchronous key state. 02139 */ 02140 if (ptiKeyState) { 02141 RtlCopyMemory(pq->afKeyState, ptiKeyState->pq->afKeyState, CBKEYSTATE); 02142 } else { 02143 RtlCopyMemory(pq->afKeyState, gafAsyncKeyState, CBKEYSTATE); 02144 } 02145 02146 /* 02147 * If there isn't a mouse set iCursorLevel to -1 so the 02148 * mouse cursor won't be visible on the screen. 02149 */ 02150 if ( 02151 !TEST_GTERMF(GTERMF_MOUSE)) { 02152 pq->iCursorLevel--; 02153 } 02154 /* 02155 * While the thread is starting up... it has the wait cursor. 02156 */ 02157 LockQCursor(pq, SYSCUR(WAIT)); 02158 02159 DebugValidateMLIST(&pq->mlInput); 02160 return pq; 02161 }

void AnimateFade void   ) 
 

Definition at line 984 of file sprite.c.

References BOOL, BYTE, tagFADE::dwFlags, DWORD, tagFADE::dwStart, tagFADE::dwTime, FADE_COMPLETED, FADE_SHOW, gfade, tagFADE::hbm, tagFADE::hdc, NtGetTickCount(), NULL, StopFade(), and UpdateFade().

Referenced by xxxSystemTimerProc().

00985 { 00986 DWORD dwTimeElapsed; 00987 BLENDFUNCTION blend; 00988 BYTE bAlpha; 00989 BOOL fShow; 00990 00991 UserAssert(gfade.hdc != NULL); 00992 UserAssert(gfade.hbm != NULL); 00993 00994 dwTimeElapsed = NtGetTickCount() - gfade.dwStart; 00995 00996 /* 00997 * If exceeding the allowed time, stop the animation now. 00998 */ 00999 if (dwTimeElapsed > gfade.dwTime) { 01000 StopFade(); 01001 return; 01002 } 01003 01004 fShow = (gfade.dwFlags & FADE_SHOW); 01005 01006 /* 01007 * Calculate new alpha value based on time elapsed. 01008 */ 01009 if (fShow) { 01010 bAlpha = (BYTE)((255 * dwTimeElapsed) / gfade.dwTime); 01011 } else { 01012 bAlpha = (BYTE)(255 * (gfade.dwTime - dwTimeElapsed) / gfade.dwTime); 01013 } 01014 01015 blend.BlendOp = AC_SRC_OVER; 01016 blend.BlendFlags = 0; 01017 blend.AlphaFormat = 0; 01018 blend.SourceConstantAlpha = bAlpha; 01019 UpdateFade(NULL, NULL, NULL, NULL, &blend); 01020 01021 /* 01022 * Check if finished animating the fade. 01023 */ 01024 if ((fShow && bAlpha == 255) || (!fShow && bAlpha == 0)) { 01025 gfade.dwFlags |= FADE_COMPLETED; 01026 StopFade(); 01027 } 01028 }

HIMC AssociateInputContext IN PWND  pWnd,
IN PIMC  pImc
 

Definition at line 289 of file ntimm.c.

References PtoH.

Referenced by AssociateInputContextEx(), and DestroyInputContext().

00292 { 00293 HIMC hImcRet = pWnd->hImc; 00294 pWnd->hImc = (HIMC)PtoH(pImc); 00295 00296 return hImcRet; 00297 }

AIC_STATUS AssociateInputContextEx IN PWND  pWnd,
IN PIMC  pImc,
IN DWORD  dwFlag
 

Definition at line 299 of file ntimm.c.

References AIC_ERROR, AIC_FOCUSCONTEXTCHANGED, AIC_STATUS, AIC_SUCCESS, AssociateInputContext(), BOOL, BuildHwndList(), BWL_ENUMCHILDREN, BWL_ENUMLIST, FreeHwndList(), GETPTI, tagWND::hImc, NULL, NULL_HIMC, tagTHREADINFO::pq, PtiCurrent, PtoH, RevalidateHwnd, tagBWL::rghwnd, tagTHREADINFO::spDefaultImc, tagQ::spwndFocus, and Status.

Referenced by NtUserAssociateInputContext().

00303 { 00304 PTHREADINFO ptiWnd = GETPTI(pWnd); 00305 PWND pWndFocus = ptiWnd->pq->spwndFocus; 00306 HIMC hImcFocus = pWndFocus->hImc; 00307 BOOL fIgnoreNoContext = (dwFlag & IACE_IGNORENOCONTEXT) == IACE_IGNORENOCONTEXT; 00308 AIC_STATUS Status = AIC_SUCCESS; 00309 00310 if (dwFlag & IACE_DEFAULT) { 00311 /* 00312 * use default input context. 00313 */ 00314 pImc = ptiWnd->spDefaultImc; 00315 00316 } else if (pImc != NULL && GETPTI(pImc) != ptiWnd) { 00317 /* 00318 * Cannot associate input context to window created 00319 * by other thread. 00320 */ 00321 RIPERR0(ERROR_ACCESS_DENIED, RIP_WARNING, 00322 "AssociateInputContextEx: pwnd not of Imc pti"); 00323 return AIC_ERROR; 00324 } 00325 00326 /* 00327 * Cannot do association under different process context. 00328 */ 00329 if (GETPTI(pWnd)->ppi != PtiCurrent()->ppi) { 00330 RIPERR0(ERROR_ACCESS_DENIED, RIP_WARNING, 00331 "AssociateInputContextEx: pwnd not of current ppi"); 00332 return AIC_ERROR; 00333 } 00334 00335 /* 00336 * Finally, make sure they are on the same desktop. 00337 */ 00338 if (pImc != NULL && pImc->head.rpdesk != pWnd->head.rpdesk) { 00339 RIPERR0(ERROR_ACCESS_DENIED, RIP_WARNING, 00340 "AssociateInputContextEx: no desktop access"); 00341 return AIC_ERROR; 00342 } 00343 00344 /* 00345 * If IACE_CHILDREN is specified, associate the input context 00346 * to the child windows of pWnd as well. 00347 */ 00348 if ((dwFlag & IACE_CHILDREN) && pWnd->spwndChild != NULL) { 00349 PBWL pbwl; 00350 PWND pwndT; 00351 HWND *phwndT; 00352 00353 pbwl = BuildHwndList(pWnd->spwndChild, 00354 BWL_ENUMLIST|BWL_ENUMCHILDREN, ptiWnd); 00355 00356 if (pbwl != NULL) { 00357 00358 for (phwndT = pbwl->rghwnd; *phwndT != (HWND)1; phwndT++) { 00359 /* 00360 * Make sure this hwnd is still around. 00361 */ 00362 if ((pwndT = RevalidateHwnd(*phwndT)) == NULL) 00363 continue; 00364 00365 if (pwndT->hImc == (HIMC)PtoH(pImc)) 00366 continue; 00367 00368 if (pwndT->hImc == NULL_HIMC && fIgnoreNoContext) 00369 continue; 00370 00371 AssociateInputContext(pwndT, pImc); 00372 00373 if (pwndT == pWndFocus) 00374 Status = AIC_FOCUSCONTEXTCHANGED; 00375 } 00376 00377 FreeHwndList(pbwl); 00378 } 00379 } 00380 00381 /* 00382 * Associate the input context to pWnd. 00383 */ 00384 if (pWnd->hImc != NULL_HIMC || !fIgnoreNoContext) { 00385 if (pWnd->hImc != (HIMC)PtoH(pImc)) { 00386 AssociateInputContext(pWnd, pImc); 00387 if (pWnd == pWndFocus) 00388 Status = AIC_FOCUSCONTEXTCHANGED; 00389 } 00390 } 00391 00392 return Status; 00393 }

BOOL FAR BitBltSysBmp HDC  hdc,
int  x,
int  y,
UINT  i
 

Definition at line 29 of file mngrayc.c.

References BOOL, tagOEMBITMAPINFO::cx, tagOEMBITMAPINFO::cy, FAR, gpsi, HDCBITS, HEBREW_UI_LANGID, NtUserBitBltSysBmp(), OBI_HELP, OBI_HELP_D, OBI_HELP_H, SYSMET, tagOEMBITMAPINFO::x, and tagOEMBITMAPINFO::y.

Referenced by DrawCaptionButtons(), DrawSize(), DrawStateW(), LoadBmp(), MNDrawArrow(), xxxDrawCaptionBar(), xxxDrawSB2(), xxxRealDrawMenuItem(), xxxTrackCaptionButton(), and zzzDrawInvertScrollArea().

00030 { 00031 POEMBITMAPINFO pOem = gpsi->oembmi + i; 00032 00033 return(NtUserBitBltSysBmp(hdc, x, y, pOem->cx, pOem->cy, pOem->x, pOem->y, SRCCOPY)); 00034 }

VOID BltColor HDC  ,
HBRUSH  ,
HDC  ,
int  ,
int  ,
int  ,
int  ,
int  ,
int  ,
UINT 
 

Definition at line 448 of file mngray.c.

References BC_INVERT, BC_NOMIRROR, cy, DWORD, gpDispInfo, tagDISPLAYINFO::hdcGray, L, NULL, and VOID().

Referenced by DrawMenuItemCheckMark(), DrawStateW(), xxxDrawMenuItem(), xxxDrawState(), and xxxRealDrawMenuItem().

00459 { 00460 HBRUSH hbrSave; 00461 DWORD textColorSave; 00462 DWORD bkColorSave; 00463 DWORD ROP; 00464 00465 /* 00466 * Set the Text and Background colors so that bltColor handles the 00467 * background of buttons (and other bitmaps) properly. 00468 * Save the HDC's old Text and Background colors. This causes problems 00469 * with Omega (and probably other apps) when calling GrayString which 00470 * uses this routine... 00471 */ 00472 textColorSave = GreSetTextColor(hdc, 0x00000000L); 00473 bkColorSave = GreSetBkColor(hdc, 0x00FFFFFFL); 00474 00475 if (hbr != NULL) 00476 hbrSave = GreSelectBrush(hdc, hbr); 00477 if (uBltFlags & BC_INVERT) 00478 ROP = 0xB8074AL; 00479 else 00480 ROP = 0xE20746L; 00481 00482 if (uBltFlags & BC_NOMIRROR) 00483 ROP |= NOMIRRORBITMAP; 00484 00485 GreBitBlt(hdc, 00486 xO, 00487 yO, 00488 cx, 00489 cy, 00490 hdcSrce ? hdcSrce : gpDispInfo->hdcGray, 00491 xO1, 00492 yO1, 00493 ROP, 00494 0x00FFFFFF); 00495 00496 if (hbr != NULL) 00497 GreSelectBrush(hdc, hbrSave); 00498 00499 /* 00500 * Restore saved colors 00501 */ 00502 GreSetTextColor(hdc, textColorSave); 00503 GreSetBkColor(hdc, bkColorSave); 00504 }

BOOL BltIcon HDC  hdc,
int  x,
int  y,
int  cx,
int  cy,
HDC  hdcSrc,
PCURSOR  pcursor,
BOOL  fMask,
LONG  rop
 

Definition at line 32 of file wmicon.c.

References BOOL, cy, FALSE, SetBestStretchMode, and TRUE.

Referenced by _DrawIconEx(), and BltMe4Times().

00042 { 00043 HBITMAP hbmpSave; 00044 HBITMAP hbmpUse; 00045 LONG rgbText; 00046 LONG rgbBk; 00047 int nMode; 00048 00049 /* 00050 * Setup the DC for drawing 00051 */ 00052 hbmpUse = (fMask || !pcur->hbmColor ? pcur->hbmMask : pcur->hbmColor); 00053 00054 rgbBk = GreSetBkColor(hdc, 0x00FFFFFFL); 00055 rgbText = GreSetTextColor(hdc, 0x00000000L); 00056 nMode = SetBestStretchMode(hdc, pcur->bpp, FALSE); 00057 00058 hbmpSave = GreSelectBitmap(hdcSrc, hbmpUse); 00059 00060 /* 00061 * Do the output to the surface. By passing in (-1) as the background 00062 * color, we are telling GDI to use the background-color already set 00063 * in the DC. 00064 */ 00065 GreStretchBlt(hdc, 00066 x, 00067 y, 00068 cx, 00069 cy, 00070 hdcSrc, 00071 0, 00072 (fMask || pcur->hbmColor ? 0 : pcur->cy / 2), 00073 pcur->cx, 00074 pcur->cy / 2, 00075 rop, 00076 (COLORREF)-1); 00077 00078 GreSetStretchBltMode(hdc, nMode); 00079 GreSetTextColor(hdc, rgbText); 00080 GreSetBkColor(hdc, rgbBk); 00081 00082 GreSelectBitmap(hdcSrc, hbmpSave); 00083 00084 return TRUE; 00085 }

VOID BoundCursor LPPOINT  lppt  ) 
 

Definition at line 299 of file ntuser/kernel/cursor.c.

References ClipPointToDesktop(), tagDISPLAYINFO::fDesktopIsRect, gpDispInfo, grcCursorClip, grcVDMCursorBounds, gspwndFullScreen, NULL, PUDF_VDMBOUNDSACTIVE, TEST_PUDF, and VOID().

Referenced by xxxMoveEventAbsolute(), zzzActiveCursorTracking(), and zzzInternalSetCursorPos().

00301 { 00302 if (TEST_PUDF(PUDF_VDMBOUNDSACTIVE) && gspwndFullScreen != NULL) { 00303 00304 if (lppt->x < grcVDMCursorBounds.left) { 00305 lppt->x = grcVDMCursorBounds.left; 00306 } else if (lppt->x >= grcVDMCursorBounds.right) { 00307 lppt->x = grcVDMCursorBounds.right - 1; 00308 } 00309 00310 if (lppt->y < grcVDMCursorBounds.top) { 00311 lppt->y = grcVDMCursorBounds.top; 00312 } else if (lppt->y >= grcVDMCursorBounds.bottom) { 00313 lppt->y = grcVDMCursorBounds.bottom - 1; 00314 } 00315 00316 } else { 00317 00318 if (lppt->x < grcCursorClip.left) { 00319 lppt->x = grcCursorClip.left; 00320 } else if (lppt->x >= grcCursorClip.right) { 00321 lppt->x = grcCursorClip.right - 1; 00322 } 00323 00324 if (lppt->y < grcCursorClip.top) { 00325 lppt->y = grcCursorClip.top; 00326 } else if (lppt->y >= grcCursorClip.bottom) { 00327 lppt->y = grcCursorClip.bottom - 1; 00328 } 00329 } 00330 00331 /* 00332 * If we have more than one monitor, then we need to clip the 00333 * cursor to a point on the desktop. 00334 */ 00335 if (!gpDispInfo->fDesktopIsRect) { 00336 ClipPointToDesktop(lppt); 00337 } 00338 }

UINT BuildHimcList PTHREADINFO  pti,
UINT  cHimcMax,
HIMC *  phimcFirst
 

Definition at line 475 of file ntimm.c.

References FALSE, NULL, tagIMC::pImcNext, PtiCurrent, tagTHREADINFO::ptiSibling, PtoH, tagTHREADINFO::spDefaultImc, and UINT.

Referenced by ImmEnumInputContext(), and NtUserBuildHimcList().

00479 { 00480 PIMC pImcT; 00481 UINT i = 0; 00482 00483 if (pti == NULL) { 00484 /* 00485 * Build the list which contains all IMCs created by calling process. 00486 */ 00487 for (pti = PtiCurrent()->ppi->ptiList; pti != NULL; pti = pti->ptiSibling) { 00488 pImcT = pti->spDefaultImc; 00489 while (pImcT != NULL) { 00490 if (i < cHimcMax) { 00491 try { 00492 ccxphimcFirst[i] = (HIMC)PtoH(pImcT); 00493 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00494 } 00495 } 00496 i++; 00497 pImcT = pImcT->pImcNext; 00498 } 00499 } 00500 } 00501 else { 00502 /* 00503 * Build the list which contains all IMCs created by specified thread. 00504 */ 00505 pImcT = pti->spDefaultImc; 00506 while (pImcT != NULL) { 00507 if (i < cHimcMax) { 00508 try { 00509 ccxphimcFirst[i] = (HIMC)PtoH(pImcT); 00510 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00511 } 00512 } 00513 i++; 00514 pImcT = pImcT->pImcNext; 00515 } 00516 } 00517 00518 return i; 00519 }

PBWL BuildHwndList PWND  pwnd,
UINT  flags,
PTHREADINFO  ptiOwner
 

Definition at line 91 of file enumwin.c.

References BWL, BWL_ENUMIMELAST, BWL_ENUMOWNERLIST, BWL_REMOVEIMECHILD, CheckCritIn, CHWND_BWLCREATE, gpbwlList, InternalBuildHwndList(), InternalBuildHwndOwnerList(), IS_IME_ENABLED, NULL, pbwlCache, tagBWL::pbwlNext, tagBWL::phwndMax, tagBWL::phwndNext, PtiCurrent, tagBWL::ptiOwner, and tagBWL::rghwnd.

Referenced by _FindWindowEx(), ArrangeWindows(), AssociateInputContextEx(), CascadeWindowsEnum(), DestroyInputContext(), InitSwitchWndInfo(), InternalEnumWindows(), NtUserBuildHwndList(), StartTaskModalDialog(), UnmaximizeChildWindows(), xxxArrangeIconicWindows(), xxxCheckImeShowStatus(), xxxClientShutdown(), xxxDefWindowProc(), xxxDesktopRecalc(), xxxDWPPrint(), xxxInternalDoSyncPaint(), xxxInternalEnumWindow(), xxxMetricsRecalc(), xxxSendBSMtoDesktop(), and xxxShowOwnedWindows().

00095 { 00096 PBWL pbwl; 00097 00098 CheckCritIn(); 00099 00100 if ((pbwl = pbwlCache) != NULL) { 00101 00102 /* 00103 * We're using the cache now; zero it out. 00104 */ 00105 #if DBG 00106 pbwlCachePrev = pbwlCache; 00107 #endif 00108 pbwlCache = NULL; 00109 00110 #if DBG 00111 { 00112 PBWL pbwlT; 00113 /* 00114 * pbwlCache shouldn't be in the global linked list. 00115 */ 00116 for (pbwlT = gpbwlList; pbwlT != NULL; pbwlT = pbwlT->pbwlNext) { 00117 UserAssert(pbwlT != pbwl); 00118 } 00119 } 00120 #endif 00121 } else { 00122 00123 /* 00124 * sizeof(BWL) includes the first element of array. 00125 */ 00126 pbwl = (PBWL)UserAllocPool(sizeof(BWL) + sizeof(PWND) * CHWND_BWLCREATE, 00127 TAG_WINDOWLIST); 00128 if (pbwl == NULL) 00129 return NULL; 00130 00131 pbwl->phwndMax = &pbwl->rghwnd[CHWND_BWLCREATE - 1]; 00132 } 00133 pbwl->phwndNext = pbwl->rghwnd; 00134 00135 /* 00136 * We'll use ptiOwner as temporary storage for the thread we're 00137 * scanning for. It will get reset to the proper thing at the bottom 00138 * of this routine. 00139 */ 00140 pbwl->ptiOwner = pti; 00141 00142 #ifdef OWNERLIST 00143 if (flags & BWL_ENUMOWNERLIST) { 00144 pbwl = InternalBuildHwndOwnerList(pbwl, pwnd, NULL); 00145 } else { 00146 pbwl = InternalBuildHwndList(pbwl, pwnd, flags); 00147 } 00148 #else 00149 pbwl = InternalBuildHwndList(pbwl, pwnd, flags); 00150 #endif 00151 00152 /* 00153 * If phwndNext == phwndMax, it indicates that the pbwl has failed to expand. 00154 * The list is no longer valid, so we should just bail. 00155 */ 00156 if (pbwl->phwndNext >= pbwl->phwndMax) { 00157 UserAssert(pbwl->phwndNext == pbwl->phwndMax); 00158 /* 00159 * Even if we had picked pbwl from the global single cache (pbwlCache), 00160 * it should have already been unlinked from the global link list when it was put in the cache. 00161 * So we should just free it without manupilating the link pointers. 00162 * If we have allocated the pwbl for ourselves, we can simply free it. 00163 * In both cases, we should just call UserFreePool(). 00164 * As the side effect, it may make some room by providing a free pool block. 00165 */ 00166 UserFreePool(pbwl); 00167 return NULL; 00168 } 00169 00170 /* 00171 * Stick in the terminator. 00172 */ 00173 *pbwl->phwndNext = (HWND)1; 00174 00175 #ifdef FE_IME 00176 if (flags & BWL_ENUMIMELAST) { 00177 UserAssert(IS_IME_ENABLED()); 00178 /* 00179 * For IME windows. 00180 * Rebuild window list for EnumWindows API. Because ACCESS 2.0 assumes 00181 * the first window that is called CallBack Functions in the task is 00182 * Q-Card Wnd. We should change the order of IME windows 00183 */ 00184 pbwl = InternalRebuildHwndListForIMEClass(pbwl, 00185 (flags & BWL_REMOVEIMECHILD) == BWL_REMOVEIMECHILD); 00186 } 00187 #endif 00188 00189 /* 00190 * Finally link this guy into the list. 00191 */ 00192 pbwl->ptiOwner = PtiCurrent(); 00193 pbwl->pbwlNext = gpbwlList; 00194 gpbwlList = pbwl; 00195 00196 00197 /* 00198 * We should have given out the cache if it was available 00199 */ 00200 UserAssert(pbwlCache == NULL); 00201 00202 return pbwl; 00203 }

PWND CalcForegroundInsertAfter PWND  pwnd  ) 
 

Definition at line 3620 of file swp.c.

References FALSE, GetLastNonBottomMostWindow(), GetLastTopMostWindow(), GETPTI, gpqForeground, IS_IME_ENABLED, NULL, tagQ::spwndActive, tagWND::spwndChild, tagWND::spwndNext, tagWND::spwndOwner, tagWND::spwndParent, TestWF, TestwndChild, TIF_ALLOWFOREGROUNDACTIVATE, TRUE, WEFTOPMOST, WFBOTTOMMOST, and WFVISIBLE.

Referenced by CheckOnTop(), CheckTopmost(), TrackBackground(), xxxCreateWindowEx(), and xxxSetParent().

03622 { 03623 PWND pwndInsertAfter, pwndInsertAfterSave; 03624 PWND pwndT; 03625 PTHREADINFO ptiTop; 03626 #ifdef LATER // see #88810 03627 BOOLEAN fImeOwnerIsBottom = FALSE; 03628 #endif 03629 03630 /* 03631 * If we're allowing this application to make this top 03632 * level window foreground active, then this app may 03633 * not be foreground yet, but we want any windows it 03634 * zorders to appear on top because it is probably about 03635 * to activate them (this is a guess!) If this is the case, 03636 * let it do what it wants. A good example of this is an 03637 * application like toolbook that creates a window without a 03638 * caption, doesn't activate it, and wants that to appear on top. 03639 */ 03640 03641 if (TestWF(pwnd, WFBOTTOMMOST)) { 03642 pwndInsertAfter = GetLastNonBottomMostWindow(pwnd, TRUE); 03643 } else { 03644 pwndInsertAfter = GetLastTopMostWindow(); 03645 #ifdef LATER // see #88810 03646 if (IS_IME_ENABLED()) { 03647 fImeOwnerIsBottom = IsBottomIMEWindow(pwnd); 03648 if (fImeOwnerIsBottom) { 03649 for (pwndT = pwndInsertAfter; pwndT; pwndT = pwndT->spwndNext) { 03650 if (ImeCheckBottomIMEWindow(pwndT)) { 03651 /* 03652 * toplevel owner of pwndT->spwndNext is BOTTOMMOST 03653 */ 03654 break; 03655 } 03656 pwndInsertAfter = pwndT; 03657 } 03658 } 03659 } 03660 #endif // LATER 03661 } 03662 03663 03664 if (!TestwndChild(pwnd)) { 03665 // if (hwnd->hwndParent == hwndDesktop) -- Chicago conditional FritzS 03666 03667 if ((GETPTI(pwnd)->TIF_flags & TIF_ALLOWFOREGROUNDACTIVATE) || 03668 (GETPTI(pwnd)->ppi->W32PF_Flags & W32PF_ALLOWFOREGROUNDACTIVATE)) { 03669 03670 return pwndInsertAfter; 03671 } 03672 } 03673 03674 /* 03675 * If there is no foreground thread or this pwnd is of the foreground 03676 * thread, then let it come to the top. 03677 */ 03678 if (gpqForeground == NULL) 03679 return pwndInsertAfter; 03680 03681 if (GETPTI(pwnd)->pq == gpqForeground) 03682 return pwndInsertAfter; 03683 03684 /* 03685 * This thread is not of the foreground queue, so search for a window 03686 * of this thread to zorder above. 03687 */ 03688 pwndT = ((pwndInsertAfter == NULL) ? 03689 pwnd->spwndParent->spwndChild : 03690 pwndInsertAfter); 03691 03692 /* 03693 * Remember the top insert after in case this first loop 03694 * fails to find a window 03695 */ 03696 pwndInsertAfterSave = pwndInsertAfter; 03697 03698 for (; pwndT != NULL; pwndT = pwndT->spwndNext) { 03699 03700 /* 03701 * This window wants to come to the top if possible. 03702 * If we're passing our own window, get out of this loop: 03703 * by now we already have pwndInsertAfter set up to the 03704 * last available window to insert after. 03705 */ 03706 if ((pwndT == pwnd) || TestWF(pwndT, WFBOTTOMMOST)) 03707 break; 03708 03709 /* 03710 * If this window isn't owned by this thread, continue. 03711 */ 03712 if (GETPTI(pwndT) != GETPTI(pwnd)) { 03713 pwndInsertAfter = pwndT; 03714 continue; 03715 } 03716 03717 /* 03718 * Don't want a window zordering below one of its top most windows 03719 * if it isn't foreground. 03720 */ 03721 if (TestWF(pwndT, WEFTOPMOST)) { 03722 pwndInsertAfter = pwndT; 03723 continue; 03724 } 03725 03726 #ifdef LATER // see #88810 03727 // FE_IME 03728 if (fImeOwnerIsBottom && ImeCheckBottomIMEWindow(pwndT)) { 03729 /* 03730 * owner of pwndT->spwndNext is BOTTOMMOST 03731 * so pwndT is the last one whose owner is not bottommost. 03732 */ 03733 pwndInsertAfter = pwndT; 03734 continue; 03735 } 03736 // end FE_IME 03737 #endif 03738 03739 /* 03740 * Ok to change zorder of top level windows because of 03741 * invisible windows laying around, but not children: 03742 * applications would go nuts if we did this. 03743 */ 03744 if (!TestwndChild(pwndT)) { 03745 if (!TestWF(pwndT, WFVISIBLE)) { 03746 pwndInsertAfter = pwndT; 03747 continue; 03748 } 03749 } 03750 03751 break; 03752 } 03753 03754 /* 03755 * If we didn't find a window in the previous loop, 03756 * it means that the thread has no 03757 * other sibling windows, so we need to put it after the 03758 * foreground window (foreground thread). Search for the 03759 * first unowned window of the foreground app to zorder 03760 * after. 03761 */ 03762 if ((pwndT == NULL) || TestWF(pwndT, WFBOTTOMMOST)) { 03763 /* 03764 * This is our first guess in case nothing works out. 03765 */ 03766 pwndInsertAfter = pwndInsertAfterSave; 03767 03768 /* 03769 * Start below the last topmost or from the top if no 03770 * topmost windows. 03771 */ 03772 if ((pwndT = pwndInsertAfter) == NULL) 03773 pwndT = pwnd->spwndParent->spwndChild; 03774 03775 /* 03776 * ptiTop is the pti of the active window in the foreground queue! 03777 */ 03778 ptiTop = NULL; 03779 if (gpqForeground->spwndActive != NULL) 03780 ptiTop = GETPTI(gpqForeground->spwndActive); 03781 03782 for (; pwndT != NULL; pwndT = pwndT->spwndNext) { 03783 03784 if (TestWF(pwndT, WFBOTTOMMOST)) 03785 break; 03786 03787 /* 03788 * If not the top most thread, continue. 03789 */ 03790 if (GETPTI(pwndT) != ptiTop) 03791 continue; 03792 03793 /* 03794 * Found one of the foreground thread. Remember this 03795 * as the next best guess. Try to find an unowned 03796 * visible window, which would indicate the main 03797 * window of the foreground thread. If owned, 03798 * continue. 03799 */ 03800 if (pwndT->spwndOwner != NULL) { 03801 pwndInsertAfter = pwndT; 03802 continue; 03803 } 03804 03805 /* 03806 * Unowned and of the foreground thread. Is it visible? 03807 * If not, get out of here. 03808 */ 03809 if (!TestWF(pwndT, WFVISIBLE)) 03810 continue; 03811 #ifdef LATER // see #88810 03812 // FE_IME 03813 if (fImeOwnerIsBottom && ImeCheckBottomIMEWindow(pwndT)) { 03814 continue; 03815 } 03816 // end FE_IME 03817 #endif 03818 03819 /* 03820 * Best possible match so far: unowned visible window 03821 * of the foreground thread. 03822 */ 03823 pwndInsertAfter = pwndT; 03824 } 03825 } 03826 03827 UserAssert(pwnd != pwndInsertAfter); 03828 03829 return pwndInsertAfter; 03830 }

void CalcSBStuff PWND  pwnd,
PSBCALC  pSBCalc,
BOOL  fVert
 

Referenced by _GetScrollBarInfo(), HitTestScrollBar(), RecalcTrackRect(), xxxDoScrollMenu(), xxxDrawScrollBar(), xxxDrawThumb(), and xxxSBTrackInit().

void CalcSBStuff2 PSBCALC  pSBCalc,
LPRECT  lprc,
CONST PSBDATA  pw,
BOOL  fVert
 

Definition at line 925 of file sbctl.c.

References tagSBCALC::cpx, tagSBCALC::cpxThumb, DWORD, max, min, tagSBCALC::pxBottom, tagSBCALC::pxDownArrow, tagSBCALC::pxLeft, tagSBCALC::pxMin, tagSBCALC::pxRight, tagSBCALC::pxThumbBottom, tagSBCALC::pxThumbTop, tagSBCALC::pxTop, tagSBCALC::pxUpArrow, and SYSMET.

Referenced by _GetScrollBarInfo(), CalcSBStuff(), and SBCtlSetup().

00930 { 00931 int cpx; 00932 DWORD dwRange; 00933 int denom; 00934 00935 if (fVert) { 00936 pSBCalc->pxTop = lprc->top; 00937 pSBCalc->pxBottom = lprc->bottom; 00938 pSBCalc->pxLeft = lprc->left; 00939 pSBCalc->pxRight = lprc->right; 00940 pSBCalc->cpxThumb = SYSMET(CYVSCROLL); 00941 } else { 00942 00943 /* 00944 * For horiz scroll bars, "left" & "right" are "top" and "bottom", 00945 * and vice versa. 00946 */ 00947 pSBCalc->pxTop = lprc->left; 00948 pSBCalc->pxBottom = lprc->right; 00949 pSBCalc->pxLeft = lprc->top; 00950 pSBCalc->pxRight = lprc->bottom; 00951 pSBCalc->cpxThumb = SYSMET(CXHSCROLL); 00952 } 00953 00954 pSBCalc->pos = pw->pos; 00955 pSBCalc->page = pw->page; 00956 pSBCalc->posMin = pw->posMin; 00957 pSBCalc->posMax = pw->posMax; 00958 00959 dwRange = ((DWORD)(pSBCalc->posMax - pSBCalc->posMin)) + 1; 00960 00961 // 00962 // For the case of short scroll bars that don't have enough 00963 // room to fit the full-sized up and down arrows, shorten 00964 // their sizes to make 'em fit 00965 // 00966 cpx = min((pSBCalc->pxBottom - pSBCalc->pxTop) / 2, pSBCalc->cpxThumb); 00967 00968 pSBCalc->pxUpArrow = pSBCalc->pxTop + cpx; 00969 pSBCalc->pxDownArrow = pSBCalc->pxBottom - cpx; 00970 00971 if ((pw->page != 0) && (dwRange != 0)) { 00972 // JEFFBOG -- This is the one and only place where we should 00973 // see 'range'. Elsewhere it should be 'range - page'. 00974 00975 /* 00976 * The minimun thumb size used to depend on the frame/edge metrics. 00977 * People that increase the scrollbar width/height expect the minimun 00978 * to grow with proportianally. So NT5 bases the minimun on 00979 * CXH/YVSCROLL, which is set by default in cpxThumb. 00980 */ 00981 /* 00982 * i is used to keep the macro "max" from executing EngMulDiv twice. 00983 */ 00984 int i = EngMulDiv(pSBCalc->pxDownArrow - pSBCalc->pxUpArrow, 00985 pw->page, dwRange); 00986 pSBCalc->cpxThumb = max(pSBCalc->cpxThumb / 2, i); 00987 } 00988 00989 pSBCalc->pxMin = pSBCalc->pxTop + cpx; 00990 pSBCalc->cpx = pSBCalc->pxBottom - cpx - pSBCalc->cpxThumb - pSBCalc->pxMin; 00991 00992 denom = dwRange - (pw->page ? pw->page : 1); 00993 if (denom) 00994 pSBCalc->pxThumbTop = EngMulDiv(pw->pos - pw->posMin, 00995 pSBCalc->cpx, denom) + 00996 pSBCalc->pxMin; 00997 else 00998 pSBCalc->pxThumbTop = pSBCalc->pxMin - 1; 00999 01000 pSBCalc->pxThumbBottom = pSBCalc->pxThumbTop + pSBCalc->cpxThumb; 01001 01002 }

LONG CalculateMouseSensitivity LONG  lSens  ) 
 

Definition at line 1247 of file rare.c.

Referenced by xxxSystemParametersInfo(), and xxxUpdatePerUserSystemParameters().

01274 : Sensitivities are constrained to be between 1 and 20. 01275 */ 01276 { 01277 LONG lSenFactor ; 01278 01279 if(lSens <= 2) 01280 lSenFactor=lSens*256/32 ; 01281 else if(lSens >= 3 && lSens <= 10 ) 01282 lSenFactor=(lSens-2)*256/8 ; 01283 else 01284 lSenFactor=(lSens-6)*256/4 ; 01285 01286 return lSenFactor ; 01287 }

BOOL CalcVisRgn HRGN *  hrgn,
PWND  pwndOrg,
PWND  pwndClip,
DWORD  flags
 

Definition at line 523 of file visrgn.c.

References _IsDescendant(), BOOL, CalcWindowVisRgn(), FALSE, grpdeskRitInput, gspwndLockUpdate, tagWND::head, IsVisible(), NULL, PZERO, tagDESKTOP::rpwinstaParent, and SetOrCreateRectRgnIndirectPublic().

Referenced by _GetDCEx(), InvalidateGDIWindows(), ResetSharedDesktops(), SwpCalcVisRgn(), UserGetClientRgn(), UserSetDCVisRgn(), and UserVisrgnFromHwnd().

00528 { 00529 PDESKTOP pdesk; 00530 00531 UserAssert(pwndOrg != NULL); 00532 00533 /* 00534 * If the window's not visible or is not an active desktop, 00535 * or if the clip window is in the process of being destroyed, 00536 * the visrgn is empty. 00537 */ 00538 pdesk = pwndOrg->head.rpdesk; 00539 00540 UserAssert(pdesk); 00541 00542 /* 00543 * Make sure this happens in the IO windowstation 00544 */ 00545 #if DBG 00546 if (grpdeskRitInput != NULL) { 00547 UserAssert(pdesk->rpwinstaParent == grpdeskRitInput->rpwinstaParent || 00548 !IsVisible(pwndOrg)); 00549 } 00550 #endif // DBG 00551 00552 if (!IsVisible(pwndOrg) || pdesk != grpdeskRitInput) { 00553 goto EmptyRgn; 00554 } 00555 00556 /* 00557 * If LockWindowUpdate() has been called, and this window is a child 00558 * of the lock window, always return an empty visrgn. 00559 */ 00560 if ((gspwndLockUpdate != NULL) && 00561 !(flags & DCX_LOCKWINDOWUPDATE) && 00562 _IsDescendant(gspwndLockUpdate, pwndOrg)) { 00563 00564 goto EmptyRgn; 00565 } 00566 00567 /* 00568 * Now go compute the visrgn for pwndClip. 00569 */ 00570 return CalcWindowVisRgn(pwndClip, phrgn, flags); 00571 00572 EmptyRgn: 00573 SetOrCreateRectRgnIndirectPublic(phrgn, PZERO(RECT)); 00574 return FALSE; 00575 }

int CalcWindowRgn PWND  pwnd,
HRGN  hrgn,
BOOL  fClient
 

Definition at line 585 of file visrgn.c.

References tagWND::hrgnClip, IntersectRgn, NULL, tagWND::rcClient, tagWND::rcWindow, and SetRectRgnIndirect().

Referenced by GetNCUpdateRgn(), InternalInvalidate3(), and xxxInternalInvalidate().

00589 { 00590 SetRectRgnIndirect(hrgn, (fClient) ? &pwnd->rcClient : &pwnd->rcWindow); 00591 00592 /* 00593 * If the window has a region, then intersect the rectangle region with 00594 * that. If this is low on memory, it'll propagate ERROR back. 00595 */ 00596 if (pwnd->hrgnClip != NULL) { 00597 return IntersectRgn(hrgn, hrgn, pwnd->hrgnClip); 00598 } 00599 00600 return SIMPLEREGION; 00601 }

void CancelForegroundActivate  ) 
 

Definition at line 1515 of file ntuser/kernel/input.c.

References CLEAR_PUDF, gppiStarting, NULL, tagPROCESSINFO::ppiNext, PUDF_ALLOWFOREGROUNDACTIVATE, and TEST_PUDF.

Referenced by WakeSomeone().

01516 { 01517 PPROCESSINFO ppiT; 01518 01519 if (TEST_PUDF(PUDF_ALLOWFOREGROUNDACTIVATE)) { 01520 01521 for (ppiT = gppiStarting; ppiT != NULL; ppiT = ppiT->ppiNext) { 01522 /* 01523 * Don't cancel activation if the app is being debugged - if 01524 * the debugger stops the application before it has created and 01525 * activated its first window, the app will come up behind all 01526 * others - not what you want when being debugged. 01527 */ 01528 if (!ppiT->Process->DebugPort) { 01529 ppiT->W32PF_Flags &= ~W32PF_ALLOWFOREGROUNDACTIVATE; 01530 TAGMSG1(DBGTAG_FOREGROUND, "CancelForegroundActivate clear W32PF %#p", ppiT); 01531 } 01532 } 01533 01534 CLEAR_PUDF(PUDF_ALLOWFOREGROUNDACTIVATE); 01535 TAGMSG0(DBGTAG_FOREGROUND, "CancelForegroundActivate clear PUDF"); 01536 } 01537 }

void CancelMouseHover PQ  pq  ) 
 

BOOL CanForceForeground PPROCESSINFO  ppi  ) 
 

Definition at line 1056 of file focusact.c.

References BOOL, FALSE, glinp, gppiInputProvider, gpqForeground, gptiForeground, IsTimeFromLastRITEvent(), NULL, tagTHREADINFO::ppi, tagLASTINPUT::ptiLastWoken, TRUE, UP, and W32PF_ALLOWSETFOREGROUND.

Referenced by _LockSetForegroundWindow(), CheckAllowForeground(), NtUserSystemParametersInfo(), xxxAllowSetForegroundWindow(), xxxHardErrorControl(), xxxSendBSMtoDesktop(), and xxxSetForegroundWindow().

01057 { 01058 01059 if ((glinp.ptiLastWoken != NULL) 01060 && (glinp.ptiLastWoken->ppi != ppi) 01061 && (gptiForeground != NULL) 01062 && (gptiForeground->ppi != ppi) 01063 && !(ppi->W32PF_Flags & (W32PF_ALLOWFOREGROUNDACTIVATE | W32PF_ALLOWSETFOREGROUND)) 01064 && (ppi != gppiInputProvider) 01065 && (gpqForeground != NULL) 01066 && 01067 #if DBG 01068 /* 01069 * When attaching the debugger to the foreground app, this function always 01070 * returns TRUE. In order to be able to debug anything related to this 01071 * function in such case, set this global to TRUE. 01072 */ 01073 (gfDebugForegroundIgnoreDebugPort 01074 || ( 01075 #endif 01076 (glinp.ptiLastWoken->ppi->Process->DebugPort == NULL) 01077 && (gptiForeground->ppi->Process->DebugPort == NULL) 01078 #if DBG 01079 )) 01080 #endif 01081 && !IsTimeFromLastRITEvent(UP(FOREGROUNDLOCKTIMEOUT))) { 01082 01083 return FALSE; 01084 } else { 01085 return TRUE; 01086 } 01087 01088 }

VOID CaretBlinkProc PWND  pwnd,
UINT  message,
UINT_PTR  id,
LPARAM  lParam
 

Definition at line 454 of file caret.c.

References _KillSystemTimer(), tagQ::caret, tagCARET::fOn, tagCARET::fVisible, gbRemoteSession, gpsi, IDSYS_CARET, tagCARET::iHideLevel, PtiCurrent, tagCARET::spwnd, UT_InvertCaret(), and VOID().

Referenced by _SetCaretBlinkTime(), xxxCreateCaret(), and zzzSetCaretPos().

00459 { 00460 PQ pq; 00461 00462 /* 00463 * If this window doesn't even have a timer, just return. TRUE is 00464 * returned, which gets returned from DispatchMessage(). Why? Because 00465 * it is compatible with Win3. 00466 */ 00467 pq = PtiCurrent()->pq; 00468 if (pwnd != pq->caret.spwnd) 00469 return; 00470 00471 /* 00472 * leave caret on, don't blink it off for remote sessions 00473 */ 00474 00475 if (gbRemoteSession && (gpsi->dtCaretBlink >= 1200) && pq->caret.fOn && pq->caret.fVisible) { 00476 00477 /* 00478 * Kill the timer for performance 00479 */ 00480 _KillSystemTimer(pq->caret.spwnd, IDSYS_CARET); 00481 return; 00482 } 00483 00484 /* 00485 * Flip the logical cursor state. If the hide level permits it, flip 00486 * the physical state and draw the caret. 00487 */ 00488 pq->caret.fOn ^= 1; 00489 if (pq->caret.iHideLevel == 0) { 00490 pq->caret.fVisible ^= 1; 00491 UT_InvertCaret(); 00492 } 00493 00494 return; 00495 00496 DBG_UNREFERENCED_PARAMETER(message); 00497 DBG_UNREFERENCED_PARAMETER(id); 00498 DBG_UNREFERENCED_PARAMETER(lParam); 00499 }

VOID ChangeAcquireResourceType VOID   ) 
 

Definition at line 887 of file validate.c.

References CheckDevLockOut, ExAcquireResourceExclusiveLite(), ExReleaseResource, gpresUser, gptiCurrent, ISATOMICCHECK, TRUE, and VOID().

Referenced by NtUserGetKeyState().

00889 { 00890 #if DBG 00891 FlushCallStack(); 00892 CheckDevLockOut(); 00893 UserAssert(!ISATOMICCHECK()); 00894 #endif // DBG 00895 ExReleaseResource(gpresUser); 00896 ExAcquireResourceExclusiveLite(gpresUser, TRUE); 00897 gptiCurrent = ((PTHREADINFO)(W32GetCurrentThread())); 00898 #if DBG 00899 GetCallStack(); 00900 #endif // DBG 00901 }

VOID ChangeForegroundKeyboardTable PKL  pklOld,
PKL  pklNew
 

Definition at line 982 of file kbdlyout.c.

References CheckCritIn, ClearAsyncKeyStateToggle, ClearKeyStateToggle, ClearRawKeyToggle, gfKanaToggle, ghKbdTblBase, gpKbdNlsTbl, gpKbdTbl, gptiForeground, guKbdTblSize, tagKBDFILE::hBase, tagKL::hkl, ISTS, NULL, tagKBDFILE::pKbdNlsTbl, tagKBDFILE::pKbdTbl, tagTHREADINFO::pq, SetAsyncKeyStateToggle, SetKeyStateToggle, SetRawKeyToggle, tagKBDFILE::Size, tagKL::spkf, TestAsyncKeyStateToggle, TRUE, UpdateKeyLights(), and VOID().

Referenced by SetForegroundThread(), xxxInternalActivateKeyboardLayout(), and xxxSetPKLinThreads().

00983 { 00984 CheckCritIn(); 00985 UserAssert(pklNew != NULL); 00986 00987 if (pklOld == pklNew || (pklOld != NULL && pklOld->spkf == pklNew->spkf)) { 00988 return; 00989 } 00990 00991 // Manage the VK_KANA toggle key for Japanese KL. 00992 // Since VK_HANGUL and VK_KANA share the same VK value and 00993 // VK_KANA is a toggle key, when keyboard layouts are switched, 00994 // VK_KANA toggle status should be restored. 00995 00996 // 00997 // If: 00998 // 1) Old and New keyboard layouts are both Japanese, do nothing. 00999 // 2) Old and New keyboard layouts are not Japanese, do nothing. 01000 // 3) Old keyboard is Japanese and new one is not, clear the KANA toggle. 01001 // 4) New keyboard is Japanese and old one is not, restore the KANA toggle. 01002 // 01003 01004 if (pklOld && JAPANESE_KBD_LAYOUT(pklOld->hkl)) { 01005 if (!JAPANESE_KBD_LAYOUT(pklNew->hkl)) { 01006 // Old keyboard layout is Japanese and the new one is not Japanese, 01007 // so we save the current KANA toggle status and clear it. 01008 gfKanaToggle = (TestAsyncKeyStateToggle(VK_KANA) != 0); 01009 RIPMSG0(RIP_VERBOSE, "Old kbd is JPN. VK_KANA toggle is being cleared.\n"); 01010 ClearAsyncKeyStateToggle(VK_KANA); 01011 ClearRawKeyToggle(VK_KANA); 01012 UpdateKeyLights(TRUE); 01013 } 01014 } else if (JAPANESE_KBD_LAYOUT(pklNew->hkl)) { 01015 // Previous keyboard layout does not exist or is not Japanese, 01016 // and the new one is Japanese. 01017 // Have to restore the KANA toggle status. 01018 RIPMSG0(RIP_VERBOSE, "New kbd is JPN. "); 01019 if (gfKanaToggle) { 01020 RIPMSG0(RIP_VERBOSE, "VK_KANA is being set.\n"); 01021 SetAsyncKeyStateToggle(VK_KANA); 01022 SetRawKeyToggle(VK_KANA); 01023 if (gptiForeground && gptiForeground->pq) { 01024 SetKeyStateToggle(gptiForeground->pq, VK_KANA); 01025 } 01026 } else { 01027 RIPMSG0(RIP_VERBOSE, "VK_KANA is beging cleared.\n"); 01028 ClearAsyncKeyStateToggle(VK_KANA); 01029 ClearRawKeyToggle(VK_KANA); 01030 if (gptiForeground && gptiForeground->pq) { 01031 ClearKeyStateToggle(gptiForeground->pq, VK_KANA); 01032 } 01033 } 01034 UpdateKeyLights(TRUE); 01035 } 01036 01037 /* 01038 * Set gpKbdTbl so foreground thread processes AltGr appropriately 01039 */ 01040 gpKbdTbl = pklNew->spkf->pKbdTbl; 01041 if (ISTS()) { 01042 ghKbdTblBase = pklNew->spkf->hBase; 01043 guKbdTblSize = pklNew->spkf->Size; 01044 } 01045 01046 UserAssert(pklNew); 01047 TAGMSG2(DBGTAG_IMM, "ChangeForegroundKeyboardTable:Changing KL NLS Table: prev HKL=%x to new HKL=%x\n", pklOld ? pklOld->hkl : 0, pklNew->hkl); 01048 TAGMSG1(DBGTAG_IMM, "ChangeForegroundKeyboardTable: new gpKbdNlsTbl=%x\n", pklNew->spkf->pKbdNlsTbl); 01049 gpKbdNlsTbl = pklNew->spkf->pKbdNlsTbl; 01050 }

VOID ChangeMenuOwner PMENU  pMenu,
PPROCESSINFO  ppi
 

PWINDOWSTATION CheckClipboardAccess void   ) 
 

Definition at line 49 of file ntuser/kernel/clipbrd.c.

References BOOL, FALSE, NT_SUCCESS, NTSTATUS(), NULL, PsGetCurrentThread, PtiCurrentShared, ReferenceWindowStation(), Status, TIF_CSRSSTHREAD, tagTHREADINFO::TIF_flags, and TRUE.

Referenced by _EnumClipboardFormats(), _GetPriorityClipboardFormat(), _SetClipboardData(), DisownClipboard(), NtUserCountClipboardFormats(), NtUserGetClipboardData(), NtUserGetClipboardOwner(), NtUserGetClipboardSequenceNumber(), NtUserGetClipboardViewer(), NtUserGetOpenClipboardWindow(), NtUserIsClipboardFormatAvailable(), xxxChangeClipboardChain(), xxxCloseClipboard(), xxxEmptyClipboard(), xxxOpenClipboard(), and xxxSetClipboardViewer().

00050 { 00051 NTSTATUS Status; 00052 PWINDOWSTATION pwinsta; 00053 BOOL fUseDesktop; 00054 PTHREADINFO pti; 00055 00056 pti = PtiCurrentShared(); 00057 00058 /* 00059 * CSR process use to have NULL pwinsta. Now that it's assigned to 00060 * the services windowstation we have to explicitly use the desktop 00061 * for checking the access. 00062 */ 00063 fUseDesktop = (pti->TIF_flags & TIF_CSRSSTHREAD) ? TRUE : FALSE; 00064 00065 Status = ReferenceWindowStation(PsGetCurrentThread(), 00066 NULL, 00067 WINSTA_ACCESSCLIPBOARD, 00068 &pwinsta, 00069 fUseDesktop); 00070 if (!NT_SUCCESS(Status)) { 00071 RIPNTERR0(Status, RIP_WARNING,"Access to clipboard denied."); 00072 return NULL; 00073 } 00074 00075 return pwinsta; 00076 }

BOOL CheckDesktopPolicy PUNICODE_STRING pProfileUserName  OPTIONAL,
PCWSTR  lpKeyName
 

Definition at line 426 of file w32/ntuser/kernel/profile.c.

References ARRAY_SIZE, BOOL, DWORD, FALSE, gdwPolicyFlags, GetCurrentProcessId, gpidLogon, hModuleWin, IS_PTR, NT_ERROR, NTSTATUS(), NULL, OpenCacheKeyEx(), PMAP_DESKTOP, POLICY_MACHINE, POLICY_USER, PTR_TO_ID, RtlInitUnicodeString(), ServerLoadString, Status, and TRUE.

Referenced by xxxSystemParametersInfo().

00430 { 00431 WCHAR szKey[80]; 00432 HANDLE hKey; 00433 DWORD cbSize; 00434 NTSTATUS Status; 00435 UNICODE_STRING UnicodeString; 00436 KEY_VALUE_BASIC_INFORMATION KeyInfo; 00437 DWORD dwPolicyFlags = gdwPolicyFlags & (POLICY_MACHINE | POLICY_USER); 00438 00439 /* 00440 * If there is no policy or the caller is winlogon, let it go. 00441 */ 00442 if (!dwPolicyFlags || GetCurrentProcessId() == gpidLogon) { 00443 return FALSE; 00444 } 00445 00446 /* 00447 * Convert the ID to a string if we need to. 00448 */ 00449 if (!IS_PTR(lpKeyName)) { 00450 ServerLoadString(hModuleWin, PTR_TO_ID(lpKeyName), szKey, ARRAY_SIZE(szKey)); 00451 lpKeyName = szKey; 00452 } 00453 00454 TryAgain: 00455 00456 /* 00457 * Try to open a key. 00458 */ 00459 if ((hKey = OpenCacheKeyEx(pProfileUserName, 00460 PMAP_DESKTOP, 00461 KEY_READ, 00462 &dwPolicyFlags)) == NULL) { 00463 return FALSE; 00464 } 00465 00466 /* 00467 * See if the value exists. 00468 */ 00469 RtlInitUnicodeString(&UnicodeString, lpKeyName); 00470 Status = ZwQueryValueKey(hKey, 00471 &UnicodeString, 00472 KeyValueBasicInformation, 00473 &KeyInfo, 00474 sizeof(KeyInfo), 00475 &cbSize); 00476 00477 ZwClose(hKey); 00478 00479 if (!NT_ERROR(Status)) { 00480 return TRUE; 00481 } else if (dwPolicyFlags) { 00482 goto TryAgain; 00483 } else { 00484 return FALSE; 00485 } 00486 }

BOOL CheckDesktopPolicyChange PUNICODE_STRING pProfileUserName  OPTIONAL  ) 
 

Definition at line 499 of file w32/ntuser/kernel/profile.c.

References BOOL, DWORD, FALSE, gdwPolicyFlags, OpenCacheKeyEx(), PMAP_DESKTOP, POLICY_MACHINE, POLICY_USER, and TRUE.

Referenced by xxxUpdatePerUserSystemParameters().

00502 { 00503 static LARGE_INTEGER LastMachineWriteTime; 00504 static LARGE_INTEGER LastUserWriteTime; 00505 KEY_BASIC_INFORMATION KeyInfo; 00506 BOOL bPolicyChanged = FALSE; 00507 HANDLE hKey; 00508 DWORD cbSize; 00509 DWORD dwPolicyFlags; 00510 00511 /* 00512 * Check if machine policy has changed since last time we checked. 00513 */ 00514 dwPolicyFlags = POLICY_MACHINE; 00515 KeyInfo.LastWriteTime.QuadPart = 0; 00516 hKey = OpenCacheKeyEx(pProfileUserName, 00517 PMAP_DESKTOP, 00518 KEY_READ, 00519 &dwPolicyFlags); 00520 if (hKey) { 00521 ZwQueryKey(hKey, 00522 KeyValueBasicInformation, 00523 &KeyInfo, 00524 sizeof(KeyInfo), 00525 &cbSize); 00526 ZwClose(hKey); 00527 gdwPolicyFlags |= POLICY_MACHINE; 00528 } else { 00529 gdwPolicyFlags &= ~POLICY_MACHINE; 00530 } 00531 if (LastMachineWriteTime.QuadPart != KeyInfo.LastWriteTime.QuadPart) { 00532 LastMachineWriteTime.QuadPart = KeyInfo.LastWriteTime.QuadPart; 00533 bPolicyChanged = TRUE; 00534 } 00535 00536 /* 00537 * Check if user policy has changed since last time we checked. 00538 */ 00539 dwPolicyFlags = POLICY_USER; 00540 KeyInfo.LastWriteTime.QuadPart = 0; 00541 hKey = OpenCacheKeyEx(pProfileUserName, 00542 PMAP_DESKTOP, 00543 KEY_READ, 00544 &dwPolicyFlags); 00545 if (hKey) { 00546 ZwQueryKey(hKey, 00547 KeyValueBasicInformation, 00548 &KeyInfo, 00549 sizeof(KeyInfo), 00550 &cbSize); 00551 ZwClose(hKey); 00552 gdwPolicyFlags |= POLICY_USER; 00553 } else { 00554 gdwPolicyFlags &= ~POLICY_USER; 00555 } 00556 if (LastUserWriteTime.QuadPart != KeyInfo.LastWriteTime.QuadPart) { 00557 LastUserWriteTime.QuadPart = KeyInfo.LastWriteTime.QuadPart; 00558 bPolicyChanged = TRUE; 00559 } 00560 00561 return bPolicyChanged; 00562 }

BOOL CheckGrantedAccess ACCESS_MASK  ,
ACCESS_MASK 
 

Definition at line 492 of file w32/ntuser/kernel/security.c.

References BOOL, FALSE, RtlAreAllAccessesGranted(), and TRUE.

Referenced by NtUserGetCaretBlinkTime(), NtUserGetDoubleClickTime(), and xxxMouseEventDirect().

00495 { 00496 00497 /* 00498 * Check the granted access. 00499 */ 00500 if (!RtlAreAllAccessesGranted(amGranted, amRequest)) { 00501 RIPERR0(ERROR_ACCESS_DENIED, RIP_VERBOSE, ""); 00502 return FALSE; 00503 } 00504 return TRUE; 00505 }

BOOL CheckHandleFlag HANDLE  ,
DWORD 
 

Definition at line 4464 of file desktop.c.

References tagPROCESSINFO::bmHandleFlags, BOOL, EnterHandleFlagsCrit(), FALSE, HF_LIMIT, Index, LeaveHandleFlagsCrit(), NULL, PEXHANDLE, and PpiCurrent.

Referenced by _GetUserObjectInformation(), OkayToCloseDesktop(), OkayToCloseWindowStation(), and zzzSetDesktop().

04467 { 04468 PPROCESSINFO ppi; 04469 ULONG Index = ((PEXHANDLE)&hObject)->Index * HF_LIMIT + dwFlag; 04470 BOOL fRet = FALSE; 04471 04472 EnterHandleFlagsCrit(); 04473 04474 if ((ppi = PpiCurrent()) != NULL) { 04475 fRet = (Index < ppi->bmHandleFlags.SizeOfBitMap && 04476 RtlCheckBit(&ppi->bmHandleFlags, Index)); 04477 } 04478 04479 LeaveHandleFlagsCrit(); 04480 04481 return fRet; 04482 }

BOOL CheckHandleInUse HANDLE   ) 
 

Definition at line 4557 of file desktop.c.

References BOOL, EnterHandleFlagsCrit(), gHandleInUse, gProcessInUse, LeaveHandleFlagsCrit(), and PsGetCurrentProcess.

Referenced by OkayToCloseDesktop(), and OkayToCloseWindowStation().

04559 { 04560 BOOL fRet; 04561 04562 EnterHandleFlagsCrit(); 04563 fRet = ((gProcessInUse == PsGetCurrentProcess()) && 04564 (gHandleInUse == hObject)); 04565 LeaveHandleFlagsCrit(); 04566 04567 return fRet; 04568 }

PIMEHOTKEYOBJ CheckImeHotKey PQ  pq,
UINT  uVKey,
LPARAM  lParam
 

Definition at line 461 of file imehotky.c.

References BOOL, FALSE, FindImeHotKeyByKey(), gpImeHotKeyListHeader, _tagIMEHOTKEYOBJ::hk, MOD_BOTH_SIDES, MOD_MODIFY_KEYS, NULL, TestKeyStateDown, TRUE, UINT, and _tagIMEHOTKEY::uModifiers.

Referenced by NtUserCheckImeHotKey(), and xxxImmProcessKey().

00466 { 00467 static UINT uVKeySaved = 0; 00468 PIMEHOTKEYOBJ ph; 00469 UINT uModifiers = 0; 00470 BOOL fKeyUp; 00471 00472 // 00473 // early return for key up message 00474 // 00475 fKeyUp = ( lParam & 0x80000000 ) ? TRUE : FALSE; 00476 if ( fKeyUp ) { 00477 // 00478 // if the uVKey is not same as the vkey 00479 // we previously saved, there is no chance 00480 // that this is a hotkey. 00481 // 00482 if ( uVKeySaved != uVKey ) { 00483 uVKeySaved = 0; 00484 return NULL; 00485 } 00486 uVKeySaved = 0; 00487 // 00488 // If it's same, we still need to check 00489 // the hotkey list because there is a 00490 // chance that the hotkey list is modified 00491 // between the key make and break. 00492 // 00493 } 00494 00495 // 00496 // Current specification doesn't allow us to use a complex 00497 // hotkey such as LSHIFT+RMENU+SPACE 00498 // 00499 00500 // 00501 // Setup the shift, control, alt key states 00502 // 00503 uModifiers |= TestKeyStateDown(pq, VK_LSHIFT) ? (MOD_SHIFT | MOD_LEFT) : 0; 00504 uModifiers |= TestKeyStateDown(pq, VK_RSHIFT) ? (MOD_SHIFT | MOD_RIGHT) : 0; 00505 00506 uModifiers |= TestKeyStateDown(pq, VK_LCONTROL) ? (MOD_CONTROL | MOD_LEFT) : 0; 00507 uModifiers |= TestKeyStateDown(pq, VK_RCONTROL) ? (MOD_CONTROL | MOD_RIGHT) : 0; 00508 00509 uModifiers |= TestKeyStateDown(pq, VK_LMENU) ? (MOD_ALT | MOD_LEFT) : 0; 00510 uModifiers |= TestKeyStateDown(pq, VK_RMENU) ? (MOD_ALT | MOD_RIGHT) : 0; 00511 00512 ph = FindImeHotKeyByKey( gpImeHotKeyListHeader, 00513 uModifiers & MOD_MODIFY_KEYS, 00514 uModifiers & MOD_BOTH_SIDES, 00515 uVKey ); 00516 00517 if ( ph != NULL ) { 00518 if ( fKeyUp ) { 00519 if ( ph->hk.uModifiers & MOD_ON_KEYUP ) { 00520 return ph; 00521 } 00522 } else { 00523 if ( ph->hk.uModifiers & MOD_ON_KEYUP ) { 00524 // 00525 // save vkey for next keyup message time 00526 // 00527 // when ALT+Z is a hotkey, we don't want 00528 // to handle #2 as the hotkey sequence. 00529 // 1) ALT make -> 'Z' make -> 'Z' break 00530 // 2) 'Z' make -> ALT make -> 'Z' break 00531 // 00532 uVKeySaved = uVKey; 00533 } else { 00534 return ph; 00535 } 00536 } 00537 } 00538 00539 return NULL; 00540 }

BOOL CheckPwndFilter PWND  pwnd,
PWND  pwndFilter
 

Definition at line 131 of file w32/ntuser/kernel/random.c.

References _IsChild(), BOOL, NULL, and TRUE.

Referenced by DoPaint(), DoTimer(), FindQMsg(), xxxScanSysQueue(), and xxxWindowHitTest2().

00134 { 00135 if ((pwndFilter == NULL) || (pwndFilter == pwnd) || 00136 ((pwndFilter == (PWND)1) && (pwnd == NULL))) { 00137 return TRUE; 00138 } 00139 00140 return _IsChild(pwndFilter, pwnd); 00141 }

BOOL CheckWinstaWriteAttributesAccess void   ) 
 

Definition at line 518 of file w32/ntuser/kernel/security.c.

References tagPROCESSINFO::amwinsta, BOOL, FALSE, gpidLogon, PpiCurrent, PsGetCurrentProcess, RtlAreAllAccessesGranted(), and TRUE.

Referenced by _RegisterHotKey(), _SetCaretBlinkTime(), _SetDoubleClickTime(), xxxSetSysColors(), xxxSystemParametersInfo(), zzzClipCursor(), zzzSetCursorPos(), and zzzSetSystemCursor().

00519 { 00520 PPROCESSINFO ppiCurrent = PpiCurrent(); 00521 00522 /* 00523 * winlogon has rights to all windowstations. 00524 */ 00525 if (PsGetCurrentProcess()->UniqueProcessId == gpidLogon) 00526 return TRUE; 00527 00528 if (!(ppiCurrent->W32PF_Flags & W32PF_IOWINSTA)) { 00529 RIPERR0(ERROR_REQUIRES_INTERACTIVE_WINDOWSTATION, 00530 RIP_WARNING, 00531 "Operation invalid on a non-interactive WindowStation."); 00532 00533 return FALSE; 00534 } 00535 00536 if (!RtlAreAllAccessesGranted(ppiCurrent->amwinsta, WINSTA_WRITEATTRIBUTES)) { 00537 RIPERR0(ERROR_ACCESS_DENIED, 00538 RIP_WARNING, 00539 "WINSTA_WRITEATTRIBUTES access to WindowStation denied."); 00540 00541 return FALSE; 00542 } 00543 return TRUE; 00544 }

CHECKPOINT* CkptRestore PWND  pwnd,
LPCRECT  lprcWindow
 

Definition at line 335 of file movesize.c.

References _GetProp(), _MonitorFromRect(), CopyRect, FALSE, tagCHECKPOINT::fMaxInitialized, tagCHECKPOINT::fMinInitialized, GetMonitorMaxArea(), HMIsMarkDestroy, InternalSetProp(), NULL, PROP_CHECKPOINT, PROPF_INTERNAL, tagCHECKPOINT::ptMax, tagCHECKPOINT::ptMin, PWNDDESKTOP, tagCHECKPOINT::rcNormal, tagWND::spwndParent, TestWF, TRUE, WFMAXIMIZED, WFMINIMIZED, and WFREALLYMAXIMIZABLE.

Referenced by UpdateCheckpoint(), xxxMinMaximize(), and xxxMS_TrackMove().

00338 { 00339 PCHECKPOINT pcp; 00340 00341 /* 00342 * Don't return or create a checkpoint if the window is dying. 00343 */ 00344 if (HMIsMarkDestroy(pwnd)) 00345 return NULL; 00346 00347 /* 00348 * If it doesn't exist, create it. 00349 */ 00350 if ((pcp = (PCHECKPOINT)_GetProp(pwnd, 00351 PROP_CHECKPOINT, 00352 PROPF_INTERNAL)) == NULL) { 00353 00354 if ((pcp = (PCHECKPOINT)UserAllocPoolWithQuota(sizeof(CHECKPOINT), 00355 TAG_CHECKPT)) == NULL) { 00356 return NULL; 00357 } 00358 00359 if (!InternalSetProp(pwnd, 00360 PROP_CHECKPOINT, 00361 (HANDLE)pcp, 00362 PROPF_INTERNAL)) { 00363 00364 UserFreePool(pcp); 00365 return NULL; 00366 } 00367 00368 /* 00369 * Initialize it to -1 so first minimize will park the icon. 00370 */ 00371 pcp->ptMin.x = -1; 00372 pcp->ptMin.y = -1; 00373 pcp->ptMax.x = -1; 00374 pcp->ptMax.y = -1; 00375 00376 /* 00377 * Initialize pwndTitle to NULL so we create a title window on the 00378 * first minimize of the window 00379 */ 00380 pcp->fDragged = FALSE; 00381 pcp->fWasMaximizedBeforeMinimized = FALSE; 00382 pcp->fWasMinimizedBeforeMaximized = FALSE; 00383 pcp->fMinInitialized = FALSE; 00384 pcp->fMaxInitialized = FALSE; 00385 00386 /* 00387 * BOGUS! We're going to copy this twice if the window isn't 00388 * minimized or maximized. But if it isn't, we're going to get 00389 * a weird size in rcNormal... 00390 */ 00391 CopyRect(&pcp->rcNormal, lprcWindow); 00392 } 00393 00394 /* 00395 * If the window is minimized/maximized, then set the min/max 00396 * point. Otherwise use checkpoint the window-size. 00397 */ 00398 if (TestWF(pwnd, WFMINIMIZED)) { 00399 pcp->fMinInitialized = TRUE; 00400 pcp->ptMin.x = lprcWindow->left; 00401 pcp->ptMin.y = lprcWindow->top; 00402 } else if (TestWF(pwnd, WFMAXIMIZED)) { 00403 pcp->fMaxInitialized = TRUE; 00404 00405 if (pwnd->spwndParent == PWNDDESKTOP(pwnd)) { 00406 if (TestWF(pwnd, WFREALLYMAXIMIZABLE)) { 00407 pcp->fMaxInitialized = FALSE; 00408 pcp->ptMax.x = -1; 00409 pcp->ptMax.y = -1; 00410 } else { 00411 PMONITOR pMonitor; 00412 LPRECT lprc; 00413 00414 pMonitor = _MonitorFromRect(lprcWindow, MONITOR_DEFAULTTOPRIMARY); 00415 GetMonitorMaxArea(pwnd, pMonitor, &lprc); 00416 pcp->ptMax.x = lprcWindow->left - lprc->left; 00417 pcp->ptMax.y = lprcWindow->top - lprc->top; 00418 } 00419 } else { 00420 pcp->ptMax.x = lprcWindow->left; 00421 pcp->ptMax.y = lprcWindow->top; 00422 } 00423 } else { 00424 CopyRect(&pcp->rcNormal, lprcWindow); 00425 } 00426 00427 return pcp; 00428 }

PCURSOR ClassSetSmallIcon PCLS  pcls,
PCURSOR  pcursor,
BOOL  fServerCreated
 

void CleanupDecSFWLockCount PVOID  pIgnore  ) 
 

Definition at line 1218 of file focusact.c.

References DecSFWLockCount().

01219 { 01220 DecSFWLockCount(); 01221 UNREFERENCED_PARAMETER(pIgnore); 01222 }

VOID CleanupGDI VOID   ) 
 

Definition at line 565 of file w32/ntuser/kernel/init.c.

References DelayedDestroyCacheDC(), DestroyBitmap(), DestroyBrush(), DestroyCacheDCEntries(), DestroyDC(), DestroyFont(), DestroyMonitor(), DestroyRegion(), gfade, ghbmBits, ghbmCaption, ghbmWallpaper, ghbrBlack, ghbrHungApp, ghbrWhite, ghdcMem, ghdcMem2, ghFontSys, ghIconFont, ghMenuFont, ghMenuFontDef, ghpalWallpaper, ghrgnGDC, ghrgnInv0, ghrgnInv1, ghrgnInv2, ghrgnInvalid, ghrgnInvalidSum, ghrgnSCR, ghrgnScrl1, ghrgnScrl2, ghrgnScrlDst, ghrgnScrlSrc, ghrgnScrlValid, ghrgnScrlVis, ghrgnSPB1, ghrgnSPB2, ghrgnSW, ghrgnSWP1, ghrgnValid, ghrgnValidSum, ghrgnVisNew, ghSmCaptionFont, ghStatusFont, gpDispInfo, gpMonitorCached, gpsi, tagDISPLAYINFO::hbmGray, tagFADE::hdc, tagDISPLAYINFO::hdcBits, tagDISPLAYINFO::hdcGray, tagDISPLAYINFO::hdcScreen, tagDISPLAYINFO::hDev, tagDISPLAYINFO::hrgnScreen, NULL, tagDISPLAYINFO::pdceFirst, tagDISPLAYINFO::pmdev, tagDISPLAYINFO::pMonitorFirst, tagMONITOR::pMonitorNext, PtiCurrent, SYSHBRUSH, and VOID().

Referenced by CleanupResources().

00567 { 00568 int i; 00569 00570 /* 00571 * Free gpDispInfo stuff 00572 */ 00573 DestroyDC(&gpDispInfo->hdcScreen); 00574 DestroyDC(&gpDispInfo->hdcBits); 00575 DestroyDC(&gpDispInfo->hdcGray); 00576 DestroyDC(&ghdcMem); 00577 DestroyDC(&ghdcMem2); 00578 DestroyDC(&gfade.hdc); 00579 00580 /* 00581 * Free the cache DC stuff before the GRE cleanup. 00582 * Also notice that we call DelayedDestroyCacheDC which 00583 * we usualy call from DestroyProcessInfo. We do it 00584 * here because this is the last WIN32 thread. 00585 */ 00586 DestroyCacheDCEntries(PtiCurrent()); 00587 DestroyCacheDCEntries(NULL); 00588 DelayedDestroyCacheDC(); 00589 00590 UserAssert(gpDispInfo->pdceFirst == NULL); 00591 00592 /* 00593 * Free bitmaps 00594 */ 00595 DestroyBitmap(&gpDispInfo->hbmGray); 00596 DestroyBitmap(&ghbmBits); 00597 DestroyBitmap(&ghbmCaption); 00598 00599 /* 00600 * Cleanup brushes 00601 */ 00602 DestroyBrush(&ghbrHungApp); 00603 DestroyBrush(&gpsi->hbrGray); 00604 DestroyBrush(&ghbrWhite); 00605 DestroyBrush(&ghbrBlack); 00606 00607 for (i = 0; i < COLOR_MAX; i++) { 00608 DestroyBrush(&(SYSHBRUSH(i))); 00609 } 00610 00611 /* 00612 * Cleanup regions 00613 */ 00614 DestroyRegion(&gpDispInfo->hrgnScreen); 00615 DestroyRegion(&ghrgnInvalidSum); 00616 DestroyRegion(&ghrgnVisNew); 00617 DestroyRegion(&ghrgnSWP1); 00618 DestroyRegion(&ghrgnValid); 00619 DestroyRegion(&ghrgnValidSum); 00620 DestroyRegion(&ghrgnInvalid); 00621 DestroyRegion(&ghrgnInv0); 00622 DestroyRegion(&ghrgnInv1); 00623 DestroyRegion(&ghrgnInv2); 00624 DestroyRegion(&ghrgnGDC); 00625 DestroyRegion(&ghrgnSCR); 00626 DestroyRegion(&ghrgnSPB1); 00627 DestroyRegion(&ghrgnSPB2); 00628 DestroyRegion(&ghrgnSW); 00629 DestroyRegion(&ghrgnScrl1); 00630 DestroyRegion(&ghrgnScrl2); 00631 DestroyRegion(&ghrgnScrlVis); 00632 DestroyRegion(&ghrgnScrlSrc); 00633 DestroyRegion(&ghrgnScrlDst); 00634 DestroyRegion(&ghrgnScrlValid); 00635 00636 /* 00637 * Cleanup fonts 00638 */ 00639 DestroyFont(&ghSmCaptionFont); 00640 DestroyFont(&ghMenuFont); 00641 DestroyFont(&ghMenuFontDef); 00642 DestroyFont(&ghStatusFont); 00643 DestroyFont(&ghIconFont); 00644 DestroyFont(&ghFontSys); 00645 00646 /* 00647 * wallpaper stuff. 00648 */ 00649 if (ghpalWallpaper != NULL) { 00650 GreSetPaletteOwner(ghpalWallpaper, OBJECT_OWNER_CURRENT); 00651 GreDeleteObject(ghpalWallpaper); 00652 ghpalWallpaper = NULL; 00653 } 00654 DestroyBitmap(&ghbmWallpaper); 00655 00656 /* 00657 * Unload the video driver 00658 */ 00659 if (gpDispInfo->pmdev) { 00660 DrvDestroyMDEV(gpDispInfo->pmdev); 00661 GreFreePool(gpDispInfo->pmdev); 00662 gpDispInfo->pmdev = NULL; 00663 gpDispInfo->hDev = NULL; 00664 } 00665 00666 /* 00667 * Free the monitor stuff 00668 */ 00669 { 00670 PMONITOR pMonitor; 00671 PMONITOR pMonitorNext; 00672 00673 pMonitor = gpDispInfo->pMonitorFirst; 00674 00675 while (pMonitor != NULL) { 00676 pMonitorNext = pMonitor->pMonitorNext; 00677 DestroyMonitor(pMonitor); 00678 pMonitor = pMonitorNext; 00679 } 00680 00681 UserAssert(gpDispInfo->pMonitorFirst == NULL); 00682 00683 if (gpMonitorCached != NULL) { 00684 DestroyMonitor(gpMonitorCached); 00685 } 00686 } 00687 }

VOID CleanupPowerRequestList VOID   ) 
 

Definition at line 216 of file power.c.

References CancelPowerRequest(), gbNoMorePowerCallouts, gpPowerRequestMutex, NULL, PPOWERREQUEST, TRUE, and UnqueuePowerRequest().

Referenced by CleanupResources(), and InitiateWin32kCleanup().

00217 { 00218 PPOWERREQUEST pPowerRequest; 00219 00220 /* 00221 * Make sure no new power requests come in. 00222 */ 00223 gbNoMorePowerCallouts = TRUE; 00224 00225 /* 00226 * If we never allocated anything, there's nothing to clean up. 00227 */ 00228 if (gpPowerRequestMutex == NULL) { 00229 return; 00230 } 00231 00232 /* 00233 * Mark any pending power requests as cacelled. 00234 */ 00235 while ((pPowerRequest = UnqueuePowerRequest()) != NULL) { 00236 CancelPowerRequest(pPowerRequest); 00237 } 00238 }

VOID CleanupResources VOID   ) 
 

Definition at line 2087 of file ntinput.c.

References CleanupGDI(), CleanupPowerRequestList(), DestroyClass(), gbCleanedUpResources, gpclsList, HH_CLEANUPRESOURCES, HYDRA_HINT, LockQCursor, NULL, PpiCurrent, tagTHREADINFO::pq, tagTHREADINFO::ptiSibling, TRUE, UnloadCursorsAndIcons(), and VOID().

Referenced by xxxDestroyThreadInfo().

02089 { 02090 PPCLS ppcls; 02091 PTHREADINFO pti; 02092 02093 UserAssert(!gbCleanedUpResources); 02094 02095 gbCleanedUpResources = TRUE; 02096 02097 HYDRA_HINT(HH_CLEANUPRESOURCES); 02098 02099 /* 02100 * Prevent power callouts. 02101 */ 02102 CleanupPowerRequestList(); 02103 02104 /* 02105 * Destroy the system classes also 02106 */ 02107 ppcls = &gpclsList; 02108 while (*ppcls != NULL) { 02109 DestroyClass(ppcls); 02110 } 02111 02112 /* 02113 * Unlock the cursor from all the CSRSS's threads. 02114 * We do this here because RIT might not be the only 02115 * CSRSS process running at this time and we want 02116 * to prevent the change of thread ownership 02117 * after RIT is gone. 02118 */ 02119 pti = PpiCurrent()->ptiList; 02120 02121 while (pti != NULL) { 02122 02123 if (pti->pq != NULL) { 02124 LockQCursor(pti->pq, NULL); 02125 } 02126 pti = pti->ptiSibling; 02127 } 02128 02129 UnloadCursorsAndIcons(); 02130 02131 /* 02132 * Cleanup the GDI globals in USERK 02133 */ 02134 CleanupGDI(); 02135 }

void ClearAppStarting PPROCESSINFO  ppi  ) 
 

Definition at line 1131 of file queue.c.

References gppiStarting, PROCESSINFO, and REMOVE_FROM_LIST.

Referenced by DestroyProcessInfo(), FRemoveForegroundActivate(), and InitSystemThread().

01132 { 01133 REMOVE_FROM_LIST(PROCESSINFO, gppiStarting, ppi, ppiNext); 01134 ppi->W32PF_Flags &= ~W32PF_APPSTARTING; 01135 }

VOID ClearHungFlag PWND  pwnd,
WORD  wFlag
 

Definition at line 57 of file hungapp.c.

References BOOL, ClrWF, gpvwplHungRedraw, TestWF, VOID(), VWPLRemove(), and WFANYHUNGREDRAW.

Referenced by InternalInvalidate3(), xxxBeginPaint(), xxxDrawCaptionBar(), xxxFreeWindow(), xxxHungAppDemon(), xxxRedrawHungWindow(), and xxxSimpleDoSyncPaint().

00060 { 00061 BOOL fInRedrawList = TestWF(pwnd, WFANYHUNGREDRAW); 00062 00063 ClrWF(pwnd, wFlag); 00064 if (!TestWF(pwnd, WFANYHUNGREDRAW) && fInRedrawList) { 00065 /* 00066 * Remove the window from the redraw list and possibly compact it. 00067 */ 00068 VWPLRemove(&gpvwplHungRedraw, pwnd); 00069 } 00070 }

VOID ClearSendMessages PWND  pwnd  ) 
 

Definition at line 2400 of file kernel/sendmsg.c.

Referenced by xxxFreeWindow().

02409 : 02410 * 01-13-91 DavidPe Ported. 02411 \***********************************************************************/ 02412 02413 VOID ClearSendMessages( 02414 PWND pwnd) 02415 { 02416 PSMS psms, psmsNext; 02417 PSMS *ppsms; 02418 02419 CheckCritIn(); 02420 02421 psms = gpsmsList; 02422 while (psms != NULL) { 02423 /* 02424 * Grab the next one beforehand in case we free the current one. 02425 */ 02426 psmsNext = psms->psmsNext; 02427 02428 if (psms->spwnd == pwnd) { 02429 02430 /* 02431 * If the sender has died, then mark this receiver free so the 02432 * receiver will destroy it in its processing. 02433 */ 02434 if (psms->flags & SMF_SENDERDIED) { 02435 psms->flags |= SMF_REPLY | SMF_RECEIVERFREE; 02436 } else { 02437 /* 02438 * The sender is alive. If the receiver hasn't replied to 02439 * this yet, make a reply so the sender gets it. Make sure 02440 * the receiver is the one free it so we don't have a race 02441 * condition. 02442 */ 02443 if (!(psms->flags & SMF_REPLY)) { 02444 02445 /* 02446 * The sms is either still on the receive list 02447 * or is currently being received. Since the sender 02448 * is alive, we want the sender to get the reply 02449 * to this SMS. If it hasn't been received, take 02450 * it off the receive list and reply to it. If it 02451 * has been received, then just leave it alone: 02452 * it'll get replied to normally. 02453 */ 02454 if (psms->flags & SMF_CB_REQUEST) { 02455 /* 02456 * From SendMessageCallback REQUEST callback. Send the 02457 * message back with a the REPLY value. 02458 */ 02459 TL tlpwnd; 02460 INTRSENDMSGEX ism; 02461 02462 psms->flags |= SMF_REPLY; 02463 02464 ism.fuCall = ISM_CALLBACK | ISM_REPLY; 02465 if (psms->flags & SMF_CB_CLIENT) 02466 ism.fuCall |= ISM_CB_CLIENT; 02467 ism.lpResultCallBack = psms->lpResultCallBack; 02468 ism.dwData = psms->dwData; 02469 ism.lRet = 0L; /* null return */ 02470 02471 ThreadLock(psms->spwnd, &tlpwnd); 02472 02473 xxxInterSendMsgEx(psms->spwnd, psms->message, 0L, 0L, 02474 NULL, psms->ptiCallBackSender, &ism ); 02475 02476 ThreadUnlock(&tlpwnd); 02477 } else if (!(psms->flags & SMF_RECEIVERBUSY)) { 02478 /* 02479 * If there is no sender, this is a notification 02480 * message (nobody to reply to). In this case, 02481 * just set the SMF_REPLY bit (SMF_RECEIVERFREE 02482 * is already set) and this'll cause ReceiveMessage 02483 * to just free this SMS and return. 02484 */ 02485 if (psms->ptiSender == NULL) { 02486 psms->flags |= SMF_REPLY; 02487 } else { 02488 /* 02489 * There is a sender, and it wants a reply: take 02490 * this SMS off the receive list, and reply 02491 * to the sender. 02492 */ 02493 for (ppsms = &(psms->ptiReceiver->psmsReceiveList); 02494 *ppsms != NULL; 02495 ppsms = &((*ppsms)->psmsReceiveNext)) { 02496 02497 if (*ppsms == psms) { 02498 *ppsms = psms->psmsReceiveNext; 02499 break; 02500 } 02501 } 02502 02503 02504 /* 02505 * Reply to this message so the sender 02506 * wakes up. 02507 */ 02508 psms->flags |= SMF_REPLY; 02509 psms->lRet = 0; 02510 psms->psmsReceiveNext = NULL; 02511 SetWakeBit(psms->ptiSender, QS_SMSREPLY); 02512 02513 /* 02514 * 16 bit senders need to be notifed that sends completed 02515 * otherwise it may wait for a very long time for the reply. 02516 */ 02517 if (psms->ptiSender->TIF_flags & TIF_16BIT) { 02518 DirectedScheduleTask(psms->ptiReceiver, psms->ptiSender, FALSE, psms); 02519 } 02520 } }

VOID ClearWakeBit PTHREADINFO  pti,
UINT  wWakeBit,
BOOL  fSysCheck
 

Definition at line 4700 of file queue.c.

References tagMLIST::cMsgs, FJOURNALPLAYBACK, tagCLIENTTHREADINFO::fsWakeBits, tagQ::mlInput, tagTHREADINFO::pcti, tagTHREADINFO::pq, tagQ::QF_flags, QF_MOUSEMOVED, and VOID().

Referenced by xxxDesktopThread(), and xxxScanSysQueue().

04704 { 04705 04706 /* 04707 * If fSysCheck is TRUE, clear bits only if we are not doing journal 04708 * playback and there are no more messages in the queue. fSysCheck 04709 * is TRUE if clearing because of no more input. FALSE if just 04710 * transfering input ownership from one thread to another. 04711 */ 04712 if (fSysCheck) { 04713 if (pti->pq->mlInput.cMsgs != 0 || FJOURNALPLAYBACK()) 04714 return; 04715 if (pti->pq->QF_flags & QF_MOUSEMOVED) 04716 wWakeBit &= ~QS_MOUSEMOVE; 04717 } 04718 04719 /* 04720 * Only clear the wake bits, not the change bits as well! 04721 */ 04722 pti->pcti->fsWakeBits &= ~wWakeBit; 04723 }

VOID ClearWakeMask VOID   ) 
 

Definition at line 5223 of file queue.c.

References PtiCurrent, and VOID().

05224 { 05225 PtiCurrent()->pcti->fsWakeMask = 0; 05226 }

VOID ClearWindowState PWND  pwnd,
DWORD  flags
 

Definition at line 102 of file w32/ntuser/kernel/random.c.

References ClrWF, dwFlags, GETPTI, PtiCurrent, and ValidateState().

Referenced by AnimateWindow(), ButtonWndProcWorker(), CalcClientScrolling(), CBNcCreateHandler(), DefDlgProcWorker(), DefFrameProcWorker(), ECNcCreate(), ECSetPasswordChar(), EditWndProc(), MDIAddSysMenu(), MDIClientWndProcWorker(), and MLCreate().

00105 { 00106 /* 00107 * Don't let anyone mess with someone else's window 00108 */ 00109 if (GETPTI(pwnd)->ppi == PtiCurrent()->ppi) { 00110 if (ValidateState(dwFlags)) { 00111 ClrWF(pwnd, dwFlags); 00112 } else { 00113 RIPMSG1(RIP_ERROR, "SetWindowState: invalid flag %x", dwFlags); 00114 } 00115 } else { 00116 RIPMSG1(RIP_WARNING, "ClearWindowState: current ppi doesn't own pwnd %#p", pwnd); 00117 } 00118 00119 }

VOID ClientDeliverUserApc VOID   ) 
 

Referenced by xxxPollAndWaitForSingleObject(), xxxSleepTask(), and xxxSleepThread().

void ClientDied void   ) 
 

BOOL ClientExitProcess PFNW32ET  pfn,
DWORD  dwExitCode
 

VOID ClientFontSweep VOID   ) 
 

Referenced by CreateTerminalInput().

BOOL ClientFreeLibrary HANDLE  hmod  ) 
 

Referenced by xxxDoSysExpunge(), and xxxLoadHmodIndex().

DWORD ClientGetListboxString PWND  hwnd,
UINT  msg,
WPARAM  wParam,
PVOID  lParam,
ULONG_PTR  xParam,
PROC  xpfn,
DWORD  dwSCMSFlags,
BOOL  bNotString,
PSMS  psms
 

Referenced by SfnOUTCBOXSTRING(), and SfnOUTLBOXSTRING().

BOOL ClientGrayString GRAYSTRINGPROC  pfnOutProc,
HDC  hdc,
DWORD  lpData,
int  nCount
 

BOOL ClientImmLoadLayout HKL  ,
PIMEINFOEX 
 

Referenced by xxxImmLoadLayout().

DWORD ClientImmProcessKey HWND  ,
HKL  ,
UINT  ,
LPARAM  ,
DWORD 
 

Referenced by xxxImmProcessKey().

HANDLE ClientLoadLibrary PUNICODE_STRING  pstrLib,
BOOL  bWx86KnownDll
 

Referenced by xxxLoadHmodIndex().

VOID ClientLoadLocalT1Fonts  ) 
 

Referenced by xxxLW_LoadFonts().

VOID ClientLoadRemoteT1Fonts  ) 
 

Referenced by xxxLW_LoadFonts().

VOID ClientNoMemoryPopup VOID   ) 
 

Referenced by xxxSnapWindow().

NTSTATUS ClientThreadSetup VOID   ) 
 

Definition at line 1219 of file clinit.c.

References BOOL, ButtonWndProcA(), ButtonWndProcW(), ButtonWndProcWorker(), CheckBadApp(), _CLIENTINFO::CI_flags, CI_INITIALIZED, CI_REGISTERCLASSES, ComboBoxWndProcA(), ComboBoxWndProcW(), ComboBoxWndProcWorker(), ComboListBoxWndProcA(), ComboListBoxWndProcW(), DefDlgProcA(), DefDlgProcW(), DefDlgProcWorker(), DESKTOPINFO, DesktopWndProcA(), DesktopWndProcW(), DispatchClientMessage(), DispatchHookA(), DispatchHookW(), _USERCONNECT::dwDispatchCount, DWORD, EditWndProcA(), EditWndProcW(), EditWndProcWorker(), FALSE, fnHkINLPCWPRETSTRUCTA(), fnHkINLPCWPRETSTRUCTW(), fnHkINLPCWPSTRUCTA(), fnHkINLPCWPSTRUCTW(), gcsAccelCache, GdiProcessSetup(), gDispatchTableValues, gdwLpkEntryPoints, GetClientInfo, gfFirstThread, gfServerProcess, gfSystemInitialized, ghbrBlack, ghbrWhite, ghdcBits2, gpsi, gSharedInfo, hmodUser, tagMSG_TABLE_ENTRY::iFunction, ImeWndProcA(), ImeWndProcW(), ImeWndProcWorker(), InitClientDrawing(), InitOemXlateTables(), INT, ListBoxWndProcA(), ListBoxWndProcW(), ListBoxWndProcWorker(), LoadAppDlls(), LoadCursorsAndIcons(), MB_DlgProcA(), MB_DlgProcW(), MDIActivateDlgProcA(), MDIActivateDlgProcW(), MDIClientWndProcA(), MDIClientWndProcW(), MDIClientWndProcWorker(), MenuWndProcA(), MenuWndProcW(), MessageTable, NT_SUCCESS, NTSTATUS(), NtUserCallNoParam(), NtUserCallOneParam(), NtUserGetThreadDesktop(), NtUserInitializeClientPfnArrays(), NtUserProcessConnect(), NULL, pdiLocal, _PFNCLIENTWORKER::pfnButtonWndProc, _PFNCLIENT::pfnButtonWndProc, pfnClientA, pfnClientW, pfnClientWorker, _PFNCLIENTWORKER::pfnComboBoxWndProc, _PFNCLIENT::pfnComboBoxWndProc, _PFNCLIENTWORKER::pfnComboListBoxProc, _PFNCLIENT::pfnComboListBoxProc, _PFNCLIENT::pfnDefWindowProc, _PFNCLIENT::pfnDesktopWndProc, _PFNCLIENTWORKER::pfnDialogWndProc, _PFNCLIENT::pfnDialogWndProc, _PFNCLIENT::pfnDispatchHook, _PFNCLIENT::pfnDispatchMessage, _PFNCLIENTWORKER::pfnEditWndProc, _PFNCLIENT::pfnEditWndProc, _PFNCLIENT::pfnHkINLPCWPRETSTRUCT, _PFNCLIENT::pfnHkINLPCWPSTRUCT, _PFNCLIENTWORKER::pfnImeWndProc, _PFNCLIENT::pfnImeWndProc, _PFNCLIENTWORKER::pfnListBoxWndProc, _PFNCLIENT::pfnListBoxWndProc, _PFNCLIENT::pfnMB_DlgProc, _PFNCLIENT::pfnMDIActivateDlgProc, _PFNCLIENTWORKER::pfnMDIClientWndProc, _PFNCLIENT::pfnMDIClientWndProc, _PFNCLIENT::pfnMenuWndProc, _PFNCLIENT::pfnScrollBarWndProc, _PFNCLIENTWORKER::pfnStaticWndProc, _PFNCLIENT::pfnStaticWndProc, _PFNCLIENT::pfnTitleWndProc, tagSHAREDINFO::psi, RW_RegisterControls(), RW_RegisterDDEML(), ScrollBarWndProcA(), ScrollBarWndProcW(), _USERCONNECT::siClient, StaticWndProcA(), StaticWndProcW(), StaticWndProcWorker(), Status, TRUE, _USERCONNECT::ulVersion, and USERCURRENTVERSION.

Referenced by xxxCreateThreadInfo().

01220 { 01221 PCLIENTINFO pci; 01222 BOOL fFirstThread; 01223 DWORD ConnectState; 01224 01225 #ifdef TRACE_THREAD_INIT 01226 KdPrint(("USER32: ClientThreadSetup (pteb: %#p)\n", NtCurrentTeb())); 01227 #endif 01228 01229 /* 01230 * BUG 268642: Only the first thread calls GdiProcessSetup but all the other 01231 * threads must wait until the setup for GDI is finished. 01232 * 01233 * We can safely use gcsAccelCache critical section to protect this (even 01234 * though the name is not intuitive at all) 01235 */ 01236 01237 RtlEnterCriticalSection(&gcsAccelCache); 01238 01239 fFirstThread = gfFirstThread; 01240 01241 /* 01242 * setup GDI before continuing 01243 */ 01244 if (fFirstThread) { 01245 gfFirstThread = FALSE; 01246 GdiProcessSetup(); 01247 } 01248 01249 RtlLeaveCriticalSection(&gcsAccelCache); 01250 01251 /* 01252 * We've already checked to see if we need to connect 01253 * (i.e. NtCurrentTeb()->Win32ThreadInfo == NULL) This routine 01254 * just does the connecting. If we've already been through here 01255 * once, don't do it again. 01256 */ 01257 pci = GetClientInfo(); 01258 if (pci->CI_flags & CI_INITIALIZED) { 01259 RIPMSG0(RIP_ERROR, "Already initialized!"); 01260 return FALSE; 01261 } 01262 01263 /* 01264 * Create the queue info and thread info. Only once for this process do 01265 * we pass client side addresses to the server (for server callbacks). 01266 */ 01267 if (gfServerProcess && fFirstThread) { 01268 01269 USERCONNECT userconnect; 01270 NTSTATUS Status; 01271 01272 /* 01273 * We know that the shared info is now available in 01274 * the kernel. Map it into the server process. 01275 */ 01276 userconnect.ulVersion = USERCURRENTVERSION; 01277 userconnect.dwDispatchCount = gDispatchTableValues; 01278 Status = NtUserProcessConnect(NtCurrentProcess(), 01279 &userconnect, 01280 sizeof(USERCONNECT)); 01281 if (!NT_SUCCESS(Status)) 01282 return FALSE; 01283 01284 gSharedInfo = userconnect.siClient; 01285 gpsi = gSharedInfo.psi; 01286 UserAssert(gpsi); 01287 01288 UserAssert(pfnClientA.pfnScrollBarWndProc == (KPROC)ScrollBarWndProcA); 01289 UserAssert(pfnClientA.pfnTitleWndProc == (KPROC)DefWindowProcA); 01290 UserAssert(pfnClientA.pfnMenuWndProc == (KPROC)MenuWndProcA); 01291 UserAssert(pfnClientA.pfnDesktopWndProc == (KPROC)DesktopWndProcA); 01292 UserAssert(pfnClientA.pfnDefWindowProc == (KPROC)DefWindowProcA); 01293 UserAssert(pfnClientA.pfnHkINLPCWPSTRUCT == (KPROC)fnHkINLPCWPSTRUCTA); 01294 UserAssert(pfnClientA.pfnHkINLPCWPRETSTRUCT == (KPROC)fnHkINLPCWPRETSTRUCTA); 01295 UserAssert(pfnClientA.pfnButtonWndProc == (KPROC)ButtonWndProcA); 01296 UserAssert(pfnClientA.pfnComboBoxWndProc == (KPROC)ComboBoxWndProcA); 01297 UserAssert(pfnClientA.pfnComboListBoxProc == (KPROC)ComboListBoxWndProcA); 01298 UserAssert(pfnClientA.pfnDialogWndProc == (KPROC)DefDlgProcA); 01299 UserAssert(pfnClientA.pfnEditWndProc == (KPROC)EditWndProcA); 01300 UserAssert(pfnClientA.pfnListBoxWndProc == (KPROC)ListBoxWndProcA); 01301 UserAssert(pfnClientA.pfnMB_DlgProc == (KPROC)MB_DlgProcA); 01302 UserAssert(pfnClientA.pfnMDIActivateDlgProc == (KPROC)MDIActivateDlgProcA); 01303 UserAssert(pfnClientA.pfnMDIClientWndProc == (KPROC)MDIClientWndProcA); 01304 UserAssert(pfnClientA.pfnStaticWndProc == (KPROC)StaticWndProcA); 01305 UserAssert(pfnClientA.pfnDispatchHook == (KPROC)DispatchHookA); 01306 UserAssert(pfnClientA.pfnDispatchMessage == (KPROC)DispatchClientMessage); 01307 UserAssert(pfnClientA.pfnImeWndProc == (KPROC)ImeWndProcA); 01308 01309 UserAssert(pfnClientW.pfnScrollBarWndProc == (KPROC)ScrollBarWndProcW); 01310 UserAssert(pfnClientW.pfnTitleWndProc == (KPROC)DefWindowProcW); 01311 UserAssert(pfnClientW.pfnMenuWndProc == (KPROC)MenuWndProcW); 01312 UserAssert(pfnClientW.pfnDesktopWndProc == (KPROC)DesktopWndProcW); 01313 UserAssert(pfnClientW.pfnDefWindowProc == (KPROC)DefWindowProcW); 01314 UserAssert(pfnClientW.pfnHkINLPCWPSTRUCT == (KPROC)fnHkINLPCWPSTRUCTW); 01315 UserAssert(pfnClientW.pfnHkINLPCWPRETSTRUCT == (KPROC)fnHkINLPCWPRETSTRUCTW); 01316 UserAssert(pfnClientW.pfnButtonWndProc == (KPROC)ButtonWndProcW); 01317 UserAssert(pfnClientW.pfnComboBoxWndProc == (KPROC)ComboBoxWndProcW); 01318 UserAssert(pfnClientW.pfnComboListBoxProc == (KPROC)ComboListBoxWndProcW); 01319 UserAssert(pfnClientW.pfnDialogWndProc == (KPROC)DefDlgProcW); 01320 UserAssert(pfnClientW.pfnEditWndProc == (KPROC)EditWndProcW); 01321 UserAssert(pfnClientW.pfnListBoxWndProc == (KPROC)ListBoxWndProcW); 01322 UserAssert(pfnClientW.pfnMB_DlgProc == (KPROC)MB_DlgProcW); 01323 UserAssert(pfnClientW.pfnMDIActivateDlgProc == (KPROC)MDIActivateDlgProcW); 01324 UserAssert(pfnClientW.pfnMDIClientWndProc == (KPROC)MDIClientWndProcW); 01325 UserAssert(pfnClientW.pfnStaticWndProc == (KPROC)StaticWndProcW); 01326 UserAssert(pfnClientW.pfnDispatchHook == (KPROC)DispatchHookW); 01327 UserAssert(pfnClientW.pfnDispatchMessage == (KPROC)DispatchClientMessage); 01328 UserAssert(pfnClientW.pfnImeWndProc == (KPROC)ImeWndProcW); 01329 01330 UserAssert(pfnClientWorker.pfnButtonWndProc == (KPROC)ButtonWndProcWorker); 01331 UserAssert(pfnClientWorker.pfnComboBoxWndProc == (KPROC)ComboBoxWndProcWorker); 01332 UserAssert(pfnClientWorker.pfnComboListBoxProc == (KPROC)ListBoxWndProcWorker); 01333 UserAssert(pfnClientWorker.pfnDialogWndProc == (KPROC)DefDlgProcWorker); 01334 UserAssert(pfnClientWorker.pfnEditWndProc == (KPROC)EditWndProcWorker); 01335 UserAssert(pfnClientWorker.pfnListBoxWndProc == (KPROC)ListBoxWndProcWorker); 01336 UserAssert(pfnClientWorker.pfnMDIClientWndProc == (KPROC)MDIClientWndProcWorker); 01337 UserAssert(pfnClientWorker.pfnStaticWndProc == (KPROC)StaticWndProcWorker); 01338 UserAssert(pfnClientWorker.pfnImeWndProc == (KPROC)ImeWndProcWorker); 01339 01340 #if DBG 01341 { 01342 PULONG_PTR pdw; 01343 01344 /* 01345 * Make sure that everyone got initialized 01346 */ 01347 for (pdw = (PULONG_PTR)&pfnClientA; 01348 (ULONG_PTR)pdw<(ULONG_PTR)(&pfnClientA) + sizeof(pfnClientA); 01349 pdw++) { 01350 UserAssert(*pdw); 01351 } 01352 01353 for (pdw = (PULONG_PTR)&pfnClientW; 01354 (ULONG_PTR)pdw<(ULONG_PTR)(&pfnClientW) + sizeof(pfnClientW); 01355 pdw++) { 01356 UserAssert(*pdw); 01357 } 01358 } 01359 #endif 01360 01361 #if DBG 01362 { 01363 extern CONST INT gcapfnScSendMessage; 01364 BOOLEAN apfnCheckMessage[64]; 01365 int i; 01366 01367 /* 01368 * Do some verification of the message table. Since we only have 01369 * 6 bits to store the function index, the function table can have 01370 * at most 64 entries. Also verify that none of the indexes point 01371 * past the end of the table and that all the function entries 01372 * are used. 01373 */ 01374 UserAssert(gcapfnScSendMessage <= 64); 01375 RtlZeroMemory(apfnCheckMessage, sizeof(apfnCheckMessage)); 01376 for (i = 0; i < WM_USER; i++) { 01377 UserAssert(MessageTable[i].iFunction < gcapfnScSendMessage); 01378 apfnCheckMessage[MessageTable[i].iFunction] = TRUE; 01379 } 01380 01381 for (i = 0; i < gcapfnScSendMessage; i++) { 01382 UserAssert(apfnCheckMessage[i]); 01383 } 01384 } 01385 #endif 01386 01387 } 01388 01389 /* 01390 * Pass the function pointer arrays to the kernel. This also establishes 01391 * the kernel state for the thread. If ClientThreadSetup is called from 01392 * CsrConnectToUser this call will raise an exception if the thread 01393 * cannot be converted to a gui thread. The exception is handled in 01394 * CsrConnectToUser. 01395 */ 01396 #if DBG && !defined(BUILD_WOW6432) 01397 /* 01398 * On debug systems, go to the kernel for all processes to verify we're 01399 * loading user32.dll at the right address. 01400 */ 01401 if (fFirstThread) { 01402 #elif defined(BUILD_WOW6432) 01403 /* 01404 * On WOW64 allways register the client fns 01405 */ 01406 { 01407 #else 01408 if (gfServerProcess && fFirstThread) { 01409 #endif 01410 if (!NT_SUCCESS(NtUserInitializeClientPfnArrays(&pfnClientA, &pfnClientW, &pfnClientWorker, hmodUser))) { 01411 01412 RIPERR0(ERROR_OUTOFMEMORY, 01413 RIP_WARNING, 01414 "NtUserInitializeClientPfnArrays failed"); 01415 01416 return FALSE; 01417 } 01418 } 01419 01420 /* 01421 * Mark this thread as being initialized. If the connection to 01422 * the server fails, NtCurrentTeb()->Win32ThreadInfo will remain 01423 * NULL. 01424 */ 01425 pci->CI_flags |= CI_INITIALIZED; 01426 01427 /* 01428 * Some initialization only has to occur once per process 01429 */ 01430 if (fFirstThread) { 01431 01432 ConnectState = (DWORD)NtUserCallNoParam(SFI_REMOTECONNECTSTATE); 01433 01434 /* 01435 * Winstation Winlogon and CSR must do graphics initialization 01436 * after the connect. 01437 */ 01438 01439 if (ConnectState != CTX_W32_CONNECT_STATE_IDLE) { 01440 01441 if ((ghdcBits2 = CreateCompatibleDC(NULL)) == NULL) { 01442 RIPERR0(ERROR_OUTOFMEMORY, RIP_WARNING, "ghdcBits2 creation failed"); 01443 return FALSE; 01444 } 01445 01446 /* 01447 * Get things we need from Gdi. 01448 */ 01449 if (ghbrWhite == NULL) 01450 ghbrWhite = GetStockObject(WHITE_BRUSH); 01451 01452 if (ghbrBlack == NULL) 01453 ghbrBlack = GetStockObject(BLACK_BRUSH); 01454 01455 InitClientDrawing(); 01456 } 01457 01458 gfSystemInitialized = NtUserGetThreadDesktop(GetCurrentThreadId(), 01459 NULL) != NULL; 01460 01461 /* 01462 * If an lpk is loaded for this process notify the kernel 01463 */ 01464 if (gdwLpkEntryPoints) { 01465 NtUserCallOneParam(gdwLpkEntryPoints, SFI_REGISTERLPK); 01466 } 01467 01468 if (gfServerProcess || (GetClientInfo()->pDeskInfo == NULL)) { 01469 01470 /* 01471 * Perform any server initialization. 01472 */ 01473 UserAssert(gpsi); 01474 01475 if (pdiLocal = LocalAlloc(LPTR, sizeof(DESKTOPINFO))) { 01476 01477 GetClientInfo()->pDeskInfo = pdiLocal; 01478 01479 } else { 01480 01481 RIPERR0(ERROR_OUTOFMEMORY, RIP_WARNING, "pdiLocal creation failed"); 01482 01483 return FALSE; 01484 } 01485 } 01486 01487 if (gfServerProcess) { 01488 /* 01489 * Winstation Winlogon and CSR must do graphics initialization 01490 * after the connect. 01491 */ 01492 if (ConnectState != CTX_W32_CONNECT_STATE_IDLE) { 01493 if (!LoadCursorsAndIcons()) { 01494 RIPERR0(ERROR_OUTOFMEMORY, RIP_WARNING, "LoadCursorsAndIcons failed"); 01495 return FALSE; 01496 } 01497 } 01498 01499 InitOemXlateTables(); 01500 } 01501 01502 if ( ! CheckBadApp() ) { 01503 RIPERR0(ERROR_OUTOFMEMORY, RIP_WARNING, "Don't start app for server appliance"); 01504 return FALSE; 01505 } 01506 01507 LoadAppDlls(); 01508 } else if (gfServerProcess) { 01509 GetClientInfo()->pDeskInfo = pdiLocal; 01510 } 01511 01512 /* 01513 * Kernel sets CI_REGISTERCLASSES when appropriate (i.e. always 01514 * for the first thread and for other threads if the last GUI 01515 * thread for a process has exited) except for the CSR proces. 01516 * For the CSR process, you must register the classes on the 01517 * first thread anyways. 01518 */ 01519 01520 if (fFirstThread || (pci->CI_flags & CI_REGISTERCLASSES)) { 01521 01522 /* 01523 * If it's the first thread we already made it to the kernel 01524 * to get the ConnectState... 01525 */ 01526 if (!fFirstThread) { 01527 ConnectState = (DWORD)NtUserCallNoParam(SFI_REMOTECONNECTSTATE); 01528 } 01529 01530 if (ConnectState != CTX_W32_CONNECT_STATE_IDLE) { 01531 01532 /* 01533 * Register the control classes. 01534 */ 01535 RW_RegisterControls(); 01536 RW_RegisterDDEML(); 01537 } 01538 } 01539 01540 return TRUE; 01541 }

void ClipPointToDesktop LPPOINT  lppt  ) 
 

Definition at line 33 of file multimon.c.

References _MonitorFromPoint(), tagDISPLAYINFO::fDesktopIsRect, gpDispInfo, gpMonitorMouse, NULL, PtInRect(), and tagMONITOR::rcMonitor.

Referenced by BoundCursor().

00034 { 00035 PMONITOR pMonitor; 00036 00037 UserAssert(!gpDispInfo->fDesktopIsRect && 00038 "You shouldn't call this function if the desktop is a rectangle.\n" 00039 "Just clip to gpsi->rcScreen instead."); 00040 00041 /* 00042 * Optimization: The cursor is likely to be on the monitor it was last on, 00043 * so check for that case. 00044 */ 00045 if (gpMonitorMouse != NULL && PtInRect(&gpMonitorMouse->rcMonitor, *lppt)) { 00046 return; 00047 } 00048 00049 pMonitor = _MonitorFromPoint(*lppt, MONITOR_DEFAULTTONEAREST); 00050 00051 /* 00052 * Remember the monitor the cursor is on. 00053 */ 00054 gpMonitorMouse = pMonitor; 00055 00056 if (lppt->x < pMonitor->rcMonitor.left) { 00057 lppt->x = pMonitor->rcMonitor.left; 00058 } else if (lppt->x >= pMonitor->rcMonitor.right) { 00059 lppt->x = pMonitor->rcMonitor.right-1; 00060 } 00061 if (lppt->y < pMonitor->rcMonitor.top) { 00062 lppt->y = pMonitor->rcMonitor.top; 00063 } else if (lppt->y >= pMonitor->rcMonitor.bottom) { 00064 lppt->y = pMonitor->rcMonitor.bottom-1; 00065 } 00066 }

__inline NTSTATUS CloseProtectedHandle HANDLE  handle  ) 
 

Definition at line 7298 of file userk.h.

References BOOL, and VOID().

Referenced by DestroyProcessInfo(), InitiateWin32kCleanup(), NtUserOpenInputDesktop(), xxxCloseDesktop(), xxxCreateDesktop(), xxxCreateDisconnectDesktop(), xxxOpenDesktop(), xxxResolveDesktop(), xxxResolveDesktopForWOW(), xxxRestoreCsrssThreadDesktop(), and xxxSetCsrssThreadDesktop().

07309 {

VOID ClrFTrueVis PWND  pwnd  ) 
 

Definition at line 5495 of file swp.c.

References ClrWF, DecPaintCount(), DeleteMaybeSpecialRgn(), tagWND::hrgnUpdate, NEEDSPAINT, NULL, tagWND::spwndChild, tagWND::spwndNext, TestWF, VOID(), WFINTERNALPAINT, and WFVISIBLE.

Referenced by SetVisible(), and xxxMinMaximize().

05497 { 05498 /* 05499 * Destroy pwnd and its children's update regions. 05500 * We do this here to guarantee that a hidden window 05501 * and its children don't have update regions. 05502 * 05503 * This fixes bugs when destroying windows that have 05504 * update regions (SendDestroyMessages) among others 05505 * and allows us to simplify SetParent(). This was 05506 * deemed better than hacking DoPaint() and/or 05507 * DestroyWindow(). 05508 * 05509 * We can stop recursing when we find a window that doesn't 05510 * have the visible bit set, because by definition it won't 05511 * have any update regions below it (this routine will have been called) 05512 */ 05513 if (NEEDSPAINT(pwnd)) { 05514 05515 DeleteMaybeSpecialRgn(pwnd->hrgnUpdate); 05516 05517 ClrWF(pwnd, WFINTERNALPAINT); 05518 05519 pwnd->hrgnUpdate = NULL; 05520 DecPaintCount(pwnd); 05521 } 05522 05523 for (pwnd = pwnd->spwndChild; pwnd != NULL; pwnd = pwnd->spwndNext) { 05524 05525 /* 05526 * pwnd->fs &= ~WF_TRUEVIS; 05527 */ 05528 if (TestWF(pwnd, WFVISIBLE)) 05529 ClrFTrueVis(pwnd); 05530 } 05531 }

NTSTATUS CommitReadOnlyMemory HANDLE  hSection,
PSIZE_T  pulCommit,
DWORD  dwCommitOffset,
int *  pdCommit
 

Definition at line 278 of file ex.c.

References MmMapViewOfSection(), MmUnmapViewOfSection(), NT_SUCCESS, NTSTATUS(), NULL, PAGE_SIZE, PBYTE, PsGetCurrentProcess, and Status.

Referenced by HMGrowHandleTable(), HMInitHandleTable(), UserCommitDesktopMemory(), and UserCommitSharedMemory().

00283 { 00284 SIZE_T ulViewSize; 00285 LARGE_INTEGER liOffset; 00286 PEPROCESS Process; 00287 PVOID pUserBase, pvt; 00288 NTSTATUS Status; 00289 00290 ulViewSize = 0; 00291 pUserBase = NULL; 00292 liOffset.QuadPart = 0; 00293 Process = PsGetCurrentProcess(); 00294 00295 Status = MmMapViewOfSection( 00296 hSection, 00297 Process, 00298 &pUserBase, 00299 0, 00300 PAGE_SIZE, 00301 &liOffset, 00302 &ulViewSize, 00303 ViewUnmap, 00304 SEC_NO_CHANGE, 00305 PAGE_EXECUTE_READ); 00306 00307 if (NT_SUCCESS(Status)) { 00308 00309 /* 00310 * Commit the memory 00311 */ 00312 pUserBase = pvt = (PVOID)((PBYTE)pUserBase + dwCommitOffset); 00313 00314 Status = ZwAllocateVirtualMemory( 00315 NtCurrentProcess(), 00316 &pUserBase, 00317 0, 00318 pCommitSize, 00319 MEM_COMMIT, 00320 PAGE_EXECUTE_READ); 00321 00322 if (pdCommit) { 00323 *pdCommit = (int)((PBYTE)pUserBase - (PBYTE)pvt); 00324 } 00325 #if DBG 00326 else { 00327 UserAssert(pvt == pUserBase); 00328 } 00329 #endif 00330 00331 MmUnmapViewOfSection(Process, pUserBase); 00332 } 00333 return Status; 00334 }

__inline int ComputePastTickDelta IN DWORD  dwCurTick,
IN DWORD  dwLastTick
 

Definition at line 6972 of file userk.h.

Referenced by TimersProc(), and xxxPollAndWaitForSingleObject().

06976 { 06977 return (int) dwCurTick - dwLastTick; 06978 } 06979

__inline int ComputeTickDelta IN DWORD  dwCurTick,
IN DWORD  dwLastTick
 

Definition at line 6963 of file userk.h.

Referenced by zzzCalcStartCursorHide().

06976 {

BOOL CopyFromClient LPBYTE  lpByte,
LPBYTE  lpByteClient,
DWORD  cch,
BOOL  fString,
BOOL  fAnsi
 

BOOL CopyToClient LPBYTE  lpByte,
LPBYTE  lpByteClient,
DWORD  cchMax,
BOOL  fAnsi
 

BOOL CreateBitmapStrip VOID   ) 
 

Definition at line 494 of file inctlpan.c.

References BOOL, CCACHEDCAPTIONS, CreateCaptionStrip(), tagOEMBITMAPINFO::cx, tagOEMBITMAPINFO::cy, cy, DrawCaptionButtons(), DrawFrameControl(), FALSE, FillRect(), gcachedCaptions, GetFrameControlMetrics(), ghbmBits, ghbmCaption, gpDispInfo, gpsi, HDCBITS, tagDISPLAYINFO::hdcScreen, min, NULL, OBI_COUNT, OBI_MENUCHECK, PackFrameControls(), tagCAPTIONCACHE::pOem, tagCAPTIONCACHE::spcursor, sysBmpStyles, SYSHBR, SYSMET, szOneChar, TestALPHA, TRUE, UINT, Unlock, tagOEMBITMAPINFO::x, and tagOEMBITMAPINFO::y.

Referenced by xxxResetDisplayDevice(), xxxSetWindowNCMetrics(), and xxxSystemParametersInfo().

00495 { 00496 int cxBmp = 0; 00497 int cyBmp = 0; 00498 int iCache = 0; 00499 HBITMAP hOldBitmap; 00500 HBITMAP hNewBmp; 00501 UINT iType; 00502 RECT rc; 00503 UINT wBmpType; 00504 UINT wBmpStyle; 00505 POEMBITMAPINFO pOem; 00506 00507 /* 00508 * Each OBI_ must have an entry in sysBmpStyles 00509 */ 00510 UserAssert(OBI_COUNT == sizeof(sysBmpStyles) / sizeof(*sysBmpStyles)); 00511 UserAssert(OBI_COUNT == sizeof(gpsi->oembmi) / sizeof(*(gpsi->oembmi))); 00512 00513 /* 00514 * load all the bitmap dimensions into the OEMBITMAPINFO array oemInfo.bm 00515 */ 00516 for (iType = 0; iType < OBI_COUNT; iType++) 00517 cxBmp = GetFrameControlMetrics(iType, cxBmp); 00518 00519 for (iType = 0; iType < 5; iType++) 00520 cy[iType] = PackFrameControls(cxBmp * (iType + 1), FALSE) * (iType + 1); 00521 00522 cyBmp = min(cy[0], min(cy[1], min(cy[2], min(cy[3], cy[4])))); 00523 for (iType = 0; cyBmp != cy[iType]; iType++); 00524 00525 cxBmp *= iType + 1; 00526 cyBmp = PackFrameControls(cxBmp, TRUE); 00527 00528 hNewBmp = GreCreateCompatibleBitmap(gpDispInfo->hdcScreen, cxBmp, cyBmp); 00529 00530 if (hNewBmp == NULL) { 00531 RIPMSG0(RIP_WARNING, "CreateBitmapStrip: failed to create bitmap"); 00532 return FALSE; 00533 } 00534 00535 GreSetBitmapOwner(hNewBmp, OBJECT_OWNER_PUBLIC); 00536 00537 /* 00538 * Select in Bitmap Strip -- then delete old one if it exists 00539 * Yanked for Chicago since these can now be paged 00540 * GDIMoveBitmap(hNewBmp); 00541 */ 00542 hOldBitmap = GreSelectBitmap(HDCBITS(), hNewBmp); 00543 00544 if (ghbmBits) { 00545 #if DBG 00546 /* 00547 * Don't assert if we're out of memory 00548 */ 00549 if (hOldBitmap != NULL) { 00550 UserAssert(ghbmBits == hOldBitmap); 00551 } 00552 #endif 00553 GreDeleteObject(ghbmCaption); 00554 GreDeleteObject(hOldBitmap); 00555 } else { 00556 /* 00557 * hack to clear out display driver's font cache 00558 */ 00559 GreExtTextOutW(HDCBITS(), 0, 0, 0, NULL, (PWSTR)szOneChar, 1, NULL); 00560 } 00561 00562 ghbmBits = hNewBmp; 00563 00564 ghbmCaption = CreateCaptionStrip(); 00565 00566 if (ghbmCaption == NULL) { 00567 RIPMSG0(RIP_WARNING, "CreateBitmapStrip: failed to create bitmap for caption"); 00568 return FALSE; 00569 } 00570 00571 /* 00572 * draw individual bitmaps into the strip bitmap and record the offsets 00573 */ 00574 for (pOem = gpsi->oembmi, iType = 0; iType < OBI_COUNT; iType++, pOem++) { 00575 if (!pOem->cx) { 00576 *pOem = gpsi->oembmi[pOem->cy]; 00577 } else { 00578 rc.left = pOem->x; 00579 rc.top = pOem->y; 00580 rc.right = rc.left + pOem->cx; 00581 rc.bottom = rc.top + pOem->cy; 00582 00583 wBmpType = sysBmpStyles[iType][0]; 00584 wBmpStyle = sysBmpStyles[iType][1]; 00585 00586 if (wBmpType == DFC_CACHE) { 00587 if (wBmpStyle & DFCS_CACHEBUTTONS) { 00588 HBRUSH hbr; 00589 if (TestALPHA(GRADIENTCAPTIONS)) { 00590 hbr = (wBmpStyle & DFCS_INACTIVE) ? SYSHBR(GRADIENTINACTIVECAPTION) : SYSHBR(GRADIENTACTIVECAPTION); 00591 } else { 00592 hbr = (wBmpStyle & DFCS_INACTIVE) ? SYSHBR(INACTIVECAPTION) : SYSHBR(ACTIVECAPTION); 00593 } 00594 FillRect(HDCBITS(), &rc, hbr); 00595 DrawCaptionButtons(rc.left, rc.top); 00596 } else if (!(wBmpStyle & DFCS_INACTIVE)) { 00597 /* 00598 * Setup Caption Cache Entry 00599 */ 00600 UserAssert(iCache < CCACHEDCAPTIONS); 00601 if (gcachedCaptions[iCache].spcursor) { 00602 Unlock(&(gcachedCaptions[iCache].spcursor)); 00603 } 00604 gcachedCaptions[iCache++].pOem = pOem; 00605 } 00606 } else { 00607 DrawFrameControl(HDCBITS(), &rc, wBmpType, wBmpStyle); 00608 } 00609 } 00610 } 00611 00612 /* 00613 * Setup other frame metric dependent values. 00614 */ 00615 SYSMET(CXMENUCHECK) = gpsi->oembmi[OBI_MENUCHECK].cx; 00616 SYSMET(CYMENUCHECK) = gpsi->oembmi[OBI_MENUCHECK].cy; 00617 00618 return TRUE; 00619 }

HDC CreateCacheDC PWND  ,
DWORD  ,
PMONITOR 
 

Definition at line 1463 of file dc.c.

References AnySpbs, CFCLASSDC, DCE, tagDCE::DCX_flags, FALSE, gpDispInfo, tagDCE::hdc, tagMONITOR::hDev, tagDISPLAYINFO::hDev, tagDCE::hrgnClip, tagDCE::hrgnClipPublic, tagDCE::hrgnSavedVis, IncrementFreeDCECount(), InvalidateDce(), NULL, tagWND::pcls, tagCLS::pdce, tagDISPLAYINFO::pdceFirst, tagDCE::pdceNext, tagDCE::pMonitor, PtiCurrent, tagDCE::ptiOwner, tagDCE::pwndClip, tagDCE::pwndOrg, and TestCF.

Referenced by _GetDCEx(), GetMonitorDC(), InitUserScreen(), and xxxCreateWindowEx().

01468 { 01469 PDCE pdce; 01470 HDC hdc; 01471 HANDLE hDev; 01472 01473 if ((pdce = (PDCE)UserAllocPool(sizeof(DCE), TAG_DCE)) == NULL) 01474 return NULL; 01475 01476 if (pMonitor == NULL) { 01477 hDev = gpDispInfo->hDev; 01478 } else { 01479 hDev = pMonitor->hDev; 01480 } 01481 01482 if ((hdc = GreCreateDisplayDC(hDev, DCTYPE_DIRECT, FALSE)) == NULL) { 01483 UserFreePool(pdce); 01484 return NULL; 01485 } 01486 01487 /* 01488 * Link this entry into the cache entry list. 01489 */ 01490 pdce->pdceNext = gpDispInfo->pdceFirst; 01491 gpDispInfo->pdceFirst = pdce; 01492 01493 pdce->hdc = hdc; 01494 pdce->DCX_flags = DCX_flags; 01495 pdce->pwndOrg = pwndOrg; 01496 pdce->pwndClip = pwndOrg; 01497 pdce->hrgnClip = NULL; 01498 pdce->hrgnClipPublic = NULL; 01499 pdce->hrgnSavedVis = NULL; 01500 pdce->pMonitor = pMonitor; 01501 01502 /* 01503 * Mark it as undeleteable so no application can delete it out of our 01504 * cache! 01505 */ 01506 GreMarkUndeletableDC(hdc); 01507 01508 if (DCX_flags & DCX_OWNDC) { 01509 01510 /* 01511 * Set the ownership of owndcs immediately: that way console can set 01512 * the owernship to PUBLIC when it calls GetDC so that both the input 01513 * thread and the service threads can use the same owndc. 01514 */ 01515 GreSetDCOwner(hdc, OBJECT_OWNER_CURRENT); 01516 pdce->ptiOwner = PtiCurrent(); 01517 01518 } else { 01519 01520 /* 01521 * Otherwise it is a cache dc... set its owner to none - nothing 01522 * is using it - equivalent of "being in the cache" but unaccessible 01523 * to other processes. 01524 */ 01525 GreSetDCOwner(hdc, OBJECT_OWNER_NONE); 01526 pdce->ptiOwner = NULL; 01527 01528 /* 01529 * Increment the available-cacheDC count. Once this hits our 01530 * threshold, then we can free-up some of the entries. 01531 */ 01532 IncrementFreeDCECount(); 01533 } 01534 01535 /* 01536 * If we're creating a permanent DC, then compute it now. 01537 */ 01538 if (!(DCX_flags & DCX_CACHE)) { 01539 01540 /* 01541 * Set up the class DC now... 01542 */ 01543 if (TestCF(pwndOrg, CFCLASSDC)) 01544 pwndOrg->pcls->pdce = pdce; 01545 01546 /* 01547 * Finish setting up DCE and force eventual visrgn calculation. 01548 */ 01549 UserAssert(!(DCX_flags & DCX_WINDOW)); 01550 01551 pdce->DCX_flags |= DCX_INUSE; 01552 01553 InvalidateDce(pdce); 01554 } 01555 01556 /* 01557 * If there are any spb's around then enable bounds accumulation. 01558 */ 01559 if (AnySpbs()) 01560 GreGetBounds(pdce->hdc, NULL, DCB_ENABLE | DCB_SET | DCB_WINDOWMGR); 01561 01562 return pdce->hdc; 01563 }

HBITMAP CreateCaptionStrip  ) 
 

Referenced by CreateBitmapStrip(), xxxAnimateCaption(), and xxxResetDisplayDevice().

HDC CreateCompatiblePublicDC HDC  hdc,
HBITMAP *  pbmDCGray
 

Definition at line 40 of file mngray.c.

References tagDISPLAYINFO::cxGray, cy, ghbmBits, ghFontSys, gpDispInfo, GreGetTextAlign(), GreSetTextAlign(), HDCBITS, tagDISPLAYINFO::hdcGray, and NULL.

00043 { 00044 HDC hdcCompatible = 0; 00045 HBITMAP hbmCompatible; 00046 HFONT hFont; 00047 int cx,cy; 00048 00049 if ((hdcPublic != gpDispInfo->hdcGray) && (hdcPublic != HDCBITS())) { 00050 return hdcPublic; 00051 } 00052 00053 if ((hdcCompatible = GreCreateCompatibleDC(hdcPublic)) == NULL) { 00054 RIPMSG1(RIP_WARNING, "CreateCompatiblePublicDC: GreCreateCompatibleDC Failed %lX", hdcPublic); 00055 return (HDC)NULL; 00056 } 00057 if (!GreSetDCOwner(hdcCompatible, OBJECT_OWNER_CURRENT)) { 00058 RIPMSG1(RIP_WARNING, "CreateCompatiblePublicDC: SetDCOwner Failed %lX", hdcCompatible); 00059 GreDeleteDC(hdcCompatible); 00060 return (HDC)NULL; 00061 } 00062 00063 if (hdcPublic == gpDispInfo->hdcGray) { 00064 cx = gpDispInfo->cxGray; 00065 cy = gpDispInfo->cxGray; 00066 } else { 00067 if (hdcPublic == HDCBITS()) { 00068 BITMAP bmBits; 00069 00070 GreExtGetObjectW(ghbmBits, sizeof(BITMAP), &bmBits); 00071 cx = bmBits.bmWidth; 00072 cy = bmBits.bmHeight; 00073 } else { 00074 00075 // 00076 // We should not reach here. 00077 // 00078 RIPMSG1(RIP_ERROR, "CreateCompatiblePublicDC: GreCreateCompatibleDC Failed %lX", hdcPublic); 00079 } 00080 00081 } 00082 00083 hbmCompatible = GreCreateCompatibleBitmap(hdcPublic, 00084 cx, 00085 cy); 00086 00087 // 00088 // Check whether bitmap couldn't be created or can't 00089 // be set to OBJECT_OWNER_CURRENT, then fail and 00090 // do necessary cleanup now! 00091 // 00092 00093 if( (hbmCompatible == NULL) || 00094 (!GreSetBitmapOwner(hbmCompatible, OBJECT_OWNER_CURRENT)) ) { 00095 00096 RIPMSG1(RIP_WARNING, "CreateCompatiblePublicDC: GreCreateCompatibleBitmap Failed %lX", hbmCompatible); 00097 GreDeleteDC( hdcCompatible ); 00098 00099 if( hbmCompatible ) { 00100 GreDeleteObject( hbmCompatible ); 00101 } 00102 00103 return (HDC)NULL; 00104 } 00105 00106 GreSelectBitmap(hdcCompatible, hbmCompatible); 00107 /* 00108 * Make sure we use the same font and text alignment. 00109 */ 00110 hFont = GreSelectFont(hdcPublic, ghFontSys); 00111 GreSelectFont(hdcPublic, hFont); 00112 GreSelectFont(hdcCompatible, hFont); 00113 GreSetTextAlign(hdcCompatible, GreGetTextAlign(hdcPublic)); 00114 /* 00115 * Copy any information already written into G_TERM(pDispInfo)->hdcGray. 00116 */ 00117 00118 #ifdef USE_MIRRORING 00119 // 00120 // Mirror the created DC if the hdcGray is currently mirrored, 00121 // so that TextOut won't get mirrored on User Client DCs 00122 // 00123 if (GreGetLayout(hdcPublic) & LAYOUT_RTL) 00124 GreSetLayout(hdcCompatible, cx - 1, LAYOUT_RTL); 00125 #endif 00126 GreBitBlt(hdcCompatible, 0, 0, cx, cy, hdcPublic, 0, 0, SRCCOPY, 0); 00127 00128 *pbmPublicDC = hbmCompatible ; // for later deletion, by the server side 00129 00130 return hdcCompatible; 00131 }

HANDLE CreateDesktopHeap PWIN32HEAP *  ppheapRet,
ULONG  ulHeapSize
 

Definition at line 2696 of file desktop.c.

References Error, NT_SUCCESS, NTSTATUS(), NULL, Status, UserCommitDesktopMemory(), and UserCreateHeap().

Referenced by xxxCreateDesktop2().

02699 { 02700 HANDLE hsection; 02701 LARGE_INTEGER SectionSize; 02702 SIZE_T ulViewSize; 02703 NTSTATUS Status; 02704 PWIN32HEAP pheap; 02705 PVOID pHeapBase; 02706 02707 /* 02708 * Create desktop heap section and map it into the kernel 02709 */ 02710 SectionSize.QuadPart = ulHeapSize; 02711 02712 Status = Win32CreateSection(&hsection, 02713 SECTION_ALL_ACCESS, 02714 (POBJECT_ATTRIBUTES)NULL, 02715 &SectionSize, 02716 PAGE_EXECUTE_READWRITE, 02717 SEC_RESERVE, 02718 (HANDLE)NULL, 02719 NULL, 02720 TAG_SECTION_DESKTOP); 02721 02722 if (!NT_SUCCESS( Status )) { 02723 RIPNTERR0(Status, RIP_WARNING, "Can't create section for desktop heap."); 02724 return NULL; 02725 } 02726 02727 ulViewSize = ulHeapSize; 02728 pHeapBase = NULL; 02729 02730 Status = Win32MapViewInSessionSpace(hsection, &pHeapBase, &ulViewSize); 02731 02732 if (!NT_SUCCESS(Status)) { 02733 RIPNTERR0(Status, 02734 RIP_WARNING, 02735 "Can't map section for desktop heap into system space."); 02736 goto Error; 02737 } 02738 02739 /* 02740 * Create desktop heap. 02741 */ 02742 if ((pheap = UserCreateHeap( 02743 hsection, 02744 0, 02745 pHeapBase, 02746 ulHeapSize, 02747 UserCommitDesktopMemory)) == NULL) { 02748 02749 RIPERR0(ERROR_NOT_ENOUGH_MEMORY, RIP_WARNING, "Can't create Desktop heap."); 02750 02751 Win32UnmapViewInSessionSpace(pHeapBase); 02752 Error: 02753 Win32DestroySection(hsection); 02754 *ppheapRet = NULL; 02755 return NULL; 02756 } 02757 02758 UserAssert(Win32HeapGetHandle(pheap) == pHeapBase); 02759 *ppheapRet = pheap; 02760 02761 return hsection; 02762 }

PDEVICEINFO CreateDeviceInfo DWORD  DeviceType,
PUNICODE_STRING  SymbolicLinkName,
BYTE  bFlags
 

Definition at line 406 of file w32/ntuser/kernel/pnp.c.

References aDeviceTemplate, BEGINATOMICCHECK, BYTE, CheckCritIn, CreateKernelEvent(), DEVICE_TYPE_MAX, ENDATOMICCHECK, EnterDeviceInfoListCrit(), EXITATOMICCHECK, FALSE, GDIAF_ARRIVED, gpDeviceInfoList, LeaveDeviceInfoListCrit(), NULL, RequestDeviceChange(), RtlCopyUnicodeString(), and TRUE.

Referenced by DeviceClassNotify(), OpenMultiplePortDevice(), and RawInputThread().

00407 { 00408 PDEVICEINFO pDeviceInfo = NULL; 00409 00410 CheckCritIn(); 00411 BEGINATOMICCHECK(); 00412 00413 UserAssert(pustrName != NULL); 00414 00415 TAGMSG3(DBGTAG_PNP, "CreateDeviceInfo(%d, %S, %x)", DeviceType, pustrName->Buffer, bFlags); 00416 00417 if (DeviceType > DEVICE_TYPE_MAX) { 00418 RIPMSG1(RIP_ERROR, "Unknown DeviceType %lx", DeviceType); 00419 } 00420 00421 pDeviceInfo = UserAllocPoolZInit(aDeviceTemplate[DeviceType].cbDeviceInfo, TAG_PNP); 00422 if (pDeviceInfo == NULL) { 00423 RIPMSG0(RIP_WARNING, "CreateDeviceInfo() out of memory allocating DEVICEINFO"); 00424 EXITATOMICCHECK(); 00425 return NULL; 00426 } 00427 00428 if (pustrName->Buffer != NULL) { 00429 pDeviceInfo->ustrName.Buffer = UserAllocPool(pustrName->Length, TAG_PNP); 00430 00431 if (pDeviceInfo->ustrName.Buffer == NULL) { 00432 RIPMSG1(RIP_WARNING, "CreateDeviceInfo: Can't duplicate string %ws", 00433 pustrName->Buffer); 00434 goto CreateFailed; 00435 } 00436 00437 pDeviceInfo->ustrName.MaximumLength = pustrName->Length; 00438 RtlCopyUnicodeString(&pDeviceInfo->ustrName, pustrName); 00439 } 00440 00441 pDeviceInfo->type = (BYTE)DeviceType; 00442 00443 /* 00444 * Create this device's HidChangeCompletion event. When the RIT completes 00445 * a synchronous ProcessDeviceChanges() it signals the HidChangeCompletion 00446 * event to wake the requesting RequestDeviceChange() which is blocking on 00447 * the event. 00448 * Each device has it's own HidChangeCompletion event, 00449 * since multiple PnP notification may arrive for several different 00450 * devices simultaneously. (see #331320 IanJa) 00451 */ 00452 pDeviceInfo->pkeHidChangeCompleted = CreateKernelEvent(SynchronizationEvent, FALSE); 00453 if (pDeviceInfo->pkeHidChangeCompleted == NULL) { 00454 RIPMSG0(RIP_WARNING, 00455 "CreateDeviceInfo: failed to create pkeHidChangeCompleted"); 00456 goto CreateFailed; 00457 } 00458 00459 /* 00460 * Link it in 00461 */ 00462 EnterDeviceInfoListCrit(); 00463 pDeviceInfo->pNext = gpDeviceInfoList; 00464 gpDeviceInfoList = pDeviceInfo; 00465 pDeviceInfo->bFlags |= bFlags; 00466 00467 /* 00468 * Tell the RIT there is a new device so that it can open it and start 00469 * reading from it. This is non-blocking (no GDIAF_PNPWAITING bit set) 00470 */ 00471 RequestDeviceChange(pDeviceInfo, GDIAF_ARRIVED, TRUE); 00472 LeaveDeviceInfoListCrit(); 00473 00474 EXITATOMICCHECK(); 00475 return pDeviceInfo; 00476 00477 CreateFailed: 00478 00479 if (pDeviceInfo) { 00480 if (pDeviceInfo->ustrName.Buffer) { 00481 UserFreePool(pDeviceInfo->ustrName.Buffer); 00482 } 00483 UserFreePool(pDeviceInfo); 00484 } 00485 00486 ENDATOMICCHECK(); 00487 return NULL; 00488 }

HPALETTE CreateDIBPalette LPBITMAPINFOHEADER  pbmih,
UINT  colors
 

Definition at line 2041 of file ntuser/kernel/clipbrd.c.

References BOOL, BYTE, HDCBITS, and NULL.

Referenced by xxxGetDummyPalette().

02044 { 02045 HPALETTE hpal; 02046 02047 if (colors != 0) { 02048 02049 int i; 02050 BOOL fOldDIB = (pbmih->biSize == sizeof(BITMAPCOREHEADER)); 02051 RGBTRIPLE *pColorTable; 02052 PLOGPALETTE plp; 02053 02054 /* 02055 * Allocate memory for palette creation. 02056 */ 02057 plp = (PLOGPALETTE)UserAllocPoolWithQuota(sizeof(LOGPALETTE) + 02058 (sizeof(PALETTEENTRY) * 256), 02059 TAG_CLIPBOARDPALETTE); 02060 02061 if (plp == NULL) { 02062 return NULL; 02063 } 02064 02065 pColorTable = (RGBTRIPLE *)((LPSTR)pbmih + (WORD)pbmih->biSize); 02066 plp->palVersion = 0x300; 02067 02068 if (fOldDIB || (pbmih->biClrUsed == 0)) { 02069 UserAssert(colors <= 0xFFFF); 02070 plp->palNumEntries = (WORD)colors; 02071 } else { 02072 UserAssert(pbmih->biClrUsed <= 0xFFFF); 02073 plp->palNumEntries = (WORD)pbmih->biClrUsed; 02074 } 02075 02076 for (i = 0; i < (int)(plp->palNumEntries); i++) { 02077 02078 plp->palPalEntry[i].peRed = pColorTable->rgbtRed; 02079 plp->palPalEntry[i].peGreen = pColorTable->rgbtGreen; 02080 plp->palPalEntry[i].peBlue = pColorTable->rgbtBlue; 02081 plp->palPalEntry[i].peFlags = (BYTE)PC_NOCOLLAPSE; 02082 02083 if (fOldDIB) { 02084 pColorTable++; 02085 } else { 02086 pColorTable = (RGBTRIPLE *)((LPSTR)pColorTable+sizeof(RGBQUAD)); 02087 } 02088 } 02089 02090 hpal = GreCreatePalette((LPLOGPALETTE)plp); 02091 UserFreePool(plp); 02092 02093 } else { 02094 hpal = GreCreateHalftonePalette(HDCBITS()); 02095 } 02096 02097 GreSetPaletteOwner(hpal, OBJECT_OWNER_PUBLIC); 02098 02099 return hpal; 02100 }

HRGN CreateEmptyRgn void   ) 
 

Definition at line 57 of file visrgn.c.

References PZERO.

Referenced by _GetDCEx(), BltValidInit(), CalcWindowVisRgn(), CenterWallpaper(), CreateEmptyRgnPublic(), GetMonitorDC(), InternalScrollDC(), NtUserGetDC(), PreventInterMonitorBlts(), ResetSharedDesktops(), UserValidateCopyRgn(), xxxBeginPaint(), xxxCreateDisconnectDesktop(), xxxMenuBarDraw(), xxxMNInvertItem(), and xxxRedrawHungWindow().

00058 { 00059 return GreCreateRectRgnIndirect(PZERO(RECT)); 00060 }

HRGN CreateEmptyRgnPublic void   ) 
 

Definition at line 74 of file visrgn.c.

References CreateEmptyRgn().

Referenced by _GetDCEx(), GetNCUpdateRgn(), InitUserScreen(), and InternalInvalidate3().

00075 { 00076 HRGN hrgn; 00077 00078 if (hrgn = CreateEmptyRgn()) { 00079 UserVerify(GreSetRegionOwner(hrgn, OBJECT_OWNER_PUBLIC)); 00080 } 00081 00082 return hrgn; 00083 }

HDC CreateFade PWND  pwnd,
RECT *  prc,
DWORD  dwTime,
DWORD  dwFlags
 

Definition at line 761 of file sprite.c.

References BEGINATOMICCHECK, DeleteFadeSprite(), dwFlags, tagFADE::dwFlags, tagFADE::dwTime, ENDATOMICCHECK, FADE_WINDOW, FALSE, gfade, gpDispInfo, tagFADE::hbm, tagFADE::hdc, tagDISPLAYINFO::hdcScreen, tagDISPLAYINFO::hDev, tagFADE::hsprite, HWq, NULL, tagFADE::ptDst, tagWND::rcWindow, tagFADE::size, and xxxSetLayeredWindow().

Referenced by MNFadeSelection(), xxxMenuWindowProc(), and xxxTooltipWndProc().

00762 { 00763 SIZE size; 00764 00765 /* 00766 * Bail if there is a fade animation going on already. 00767 */ 00768 if (gfade.hbm != NULL) { 00769 RIPMSG0(RIP_WARNING, "CreateFade: failed, fade not available"); 00770 return NULL; 00771 } 00772 00773 /* 00774 * Create a cached compatible DC. 00775 */ 00776 if (gfade.hdc == NULL) { 00777 gfade.hdc = GreCreateCompatibleDC(gpDispInfo->hdcScreen); 00778 if (gfade.hdc == NULL) { 00779 return NULL; 00780 } 00781 } 00782 00783 /* 00784 * A windowed fade must have window position and size, so 00785 * prc passed in is disregarded. 00786 */ 00787 UserAssert((pwnd == NULL) || (prc == NULL)); 00788 00789 if (pwnd != NULL) { 00790 prc = &pwnd->rcWindow; 00791 } 00792 00793 size.cx = prc->right - prc->left; 00794 size.cy = prc->bottom - prc->top; 00795 00796 if (pwnd == NULL) { 00797 gfade.hsprite = GreCreateSprite(gpDispInfo->hDev, NULL, prc); 00798 } else { 00799 gfade.dwFlags |= FADE_WINDOW; 00800 gfade.hsprite = HWq(pwnd); 00801 00802 BEGINATOMICCHECK(); 00803 xxxSetLayeredWindow(pwnd, FALSE); 00804 ENDATOMICCHECK(); 00805 } 00806 00807 if (gfade.hsprite == NULL) 00808 return FALSE; 00809 00810 /* 00811 * Create a compatible bitmap for this size animation. 00812 */ 00813 gfade.hbm = GreCreateCompatibleBitmap(gpDispInfo->hdcScreen, size.cx, size.cy); 00814 if (gfade.hbm == NULL) { 00815 DeleteFadeSprite(); 00816 return NULL; 00817 } 00818 00819 GreSelectBitmap(gfade.hdc, gfade.hbm); 00820 00821 /* 00822 * Since this isn't necessarily the first animation and the hdc could 00823 * be set to public, make sure the owner is the current process. This 00824 * way this process will be able to draw into it. 00825 */ 00826 GreSetDCOwner(gfade.hdc, OBJECT_OWNER_CURRENT); 00827 00828 /* 00829 * Initialize all other fade animation data. 00830 */ 00831 gfade.ptDst.x = prc->left; 00832 gfade.ptDst.y = prc->top; 00833 gfade.size.cx = size.cx; 00834 gfade.size.cy = size.cy; 00835 gfade.dwTime = dwTime; 00836 gfade.dwFlags |= dwFlags; 00837 00838 return gfade.hdc; 00839 }

HFONT FAR PASCAL CreateFontFromWinIni PUNICODE_STRING  pProfileUserName,
LPLOGFONT  lplf,
UINT  idFont
 

Referenced by SPISetIconTitleFont(), and UserSetFont().

NTSTATUS CreateGlobalAtomTable PVOID *  ppAtomTable  ) 
 

Definition at line 212 of file winsta.c.

References ARRAY_SIZE, lpszStdFormats, NT_SUCCESS, NTSTATUS(), RtlAddAtomToAtomTable(), RtlCreateAtomTable(), RtlDestroyAtomTable(), RtlPinAtomInAtomTable(), and Status.

Referenced by CreateW32Job(), and xxxCreateWindowStation().

00214 { 00215 NTSTATUS Status; 00216 RTL_ATOM Atom; 00217 ULONG i; 00218 00219 Status = RtlCreateAtomTable(0, ppAtomTable); 00220 00221 if (!NT_SUCCESS(Status)) { 00222 RIPMSG0(RIP_WARNING, "Global atom table not created"); 00223 return Status; 00224 } 00225 00226 for (i = 0; i < ARRAY_SIZE(lpszStdFormats); i++) { 00227 Status = RtlAddAtomToAtomTable(*ppAtomTable, 00228 (PWSTR)lpszStdFormats[i], 00229 &Atom); 00230 if (!NT_SUCCESS(Status)) { 00231 RIPMSG1(RIP_WARNING, "RtlAddAtomToAtomTable failed to add atom %ws", 00232 lpszStdFormats[i]); 00233 00234 RtlDestroyAtomTable(*ppAtomTable); 00235 return Status; 00236 } 00237 00238 RtlPinAtomInAtomTable(*ppAtomTable, Atom); 00239 } 00240 return Status; 00241 }

PIMC CreateInputContext IN ULONG_PTR  dwClientImcData  ) 
 

Referenced by InternalImmLockIMC(), NtUserCreateInputContext(), xxxCreateDefaultImeWindow(), and xxxCreateThreadInfo().

PKEVENT CreateKernelEvent IN EVENT_TYPE  Type,
IN BOOLEAN  State
 

Definition at line 346 of file ex.c.

References KeInitializeEvent, and NULL.

Referenced by CreateDeviceInfo(), RawInputThread(), RemoteConnect(), UserInitialize(), xxxDesktopThread(), and xxxInitInput().

00349 { 00350 PKEVENT pEvent; 00351 00352 pEvent = UserAllocPoolNonPaged(sizeof(KEVENT), TAG_SYSTEM); 00353 if (pEvent != NULL) { 00354 KeInitializeEvent(pEvent, Type, State); 00355 } 00356 return pEvent; 00357 }

PUNICODE_STRING CreateProfileUserName TL ptl  ) 
 

Definition at line 151 of file w32/ntuser/kernel/profile.c.

References tagPROFILEUSERNAME::awcName, CheckCritIn, InitPreviousUserString(), tagPROFILEUSERNAME::NameString, NULL, PPROFILEUSERNAME, PreviousUserString, PtiCurrent, RtlCopyUnicodeString(), and ThreadLockPool.

Referenced by InitUserScreen(), NtUserSetSysColors(), PrepareForLogoff(), xxxDesktopWndProc(), xxxInitWindowStation(), xxxResetDisplayDevice(), xxxSetIMEShowStatus(), xxxSystemParametersInfo(), and xxxUpdatePerUserSystemParameters().

00152 { 00153 PPROFILEUSERNAME pMapName; 00154 00155 CheckCritIn(); 00156 00157 pMapName = UserAllocPoolWithQuota(sizeof (PROFILEUSERNAME), TAG_PROFILEUSERNAME); 00158 if (!pMapName) { 00159 RIPMSG0(RIP_WARNING, "CreateProfileUserName: Allocation failed"); 00160 return NULL; 00161 } 00162 00163 ThreadLockPool(PtiCurrent(), pMapName, ptl); 00164 pMapName->NameString.Length = 0; 00165 pMapName->NameString.MaximumLength = sizeof (pMapName->awcName); 00166 pMapName->NameString.Buffer = pMapName->awcName; 00167 00168 InitPreviousUserString(); 00169 00170 RtlCopyUnicodeString(&pMapName->NameString, &PreviousUserString); 00171 return &(pMapName->NameString); 00172 }

PPROP CreateProp PWND  pwnd  ) 
 

Definition at line 217 of file kernel/winprop.c.

References tagPROPLIST::aprop, tagPROPLIST::cEntries, DesktopAlloc(), DesktopFree, DTAG_PROPLIST, tagWND::head, tagPROPLIST::iFirstFree, NULL, tagWND::ppropList, PROP, and PROPLIST.

Referenced by InternalSetProp().

00219 { 00220 PPROPLIST ppropList; 00221 PPROP pprop; 00222 00223 if (pwnd->ppropList == NULL) { 00224 pwnd->ppropList = (PPROPLIST)DesktopAlloc(pwnd->head.rpdesk, 00225 sizeof(PROPLIST), 00226 DTAG_PROPLIST); 00227 if (pwnd->ppropList == NULL) { 00228 return NULL; 00229 } 00230 pwnd->ppropList->cEntries = 1; 00231 } else if (pwnd->ppropList->iFirstFree == pwnd->ppropList->cEntries) { 00232 ppropList = (PPROPLIST)DesktopAlloc(pwnd->head.rpdesk, 00233 sizeof(PROPLIST) + pwnd->ppropList->cEntries * sizeof(PROP), 00234 DTAG_PROPLIST); 00235 if (ppropList == NULL) { 00236 return NULL; 00237 } 00238 RtlCopyMemory(ppropList, pwnd->ppropList, sizeof(PROPLIST) + (pwnd->ppropList->cEntries - 1) * sizeof(PROP)); 00239 DesktopFree(pwnd->head.rpdesk, pwnd->ppropList); 00240 pwnd->ppropList = ppropList; 00241 pwnd->ppropList->cEntries++; 00242 } 00243 pprop = &pwnd->ppropList->aprop[pwnd->ppropList->iFirstFree]; 00244 pwnd->ppropList->iFirstFree++; 00245 00246 return pprop; 00247 }

PSECURITY_DESCRIPTOR CreateSecurityDescriptor PACCESS_ALLOWED_ACE  paceList,
DWORD  cbAce,
BOOLEAN  fDaclDefaulted
 

Definition at line 91 of file w32/ntuser/kernel/security.c.

References FALSE, NT_SUCCESS, NTSTATUS(), NULL, PBYTE, RtlAddAce(), RtlCreateAcl(), RtlCreateSecurityDescriptor(), RtlSetDaclSecurityDescriptor(), RtlSetGroupSecurityDescriptor(), RtlSetOwnerSecurityDescriptor(), RtlSetSaclSecurityDescriptor(), Status, and TRUE.

Referenced by InitSecurity(), xxxConnectService(), and xxxCreateWindowStation().

00095 { 00096 PSECURITY_DESCRIPTOR psd; 00097 PACL pacl; 00098 NTSTATUS Status; 00099 00100 /* 00101 * Allocate the security descriptor 00102 */ 00103 psd = (PSECURITY_DESCRIPTOR)UserAllocPoolWithQuota( 00104 cbAce + sizeof(ACL) + SECURITY_DESCRIPTOR_MIN_LENGTH, 00105 TAG_SECURITY); 00106 if (psd == NULL) 00107 return NULL; 00108 RtlCreateSecurityDescriptor(psd, SECURITY_DESCRIPTOR_REVISION); 00109 00110 /* 00111 * Initialize the ACL 00112 */ 00113 pacl = (PACL)((PBYTE)psd + SECURITY_DESCRIPTOR_MIN_LENGTH); 00114 Status = RtlCreateAcl(pacl, sizeof(ACL) + cbAce, ACL_REVISION); 00115 if (NT_SUCCESS(Status)) { 00116 00117 /* 00118 * Add the ACEs to the ACL. 00119 */ 00120 Status = RtlAddAce(pacl, ACL_REVISION, MAXULONG, paceList, cbAce); 00121 if (NT_SUCCESS(Status)) { 00122 00123 /* 00124 * Initialize the SD 00125 */ 00126 Status = RtlSetDaclSecurityDescriptor(psd, (BOOLEAN)TRUE, 00127 pacl, fDaclDefaulted); 00128 RtlSetSaclSecurityDescriptor(psd, (BOOLEAN)FALSE, NULL, 00129 (BOOLEAN)FALSE); 00130 RtlSetOwnerSecurityDescriptor(psd, NULL, (BOOLEAN)FALSE); 00131 RtlSetGroupSecurityDescriptor(psd, NULL, (BOOLEAN)FALSE); 00132 } 00133 } 00134 00135 if (!NT_SUCCESS(Status)) { 00136 UserFreePool(psd); 00137 return NULL; 00138 } 00139 00140 return psd; 00141 }

VOID CreateSpb PWND  pwnd,
UINT  flags,
HDC  hdcScreen
 

Definition at line 341 of file spb.c.

References _MonitorFromRect(), AnySpbs, BOOL, cy, tagDCE::DCX_flags, FALSE, tagSPB::flags, ghdcMem, ghrgnSPB2, gpDispInfo, tagSPB::hbm, tagDCE::hdc, tagDISPLAYINFO::hDev, tagSPB::hrgn, tagWND::hrgnClip, tagDISPLAYINFO::hrgnScreen, IntersectRect(), IntersectRgn, Lock, NULL, tagDISPLAYINFO::pdceFirst, tagDCE::pdceNext, tagDISPLAYINFO::pMonitorPrimary, tagDISPLAYINFO::pspbFirst, tagSPB::pspbNext, PWNDDESKTOP, tagSPB::rc, tagMONITOR::rcMonitor, tagDISPLAYINFO::rcScreen, tagWND::rcWindow, SetRectRgnIndirect(), SetWF, SPB, SPB_LOCKUPDATE, SPB_SAVESCREENBITS, SpbCheck(), SpbTransfer(), tagSPB::spwnd, tagWND::spwndNext, tagWND::spwndParent, SubtractRect(), SYSMET, TRUE, tagSPB::ulSaveId, Unlock, VOID(), and WFHASSPB.

Referenced by LockWindowUpdate2(), and zzzChangeStates().

00345 { 00346 PSPB pspb; 00347 int fSpbLockUpdate; 00348 00349 /* 00350 * Non-LOCKWINDOWUPDATE SPBs can only be created for top-level windows. 00351 * 00352 * This is because of the way that the display driver RestoreBits function 00353 * works. It can put bits down in places that aren't even part of the 00354 * window's visrgn, and these bits need to be invalidated. The 00355 * SetWindowPos() code to handle this case only knows how to invalidate 00356 * one of windows (i.e., the window's immediate parent), but all levels 00357 * need to get invalidated. See also the comments in wmswp.c, near the 00358 * call to RestoreSpb(). 00359 * 00360 * For example: the Q&E app brings up a copyright dialog that is a child 00361 * of its main window. While this is up, the user alt-f alt-l to execute 00362 * the file login command, which brings up another dialog that is a child 00363 * of the desktop. When the copyright dialog goes away, the display driver 00364 * restores bits on top of the second dialog. The SWP code knows to 00365 * invalidate the bogus stuff in the main window, but not in the desktop. 00366 * 00367 * LOCKUPDATE SPBs are fine, because they don't call RestoreBits. 00368 */ 00369 fSpbLockUpdate = flags & SPB_LOCKUPDATE; 00370 if ( !fSpbLockUpdate && 00371 pwnd->spwndParent != NULL && 00372 pwnd->spwndParent != PWNDDESKTOP(pwnd)) { 00373 00374 return; 00375 } 00376 00377 /* 00378 * We go and check all the existing DCs at this point, to handle the 00379 * case where we're saving an image of a window that has a "dirty" 00380 * DC, which would eventually invalidate our saved image (but which 00381 * is really okay). 00382 */ 00383 if (AnySpbs()) { 00384 00385 SpbCheck(); 00386 00387 } else { 00388 00389 PDCE pdce; 00390 00391 /* 00392 * Reset the dirty areas of all of the DC's and enable 00393 * bounds accumulation. We're creating a SPB now. This 00394 * is only done if there are no other SPB's in the list. 00395 */ 00396 GreLockDisplay(gpDispInfo->hDev); 00397 00398 for (pdce = gpDispInfo->pdceFirst; pdce != NULL; pdce = pdce->pdceNext) { 00399 00400 if (pdce->DCX_flags & DCX_LAYERED) 00401 continue; 00402 00403 GreGetBounds(pdce->hdc, NULL, GGB_ENABLE_WINMGR); 00404 } 00405 00406 GreUnlockDisplay(gpDispInfo->hDev); 00407 } 00408 00409 /* 00410 * Create the save popup bits structure 00411 */ 00412 pspb = (PSPB)UserAllocPoolWithQuota(sizeof(SPB), TAG_SPB); 00413 if (!pspb) 00414 return; 00415 00416 pspb->spwnd = NULL; 00417 pspb->rc = pwnd->rcWindow; 00418 00419 /* 00420 * Clip to the screen 00421 */ 00422 if (!IntersectRect(&pspb->rc, &pspb->rc, &gpDispInfo->rcScreen)) 00423 goto BMError; 00424 00425 pspb->hrgn = NULL; 00426 pspb->hbm = NULL; 00427 pspb->flags = flags; 00428 Lock(&(pspb->spwnd), pwnd); 00429 00430 if (!fSpbLockUpdate) { 00431 00432 RECT rc = pspb->rc; 00433 00434 if (!SYSMET(SAMEDISPLAYFORMAT)) { 00435 PMONITOR pMonitor = _MonitorFromRect(&pspb->rc, MONITOR_DEFAULTTOPRIMARY); 00436 RECT rcT; 00437 00438 /* 00439 * If the intersection with the monitor isn't the entire visible 00440 * window rectangle, then bail! We don't save SPBs for windows 00441 * that span multiple monitors. Since we do a lot of work to 00442 * pin dialogs and menus, there won't be too many of these 00443 * babies. 00444 */ 00445 if (SubtractRect(&rcT, &pspb->rc, &pMonitor->rcMonitor) && 00446 GreRectInRegion(gpDispInfo->hrgnScreen, &rcT)) 00447 goto BMError2; 00448 00449 /* 00450 * Clip to the window's monitor 00451 */ 00452 if (!IntersectRect(&pspb->rc, &pspb->rc, &pMonitor->rcMonitor)) 00453 goto BMError2; 00454 00455 /* 00456 * dont save bits in a mixed bitdepth situtation 00457 * we cant create the exactly correct format bitmap 00458 * in all cases (555/565, and Paletized) so as 00459 * a cop-out dont save bitmaps at all (on secondaries) 00460 * in mixed bit-depth. 00461 * 00462 * the correct fix is to create a compatible 00463 * bitmap for the monitor device and directly 00464 * BitBlt() from/to the device (pMonitor->hdcMonitor) 00465 * but this involves too much code at this time. 00466 */ 00467 if (pMonitor != gpDispInfo->pMonitorPrimary) 00468 goto BMError2; 00469 } 00470 00471 /* 00472 * If this window is a regional window, don't use driver save 00473 * bits. Because it can only restore an entire rectangle, 00474 * invalid region is calculated assuming the old vis rgn was 00475 * rectangular. For regional windows, this would end up always 00476 * invalidating the area of (rcWindow - hrgnWindow) every 00477 * time an spb would be used. On the other hand, the invalid 00478 * area calculated when not using driver save bits is perfect, 00479 * because the restore blt can be correctly clipped to begin with. 00480 */ 00481 if ((pwnd->hrgnClip == NULL) && 00482 (pspb->ulSaveId = GreSaveScreenBits(gpDispInfo->hDev, 00483 SS_SAVE, 00484 0, 00485 (RECTL *)&rc))) { 00486 00487 /* 00488 * Remember that we copied this bitmap into on board memory. 00489 */ 00490 pspb->flags |= SPB_SAVESCREENBITS; 00491 00492 } else { 00493 HBITMAP hbmSave; 00494 BOOL bRet; 00495 00496 /* 00497 * The following delta byte-aligns the screen bitmap 00498 */ 00499 int dx = pspb->rc.left & 0x0007; 00500 int cx = pspb->rc.right - pspb->rc.left; 00501 int cy = pspb->rc.bottom - pspb->rc.top; 00502 00503 /* 00504 * NOTE: we don't care about setting up a visrgn in 00505 * hdcScreen, because BitBlt ignores it on reads. 00506 */ 00507 pspb->hbm = GreCreateCompatibleBitmap(hdcScreen, cx + dx, cy); 00508 if (!pspb->hbm) 00509 goto BMError2; 00510 00511 hbmSave = (HBITMAP)GreSelectBitmap(ghdcMem, pspb->hbm); 00512 if (!hbmSave) 00513 goto BMError2; 00514 00515 /* 00516 * Copy the contents of the screen to the bitmap in the 00517 * save popup bits structure. If we ever find we run 00518 * into problems with the screen access check we can 00519 * do a bLockDisplay, give this process permission, do 00520 * the BitBlt and then take away permission. GDI 00521 * accesses the screen and that bit only under the 00522 * display semaphore so it is safe. Alternatively 00523 * if it is too hard to change this processes permission 00524 * here we could do it in GDI by marking the psoSrc 00525 * readable temporarily while completing the operation 00526 * and then setting it back to unreadable when done. 00527 * Or we could just fail it like the CreateCompatibleDC 00528 * failed and force a redraw. Basically we can't add 00529 * 3K of code in GDI to do a BitBlt that just does 1 00530 * test differently for this 1 place in User. 00531 * 00532 */ 00533 bRet = GreBitBlt(ghdcMem, 00534 dx, 00535 0, 00536 cx, 00537 cy, 00538 hdcScreen, 00539 pspb->rc.left, 00540 pspb->rc.top, 00541 0x00CC0000, 00542 0); 00543 00544 GreSelectBitmap(ghdcMem, hbmSave); 00545 00546 if (!bRet) 00547 goto BMError2; 00548 00549 GreSetBitmapOwner(pspb->hbm, OBJECT_OWNER_PUBLIC); 00550 } 00551 00552 /* 00553 * Mark that the window has an SPB. 00554 */ 00555 SetWF(pwnd, WFHASSPB); 00556 00557 /* 00558 * non-LOCKUPDATE SPBs are not invalidated by 00559 * drawing in pspb->spwnd, so start the SPB validation 00560 * loop below at the sibling immediately below us. 00561 */ 00562 pwnd = pwnd->spwndNext; 00563 } 00564 00565 /* 00566 * Link the new save popup bits structure into the list. 00567 */ 00568 pspb->pspbNext = gpDispInfo->pspbFirst; 00569 gpDispInfo->pspbFirst = pspb; 00570 00571 /* 00572 * Here we deal with any update regions that may be 00573 * pending in windows underneath the SPB. 00574 * 00575 * For all windows that might affect this SPB: 00576 * - Subtract the SPB rect from the update region 00577 * - Subtract the window from the SPB 00578 * 00579 * Note that we use pspb->spwnd here, in case it has 00580 * no siblings. 00581 * 00582 * ghrgnSPB2 is the region that is used inside of SpbTransfer to 00583 * validate window update regions. Intersect with the window clipping 00584 * region, if it exists. Don't want to intersect with the spb rect if 00585 * a clipping region exists because we'll end up validating more than 00586 * we want to validate. 00587 */ 00588 SetRectRgnIndirect(ghrgnSPB2, &pspb->rc); 00589 if (pspb->spwnd->hrgnClip != NULL) { 00590 00591 /* 00592 * If we get an error bail since an error might result in more 00593 * being validated than we want. Since the below code is only an 00594 * optimizer, this is ok: the window will remain invalid and will 00595 * draw, thereby invalidating the SPB like usual. 00596 */ 00597 if (IntersectRgn(ghrgnSPB2, 00598 ghrgnSPB2, 00599 pspb->spwnd->hrgnClip) == ERROR) { 00600 return; 00601 } 00602 } 00603 00604 if (pspb->spwnd->spwndParent == NULL || 00605 SpbTransfer(pspb, pspb->spwnd->spwndParent, FALSE)) { 00606 00607 /* 00608 * Do the same for the siblings underneath us... 00609 */ 00610 for ( ; pwnd != NULL; pwnd = pwnd->spwndNext) { 00611 if (!SpbTransfer(pspb, pwnd, TRUE)) 00612 break; 00613 } 00614 } 00615 00616 return; 00617 00618 BMError2: 00619 /* 00620 * Error creating the bitmap: clean up and return. 00621 */ 00622 if (pspb->hbm) 00623 GreDeleteObject(pspb->hbm); 00624 00625 Unlock(&pspb->spwnd); 00626 // fall-through 00627 00628 BMError: 00629 UserFreePool(pspb); 00630 }

NTSTATUS CreateSystemThread PKSTART_ROUTINE  lpThreadAddress,
PVOID  pvContext,
PHANDLE  phThread
 

Definition at line 131 of file ex.c.

References CheckCritOut, gpepCSRSS, KernelMode, NT_SUCCESS, NTSTATUS(), NULL, ObOpenObjectByPointer(), PsCreateSystemThread(), and Status.

Referenced by VideoPortCallout(), xxxInitInput(), and xxxInitTerminal().

00135 { 00136 NTSTATUS Status; 00137 OBJECT_ATTRIBUTES Obja; 00138 HANDLE hProcess; 00139 00140 CheckCritOut(); 00141 00142 InitializeObjectAttributes(&Obja, 00143 NULL, 00144 0, 00145 NULL, 00146 NULL); 00147 00148 /* 00149 * On WinFrame WIN32K.SYS is in WINSTATION SPACE. We can not 00150 * allow any system threads to access WIN32K.SYS since 00151 * this space is not mapped into the system process. 00152 * 00153 * We need to access the CSRSS 00154 * process regardless of who our caller is. IE: We could be called from 00155 * a CSRSS client who does not have a handle to the CSRSS process in 00156 * its handle table. 00157 */ 00158 UserAssert(gpepCSRSS != NULL); 00159 00160 Status = ObOpenObjectByPointer( 00161 gpepCSRSS, 00162 0, 00163 NULL, 00164 PROCESS_CREATE_THREAD, 00165 NULL, 00166 KernelMode, 00167 &hProcess); 00168 00169 if (!NT_SUCCESS(Status)) { 00170 return Status; 00171 } 00172 00173 UserAssert(hProcess != NULL); 00174 00175 Status = PsCreateSystemThread( 00176 phThread, 00177 THREAD_ALL_ACCESS, 00178 &Obja, 00179 hProcess, 00180 NULL, 00181 lpThreadAddress, 00182 pvContext); 00183 00184 ZwClose(hProcess); 00185 00186 return Status; 00187 }

BOOL CreateTerminalInput PTERMINAL   ) 
 

Definition at line 1376 of file w32/ntuser/kernel/init.c.

References BOOL, ClientFontSweep(), FALSE, NULL, TRUE, xxxInitInput(), and xxxLW_LoadFonts().

Referenced by xxxInitTerminal().

01378 { 01379 UserAssert(pTerm != NULL); 01380 01381 /* 01382 * call to the client side to clean up the [Fonts] section 01383 * of the registry. This will only take significant chunk of time 01384 * if the [Fonts] key changed during since the last boot and if 01385 * there are lots of fonts loaded 01386 */ 01387 ClientFontSweep(); 01388 01389 /* 01390 * Load the standard fonts before we create any DCs. 01391 * At this time we can only add the fonts that do not 01392 * reside on the net. They may be needed by winlogon. 01393 * Our winlogon needs only ms sans serif, but private 01394 * winlogon's may need some other fonts as well. 01395 * The fonts on the net will be added later, right 01396 * after all the net connections have been restored. 01397 */ 01398 /* 01399 * This call should be made in UserInitialize. 01400 */ 01401 xxxLW_LoadFonts(FALSE); 01402 01403 /* 01404 * Initialize the input system. 01405 */ 01406 if (!xxxInitInput(pTerm)) 01407 return FALSE; 01408 01409 return TRUE; 01410 }

NTSTATUS CtxDisplayIOCtl ULONG  DisplayIOCtlFlags,
PUCHAR  pDisplayIOCtlData,
ULONG  cbDisplayIOCtlData
 

Definition at line 814 of file w32/ntuser/kernel/misc.c.

References BOOL, gpDispInfo, tagDISPLAYINFO::hDev, RemoteRedrawRectangle(), and TRACE_HYDAPI.

Referenced by NtUserCtxDisplayIOCtl().

00818 { 00819 BOOL fResult; 00820 00821 TRACE_HYDAPI(("CtxDisplayIOCtl\n")); 00822 00823 fResult = bDrvDisplayIOCtl(gpDispInfo->hDev, pDisplayIOCtlData, cbDisplayIOCtlData); 00824 00825 if (!fResult) { 00826 return STATUS_CTX_BAD_VIDEO_MODE; 00827 } 00828 00829 if ((DisplayIOCtlFlags & DISPLAY_IOCTL_FLAG_REDRAW)) { 00830 RemoteRedrawRectangle(0,0,0xffff,0xffff); 00831 } 00832 00833 return STATUS_SUCCESS; 00834 }

void DBGValidateQueueStates PDESKTOP  pdesk  ) 
 

Referenced by zzzReattachThreads().

VOID DecPaintCount PWND  pwnd  ) 
 

Definition at line 1272 of file paint.c.

References tagTHREADINFO::cPaintsReady, tagCLIENTTHREADINFO::fsChangeBits, tagCLIENTTHREADINFO::fsWakeBits, GETPTI, tagTHREADINFO::pcti, and VOID().

Referenced by ClrFTrueVis(), DoPaint(), GetNCUpdateRgn(), InternalInvalidate3(), xxxBeginPaint(), xxxFreeWindow(), and xxxUpdateWindow2().

01274 { 01275 PTHREADINFO pti = GETPTI(pwnd); 01276 01277 if (--pti->cPaintsReady == 0) { 01278 pti->pcti->fsWakeBits &= ~QS_PAINT; 01279 pti->pcti->fsChangeBits &= ~QS_PAINT; 01280 } 01281 }

void DecrMBox void   ) 
 

__inline void DecSFWLockCount  ) 
 

Definition at line 7053 of file userk.h.

Referenced by CleanupDecSFWLockCount(), xxxMNEndMenuState(), and xxxMNLoop().

07059 {

VOID DecTimerCount PTHREADINFO  pti  ) 
 

Definition at line 644 of file timers.c.

References CheckCritIn, tagTHREADINFO::cTimersReady, tagCLIENTTHREADINFO::fsWakeBits, tagTHREADINFO::pcti, and VOID().

Referenced by DoTimer(), FreeTimer(), and InternalSetTimer().

00646 { 00647 CheckCritIn(); 00648 00649 if (--pti->cTimersReady == 0) 00650 pti->pcti->fsWakeBits &= ~QS_TIMER; 00651 }

VOID DecVisWindows PWND  pwnd  ) 
 

Definition at line 5156 of file swp.c.

References cDecVis(), ISTS, and VOID().

Referenced by SetMinimize(), SetVisible(), and xxxSetWindowStyle().

05158 { 05159 cDecVis(pwnd); 05160 05161 #if DBG 05162 if (!ISTS()) 05163 VerifycVisWindows(pwnd); 05164 #endif 05165 }

BOOL DefSetText PWND  pwnd,
PLARGE_STRING  pstrText
 

Definition at line 28 of file ntuser/kernel/getset.c.

References _LARGE_STRING::bAnsi, BOOL, _LARGE_UNICODE_STRING::Buffer, _LARGE_STRING::Buffer, DesktopAlloc(), DesktopFree, DTAG_TEXT, DWORD, FALSE, tagWND::head, _LARGE_STRING::Length, _LARGE_UNICODE_STRING::Length, _LARGE_UNICODE_STRING::MaximumLength, NT_SUCCESS, NULL, RtlMultiByteToUnicodeN(), tagWND::strName, and TRUE.

Referenced by NtUserDefSetText(), and xxxDefWindowProc().

00031 { 00032 /* 00033 * Note -- string buffer may be on client side. 00034 */ 00035 PDESKTOP pdesk; 00036 DWORD cbString; 00037 BOOL fTranslateOk; 00038 00039 if (pwnd->head.rpdesk == NULL || cczpstr == NULL || cczpstr->Buffer == NULL) { 00040 pwnd->strName.Length = 0; 00041 return TRUE; 00042 } 00043 00044 /* 00045 * Capture the new window name 00046 */ 00047 if (cczpstr->bAnsi) 00048 cbString = (cczpstr->Length + 1) * sizeof(WCHAR); 00049 else 00050 cbString = cczpstr->Length + sizeof(WCHAR); 00051 00052 /* 00053 * If the current buffer is not large enough, 00054 * reallocate it. 00055 */ 00056 pdesk = pwnd->head.rpdesk; 00057 if (pwnd->strName.MaximumLength < cbString) { 00058 if (pwnd->strName.Buffer != NULL) 00059 DesktopFree(pdesk, pwnd->strName.Buffer); 00060 pwnd->strName.Buffer = (LPWSTR)DesktopAlloc(pdesk, cbString, DTAG_TEXT); 00061 pwnd->strName.Length = 0; 00062 if (pwnd->strName.Buffer == NULL) { 00063 pwnd->strName.MaximumLength = 0; 00064 return FALSE; 00065 } 00066 pwnd->strName.MaximumLength = cbString; 00067 } 00068 00069 fTranslateOk = TRUE; 00070 if (cczpstr->Length != 0) { 00071 try { 00072 if (!cczpstr->bAnsi) { 00073 RtlCopyMemory(pwnd->strName.Buffer, cczpstr->Buffer, cbString); 00074 } else { 00075 LPCSTR ccxpszAnsi = (LPCSTR)cczpstr->Buffer; 00076 00077 fTranslateOk = NT_SUCCESS(RtlMultiByteToUnicodeN(pwnd->strName.Buffer, 00078 cbString, &cbString, 00079 (LPSTR)ccxpszAnsi, cbString / sizeof(WCHAR))); 00080 } 00081 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00082 pwnd->strName.Length = 0; 00083 return FALSE; 00084 } 00085 } 00086 00087 if (fTranslateOk) { 00088 pwnd->strName.Length = cbString - sizeof(WCHAR); 00089 return TRUE; 00090 } else { 00091 pwnd->strName.Length = 0; 00092 return FALSE; 00093 } 00094 }

VOID DelayedDestroyCacheDC VOID   ) 
 

Definition at line 1596 of file dc.c.

References tagDCE::DCX_flags, DestroyCacheDC(), gpDispInfo, tagDCE::hdc, NULL, tagDISPLAYINFO::pdceFirst, tagDCE::pdceNext, PpiCurrent, and VOID().

Referenced by _GetDCEx(), CleanupGDI(), and DestroyProcessInfo().

01597 { 01598 PDCE *ppdce; 01599 PDCE pdce; 01600 01601 01602 /* 01603 * Zip through the cache looking for a DCX_DESTROYTHIS hdc. 01604 */ 01605 for (ppdce = &gpDispInfo->pdceFirst; *ppdce != NULL; ) { 01606 01607 /* 01608 * If we found a DCE on this thread that we tried to destroy 01609 * earlier, try and destroy it again. 01610 */ 01611 pdce = *ppdce; 01612 01613 if (pdce->DCX_flags & DCX_DESTROYTHIS) 01614 DestroyCacheDC(ppdce, pdce->hdc); 01615 01616 /* 01617 * Step to the next DC. If the DC was deleted, there 01618 * is no need to calculate address of the next entry. 01619 */ 01620 if (pdce == *ppdce) 01621 ppdce = &pdce->pdceNext; 01622 } 01623 01624 PpiCurrent()->W32PF_Flags &= ~W32PF_OWNDCCLEANUP; 01625 }

void DeleteHrgnClip PDCE  pdce  ) 
 

Definition at line 549 of file dc.c.

References tagDCE::DCX_flags, DeleteMaybeSpecialRgn(), tagDCE::hdc, tagDCE::hrgnClip, tagDCE::hrgnClipPublic, tagDCE::hrgnSavedVis, InvalidateDce(), NULL, and VOID().

Referenced by _GetDCEx(), ReleaseCacheDC(), and xxxFreeWindow().

00551 { 00552 /* 00553 * Clear these flags first in case we get a DCHook() callback... 00554 */ 00555 pdce->DCX_flags &= ~(DCX_EXCLUDERGN | DCX_INTERSECTRGN); 00556 00557 /* 00558 * Blow away pdce->hrgnClip and clear the associated flags. 00559 * Do not delete hrgnClip if DCX_NODELETERGN is set! 00560 */ 00561 if (!(pdce->DCX_flags & DCX_NODELETERGN)) { 00562 DeleteMaybeSpecialRgn(pdce->hrgnClip); 00563 } else { 00564 pdce->DCX_flags &= ~DCX_NODELETERGN; 00565 } 00566 00567 DeleteMaybeSpecialRgn(pdce->hrgnClipPublic); 00568 00569 pdce->hrgnClip = NULL; 00570 pdce->hrgnClipPublic = NULL; 00571 00572 /* 00573 * If the saved visrgn was invalidated by an InvalidateDce() 00574 * while we had it checked out, then invalidate the entry now. 00575 */ 00576 if (pdce->DCX_flags & DCX_SAVEDRGNINVALID) { 00577 InvalidateDce(pdce); 00578 00579 /* 00580 * We've just gone through InvalidateDce, so the visrgn in the 00581 * DC has been properly reset. Simply nuke the old saved visrgn. 00582 */ 00583 if (pdce->hrgnSavedVis != NULL) { 00584 GreDeleteObject(pdce->hrgnSavedVis); 00585 pdce->hrgnSavedVis = NULL; 00586 } 00587 } else { 00588 /* 00589 * The saved visrgn is still valid, select it back into the 00590 * DC so the entry may be re-used without recomputing. 00591 */ 00592 if (pdce->hrgnSavedVis != NULL) { 00593 GreSelectVisRgn(pdce->hdc, pdce->hrgnSavedVis, SVR_DELETEOLD); 00594 pdce->hrgnSavedVis = NULL; 00595 } 00596 } 00597 }

void DeleteMaybeSpecialRgn HRGN  hrgn  ) 
 

Definition at line 132 of file paint.c.

References HRGN_SPECIAL_LAST, and VOID().

Referenced by ClrFTrueVis(), DeleteHrgnClip(), DestroyCacheDC(), InternalInvalidate3(), xxxBeginPaint(), xxxFreeWindow(), and xxxSimpleDoSyncPaint().

00134 { 00135 if (hrgn > HRGN_SPECIAL_LAST) { 00136 GreDeleteObject(hrgn); 00137 } 00138 }

VOID DeletePowerRequestList VOID   ) 
 

Definition at line 250 of file power.c.

References gPowerRequestList, gpPowerRequestMutex, and NULL.

Referenced by Win32kNtUserCleanup().

00251 { 00252 if (gpPowerRequestMutex) { 00253 00254 /* 00255 * Make sure there are no pending power requests. 00256 */ 00257 UserAssert(IsListEmpty(&gPowerRequestList)); 00258 00259 /* 00260 * Free the power request structures. 00261 */ 00262 UserFreePool(gpPowerRequestMutex); 00263 gpPowerRequestMutex = NULL; 00264 } 00265 }

VOID DeleteProperties PWND  pwnd  ) 
 

Definition at line 265 of file kernel/winprop.c.

References tagPROPLIST::aprop, DesktopFree, tagPROP::fs, tagPROP::hData, tagWND::head, tagPROPLIST::iFirstFree, NULL, tagWND::ppropList, PROPF_INTERNAL, PROPF_NOPOOL, and UINT.

Referenced by xxxFreeWindow().

00267 { 00268 PPROP pprop; 00269 UINT i; 00270 00271 UserAssert(pwnd->ppropList); 00272 00273 /* 00274 * Loop through the whole list of properties on this window. 00275 */ 00276 pprop = pwnd->ppropList->aprop; 00277 for (i = pwnd->ppropList->iFirstFree; i > 0; i--) { 00278 00279 /* 00280 * Is this an internal property? If so, free any data we allocated 00281 * for it. 00282 */ 00283 if ((pprop->fs & PROPF_INTERNAL) && !(pprop->fs & PROPF_NOPOOL)) { 00284 UserFreePool(pprop->hData); 00285 } 00286 00287 /* 00288 * Advance to the next property in the list. 00289 */ 00290 pprop++; 00291 } 00292 00293 /* 00294 * All properties gone, free the property list and clear out the 00295 * window's property list pointer. 00296 */ 00297 DesktopFree(pwnd->head.rpdesk, pwnd->ppropList); 00298 pwnd->ppropList = NULL; 00299 }

VOID DeleteUpdateRgn PWND  pwnd  ) 
 

void DelQEntry PMLIST  pml,
PQMSG  pqmsg
 

Definition at line 3253 of file queue.c.

References tagMLIST::cMsgs, DebugValidateMLIST, DebugValidateMLISTandQMSG, ExFreeToPagedLookasideList(), NULL, tagQMSG::pqmsgNext, tagQMSG::pqmsgPrev, tagMLIST::pqmsgRead, tagMLIST::pqmsgWriteLast, and QEntryLookaside.

Referenced by AdjustForCoalescing(), DestroyThreadsMessages(), FindQMsg(), FreeMessageList(), PostInputMessage(), RemoveEventMessage(), xxxReadPostMessage(), xxxScanSysQueue(), and xxxSkipSysMsg().

03256 { 03257 DebugValidateMLISTandQMSG(pml, pqmsg); 03258 UserAssert((int)pml->cMsgs > 0); 03259 UserAssert(pml->pqmsgRead); 03260 UserAssert(pml->pqmsgWriteLast); 03261 03262 /* 03263 * Unlink this pqmsg from the message list. 03264 */ 03265 if (pqmsg->pqmsgPrev != NULL) 03266 pqmsg->pqmsgPrev->pqmsgNext = pqmsg->pqmsgNext; 03267 03268 if (pqmsg->pqmsgNext != NULL) 03269 pqmsg->pqmsgNext->pqmsgPrev = pqmsg->pqmsgPrev; 03270 03271 /* 03272 * Update the read/write pointers if necessary. 03273 */ 03274 if (pml->pqmsgRead == pqmsg) 03275 pml->pqmsgRead = pqmsg->pqmsgNext; 03276 03277 if (pml->pqmsgWriteLast == pqmsg) 03278 pml->pqmsgWriteLast = pqmsg->pqmsgPrev; 03279 03280 /* 03281 * Adjust the message count and free the message structure. 03282 */ 03283 pml->cMsgs--; 03284 03285 ExFreeToPagedLookasideList(QEntryLookaside, pqmsg); 03286 03287 DebugValidateMLIST(pml); 03288 }

VOID DereferenceClass PWND  pwnd  ) 
 

Definition at line 1735 of file class.c.

References tagCLS::cWndReferenceCount, DestroyClass(), tagWND::pcls, tagCLS::pclsBase, tagCLS::pclsClone, tagCLS::pclsNext, and VOID().

Referenced by HMChangeOwnerThread(), and xxxFreeWindow().

01737 { 01738 PCLS pcls = pwnd->pcls; 01739 PPCLS ppcls; 01740 01741 UserAssert(pcls->cWndReferenceCount >= 1); 01742 01743 pcls->cWndReferenceCount--; 01744 if (pcls != pcls->pclsBase) { 01745 01746 UserAssert(pcls->pclsBase->cWndReferenceCount >= 1); 01747 01748 pcls->pclsBase->cWndReferenceCount--; 01749 01750 if (pcls->cWndReferenceCount == 0) { 01751 ppcls = &pcls->pclsBase->pclsClone; 01752 while ((*ppcls) != pcls) 01753 ppcls = &(*ppcls)->pclsNext; 01754 UserAssert(ppcls); 01755 DestroyClass(ppcls); 01756 } 01757 } 01758 }

PVOID DesktopAlloc PDESKTOP  pdesk,
UINT  uSize,
DWORD  tag
 

Definition at line 47 of file desktop.c.

References DF_DESTROYED, tagDESKTOP::dwDTFlags, NULL, and tagDESKTOP::pheapDesktop.

Referenced by _InitPwSB(), CreateProp(), DefSetText(), HMAllocObject(), xxxCreateDefaultImeWindow(), xxxCreateDesktop2(), xxxInsertMenuItem(), xxxRemoveDeleteMenuHelper(), and xxxSetLPITEMInfo().

00051 { 00052 if (pdesk->dwDTFlags & DF_DESTROYED) { 00053 RIPMSG2(RIP_ERROR, 00054 "DesktopAlloc: tag %d pdesk %#p is destroyed", 00055 tag, 00056 pdesk); 00057 return NULL; 00058 } 00059 00060 return Win32HeapAlloc(pdesk->pheapDesktop, uSize, tag, 0); 00061 }

__inline PVOID DesktopRebaseToClient PTHREADINFO  pti,
PVOID  p
 

Definition at line 6718 of file userk.h.

06729 {

BOOL DestroyCacheDC PDCE ,
HDC 
 

Definition at line 1638 of file dc.c.

References BOOL, tagDCE::DCX_flags, DecrementFreeDCECount(), DeleteMaybeSpecialRgn(), FALSE, gpDispInfo, tagDCE::hdc, tagDCE::hrgnClip, tagDCE::hrgnClipPublic, tagDCE::hrgnSavedVis, NULL, tagDISPLAYINFO::pdceFirst, tagDCE::pdceNext, PpiCurrent, tagDCE::pwndClip, tagDCE::pwndOrg, and TRUE.

Referenced by DelayedDestroyCacheDC(), DestroyCacheDCEntries(), DestroyClass(), DestroyMonitorDCs(), ReleaseCacheDC(), xxxFreeWindow(), and xxxUserProcessCallout().

01641 { 01642 PDCE pdce; 01643 01644 /* 01645 * Zip through the cache looking for hdc. 01646 */ 01647 if (ppdce == NULL) { 01648 for (ppdce = &gpDispInfo->pdceFirst; (pdce = *ppdce); ppdce = &pdce->pdceNext) { 01649 if (pdce->hdc == hdc) 01650 break; 01651 } 01652 } 01653 01654 if (ppdce == NULL) 01655 return FALSE; 01656 01657 /* 01658 * Set this here so we know this DCE is supposed to be deleted. 01659 */ 01660 pdce = *ppdce; 01661 pdce->DCX_flags |= DCX_DESTROYTHIS; 01662 01663 /* 01664 * Free up the dce object and contents. 01665 */ 01666 01667 if (!(pdce->DCX_flags & DCX_NODELETERGN)) { 01668 DeleteMaybeSpecialRgn(pdce->hrgnClip); 01669 pdce->hrgnClip = NULL; 01670 } 01671 01672 if (pdce->hrgnClipPublic != NULL) { 01673 GreDeleteObject(pdce->hrgnClipPublic); 01674 pdce->hrgnClipPublic = NULL; 01675 } 01676 01677 if (pdce->hrgnSavedVis != NULL) { 01678 GreDeleteObject(pdce->hrgnSavedVis); 01679 pdce->hrgnSavedVis = NULL; 01680 } 01681 01682 /* 01683 * If GreSetDCOwner() or GreDeleteDC() fail, the 01684 * DC is in-use by another thread. Set 01685 * W32PF_OWNDCCLEANUP so we know to scan for and 01686 * delete this DCE later. 01687 */ 01688 if (!GreSetDCOwner(hdc, OBJECT_OWNER_PUBLIC)) { 01689 PpiCurrent()->W32PF_Flags |= W32PF_OWNDCCLEANUP; 01690 return FALSE; 01691 } 01692 01693 /* 01694 * Set the don't rip flag so our routine RipIfCacheDC() doesn't 01695 * rip (called back from gdi). 01696 */ 01697 #if DBG 01698 pdce->DCX_flags |= DCX_DONTRIPONDESTROY; 01699 GreMarkDeletableDC(hdc); // So GRE doesn't RIP. 01700 #endif 01701 01702 if (!GreDeleteDC(hdc)) { 01703 01704 #if DBG 01705 GreMarkUndeletableDC(hdc); 01706 pdce->DCX_flags &= ~DCX_DONTRIPONDESTROY; 01707 #endif 01708 PpiCurrent()->W32PF_Flags |= W32PF_OWNDCCLEANUP; 01709 return FALSE; 01710 } 01711 01712 /* 01713 * Decrement this dc-entry from the free-list count. 01714 */ 01715 if (pdce->DCX_flags & DCX_CACHE) { 01716 01717 if (!(pdce->DCX_flags & DCX_INUSE)) { 01718 DecrementFreeDCECount(); 01719 } 01720 } 01721 01722 #if DBG 01723 pdce->pwndOrg = NULL; 01724 pdce->pwndClip = NULL; 01725 #endif 01726 01727 /* 01728 * Unlink the DCE from the list. 01729 */ 01730 *ppdce = pdce->pdceNext; 01731 01732 UserFreePool(pdce); 01733 01734 return TRUE; 01735 }

VOID DestroyCacheDCEntries PTHREADINFO   ) 
 

Definition at line 2923 of file createw.c.

References tagDCE::DCX_flags, DestroyCacheDC(), gpDispInfo, tagDCE::hdc, NULL, tagDISPLAYINFO::pdceFirst, tagDCE::pdceNext, tagDCE::ptiOwner, and VOID().

Referenced by CleanupGDI(), and DestroyThreadsObjects().

02925 { 02926 PDCE *ppdce; 02927 PDCE pdce; 02928 /* 02929 * Before any window destruction occurs, we need to destroy any dcs 02930 * in use in the dc cache. When a dc is checked out, it is marked owned, 02931 * which makes gdi's process cleanup code delete it when a process 02932 * goes away. We need to similarly destroy the cache entry of any dcs 02933 * in use by the exiting process. 02934 */ 02935 for (ppdce = &gpDispInfo->pdceFirst; *ppdce != NULL; ) { 02936 02937 /* 02938 * If the dc owned by this thread, remove it from the cache. Because 02939 * DestroyCacheEntry destroys gdi objects, it is important that 02940 * USER be called first in process destruction ordering. 02941 * 02942 * Only destroy this dc if it is a cache dc, because if it is either 02943 * an owndc or a classdc, it will be destroyed for us when we destroy 02944 * the window (for owndcs) or destroy the class (for classdcs). 02945 */ 02946 pdce = *ppdce; 02947 if (pti == pdce->ptiOwner) { 02948 02949 if (pdce->DCX_flags & DCX_CACHE) 02950 DestroyCacheDC(ppdce, pdce->hdc); 02951 } 02952 02953 /* 02954 * Step to the next DC. If the DC was deleted, there 02955 * is no need to calculate address of the next entry. 02956 */ 02957 if (pdce == *ppdce) 02958 ppdce = &pdce->pdceNext; 02959 } 02960 }

VOID DestroyClass PPCLS  ppcls  ) 
 

Definition at line 1207 of file class.c.

References tagCLS::atomClassName, ClassFree(), tagCLS::cWndReferenceCount, DestroyCacheDC(), DestroyClassBrush(), DestroyClassSmIcon(), tagDCE::hdc, IS_PTR, LockDesktop, NULL, tagCLS::pclsBase, tagCLS::pclsClone, tagCLS::pclsNext, tagCLS::pdce, PtiCurrent, tagCLS::rpdeskParent, tagCLS::spcpdFirst, Unlock, UnlockAndFreeCPDs(), UnlockDesktop, and UserDeleteAtom().

Referenced by _UnregisterClass(), _WOWCleanup(), _WOWModuleUnload(), CleanupResources(), DereferenceClass(), DestroyProcessesClasses(), and FinalUserInit().

01209 { 01210 PPCLS ppclsClone; 01211 PCLS pcls; 01212 PDESKTOP rpdesk; 01213 01214 pcls = *ppcls; 01215 01216 UserAssert(pcls->cWndReferenceCount == 0); 01217 01218 /* 01219 * If this is a base class, destroy all clones before deleting 01220 * stuff. 01221 */ 01222 if (pcls == pcls->pclsBase) { 01223 ppclsClone = &pcls->pclsClone; 01224 while (*ppclsClone != NULL) { 01225 DestroyClass(ppclsClone); 01226 } 01227 01228 UserDeleteAtom(pcls->atomClassName); 01229 01230 /* 01231 * No freeing if it's an integer resource. 01232 */ 01233 if (IS_PTR(pcls->lpszMenuName)) { 01234 UserFreePool(pcls->lpszMenuName); 01235 } 01236 01237 /* 01238 * Free up the class dc if there is one. 01239 */ 01240 if (pcls->pdce != NULL) 01241 DestroyCacheDC(NULL, pcls->pdce->hdc); 01242 01243 /* 01244 * Delete the hBrBackground brush if nobody else is 01245 * using it. 01246 */ 01247 DestroyClassBrush(pcls); 01248 } 01249 01250 /* 01251 * If we created the small icon delete it 01252 */ 01253 DestroyClassSmIcon(pcls); 01254 01255 /* 01256 * Unlock cursor and icon 01257 */ 01258 Unlock(&pcls->spicn); 01259 Unlock(&pcls->spicnSm); 01260 Unlock(&pcls->spcur); 01261 01262 /* 01263 * Free any CallProcData objects associated with this class 01264 */ 01265 if (pcls->spcpdFirst) { 01266 UnlockAndFreeCPDs(&pcls->spcpdFirst); 01267 } 01268 01269 /* 01270 * Point the previous guy at the guy we currently point to. 01271 */ 01272 *ppcls = pcls->pclsNext; 01273 01274 /* 01275 * Lock the desktop. Do not use a thread lock because 01276 * this may be called during process cleanup when thread 01277 * locks are no longer usable. 01278 */ 01279 rpdesk = NULL; 01280 LockDesktop(&rpdesk, pcls->rpdeskParent, LDL_FN_DESTROYCLASS, (ULONG_PTR)PtiCurrent()); 01281 UnlockDesktop(&pcls->rpdeskParent, LDU_CLS_DESKPARENT2, (ULONG_PTR)pcls); 01282 ClassFree(rpdesk, pcls->lpszAnsiClassName); 01283 ClassFree(rpdesk, pcls); 01284 UnlockDesktop(&rpdesk, LDU_FN_DESTROYCLASS, (ULONG_PTR)PtiCurrent()); 01285 }

BOOL DestroyClassSmIcon PCLS  pcls  ) 
 

Definition at line 146 of file classchg.c.

References _DestroyCursor(), BOOL, CSF_CACHEDSMICON, tagCLS::CSF_flags, CURSOR_ALWAYSDESTROY, FALSE, TRUE, and Unlock.

Referenced by DestroyClass(), xxxRecreateSmallIcons(), and xxxSetClassIcon().

00148 { 00149 00150 /* 00151 * If we don't have a cached icon, then no work. 00152 */ 00153 if (pcls->CSF_flags & CSF_CACHEDSMICON) { 00154 if (pcls->spicnSm) { 00155 _DestroyCursor(pcls->spicnSm, CURSOR_ALWAYSDESTROY); 00156 Unlock(&pcls->spicnSm); 00157 } 00158 pcls->CSF_flags &= ~CSF_CACHEDSMICON; 00159 return TRUE; 00160 } 00161 00162 return FALSE; 00163 }

void DestroyEventHook PEVENTHOOK   ) 
 

Definition at line 879 of file kernel/winable.c.

References DBGVERIFYEVENTHOOK, tagEVENTHOOK::fDestroyed, gpWinEventHooks, HMFreeObject(), HMMarkObjectDestroy(), tagEVENTHOOK::ihmod, tagEVENTHOOK::pehNext, RemoveHmodDependency(), SET_OR_CLEAR_SRVIF, SRVIF_WINEVENTHOOKS, and TRUE.

Referenced by _UnhookWinEvent(), and FreeThreadsWinEvents().

00880 { 00881 PEVENTHOOK *ppEvent; 00882 PEVENTHOOK pEventT; 00883 00884 DBGVERIFYEVENTHOOK(pEventDestroy); 00885 UserAssert(gpWinEventHooks); 00886 00887 /* 00888 * Mark this event as destroyed, but don't remove it from the event list 00889 * until its lock count goes to 0 - we may be traversing the list 00890 * within xxxWindowEvent, so we mustn't break the link to the next hook. 00891 */ 00892 pEventDestroy->fDestroyed = TRUE; 00893 00894 /* 00895 * If the object is locked, mark it for destroy but don't free it yet. 00896 */ 00897 if (!HMMarkObjectDestroy(pEventDestroy)) 00898 return; 00899 00900 /* 00901 * Remove this from our event list. 00902 */ 00903 for (ppEvent = &gpWinEventHooks; pEventT = *ppEvent; ppEvent = &pEventT->pehNext) { 00904 if (pEventT == pEventDestroy) { 00905 *ppEvent = pEventDestroy->pehNext; 00906 break; 00907 } 00908 } 00909 UserAssert(pEventT); 00910 SET_OR_CLEAR_SRVIF(SRVIF_WINEVENTHOOKS, gpWinEventHooks); 00911 00912 /* 00913 * Make sure each hooked thread will unload the hook proc DLL 00914 */ 00915 if (pEventDestroy->ihmod >= 0) { 00916 RemoveHmodDependency(pEventDestroy->ihmod); 00917 } 00918 00919 /* 00920 * Free this pointer. 00921 */ 00922 HMFreeObject(pEventDestroy); 00923 00924 return; 00925 }

BOOL DestroyInputContext IN PIMC  pImc  ) 
 

Definition at line 122 of file ntimm.c.

References AssociateInputContext(), _HANDLEENTRY::bFlags, BOOL, BuildHwndList(), BWL_ENUMCHILDREN, BWL_ENUMLIST, FALSE, FreeHwndList(), GETPTI, HANDLEF_DESTROY, tagWND::hImc, HMDestroyUnlockedObject(), HMPheFromObject, NULL, tagDESKTOP::pDeskInfo, PtiCurrent, PtoH, RevalidateHwnd, tagBWL::rghwnd, tagTHREADINFO::rpdesk, tagTHREADINFO::spDefaultImc, tagDESKTOPINFO::spwnd, tagWND::spwndChild, and TRUE.

Referenced by ImmDestroyContext(), ImmDllInitialize(), and NtUserDestroyInputContext().

00124 { 00125 PTHREADINFO ptiImcOwner; 00126 PBWL pbwl; 00127 PWND pwnd; 00128 HWND *phwnd; 00129 PHE phe; 00130 00131 ptiImcOwner = GETPTI(pImc); 00132 00133 /* 00134 * Cannot destroy input context from other thread. 00135 */ 00136 if (ptiImcOwner != PtiCurrent()) { 00137 RIPERR0(ERROR_ACCESS_DENIED, RIP_WARNING, 00138 "DestroyInputContext: pImc not of current pti"); 00139 return FALSE; 00140 } 00141 00142 /* 00143 * Cannot destroy default input context. 00144 */ 00145 if (pImc == ptiImcOwner->spDefaultImc) { 00146 RIPERR0(ERROR_INVALID_PARAMETER, RIP_WARNING, 00147 "DestroyInputContext: can't destroy default Imc"); 00148 return FALSE; 00149 } 00150 00151 /* 00152 * Cleanup destroyed input context from each associated window. 00153 */ 00154 pbwl = BuildHwndList(ptiImcOwner->rpdesk->pDeskInfo->spwnd->spwndChild, 00155 BWL_ENUMLIST|BWL_ENUMCHILDREN, ptiImcOwner); 00156 00157 if (pbwl != NULL) { 00158 00159 for (phwnd = pbwl->rghwnd; *phwnd != (HWND)1; phwnd++) { 00160 /* 00161 * Make sure this hwnd is still around. 00162 */ 00163 if ((pwnd = RevalidateHwnd(*phwnd)) == NULL) 00164 continue; 00165 00166 /* 00167 * Cleanup by associating the default input context. 00168 */ 00169 if (pwnd->hImc == (HIMC)PtoH(pImc)) 00170 AssociateInputContext(pwnd, ptiImcOwner->spDefaultImc); 00171 } 00172 00173 FreeHwndList(pbwl); 00174 } 00175 00176 phe = HMPheFromObject(pImc); 00177 00178 /* 00179 * Make sure this object isn't already marked to be destroyed - we'll 00180 * do no good if we try to destroy it now since it is locked. 00181 */ 00182 if (!(phe->bFlags & HANDLEF_DESTROY)) 00183 HMDestroyUnlockedObject(phe); 00184 00185 return TRUE; 00186 }

void DestroyKF PKBDFILE  pkf  ) 
 

Definition at line 435 of file kbdlyout.c.

References tagKBDFILE::hBase, HMFreeObject(), HMMarkObjectDestroy(), and RemoveKeyboardLayoutFile().

Referenced by DestroyKL().

00436 { 00437 if (!HMMarkObjectDestroy(pkf)) 00438 return; 00439 00440 RemoveKeyboardLayoutFile(pkf); 00441 UserFreePool(pkf->hBase); 00442 HMFreeObject(pkf); 00443 }

VOID DestroyKL PKL  pkl  ) 
 

Definition at line 1688 of file kbdlyout.c.

References DestroyKF(), HMFreeObject(), NULL, tagKL::piiex, tagKL::pklNext, tagKL::pklPrev, tagKL::spkf, Unlock, and VOID().

Referenced by Win32kNtUserCleanup().

01690 { 01691 PKBDFILE pkf; 01692 01693 /* 01694 * Cut it out of the pwinsta->spklList circular bidirectional list. 01695 * We know pwinsta->spklList != pkl, since pkl is unlocked. 01696 */ 01697 pkl->pklPrev->pklNext = pkl->pklNext; 01698 pkl->pklNext->pklPrev = pkl->pklPrev; 01699 01700 /* 01701 * Unlock its pkf 01702 */ 01703 pkf = Unlock(&pkl->spkf); 01704 if (pkf) { 01705 DestroyKF(pkf); 01706 } 01707 01708 if (pkl->piiex != NULL) { 01709 UserFreePool(pkl->piiex); 01710 } 01711 01712 /* 01713 * Free the pkl itself. 01714 */ 01715 HMFreeObject(pkl); 01716 }

void DestroyMonitor PMONITOR  pMonitor  ) 
 

Definition at line 249 of file multimon.c.

References gpDispInfo, gpMonitorMouse, HMFreeObject(), HMMarkObjectDestroy(), tagMONITOR::hrgnMonitor, NULL, tagDISPLAYINFO::pMonitorFirst, tagDISPLAYINFO::pMonitorPrimary, and REMOVE_FROM_LIST.

Referenced by CleanupGDI(), and UpdateUserScreen().

00250 { 00251 UserAssert(pMonitor); 00252 00253 /* 00254 * Remove references to this monitor from the global data. 00255 */ 00256 if (pMonitor == gpMonitorMouse) { 00257 gpMonitorMouse = NULL; 00258 } 00259 00260 /* 00261 * Remove from the monitor list. 00262 */ 00263 REMOVE_FROM_LIST(MONITOR, gpDispInfo->pMonitorFirst, pMonitor, pMonitorNext); 00264 00265 /* 00266 * Make sure the primary monitor points to a valid monitor. During the 00267 * mode changes the primary monitor will be recalculated as appropriate. 00268 */ 00269 if (pMonitor == gpDispInfo->pMonitorPrimary) { 00270 gpDispInfo->pMonitorPrimary = gpDispInfo->pMonitorFirst; 00271 } 00272 00273 if (HMMarkObjectDestroy(pMonitor)) { 00274 00275 if (pMonitor->hrgnMonitor) { 00276 GreDeleteObject(pMonitor->hrgnMonitor); 00277 } 00278 00279 HMFreeObject(pMonitor); 00280 } 00281 }

VOID DestroyNotify PNOTIFY  pNotify  ) 
 

Definition at line 566 of file kernel/winable.c.

References DBGVERIFYNOTIFY, gpPendingNotifies, NULL, tagNOTIFY::pNotifyNext, PtiCurrent, tagNOTIFY::ptiReceiver, and RemoveNotify().

Referenced by CleanEventMessage(), FreeThreadsWinEvents(), and xxxProcessNotifyWinEvent().

00567 { 00568 PNOTIFY *ppNotify; 00569 PNOTIFY pNotifyT; 00570 00571 DBGVERIFYNOTIFY(pNotifyDestroy); 00572 00573 /* 00574 * Either this notify isn't currently in the process of calling back 00575 * (which means ptiReceiver is NULL) or the thread destroying it 00576 * must be the one that was calling back (which means this thread 00577 * was destroyed during the callback and is cleaning up). 00578 */ 00579 UserAssert((pNotifyDestroy->ptiReceiver == NULL) || 00580 (pNotifyDestroy->ptiReceiver == PtiCurrent())); 00581 00582 ppNotify = &gpPendingNotifies; 00583 while (pNotifyT = *ppNotify) { 00584 if (pNotifyT == pNotifyDestroy) { 00585 RemoveNotify(ppNotify); 00586 return; 00587 } else { 00588 ppNotify = &pNotifyT->pNotifyNext; 00589 } 00590 } 00591 RIPMSG1(RIP_ERROR, "DestroyNotify %#p - not found", pNotifyDestroy); 00592 }

VOID DestroyProcessesClasses PPROCESSINFO   ) 
 

Definition at line 1768 of file class.c.

References DestroyClass(), NULL, tagPROCESSINFO::pclsPrivateList, tagPROCESSINFO::pclsPublicList, and VOID().

Referenced by xxxDestroyThreadInfo().

01770 { 01771 PPCLS ppcls; 01772 01773 /* 01774 * Destroy the private classes first 01775 */ 01776 ppcls = &(ppi->pclsPrivateList); 01777 while (*ppcls != NULL) { 01778 DestroyClass(ppcls); 01779 } 01780 01781 /* 01782 * Then the cloned public classes 01783 */ 01784 ppcls = &(ppi->pclsPublicList); 01785 while (*ppcls != NULL) { 01786 DestroyClass(ppcls); 01787 } 01788 }

BOOL DestroyProcessInfo PW32PROCESS   ) 
 

Definition at line 4976 of file queue.c.

References tagSHAREDINFO::aheList, AllocQEntry(), BEGINATOMICCHECK, _HANDLEENTRY::bFlags, BOOL, _HANDLEENTRY::bType, CheckCritIn, ClearAppStarting(), CLOSE_PSEUDO_EVENT, CloseProtectedHandle(), tagPROCESSINFO::cThreads, DeferWinEventNotify, DelayedDestroyCacheDC(), tagWINDOWSTATION::dwWSF_Flags, ENDATOMICCHECK, EndDeferWinEventNotifyWithoutProcessing, FALSE, gahti, GETPTI, giheLast, GiveForegroundActivateRight(), gppiForegroundOld, gppiInputProvider, gppiList, gppiLockSFW, gppiScreenSaver, gpPublicObjectList, gpwpiFirstWow, gSharedInfo, gspwndLogonNotify, HANDLEF_DESTROY, IsShellProcess(), tagTHREADINFO::mlPost, tagPUBOBJ::next, NT_SUCCESS, NULL, ObDereferenceObject, OCF_PROCESSOWNED, tagDESKTOP::pDeskInfo, tagDESKTOPVIEW::pdvNext, tagWOWPROCESSINFO::pEventWowExec, tagPUBOBJ::pid, _HANDLEENTRY::pOwner, tagDESKTOPINFO::ppiShellProcess, PPUBOBJ, REMOVE_FROM_LIST, tagPROCESSINFO::rpdeskStartup, tagPROCESSINFO::rpwinsta, SetWakeBit(), StoreQMessage(), UnlockDesktop, UnlockWinSta, USER_SOUND_CLOSE, WOWPROCESSINFO, WSF_OPENLOCK, and zzzCalcStartCursorHide().

Referenced by xxxUserProcessCallout().

04978 { 04979 PPROCESSINFO ppi = (PPROCESSINFO)pwp; 04980 PDESKTOPVIEW pdv, pdvNext; 04981 BOOL fHadThreads; 04982 PPUBOBJ ppo; 04983 04984 CheckCritIn(); 04985 04986 /* 04987 * Free up input idle event if it exists - wake everyone waiting on it 04988 * first. This object will get created sometimes even for non-windows 04989 * processes (usually for WinExec(), which calls WaitForInputIdle()). 04990 */ 04991 CLOSE_PSEUDO_EVENT(&pwp->InputIdleEvent); 04992 04993 /* 04994 * Check to see if the startglass is on, and if so turn it off and update. 04995 * DeferWinEventNotify to because we cannot process notifications for this 04996 * thread now (we may have no PtiCurrent, see comment above) 04997 */ 04998 BEGINATOMICCHECK(); 04999 DeferWinEventNotify(); 05000 if (pwp->W32PF_Flags & W32PF_STARTGLASS) { 05001 pwp->W32PF_Flags &= ~W32PF_STARTGLASS; 05002 zzzCalcStartCursorHide(NULL, 0); 05003 } 05004 /* 05005 * This is bookkeeping - restore original notification deferral but without 05006 * attempting to process any deferred notifications because we have no pti. 05007 */ 05008 EndDeferWinEventNotifyWithoutProcessing(); 05009 ENDATOMICCHECK(); 05010 05011 /* 05012 * If the process never called Win32k, we're done. 05013 */ 05014 if (!(pwp->W32PF_Flags & W32PF_PROCESSCONNECTED)) { 05015 return FALSE; 05016 } 05017 05018 /* 05019 * Play the Process Close sound for non-console processes 05020 * running on the I/O windowstation. 05021 */ 05022 05023 if ((ppi->W32PF_Flags & W32PF_IOWINSTA) && 05024 !(ppi->W32PF_Flags & W32PF_CONSOLEAPPLICATION) && 05025 (gspwndLogonNotify != NULL) && 05026 !(ppi->rpwinsta->dwWSF_Flags & WSF_OPENLOCK)) { 05027 05028 PTHREADINFO pti = GETPTI(gspwndLogonNotify); 05029 PQMSG pqmsg; 05030 05031 if ((pqmsg = AllocQEntry(&pti->mlPost)) != NULL) { 05032 StoreQMessage(pqmsg, gspwndLogonNotify, WM_LOGONNOTIFY, 05033 LOGON_PLAYEVENTSOUND, USER_SOUND_CLOSE, 0, 0, 0); 05034 05035 SetWakeBit(pti, QS_POSTMESSAGE | QS_ALLPOSTMESSAGE); 05036 } 05037 05038 } 05039 05040 /* 05041 * Be like WIN95. 05042 * If this is the shell process, then send a LOGON_RESTARTSHELL 05043 * notification to the winlogon process (only if not logging off) 05044 */ 05045 if (IsShellProcess(ppi)) { 05046 05047 /* 05048 * The shell process will get killed and it's better to set this 05049 * in the desktop info. 05050 */ 05051 ppi->rpdeskStartup->pDeskInfo->ppiShellProcess = NULL; 05052 05053 /* 05054 * If we're not logging off, notify winlogon 05055 */ 05056 if ((gspwndLogonNotify != NULL) && 05057 !(ppi->rpwinsta->dwWSF_Flags & WSF_OPENLOCK)) { 05058 05059 PTHREADINFO pti = GETPTI(gspwndLogonNotify); 05060 PQMSG pqmsg; 05061 05062 if ((pqmsg = AllocQEntry(&pti->mlPost)) != NULL) { 05063 StoreQMessage(pqmsg, gspwndLogonNotify, WM_LOGONNOTIFY, 05064 LOGON_RESTARTSHELL, ppi->Process->ExitStatus, 0, 0, 0); 05065 SetWakeBit(pti, QS_POSTMESSAGE | QS_ALLPOSTMESSAGE); 05066 } 05067 } 05068 } 05069 05070 if (ppi->cThreads) 05071 RIPMSG1(RIP_ERROR, "Disconnect with %d threads remaining\n", ppi->cThreads); 05072 05073 /* 05074 * If the app is still starting, remove it from the startup list 05075 */ 05076 if (ppi->W32PF_Flags & W32PF_APPSTARTING) { 05077 /* 05078 * Bug 294193 - joejo 05079 * 05080 * Handle case when creator process exits before the child 05081 * process makes it to CheckAllowForeground code. This is typical with 05082 * stub EXEs that do nothing but create other processes. 05083 */ 05084 GiveForegroundActivateRight(ppi->Process->UniqueProcessId); 05085 ClearAppStarting(ppi); 05086 } 05087 05088 /* 05089 * remove it from the global list 05090 */ 05091 REMOVE_FROM_LIST(PROCESSINFO, gppiList, ppi, ppiNextRunning); 05092 05093 /* 05094 * If any threads ever connected, there may be DCs, classes, 05095 * cursors, etc. still lying around. If no threads connected 05096 * (which is the case for console apps), skip all of this cleanup. 05097 */ 05098 fHadThreads = ppi->W32PF_Flags & W32PF_THREADCONNECTED; 05099 if (fHadThreads) { 05100 05101 /* 05102 * When a process dies we need to make sure any DCE's it owns 05103 * and have not been deleted are cleanup up. The clean up 05104 * earlier may have failed if the DC was busy in GDI. 05105 */ 05106 if (ppi->W32PF_Flags & W32PF_OWNDCCLEANUP) { 05107 DelayedDestroyCacheDC(); 05108 } 05109 05110 #if DBG 05111 { 05112 PHE pheT, pheMax; 05113 05114 /* 05115 * Loop through the table destroying all objects created by the current 05116 * process. All objects will get destroyed in their proper order simply 05117 * because of the object locking. 05118 */ 05119 pheMax = &gSharedInfo.aheList[giheLast]; 05120 for (pheT = gSharedInfo.aheList; pheT <= pheMax; pheT++) { 05121 05122 /* 05123 * We should have no process objects left for this process. 05124 */ 05125 UserAssertMsg0( 05126 pheT->bFlags & HANDLEF_DESTROY || 05127 !(gahti[pheT->bType].bObjectCreateFlags & OCF_PROCESSOWNED) || 05128 (PPROCESSINFO)pheT->pOwner != ppi, 05129 "We should have no process objects left for this process!"); 05130 } 05131 } 05132 #endif 05133 } 05134 05135 if (pwp->UserHandleCount) 05136 RIPMSG1(RIP_ERROR, "Disconnect with %d User handle objects remaining\n", pwp->UserHandleCount); 05137 05138 /* 05139 * check if we need to zap PID's for DDE objects 05140 */ 05141 for (ppo = gpPublicObjectList; 05142 ppo != NULL; 05143 ppo = ppo->next) { 05144 if (ppo->pid == pwp->W32Pid) { 05145 ppo->pid = OBJECT_OWNER_PUBLIC; 05146 } 05147 } 05148 05149 05150 if (gppiScreenSaver == ppi) { 05151 UserAssert(ppi->W32PF_Flags & W32PF_SCREENSAVER); 05152 05153 gppiScreenSaver = NULL; 05154 } 05155 05156 if (gppiForegroundOld == ppi) { 05157 gppiForegroundOld = NULL; 05158 } 05159 05160 UnlockWinSta(&ppi->rpwinsta); 05161 UnlockDesktop(&ppi->rpdeskStartup, LDU_PPI_DESKSTARTUP3, (ULONG_PTR)ppi); 05162 05163 /* 05164 * Close the startup desktop handle now if it's still around. If we wait 05165 * until handle table cleanup time we could potentially deadlock. 05166 */ 05167 if (ppi->hdeskStartup) { 05168 UserVerify(NT_SUCCESS(CloseProtectedHandle(ppi->hdeskStartup))); 05169 ppi->hdeskStartup = NULL; 05170 } 05171 05172 /* 05173 * Mark the process as terminated so access checks will work. 05174 */ 05175 ppi->W32PF_Flags |= W32PF_TERMINATED; 05176 05177 /* 05178 * Cleanup wow process info struct, if any 05179 */ 05180 if (ppi->pwpi) { 05181 PWOWPROCESSINFO pwpi = ppi->pwpi; 05182 05183 ObDereferenceObject(pwpi->pEventWowExec); 05184 05185 REMOVE_FROM_LIST(WOWPROCESSINFO, gpwpiFirstWow, pwpi, pwpiNext); 05186 05187 UserFreePool(pwpi); 05188 ppi->pwpi = NULL; 05189 } 05190 05191 /* 05192 * Delete desktop views. System will do unmapping. 05193 */ 05194 pdv = ppi->pdvList; 05195 while (pdv) { 05196 pdvNext = pdv->pdvNext; 05197 UserFreePool(pdv); 05198 pdv = pdvNext; 05199 } 05200 ppi->pdvList = NULL; 05201 05202 /* 05203 * Clear the SendInput/Journalling hook caller ppi 05204 */ 05205 if (ppi == gppiInputProvider) { 05206 gppiInputProvider = NULL; 05207 } 05208 /* 05209 * If this ppi locked SetForegroundWindow, clean up 05210 */ 05211 if (ppi == gppiLockSFW) { 05212 gppiLockSFW = NULL; 05213 } 05214 05215 return fHadThreads; 05216 }

void DestroySMWP PSMWP  psmwp  ) 
 

Definition at line 64 of file swp.c.

References tagSMWP::acvr, tagSMWP::bHandle, BOOL, tagSMWP::ccvr, tagSMWP::ccvrAlloc, CheckCritIn, CLEAR_PUDF, CVR, DBGCheskSMWP, gSMWP, HMFreeObject(), HMMarkObjectDestroy(), tagCVR::hrgnInterMonitor, NULL, PUDF_GSMWPINUSE, TEST_PUDF, and TRUE.

Referenced by _DeferWindowPos(), and xxxEndDeferWindowPosEx().

00065 { 00066 BOOL fFree; 00067 00068 CheckCritIn(); 00069 00070 DBGCheskSMWP(psmwp); 00071 /* 00072 * First mark the object for destruction. This tells the locking code 00073 * that we want to destroy this object when the lock count goes to 0. 00074 * If this returns FALSE, we can't destroy the object yet. 00075 */ 00076 if (psmwp->bHandle) { 00077 if (!HMMarkObjectDestroy(psmwp)) { 00078 return; 00079 } 00080 fFree = TRUE; 00081 } else { 00082 /* 00083 * Is this the global cached structure? 00084 */ 00085 fFree = (psmwp != &gSMWP); 00086 } 00087 00088 if (psmwp->acvr) { 00089 00090 /* 00091 * Free any hrgnInterMonitor stuff we accumulated. 00092 */ 00093 PCVR pcvr; 00094 int ccvr; 00095 00096 for (pcvr = psmwp->acvr, ccvr = psmwp->ccvr; --ccvr >= 0; pcvr++) { 00097 if (pcvr->hrgnInterMonitor != NULL) { 00098 GreDeleteObject(pcvr->hrgnInterMonitor); 00099 } 00100 } 00101 00102 if (fFree) { 00103 UserFreePool(psmwp->acvr); 00104 } 00105 } 00106 00107 /* 00108 * Ok to destroy... Free the handle (which will free the object 00109 * and the handle). 00110 */ 00111 if (psmwp->bHandle) { 00112 HMFreeObject(psmwp); 00113 } else if (fFree) { 00114 UserFreePool(psmwp); 00115 } else { 00116 UserAssert(TEST_PUDF(PUDF_GSMWPINUSE)); 00117 CLEAR_PUDF(PUDF_GSMWPINUSE); 00118 /* 00119 * If acvr grew too much, shrink it. 00120 * Don't use realloc since we don't care about the left over data 00121 */ 00122 if (psmwp->ccvrAlloc > 8) { 00123 PCVR pcvr = UserAllocPool(4 * sizeof(CVR), TAG_SWP); 00124 if (pcvr != NULL) { 00125 UserFreePool(psmwp->acvr); 00126 psmwp->acvr = pcvr; 00127 psmwp->ccvrAlloc = 4; 00128 } 00129 } 00130 } 00131 }

VOID DestroyTask PPROCESSINFO  ppi,
PTHREADINFO  ptiToRemove
 

Definition at line 129 of file taskman.c.

References _PostMessage(), BEGINATOMICCHECK, CheckCritIn, CLOSE_PSEUDO_EVENT, tagWOWPROCESSINFO::CSOwningThread, DTM_SETUPAPPRAN, ENDATOMICCHECK, EVENT_INCREMENT, ExitWowCritSect(), FALSE, GETDESKINFO, gpsi, gpwtiFirst, KeSetEvent(), tagTDB::nEvents, tagWOWPROCESSINFO::nTaskLock, NULL, tagTHREADINFO::pEventQueueServer, tagWOWPROCESSINFO::pEventWowExec, tagWOWTHREADINFO::pIdleEvent, tagTHREADINFO::ptdb, tagWOWPROCESSINFO::ptdbHead, tagTDB::ptdbNext, tagTDB::pti, tagWOWPROCESSINFO::ptiScheduled, tagPROCESSINFO::pwpi, tagTDB::pwti, tagWOWTHREADINFO::pwtiNext, tagDESKTOPINFO::spwndShell, tagTDB::TDB_Flags, and TDBF_SETUP.

Referenced by xxxDestroyThreadInfo().

00132 { 00133 PTDB ptdbToRemove = ptiToRemove->ptdb; 00134 PTDB ptdb; 00135 PTDB* pptdb; 00136 PWOWPROCESSINFO pwpi = ppi->pwpi; 00137 00138 // try to catch #150446 00139 CheckCritIn(); 00140 BEGINATOMICCHECK(); 00141 00142 UserAssert(pwpi != NULL); 00143 00144 if (ptdbToRemove != NULL) { 00145 00146 if (ptdbToRemove->TDB_Flags & TDBF_SETUP) { 00147 /* 00148 * This means that the WoW app was a setup app (checked in SetAppCompatFlags). 00149 * If so, the shell needs to be notified so it can clean up potential problems 00150 * caused by bad calls to DDE, etc. FritzS 00151 */ 00152 PDESKTOPINFO pdeskinfo = GETDESKINFO(ptiToRemove); 00153 if (pdeskinfo->spwndShell) { 00154 _PostMessage(pdeskinfo->spwndShell, DTM_SETUPAPPRAN, 0, 0); 00155 } 00156 } 00157 /* 00158 * Remove the WOW per thread info 00159 */ 00160 if (ptdbToRemove->pwti) { 00161 PWOWTHREADINFO *ppwti = &gpwtiFirst; 00162 while (*ppwti != ptdbToRemove->pwti && (*ppwti)->pwtiNext != NULL) { 00163 ppwti = &((*ppwti)->pwtiNext); 00164 } 00165 if (*ppwti == ptdbToRemove->pwti) { 00166 *ppwti = ptdbToRemove->pwti->pwtiNext; 00167 } 00168 CLOSE_PSEUDO_EVENT(&ptdbToRemove->pwti->pIdleEvent); 00169 UserFreePool(ptdbToRemove->pwti); 00170 } 00171 00172 gpsi->nEvents -= ptdbToRemove->nEvents; 00173 00174 /* 00175 * remove it from any lists 00176 */ 00177 pptdb = &pwpi->ptdbHead; 00178 while ((ptdb = *pptdb) != NULL) { 00179 /* 00180 * Remove it from it's old location 00181 */ 00182 if (ptdb == ptdbToRemove) { 00183 *pptdb = ptdb->ptdbNext; 00184 UserFreePool(ptdbToRemove); 00185 UserAssert(ptiToRemove->ptdb == ptdbToRemove); 00186 ptiToRemove->ptdb = NULL; 00187 break; 00188 } 00189 pptdb = &(ptdb->ptdbNext); 00190 } 00191 UserAssert(ptdb == ptdbToRemove); // #150446 check that we actually found it 00192 } 00193 ENDATOMICCHECK(); // #150446 00194 00195 /* 00196 * If the task being destroyed is the active task, make nobody active. 00197 * We will go through this code path for 32-bit threads that die while 00198 * Win16 threads are waiting for a SendMessage reply from them. 00199 */ 00200 if (pwpi->ptiScheduled == ptiToRemove) { 00201 pwpi->ptiScheduled = NULL; 00202 ExitWowCritSect(ptiToRemove, pwpi); 00203 00204 /* 00205 * If this active task was locked, remove lock so next guy can 00206 * run. 00207 */ 00208 pwpi->nTaskLock = 0; 00209 00210 00211 /* 00212 * Wake next task with events, or wowexec to run the scheduler 00213 */ 00214 if (pwpi->ptdbHead != NULL) { 00215 PTDB ptdb; 00216 00217 for (ptdb = pwpi->ptdbHead; ptdb; ptdb = ptdb->ptdbNext) { 00218 if (ptdb->nEvents > 0) { 00219 KeSetEvent(ptdb->pti->pEventQueueServer, 00220 EVENT_INCREMENT, FALSE); 00221 break; 00222 } 00223 } 00224 00225 if (!ptdb) { 00226 KeSetEvent(pwpi->pEventWowExec, EVENT_INCREMENT, FALSE); 00227 } 00228 } 00229 } 00230 UserAssert(ptiToRemove != pwpi->CSOwningThread); 00231 00232 }

VOID DestroyThreadsHotKeys VOID   ) 
 

VOID DestroyThreadsObjects VOID   ) 
 

VOID DestroyThreadsTimers PTHREADINFO  pti  ) 
 

Definition at line 472 of file timers.c.

References FreeTimer(), gptmrFirst, NULL, tagTIMER::pti, tagTIMER::ptiOptCreator, tagTIMER::ptmrNext, and VOID().

Referenced by xxxDestroyThreadInfo().

00474 { 00475 PTIMER ptmr; 00476 00477 ptmr = gptmrFirst; 00478 00479 while (ptmr != NULL) { 00480 00481 /* 00482 * Is this one of the timers we're looking for? If so, destroy it. 00483 */ 00484 if (ptmr->pti == pti || ptmr->ptiOptCreator == pti) { 00485 PTIMER ptmrNext = ptmr->ptmrNext; 00486 FreeTimer(ptmr); 00487 ptmr = ptmrNext; 00488 } else { 00489 ptmr = ptmr->ptmrNext; 00490 } 00491 } 00492 }

void DestroyUnlockedCursor void *   ) 
 

Definition at line 680 of file loadbits.c.

References _DestroyCursor(), and CURSOR_THREADCLEANUP.

00681 { 00682 _DestroyCursor((PCURSOR)pv, CURSOR_THREADCLEANUP); 00683 }

VOID DestroyWindowsHotKeys PWND  pwnd  ) 
 

Definition at line 93 of file hotkeys.c.

References gphkFirst, tagHOTKEY::phkNext, tagHOTKEY::spwnd, Unlock, and VOID().

Referenced by xxxFreeWindow().

00095 { 00096 PHOTKEY *pphk; 00097 PHOTKEY phk; 00098 pphk = &gphkFirst; 00099 while (*pphk) { 00100 if ((*pphk)->spwnd == pwnd) { 00101 phk = *pphk; 00102 *pphk = (*pphk)->phkNext; 00103 00104 Unlock(&phk->spwnd); 00105 UserFreePool(phk); 00106 } else { 00107 pphk = &((*pphk)->phkNext); 00108 } 00109 } 00110 }

BOOL DestroyWindowSmIcon PWND  pwnd  ) 
 

Definition at line 1067 of file dwp.c.

References _DestroyCursor(), _GetProp(), tagSERVERINFO::atomIconSmProp, BOOL, ClrWF, CURSOR_ALWAYSDESTROY, CURSORF_SECRET, FALSE, gpsi, HMValidateHandleNoRip(), InternalRemoveProp(), MAKEINTATOM, NULL, PROPF_INTERNAL, TRUE, TYPE_CURSOR, and WFSMQUERYDRAGICON.

Referenced by xxxFreeWindow(), xxxRecreateSmallIcons(), and xxxSetClassIconEnum().

01069 { 01070 HCURSOR hcursor; 01071 PCURSOR pcursor; 01072 01073 // 01074 // Get the small icon property first... 01075 // 01076 hcursor = (HCURSOR)_GetProp(pwnd, MAKEINTATOM(gpsi->atomIconSmProp), PROPF_INTERNAL); 01077 if (hcursor == NULL) 01078 return FALSE; 01079 01080 pcursor = (PCURSOR)HMValidateHandleNoRip(hcursor, TYPE_CURSOR); 01081 if (pcursor == NULL) 01082 return FALSE; 01083 01084 // 01085 // Remove it if it's a secretly created one 01086 // 01087 01088 if (pcursor->CURSORF_flags & CURSORF_SECRET) 01089 { 01090 ClrWF(pwnd, WFSMQUERYDRAGICON); 01091 InternalRemoveProp(pwnd, MAKEINTATOM(gpsi->atomIconSmProp), PROPF_INTERNAL); 01092 _DestroyCursor(pcursor, CURSOR_ALWAYSDESTROY); 01093 return(TRUE); 01094 } 01095 else 01096 return(FALSE); 01097 }

VOID DestroyWindowStation IN PEPROCESS Process  OPTIONAL,
IN PVOID  Object,
IN ACCESS_MASK  GrantedAccess,
IN ULONG  ProcessHandleCount,
IN ULONG  SystemHandleCount
 

Referenced by Win32UserInitialize().

VOID DestroyWindowsTimers PWND  pwnd  ) 
 

Definition at line 504 of file timers.c.

References FreeTimer(), gptmrFirst, NULL, tagTIMER::ptmrNext, tagTIMER::spwnd, and VOID().

Referenced by xxxClientShutdown2(), and xxxFreeWindow().

00506 { 00507 PTIMER ptmr; 00508 00509 ptmr = gptmrFirst; 00510 00511 while (ptmr != NULL) { 00512 00513 /* 00514 * Is this one of the timers we're looking for? If so, destroy it. 00515 */ 00516 if (ptmr->spwnd == pwnd) { 00517 PTIMER ptmrNext = ptmr->ptmrNext; 00518 FreeTimer(ptmr); 00519 ptmr = ptmrNext; 00520 } else { 00521 ptmr = ptmr->ptmrNext; 00522 } 00523 } 00524 }

NTSTATUS DeviceNotify IN PPLUGPLAY_NOTIFY_HDR  pNotification,
IN PDEVICEINFO  pDeviceInfo
 

Definition at line 1025 of file w32/ntuser/kernel/pnp.c.

References CheckCritOut, CheckDeviceInfoListCritOut, FALSE, gbRemoteSession, GDIAF_DEPARTED, GDIAF_PNPWAITING, GDIAF_QUERYREMOVE, GDIAF_REMOVECANCELLED, gpDeviceInfoList, NTSTATUS(), NULL, PsGetCurrentThread, RequestDeviceChange(), and USHORT.

01028 { 01029 USHORT usAction; 01030 01031 #if DBG 01032 { 01033 PDEVICEINFO pDeviceInfoDbg; 01034 for (pDeviceInfoDbg = gpDeviceInfoList; pDeviceInfoDbg; pDeviceInfoDbg = pDeviceInfoDbg->pNext) { 01035 if (pDeviceInfoDbg == pDeviceInfo) { 01036 break; 01037 } 01038 } 01039 UserAssertMsg1(pDeviceInfoDbg != NULL, "Notification for unlisted DEVICEINFO %lx", pDeviceInfo); 01040 } 01041 #endif 01042 01043 CheckCritOut(); 01044 01045 UserAssert(!gbRemoteSession); 01046 01047 TAGMSG1(DBGTAG_PNP | RIP_THERESMORE, "DeviceNotify >>> %lx", pDeviceInfo); 01048 01049 UserAssert(pDeviceInfo->OpenerProcess != PsGetCurrentThread()->Cid.UniqueProcess); 01050 UserAssert(pDeviceInfo->usActions == 0); 01051 01052 if (IsEqualGUID(&pNotification->Event, &GUID_TARGET_DEVICE_QUERY_REMOVE)) { 01053 TAGMSG0(DBGTAG_PNP | RIP_NONAME, "QueryRemove"); 01054 usAction = GDIAF_QUERYREMOVE; 01055 01056 } else if (IsEqualGUID(&pNotification->Event, &GUID_TARGET_DEVICE_REMOVE_CANCELLED)) { 01057 TAGMSG0(DBGTAG_PNP | RIP_NONAME, "RemoveCancelled"); 01058 usAction = GDIAF_REMOVECANCELLED; 01059 01060 } else if (IsEqualGUID(&pNotification->Event, &GUID_TARGET_DEVICE_REMOVE_COMPLETE)) { 01061 TAGMSG1(DBGTAG_PNP | RIP_NONAME, "RemoveComplete (process %#x)", PsGetCurrentThread()->Cid.UniqueProcess); 01062 usAction = GDIAF_DEPARTED; 01063 01064 } else { 01065 TAGMSG4(DBGTAG_PNP | RIP_NONAME, "GUID Unknown: %lx:%lx:%lx:%x...", 01066 pNotification->Event.Data1, pNotification->Event.Data2, 01067 pNotification->Event.Data3, pNotification->Event.Data4[0]); 01068 return STATUS_UNSUCCESSFUL; 01069 } 01070 01071 /* 01072 * Signal the RIT to ProcessDeviceChanges() 01073 * Wait for completion according to the GDIAF_PNPWAITING bit 01074 */ 01075 CheckCritOut(); 01076 CheckDeviceInfoListCritOut(); 01077 RequestDeviceChange(pDeviceInfo, (USHORT)(usAction | GDIAF_PNPWAITING), FALSE); 01078 01079 return STATUS_SUCCESS; 01080 }

VOID DirectedScheduleTask PTHREADINFO  ptiOld,
PTHREADINFO  ptiNew,
BOOL  bSendMsg,
PSMS  psms
 

Definition at line 594 of file taskman.c.

References BOOL, CheckCritIn, gpsi, InsertTask(), tagTDB::nEvents, tagTDB::nPriority, tagWOWPROCESSINFO::nRecvLock, tagWOWPROCESSINFO::nSendLock, tagTHREADINFO::ppi, tagTHREADINFO::psmsSent, tagTHREADINFO::ptdb, tagWOWPROCESSINFO::ptiScheduled, tagPROCESSINFO::pwpi, SMF_WOWRECEIVE, SMF_WOWSEND, TIF_16BIT, tagTHREADINFO::TIF_flags, VOID(), and WakeWowTask().

Referenced by _ReplyMessage(), ReceiverDied(), xxxInterSendMsgEx(), xxxReceiveMessage(), and xxxSleepTask().

00600 { 00601 PWOWPROCESSINFO pwpiOld; 00602 PWOWPROCESSINFO pwpiNew; 00603 00604 CheckCritIn(); 00605 00606 pwpiOld = ptiOld->ppi->pwpi; 00607 pwpiNew = ptiNew->ppi->pwpi; 00608 00609 00610 /* 00611 * If old task is 16 bit, reinsert the task in its wow scheduler list 00612 * so that it is lowest in priority. Note that ptiOld is always the 00613 * same as pwpiOld->ptiScheduled except when called from ReceiverDied. 00614 */ 00615 if (ptiOld->TIF_flags & TIF_16BIT) { 00616 00617 if (pwpiOld->ptiScheduled == ptiOld) { 00618 ptiOld->ptdb->nEvents++; 00619 gpsi->nEvents++; 00620 InsertTask(ptiOld->ppi, ptiOld->ptdb); 00621 } 00622 00623 00624 // Update the Send\Recv counts for interprocess scheduling in SleepTask 00625 00626 if (pwpiOld != pwpiNew || !(ptiNew->TIF_flags & TIF_16BIT)) { 00627 if (bSendMsg) { 00628 pwpiOld->nSendLock++; 00629 psms->flags |= SMF_WOWSEND; 00630 } 00631 else if (pwpiOld->nRecvLock && psms->flags & SMF_WOWRECEIVE) { 00632 pwpiOld->nRecvLock--; 00633 psms->flags &= ~SMF_WOWRECEIVE; 00634 } 00635 } 00636 00637 } 00638 00639 00640 /* 00641 * If the new task is 16 bit, reinsert into the wow scheduler list 00642 * so that it will run, if its a sendmsg raise priority of the receiver. 00643 * If its a reply and the sender is waiting for this psms or the sender 00644 * has a message to reply to raise priority of the sender. 00645 */ 00646 if (ptiNew->TIF_flags & TIF_16BIT) { 00647 BOOL bRaisePriority; 00648 00649 ptiNew->ptdb->nEvents++; 00650 gpsi->nEvents++; 00651 bRaisePriority = bSendMsg || psms == ptiNew->psmsSent; 00652 00653 if (bRaisePriority) { 00654 ptiNew->ptdb->nPriority--; 00655 } 00656 00657 InsertTask(ptiNew->ppi, ptiNew->ptdb); 00658 00659 if (bRaisePriority) { 00660 ptiNew->ptdb->nPriority++; 00661 WakeWowTask(ptiNew); 00662 } 00663 00664 00665 // Update the Send\Recv counts for interprocess scheduling in SleepTask 00666 00667 if (pwpiOld != pwpiNew || !(ptiOld->TIF_flags & TIF_16BIT)) { 00668 if (bSendMsg) { 00669 pwpiNew->nRecvLock++; 00670 psms->flags |= SMF_WOWRECEIVE; 00671 } 00672 else if (pwpiNew->nSendLock && psms->flags & SMF_WOWSEND) { 00673 pwpiNew->nSendLock--; 00674 psms->flags &= ~SMF_WOWSEND; 00675 } 00676 } 00677 00678 } 00679 }

VOID DisownClipboard PWND  pwndClipOwner  ) 
 

Definition at line 2687 of file ntuser/kernel/clipbrd.c.

References BOOL, CheckClipboardAccess(), tagWINDOWSTATION::cNumClipFormats, DUMMY_TEXT_HANDLE, FALSE, tagWINDOWSTATION::fClipboardChanged, tagWINDOWSTATION::iClipSequenceNumber, IsTextHandle, MungeClipData(), NULL, tagWINDOWSTATION::pClipBase, PtiCurrent, tagWINDOWSTATION::spwndClipOwner, ThreadLockWinSta, ThreadUnlockWinSta, TRUE, Unlock, VOID(), xxxDrawClipboard(), and xxxSendClipboardMessage().

Referenced by xxxDW_SendDestroyMessages().

02688 { 02689 TL tlpwinsta; 02690 PWINDOWSTATION pwinsta; 02691 int iFmt; 02692 int cFmts; 02693 PCLIP pClip; 02694 PCLIP pClipOut; 02695 BOOL fKeepDummyHandle; 02696 PTHREADINFO ptiCurrent; 02697 02698 if ((pwinsta = CheckClipboardAccess()) == NULL) 02699 return; 02700 02701 ptiCurrent = PtiCurrent(); 02702 02703 ThreadLockWinSta(ptiCurrent, pwinsta, &tlpwinsta); 02704 02705 xxxSendClipboardMessage(pwinsta, WM_RENDERALLFORMATS); 02706 02707 pClipOut = pClip = pwinsta->pClipBase; 02708 fKeepDummyHandle = FALSE; 02709 02710 for (cFmts = 0, iFmt = pwinsta->cNumClipFormats; iFmt-- != 0;) { 02711 02712 /* 02713 * We have to remove the Dummy handles also if the corresponding 02714 * valid handles are NULL; We should not remove the dummy handles if 02715 * the corresponding valid handles are not NULL; 02716 * The following code assumes that only one dummy handle is possible 02717 * and that can appear only after the corresponding valid handle in 02718 * the pClip linked list; 02719 * Fix for Bug #???? --SANKAR-- 10-19-89 --OPUS BUG #3252-- 02720 */ 02721 if (pClip->hData != NULL) { 02722 02723 if ((pClip->hData != DUMMY_TEXT_HANDLE) || 02724 ((pClip->hData == DUMMY_TEXT_HANDLE) && fKeepDummyHandle)) { 02725 02726 cFmts++; 02727 *pClipOut++ = *pClip; 02728 02729 if (IsTextHandle(pClip->fmt, pClip->hData)) { 02730 fKeepDummyHandle = TRUE; 02731 } 02732 } 02733 } 02734 02735 pClip++; 02736 } 02737 02738 /* 02739 * Unlock the clipboard owner if the owner is still the window we were cleaning 02740 * up for. 02741 */ 02742 if (pwndClipOwner == pwinsta->spwndClipOwner) { 02743 Unlock(&pwinsta->spwndClipOwner); 02744 } else { 02745 RIPMSG2(RIP_WARNING, "DisownClipboard: pwndClipOwner changed from %#p to %#p", 02746 pwndClipOwner, pwinsta->spwndClipOwner); 02747 } 02748 02749 /* 02750 * If number of formats changed, redraw. 02751 */ 02752 if (cFmts != pwinsta->cNumClipFormats) { 02753 pwinsta->fClipboardChanged = TRUE; 02754 pwinsta->iClipSequenceNumber++; 02755 } 02756 02757 pwinsta->cNumClipFormats = cFmts; 02758 02759 /* 02760 * If anything changed, redraw. And make sure the data type munging is done. Or else we will lose 02761 * them when xxxDrawClipboard clears the fClipboardChanged flag 02762 */ 02763 if (pwinsta->fClipboardChanged) { 02764 xxxDrawClipboard(pwinsta); 02765 MungeClipData(pwinsta); 02766 } 02767 02768 ThreadUnlockWinSta(ptiCurrent, &tlpwinsta); 02769 }

BOOL DoPaint PWND  pwndFilter,
LPMSG  lpMsg
 

Definition at line 574 of file paint.c.

References BOOL, CheckPwndFilter(), ClrWF, DecPaintCount(), DWORD, FALSE, FNID_DESKTOP, GETFNID, tagWND::hrgnUpdate, InternalDoPaint(), L, NULL, tagDESKTOP::pDeskInfo, PtiCurrent, tagTHREADINFO::pwinsta, tagTHREADINFO::rpdesk, tagWINDOWSTATION::rpdeskList, tagDESKTOP::rpdeskNext, SetWF, tagDESKTOPINFO::spwnd, tagWND::spwndParent, StoreMessage(), TestWF, tagTHREADINFO::TIF_flags, TIF_SYSTEMTHREAD, TRUE, WFCLIPCHILDREN, WFINTERNALPAINT, WFMINIMIZED, WFSTARTPAINT, WFUPDATEDIRTY, WFWIN40COMPAT, and WFWMPAINTSENT.

Referenced by xxxInternalGetMessage().

00577 { 00578 PWND pwnd; 00579 PWND pwndT; 00580 PTHREADINFO ptiCurrent = PtiCurrent(); 00581 00582 00583 #if 0 // CHRISWIL: WIN95 SPECIFIC 00584 00585 /* 00586 * If there is a system modal up and it is attached to another task, 00587 * DON'T do paints. We don't want to return a message for a window in 00588 * another task! 00589 */ 00590 if (hwndSysModal && (hwndSysModal->hq != hqCurrent)) { 00591 00592 /* 00593 * Poke this guy so he wakes up at some point in the future, 00594 * otherwise he may never wake up to realize he should paint. 00595 * Causes hangs - e.g. Photoshop installation program 00596 * PostThreadMessage32(Lpq(hqCurrent)->idThread, WM_NULL, 0, 0, 0); 00597 */ 00598 return FALSE; 00599 } 00600 00601 #endif 00602 00603 /* 00604 * If this is a system thread, then walk the windowstation desktop-list 00605 * to find the window which needs painting. For other threads, we 00606 * reference off the thread-desktop. 00607 */ 00608 if (ptiCurrent->TIF_flags & TIF_SYSTEMTHREAD) { 00609 00610 PWINDOWSTATION pwinsta; 00611 PDESKTOP pdesk; 00612 00613 if ((pwinsta = ptiCurrent->pwinsta) == NULL) { 00614 RIPMSG0(RIP_ERROR, "DoPaint: SYSTEMTHREAD does not have (pwinsta)"); 00615 return FALSE; 00616 } 00617 00618 pwnd = NULL; 00619 for(pdesk = pwinsta->rpdeskList; pdesk; pdesk = pdesk->rpdeskNext) { 00620 00621 if (pwnd = InternalDoPaint(pdesk->pDeskInfo->spwnd, ptiCurrent)) 00622 break; 00623 } 00624 00625 } else { 00626 pwnd = InternalDoPaint(ptiCurrent->rpdesk->pDeskInfo->spwnd, 00627 ptiCurrent); 00628 } 00629 00630 if (pwnd != NULL) { 00631 00632 if (!CheckPwndFilter(pwnd, pwndFilter)) 00633 return FALSE; 00634 00635 /* 00636 * We're returning a WM_PAINT message, so clear WFINTERNALPAINT so 00637 * it won't get sent again later. 00638 */ 00639 if (TestWF(pwnd, WFINTERNALPAINT)) { 00640 00641 ClrWF(pwnd, WFINTERNALPAINT); 00642 00643 /* 00644 * If there is no update region, then no more paint for this 00645 * window. 00646 */ 00647 if (pwnd->hrgnUpdate == NULL) 00648 DecPaintCount(pwnd); 00649 } 00650 00651 /* 00652 * Set the STARTPAINT so that any other calls to BeginPaint while 00653 * painting is begin performed, will prevent painting on those 00654 * windows. 00655 * 00656 * Clear the UPDATEDIRTY since some apps (DBFast) don't call 00657 * GetUpdateRect, BeginPaint/EndPaint. 00658 */ 00659 ClrWF(pwnd, WFSTARTPAINT); 00660 ClrWF(pwnd, WFUPDATEDIRTY); 00661 00662 /* 00663 * If we get an invalidate between now and the time the app calls 00664 * BeginPaint() and the windows parent is not CLIPCHILDREN, then 00665 * the parent will paint in the wrong order. So we are going to 00666 * cause the child to paint again. Look in beginpaint and internal 00667 * invalidate for other parts of this fix. 00668 * 00669 * Set a flag to signify that we are in the bad zone. 00670 * 00671 * Must go up the parent links to make sure all parents have 00672 * WFCLIPCHILDREN set otherwise set the WFWMPAINTSENT flag. 00673 * This is to fix Excel spreadsheet and fulldrag. The speadsheet 00674 * parent window (class XLDESK) has WFCLIPCHILDREN set but it's 00675 * parent (class XLMAIN) doesn't. So the main window erases the 00676 * background after the child window paints. 00677 * 00678 * JOHANNEC : 27-Jul-1994 00679 */ 00680 00681 /* 00682 * NT Bug 400167: As we walk up the tree, we need to stop short of 00683 * desktop windows and mother desktop windows. We can't do a test 00684 * for WFCLIPCHILDREN on the mother desktop window's parent because 00685 * it doesn't exist. This means that no desktop window will get 00686 * WFWMPAINTSENT set, but the message window will be able to get 00687 * WFWMPAINTSENT set. 00688 */ 00689 00690 pwndT = pwnd; 00691 while (pwndT && (GETFNID(pwndT) != FNID_DESKTOP)) { 00692 00693 if (!TestWF(pwndT->spwndParent, WFCLIPCHILDREN)) { 00694 SetWF(pwnd, WFWMPAINTSENT); 00695 break; 00696 } 00697 00698 pwndT = pwndT->spwndParent; 00699 } 00700 00701 /* 00702 * If the top level "tiled" owner/parent of this window is iconed, 00703 * send a WM_PAINTICON rather than a WM_PAINT. The wParam 00704 * is TRUE if this is the tiled window and FALSE if it is a 00705 * child/owned popup of the minimized window. 00706 * 00707 * BACKWARD COMPATIBILITY HACK 00708 * 00709 * 3.0 sent WM_PAINTICON with wParam == TRUE for no apparent 00710 * reason. Lotus Notes 2.1 depends on this for some reason 00711 * to properly change its icon when new mail arrives. 00712 */ 00713 if (!TestWF(pwnd, WFWIN40COMPAT) && 00714 TestWF(pwnd, WFMINIMIZED) && 00715 (pwnd->pcls->spicn != NULL)) { 00716 00717 StoreMessage(lpMsg, pwnd, WM_PAINTICON, (DWORD)TRUE, 0L, 0L); 00718 00719 } else { 00720 00721 StoreMessage(lpMsg, pwnd, WM_PAINT, 0, 0L, 0L); 00722 } 00723 00724 return TRUE; 00725 } 00726 00727 return FALSE; 00728 }

BOOL DoTimer PWND  pwndFilter  ) 
 

Definition at line 538 of file timers.c.

References AllocQEntry(), BOOL, CheckCritIn, CheckPwndFilter(), DecTimerCount(), FALSE, tagTIMER::flags, gptmrFirst, tagTHREADINFO::mlPost, tagTIMER::nID, NULL, tagTIMER::pfn, tagTIMER::pti, PtiCurrent, tagTIMER::ptmrNext, tagTIMER::ptmrPrev, SetWakeBit(), tagTIMER::spwnd, StoreQMessage(), StoreQMessagePti(), TRUE, UINT, and WM_SYSTIMER.

Referenced by xxxInternalGetMessage().

00540 { 00541 PTHREADINFO pti; 00542 PTIMER ptmr; 00543 PTIMER ptmrNext; 00544 PQMSG pqmsg; 00545 00546 CheckCritIn(); 00547 00548 pti = PtiCurrent(); 00549 00550 /* 00551 * Search for a timer that belongs to this queue. 00552 */ 00553 ptmr = gptmrFirst; 00554 00555 while (ptmr != NULL) { 00556 00557 /* 00558 * Has this timer gone off and is it one we're looking for? 00559 */ 00560 if ((ptmr->flags & TMRF_READY) && 00561 (ptmr->pti == pti) && 00562 CheckPwndFilter(ptmr->spwnd, pwndFilter)) { 00563 00564 /* 00565 * We found an appropriate timer. Put it in the app's queue and 00566 * return success. 00567 */ 00568 if ((pqmsg = AllocQEntry(&pti->mlPost)) != NULL) { 00569 00570 /* 00571 * Store the message and set the QS_POSTMESSAGE bit so the 00572 * thread knows it has a message. 00573 */ 00574 StoreQMessage(pqmsg, 00575 ptmr->spwnd, 00576 (UINT)((ptmr->flags & TMRF_SYSTEM) ? 00577 WM_SYSTIMER : WM_TIMER), 00578 (WPARAM)ptmr->nID, 00579 (LPARAM)ptmr->pfn, 00580 0, 0, 0); 00581 #ifdef REDIRECTION 00582 StoreQMessagePti(pqmsg, pti); 00583 #endif // REDIRECTION 00584 SetWakeBit(pti, QS_POSTMESSAGE | QS_ALLPOSTMESSAGE); 00585 } 00586 00587 /* 00588 * Reset this timer. 00589 */ 00590 ptmr->flags &= ~TMRF_READY; 00591 DecTimerCount(ptmr->pti); 00592 00593 /* 00594 * If there are other timers in the system move this timer 00595 * to the end of the list so other timers in for this queue 00596 * get a chance to go off. 00597 */ 00598 ptmrNext = ptmr->ptmrNext; 00599 if (ptmrNext != NULL) { 00600 00601 /* 00602 * Remove ptmr from its place in the list. 00603 */ 00604 if (ptmr->ptmrPrev) { 00605 ptmr->ptmrPrev->ptmrNext = ptmr->ptmrNext; 00606 } else 00607 gptmrFirst = ptmr->ptmrNext; 00608 00609 ptmrNext->ptmrPrev = ptmr->ptmrPrev; 00610 00611 /* 00612 * Move to the last TIMER of the list. 00613 */ 00614 while (ptmrNext->ptmrNext != NULL) 00615 ptmrNext = ptmrNext->ptmrNext; 00616 00617 /* 00618 * Insert this timer at the end. 00619 */ 00620 ptmrNext->ptmrNext = ptmr; 00621 ptmr->ptmrPrev = ptmrNext; 00622 ptmr->ptmrNext = NULL; 00623 } 00624 00625 return TRUE; 00626 } 00627 00628 ptmr = ptmr->ptmrNext; 00629 } 00630 00631 return FALSE; 00632 }

void DrawSize PWND  pwnd,
HDC  hdc,
int  cxFrame,
int  cyFrame
 

Definition at line 481 of file sbctl.c.

References BitBltSysBmp(), DrawBox(), FAR, IsScrollBarControl, OBI_NCGRIP, OBI_NCGRIP_L, tagWND::rcWindow, SBFSIZEGRIP, SizeBoxHwnd(), SYSHBR, SYSMET, TestWF, and WEFLEFTSCROLL.

Referenced by xxxDrawWindowFrame(), and xxxSBWndProc().

00482 { 00483 int x, y; 00484 //HBRUSH hbrSave; 00485 00486 if (TestWF(pwnd, WEFLEFTSCROLL)) { 00487 x = cxFrame; 00488 } else { 00489 x = pwnd->rcWindow.right - pwnd->rcWindow.left - cxFrame - SYSMET(CXVSCROLL); 00490 } 00491 y = pwnd->rcWindow.bottom - pwnd->rcWindow.top - cyFrame - SYSMET(CYHSCROLL); 00492 00493 // If we have a scrollbar control, or the sizebox is not associated with 00494 // a sizeable window, draw the flat gray sizebox. Otherwise, use the 00495 // sizing grip. 00496 if (IsScrollBarControl(pwnd)) 00497 { 00498 if (TestWF(pwnd, SBFSIZEGRIP)) 00499 goto DrawSizeGrip; 00500 else 00501 goto DrawBox; 00502 00503 } 00504 else if (!SizeBoxHwnd(pwnd)) 00505 { 00506 DrawBox: 00507 { 00508 //hbrSave = GreSelectBrush(hdc, SYSHBR(3DFACE)); 00509 //GrePatBlt(hdc, x, y, SYSMET(CXVSCROLL), SYSMET(CYHSCROLL), PATCOPY); 00510 //GreSelectBrush(hdc, hbrSave); 00511 00512 POLYPATBLT PolyData; 00513 00514 PolyData.x = x; 00515 PolyData.y = y; 00516 PolyData.cx = SYSMET(CXVSCROLL); 00517 PolyData.cy = SYSMET(CYHSCROLL); 00518 PolyData.BrClr.hbr = SYSHBR(3DFACE); 00519 00520 GrePolyPatBlt(hdc,PATCOPY,&PolyData,1,PPB_BRUSH); 00521 00522 } 00523 } 00524 else 00525 { 00526 DrawSizeGrip: 00527 // Blt out the grip bitmap. 00528 BitBltSysBmp(hdc, x, y, TestWF(pwnd, WEFLEFTSCROLL) ? OBI_NCGRIP_L : OBI_NCGRIP); 00529 } 00530 }

VOID DrawThumb2 PWND  ,
PSBCALC  ,
HDC  ,
HBRUSH  ,
BOOL  ,
UINT 
 

Definition at line 697 of file sbctl.c.

References BOOL, tagSBTRACK::cmdSB, tagSBCALC::cpxThumb, DrawGroove(), DrawPushButton(), FALSE, tagSBTRACK::fTrackRecalc, tagSBTRACK::fTrackVert, InvertRect(), LTUPFLAG, PWNDTOPSBTRACK, tagSBCALC::pxBottom, tagSBCALC::pxDownArrow, tagSBCALC::pxLeft, tagSBCALC::pxRight, tagSBCALC::pxThumbBottom, tagSBCALC::pxThumbTop, tagSBCALC::pxTop, tagSBCALC::pxUpArrow, tagSBTRACK::rcTrack, RecalcTrackRect(), RTDNFLAG, and tagSBTRACK::spwndTrack.

Referenced by DrawCtlThumb(), xxxDrawSB2(), xxxDrawThumb(), xxxMoveThumb(), and xxxSBWndProc().

00704 { 00705 int *pLength; 00706 int *pWidth; 00707 RECT rcSB; 00708 PSBTRACK pSBTrack; 00709 00710 // 00711 // Bail out if the scrollbar has an empty rect 00712 // 00713 if ((pSBCalc->pxTop >= pSBCalc->pxBottom) || (pSBCalc->pxLeft >= pSBCalc->pxRight)) 00714 return; 00715 pLength = (LPINT)&rcSB; 00716 if (fVert) 00717 pWidth = pLength++; 00718 else 00719 pWidth = pLength + 1; 00720 00721 pWidth[0] = pSBCalc->pxLeft; 00722 pWidth[2] = pSBCalc->pxRight; 00723 00724 /* 00725 * If both scroll bar arrows are disabled, then we should not draw 00726 * the thumb. So, quit now! 00727 */ 00728 if (((wDisable & LTUPFLAG) && (wDisable & RTDNFLAG)) || 00729 ((pSBCalc->pxDownArrow - pSBCalc->pxUpArrow) < pSBCalc->cpxThumb)) { 00730 pLength[0] = pSBCalc->pxUpArrow; 00731 pLength[2] = pSBCalc->pxDownArrow; 00732 00733 DrawGroove(hdc, hbr, &rcSB, fVert); 00734 return; 00735 } 00736 00737 if (pSBCalc->pxUpArrow < pSBCalc->pxThumbTop) { 00738 // Fill in space above Thumb 00739 pLength[0] = pSBCalc->pxUpArrow; 00740 pLength[2] = pSBCalc->pxThumbTop; 00741 00742 DrawGroove(hdc, hbr, &rcSB, fVert); 00743 } 00744 00745 if (pSBCalc->pxThumbBottom < pSBCalc->pxDownArrow) { 00746 // Fill in space below Thumb 00747 pLength[0] = pSBCalc->pxThumbBottom; 00748 pLength[2] = pSBCalc->pxDownArrow; 00749 00750 DrawGroove(hdc, hbr, &rcSB, fVert); 00751 } 00752 00753 // 00754 // Draw elevator 00755 // 00756 pLength[0] = pSBCalc->pxThumbTop; 00757 pLength[2] = pSBCalc->pxThumbBottom; 00758 00759 // Not soft! 00760 DrawPushButton(hdc, &rcSB, 0, 0); 00761 00762 /* 00763 * If we're tracking a page scroll, then we've obliterated the hilite. 00764 * We need to correct the hiliting rectangle, and rehilite it. 00765 */ 00766 pSBTrack = PWNDTOPSBTRACK(pwnd); 00767 00768 if (pSBTrack && (pSBTrack->cmdSB == SB_PAGEUP || pSBTrack->cmdSB == SB_PAGEDOWN) && 00769 (pwnd == pSBTrack->spwndTrack) && 00770 (BOOL)pSBTrack->fTrackVert == fVert) { 00771 00772 if (pSBTrack->fTrackRecalc) { 00773 RecalcTrackRect(pSBTrack); 00774 pSBTrack->fTrackRecalc = FALSE; 00775 } 00776 00777 pLength = (int *)&pSBTrack->rcTrack; 00778 00779 if (fVert) 00780 pLength++; 00781 00782 if (pSBTrack->cmdSB == SB_PAGEUP) 00783 pLength[2] = pSBCalc->pxThumbTop; 00784 else 00785 pLength[0] = pSBCalc->pxThumbBottom; 00786 00787 if (pLength[0] < pLength[2]) 00788 InvertRect(hdc, &pSBTrack->rcTrack); 00789 } 00790 }

PWND DSW_GetTopLevelCreatorWindow PWND  pwnd  ) 
 

Definition at line 69 of file tmswitch.c.

References NULL, and tagWND::spwndOwner.

Referenced by xxxPaintIconsInSwitchWindow(), and xxxSetForegroundWindow().

00071 { 00072 UserAssert(pwnd != NULL); 00073 00074 if (pwnd != NULL) { 00075 while (pwnd->spwndOwner) 00076 pwnd = pwnd->spwndOwner; 00077 } 00078 00079 return pwnd; 00080 }

PWND DWP_GetEnabledPopup PWND  pwndStart  ) 
 

Definition at line 125 of file dwp.c.

References GETPTI, NULL, tagTHREADINFO::pq, tagWND::spwndChild, tagWND::spwndNext, tagWND::spwndOwner, tagWND::spwndParent, TestWF, TIF_16BIT, tagTHREADINFO::TIF_flags, WFDISABLED, and WFVISIBLE.

Referenced by GetActiveTrackPwnd(), and xxxDWP_SetCursor().

00127 { 00128 PWND pwndT, pwnd; 00129 PTHREADINFO ptiStart; 00130 00131 ptiStart = GETPTI(pwndStart); 00132 pwnd = pwndStart->spwndNext; 00133 00134 #ifdef SYSMODALWINDOWS 00135 if (gspwndSysModal) 00136 return NULL; 00137 #endif 00138 00139 /* 00140 * The user clicked on a window that is disabled. That window is pwndStart. 00141 * This loop is designed to evaluate what application this window is 00142 * associated with, and activate that "application", by finding what window 00143 * associated with that application can be activated. This is done by 00144 * enumerating top level windows, searching for a top level enabled 00145 * and visible ownee associated with this application. 00146 */ 00147 while (pwnd != pwndStart) { 00148 if (pwnd == NULL) { 00149 00150 /* 00151 * Warning! Win 3.1 had PWNDDESKTOP(pwndStart)->spwndChild 00152 * which could loop forever if pwndStart was a child window 00153 */ 00154 pwnd = pwndStart->spwndParent->spwndChild; 00155 continue; 00156 } 00157 00158 /* 00159 * We have two cases we need to watch out for here. The first is when 00160 * applications call AssociateThreadInput() to tie two threads 00161 * together to share input state. If the threads own the same queue, 00162 * then associate them together: this way, when two threads call 00163 * AttachThreadInput(), one created the main window, one created the 00164 * dialog window, when you click on the main window, they'll both 00165 * come to the top (rather than beeping). In this case we want to 00166 * compare queues. When Control Panel starts Setup in the Network 00167 * applet is one type of example of attached input. 00168 * 00169 * The second case is WOW apps. All wow apps have the same queue 00170 * so to retain Win 3.1 compatibility, we want to treat each app 00171 * as an individual task (Win 3.1 tests hqs), so we will compare 00172 * PTI's for WOW apps. 00173 * 00174 * To see this case start 16 bit notepad and 16 bit write. Do file 00175 * open on write and then give notepad the focus now click on write's 00176 * main window and the write file open dialog should activate. 00177 * 00178 * Another related case is powerpnt. This case is interesting because 00179 * it tests that we do not find another window to activate when nested 00180 * windows are up and you click on a owner's owner. Run Powerpnt, do 00181 * Edit-Insert-Picture and Object-Recolor Picture will bring up a 00182 * dialog with combos, drop down one of the color combo and then click 00183 * on powerpnt's main window - focus should stay with the dialogs 00184 * combo and it should stay dropped down. 00185 */ 00186 if (((ptiStart->TIF_flags & TIF_16BIT) && (GETPTI(pwnd) == ptiStart)) || 00187 (!(ptiStart->TIF_flags & TIF_16BIT) && (GETPTI(pwnd)->pq == ptiStart->pq))) { 00188 00189 if (!TestWF(pwnd, WFDISABLED) && TestWF(pwnd, WFVISIBLE)) { 00190 pwndT = pwnd->spwndOwner; 00191 00192 /* 00193 * If this window is the parent of a popup window, 00194 * bring up only one. 00195 */ 00196 while (pwndT) { 00197 if (pwndT == pwndStart) 00198 return pwnd; 00199 00200 pwndT = pwndT->spwndOwner; 00201 } 00202 00203 /* 00204 * Win9x continues looping only if pwnd is WEFTOPMOST. NT4 just returns, like Win3.1 00205 * As soon as we find a window on the queue, we stop. So if the queue owns 00206 * multiple top level unowned windows, then this code will probably not find 00207 * the enabled popup. Note that owned windows are supposed to be on top of the 00208 * owner, usally right on top of it (ie, pwnd->spwndNext == pwnd->spwndOwner) 00209 * so this code used to find any other top level unowned windows before the enabled 00210 * popup and bail. Odd. 00211 * So let's continue looping. Hopefully this won't cause any compatibility problems 00212 */ 00213 // return NULL; 00214 } 00215 } 00216 pwnd = pwnd->spwndNext; 00217 } 00218 00219 return NULL; 00220 }

UINT DWP_GetHotKey PWND   ) 
 

Definition at line 242 of file winhtky.c.

References HotKeyHelper(), tagHOTKEYSTRUCT::key, NULL, and UINT.

Referenced by xxxDefWindowProc().

00244 { 00245 PHOTKEYSTRUCT phk; 00246 00247 if ((phk = HotKeyHelper(pwnd)) == NULL) 00248 return 0; 00249 00250 return phk->key; 00251 }

HICON DWP_GetIcon PWND  pwnd,
UINT  uType
 

Definition at line 1022 of file dwp.c.

References _GetProp(), tagSERVERINFO::atomIconProp, tagSERVERINFO::atomIconSmProp, CURSORF_SECRET, gpsi, HMValidateHandleNoRip(), MAKEINTATOM, NULL, PROPF_INTERNAL, and TYPE_CURSOR.

Referenced by xxxDefWindowProc().

01025 { 01026 HICON hicoTemp; 01027 01028 if (uType < ICON_SMALL || uType > ICON_BIG) 01029 { 01030 RIPERR1(ERROR_INVALID_PARAMETER, RIP_WARNING, "WM_GETICON: Invalid wParam value (0x%X)", uType); 01031 return (HICON)NULL; 01032 } 01033 01034 /* 01035 * Get the icon from the window 01036 */ 01037 hicoTemp = (HICON)_GetProp(pwnd, 01038 MAKEINTATOM(uType == ICON_SMALL ? gpsi->atomIconSmProp : gpsi->atomIconProp), 01039 PROPF_INTERNAL); 01040 01041 /* 01042 * If it's a USER created small icon don't return it. 01043 */ 01044 if (uType == ICON_SMALL && hicoTemp) { 01045 PCURSOR pcurTemp; 01046 01047 pcurTemp = (PCURSOR)HMValidateHandleNoRip((HCURSOR)hicoTemp, TYPE_CURSOR); 01048 if (pcurTemp != NULL && (pcurTemp->CURSORF_flags & CURSORF_SECRET)) { 01049 hicoTemp = (HICON)NULL; 01050 } 01051 } 01052 01053 return hicoTemp; 01054 }

UINT DWP_SetHotKey PWND  ,
DWORD 
 

Definition at line 96 of file winhtky.c.

References BOOL, FALSE, gcHotKey, gcHotKeyAlloc, gpHotKeyList, HotKeyHelper(), HOTKEYSTRUCT, HotKeyToWindow(), tagHOTKEYSTRUCT::key, LOBYTE, Lock, NULL, tagHOTKEYSTRUCT::spwnd, TestWF, TRUE, UINT, Unlock, and WFCHILD.

Referenced by xxxCreateWindowEx(), xxxDefWindowProc(), and xxxDestroyWindow().

00099 { 00100 PHOTKEYSTRUCT phk; 00101 BOOL fKeyExists = FALSE; 00102 PWND pwndTemp; 00103 00104 /* 00105 * Filter out invalid hotkeys 00106 */ 00107 if (LOBYTE(dwKey) == VK_ESCAPE || 00108 LOBYTE(dwKey) == VK_SPACE || 00109 LOBYTE(dwKey) == VK_TAB || 00110 LOBYTE(dwKey) == VK_PACKET) { 00111 00112 return (UINT)-1; 00113 } 00114 00115 /* 00116 * Don't allow hotkeys for children 00117 */ 00118 if (TestWF(pwnd, WFCHILD)) 00119 return 0; 00120 00121 /* 00122 * Check if the hot key exists and is assigned to a different pwnd 00123 */ 00124 if (dwKey != 0) { 00125 00126 pwndTemp = HotKeyToWindow(dwKey); 00127 00128 if ((pwndTemp != NULL) && (pwndTemp != pwnd)) 00129 fKeyExists = TRUE; 00130 } 00131 00132 /* 00133 * Get the hotkey assigned to the window, if any 00134 */ 00135 if ((phk = HotKeyHelper(pwnd)) == NULL) { 00136 00137 /* 00138 * Window doesn't exist in the hotkey list and key is being set 00139 * to zero, so just return. 00140 */ 00141 if (dwKey == 0) 00142 return 1; 00143 00144 /* 00145 * Allocate and point to a spot for the new hotkey 00146 */ 00147 if (gcHotKey >= gcHotKeyAlloc) { 00148 00149 if (gcHotKeyAlloc) { 00150 00151 phk = (PHOTKEYSTRUCT)UserReAllocPool( 00152 (HANDLE)gpHotKeyList, 00153 gcHotKeyAlloc * sizeof(HOTKEYSTRUCT), 00154 (gcHotKey + 1) * sizeof(HOTKEYSTRUCT), TAG_HOTKEY); 00155 00156 if (phk != NULL) { 00157 00158 gpHotKeyList = phk; 00159 phk = &gpHotKeyList[gcHotKey++]; 00160 gcHotKeyAlloc = gcHotKey; 00161 00162 } else { 00163 00164 return 0; 00165 } 00166 00167 } else { 00168 00169 UserAssert(gpHotKeyList == NULL); 00170 UserAssert(gcHotKey == 0); 00171 00172 phk = (PHOTKEYSTRUCT)UserAllocPool(sizeof(HOTKEYSTRUCT), 00173 TAG_HOTKEY); 00174 00175 if (phk != NULL) { 00176 00177 gpHotKeyList = phk; 00178 gcHotKey = 1; 00179 gcHotKeyAlloc = 1; 00180 00181 } else { 00182 00183 return 0; 00184 } 00185 } 00186 00187 } else { 00188 phk = &gpHotKeyList[gcHotKey++]; 00189 } 00190 } 00191 00192 if (dwKey == 0) { 00193 00194 /* 00195 * The hotkey for this window is being deleted. Copy the last item 00196 * on the list on top of the one being deleted. 00197 */ 00198 if (--gcHotKey) { 00199 00200 Lock(&phk->spwnd, gpHotKeyList[gcHotKey].spwnd); 00201 Unlock(&gpHotKeyList[gcHotKey].spwnd); 00202 00203 phk->key = gpHotKeyList[gcHotKey].key; 00204 phk = (PHOTKEYSTRUCT)UserReAllocPool((HANDLE)gpHotKeyList, 00205 gcHotKeyAlloc * sizeof(HOTKEYSTRUCT), 00206 gcHotKey * sizeof(HOTKEYSTRUCT), TAG_HOTKEY); 00207 00208 if (phk != NULL) { 00209 gpHotKeyList = phk; 00210 gcHotKeyAlloc = gcHotKey; 00211 } 00212 00213 } else { 00214 00215 Unlock(&gpHotKeyList[gcHotKey].spwnd); 00216 UserFreePool((HANDLE)gpHotKeyList); 00217 gpHotKeyList = NULL; 00218 gcHotKeyAlloc = 0; 00219 } 00220 00221 } else { 00222 00223 /* 00224 * Add the window and key to the list 00225 */ 00226 phk->spwnd = NULL; 00227 Lock(&phk->spwnd, pwnd); 00228 phk->key = dwKey; 00229 } 00230 00231 return fKeyExists ? 2 : 1; 00232 }

void EnforceColorDependentSettings void   ) 
 

Definition at line 2782 of file w32/ntuser/kernel/init.c.

References FALSE, tagDISPLAYINFO::fAnyPalette, gbDisableAlpha, gpDispInfo, tagDISPLAYINFO::hdcScreen, and TRUE.

Referenced by LoadCPUserPreferences(), and UpdateUserScreen().

02783 { 02784 if (gpDispInfo->fAnyPalette) { 02785 gbDisableAlpha = TRUE; 02786 } else if (GreGetDeviceCaps(gpDispInfo->hdcScreen, NUMCOLORS) == -1) { 02787 gbDisableAlpha = FALSE; 02788 } else { 02789 gbDisableAlpha = TRUE; 02790 } 02791 }

VOID EnterCrit VOID   ) 
 

__inline VOID EnterDeviceInfoListCrit  ) 
 

Definition at line 7254 of file userk.h.

Referenced by CreateDeviceInfo(), InputApc(), NlsKbdSendIMENotification(), ProcessDeviceChanges(), RawInputThread(), RequestDeviceChange(), StartDeviceRead(), UpdateKeyLights(), UpdateMouseInfo(), and Win32kNtUserCleanup().

07264 {

__inline VOID EnterHandleFlagsCrit  ) 
 

Definition at line 7307 of file userk.h.

References FALSE, HF_PROTECTED, NTSTATUS(), NULL, and SetHandleFlag().

Referenced by CheckHandleFlag(), CheckHandleInUse(), SetHandleFlag(), SetHandleInUse(), and UserDeleteW32Process().

07309 { 07310 if (handle != NULL) {

__inline VOID EnterMouseCrit  ) 
 

Definition at line 7233 of file userk.h.

Referenced by QueueMouseEvent(), and UnqueueMouseEvent().

07243 {

VOID EnterSharedCrit VOID   ) 
 

_inline VOID EnterWowCritSect PTHREADINFO  pti,
PWOWPROCESSINFO  pwpi
 

Definition at line 5343 of file userk.h.

References VOID().

Referenced by xxxSleepTask(), and zzzInitTask().

05357 { 05358 if (!++pwpi->CSLockCount) { 05359 pwpi->CSOwningThread = pti; 05360 return;

__inline BOOL ExitMenuLoop PMENUSTATE  pMenuState,
PPOPUPMENU  ppopupmenu
 

Definition at line 4723 of file userk.h.

Referenced by xxxCallHandleMenuMessages(), xxxHandleMenuMessages(), xxxMNLoop(), xxxTrackPopupMenuEx(), xxxUnlockMenuState(), and zzzAttachToQueue().

04730 {

_inline VOID ExitWowCritSect PTHREADINFO  pti,
PWOWPROCESSINFO  pwpi
 

Definition at line 5364 of file userk.h.

Referenced by DestroyTask(), and xxxSleepTask().

05378 {

DWORD FastGetProfileDwordW PUNICODE_STRING pProfileUserName  OPTIONAL,
UINT  idSection,
LPCWSTR  lpKeyName,
DWORD  dwDefault
 

Definition at line 575 of file w32/ntuser/kernel/profile.c.

References BYTE, DWORD, gbRemoteSession, NT_SUCCESS, NULL, OpenCacheKeyEx(), PMAP_LAST, RemoteOpenCacheKeyEx(), RtlInitUnicodeString(), and Status.

Referenced by IsIMMEnabledSystem(), OpenMultiplePortDevice(), SetDebugHotKeys(), Win32UserInitialize(), and xxxUpdatePerUserSystemParameters().

00580 { 00581 HANDLE hKey; 00582 DWORD cbSize; 00583 DWORD dwRet; 00584 LONG Status; 00585 UNICODE_STRING UnicodeString; 00586 BYTE Buf[sizeof(KEY_VALUE_PARTIAL_INFORMATION) + sizeof(DWORD)]; 00587 00588 UserAssert(idSection <= PMAP_LAST); 00589 00590 if (gbRemoteSession) { 00591 00592 hKey = RemoteOpenCacheKeyEx(idSection, KEY_READ); 00593 if (hKey != NULL) { 00594 goto Override; 00595 } 00596 } 00597 00598 if ((hKey = OpenCacheKeyEx(pProfileUserName, 00599 idSection, 00600 KEY_READ, 00601 NULL)) == NULL) { 00602 RIPMSG1(RIP_WARNING | RIP_NONAME, "%ws", lpKeyName); 00603 return dwDefault; 00604 } 00605 00606 Override: 00607 00608 RtlInitUnicodeString(&UnicodeString, lpKeyName); 00609 Status = ZwQueryValueKey(hKey, 00610 &UnicodeString, 00611 KeyValuePartialInformation, 00612 (PKEY_VALUE_PARTIAL_INFORMATION)Buf, 00613 sizeof(Buf), 00614 &cbSize); 00615 00616 dwRet = dwDefault; 00617 00618 if (NT_SUCCESS(Status)) { 00619 00620 dwRet = *((PDWORD)((PKEY_VALUE_PARTIAL_INFORMATION)Buf)->Data); 00621 00622 } else if (Status != STATUS_OBJECT_NAME_NOT_FOUND) { 00623 00624 RIPMSG1(RIP_WARNING, 00625 "FastGetProfileDwordW: ObjectName not found: %ws", 00626 lpKeyName); 00627 } 00628 00629 ZwClose(hKey); 00630 00631 return dwRet; 00632 }

int FastGetProfileIntFromID PUNICODE_STRING pProfileUserName  OPTIONAL,
UINT  idSection,
UINT  idKey,
int  def
 

Definition at line 1031 of file w32/ntuser/kernel/profile.c.

References ARRAY_SIZE, FastGetProfileIntW(), gpsi, hModuleWin, MultDiv, PMAP_LAST, and ServerLoadString.

Referenced by LW_LoadProfileInitData(), MetricGetID(), and xxxUpdatePerUserSystemParameters().

01036 { 01037 int result; 01038 WCHAR szKey[80]; 01039 01040 01041 UserAssert(idSection <= PMAP_LAST); 01042 01043 ServerLoadString(hModuleWin, idKey, szKey, ARRAY_SIZE(szKey)); 01044 01045 result = FastGetProfileIntW(pProfileUserName,idSection, szKey, def); 01046 01047 /* 01048 * If you change the below list of STR_* make sure you make a 01049 * corresponding change in SetWindowMetricInt (rare.c) 01050 */ 01051 switch (idKey) { 01052 case STR_BORDERWIDTH: 01053 case STR_SCROLLWIDTH: 01054 case STR_SCROLLHEIGHT: 01055 case STR_CAPTIONWIDTH: 01056 case STR_CAPTIONHEIGHT: 01057 case STR_SMCAPTIONWIDTH: 01058 case STR_SMCAPTIONHEIGHT: 01059 case STR_MENUWIDTH: 01060 case STR_MENUHEIGHT: 01061 case STR_ICONHORZSPACING: 01062 case STR_ICONVERTSPACING: 01063 case STR_MINWIDTH: 01064 case STR_MINHORZGAP: 01065 case STR_MINVERTGAP: 01066 /* 01067 * Convert any registry values stored in TWIPS back to pixels 01068 */ 01069 if (result < 0) 01070 result = MultDiv(-result, gpsi->dmLogPixels, 72 * 20); 01071 break; 01072 } 01073 01074 return result; 01075 }

BOOL FastGetProfileIntsW PUNICODE_STRING pProfileUserName  OPTIONAL,
PPROFINTINFO  ppii
 

Definition at line 1290 of file w32/ntuser/kernel/profile.c.

References ARRAY_SIZE, BOOL, FastGetProfileIntW(), hModuleWin, tagPROFINTINFO::idSection, tagPROFINTINFO::lpKeyName, tagPROFINTINFO::nDefault, PPROFINTINFO, PTR_TO_ID, tagPROFINTINFO::puResult, ServerLoadString, and TRUE.

Referenced by xxxSetDeskWallpaper(), and xxxUpdatePerUserSystemParameters().

01293 { 01294 WCHAR szKey[40]; 01295 01296 while (ppii->idSection != 0) { 01297 01298 ServerLoadString(hModuleWin, 01299 PTR_TO_ID(ppii->lpKeyName), 01300 szKey, 01301 ARRAY_SIZE(szKey)); 01302 01303 *ppii->puResult = FastGetProfileIntW(pProfileUserName, 01304 ppii->idSection, 01305 szKey, 01306 ppii->nDefault 01307 ); 01308 ppii++; 01309 } 01310 01311 return TRUE; 01312 }

UINT FastGetProfileIntW PUNICODE_STRING pProfileUserName  OPTIONAL,
UINT  idSection,
LPCWSTR  lpKeyName,
UINT  nDefault
 

Definition at line 945 of file w32/ntuser/kernel/profile.c.

References FastGetProfileStringW(), NULL, PMAP_LAST, RtlInitUnicodeString(), RtlUnicodeStringToInteger(), and UINT.

Referenced by FastGetProfileIntFromID(), FastGetProfileIntsW(), GetKbdLangSwitch(), UpdatePerUserKeyboardIndicators(), xxxUpdatePerUserAccessPackSettings(), and xxxUpdatePerUserSystemParameters().

00950 { 00951 WCHAR ValueBuf[40]; 00952 UNICODE_STRING Value; 00953 UINT ReturnValue; 00954 00955 UserAssert(idSection <= PMAP_LAST); 00956 00957 if (!FastGetProfileStringW(pProfileUserName, 00958 idSection, 00959 lpKeyName, 00960 NULL, 00961 ValueBuf, 00962 sizeof(ValueBuf) / sizeof(WCHAR) 00963 )) { 00964 00965 return nDefault; 00966 } 00967 00968 /* 00969 * Convert string to int. 00970 */ 00971 RtlInitUnicodeString(&Value, ValueBuf); 00972 RtlUnicodeStringToInteger(&Value, 10, &ReturnValue); 00973 00974 return ReturnValue; 00975 }

DWORD FastGetProfileKeysW PUNICODE_STRING pProfileUserName  OPTIONAL,
UINT  idSection,
LPCWSTR  pszDefault,
LPWSTR *  ppszKeys
 

Definition at line 642 of file w32/ntuser/kernel/profile.c.

References Buffer, DWORD, L, NT_SUCCESS, NULL, OpenCacheKeyEx(), PMAP_LAST, Status, and TRUE.

Referenced by bEnumerateRegistryFonts().

00647 { 00648 HANDLE hKey; 00649 DWORD cchSize; 00650 DWORD cchKey; 00651 LONG Status; 00652 WCHAR Buffer[256 + 6]; 00653 PKEY_VALUE_BASIC_INFORMATION pKeyInfo; 00654 ULONG iValue; 00655 LPWSTR lpTmp; 00656 LPWSTR lpKeys = NULL; 00657 DWORD dwPoolSize; 00658 00659 UserAssert(idSection <= PMAP_LAST); 00660 00661 if ((hKey = OpenCacheKeyEx(pProfileUserName, 00662 idSection, 00663 KEY_READ, 00664 NULL)) == NULL) { 00665 RIPMSG0(RIP_WARNING | RIP_NONAME, ""); 00666 goto DefExit; 00667 } 00668 00669 pKeyInfo = (PKEY_VALUE_BASIC_INFORMATION)Buffer; 00670 cchSize = 0; 00671 *lpReturnedString = NULL; 00672 iValue = 0; 00673 00674 while (TRUE) { 00675 00676 #if DBG 00677 wcscpy(Buffer + 256, L"DON'T"); 00678 #endif 00679 Status = ZwEnumerateValueKey(hKey, 00680 iValue, 00681 KeyValueBasicInformation, 00682 pKeyInfo, 00683 sizeof(Buffer), 00684 &cchKey); 00685 00686 UserAssert(_wcsicmp(Buffer + 256, L"DON'T") == 0); 00687 00688 if (Status == STATUS_NO_MORE_ENTRIES) { 00689 00690 break; 00691 00692 } else if (!NT_SUCCESS(Status)) { 00693 00694 if (lpKeys) { 00695 UserFreePool(lpKeys); 00696 lpKeys = NULL; 00697 } 00698 goto DefExit; 00699 } 00700 00701 UserAssert(pKeyInfo->NameLength * sizeof(WCHAR) <= 00702 sizeof(Buffer) - sizeof(KEY_VALUE_BASIC_INFORMATION)); 00703 00704 UserAssert(cchKey <= sizeof(Buffer)); 00705 00706 /* 00707 * A key was found. Allocate space for it. Note that 00708 * NameLength is in bytes. 00709 */ 00710 cchKey = cchSize; 00711 cchSize += pKeyInfo->NameLength + sizeof(WCHAR); 00712 00713 if (lpKeys == NULL) { 00714 00715 dwPoolSize = cchSize + sizeof(WCHAR); 00716 lpKeys = UserAllocPoolWithQuota(dwPoolSize, TAG_PROFILE); 00717 00718 } else { 00719 00720 lpTmp = lpKeys; 00721 lpKeys = UserReAllocPoolWithQuota(lpTmp, 00722 dwPoolSize, 00723 cchSize + sizeof(WCHAR), 00724 TAG_PROFILE); 00725 00726 /* 00727 * Free the original buffer if the allocation fails 00728 */ 00729 if (lpKeys == NULL) { 00730 UserFreePool(lpTmp); 00731 } 00732 dwPoolSize = cchSize + sizeof(WCHAR); 00733 } 00734 00735 /* 00736 * Check for out of memory. 00737 */ 00738 if (lpKeys == NULL) 00739 goto DefExit; 00740 00741 /* 00742 * NULL terminate the string and append it to 00743 * the key list. 00744 */ 00745 UserAssert(pKeyInfo->NameLength < sizeof(Buffer) - sizeof(KEY_VALUE_BASIC_INFORMATION)); 00746 00747 RtlCopyMemory(&lpKeys[cchKey / sizeof(WCHAR)], pKeyInfo->Name, pKeyInfo->NameLength); 00748 lpKeys[(cchKey + pKeyInfo->NameLength) / sizeof(WCHAR)] = 0; 00749 00750 iValue++; 00751 } 00752 00753 /* 00754 * If no keys were found, return the default. 00755 */ 00756 if (iValue == 0) { 00757 00758 DefExit: 00759 00760 cchSize = wcslen(lpDefault)+1; 00761 lpKeys = UserAllocPoolWithQuota((cchSize+1) * sizeof(WCHAR), TAG_PROFILE); 00762 00763 if (lpKeys) 00764 wcscpy(lpKeys, lpDefault); 00765 else 00766 cchSize = 0; 00767 00768 } else { 00769 00770 /* 00771 * Turn the byte count into a char count. 00772 */ 00773 cchSize /= sizeof(WCHAR); 00774 } 00775 00776 /* 00777 * Make sure hKey is closed. 00778 */ 00779 if (hKey) 00780 ZwClose(hKey); 00781 00782 /* 00783 * Append the ending NULL. 00784 */ 00785 if (lpKeys) 00786 lpKeys[cchSize] = 0; 00787 00788 *lpReturnedString = lpKeys; 00789 00790 return cchSize; 00791 }

DWORD FastGetProfileStringFromIDW PUNICODE_STRING pProfileUserName  OPTIONAL,
UINT  idSection,
UINT  idKey,
LPCWSTR  lpDefault,
LPWSTR  lpReturnedString,
DWORD  cch
 

Definition at line 1086 of file w32/ntuser/kernel/profile.c.

References ARRAY_SIZE, DWORD, FastGetProfileStringW(), hModuleWin, PMAP_LAST, and ServerLoadString.

Referenced by GetDeskWallpaperName(), LW_LoadResources(), xxxODI_ColorInit(), xxxSetDeskPattern(), xxxSystemParametersInfo(), xxxUpdateSystemCursorsFromRegistry(), and xxxUpdateSystemIconsFromRegistry().

01093 { 01094 WCHAR szKey[80]; 01095 01096 UserAssert(idSection <= PMAP_LAST); 01097 01098 ServerLoadString(hModuleWin, idKey, szKey, ARRAY_SIZE(szKey)); 01099 01100 return FastGetProfileStringW(pProfileUserName, 01101 idSection, 01102 szKey, 01103 lpDefault, 01104 lpReturnedString, 01105 cch 01106 ); 01107 }

DWORD FastGetProfileStringW PUNICODE_STRING pProfileUserName  OPTIONAL,
UINT  idSection,
LPCWSTR  lpKeyName,
LPCWSTR  lpDefault,
LPWSTR  lpReturnedString,
DWORD  nSize
 

Definition at line 806 of file w32/ntuser/kernel/profile.c.

References BOOL, DWORD, FALSE, gbRemoteSession, gdwPolicyFlags, gpidLogon, L, NT_SUCCESS, NULL, OpenCacheKeyEx(), PMAP_LAST, PsGetCurrentProcess, RemoteOpenCacheKeyEx(), RtlInitUnicodeString(), Status, and TRUE.

Referenced by bEnumerateRegistryFonts(), FastGetProfileIntW(), FastGetProfileStringFromIDW(), InitCreateUserSubsystem(), OpenMultiplePortDevice(), SetAppCompatFlags(), SetAppImeCompatFlags(), and xxxUpdatePerUserAccessPackSettings().

00813 { 00814 HANDLE hKey = NULL; 00815 DWORD cbSize; 00816 LONG Status; 00817 UNICODE_STRING UnicodeString; 00818 PKEY_VALUE_PARTIAL_INFORMATION pKeyInfo; 00819 BOOL bRemoteOverride = FALSE; 00820 DWORD dwPolicyFlags = gdwPolicyFlags; 00821 00822 00823 UserAssert(idSection <= PMAP_LAST); 00824 UserAssert(lpKeyName != NULL); 00825 00826 if (gbRemoteSession) { 00827 hKey = RemoteOpenCacheKeyEx(idSection, KEY_READ); 00828 if (hKey != NULL) { 00829 bRemoteOverride = TRUE; 00830 goto Override; 00831 } 00832 } 00833 00834 TryAgain: 00835 if ((hKey = OpenCacheKeyEx(pProfileUserName, 00836 idSection, 00837 KEY_READ, 00838 &dwPolicyFlags)) == NULL) { 00839 00840 #if DBG 00841 if (PsGetCurrentProcess()->UniqueProcessId != gpidLogon) { 00842 RIPMSG1(RIP_WARNING | RIP_NONAME, "%ws", lpKeyName); 00843 } 00844 #endif 00845 goto DefExit; 00846 } 00847 00848 Override: 00849 00850 cbSize = (cchBuf * sizeof(WCHAR)) + 00851 FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data); 00852 00853 if ((pKeyInfo = UserAllocPoolWithQuota(cbSize, TAG_PROFILE)) == NULL) 00854 goto DefExit; 00855 00856 RtlInitUnicodeString(&UnicodeString, lpKeyName); 00857 Status = ZwQueryValueKey(hKey, 00858 &UnicodeString, 00859 KeyValuePartialInformation, 00860 pKeyInfo, 00861 cbSize, 00862 &cbSize); 00863 00864 if (Status == STATUS_BUFFER_OVERFLOW) { 00865 RIPMSG0(RIP_WARNING, "FastGetProfileStringW: Buffer overflow"); 00866 Status = STATUS_SUCCESS; 00867 } 00868 00869 UserAssert(NT_SUCCESS(Status) || (Status == STATUS_OBJECT_NAME_NOT_FOUND)); 00870 00871 if (NT_SUCCESS(Status)) { 00872 00873 if (pKeyInfo->DataLength >= sizeof(WCHAR)) { 00874 00875 ((LPWSTR)(pKeyInfo->Data))[cchBuf - 1] = L'\0'; 00876 wcscpy(lpReturnedString, (LPWSTR)pKeyInfo->Data); 00877 00878 } else { 00879 /* 00880 * Appears to be a bug with empty strings - only first 00881 * byte is set to NULL. (SAS) 00882 */ 00883 lpReturnedString[0] = TEXT('\0'); 00884 } 00885 00886 cchBuf = pKeyInfo->DataLength; 00887 00888 UserFreePool(pKeyInfo); 00889 00890 ZwClose(hKey); 00891 00892 /* 00893 * data length includes terminating zero [bodind] 00894 */ 00895 return (cchBuf / sizeof(WCHAR)); 00896 00897 } else if (bRemoteOverride) { 00898 bRemoteOverride = FALSE; 00899 UserFreePool(pKeyInfo); 00900 ZwClose(hKey); 00901 hKey = NULL; 00902 goto TryAgain; 00903 00904 } else if (dwPolicyFlags) { 00905 UserFreePool(pKeyInfo); 00906 ZwClose(hKey); 00907 goto TryAgain; 00908 } 00909 00910 UserFreePool(pKeyInfo); 00911 00912 DefExit: 00913 00914 /* 00915 * Make sure the key is closed. 00916 */ 00917 if (hKey) 00918 ZwClose(hKey); 00919 00920 /* 00921 * wcscopy copies terminating zero, but the length returned by 00922 * wcslen does not, so add 1 to be consistent with success 00923 * return [bodind] 00924 */ 00925 if (lpDefault != NULL) { 00926 cchBuf = wcslen(lpDefault) + 1; 00927 RtlCopyMemory(lpReturnedString, lpDefault, cchBuf * sizeof(WCHAR)); 00928 return cchBuf; 00929 } 00930 00931 return 0; 00932 }

DWORD FastGetProfileValue PUNICODE_STRING pProfileUserName  OPTIONAL,
UINT  idSection,
LPCWSTR  lpKeyName,
LPBYTE  lpDefault,
LPBYTE  lpReturn,
UINT  cbSizeReturn
 

Definition at line 1173 of file w32/ntuser/kernel/profile.c.

References ARRAY_SIZE, DWORD, gbRemoteSession, hModuleWin, IS_PTR, NT_SUCCESS, NULL, OpenCacheKeyEx(), PMAP_LAST, PTR_TO_ID, RemoteOpenCacheKeyEx(), RtlInitUnicodeString(), ServerLoadString, SERVERSTRINGMAXSIZE, Status, and UINT.

Referenced by CreateFontFromWinIni(), CreateSetupNameArray(), InitScancodeMap(), LoadCPUserPreferences(), SetAppCompatFlags(), xxxSystemParametersInfo(), and xxxUpdatePerUserSystemParameters().

01180 { 01181 HANDLE hKey; 01182 UINT cbSize; 01183 LONG Status; 01184 UNICODE_STRING UnicodeString; 01185 PKEY_VALUE_PARTIAL_INFORMATION pKeyInfo; 01186 WCHAR szKey[SERVERSTRINGMAXSIZE]; 01187 KEY_VALUE_PARTIAL_INFORMATION KeyInfo; 01188 01189 UserAssert(idSection <= PMAP_LAST); 01190 01191 if (!IS_PTR(lpKeyName)) { 01192 *szKey = (WCHAR)0; 01193 ServerLoadString(hModuleWin, PTR_TO_ID(lpKeyName), szKey, ARRAY_SIZE(szKey)); 01194 UserAssert(*szKey != (WCHAR)0); 01195 lpKeyName = szKey; 01196 } 01197 01198 if (gbRemoteSession) { 01199 hKey = RemoteOpenCacheKeyEx(idSection, KEY_READ); 01200 if (hKey != NULL) { 01201 goto Override; 01202 } 01203 } 01204 01205 if ((hKey = OpenCacheKeyEx(pProfileUserName, 01206 idSection, 01207 KEY_READ, 01208 NULL)) == NULL) { 01209 // if hi-word of lpKeName is 0, it is a resource number not a string 01210 01211 if (!IS_PTR(lpKeyName)) 01212 RIPMSG1(RIP_WARNING, "FastGetProfileValue: Failed to open cache-key (%08x)", lpKeyName); 01213 else 01214 RIPMSG1(RIP_WARNING | RIP_NONAME, "%ws", lpKeyName); 01215 01216 goto DefExit; 01217 } 01218 01219 Override: 01220 01221 if (cbSizeReturn == 0) { 01222 cbSize = sizeof(KeyInfo); 01223 pKeyInfo = &KeyInfo; 01224 } else { 01225 cbSize = cbSizeReturn + FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data); 01226 if ((pKeyInfo = UserAllocPoolWithQuota(cbSize, TAG_PROFILE)) == NULL) { 01227 goto DefExit; 01228 } 01229 } 01230 01231 RtlInitUnicodeString(&UnicodeString, lpKeyName); 01232 01233 Status = ZwQueryValueKey(hKey, 01234 &UnicodeString, 01235 KeyValuePartialInformation, 01236 pKeyInfo, 01237 cbSize, 01238 &cbSize); 01239 01240 if (NT_SUCCESS(Status)) { 01241 01242 UserAssert(cbSizeReturn >= pKeyInfo->DataLength); 01243 01244 cbSize = pKeyInfo->DataLength; 01245 RtlCopyMemory(lpReturn, pKeyInfo->Data, cbSize); 01246 01247 if (cbSizeReturn != 0) { 01248 UserFreePool(pKeyInfo); 01249 } 01250 ZwClose(hKey); 01251 01252 return cbSize; 01253 } else if ((Status == STATUS_BUFFER_OVERFLOW) && (cbSizeReturn == 0)) { 01254 ZwClose(hKey); 01255 return pKeyInfo->DataLength; 01256 } 01257 01258 #if DBG 01259 if (Status != STATUS_OBJECT_NAME_NOT_FOUND) { 01260 RIPMSG3 (RIP_WARNING, "FastGetProfileValue: ZwQueryValueKey Failed. Status:%#lx idSection:%#lx KeyName:%s", 01261 Status, idSection, UnicodeString.Buffer); 01262 } 01263 #endif 01264 01265 if (cbSizeReturn != 0) { 01266 UserFreePool(pKeyInfo); 01267 } 01268 01269 DefExit: 01270 01271 if (hKey) 01272 ZwClose(hKey); 01273 01274 if (lpDefault) { 01275 RtlMoveMemory(lpReturn, lpDefault, cbSizeReturn); 01276 return cbSizeReturn; 01277 } 01278 01279 return 0; 01280 }

BOOL FastUpdateWinIni PUNICODE_STRING pProfileUserName  OPTIONAL,
UINT  idSection,
UINT  wKeyNameId,
LPWSTR  lpszValue
 

Definition at line 1323 of file w32/ntuser/kernel/profile.c.

References ARRAY_SIZE, BOOL, FALSE, FastWriteProfileStringW(), hModuleWin, PMAP_LAST, and ServerLoadString.

Referenced by xxxSystemParametersInfo().

01328 { 01329 WCHAR szKeyName[40]; 01330 BOOL bResult = FALSE; 01331 01332 UserAssert(idSection <= PMAP_LAST); 01333 01334 ServerLoadString(hModuleWin, 01335 wKeyNameId, 01336 szKeyName, 01337 ARRAY_SIZE(szKeyName)); 01338 01339 bResult = FastWriteProfileStringW(pProfileUserName, 01340 idSection, szKeyName, lpszValue); 01341 01342 return bResult; 01343 }

PWND FastWindowFromDC HDC  hdc  ) 
 

Definition at line 2022 of file dc.c.

References tagDCE::DCX_flags, gpDispInfo, tagDCE::hdc, NULL, tagDISPLAYINFO::pdceFirst, tagDCE::pdceNext, and tagDCE::pwndOrg.

Referenced by _ScrollDC().

02024 { 02025 PDCE *ppdce; 02026 PDCE pdceT; 02027 02028 if ((gpDispInfo->pdceFirst->hdc == hdc) && 02029 (gpDispInfo->pdceFirst->DCX_flags & DCX_INUSE)) { 02030 02031 return gpDispInfo->pdceFirst->pwndOrg; 02032 } 02033 02034 for (ppdce = &gpDispInfo->pdceFirst; *ppdce; ppdce = &(*ppdce)->pdceNext) { 02035 02036 if (((*ppdce)->hdc == hdc) && ((*ppdce)->DCX_flags & DCX_INUSE)) { 02037 02038 /* 02039 * Unlink/link to make it first. 02040 */ 02041 pdceT = *ppdce; 02042 *ppdce = pdceT->pdceNext; 02043 pdceT->pdceNext = gpDispInfo->pdceFirst; 02044 gpDispInfo->pdceFirst = pdceT; 02045 02046 return pdceT->pwndOrg; 02047 } 02048 } 02049 02050 return NULL; 02051 }

BOOL FastWriteProfileStringW PUNICODE_STRING pProfileUserName  OPTIONAL,
UINT  idSection,
LPCWSTR  lpKeyName,
LPCWSTR  lpString
 

Definition at line 988 of file w32/ntuser/kernel/profile.c.

References BOOL, FALSE, NT_SUCCESS, NULL, OpenCacheKeyEx(), PMAP_LAST, RtlInitUnicodeString(), and Status.

Referenced by FastUpdateWinIni(), RegisterPerUserKeyboardIndicators(), SetFilterKeys(), SetMouseKeys(), SetSoundSentry(), UpdateWinIniInt(), xxxSystemParametersInfo(), and xxxUpdatePerUserSystemParameters().

00993 { 00994 HANDLE hKey; 00995 LONG Status; 00996 UNICODE_STRING UnicodeString; 00997 00998 UserAssert(idSection <= PMAP_LAST); 00999 01000 if ((hKey = OpenCacheKeyEx(pProfileUserName, 01001 idSection, 01002 KEY_WRITE, 01003 NULL)) == NULL) { 01004 RIPMSG1(RIP_WARNING | RIP_NONAME, "%ws", lpKeyName); 01005 return FALSE; 01006 } 01007 01008 RtlInitUnicodeString(&UnicodeString, lpKeyName); 01009 Status = ZwSetValueKey(hKey, 01010 &UnicodeString, 01011 0, 01012 REG_SZ, 01013 (PVOID)lpString, 01014 (wcslen(lpString) + 1) * sizeof(WCHAR)); 01015 01016 ZwClose(hKey); 01017 01018 return (NT_SUCCESS(Status)); 01019 }

BOOL FastWriteProfileValue PUNICODE_STRING pProfileUserName  OPTIONAL,
UINT  idSection,
LPCWSTR  lpKeyName,
UINT  uType,
LPBYTE  lpStruct,
UINT  cbSizeStruct
 

Definition at line 1115 of file w32/ntuser/kernel/profile.c.

References ARRAY_SIZE, BOOL, FALSE, hModuleWin, IS_PTR, NT_SUCCESS, NULL, OpenCacheKeyEx(), PMAP_LAST, PTR_TO_ID, RtlInitUnicodeString(), ServerLoadString, SERVERSTRINGMAXSIZE, and Status.

Referenced by SetWindowMetricFont(), and xxxSystemParametersInfo().

01122 { 01123 HANDLE hKey; 01124 LONG Status; 01125 UNICODE_STRING UnicodeString; 01126 WCHAR szKey[SERVERSTRINGMAXSIZE]; 01127 01128 UserAssert(idSection <= PMAP_LAST); 01129 01130 if (!IS_PTR(lpKeyName)) { 01131 *szKey = (WCHAR)0; 01132 ServerLoadString(hModuleWin, PTR_TO_ID(lpKeyName), szKey, ARRAY_SIZE(szKey)); 01133 UserAssert(*szKey != (WCHAR)0); 01134 lpKeyName = szKey; 01135 } 01136 01137 if ((hKey = OpenCacheKeyEx(pProfileUserName, 01138 idSection, 01139 KEY_WRITE, 01140 NULL)) == NULL) { 01141 RIPMSG1(RIP_WARNING, "FastWriteProfileValue: Failed to open cache-key (%ws)", lpKeyName); 01142 return FALSE; 01143 } 01144 01145 RtlInitUnicodeString(&UnicodeString, lpKeyName); 01146 01147 Status = ZwSetValueKey(hKey, 01148 &UnicodeString, 01149 0, 01150 uType, 01151 lpStruct, 01152 cbSizeStruct); 01153 ZwClose(hKey); 01154 01155 #if DBG 01156 if (!NT_SUCCESS(Status)) { 01157 RIPMSG3 (RIP_WARNING, "FastWriteProfileValue: ZwSetValueKey Failed. Status:%#lx idSection:%#lx KeyName:%s", 01158 Status, idSection, UnicodeString.Buffer); 01159 } 01160 #endif 01161 01162 return (NT_SUCCESS(Status)); 01163 }

BOOL FBadWindow PWND  pwnd  ) 
 

Definition at line 365 of file focusact.c.

References BOOL, NULL, TestWF, WFDISABLED, and WFVISIBLE.

Referenced by xxxActivateWindow(), and xxxMenuWindowProc().

00367 { 00368 return (pwnd == NULL 00369 || !TestWF(pwnd, WFVISIBLE) 00370 || TestWF(pwnd, WFDISABLED)); 00371 }

BOOL FCallerOk PWND  pwnd  ) 
 

Definition at line 104 of file ntuser/kernel/getset.c.

References BOOL, FALSE, GETPTI, gpidLogon, PtiCurrent, TIF_CSRSSTHREAD, tagTHREADINFO::TIF_flags, TIF_SYSTEMTHREAD, and TRUE.

Referenced by _SetWindowWord(), and xxxSetWindowLongPtr().

00106 { 00107 PTHREADINFO pti = PtiCurrent(); 00108 00109 if ((GETPTI(pwnd)->TIF_flags & (TIF_SYSTEMTHREAD | TIF_CSRSSTHREAD)) && 00110 !(pti->TIF_flags & (TIF_SYSTEMTHREAD | TIF_CSRSSTHREAD))) { 00111 return FALSE; 00112 } 00113 00114 if (GETPTI(pwnd)->pEThread->Cid.UniqueProcess == gpidLogon && 00115 pti->pEThread->Cid.UniqueProcess != gpidLogon) { 00116 return FALSE; 00117 } 00118 00119 return TRUE; 00120 }

BOOL FHungApp PTHREADINFO  pti,
DWORD  dwTimeFromLastRead
 

Definition at line 80 of file hungapp.c.

References BOOL, FALSE, tagCLIENTTHREADINFO::fsWakeMask, GET_TIME_LAST_READ, NtGetTickCount(), tagTHREADINFO::pcti, tagTHREADINFO::ppi, and TRUE.

Referenced by IdleTimerProc(), InterQueueMsgCleanup(), NtUserQueryWindow(), xxxButtonEvent(), xxxCallHook2(), xxxDesktopThread(), xxxDesktopWndProc(), xxxHungAppDemon(), xxxInterSendMsgEx(), xxxQueryInformationThread(), xxxRedrawHungWindow(), xxxSendMessageTimeout(), xxxSetForegroundWindow2(), and xxxSimpleDoSyncPaint().

00083 { 00084 00085 /* 00086 * An app is considered hung if it isn't waiting for input, isn't in 00087 * startup processing, and hasn't called PeekMessage() within the 00088 * specified timeout. 00089 */ 00090 if (((NtGetTickCount() - GET_TIME_LAST_READ(pti)) > dwTimeFromLastRead) && 00091 !((pti->pcti->fsWakeMask & QS_INPUT) && (pti->pEThread->Tcb.FreezeCount == 0)) && 00092 !(pti->ppi->W32PF_Flags & W32PF_APPSTARTING)) { 00093 return TRUE; 00094 } 00095 00096 return FALSE; 00097 }

BOOL FinalUserInit  ) 
 

Referenced by xxxInitWindowStation().

LONG FindBestPos int  x,
int  y,
int  cx,
int  cy,
LPRECT  prcExclude,
UINT  wFlags,
PPOPUPMENU  ppopupmenu,
PMONITOR  pMonitor
 

Definition at line 496 of file mnpopup.c.

References COPY_FLAG, CopyRect, cy, tagPOPUPMENU::iDropDir, IntersectRect(), NULL, PAS_DOWN, PAS_HORZ, PAS_LEFT, PAS_RIGHT, PAS_UP, PAS_VERT, tagMONITOR::rcMonitor, RECT_ONBOTTOM, RECT_ONLEFT, RECT_ONRIGHT, RECT_ONTOP, RECT_ORG, SetRect(), TryRect(), and UINT.

Referenced by xxxMenuWindowProc(), and xxxTrackPopupMenuEx().

00505 { 00506 int iRect; 00507 int iT; 00508 UINT awRect[4]; 00509 POINT ptT; 00510 RECT rcExclude; 00511 // 00512 // Clip our coords on screen first. We use the same algorithm to clip 00513 // as in Win3.1 for dudes with no exclude rect. 00514 // 00515 00516 if (prcExclude!=NULL) { 00517 // Clip exclude rect to monitor! 00518 CopyRect(&rcExclude, prcExclude); 00519 IntersectRect(&rcExclude, &rcExclude, &pMonitor->rcMonitor); 00520 } else { 00521 SetRect(&rcExclude, x, y, x, y); 00522 } 00523 00524 00525 /* 00526 * Make sure popup fits completely on the screen 00527 * At least the x,y point will be on the screen. 00528 */ 00529 if (x + cx > pMonitor->rcMonitor.right) { 00530 if ((wFlags & TPM_CENTERALIGN) 00531 || (x - cx < pMonitor->rcMonitor.left) 00532 || (x >= pMonitor->rcMonitor.right)) { 00533 x = pMonitor->rcMonitor.right - cx; 00534 } else { 00535 x -= cx; 00536 } 00537 if (ppopupmenu->iDropDir & PAS_HORZ) { 00538 COPY_FLAG(ppopupmenu->iDropDir, PAS_LEFT, PAS_HORZ); 00539 } 00540 } 00541 00542 if (x < pMonitor->rcMonitor.left) { 00543 x += cx; 00544 if ((wFlags & TPM_CENTERALIGN) 00545 || (x >= pMonitor->rcMonitor.right) 00546 || (x < pMonitor->rcMonitor.left)) { 00547 x = pMonitor->rcMonitor.left; 00548 } 00549 if (ppopupmenu->iDropDir & PAS_HORZ) { 00550 COPY_FLAG(ppopupmenu->iDropDir, PAS_RIGHT, PAS_HORZ); 00551 } 00552 } 00553 00554 00555 if (y + cy > pMonitor->rcMonitor.bottom) { 00556 if ((wFlags & TPM_VCENTERALIGN) 00557 || (y - cy < pMonitor->rcMonitor.top) 00558 || (y >= pMonitor->rcMonitor.bottom)) { 00559 y = pMonitor->rcMonitor.bottom - cy; 00560 } else { 00561 y -= cy; 00562 } 00563 if (ppopupmenu->iDropDir & PAS_VERT) { 00564 COPY_FLAG(ppopupmenu->iDropDir, PAS_UP, PAS_VERT); 00565 } 00566 } 00567 00568 if (y < pMonitor->rcMonitor.top) { 00569 y += cy; 00570 if ((wFlags & TPM_VCENTERALIGN) 00571 || (y >= pMonitor->rcMonitor.bottom) 00572 || (y < pMonitor->rcMonitor.top)) { 00573 y = pMonitor->rcMonitor.top; 00574 } 00575 if (ppopupmenu->iDropDir & PAS_VERT) { 00576 COPY_FLAG(ppopupmenu->iDropDir, PAS_DOWN, PAS_VERT); 00577 } 00578 } 00579 00580 // 00581 // Try first point 00582 // 00583 if (TryRect(RECT_ORG, x, y, cx, cy, &rcExclude, &ptT, pMonitor)) 00584 goto FOUND; 00585 00586 // 00587 // Sort possibilities. Get offset of horizontal rects. 00588 // 00589 iRect = (wFlags & TPM_VERTICAL) ? 2 : 0; 00590 00591 // 00592 // Sort horizontally. Note that we treat TPM_CENTERALIGN like 00593 // TPM_LEFTALIGN. 00594 // 00595 // 00596 // If we're right-aligned, try to right-align on left side first. 00597 // Otherwise, try to left-align on right side first. 00598 // 00599 iT = (wFlags & TPM_RIGHTALIGN) ? 0 : 2; 00600 00601 awRect[0 + iRect] = RECT_ONLEFT + iT; 00602 awRect[1 + iRect] = RECT_ONRIGHT - iT; 00603 00604 // 00605 // Sort vertically. Note that we treat TPM_VCENTERALIGN like 00606 // TPM_TOPALIGN. 00607 // 00608 // If we're bottom-aligned, try to bottom-align with top of rect 00609 // first. Otherwise, try to top-align with bottom of exclusion first. 00610 // 00611 iT = (wFlags & TPM_BOTTOMALIGN) ? 0 : 2; 00612 00613 awRect[2 - iRect] = RECT_ONTOP + iT; 00614 awRect[3 - iRect] = RECT_ONBOTTOM - iT; 00615 00616 // 00617 // Loop through sorted alternatives. Note that TryRect fails immediately 00618 // if an exclusion coordinate is too close to screen edge. 00619 // 00620 00621 for (iRect = 0; iRect < 4; iRect++) { 00622 if (TryRect(awRect[iRect], x, y, cx, cy, &rcExclude, &ptT, pMonitor)) { 00623 switch (awRect[iRect]) 00624 { 00625 case RECT_ONTOP: 00626 ppopupmenu->iDropDir = PAS_UP; 00627 break; 00628 case RECT_ONLEFT: 00629 ppopupmenu->iDropDir = PAS_LEFT; 00630 break; 00631 case RECT_ONBOTTOM: 00632 ppopupmenu->iDropDir = PAS_DOWN; 00633 break; 00634 case RECT_ONRIGHT: 00635 ppopupmenu->iDropDir = PAS_RIGHT; 00636 break; 00637 } 00638 00639 x = ptT.x; 00640 y = ptT.y; 00641 break; 00642 } 00643 } 00644 00645 FOUND: 00646 return MAKELONG(x, y); 00647 }

PCLIP FindClipFormat PWINDOWSTATION  pwinsta,
UINT  format
 

Definition at line 2482 of file ntuser/kernel/clipbrd.c.

References tagWINDOWSTATION::cNumClipFormats, tagCLIP::fmt, format, NULL, and tagWINDOWSTATION::pClipBase.

Referenced by _EnumClipboardFormats(), InternalSetClipboardData(), MungeClipData(), NtUserIsClipboardFormatAvailable(), xxxGetClipboardData(), xxxGetDummyBitmap(), xxxGetDummyDib(), xxxGetDummyDibV5(), xxxGetDummyPalette(), xxxGetDummyText(), and xxxGetRenderData().

02485 { 02486 PCLIP pClip; 02487 int iFmt; 02488 02489 if ((format != 0) && ((pClip = pwinsta->pClipBase) != NULL)) { 02490 02491 for (iFmt = pwinsta->cNumClipFormats; iFmt-- != 0;) { 02492 02493 if (pClip->fmt == format) 02494 return pClip; 02495 02496 pClip++; 02497 } 02498 } 02499 02500 return NULL; 02501 }

PHOTKEY FindHotKey PTHREADINFO  pti,
PWND  pwnd,
int  id,
UINT  fsModifiers,
UINT  vk,
BOOL  fUnregister,
PBOOL  pfKeysExist
 

Definition at line 290 of file hotkeys.c.

References FALSE, tagHOTKEY::fsModifiers, gphkFirst, tagHOTKEY::id, NULL, tagHOTKEY::phkNext, tagHOTKEY::pti, PWND_FOCUS, PWND_INPUTOWNER, tagHOTKEY::spwnd, TRUE, Unlock, and tagHOTKEY::vk.

Referenced by _RegisterHotKey(), and _UnregisterHotKey().

00298 { 00299 PHOTKEY phk, phkRet, phkPrev; 00300 00301 /* 00302 * Initialize out 'return' values. 00303 */ 00304 *pfKeysExist = FALSE; 00305 phkRet = NULL; 00306 00307 phk = gphkFirst; 00308 00309 while (phk) { 00310 00311 /* 00312 * If all this matches up then we've found it. 00313 */ 00314 if ((phk->pti == ptiCurrent) && (phk->spwnd == pwnd) && (phk->id == id)) { 00315 if (fUnregister) { 00316 00317 /* 00318 * Unlink the HOTKEY from the list. 00319 */ 00320 if (phk == gphkFirst) { 00321 gphkFirst = phk->phkNext; 00322 } else { 00323 phkPrev->phkNext = phk->phkNext; 00324 } 00325 00326 if ((pwnd != PWND_FOCUS) && (pwnd != PWND_INPUTOWNER)) { 00327 Unlock(&phk->spwnd); 00328 } 00329 UserFreePool((PVOID)phk); 00330 00331 return((PHOTKEY)1); 00332 } 00333 phkRet = phk; 00334 } 00335 00336 /* 00337 * If the key is already registered, set the exists flag so 00338 * the app knows it can't use this hotkey sequence. 00339 */ 00340 if ((phk->fsModifiers == (WORD)fsModifiers) && (phk->vk == vk)) { 00341 00342 /* 00343 * In the case of PWND_FOCUS, we need to check that the queues 00344 * are the same since PWND_FOCUS is local to the queue it was 00345 * registered under. 00346 */ 00347 if (phk->spwnd == PWND_FOCUS) { 00348 if (phk->pti == ptiCurrent) { 00349 *pfKeysExist = TRUE; 00350 } 00351 } else { 00352 *pfKeysExist = TRUE; 00353 } 00354 } 00355 00356 phkPrev = phk; 00357 phk = phk->phkNext; 00358 } 00359 00360 return phkRet; 00361 }

int FindNCHitEx PWND  pwnd,
int  ht,
POINT  pt
 

Definition at line 375 of file tooltips.c.

References FALSE, tagITEM::hbmp, HitTestScrollBar(), HTMDICLOSE, HTMDIMAXBUTTON, HTMDIMINBUTTON, HTMDISYSMENU, HTMENUITEM, MNItemHitTest(), tagMENU::rgItems, tagWND::spmenu, TestWF, TRUE, WFHPRESENT, WFMPRESENT, and WFVPRESENT.

Referenced by xxxScanSysQueue().

00376 { 00377 /* 00378 * Bug 263057 joejo 00379 * It seems that pwnd->spmenu can be released and set to null, 00380 * without the WFMPRESENT flag being cleared. Make sure that 00381 * we have a good pwnd->spmenu before continuing. 00382 */ 00383 if (ht == HTMENU && pwnd->spmenu && TestWF(pwnd, WFMPRESENT)) { 00384 PMENU spmenu = pwnd->spmenu; 00385 PITEM pitem; 00386 int nItem; 00387 00388 nItem = MNItemHitTest(spmenu, pwnd, pt); 00389 if (nItem >= 0) { 00390 pitem = (PITEM)&spmenu->rgItems[nItem]; 00391 switch ((ULONG_PTR)pitem->hbmp) { 00392 case (ULONG_PTR)HBMMENU_SYSTEM: 00393 ht = HTMDISYSMENU; 00394 break; 00395 case (ULONG_PTR)HBMMENU_MBAR_RESTORE: 00396 ht = HTMDIMAXBUTTON; 00397 break; 00398 case (ULONG_PTR)HBMMENU_MBAR_MINIMIZE: 00399 case (ULONG_PTR)HBMMENU_MBAR_MINIMIZE_D: 00400 ht = HTMDIMINBUTTON; 00401 break; 00402 case (ULONG_PTR)HBMMENU_MBAR_CLOSE: 00403 case (ULONG_PTR)HBMMENU_MBAR_CLOSE_D: 00404 ht = HTMDICLOSE; 00405 break; 00406 case (ULONG_PTR)HBMMENU_CALLBACK: 00407 ht = HTERROR; 00408 break; 00409 default: 00410 ht = HTMENUITEM; 00411 break; 00412 } 00413 } 00414 return MAKELONG(ht, nItem); 00415 } else if (ht == HTVSCROLL && TestWF(pwnd, WFVPRESENT)) { 00416 return MAKELONG(HitTestScrollBar(pwnd, TRUE, pt), 1); 00417 } else if (ht == HTHSCROLL && TestWF(pwnd, WFHPRESENT)) { 00418 return MAKELONG(HitTestScrollBar(pwnd, FALSE, pt), 0); 00419 } 00420 00421 return ht; 00422 }

PQMSG FindQMsg PTHREADINFO  ,
PMLIST  ,
PWND  ,
UINT  ,
UINT  ,
BOOL 
 

Definition at line 3336 of file queue.c.

References CheckMsgFilter, CheckPwndFilter(), CheckRemoveHotkeyBit(), DebugValidateMLIST, DelQEntry(), tagXSTATE::flags, FreeDdeXact(), HMValidateHandleNoRip(), tagQ::idSysLock, tagQMSG::msg, MSGFLAG_DDE_MID_THUNK, NULL, tagTHREADINFO::pq, tagQMSG::pqmsgNext, tagMLIST::pqmsgRead, tagQ::ptiSysLock, PtoH, PXSTATE, RevalidateHwnd, TYPE_DDEXACT, UINT, and XS_FREEPXS.

Referenced by xxxFreeWindow(), and xxxReadPostMessage().

03343 { 03344 PWND pwnd; 03345 PQMSG pqmsgRead; 03346 PQMSG pqmsgRet = NULL; 03347 UINT message; 03348 03349 DebugValidateMLIST(pml); 03350 03351 pqmsgRead = pml->pqmsgRead; 03352 03353 while (pqmsgRead != NULL) { 03354 03355 /* 03356 * Make sure this window is valid and doesn't have the destroy 03357 * bit set (don't want to send it to any client side window procs 03358 * if destroy window has been called on it). 03359 */ 03360 pwnd = RevalidateHwnd(pqmsgRead->msg.hwnd); 03361 03362 if (pwnd == NULL && pqmsgRead->msg.hwnd != NULL) { 03363 /* 03364 * If we're removing a WM_HOTKEY message, we may need to 03365 * clear the QS_HOTKEY bit, since we have a special bit 03366 * for that message. 03367 */ 03368 if (pqmsgRead->msg.message == WM_HOTKEY) { 03369 CheckRemoveHotkeyBit(pti, pml); 03370 } 03371 /* 03372 * If the current thread's queue is locked waiting for this message, 03373 * we have to unlock it because we're eating the message. If there's 03374 * no more input/messages for this thread, the thread is going to 03375 * sleep; hence there might not be a next Get/PeekMessage call to 03376 * unlock the queue (ie, updating pti->idLast is not enough); 03377 * so we must unlock it now. 03378 * Win95 doesn't have this problem because their FindQMsg doesn't 03379 * eat messages; they call ReadPostMessage from FreeWindow 03380 * to take care of this scenario (== message for a destroyed window). 03381 * We could also do this if we have some problems with this fix. 03382 */ 03383 if ((pti->pq->idSysLock == (ULONG_PTR)pqmsgRead) 03384 && (pti->pq->ptiSysLock == pti)) { 03385 /* CheckSysLock(What number?, pti->pq, NULL); */ 03386 RIPMSG2(RIP_VERBOSE, "FindQMsg: Unlocking queue:%#p. Msg:%#lx", 03387 pti->pq, pqmsgRead->msg.message); 03388 pti->pq->ptiSysLock = NULL; 03389 } 03390 03391 DelQEntry(pml, pqmsgRead); 03392 goto nextMsgFromPml; 03393 } 03394 03395 /* 03396 * Process the WM_DDE_ACK messages if bProcessAck is set. 03397 */ 03398 if (bProcessAck && (PtoH(pwndFilter) == pqmsgRead->msg.hwnd) && 03399 (pqmsgRead->msg.message == (WM_DDE_ACK | MSGFLAG_DDE_MID_THUNK))) { 03400 03401 PXSTATE pxs; 03402 03403 pxs = (PXSTATE)HMValidateHandleNoRip((HANDLE)pqmsgRead->msg.lParam, TYPE_DDEXACT); 03404 03405 if (pxs != NULL && (pxs->flags & XS_FREEPXS)) { 03406 FreeDdeXact(pxs); 03407 DelQEntry(pml, pqmsgRead); 03408 goto nextMsgFromPml; 03409 } 03410 } 03411 03412 /* 03413 * Make sure this message fits both window handle and message 03414 * filters. 03415 */ 03416 if (!CheckPwndFilter(pwnd, pwndFilter)) 03417 goto nextMsg; 03418 03419 /* 03420 * If this is a fixed up dde message, then turn it into a normal 03421 * dde message for the sake of message filtering. 03422 */ 03423 message = pqmsgRead->msg.message; 03424 if (CheckMsgFilter(message, 03425 (WM_DDE_FIRST + 1) | MSGFLAG_DDE_MID_THUNK, 03426 WM_DDE_LAST | MSGFLAG_DDE_MID_THUNK)) { 03427 message = message & ~MSGFLAG_DDE_MID_THUNK; 03428 } 03429 03430 if (!CheckMsgFilter(message, msgMin, msgMax)) 03431 goto nextMsg; 03432 03433 /* 03434 * Found it. If bProcessAck is set, remember this pointer and go on 03435 * till we finish walking the list to process all WM_DDE_ACK messages. 03436 */ 03437 if (!bProcessAck) { 03438 DebugValidateMLIST(pml); 03439 return pqmsgRead; 03440 } 03441 03442 if (pqmsgRet == NULL) { 03443 pqmsgRet = pqmsgRead; 03444 } 03445 nextMsg: 03446 pqmsgRead = pqmsgRead->pqmsgNext; 03447 continue; 03448 03449 nextMsgFromPml: 03450 pqmsgRead = pml->pqmsgRead; 03451 continue; 03452 } 03453 03454 DebugValidateMLIST(pml); 03455 return pqmsgRet; 03456 }

PSPB FindSpb PWND  pwnd  ) 
 

Definition at line 965 of file spb.c.

References tagSPB::flags, gpDispInfo, NULL, tagDISPLAYINFO::pspbFirst, tagSPB::pspbNext, SPB_LOCKUPDATE, and tagSPB::spwnd.

Referenced by OffsetChildren(), RestoreSpb(), xxxDrawDragRect(), xxxFreeWindow(), and zzzBltValidBits().

00967 { 00968 PSPB pspb; 00969 00970 /* 00971 * Walk through the list of save popup bits looking for a match on 00972 * window handle. 00973 */ 00974 for (pspb = gpDispInfo->pspbFirst; pspb != NULL; pspb = pspb->pspbNext) { 00975 00976 if (pspb->spwnd == pwnd && !(pspb->flags & SPB_LOCKUPDATE)) 00977 break; 00978 } 00979 00980 return pspb; 00981 }

PTIMER FindTimer PWND  pwnd,
UINT_PTR  nID,
UINT  flags,
BOOL  fKill
 

Definition at line 167 of file timers.c.

References tagTIMER::flags, FreeTimer(), gptmrFirst, tagTIMER::nID, NULL, tagTIMER::ptmrNext, tagTIMER::spwnd, SYSRIT_TIMER, and TRUE.

Referenced by InternalSetTimer(), KillTimer2(), and UserSetTimer().

00172 { 00173 PTIMER ptmr; 00174 00175 ptmr = gptmrFirst; 00176 00177 while (ptmr != NULL) { 00178 00179 /* 00180 * Is this the timer we're looking for? 00181 */ 00182 if ((ptmr->spwnd == pwnd) && 00183 (ptmr->nID == nID) && 00184 (ptmr->flags & SYSRIT_TIMER) == (flags & SYSRIT_TIMER)) { 00185 00186 /* 00187 * Are we being called from KillTimer()? If so, destroy the 00188 * timer. return != 0 because *pptmr is gone. 00189 */ 00190 if (fKill) { 00191 FreeTimer(ptmr); 00192 return (PTIMER)TRUE; 00193 } 00194 00195 /* 00196 * Found the timer, break out of the loop. 00197 */ 00198 break; 00199 } 00200 00201 /* 00202 * No, try the next one. 00203 */ 00204 ptmr = ptmr->ptmrNext; 00205 } 00206 00207 return ptmr; 00208 }

__inline BOOL FLayeredOrRedirected PWND  pwnd  ) 
 

Definition at line 6776 of file userk.h.

References BOOL.

Referenced by CalcWindowVisRgn(), ExcludeWindowRects(), InternalInvalidate2(), IntersectWithParents(), RecreateRedirectionBitmap(), RemoveRedirectionBitmap(), UpdateLayeredSprite(), xxxInternalInvalidate(), zzzBltValidBits(), and zzzChangeStates().

06782 {

LRESULT fnHkINLPCWPEXSTRUCT PWND  pwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam,
ULONG_PTR  xParam
 

Definition at line 490 of file srvhook.c.

References _CLIENTINFO::CI_flags, CI_INTERTHREAD_HOOK, GetClientInfo, HW, NULL, _CWPSTRUCTEX::psmsSender, and xxxCallNextHookEx().

Referenced by InitFunctionTables().

00496 { 00497 CWPSTRUCTEX cwp; 00498 PCLIENTINFO pci = GetClientInfo(); 00499 00500 UNREFERENCED_PARAMETER(xParam); 00501 00502 cwp.hwnd = HW(pwnd); 00503 cwp.message = message; 00504 cwp.wParam = wParam; 00505 cwp.lParam = lParam; 00506 cwp.psmsSender = NULL; 00507 00508 return xxxCallNextHookEx(HC_ACTION, (pci->CI_flags & CI_INTERTHREAD_HOOK) != 0, 00509 (LPARAM)&cwp); 00510 }

LRESULT fnHkINLPCWPRETEXSTRUCT PWND  pwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam,
ULONG_PTR  xParam
 

Definition at line 512 of file srvhook.c.

References _CLIENTINFO::CI_flags, CI_INTERTHREAD_HOOK, _CLIENTINFO::dwHookData, GetClientInfo, HW, _CWPRETSTRUCTEX::lResult, NULL, _CWPRETSTRUCTEX::psmsSender, and xxxCallNextHookEx().

Referenced by InitFunctionTables().

00518 { 00519 CWPRETSTRUCTEX cwp; 00520 PCLIENTINFO pci = GetClientInfo(); 00521 00522 UNREFERENCED_PARAMETER(xParam); 00523 00524 cwp.hwnd = HW(pwnd); 00525 cwp.message = message; 00526 cwp.wParam = wParam; 00527 cwp.lParam = lParam; 00528 cwp.lResult = pci->dwHookData; 00529 cwp.psmsSender = NULL; 00530 00531 return xxxCallNextHookEx(HC_ACTION, (pci->CI_flags & CI_INTERTHREAD_HOOK) != 0, 00532 (LPARAM)&cwp); 00533 }

VOID ForceEmptyClipboard PWINDOWSTATION   ) 
 

Definition at line 2779 of file ntuser/kernel/clipbrd.c.

References tagWINDOWSTATION::dwWSF_Flags, tagWINDOWSTATION::ptiClipLock, tagWINDOWSTATION::spwndClipOpen, tagWINDOWSTATION::spwndClipOwner, tagWINDOWSTATION::spwndClipViewer, Unlock, VOID(), WSF_DYING, xxxCloseClipboard(), and xxxEmptyClipboard().

Referenced by EndShutdown(), and FreeWindowStation().

02781 { 02782 02783 pwinsta->ptiClipLock = ((PTHREADINFO)(W32GetCurrentThread())); /* 02784 * This will be NULL 02785 * for a non-GUI thread. 02786 */ 02787 Unlock(&pwinsta->spwndClipOwner); 02788 Unlock(&pwinsta->spwndClipViewer); 02789 Unlock(&pwinsta->spwndClipOpen); 02790 02791 xxxEmptyClipboard(pwinsta); 02792 02793 /* 02794 * If the windowstation is dying, don't bother closing 02795 * the clipboard. 02796 */ 02797 if (!(pwinsta->dwWSF_Flags & WSF_DYING)) 02798 xxxCloseClipboard(pwinsta); 02799 }

VOID FreeAllSpbs void   ) 
 

Definition at line 1252 of file spb.c.

References AnySpbs, FreeSpb(), gpDispInfo, NULL, tagDISPLAYINFO::pspbFirst, and VOID().

Referenced by InitiateWin32kCleanup(), xxxRealizePalette(), xxxSetDeskWallpaper(), xxxSwitchDesktop(), and xxxUserChangeDisplaySettings().

01253 { 01254 01255 while(AnySpbs()) { 01256 FreeSpb(gpDispInfo->pspbFirst); 01257 } 01258 01259 gpDispInfo->pspbFirst = NULL; 01260 }

VOID FreeCachedQueues VOID   ) 
 

Definition at line 2193 of file queue.c.

References ExDeletePagedLookasideList(), NULL, QLookaside, and VOID().

Referenced by Win32kNtUserCleanup().

02195 { 02196 if (QLookaside != NULL) { 02197 ExDeletePagedLookasideList(QLookaside); 02198 UserFreePool(QLookaside); 02199 QLookaside = NULL; 02200 } 02201 }

VOID FreeDdeConv PDDECONV  pDdeConv  ) 
 

Definition at line 2042 of file kernel/ddetrack.c.

References _PostMessage(), tagDDEIMP::ClientContext, tagDDEIMP::cRefConv, tagDDEIMP::cRefInit, CXF_TERMINATE_POSTED, tagDDECONV::flags, GETPTI, HMFreeObject(), HMIsMarkDestroy, HMMarkObjectDestroy(), NULL, tagDDECONV::pddei, PopState(), PtoH, SeDeleteClientSecurity, tagDDECONV::spartnerConv, tagDDECONV::spwnd, tagDDECONV::spwndPartner, TIF_INCLEANUP, TRACE_DDE1, UnlinkConv(), Unlock, and VOID().

Referenced by xxxCleanupDdeConv(), xxxDDETrackGetMessageHook(), and xxxDDETrackWindowDying().

02044 { 02045 02046 TRACE_DDE1("FreeDdeConv(%#p)", pDdeConv); 02047 02048 if (!(pDdeConv->flags & CXF_TERMINATE_POSTED) && 02049 !HMIsMarkDestroy(pDdeConv->spwndPartner)) { 02050 _PostMessage(pDdeConv->spwndPartner, WM_DDE_TERMINATE, 02051 (WPARAM)PtoH(pDdeConv->spwnd), 0); 02052 // pDdeConv->flags |= CXF_TERMINATE_POSTED; set by PostHookProc 02053 } 02054 02055 if (pDdeConv->spartnerConv != NULL && 02056 GETPTI(pDdeConv)->TIF_flags & TIF_INCLEANUP) { 02057 /* 02058 * Fake that the other side already posted a terminate. 02059 * This prevents vestigal dde structures from hanging 02060 * around after thread cleanup if the conversation structure 02061 * is destroyed before the associated window. 02062 */ 02063 pDdeConv->spartnerConv->flags |= CXF_TERMINATE_POSTED; 02064 } 02065 02066 UnlinkConv(pDdeConv); 02067 02068 if (pDdeConv->pddei != NULL) { 02069 pDdeConv->pddei->cRefConv--; 02070 if (pDdeConv->pddei->cRefConv == 0 && pDdeConv->pddei->cRefInit == 0) { 02071 SeDeleteClientSecurity(&pDdeConv->pddei->ClientContext); 02072 UserFreePool(pDdeConv->pddei); 02073 } 02074 pDdeConv->pddei = NULL; 02075 } 02076 02077 Unlock(&(pDdeConv->spartnerConv)); 02078 Unlock(&(pDdeConv->spwndPartner)); 02079 Unlock(&(pDdeConv->spwnd)); 02080 02081 if (!HMMarkObjectDestroy((PHEAD)pDdeConv)) 02082 return; 02083 02084 while (pDdeConv->spxsOut) { 02085 PopState(pDdeConv); 02086 } 02087 02088 HMFreeObject(pDdeConv); 02089 }

VOID FreeDdeXact PXSTATE  pxs  ) 
 

Definition at line 2285 of file kernel/ddetrack.c.

References tagSHAREDINFO::aheList, tagXSTATE::flags, tagINTDDEINFO::flags, giheLast, gSharedInfo, tagXSTATE::head, tagINTDDEINFO::hIndirect, HMFreeObject(), HMMarkObjectDestroy(), NULL, tagXSTATE::pIntDdeInfo, RemovePublicObject(), tagXSTATE::snext, TYPE_DDECONV, TYPE_DDEXACT, ValidatePublicObjectList, VOID(), XS_ENHMETAFILE, XS_METAFILEPICT, and XS_PUBLICOBJ.

Referenced by FindQMsg(), PopState(), and xxxDDETrackGetMessageHook().

02287 { 02288 if (!HMMarkObjectDestroy(pxs)) 02289 return; 02290 02291 #if 0 02292 { 02293 int i; 02294 HANDLEENTRY *phe; 02295 02296 for (i = 0, phe = gSharedInfo.aheList; 02297 i <= giheLast; 02298 i++) { 02299 if (phe[i].bType == TYPE_DDEXACT) { 02300 UserAssert(((PXSTATE)(phe[i].phead))->snext != pxs); 02301 } 02302 if (phe[i].bType == TYPE_DDECONV) { 02303 UserAssert(((PDDECONV)(phe[i].phead))->spxsOut != pxs); 02304 UserAssert(((PDDECONV)(phe[i].phead))->spxsIn != pxs); 02305 } 02306 } 02307 } 02308 UserAssert(pxs->head.cLockObj == 0); 02309 UserAssert(pxs->snext == NULL); 02310 #endif 02311 02312 if (pxs->pIntDdeInfo != NULL) { 02313 /* 02314 * free any server-side GDI objects 02315 */ 02316 if (pxs->pIntDdeInfo->flags & (XS_METAFILEPICT | XS_ENHMETAFILE)) { 02317 GreDeleteServerMetaFile(pxs->pIntDdeInfo->hIndirect); 02318 } 02319 if (pxs->flags & XS_PUBLICOBJ) { 02320 RemovePublicObject(((PDDE_DATA)(pxs->pIntDdeInfo + 1))->wFmt, 02321 pxs->pIntDdeInfo->hIndirect); 02322 pxs->flags &= ~XS_PUBLICOBJ; 02323 } 02324 UserFreePool(pxs->pIntDdeInfo); 02325 } 02326 02327 HMFreeObject(pxs); 02328 ValidatePublicObjectList(); 02329 }

VOID FreeDesktop IN PVOID  Desktop  ) 
 

PDEVICEINFO FreeDeviceInfo PDEVICEINFO  pMouseInfo  ) 
 

Definition at line 313 of file ntinput.c.

References CheckDeviceInfoListCritIn, EVENT_INCREMENT, FALSE, FreeKernelEvent(), GDIAF_FREEME, GDIAF_PNPWAITING, GDIF_PNPMUSTFREE, GDIF_READERMUSTFREE, GDIF_READING, gpDeviceInfoList, KeSetEvent(), and NULL.

Referenced by InputApc(), ProcessDeviceChanges(), RequestDeviceChange(), StartDeviceRead(), and Win32kNtUserCleanup().

00314 { 00315 PDEVICEINFO *ppDeviceInfo; 00316 00317 CheckDeviceInfoListCritIn(); 00318 00319 TAGMSG1(DBGTAG_PNP, "FreeDeviceInfo(%#p)", pDeviceInfo); 00320 00321 /* 00322 * We cannot free the device since we still have a read pending. 00323 * Mark it GDIAF_FREEME so that it will be freed when the APC is made 00324 * (see InputApc), or when the next read request is about to be issued 00325 * (see StartDeviceRead). 00326 */ 00327 if (pDeviceInfo->bFlags & GDIF_READING) { 00328 #if DIAGNOSE_IO 00329 pDeviceInfo->bFlags |= GDIF_READERMUSTFREE; 00330 #endif 00331 TAGMSG1(DBGTAG_PNP, "** FreeDeviceInfo(%#p) DEFERRED : reader must free", pDeviceInfo); 00332 pDeviceInfo->usActions |= GDIAF_FREEME; 00333 return pDeviceInfo->pNext; 00334 } 00335 00336 /* 00337 * If a PnP thread is waiting in RequestDeviceChange for some action to be 00338 * performed on this device, just mark it for freeing and signal that PnP 00339 * thread with the pkeHidChangeCompleted so that it will free it 00340 */ 00341 if (pDeviceInfo->usActions & GDIAF_PNPWAITING) { 00342 #if DIAGNOSE_IO 00343 pDeviceInfo->bFlags |= GDIF_PNPMUSTFREE; 00344 #endif 00345 TAGMSG1(DBGTAG_PNP, "** FreeDeviceInfo(%#p) DEFERRED : PnP must free", pDeviceInfo); 00346 pDeviceInfo->usActions |= GDIAF_FREEME; 00347 KeSetEvent(pDeviceInfo->pkeHidChangeCompleted, EVENT_INCREMENT, FALSE); 00348 return pDeviceInfo->pNext; 00349 } 00350 00351 ppDeviceInfo = &gpDeviceInfoList; 00352 00353 while (*ppDeviceInfo) { 00354 if (*ppDeviceInfo == pDeviceInfo) { 00355 /* 00356 * Found the DEVICEINFO struct, so free it and its members. 00357 */ 00358 if (pDeviceInfo->pkeHidChangeCompleted != NULL) { 00359 FreeKernelEvent(&pDeviceInfo->pkeHidChangeCompleted); // BUG BUG 00360 } 00361 if (pDeviceInfo->ustrName.Buffer != NULL) { 00362 UserFreePool(pDeviceInfo->ustrName.Buffer); 00363 } 00364 *ppDeviceInfo = pDeviceInfo->pNext; 00365 UserFreePool(pDeviceInfo); 00366 00367 return *ppDeviceInfo; 00368 } 00369 ppDeviceInfo = &(*ppDeviceInfo)->pNext; 00370 } 00371 RIPMSG1(RIP_ERROR, "pDeviceInfo %#p not found in gpDeviceInfoList", pDeviceInfo); 00372 00373 return NULL; 00374 }

VOID FreeHook PHOOK  phk  ) 
 

Definition at line 1976 of file hooks.c.

References CheckWHFBits(), DbgValidateHooks, tagHOOK::flags, GETPTI, HF_DESTROYED, HF_GLOBAL, HMFreeObject(), HMMarkObjectDestroy(), tagHOOK::iHook, NULL, tagHOOK::ptiHooked, RemoveHmodDependency(), UnlinkHook(), and VOID().

Referenced by FreeThreadsWindowHooks(), xxxCallHook2(), and zzzUnhookWindowsHookEx().

01978 { 01979 /* 01980 * Paranoia... 01981 */ 01982 UserAssert(!(phkFree->flags & HF_FREED)); 01983 /* 01984 * BUGBUG 01985 * Unless we come from zzzUnhookWindowsHook, if this was a journaling hook 01986 * we don't unattach the threads. We should reconsider this one day. 01987 * MCostea Jan 21, 99 01988 */ 01989 01990 /* 01991 * Clear fsHooks bits the first time around (and mark it as destroyed). 01992 */ 01993 if (!(phkFree->flags & HF_DESTROYED)) { 01994 DbgValidateHooks (phkFree, phkFree->iHook); 01995 phkFree->flags |= HF_DESTROYED; 01996 /* 01997 * This hook has been marked as destroyed so CheckWHSBits 01998 * won't take it into account when updating the fsHooks bits. 01999 * However, this means that right at this moment fsHooks is 02000 * out of sync. So we need a flag to make the assertion freaks 02001 * (i.e., me) happy. 02002 */ 02003 #if DBG 02004 phkFree->flags |= HF_INCHECKWHF; 02005 #endif 02006 UserAssert((phkFree->ptiHooked != NULL) || (phkFree->flags & HF_GLOBAL)); 02007 CheckWHFBits(phkFree->ptiHooked != NULL 02008 ? phkFree->ptiHooked 02009 : GETPTI(phkFree), 02010 phkFree->iHook); 02011 #if DBG 02012 phkFree->flags &= ~HF_INCHECKWHF; 02013 #endif 02014 } 02015 /* 02016 * Mark it for destruction. If it the object is locked it can't 02017 * be freed right now. 02018 */ 02019 if (!HMMarkObjectDestroy((PVOID)phkFree)) { 02020 return; 02021 } 02022 /* 02023 * We're going to free this hook so get it off the list. 02024 */ 02025 UnlinkHook(phkFree); 02026 /* 02027 * Now remove the hmod dependency and free the 02028 * HOOK structure. 02029 */ 02030 if (phkFree->ihmod >= 0) { 02031 RemoveHmodDependency(phkFree->ihmod); 02032 } 02033 02034 #ifdef HOOKBATCH 02035 /* 02036 * Free the cached Events 02037 */ 02038 if (phkFree->aEventCache) { 02039 UserFreePool(phkFree->aEventCache); 02040 phkFree->aEventCache = NULL; 02041 } 02042 #endif //HOOKBATCH 02043 02044 #if DBG 02045 phkFree->flags |= HF_FREED; 02046 #endif 02047 02048 HMFreeObject((PVOID)phkFree); 02049 return; 02050 }

VOID FreeHwndList PBWL  pbwl  ) 
 

Definition at line 417 of file enumwin.c.

References CheckCritIn, FALSE, gpbwlList, NULL, pbwlCache, tagBWL::pbwlNext, tagBWL::phwndMax, and tagBWL::rghwnd.

Referenced by _FindWindowEx(), AssociateInputContextEx(), DestroyInputContext(), InitSwitchWndInfo(), NtUserBuildHwndList(), SwitchWndCleanup(), xxxArrangeIconicWindows(), xxxCheckImeShowStatus(), xxxClientShutdown(), xxxDefWindowProc(), xxxDesktopRecalc(), xxxDestroyThreadInfo(), xxxDWPPrint(), xxxInternalDoSyncPaint(), xxxInternalEnumWindow(), xxxMetricsRecalc(), xxxSendBSMtoDesktop(), and xxxShowOwnedWindows().

00419 { 00420 PBWL *ppbwl; 00421 PBWL pbwlT; 00422 00423 CheckCritIn(); 00424 00425 /* 00426 * We should never have an active bwl that is the free cached bwl 00427 */ 00428 UserAssert(pbwl != pbwlCache); 00429 00430 /* 00431 * Unlink this bwl from the list. 00432 */ 00433 for (ppbwl = &gpbwlList; *ppbwl != NULL; ppbwl = &(*ppbwl)->pbwlNext) { 00434 if (*ppbwl == pbwl) { 00435 *ppbwl = pbwl->pbwlNext; 00436 00437 /* 00438 * If the cache is empty or this pbwl is larger than the 00439 * cached one, save the pbwl there. 00440 */ 00441 if (pbwlCache == NULL) { 00442 pbwlCache = pbwl; 00443 } else if ((pbwl->phwndMax - pbwl->rghwnd) > 00444 (pbwlCache->phwndMax - pbwlCache->rghwnd)) { 00445 pbwlT = pbwlCache; 00446 pbwlCache = pbwl; 00447 UserFreePool((HANDLE)pbwlT); 00448 } else { 00449 UserFreePool((HANDLE)pbwl); 00450 } 00451 return; 00452 } 00453 } 00454 00455 /* 00456 * Assert if we couldn't find the pbwl in the list... 00457 */ 00458 UserAssert(FALSE); 00459 }

VOID FreeInputContext IN PIMC  pImc  ) 
 

Definition at line 198 of file ntimm.c.

References GETPTI, HMFreeObject(), HMMarkObjectDestroy(), NULL, tagIMC::pImcNext, and VOID().

00200 { 00201 PIMC pImcT; 00202 00203 /* 00204 * Mark it for destruction. If it the object is locked it can't 00205 * be freed right now. 00206 */ 00207 if (!HMMarkObjectDestroy((PVOID)pImc)) 00208 return; 00209 00210 /* 00211 * Unlink it. 00212 */ 00213 pImcT = GETPTI(pImc)->spDefaultImc; 00214 00215 while (pImcT != NULL && pImcT->pImcNext != pImc) 00216 pImcT = pImcT->pImcNext; 00217 00218 if (pImcT != NULL) 00219 pImcT->pImcNext = pImc->pImcNext; 00220 00221 /* 00222 * We're really going to free the input context. 00223 */ 00224 HMFreeObject((PVOID)pImc); 00225 00226 return; 00227 }

VOID __inline FreeKernelEvent PVOID *  pp  ) 
 

Definition at line 126 of file userk.h.

References NULL, and VOID().

Referenced by FreeDeviceInfo(), Win32kNtUserCleanup(), xxxDesktopThread(), and xxxInitInput().

00127 { 00128 UserFreePool(*pp); 00129 *pp = NULL; 00130 }

VOID FreeMessageList PMLIST  pml  ) 
 

Definition at line 3106 of file queue.c.

References CleanEventMessage(), DebugValidateMLIST, DelQEntry(), NULL, tagMLIST::pqmsgRead, and VOID().

Referenced by xxxDestroyThreadInfo(), and zzzDestroyQueue().

03108 { 03109 PQMSG pqmsg; 03110 03111 DebugValidateMLIST(pml); 03112 03113 while ((pqmsg = pml->pqmsgRead) != NULL) { 03114 CleanEventMessage(pqmsg); 03115 DelQEntry(pml, pqmsg); 03116 } 03117 03118 DebugValidateMLIST(pml); 03119 }

void FreeProfileUserName PUNICODE_STRING  pProfileUserName,
TL ptl
 

Definition at line 174 of file w32/ntuser/kernel/profile.c.

References CheckCritIn, PtiCurrent, and ThreadUnlockAndFreePool.

Referenced by InitUserScreen(), NtUserSetSysColors(), PrepareForLogoff(), xxxDesktopWndProc(), xxxInitWindowStation(), xxxResetDisplayDevice(), xxxSetIMEShowStatus(), xxxSystemParametersInfo(), and xxxUpdatePerUserSystemParameters().

00174 { 00175 UNREFERENCED_PARAMETER(ptl); 00176 CheckCritIn(); 00177 if (pProfileUserName) { 00178 ThreadUnlockAndFreePool(PtiCurrent(), ptl); 00179 } 00180 }

__inline void FreeQEntry PQMSG  pqmsg  ) 
 

Definition at line 4397 of file userk.h.

References QEntryLookaside, and VOID().

Referenced by RedistributeInput().

04408 {

VOID FreeQueue PQ  pq  ) 
 

Definition at line 2168 of file queue.c.

References ExFreeToPagedLookasideList(), gpqCursor, gpqForeground, gpqForegroundPrev, tagQ::QF_flags, QF_INDESTROY, QLookaside, and VOID().

Referenced by RtlpDphFreeDelayedBlocksFromHeap(), RtlpDphTrimDelayedFreeQueue(), UserDeleteW32Thread(), Win32kNtUserCleanup(), and zzzDestroyQueue().

02170 { 02171 #if DBG 02172 /* 02173 * Turn off the flag indicating that this queue is in destruction. 02174 * We do this in either case that we are putting this into the free 02175 * list, or truly destroying the handle. We use this to try and 02176 * track cases where someone tries to lock elements into the queue 02177 * structure while it's going through destuction. 02178 */ 02179 pq->QF_flags &= ~QF_INDESTROY; 02180 #endif 02181 02182 UserAssertMsg0(pq != gpqForeground, "FreeQueue(gpqForeground) !"); 02183 UserAssertMsg0(pq != gpqForegroundPrev, "FreeQueue(gpqForegroundPrev) !"); 02184 UserAssertMsg0(pq != gpqCursor, "FreeQueue(gpqCursor) !"); 02185 ExFreeToPagedLookasideList(QLookaside, pq); 02186 }

VOID FreeSpb PSPB  pspb  ) 
 

Definition at line 1171 of file spb.c.

References AnySpbs, ClrWF, tagDCE::DCX_flags, tagSPB::flags, gpDispInfo, tagSPB::hbm, tagDCE::hdc, tagDISPLAYINFO::hDev, tagSPB::hrgn, NULL, tagDISPLAYINFO::pdceFirst, tagDCE::pdceNext, tagDISPLAYINFO::pspbFirst, tagSPB::pspbNext, SPB_SAVESCREENBITS, tagSPB::spwnd, tagSPB::ulSaveId, Unlock, VOID(), and WFHASSPB.

Referenced by FreeAllSpbs(), LockWindowUpdate2(), RestoreSpb(), SpbCheckPwnd(), SpbCheckRect2(), xxxDrawDragRect(), xxxFreeWindow(), and zzzBltValidBits().

01173 { 01174 PSPB *ppspb; 01175 PDCE pdce; 01176 01177 if (pspb == NULL) 01178 return; 01179 01180 /* 01181 * Delete the bitmap. If saved in screen memory, make special call. 01182 */ 01183 if (pspb->flags & SPB_SAVESCREENBITS) { 01184 GreSaveScreenBits(gpDispInfo->hDev, SS_FREE, pspb->ulSaveId, NULL); 01185 } else if (pspb->hbm != NULL) { 01186 GreDeleteObject(pspb->hbm); 01187 } 01188 01189 /* 01190 * Destroy the region. 01191 */ 01192 if (pspb->hrgn != NULL){ 01193 GreDeleteObject(pspb->hrgn); 01194 } 01195 01196 /* 01197 * Forget that there is an attached SPB. 01198 */ 01199 if (pspb->spwnd != NULL) { 01200 ClrWF(pspb->spwnd, WFHASSPB); 01201 Unlock(&pspb->spwnd); 01202 } 01203 01204 /* 01205 * Unlink the spb. 01206 */ 01207 ppspb = &gpDispInfo->pspbFirst; 01208 while (*ppspb != pspb) { 01209 ppspb = &(*ppspb)->pspbNext; 01210 } 01211 01212 *ppspb = pspb->pspbNext; 01213 01214 /* 01215 * Free the save popup bits structure. 01216 */ 01217 UserFreePool(pspb); 01218 01219 /* 01220 * If we no longer have any SPBs then turn off window MGR 01221 * bounds collection. 01222 */ 01223 if (!AnySpbs()) { 01224 01225 GreLockDisplay(gpDispInfo->hDev); 01226 01227 /* 01228 * Reset the dirty areas of all of the DC's. NULL means reset. 01229 */ 01230 for (pdce = gpDispInfo->pdceFirst; pdce != NULL; pdce = pdce->pdceNext) { 01231 01232 if (pdce->DCX_flags & DCX_LAYERED) 01233 continue; 01234 01235 GreGetBounds(pdce->hdc, NULL, GGB_DISABLE_WINMGR); 01236 } 01237 01238 GreUnlockDisplay(gpDispInfo->hDev); 01239 } 01240 01241 }

VOID FreeThreadsWindowHooks VOID   ) 
 

Definition at line 2227 of file hooks.c.

References tagDESKTOPINFO::aphkStart, tagTHREADINFO::aphkStart, tagHOOK::flags, FreeHook(), tagTHREADINFO::fsHooks, GETPTI, HF_DESTROYED, HF_GLOBAL, NULL, tagTHREADINFO::pDeskInfo, tagHOOK::phkNext, PtiCurrent, tagHOOK::ptiHooked, tagTHREADINFO::rpdesk, tagTHREADINFO::sphkCurrent, tagTHREADINFO::TIF_flags, TIF_INCLEANUP, UnlinkHook(), Unlock, and VOID().

Referenced by xxxDestroyThreadInfo().

02228 { 02229 int iHook; 02230 PHOOK phk, phkNext; 02231 PTHREADINFO ptiCurrent = PtiCurrent(); 02232 02233 /* 02234 * If there is not thread info, there are not hooks to worry about 02235 */ 02236 if (ptiCurrent == NULL || ptiCurrent->rpdesk == NULL) { 02237 return; 02238 } 02239 /* 02240 * In case we have a hook locked in as the current hook unlock it 02241 * so it can be freed 02242 */ 02243 Unlock(&ptiCurrent->sphkCurrent); 02244 02245 UserAssert(ptiCurrent->TIF_flags & TIF_INCLEANUP); 02246 // Why bother doing this? We won't be calling back to user mode again! 02247 // if (ptiCurrent->pClientInfo) { 02248 // ptiCurrent->pClientInfo->phkCurrent = NULL; 02249 // } 02250 02251 /* 02252 * Loop through all the hook types. 02253 */ 02254 for (iHook = WH_MIN ; iHook <= WH_MAX ; ++iHook) { 02255 /* 02256 * Loop through all the hooks of this type, including the 02257 * ones already marked as destroyed (so don't call 02258 * PhkFirstValid and PhkNextValid). 02259 */ 02260 phk = ptiCurrent->aphkStart[iHook + 1]; 02261 if (phk == NULL) { 02262 phk = ptiCurrent->pDeskInfo->aphkStart[iHook + 1]; 02263 UserAssert((phk == NULL) || (phk->flags & HF_GLOBAL)); 02264 } 02265 02266 while (phk != NULL) { 02267 /* 02268 * We might free phk below, so grab the next now 02269 * If at end of local chain, jump to the global chain 02270 */ 02271 phkNext = phk->phkNext; 02272 if ((phkNext == NULL) && !(phk->flags & HF_GLOBAL)) { 02273 phkNext = ptiCurrent->pDeskInfo->aphkStart[iHook + 1]; 02274 UserAssert((phkNext == NULL) || (phkNext->flags & HF_GLOBAL)); 02275 } 02276 /* 02277 * If this is a local(thread) hook, unlink it and mark it as 02278 * destroyed so we won't call it anymore. We want to do 02279 * this even if not calling FreeHook; also note that 02280 * FreeHook won't unlink it if locked so we do it here anyway. 02281 */ 02282 if (!(phk->flags & HF_GLOBAL)) { 02283 UserAssert(ptiCurrent == phk->ptiHooked); 02284 UnlinkHook(phk); 02285 phk->flags |= HF_DESTROYED; 02286 phk->phkNext = NULL; 02287 } 02288 /* 02289 * If this hook was created by this thread, free it 02290 */ 02291 if (GETPTI(phk) == ptiCurrent) { 02292 FreeHook(phk); 02293 } 02294 02295 phk = phkNext; 02296 } 02297 /* 02298 * All local hooks should be unlinked 02299 */ 02300 UserAssert(ptiCurrent->aphkStart[iHook + 1] == NULL); 02301 } /* for (iHook = WH_MIN....*/ 02302 02303 /* 02304 * Keep fsHooks in sync. 02305 */ 02306 ptiCurrent->fsHooks = 0; 02307 }

VOID FreeThreadsWinEvents PTHREADINFO  pti  ) 
 

Definition at line 615 of file kernel/winable.c.

References DestroyEventHook(), DestroyNotify(), DWORD, tagNOTIFY::dwWEFlags, GETPTI, gpPendingNotifies, gpWinEventHooks, tagNOTIFY::idSenderThread, NULL, tagEVENTHOOK::pehNext, tagNOTIFY::pNotifyNext, tagNOTIFY::ptiReceiver, WEF_ASYNC, and WEF_POSTED.

Referenced by xxxDestroyThreadInfo().

00616 { 00617 PEVENTHOOK peh, pehNext; 00618 PNOTIFY pn, pnNext; 00619 DWORD idCurrentThread = W32GetCurrentTID(); 00620 00621 /* 00622 * Loop through all the notifications 00623 */ 00624 for (pn = gpPendingNotifies; pn; pn = pnNext) { 00625 pnNext = pn->pNotifyNext; 00626 00627 /* 00628 * Only destroy sync notifications that belong to this thread 00629 * and are not currently calling back i.e. ptiReceiver must be NULL. 00630 * Otherwise, when we come back from the callback in 00631 * xxxProcessNotifyWinEvent we will operate on a freed notify. 00632 * Also destroy the notification if the receiver is going away 00633 * or else it gets leaked as long as the sender is alive. 00634 */ 00635 if ((pn->idSenderThread == idCurrentThread && 00636 pn->ptiReceiver == NULL) || (pn->ptiReceiver == pti)) { 00637 if ((pn->dwWEFlags & WEF_ASYNC) == 0) { 00638 UserAssert((pn->dwWEFlags & WEF_POSTED) == 0); 00639 DestroyNotify(pn); 00640 } 00641 } 00642 } 00643 00644 peh = gpWinEventHooks; 00645 while (peh) { 00646 pehNext = peh->pehNext; 00647 if (GETPTI(peh) == pti) { 00648 DestroyEventHook(peh); 00649 } 00650 peh = pehNext; 00651 } 00652 // Async notification not yet processed may still be posted in a queue, 00653 // pending being read and processed (gnNotifies > 0), although the 00654 // originating hook has now been unhooked (maybe gpWinEventHooks == NULL) 00655 // so the following assert is no good: 00656 // UserAssert(gpWinEventHooks || (!gpWinEventHooks && !gnNotifies)); 00657 }

VOID FreeTimer PTIMER  ptmr  ) 
 

Definition at line 112 of file timers.c.

References CheckCritIn, DecTimerCount(), gptmrFirst, HMFreeObject(), HMMarkObjectDestroy(), tagTIMER::ptmrNext, tagTIMER::ptmrPrev, Unlock, and VOID().

Referenced by DestroyThreadsTimers(), DestroyWindowsTimers(), FindTimer(), InitiateWin32kCleanup(), and Win32kNtUserCleanup().

00113 { 00114 00115 CheckCritIn(); 00116 00117 /* 00118 * Mark it for destruction. If it the object is locked it can't 00119 * be freed right now. 00120 */ 00121 if (!HMMarkObjectDestroy((PVOID)ptmr)) 00122 return; 00123 00124 /* 00125 * If this timer was just about to be processed, decrement 00126 * the ready-count since we're blowing it off. 00127 */ 00128 if (ptmr->flags & TMRF_READY) 00129 DecTimerCount(ptmr->pti); 00130 00131 /* 00132 * Unlock the window 00133 */ 00134 Unlock(&ptmr->spwnd); 00135 00136 /* 00137 * Unlink this timer 00138 */ 00139 if (ptmr->ptmrPrev) { 00140 ptmr->ptmrPrev->ptmrNext = ptmr->ptmrNext; 00141 } else { 00142 gptmrFirst = ptmr->ptmrNext; 00143 } 00144 00145 if (ptmr->ptmrNext) { 00146 ptmr->ptmrNext->ptmrPrev = ptmr->ptmrPrev; 00147 } 00148 00149 /* 00150 * Free up the TIMER structure. 00151 */ 00152 HMFreeObject((PVOID)ptmr); 00153 }

VOID FreeWindowStation IN PWINDOWSTATION  WindowStation  ) 
 

Referenced by Win32UserInitialize().

BOOL FRemoveForegroundActivate PTHREADINFO  pti  ) 
 

Definition at line 1717 of file focusact.c.

References BOOL, ClearAppStarting(), tagTHREADINFO::ppi, TIF_ALLOWFOREGROUNDACTIVATE, and tagTHREADINFO::TIF_flags.

Referenced by FAllowForegroundActivate(), and xxxSetForegroundWindow().

01718 { 01719 BOOL fRemoved; 01720 PPROCESSINFO ppi; 01721 /* 01722 * W32PF_APPSTARTING gets turned off the first activate this process does. 01723 * We assume it's ready now for action. 01724 */ 01725 ppi = pti->ppi; 01726 if (ppi->W32PF_Flags & W32PF_APPSTARTING) { 01727 ClearAppStarting(ppi); 01728 } 01729 01730 /* 01731 * Remove the right if present. 01732 */ 01733 fRemoved = (pti->TIF_flags & TIF_ALLOWFOREGROUNDACTIVATE); 01734 if (fRemoved) { 01735 pti->TIF_flags &= ~TIF_ALLOWFOREGROUNDACTIVATE ; 01736 TAGMSG1(DBGTAG_FOREGROUND, "FRemoveForegroundActivate clear TIF %#p", pti); 01737 } else { 01738 fRemoved = (ppi->W32PF_Flags & W32PF_ALLOWFOREGROUNDACTIVATE); 01739 } 01740 if (fRemoved) { 01741 ppi->W32PF_Flags &= ~W32PF_ALLOWFOREGROUNDACTIVATE; 01742 TAGMSG1(DBGTAG_FOREGROUND, "FRemoveForegroundActivate clear W32PF %#p", ppi); 01743 } 01744 01745 return fRemoved; 01746 01747 }

__inline BOOL FSwpTopmost PWND  pwnd  ) 
 

Definition at line 5504 of file userk.h.

References BOOL.

Referenced by LinkWindow(), TrackBackground(), TrackZorder(), and ValidateWindowPos().

05512 : GetTopMostInsertAfter(pwnd))

void FullScreenCleanup  ) 
 

Definition at line 101 of file fullscr.c.

References CLEAR_PUDF, FALSE, fGdiEnabled, fRedoFullScreenSwitch, gbFullScreen, grpdeskRitInput, gspwndFullScreen, HW, idSwitcher, LockWindowUpdate2(), NOSWITCHER, NULL, tagDESKTOP::pDeskInfo, PsGetCurrentThread, PUDF_LOCKFULLSCREEN, tagDESKTOPINFO::spwnd, ThreadLock, ThreadUnlock, TRACE_SWITCH, TRUE, Unlock, and xxxSendNotifyMessage().

Referenced by UserThreadCallout().

00102 { 00103 if (PsGetCurrentThread()->Cid.UniqueThread == idSwitcher) { 00104 00105 /* 00106 * correct the full screen state 00107 */ 00108 00109 if (fGdiEnabled) { 00110 00111 TRACE_SWITCH(("Switching: FullScreenCleanup: Gdi Enabled\n")); 00112 00113 /* 00114 * gdi is enabled, we are switching away from gdi the only thing we 00115 * could have done so far is locking the screen so unlock it. 00116 */ 00117 CLEAR_PUDF(PUDF_LOCKFULLSCREEN); 00118 LockWindowUpdate2(NULL, TRUE); 00119 00120 } else { 00121 00122 /* 00123 * GDI is not enabled . This means we were switching from a full 00124 * screen to another fullscreen or back to GDI. Or we could have 00125 * disabled gdi and sent a message to the new full screen which 00126 * never got completed. 00127 * 00128 * In any case this probably means the fullscreen guy is gone so 00129 * we will switch back to gdi. 00130 * 00131 * delete any left over saved screen state stuff 00132 * set the fullscreen to nothing and then send a message that will 00133 * cause us to switch back to the gdi desktop 00134 */ 00135 TL tlpwndT; 00136 00137 TRACE_SWITCH(("Switching: FullScreenCleanup: Gdi Disabled\n")); 00138 00139 Unlock(&gspwndFullScreen); 00140 gbFullScreen = FULLSCREEN; 00141 00142 ThreadLock(grpdeskRitInput->pDeskInfo->spwnd, &tlpwndT); 00143 xxxSendNotifyMessage( 00144 grpdeskRitInput->pDeskInfo->spwnd, WM_FULLSCREEN, 00145 GDIFULLSCREEN, (LPARAM)HW(grpdeskRitInput->pDeskInfo->spwnd)); 00146 ThreadUnlock(&tlpwndT); 00147 } 00148 00149 idSwitcher = NOSWITCHER; 00150 fRedoFullScreenSwitch = FALSE; 00151 } 00152 }

BOOL FVisCountable PWND  pwnd  ) 
 

Definition at line 5107 of file swp.c.

References BOOL, FALSE, FNID_DESKTOP, FTopLevel, GETFNID, TestWF, TRUE, WFDESTROYED, and WFMINIMIZED.

Referenced by cDecVis(), HMChangeOwnerThread(), and IncVisWindows().

05108 { 05109 if (!TestWF(pwnd, WFDESTROYED)) { 05110 if ((GETFNID(pwnd) == FNID_DESKTOP) || 05111 (FTopLevel(pwnd) && !TestWF(pwnd, WFMINIMIZED))) { 05112 return TRUE; 05113 } 05114 } 05115 return FALSE; 05116 }

HKL GetActiveHKL  ) 
 

Definition at line 439 of file ntinput.c.

References _GetKeyboardLayout(), CheckCritIn, GETPTI, gpqForeground, tagKL::hkl, L, tagTHREADINFO::spklActive, and tagQ::spwndActive.

Referenced by FindImeHotKeyByKey(), RemoteSyncToggleKeys(), VKFromVSC(), xxxButtonEvent(), xxxKeyEvent(), and xxxProcessKeyEvent().

00440 { 00441 CheckCritIn(); 00442 if (gpqForeground && gpqForeground->spwndActive) { 00443 PTHREADINFO ptiForeground = GETPTI(gpqForeground->spwndActive); 00444 if (ptiForeground && ptiForeground->spklActive) { 00445 return ptiForeground->spklActive->hkl; 00446 } 00447 } 00448 return _GetKeyboardLayout(0L); 00449 }

PWND GetActiveTrackPwnd PWND  pwnd,
Q **  ppq
 

Definition at line 2251 of file ntuser/kernel/input.c.

References CheckCritIn, DWP_GetEnabledPopup(), GETPTI, gpqForeground, tagWND::head, IsModelessMenuNotificationWindow(), NULL, tagQ::spwndActive, tagWND::spwndParent, TestWF, TestwndChild, WFDISABLED, and WFVISIBLE.

Referenced by xxxActiveWindowTracking(), xxxSystemTimerProc(), xxxTrackMouseMove(), and zzzActiveCursorTracking().

02252 { 02253 PWND pwndActivate; 02254 Q *pq; 02255 02256 CheckCritIn(); 02257 pwndActivate = pwnd; 02258 02259 /* 02260 * Find the top parent 02261 */ 02262 while (TestwndChild(pwndActivate)) { 02263 pwndActivate = pwndActivate->spwndParent; 02264 } 02265 02266 /* 02267 * If disabled, get a enabled popup owned by it. 02268 */ 02269 if (TestWF(pwndActivate, WFDISABLED)) { 02270 /* 02271 * This is what we do elsewhere when someone clicks on a 02272 * disabled non-active window. It might be cheaper to check 02273 * pwnd->spwndLastActive first (we might need to walk up 02274 * the owner chain though, as this is where we set spwndLastAcitve 02275 * when activating a new window. see xxxActivateThisWindow). 02276 * But let's do the same here; this should be fixed/improved 02277 * in DWP_GetEnabledPopup anyway. There might be a reason 02278 * why we don't grab spwndLastActive if OK.... perhaps it has 02279 * something to do with nested owner windows 02280 */ 02281 pwndActivate = DWP_GetEnabledPopup(pwndActivate); 02282 } 02283 02284 /* 02285 * Bail if we didn't find a visible window 02286 */ 02287 if ((pwndActivate == NULL) || !TestWF(pwndActivate, WFVISIBLE)) { 02288 return NULL; 02289 } 02290 02291 /* 02292 * If already active in the foreground queue, nothing to do 02293 * Don't activate the modeless menu notification window (it would 02294 * dismiss the menu) 02295 */ 02296 pq = GETPTI(pwndActivate)->pq; 02297 if ((pq == gpqForeground) 02298 && ((pwndActivate == pq->spwndActive) 02299 || IsModelessMenuNotificationWindow(pwndActivate))) { 02300 02301 return NULL; 02302 } 02303 02304 /* 02305 * Don't activate the shell window. 02306 */ 02307 if (pwndActivate == pwndActivate->head.rpdesk->pDeskInfo->spwndShell) { 02308 return NULL; 02309 } 02310 02311 /* 02312 * Return the queue if requested 02313 */ 02314 if (ppq != NULL) { 02315 *ppq = pq; 02316 } 02317 02318 return pwndActivate; 02319 }

__inline DWORD GetAppCompatFlags2ForPti PTHREADINFO  pti,
WORD  wVer
 

Definition at line 6044 of file userk.h.

References BOOL, and NULL.

Referenced by GetAppCompatFlags2(), and xxxDDETrackWindowDying().

06050 {

__inline int GetCaptionHeight PWND  pwnd  ) 
 

Definition at line 6919 of file userk.h.

Referenced by xxxCalcClientRect(), xxxDrawWindowFrame(), xxxMenuBarDraw(), xxxMNRecomputeBarIfNeeded(), and xxxMoveSize().

06930 {

PCURSOR GetClassIcoCur PWND  pwnd,
int  index
 

Definition at line 1297 of file class.c.

References NULL, and tagWND::pcls.

01298 { 01299 PCLS pcls = pwnd->pcls; 01300 PCURSOR pcur; 01301 01302 switch (index) { 01303 case GCLP_HICON: 01304 pcur = pcls->spicn; 01305 break; 01306 01307 case GCLP_HCURSOR: 01308 pcur = pcls->spcur; 01309 break; 01310 01311 case GCLP_HICONSM: 01312 pcur = pcls->spicnSm; 01313 break; 01314 01315 default: 01316 RIPMSG2(RIP_WARNING, "GetWndIcoCur: Invalid index:%#lx. pwnd:%#p", 01317 index, pwnd); 01318 pcur = NULL; 01319 } 01320 01321 return pcur; 01322 }

PPCLS GetClassPtr ATOM  atom,
PPROCESSINFO  ppi,
HANDLE  hModule
 

Definition at line 1036 of file class.c.

References _InnerGetClassPtr(), gpclsList, hModClient, NULL, tagPROCESSINFO::pclsPrivateList, and tagPROCESSINFO::pclsPublicList.

Referenced by _GetClassInfoEx(), _GetWOWClass(), HMChangeOwnerThread(), xxxCreateWindowEx(), and xxxFreeWindow().

01040 { 01041 PPCLS ppcls; 01042 01043 /* 01044 * First search public then private then usersrv registered classes 01045 */ 01046 ppcls = _InnerGetClassPtr(atom, &ppi->pclsPrivateList, hModule); 01047 if (ppcls) 01048 return ppcls; 01049 01050 ppcls = _InnerGetClassPtr(atom, &ppi->pclsPublicList, NULL); 01051 if (ppcls) 01052 return ppcls; 01053 01054 /* 01055 * Next seach public and private classes and override hmodule; 01056 * some apps (bunny) do a GetClassInfo(dialog) and RegisterClass 01057 * and only change the wndproc which set the hmodule to be just 01058 * like usersrv created it even though it is in the app's public 01059 * or private class list 01060 */ 01061 01062 /* 01063 * Later -- since we are no longer returning hModuleWin to any app, 01064 * we may only need to check for hModClient. Check this out. 01065 * FritzS 01066 */ 01067 01068 ppcls = _InnerGetClassPtr(atom, &ppi->pclsPrivateList, hModClient); 01069 if (ppcls) 01070 return ppcls; 01071 01072 ppcls = _InnerGetClassPtr(atom, &ppi->pclsPublicList, hModClient); 01073 if (ppcls) 01074 return ppcls; 01075 01076 /* 01077 * Search the system class list 01078 */ 01079 ppcls = _InnerGetClassPtr(atom, &gpclsList, NULL); 01080 return ppcls; 01081 }

DWORD GetContextHelpId PWND  pwnd  ) 
 

Definition at line 28 of file rtl/help.c.

References _GetProp(), tagSERVERINFO::atomContextHelpIdProp, DWORD, FNID_DESKTOP, GETFNID, gpsi, MAKEINTATOM, PROPF_INTERNAL, REBASEPWND, and TestwndChild.

Referenced by ComboBoxWndProcWorker(), xxxDefWindowProc(), and xxxHelpLoop().

00030 { 00031 DWORD dwContextId; 00032 00033 while (!(dwContextId = (DWORD)(ULONG_PTR)_GetProp(pwnd, 00034 MAKEINTATOM(gpsi->atomContextHelpIdProp), PROPF_INTERNAL))) { 00035 pwnd = (TestwndChild(pwnd) ? 00036 REBASEPWND(pwnd, spwndParent) : 00037 REBASEPWND(pwnd, spwndOwner)); 00038 if (!pwnd || (GETFNID(pwnd) == FNID_DESKTOP)) 00039 break; 00040 } 00041 00042 return dwContextId; 00043 }

BOOL GetDCOrgOnScreen HDC  hdc,
LPPOINT  ppt
 

Definition at line 2066 of file dc.c.

References BOOL, FALSE, TRUE, and UserGetRedirectedWindowOrigin().

Referenced by InternalScrollDC(), and xxxScrollWindowEx().

02067 { 02068 if (GreGetDCOrg(hdc, ppt)) { 02069 POINT ptScreen; 02070 02071 /* 02072 * Get the origin of the redirected window in screen coordinates. 02073 */ 02074 if (UserGetRedirectedWindowOrigin(hdc, &ptScreen)) { 02075 ppt->x += ptScreen.x; 02076 ppt->y += ptScreen.y; 02077 return TRUE; 02078 } 02079 } 02080 return FALSE; 02081 }

DWORD GetDebugHookLParamSize WPARAM  wParam,
PDEBUGHOOKINFO  pdebughookstruct
 

Referenced by NtUserfnHkINLPDEBUGHOOKSTRUCT().

PDESKTOPVIEW GetDesktopView PPROCESSINFO  ppi,
PDESKTOP  pdesk
 

Definition at line 2773 of file desktop.c.

References gpepCSRSS, NULL, tagDESKTOPVIEW::pdesk, tagPROCESSINFO::pdvList, and tagDESKTOPVIEW::pdvNext.

Referenced by _MapDesktopObject(), FreeView(), MapDesktop(), NtUserPostThreadMessage(), OpenDesktopCompletion(), UserCommitDesktopMemory(), ValidateHwnd(), xxxCreateDesktop(), xxxResolveDesktop(), xxxSetThreadDesktop(), and zzzSetDesktop().

02776 { 02777 PDESKTOPVIEW pdv; 02778 02779 if(ppi->Process != gpepCSRSS && pdesk == NULL) { 02780 RIPMSG1(RIP_WARNING, "Process %#p isn't CSRSS but pdesk is NULL in GetDesktopView", ppi); 02781 } 02782 02783 for (pdv = ppi->pdvList; pdv != NULL; pdv = pdv->pdvNext) 02784 if (pdv->pdesk == pdesk) 02785 break; 02786 return pdv; 02787 }

ULONG GetDeviceChangeInfo VOID   ) 
 

__inline PDISPLAYINFO GetDispInfo void   ) 
 

Definition at line 7351 of file userk.h.

07362 {

__inline DWORD GetFlashWindowState PWND  pwnd  ) 
 

Definition at line 5658 of file userk.h.

References VOID().

Referenced by xxxFlashWindow().

05669 {

BOOL GetHDevName HMONITOR  hMon,
PWCHAR  pName
 

Definition at line 13465 of file kernel/ntstubs.c.

References BOOL, CheckCritIn, DWORD, FALSE, tagMONITOR::hDev, ProbeForWrite(), StubExceptionHandler, TRUE, and ValidateHmonitor().

13466 { 13467 PMONITOR pMonitor; 13468 13469 CheckCritIn(); 13470 13471 pMonitor = ValidateHmonitor(hMon); 13472 if (!pMonitor) { 13473 return FALSE; 13474 } 13475 13476 try { 13477 ProbeForWrite(pName, CCHDEVICENAME*sizeof(WCHAR), sizeof(DWORD)); 13478 } except (StubExceptionHandler(TRUE)) { 13479 return FALSE; 13480 } 13481 return DrvGetHdevName(pMonitor->hDev, pName); 13482 }

int GetHmodTableIndex PUNICODE_STRING  pstrName  ) 
 

Definition at line 53 of file libmgmt.c.

References aatomSysLoaded, acatomSysDepends, acatomSysUse, catomSysTableEntries, CLIBS, FALSE, ProbeAndReadUnicodeString, ProbeForReadUnicodeStringBuffer, UserAddAtom(), and UserDeleteAtom().

Referenced by _SetWinEventHook(), and zzzSetWindowsHookEx().

00055 { 00056 int i; 00057 ATOM atom; 00058 UNICODE_STRING strLibName; 00059 00060 /* 00061 * Probe string 00062 */ 00063 try { 00064 strLibName = ProbeAndReadUnicodeString(pstrLibName); 00065 ProbeForReadUnicodeStringBuffer(strLibName); 00066 atom = UserAddAtom(strLibName.Buffer, FALSE); 00067 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00068 return -1; 00069 } 00070 00071 /* 00072 * If we can't add the atom we're hosed 00073 * so return an error. 00074 */ 00075 if (atom == 0) { 00076 return -1; 00077 } 00078 00079 /* 00080 * Search for atom index 00081 */ 00082 for (i = 0; i < catomSysTableEntries && aatomSysLoaded[i] != atom; i++) 00083 ; 00084 00085 if (i == catomSysTableEntries) { 00086 00087 /* 00088 * Find empty entry for atom 00089 */ 00090 for (i = 0; i < catomSysTableEntries && aatomSysLoaded[i]; i++) 00091 ; 00092 00093 /* 00094 * Check if no empty entry found 00095 */ 00096 if (i == catomSysTableEntries) { 00097 if (i == CLIBS) { 00098 UserDeleteAtom(atom); 00099 RIPERR0(ERROR_NOT_ENOUGH_MEMORY, 00100 RIP_WARNING, 00101 "Memory allocation failed in GetHmodTableIndex"); 00102 00103 return -1; 00104 } 00105 00106 /* 00107 * Increase table size 00108 */ 00109 catomSysTableEntries++; 00110 } 00111 00112 /* 00113 * Set entry 00114 */ 00115 aatomSysLoaded[i] = atom; 00116 acatomSysUse[i] = 0; 00117 acatomSysDepends[i] = 0; 00118 } else { 00119 UserDeleteAtom(atom); 00120 } 00121 00122 return i; 00123 }

BOOL GetImeHotKey DWORD  dwHotKeyID,
PUINT  puModifiers,
PUINT  puVKey,
HKL *  phKL
 

Definition at line 71 of file imehotky.c.

References FALSE, FindImeHotKeyByID(), gpImeHotKeyListHeader, _tagIMEHOTKEYOBJ::hk, _tagIMEHOTKEY::hKL, NULL, TRUE, _tagIMEHOTKEY::uModifiers, and _tagIMEHOTKEY::uVKey.

Referenced by NtUserGetImeHotKey().

00076 { 00077 PIMEHOTKEYOBJ ph; 00078 00079 ph = FindImeHotKeyByID( gpImeHotKeyListHeader, dwHotKeyID ); 00080 if ( ph == NULL ) { 00081 RIPERR0(ERROR_HOTKEY_NOT_REGISTERED, RIP_VERBOSE, "No such IME hotkey"); 00082 return (FALSE); 00083 } 00084 00085 // 00086 // it is OK for NULL phKL, if the target hKL is NULL 00087 // 00088 if ( phKL ) { 00089 *phKL = ph->hk.hKL; 00090 } else if ( ph->hk.hKL != NULL ) { 00091 RIPERR0(ERROR_INVALID_PARAMETER, RIP_WARNING, "phKL is null"); 00092 return (FALSE); 00093 } 00094 00095 *puModifiers = ph->hk.uModifiers; 00096 *puVKey = ph->hk.uVKey; 00097 00098 return (TRUE); 00099 }

BOOL GetImeInfoEx IN PWINDOWSTATION  pwinsta,
IN PIMEINFOEX  piiex,
IN IMEINFOEXCLASS  SearchType
 

Referenced by NtUserGetImeInfoEx().

PQ GetJournallingQueue PTHREADINFO  pti  ) 
 

Definition at line 1416 of file queue.c.

References GETPTI, IsHooked, NULL, PhkFirstGlobalValid(), tagTHREADINFO::rpdesk, TIF_DONTJOURNALATTACH, tagTHREADINFO::TIF_flags, and WHF_FROM_WH.

Referenced by xxxCreateThreadInfo(), and zzzSetDesktop().

01417 { 01418 PHOOK phook; 01419 /* 01420 * fail if we cannot journal this thread 01421 */ 01422 if ((pti->TIF_flags & TIF_DONTJOURNALATTACH) 01423 || (pti->rpdesk == NULL)) { 01424 01425 return NULL; 01426 } 01427 /* 01428 * Get the journalling hook if any. 01429 */ 01430 phook = PhkFirstGlobalValid(pti, WH_JOURNALPLAYBACK); 01431 if (phook == NULL) { 01432 phook = PhkFirstGlobalValid(pti, WH_JOURNALRECORD); 01433 } 01434 /* 01435 * Validate fsHooks bits. 01436 */ 01437 UserAssert((phook == NULL) 01438 ^ IsHooked(pti, (WHF_FROM_WH(WH_JOURNALPLAYBACK) | WHF_FROM_WH(WH_JOURNALRECORD)))); 01439 01440 /* 01441 * return the queue if we found a journalling hook 01442 */ 01443 return ((phook == NULL) ? NULL : GETPTI(phook)->pq); 01444 }

BOOL GetKbdLangSwitch PUNICODE_STRING  pProfileUserName  ) 
 

Definition at line 2393 of file w32/ntuser/kernel/init.c.

References BOOL, tagKBDLANGTOGGLE::bScan, tagKBDLANGTOGGLE::bVkey, DWORD, FALSE, FastGetProfileIntW(), gbGraveKeyToggle, gLangToggle, PMAP_UKBDLAYOUTTOGGLE, and TRUE.

Referenced by xxxSystemParametersInfo(), and xxxUpdatePerUserSystemParameters().

02394 { 02395 DWORD dwToggle; 02396 BOOL bStatus = TRUE; 02397 LCID lcid; 02398 02399 dwToggle = FastGetProfileIntW(pProfileUserName, 02400 PMAP_UKBDLAYOUTTOGGLE, 02401 TEXT("Hotkey"), 02402 1); 02403 02404 gbGraveKeyToggle = FALSE; 02405 02406 switch (dwToggle) { 02407 case 4: 02408 /* 02409 * Grave accent keyboard switch for thai locales 02410 */ 02411 ZwQueryDefaultLocale(FALSE, &lcid); 02412 gbGraveKeyToggle = (PRIMARYLANGID(lcid) == LANG_THAI) ? TRUE : FALSE; 02413 /* 02414 * fall through (intentional) and disable the ctrl/alt toggle mechanism 02415 */ 02416 case 3: 02417 gLangToggle[0].bVkey = 0; 02418 gLangToggle[0].bScan = 0; 02419 break; 02420 02421 case 2: 02422 gLangToggle[0].bVkey = VK_CONTROL; 02423 break; 02424 02425 default: 02426 gLangToggle[0].bVkey = VK_MENU; 02427 break; 02428 } 02429 02430 return bStatus; 02431 }

PWND GetLayeredWindow PWND  pwnd  ) 
 

Definition at line 1166 of file sprite.c.

References GetTopLevelWindow(), NULL, TestWF, and WEFLAYERED.

Referenced by _GetDCEx(), ResetOrg(), UpdateLayeredSprite(), UserGetRedirectedWindowOrigin(), and xxxCalcValidRects().

01167 { 01168 pwnd = GetTopLevelWindow(pwnd); 01169 01170 if (TestWF(pwnd, WEFLAYERED)) 01171 return pwnd; 01172 01173 return NULL; 01174 }

PWND GetMenuStateWindow PMENUSTATE  pMenuState  ) 
 

Definition at line 232 of file ntuser/kernel/menu.c.

References tagPOPUPMENU::fIsTrackPopup, NULL, tagMENUSTATE::pGlobalPopupMenu, tagPOPUPMENU::spwndActivePopup, tagPOPUPMENU::spwndNextPopup, and tagPOPUPMENU::spwndPopupMenu.

Referenced by NtUserEndMenu(), xxxHandleMenuMessages(), and xxxMNDragOver().

00233 { 00234 if (pMenuState == NULL) { 00235 return NULL; 00236 } else if (pMenuState->pGlobalPopupMenu->fIsTrackPopup) { 00237 return pMenuState->pGlobalPopupMenu->spwndPopupMenu; 00238 } else if (pMenuState->pGlobalPopupMenu->spwndNextPopup != NULL) { 00239 return pMenuState->pGlobalPopupMenu->spwndNextPopup; 00240 } else { 00241 return pMenuState->pGlobalPopupMenu->spwndActivePopup; 00242 } 00243 }

HDC GetMonitorDC PDCE  pdceOrig,
PMONITOR  pMonitor
 

Definition at line 2151 of file dc.c.

References CreateCacheDC(), CreateEmptyRgn(), tagDCE::DCX_flags, DCX_LEAVEBITS, DecrementFreeDCECount(), ghrgnGDC, gpDispInfo, tagDCE::hdc, HRGN_FULL, tagDCE::hrgnClip, NULL, OffsetRect(), tagDISPLAYINFO::pdceFirst, tagDCE::pdceNext, tagDCE::pMonitor, tagDCE::ptiOwner, tagDCE::pwndClip, tagDCE::pwndOrg, tagMONITOR::rcMonitor, SetMonitorRegion(), and SpbCheckDce().

Referenced by xxxEnumDisplayMonitors().

02152 { 02153 PDCE pdce; 02154 POINT pt; 02155 RECT rc; 02156 02157 TryAgain: 02158 for (pdce = gpDispInfo->pdceFirst; pdce != NULL; pdce = pdce->pdceNext) { 02159 /* 02160 * Find an available DC for this monitor. 02161 */ 02162 if (pdce->DCX_flags & (DCX_INUSE | DCX_DESTROYTHIS)) 02163 continue; 02164 02165 if (pdce->pMonitor != pMonitor) 02166 continue; 02167 02168 if (!(pdce->DCX_flags & DCX_INVALID)) 02169 SpbCheckDce(pdce); 02170 02171 /* 02172 * Copy DC properties and style bits. 02173 */ 02174 GreSetDCOwner(pdce->hdc, OBJECT_OWNER_CURRENT); 02175 pdce->pwndOrg = pdceOrig->pwndOrg; 02176 pdce->pwndClip = pdceOrig->pwndClip; 02177 pdce->ptiOwner = pdceOrig->ptiOwner; 02178 pdce->DCX_flags = (DCX_INUSE | DCX_CACHE) | 02179 (pdceOrig->DCX_flags & DCX_LEAVEBITS); 02180 02181 if (pdceOrig->hrgnClip > HRGN_FULL) { 02182 UserAssert(pdce->hrgnClip == NULL); 02183 UserAssert(pdceOrig->DCX_flags & (DCX_INTERSECTRGN | DCX_EXCLUDERGN)); 02184 02185 pdce->hrgnClip = CreateEmptyRgn(); 02186 SetMonitorRegion(pMonitor, pdce->hrgnClip, pdceOrig->hrgnClip); 02187 } else { 02188 pdce->hrgnClip = pdceOrig->hrgnClip; 02189 } 02190 02191 /* 02192 * Setup the visrgn clipped to this monitor. 02193 */ 02194 GreCopyVisRgn(pdceOrig->hdc, ghrgnGDC); 02195 SetMonitorRegion(pMonitor, ghrgnGDC, ghrgnGDC); 02196 GreSelectVisRgn(pdce->hdc, ghrgnGDC, SVR_COPYNEW); 02197 02198 GreGetDCOrgEx(pdceOrig->hdc, &pt, &rc); 02199 OffsetRect(&rc, -pMonitor->rcMonitor.left, -pMonitor->rcMonitor.top); 02200 GreSetDCOrg(pdce->hdc, rc.left, rc.top, (PRECTL)&rc); 02201 02202 /* 02203 * Decrement the Free DCE Count. This should always be >= 0, 02204 * since we'll create a new dce if the cache is all in use. 02205 */ 02206 DecrementFreeDCECount(); 02207 02208 return pdce->hdc; 02209 } 02210 02211 /* 02212 * If this call succeeds a new DC will be available in the cache, 02213 * so the loop will find it and properly set it up. 02214 */ 02215 if (CreateCacheDC(NULL, DCX_INVALID | DCX_CACHE, pMonitor) == NULL) 02216 return NULL; 02217 02218 goto TryAgain; 02219 }

void GetMonitorMaxArea PWND  pwnd,
PMONITOR  pMonitor,
LPRECT *  pprc
 

Definition at line 62 of file movesize.c.

References tagMONITOR::cFullScreen, tagMONITOR::rcMonitor, tagMONITOR::rcWork, TestWF, WFCPRESENT, and WFMAXBOX.

Referenced by CkptRestore(), and xxxInitSendValidateMinMaxInfo().

00063 { 00064 if ( !TestWF(pwnd, WFMAXBOX) || 00065 !TestWF(pwnd, WFCPRESENT) || 00066 pMonitor->cFullScreen) { 00067 00068 *pprc = &pMonitor->rcMonitor; 00069 } else { 00070 *pprc = &pMonitor->rcWork; 00071 } 00072 }

UINT GetMouseKeyFlags PQ  pq  ) 
 

Definition at line 3267 of file ntuser/kernel/input.c.

References TestKeyStateDown, and UINT.

Referenced by xxxDefWindowProc(), xxxProcessEventMessage(), xxxScanSysQueue(), and xxxSystemTimerProc().

03269 { 03270 UINT wParam = 0; 03271 03272 if (TestKeyStateDown(pq, VK_LBUTTON)) 03273 wParam |= MK_LBUTTON; 03274 if (TestKeyStateDown(pq, VK_RBUTTON)) 03275 wParam |= MK_RBUTTON; 03276 if (TestKeyStateDown(pq, VK_MBUTTON)) 03277 wParam |= MK_MBUTTON; 03278 if (TestKeyStateDown(pq, VK_XBUTTON1)) 03279 wParam |= MK_XBUTTON1; 03280 if (TestKeyStateDown(pq, VK_XBUTTON2)) 03281 wParam |= MK_XBUTTON2; 03282 if (TestKeyStateDown(pq, VK_SHIFT)) 03283 wParam |= MK_SHIFT; 03284 if (TestKeyStateDown(pq, VK_CONTROL)) 03285 wParam |= MK_CONTROL; 03286 03287 return wParam; 03288 }

__inline PPOPUPMENU GetpGlobalPopupMenu PWND  pwnd  ) 
 

Definition at line 4731 of file userk.h.

Referenced by xxxGetMenuBarInfo(), and xxxGetSystemMenu().

04734 {

__inline PMENUSTATE GetpMenuState PWND  pwnd  ) 
 

Definition at line 4727 of file userk.h.

References BOOL.

Referenced by MNGetPopupFromMenu(), xxxDestroyWindow(), xxxDWP_DoCancelMode(), xxxMenuWindowProc(), xxxMNEndMenuState(), xxxMNStartMenu(), xxxMNSwitchToAlternateMenu(), and xxxSendMenuSelect().

04730 {

__inline PMONITOR GetPrimaryMonitor void   ) 
 

Definition at line 7358 of file userk.h.

References gpDispInfo.

07362 {

NTSTATUS GetProcessLuid PETHREAD Thread  OPTIONAL,
PLUID  LuidProcess
 

Definition at line 50 of file ex.c.

References NTSTATUS(), NULL, ObDereferenceObject, PsGetCurrentThread, PsReferenceImpersonationToken(), PsReferencePrimaryToken(), SeQueryAuthenticationIdToken(), Status, and _ETHREAD::ThreadsProcess.

Referenced by EndShutdown(), InitiateShutdown(), InitPreviousUserString(), NtUserCreateWindowStation(), NtUserOpenWindowStation(), NtUserPostThreadMessage(), OpenDesktopCompletion(), xxxCreateDesktop2(), xxxInitProcessInfo(), xxxResolveDesktop(), and xxxUpdatePerUserAccessPackSettings().

00054 { 00055 PACCESS_TOKEN UserToken = NULL; 00056 BOOLEAN fCopyOnOpen; 00057 BOOLEAN fEffectiveOnly; 00058 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; 00059 NTSTATUS Status; 00060 00061 if (Thread == NULL) 00062 Thread = PsGetCurrentThread(); 00063 00064 // 00065 // Check for a thread token first 00066 // 00067 00068 UserToken = PsReferenceImpersonationToken(Thread, 00069 &fCopyOnOpen, &fEffectiveOnly, &ImpersonationLevel); 00070 00071 if (UserToken == NULL) { 00072 00073 // 00074 // No thread token, go to the process 00075 // 00076 00077 UserToken = PsReferencePrimaryToken(Thread->ThreadsProcess); 00078 if (UserToken == NULL) 00079 return STATUS_NO_TOKEN; 00080 } 00081 00082 Status = SeQueryAuthenticationIdToken(UserToken, LuidProcess); 00083 00084 // 00085 // We're finished with the token 00086 // 00087 00088 ObDereferenceObject(UserToken); 00089 00090 return Status; 00091 }

ULONG GetTaskName PTHREADINFO  pti,
PWSTR  Buffer,
ULONG  BufferLength
 

Definition at line 5857 of file queue.c.

References Buffer, FALSE, min, NT_SUCCESS, NTSTATUS(), NULL, tagTHREADINFO::pstrAppName, RtlAnsiStringToUnicodeString(), RtlInitAnsiString(), SHORT, and Status.

Referenced by xxxQueryInformationThread(), and xxxSendBSMtoDesktop().

05861 { 05862 ANSI_STRING strAppName; 05863 UNICODE_STRING strAppNameU; 05864 NTSTATUS Status; 05865 ULONG NameLength = 0; 05866 05867 if (pti == NULL) { 05868 *Buffer = 0; 05869 return 0; 05870 } 05871 if (pti->pstrAppName != NULL) { 05872 NameLength = min(pti->pstrAppName->Length + sizeof(WCHAR), BufferLength); 05873 RtlCopyMemory(Buffer, pti->pstrAppName->Buffer, NameLength); 05874 } else { 05875 RtlInitAnsiString(&strAppName, pti->pEThread->ThreadsProcess->ImageFileName); 05876 if (BufferLength < sizeof(WCHAR)) 05877 NameLength = (strAppName.Length + 1) * sizeof(WCHAR); 05878 else { 05879 strAppNameU.Buffer = Buffer; 05880 strAppNameU.MaximumLength = (SHORT)BufferLength - sizeof(WCHAR); 05881 Status = RtlAnsiStringToUnicodeString(&strAppNameU, &strAppName, 05882 FALSE); 05883 if (NT_SUCCESS(Status)) 05884 NameLength = strAppNameU.Length + sizeof(WCHAR); 05885 } 05886 } 05887 Buffer[(NameLength / sizeof(WCHAR)) - 1] = 0; 05888 05889 return NameLength; 05890 }

PWND GetTopMostInsertAfter PWND  pwnd  ) 
 

Definition at line 3843 of file swp.c.

References FNID_MENU, FNID_SWITCH, GETFNID, GETPTI, gHardErrorHandler, grpdeskLogon, NULL, tagDESKTOP::pDeskInfo, tagTHREADINFO::ppi, tagWINDOWSTATION::pTerm, tagHARDERRORHANDLER::pti, PtiCurrent, tagTHREADINFO::rpdesk, tagDESKTOP::rpwinstaParent, tagDESKTOPINFO::spwnd, tagWND::spwndChild, tagWND::spwndNext, TestWF, and WEFTOPMOST.

03844 { 03845 PWND pwndT; 03846 PTHREADINFO ptiCurrent; 03847 PDESKTOP pdesk; 03848 WORD wfnid; 03849 03850 /* 03851 * If you hit this assertion, you're probably not using the 03852 * GETTOPMOSTINSERTAFTER macro to make this call. 03853 */ 03854 UserAssert(gHardErrorHandler.pti != NULL); 03855 /* 03856 * pwnd: Menu and switch (ALT-TAB) windows can go on top. 03857 */ 03858 wfnid = GETFNID(pwnd); 03859 if ((wfnid == FNID_MENU) || (wfnid == FNID_SWITCH)) { 03860 return NULL; 03861 } 03862 03863 /* 03864 * pti: If this is the error handler thread, don't bother any longer. 03865 * Screen saver can go on top too. 03866 */ 03867 ptiCurrent = PtiCurrent(); 03868 UserAssert(ptiCurrent != NULL); 03869 03870 if (ptiCurrent == gHardErrorHandler.pti || (ptiCurrent->ppi->W32PF_Flags & W32PF_SCREENSAVER)) { 03871 return NULL; 03872 } 03873 03874 /* 03875 * pdesk: Leave the logon desktop alone. 03876 * Make sure the hard error box is on this desktop 03877 */ 03878 pdesk = ptiCurrent->rpdesk; 03879 UserAssert(pdesk != NULL); 03880 UserAssert(pdesk->rpwinstaParent); 03881 UserAssert(pdesk->rpwinstaParent->pTerm); 03882 03883 if ((pdesk == grpdeskLogon) 03884 || (pdesk != gHardErrorHandler.pti->rpdesk)) { 03885 return NULL; 03886 } 03887 03888 /* 03889 * Walk the window list looking for the hard error box. 03890 * Start searching from the current desktop's first child. 03891 * Note that the harderror box migth not be created yet. 03892 */ 03893 UserAssert(pdesk->pDeskInfo); 03894 UserAssert(pdesk->pDeskInfo->spwnd); 03895 03896 for (pwndT = pdesk->pDeskInfo->spwnd->spwndChild; 03897 pwndT != NULL; pwndT = pwndT->spwndNext) { 03898 03899 /* 03900 * Hard error boxes are always top most. 03901 */ 03902 if (!TestWF(pwndT, WEFTOPMOST)) { 03903 break; 03904 } 03905 03906 /* 03907 * If this window was created by the hard error handler thread, 03908 * then this is it 03909 */ 03910 if (gHardErrorHandler.pti == GETPTI(pwndT)) { 03911 return pwndT; 03912 } 03913 } 03914 03915 return NULL; 03916 }

VOID GetWindowNCMetrics LPNONCLIENTMETRICS  lpnc  ) 
 

Definition at line 1030 of file inctlpan.c.

References ghMenuFont, ghSmCaptionFont, ghStatusFont, gpsi, SYSMET, and VOID().

Referenced by xxxSystemParametersInfo().

01032 { 01033 lpnc->cbSize = sizeof(NONCLIENTMETRICS); 01034 lpnc->iBorderWidth = gpsi->gclBorder; 01035 lpnc->iScrollWidth = SYSMET(CXVSCROLL); 01036 lpnc->iScrollHeight = SYSMET(CYVSCROLL); 01037 lpnc->iCaptionWidth = SYSMET(CXSIZE); 01038 lpnc->iCaptionHeight = SYSMET(CYSIZE); 01039 lpnc->iSmCaptionWidth = SYSMET(CXSMSIZE); 01040 lpnc->iSmCaptionHeight = SYSMET(CYSMSIZE); 01041 lpnc->iMenuWidth = SYSMET(CXMENUSIZE); 01042 lpnc->iMenuHeight = SYSMET(CYMENUSIZE); 01043 01044 /* 01045 * Get the font info. 01046 */ 01047 GreExtGetObjectW(gpsi->hCaptionFont, 01048 sizeof(LOGFONTW), 01049 &(lpnc->lfCaptionFont)); 01050 01051 GreExtGetObjectW(ghSmCaptionFont, 01052 sizeof(LOGFONTW), 01053 &(lpnc->lfSmCaptionFont)); 01054 01055 GreExtGetObjectW(ghMenuFont, 01056 sizeof(LOGFONTW), 01057 &(lpnc->lfMenuFont)); 01058 01059 GreExtGetObjectW(ghStatusFont, 01060 sizeof(LOGFONTW), 01061 &(lpnc->lfStatusFont)); 01062 01063 GreExtGetObjectW(gpsi->hMsgFont, 01064 sizeof(LOGFONTW), 01065 &(lpnc->lfMessageFont)); 01066 }

UINT GetWndSBDisableFlags PWND  ,
BOOL 
 

Definition at line 186 of file sbctl.c.

References NULL, tagWND::pSBInfo, UINT, WSB_HORZ, WSB_VERT, and tagSBINFO::WSBflags.

Referenced by _GetScrollBarInfo(), HitTestScrollBar(), xxxDoScrollMenu(), xxxDrawScrollBar(), xxxDrawThumb(), and xxxSBTrackInit().

00189 { 00190 PSBINFO pw; 00191 00192 if ((pw = pwnd->pSBInfo) == NULL) { 00193 RIPERR0(ERROR_NO_SCROLLBARS, RIP_VERBOSE, ""); 00194 return 0; 00195 } 00196 00197 return (fVert ? (pw->WSBflags & WSB_VERT) >> 2 : pw->WSBflags & WSB_HORZ); 00198 }

__inline void GiveForegroundActivateRight HANDLE  hPid  ) 
 

Definition at line 6338 of file userk.h.

References ACTIVATE_ARRAY_SIZE, BOOL, and ghCanActivateForegroundPIDs.

Referenced by DestroyProcessInfo(), and xxxUserNotifyProcessCreate().

06349 {

__inline BOOL GiveUpForeground  ) 
 

Definition at line 7033 of file userk.h.

References gppiLockSFW, guSFWLockCount, and NULL.

Referenced by CheckAllowForeground(), and xxxSetForegroundWindow().

07033 { 07034 return ((guSFWLockCount != 0) || (gppiLockSFW != NULL)); 07035 } 07036 07037 07038 /* Bug 247768 - joejo 07039 * Add compatibility hack for foreground activation problems. 07040 * 07041 */ 07042 __inline 07043 BOOL GiveUpForeground() 07044 { 07045 07046 if (gptiForeground == NULL) {

UINT APIENTRY GreGetTextAlign HDC   ) 
 

Referenced by CreateCompatiblePublicDC(), xxxDrawCaptionTemp(), xxxDrawState(), xxxHotTrackMenu(), xxxMenuDraw(), and xxxMNInvertItem().

UINT APIENTRY GreSetTextAlign HDC  ,
UINT 
 

Referenced by CreateCompatiblePublicDC(), DesktopBuildPaint(), xxxDrawCaptionTemp(), xxxDrawState(), xxxHotTrackMenu(), xxxMenuDraw(), and xxxMNInvertItem().

__inline BOOL HasForegroundActivateRight HANDLE  hPid  ) 
 

Definition at line 6349 of file userk.h.

References ACTIVATE_ARRAY_SIZE, and ghCanActivateForegroundPIDs.

Referenced by CheckAllowForeground().

06349 { 06350 static int index = 0; 06351 06352 TAGMSG1(DBGTAG_FOREGROUND, "Giving %x foreground activate right", hPid); 06353 ghCanActivateForegroundPIDs[index++] = hPid; 06354 if(index == ACTIVATE_ARRAY_SIZE) { 06355 index = 0; 06356 } 06357 } 06358 06359 __inline BOOL HasForegroundActivateRight(HANDLE hPid) 06360 { 06361 int i = 0; 06362

ULONG HdevFromMonitor PMONITOR  pMonitor  ) 
 

Definition at line 432 of file fullscr.c.

References gpDispInfo, tagMONITOR::hDev, and tagDISPLAYINFO::pmdev.

Referenced by SnapshotMonitorRects(), and UpdateUserScreen().

00433 { 00434 PMDEV pmdev = gpDispInfo->pmdev; 00435 ULONG i; 00436 00437 for (i = 0; i < pmdev->chdev; i++) { 00438 if (pmdev->Dev[i].hdev == pMonitor->hDev) { 00439 return i; 00440 } 00441 } 00442 return -1; 00443 }

PKL HKLtoPKL PTHREADINFO  pti,
HKL  hkl
 

Definition at line 40 of file kbdlyout.c.

References tagKL::dwKL_Flags, tagKL::hkl, KL_UNLOADED, NULL, tagKL::pklNext, tagKL::pklPrev, and tagTHREADINFO::spklActive.

Referenced by NtUserMapVirtualKeyEx(), NtUserSetThreadLayoutHandles(), NtUserVkKeyScanEx(), xxxActivateKeyboardLayout(), xxxFreeKeyboardLayouts(), xxxInternalToUnicode(), xxxInternalUnloadKeyboardLayout(), xxxLoadKeyboardLayoutEx(), xxxScanSysQueue(), xxxSystemParametersInfo(), and xxxUnloadKeyboardLayout().

00043 { 00044 PKL pklActive; 00045 PKL pkl; 00046 00047 UserAssert(pti != NULL); 00048 if ((pklActive = pti->spklActive) == NULL) { 00049 return NULL; 00050 } 00051 00052 pkl = pklActive; 00053 00054 if (hkl == (HKL)HKL_PREV) { 00055 do { 00056 pkl = pkl->pklPrev; 00057 if (!(pkl->dwKL_Flags & KL_UNLOADED)) { 00058 return pkl; 00059 } 00060 } while (pkl != pklActive); 00061 return NULL; 00062 } else if (hkl == (HKL)HKL_NEXT) { 00063 do { 00064 pkl = pkl->pklNext; 00065 if (!(pkl->dwKL_Flags & KL_UNLOADED)) { 00066 return pkl; 00067 } 00068 } while (pkl != pklActive); 00069 return NULL; 00070 } 00071 00072 /* 00073 * Find the pkl for this hkl. 00074 * If the kbd layout isn't specified (in the HIWORD), ignore it and look 00075 * for a Locale match only. (Mohamed Hamid's fix for Word bug) 00076 */ 00077 if (HandleToUlong(hkl) & 0xffff0000) { 00078 do { 00079 if (pkl->hkl == hkl) { 00080 return pkl; 00081 } 00082 pkl = pkl->pklNext; 00083 } while (pkl != pklActive); 00084 } else { 00085 do { 00086 if (LOWORD(HandleToUlong(pkl->hkl)) == LOWORD(HandleToUlong(hkl))) { 00087 return pkl; 00088 } 00089 pkl = pkl->pklNext; 00090 } while (pkl != pklActive); 00091 } 00092 00093 return NULL; 00094 }

PVOID HMAllocObject PTHREADINFO  pti,
PDESKTOP  pdesk,
BYTE  btype,
DWORD  size
 

Definition at line 828 of file handtabl.c.

References tagSHAREDINFO::aheList, _HANDLEENTRY::bFlags, tagHANDLETYPEINFO::bObjectCreateFlags, BOOL, _HANDLEENTRY::bType, BYTE, tagSERVERINFO::cHandleEntries, CheckCritIn, DBGHMValidateFreeLists, DBGValidateHandleQuota, DesktopAlloc(), DTAG_HANDTABL, DWORD, ExQueryPoolBlockSize(), gahti, gcHandlePages, giheLast, gpHandlePages, gpsi, gpvSharedAlloc, gSharedInfo, gUserProcessHandleQuota, _HEAD::h, HMGrowHandleTable(), HMHandleFromIndex, HMINDEXBITS, HMIndexFromHandle, tagTDB::hTaskWow, _HANDLEPAGE::iheFreeEven, _HANDLEPAGE::iheFreeOdd, tagPERFINFO::lCount, tagPERFINFO::lMaxCount, LockDesktop, tagPERFINFO::lSize, tagPERFINFO::lTotalCount, NULL, OCF_DESKTOPHEAP, OCF_MARKPROCESS, OCF_PROCESSOWNED, OCF_SHAREDHEAP, OCF_THREADOWNED, OCF_USEPOOLIFNODESKTOP, OCF_USEPOOLQUOTA, OCF_VARIABLESIZE, PBYTE, _HANDLEENTRY::phead, tagDESKTOP::pheapDesktop, _HANDLEENTRY::pOwner, tagTHREADINFO::ppi, PPROCMARKHEAD, tagTHREADINFO::ptdb, RtlSizeHeap(), SharedAlloc(), TIF_16BIT, tagTHREADINFO::TIF_flags, and TYPE_WINDOW.

Referenced by _BeginDeferWindowPos(), _ConvertMemHandle(), _CreateAcceleratorTable(), _CreateEmptyCursorObject(), _SetWinEventHook(), CreateInputContext(), CreateMonitor(), Createpxs(), GetCPD(), InternalCreateMenu(), InternalSetTimer(), LoadKeyboardLayoutFile(), NewConversation(), xxxCreateWindowEx(), xxxCsDdeInitialize(), xxxLoadKeyboardLayoutEx(), and zzzSetWindowsHookEx().

00833 { 00834 DWORD i; 00835 PHEAD phead; 00836 PHE pheT; 00837 ULONG_PTR iheFree, *piheFreeHead; 00838 PHANDLEPAGE php; 00839 BYTE bCreateFlags; 00840 PPROCESSINFO ppiQuotaCharge = NULL; 00841 BOOL fUsePoolIfNoDesktop; 00842 BOOL fEven; 00843 00844 CheckCritIn(); 00845 bCreateFlags = gahti[bType].bObjectCreateFlags; 00846 00847 #if DBG 00848 /* 00849 * Validate size 00850 */ 00851 if (bCreateFlags & OCF_VARIABLESIZE) { 00852 UserAssert(gahti[bType].uSize <= size); 00853 } else { 00854 UserAssert(gahti[bType].uSize == size); 00855 } 00856 #endif 00857 00858 /* 00859 * Check for process handle quota 00860 */ 00861 if (bCreateFlags & (OCF_PROCESSOWNED | OCF_THREADOWNED)) { 00862 UserAssert(ptiOwner != NULL); 00863 ppiQuotaCharge = ptiOwner->ppi; 00864 if (ppiQuotaCharge->UserHandleCount >= gUserProcessHandleQuota) { 00865 RIPERR0(ERROR_NO_MORE_USER_HANDLES, 00866 RIP_WARNING, 00867 "USER: HMAllocObject: out of handle quota\n"); 00868 return NULL; 00869 } 00870 } 00871 00872 /* 00873 * Find the next free handle 00874 * Window handles must be even; hence we try first to use odd handles 00875 * for all other objects. 00876 * Old comment: 00877 * Some wow apps, like WinProj, require even Window handles so we'll 00878 * accomodate them; build a list of the odd handles so they won't get lost 00879 * 10/13/97: WinProj never fixed this; even the 32 bit version has the problem. 00880 */ 00881 fEven = (bType == TYPE_WINDOW); 00882 piheFreeHead = NULL; 00883 do { 00884 php = gpHandlePages; 00885 for (i = 0; i < gcHandlePages; ++i, ++php) { 00886 if (fEven) { 00887 if (php->iheFreeEven != 0) { 00888 piheFreeHead = &php->iheFreeEven; 00889 break; 00890 } 00891 } else { 00892 if (php->iheFreeOdd != 0) { 00893 piheFreeHead = &php->iheFreeOdd; 00894 break; 00895 } 00896 } 00897 } /* for */ 00898 /* 00899 * If we couldn't find an odd handle, then search for an even one 00900 */ 00901 fEven = ((piheFreeHead == NULL) && !fEven); 00902 } while (fEven); 00903 /* 00904 * If there are no free handles we can use, grow the table 00905 */ 00906 if (piheFreeHead == NULL) { 00907 HMGrowHandleTable(); 00908 /* 00909 * If the table didn't grow, get out. 00910 */ 00911 if (i == gcHandlePages) { 00912 RIPMSG0(RIP_WARNING, "HMAllocObject: could not grow handle space"); 00913 return NULL; 00914 } 00915 /* 00916 * Because the handle page table may have moved, 00917 * recalc the page entry pointer. 00918 */ 00919 php = &gpHandlePages[i]; 00920 piheFreeHead = (bType == TYPE_WINDOW ? &php->iheFreeEven : &php->iheFreeOdd); 00921 if (*piheFreeHead == 0) { 00922 UserAssert(gpsi->cHandleEntries == (HMINDEXBITS + 1)); 00923 RIPMSG0(RIP_WARNING, "HMAllocObject: handle table is full"); 00924 return NULL; 00925 } 00926 } 00927 /* 00928 * HMINDEXBITS is a reserved value that should never be in the free lists 00929 * (see HMGrowHandleTable()); 00930 */ 00931 UserAssert(HMIndexFromHandle(*piheFreeHead) != HMINDEXBITS); 00932 /* 00933 * Try to allocate the object. If this fails, bail out. 00934 */ 00935 if ((bCreateFlags & OCF_DESKTOPHEAP) && pdeskSrc) { 00936 phead = (PHEAD)DesktopAlloc(pdeskSrc, size, DTAG_HANDTABL); 00937 if (phead) { 00938 LockDesktop(&((PDESKOBJHEAD)phead)->rpdesk, pdeskSrc, LDL_OBJ_DESK, (ULONG_PTR)phead); 00939 ((PDESKOBJHEAD)phead)->pSelf = (PBYTE)phead; 00940 } 00941 } else if (bCreateFlags & OCF_SHAREDHEAP) { 00942 UserAssert(!pdeskSrc); 00943 phead = (PHEAD)SharedAlloc(size); 00944 } else { 00945 fUsePoolIfNoDesktop = !pdeskSrc && (bCreateFlags & OCF_USEPOOLIFNODESKTOP); 00946 UserAssert(!(bCreateFlags & OCF_DESKTOPHEAP) || fUsePoolIfNoDesktop); 00947 00948 if ((bCreateFlags & OCF_USEPOOLQUOTA) && !fUsePoolIfNoDesktop) { 00949 phead = (PHEAD)UserAllocPoolWithQuotaZInit(size, gahti[bType].dwAllocTag); 00950 } else { 00951 phead = (PHEAD)UserAllocPoolZInit(size, gahti[bType].dwAllocTag); 00952 } 00953 } 00954 00955 if (phead == NULL) { 00956 RIPERR0(ERROR_NOT_ENOUGH_MEMORY, 00957 RIP_WARNING, 00958 "USER: HMAllocObject: out of memory"); 00959 return NULL; 00960 } 00961 /* 00962 * We're going to use this handle so get it off its free list. 00963 * The free handle phead points to the next free handle. 00964 */ 00965 iheFree = *piheFreeHead; 00966 pheT = &gSharedInfo.aheList[iheFree]; 00967 *piheFreeHead = (ULONG_PTR)pheT->phead; 00968 DBGHMValidateFreeLists(); 00969 /* 00970 * Track high water mark for handle allocation. 00971 */ 00972 if ((DWORD)iheFree > giheLast) { 00973 giheLast = (DWORD)iheFree; 00974 } 00975 /* 00976 * Setup the handle contents, plus initialize the object header. 00977 */ 00978 pheT->bType = bType; 00979 pheT->phead = phead; 00980 UserAssert(pheT->bFlags == 0); 00981 if (bCreateFlags & OCF_PROCESSOWNED) { 00982 if ((ptiOwner->TIF_flags & TIF_16BIT) && (ptiOwner->ptdb)) { 00983 ((PPROCOBJHEAD)phead)->hTaskWow = ptiOwner->ptdb->hTaskWow; 00984 } else { 00985 ((PPROCOBJHEAD)phead)->hTaskWow = 0; 00986 } 00987 pheT->pOwner = ptiOwner->ppi; 00988 if (bCreateFlags & OCF_MARKPROCESS) { 00989 ((PPROCMARKHEAD)phead)->ppi = ptiOwner->ppi; 00990 } 00991 } else if (bCreateFlags & OCF_THREADOWNED) { 00992 ((PTHROBJHEAD)phead)->pti = pheT->pOwner = ptiOwner; 00993 } else { 00994 /* 00995 * The caller is wasting time if ptiOwner != NULL 00996 * The handle entry must already have pOwner == NULL. 00997 */ 00998 UserAssert(ptiOwner == NULL); 00999 UserAssert(pheT->pOwner == NULL); 01000 } 01001 01002 phead->h = HMHandleFromIndex(iheFree); 01003 01004 if (ppiQuotaCharge) { 01005 ppiQuotaCharge->UserHandleCount++; 01006 DBGValidateHandleQuota(); 01007 } 01008 01009 #if DBG 01010 /* 01011 * performance counter dumphmgr 01012 * dwPrevCount is used for the snapshot option 01013 */ 01014 01015 gaPerfhti[bType].lTotalCount++; 01016 gaPerfhti[bType].lCount++; 01017 if (gaPerfhti[bType].lCount > gaPerfhti[bType].lMaxCount) { 01018 gaPerfhti[bType].lMaxCount = gaPerfhti[bType].lCount; 01019 } 01020 if ((bCreateFlags & OCF_DESKTOPHEAP) && (pdeskSrc != NULL)) { 01021 gaPerfhti[bType].lSize += RtlSizeHeap(Win32HeapGetHandle(pdeskSrc->pheapDesktop), 0, phead); 01022 } else if (bCreateFlags & OCF_SHAREDHEAP) { 01023 gaPerfhti[bType].lSize += RtlSizeHeap(Win32HeapGetHandle(gpvSharedAlloc), 0, phead); 01024 } else { 01025 unsigned char notUsed; 01026 gaPerfhti[bType].lSize += ExQueryPoolBlockSize(phead, &notUsed); 01027 } 01028 01029 #endif // DBG 01030 01031 /* 01032 * Return a handle entry pointer. 01033 */ 01034 return pheT->phead; 01035 }

PVOID FASTCALL HMAssignmentLock PVOID *  ppobj,
PVOID  pobj
 

Definition at line 1509 of file handtabl.c.

References FASTCALL, HMIsMarkDestroy, HMLockObject, HMRecordLock(), HMUnlockObject, HMUnrecordLock(), HMValidateCatHandleNoSecure(), NULL, PHEAD, and TYPE_GENERIC.

01512 { 01513 PVOID pobjOld; 01514 01515 pobjOld = *ppobj; 01516 *ppobj = pobj; 01517 01518 /* 01519 * Unlocks the old, locks the new. 01520 */ 01521 if (pobjOld != NULL) { 01522 01523 /* 01524 * if we are locking in the same object that is there then 01525 * it is a no-op but we don't want to do the Unlock and the Lock 01526 * because the unlock could free object and the lock would lock 01527 * in a freed pointer; 6410. 01528 */ 01529 if (pobjOld == pobj) { 01530 return pobjOld; 01531 } 01532 01533 #if DEBUGTAGS 01534 01535 /* 01536 * Track assignment locks. 01537 */ 01538 if (IsDbgTagEnabled(DBGTAG_TrackLocks)) { 01539 if (!HMUnrecordLock(ppobj, pobjOld)) { 01540 HMRecordLock(ppobj, pobjOld, ((PHEAD)pobjOld)->cLockObj - 1); 01541 } 01542 } 01543 #endif 01544 01545 } 01546 01547 01548 if (pobj != NULL) { 01549 UserAssert(pobj == HMValidateCatHandleNoSecure(((PHEAD)pobj)->h, TYPE_GENERIC)); 01550 if (HMIsMarkDestroy(pobj)) { 01551 RIPERR2(ERROR_INVALID_PARAMETER, 01552 RIP_WARNING, 01553 "HMAssignmentLock, locking object %#p marked for destruction at %#p\n", 01554 pobj, ppobj); 01555 } 01556 #if DEBUGTAGS 01557 01558 /* 01559 * Track assignment locks. 01560 */ 01561 if (IsDbgTagEnabled(DBGTAG_TrackLocks)) { 01562 HMRecordLock(ppobj, pobj, ((PHEAD)pobj)->cLockObj + 1); 01563 if (HMIsMarkDestroy(pobj)) { 01564 01565 RIPMSG2(RIP_WARNING, 01566 "Locking object %#p marked for destruction at %#p", 01567 pobj, ppobj); 01568 } 01569 } 01570 #endif 01571 HMLockObject(pobj); 01572 } 01573 01574 /* 01575 * This unlock has been moved from up above, so that we implement a 01576 * "lock before unlock" strategy. Just in case pobjOld was the 01577 * only object referencing pobj, pobj won't go away when we unlock 01578 * pobjNew -- it will have been locked above. 01579 */ 01580 01581 if (pobjOld) { 01582 pobjOld = HMUnlockObject(pobjOld); 01583 } 01584 01585 return pobjOld; 01586 }

PVOID FASTCALL HMAssignmentUnlock PVOID *  ppobj  ) 
 

Definition at line 1599 of file handtabl.c.

References FASTCALL, HMRecordLock(), HMUnlockObject, HMUnrecordLock(), and NULL.

01601 { 01602 PVOID pobjOld; 01603 01604 pobjOld = *ppobj; 01605 *ppobj = NULL; 01606 01607 /* 01608 * Unlocks the old, locks the new. 01609 */ 01610 if (pobjOld != NULL) { 01611 01612 #if DEBUGTAGS 01613 01614 /* 01615 * Track assignment locks. 01616 */ 01617 if (IsDbgTagEnabled(DBGTAG_TrackLocks)) { 01618 if (!HMUnrecordLock(ppobj, pobjOld)) { 01619 HMRecordLock(ppobj, pobjOld, ((PHEAD)pobjOld)->cLockObj - 1); 01620 } 01621 } 01622 #endif 01623 pobjOld = HMUnlockObject(pobjOld); 01624 } 01625 01626 return pobjOld; 01627 }

VOID HMChangeOwnerPheProcess PHE  phe,
PTHREADINFO  pti
 

Definition at line 2220 of file handtabl.c.

References tagHANDLETYPEINFO::bObjectCreateFlags, _HANDLEENTRY::bType, DBGValidateHandleQuota, gahti, HMObjectFlags, tagTDB::hTaskWow, NULL, OCF_MARKPROCESS, OCF_PROCESSOWNED, _HANDLEENTRY::phead, _HANDLEENTRY::pOwner, tagTHREADINFO::ppi, tagTHREADINFO::ptdb, TIF_16BIT, tagTHREADINFO::TIF_flags, TYPE_CURSOR, and VOID().

Referenced by DestroyProcessesObjects().

02223 { 02224 PPROCESSINFO ppiOwner = (PPROCESSINFO)(phe->pOwner); 02225 PVOID pobj = phe->phead; 02226 02227 UserAssert(HMObjectFlags(pobj) & OCF_PROCESSOWNED); 02228 UserAssert(pti != NULL); 02229 /* 02230 * Dec current owner handle count 02231 */ 02232 ppiOwner->UserHandleCount--; 02233 /* 02234 * hTaskWow 02235 */ 02236 if ((pti->TIF_flags & TIF_16BIT) && (pti->ptdb)) { 02237 ((PPROCOBJHEAD)pobj)->hTaskWow = pti->ptdb->hTaskWow; 02238 } else { 02239 ((PPROCOBJHEAD)pobj)->hTaskWow = 0; 02240 } 02241 /* 02242 * ppi 02243 */ 02244 if (gahti[phe->bType].bObjectCreateFlags & OCF_MARKPROCESS) { 02245 ((PPROCMARKHEAD)pobj)->ppi = pti->ppi; 02246 } 02247 /* 02248 * Set new owner in handle entry 02249 */ 02250 phe->pOwner = pti->ppi; 02251 /* 02252 * Inc new owner handle count 02253 */ 02254 ((PPROCESSINFO)(phe->pOwner))->UserHandleCount++; 02255 /* 02256 * If the handle is a cursor, adjust GDI cursor handle count 02257 */ 02258 if (phe->bType == TYPE_CURSOR) { 02259 GreDecQuotaCount((PW32PROCESS)ppiOwner); 02260 GreIncQuotaCount((PW32PROCESS)phe->pOwner); 02261 02262 if (((PCURSOR)pobj)->hbmColor) { 02263 GreDecQuotaCount((PW32PROCESS)ppiOwner); 02264 GreIncQuotaCount((PW32PROCESS)phe->pOwner); 02265 } 02266 } 02267 02268 DBGValidateHandleQuota(); 02269 }

VOID HMChangeOwnerThread PVOID  pobj,
PTHREADINFO  pti
 

Definition at line 2112 of file handtabl.c.

References tagCLS::atomClassName, tagSERVERINFO::atomSysClass, _HANDLEENTRY::bType, tagTHREADINFO::cVisWindows, tagTHREADINFO::cWindows, tagCLS::cWndReferenceCount, DBGValidateHandleQuota, DereferenceClass(), FVisCountable(), GetClassPtr(), gpsi, gptiRit, tagWND::head, HF_GLOBAL, HMObjectFlags, hModuleWin, HMPheFromObject, ICLS_ICONTITLE, LockDesktop, NULL, OCF_THREADOWNED, tagWND::pcls, PHOOK, _HANDLEENTRY::pOwner, tagTHREADINFO::ppi, PpiCurrent, tagTHREADINFO::rpdesk, TestWF, TYPE_HOOK, TYPE_WINDOW, VOID(), WFDESTROYED, and WFVISIBLE.

Referenced by MarkThreadsObjects(), xxxCreateDesktop(), xxxCreateWindowStation(), xxxDestroyWindow(), xxxFreeWindow(), and xxxMNOpenHierarchy().

02115 { 02116 PHE phe = HMPheFromObject(pobj); 02117 PTHREADINFO ptiOld = ((PTHROBJHEAD)(pobj))->pti; 02118 PWND pwnd; 02119 PPCLS ppcls; 02120 PPROCESSINFO ppi; 02121 02122 UserAssert(HMObjectFlags(pobj) & OCF_THREADOWNED); 02123 UserAssert(pti != NULL); 02124 02125 ((PTHREADINFO)phe->pOwner)->ppi->UserHandleCount--; 02126 02127 ((PTHROBJHEAD)pobj)->pti = phe->pOwner = pti; 02128 02129 ((PTHREADINFO)phe->pOwner)->ppi->UserHandleCount++; 02130 02131 DBGValidateHandleQuota(); 02132 02133 /* 02134 * If this is a window, update the window counts. 02135 */ 02136 switch (phe->bType) { 02137 case TYPE_WINDOW: 02138 /* 02139 * Desktop thread used to hit this assert in HYDRA 02140 * because pti == ptiOld 02141 */ 02142 UserAssert(ptiOld->cWindows > 0 || ptiOld == pti); 02143 pti->cWindows++; 02144 ptiOld->cWindows--; 02145 02146 pwnd = (PWND)pobj; 02147 02148 /* 02149 * Make sure thread visible window count is properly updated. 02150 */ 02151 if (TestWF(pwnd, WFVISIBLE) && FVisCountable(pwnd)) { 02152 pti->cVisWindows++; 02153 ptiOld->cVisWindows--; 02154 } 02155 02156 /* 02157 * If the owning process is changing, fix up 02158 * the window class. 02159 */ 02160 if (pti->ppi != ptiOld->ppi) { 02161 02162 ppcls = GetClassPtr(pwnd->pcls->atomClassName, pti->ppi, hModuleWin); 02163 02164 if (ppcls == NULL) { 02165 if (pwnd->head.rpdesk) 02166 ppi = pwnd->head.rpdesk->rpwinstaParent->pTerm->ptiDesktop->ppi; 02167 else 02168 ppi = PpiCurrent(); 02169 ppcls = GetClassPtr(gpsi->atomSysClass[ICLS_ICONTITLE], ppi, hModuleWin); 02170 } 02171 UserAssert(ppcls); 02172 02173 /* 02174 * The window is either destroyed or the desktop of the class is 02175 * the same as the window's desktop 02176 */ 02177 UserAssert((*ppcls)->rpdeskParent == pwnd->head.rpdesk || 02178 TestWF(pwnd, WFDESTROYED)); 02179 02180 DereferenceClass(pwnd); 02181 pwnd->pcls = *ppcls; 02182 pwnd->pcls->cWndReferenceCount++; 02183 } 02184 break; 02185 02186 case TYPE_HOOK: 02187 /* 02188 * If this is a global hook, remember this hook's desktop so we'll be 02189 * able to unlink it later (gptiRit might switch to a different desktop 02190 * at any time). 02191 */ 02192 UserAssert(!!(((PHOOK)pobj)->flags & HF_GLOBAL) ^ (((PHOOK)pobj)->ptiHooked != NULL)); 02193 if (((PHOOK)pobj)->flags & HF_GLOBAL) { 02194 UserAssert(pti == gptiRit); 02195 LockDesktop(&((PHOOK)pobj)->rpdesk, ptiOld->rpdesk, LDL_HOOK_DESK, 0); 02196 } else { 02197 /* 02198 * This must be a hook on another thread or it was supposed to be 02199 * gone by now. 02200 */ 02201 UserAssert(((PHOOK)pobj)->ptiHooked != ptiOld); 02202 } 02203 break; 02204 02205 default: 02206 break; 02207 } 02208 }

void HMCleanupGrantedHandle HANDLE  h  ) 
 

Definition at line 2853 of file handtabl.c.

References DWORD, gpJobsList, NULL, tagW32JOB::pgh, tagW32JOB::pNext, and tagW32JOB::ughCrt.

Referenced by HMFreeObject().

02855 { 02856 PW32JOB pW32Job; 02857 02858 pW32Job = gpJobsList; 02859 02860 while (pW32Job != NULL) { 02861 PULONG_PTR pgh; 02862 DWORD dw; 02863 02864 pgh = pW32Job->pgh; 02865 02866 /* 02867 * search for the handle in the array. 02868 */ 02869 for (dw = 0; dw < pW32Job->ughCrt; dw++) { 02870 if (*(pgh + dw) == (ULONG_PTR)h) { 02871 02872 /* 02873 * found the handle granted to this process 02874 */ 02875 RtlMoveMemory(pgh + dw, 02876 pgh + dw + 1, 02877 (pW32Job->ughCrt - dw - 1) * sizeof(*pgh)); 02878 02879 (pW32Job->ughCrt)--; 02880 02881 /* 02882 * we should shrink the array also 02883 */ 02884 02885 break; 02886 } 02887 } 02888 02889 pW32Job = pW32Job->pNext; 02890 } 02891 }

BOOL HMDestroyObject PVOID  pobj  ) 
 

Definition at line 1299 of file handtabl.c.

References BOOL, FALSE, HMFreeObject(), HMMarkObjectDestroy(), and TRUE.

Referenced by HMNullFnDestroy().

01301 { 01302 /* 01303 * First mark the object for destruction. This tells the locking code 01304 * that we want to destroy this object when the lock count goes to 0. 01305 * If this returns FALSE, we can't destroy the object yet (and can't get 01306 * rid of security yet either.) 01307 */ 01308 01309 if (!HMMarkObjectDestroy(pobj)) 01310 return FALSE; 01311 01312 /* 01313 * Ok to destroy... Free the handle (which will free the object 01314 * and the handle). 01315 */ 01316 HMFreeObject(pobj); 01317 return TRUE; 01318 }

void HMDestroyUnlockedObject PHE  phe  ) 
 

Referenced by _WOWCleanup(), DestroyHandleTableObjects(), DestroyInputContext(), DestroyProcessesObjects(), DestroyThreadsObjects(), and HMUnlockObjectInternal().

BOOL HMFreeObject PVOID  pobj  ) 
 

Definition at line 1069 of file handtabl.c.

References tagSHAREDINFO::aheList, _HANDLEENTRY::bFlags, tagHANDLETYPEINFO::bObjectCreateFlags, BOOL, _HANDLEENTRY::bType, BYTE, DBGHMValidateFreeLists, DBGValidateHandleQuota, DesktopFree, DWORD, ExQueryPoolBlockSize(), gahti, gcHandlePages, gpHandlePages, gpvSharedAlloc, gSharedInfo, _HEAD::h, HANDLEF_GRANTED, HANDLEF_POOL, HMCleanupGrantedHandle(), HMPheFromObject, HMUNIQBITS, HtoPqCat, _HANDLEPAGE::iheFreeEven, _HANDLEPAGE::iheFreeOdd, _HANDLEPAGE::iheLimit, tagPERFINFO::lCount, tagPERFINFO::lSize, NULL, OCF_DESKTOPHEAP, OCF_PROCESSOWNED, OCF_SHAREDHEAP, OCF_THREADOWNED, _HANDLEENTRY::phead, tagDESKTOP::pheapDesktop, _LOCKRECORD::plrNext, _HANDLEENTRY::pOwner, PtoHq, RtlSizeHeap(), SharedFree(), TRUE, TYPE_FREE, UnlockDesktop, and _HANDLEENTRY::wUniq.

Referenced by _BeginDeferWindowPos(), _ConvertMemHandle(), _CreateAcceleratorTable(), _DestroyMenu(), DestroyEmptyCursorObject(), DestroyEventHook(), DestroyKF(), DestroyKL(), DestroyMonitor(), DestroySMWP(), FreeDdeConv(), FreeDdeXact(), FreeHook(), FreeInputContext(), FreeTimer(), HMDestroyObject(), InternalSetTimer(), LoadKeyboardLayoutFile(), MungeClipData(), NewConversation(), NtUserDestroyAcceleratorTable(), UT_FreeCBFormat(), xxxCreateWindowEx(), xxxCsDdeInitialize(), xxxDestroyThreadDDEObject(), xxxFreeWindow(), xxxGetDummyDib(), xxxGetDummyDibV5(), and zzzSetWindowsHookEx().

01071 { 01072 PHE pheT; 01073 WORD wUniqT; 01074 PHANDLEPAGE php; 01075 DWORD i; 01076 ULONG_PTR iheCurrent, *piheCurrentHead; 01077 BYTE bCreateFlags; 01078 PDESKTOP pdesk; 01079 PPROCESSINFO ppiQuotaCharge = NULL; 01080 #if DBG 01081 PLR plrT, plrNextT; 01082 unsigned char notUsed; 01083 #endif 01084 01085 UserAssert(((PHEAD)pobj)->cLockObj == 0); 01086 UserAssert(pobj == HtoPqCat(PtoHq(pobj))); 01087 /* 01088 * Free the object first. 01089 */ 01090 pheT = HMPheFromObject(pobj); 01091 bCreateFlags = gahti[pheT->bType].bObjectCreateFlags; 01092 01093 UserAssertMsg1(pheT->bType != TYPE_FREE, 01094 "Object already marked as freed!!! %#p", pobj); 01095 01096 /* 01097 * decr process handle use 01098 */ 01099 if (bCreateFlags & OCF_PROCESSOWNED) { 01100 ppiQuotaCharge = (PPROCESSINFO)pheT->pOwner; 01101 UserAssert(ppiQuotaCharge != NULL); 01102 } else if (bCreateFlags & OCF_THREADOWNED) { 01103 ppiQuotaCharge = (PPROCESSINFO)(((PTHREADINFO)(pheT->pOwner))->ppi); 01104 UserAssert(ppiQuotaCharge != NULL); 01105 } else { 01106 ppiQuotaCharge = NULL; 01107 } 01108 01109 if (ppiQuotaCharge != NULL) { 01110 ppiQuotaCharge->UserHandleCount--; 01111 } 01112 01113 if (pheT->bFlags & HANDLEF_GRANTED) { 01114 HMCleanupGrantedHandle(pheT->phead->h); 01115 pheT->bFlags &= ~HANDLEF_GRANTED; 01116 } 01117 01118 #if DBG 01119 /* 01120 * performance counters 01121 */ 01122 gaPerfhti[pheT->bType].lCount--; 01123 01124 if ((bCreateFlags & OCF_DESKTOPHEAP) && ((PDESKOBJHEAD)pobj)->rpdesk) { 01125 pdesk = ((PDESKOBJHEAD)pobj)->rpdesk; 01126 gaPerfhti[pheT->bType].lSize -= RtlSizeHeap(Win32HeapGetHandle(pdesk->pheapDesktop), 0, pobj); 01127 } else if (bCreateFlags & OCF_SHAREDHEAP) { 01128 gaPerfhti[pheT->bType].lSize -= RtlSizeHeap(Win32HeapGetHandle(gpvSharedAlloc), 0, pobj); 01129 } else { 01130 gaPerfhti[pheT->bType].lSize -= ExQueryPoolBlockSize(pobj, &notUsed); 01131 } 01132 01133 #endif // DBG 01134 01135 if ((bCreateFlags & OCF_DESKTOPHEAP)) { 01136 #if DBG 01137 BOOL bSuccess; 01138 #endif 01139 UserAssert(((PDESKOBJHEAD)pobj)->rpdesk != NULL); 01140 01141 pdesk = ((PDESKOBJHEAD)pobj)->rpdesk; 01142 UnlockDesktop(&((PDESKOBJHEAD)pobj)->rpdesk, LDU_OBJ_DESK, (ULONG_PTR)pobj); 01143 01144 if (pheT->bFlags & HANDLEF_POOL) { 01145 UserFreePool(pobj); 01146 } else { 01147 01148 #if DBG 01149 bSuccess = 01150 #endif 01151 DesktopFree(pdesk, pobj); 01152 #if DBG 01153 if (!bSuccess) { 01154 /* 01155 * We would hit this assert in HYDRA trying to free the 01156 * mother desktop window which was allocated out of pool 01157 */ 01158 RIPMSG1(RIP_ERROR, "Object already freed from desktop heap! %#p", pobj); 01159 } 01160 #endif 01161 } 01162 01163 } else if (bCreateFlags & OCF_SHAREDHEAP) { 01164 SharedFree(pobj); 01165 } else { 01166 UserFreePool(pobj); 01167 } 01168 01169 #if DBG 01170 /* 01171 * Go through and delete the lock records, if they exist. 01172 */ 01173 for (plrT = pheT->plr; plrT != NULL; plrT = plrNextT) { 01174 01175 /* 01176 * Remember the next one before freeing this one. 01177 */ 01178 plrNextT = plrT->plrNext; 01179 FreeLockRecord((HANDLE)plrT); 01180 } 01181 #endif 01182 01183 /* 01184 * Clear the handle contents. Need to remember the uniqueness across 01185 * the clear. Also, advance uniqueness on free so that uniqueness checking 01186 * against old handles also fails. 01187 */ 01188 wUniqT = (WORD)((pheT->wUniq + 1) & HMUNIQBITS); 01189 RtlZeroMemory(pheT, sizeof(HANDLEENTRY)); 01190 pheT->wUniq = wUniqT; 01191 01192 /* 01193 * Change the handle type to TYPE_FREE so we know what type this handle 01194 * is. (TYPE_FREE is defined as zero) 01195 */ 01196 /* pheT->bType = TYPE_FREE; */ 01197 UserAssert(pheT->bType == TYPE_FREE); 01198 01199 /* 01200 * Put the handle on the free list of the appropriate page. 01201 */ 01202 php = gpHandlePages; 01203 iheCurrent = pheT - gSharedInfo.aheList; 01204 for (i = 0; i < gcHandlePages; ++i, ++php) { 01205 if (iheCurrent < php->iheLimit) { 01206 piheCurrentHead = (iheCurrent & 0x1 ? &php->iheFreeOdd : &php->iheFreeEven); 01207 pheT->phead = (PHEAD)*piheCurrentHead; 01208 *piheCurrentHead = iheCurrent; 01209 DBGHMValidateFreeLists(); 01210 break; 01211 } 01212 } 01213 /* 01214 * We must have found it. 01215 */ 01216 UserAssert(i < gcHandlePages); 01217 01218 UserAssert(pheT->pOwner == NULL); 01219 01220 DBGValidateHandleQuota(); 01221 01222 return TRUE; 01223 }

NTSTATUS HMGetStats HANDLE  hProcess,
int  iPidType,
PVOID  pResults,
UINT  cjResultSize
 

BOOL HMInitHandleTable PVOID  pBase  ) 
 

Definition at line 575 of file handtabl.c.

References tagSHAREDINFO::aheList, tagHANDLETYPEINFO::bObjectCreateFlags, BOOL, _HANDLEENTRY::bType, BYTE, tagSERVERINFO::cbHandleTable, tagSERVERINFO::cHandleEntries, CommitReadOnlyMemory(), CPAGEENTRIESINIT, DESKOBJHEAD, FALSE, gahti, gcHandlePages, ghSectionShared, gpHandlePages, gpsi, gSharedInfo, HANDLEPAGE, HMINDEXBITS, HMInitHandleEntries(), _HANDLEPAGE::iheFreeEven, _HANDLEPAGE::iheFreeOdd, _HANDLEPAGE::iheLimit, NT_SUCCESS, NTSTATUS(), NULL, OCF_DESKTOPHEAP, OCF_MARKPROCESS, OCF_PROCESSOWNED, OCF_SHAREDHEAP, OCF_THREADOWNED, OCF_USEPOOLIFNODESKTOP, OCF_USEPOOLQUOTA, PAGE_SIZE, _HANDLEENTRY::phead, PROCDESKHEAD, PROCOBJHEAD, Status, THRDESKHEAD, TRUE, TYPE_CTYPES, TYPE_FREE, UINT, and _HANDLEENTRY::wUniq.

Referenced by Win32UserInitialize().

00577 { 00578 NTSTATUS Status; 00579 SIZE_T ulCommit; 00580 00581 /* 00582 * Allocate the handle page array. Make it big enough 00583 * for 4 pages, which should be sufficient for nearly 00584 * all instances. 00585 */ 00586 gpHandlePages = UserAllocPool( 00587 CPAGEENTRIESINIT * sizeof(HANDLEPAGE), TAG_SYSTEM); 00588 00589 if (gpHandlePages == NULL) 00590 return FALSE; 00591 00592 #if DBG 00593 if (!NT_SUCCESS(InitLockRecordLookaside())) 00594 return FALSE; 00595 #endif 00596 00597 /* 00598 * Allocate the array. We have the space from 00599 * NtCurrentPeb()->ReadOnlySharedMemoryBase to 00600 * NtCurrentPeb()->ReadOnlySharedMemoryHeap reserved for 00601 * the handle table. All we need to do is commit the pages. 00602 * 00603 * Compute the minimum size of the table. The allocation will 00604 * round this up to the next page size. 00605 */ 00606 ulCommit = gpsi->cbHandleTable = PAGE_SIZE; 00607 Status = CommitReadOnlyMemory(ghSectionShared, &ulCommit, 0, NULL); 00608 00609 if (!NT_SUCCESS(Status)) 00610 return FALSE; 00611 00612 gSharedInfo.aheList = pReadOnlySharedSectionBase; 00613 gpsi->cHandleEntries = gpsi->cbHandleTable / sizeof(HANDLEENTRY); 00614 gcHandlePages = 1; 00615 00616 /* 00617 * Initialize the handlepage info. Handle 0 is reserved so even free list 00618 * starts at 2. 00619 */ 00620 gpHandlePages[0].iheFreeOdd = 1; 00621 gpHandlePages[0].iheFreeEven = 2; 00622 gpHandlePages[0].iheLimit = gpsi->cHandleEntries; 00623 /* 00624 * Initialize the handle entries. 00625 */ 00626 HMInitHandleEntries(0); 00627 /* 00628 * PW(NULL) (ie, handle 0) must map to a NULL pointer. 00629 * Old comment: 00630 * Reserve the first handle table entry so that PW(NULL) maps to a 00631 * NULL pointer. Set it to TYPE_FREE so the cleanup code doesn't think 00632 * it is allocated. Set wUniq to 1 so that RevalidateHandles on NULL 00633 * will fail. 00634 */ 00635 gSharedInfo.aheList[0].phead = NULL; 00636 UserAssert(gSharedInfo.aheList[0].bType == TYPE_FREE); 00637 UserAssert(gSharedInfo.aheList[0].wUniq == 1); 00638 00639 #if DBG 00640 /* 00641 * Make sure we don't need to add the special case to handle HMINDEXBITS in this function. 00642 */ 00643 UserAssert(gpsi->cHandleEntries <= HMINDEXBITS); 00644 /* 00645 * PDESKOBJHEAD won't do the right casting unless these structs have 00646 * the same size. 00647 */ 00648 UserAssert(sizeof(THROBJHEAD) == sizeof(PROCOBJHEAD)); 00649 UserAssert(sizeof(THRDESKHEAD) == sizeof(PROCDESKHEAD)); 00650 UserAssert(sizeof(THRDESKHEAD) == sizeof(DESKOBJHEAD)); 00651 /* 00652 * Validate type flags to make sure that assumptions made 00653 * throughout HM code are OK. 00654 */ 00655 { 00656 HANDLETYPEINFO * pahti = (HANDLETYPEINFO *) gahti; 00657 UINT uTypes = TYPE_CTYPES; 00658 BYTE bObjectCreateFlags; 00659 while (uTypes-- != 0) { 00660 bObjectCreateFlags = pahti->bObjectCreateFlags; 00661 /* 00662 * Illegal flag combinations 00663 */ 00664 UserAssert(!((bObjectCreateFlags & OCF_DESKTOPHEAP) && (bObjectCreateFlags & OCF_MARKPROCESS))); 00665 /* 00666 * Pointless (and probably illegal) flag combinations 00667 */ 00668 UserAssert(!((bObjectCreateFlags & OCF_DESKTOPHEAP) && (bObjectCreateFlags & OCF_SHAREDHEAP))); 00669 UserAssert(!((bObjectCreateFlags & OCF_USEPOOLQUOTA) && (bObjectCreateFlags & OCF_SHAREDHEAP))); 00670 UserAssert(!((bObjectCreateFlags & OCF_THREADOWNED) && (bObjectCreateFlags & OCF_PROCESSOWNED))); 00671 UserAssert(!(bObjectCreateFlags & OCF_USEPOOLQUOTA) 00672 || !(bObjectCreateFlags & OCF_DESKTOPHEAP) 00673 || (bObjectCreateFlags & OCF_USEPOOLIFNODESKTOP)); 00674 00675 /* 00676 * Required flag combinations 00677 */ 00678 UserAssert(!(bObjectCreateFlags & OCF_DESKTOPHEAP) 00679 || (bObjectCreateFlags & (OCF_PROCESSOWNED | OCF_THREADOWNED))); 00680 00681 UserAssert(!(bObjectCreateFlags & OCF_MARKPROCESS) 00682 || (bObjectCreateFlags & OCF_PROCESSOWNED)); 00683 00684 UserAssert(!(bObjectCreateFlags & OCF_USEPOOLIFNODESKTOP) 00685 || (bObjectCreateFlags & OCF_DESKTOPHEAP)); 00686 00687 00688 pahti++; 00689 } /* while (uTypes-- != 0) */ 00690 } 00691 #endif 00692 00693 return TRUE; 00694 }

BOOL HMMarkObjectDestroy PVOID  pobj  ) 
 

Definition at line 1237 of file handtabl.c.

References _HANDLEENTRY::bFlags, BOOL, FALSE, HANDLEF_DESTROY, HANDLEF_INDESTROY, HANDLEF_MARKED_OK, HMPheFromObject, HMRecordLock(), LOCKRECORD_MARKDESTROY, and TRUE.

Referenced by _DestroyCursor(), _DestroyMenu(), DestroyEventHook(), DestroyKF(), DestroyMonitor(), DestroySMWP(), FreeDdeConv(), FreeDdeXact(), FreeHook(), FreeInputContext(), FreeTimer(), FreeWindowStation(), HMDestroyObject(), NtUserDestroyAcceleratorTable(), UnlockAndFreeCPDs(), Win32kNtUserCleanup(), xxxDestroyThreadDDEObject(), xxxFreeWindow(), xxxInternalUnloadKeyboardLayout(), and xxxLoadKeyboardLayoutEx().

01239 { 01240 PHE phe; 01241 01242 phe = HMPheFromObject(pobj); 01243 01244 #if DEBUGTAGS 01245 /* 01246 * Record where the object was marked for destruction. 01247 */ 01248 if (IsDbgTagEnabled(DBGTAG_TrackLocks)) { 01249 if (!(phe->bFlags & HANDLEF_DESTROY)) { 01250 HMRecordLock(LOCKRECORD_MARKDESTROY, pobj, ((PHEAD)pobj)->cLockObj); 01251 } 01252 } 01253 #endif 01254 01255 /* 01256 * Set the destroy flag so our unlock code will know we're trying to 01257 * destroy this object. 01258 */ 01259 phe->bFlags |= HANDLEF_DESTROY; 01260 01261 /* 01262 * If this object can't be destroyed, then CLEAR the HANDLEF_INDESTROY 01263 * flag - because this object won't be currently "in destruction"! 01264 * (if we didn't clear it, when it was unlocked it wouldn't get destroyed). 01265 */ 01266 if (((PHEAD)pobj)->cLockObj != 0) { 01267 phe->bFlags &= ~HANDLEF_INDESTROY; 01268 01269 /* 01270 * Return FALSE because we can't destroy this object. 01271 */ 01272 return FALSE; 01273 } 01274 01275 #if DBG 01276 /* 01277 * Ensure that this function only returns TRUE once. 01278 */ 01279 UserAssert(!(phe->bFlags & HANDLEF_MARKED_OK)); 01280 phe->bFlags |= HANDLEF_MARKED_OK; 01281 #endif 01282 01283 /* 01284 * Return TRUE because Lock count is zero - ok to destroy this object. 01285 */ 01286 return TRUE; 01287 }

PVOID HMUnlockObjectInternal PVOID  pobj  ) 
 

Definition at line 1472 of file handtabl.c.

References _HANDLEENTRY::bFlags, HANDLEF_DESTROY, HANDLEF_INDESTROY, HMDestroyUnlockedObject(), HMPheFromObject, and NULL.

01474 { 01475 PHE phe; 01476 01477 /* 01478 * The object is not reference counted. If the object is not a zombie, 01479 * return success because the object is still around. 01480 */ 01481 phe = HMPheFromObject(pobj); 01482 if (!(phe->bFlags & HANDLEF_DESTROY)) 01483 return pobj; 01484 01485 /* 01486 * We're destroying the object based on an unlock... Make sure it isn't 01487 * currently being destroyed! (It is valid to have lock counts go from 01488 * 0 to != 0 to 0 during destruction... don't want recursion into 01489 * the destroy routine. 01490 */ 01491 if (phe->bFlags & HANDLEF_INDESTROY) 01492 return pobj; 01493 01494 HMDestroyUnlockedObject(phe); 01495 return NULL; 01496 }

VOID IdleTimerProc VOID   ) 
 

Definition at line 5120 of file ntuser/kernel/input.c.

References _PostMessage(), CheckCritIn, CMSHUNGAPPTIMEOUT, tagLASTINPUT::dwFlags, DWORD, FALSE, FHungApp(), GETPTI, giLowPowerTimeOutMs, giPowerOffTimeOutMs, giScreenSaveTimeOutMs, glinp, gppiScreenSaver, gpqForeground, IsTimeFromLastInput(), L, LINP_LOWPOWER, LINP_POWEROFF, LOWPOWER_PHASE, NULL, POWEROFF_PHASE, tagPROCESSINFO::ptiMainThread, SetForegroundPriorityProcess(), tagQ::spwndActive, StartScreenSaver(), TestAsyncKeyStateDown, TRUE, and VOID().

Referenced by xxxHungAppDemon().

05121 { 05122 05123 CheckCritIn(); 05124 05125 if ( (TestAsyncKeyStateDown(VK_LBUTTON)) || 05126 (TestAsyncKeyStateDown(VK_RBUTTON)) || 05127 (TestAsyncKeyStateDown(VK_MBUTTON)) || 05128 (TestAsyncKeyStateDown(VK_XBUTTON1)) || 05129 (TestAsyncKeyStateDown(VK_XBUTTON2))) { 05130 05131 return; 05132 } 05133 05134 05135 if (giScreenSaveTimeOutMs > 0) { 05136 05137 if (IsTimeFromLastInput((DWORD)(giScreenSaveTimeOutMs))) { 05138 05139 if (gppiScreenSaver != NULL) { 05140 05141 if (!(gppiScreenSaver->W32PF_Flags & W32PF_IDLESCREENSAVER)) { 05142 /* 05143 * Bump the priority of the screen saver down to idle. 05144 */ 05145 gppiScreenSaver->W32PF_Flags |= W32PF_IDLESCREENSAVER; 05146 SetForegroundPriorityProcess(gppiScreenSaver, gppiScreenSaver->ptiMainThread, TRUE); 05147 } 05148 } else { 05149 /* 05150 * Tell the system that it needs to bring up a screen saver. 05151 * 05152 * Carefull with the case when the active window is hung. If this 05153 * is the case the screen saver won't be started by winlogon because 05154 * DefWindowProc won't call StartScreenSaver(FALSE). 05155 */ 05156 if ((gpqForeground != NULL) && 05157 (gpqForeground->spwndActive != NULL) && 05158 !FHungApp(GETPTI(gpqForeground->spwndActive), CMSHUNGAPPTIMEOUT)) { 05159 05160 /* 05161 * Tell winlogon to start the screen saver if we have a secure 05162 * screen saver. In case we do have a secure one, the next PostMessage 05163 * will be ignored in winlogon. 05164 */ 05165 StartScreenSaver(TRUE); 05166 _PostMessage(gpqForeground->spwndActive, WM_SYSCOMMAND, SC_SCREENSAVE, 0L); 05167 } else { 05168 StartScreenSaver(FALSE); 05169 } 05170 } 05171 } 05172 } 05173 05174 if ((giLowPowerTimeOutMs > 0) && ((glinp.dwFlags & LINP_LOWPOWER) == 0)) { 05175 if (IsTimeFromLastInput((DWORD)(giLowPowerTimeOutMs))) { 05176 if ((gpqForeground != NULL) && (gpqForeground->spwndActive != NULL)) { 05177 _PostMessage(gpqForeground->spwndActive, WM_SYSCOMMAND, SC_MONITORPOWER, LOWPOWER_PHASE); 05178 } 05179 } 05180 } 05181 05182 if ((giPowerOffTimeOutMs > 0) && ((glinp.dwFlags & LINP_POWEROFF) == 0)) { 05183 if (IsTimeFromLastInput((DWORD)(giPowerOffTimeOutMs))) { 05184 if ((gpqForeground != NULL) && (gpqForeground->spwndActive != NULL)) { 05185 _PostMessage(gpqForeground->spwndActive, WM_SYSCOMMAND, SC_MONITORPOWER, POWEROFF_PHASE); 05186 } 05187 } 05188 } 05189 05190 }

BOOL ImeCanDestroyDefIME IN PWND  pwndDefaultIme,
IN PWND  pwndDestroy
 

Referenced by xxxDestroyWindow().

BOOL ImeCanDestroyDefIMEforChild IN PWND  pwndDefaultIme,
IN PWND  pwndDestroy
 

Referenced by xxxDestroyWindow().

VOID ImeCheckTopmost IN PWND  pwnd  ) 
 

Referenced by ImeCanDestroyDefIME(), and NtUserSetImeOwnerWindow().

VOID ImeSetFutureOwner IN PWND  pwndDefaultIme,
IN PWND  pwndOrgOwner
 

Referenced by ImeCanDestroyDefIME(), and NtUserSetImeOwnerWindow().

VOID ImeSetTopmost IN PWND  pwndRoot,
IN BOOL  fFlag,
IN PWND  pwndInsertBefore
 

Referenced by ImeCheckTopmost().

VOID ImeSetTopmostChild IN PWND  pwndRoot,
IN BOOL  fFlag
 

Referenced by ImeSetTopmost(), and ImeSetTopmostChild().

VOID IncPaintCount PWND  pwnd  ) 
 

Definition at line 1248 of file paint.c.

References tagTHREADINFO::cPaintsReady, GETPTI, SetWakeBit(), and VOID().

Referenced by InternalInvalidate3().

01250 { 01251 PTHREADINFO pti = GETPTI(pwnd); 01252 01253 if (pti->cPaintsReady++ == 0) 01254 SetWakeBit(pti, QS_PAINT); 01255 }

void IncrMBox void   ) 
 

__inline void IncSFWLockCount  ) 
 

Definition at line 7048 of file userk.h.

Referenced by xxxMNAllocMenuState().

07050 { 07051 TAGMSG0(DBGTAG_FOREGROUND, "GiveUpForeground Hack Succeeded!");

VOID IncVisWindows PWND  pwnd  ) 
 

Definition at line 5123 of file swp.c.

References FVisCountable(), GETPTI, ISTS, and VOID().

Referenced by SetMinimize(), SetVisible(), and xxxSetWindowStyle().

05125 { 05126 if (FVisCountable(pwnd)) 05127 GETPTI(pwnd)->cVisWindows++; 05128 05129 #if DBG 05130 if (!ISTS()) 05131 VerifycVisWindows(pwnd); 05132 #endif 05133 }

void InitAnsiOem PCHAR  pOemToAnsi,
PCHAR  pAnsiToOem
 

Definition at line 2743 of file w32/ntuser/kernel/init.c.

References tagSERVERINFO::acAnsiToOem, tagSERVERINFO::acOemToAnsi, BYTE, FALSE, gpsi, NCHARS, and ProbeForRead.

02743 { 02744 02745 UserAssert(gpsi); 02746 UserAssert(pOemToAnsi); 02747 UserAssert(pAnsiToOem); 02748 02749 try { 02750 ProbeForRead(pOemToAnsi, NCHARS, sizeof(BYTE)); 02751 ProbeForRead(pAnsiToOem, NCHARS, sizeof(BYTE)); 02752 02753 RtlCopyMemory(gpsi->acOemToAnsi, pOemToAnsi, NCHARS); 02754 RtlCopyMemory(gpsi->acAnsiToOem, pAnsiToOem, NCHARS); 02755 02756 02757 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 02758 } 02759 }

HRGN InitCreateRgn VOID   ) 
 

BOOL InitCreateUserCrit VOID   ) 
 

Definition at line 1322 of file kernel/server.c.

References BOOL, ERESOURCE, ExAllocatePoolWithTag, ExFreePool(), ExInitializeFastMutex, ExInitializeResourceLite(), FALSE, gpHandleFlagsMutex, gpresDeviceInfoList, gpresMouseEventQueue, gpresUser, NonPagedPoolMustSucceed, NT_SUCCESS, NULL, TRACE_INIT, and TRUE.

01323 { 01324 TRACE_INIT(("Win32UserInit: InitCreateUserCrit()\n")); 01325 01326 /* 01327 * Initialize a critical section structure that will be used to protect 01328 * all of the User Server's critical sections (except a few special 01329 * cases like the RIT -- see below). 01330 */ 01331 gpresUser = ExAllocatePoolWithTag(NonPagedPoolMustSucceed, 01332 sizeof(ERESOURCE), 01333 TAG_ERESOURCE); 01334 if (!gpresUser) { 01335 goto InitCreateUserCritExit; 01336 } 01337 if (!NT_SUCCESS(ExInitializeResourceLite(gpresUser))) { 01338 goto InitCreateUserCritExit; 01339 } 01340 01341 /* 01342 * Initialize a critical section to be used in [Un]QueueMouseEvent 01343 * to protect the queue of mouse input events that the desktop thread 01344 * uses to pass input on to the RIT, after having moved the cursor 01345 * without obtaining gpresUser itself. 01346 */ 01347 gpresMouseEventQueue = ExAllocatePoolWithTag(NonPagedPoolMustSucceed, 01348 sizeof(ERESOURCE), 01349 TAG_ERESOURCE); 01350 if (!gpresMouseEventQueue) { 01351 goto InitCreateUserCritExit; 01352 } 01353 if (!NT_SUCCESS(ExInitializeResourceLite(gpresMouseEventQueue))) { 01354 goto InitCreateUserCritExit; 01355 } 01356 01357 /* 01358 * Initialize a critical section to protect the list of DEVICEINFO structs 01359 * kept under gpDeviceInfoList. This is used by the RIT when reading kbd 01360 * input, the desktop thread when reading mouse input, and the PnP callback 01361 * routines DeviceClassNotify() and DeviceNotify() when devices come and go. 01362 */ 01363 gpresDeviceInfoList = ExAllocatePoolWithTag(NonPagedPoolMustSucceed, 01364 sizeof(ERESOURCE), 01365 TAG_ERESOURCE); 01366 if (!gpresDeviceInfoList) { 01367 goto InitCreateUserCritExit; 01368 } 01369 if (!NT_SUCCESS(ExInitializeResourceLite(gpresDeviceInfoList))) { 01370 goto InitCreateUserCritExit; 01371 } 01372 01373 /* 01374 * Create the handle flag mutex. We'll need this once we start creating 01375 * windowstations and desktops. 01376 */ 01377 gpHandleFlagsMutex = ExAllocatePoolWithTag(NonPagedPoolMustSucceed, 01378 sizeof(FAST_MUTEX), 01379 TAG_SYSTEM); 01380 if (gpHandleFlagsMutex == NULL) { 01381 goto InitCreateUserCritExit; 01382 } 01383 ExInitializeFastMutex(gpHandleFlagsMutex); 01384 01385 TRACE_INIT(("Win32UserInit: gpHandleFlagsMutex = 0x%p\n", gpHandleFlagsMutex)); 01386 TRACE_INIT(("Win32UserInit: gpresDeviceInfoList = 0x%X\n", gpresDeviceInfoList)); 01387 TRACE_INIT(("Win32UserInit: gpresMouseEventQueue = 0x%X\n", gpresMouseEventQueue)); 01388 TRACE_INIT(("Win32UserInit: gpresUser = 0x%X\n", gpresUser)); 01389 01390 TRACE_INIT(("Win32UserInit: exit InitCreateUserCrit()\n")); 01391 return TRUE; 01392 01393 InitCreateUserCritExit: 01394 RIPERR0(ERROR_NOT_ENOUGH_MEMORY, RIP_ERROR, 01395 "Win32UserInit: InitCreateUserCrit failed"); 01396 01397 if (gpresUser) { 01398 ExFreePool(gpresUser); 01399 } 01400 if (gpresMouseEventQueue) { 01401 ExFreePool(gpresMouseEventQueue); 01402 } 01403 if (gpresDeviceInfoList) { 01404 ExFreePool(gpresDeviceInfoList); 01405 } 01406 return FALSE; 01407 }

NTSTATUS InitializeClientPfnArrays CONST PFNCLIENT ppfnClientA,
CONST PFNCLIENT ppfnClientW,
CONST PFNCLIENTWORKER ppfnClientWorker,
HANDLE  hModUser
 

Definition at line 2313 of file w32/ntuser/kernel/init.c.

References tagSERVERINFO::apfnClientA, tagSERVERINFO::apfnClientW, tagSERVERINFO::apfnClientWorker, BOOL, FALSE, gpfnwp, gpsi, hModClient, ICLS_BUTTON, ICLS_COMBOBOX, ICLS_COMBOLISTBOX, ICLS_DDEML16BIT, ICLS_DDEMLCLIENTA, ICLS_DDEMLCLIENTW, ICLS_DDEMLEVENT, ICLS_DDEMLMOTHER, ICLS_DDEMLSERVERA, ICLS_DDEMLSERVERW, ICLS_DESKTOP, ICLS_DIALOG, ICLS_EDIT, ICLS_ICONTITLE, ICLS_IME, ICLS_LISTBOX, ICLS_MAX, ICLS_MDICLIENT, ICLS_MENU, ICLS_SCROLLBAR, ICLS_STATIC, ICLS_SWITCH, ICLS_TOOLTIP, ISCSRSS, NTSTATUS(), NULL, _PFNCLIENT::pfnButtonWndProc, _PFNCLIENT::pfnComboBoxWndProc, _PFNCLIENT::pfnComboListBoxProc, _PFNCLIENT::pfnDefWindowProc, _PFNCLIENT::pfnDialogWndProc, _PFNCLIENT::pfnListBoxWndProc, _PFNCLIENT::pfnMDIClientWndProc, _PFNCLIENT::pfnStaticWndProc, _PFNCLIENT::pfnTitleWndProc, TRUE, xxxDesktopWndProc(), xxxMenuWindowProc(), xxxSBWndProc(), xxxSwitchWndProc(), and xxxTooltipWndProc().

Referenced by NtUserInitializeClientPfnArrays().

02318 { 02319 static BOOL fHaveClientPfns = FALSE; 02320 /* 02321 * Remember client side addresses in this global structure. These are 02322 * always constant, so this is ok. Note that if either of the 02323 * pointers are invalid, the exception will be handled in 02324 * the thunk and fHaveClientPfns will not be set. 02325 */ 02326 if (!fHaveClientPfns && ppfnClientA != NULL) { 02327 if (!ISCSRSS()) { 02328 RIPMSG0(RIP_WARNING, "InitializeClientPfnArrays failed !csrss"); 02329 return STATUS_UNSUCCESSFUL; 02330 } 02331 gpsi->apfnClientA = *ppfnClientA; 02332 gpsi->apfnClientW = *ppfnClientW; 02333 gpsi->apfnClientWorker = *ppfnClientWorker; 02334 02335 gpfnwp[ICLS_BUTTON] = gpsi->apfnClientW.pfnButtonWndProc; 02336 gpfnwp[ICLS_EDIT] = gpsi->apfnClientW.pfnDefWindowProc; 02337 gpfnwp[ICLS_STATIC] = gpsi->apfnClientW.pfnStaticWndProc; 02338 gpfnwp[ICLS_LISTBOX] = gpsi->apfnClientW.pfnListBoxWndProc; 02339 gpfnwp[ICLS_SCROLLBAR] = (PROC)xxxSBWndProc; 02340 gpfnwp[ICLS_COMBOBOX] = gpsi->apfnClientW.pfnComboBoxWndProc; 02341 gpfnwp[ICLS_DESKTOP] = (PROC)xxxDesktopWndProc; 02342 gpfnwp[ICLS_DIALOG] = gpsi->apfnClientW.pfnDialogWndProc; 02343 gpfnwp[ICLS_MENU] = (PROC)xxxMenuWindowProc; 02344 gpfnwp[ICLS_SWITCH] = (PROC)xxxSwitchWndProc; 02345 gpfnwp[ICLS_ICONTITLE] = gpsi->apfnClientW.pfnTitleWndProc; 02346 gpfnwp[ICLS_MDICLIENT] = gpsi->apfnClientW.pfnMDIClientWndProc; 02347 gpfnwp[ICLS_COMBOLISTBOX] = gpsi->apfnClientW.pfnComboListBoxProc; 02348 gpfnwp[ICLS_DDEMLEVENT] = NULL; 02349 gpfnwp[ICLS_DDEMLMOTHER] = NULL; 02350 gpfnwp[ICLS_DDEML16BIT] = NULL; 02351 gpfnwp[ICLS_DDEMLCLIENTA] = NULL; 02352 gpfnwp[ICLS_DDEMLCLIENTW] = NULL; 02353 gpfnwp[ICLS_DDEMLSERVERA] = NULL; 02354 gpfnwp[ICLS_DDEMLSERVERW] = NULL; 02355 gpfnwp[ICLS_IME] = NULL; 02356 gpfnwp[ICLS_TOOLTIP] = (PROC)xxxTooltipWndProc; 02357 02358 /* 02359 * Change this assert when new classes are added. 02360 */ 02361 UserAssert(ICLS_MAX == ICLS_TOOLTIP+1); 02362 02363 hModClient = hModUser; 02364 fHaveClientPfns = TRUE; 02365 } 02366 #if DBG 02367 /* 02368 * BradG - Verify that user32.dll on the client side has loaded 02369 * at the correct address. If not, do an RIPMSG. 02370 */ 02371 02372 if((ppfnClientA != NULL) && 02373 (gpsi->apfnClientA.pfnButtonWndProc != ppfnClientA->pfnButtonWndProc)) 02374 RIPMSG0(RIP_ERROR, "Client side user32.dll not loaded at same address."); 02375 #endif 02376 02377 return STATUS_SUCCESS; 02378 }

VOID InitializeMediaChange HANDLE   ) 
 

Definition at line 119 of file w32/ntuser/kernel/pnp.c.

References ExEventObjectType, ExInitializeFastMutex, gbRemoteSession, gMediaChangeList, gMediaChangeMutex, gpEventMediaChange, KernelMode, NULL, and ObReferenceObjectByHandle().

Referenced by NtUserInitialize().

00120 { 00121 if (!gbRemoteSession) { 00122 00123 InitializeListHead(&gMediaChangeList); 00124 00125 ObReferenceObjectByHandle(hMediaRequestEvent, 00126 EVENT_ALL_ACCESS, 00127 *ExEventObjectType, 00128 KernelMode, 00129 &gpEventMediaChange, 00130 NULL); 00131 00132 gMediaChangeMutex = UserAllocPoolNonPaged(sizeof(FAST_MUTEX), TAG_PNP); 00133 00134 if (gMediaChangeMutex) { 00135 ExInitializeFastMutex(gMediaChangeMutex); 00136 } 00137 } 00138 00139 return; 00140 }

NTSTATUS InitializePowerRequestList HANDLE  hPowerRequestEvent  ) 
 

Definition at line 180 of file power.c.

References ExEventObjectType, ExInitializeFastMutex, gpEventPowerRequest, gPowerRequestList, gpPowerRequestMutex, KernelMode, NT_SUCCESS, NTSTATUS(), NULL, ObReferenceObjectByHandle(), and Status.

Referenced by NtUserInitialize().

00182 { 00183 NTSTATUS Status; 00184 00185 InitializeListHead(&gPowerRequestList); 00186 00187 Status = ObReferenceObjectByHandle(hPowerRequestEvent, 00188 EVENT_ALL_ACCESS, 00189 *ExEventObjectType, 00190 KernelMode, 00191 &gpEventPowerRequest, 00192 NULL); 00193 if (!NT_SUCCESS(Status)) { 00194 return Status; 00195 } 00196 00197 gpPowerRequestMutex = UserAllocPoolNonPaged(sizeof(FAST_MUTEX), TAG_POWER); 00198 if (gpPowerRequestMutex == NULL) { 00199 return STATUS_NO_MEMORY; 00200 } 00201 ExInitializeFastMutex(gpPowerRequestMutex); 00202 00203 return STATUS_SUCCESS; 00204 }

void InitKeyboard void   ) 
 

Referenced by RawInputThread(), and xxxRemoteReconnect().

VOID InitLoadResources  ) 
 

Definition at line 1738 of file kernel/server.c.

References tagDISPLAYRESOURCE::cxBorder, tagDISPLAYRESOURCE::cyBorder, DISPLAYRESOURCE, gbRemoteSession, GetPrimaryMonitor(), gpsi, tagMONITOR::rcMonitor, SYSMET, TRACE_INIT, VOID(), tagDISPLAYRESOURCE::xCompressCursor, tagDISPLAYRESOURCE::xCompressIcon, tagDISPLAYRESOURCE::yCompressCursor, tagDISPLAYRESOURCE::yCompressIcon, and tagDISPLAYRESOURCE::yKanji.

Referenced by RemoteConnect(), and UserInitialize().

01739 { 01740 PRECT prc; 01741 01742 DISPLAYRESOURCE dr = { 01743 17, // Height of vertical thumb 01744 17, // Width of horizontal thumb 01745 2, // Icon horiz compression factor 01746 2, // Icon vert compression factor 01747 1, // Cursor horz compression factor 01748 1, // Cursor vert compression factor 01749 0, // Kanji window height 01750 1, // cxBorder (thickness of vertical lines) 01751 1 // cyBorder (thickness of horizontal lines) 01752 }; 01753 01754 01755 TRACE_INIT(("UserInit: Load Display Resources\n")); 01756 01757 if (dr.xCompressIcon > 10) { 01758 01759 /* 01760 * If so, the actual dimensions of icons and cursors are 01761 * kept in OEMBIN. 01762 */ 01763 SYSMET(CXICON) = dr.xCompressIcon; 01764 SYSMET(CYICON) = dr.yCompressIcon; 01765 SYSMET(CXCURSOR) = dr.xCompressCursor; 01766 SYSMET(CYCURSOR) = dr.yCompressCursor; 01767 01768 } else { 01769 01770 /* 01771 * Else, only the ratio of (64/icon dimensions) is kept there. 01772 */ 01773 SYSMET(CXICON) = (64 / dr.xCompressIcon); 01774 SYSMET(CYICON) = (64 / dr.yCompressIcon); 01775 SYSMET(CXCURSOR) = (32 / dr.xCompressCursor); 01776 SYSMET(CYCURSOR) = (32 / dr.yCompressCursor); 01777 } 01778 01779 SYSMET(CXSMICON) = SYSMET(CXICON) / 2; 01780 SYSMET(CYSMICON) = SYSMET(CYICON) / 2; 01781 01782 SYSMET(CYKANJIWINDOW) = dr.yKanji; 01783 01784 /* 01785 * Get border thicknesses. 01786 */ 01787 SYSMET(CXBORDER) = dr.cxBorder; 01788 SYSMET(CYBORDER) = dr.cyBorder; 01789 01790 /* 01791 * Edge is two borders. 01792 */ 01793 SYSMET(CXEDGE) = 2 * SYSMET(CXBORDER); 01794 SYSMET(CYEDGE) = 2 * SYSMET(CYBORDER); 01795 01796 /* 01797 * Fixed frame is outer edge + border. 01798 */ 01799 SYSMET(CXDLGFRAME) = SYSMET(CXEDGE) + SYSMET(CXBORDER); 01800 SYSMET(CYDLGFRAME) = SYSMET(CYEDGE) + SYSMET(CYBORDER); 01801 01802 if (gbRemoteSession) { 01803 return; 01804 } 01805 01806 prc = &GetPrimaryMonitor()->rcMonitor; 01807 SYSMET(CXFULLSCREEN) = prc->right; 01808 SYSMET(CYFULLSCREEN) = prc->bottom - SYSMET(CYCAPTION); 01809 01810 /* 01811 * Set the initial cursor position to the center of the primary screen. 01812 */ 01813 gpsi->ptCursor.x = prc->right / 2; 01814 gpsi->ptCursor.y = prc->bottom / 2; 01815 }

VOID InitMice  ) 
 

Definition at line 289 of file ntinput.c.

References ACCF_MKVIRTUALMOUSE, CLEAR_ACCF, CLEAR_GTERMF, FALSE, GTERMF_MOUSE, SYSMET, and VOID().

Referenced by RawInputThread().

00290 { 00291 CLEAR_ACCF(ACCF_MKVIRTUALMOUSE); 00292 CLEAR_GTERMF(GTERMF_MOUSE); 00293 SYSMET(MOUSEPRESENT) = FALSE; 00294 SYSMET(CMOUSEBUTTONS) = 0; 00295 SYSMET(MOUSEWHEELPRESENT) = FALSE; 00296 }

BOOL InitSecurity VOID   ) 
 

Definition at line 152 of file w32/ntuser/kernel/security.c.

References AllocAce(), BOOL, CreateSecurityDescriptor(), DWORD, FALSE, gpsdInitWinSta, NULL, _SE_EXPORTS::SeAliasAdminsSid, SeEnableAccessToExports, SeExports, _SE_EXPORTS::SeRestrictedSid, _SE_EXPORTS::SeWorldSid, and WinStaMapping.

Referenced by Win32UserInitialize().

00154 { 00155 PACCESS_ALLOWED_ACE paceList = NULL, pace; 00156 DWORD dwLength; 00157 00158 /* 00159 * Get access to exported constants 00160 */ 00161 SeEnableAccessToExports(); 00162 00163 /* 00164 * Create ACE list. 00165 */ 00166 paceList = AllocAce(NULL, 00167 ACCESS_ALLOWED_ACE_TYPE, 00168 CONTAINER_INHERIT_ACE | INHERIT_ONLY_ACE | NO_PROPAGATE_INHERIT_ACE, 00169 WinStaMapping.GenericAll, 00170 SeExports->SeWorldSid, 00171 &dwLength); 00172 if (paceList == NULL) 00173 return FALSE; 00174 00175 pace = AllocAce(paceList, 00176 ACCESS_ALLOWED_ACE_TYPE, 00177 CONTAINER_INHERIT_ACE | INHERIT_ONLY_ACE | NO_PROPAGATE_INHERIT_ACE, 00178 WinStaMapping.GenericAll, 00179 SeExports->SeRestrictedSid, 00180 &dwLength); 00181 if (pace == NULL) { 00182 UserFreePool(paceList); 00183 return FALSE; 00184 } 00185 paceList = pace; 00186 00187 pace = AllocAce(paceList, ACCESS_ALLOWED_ACE_TYPE, 00188 OBJECT_INHERIT_ACE | INHERIT_ONLY_ACE, 00189 GENERIC_ALL, SeExports->SeWorldSid, &dwLength); 00190 if (pace == NULL) { 00191 UserFreePool(paceList); 00192 return FALSE; 00193 } 00194 paceList = pace; 00195 00196 pace = AllocAce(paceList, ACCESS_ALLOWED_ACE_TYPE, 00197 OBJECT_INHERIT_ACE | INHERIT_ONLY_ACE, 00198 GENERIC_ALL, SeExports->SeRestrictedSid, &dwLength); 00199 if (pace == NULL) { 00200 UserFreePool(paceList); 00201 return FALSE; 00202 } 00203 paceList = pace; 00204 00205 pace = AllocAce(paceList, ACCESS_ALLOWED_ACE_TYPE, 00206 0, DIRECTORY_QUERY | DIRECTORY_CREATE_OBJECT, 00207 SeExports->SeAliasAdminsSid, &dwLength); 00208 if (pace == NULL) { 00209 UserFreePool(paceList); 00210 return FALSE; 00211 } 00212 paceList = pace; 00213 00214 pace = AllocAce(paceList, ACCESS_ALLOWED_ACE_TYPE, 00215 0, DIRECTORY_TRAVERSE, SeExports->SeWorldSid, &dwLength); 00216 if (pace == NULL) { 00217 UserFreePool(paceList); 00218 return FALSE; 00219 } 00220 paceList = pace; 00221 00222 pace = AllocAce(paceList, ACCESS_ALLOWED_ACE_TYPE, 00223 0, DIRECTORY_TRAVERSE, SeExports->SeRestrictedSid, &dwLength); 00224 if (pace == NULL) { 00225 UserFreePool(paceList); 00226 return FALSE; 00227 } 00228 paceList = pace; 00229 00230 /* 00231 * Create the SD 00232 */ 00233 gpsdInitWinSta = CreateSecurityDescriptor(paceList, dwLength, FALSE); 00234 UserFreePool(paceList); 00235 00236 if (gpsdInitWinSta == NULL) { 00237 RIPMSG0(RIP_WARNING, "Initial windowstation security was not created!"); 00238 } 00239 00240 return (BOOL)(gpsdInitWinSta != NULL); 00241 }

NTSTATUS InitSystemThread PUNICODE_STRING  pstrThreadName  ) 
 

Definition at line 191 of file ex.c.

References CheckCritOut, ClearAppStarting(), EnterCrit, LeaveCrit, NT_SUCCESS, NTSTATUS(), NULL, tagTHREADINFO::ppi, PsGetCurrentThread, tagTHREADINFO::pstrAppName, PtiCurrentShared, Status, _ETHREAD::ThreadsProcess, TRUE, ValidateThreadSessionId, _EPROCESS::Win32Process, and xxxCreateThreadInfo().

Referenced by RawInputThread(), VideoPortCalloutThread(), and xxxDesktopThread().

00193 { 00194 PETHREAD pEThread; 00195 PEPROCESS Process; 00196 PTHREADINFO pti; 00197 NTSTATUS Status; 00198 00199 CheckCritOut(); 00200 00201 pEThread = PsGetCurrentThread(); 00202 Process = pEThread->ThreadsProcess; 00203 00204 ValidateThreadSessionId(pEThread); 00205 00206 /* 00207 * check to see if process is already set, if not, we 00208 * need to set it up as well 00209 */ 00210 if (Process->Win32Process == NULL) { 00211 Status = W32pProcessCallout(Process, TRUE); 00212 if (!NT_SUCCESS(Status)) { 00213 return Status; 00214 } 00215 } 00216 00217 /* 00218 * We have the W32 process (or don't need one). Now get the thread data 00219 * and the kernel stack 00220 */ 00221 Status = AllocateW32Thread(pEThread); 00222 if (!NT_SUCCESS(Status)) { 00223 return Status; 00224 } 00225 00226 EnterCrit(); 00227 00228 /* 00229 * Allocate a pti for this thread 00230 * 00231 * Flag this as a system thread 00232 */ 00233 Status = xxxCreateThreadInfo(pEThread, TRUE); 00234 if (!NT_SUCCESS(Status)) { 00235 FreeW32Thread(pEThread); 00236 LeaveCrit(); 00237 return Status; 00238 } 00239 00240 pti = PtiCurrentShared(); 00241 if (pstrThreadName) { 00242 if (pti->pstrAppName != NULL) 00243 UserFreePool(pti->pstrAppName); 00244 pti->pstrAppName = UserAllocPoolWithQuota(sizeof(UNICODE_STRING) + 00245 pstrThreadName->Length + sizeof(WCHAR), TAG_TEXT); 00246 if (pti->pstrAppName != NULL) { 00247 pti->pstrAppName->Buffer = (PWCHAR)(pti->pstrAppName + 1); 00248 RtlCopyMemory(pti->pstrAppName->Buffer, pstrThreadName->Buffer, 00249 pstrThreadName->Length); 00250 pti->pstrAppName->Buffer[pstrThreadName->Length / sizeof(WCHAR)] = 0; 00251 pti->pstrAppName->MaximumLength = pstrThreadName->Length + sizeof(WCHAR); 00252 pti->pstrAppName->Length = pstrThreadName->Length; 00253 } 00254 } 00255 00256 /* 00257 * Need to clear the W32PF_APPSTARTING bit so that windows created by 00258 * the RIT don't cause the cursor to change to the app starting 00259 * cursor. 00260 */ 00261 if ((pti->ppi != NULL) && (pti->ppi->W32PF_Flags & W32PF_APPSTARTING)) { 00262 ClearAppStarting(pti->ppi); 00263 } 00264 00265 LeaveCrit(); 00266 00267 return STATUS_SUCCESS; 00268 }

__inline void InitTooltipDelay PTOOLTIPWND  pttwnd  ) 
 

Definition at line 6932 of file userk.h.

References SYSMET.

Referenced by _SetDoubleClickTime(), and xxxTooltipWndProc().

06937 : SYSMET(CYCAPTION); 06938

BOOL InitUserScreen  ) 
 

Definition at line 775 of file fullscr.c.

References BOOL, CreateCacheDC(), CreateCachedMonitor(), CreateEmptyRgnPublic(), CreateProfileUserName(), DCE_SIZE_CACHEINIT, FALSE, FillRect(), FreeProfileUserName(), ghdcMem, ghdcMem2, ghFontSys, ghrgnGDC, ghrgnInv0, ghrgnInv1, ghrgnInv2, ghrgnInvalid, ghrgnInvalidSum, ghrgnSCR, ghrgnScrl1, ghrgnScrl2, ghrgnScrlDst, ghrgnScrlSrc, ghrgnScrlValid, ghrgnScrlVis, ghrgnSPB1, ghrgnSPB2, ghrgnSW, ghrgnSWP1, ghrgnValid, ghrgnValidSum, ghrgnVisNew, gpDispInfo, gpsi, HDCBITS, tagDISPLAYINFO::hdcScreen, tagDISPLAYINFO::hDev, InitSafeBootMode, NULL, tagDISPLAYINFO::rcScreen, SYSHBR, SYSMET, TRACE_INIT, TRUE, UpdateUserScreen(), and xxxODI_ColorInit().

Referenced by InitVideo().

00776 { 00777 int i; 00778 TL tlName; 00779 PUNICODE_STRING pProfileUserName = CreateProfileUserName(&tlName); 00780 BOOL fSuccess = TRUE; 00781 00782 TRACE_INIT(("UserInit: Initialize Screen\n")); 00783 00784 /* 00785 * Create screen and memory dcs. 00786 */ 00787 gpDispInfo->hdcScreen = GreCreateDisplayDC(gpDispInfo->hDev, DCTYPE_DIRECT, FALSE); 00788 00789 if (gpDispInfo->hdcScreen == NULL) { 00790 RIPMSG0(RIP_WARNING, "Fail to create gpDispInfo->hdcScreen"); 00791 fSuccess = FALSE; 00792 goto Exit; 00793 } 00794 00795 GreSelectFont(gpDispInfo->hdcScreen, GreGetStockObject(SYSTEM_FONT)); 00796 GreSetDCOwner(gpDispInfo->hdcScreen, OBJECT_OWNER_PUBLIC); 00797 00798 HDCBITS() = GreCreateCompatibleDC(gpDispInfo->hdcScreen); 00799 00800 if (HDCBITS() == NULL) { 00801 RIPMSG0(RIP_WARNING, "Fail to create HDCBITS()"); 00802 fSuccess = FALSE; 00803 goto Exit; 00804 } 00805 00806 GreSelectFont(HDCBITS(), GreGetStockObject(SYSTEM_FONT)); 00807 GreSetDCOwner(HDCBITS(), OBJECT_OWNER_PUBLIC); 00808 00809 ghdcMem = GreCreateCompatibleDC(gpDispInfo->hdcScreen); 00810 fSuccess &= !!ghdcMem; 00811 00812 ghdcMem2 = GreCreateCompatibleDC(gpDispInfo->hdcScreen); 00813 fSuccess &= !!ghdcMem2; 00814 00815 if (!fSuccess) { 00816 RIPMSG0(RIP_WARNING, "Fail to create ghdcMem or ghdcMem2"); 00817 goto Exit; 00818 } 00819 00820 GreSetDCOwner(ghdcMem, OBJECT_OWNER_PUBLIC); 00821 GreSetDCOwner(ghdcMem2, OBJECT_OWNER_PUBLIC); 00822 00823 if (CreateCachedMonitor() == NULL) { 00824 fSuccess = FALSE; 00825 goto Exit; 00826 } 00827 00828 if (!UpdateUserScreen()) { 00829 RIPMSG0(RIP_WARNING, "UpdateUserScreen failed"); 00830 fSuccess = FALSE; 00831 goto Exit; 00832 } 00833 00834 /* 00835 * Do some initialization so we create the system colors. 00836 */ 00837 00838 /* 00839 * Set the window sizing border width to something reasonable. 00840 */ 00841 gpsi->gclBorder = 1; 00842 00843 /* 00844 * Init InternalInvalidate globals 00845 */ 00846 ghrgnInv0 = CreateEmptyRgnPublic(); // For InternalInvalidate() 00847 fSuccess &= !!ghrgnInv0; 00848 00849 ghrgnInv1 = CreateEmptyRgnPublic(); // For InternalInvalidate() 00850 fSuccess &= !!ghrgnInv1; 00851 00852 ghrgnInv2 = CreateEmptyRgnPublic(); // For InternalInvalidate() 00853 fSuccess &= !!ghrgnInv2; 00854 00855 /* 00856 * Initialize SPB globals 00857 */ 00858 ghrgnSPB1 = CreateEmptyRgnPublic(); 00859 fSuccess &= !!ghrgnSPB1; 00860 00861 ghrgnSPB2 = CreateEmptyRgnPublic(); 00862 fSuccess &= !!ghrgnSPB2; 00863 00864 ghrgnSCR = CreateEmptyRgnPublic(); 00865 fSuccess &= !!ghrgnSCR; 00866 00867 /* 00868 * Initialize ScrollWindow/ScrollDC globals 00869 */ 00870 ghrgnSW = CreateEmptyRgnPublic(); 00871 fSuccess &= !!ghrgnSW; 00872 00873 ghrgnScrl1 = CreateEmptyRgnPublic(); 00874 fSuccess &= !!ghrgnScrl1; 00875 00876 ghrgnScrl2 = CreateEmptyRgnPublic(); 00877 fSuccess &= !!ghrgnScrl2; 00878 00879 ghrgnScrlVis = CreateEmptyRgnPublic(); 00880 fSuccess &= !!ghrgnScrlVis; 00881 00882 ghrgnScrlSrc = CreateEmptyRgnPublic(); 00883 fSuccess &= !!ghrgnScrlSrc; 00884 00885 ghrgnScrlDst = CreateEmptyRgnPublic(); 00886 fSuccess &= !!ghrgnScrlDst; 00887 00888 ghrgnScrlValid = CreateEmptyRgnPublic(); 00889 fSuccess &= !!ghrgnScrlValid; 00890 00891 /* 00892 * Initialize SetWindowPos() 00893 */ 00894 ghrgnInvalidSum = CreateEmptyRgnPublic(); 00895 fSuccess &= !!ghrgnInvalidSum; 00896 00897 ghrgnVisNew = CreateEmptyRgnPublic(); 00898 fSuccess &= !!ghrgnVisNew; 00899 00900 ghrgnSWP1 = CreateEmptyRgnPublic(); 00901 fSuccess &= !!ghrgnSWP1; 00902 00903 ghrgnValid = CreateEmptyRgnPublic(); 00904 fSuccess &= !!ghrgnValid; 00905 00906 ghrgnValidSum = CreateEmptyRgnPublic(); 00907 fSuccess &= !!ghrgnValidSum; 00908 00909 ghrgnInvalid = CreateEmptyRgnPublic(); 00910 fSuccess &= !!ghrgnInvalid; 00911 00912 /* 00913 * Initialize DC cache 00914 */ 00915 ghrgnGDC = CreateEmptyRgnPublic(); 00916 fSuccess &= !!ghrgnGDC; 00917 00918 for (i = 0; i < DCE_SIZE_CACHEINIT; i++) { 00919 fSuccess &= !!CreateCacheDC(NULL, DCX_INVALID | DCX_CACHE, NULL); 00920 } 00921 00922 if (!fSuccess) { 00923 RIPMSG0(RIP_WARNING, "CreateCacheDC failed"); 00924 goto Exit; 00925 } 00926 00927 /* 00928 * Let engine know that the display must be secure. 00929 */ 00930 00931 GreMarkDCUnreadable(gpDispInfo->hdcScreen); 00932 00933 /* 00934 * LATER mikeke - if ghfontsys is changed anywhere but here 00935 * we need to fix SetNCFont() 00936 */ 00937 ghFontSys = (HFONT)GreGetStockObject(SYSTEM_FONT); 00938 00939 #if DBG 00940 SYSMET(DEBUG) = TRUE; 00941 #else 00942 SYSMET(DEBUG) = FALSE; 00943 #endif 00944 00945 SYSMET(CLEANBOOT) = **((PULONG *)&InitSafeBootMode); 00946 00947 SYSMET(SLOWMACHINE) = 0; 00948 00949 /* 00950 * Initialize system colors from registry. 00951 */ 00952 xxxODI_ColorInit(pProfileUserName); 00953 00954 /* 00955 * Paint the screen background. 00956 */ 00957 FillRect(gpDispInfo->hdcScreen, &gpDispInfo->rcScreen, SYSHBR(DESKTOP)); 00958 00959 UserAssert(fSuccess); 00960 00961 Exit: 00962 FreeProfileUserName(pProfileUserName, &tlName); 00963 00964 return fSuccess; 00965 }

PMDEV InitVideo BOOL  bReenumerationNeeded  ) 
 

Definition at line 1893 of file kernel/server.c.

References FALSE, gpDispInfo, GW_DESKTOP_ID, tagDISPLAYINFO::hDev, HH_INITVIDEO, HYDRA_HINT, InitUserScreen(), KernelMode, NULL, tagDISPLAYINFO::pmdev, and TRUE.

Referenced by RemoteConnect(), and UserInitialize().

01895 { 01896 PMDEV pmdev; 01897 LONG ChangeStatus; 01898 01899 /* 01900 * BUGBUG !!! Need to get a status return from this call. 01901 */ 01902 DrvInitConsole(bReenumerationNeeded); 01903 01904 /* 01905 * BASEVIDEO may be on or off, whether we are in setup or not. 01906 */ 01907 01908 ChangeStatus = DrvChangeDisplaySettings(NULL, 01909 NULL, 01910 NULL, 01911 (PVOID) (GW_DESKTOP_ID), 01912 KernelMode, 01913 FALSE, 01914 TRUE, 01915 NULL, 01916 &pmdev, 01917 GRE_DEFAULT, 01918 TRUE); 01919 01920 if (ChangeStatus != GRE_DISP_CHANGE_SUCCESSFUL) { 01921 01922 /* 01923 * If we fail, try BASEVIDEO temporarily 01924 */ 01925 01926 DrvSetBaseVideo(TRUE); 01927 01928 ChangeStatus = DrvChangeDisplaySettings(NULL, 01929 NULL, 01930 NULL, 01931 (PVOID) (GW_DESKTOP_ID), 01932 KernelMode, 01933 FALSE, 01934 TRUE, 01935 NULL, 01936 &pmdev, 01937 GRE_DEFAULT, 01938 TRUE); 01939 01940 DrvSetBaseVideo(FALSE); 01941 01942 /* 01943 * Give it one last try, not in basevideo, to handle TGA 01944 * (non-vgacompatible) during GUI-mode setup (BASEVIDEO is on by 01945 * default) 01946 */ 01947 01948 if (ChangeStatus != GRE_DISP_CHANGE_SUCCESSFUL) { 01949 01950 ChangeStatus = DrvChangeDisplaySettings(NULL, 01951 NULL, 01952 NULL, 01953 (PVOID) (GW_DESKTOP_ID), 01954 KernelMode, 01955 FALSE, 01956 TRUE, 01957 NULL, 01958 &pmdev, 01959 GRE_DEFAULT, 01960 TRUE); 01961 01962 } 01963 } 01964 01965 if (ChangeStatus != GRE_DISP_CHANGE_SUCCESSFUL) { 01966 RIPMSG0(RIP_WARNING, "InitVideo: No working display driver found"); 01967 return NULL; 01968 } 01969 01970 gpDispInfo->hDev = pmdev->hdevParent; 01971 gpDispInfo->pmdev = pmdev; 01972 01973 GreUpdateSharedDevCaps(gpDispInfo->hDev); 01974 01975 if (!InitUserScreen()) { 01976 RIPMSG0(RIP_WARNING, "InitUserScreen failed"); 01977 return NULL; 01978 } 01979 01980 HYDRA_HINT(HH_INITVIDEO); 01981 01982 return pmdev; 01983 }

VOID NTAPI InputApc IN PVOID  ApcContext,
IN PIO_STATUS_BLOCK  IoStatusBlock,
IN ULONG  Reserved
 

Definition at line 1090 of file ntinput.c.

References aDeviceTemplate, tagDEVICE_TEMPLATE::DeviceRead, EnterDeviceInfoListCrit(), FreeDeviceInfo(), GDIAF_FREEME, GDIF_READING, LeaveDeviceInfoListCrit(), NT_SUCCESS, PDEVICE_TEMPLATE, StartDeviceRead(), and VOID().

Referenced by StartDeviceRead().

01095 { 01096 PDEVICEINFO pDeviceInfo = (PDEVICEINFO)ApcContext; 01097 UNREFERENCED_PARAMETER(Reserved); 01098 01099 #ifdef DIAGNOSE_IO 01100 pDeviceInfo->nReadsOutstanding--; 01101 #endif 01102 01103 /* 01104 * If this device needs freeing, abandon reading now and request the free. 01105 * (Don't even process the input that we received in this APC) 01106 */ 01107 if (pDeviceInfo->usActions & GDIAF_FREEME) { 01108 EnterDeviceInfoListCrit(); 01109 pDeviceInfo->bFlags &= ~GDIF_READING; 01110 FreeDeviceInfo(pDeviceInfo); 01111 LeaveDeviceInfoListCrit(); 01112 return; 01113 } 01114 01115 if (NT_SUCCESS(IoStatusBlock->Status)) { 01116 PDEVICE_TEMPLATE pDevTpl = &aDeviceTemplate[pDeviceInfo->type]; 01117 pDevTpl->DeviceRead(pDeviceInfo); 01118 } 01119 StartDeviceRead(pDeviceInfo); 01120 }

VOID InsertTask PPROCESSINFO  ppi,
PTDB  ptdbNew
 

Definition at line 60 of file taskman.c.

References CheckCritIn, tagTDB::nPriority, NULL, tagWOWPROCESSINFO::ptdbHead, tagTDB::ptdbNext, and tagPROCESSINFO::pwpi.

Referenced by DirectedScheduleTask(), xxxDirectedYield(), xxxSleepTask(), xxxUserYield(), and zzzInitTask().

00063 { 00064 PTDB *pptdb; 00065 PTDB ptdb; 00066 int nPriority; 00067 PWOWPROCESSINFO pwpi = ppi->pwpi; 00068 00069 CheckCritIn(); 00070 00071 UserAssert(pwpi != NULL); 00072 00073 pptdb = &pwpi->ptdbHead; 00074 nPriority = ptdbNew->nPriority; 00075 00076 while ((ptdb = *pptdb) != NULL) { 00077 /* 00078 * Remove it from it's old location 00079 */ 00080 if (ptdb == ptdbNew) { 00081 *pptdb = ptdbNew->ptdbNext; 00082 00083 /* 00084 * continue to search for the place to insert it 00085 */ 00086 while ((ptdb = *pptdb) != NULL) { 00087 if (nPriority < ptdb->nPriority) { 00088 break; 00089 } 00090 00091 pptdb = &(ptdb->ptdbNext); 00092 } 00093 break; 00094 } 00095 00096 /* 00097 * if this is the place to insert continue to search for the 00098 * place to delete it from 00099 */ 00100 if (nPriority < ptdb->nPriority) { 00101 do { 00102 if (ptdb->ptdbNext == ptdbNew) { 00103 ptdb->ptdbNext = ptdbNew->ptdbNext; 00104 break; 00105 } 00106 ptdb = ptdb->ptdbNext; 00107 } while (ptdb != NULL); 00108 break; 00109 } 00110 00111 pptdb = &(ptdb->ptdbNext); 00112 } 00113 00114 /* 00115 * insert the new task 00116 */ 00117 ptdbNew->ptdbNext = *pptdb; 00118 *pptdb = ptdbNew; 00119 }

PSMWP InternalBeginDeferWindowPos int  cwndGuess  ) 
 

Definition at line 231 of file swp.c.

References tagSMWP::acvr, AllocateCvr(), tagSMWP::ccvr, tagSMWP::ccvrAlloc, CheckCritIn, DBGCheskSMWP, gSMWP, NULL, PUDF_GSMWPINUSE, SET_PUDF, and TEST_PUDF.

Referenced by xxxArrangeIconicWindows(), xxxDesktopRecalc(), xxxMinMaximize(), xxxProcessSetWindowPosEvent(), xxxSetWindowPos(), and xxxSetWindowRgn().

00232 { 00233 PSMWP psmwp; 00234 00235 CheckCritIn(); 00236 00237 /* 00238 * If gSMWP in being used, allocate one. 00239 * Note that SMWP is zero init but CVR is not; _DeferWindowPos initializes it 00240 */ 00241 if (TEST_PUDF(PUDF_GSMWPINUSE) || (cwndHint > gSMWP.ccvrAlloc)) { 00242 psmwp = (PSMWP)UserAllocPoolWithQuotaZInit(sizeof(SMWP), TAG_SWP); 00243 if (psmwp == NULL) { 00244 return NULL; 00245 } 00246 if (!AllocateCvr(psmwp, cwndHint)) { 00247 UserFreePool(psmwp); 00248 return NULL; 00249 } 00250 } else { 00251 SET_PUDF(PUDF_GSMWPINUSE); 00252 psmwp = &gSMWP; 00253 RtlZeroMemory(&gSMWP, FIELD_OFFSET(SMWP, ccvrAlloc)); 00254 UserAssert(gSMWP.ccvr == 0); 00255 UserAssert(gSMWP.acvr != NULL); 00256 } 00257 00258 DBGCheskSMWP(psmwp); 00259 return psmwp; 00260 }

void InternalInvalidate3 PWND  pwnd,
HRGN  hrgn,
DWORD  flags
 

Definition at line 784 of file update.c.

References BOOL, CalcWindowRgn(), ClearHungFlag(), ClrWF, CopyRgn, CreateEmptyRgnPublic(), DecPaintCount(), DeleteMaybeSpecialRgn(), GETPTI, ghrgnInv2, HRGN_FULL, tagWND::hrgnUpdate, IncPaintCount(), NEEDSPAINT, NULL, PtiCurrent, RDW_IGNOREUPDATEDIRTY, SetHungFlag(), SetWF, SubtractRgn, TestWF, TRUE, UnionRgn, VOID(), WEFTRANSPARENT, WFDONTVALIDATE, WFINTERNALPAINT, WFNONCPAINT, WFPIXIEHACK, WFREDRAWIFHUNG, WFSENDERASEBKGND, WFSENDNCPAINT, WFUPDATEDIRTY, WFWIN31COMPAT, and WFWMPAINTSENT.

Referenced by InternalInvalidate2(), and xxxEndPaint().

00788 { 00789 BOOL fNeededPaint; 00790 00791 fNeededPaint = NEEDSPAINT(pwnd); 00792 00793 if (flags & (RDW_INVALIDATE | RDW_INTERNALPAINT | RDW_ERASE | RDW_FRAME)) { 00794 00795 if (flags & RDW_INTERNALPAINT) 00796 SetWF(pwnd, WFINTERNALPAINT); 00797 00798 if (flags & RDW_INVALIDATE) { 00799 00800 /* 00801 * Make sure that the NONCPAINT bit is cleared 00802 * to ensure that the caption will redraw when we update. 00803 */ 00804 ClrWF(pwnd, WFNONCPAINT); 00805 00806 /* 00807 * If another app is invalidating this window, then set the 00808 * UPDATEDIRTY flag. 00809 * 00810 * Solves critical section where thread A draws, then validates, 00811 * but thread B goes and invalidates before A validates. 00812 * See comments later in RDW_VALIDATE code. 00813 */ 00814 if (GETPTI(pwnd) != PtiCurrent()) { 00815 00816 SetWF(pwnd, WFUPDATEDIRTY); 00817 00818 /* 00819 * Paint order problem, see paint.c 00820 */ 00821 if (TestWF(pwnd, WFWMPAINTSENT)) { 00822 SetWF(pwnd, WFDONTVALIDATE); 00823 } 00824 } 00825 00826 /* 00827 * BACKWARD COMPATIBILITY HACK 00828 * 00829 * In 3.0, InvalidateRect(pwnd, NULL, FALSE) would always 00830 * clear the WFSENDERASEBKGND flag, even if it was previously 00831 * set from an InvalidateRect(pwnd, NULL, TRUE). This is bogus, 00832 * because it can cause you to "lose" WM_ERASEBKGND messages, but 00833 * AttachMate Extra (and maybe other apps) depend on this behavior. 00834 */ 00835 if ((hrgn == HRGN_FULL) && !TestWF(pwnd, WFWIN31COMPAT)) 00836 ClrWF(pwnd, WFSENDERASEBKGND); 00837 00838 if (flags & RDW_ERASE) 00839 SetWF(pwnd, WFSENDERASEBKGND); 00840 00841 if ((flags & (RDW_FRAME | RDW_ERASE)) && !TestWF(pwnd, WEFTRANSPARENT)) 00842 SetHungFlag(pwnd, WFREDRAWIFHUNG); 00843 00844 if (flags & RDW_FRAME) 00845 SetWF(pwnd, WFSENDNCPAINT); 00846 00847 /* 00848 * If window is already completely invalidated, 00849 * no need to do any further invalidation. 00850 */ 00851 if (pwnd->hrgnUpdate != HRGN_FULL) { 00852 00853 if (hrgn == HRGN_FULL) { 00854 InvalidateAll: 00855 DeleteMaybeSpecialRgn(pwnd->hrgnUpdate); 00856 pwnd->hrgnUpdate = HRGN_FULL; 00857 00858 } else { 00859 if (pwnd->hrgnUpdate == NULL) { 00860 00861 if (!(pwnd->hrgnUpdate = CreateEmptyRgnPublic())) 00862 goto InvalidateAll; 00863 00864 if (CopyRgn(pwnd->hrgnUpdate, hrgn) == ERROR) 00865 goto InvalidateAll; 00866 00867 } else { // pwnd->hrgnUpdate is a region 00868 00869 if (UnionRgn(pwnd->hrgnUpdate, 00870 pwnd->hrgnUpdate, 00871 hrgn) == ERROR) { 00872 00873 goto InvalidateAll; 00874 } 00875 } 00876 } 00877 } 00878 } 00879 00880 if (!fNeededPaint && NEEDSPAINT(pwnd)) 00881 IncPaintCount(pwnd); 00882 00883 } else if (flags & (RDW_VALIDATE | RDW_NOINTERNALPAINT | RDW_NOERASE | RDW_NOFRAME)) { 00884 00885 /* 00886 * Validation: 00887 * 00888 * Do not allow validation if this window has been invalidated from 00889 * another process - because this window may be validating just 00890 * after another process invalidated, thereby validating invalid 00891 * bits. 00892 * 00893 * Sometimes applications draw stuff, then validate what they drew. 00894 * If another app invalidated some area during the drawing operation, 00895 * then it will need another paint message. 00896 * 00897 * This wouldn't be necessary if people validated BEFORE they drew. 00898 */ 00899 if (TestWF(pwnd, WFUPDATEDIRTY) && !(flags & RDW_IGNOREUPDATEDIRTY)) 00900 return; 00901 00902 if (flags & RDW_NOINTERNALPAINT) 00903 ClrWF(pwnd, WFINTERNALPAINT); 00904 00905 if (flags & RDW_VALIDATE) { 00906 00907 if (flags & RDW_NOERASE) 00908 ClrWF(pwnd, WFSENDERASEBKGND); 00909 00910 if (flags & RDW_NOFRAME) { 00911 ClrWF(pwnd, WFSENDNCPAINT); 00912 ClrWF(pwnd, WFPIXIEHACK); 00913 } 00914 00915 if (flags & (RDW_NOERASE | RDW_NOFRAME)) 00916 ClearHungFlag(pwnd, WFREDRAWIFHUNG); 00917 00918 if (pwnd->hrgnUpdate != NULL) { 00919 00920 /* 00921 * If WFSENDNCPAINT is set, then all or part of the 00922 * window border still needs to be drawn. This means 00923 * that we must subtract off the client rectangle only. 00924 * Convert HRGN_FULL to the client region. 00925 */ 00926 if (TestWF(pwnd, WFSENDNCPAINT) && (hrgn == HRGN_FULL)) { 00927 hrgn = ghrgnInv2; 00928 CalcWindowRgn(pwnd, hrgn, TRUE); 00929 } 00930 00931 if (hrgn == HRGN_FULL) { 00932 ValidateAll: 00933 00934 /* 00935 * We're validating the entire window. Just 00936 * blow away the update region. 00937 */ 00938 DeleteMaybeSpecialRgn(pwnd->hrgnUpdate); 00939 pwnd->hrgnUpdate = (HRGN)NULL; 00940 00941 /* 00942 * No need to erase the background... 00943 */ 00944 ClrWF(pwnd, WFSENDERASEBKGND); 00945 ClearHungFlag(pwnd, WFREDRAWIFHUNG); 00946 00947 } else { 00948 00949 /* 00950 * Subtracting some region from pwnd->hrgnUpdate. 00951 * Be sure pwnd->hrgnUpdate is a real region. 00952 */ 00953 if (pwnd->hrgnUpdate == HRGN_FULL) { 00954 00955 /* 00956 * If the WFSENDNCPAINT bit is set, 00957 * the update region must include the entire window 00958 * area. Otherwise it includes only the client. 00959 */ 00960 pwnd->hrgnUpdate = CreateEmptyRgnPublic(); 00961 00962 /* 00963 * If the creation failed, punt by 00964 * invalidating the entire window. 00965 */ 00966 if (pwnd->hrgnUpdate == NULL) 00967 goto InvalidateAll; 00968 00969 if (CalcWindowRgn(pwnd, 00970 pwnd->hrgnUpdate, 00971 !(TestWF(pwnd, WFSENDNCPAINT))) == ERROR) { 00972 00973 goto InvalidateAll; 00974 } 00975 } 00976 00977 /* 00978 * Subtract off the region. If we get an error, 00979 * punt by invalidating everything. If the 00980 * region becomes empty, then validate everything. 00981 */ 00982 switch (SubtractRgn(pwnd->hrgnUpdate, 00983 pwnd->hrgnUpdate, 00984 hrgn)) { 00985 case ERROR: 00986 goto InvalidateAll; 00987 00988 case NULLREGION: 00989 goto ValidateAll; 00990 } 00991 } 00992 } 00993 } 00994 00995 if (fNeededPaint && !NEEDSPAINT(pwnd)) 00996 DecPaintCount(pwnd); 00997 } 00998 }

UINT InternalMapVirtualKeyEx UINT  wCode,
UINT  wType,
PKBDTABLES  pKbdTbl
 

Definition at line 231 of file xlate.c.

References aVkNumpad, LOBYTE, NULL, PBYTE, UINT, and USHORT.

Referenced by _GetKeyNameText(), AdjustPushState(), and NtUserMapVirtualKeyEx().

00235 { 00236 PVK_TO_WCHARS1 pVK; 00237 PVK_TO_WCHAR_TABLE pVKT; 00238 UINT VkRet = 0; 00239 USHORT usScanCode; 00240 PVSC_VK pVscVk; 00241 PBYTE pVkNumpad; 00242 00243 switch (wType) { 00244 case 0: 00245 00246 /* 00247 * Convert Virtual Key (wCode) to Scan Code 00248 */ 00249 if ((wCode >= VK_SHIFT) && (wCode <= VK_MENU)) { 00250 00251 /* 00252 * Convert ambiguous Shift/Control/Alt keys to left-hand keys 00253 */ 00254 wCode = (UINT)((wCode - VK_SHIFT) * 2 + VK_LSHIFT); 00255 } 00256 00257 /* 00258 * Scan through the table that maps Virtual Scancodes to Virtual Keys 00259 * for non-extended keys. 00260 */ 00261 for (usScanCode = 0; usScanCode < pKbdTbl->bMaxVSCtoVK; usScanCode++) { 00262 if ((UINT)LOBYTE(pKbdTbl->pusVSCtoVK[usScanCode]) == wCode) { 00263 return usScanCode & 0xFF; 00264 } 00265 } 00266 00267 /* 00268 * Scan through the table that maps Virtual Scancodes to Virtual Keys 00269 * for extended keys. 00270 */ 00271 for (pVscVk = pKbdTbl->pVSCtoVK_E0; pVscVk->Vk; pVscVk++) { 00272 if ((UINT)LOBYTE(pVscVk->Vk) == wCode) { 00273 return (UINT)pVscVk->Vsc; 00274 } 00275 } 00276 00277 /* 00278 * There was no match: maybe the Virtual Key can only be generated 00279 * with Numlock on. Scan through aVkNumpad[] to determine scancode. 00280 */ 00281 for (pVkNumpad = aVkNumpad; *pVkNumpad != 0; pVkNumpad++) { 00282 if ((UINT)(*pVkNumpad) == wCode) { 00283 return (UINT)(pVkNumpad - aVkNumpad) + SCANCODE_NUMPAD_FIRST; 00284 } 00285 } 00286 00287 return 0; // No match found! 00288 00289 case 1: 00290 case 3: 00291 00292 /* 00293 * Convert Scan Code (wCode) to Virtual Key, disregarding modifier keys 00294 * and NumLock key etc. Returns 0 for no corresponding Virtual Key 00295 */ 00296 if (wCode < (UINT)(pKbdTbl->bMaxVSCtoVK)) { 00297 VkRet = (UINT)LOBYTE(pKbdTbl->pusVSCtoVK[wCode]); 00298 } else { 00299 /* 00300 * Scan the E0 prefix table for a match 00301 */ 00302 for (pVscVk = pKbdTbl->pVSCtoVK_E0; pVscVk->Vk; pVscVk++) { 00303 if ((UINT)pVscVk->Vsc == wCode) { 00304 VkRet = (UINT)LOBYTE(pVscVk->Vk); 00305 break; 00306 } 00307 } 00308 } 00309 00310 if ((wType == 1) && (VkRet >= VK_LSHIFT) && (VkRet <= VK_RMENU)) { 00311 00312 /* 00313 * Convert left/right Shift/Control/Alt keys to ambiguous keys 00314 * (neither left nor right) 00315 */ 00316 VkRet = (UINT)((VkRet - VK_LSHIFT) / 2 + VK_SHIFT); 00317 } 00318 00319 if (VkRet == 0xFF) { 00320 VkRet = 0; 00321 } 00322 return VkRet; 00323 00324 case 2: 00325 00326 /* 00327 * Bogus Win3.1 functionality: despite SDK documenation, return uppercase for 00328 * VK_A through VK_Z 00329 */ 00330 if ((wCode >= (WORD)'A') && (wCode <= (WORD)'Z')) { 00331 return wCode; 00332 } 00333 00334 // HIWORD is no loner the wchar, due to app compat problems #287134 00335 // We should not return the wchar from pti->wchInjected that cached 00336 // at GetMessage time. 00337 // (delete this commented-out section by end of March 1999 - IanJa) 00338 // 00339 // if (LOWORD(wCode) == VK_PACKET) { 00340 // return HIWORD(wCode); 00341 // } 00342 00343 /* 00344 * Convert Virtual Key (wCode) to ANSI. 00345 * Search each Shift-state table in turn, looking for the Virtual Key. 00346 */ 00347 for (pVKT = pKbdTbl->pVkToWcharTable; pVKT->pVkToWchars != NULL; pVKT++) { 00348 pVK = pVKT->pVkToWchars; 00349 while (pVK->VirtualKey != 0) { 00350 if ((UINT)pVK->VirtualKey == wCode) { 00351 00352 /* 00353 * Match found: return the unshifted character 00354 */ 00355 if (pVK->wch[0] == WCH_DEAD) { 00356 00357 /* 00358 * It is a dead character: the next entry contains its 00359 * value. Set the high bit to indicate dead key 00360 * (undocumented behaviour) 00361 */ 00362 pVK = (PVK_TO_WCHARS1)((PBYTE)pVK + pVKT->cbSize); 00363 return pVK->wch[0] | (UINT)0x80000000; 00364 } else if (pVK->wch[0] == WCH_NONE) { 00365 return 0; // 9013 00366 } 00367 if (pVK->wch[0] == WCH_NONE) { 00368 return 0; 00369 } 00370 return pVK->wch[0]; 00371 } 00372 pVK = (PVK_TO_WCHARS1)((PBYTE)pVK + pVKT->cbSize); 00373 } 00374 } 00375 } 00376 00377 /* 00378 * Can't find translation, or wType was invalid 00379 */ 00380 return 0; 00381 }

PCLS InternalRegisterClassEx LPWNDCLASSEX  lpwndcls,
WORD  fnid,
DWORD  flags
 

Definition at line 244 of file class.c.

References _InnerGetClassPtr(), AllocateUnicodeString(), BOOL, CBFNID, CheckCritIn, _CLIENTINFO::CI_flags, CI_REGISTERCLASSES, ClassAlloc(), ClassFree(), COMMON_WNDCLASS, CSF_ANSIPROC, CSF_SERVERSIDEPROC, CSF_SYSTEMCLASS, CSF_WIN40COMPAT, CSF_WOWCLASS, tagTHREADINFO::dwExpWinVer, DWORD, FALSE, FindClassAtom, gpclsList, hModuleWin, IS_PTR, L, LockDesktop, MapClientToServerPfn(), NULL, tagTHREADINFO::pClientInfo, tagCLS::pclsNext, tagPROCESSINFO::pclsPrivateList, tagPROCESSINFO::pclsPublicList, tagTHREADINFO::ppi, PtiCurrent, PTR_TO_ID, tagTHREADINFO::rpdesk, tagCLS::rpdeskParent, RtlInitUnicodeString(), RtlIntegerToChar(), RtlUnicodeStringToAnsiString(), tagTHREADINFO::TIF_flags, TIF_SYSTEMTHREAD, Unlock, UnlockDesktop, UserAddAtom(), UserDeleteAtom(), USHORT, ValidateAndLockCursor(), VER40, WND, and WNDPROC_PWND.

Referenced by LW_RegisterWindows(), and xxxRegisterClassEx().

00249 { 00250 BOOL fIs40Compat; 00251 ULONG_PTR dwT; 00252 PCLS pcls; 00253 LPWSTR pszT1; 00254 ATOM atomT; 00255 PTHREADINFO ptiCurrent; 00256 HANDLE hModule; 00257 PDESKTOP pdesk; 00258 ULONG cch; 00259 UNICODE_STRING UString; 00260 ANSI_STRING AString; 00261 00262 /* 00263 * NOTE -- lpszClassName and lpszMenuName in the wndclass may be client-side 00264 * pointers. Use of those fields must be protected in try blocks. 00265 */ 00266 CheckCritIn(); 00267 00268 ptiCurrent = PtiCurrent(); 00269 00270 /* 00271 * Don't allow 4.0 apps to register a class using hModuleWin 00272 * LATER GerardoB: Our client side classes use hmodUser (USER32) while 00273 * our server side classes use hWinInstance (WIN32K). We should change 00274 * CreateThreadInfo and LW_RegisterWindows so all classes use hModUser. 00275 */ 00276 hModule = cczlpwndcls->hInstance; 00277 if (!(CSF_flags & (CSF_SYSTEMCLASS | CSF_SERVERSIDEPROC)) 00278 && (hModule == hModuleWin) 00279 && (LOWORD(ptiCurrent->dwExpWinVer) >= VER40)) { 00280 00281 RIPERR0(ERROR_INVALID_PARAMETER, RIP_WARNING, "InternalRegisterClassEx: Invalid hInstance (Cannot use system's hInstance)"); 00282 return NULL; 00283 } 00284 00285 00286 /* 00287 * As of NT 4.0 we no longer honor CS_BYTEALIGNCLIENT or CS_BYTEALIGNWINDOW 00288 */ 00289 if (cczlpwndcls->style & (CS_BYTEALIGNCLIENT | CS_BYTEALIGNWINDOW)) { 00290 RIPMSG0(RIP_VERBOSE, "CS_BYTEALIGNCLIENT and CS_BYTEALIGNWINDOW styles no longer honored."); 00291 } 00292 00293 /* 00294 * Does this class exist as a private class? If so, fail. 00295 */ 00296 atomT = FindClassAtom(cczlpwndcls->lpszClassName); 00297 00298 if (atomT != 0 && !(CSF_flags & CSF_SERVERSIDEPROC)) { 00299 /* 00300 * First check private classes. If already exists, return error. 00301 */ 00302 if (_InnerGetClassPtr(atomT, &ptiCurrent->ppi->pclsPrivateList, 00303 hModule) != NULL) { 00304 RIPERR1(ERROR_CLASS_ALREADY_EXISTS, RIP_VERBOSE, "RegisterClass: Class already exists %lx", (DWORD)atomT); 00305 return NULL; 00306 } 00307 00308 /* 00309 * Now only check public classes if CS_GLOBALCLASS is set. If it 00310 * isn't set, then this will allow an application to re-register 00311 * a private class to take precedence over a public class. 00312 */ 00313 if (cczlpwndcls->style & CS_GLOBALCLASS) { 00314 if (_InnerGetClassPtr(atomT, &ptiCurrent->ppi->pclsPublicList, NULL) != NULL) { 00315 RIPERR0(ERROR_CLASS_ALREADY_EXISTS, RIP_VERBOSE, "RegisterClass: Global Class already exists"); 00316 return NULL; 00317 } 00318 } 00319 } 00320 00321 /* 00322 * Alloc space for the class. 00323 */ 00324 if (ptiCurrent->TIF_flags & TIF_SYSTEMTHREAD) { 00325 pdesk = NULL; 00326 } else { 00327 pdesk = ptiCurrent->rpdesk; 00328 } 00329 pcls = (PCLS)ClassAlloc(pdesk, sizeof(CLS) + cczlpwndcls->cbClsExtra + (CSF_flags & CSF_WOWCLASS ? sizeof(WC):0)); 00330 if (pcls == NULL) { 00331 return NULL; 00332 } 00333 00334 LockDesktop(&pcls->rpdeskParent, pdesk, LDL_CLS_DESKPARENT1, (ULONG_PTR)pcls); 00335 pcls->pclsBase = pcls; 00336 00337 /* 00338 * Copy over the shared part of the class structure. 00339 */ 00340 UserAssert(FIELD_OFFSET(WNDCLASSEX, style) == FIELD_OFFSET(COMMON_WNDCLASS, style)); 00341 RtlCopyMemory(&pcls->style, &(cczlpwndcls->style), 00342 sizeof(COMMON_WNDCLASS) - FIELD_OFFSET(COMMON_WNDCLASS, style)); 00343 00344 /* 00345 * Copy CSF_SERVERSIDEPROC, CSF_ANSIPROC (etc.) flags 00346 */ 00347 pcls->CSF_flags = LOWORD(CSF_flags); 00348 pcls->fnid = fnid; 00349 if (fnid) { 00350 CBFNID(fnid) = (WORD)(pcls->cbwndExtra + sizeof(WND)); 00351 00352 if (!(pcls->CSF_flags & CSF_SERVERSIDEPROC) && ptiCurrent->pClientInfo != NULL) { 00353 /* 00354 * Clear the bit so new threads in this process 00355 * won't bother to reregister the client-side USER classes. 00356 */ 00357 ptiCurrent->pClientInfo->CI_flags &= ~CI_REGISTERCLASSES; 00358 } 00359 } 00360 00361 /* 00362 * If this wndproc happens to be a client wndproc stub for a server 00363 * wndproc, then remember the server wndproc! This should be rare: why 00364 * would an application re-register a class that isn't "subclassed"? 00365 */ 00366 if (!(pcls->CSF_flags & CSF_SERVERSIDEPROC)) { 00367 dwT = MapClientToServerPfn((ULONG_PTR)pcls->lpfnWndProc); 00368 if (dwT != 0) { 00369 pcls->CSF_flags |= CSF_SERVERSIDEPROC; 00370 pcls->CSF_flags &= ~CSF_ANSIPROC; 00371 pcls->lpfnWndProc = (WNDPROC_PWND)dwT; 00372 } 00373 } 00374 00375 /* 00376 * Win95 compatible validation. 00377 * 00378 * hbrBackground was validated by GDI in the client side 00379 * NULL hInstances are mapped to GetModuleHandle(NULL) in the client 00380 * side 00381 */ 00382 00383 fIs40Compat = (CSF_flags & CSF_WIN40COMPAT) != 0; 00384 00385 if (!ValidateAndLockCursor(&pcls->spcur, fIs40Compat)) { 00386 goto ValidateError1; 00387 } 00388 00389 if (!ValidateAndLockCursor(&pcls->spicn, fIs40Compat)) { 00390 goto ValidateError2; 00391 } 00392 00393 if (!ValidateAndLockCursor(&pcls->spicnSm, fIs40Compat)) { 00394 goto ValidateError3; 00395 } 00396 00397 /* 00398 * Add the class name to the atom table. 00399 */ 00400 00401 if (IS_PTR(cczlpwndcls->lpszClassName)) 00402 atomT = UserAddAtom(cczlpwndcls->lpszClassName, FALSE); 00403 else 00404 atomT = PTR_TO_ID(cczlpwndcls->lpszClassName); 00405 00406 if (atomT == 0) { 00407 goto AtomError; 00408 } 00409 pcls->atomClassName = atomT; 00410 00411 /* 00412 * Make an ANSI version of the class name to optimize 00413 * GetClassNameA for WOW. 00414 */ 00415 if (IS_PTR(cczlpwndcls->lpszClassName)) { 00416 try { 00417 RtlInitUnicodeString(&UString, cczlpwndcls->lpszClassName); 00418 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00419 goto MemError2; 00420 } 00421 #ifdef FE_SB // InternalRegisterClassEx() 00422 cch = UString.Length + 1; 00423 #else 00424 cch = UString.Length / sizeof(WCHAR) + 1; 00425 #endif // FE_SB 00426 } else { 00427 cch = 7; // 1 char for '#', 5 for '65536'. 00428 } 00429 00430 /* 00431 * Allocate the ANSI name buffer and convert the unicode name 00432 * to ANSI. 00433 */ 00434 pcls->lpszAnsiClassName = (LPSTR)ClassAlloc(pdesk, cch); 00435 if (pcls->lpszAnsiClassName == NULL) { 00436 goto MemError2; 00437 } 00438 00439 /* 00440 * Form the ANSI class name. 00441 */ 00442 if (IS_PTR(cczlpwndcls->lpszClassName)) { 00443 00444 /* 00445 * Class name is a string. 00446 */ 00447 AString.Length = 0; 00448 AString.MaximumLength = (USHORT)cch; 00449 AString.Buffer = pcls->lpszAnsiClassName; 00450 try { 00451 RtlUnicodeStringToAnsiString(&AString, &UString, FALSE); 00452 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00453 goto MemError3; 00454 } 00455 } else { 00456 00457 /* 00458 * Class name is an integer atom. 00459 */ 00460 pcls->lpszAnsiClassName[0] = L'#'; 00461 RtlIntegerToChar(PTR_TO_ID(cczlpwndcls->lpszClassName), 10, cch - 1, 00462 &pcls->lpszAnsiClassName[1]); 00463 } 00464 00465 /* 00466 * Make local copy of menu name. 00467 */ 00468 pszT1 = pcls->lpszMenuName; 00469 00470 if (pszT1 != NULL) { 00471 if (IS_PTR(pszT1)) { 00472 try { 00473 RtlInitUnicodeString(&UString, pszT1); 00474 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 00475 goto MemError3; 00476 } 00477 if (UString.Length == 0) { 00478 00479 /* 00480 * app passed an empty string for the name 00481 */ 00482 pcls->lpszMenuName = NULL; 00483 } else { 00484 UNICODE_STRING strMenuName; 00485 00486 /* 00487 * Alloc space for the Menu Name. 00488 */ 00489 if (!AllocateUnicodeString(&strMenuName, &UString)) { 00490 MemError3: 00491 ClassFree(pdesk, pcls->lpszAnsiClassName); 00492 MemError2: 00493 UserDeleteAtom(pcls->atomClassName); 00494 AtomError: 00495 Unlock(&pcls->spicnSm); 00496 ValidateError3: 00497 Unlock(&pcls->spicn); 00498 ValidateError2: 00499 Unlock(&pcls->spcur); 00500 ValidateError1: 00501 UnlockDesktop(&pcls->rpdeskParent, LDU_CLS_DESKPARENT1, (ULONG_PTR)pcls); 00502 ClassFree(pdesk, pcls); 00503 return NULL; 00504 } 00505 00506 pcls->lpszMenuName = strMenuName.Buffer; 00507 } 00508 } 00509 } 00510 00511 if ((CSF_flags & CSF_SERVERSIDEPROC) || (pcls->style & CS_GLOBALCLASS)) { 00512 if (pcls->CSF_flags & CSF_SYSTEMCLASS) { 00513 pcls->pclsNext = gpclsList; 00514 gpclsList = pcls; 00515 } else { 00516 pcls->pclsNext = ptiCurrent->ppi->pclsPublicList; 00517 ptiCurrent->ppi->pclsPublicList = pcls; 00518 } 00519 } else { 00520 pcls->pclsNext = ptiCurrent->ppi->pclsPrivateList; 00521 ptiCurrent->ppi->pclsPrivateList = pcls; 00522 } 00523 00524 /* 00525 * Because Memory is allocated with ZEROINIT, the pcls->cWndReferenceCount 00526 * field is automatically initialised to zero. 00527 */ 00528 00529 return pcls; 00530 }

HANDLE InternalRemoveProp PWND  pwnd,
LPWSTR  pszKey,
BOOL  fInternal
 

Definition at line 98 of file kernel/winprop.c.

References _FindProp(), tagPROPLIST::aprop, tagPROP::hData, tagPROPLIST::iFirstFree, NULL, and tagWND::ppropList.

Referenced by _DdeSetQualityOfService(), _SetWindowContextHelpId(), DestroyWindowSmIcon(), MESSAGECALL(), NtUserRemoveProp(), RemoveRedirectionBitmap(), UnlinkConv(), UserAssociateHwnd(), and xxxFreeWindow().

00102 { 00103 PPROP pprop; 00104 PPROP ppropLast; 00105 HANDLE hT; 00106 00107 /* 00108 * Find the property to be removed. 00109 */ 00110 pprop = _FindProp(pwnd, pszKey, fInternal); 00111 if (pprop == NULL) 00112 return NULL; 00113 00114 /* 00115 * Remember what it was pointing at. 00116 */ 00117 hT = pprop->hData; 00118 00119 /* 00120 * Move the property at the end of the list into this slot. 00121 */ 00122 pwnd->ppropList->iFirstFree--; 00123 ppropLast = &pwnd->ppropList->aprop[pwnd->ppropList->iFirstFree]; 00124 *pprop = *ppropLast; 00125 RtlZeroMemory(ppropLast, sizeof(*ppropLast)); 00126 00127 return hT; 00128 }

BOOL InternalSetClipboardData PWINDOWSTATION  pwinsta,
UINT  format,
HANDLE  hData,
BOOL  fGlobalHandle,
BOOL  fIncSerialNumber
 

Definition at line 1007 of file ntuser/kernel/clipbrd.c.

References BOOL, CCHFORMATNAME, CLIP, tagWINDOWSTATION::cNumClipFormats, DWORD, FALSE, tagWINDOWSTATION::fClipboardChanged, tagCLIP::fGlobalHandle, FindClipFormat(), tagWINDOWSTATION::fInDelayedRendering, tagCLIP::fmt, GETPTI, tagCLIP::hData, tagWINDOWSTATION::iClipSequenceNumber, tagWINDOWSTATION::iClipSerialNumber, NULL, tagWINDOWSTATION::pClipBase, tagWINDOWSTATION::ptiClipLock, PtiCurrent, tagWINDOWSTATION::spwndClipOwner, TRUE, UserAddAtom(), UserGetAtomName(), and UT_FreeCBFormat().

Referenced by _SetClipboardData(), MungeClipData(), and PasteScreenPalette().

01013 { 01014 PCLIP pClip; 01015 WCHAR achFormatName[CCHFORMATNAME]; 01016 01017 /* 01018 * Just check for pwinsta->ptiClipLock being NULL instead of checking 01019 * against PtiCurrent because an app needs to call SetClipboardData if 01020 * he's rendering data while another app has the clipboard open. 01021 */ 01022 if ((pwinsta->ptiClipLock == NULL) || (fmt == 0)) { 01023 RIPERR0(ERROR_CLIPBOARD_NOT_OPEN, RIP_WARNING, "SetClipboardData: Clipboard not open"); 01024 return FALSE; 01025 } 01026 01027 if ((pClip = FindClipFormat(pwinsta, fmt)) != NULL) { 01028 01029 /* 01030 * If data already exists, free it before we replace it. 01031 */ 01032 UT_FreeCBFormat(pClip); 01033 01034 } else { 01035 01036 if (pwinsta->pClipBase == NULL) { 01037 pClip = (PCLIP)UserAllocPool(sizeof(CLIP), TAG_CLIPBOARD); 01038 } else { 01039 DWORD dwSize = sizeof(CLIP) * pwinsta->cNumClipFormats; 01040 01041 pClip = (PCLIP)UserReAllocPool(pwinsta->pClipBase, 01042 dwSize, 01043 dwSize + sizeof(CLIP), 01044 TAG_CLIPBOARD); 01045 } 01046 01047 /* 01048 * Out of memory... return. 01049 */ 01050 if (pClip == NULL) { 01051 RIPMSG0(RIP_WARNING, "SetClipboardData: Out of memory"); 01052 return FALSE; 01053 } 01054 01055 /* 01056 * Just in case the data moved 01057 */ 01058 pwinsta->pClipBase = pClip; 01059 01060 /* 01061 * Increment the reference count of this atom format so that if 01062 * the application frees this atom we don't get stuck with a 01063 * bogus atom. We call DeleteAtom in the EmptyClipboard() code, 01064 * which decrements this count when we're done with this clipboard 01065 * data. 01066 */ 01067 if (UserGetAtomName((ATOM)fmt, achFormatName, CCHFORMATNAME) != 0) 01068 UserAddAtom(achFormatName, FALSE); 01069 01070 /* 01071 * Point to the new entry in the clipboard. 01072 */ 01073 pClip += pwinsta->cNumClipFormats++; 01074 pClip->fmt = fmt; 01075 } 01076 01077 /* 01078 * Start updating the new entry in the clipboard. 01079 */ 01080 pClip->hData = hData; 01081 pClip->fGlobalHandle = fGlobalHandle; 01082 01083 if (fIncSerialNumber) 01084 pwinsta->fClipboardChanged = TRUE; 01085 01086 if (fIncSerialNumber && !pwinsta->fInDelayedRendering) { 01087 pwinsta->iClipSequenceNumber++; 01088 } 01089 01090 /* 01091 * If the thread didn't bother emptying the clipboard before 01092 * writing to it, change the clipboard serial number 01093 * so that the client-side clipboard caches of all the 01094 * processes will get flushed on the next OpenClipboard. 01095 */ 01096 if ((pwinsta->spwndClipOwner == NULL) || 01097 (GETPTI(pwinsta->spwndClipOwner) != PtiCurrent())) { 01098 01099 RIPMSG0(RIP_VERBOSE, "Clipboard: SetClipboardData called without emptying clipboard"); 01100 01101 if (fIncSerialNumber) 01102 pwinsta->iClipSerialNumber++; 01103 } 01104 01105 return TRUE; 01106 }

BOOL InternalSetProp PWND  pwnd,
LPWSTR  pszKey,
HANDLE  hData,
DWORD  dwFlags
 

Definition at line 39 of file kernel/winprop.c.

References _FindProp(), tagPROP::atomKey, BOOL, CreateProp(), dwFlags, FALSE, tagPROP::fs, tagPROP::hData, IS_PTR, NULL, PROPF_INTERNAL, PTR_TO_ID, and TRUE.

Referenced by _DdeSetQualityOfService(), _SetWindowContextHelpId(), AddConvProp(), CkptRestore(), CreateRedirectionBitmap(), MESSAGECALL(), NtUserSetAppImeLevel(), NtUserSetProp(), UnlinkConv(), UserAssociateHwnd(), xxxCreateWindowSmIcon(), and xxxDWP_SetIcon().

00044 { 00045 PPROP pprop; 00046 00047 if (pszKey == NULL) { 00048 RIPERR0(ERROR_INVALID_PARAMETER, 00049 RIP_WARNING, 00050 "Invalid parameter \"pszKey\" (NULL) to InternalSetProp"); 00051 00052 return FALSE; 00053 } 00054 00055 /* 00056 * If no property list exists for this window, create one. 00057 */ 00058 pprop = _FindProp(pwnd, pszKey, dwFlags & PROPF_INTERNAL); 00059 if (pprop == NULL) { 00060 00061 /* 00062 * pszKey must be an atom within the server. 00063 */ 00064 UserAssert(!IS_PTR(pszKey)); 00065 00066 /* 00067 * CreateProp allocates the property and links it into the window's 00068 * property list. 00069 */ 00070 pprop = CreateProp(pwnd); 00071 if (pprop == NULL) 00072 return FALSE; 00073 00074 pprop->atomKey = PTR_TO_ID(pszKey); 00075 pprop->fs = (WORD)dwFlags; 00076 } 00077 00078 pprop->hData = hData; 00079 00080 return TRUE; 00081 }

UINT_PTR InternalSetTimer PWND  pwnd,
UINT_PTR  nIDEvent,
UINT  dwElapse,
TIMERPROC_PWND  pTimerFunc,
UINT  flags
 

Definition at line 225 of file timers.c.

References CheckCritIn, tagTIMER::cmsCountdown, tagTIMER::cmsRate, cTimerId, DecTimerCount(), ELAPSED_MAX, FALSE, FindTimer(), tagTIMER::flags, gbMasterTimerSet, GETPTI, gptiRit, gptmrFirst, gptmrMaster, HMAllocObject(), HMFreeObject(), KeSetTimer(), Lock, tagTIMER::nID, NULL, tagTIMER::pfn, tagTIMER::pti, tagTIMER::ptiOptCreator, tagTIMER::ptmrNext, tagTIMER::ptmrPrev, tagTIMER::spwnd, TIF_16BIT, tagTHREADINFO::TIF_flags, TIMER, TIMERID_MAX, TIMERID_MIN, TRUE, TYPE_TIMER, and UINT.

Referenced by _SetSystemTimer(), _SetTimer(), _UserSoundSentryWorker(), AccessTimeOutReset(), FilterKeys(), FKActivationTimer(), IncrementRedirectedCount(), ProcessKeyboardInput(), ResetMouseHover(), SetAppStarting(), SetJournalTimer(), SetTooltipTimer(), SoundSentryTimer(), StartFade(), StartTimers(), ToggleKeys(), UserSetTimer(), xxxFKAcceptanceDelayTimer(), xxxFKRepeatRateTimer(), xxxFlashWindow(), xxxMKMouseMove(), xxxMKMoveAccelCursorTimer(), xxxTrackMouseMove(), zzzAnimateCursor(), and zzzUpdateCursorImage().

00231 { 00232 LARGE_INTEGER liT = {1, 0}; 00233 PTIMER ptmr; 00234 PTHREADINFO ptiCurrent; 00235 00236 CheckCritIn(); 00237 00238 /* 00239 * Assert if someone tries to set a timer after InitiateWin32kCleanup 00240 * killed the RIT. 00241 */ 00242 UserAssert(gptiRit != NULL); 00243 00244 /* 00245 * 1.0 compatibility weirdness. Also, don't allow negative elapse times 00246 * because this'll cause ScanTimers() to generate negative elapse times 00247 * between timers. 00248 */ 00249 if ((dwElapse == 0) || (dwElapse > ELAPSED_MAX)) 00250 dwElapse = 1; 00251 00252 /* 00253 * Attempt to first locate the timer, then create a new one 00254 * if one isn't found. 00255 */ 00256 if ((ptmr = FindTimer(pwnd, nIDEvent, flags, FALSE)) == NULL) { 00257 00258 /* 00259 * Not found. Create a new one. 00260 */ 00261 ptmr = (PTIMER)HMAllocObject(NULL, NULL, TYPE_TIMER, sizeof(TIMER)); 00262 if (ptmr == NULL) { 00263 return 0; 00264 } 00265 00266 ptmr->spwnd = NULL; 00267 00268 if (pwnd == NULL) { 00269 00270 WORD timerIdInitial = cTimerId; 00271 00272 /* 00273 * Pick a unique, unused timer ID. 00274 */ 00275 do { 00276 00277 if (--cTimerId <= TIMERID_MIN) 00278 cTimerId = TIMERID_MAX; 00279 00280 if (cTimerId == timerIdInitial) { 00281 00282 /* 00283 * Flat out of timers bud. 00284 */ 00285 HMFreeObject(ptmr); 00286 return 0; 00287 } 00288 00289 } while (FindTimer(NULL, cTimerId, flags, FALSE) != NULL); 00290 00291 ptmr->nID = (UINT)cTimerId; 00292 00293 } else { 00294 ptmr->nID = nIDEvent; 00295 } 00296 00297 /* 00298 * Link the new timer into the front of the list. 00299 * Handily this works even when gptmrFirst is NULL. 00300 */ 00301 ptmr->ptmrNext = gptmrFirst; 00302 ptmr->ptmrPrev = NULL; 00303 if (gptmrFirst) 00304 gptmrFirst->ptmrPrev = ptmr; 00305 gptmrFirst = ptmr; 00306 00307 } else { 00308 00309 /* 00310 * If this timer was just about to be processed, 00311 * decrement cTimersReady since we're resetting it. 00312 */ 00313 if (ptmr->flags & TMRF_READY) 00314 DecTimerCount(ptmr->pti); 00315 } 00316 00317 /* 00318 * If pwnd is NULL, create a unique id by 00319 * using the timer handle. RIT timers are 'owned' by the RIT pti 00320 * so they are not deleted when the creating pti dies. 00321 * 00322 * We used to record the pti as the pti of the window if one was 00323 * specified. This is not what Win 3.1 does and it broke 10862 00324 * where some merge app was setting the timer on winword's window 00325 * it it still expected to get the messages not winword. 00326 * 00327 * MS Visual C NT was counting on this bug in the NT 3.1 so if 00328 * a thread sets a timer for a window in another thread in the 00329 * same process the timer goes off in the thread of the window. 00330 * You can see this by doing a build in msvcnt and the files being 00331 * compiled do not show up. 00332 */ 00333 ptiCurrent = (PTHREADINFO)(W32GetCurrentThread()); /* 00334 * This will be NULL 00335 * for a non-GUI thread. 00336 */ 00337 00338 if (pwnd == NULL) { 00339 00340 if (flags & TMRF_RIT) { 00341 ptmr->pti = gptiRit; 00342 } else { 00343 ptmr->pti = ptiCurrent; 00344 UserAssert(ptiCurrent); 00345 } 00346 00347 } else { 00348 00349 /* 00350 * As enforced in the API wrappers. We shouldn't get here 00351 * any other way for an app timer. 00352 * 00353 * Always use pti of the window when TMRF_PTIWINDOW is passed in. 00354 */ 00355 if ((ptiCurrent->TIF_flags & TIF_16BIT) && !(flags & TMRF_PTIWINDOW)) { 00356 ptmr->pti = ptiCurrent; 00357 UserAssert(ptiCurrent); 00358 } else { 00359 ptmr->pti = GETPTI(pwnd); 00360 } 00361 } 00362 00363 /* 00364 * Initialize the timer-struct. 00365 * 00366 * NOTE: The ptiOptCreator is used to identify a JOURNAL-timer. We 00367 * want to allow these timers to be destroyed when the creator 00368 * thread goes away. For other threads that create timers across 00369 * threads, we do not want to destroy these timers when the 00370 * creator goes away. Currently, we're only checking for a 00371 * TMRF_RIT. However, in the future we might want to add this 00372 * same check for TMRF_SYSTEM. 00373 */ 00374 Lock(&(ptmr->spwnd), pwnd); 00375 00376 ptmr->cmsCountdown = ptmr->cmsRate = dwElapse; 00377 ptmr->flags = flags | TMRF_INIT; 00378 ptmr->pfn = pTimerFunc; 00379 ptmr->ptiOptCreator = (flags & TMRF_RIT ? ptiCurrent : NULL); 00380 00381 /* 00382 * Force the RIT to scan timers. 00383 * 00384 * N.B. The following code sets the raw input thread timer to expire 00385 * at the absolute time 1 which is very far into the past. This 00386 * causes the timer to immediately expire before the set timer 00387 * call returns. 00388 */ 00389 if (ptiCurrent == gptiRit) { 00390 /* 00391 * Don't let RIT timer loop reset the master timer - we already have. 00392 */ 00393 gbMasterTimerSet = TRUE; 00394 } 00395 00396 UserAssert(gptmrMaster); 00397 KeSetTimer(gptmrMaster, liT, NULL); 00398 00399 /* 00400 * Windows 3.1 returns the timer ID if non-zero, otherwise it returns 1. 00401 */ 00402 return (ptmr->nID == 0 ? 1 : ptmr->nID); 00403 }

SHORT InternalVkKeyScanEx WCHAR  cChar,
PKBDTABLES  pKbdTbl
 

Definition at line 803 of file tounicod.c.

References BYTE, FALSE, GetModificationNumber(), gspklBaseLayout, NULL, PBYTE, tagKBDFILE::pKbdTbl, SHORT, and tagKL::spkf.

Referenced by NtUserVkKeyScanEx(), and xxxInternalToUnicode().

00806 { 00807 PVK_TO_WCHARS1 pVK; 00808 PVK_TO_WCHAR_TABLE pVKT; 00809 BYTE nShift; 00810 WORD wModBits; 00811 WORD wModNumCtrl, wModNumShiftCtrl; 00812 SHORT shRetvalCtrl = 0; 00813 SHORT shRetvalShiftCtrl = 0; 00814 00815 if (pKbdTbl == NULL) { 00816 pKbdTbl = gspklBaseLayout->spkf->pKbdTbl; 00817 } 00818 00819 /* 00820 * Ctrl and Shift-Control combinations are less favored, so determine 00821 * the values for nShift which we prefer not to use if at all possible. 00822 * This is for compatibility with Windows 95/98, which only returns a 00823 * Ctrl or Shift+Ctrl combo as a last resort. See bugs #78891 & #229141 00824 */ 00825 wModNumCtrl = GetModificationNumber(pKbdTbl->pCharModifiers, KBDCTRL); 00826 wModNumShiftCtrl = GetModificationNumber(pKbdTbl->pCharModifiers, KBDSHIFT | KBDCTRL); 00827 00828 for (pVKT = pKbdTbl->pVkToWcharTable; pVKT->pVkToWchars != NULL; pVKT++) { 00829 for (pVK = pVKT->pVkToWchars; 00830 pVK->VirtualKey != 0; 00831 pVK = (PVK_TO_WCHARS1)((PBYTE)pVK + pVKT->cbSize)) { 00832 for (nShift = 0; nShift < pVKT->nModifications; nShift++) { 00833 if (pVK->wch[nShift] == wchChar) { 00834 /* 00835 * A matching character has been found! 00836 */ 00837 if (pVK->VirtualKey == 0xff) { 00838 /* 00839 * dead char: back up to previous line to get the VK. 00840 */ 00841 pVK = (PVK_TO_WCHARS1)((PBYTE)pVK - pVKT->cbSize); 00842 } 00843 00844 /* 00845 * If this is the first Ctrl or the first Shift+Ctrl match, 00846 * remember in case we don't find any better match. 00847 * In the meantime, keep on looking. 00848 */ 00849 if (nShift == wModNumCtrl) { 00850 if (shRetvalCtrl == 0) { 00851 shRetvalCtrl = (SHORT)MAKEWORD(pVK->VirtualKey, KBDCTRL); 00852 } 00853 } else if (nShift == wModNumShiftCtrl) { 00854 if (shRetvalShiftCtrl == 0) { 00855 shRetvalShiftCtrl = (SHORT)MAKEWORD(pVK->VirtualKey, KBDCTRL | KBDSHIFT); 00856 } 00857 } else { 00858 /* 00859 * this seems like a very good match! 00860 */ 00861 goto GoodMatchFound; 00862 } 00863 } 00864 } 00865 } 00866 } 00867 00868 /* 00869 * Didn't find a good match: use whatever Ctrl/Shift+Ctrl match was found 00870 */ 00871 if (shRetvalCtrl) { 00872 return shRetvalCtrl; 00873 } 00874 if (shRetvalShiftCtrl) { 00875 return shRetvalShiftCtrl; 00876 } 00877 00878 /* 00879 * May be a control character not explicitly in the layout tables 00880 */ 00881 if (wchChar < 0x0020) { 00882 /* 00883 * Ctrl+char -> char - 0x40 00884 */ 00885 return (SHORT)MAKEWORD((wchChar + 0x40), KBDCTRL); 00886 } 00887 return -1; 00888 00889 GoodMatchFound: 00890 /* 00891 * Scan aModification[] to find nShift: the index will be a bitmask 00892 * representing the Shifter Keys that need to be pressed to produce 00893 * this Shift State. 00894 */ 00895 for (wModBits = 0; 00896 wModBits <= pKbdTbl->pCharModifiers->wMaxModBits; 00897 wModBits++) 00898 { 00899 if (pKbdTbl->pCharModifiers->ModNumber[wModBits] == nShift) { 00900 if (pVK->VirtualKey == 0xff) { 00901 /* 00902 * The previous entry contains the actual virtual key in this case. 00903 */ 00904 pVK = (PVK_TO_WCHARS1)((PBYTE)pVK - pVKT->cbSize); 00905 } 00906 return (SHORT)MAKEWORD(pVK->VirtualKey, wModBits); 00907 } 00908 } 00909 00910 /* 00911 * huh? should never reach here! (IanJa) 00912 */ 00913 UserAssertMsg1(FALSE, "InternalVkKeyScanEx error: wchChar = 0x%x", wchChar); 00914 return -1; 00915 }

int IntersectVisRect HDC  ,
int  ,
int  ,
int  ,
int 
 

BOOL IntersectWithParents PWND  pwnd,
LPRECT  lprc
 

Definition at line 1772 of file update.c.

References BOOL, FALSE, FLayeredOrRedirected(), IntersectRect(), NULL, tagWND::rcClient, tagWND::spwndParent, TestWF, TRUE, WFMINIMIZED, and WFVISIBLE.

Referenced by SpbTransfer(), ValidateParents(), xxxGetUpdateRect(), xxxGetUpdateRgn(), and xxxInternalInvalidate().

01775 { 01776 if (FLayeredOrRedirected(pwnd)) 01777 return TRUE; 01778 01779 while ((pwnd = pwnd->spwndParent) != NULL) { 01780 01781 if (!TestWF(pwnd, WFVISIBLE) || TestWF(pwnd, WFMINIMIZED)) 01782 return FALSE; 01783 01784 if (!IntersectRect(lprc, lprc, &pwnd->rcClient)) 01785 return FALSE; 01786 01787 if (FLayeredOrRedirected(pwnd)) 01788 return TRUE; 01789 } 01790 01791 return TRUE; 01792 }

VOID InvalidateDce PDCE  pdce  ) 
 

Definition at line 470 of file dc.c.

References CFPARENTDC, tagDCE::DCX_flags, gpDispInfo, tagDCE::hdc, tagDISPLAYINFO::hDev, tagDCE::hrgnClip, tagDCE::hrgnClipPublic, MarkDCEInvalid(), NULL, tagDCE::pwndClip, tagDCE::pwndOrg, SpbCheckDce(), TestCF, TestWF, UserSetDCVisRgn(), VOID(), WFCLIPCHILDREN, WFCLIPSIBLINGS, WFMINIMIZED, WFVISIBLE, and WFWIN31COMPAT.

Referenced by ConvertRedirectionDCs(), CreateCacheDC(), DeleteHrgnClip(), and zzzInvalidateDCCache().

00472 { 00473 GreLockDisplay(gpDispInfo->hDev); 00474 00475 if (!(pdce->DCX_flags & DCX_INUSE)) { 00476 00477 /* 00478 * Accumulate any bounds for this CE 00479 * since we're about to mark it invalid. 00480 */ 00481 SpbCheckDce(pdce); 00482 00483 MarkDCEInvalid(pdce); 00484 00485 pdce->pwndOrg = NULL; 00486 pdce->pwndClip = NULL; 00487 pdce->hrgnClip = NULL; 00488 pdce->hrgnClipPublic = NULL; 00489 00490 /* 00491 * Remove the vis rgn since it is still owned - if we did not, 00492 * gdi would not be able to clean up properly if the app that 00493 * owns this vis rgn exist while the vis rgn is still selected. 00494 */ 00495 GreSelectVisRgn(pdce->hdc, NULL, SVR_DELETEOLD); 00496 00497 } else { 00498 00499 PWND pwndOrg = pdce->pwndOrg; 00500 PWND pwndClip = pdce->pwndClip; 00501 00502 /* 00503 * In case the window's clipping style bits changed, 00504 * reset the DCE flags from the window style bits. 00505 * Note that minimized windows never exclude their children. 00506 */ 00507 pdce->DCX_flags &= ~(DCX_CLIPCHILDREN | DCX_CLIPSIBLINGS); 00508 00509 /* 00510 * Chicago stuff... 00511 */ 00512 if (TestCF(pwndOrg, CFPARENTDC) && 00513 (TestWF(pwndOrg, WFWIN31COMPAT) || !TestWF(pwndClip, WFCLIPCHILDREN)) && 00514 (TestWF(pwndOrg, WFVISIBLE) == TestWF(pwndClip, WFVISIBLE))) { 00515 00516 if (TestWF(pwndClip, WFCLIPSIBLINGS)) 00517 pdce->DCX_flags |= DCX_CLIPSIBLINGS; 00518 00519 } else { 00520 00521 if (TestWF(pwndOrg, WFCLIPCHILDREN) && !TestWF(pwndOrg, WFMINIMIZED)) 00522 pdce->DCX_flags |= DCX_CLIPCHILDREN; 00523 00524 if (TestWF(pwndOrg, WFCLIPSIBLINGS)) 00525 pdce->DCX_flags |= DCX_CLIPSIBLINGS; 00526 } 00527 00528 /* 00529 * Mark that any saved visrgn needs to be recomputed. 00530 */ 00531 pdce->DCX_flags |= DCX_SAVEDRGNINVALID; 00532 00533 UserSetDCVisRgn(pdce); 00534 } 00535 00536 GreUnlockDisplay(gpDispInfo->hDev); 00537 }

BOOL IPostQuitMessage PTHREADINFO  pti,
int  nExitCode
 

Definition at line 1102 of file ntuser/kernel/input.c.

References BOOL, tagTHREADINFO::cQuit, tagTHREADINFO::exitCode, SetWakeBit(), and TRUE.

Referenced by _PostQuitMessage(), and xxxSwitchDesktop().

01103 { 01104 pti->cQuit = 1; 01105 pti->exitCode = nExitCode; 01106 SetWakeBit(pti, QS_POSTMESSAGE | QS_ALLPOSTMESSAGE); 01107 return TRUE; 01108 }

BOOL Is31TrayWindow PWND  pwnd  ) 
 

Definition at line 40 of file winloop2.c.

References BOOL, FALSE, FHas31TrayStyles, IsVSlick(), tagWND::spwndOwner, TestWF, TRUE, and WEFTOOLWINDOW.

Referenced by IsTrayWindow(), and xxxUpdateTray().

00041 { 00042 PWND pwnd2; 00043 00044 if (!(pwnd2 = pwnd->spwndOwner)) 00045 return (!IsVSlick(pwnd)); // unowned -- do we want you? 00046 00047 if (TestWF(pwnd2, WEFTOOLWINDOW)) 00048 return(FALSE); // owned by a tool window -- we don't want 00049 00050 return((FHas31TrayStyles(pwnd2) ? (IsVSlick(pwnd2)) : TRUE)); 00051 }

BOOL IsChildSameThread IN PWND  pwndParent,
IN PWND  pwndChild
 

Referenced by ImeCanDestroyDefIMEforChild().

__inline BOOL IsForegroundLocked  ) 
 

Definition at line 7022 of file userk.h.

Referenced by FAllowForegroundActivate(), xxxActiveWindowTracking(), and xxxSetForegroundWindow().

07023 { 07024 UserAssert(guModalMenuStateCount != 0); 07025 guModalMenuStateCount--;

PHOTKEY IsHotKey UINT  fsModifiers,
UINT  vk
 

Definition at line 735 of file hotkeys.c.

References CheckCritIn, tagHOTKEY::fsModifiers, gphkFirst, NULL, tagHOTKEY::phkNext, and tagHOTKEY::vk.

Referenced by xxxDoHotKeyStuff(), and xxxKeyEvent().

00738 { 00739 PHOTKEY phk; 00740 00741 CheckCritIn(); 00742 00743 phk = gphkFirst; 00744 00745 while (phk != NULL) { 00746 00747 /* 00748 * Do the modifiers and vk for this hotkey match the current state? 00749 */ 00750 if ((phk->fsModifiers == fsModifiers) && (phk->vk == vk)) { 00751 return phk; 00752 } 00753 00754 phk = phk->phkNext; 00755 } 00756 00757 return NULL; 00758 }

__inline BOOL IsInsideMenuLoop PTHREADINFO  pti  ) 
 

Definition at line 4735 of file userk.h.

Referenced by xxxCancelTrackingForThread(), xxxScanSysQueue(), and zzzAttachToQueue().

04738 {

__inline BOOL IsMDIItem PITEM  pitem  ) 
 

Definition at line 4772 of file userk.h.

References NULL, and PMENUSTATE.

Referenced by MBC_RightJustifyMenu().

04778 {

__inline BOOL IsMenuStarted PTHREADINFO  pti  ) 
 

Definition at line 4739 of file userk.h.

Referenced by xxxButtonEvent(), and xxxScanSysQueue().

04742 {

BOOL IsMFMWFPWindow ULONG_PTR  uHitArea  ) 
 

Definition at line 3145 of file ntuser/kernel/menu.c.

References BOOL, FALSE, MFMWFP_ALTMENU, MFMWFP_NOITEM, MFMWFP_OFFMENU, and TRUE.

Referenced by LockMFMWFPWindow(), UnlockMFMWFPWindow(), xxxHandleMenuMessages(), xxxMenuWindowProc(), xxxMNFindWindowFromPoint(), xxxMNSetGapState(), and xxxMNUpdateDraggingInfo().

03146 { 03147 switch(uHitArea) { 03148 case MFMWFP_OFFMENU: 03149 case MFMWFP_NOITEM: 03150 case MFMWFP_ALTMENU: 03151 return FALSE; 03152 03153 default: 03154 return TRUE; 03155 } 03156 }

__inline BOOL IsModelessMenuNotificationWindow PWND  pwnd  ) 
 

Definition at line 4760 of file userk.h.

Referenced by GetActiveTrackPwnd(), and xxxDWP_DoNCActivate().

04762 { 04763 return ppopupmenu->spmenu->rgItems + ppopupmenu->posSelectedItem; 04764 } 04765 __inline BOOL MNIsScrollArrowSelected(PPOPUPMENU ppopupmenu) 04766 {

BOOL IsPrivileged PPRIVILEGE_SET  ppSet  ) 
 

Definition at line 593 of file w32/ntuser/kernel/security.c.

References BOOL, FALSE, L, NT_SUCCESS, NtClose(), NtOpenThreadToken(), NtPrivilegeCheck(), NtPrivilegeObjectAuditAlarm(), NTSTATUS(), NULL, RtlInitUnicodeString(), RtlNtStatusToDosError(), SeCaptureSubjectContext(), SeLockSubjectContext(), SePrivilegeCheck(), SePrivilegeObjectAuditAlarm(), SeReleaseSubjectContext(), SeUnlockSubjectContext(), Status, TRUE, and UserMode.

Referenced by _RegisterLogonProcess(), InitiateShutdown(), SrvRegisterServicesProcess(), and xxxWrapSendMessageBSM().

00595 { 00596 SECURITY_SUBJECT_CONTEXT Context; 00597 BOOLEAN bHeld; 00598 00599 SeCaptureSubjectContext(&Context); 00600 SeLockSubjectContext(&Context); 00601 00602 bHeld = SePrivilegeCheck(ppSet, &Context, UserMode); 00603 SePrivilegeObjectAuditAlarm(NULL, &Context, 0, ppSet, bHeld, UserMode); 00604 00605 SeUnlockSubjectContext(&Context); 00606 SeReleaseSubjectContext(&Context); 00607 00608 if (!bHeld) 00609 RIPERR0(ERROR_PRIVILEGE_NOT_HELD, RIP_VERBOSE, ""); 00610 00611 /* 00612 * Return result of privilege check 00613 */ 00614 return (BOOL)bHeld; 00615 }

__inline BOOL IsRecursedMenuState PMENUSTATE  pMenuState,
PPOPUPMENU  ppopupmenu
 

Definition at line 4767 of file userk.h.

References MFMWFP_DOWNARROW, and MFMWFP_UPARROW.

Referenced by xxxMenuWindowProc().

04771 {

BOOLEAN IsRestricted PETHREAD  Thread  ) 
 

Definition at line 95 of file ex.c.

References FALSE, NULL, ObDereferenceObject, PsReferenceImpersonationToken(), PsReferencePrimaryToken(), SeTokenIsRestricted(), and _ETHREAD::ThreadsProcess.

00098 { 00099 PACCESS_TOKEN UserToken; 00100 BOOLEAN fCopyOnOpen; 00101 BOOLEAN fEffectiveOnly; 00102 SECURITY_IMPERSONATION_LEVEL ImpersonationLevel; 00103 BOOLEAN fRestricted = FALSE; 00104 00105 /* 00106 * Check for a thread token first. 00107 */ 00108 UserToken = PsReferenceImpersonationToken(Thread, 00109 &fCopyOnOpen, &fEffectiveOnly, &ImpersonationLevel); 00110 00111 /* 00112 * If no thread token, go to the process. 00113 */ 00114 if (UserToken == NULL) { 00115 UserToken = PsReferencePrimaryToken(Thread->ThreadsProcess); 00116 } 00117 00118 /* 00119 * If we got a token, is it restricted? 00120 */ 00121 if (UserToken != NULL) { 00122 fRestricted = SeTokenIsRestricted(UserToken); 00123 ObDereferenceObject(UserToken); 00124 } 00125 00126 return fRestricted; 00127 }

__inline BOOL IsRootPopupMenu PPOPUPMENU  ppopupmenu  ) 
 

Definition at line 4719 of file userk.h.

References BOOL.

Referenced by MNFlushDestroyedPopups(), MNFreePopup(), UnlockPopupMenu(), xxxEndMenuLoop(), xxxMNDestroyHandler(), xxxMNKeyDown(), xxxMNLoop(), xxxMNMouseMove(), and xxxMNStartMenu().

04730 {

BOOL IsSAS BYTE  vk,
UINT *  pfsModifiers
 

Definition at line 372 of file hotkeys.c.

References BOOL, CheckCritIn, FALSE, gfsSASModifiers, gfsSASModifiersDown, gvkSAS, TRUE, and UINT.

Referenced by xxxDoHotKeyStuff(), xxxKeyEvent(), and xxxNumpadCursor().

00375 { 00376 UINT fsDown = 0; 00377 00378 CheckCritIn(); 00379 00380 if (gvkSAS != vk) { 00381 return FALSE; 00382 } 00383 00384 /* 00385 * Special case for SAS - examine real physical modifier-key state! 00386 * 00387 * An evil daemon process can fool convincingly pretend to be winlogon 00388 * by registering Alt+Del as a hotkey, and spinning another thread that 00389 * continually calls keybd_event() to send the Ctrl key up: when the 00390 * user types Ctrl+Alt+Del, only Alt+Del will be seen by the system, 00391 * the evil daemon will get woken by WM_HOTKEY and can pretend to be 00392 * winlogon. So look at gfsSASModifiersDown in this case, to see what keys 00393 * were physically pressed. 00394 * NOTE: If hotkeys are ever made to work under journal playback, make 00395 * sure they don't affect the gfsSASModifiersDown! - IanJa. 00396 */ 00397 if (gfsSASModifiersDown == gfsSASModifiers) { 00398 *pfsModifiers = gfsSASModifiersDown; 00399 return TRUE; 00400 } 00401 00402 return FALSE; 00403 }

__inline BOOL IsShellProcess PPROCESSINFO  ppi  ) 
 

Definition at line 6039 of file userk.h.

Referenced by CheckAllowForeground(), and DestroyProcessInfo().

06050 {

BOOL IsSmallerThanScreen PWND  pwnd  ) 
 

Definition at line 208 of file mnsys.c.

References _MonitorFromWindow(), BOOL, FALSE, tagWND::rcWindow, tagMONITOR::rcWork, and TRUE.

Referenced by xxxSetSysMenu(), and zzzChangeStates().

00209 { 00210 int dxMax, dyMax; 00211 PMONITOR pMonitor; 00212 00213 pMonitor = _MonitorFromWindow(pwnd, MONITOR_DEFAULTTOPRIMARY); 00214 dxMax = pMonitor->rcWork.right - pMonitor->rcWork.left; 00215 dyMax = pMonitor->rcWork.bottom - pMonitor->rcWork.top; 00216 00217 if ((pwnd->rcWindow.right - pwnd->rcWindow.left < dxMax) || 00218 (pwnd->rcWindow.bottom - pwnd->rcWindow.top < dyMax)) { 00219 return TRUE; 00220 } 00221 return FALSE; 00222 }

__inline BOOL IsTimeFromLastInput DWORD  dwTimeout  ) 
 

Definition at line 6996 of file userk.h.

References DWORD.

Referenced by IdleTimerProc().

07001 {

__inline BOOL IsTimeFromLastRITEvent DWORD  dwTimeout  ) 
 

Definition at line 7001 of file userk.h.

References DWORD.

Referenced by CanForceForeground().

07001 { 07002 UserAssertMsg0(nDelta >= 0, "Delta must be postive"); 07003 return dwTime - (DWORD) nDelta; 07004 }

BOOL IsTrayWindow PWND   ) 
 

Definition at line 62 of file winloop2.c.

References BOOL, FALSE, FCallHookTray, FDoTray, FHas31TrayStyles, FPostTray, FTopLevel, tagWND::head, Is31TrayWindow(), NULL, tagWND::spwndOwner, TestWF, TRUE, WEFAPPWINDOW, WEFNOACTIVATE, WEFTOOLWINDOW, and WFWIN40COMPAT.

Referenced by ParkIcon(), xxxArrangeIconicWindows(), xxxCalcValidRects(), xxxDestroyWindow(), xxxFlashWindow(), xxxHandleOwnerSwitch(), xxxMinMaximize(), xxxMNPositionHierarchy(), xxxRedrawFrameAndHook(), xxxRedrawTitle(), xxxSetForegroundWindow(), xxxSetSysMenu(), xxxUpdateTray(), and zzzChangeStates().

00063 { 00064 if ((pwnd==NULL) || !(FDoTray() && (FCallHookTray() || FPostTray(pwnd->head.rpdesk))) || 00065 !FTopLevel(pwnd)) 00066 return(FALSE); 00067 00068 // Check for WS_EX_APPWINDOW or WS_EX_TOOLWINDOW "overriding" bits 00069 if (TestWF(pwnd, WEFAPPWINDOW)) 00070 return(TRUE); 00071 00072 if (TestWF(pwnd, WEFTOOLWINDOW)) 00073 return(FALSE); 00074 00075 if (TestWF(pwnd, WEFNOACTIVATE)) { 00076 return FALSE; 00077 } 00078 00079 if (TestWF(pwnd, WFWIN40COMPAT)) { 00080 if (pwnd->spwndOwner == NULL) 00081 return(TRUE); 00082 if (TestWF(pwnd->spwndOwner, WFWIN40COMPAT)) 00083 return(FALSE); 00084 // if this window is owned by a 3.1 window, check it like a 3.1 window 00085 } 00086 00087 if (!FHas31TrayStyles(pwnd)) 00088 return(FALSE); 00089 00090 return(Is31TrayWindow(pwnd)); 00091 }

VOID ISV_InitMinMaxInfo PWND  pwnd,
PPOINT  aptMinMaxWnd
 

VOID ISV_ValidateMinMaxInfo PWND  pwnd,
PPOINT  aptMinMaxWnd
 

BOOL IsVSlick PWND  pwnd  ) 
 

Definition at line 17 of file winloop2.c.

References BOOL, tagDISPLAYINFO::cMonitors, FALSE, gpDispInfo, tagDISPLAYINFO::rcScreen, tagWND::rcWindow, and TRUE.

Referenced by Is31TrayWindow().

00018 { 00019 if (gpDispInfo->cMonitors == 1 && 00020 ((unsigned) pwnd->rcWindow.left > (unsigned) gpDispInfo->rcScreen.right ) && 00021 ((unsigned) pwnd->rcWindow.top > (unsigned) gpDispInfo->rcScreen.bottom) && 00022 (pwnd->rcWindow.top == (gpDispInfo->rcScreen.bottom+100)) && 00023 (pwnd->rcWindow.left == (gpDispInfo->rcScreen.right+100))) 00024 { 00025 // MUST BE THE ONE AND ONLY V-SLICK 00026 return(TRUE); 00027 } 00028 00029 return(FALSE); 00030 }

BOOL KEOEMProcs PKE  pke  ) 
 

Definition at line 635 of file xlate.c.

References aKEProcOEM, BOOL, CheckCritIn, FALSE, NULL, and TRUE.

Referenced by xxxProcessKeyEvent().

00636 { 00637 int i; 00638 00639 CheckCritIn(); 00640 00641 for (i = 0; aKEProcOEM[i] != NULL; i++) { 00642 if (!aKEProcOEM[i](pKe)) { 00643 /* 00644 * Eat the key event 00645 */ 00646 return FALSE; 00647 } 00648 } 00649 00650 /* 00651 * Pass the (possibly altered) key event on. 00652 */ 00653 return TRUE; 00654 }

HANDLE KernelPtoH PVOID  pObj  ) 
 

BOOL KillTimer2 PWND  pwnd,
UINT_PTR  nIDEvent,
BOOL  fSystemTimer
 

Definition at line 447 of file timers.c.

References BOOL, FindTimer(), NULL, and TRUE.

Referenced by _KillSystemTimer(), and _KillTimer().

00451 { 00452 /* 00453 * Call FindTimer() with fKill == TRUE. This will 00454 * basically delete the timer. 00455 */ 00456 return (FindTimer(pwnd, 00457 nIDEvent, 00458 (fSystemTimer ? TMRF_SYSTEM : 0), 00459 TRUE) != NULL); 00460 }

VOID LeaveCrit VOID   ) 
 

__inline VOID LeaveDeviceInfoListCrit  ) 
 

Definition at line 7258 of file userk.h.

References VOID().

Referenced by CreateDeviceInfo(), InputApc(), NlsKbdSendIMENotification(), ProcessDeviceChanges(), RawInputThread(), RequestDeviceChange(), StartDeviceRead(), UpdateKeyLights(), UpdateMouseInfo(), and Win32kNtUserCleanup().

07264 {

__inline VOID LeaveHandleFlagsCrit  ) 
 

Definition at line 7312 of file userk.h.

Referenced by CheckHandleFlag(), CheckHandleInUse(), SetHandleFlag(), SetHandleInUse(), and UserDeleteW32Process().

07317 {

__inline VOID LeaveMouseCrit  ) 
 

Definition at line 7239 of file userk.h.

References ExAcquireResourceExclusiveLite(), gpresMouseEventQueue, KeEnterCriticalRegion, TRUE, and VOID().

Referenced by QueueMouseEvent(), and UnqueueMouseEvent().

07243 {

VOID LinkCursor PCURSOR  pcur  ) 
 

Definition at line 269 of file kernel/acons.c.

References CURSORF_ACONFRAME, CURSORF_LINKED, CURSORF_LRSHARED, gpcurFirst, NULL, tagPROCESSINFO::pCursorCache, and VOID().

Referenced by _SetCursorIconData().

00271 { 00272 /* 00273 * Should never try to link twice! 00274 */ 00275 UserAssert(!(pcur->CURSORF_flags & CURSORF_LINKED)); 00276 /* 00277 * We don't cache acon frames because they all belong to the 00278 * root acon object. 00279 * 00280 * We don't cache process owned objects that are not LRSHARED 00281 * either. 00282 */ 00283 if (!(pcur->CURSORF_flags & CURSORF_ACONFRAME)) { 00284 PPROCESSINFO ppi = pcur->head.ppi; 00285 if (ppi == NULL) { 00286 /* 00287 * Public cache object. 00288 */ 00289 pcur->pcurNext = gpcurFirst; 00290 gpcurFirst = pcur; 00291 pcur->CURSORF_flags |= CURSORF_LINKED; 00292 } else if (pcur->CURSORF_flags & CURSORF_LRSHARED) { 00293 /* 00294 * Private cache LR_SHARED object. 00295 */ 00296 pcur->pcurNext = ppi->pCursorCache; 00297 ppi->pCursorCache = pcur; 00298 pcur->CURSORF_flags |= CURSORF_LINKED; 00299 } 00300 } 00301 }

VOID LinkWindow PWND  pwnd,
PWND  pwndInsert,
PWND  pwndParent
 

Definition at line 1478 of file createw.c.

References tagCLS::atomClassName, tagSERVERINFO::atomSysClass, CFIME, FALSE, FSwpTopmost(), gpsi, ICLS_IME, Lock, NULL, tagWND::pcls, PWND_BOTTOM, PWND_TOP, PWNDDESKTOP, PWNDMESSAGE, tagWND::spwndChild, tagWND::spwndNext, tagWND::spwndParent, TestCF, TestWF, TrackLayeredZorder(), TRUE, WEFLAYERED, WEFTOPMOST, WFBOTTOMMOST, WFDESTROYED, and WFTOGGLETOPMOST.

Referenced by ImeSetTopmost(), xxxCreateDesktop(), xxxCreateWindowEx(), xxxSetParent(), and zzzChangeStates().

01482 { 01483 if (pwndParent->spwndChild == pwnd) { 01484 RIPMSG0(RIP_WARNING, "Attempting to link a window to itself"); 01485 return; 01486 } 01487 UserAssert(pwnd != pwndInsert); 01488 UserAssert((pwnd->spwndParent == NULL) || (pwnd->spwndParent == pwndParent)); 01489 01490 if (pwndInsert == PWND_TOP) { 01491 01492 /* 01493 * We are at the top of the list. 01494 */ 01495 LinkTop: 01496 #if DBG 01497 /* 01498 * If the first child is topmost, so must be pwnd, but only for top-level windows. 01499 * 01500 * IME or IME related windows are the exceptions, because ImeSetTopmost() and its fellow 01501 * do most of the relinking by its own: when LinkWindow() is called, it's possible TOPMOST flags 01502 * are left in intermediate state. By the time the all window relinking finishes, TOPMOST 01503 * flags have been taken care of and they are just fine. 01504 */ 01505 if (pwndParent == PWNDDESKTOP(pwndParent) && 01506 pwndParent->spwndChild && 01507 FSwpTopmost(pwndParent->spwndChild) && 01508 pwndParent != PWNDMESSAGE(pwndParent) && 01509 // Check if the target is IME related window 01510 !TestCF(pwnd, CFIME) && pwnd->pcls->atomClassName != gpsi->atomSysClass[ICLS_IME]) { 01511 01512 /* 01513 * There are few cases that cause the z-ordering code to leave the WFTOGGLETOPMOST bit set. 01514 * One is when SWP_NOOWNERZORDER is used when changing the topmost state of a window; 01515 * in this case, ZOrderByOwner2 doesn't add ownees to the psmwp list, still SetTopMost 01516 * sets the bit on all the ownees. 01517 * Another case is when SetWindowPos gets re-entered on the same window. 01518 * It's too late to attempt to fix this ancient behavior (2/24/99) so let's turn off 01519 * the assert for now. 01520 */ 01521 if (!FSwpTopmost(pwnd)) { 01522 RIPMSG1(RIP_WARNING, "LinkWindow pwnd:%p is not FSwpTopmost", pwnd); 01523 } 01524 } 01525 #endif 01526 01527 Lock(&pwnd->spwndNext, pwndParent->spwndChild); 01528 Lock(&(pwndParent->spwndChild), pwnd); 01529 } else { 01530 if (pwndInsert == PWND_BOTTOM) { 01531 01532 /* 01533 * Find bottom-most window. 01534 */ 01535 if (((pwndInsert = pwndParent->spwndChild) == NULL) || 01536 TestWF(pwndInsert, WFBOTTOMMOST)) 01537 goto LinkTop; 01538 01539 /* 01540 * Since we know (ahem) that there's only one bottommost window, 01541 * we can't possibly insert after it. Either we're inserting 01542 * the bottomost window, in which case it's not in the linked 01543 * list currently, or we're inserting some other window. 01544 */ 01545 01546 while (pwndInsert->spwndNext != NULL) { 01547 if (TestWF(pwndInsert->spwndNext, WFBOTTOMMOST)) { 01548 #if DBG 01549 UserAssert(pwnd != pwndInsert->spwndNext); 01550 if (TestWF(pwnd, WFBOTTOMMOST)) 01551 UserAssert(FALSE); 01552 #endif 01553 break; 01554 } 01555 01556 pwndInsert = pwndInsert->spwndNext; 01557 } 01558 } 01559 01560 UserAssert(pwnd != pwndInsert); 01561 UserAssert(pwnd != pwndInsert->spwndNext); 01562 UserAssert(!TestWF(pwndInsert, WFDESTROYED)); 01563 UserAssert(!TestWF(pwnd, WEFTOPMOST) || TestWF(pwndInsert, WEFTOPMOST) || TestWF(pwnd, WFTOGGLETOPMOST) || (pwndParent != PWNDDESKTOP(pwndInsert))); 01564 UserAssert(pwnd->spwndParent == pwndInsert->spwndParent); 01565 01566 Lock(&pwnd->spwndNext, pwndInsert->spwndNext); 01567 Lock(&pwndInsert->spwndNext, pwnd); 01568 } 01569 01570 if (TestWF(pwnd, WEFLAYERED)) 01571 TrackLayeredZorder(pwnd); 01572 01573 #if DBG 01574 VerifyWindowLink (pwnd, pwndParent, TRUE); 01575 #endif 01576 01577 }

__inline VOID LockCaptureWindow PQ  pq,
PWND  pwnd
 

Definition at line 7267 of file userk.h.

Referenced by xxxCapture(), and zzzAttachToQueue().

07268 { 07269 ExReleaseResource(gpresDeviceInfoList); 07270 KeLeaveCriticalRegion(); 07271 } 07272 #endif 07273 07274 /* 07275 * Keep some capture state visible from user-mode for performance. 07276 */

PVOID LockDesktopMenu PMENU ppmenu,
PMENU  pmenu
 

Definition at line 74 of file mnsys.c.

References tagMENU::cItems, HMChangeOwnerProcess, Lock, MFDESKTOP, NULL, PtiCurrent, tagMENU::rgItems, SetMF, tagITEM::spSubMenu, and UINT.

Referenced by xxxGetScrollMenu(), and xxxLoadSysDesktopMenu().

00075 { 00076 PMENU pSubMenu; 00077 PTHREADINFO ptiDesktop; 00078 /* 00079 * We only load desktop sys menus once. 00080 */ 00081 UserAssert(*ppmenu == NULL); 00082 00083 if (pmenu == NULL) { 00084 return NULL; 00085 } 00086 00087 SetMF(pmenu, MFDESKTOP); 00088 /* 00089 * This is awful but this is the real owner of this object. We used to set it 00090 * to NULL but that was forcing us to handle the NULL owner all over the place 00091 */ 00092 ptiDesktop = PtiCurrent()->rpdesk->rpwinstaParent->pTerm->ptiDesktop; 00093 HMChangeOwnerProcess(pmenu, ptiDesktop); 00094 00095 pSubMenu = pmenu->rgItems->spSubMenu; 00096 UserAssert(pSubMenu != NULL); 00097 00098 SetMF(pSubMenu, MFDESKTOP); 00099 HMChangeOwnerProcess(pSubMenu, ptiDesktop); 00100 00101 #if DBG 00102 { 00103 /* 00104 * Assert that there are no other submenus that would need to be 00105 * marked as MFDESKTOP. 00106 */ 00107 PITEM pitem; 00108 UINT uItems; 00109 00110 UserAssert(pmenu->cItems == 1); 00111 00112 pitem = pSubMenu->rgItems; 00113 uItems = pSubMenu->cItems; 00114 while (uItems--) { 00115 UserAssert(pitem->spSubMenu == NULL); 00116 pitem++; 00117 } 00118 } 00119 #endif 00120 00121 return Lock(ppmenu, pmenu); 00122 }

__inline void LockMenuState PMENUSTATE  pMenuState  ) 
 

Definition at line 4873 of file userk.h.

References BOOL, and PMENUSTATE.

Referenced by xxxMenuWindowProc(), xxxMNDragLeave(), and xxxMNDragOver().

04884 {

void LockMFMWFPWindow PULONG_PTR  puHitArea,
ULONG_PTR  uNewHitArea
 

Definition at line 3097 of file ntuser/kernel/menu.c.

References IsMFMWFPWindow(), Lock, and UnlockMFMWFPWindow().

Referenced by xxxHandleMenuMessages(), and xxxMNUpdateDraggingInfo().

03098 { 03099 /* 03100 * Bail if there is nothing to do. 03101 */ 03102 if (*puHitArea == uNewHitArea) { 03103 return; 03104 } 03105 03106 /* 03107 * Unlock current hit area 03108 */ 03109 UnlockMFMWFPWindow(puHitArea); 03110 03111 /* 03112 * Lock new hit area 03113 */ 03114 if (IsMFMWFPWindow(uNewHitArea)) { 03115 Lock(puHitArea, (PWND)uNewHitArea); 03116 } else { 03117 *puHitArea = uNewHitArea; 03118 } 03119 }

VOID LockObjectAssignment PVOID *  ,
PVOID 
 

Definition at line 368 of file ex.c.

References ExDesktopObjectType, FALSE, LogDesktop, NULL, ObDereferenceObject, OBJECT_TO_OBJECT_HEADER, ObReferenceObject, TRUE, and VOID().

00376 { 00377 PVOID pobjectOld; 00378 00379 /* 00380 * Save old object to dereference AFTER the new object is 00381 * referenced. This will avoid problems with relocking 00382 * the same object. 00383 */ 00384 pobjectOld = *pplock; 00385 00386 /* 00387 * Reference the new object. 00388 */ 00389 if (pobject != NULL) { 00390 ObReferenceObject(pobject); 00391 #ifdef LOGDESKTOPLOCKS 00392 if (OBJECT_TO_OBJECT_HEADER(pobject)->Type == *ExDesktopObjectType) { 00393 LogDesktop(pobject, tag, TRUE, extra); 00394 } 00395 #endif 00396 } 00397 *pplock = pobject; 00398 00399 /* 00400 * Dereference the old object 00401 */ 00402 if (pobjectOld != NULL) { 00403 #ifdef LOGDESKTOPLOCKS 00404 if (OBJECT_TO_OBJECT_HEADER(pobjectOld)->Type == *ExDesktopObjectType) { 00405 LogDesktop(pobjectOld, tag, FALSE, extra); 00406 } 00407 #endif 00408 ObDereferenceObject(pobjectOld); 00409 } 00410 }

PVOID LockPopupMenu PPOPUPMENU  ppopup,
PMENU pspmenu,
PMENU  pmenu
 

Definition at line 296 of file ntuser/kernel/menu.c.

References tagWND::head, Lock, NULL, tagPOPUPMENU::spmenu, tagPOPUPMENU::spmenuAlternate, tagMENU::spwndNotify, tagPOPUPMENU::spwndNotify, UnlockPopupMenuWindow(), and Validateppopupmenu.

Referenced by xxxMenuWindowProc(), xxxMNKeyDown(), xxxMNOpenHierarchy(), xxxMNStartMenu(), and xxxTrackPopupMenuEx().

00297 { 00298 /* 00299 * If you hit this assertion, you're probably not passing the right thing 00300 */ 00301 UserAssert((pspmenu == &ppopup->spmenu) || (pspmenu == &ppopup->spmenuAlternate)); 00302 Validateppopupmenu(ppopup); 00303 /* 00304 * This won't work properly if the popup hasn't locked the notification 00305 * window. 00306 */ 00307 UserAssert(ppopup->spwndNotify != NULL); 00308 00309 /* 00310 * When using modeless menus, menus can be shared by several active popups. 00311 * If the menu has owner draw items, the app better knows how to draw them 00312 * correctly. This shouldn't happen with modal menus though 00313 */ 00314 #if DBG 00315 if ((*pspmenu != NULL) 00316 && ((*pspmenu)->spwndNotify != NULL) 00317 && ((*pspmenu)->spwndNotify != ppopup->spwndNotify)) { 00318 00319 RIPMSG3(RIP_WARNING, "LockPopupMenu: Current Menu %#p shared by %#p and %#p", 00320 *pspmenu, (*pspmenu)->spwndNotify, ppopup->spwndNotify); 00321 } 00322 #endif 00323 00324 /* 00325 * Unlock the current's menu spwndNotify if needed 00326 */ 00327 UnlockPopupMenuWindow(*pspmenu, ppopup->spwndNotify); 00328 00329 /* 00330 * Lock the notification window into the menu structure 00331 */ 00332 if (pmenu != NULL) { 00333 00334 /* 00335 * Display a warning if this menu is being shared 00336 */ 00337 #if DBG 00338 if ((pmenu->spwndNotify != NULL) 00339 && (pmenu->spwndNotify != ppopup->spwndNotify) 00340 && (pmenu != pmenu->spwndNotify->head.rpdesk->spmenuDialogSys)) { 00341 00342 RIPMSG3(RIP_WARNING, "LockPopupMenu: New Menu %#p shared by %#p and %#p", 00343 pmenu, pmenu->spwndNotify, ppopup->spwndNotify); 00344 } 00345 #endif 00346 00347 /* 00348 * spwndNotify "owns" this menu now. 00349 */ 00350 Lock(&pmenu->spwndNotify, ppopup->spwndNotify); 00351 } 00352 00353 /* 00354 * Lock the menu into the popup structure (unlock the previous one) 00355 */ 00356 return Lock(pspmenu, pmenu); 00357 }

NTSTATUS __inline LockProcessByClientId HANDLE  dwProcessId,
PEPROCESS ppEProcess
 

Definition at line 4503 of file userk.h.

References CheckCritOut, NTSTATUS(), and Status.

Referenced by CheckAllowForeground(), UserSetConsoleProcessWindowStation(), xxxActivateDebugger(), xxxAllowSetForegroundWindow(), xxxUserNotifyConsoleApplication(), xxxUserNotifyProcessCreate(), and xxxWaitForInputIdle().

04514 { 04515 NTSTATUS Status; 04516

NTSTATUS __inline LockThreadByClientId HANDLE  dwThreadId,
PETHREAD ppEThread
 

Definition at line 4518 of file userk.h.

References gSessionId, and Status.

Referenced by PtiFromThreadId(), TerminateConsole(), and xxxUserNotifyProcessCreate().

04521 { 04522 UnlockProcess(*ppEProcess); 04523 return STATUS_UNSUCCESSFUL; 04524 } 04525 return Status; 04526 } 04527 04528 NTSTATUS __inline LockThreadByClientId(HANDLE dwThreadId, PETHREAD* ppEThread) 04529 {

BOOL LockWindowUpdate2 PWND  pwndLock,
BOOL  fThreadOverride
 

Definition at line 802 of file spb.c.

References BEGINATOMICCHECK, BOOL, CreateSpb(), DeferWinEventNotify, ENDATOMICCHECK, FALSE, tagSPB::flags, FreeSpb(), ghrgnSPB1, gpDispInfo, gptiLockUpdate, gspwndLockUpdate, tagDISPLAYINFO::hDev, tagSPB::hrgn, HRGN_FULL, IDC_DEFAULT, IsWinEventNotifyDeferredOK, Lock, NULL, tagDISPLAYINFO::pspbFirst, tagSPB::pspbNext, PtiCurrent, PUDF_LOCKFULLSCREEN, PWNDDESKTOP, tagSPB::rc, SetRectRgnIndirect(), SPB_LOCKUPDATE, SpbCheck(), SpbCheckPwnd(), SubtractRgn, TEST_PUDF, TRUE, Unlock, xxxInternalInvalidate(), zzzEndDeferWinEventNotify, and zzzInvalidateDCCache().

Referenced by FullScreenCleanup(), NtUserLockWindowUpdate(), xxxMakeWindowForegroundWithState(), xxxMS_TrackMove(), xxxProcessEventMessage(), and xxxSetForegroundWindow2().

00805 { 00806 PSPB pspb; 00807 BOOL fInval; 00808 HRGN hrgn; 00809 PTHREADINFO ptiCurrent = PtiCurrent(); 00810 00811 if ( /* 00812 * If we're full screen right now, fail this call. 00813 */ 00814 TEST_PUDF(PUDF_LOCKFULLSCREEN) 00815 00816 || 00817 00818 /* 00819 * If the screen is already locked, and it's being locked 00820 * by some other app, then fail. If fThreadOverride is set 00821 * then we're calling internally and it's okay to cancel 00822 * someone elses LockUpdate. 00823 */ 00824 ( gptiLockUpdate != NULL && 00825 gptiLockUpdate != PtiCurrent() && 00826 !fThreadOverride)) { 00827 UserAssert(IsWinEventNotifyDeferredOK()); 00828 00829 RIPERR0(ERROR_SCREEN_ALREADY_LOCKED, 00830 RIP_WARNING, 00831 "LockWindowUpdate failed because screen is locked by another application."); 00832 00833 return FALSE; 00834 } 00835 00836 if ((pwndLock != NULL) == (gptiLockUpdate != NULL)) { 00837 if (!fThreadOverride) { 00838 RIPERR1(ERROR_INVALID_PARAMETER, 00839 RIP_WARNING, 00840 "LockWindowUpdate failed because it is already %s.", 00841 (pwndLock != NULL) ? "locked" : "unlocked"); 00842 } 00843 00844 return FALSE; 00845 } 00846 00847 /* 00848 * This must be done while holding the screen critsec. 00849 * Deadlock if we callback during this, so defer WinEvent notifications 00850 */ 00851 DeferWinEventNotify(); 00852 GreLockDisplay(gpDispInfo->hDev); 00853 00854 if (pwndLock != NULL) { 00855 /* 00856 * We're about to make pwndLock and its siblings invisible: 00857 * go invalidate any other affected SPBs. 00858 */ 00859 SpbCheckPwnd(pwndLock); 00860 00861 CreateSpb(pwndLock, SPB_LOCKUPDATE, NULL); 00862 00863 Lock(&(gspwndLockUpdate), pwndLock); 00864 gptiLockUpdate = ptiCurrent; 00865 00866 zzzInvalidateDCCache(pwndLock, IDC_DEFAULT); 00867 00868 } else { 00869 /* 00870 * Flush any accumulated rectangles and invalidate spbs. 00871 */ 00872 SpbCheck(); 00873 00874 /* 00875 * Save this in a local before we set it to NULL 00876 */ 00877 pwndLock = gspwndLockUpdate; 00878 00879 gptiLockUpdate = NULL; 00880 Unlock(&gspwndLockUpdate); 00881 00882 zzzInvalidateDCCache(pwndLock, IDC_DEFAULT); 00883 00884 /* 00885 * Assume SPB doesn't exist, or couldn't be created, and that we 00886 * must invalidate the entire window. 00887 */ 00888 fInval = TRUE; 00889 hrgn = HRGN_FULL; 00890 00891 /* 00892 * Find the LOCKUPDATE spb in the list, and if present calculate 00893 * the area that has been invalidated, if any. 00894 */ 00895 for (pspb = gpDispInfo->pspbFirst; pspb != NULL; pspb = pspb->pspbNext) { 00896 00897 if (pspb->flags & SPB_LOCKUPDATE) { 00898 00899 if (pspb->hrgn == NULL) { 00900 00901 /* 00902 * If no invalid area, then no invalidation needed. 00903 */ 00904 fInval = FALSE; 00905 00906 } else { 00907 00908 /* 00909 * Subtract SPB valid region from SPB rectangle, to 00910 * yield invalid region. 00911 */ 00912 hrgn = ghrgnSPB1; 00913 SetRectRgnIndirect(hrgn, &pspb->rc); 00914 00915 /* 00916 * If spb rect minus the spb valid rgn is empty, 00917 * then there is nothing to invalidate. 00918 */ 00919 fInval = SubtractRgn(hrgn, hrgn, pspb->hrgn) != NULLREGION; 00920 } 00921 00922 FreeSpb(pspb); 00923 00924 /* 00925 * Exit this loop (there can be only one LOCKUPDATE spb) 00926 */ 00927 break; 00928 } 00929 } 00930 00931 if (fInval) { 00932 BEGINATOMICCHECK(); 00933 // want to prevent WinEvent notifies, but this make break asserts 00934 DeferWinEventNotify(); 00935 xxxInternalInvalidate(PWNDDESKTOP(pwndLock), 00936 hrgn, 00937 RDW_INVALIDATE | RDW_ERASE | RDW_ALLCHILDREN); 00938 zzzEndDeferWinEventNotify(); 00939 ENDATOMICCHECK(); 00940 } 00941 00942 /* 00943 * Invalidate any other SPBs affected by the fact that this window 00944 * and its children are being made visible. 00945 */ 00946 SpbCheckPwnd(pwndLock); 00947 } 00948 00949 GreUnlockDisplay(gpDispInfo->hDev); 00950 zzzEndDeferWinEventNotify(); 00951 00952 return TRUE; 00953 }

PVOID LockWndMenu PWND  pwnd,
PMENU pspmenu,
PMENU  pmenu
 

Definition at line 422 of file ntuser/kernel/menu.c.

References Lock, NULL, tagWND::spmenu, tagWND::spmenuSys, tagMENU::spwndNotify, and Unlock.

Referenced by xxxCreateWindowEx(), xxxGetSystemMenu(), xxxSetDialogSystemMenu(), xxxSetMenu(), xxxSetSystemMenu(), and xxxSetWindowData().

00423 { 00424 /* 00425 * If you hit this assertion, you're probably not passing the right thing 00426 */ 00427 UserAssert((pspmenu == &pwnd->spmenu) || (pspmenu == &pwnd->spmenuSys)); 00428 00429 /* 00430 * If the current menu is owned by this window, unlock it 00431 */ 00432 if ((*pspmenu != NULL) && ((*pspmenu)->spwndNotify == pwnd)) { 00433 Unlock(&((*pspmenu)->spwndNotify)); 00434 } 00435 00436 /* 00437 * If nobody owns the new menu, make this window the owner 00438 */ 00439 if ((pmenu != NULL) && (pmenu->spwndNotify == NULL)) { 00440 Lock(&pmenu->spwndNotify, pwnd); 00441 } 00442 00443 /* 00444 * Lock the menu into the window structure (unlock the previous menu) 00445 */ 00446 return Lock(pspmenu, pmenu); 00447 00448 }

PDCE LookupDC HDC  hdc  ) 
 

Definition at line 2123 of file dc.c.

References tagDCE::DCX_flags, gpDispInfo, tagDCE::hdc, NULL, tagDISPLAYINFO::pdceFirst, tagDCE::pdceNext, and tagDCE::pMonitor.

Referenced by UserGetRedirectedWindowOrigin(), and xxxEnumDisplayMonitors().

02124 { 02125 PDCE pdce; 02126 02127 for (pdce = gpDispInfo->pdceFirst; pdce != NULL; pdce = pdce->pdceNext) { 02128 02129 if (pdce->DCX_flags & (DCX_INVALID | DCX_DESTROYTHIS)) 02130 continue; 02131 02132 if (pdce->hdc == hdc && pdce->pMonitor == NULL && 02133 (pdce->DCX_flags & DCX_INUSE)) { 02134 return pdce; 02135 } 02136 } 02137 return NULL; 02138 }

BOOL LW_BrushInit VOID   ) 
 

Definition at line 1820 of file w32/ntuser/kernel/init.c.

References BOOL, FALSE, ghbrBlack, ghbrHungApp, ghbrWhite, gpsi, NULL, and TRUE.

Referenced by RemoteConnect(), and UserInitialize().

01821 { 01822 HBITMAP hbmGray; 01823 CONST static WORD patGray[8] = {0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa}; 01824 01825 /* 01826 * Create a gray brush to be used with GrayString 01827 */ 01828 hbmGray = GreCreateBitmap(8, 8, 1, 1, (LPBYTE)patGray); 01829 01830 if (hbmGray == NULL) { 01831 return FALSE; 01832 } 01833 01834 gpsi->hbrGray = GreCreatePatternBrush(hbmGray); 01835 ghbrWhite = GreGetStockObject(WHITE_BRUSH); 01836 ghbrBlack = GreGetStockObject(BLACK_BRUSH); 01837 01838 UserAssert(ghbrWhite != NULL && ghbrBlack != NULL); 01839 01840 if (gpsi->hbrGray == NULL) { 01841 return FALSE; 01842 } 01843 01844 GreDeleteObject(hbmGray); 01845 GreSetBrushOwnerPublic(gpsi->hbrGray); 01846 ghbrHungApp = GreCreateSolidBrush(0); 01847 01848 if (ghbrHungApp == NULL) { 01849 return FALSE; 01850 } 01851 01852 GreSetBrushOwnerPublic(ghbrHungApp); 01853 01854 return TRUE; 01855 }

VOID LW_LoadProfileInitData  ) 
 

Referenced by xxxInitWindowStation().

VOID LW_LoadSomeStrings VOID   ) 
 

Definition at line 1422 of file w32/ntuser/kernel/init.c.

References gpsi, gszMAX, gszMIN, gszRESDOWN, gszRESUP, gszSCLOSE, hModuleWin, MAX_MB_STRINGS, tagSERVERINFO::MBStrings, ServerLoadString, tagMBSTRING::szName, tagMBSTRING::uID, tagMBSTRING::uStr, and VOID().

Referenced by Win32UserInitialize().

01423 { 01424 int i, str, id; 01425 01426 /* 01427 * MessageBox strings 01428 */ 01429 for (i = 0, str = STR_OK, id = IDOK; i<MAX_MB_STRINGS; i++, str++, id++) { 01430 gpsi->MBStrings[i].uStr = str; 01431 gpsi->MBStrings[i].uID = id; 01432 ServerLoadString(hModuleWin, str, gpsi->MBStrings[i].szName, sizeof(gpsi->MBStrings[i].szName) / sizeof(WCHAR)); 01433 } 01434 01435 /* 01436 * Tooltips strings 01437 */ 01438 ServerLoadString(hModuleWin, STR_MIN, gszMIN, sizeof(gszMIN) / sizeof(WCHAR)); 01439 ServerLoadString(hModuleWin, STR_MAX, gszMAX, sizeof(gszMAX) / sizeof(WCHAR)); 01440 ServerLoadString(hModuleWin, STR_RESUP, gszRESUP, sizeof(gszRESUP) / sizeof(WCHAR)); 01441 ServerLoadString(hModuleWin, STR_RESDOWN,gszRESDOWN,sizeof(gszRESDOWN)/ sizeof(WCHAR)); 01442 /* Commented out due to TandyT ... 01443 * ServerLoadString(hModuleWin, STR_SMENU, gszSMENU, sizeof(gszSMENU) / sizeof(WCHAR)); 01444 */ 01445 ServerLoadString(hModuleWin, STR_SCLOSE, gszSCLOSE, sizeof(gszSCLOSE) / sizeof(WCHAR)); 01446 }

BOOL LW_RegisterWindows BOOL  fSystem  ) 
 

Definition at line 1863 of file w32/ntuser/kernel/init.c.

References BOOL, CCLASSES, CSF_SERVERSIDEPROC, CSF_SYSTEMCLASS, CSF_WIN40COMPAT, DESKTOPCLASS, DESKWND, FALSE, FNID_DESKTOP, FNID_ICONTITLE, FNID_MENU, FNID_SCROLLBAR, FNID_SWITCH, FNID_TOOLTIP, hModuleWin, ICONTITLECLASS, InternalRegisterClassEx(), L, MENUCLASS, NULL, PtoH, SBWND, SWITCHWND, SWITCHWNDCLASS, SYSCUR, TOOLTIPCLASS, TOOLTIPWND, TRUE, UINT, xxxDefWindowProc(), xxxDesktopWndProc(), xxxEventWndProc(), xxxMenuWindowProc(), xxxSBWndProc(), xxxSwitchWndProc(), and xxxTooltipWndProc().

Referenced by xxxCreateThreadInfo().

01865 { 01866 #ifdef HUNGAPP_GHOSTING 01867 #define CCLASSES 9 01868 #else // HUNGAPP_GHOSTING 01869 #define CCLASSES 8 01870 #endif // HUNGAPP_GHOSTING 01871 01872 int i; 01873 WNDCLASSEX wndcls; 01874 01875 CONST static struct { 01876 BOOLEAN fSystem; 01877 BOOLEAN fGlobalClass; 01878 WORD fnid; 01879 UINT style; 01880 WNDPROC lpfnWndProc; 01881 int cbWndExtra; 01882 BOOL fNormalCursor : 1; 01883 HBRUSH hbrBackground; 01884 LPCTSTR lpszClassName; 01885 } rc[CCLASSES] = { 01886 { TRUE, TRUE, FNID_DESKTOP, 01887 CS_DBLCLKS, 01888 (WNDPROC)xxxDesktopWndProc, 01889 sizeof(DESKWND) - sizeof(WND), 01890 TRUE, 01891 (HBRUSH)(COLOR_BACKGROUND + 1), 01892 DESKTOPCLASS}, 01893 { TRUE, FALSE, FNID_SWITCH, 01894 CS_VREDRAW | CS_HREDRAW | CS_SAVEBITS, 01895 (WNDPROC)xxxSwitchWndProc, 01896 sizeof(SWITCHWND) - sizeof(WND), 01897 TRUE, 01898 NULL, 01899 SWITCHWNDCLASS}, 01900 { TRUE, FALSE, FNID_MENU, 01901 CS_DBLCLKS | CS_SAVEBITS, 01902 (WNDPROC)xxxMenuWindowProc, 01903 sizeof(PPOPUPMENU), 01904 FALSE, 01905 (HBRUSH)(COLOR_MENU + 1), 01906 MENUCLASS}, 01907 { FALSE, FALSE, FNID_SCROLLBAR, 01908 CS_VREDRAW | CS_HREDRAW | CS_DBLCLKS | CS_PARENTDC, 01909 (WNDPROC)xxxSBWndProc, 01910 sizeof(SBWND) - sizeof(WND), 01911 TRUE, 01912 NULL, 01913 L"ScrollBar"}, 01914 { TRUE, FALSE, FNID_TOOLTIP, 01915 CS_DBLCLKS | CS_SAVEBITS, 01916 (WNDPROC)xxxTooltipWndProc, 01917 sizeof(TOOLTIPWND) - sizeof(WND), 01918 TRUE, 01919 NULL, 01920 TOOLTIPCLASS}, 01921 { TRUE, TRUE, FNID_ICONTITLE, 01922 0, 01923 (WNDPROC)xxxDefWindowProc, 01924 0, 01925 TRUE, 01926 NULL, 01927 ICONTITLECLASS}, 01928 { FALSE, FALSE, 0, 01929 0, 01930 (WNDPROC)xxxEventWndProc, 01931 sizeof(PSVR_INSTANCE_INFO), 01932 FALSE, 01933 NULL, 01934 L"DDEMLEvent"}, 01935 #ifdef HUNGAPP_GHOSTING 01936 { TRUE, TRUE, 0, 01937 0, 01938 (WNDPROC)xxxGhostWndProc, 01939 0, 01940 TRUE, 01941 NULL, 01942 L"Ghost"}, 01943 #endif // HUNGAPP_GHOSTING 01944 { TRUE, TRUE, 0, 01945 0, 01946 (WNDPROC)xxxDefWindowProc, 01947 4, 01948 TRUE, 01949 NULL, 01950 L"Message"} 01951 }; 01952 01953 01954 /* 01955 * All other classes are registered via the table. 01956 */ 01957 wndcls.cbClsExtra = 0; 01958 wndcls.hInstance = hModuleWin; 01959 wndcls.hIcon = NULL; 01960 wndcls.hIconSm = NULL; 01961 wndcls.lpszMenuName = NULL; 01962 01963 for (i = 0; i < CCLASSES; i++) { 01964 if (fSystem && !rc[i].fSystem) { 01965 continue; 01966 } 01967 wndcls.style = rc[i].style; 01968 wndcls.lpfnWndProc = rc[i].lpfnWndProc; 01969 wndcls.cbWndExtra = rc[i].cbWndExtra; 01970 wndcls.hCursor = rc[i].fNormalCursor ? PtoH(SYSCUR(ARROW)) : NULL; 01971 wndcls.hbrBackground= rc[i].hbrBackground; 01972 wndcls.lpszClassName= rc[i].lpszClassName; 01973 01974 if (InternalRegisterClassEx(&wndcls, 01975 rc[i].fnid, 01976 CSF_SERVERSIDEPROC | CSF_WIN40COMPAT) == NULL) { 01977 RIPMSG0(RIP_WARNING, "LW_RegisterWindows: InternalRegisterClassEx failed"); 01978 return FALSE; 01979 } 01980 01981 if (fSystem && rc[i].fGlobalClass) { 01982 if (InternalRegisterClassEx(&wndcls, 01983 rc[i].fnid, 01984 CSF_SERVERSIDEPROC | CSF_SYSTEMCLASS | CSF_WIN40COMPAT) == NULL) { 01985 01986 RIPMSG0(RIP_WARNING, "LW_RegisterWindows: InternalRegisterClassEx failed"); 01987 return FALSE; 01988 } 01989 } 01990 } 01991 return TRUE; 01992 }

PMENU MakeMenuRtoL PMENU  pMenu,
BOOL  bRtoL
 

Definition at line 995 of file mncomput.c.

References tagMENU::cItems, ClearMF, ClearMFT, MFRTL, tagMENU::rgItems, SetMF, SetMFT, and tagITEM::spSubMenu.

Referenced by xxxInsertMenuItem(), and xxxSetMenuItemInfo().

00996 { 00997 PITEM pItem; 00998 int cItem; 00999 01000 if (bRtoL) 01001 SetMF(pMenu,MFRTL); 01002 else 01003 ClearMF(pMenu,MFRTL); 01004 01005 for (cItem = 0; cItem < (int)pMenu->cItems; cItem++) { 01006 pItem = pMenu->rgItems + cItem; 01007 if (bRtoL) { 01008 SetMFT(pItem, MFT_RIGHTJUSTIFY); 01009 SetMFT(pItem, MFT_RIGHTORDER); 01010 } else { 01011 ClearMFT(pItem, MFT_RIGHTJUSTIFY); 01012 ClearMFT(pItem, MFT_RIGHTORDER); 01013 } 01014 if (pItem->spSubMenu) 01015 MakeMenuRtoL(pItem->spSubMenu, bRtoL); 01016 } 01017 return pMenu; 01018 }

ULONG_PTR MapClientToServerPfn ULONG_PTR  dw  ) 
 

Definition at line 978 of file ntuser/kernel/getset.c.

References tagSERVERINFO::apfnClientA, tagSERVERINFO::apfnClientW, FNID_WNDPROCEND, FNID_WNDPROCSTART, gpsi, and STOCID.

Referenced by InternalRegisterClassEx(), xxxSetClassData(), and xxxSetWindowData().

00980 { 00981 ULONG_PTR *pdw; 00982 int i; 00983 00984 pdw = (ULONG_PTR *)&gpsi->apfnClientW; 00985 for (i = FNID_WNDPROCSTART; i <= FNID_WNDPROCEND; i++, pdw++) { 00986 if (*pdw == dw) 00987 return (ULONG_PTR)STOCID(i); 00988 } 00989 00990 pdw = (ULONG_PTR *)&gpsi->apfnClientA; 00991 for (i = FNID_WNDPROCSTART; i <= FNID_WNDPROCEND; i++, pdw++) { 00992 if (*pdw == dw) 00993 return (ULONG_PTR)STOCID(i); 00994 } 00995 00996 return 0; 00997 }

VOID MapDesktop IN OB_OPEN_REASON  OpenReason,
IN PEPROCESS Process  OPTIONAL,
IN PVOID  Object,
IN ACCESS_MASK  GrantedAccess,
IN ULONG  HandleCount
 

Referenced by UserCommitDesktopMemory(), xxxCreateDesktop(), xxxResolveDesktop(), and xxxSetThreadDesktop().

__inline VOID MarkDCEInvalid PDCE  pdce  ) 
 

Definition at line 5695 of file userk.h.

References BOOL, and VOID().

Referenced by InvalidateDce(), and xxxFreeWindow().

05706 {

VOID MarkThreadsObjects PTHREADINFO  pti  ) 
 

Definition at line 2595 of file handtabl.c.

References tagSHAREDINFO::aheList, _HANDLEENTRY::bFlags, tagHANDLETYPEINFO::bObjectCreateFlags, _HANDLEENTRY::bType, gahti, giheLast, gptiRit, gSharedInfo, gTermIO, _HEAD::h, HANDLEF_DESTROY, HMChangeOwnerThread(), ISTS, OCF_PROCESSOWNED, _HANDLEENTRY::phead, _HANDLEENTRY::pOwner, tagTERMINAL::ptiDesktop, ShowLocks(), and TYPE_FREE.

Referenced by xxxDestroyThreadInfo().

02597 { 02598 PHE pheT, pheMax; 02599 02600 pheMax = &gSharedInfo.aheList[giheLast]; 02601 for (pheT = gSharedInfo.aheList; pheT <= pheMax; pheT++) { 02602 /* 02603 * Check against free before we look at pti... because pti is stored 02604 * in the object itself, which won't be there if TYPE_FREE. 02605 */ 02606 if (pheT->bType == TYPE_FREE) 02607 continue; 02608 02609 /* 02610 * Change ownership! 02611 */ 02612 if (gahti[pheT->bType].bObjectCreateFlags & OCF_PROCESSOWNED || 02613 (PTHREADINFO)pheT->pOwner != pti) 02614 continue; 02615 02616 #if DBG 02617 /* 02618 * This is just to make sure that RIT or DT never get here 02619 */ 02620 if (ISTS() && (pti == gptiRit || pti == gTermIO.ptiDesktop)) { 02621 RIPMSG2(RIP_ERROR, "pti %#p is RIT or DT. phe %#p\n", pti, pheT); 02622 } 02623 #endif 02624 02625 HMChangeOwnerThread(pheT->phead, gptiRit); 02626 02627 #if DEBUGTAGS 02628 02629 if (IsDbgTagEnabled(DBGTAG_TrackLocks)) { 02630 /* 02631 * Object still around: print warning message. 02632 */ 02633 if (pheT->bFlags & HANDLEF_DESTROY) { 02634 TAGMSG2(DBGTAG_TrackLocks, 02635 "Zombie %s %#p still locked", 02636 gahti[pheT->bType].szObjectType, pheT->phead->h); 02637 } else { 02638 TAGMSG1(DBGTAG_TrackLocks, 02639 "Thread object %#p not destroyed.\n", 02640 pheT->phead->h); 02641 } 02642 02643 ShowLocks(pheT); 02644 } 02645 02646 #endif // DEBUGTAGS 02647 } 02648 }

void MenuRecalc void   ) 
 

Definition at line 20 of file metrics.c.

References tagSHAREDINFO::aheList, _HANDLEENTRY::bType, tagMENU::cItems, tagITEM::cxBmp, tagMENU::cxMenu, tagMENU::cyMenu, DWORD, giheLast, gSharedInfo, MNIS_MEASUREBMP, _HANDLEENTRY::phead, tagMENU::rgItems, TYPE_MENU, UINT, tagITEM::ulWidth, tagITEM::ulX, and UNDERLINE_RECALC.

Referenced by xxxSetAndDrawNCMetrics().

00021 { 00022 PMENU lpMenu; 00023 UINT iItem; 00024 PHE pheT; 00025 DWORD i; 00026 00027 /* 00028 * for (ppi = gppiFirst; ppi; ppi = ppi->ppiNext) 00029 * { 00030 * for (pMenu = ppi->lpMenus; TESTFAR(lpMenu); lpMenu = lpMenu->lpMenuNext) 00031 * { 00032 * 00033 * That was the Chicao way of walking the objects. In NT, we 00034 * walk the handle table. 00035 */ 00036 for (pheT = gSharedInfo.aheList, i = 0; i <= giheLast; i++, pheT++) { 00037 00038 if (pheT->bType == TYPE_MENU) { 00039 /* 00040 * Get a pointer to the menu. 00041 */ 00042 lpMenu = (PMENU)pheT->phead; 00043 00044 /* 00045 * Set menu size to 0 so it recalculates later when we go to 00046 * draw it again. 00047 */ 00048 lpMenu->cxMenu = 0; 00049 lpMenu->cyMenu = 0; 00050 00051 /* 00052 * Reset mnemonic underline info 00053 */ 00054 for (iItem = 0; iItem < lpMenu->cItems; iItem++) { 00055 lpMenu->rgItems[iItem].ulX = UNDERLINE_RECALC; 00056 lpMenu->rgItems[iItem].ulWidth = 0; 00057 lpMenu->rgItems[iItem].cxBmp = MNIS_MEASUREBMP; 00058 } 00059 } 00060 } 00061 }

BOOL MinToTray PWND  pwnd  ) 
 

PPOPUPMENU MNAllocPopup BOOL  fForceAlloc  ) 
 

Definition at line 143 of file mnstate.c.

References gpopupMenu, PUDF_POPUPINUSE, SET_PUDF, and TEST_PUDF.

Referenced by xxxMenuWindowProc(), and xxxMNStartMenuState().

00144 { 00145 PPOPUPMENU ppm; 00146 if (!fForceAlloc && !TEST_PUDF(PUDF_POPUPINUSE)) { 00147 SET_PUDF(PUDF_POPUPINUSE); 00148 00149 ppm = &gpopupMenu; 00150 } else { 00151 ppm = (PPOPUPMENU)UserAllocPoolWithQuota(sizeof(POPUPMENU), TAG_POPUPMENU); 00152 } 00153 00154 if (ppm) { 00155 RtlZeroMemory(ppm, sizeof(POPUPMENU)); 00156 } 00157 00158 return (ppm); 00159 }

void MNAnimate PMENUSTATE  pMenuState,
BOOL  fIterate
 

Definition at line 290 of file mndraw.c.

References _KillTimer(), _ReleaseDC(), CMS_QANIMATION, tagMENUSTATE::cxAni, tagMENUSTATE::cyAni, tagMENUSTATE::dwAniStartTime, DWORD, ExGetExclusiveWaiterCount(), ExGetSharedWaiterCount(), FADE_MENU, gcxMenuFontChar, gcyMenuFontChar, gpresUser, tagMENUSTATE::hdcWndAni, tagMENUSTATE::iAniDropDir, IDSYS_MNANIMATE, tagMENUSTATE::ixAni, tagMENUSTATE::iyAni, MNDestroyAnimationBitmap(), MultDiv, NtGetTickCount(), NULL, PAS_HORZ, PAS_LEFT, PAS_UP, PAS_VERT, tagMENUSTATE::pGlobalPopupMenu, tagPOPUPMENU::spwndActivePopup, StopFade(), TestFadeFlags(), TestWF, and WFVISIBLE.

Referenced by MNGetPopupFromMenu(), xxxMenuWindowProc(), xxxMNCloseHierarchy(), xxxMNSelectItem(), and xxxTrackPopupMenuEx().

00291 { 00292 DWORD dwTimeElapsed; 00293 int x, y, xOff, yOff, xLast, yLast; 00294 00295 if (TestFadeFlags(FADE_MENU)) { 00296 if (!fIterate) { 00297 StopFade(); 00298 } 00299 return; 00300 } 00301 00302 /* 00303 * If we're not animating, bail 00304 */ 00305 if (pMenuState->hdcWndAni == NULL) { 00306 return; 00307 } 00308 00309 /* 00310 * The active popup must be visible. It's supposed to be the 00311 * window we're animating 00312 */ 00313 UserAssert(TestWF(pMenuState->pGlobalPopupMenu->spwndActivePopup, WFVISIBLE)); 00314 00315 /* 00316 * End animation if asked to do so, if it's taking too long 00317 * or someone is waiting for the critical section 00318 */ 00319 dwTimeElapsed = NtGetTickCount() - pMenuState->dwAniStartTime; 00320 if (!fIterate 00321 || (dwTimeElapsed > CMS_QANIMATION) 00322 || (ExGetExclusiveWaiterCount(gpresUser) > 0) 00323 || (ExGetSharedWaiterCount(gpresUser) > 0)) { 00324 00325 GreBitBlt(pMenuState->hdcWndAni, 0, 0, pMenuState->cxAni, pMenuState->cyAni, pMenuState->hdcAni, 00326 0, 0, SRCCOPY | NOMIRRORBITMAP, 0xFFFFFF); 00327 00328 goto AnimationCompleted; 00329 } 00330 00331 /* 00332 * Remember current animation point and calculate new one 00333 */ 00334 xLast = pMenuState->ixAni; 00335 yLast = pMenuState->iyAni; 00336 if (pMenuState->iAniDropDir & PAS_HORZ) { 00337 pMenuState->ixAni = MultDiv(gcxMenuFontChar, dwTimeElapsed, CMS_QANIMATION / 20); 00338 if (pMenuState->ixAni > pMenuState->cxAni) { 00339 pMenuState->ixAni = pMenuState->cxAni; 00340 } 00341 } 00342 00343 if (pMenuState->iAniDropDir & PAS_VERT) { 00344 pMenuState->iyAni = MultDiv(gcyMenuFontChar, dwTimeElapsed, CMS_QANIMATION / 10); 00345 if (pMenuState->iyAni > pMenuState->cyAni) { 00346 pMenuState->iyAni = pMenuState->cyAni; 00347 } 00348 } 00349 00350 /* 00351 * if no change -- bail out 00352 */ 00353 if ((pMenuState->ixAni == xLast) && (pMenuState->iyAni == yLast)) { 00354 return; 00355 } 00356 00357 /* 00358 * Calculate source and dest coordinates 00359 */ 00360 if (pMenuState->iAniDropDir & PAS_LEFT) { 00361 x = pMenuState->cxAni - pMenuState->ixAni; 00362 xOff = 0; 00363 } else { 00364 xOff = pMenuState->cxAni - pMenuState->ixAni; 00365 x = 0; 00366 } 00367 00368 if (pMenuState->iAniDropDir & PAS_UP) { 00369 y = pMenuState->cyAni - pMenuState->iyAni; 00370 yOff = 0; 00371 } else { 00372 yOff = pMenuState->cyAni - pMenuState->iyAni; 00373 y = 0; 00374 } 00375 00376 /* 00377 * Do it 00378 */ 00379 GreBitBlt(pMenuState->hdcWndAni, x, y, pMenuState->ixAni, pMenuState->iyAni, 00380 pMenuState->hdcAni, xOff, yOff, SRCCOPY | NOMIRRORBITMAP, 0xFFFFFF); 00381 00382 /* 00383 * Check if we're done 00384 */ 00385 if ((pMenuState->cxAni == pMenuState->ixAni) 00386 && (pMenuState->cyAni == pMenuState->iyAni)) { 00387 00388 AnimationCompleted: 00389 00390 MNDestroyAnimationBitmap(pMenuState); 00391 _ReleaseDC(pMenuState->hdcWndAni); 00392 pMenuState->hdcWndAni = NULL; 00393 _KillTimer(pMenuState->pGlobalPopupMenu->spwndActivePopup, IDSYS_MNANIMATE); 00394 } 00395 00396 }

void MNCheckButtonDownState PMENUSTATE  pMenuState  ) 
 

Definition at line 206 of file ntuser/kernel/menu.c.

References _GetKeyState(), FALSE, tagMENUSTATE::fButtonDown, tagMENUSTATE::fDragAndDrop, tagMENUSTATE::fDragging, tagMENUSTATE::fIgnoreButtonUp, tagMENUSTATE::fModelessMenu, tagMENUSTATE::uButtonDownHitArea, UnlockMFMWFPWindow(), and tagMENUSTATE::vkButtonDown.

Referenced by xxxCallHandleMenuMessages(), and xxxMenuWindowProc().

00207 { 00208 /* 00209 * Modeless menus don't capture the mouse so when a mouse down 00210 * goes off the window, we need to keep watching its state. 00211 * We also might not see the button up when going on DoDragDrop loop 00212 */ 00213 UserAssert(pMenuState->fDragAndDrop || pMenuState->fModelessMenu); 00214 pMenuState->fButtonDown = ((_GetKeyState(pMenuState->vkButtonDown) & 0x8000) != 0); 00215 if (!pMenuState->fButtonDown) { 00216 pMenuState->fDragging = 00217 pMenuState->fIgnoreButtonUp = FALSE; 00218 UnlockMFMWFPWindow(&pMenuState->uButtonDownHitArea); 00219 } 00220 }

BOOL MNCreateAnimationBitmap PMENUSTATE  pMenuState,
UINT  cx,
UINT  cy
 

Definition at line 389 of file mnstate.c.

References BOOL, cy, FALSE, gpDispInfo, tagMENUSTATE::hbmAni, tagDISPLAYINFO::hdcScreen, NULL, and TRUE.

Referenced by xxxMenuWindowProc().

00390 { 00391 HBITMAP hbm = GreCreateCompatibleBitmap(gpDispInfo->hdcScreen, cx, cy); 00392 if (hbm == NULL) { 00393 RIPMSG0(RIP_WARNING, "MNSetupAnimationBitmap: Failed to create hbmAni"); 00394 return FALSE; 00395 } 00396 00397 #if DBG 00398 if (pMenuState->hdcAni == NULL) { 00399 RIPMSG0(RIP_WARNING, "MNCreateAnimationBitmap: hdcAni is NULL"); 00400 } 00401 if (pMenuState->hbmAni != NULL) { 00402 RIPMSG0(RIP_WARNING, "MNCreateAnimationBitmap: hbmAni already exists"); 00403 } 00404 #endif 00405 00406 GreSelectBitmap(pMenuState->hdcAni, hbm); 00407 pMenuState->hbmAni = hbm; 00408 return TRUE; 00409 }

void MNDestroyAnimationBitmap PMENUSTATE  pMenuState  ) 
 

Definition at line 414 of file mnstate.c.

References tagMENUSTATE::hbmAni, and NULL.

Referenced by MNAnimate(), and xxxMNEndMenuState().

00415 { 00416 GreSelectBitmap(pMenuState->hdcAni, GreGetStockObject(PRIV_STOCK_BITMAP)); 00417 UserVerify(GreDeleteObject(pMenuState->hbmAni)); 00418 pMenuState->hbmAni = NULL; 00419 }

void MNDrawArrow HDC  hdcIn,
PPOPUPMENU  ppopup,
UINT  uArrow
 

Definition at line 102 of file mndraw.c.

References _GetDCEx(), _ReleaseDC(), BitBltSysBmp(), DrawFrameControl(), tagMENU::dwArrowsOn, DWORD, gcyMenuScrollArrow, gpsi, tagMENU::hbrBack, MFMWFP_UPARROW, MSA_ATBOTTOM, MSA_ATTOP, MSA_OFF, NULL, OBI_MENUARROWDOWN, OBI_MENUARROWUP, OBI_MENUCHECK, tagWND::rcWindow, tagPOPUPMENU::spmenu, tagPOPUPMENU::spwndPopupMenu, SYSMET, and TestMF.

Referenced by MNDrawFullNC(), xxxMNInvertItem(), and xxxMNSetTop().

00103 { 00104 PWND pwnd = ppopup->spwndPopupMenu; 00105 HDC hdc; 00106 int x, y; 00107 DWORD dwBmp; 00108 DWORD dwAtCheck; 00109 DWORD dwState; 00110 00111 if (ppopup->spmenu->dwArrowsOn == MSA_OFF) { 00112 return; 00113 } 00114 00115 if (hdcIn == NULL) { 00116 hdc = _GetDCEx(pwnd, NULL, DCX_USESTYLE | DCX_WINDOW | DCX_LOCKWINDOWUPDATE); 00117 } else { 00118 hdc = hdcIn; 00119 } 00120 00121 x = SYSMET(CXFIXEDFRAME); 00122 if (!TestMF(ppopup->spmenu, MNS_NOCHECK)) { 00123 /* 00124 * Win9x: x += MNByteAlignItem(oemInfo.bm[OBI_MENUCHECK].cx); 00125 */ 00126 x += gpsi->oembmi[OBI_MENUCHECK].cx; 00127 } else { 00128 x += SYSMET(CXEDGE) * 2; 00129 } 00130 00131 if (uArrow == MFMWFP_UPARROW) { 00132 y = SYSMET(CXFIXEDFRAME); 00133 dwBmp = OBI_MENUARROWUP; 00134 dwAtCheck = MSA_ATTOP; 00135 dwState = DFCS_MENUARROWUP; 00136 } else { 00137 y = pwnd->rcWindow.bottom - pwnd->rcWindow.top - SYSMET(CYFIXEDFRAME) - gcyMenuScrollArrow; 00138 dwBmp = OBI_MENUARROWDOWN; 00139 dwAtCheck = MSA_ATBOTTOM; 00140 dwState = DFCS_MENUARROWDOWN; 00141 } 00142 00143 if (ppopup->spmenu->dwArrowsOn == dwAtCheck) { 00144 /* 00145 * go 2 ahead to inactive state bitmap 00146 */ 00147 dwBmp += 2; 00148 dwState |= DFCS_INACTIVE; 00149 } 00150 00151 if (ppopup->spmenu->hbrBack != NULL) { 00152 /* 00153 * for menus with background brushes, we can't do a straight blt 00154 * of the scroll arrows 'cause the background wouldn't be right; 00155 * need to call DrawFrameControl with DFCS_TRANSPARENT instead 00156 */ 00157 RECT rc; 00158 rc.top = y; 00159 rc.left = x; 00160 rc.right = x + gpsi->oembmi[OBI_MENUARROWUP].cx; 00161 rc.bottom = y + gpsi->oembmi[OBI_MENUARROWUP].cy; 00162 DrawFrameControl(hdc, &rc, DFC_MENU, dwState | DFCS_TRANSPARENT); 00163 } else { 00164 BitBltSysBmp(hdc, x, y, dwBmp); 00165 BitBltSysBmp(hdc, x, y, dwBmp); 00166 } 00167 00168 if (hdcIn == NULL) { 00169 _ReleaseDC(hdc); 00170 } 00171 }

void MNDrawFullNC PWND  pwnd,
HDC  hdcIn,
PPOPUPMENU  ppopup
 

Definition at line 181 of file mndraw.c.

References _GetDCEx(), _ReleaseDC(), DF_3DFACE, DrawEdge(), DrawFrame(), gcyMenuScrollArrow, tagMENU::hbrBack, InflateRect(), MFMWFP_DOWNARROW, MFMWFP_UPARROW, MNDrawArrow(), MNGetToppItem(), NULL, tagWND::rcWindow, tagPOPUPMENU::spmenu, SYSHBR, SYSMET, and tagITEM::yItem.

Referenced by xxxMenuWindowProc(), and xxxMNSetTop().

00182 { 00183 RECT rc; 00184 HDC hdc; 00185 HBRUSH hbrOld; 00186 int yTop, yBottom; 00187 POINT ptOrg; 00188 if (hdcIn == NULL) { 00189 hdc = _GetDCEx(pwnd, NULL, DCX_USESTYLE | DCX_WINDOW | DCX_LOCKWINDOWUPDATE); 00190 } else { 00191 hdc = hdcIn; 00192 } 00193 00194 rc.left = rc.top = 0; 00195 rc.right = pwnd->rcWindow.right - pwnd->rcWindow.left; 00196 rc.bottom = pwnd->rcWindow.bottom - pwnd->rcWindow.top; 00197 DrawEdge(hdc, &rc, EDGE_RAISED, (BF_RECT | BF_ADJUST)); 00198 DrawFrame(hdc, &rc, 1, DF_3DFACE); 00199 InflateRect(&rc, -SYSMET(CXBORDER), -SYSMET(CYBORDER)); 00200 00201 yTop = rc.top; 00202 yBottom = rc.bottom - gcyMenuScrollArrow; 00203 00204 GreGetBrushOrg(hdc, &ptOrg); 00205 if (ppopup->spmenu->hbrBack != NULL) { 00206 GreSetBrushOrg(hdc, 0, 00207 -(int)MNGetToppItem(ppopup->spmenu)->yItem, NULL); 00208 hbrOld = GreSelectBrush(hdc, ppopup->spmenu->hbrBack); 00209 } else { 00210 hbrOld = GreSelectBrush(hdc, SYSHBR(MENU)); 00211 } 00212 00213 rc.right -= rc.left; 00214 GrePatBlt(hdc, rc.left, yTop, rc.right, gcyMenuScrollArrow, PATCOPY); 00215 MNDrawArrow(hdc, ppopup, MFMWFP_UPARROW); 00216 GrePatBlt(hdc, rc.left, yBottom, rc.right, gcyMenuScrollArrow, PATCOPY); 00217 MNDrawArrow(hdc, ppopup, MFMWFP_DOWNARROW); 00218 00219 GreSetBrushOrg(hdc, ptOrg.x, ptOrg.y, NULL); 00220 GreSelectBrush(hdc, hbrOld); 00221 00222 if (hdcIn == NULL) { 00223 _ReleaseDC(hdc); 00224 } 00225 }

BOOL MNEndMenuStateNotify PMENUSTATE  pMenuState  ) 
 

Definition at line 234 of file mnstate.c.

References BOOL, FALSE, GETPTI, NULL, tagMENUSTATE::pGlobalPopupMenu, tagTHREADINFO::pMenuState, tagMENUSTATE::pmnsPrev, tagMENUSTATE::ptiMenuStateOwner, tagPOPUPMENU::spwndNotify, and TRUE.

Referenced by xxxDestroyWindow(), and xxxMNEndMenuState().

00235 { 00236 PTHREADINFO ptiNotify; 00237 00238 if (pMenuState->pGlobalPopupMenu->spwndNotify != NULL) { 00239 ptiNotify = GETPTI(pMenuState->pGlobalPopupMenu->spwndNotify); 00240 if (ptiNotify != pMenuState->ptiMenuStateOwner) { 00241 /* 00242 * Later5.0 GerardoB. xxxMNStartMenuState no longer allows this. 00243 * This is dead code that I'll remove eventually 00244 */ 00245 UserAssert(ptiNotify == pMenuState->ptiMenuStateOwner); 00246 00247 UserAssert(ptiNotify->pMenuState == pMenuState); 00248 UserAssert(pMenuState->pmnsPrev == NULL); 00249 ptiNotify->pMenuState = NULL; 00250 return TRUE; 00251 } 00252 } 00253 00254 return FALSE; 00255 }

void MNEraseBackground HDC  hdc,
PMENU  pmenu,
int  x,
int  y,
int  cx,
int  cy
 

Definition at line 235 of file mndraw.c.

References BOOL, cy, tagMENU::dwArrowsOn, FALSE, gcyMenuScrollArrow, tagMENU::hbrBack, MFWINDOWDC, MNGetToppItem(), MNXBORDER, MNYBORDER, MSA_OFF, NULL, TestMF, TRUE, and tagITEM::yItem.

Referenced by xxxMenuWindowProc(), and xxxMNInvertItem().

00236 { 00237 BOOL fSetOrg; 00238 HBRUSH hbrOld; 00239 POINT ptOrg; 00240 00241 UserAssert(pmenu->hbrBack != NULL); 00242 00243 fSetOrg = TRUE; 00244 GreGetBrushOrg(hdc, &ptOrg); 00245 /* 00246 * If we have scrollbars 00247 */ 00248 if (pmenu->dwArrowsOn != MSA_OFF) { 00249 /* 00250 * If not drawing on the client area only 00251 */ 00252 if (TestMF(pmenu, MFWINDOWDC)) { 00253 ptOrg.x = 0; 00254 ptOrg.y = -(int)MNGetToppItem(pmenu)->yItem; 00255 } else { 00256 ptOrg.x = -MNXBORDER; 00257 ptOrg.y = -MNYBORDER - gcyMenuScrollArrow - MNGetToppItem(pmenu)->yItem; 00258 } 00259 } else { 00260 if (TestMF(pmenu, MFWINDOWDC)) { 00261 ptOrg.x = MNXBORDER; 00262 ptOrg.y = MNYBORDER; 00263 } else { 00264 fSetOrg = FALSE; 00265 } 00266 } 00267 00268 if (fSetOrg) { 00269 GreSetBrushOrg(hdc, ptOrg.x, ptOrg.y, &ptOrg); 00270 } 00271 hbrOld = GreSelectBrush(hdc, pmenu->hbrBack); 00272 00273 GrePatBlt(hdc, x, y, cx, cy, PATCOPY); 00274 00275 if (fSetOrg) { 00276 GreSetBrushOrg(hdc, ptOrg.x, ptOrg.y, NULL); 00277 } 00278 GreSelectBrush(hdc, hbrOld); 00279 }

UINT MNFindItemInColumn PMENU  pMenu,
UINT  idxB,
int  dir,
BOOL  fRoot
 

Definition at line 124 of file mnkey.c.

References tagMENU::cItems, dir(), End, MFMWFP_NOITEM, MNFindNextValidItem(), tagMENU::rgItems, UINT, tagITEM::xItem, and tagITEM::yItem.

Referenced by xxxMNKeyDown().

00129 { 00130 int dxMin; 00131 int dyMin; 00132 int dxMax; 00133 int dyMax; 00134 int xB; 00135 int yB; 00136 UINT idxE; 00137 UINT idxR; 00138 UINT cItems; 00139 PITEM pItem; 00140 00141 cItems = pMenu->cItems; 00142 idxR = MFMWFP_NOITEM; 00143 idxE = MNFindNextValidItem(pMenu, MFMWFP_NOITEM, dir, 0); 00144 if (idxE == -1) 00145 goto End; 00146 00147 dxMin = dyMin = 20000; 00148 00149 if (idxB >= pMenu->cItems) 00150 return idxR; 00151 00152 pItem = &pMenu->rgItems[idxB]; 00153 xB = pItem->xItem; 00154 yB = pItem->yItem; 00155 00156 while (cItems-- > 0 && 00157 (idxB = MNFindNextValidItem(pMenu, idxB, dir, 0)) != idxE) { 00158 pItem = &pMenu->rgItems[idxB]; 00159 dxMax = xB - pItem->xItem; 00160 dyMax = yB - pItem->yItem; 00161 00162 if (dxMax < 0) 00163 dxMax = (-dxMax); 00164 if (dyMax < 0) 00165 dyMax = (-dyMax); 00166 00167 // See if this item is nearer than the last item found 00168 // -------------------------------------------------------- 00169 // (fRoot || dxMax) -- this condition means that if it's 00170 // not the actual menu bar menu that we're dealing with, 00171 // then the item below/above (same X value as) the selected 00172 // item is not a valid one to move to 00173 if ((dyMax < dyMin) && (fRoot || dxMax) && dxMax <= dxMin) { 00174 dxMin = dxMax; 00175 dyMin = dyMax; 00176 idxR = idxB; 00177 } 00178 } 00179 00180 End: 00181 return idxR; 00182 }

UINT MNFindNextValidItem PMENU  pMenu,
int  i,
int  dir,
UINT  flags
 

Definition at line 34 of file mnkey.c.

References BOOL, tagMENU::cItems, dir(), FALSE, tagITEM::hbmp, MFMWFP_NOITEM, MNF_DONTSKIPSEPARATORS, tagMENU::rgItems, TestMFT, TRUE, and UINT.

Referenced by MNFindItemInColumn(), xxxMenuWindowProc(), xxxMNFindChar(), and xxxMNKeyDown().

00039 { 00040 int iStart; 00041 BOOL cont = TRUE; 00042 int cItems = pMenu->cItems; 00043 PITEM pItem; 00044 00045 if ((i < 0) && (dir > 0)) 00046 // going forward from beginning -- stop after last menu item 00047 i = iStart = cItems; 00048 else if ((i >= cItems) && (dir < 0)) 00049 // going backward from end -- stop after first menu item 00050 i = iStart = -1; 00051 else 00052 iStart = i; 00053 00054 if (!cItems) 00055 return(MFMWFP_NOITEM); 00056 00057 // b#8997 - if we have these conditions and enter 00058 // loop will go blistic ( infin ) 00059 // fix: jump over code and come loop to i == iStart will now stop us 00060 if ( ( i == 0 ) && ( cItems == 1 ) && ( dir > 0 ) ) 00061 { 00062 dir = 0; 00063 goto artsquickndirtybugfix; 00064 } 00065 00066 // 00067 // Loop thru menu items til (1) we find a valid item 00068 // or (2) we make it back to the start item (iStart) 00069 while (TRUE) { 00070 i += dir; 00071 00072 if ((i == iStart) || (dir == 0)) 00073 // we made it back to start item -- return NOT FOUND 00074 return MFMWFP_NOITEM; 00075 00076 // keep 'i' in the range: 0 <= i < cItems 00077 if (i >= cItems) { 00078 i = -1; 00079 continue; 00080 } 00081 else if (i < 0) { 00082 i = cItems; 00083 continue; 00084 } 00085 00086 artsquickndirtybugfix: 00087 pItem = pMenu->rgItems + i; 00088 00089 // skip ownerdraw - seperators even though there not NULL 00090 if (TestMFT(pItem, MFT_SEPARATOR)) { 00091 // 00092 // Skip non-separator (if asked) empty items. With hot-tracking, 00093 // it is acceptable for them to be selected. In truth, it was possible 00094 // in Win3.1 too, but less likely. 00095 // 00096 if (!(flags & MNF_DONTSKIPSEPARATORS)) { 00097 continue; 00098 } 00099 } else if ((pItem->hbmp >= HBMMENU_MBARFIRST) && (pItem->hbmp <= HBMMENU_MBARLAST)) { 00100 /* 00101 * Skip close & minimize & restore buttons 00102 */ 00103 continue; 00104 } 00105 00106 // return index of found item 00107 return(i); 00108 } 00109 00110 // 00111 // We should never get here! 00112 // 00113 UserAssert(FALSE); 00114 }

void MNFlushDestroyedPopups PPOPUPMENU  ppopupmenu,
BOOL  fUnlock
 

Definition at line 91 of file mnstate.c.

References FALSE, tagPOPUPMENU::fDelayedFree, tagPOPUPMENU::fDestroyed, IsRootPopupMenu(), MNFreePopup(), NULL, tagPOPUPMENU::ppmDelayedFree, and tagPOPUPMENU::ppopupmenuRoot.

Referenced by MNFreePopup(), and xxxMNLoop().

00092 { 00093 PPOPUPMENU ppmDestroyed, ppmFree; 00094 00095 UserAssert(IsRootPopupMenu(ppopupmenu)); 00096 00097 /* 00098 * Walk ppmDelayedFree 00099 */ 00100 ppmDestroyed = ppopupmenu; 00101 while (ppmDestroyed->ppmDelayedFree != NULL) { 00102 /* 00103 * If it's marked as destroyed, unlink it and free it 00104 */ 00105 if (ppmDestroyed->ppmDelayedFree->fDestroyed) { 00106 ppmFree = ppmDestroyed->ppmDelayedFree; 00107 ppmDestroyed->ppmDelayedFree = ppmFree->ppmDelayedFree; 00108 UserAssert(ppmFree != ppmFree->ppopupmenuRoot); 00109 MNFreePopup(ppmFree); 00110 } else { 00111 /* 00112 * fUnlock is TRUE if the root popup is being destroyed; if 00113 * so, reset fDelayedFree and unlink it 00114 */ 00115 if (fUnlock) { 00116 /* 00117 * This means that the root popup is going away before 00118 * some of the hierarchical popups have been destroyed. 00119 * This can happen if someone destroys one of the menu 00120 * windows breaking the spwndNextPopup chain. 00121 */ 00122 ppmDestroyed->ppmDelayedFree->fDelayedFree = FALSE; 00123 /* 00124 * Stop here so we can figure how this happened. 00125 */ 00126 UserAssert(ppmDestroyed->ppmDelayedFree->fDelayedFree); 00127 ppmDestroyed->ppmDelayedFree = ppmDestroyed->ppmDelayedFree->ppmDelayedFree; 00128 } else { 00129 /* 00130 * Not fDestroyed so move to the next one. 00131 */ 00132 ppmDestroyed = ppmDestroyed->ppmDelayedFree; 00133 } /* fUnlock */ 00134 } /* fDestroyed */ 00135 } /* while ppmDelayedFree */ 00136 00137 }

VOID MNFreeItem PMENU  pMenu,
PITEM  pItem,
BOOL  fFreeItemPopup
 

Definition at line 617 of file mnchange.c.

References _DestroyMenu(), FreeItemBitmap(), FreeItemString(), tagITEM::spSubMenu, and UnlockSubMenu().

Referenced by _DestroyMenu(), xxxInsertMenuItem(), and xxxRemoveDeleteMenuHelper().

00621 { 00622 PMENU pSubMenu; 00623 00624 FreeItemBitmap(pItem); 00625 FreeItemString(pMenu, pItem); 00626 00627 pSubMenu = UnlockSubMenu(pMenu, &(pItem->spSubMenu)); 00628 if (pSubMenu) { 00629 if (fFreeItemPopup) { 00630 _DestroyMenu(pSubMenu); 00631 } 00632 } 00633 }

VOID MNFreePopup PPOPUPMENU  ppopupmenu  ) 
 

Definition at line 165 of file mnstate.c.

References CLEAR_PUDF, DF_MENUINUSE, tagDESKTOP::dwDTFlags, tagPOPUPMENU::fDesktopMenu, tagPOPUPMENU::fFreed, tagPOPUPMENU::fIsMenuBar, FNID_MENU, GETFNID, gpopupMenu, IsRootPopupMenu(), MNFlushDestroyedPopups(), NULL, tagPOPUPMENU::ppopupmenuRoot, PtiCurrent, PUDF_POPUPINUSE, tagPOPUPMENU::spmenu, tagPOPUPMENU::spmenuAlternate, tagPOPUPMENU::spwndActivePopup, tagDESKTOP::spwndMenu, tagPOPUPMENU::spwndNextPopup, tagPOPUPMENU::spwndNotify, tagPOPUPMENU::spwndPopupMenu, tagPOPUPMENU::spwndPrevPopup, TEST_PUDF, TRUE, Unlock, UnlockPopupMenu(), Validateppopupmenu, and VOID().

Referenced by MNFlushDestroyedPopups(), xxxMNDestroyHandler(), xxxMNEndMenuState(), and xxxMNStartMenuState().

00167 { 00168 00169 Validateppopupmenu(ppopupmenu); 00170 00171 if (IsRootPopupMenu(ppopupmenu)) { 00172 MNFlushDestroyedPopups (ppopupmenu, TRUE); 00173 } 00174 #if DBG 00175 /* 00176 * If this is not a cached menu and it corresponds to a menu window, 00177 * then the reference to the popup must be cleared at this point since 00178 * we're going to free this popup 00179 */ 00180 if (ppopupmenu->spwndPopupMenu != NULL) { 00181 if (!ppopupmenu->fDesktopMenu && !ppopupmenu->fIsMenuBar) { 00182 UserAssert(GETFNID(ppopupmenu->spwndPopupMenu) == FNID_MENU); 00183 UserAssert(((PMENUWND)ppopupmenu->spwndPopupMenu)->ppopupmenu == NULL); 00184 } 00185 } 00186 #endif 00187 Unlock(&ppopupmenu->spwndPopupMenu); 00188 /* 00189 * if spwndNextPopup is not NULL, we're breaking the chain and spwndNext won't 00190 * get closed. I won't remove the unlock since it has 00191 * always been there. 00192 */ 00193 UserAssert(ppopupmenu->spwndNextPopup == NULL); 00194 Unlock(&ppopupmenu->spwndNextPopup); 00195 00196 Unlock(&ppopupmenu->spwndPrevPopup); 00197 UnlockPopupMenu(ppopupmenu, &ppopupmenu->spmenu); 00198 UnlockPopupMenu(ppopupmenu, &ppopupmenu->spmenuAlternate); 00199 Unlock(&ppopupmenu->spwndNotify); 00200 Unlock(&ppopupmenu->spwndActivePopup); 00201 00202 #if DBG 00203 if (!ppopupmenu->fDesktopMenu) { 00204 ppopupmenu->fFreed = TRUE; 00205 } else { 00206 PDESKTOP pdesk = PtiCurrent()->rpdesk; 00207 UserAssert(pdesk->dwDTFlags & DF_MENUINUSE); 00208 UserAssert(((PMENUWND)pdesk->spwndMenu)->ppopupmenu == ppopupmenu); 00209 } 00210 #endif 00211 00212 if (ppopupmenu->fDesktopMenu) { 00213 PtiCurrent()->rpdesk->dwDTFlags &= ~DF_MENUINUSE; 00214 /* The desktop menu window points to this popup so don't leave bogus stuff in it */ 00215 ppopupmenu->ppopupmenuRoot = NULL; 00216 } else if (ppopupmenu == &gpopupMenu) { 00217 UserAssert(TEST_PUDF(PUDF_POPUPINUSE)); 00218 CLEAR_PUDF(PUDF_POPUPINUSE); 00219 } else { 00220 UserFreePool(ppopupmenu); 00221 } 00222 }

PITEM MNGetpItem PPOPUPMENU  ppopup,
UINT  uIndex
 

Definition at line 136 of file ntuser/kernel/menu.c.

References tagMENU::cItems, NULL, tagMENU::rgItems, and tagPOPUPMENU::spmenu.

Referenced by xxxMenuWindowProc(), xxxMNSetGapState(), and xxxMNUpdateDraggingInfo().

00137 { 00138 if ((ppopup == NULL) 00139 || (uIndex >= ppopup->spmenu->cItems)) { 00140 00141 return NULL; 00142 } 00143 00144 return ppopup->spmenu->rgItems + uIndex; 00145 }

PPOPUPMENU MNGetPopupFromMenu PMENU  pMenu,
PMENUSTATE ppMenuState
 

Definition at line 1027 of file mnchange.c.

References FALSE, tagMENUSTATE::fInsideMenuLoop, tagPOPUPMENU::fIsMenuBar, GetpMenuState(), MNAnimate(), NULL, tagMENUSTATE::pGlobalPopupMenu, tagPOPUPMENU::spmenu, tagPOPUPMENU::spwndNextPopup, and tagMENU::spwndNotify.

Referenced by GetMenuPwnd(), MNFadeSelection(), xxxEnableMenuItem(), xxxInsertMenuItem(), xxxRemoveDeleteMenuHelper(), xxxSetLPITEMInfo(), and xxxSetMenuInfo().

01028 { 01029 PPOPUPMENU ppopup; 01030 PMENUSTATE pMenuState; 01031 01032 /* 01033 * If this menu doesn't have a notification window, then 01034 * it cannot be in menu mode 01035 */ 01036 if (pMenu->spwndNotify == NULL) { 01037 return NULL; 01038 } 01039 01040 /* 01041 * If no pMenuState, no menu mode 01042 */ 01043 pMenuState = GetpMenuState(pMenu->spwndNotify); 01044 if (pMenuState == NULL) { 01045 return NULL; 01046 } 01047 01048 /* 01049 * If not in the menu loop, not yet or no longer in menu mode 01050 */ 01051 if (!pMenuState->fInsideMenuLoop) { 01052 return NULL; 01053 } 01054 01055 /* 01056 * return pMenuState if requested 01057 */ 01058 if (ppMenuState != NULL) { 01059 *ppMenuState = pMenuState; 01060 } 01061 01062 01063 /* 01064 * Starting from the root popup, find the popup associated to this menu 01065 */ 01066 ppopup = pMenuState->pGlobalPopupMenu; 01067 while (ppopup != NULL) { 01068 /* 01069 * found? 01070 */ 01071 if (ppopup->spmenu == pMenu) { 01072 if (ppopup->fIsMenuBar) { 01073 return NULL; 01074 } 01075 /* 01076 * Since the menu is being modified, let's kill any animation. 01077 */ 01078 MNAnimate(pMenuState, FALSE); 01079 return ppopup; 01080 } 01081 /* 01082 * If no more popups, bail 01083 */ 01084 if (ppopup->spwndNextPopup == NULL) { 01085 return NULL; 01086 } 01087 01088 /* 01089 * Next popup 01090 */ 01091 ppopup = ((PMENUWND)ppopup->spwndNextPopup)->ppopupmenu; 01092 } 01093 01094 return NULL; 01095 }

__inline PITEM MNGetSelectedpitem PPOPUPMENU  ppopupmenu  ) 
 

Definition at line 4751 of file userk.h.

References NULL.

04754 {

__inline PITEM MNGetToppItem PMENU  pMenu  ) 
 

Definition at line 4743 of file userk.h.

References NULL.

Referenced by MNDrawFullNC(), MNEraseBackground(), MNItemHitTest(), xxxMenuDraw(), xxxMNInvertItem(), xxxMNPositionHierarchy(), xxxMNSetGapState(), xxxMNSetTop(), xxxMNUpdateDraggingInfo(), and xxxMNUpdateShownMenu().

04743 : NULL); 04744 } 04745 __inline BOOL IsInsideMenuLoop(PTHREADINFO pti) 04746 {

__inline BOOL MNIsItemSelected PPOPUPMENU  ppopupmenu  ) 
 

Definition at line 4747 of file userk.h.

References NULL.

Referenced by xxxHandleMenuMessages(), xxxMNDestroyHandler(), and xxxMNSelectItem().

04750 {

__inline BOOL MNIsScrollArrowSelected PPOPUPMENU  ppopupmenu  ) 
 

Definition at line 4755 of file userk.h.

Referenced by xxxMNSelectItem().

04758 { 04759 return ((int)ppopupmenu->posSelectedItem >= 0);

VOID MNPositionSysMenu PWND  pwnd,
PMENU  pSysMenu
 

Definition at line 25 of file mnstate.c.

References tagMENU::cItems, tagITEM::cxItem, tagITEM::cyItem, FALSE, GetWindowBorders(), Lock, NULL, OffsetRect(), tagMENU::rgItems, tagMENU::spwndNotify, SYSMET, TestMF, TestWF, TRUE, WEFTOOLWINDOW, WFMINIMIZED, tagITEM::xItem, and tagITEM::yItem.

Referenced by xxxMNInvertItem(), xxxMNKeyFilter(), xxxMNStartMenu(), and xxxSetSystemMenu().

00028 { 00029 RECT rc; 00030 PITEM pItem; 00031 00032 if (pmenusys == NULL) { 00033 RIPERR0(ERROR_INVALID_HANDLE, 00034 RIP_WARNING, 00035 "Invalid menu handle pmenusys (NULL) to MNPositionSysMenu"); 00036 00037 return; 00038 } 00039 00040 /* 00041 * Whoever positions the menu becomes the owner 00042 */ 00043 if (pwnd != pmenusys->spwndNotify) { 00044 Lock(&pmenusys->spwndNotify, pwnd); 00045 } 00046 00047 /* 00048 * Setup the SysMenu hit rectangle. 00049 */ 00050 rc.top = rc.left = 0; 00051 00052 if (TestWF(pwnd, WEFTOOLWINDOW)) { 00053 rc.right = SYSMET(CXSMSIZE); 00054 rc.bottom = SYSMET(CYSMSIZE); 00055 } else { 00056 rc.right = SYSMET(CXSIZE); 00057 rc.bottom = SYSMET(CYSIZE); 00058 } 00059 00060 if (!TestWF(pwnd, WFMINIMIZED)) { 00061 int cBorders; 00062 00063 cBorders = GetWindowBorders(pwnd->style, pwnd->ExStyle, TRUE, FALSE); 00064 OffsetRect(&rc, cBorders*SYSMET(CXBORDER), cBorders*SYSMET(CYBORDER)); 00065 } 00066 00067 /* 00068 * Offset the System popup menu. 00069 */ 00070 if (!TestMF(pmenusys, MF_POPUP) && (pmenusys->cItems > 0)) { 00071 pItem = pmenusys->rgItems; 00072 if (pItem) { 00073 pItem->yItem = rc.top; 00074 pItem->xItem = rc.left; 00075 pItem->cyItem = rc.bottom - rc.top; 00076 pItem->cxItem = rc.right - rc.left; 00077 } 00078 } 00079 else 00080 // BOGUS -- MF_POPUP should never be set on a MENU -- only a MENU ITEM 00081 UserAssert(FALSE); 00082 }

UINT MNSetTimerToCloseHierarchy PPOPUPMENU  ppopup  ) 
 

Definition at line 3917 of file ntuser/kernel/menu.c.

References _SetTimer(), tagPOPUPMENU::fAboutToHide, tagPOPUPMENU::fHideTimer, tagPOPUPMENU::fHierarchyDropped, gdtMNDropDown, IDSYS_MNHIDE, NULL, tagPOPUPMENU::spwndNextPopup, tagPOPUPMENU::spwndPopupMenu, TRUE, and UINT.

Referenced by xxxMNSelectItem().

03918 { 03919 03920 if (!ppopup->fHierarchyDropped) 03921 return(0); 03922 03923 if (ppopup->fHideTimer) 03924 return(1); 03925 03926 if (!_SetTimer(ppopup->spwndPopupMenu, IDSYS_MNHIDE, gdtMNDropDown, NULL)) 03927 return((UINT) -1); 03928 03929 ppopup->fHideTimer = TRUE; 03930 03931 ppopup = ((PMENUWND)(ppopup->spwndNextPopup))->ppopupmenu; 03932 ppopup->fAboutToHide = TRUE; 03933 03934 return(1); 03935 }

BOOL MNSetupAnimationDC PMENUSTATE  pMenuState  ) 
 

Definition at line 425 of file mnstate.c.

References BOOL, FALSE, ghMenuFont, gMenuState, gpDispInfo, tagDISPLAYINFO::hdcScreen, NULL, and TRUE.

Referenced by FinalUserInit(), and xxxMNAllocMenuState().

00426 { 00427 pMenuState->hdcAni = GreCreateCompatibleDC(gpDispInfo->hdcScreen); 00428 if (pMenuState->hdcAni == NULL) { 00429 RIPMSG0(RIP_WARNING, "MNSetupAnimationDC: Failed to create hdcAnimate"); 00430 UserAssert(pMenuState != &gMenuState); 00431 return FALSE; 00432 } 00433 GreSelectFont(pMenuState->hdcAni, ghMenuFont); 00434 return TRUE; 00435 }

ULONG MonotonicTick  ) 
 

Definition at line 48 of file ntinput.c.

References NtGetTickCount().

00049 { 00050 static ULONG lasttick = 0; 00051 ULONG newtick; 00052 00053 newtick = NtGetTickCount(); 00054 if (newtick > lasttick) { 00055 lasttick = newtick; // use the new tick since it is larger 00056 } else { 00057 lasttick++; // artificially bump the tick up one. 00058 } 00059 return lasttick; 00060 }

PWND NextTopWindow PTHREADINFO  pti,
PWND  pwnd,
PWND  pwndSkip,
DWORD  flags
 

Definition at line 2431 of file focusact.c.

References BOOL, CheckTopLevelOnly(), FALSE, GNT_NextTopScan(), NTW_GetNextTop(), NTW_GetPrevTop(), NTW_IGNORETOOLWINDOW, NTW_PREVIOUS, NULL, PWNDDESKTOP, TestWF, TRUE, WEFNOACTIVATE, WEFTOOLWINDOW, WFDISABLED, and WFVISIBLE.

Referenced by IsTopmostRealApp(), xxxActivateWindow(), xxxMenuWindowProc(), xxxNextWindow(), and xxxOldNextWindow().

02436 { 02437 BOOL fFoundFirstUnowned; 02438 PWND pwndPrev; 02439 PWND pwndStart = pwnd; 02440 PWND pwndFirstUnowned; 02441 02442 /* 02443 * If the search gets to the first unowned window TWICE (See NTW_GetNextTop), 02444 * we couldn't find a window 02445 */ 02446 pwndFirstUnowned = GNT_NextTopScan(pti, NULL, NULL); 02447 fFoundFirstUnowned = FALSE; 02448 02449 if (pwnd == NULL) { 02450 pwnd = NTW_GetNextTop(pti, NULL); 02451 02452 /* 02453 * Don't allow desktop windows. 02454 */ 02455 pwnd = pwndStart = CheckTopLevelOnly(pwnd); 02456 02457 if (pwnd == NULL) 02458 return NULL; // No more windows owned by the thread 02459 02460 goto Loop; 02461 } 02462 02463 /* 02464 * Don't allow desktop windows. 02465 */ 02466 pwnd = pwndStart = CheckTopLevelOnly(pwnd); 02467 if (pwnd == NULL) 02468 return NULL; // No more windows owned by this thread 02469 02470 /* 02471 * Don't allow desktop windows. 02472 */ 02473 pwndSkip = CheckTopLevelOnly(pwndSkip); 02474 02475 02476 02477 while (TRUE) { 02478 pwndPrev = pwnd; 02479 pwnd = ((flags & NTW_PREVIOUS) ? NTW_GetPrevTop(pti, pwnd) : NTW_GetNextTop(pti, pwnd)); 02480 02481 /* 02482 * If we've cycled to where we started, couldn't find one: return NULL 02483 */ 02484 if (pwnd == pwndStart) 02485 break; 02486 02487 if (pwnd == pwndFirstUnowned) { 02488 if (fFoundFirstUnowned) { 02489 break; 02490 } else { 02491 fFoundFirstUnowned = TRUE; 02492 } 02493 } 02494 02495 if (pwnd == NULL) 02496 break; 02497 02498 /* 02499 * If we've cycled over desktops, then return NULL because we'll 02500 * never hit pwndStart. 02501 */ 02502 if (PWNDDESKTOP(pwndStart) != PWNDDESKTOP(pwnd)) 02503 break; 02504 02505 /* 02506 * going nowhere is a bad sign. 02507 */ 02508 if (pwndPrev == pwnd) { 02509 /* 02510 * This is a temporary fix chosen because its safe. This case 02511 * was hit when a window failed the NCCREATE message and fell 02512 * into xxxFreeWindow and left the critical section after being 02513 * unlinked. The app then died and entered cleanup code and 02514 * tried to destroy this window again. 02515 */ 02516 break; 02517 } 02518 02519 Loop: 02520 if (pwnd == pwndSkip) 02521 continue; 02522 02523 /* 02524 * If it's visible, not disabled, not a noactivate window 02525 * and either we're not ignoringtool windows or it's not a 02526 * tool window, then we've got it. 02527 */ 02528 if (TestWF(pwnd, WFVISIBLE) && 02529 !TestWF(pwnd, WFDISABLED) && 02530 !TestWF(pwnd, WEFNOACTIVATE) && 02531 (!(flags & NTW_IGNORETOOLWINDOW) || !TestWF(pwnd, WEFTOOLWINDOW))) { 02532 02533 return pwnd; 02534 } 02535 } 02536 02537 return NULL; 02538 }

VOID NlsKbdSendIMEProc DWORD  dwImeOpen,
DWORD  dwImeConversion
 

Definition at line 1071 of file fekbd.c.

References GetAppImeCompatFlags(), gpqForeground, NlsKbdSendIMENotification(), NULL, tagQ::ptiKeyboard, and VOID().

Referenced by NlsAlphanumericModeProc(), NlsConvOrNonConvProc(), NlsHiraganaModeProc(), NlsKanaEventProc(), and NlsKatakanaModeProc().

01072 { 01073 if (gpqForeground != NULL && gpqForeground->ptiKeyboard != NULL && 01074 (!(GetAppImeCompatFlags(gpqForeground->ptiKeyboard) & IMECOMPAT_HYDRACLIENT))) { 01075 NlsKbdSendIMENotification(dwImeOpen, dwImeConversion); 01076 } 01077 }

VOID OffsetChildren PWND  pwnd,
int  dx,
int  dy,
LPRECT  prcHitTest
 

Definition at line 5543 of file swp.c.

References FindSpb(), gpDispInfo, tagDISPLAYINFO::hDev, HRGN_FULL, IntersectRect(), NULL, OffsetRect(), PtoHq, tagWND::rcWindow, tagWND::spwndChild, TestWF, VOID(), WEFLAYERED, WFHASSPB, and WFMAXFAKEREGIONAL.

Referenced by xxxScrollWindowEx(), and zzzChangeStates().

05548 { 05549 RECT rc; 05550 PWND pwndStop; 05551 05552 if (!pwnd->spwndChild) 05553 return; 05554 05555 pwndStop = pwnd; 05556 pwnd = pwndStop->spwndChild; 05557 for (;;) { 05558 /* 05559 * Skip windows that don't intersect prcHitTest... 05560 */ 05561 if (prcHitTest && !IntersectRect(&rc, prcHitTest, &pwnd->rcWindow)) 05562 goto NextWindow; 05563 05564 pwnd->rcWindow.left += dx; 05565 pwnd->rcWindow.right += dx; 05566 pwnd->rcWindow.top += dy; 05567 pwnd->rcWindow.bottom += dy; 05568 05569 pwnd->rcClient.left += dx; 05570 pwnd->rcClient.right += dx; 05571 pwnd->rcClient.top += dy; 05572 pwnd->rcClient.bottom += dy; 05573 05574 if (pwnd->hrgnUpdate > HRGN_FULL && !TestWF(pwnd, WFMAXFAKEREGIONAL)) { 05575 GreOffsetRgn(pwnd->hrgnUpdate, dx, dy); 05576 } 05577 05578 /* 05579 * Change position of window region, if it has one 05580 */ 05581 if (pwnd->hrgnClip != NULL) 05582 GreOffsetRgn(pwnd->hrgnClip, dx, dy); 05583 05584 if (TestWF(pwnd, WFHASSPB)) 05585 OffsetRect(&(FindSpb(pwnd))->rc, dx, dy); 05586 05587 #ifdef CHILD_LAYERING 05588 if (TestWF(pwnd, WEFLAYERED)) { 05589 POINT ptPos = {pwnd->rcWindow.left, pwnd->rcWindow.top}; 05590 05591 GreUpdateSprite(gpDispInfo->hDev, PtoHq(pwnd), NULL, NULL, 05592 &ptPos, NULL, NULL, NULL, 0, NULL, 0, NULL); 05593 } 05594 #endif // CHILD_LAYERING 05595 05596 /* 05597 * Recurse into the child tree if there are children. 05598 */ 05599 if (pwnd->spwndChild) { 05600 pwnd = pwnd->spwndChild; 05601 continue; 05602 } 05603 05604 NextWindow: 05605 if (pwnd->spwndNext) { 05606 /* 05607 * Recurse to the next sibling in the list. 05608 */ 05609 pwnd = pwnd->spwndNext; 05610 } else { 05611 for (;;) { 05612 /* 05613 * We're at the end of the sibling window list. 05614 * Go to the parent's next window. 05615 */ 05616 pwnd = pwnd->spwndParent; 05617 if (pwnd == pwndStop) 05618 return; 05619 05620 if (pwnd->spwndNext) { 05621 pwnd = pwnd->spwndNext; 05622 break; 05623 } 05624 } 05625 } 05626 } 05627 }

BOOLEAN OkayToCloseDesktop IN PEPROCESS Process  OPTIONAL,
IN PVOID  Object,
IN HANDLE  Handle
 

BOOLEAN OkayToCloseWindowStation IN PEPROCESS Process  OPTIONAL,
IN PVOID  Object,
IN HANDLE  Handle
 

Referenced by Win32UserInitialize().

HANDLE OpenCacheKeyEx PUNICODE_STRING pProfileUserName  OPTIONAL,
UINT  idSection,
ACCESS_MASK  amRequest,
PDWORD  pdwPolicyFlags
 

Referenced by CheckDesktopPolicy(), CheckDesktopPolicyChange(), FastGetProfileDwordW(), FastGetProfileKeysW(), FastGetProfileStringW(), FastGetProfileValue(), FastWriteProfileStringW(), FastWriteProfileValue(), and xxxUpdatePerUserSystemParameters().

BOOL OpenDesktopCompletion PDESKTOP  pdesk,
HDESK  hdesk,
DWORD  dwFlags,
BOOL * 
 

Definition at line 3192 of file desktop.c.

References BOOL, dwFlags, tagWINDOWSTATION::dwWSF_Flags, FALSE, GetDesktopView(), GetProcessLuid(), gpidLogon, HF_DESKTOPHOOK, tagWINDOWSTATION::luidEndSession, NT_SUCCESS, NTSTATUS(), NULL, PpiCurrent, tagDESKTOP::rpwinstaParent, RtlEqualLuid(), SetHandleFlag(), Status, TRUE, WSF_OPENLOCK, and WSF_REALSHUTDOWN.

Referenced by NtUserOpenInputDesktop(), and xxxOpenDesktop().

03197 { 03198 PPROCESSINFO ppi = PpiCurrent(); 03199 PWINDOWSTATION pwinsta; 03200 BOOL fMapped; 03201 03202 /* 03203 * If the desktop was not mapped in as a result of the open, 03204 * fail. 03205 */ 03206 fMapped = (GetDesktopView(ppi, pdesk) != NULL); 03207 if (!fMapped) { 03208 03209 RIPMSG0(RIP_WARNING, "OpenDesktopCompletion failed." 03210 " The desktop is not mapped"); 03211 03212 /* 03213 * Desktop mapping failed. Status is set by MapDesktop 03214 */ 03215 return FALSE; 03216 } else { 03217 03218 /* 03219 * Fail if the windowstation is locked 03220 */ 03221 pwinsta = pdesk->rpwinstaParent; 03222 if (pwinsta->dwWSF_Flags & WSF_OPENLOCK && 03223 ppi->Process->UniqueProcessId != gpidLogon) { 03224 LUID luidCaller; 03225 NTSTATUS Status; 03226 03227 /* 03228 * If logoff is occuring and the caller does not 03229 * belong to the session that is ending, allow the 03230 * open to proceed. 03231 */ 03232 Status = GetProcessLuid(NULL, &luidCaller); 03233 03234 if (!NT_SUCCESS(Status) || 03235 (pwinsta->dwWSF_Flags & WSF_REALSHUTDOWN) || 03236 RtlEqualLuid(&luidCaller, &pwinsta->luidEndSession)) { 03237 03238 RIPERR0(ERROR_BUSY, RIP_WARNING, "OpenDesktopCompletion failed"); 03239 03240 /* 03241 * Set the shut down flag 03242 */ 03243 *pbShutDown = TRUE; 03244 return FALSE; 03245 } 03246 } 03247 } 03248 03249 SetHandleFlag(hdesk, HF_DESKTOPHOOK, dwFlags & DF_ALLOWOTHERACCOUNTHOOK); 03250 03251 return TRUE; 03252 }

NTSTATUS OpenEffectiveToken PHANDLE  phToken  ) 
 

Definition at line 17 of file ex.c.

References NT_SUCCESS, NTSTATUS(), Status, and TRUE.

Referenced by _UserTestForWinStaAccess(), and xxxConnectService().

00019 { 00020 NTSTATUS Status; 00021 00022 /* 00023 * Open the client's token. 00024 */ 00025 Status = ZwOpenThreadToken( 00026 NtCurrentThread(), 00027 TOKEN_QUERY, 00028 (BOOLEAN)TRUE, // OpenAsSelf 00029 phToken 00030 ); 00031 if (Status == STATUS_NO_TOKEN) { 00032 00033 /* 00034 * Client wasn't impersonating anyone. Open its process token. 00035 */ 00036 Status = ZwOpenProcessToken( 00037 NtCurrentProcess(), 00038 TOKEN_QUERY, 00039 phToken 00040 ); 00041 } 00042 00043 if (!NT_SUCCESS(Status)) { 00044 RIPMSG1(RIP_WARNING, "Can't open client's token! - Status = %lx", Status); 00045 } 00046 return Status; 00047 }

BOOL OpenMouse PDEVICEINFO  pMouseInfo  ) 
 

PWND ParentNeedsPaint PWND  pwnd  ) 
 

Definition at line 1120 of file paint.c.

References NEEDSPAINT, NULL, tagWND::spwndParent, TestWF, and WFCLIPCHILDREN.

Referenced by xxxDoSyncPaint().

01122 { 01123 while ((pwnd = pwnd->spwndParent) != NULL) { 01124 01125 if (TestWF(pwnd, WFCLIPCHILDREN)) 01126 break; 01127 01128 if (NEEDSPAINT(pwnd)) 01129 return pwnd; 01130 } 01131 01132 return NULL; 01133 }

NTSTATUS ParseDesktop IN PVOID  ParseObject,
IN PVOID  ObjectType,
IN OUT PACCESS_STATE  AccessState,
IN KPROCESSOR_MODE  AccessMode,
IN ULONG  Attributes,
IN OUT PUNICODE_STRING  CompleteName,
IN OUT PUNICODE_STRING  RemainingName,
IN OUT PVOID Context  OPTIONAL,
IN PSECURITY_QUALITY_OF_SERVICE SecurityQos  OPTIONAL,
OUT PVOID *  Object
 

Referenced by ParseWindowStation().

NTSTATUS ParseWindowStation IN PVOID  ParseObject,
IN PVOID  ObjectType,
IN OUT PACCESS_STATE  AccessState,
IN KPROCESSOR_MODE  AccessMode,
IN ULONG  Attributes,
IN OUT PUNICODE_STRING  CompleteName,
IN OUT PUNICODE_STRING  RemainingName,
IN OUT PVOID Context  OPTIONAL,
IN PSECURITY_QUALITY_OF_SERVICE SecurityQos  OPTIONAL,
OUT PVOID *  Object
 

Referenced by Win32UserInitialize().

VOID PatchThreadWindows PTHREADINFO   ) 
 

Definition at line 2972 of file createw.c.

References tagSHAREDINFO::aheList, _HANDLEENTRY::bFlags, _HANDLEENTRY::bType, ClrWF, FNID_WNDPROCEND, FNID_WNDPROCSTART, giheLast, gSharedInfo, HANDLEF_DESTROY, tagWND::head, tagWND::lpfnWndProc, NULL, tagDESKTOP::pDeskInfo, _HANDLEENTRY::phead, _HANDLEENTRY::pOwner, PTHROBJHEAD, tagTHREADINFO::rpdesk, SetWF, tagDESKTOPINFO::spwnd, tagDESKTOP::spwndMenu, STOCID, TYPE_WINDOW, VOID(), WFANSIPROC, WFSERVERSIDEPROC, and xxxDefWindowProc().

Referenced by xxxDestroyThreadInfo().

02974 { 02975 PHE pheT; 02976 PHE pheMax; 02977 PWND pwnd; 02978 02979 /* 02980 * First do any preparation work: windows need to be "patched" so that 02981 * their window procs point to server only windowprocs, for example. 02982 */ 02983 pheMax = &gSharedInfo.aheList[giheLast]; 02984 for (pheT = gSharedInfo.aheList; pheT <= pheMax; pheT++) { 02985 02986 /* 02987 * Make sure this object is a window, it hasn't been marked for 02988 * destruction, and that it is owned by this thread. 02989 */ 02990 if (pheT->bType != TYPE_WINDOW) 02991 continue; 02992 02993 if (pheT->bFlags & HANDLEF_DESTROY) 02994 continue; 02995 02996 if ((PTHREADINFO)pheT->pOwner != pti) 02997 continue; 02998 02999 /* 03000 * don't patch the shared menu window 03001 */ 03002 if (pti->rpdesk && (PHEAD)pti->rpdesk->spwndMenu == pheT->phead) { 03003 03004 ((PTHROBJHEAD)pheT->phead)->pti = pti->rpdesk->pDeskInfo->spwnd->head.pti; 03005 pheT->pOwner = pti->rpdesk->pDeskInfo->spwnd->head.pti; 03006 03007 continue; 03008 } 03009 03010 /* 03011 * Don't patch the window based on the class it was created from - 03012 * because apps can sometimes sub-class a class - make a random class, 03013 * then call ButtonWndProc with windows of that class by using 03014 * the CallWindowProc() api. So patch the wndproc based on what 03015 * wndproc this window has been calling. 03016 */ 03017 pwnd = (PWND)pheT->phead; 03018 03019 if ((pwnd->fnid >= (WORD)FNID_WNDPROCSTART) && 03020 (pwnd->fnid <= (WORD)FNID_WNDPROCEND)) { 03021 03022 pwnd->lpfnWndProc = STOCID(pwnd->fnid); 03023 03024 if (pwnd->lpfnWndProc == NULL) 03025 pwnd->lpfnWndProc = xxxDefWindowProc; 03026 03027 } else { 03028 03029 pwnd->lpfnWndProc = xxxDefWindowProc; 03030 } 03031 03032 /* 03033 * This is a server side window now... 03034 */ 03035 SetWF(pwnd, WFSERVERSIDEPROC); 03036 ClrWF(pwnd, WFANSIPROC); 03037 } 03038 }

PHOOK PhkFirstGlobalValid PTHREADINFO  pti,
int  nFilterType
 

Definition at line 2151 of file hooks.c.

References tagDESKTOPINFO::aphkStart, CheckCritIn, DbgValidatefsHook, DbgValidateHooks, tagHOOK::flags, HF_DESTROYED, NULL, tagTHREADINFO::pDeskInfo, PhkNextValid(), and TRUE.

Referenced by CheckWHFBits(), GetJournallingQueue(), xxxCallJournalPlaybackHook(), xxxCallJournalRecordHook(), xxxGetNextSysMsg(), xxxInternalGetMessage(), xxxSkipSysMsg(), zzzCancelJournalling(), and zzzUnhookWindowsHookEx().

02152 { 02153 PHOOK phk; 02154 02155 CheckCritIn(); 02156 phk = pti->pDeskInfo->aphkStart[nFilterType + 1]; 02157 /* 02158 * Return the first hook that it's not destroyed (i.e, the 02159 * first valid one). 02160 */ 02161 if ((phk != NULL) && (phk->flags & HF_DESTROYED)) { 02162 phk = PhkNextValid(phk); 02163 } 02164 /* 02165 * Good place to check fsHooks. If the bits are out of sync, 02166 * someone must be adjusting them. 02167 */ 02168 DbgValidatefsHook(phk, nFilterType, pti, TRUE); 02169 DbgValidateHooks(phk, nFilterType); 02170 return phk; 02171 }

PHOOK PhkFirstValid PTHREADINFO  pti,
int  nFilterType
 

Definition at line 2183 of file hooks.c.

References tagDESKTOPINFO::aphkStart, tagTHREADINFO::aphkStart, CheckCritIn, DbgValidatefsHook, DbgValidateHooks, FALSE, tagHOOK::flags, HF_DESTROYED, NULL, tagTHREADINFO::pDeskInfo, and PhkNextValid().

Referenced by CheckWHFBits(), xxxButtonEvent(), xxxCallHook(), xxxCallMouseHook(), xxxDoButtonEvent(), xxxKeyEvent(), xxxMoveEventAbsolute(), and zzzUnhookWindowsHook().

02186 { 02187 PHOOK phk; 02188 CheckCritIn(); 02189 /* 02190 * Grab the first hook off the local hook-list 02191 * for the current queue. 02192 */ 02193 phk = pti->aphkStart[nFilterType + 1]; 02194 /* 02195 * If there aren't any local hooks, try the global hooks. 02196 */ 02197 if (phk == NULL) { 02198 phk = pti->pDeskInfo->aphkStart[nFilterType + 1]; 02199 } 02200 /* 02201 * Return the first hook that it's not destroyed (i.e, the 02202 * first valid one). 02203 */ 02204 if ((phk != NULL) && (phk->flags & HF_DESTROYED)) { 02205 phk = PhkNextValid(phk); 02206 } 02207 /* 02208 * Good place to check fsHooks. If the bits are out of sync, 02209 * someone must be adjusting them. 02210 */ 02211 02212 DbgValidatefsHook(phk, nFilterType, pti, FALSE); 02213 DbgValidateHooks(phk, nFilterType); 02214 return phk; 02215 }

VOID PlayEventSound UINT  idSound  ) 
 

Definition at line 108 of file kernel/msgbeep.c.

References _PostMessage(), gspwndLogonNotify, PtiCurrent, PUDF_EXTENDEDSOUNDS, TEST_PUDF, tagTHREADINFO::TIF_flags, TIF_SYSTEMTHREAD, and VOID().

Referenced by xxxCreateThreadInfo(), xxxMenuWindowProc(), xxxMNCancel(), xxxMNOpenHierarchy(), xxxSnapWindow(), xxxSysCommand(), and xxxTrackPopupMenuEx().

00109 { 00110 PTHREADINFO pti = PtiCurrent(); 00111 00112 if (!TEST_PUDF(PUDF_EXTENDEDSOUNDS)) 00113 return; 00114 00115 if (pti->TIF_flags & TIF_SYSTEMTHREAD) 00116 return; 00117 00118 if (gspwndLogonNotify) { 00119 _PostMessage(gspwndLogonNotify, WM_LOGONNOTIFY, LOGON_PLAYEVENTSOUND, idSound); 00120 } 00121 00122 // BUGBUG -- we should only flash SoundSentry if a sound is played. With the 00123 // new technique of posting to WinLogon, we can't determine this here. 00124 // _UserSoundSentryWorker(); 00125 00126 }

BOOL PostEventMessage PTHREADINFO  pti,
PQ  pq,
DWORD  dwQEvent,
PWND  pwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 2068 of file ntuser/kernel/input.c.

References AllocQEntry(), BOOL, CheckCritIn, FALSE, tagQ::mlInput, NULL, tagQ::ptiKeyboard, tagQ::ptiMouse, SetWakeBit(), StoreQMessage(), StoreQMessagePti(), tagTHREADINFO::TIF_flags, TIF_INCLEANUP, and TRUE.

Referenced by _ShowWindowAsync(), AsyncWindowPos(), FKActivationTimer(), PostAccessibility(), PostRitSound(), PostUpdateKeyStateEvent(), xxxButtonEvent(), xxxFW_DestroyAllChildren(), xxxKeyEvent(), xxxMinimizeHungWindow(), xxxProcessEventMessage(), xxxProcessNotifyWinEvent(), xxxSetForegroundWindow(), xxxSwitchToThisWindow(), xxxTrackMouseMove(), zzzReattachThreads(), and zzzSetFMouseMoved().

02076 { 02077 PQMSG pqmsgEvent; 02078 02079 CheckCritIn(); 02080 02081 /* 02082 * If the thread is in cleanup, then it's possible the queue has 02083 * already been removed for this thread. If this is the case, then 02084 * we should fail to post the event to a dying thread. 02085 */ 02086 if (pti && (pti->TIF_flags & TIF_INCLEANUP)) 02087 return FALSE; 02088 02089 if ((pqmsgEvent = AllocQEntry(&pq->mlInput)) == NULL) 02090 return FALSE; 02091 02092 StoreQMessage(pqmsgEvent, pwnd, message, wParam, lParam, 0, dwQEvent, 0); 02093 02094 StoreQMessagePti(pqmsgEvent, pti); 02095 02096 /* 02097 * Let this thread know it has an event message to process. 02098 */ 02099 if (pti == NULL) { 02100 UserAssert(pti); 02101 SetWakeBit(pq->ptiMouse, QS_EVENTSET); 02102 SetWakeBit(pq->ptiKeyboard, QS_EVENTSET); 02103 } else { 02104 SetWakeBit(pti, QS_EVENTSET); 02105 } 02106 02107 return TRUE; 02108 }

void PostInputMessage PQ  pq,
PWND  pwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam,
DWORD  time,
ULONG_PTR  dwExtraInfo
 

Definition at line 1575 of file ntuser/kernel/input.c.

References AllocQEntry(), DelQEntry(), tagQ::idSysPeek, tagQ::mlInput, tagQMSG::msg, NULL, PostUpdateKeyStateEvent(), tagMLIST::pqmsgWriteLast, tagQ::QF_flags, QF_UPDATEKEYSTATE, StoreQMessage(), and WakeSomeone().

Referenced by PostMove(), xxxButtonEvent(), xxxDoButtonEvent(), and xxxKeyEvent().

01583 { 01584 PQMSG pqmsgInput, pqmsgPrev; 01585 short sWheelDelta; 01586 01587 /* 01588 * Grab the last written message before we start allocing new ones, 01589 * so we're sure to point to the correct message. 01590 */ 01591 pqmsgPrev = pq->mlInput.pqmsgWriteLast; 01592 01593 /* 01594 * Allocate a key state update event if needed. 01595 */ 01596 if (pq->QF_flags & QF_UPDATEKEYSTATE) { 01597 PostUpdateKeyStateEvent(pq); 01598 } 01599 01600 /* 01601 * We want to coalesce sequential WM_MOUSEMOVE and WM_MOUSEWHEEL. 01602 * WM_MOUSEMOVEs are coalesced by just storing the most recent 01603 * event over the last one. 01604 * WM_MOUSEWHEELs also add up the wheel rolls. 01605 */ 01606 if (pqmsgPrev != NULL && 01607 pqmsgPrev->msg.message == message && 01608 (message == WM_MOUSEMOVE || message == WM_MOUSEWHEEL)) { 01609 01610 if (message == WM_MOUSEWHEEL) { 01611 sWheelDelta = (short)HIWORD(wParam) + (short)HIWORD(pqmsgPrev->msg.wParam); 01612 01613 #if 0 01614 /* 01615 * LATER: We can't remove a wheel message with zero delta 01616 * unless we know it hasn't been peeked. Ideally, 01617 * we would check idsyspeek for this, but we're too close 01618 * to ship and idsyspeek is too fragile. Consider also 01619 * checking to see if mouse move messages have been peeked. 01620 */ 01621 01622 if (sWheelDelta == 0) { 01623 if ((PQMSG)pq->idSysPeek == pqmsgPrev) { 01624 RIPMSG0(RIP_VERBOSE, 01625 "Coalescing of mouse wheel messages causing " 01626 "idSysPeek to be reset to 0"); 01627 01628 pq->idSysPeek = 0; 01629 } 01630 01631 DelQEntry(&pq->mlInput, pqmsgPrev); 01632 return; 01633 } 01634 #endif 01635 01636 wParam = MAKEWPARAM(LOWORD(wParam), sWheelDelta); 01637 } 01638 01639 StoreQMessage(pqmsgPrev, pwnd, message, wParam, lParam, time, 0, dwExtraInfo); 01640 WakeSomeone(pq, message, pqmsgPrev); 01641 01642 return; 01643 } 01644 01645 /* 01646 * Fill in pqmsgInput. 01647 */ 01648 pqmsgInput = AllocQEntry(&pq->mlInput); 01649 if (pqmsgInput != NULL) { 01650 StoreQMessage(pqmsgInput, pwnd, message, wParam, lParam, time, 0, dwExtraInfo); 01651 WakeSomeone(pq, message, pqmsgInput); 01652 } 01653 }

VOID PostMove PQ  pq  ) 
 

Definition at line 1254 of file ntuser/kernel/input.c.

References CheckCritIn, gdwMouseMoveExtraInfo, gdwMouseMoveTimeStamp, gpsi, NtGetTickCount(), NULL, PostInputMessage(), tagQ::QF_flags, QF_MOUSEMOVED, SHORT, and VOID().

Referenced by xxxButtonEvent(), xxxGetNextSysMsg(), and xxxKeyEvent().

01256 { 01257 #ifdef REDIRECTION 01258 POINT pt; 01259 #endif // REDIRECTION 01260 01261 CheckCritIn(); 01262 01263 /* 01264 * set gdwMouseMoveTimeStamp to 0 after posting the move so 01265 * subsequent calls to SetFMouseMove doesn't use the same value 01266 * of gdwMouseMoveTimeStamp. Bug 74508. 01267 */ 01268 if (gdwMouseMoveTimeStamp == 0) { 01269 gdwMouseMoveTimeStamp = NtGetTickCount(); 01270 } 01271 01272 #ifdef REDIRECTION 01273 01274 PopMouseMove(pq, &pt); 01275 01276 PostInputMessage(pq, NULL, WM_MOUSEMOVE, 0, 01277 MAKELONG((SHORT)pt.x, (SHORT)pt.y), 01278 gdwMouseMoveTimeStamp, gdwMouseMoveExtraInfo); 01279 #else 01280 PostInputMessage(pq, NULL, WM_MOUSEMOVE, 0, 01281 MAKELONG((SHORT)gpsi->ptCursor.x, (SHORT)gpsi->ptCursor.y), 01282 gdwMouseMoveTimeStamp, gdwMouseMoveExtraInfo); 01283 #endif // REDIRECTION 01284 01285 gdwMouseMoveTimeStamp = 0; 01286 01287 pq->QF_flags &= ~QF_MOUSEMOVED; 01288 }

void PostShellHookMessages UINT  message,
LPARAM  lParam
 

Definition at line 3719 of file rare.c.

References _PostMessage(), DWORD, GETDESKINFO, glinp, gpsi, guiOtherWindowCreated, guiOtherWindowDestroyed, NULL, PtiCurrent, tagLASTINPUT::ptiLastWoken, tagDESKTOPINFO::pvwplShellHook, tagDESKTOPINFO::spwndProgman, tagSERVERINFO::uiShellMsg, and VWPLNext().

Referenced by xxxDefWindowProc(), xxxDesktopThread(), xxxDestroyWindow(), xxxEndDeferWindowPosEx(), xxxFlashWindow(), xxxHandleOwnerSwitch(), xxxMinMaximize(), xxxProcessEventMessage(), xxxRedrawFrameAndHook(), xxxRedrawTitle(), xxxSetTrayWindow(), and xxxSystemParametersInfo().

03719 { 03720 PDESKTOPINFO pdeskinfo = GETDESKINFO(PtiCurrent()); 03721 DWORD nPwndShellHook; 03722 PWND pwndShellHook; 03723 03724 nPwndShellHook = 0; 03725 pwndShellHook = NULL; 03726 03727 /* 03728 * Hack for WM_APPCOMMAND (bug 389210): 03729 * We want to allow anyone who's listening for these wm_appcommand messages to be able to 03730 * take the foreground. ie pressing mail will launch outlook AND bring it to the foreground 03731 * We set the token to null so anyone can steal the foreground - else it isn't clear who should 03732 * have the right to steal it - only one person gets the right. We let them fight it out to 03733 * decide who gets foreground if more than one listener will try make a foreground change. 03734 */ 03735 if (HSHELL_APPCOMMAND == message) { 03736 TAGMSG0(DBGTAG_FOREGROUND, "PostShellHookMessages cleared last input token - open foreground."); 03737 03738 glinp.ptiLastWoken = NULL; 03739 } 03740 03741 /* 03742 * Loop through all the windows registered to listen for shell hooks and post the message 03743 * to them 03744 */ 03745 while (pwndShellHook = VWPLNext(pdeskinfo->pvwplShellHook, pwndShellHook, &nPwndShellHook)) { 03746 if (pwndShellHook == pdeskinfo->spwndProgman) { 03747 switch (message) { 03748 case HSHELL_WINDOWCREATED: 03749 _PostMessage(pwndShellHook, gpsi->uiShellMsg, guiOtherWindowCreated, lParam); 03750 break; 03751 case HSHELL_WINDOWDESTROYED: 03752 _PostMessage(pwndShellHook, gpsi->uiShellMsg, guiOtherWindowDestroyed, lParam); 03753 break; 03754 } 03755 } else { 03756 _PostMessage(pwndShellHook, gpsi->uiShellMsg, message, lParam); 03757 } 03758 } 03759 03760 }

void PostUpdateKeyStateEvent PQ  pq  ) 
 

Definition at line 1874 of file ntuser/kernel/input.c.

References tagQ::afKeyRecentDown, BYTE, CBKEYSTATE, CBKEYSTATERECENTDOWN, tagMLIST::cMsgs, DWORD, tagQMSG::dwQEvent, tagCLIENTTHREADINFO::fsWakeBits, gafAsyncKeyState, gptiRit, KEYSTATESIZE, tagQ::mlInput, tagQMSG::msg, NULL, PBYTE, tagTHREADINFO::pcti, PostEventMessage(), tagQMSG::pqmsgNext, tagMLIST::pqmsgRead, tagMLIST::pqmsgWriteLast, ProcessUpdateKeyStateEvent(), tagQ::ptiKeyboard, tagQ::ptiMouse, QEVENT_UPDATEKEYSTATE, tagQ::QF_flags, QF_UPDATEKEYSTATE, and SetWakeBit().

Referenced by _PostMessage(), NtUserGetKeyState(), PostInputMessage(), UpdateAsyncKeyState(), and xxxSwitchDesktop().

01876 { 01877 BYTE *pb; 01878 PQMSG pqmsg; 01879 01880 if (!(pq->QF_flags & QF_UPDATEKEYSTATE)) 01881 return; 01882 01883 /* 01884 * Exclude the RIT - it's queue is never read, so don't waste memory 01885 */ 01886 if (pq->ptiKeyboard == gptiRit) { 01887 return; 01888 } 01889 01890 /* 01891 * If there's no mousebutton or keystroke input pending, process the 01892 * UpdateKeyState Event now: thus saving memory allocation and giving 01893 * applications the correct KeyState immediately. 01894 * NOTE: There may be event/activation msgs in pq->mlInput that don't 01895 * affect keystate, so I'd like to just test QS_KEY | QS_MOUSEBUTTON 01896 * specifically, instead of the cMsgss. However, sometimes there are 01897 * keystroke or mousebutton msgs in the q without those bits set! - IanJa 01898 */ 01899 if (pq->mlInput.cMsgs == 0) { 01900 ProcessUpdateKeyStateEvent(pq, gafAsyncKeyState, pq->afKeyRecentDown); 01901 goto SyncQueue; 01902 } 01903 #if DBG 01904 else if ((!pq->ptiKeyboard || !(pq->ptiKeyboard->pcti->fsWakeBits & QS_KEY)) && 01905 (!pq->ptiMouse || !(pq->ptiMouse->pcti->fsWakeBits & QS_MOUSEBUTTON))) { 01906 /* 01907 * See if there are any key or mousebutton messages that aren't 01908 * indicated by QS_KEY or QS_MOUSEBUTTON bits. 01909 */ 01910 PQMSG pqmsgT; 01911 for (pqmsgT = pq->mlInput.pqmsgRead; pqmsgT; pqmsgT = pqmsgT->pqmsgNext) { 01912 if (pqmsgT->msg.message >= WM_KEYFIRST && pqmsgT->msg.message <= WM_KEYLAST) { 01913 TAGMSG1(DBGTAG_InputWithoutQS, 01914 "PostUpdateKeyStateEvent() pushing in front of a keystroke: Q %#p", pq); 01915 } else if (pqmsgT->msg.message >= WM_LBUTTONDOWN && pqmsgT->msg.message <= WM_XBUTTONDBLCLK) { 01916 TAGMSG1(DBGTAG_InputWithoutQS, 01917 "PostUpdateKeyStateEvent() pushing in front of a mousebutton: Q %#p", pq); 01918 } 01919 } 01920 } 01921 #endif 01922 01923 UserAssert(pq->mlInput.pqmsgWriteLast != NULL); 01924 01925 /* 01926 * If the last input message is an UPDATEKEYSTATE event, coalesce with it. 01927 * (Prevents big memory leaks on apps that don't read input messages) 01928 */ 01929 pqmsg = pq->mlInput.pqmsgWriteLast; 01930 if (pqmsg->dwQEvent == QEVENT_UPDATEKEYSTATE) { 01931 int i; 01932 DWORD *pdw; 01933 01934 pb = (PBYTE)(pqmsg->msg.wParam); 01935 pdw = (DWORD *) (pb + CBKEYSTATE); 01936 01937 /* 01938 * Copy in the new key state 01939 */ 01940 RtlCopyMemory(pb, gafAsyncKeyState, CBKEYSTATE); 01941 01942 /* 01943 * Or in the recent key down state (DWORD at a time) 01944 */ 01945 #if (CBKEYSTATERECENTDOWN % 4) != 0 01946 #error "CBKEYSTATERECENTDOWN assumed to be an integral number of DWORDs" 01947 #endif 01948 for (i = 0; i < CBKEYSTATERECENTDOWN / sizeof(*pdw); i++) { 01949 *pdw++ |= ((DWORD *)(pq->afKeyRecentDown))[i]; 01950 } 01951 01952 /* 01953 * Set QS_EVENTSET as in PostEventMessage, although this is 01954 * usually, but not always already set 01955 */ 01956 SetWakeBit(pq->ptiKeyboard, QS_EVENTSET); 01957 goto SyncQueue; 01958 } 01959 01960 /* 01961 * Make a copy of the async key state buffer, point to it, and add an 01962 * event to the end of the input queue. 01963 */ 01964 if ((pb = UserAllocPool(KEYSTATESIZE, TAG_KBDSTATE)) == NULL) { 01965 return; 01966 } 01967 01968 RtlCopyMemory(pb, gafAsyncKeyState, CBKEYSTATE); 01969 RtlCopyMemory(pb + CBKEYSTATE, pq->afKeyRecentDown, CBKEYSTATERECENTDOWN); 01970 01971 if (!PostEventMessage(pq->ptiKeyboard, pq, QEVENT_UPDATEKEYSTATE, 01972 NULL, 0 , (WPARAM)pb, 0)) { 01973 UserFreePool(pb); 01974 return; 01975 } 01976 01977 /* 01978 * The key state of the queue is input-synchronized with the user. Erase 01979 * all 'recent down' flags. 01980 */ 01981 SyncQueue: 01982 RtlZeroMemory(pq->afKeyRecentDown, CBKEYSTATERECENTDOWN); 01983 pq->QF_flags &= ~QF_UPDATEKEYSTATE; 01984 }

BOOL PrepareForLogoff UINT  uFlags  ) 
 

Definition at line 33 of file kernel/exitwin.c.

References BOOL, CheckCritIn, CreateProfileUserName(), FALSE, FreeProfileUserName(), gpidLogon, NULL, tagTHREADINFO::ppi, PtiCurrent, tagPROCESSINFO::pW32Job, PW32JOB, RegisterPerUserKeyboardIndicators(), tagW32JOB::restrictions, tagTHREADINFO::TIF_flags, TIF_RESTRICTED, and TRUE.

00035 { 00036 PTHREADINFO ptiCurrent = PtiCurrent(); 00037 00038 CheckCritIn(); 00039 00040 if (ptiCurrent->TIF_flags & TIF_RESTRICTED) { 00041 PW32JOB pW32Job; 00042 00043 pW32Job = ptiCurrent->ppi->pW32Job; 00044 00045 UserAssert(pW32Job != NULL); 00046 00047 if (pW32Job->restrictions & JOB_OBJECT_UILIMIT_EXITWINDOWS) { 00048 // Not permitted to ExitWindows. 00049 return FALSE; 00050 } 00051 } 00052 00053 /* 00054 * There are no restrictions, or the restriction do not deny shutdown: 00055 * The caller is about to ExitWindowsEx via CSR, so save the volatile 00056 * elements of the User preferences in their profile 00057 */ 00058 if (ptiCurrent->pEThread->Cid.UniqueProcess == gpidLogon) { 00059 /* 00060 * Save the current user's NumLock state 00061 */ 00062 TL tlName; 00063 PUNICODE_STRING pProfileUserName = CreateProfileUserName(&tlName); 00064 RegisterPerUserKeyboardIndicators(pProfileUserName); 00065 FreeProfileUserName(pProfileUserName, &tlName); 00066 } 00067 00068 return TRUE; 00069 UNREFERENCED_PARAMETER(uFlags); 00070 }

PSOFTKBDDATA ProbeAndCaptureSoftKbdData PSOFTKBDDATA  Source  ) 
 

Definition at line 2154 of file ntimm.c.

References BYTE, DWORD, ExRaiseStatus(), NULL, ProbeAndReadUlong, ProbeForReadBuffer, TRUE, and UINT.

Referenced by MESSAGECALL().

02156 { 02157 PSOFTKBDDATA Destination = NULL; 02158 DWORD cbSize; 02159 UINT uCount; 02160 02161 try { 02162 uCount = ProbeAndReadUlong((PULONG)Source); 02163 02164 #if defined(_X86_) 02165 ProbeForReadBuffer(&Source->wCode, uCount, sizeof(BYTE)); 02166 #else 02167 ProbeForReadBuffer(&Source->wCode, uCount, sizeof(WORD)); 02168 #endif 02169 02170 cbSize = FIELD_OFFSET(SOFTKBDDATA, wCode[0]) 02171 + uCount * sizeof(WORD) * 256; 02172 02173 Destination = (PSOFTKBDDATA)UserAllocPool(cbSize, TAG_IME); 02174 02175 if (Destination != NULL) { 02176 RtlCopyMemory(Destination, Source, cbSize); 02177 } else { 02178 ExRaiseStatus(STATUS_NO_MEMORY); 02179 } 02180 02181 } except (W32ExceptionHandler(TRUE, RIP_WARNING)) { 02182 02183 if (Destination != NULL) { 02184 UserFreePool(Destination); 02185 } 02186 02187 return NULL; 02188 } 02189 02190 return Destination; 02191 }

void ProcessDeviceChanges DWORD  DeviceType  ) 
 

Definition at line 1191 of file w32/ntuser/kernel/pnp.c.

References tagMOUSE_DEVICE_INFO::Attr, tagKEYBOARD_DEVICE_INFO::Attr, BEGINATOMICCHECK, BEGINATOMICDEVICEINFOLISTCHECK, CheckCritIn, CLEAR_GTERMF, CloseDevice(), DEVICE_TYPE_KEYBOARD, DEVICE_TYPE_MOUSE, DWORD, ENDATOMICCHECK, ENDATOMICDEVICEINFOLISTCHECK, EnterDeviceInfoListCrit(), EVENT_INCREMENT, FALSE, FreeDeviceInfo(), gbRemoteSession, GDIAF_ARRIVED, GDIAF_DEPARTED, GDIAF_IME_STATUS, GDIAF_PNPWAITING, GDIAF_QUERYREMOVE, GDIAF_RECONNECT, GDIAF_REFRESH_MOUSE, GDIAF_REMOVECANCELLED, GDIAF_RETRYREAD, giosbKbdControl, gKbdImeStatus, gKbdIoctlLEDSStatus, gKeyboardInfo, gklpBootTime, gnKeyboards, gnMice, gpDeviceInfoList, gpDispInfo, gpepCSRSS, gpsi, gptiRit, gRemoteClientKeyboardType, GTERMF_MOUSE, gTermIO, gwMouseOwnerButton, tagDISPLAYINFO::hDev, KeSetEvent(), tagDEVICEINFO::keyboard, LeaveDeviceInfoListCrit(), max, tagDEVICEINFO::mouse, NT_SUCCESS, NTSTATUS(), NULL, OpenDevice(), PpiFromProcess, PtiCurrentShared, tagTERMINAL::ptiDesktop, QueryDeviceInfo(), RegisterForDeviceChangeNotifications(), SET_GTERMF, SetDebugHotKeys(), SetGlobalCursorLevel(), StartDeviceRead(), Status, SYSMET, TRUE, UnregisterForDeviceChangeNotifications(), UpdateKeyLights(), USHORT, and VOID().

Referenced by RawInputThread(), and xxxDesktopThread().

01192 { 01193 PDEVICEINFO pDeviceInfo; 01194 USHORT usOriginalActions; 01195 #if DBG 01196 int nChanges = 0; 01197 ULONG timeStartReadPrev; 01198 #endif 01199 01200 /* 01201 * Reset summary information for all Mice and Keyboards 01202 */ 01203 DWORD nMice = 0; 01204 DWORD nWheels = 0; 01205 DWORD nMaxButtons = 0; 01206 int nKeyboards = 0; 01207 01208 CheckCritIn(); 01209 BEGINATOMICCHECK(); 01210 UserAssert((PtiCurrentShared() == gptiRit) || (PtiCurrentShared() == gTermIO.ptiDesktop)); 01211 01212 EnterDeviceInfoListCrit(); 01213 BEGINATOMICDEVICEINFOLISTCHECK(); 01214 01215 /* 01216 * Look for devices to Create (those which have newly arrived) 01217 * and for devices to Terminate (these which have just departed) 01218 * and for device change notifications. 01219 * Make sure the actions are processed in the right order in case we 01220 * are being asked for more than one action per device: for example, 01221 * we sometimes get QueryRemove followed quickly by RemoveCancelled 01222 * and both actions arrive here together: we should do them in the 01223 * correct order. 01224 */ 01225 pDeviceInfo = gpDeviceInfoList; 01226 while (pDeviceInfo) { 01227 if (pDeviceInfo->type != DeviceType) { 01228 pDeviceInfo = pDeviceInfo->pNext; 01229 continue; 01230 } 01231 01232 usOriginalActions = pDeviceInfo->usActions; 01233 UserAssert((usOriginalActions == 0) || (usOriginalActions & ~GDIAF_PNPWAITING)); 01234 01235 /* 01236 * Refresh Mouse: 01237 * We read a MOUSE_ATTRIBUTES_CHANGED flag when a PS/2 mouse 01238 * is plugged back in. Find out the attributes of the device. 01239 */ 01240 if (pDeviceInfo->usActions & GDIAF_REFRESH_MOUSE) { 01241 pDeviceInfo->usActions &= ~GDIAF_REFRESH_MOUSE; 01242 01243 UserAssert(pDeviceInfo->type == DEVICE_TYPE_MOUSE); 01244 #if DBG 01245 nChanges++; 01246 #endif 01247 TAGMSG1(DBGTAG_PNP, "QueryDeviceInfo: %lx", pDeviceInfo); 01248 QueryDeviceInfo(pDeviceInfo); 01249 } 01250 01251 /* 01252 * QueryRemove: 01253 * Close the file object, but retain the DEVICEINFO struct and the 01254 * registration in case we later get a RemoveCancelled. 01255 */ 01256 if (pDeviceInfo->usActions & GDIAF_QUERYREMOVE) { 01257 pDeviceInfo->usActions &= ~GDIAF_QUERYREMOVE; 01258 #if DBG 01259 nChanges++; 01260 #endif 01261 TAGMSG1(DBGTAG_PNP, "QueryRemove: %lx", pDeviceInfo); 01262 CloseDevice(pDeviceInfo); 01263 } 01264 01265 /* 01266 * New device arrived or RemoveCancelled: 01267 * If new device, Open it, register for notifications and start reading 01268 * If RemoveCancelled, unregister the old notfications first 01269 */ 01270 if (pDeviceInfo->usActions & (GDIAF_ARRIVED | GDIAF_REMOVECANCELLED)) { 01271 // Reopen the file object, (this is a new file object, of course), 01272 // Unregister for the old file, register with this new one. 01273 if (pDeviceInfo->usActions & GDIAF_REMOVECANCELLED) { 01274 pDeviceInfo->usActions &= ~GDIAF_REMOVECANCELLED; 01275 #if DBG 01276 nChanges++; 01277 #endif 01278 TAGMSG1(DBGTAG_PNP, "RemoveCancelled: %lx", pDeviceInfo); 01279 UnregisterForDeviceChangeNotifications(pDeviceInfo); 01280 } 01281 01282 #if DBG 01283 if (pDeviceInfo->usActions & GDIAF_ARRIVED) { 01284 nChanges++; 01285 } 01286 #endif 01287 01288 pDeviceInfo->usActions &= ~GDIAF_ARRIVED; 01289 if (OpenDevice(pDeviceInfo)) { 01290 PDEVICEINFO pDeviceInfoNext; 01291 RegisterForDeviceChangeNotifications(pDeviceInfo); 01292 01293 if (!(gbRemoteSession && (pDeviceInfo->usActions & GDIAF_RECONNECT))) { 01294 01295 pDeviceInfoNext = StartDeviceRead(pDeviceInfo); 01296 if (pDeviceInfoNext) { 01297 /* 01298 * pDeviceInfo wasa freed, move onto the next 01299 */ 01300 pDeviceInfo = pDeviceInfoNext; 01301 continue; 01302 } 01303 } 01304 pDeviceInfo->usActions &= ~GDIAF_RECONNECT; 01305 01306 } else { 01307 /* 01308 * If the Open failed, we free the device here, and move on to 01309 * the next device. 01310 * Assert to catch re-open failure upon RemoveCancelled. 01311 */ 01312 #if DBG 01313 if ((usOriginalActions & GDIAF_ARRIVED) == 0) { 01314 RIPMSG2(RIP_WARNING, "Re-Open %#p failed status %x during RemoveCancelled", 01315 pDeviceInfo, pDeviceInfo->OpenStatus); 01316 } 01317 #endif 01318 pDeviceInfo = FreeDeviceInfo(pDeviceInfo); 01319 continue; 01320 } 01321 } 01322 01323 /* 01324 * RemoveComplete: 01325 * Close the file object, if you have not already done so, Unregister. 01326 * FreeDeviceInfo here (which will actually request a free from the 01327 * reader or the PnP requestor thread), and move on to the next device. 01328 */ 01329 if (pDeviceInfo->usActions & GDIAF_DEPARTED) { 01330 pDeviceInfo->usActions &= ~GDIAF_DEPARTED; 01331 #if DBG 01332 nChanges++; 01333 #endif 01334 TAGMSG1(DBGTAG_PNP, "RemoveComplete: %lx (process %#x)", pDeviceInfo); 01335 CloseDevice(pDeviceInfo); 01336 UnregisterForDeviceChangeNotifications(pDeviceInfo); 01337 pDeviceInfo = FreeDeviceInfo(pDeviceInfo); 01338 continue; 01339 } 01340 01341 if (pDeviceInfo->usActions & GDIAF_IME_STATUS) { 01342 pDeviceInfo->usActions &= ~GDIAF_IME_STATUS; 01343 #if DBG 01344 nChanges++; 01345 #endif 01346 if ((pDeviceInfo->type == DEVICE_TYPE_KEYBOARD) && (pDeviceInfo->handle)) { 01347 if (FUJITSU_KBD_CONSOLE(pDeviceInfo->keyboard.Attr.KeyboardIdentifier) || 01348 (gbRemoteSession && 01349 FUJITSU_KBD_REMOTE(gRemoteClientKeyboardType)) 01350 ) { 01351 /* 01352 * Fill up the KEYBOARD_IME_STATUS structure. 01353 */ 01354 ZwDeviceIoControlFile(pDeviceInfo->handle, NULL, NULL, NULL, 01355 &giosbKbdControl, IOCTL_KEYBOARD_SET_IME_STATUS, 01356 (PVOID)&gKbdImeStatus, sizeof(gKbdImeStatus), NULL, 0); 01357 } 01358 } 01359 } 01360 01361 if (pDeviceInfo->usActions & GDIAF_RETRYREAD) { 01362 PDEVICEINFO pDeviceInfoNext; 01363 pDeviceInfo->usActions &= ~GDIAF_RETRYREAD; 01364 UserAssert(pDeviceInfo->ReadStatus == STATUS_INSUFFICIENT_RESOURCES); 01365 #if DBG 01366 timeStartReadPrev = pDeviceInfo->timeStartRead; 01367 #endif 01368 TAGMSG2(DBGTAG_PNP, "Retry Read %#p after %lx ticks", 01369 pDeviceInfo, pDeviceInfo->timeStartRead - timeStartReadPrev); 01370 pDeviceInfoNext = StartDeviceRead(pDeviceInfo); 01371 if (pDeviceInfoNext) { 01372 /* 01373 * pDeviceInfo wasa freed, move onto the next 01374 */ 01375 pDeviceInfo = pDeviceInfoNext; 01376 continue; 01377 } 01378 } 01379 01380 /* 01381 * Gather summary information on open devices 01382 */ 01383 if (pDeviceInfo->handle) { 01384 switch (pDeviceInfo->type) { 01385 case DEVICE_TYPE_MOUSE: 01386 UserAssert(PtiCurrentShared() == gTermIO.ptiDesktop); 01387 if (pDeviceInfo->usActions & GDIAF_REFRESH_MOUSE) { 01388 pDeviceInfo->usActions &= ~GDIAF_REFRESH_MOUSE; 01389 #if DBG 01390 nChanges++; 01391 #endif 01392 } 01393 nMice++; 01394 nMaxButtons = max(nMaxButtons, pDeviceInfo->mouse.Attr.NumberOfButtons); 01395 switch(pDeviceInfo->mouse.Attr.MouseIdentifier) { 01396 case WHEELMOUSE_I8042_HARDWARE: 01397 case WHEELMOUSE_SERIAL_HARDWARE: 01398 case WHEELMOUSE_HID_HARDWARE: 01399 nWheels++; 01400 } 01401 break; 01402 01403 case DEVICE_TYPE_KEYBOARD: 01404 UserAssert(PtiCurrentShared() == gptiRit); 01405 { 01406 NTSTATUS Status; 01407 // BUG BUG: why query each keyboard for indicators? They should all 01408 // be the same. 01409 #ifdef DIAGNOSE_IO 01410 gKbdIoctlLEDSStatus = 01411 #endif 01412 Status = ZwDeviceIoControlFile(pDeviceInfo->handle, NULL, NULL, NULL, 01413 &giosbKbdControl, IOCTL_KEYBOARD_QUERY_INDICATORS, 01414 NULL, 0, 01415 (PVOID)&gklpBootTime, sizeof(gklpBootTime)); 01416 UserAssertMsg2(NT_SUCCESS(Status), 01417 "IOCTL_KEYBOARD_QUERY_INDICATORS failed: DeviceInfo %#x, Status %#x", 01418 pDeviceInfo, Status); 01419 // BUG BUG, Don't handle multiple keyboards properly: the last 01420 // keyboard on the list is the one whose attributes we report! 01421 gKeyboardInfo = pDeviceInfo->keyboard.Attr; 01422 } 01423 nKeyboards++; 01424 break; 01425 01426 default: 01427 // Add code for a new type of input device here 01428 RIPMSG2(RIP_ERROR, "pDeviceInfo %#p has strange type %d", 01429 pDeviceInfo, pDeviceInfo->type); 01430 break; 01431 } 01432 } 01433 01434 /* 01435 * Notify the PnP thread that a change has been completed 01436 */ 01437 if (usOriginalActions & GDIAF_PNPWAITING) { 01438 KeSetEvent(pDeviceInfo->pkeHidChangeCompleted, EVENT_INCREMENT, FALSE); 01439 } 01440 01441 pDeviceInfo = pDeviceInfo->pNext; 01442 } 01443 01444 ENDATOMICDEVICEINFOLISTCHECK(); 01445 LeaveDeviceInfoListCrit(); 01446 01447 01448 switch (DeviceType) { 01449 case DEVICE_TYPE_MOUSE: 01450 /* 01451 * Apply summary information for Mice 01452 */ 01453 if (nMice) { 01454 if (gnMice == 0) { 01455 /* 01456 * We had no mouse before but we have one now: add a cursor 01457 */ 01458 SET_GTERMF(GTERMF_MOUSE); 01459 SYSMET(MOUSEPRESENT) = TRUE; 01460 SetGlobalCursorLevel(0); 01461 UserAssert(PpiFromProcess(gpepCSRSS)->ptiList->iCursorLevel == 0); 01462 UserAssert(PpiFromProcess(gpepCSRSS)->ptiList->pq->iCursorLevel == 0); 01463 GreMovePointer(gpDispInfo->hDev, gpsi->ptCursor.x, gpsi->ptCursor.y); 01464 } 01465 } else { 01466 if (gnMice != 0) { 01467 /* 01468 * We had a mouse before but we don't now: remove the cursor 01469 */ 01470 CLEAR_GTERMF(GTERMF_MOUSE); 01471 SYSMET(MOUSEPRESENT) = FALSE; 01472 SetGlobalCursorLevel(-1); 01473 /* 01474 * Don't leave mouse buttons stuck down, clear the global button 01475 * state here, otherwise weird stuff might happen. 01476 * Also do this in Alt-Tab processing and zzzCancelJournalling. 01477 */ 01478 #if DBG 01479 if (gwMouseOwnerButton) 01480 RIPMSG1(RIP_WARNING, 01481 "gwMouseOwnerButton=%x, being cleared forcibly\n", 01482 gwMouseOwnerButton); 01483 #endif 01484 gwMouseOwnerButton = 0; 01485 } 01486 } 01487 /* 01488 * Mouse button count represents the number of buttons on the mouse with 01489 * the most buttons. 01490 */ 01491 SYSMET(CMOUSEBUTTONS) = nMaxButtons; 01492 SYSMET(MOUSEWHEELPRESENT) = (nWheels > 0); 01493 gnMice = nMice; 01494 break; 01495 01496 case DEVICE_TYPE_KEYBOARD: 01497 /* 01498 * Apply summary information for Keyboards 01499 */ 01500 01501 if (nKeyboards > gnKeyboards) { 01502 /* 01503 * We have more keyboards, let set their LEDs properly 01504 */ 01505 UpdateKeyLights(FALSE); 01506 } 01507 01508 if ((nKeyboards != 0) && (gnKeyboards == 0)) { 01509 /* 01510 * We had no keyboard but we have one now: set the system hotkeys. 01511 */ 01512 SetDebugHotKeys(); 01513 } 01514 gnKeyboards = nKeyboards; 01515 break; 01516 01517 default: 01518 break; 01519 } 01520 01521 ENDATOMICCHECK(); 01522 }

VOID ProcessKeyboardInput PDEVICEINFO  pDeviceInfo  ) 
 

Definition at line 2615 of file ntinput.c.

References AccessProceduresStream(), ACCF_ACCESSENABLED, BYTE, tagKEYBOARD_DEVICE_INFO::Data, DEVICE_TYPE_KEYBOARD, EnterCrit, FALSE, gAccessTimeOut, gafRawKeyState, gbRemoteSession, gCurrentModifierBit, gfEnableWindowsKey, gPhysModifierState, gpScancodeMap, gSetLedReceived, gtmridAccessTimeOut, InternalSetTimer(), tagDEVICEINFO::keyboard, LeaveCrit, MapScancode(), NULL, PBYTE, RemoteSyncToggleKeys(), TEST_ACCESSFLAG, TEST_ACCF, UINT, UserBeep(), VKFromVSC(), VOID(), xxxAccessTimeOutTimer(), and xxxProcessKeyEvent().

02616 { 02617 BYTE Vk; 02618 BYTE bPrefix; 02619 KE ke; 02620 PKEYBOARD_INPUT_DATA pkei; 02621 PKEYBOARD_INPUT_DATA pkeiStart, pkeiEnd; 02622 02623 EnterCrit(); 02624 UserAssert(pDeviceInfo->type == DEVICE_TYPE_KEYBOARD); 02625 02626 pkeiStart = pDeviceInfo->keyboard.Data; 02627 pkeiEnd = (PKEYBOARD_INPUT_DATA)((PBYTE)pkeiStart + pDeviceInfo->iosb.Information); 02628 for (pkei = pkeiStart; pkei < pkeiEnd; pkei++) { 02629 02630 /* 02631 * Remote terminal server clients occationally need to be able to set 02632 * the server's toggle key state to match the client. All other 02633 * standard keyboard inputs are processed below since this is the most 02634 * frequent code path. 02635 */ 02636 if (!(pkei->Flags & KEY_TERMSRV_SET_LED)) { 02637 02638 // Process any deferred remote key sync requests 02639 if (!(gSetLedReceived & KEYBOARD_LED_INJECTED)) 02640 goto ProcessKeys; 02641 else 02642 RemoteSyncToggleKeys(gSetLedReceived); 02643 02644 ProcessKeys: 02645 if (pkei->Flags & KEY_E0) { 02646 bPrefix = 0xE0; 02647 } else if (pkei->Flags & KEY_E1) { 02648 bPrefix = 0xE1; 02649 } else { 02650 bPrefix = 0; 02651 } 02652 02653 if (pkei->MakeCode == 0xFF) { 02654 /* 02655 * Kbd overrun (kbd hardware and/or keyboard driver) : Beep! 02656 * (some DELL keyboards send 0xFF if keys are hit hard enough, 02657 * presumably due to keybounce) 02658 */ 02659 LeaveCrit(); 02660 UserBeep(440, 125); 02661 EnterCrit(); 02662 continue; 02663 } 02664 02665 ke.bScanCode = (BYTE)(pkei->MakeCode & 0x7F); 02666 if (gpScancodeMap) { 02667 MapScancode(&ke.bScanCode, &bPrefix); 02668 } 02669 02670 Vk = VKFromVSC(&ke, bPrefix, gafRawKeyState); 02671 02672 if (Vk == 0) { 02673 continue; 02674 } 02675 02676 if (pkei->Flags & KEY_BREAK) { 02677 ke.usFlaggedVk |= KBDBREAK; 02678 } 02679 02680 02681 /* 02682 * We don't know if the client system or the host should get the 02683 * windows key, so the choice is to not support it on the host. 02684 * (The windows key is a local key.) 02685 * 02686 * The other practical problem is that the local shell intercepts 02687 * the "break" of the windows key and switches to the start menu. 02688 * The client never sees the "break" so the host thinks the 02689 * windows key is always depressed. 02690 * 02691 * Newer clients may indicate they support the windows key. 02692 * If the client has indicated this through the gfEnableWindowsKey, 02693 * then we allow it to be processed here on the host. 02694 */ 02695 if (gbRemoteSession) { 02696 BYTE CheckVk = (BYTE)ke.usFlaggedVk; 02697 02698 if (CheckVk == VK_LWIN || CheckVk == VK_RWIN) 02699 if ( !gfEnableWindowsKey ) 02700 continue; 02701 } 02702 02703 // 02704 // Keep track of real modifier key state. Conveniently, the values for 02705 // VK_LSHIFT, VK_RSHIFT, VK_LCONTROL, VK_RCONTROL, VK_LMENU and 02706 // VK_RMENU are contiguous. We'll construct a bit field to keep track 02707 // of the current modifier key state. If a bit is set, the corresponding 02708 // modifier key is down. The bit field has the following format: 02709 // 02710 // +---------------------------------------------------+ 02711 // | Right | Left | Right | Left | Right | Left | 02712 // | Alt | Alt | Control | Control | Shift | Shift | 02713 // +---------------------------------------------------+ 02714 // 5 4 3 2 1 0 Bit 02715 // 02716 // Add bit 7 -- VK_RWIN 02717 // bit 6 -- VK_LWIN 02718 02719 switch (Vk) { 02720 case VK_LSHIFT: 02721 case VK_RSHIFT: 02722 case VK_LCONTROL: 02723 case VK_RCONTROL: 02724 case VK_LMENU: 02725 case VK_RMENU: 02726 gCurrentModifierBit = 1 << (Vk & 0xf); 02727 break; 02728 case VK_LWIN: 02729 gCurrentModifierBit = 0x40; 02730 break; 02731 case VK_RWIN: 02732 gCurrentModifierBit = 0x80; 02733 break; 02734 default: 02735 gCurrentModifierBit = 0; 02736 } 02737 if (gCurrentModifierBit) { 02738 /* 02739 * If this is a break of a modifier key then clear the bit value. 02740 * Otherwise, set it. 02741 */ 02742 if (pkei->Flags & KEY_BREAK) { 02743 gPhysModifierState &= ~gCurrentModifierBit; 02744 } else { 02745 gPhysModifierState |= gCurrentModifierBit; 02746 } 02747 } 02748 02749 if (!TEST_ACCF(ACCF_ACCESSENABLED)) { 02750 xxxProcessKeyEvent(&ke, (ULONG_PTR)pkei->ExtraInformation, FALSE); 02751 } else { 02752 if ((gtmridAccessTimeOut != 0) && TEST_ACCESSFLAG(AccessTimeOut, ATF_TIMEOUTON)) { 02753 gtmridAccessTimeOut = InternalSetTimer( 02754 NULL, 02755 gtmridAccessTimeOut, 02756 (UINT)gAccessTimeOut.iTimeOutMSec, 02757 xxxAccessTimeOutTimer, 02758 TMRF_RIT | TMRF_ONESHOT 02759 ); 02760 } 02761 if (AccessProceduresStream(&ke, pkei->ExtraInformation, 0)) { 02762 xxxProcessKeyEvent(&ke, (ULONG_PTR)pkei->ExtraInformation, FALSE); 02763 } 02764 } 02765 } 02766 02767 // Special toggle key synchronization for Terminal Server 02768 else { 02769 RemoteSyncToggleKeys(pkei->ExtraInformation); 02770 } 02771 } 02772 02773 LeaveCrit(); 02774 }

VOID ProcessMouseInput PDEVICEINFO  pDeviceInfo  ) 
 

Definition at line 1137 of file ntinput.c.

References ACCF_ACCESSENABLED, tagMOUSE_DEVICE_INFO::Attr, CheckCritOut, CheckDeviceInfoListCritOut, tagMOUSE_DEVICE_INFO::Data, EnterCrit, fAbsoluteMouse, FALSE, FKMOUSEMOVE, gbRemoteSession, GDIAF_REFRESH_MOUSE, GetMouseCoord(), gFilterKeysState, gMouseProcessMiceInputTime, gptCursorAsync, gptiBlockInput, gStickyKeysLeftShiftCount, gStickyKeysRightShiftCount, gTermIO, gTermNOIO, gtmridFKActivation, KILLRITTIMER, LeaveCrit, LOGTIME, tagDEVICEINFO::mouse, NT_SUCCESS, NtGetTickCount(), NULL, PtiCurrentShared, tagTERMINAL::ptiDesktop, QueueMouseEvent(), RequestDeviceChange(), TEST_ACCF, VOID(), and xxxMoveEventAbsolute().

01139 { 01140 PMOUSE_INPUT_DATA pmei, pmeiNext; 01141 LONG time; 01142 POINT ptLastMove; 01143 01144 /* 01145 * This is an APC, so we don't need the DeviceInfoList Critical Section 01146 * In fact, we don't want it either. We will not remove the device until 01147 * ProcessMouseInput has signalled that it is OK to do so. (TBD) 01148 */ 01149 CheckCritOut(); 01150 CheckDeviceInfoListCritOut(); 01151 01152 UserAssert(pMouseInfo); 01153 UserAssert((PtiCurrentShared() == gTermIO.ptiDesktop) || 01154 (PtiCurrentShared() == gTermNOIO.ptiDesktop)); 01155 01156 LOGTIME(gMouseProcessMiceInputTime); 01157 01158 if (gptiBlockInput != NULL) { 01159 return; 01160 } 01161 01162 if (TEST_ACCF(ACCF_ACCESSENABLED)) { 01163 /* 01164 * Any mouse movement resets the count of consecutive shift key 01165 * presses. The shift key is used to enable & disable the 01166 * stickykeys accessibility functionality. 01167 */ 01168 gStickyKeysLeftShiftCount = 0; 01169 gStickyKeysRightShiftCount = 0; 01170 01171 /* 01172 * Any mouse movement also cancels the FilterKeys activation timer. 01173 * Entering critsect here breaks non-jerky mouse movement 01174 */ 01175 if (gtmridFKActivation != 0) { 01176 EnterCrit(); 01177 KILLRITTIMER(NULL, gtmridFKActivation); 01178 gtmridFKActivation = 0; 01179 gFilterKeysState = FKMOUSEMOVE; 01180 LeaveCrit(); 01181 return; 01182 } 01183 } 01184 01185 if (!NT_SUCCESS(pMouseInfo->iosb.Status)) { 01186 /* 01187 * If we get a bad status, we abandon reading this mouse. 01188 */ 01189 if (!gbRemoteSession) 01190 if (pMouseInfo->iosb.Status != STATUS_DELETE_PENDING) { 01191 RIPMSG3(RIP_ERROR, "iosb.Status %lx for mouse %#p (id %x) tell IanJa x63321", 01192 pMouseInfo->iosb.Status, 01193 pMouseInfo, pMouseInfo->mouse.Attr.MouseIdentifier); 01194 } 01195 return; 01196 } 01197 01198 /* 01199 * get the last move point from ptCursorAsync 01200 */ 01201 ptLastMove = gptCursorAsync; 01202 01203 pmei = pMouseInfo->mouse.Data; 01204 while (pmei != NULL) { 01205 01206 time = NtGetTickCount(); 01207 01208 /* 01209 * Figure out where the next event is. 01210 */ 01211 pmeiNext = pmei + 1; 01212 if ((PUCHAR)pmeiNext >= 01213 (PUCHAR)(((PUCHAR)pMouseInfo->mouse.Data) + pMouseInfo->iosb.Information)) { 01214 01215 /* 01216 * If there isn't another event set pmeiNext to 01217 * NULL so we exit the loop and don't get confused. 01218 */ 01219 pmeiNext = NULL; 01220 } 01221 01222 /* 01223 * If a PS/2 mouse was plugged in, evaluate the (new) mouse and 01224 * the skip the input record. 01225 */ 01226 if (pmei->Flags & MOUSE_ATTRIBUTES_CHANGED) { 01227 RequestDeviceChange(pMouseInfo, GDIAF_REFRESH_MOUSE, FALSE); 01228 goto NextMouseInputRecord; 01229 } 01230 01231 /* 01232 * First process any mouse movement that occured. 01233 * It is important to process movement before button events, otherwise 01234 * absolute coordinate pointing devices like touch-screens and tablets 01235 * will produce button clicks at old coordinates. 01236 */ 01237 if (pmei->LastX || pmei->LastY) { 01238 01239 /* 01240 * Get the actual point that will be injected. 01241 */ 01242 GetMouseCoord(pmei->LastX, 01243 pmei->LastY, 01244 pmei->Flags, 01245 time, 01246 pmei->ExtraInformation, 01247 &ptLastMove); 01248 01249 /* 01250 * If this is a move-only event, and the next one is also a 01251 * move-only event, skip/coalesce it. 01252 */ 01253 if ( (pmeiNext != NULL) && 01254 (pmei->ButtonFlags == 0) && 01255 (pmeiNext->ButtonFlags == 0) && 01256 (fAbsoluteMouse(pmei) == fAbsoluteMouse(pmeiNext))) { 01257 01258 pmei = pmeiNext; 01259 01260 continue; 01261 } 01262 01263 /* 01264 * Moves the cursor on the screen and updates gptCursorAsync 01265 * Call directly xxxMoveEventAbsolute because we already did the 01266 * acceleration sensitivity and clipping. 01267 */ 01268 xxxMoveEventAbsolute( 01269 ptLastMove.x, 01270 ptLastMove.y, 01271 pmei->ExtraInformation, 01272 time, 01273 FALSE 01274 ); 01275 01276 /* 01277 * Now update ptLastMove with ptCursorAsync because ptLastMove 01278 * doesn't reflect the clipping. 01279 */ 01280 ptLastMove = gptCursorAsync; 01281 } 01282 01283 /* 01284 * Queue mouse event for the other thread to pick up when it finishes 01285 * with the USER critical section. 01286 * If pmeiNext == NULL, there is no more mouse input yet, so wake RIT. 01287 */ 01288 QueueMouseEvent( 01289 pmei->ButtonFlags, 01290 pmei->ButtonData, 01291 pmei->ExtraInformation, 01292 gptCursorAsync, 01293 time, 01294 FALSE, 01295 (pmeiNext == NULL)); 01296 01297 NextMouseInputRecord: 01298 pmei = pmeiNext; 01299 } 01300 01301 return; 01302 }

void ProcessUpdateKeyStateEvent PQ  pq,
CONST PBYTE  pbKeyState,
CONST PBYTE  pbRecentDown
 

Definition at line 1996 of file ntuser/kernel/input.c.

References BYTE, CBKEYSTATERECENTDOWN, ClearKeyStateDown, ClearKeyStateToggle, gafAsyncKeyState, gpsi, SetKeyStateDown, SetKeyStateToggle, TestKeyDownBit, TestKeyRecentDownBit, and TestKeyToggleBit.

Referenced by PostUpdateKeyStateEvent(), and xxxProcessEventMessage().

02000 { 02001 int i, j; 02002 BYTE *pbChange; 02003 int vk; 02004 02005 pbChange = pbRecentDown; 02006 for (i = 0; i < CBKEYSTATERECENTDOWN; i++, pbChange++) { 02007 02008 /* 02009 * Find some keys that have changed. 02010 */ 02011 if (*pbChange == 0) 02012 continue; 02013 02014 /* 02015 * Some keys have changed in this byte. find out which key it is. 02016 */ 02017 for (j = 0; j < 8; j++) { 02018 02019 /* 02020 * Convert our counts to a virtual key index and check to see 02021 * if this key has changed. 02022 */ 02023 vk = (i << 3) + j; 02024 if (!TestKeyRecentDownBit(pbRecentDown, vk)) 02025 continue; 02026 02027 /* 02028 * This key has changed. Update it's state in the thread key 02029 * state table. 02030 */ 02031 02032 if (TestKeyDownBit(pbKeyState, vk)) { 02033 SetKeyStateDown(pq, vk); 02034 } else { 02035 ClearKeyStateDown(pq, vk); 02036 } 02037 02038 if (TestKeyToggleBit(pbKeyState, vk)) { 02039 SetKeyStateToggle(pq, vk); 02040 } else { 02041 ClearKeyStateToggle(pq, vk); 02042 } 02043 } 02044 } 02045 02046 /* 02047 * Update the key cache index. 02048 */ 02049 gpsi->dwKeyCache++; 02050 02051 /* 02052 * All updated. Free the key state table if it was posted as an Event Message 02053 */ 02054 if (pbKeyState != gafAsyncKeyState) { 02055 UserFreePool(pbKeyState); 02056 } 02057 }

NTSTATUS ProtectHandle IN HANDLE  Handle,
IN BOOLEAN  Protect
 

Definition at line 464 of file ex.c.

References Handle, NT_SUCCESS, NTSTATUS(), NULL, and Status.

Referenced by RtlInitializeCriticalSectionAndSpinCount(), RtlpCreateCriticalSectionSem(), xxxCreateThreadInfo(), and xxxDestroyThreadInfo().

00467 { 00468 OBJECT_HANDLE_FLAG_INFORMATION HandleInfo; 00469 NTSTATUS Status; 00470 00471 Status = ZwQueryObject( 00472 Handle, 00473 ObjectHandleFlagInformation, 00474 &HandleInfo, 00475 sizeof(HandleInfo), 00476 NULL); 00477 if (NT_SUCCESS(Status)) { 00478 HandleInfo.ProtectFromClose = Protect; 00479 00480 Status = ZwSetInformationObject( 00481 Handle, 00482 ObjectHandleFlagInformation, 00483 &HandleInfo, 00484 sizeof(HandleInfo)); 00485 } 00486 00487 return Status; 00488 }

PTHREADINFO PtiFromThreadId DWORD  idThread  ) 
 

Definition at line 4737 of file queue.c.

References FALSE, LockThreadByClientId(), NT_SUCCESS, NULL, PsIsThreadTerminating, PtiFromThread, tagTHREADINFO::TIF_flags, TIF_GUITHREADINITIALIZED, TIF_INCLEANUP, and UnlockThread.

Referenced by _SetWinEventHook(), NtUserAttachThreadInput(), NtUserBuildHimcList(), NtUserBuildHwndList(), NtUserDisableThreadIme(), NtUserGetGUIThreadInfo(), NtUserGetThreadState(), NtUserPostThreadMessage(), NtUserSetWindowsHookEx(), UT_CaretSet(), xxxConsoleControl(), xxxDirectedYield(), xxxGetThreadDesktop(), and zzzAttachThreadInput().

04739 { 04740 PETHREAD pEThread; 04741 PTHREADINFO pti; 04742 04743 /* 04744 * BUG BUG: Pretty much every place else we do call LockThreadByClientId 04745 * while outside the user critical section so we don't cause any 04746 * potential deadlock in the kernel. 04747 * It's too late to change it now. 2/17/99 04748 */ 04749 04750 if (!NT_SUCCESS(LockThreadByClientId((HANDLE)LongToHandle( dwThreadId ), &pEThread))) 04751 return NULL; 04752 04753 /* 04754 * If the thread is not terminating, look up the pti. This is 04755 * needed because the value returned by PtiFromThread() is 04756 * undefined if the thread is terminating. See PspExitThread in 04757 * ntos\ps\psdelete.c. 04758 */ 04759 if (!PsIsThreadTerminating(pEThread)) { 04760 pti = PtiFromThread(pEThread); 04761 } else { 04762 pti = NULL; 04763 } 04764 04765 /* 04766 * Do a sanity check on the pti to make sure it's really valid. 04767 */ 04768 if (pti != NULL) { 04769 try { 04770 if (pti->pEThread->Cid.UniqueThread != (HANDLE)LongToHandle( dwThreadId )) { 04771 pti = NULL; 04772 } else if (!(pti->TIF_flags & TIF_GUITHREADINITIALIZED)) { 04773 RIPMSG1(RIP_WARNING, "PtiFromThreadId: pti %#p not initialized", pti); 04774 pti = NULL; 04775 } else if (pti->TIF_flags & TIF_INCLEANUP) { 04776 RIPMSG1(RIP_WARNING, "PtiFromThreadId: pti %#p in cleanup", pti); 04777 pti = NULL; 04778 } 04779 } except (W32ExceptionHandler(FALSE, RIP_WARNING)) { 04780 pti = NULL; 04781 } 04782 } 04783 04784 UnlockThread(pEThread); 04785 04786 return pti; 04787 }

BOOL QueryTrackMouseEvent LPTRACKMOUSEEVENT  lpTME  ) 
 

Definition at line 2679 of file ntuser/kernel/input.c.

References BOOL, DF_TRACKMOUSEEVENT, DF_TRACKMOUSEHOVER, DF_TRACKMOUSELEAVE, tagDESKTOP::dwDTFlags, tagDESKTOP::dwMouseHoverTime, GETPTI, tagDESKTOP::htEx, HWq, tagTHREADINFO::pq, PtiCurrent, tagTHREADINFO::rpdesk, tagDESKTOP::spwndTrack, and TRUE.

Referenced by NtUserTrackMouseEvent().

02681 { 02682 PTHREADINFO ptiCurrent = PtiCurrent(); 02683 PDESKTOP pdesk = ptiCurrent->rpdesk; 02684 02685 /* 02686 * initialize the struct 02687 */ 02688 RtlZeroMemory(lpTME, sizeof(*lpTME)); 02689 lpTME->cbSize = sizeof(*lpTME); 02690 /* 02691 * Bail if not tracking any mouse event 02692 * or if the current thread is not in spwndTrack's queue 02693 */ 02694 if (!(pdesk->dwDTFlags & DF_TRACKMOUSEEVENT) 02695 || (ptiCurrent->pq != GETPTI(pdesk->spwndTrack)->pq)) { 02696 return TRUE; 02697 } 02698 /* 02699 * fill in the requested information 02700 */ 02701 if (pdesk->htEx != HTCLIENT) { 02702 lpTME->dwFlags |= TME_NONCLIENT; 02703 } 02704 if (pdesk->dwDTFlags & DF_TRACKMOUSELEAVE) { 02705 lpTME->dwFlags |= TME_LEAVE; 02706 } 02707 if (pdesk->dwDTFlags & DF_TRACKMOUSEHOVER) { 02708 lpTME->dwFlags |= TME_HOVER; 02709 lpTME->dwHoverTime = pdesk->dwMouseHoverTime; 02710 } 02711 02712 lpTME->hwndTrack = HWq(pdesk->spwndTrack); 02713 02714 return TRUE; 02715 }

VOID QueueMouseEvent USHORT  ButtonFlags,
USHORT  ButtonData,
ULONG_PTR  ExtraInfo,
POINT  ptMouse,
LONG  time,
BOOL  bInjected,
BOOL  bWakeRIT
 

Definition at line 925 of file ntinput.c.

References tagMOUSEEVENT::bInjected, tagMOUSEEVENT::ButtonData, tagMOUSEEVENT::ButtonFlags, CheckCritOut, EnterMouseCrit(), EVENT_INCREMENT, tagMOUSEEVENT::ExtraInfo, FALSE, gdwMouseEvents, gdwMouseQueueHead, gMouseEventQueue, gMouseQueueMouseEventTime, gpkeMouseData, KeSetEvent(), LeaveMouseCrit(), LOGTIME, NELEM_BUTTONQUEUE, tagMOUSEEVENT::ptPointer, tagMOUSEEVENT::time, UserBeep(), and VOID().

Referenced by ProcessMouseInput(), xxxMKMouseMove(), xxxMKMoveAccelCursorTimer(), xxxMKMoveConstCursorTimer(), and xxxMouseEventDirect().

00934 { 00935 CheckCritOut(); 00936 00937 EnterMouseCrit(); 00938 00939 LOGTIME(gMouseQueueMouseEventTime); 00940 00941 /* 00942 * Button data must always be accompanied by a flag to interpret it. 00943 */ 00944 UserAssert(ButtonData == 0 || ButtonFlags != 0); 00945 00946 /* 00947 * We can coalesce this mouse event with the previous event if there is a 00948 * previous event, and if the previous event and this event involve no 00949 * key transitions. 00950 */ 00951 if ((gdwMouseEvents == 0) || 00952 (ButtonFlags != 0) || 00953 (gMouseEventQueue[gdwMouseQueueHead].ButtonFlags != 0)) { 00954 /* 00955 * Can't coalesce: must add a new mouse event 00956 */ 00957 if (gdwMouseEvents >= NELEM_BUTTONQUEUE) { 00958 /* 00959 * But no more room! 00960 */ 00961 LeaveMouseCrit(); 00962 UserBeep(440, 125); 00963 return; 00964 } 00965 00966 gdwMouseQueueHead = (gdwMouseQueueHead + 1) % NELEM_BUTTONQUEUE; 00967 gMouseEventQueue[gdwMouseQueueHead].ButtonFlags = ButtonFlags; 00968 gMouseEventQueue[gdwMouseQueueHead].ButtonData = ButtonData; 00969 gdwMouseEvents++; 00970 } 00971 00972 gMouseEventQueue[gdwMouseQueueHead].ExtraInfo = ExtraInfo; 00973 gMouseEventQueue[gdwMouseQueueHead].ptPointer = ptMouse; 00974 gMouseEventQueue[gdwMouseQueueHead].time = time; 00975 gMouseEventQueue[gdwMouseQueueHead].bInjected = bInjected; 00976 00977 LeaveMouseCrit(); 00978 00979 if (bWakeRIT) { 00980 /* 00981 * Signal RIT to complete the mouse input processing 00982 */ 00983 KeSetEvent(gpkeMouseData, EVENT_INCREMENT, FALSE); 00984 } 00985 }

void QueueNotifyMessage PWND  pwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 969 of file kernel/sendmsg.c.

Referenced by CancelInputState(), DoQueuedSyncPaint(), xxxActivateApp(), xxxResetDisplayDevice(), and xxxSendBSMtoDesktop().

00987 {

VOID ReceiverDied PSMS  psms,
PSMS ppsmsUnlink
 

Referenced by InterQueueMsgCleanup(), and SendMsgCleanup().

VOID RecolorDeskPattern  ) 
 

Referenced by xxxSetDeskPattern(), and xxxSetSysColors().

BOOL RecreateRedirectionBitmap PWND  pwnd  ) 
 

Definition at line 337 of file sprite.c.

References _GetProp(), BOOL, CreateRedirectionBitmap(), cy, tagDCE::DCX_flags, DeleteRedirectionBitmap(), FALSE, FLayeredOrRedirected(), GetTopLevelWindow(), ghdcMem, ghdcMem2, gpDispInfo, tagDCE::hdc, tagDISPLAYINFO::hDev, min, NULL, tagDISPLAYINFO::pdceFirst, tagDCE::pdceNext, PROP_LAYER, tagDCE::pwndOrg, RemoveRedirectionBitmap(), and TRUE.

Referenced by UserRecreateRedirectionBitmap(), and zzzChangeStates().

00338 { 00339 HBITMAP hbm, hbmNew, hbmMem, hbmMem2; 00340 BITMAP bm, bmNew; 00341 int cx, cy; 00342 PDCE pdce; 00343 00344 UserAssert(FLayeredOrRedirected(pwnd)); 00345 00346 /* 00347 * No need to do anything if this layered window doesn't have 00348 * a redirection bitmap. 00349 */ 00350 if ((hbm = (HBITMAP)_GetProp(pwnd, PROP_LAYER, TRUE)) == NULL) 00351 return FALSE; 00352 00353 /* 00354 * Try to create a new redirection bitmap with the new size. If failed, 00355 * delete the old one and remove it from the window property list. 00356 */ 00357 if ((hbmNew = CreateRedirectionBitmap(pwnd)) == NULL) { 00358 RemoveRedirectionBitmap(pwnd); 00359 return FALSE; 00360 } 00361 00362 /* 00363 * Make sure that the display is locked, so that nobody can be drawing 00364 * into the redirection DCs while we're switching bitmaps under them. 00365 */ 00366 UserAssert(GreIsDisplayLocked(gpDispInfo->hDev)); 00367 00368 /* 00369 * Get the size of the old bitmap to know how much to copy. 00370 */ 00371 GreExtGetObjectW(hbm, sizeof(bm), (LPSTR)&bm); 00372 GreExtGetObjectW(hbmNew, sizeof(bmNew), (LPSTR)&bmNew); 00373 00374 /* 00375 * Copy the bitmap from the old bitmap into the new one. 00376 */ 00377 hbmMem = GreSelectBitmap(ghdcMem, hbm); 00378 hbmMem2 = GreSelectBitmap(ghdcMem2, hbmNew); 00379 00380 cx = min(bm.bmWidth, bmNew.bmWidth); 00381 cy = min(bm.bmHeight, bmNew.bmHeight); 00382 00383 GreBitBlt(ghdcMem2, 0, 0, cx, cy, ghdcMem, 0, 0, SRCCOPY | NOMIRRORBITMAP, 0); 00384 00385 /* 00386 * Find layered DCs that are in use corresponding to this window and 00387 * replace the old redirection bitmap by the new one. 00388 */ 00389 for (pdce = gpDispInfo->pdceFirst; pdce != NULL; pdce = pdce->pdceNext) { 00390 00391 if (!(pdce->DCX_flags & DCX_LAYERED) || !(pdce->DCX_flags & DCX_INUSE)) 00392 continue; 00393 00394 if (GetTopLevelWindow(pdce->pwndOrg) != pwnd) 00395 continue; 00396 00397 UserVerify(GreSelectRedirectionBitmap(pdce->hdc, hbmNew)); 00398 } 00399 00400 GreSelectBitmap(ghdcMem, hbmMem); 00401 GreSelectBitmap(ghdcMem2, hbmMem2); 00402 00403 /* 00404 * Finally, delete the old redirection bitmap. 00405 */ 00406 DeleteRedirectionBitmap(hbm); 00407 00408 return TRUE; 00409 }

VOID RecreateSmallIcons PWND  pwnd  ) 
 

BOOL ReferenceClass PCLS  pcls,
PWND  pwnd
 

Definition at line 1645 of file class.c.

References BOOL, ClassAlloc(), ClassFree(), CLS, tagCLS::CSF_flags, CSF_WOWCLASS, tagCLS::cWndReferenceCount, DWORD, FALSE, tagWND::head, Lock, LockDesktop, NULL, tagWND::pcls, tagCLS::pclsClone, tagCLS::pclsNext, tagCLS::rpdeskParent, strlen(), and TRUE.

Referenced by xxxCreateWindowEx().

01648 { 01649 DWORD cbName; 01650 PCLS pclsClone; 01651 PDESKTOP pdesk; 01652 01653 /* 01654 * If the window is on the same desktop as the base class, just 01655 * increment the window count. 01656 */ 01657 if (pcls->rpdeskParent == pwnd->head.rpdesk) { 01658 pcls->cWndReferenceCount++; 01659 return TRUE; 01660 } 01661 01662 /* 01663 * The window is not on the base desktop. Try to find a cloned 01664 * class. 01665 */ 01666 for (pclsClone = pcls->pclsClone; pclsClone != NULL; 01667 pclsClone = pclsClone->pclsNext) { 01668 if (pclsClone->rpdeskParent == pwnd->head.rpdesk) 01669 break; 01670 } 01671 01672 /* 01673 * If we can't find one, clone the base class. 01674 */ 01675 if (pclsClone == NULL) { 01676 pdesk = pwnd->head.rpdesk; 01677 pclsClone = ClassAlloc(pdesk, sizeof(CLS) + pcls->cbclsExtra + (pcls->CSF_flags & CSF_WOWCLASS ?sizeof(WC):0)); 01678 if (pclsClone == NULL) { 01679 RIPMSG0(RIP_WARNING, "ReferenceClass: Failed Clone-Class Allocation\n"); 01680 return FALSE; 01681 } 01682 01683 RtlCopyMemory(pclsClone, pcls, sizeof(CLS) + pcls->cbclsExtra + (pcls->CSF_flags & CSF_WOWCLASS?sizeof(WC):0)); 01684 cbName = strlen(pcls->lpszAnsiClassName) + 1; 01685 pclsClone->lpszAnsiClassName = ClassAlloc(pdesk, cbName); 01686 if (pclsClone->lpszAnsiClassName == NULL) { 01687 ClassFree(pdesk, pclsClone); 01688 RIPMSG0(RIP_WARNING, "ReferenceClass: No Clone Class Name\n"); 01689 return FALSE; 01690 } 01691 01692 /* 01693 * Everything has been allocated, now lock everything down. 01694 * NULL pointers in clone to prevent Lock() from incorrectly 01695 * decrementing object reference count 01696 */ 01697 pclsClone->rpdeskParent = NULL; 01698 LockDesktop(&pclsClone->rpdeskParent, pdesk, 01699 LDL_CLS_DESKPARENT2, (ULONG_PTR)pclsClone); 01700 pclsClone->pclsNext = pcls->pclsClone; 01701 pclsClone->pclsClone = NULL; 01702 pcls->pclsClone = pclsClone; 01703 RtlCopyMemory(pclsClone->lpszAnsiClassName, pcls->lpszAnsiClassName, cbName); 01704 01705 pclsClone->spicn = pclsClone->spicnSm = pclsClone->spcur = NULL; 01706 01707 Lock(&pclsClone->spicn, pcls->spicn); 01708 Lock(&pclsClone->spicnSm, pcls->spicnSm); 01709 Lock(&pclsClone->spcur, pcls->spcur); 01710 pclsClone->spcpdFirst = NULL; 01711 pclsClone->cWndReferenceCount = 0; 01712 } 01713 01714 /* 01715 * Increment reference counts. 01716 */ 01717 pcls->cWndReferenceCount++; 01718 pclsClone->cWndReferenceCount++; 01719 pwnd->pcls = pclsClone; 01720 01721 return TRUE; 01722 }

NTSTATUS ReferenceWindowStation PETHREAD  Thread,
HWINSTA  hwinsta,
ACCESS_MASK  amDesiredAccess,
PWINDOWSTATION ppwinsta,
BOOL  fUseDesktop
 

Definition at line 1366 of file winsta.c.

References AccessCheckObject(), tagPROCESSINFO::amwinsta, ExWindowStationObjectType, KernelMode, NT_SUCCESS, NTSTATUS(), NULL, ObDereferenceObject, ObReferenceObjectByHandle(), PpiFromProcess, PtiFromThread, RETURN_IF_ACCESS_DENIED, tagTHREADINFO::rpdesk, tagPROCESSINFO::rpwinsta, tagDESKTOP::rpwinstaParent, Status, _ETHREAD::ThreadsProcess, and WinStaMapping.

Referenced by CheckClipboardAccess(), UserGlobalAtomTableCallout(), and xxxSnapWindow().

01372 { 01373 PPROCESSINFO ppi; 01374 PTHREADINFO pti; 01375 PWINDOWSTATION pwinsta = NULL; 01376 NTSTATUS Status; 01377 01378 /* 01379 * We prefer to use the thread's desktop to dictate which 01380 * windowstation/Atom table to use rather than the process. 01381 * This allows NetDDE, which has threads running under 01382 * different desktops on different windowstations but whos 01383 * process is set to only one of these windowstations, to 01384 * get global atoms properly without having to change its 01385 * process windowstation a billion times and synchronize. 01386 */ 01387 ppi = PpiFromProcess(Thread->ThreadsProcess); 01388 pti = PtiFromThread(Thread); 01389 01390 /* 01391 * First, try to get the windowstation from the pti, and then 01392 * from the ppi. 01393 */ 01394 if (ppi != NULL) { 01395 if (!fUseDesktop || pti == NULL || pti->rpdesk == NULL || 01396 ppi->rpwinsta == pti->rpdesk->rpwinstaParent) { 01397 01398 /* 01399 * Use the windowstation assigned to the process. 01400 */ 01401 pwinsta = ppi->rpwinsta; 01402 if (pwinsta != NULL) { 01403 RETURN_IF_ACCESS_DENIED(ppi->amwinsta, amDesiredAccess, 01404 STATUS_ACCESS_DENIED); 01405 } 01406 } 01407 01408 /* 01409 * If we aren't using the process' windowstation, try to 01410 * go through the thread's desktop. 01411 */ 01412 if (pwinsta == NULL && pti != NULL && pti->rpdesk != NULL) { 01413 01414 /* 01415 * Perform access check the parent windowstation. This 01416 * is an expensive operation. 01417 */ 01418 pwinsta = pti->rpdesk->rpwinstaParent; 01419 if (!AccessCheckObject(pwinsta, amDesiredAccess, KernelMode, &WinStaMapping)) 01420 return STATUS_ACCESS_DENIED; 01421 } 01422 } 01423 01424 /* 01425 * If we still don't have a windowstation and a handle was 01426 * passed in, use it. 01427 */ 01428 if (pwinsta == NULL) { 01429 if (hwinsta != NULL) { 01430 Status = ObReferenceObjectByHandle( 01431 hwinsta, 01432 amDesiredAccess, 01433 *ExWindowStationObjectType, 01434 KernelMode, 01435 &pwinsta, 01436 NULL); 01437 if (!NT_SUCCESS(Status)) 01438 return Status; 01439 ObDereferenceObject(pwinsta); 01440 } else { 01441 return STATUS_NOT_FOUND; 01442 } 01443 } 01444 01445 *ppwinsta = pwinsta; 01446 01447 return STATUS_SUCCESS; 01448 }

void RegisterLPK DWORD   ) 
 

Definition at line 2769 of file w32/ntuser/kernel/init.c.

References PpiCurrent, and VOID().

02771 { 02772 PpiCurrent()->dwLpkEntryPoints = dwLpkEntryPoints; 02773 }

VOID RegisterPerUserKeyboardIndicators PUNICODE_STRING  pProfileUserName  ) 
 

Definition at line 223 of file keyboard.c.

References FastWriteProfileStringW(), ISTS, L, PMAP_KEYBOARD, TestAsyncKeyStateToggle, and wszInitialKeyboardIndicators.

Referenced by PrepareForLogoff().

00224 { 00225 WCHAR wszInitKbdInd[2] = L"0"; 00226 00227 /* 00228 * Initial Keyboard state (Num-Lock only) 00229 */ 00230 00231 /* 00232 * For HYDRA we do not want to save this as set, since it confuses 00233 * dial in laptop computers. So we force it off in the profile on 00234 * logoff. 00235 */ 00236 if (!ISTS()) { 00237 wszInitKbdInd[0] += TestAsyncKeyStateToggle(VK_NUMLOCK) ? 2 : 0; 00238 } 00239 00240 FastWriteProfileStringW(pProfileUserName, 00241 PMAP_KEYBOARD, 00242 wszInitialKeyboardIndicators, 00243 wszInitKbdInd); 00244 }

UINT ReleaseCacheDC HDC  hdc,
BOOL  fEndPaint
 

Definition at line 1337 of file dc.c.

References DCE_FREED, DCE_NORELEASE, DCE_RELEASED, DCE_SIZE_CACHETHRESHOLD, tagDCE::DCX_flags, DeleteHrgnClip(), DestroyCacheDC(), FALSE, gnDCECount, gpDispInfo, tagDCE::hdc, tagDISPLAYINFO::hDev, IncrementFreeDCECount(), NULL, tagDISPLAYINFO::pdceFirst, tagDCE::pdceNext, tagDCE::ptiOwner, UINT, and UpdateLayeredSprite().

Referenced by _ReleaseDC(), xxxEndPaint(), xxxEnumDisplayMonitors(), xxxFreeWindow(), and xxxSendEraseBkgnd().

01340 { 01341 PDCE pdce; 01342 PDCE *ppdce; 01343 01344 for (ppdce = &gpDispInfo->pdceFirst; (pdce = *ppdce); ppdce = &pdce->pdceNext) { 01345 01346 if (pdce->hdc == hdc) { 01347 01348 /* 01349 * Check for redundant releases or release of an invalid entry 01350 */ 01351 if ((pdce->DCX_flags & (DCX_DESTROYTHIS | DCX_INVALID | DCX_INUSE)) != DCX_INUSE) 01352 return DCE_NORELEASE; 01353 01354 /* 01355 * Lock the display since we may be playing with visrgns. 01356 */ 01357 GreLockDisplay(gpDispInfo->hDev); 01358 01359 if (pdce->DCX_flags & DCX_LAYERED) { 01360 UpdateLayeredSprite(pdce); 01361 } 01362 01363 /* 01364 * If this is a permanent DC, then don't reset its state. 01365 */ 01366 if (pdce->DCX_flags & DCX_CACHE) { 01367 /* 01368 * Restore the DC state and mark the entry as not in use. 01369 * Set owner back to server as well, since it's going back 01370 * into the cache. 01371 */ 01372 if (!(pdce->DCX_flags & DCX_NORESETATTRS)) { 01373 /* 01374 * If bSetupDC() failed, the DC is busy (ie. in-use 01375 * by another thread), so don't release it. 01376 */ 01377 if ( (!(GreCleanDC(hdc))) || 01378 (!(GreSetDCOwner(hdc, OBJECT_OWNER_NONE))) ) { 01379 01380 GreUnlockDisplay(gpDispInfo->hDev); 01381 return DCE_NORELEASE; 01382 } 01383 01384 } else if (!GreSetDCOwner(pdce->hdc, OBJECT_OWNER_NONE)) { 01385 01386 GreUnlockDisplay(gpDispInfo->hDev); 01387 return DCE_NORELEASE; 01388 } 01389 01390 pdce->ptiOwner = NULL; 01391 pdce->DCX_flags &= ~DCX_INUSE; 01392 01393 #if DBG 01394 /* 01395 * Turn off checked only surface validation for now, since 01396 * we may select a different surface (screen) in this DC that 01397 * may not correspond to the visrgn currently in the DC. When 01398 * the DC is given out again, it will be revalidated. 01399 */ 01400 GreValidateVisrgn(pdce->hdc, FALSE); 01401 #endif 01402 01403 /* 01404 * The DC is no longer in use, so unselect the redirection 01405 * bitmap from it. 01406 */ 01407 if (pdce->DCX_flags & DCX_LAYERED) { 01408 UserVerify(GreSelectRedirectionBitmap(pdce->hdc, NULL)); 01409 } 01410 01411 /* 01412 * Increment the Free DCE count. This holds the count 01413 * of available DCEs. Check the threshold, and destroy 01414 * the dce if it's above the mark. 01415 */ 01416 IncrementFreeDCECount(); 01417 01418 if (gnDCECount > DCE_SIZE_CACHETHRESHOLD) { 01419 if (DestroyCacheDC(ppdce, pdce->hdc)) { 01420 GreUnlockDisplay(gpDispInfo->hDev); 01421 return DCE_FREED; 01422 } 01423 } 01424 } 01425 01426 /* 01427 * If we have an EXCLUDERGN or INTERSECTRGN cache entry, 01428 * convert it back to a "normal" cache entry by restoring 01429 * the visrgn and blowing away hrgnClip. 01430 * 01431 * Note that for non-DCX_CACHE DCs, we only do this if 01432 * we're being called from EndPaint(). 01433 */ 01434 if ((pdce->DCX_flags & (DCX_EXCLUDERGN | DCX_INTERSECTRGN)) && 01435 ((pdce->DCX_flags & DCX_CACHE) || fEndPaint)) { 01436 DeleteHrgnClip(pdce); 01437 } 01438 01439 GreUnlockDisplay(gpDispInfo->hDev); 01440 return DCE_RELEASED; 01441 } 01442 } 01443 01444 /* 01445 * Yell if DC couldn't be found... 01446 */ 01447 RIPERR1(ERROR_DC_NOT_FOUND, RIP_WARNING, 01448 "Invalid device context (DC) handle passed to ReleaseCacheDC (0x%08lx)", hdc); 01449 01450 return DCE_NORELEASE; 01451 }

NTSTATUS RemoteConnect IN PDOCONNECTDATA  pDoConnectData,
IN ULONG  DisplayDriverNameLength,
IN PWCHAR  DisplayDriverName
 

Definition at line 20 of file w32/ntuser/kernel/misc.c.

References CreateKernelEvent(), DWORD, FALSE, gbClientDoubleClickSupport, gbConnected, gbRemoteSession, gbVideoInitialized, gfEnableWindowsKey, ghRemoteBeepChannel, ghRemoteKeyboardChannel, ghRemoteMouseChannel, ghRemoteThinwireChannel, ghRemoteVideoChannel, gpevtDesktopDestroyed, gpRemoteBeepDevice, gpThinWireCache, gRemoteClientKeyboardType, gstrBaseWinStationName, gThinwireFileObject, gVideoFileObject, gWinStationInfo, HH_REMOTECONNECT, HYDRA_HINT, InitLoadResources(), InitVideo(), IoGetRelatedDeviceObject(), ISCSRSS, KernelMode, L, LW_BrushInit(), min, NT_SUCCESS, NTSTATUS(), NULL, ObReferenceObjectByHandle(), PBYTE, PDOCONNECTDATA, Status, ThinWireCache, TRACE_HYDAPI, and TRUE.

Referenced by NtUserRemoteConnect().

00024 { 00025 NTSTATUS Status = STATUS_SUCCESS; 00026 PFILE_OBJECT pFileObject = NULL; 00027 PDEVICE_OBJECT pDeviceObject = NULL; 00028 PWCHAR pSep; 00029 00030 TRACE_HYDAPI(("RemoteConnect: display %ws\n", DisplayDriverName)); 00031 00032 HYDRA_HINT(HH_REMOTECONNECT); 00033 00034 UserAssert(ISCSRSS()); 00035 00036 gpThinWireCache = &ThinWireCache; 00037 00038 if (pDoConnectData->fMouse) { 00039 ghRemoteMouseChannel = pDoConnectData->IcaMouseChannel; 00040 } else { 00041 ghRemoteMouseChannel = NULL; 00042 } 00043 00044 ghRemoteVideoChannel = pDoConnectData->IcaVideoChannel; 00045 ghRemoteBeepChannel = pDoConnectData->IcaBeepChannel; 00046 ghRemoteKeyboardChannel = pDoConnectData->IcaKeyboardChannel; 00047 ghRemoteThinwireChannel = pDoConnectData->IcaThinwireChannel; 00048 00049 gRemoteClientKeyboardType = pDoConnectData->ClientKeyboardType; 00050 00051 gbClientDoubleClickSupport = pDoConnectData->fClientDoubleClickSupport; 00052 00053 gfEnableWindowsKey = pDoConnectData->fEnableWindowsKey; 00054 00055 RtlCopyMemory(gWinStationInfo.ProtocolName, pDoConnectData->ProtocolName, 00056 WPROTOCOLNAME_LENGTH * sizeof(WCHAR)); 00057 00058 RtlCopyMemory(gWinStationInfo.AudioDriverName, pDoConnectData->AudioDriverName, 00059 WAUDIONAME_LENGTH * sizeof(WCHAR)); 00060 00061 RtlZeroMemory(gstrBaseWinStationName, 00062 WINSTATIONNAME_LENGTH * sizeof(WCHAR)); 00063 00064 RtlCopyMemory(gstrBaseWinStationName, pDoConnectData->WinStationName, 00065 min(WINSTATIONNAME_LENGTH * sizeof(WCHAR), sizeof(pDoConnectData->WinStationName))); 00066 00067 if (pSep = wcschr(gstrBaseWinStationName, L'#')) 00068 *pSep = UNICODE_NULL; 00069 00070 /* 00071 * Create the event that is signaled when a desktop does away 00072 */ 00073 gpevtDesktopDestroyed = CreateKernelEvent(SynchronizationEvent, FALSE); 00074 if (gpevtDesktopDestroyed == NULL) { 00075 RIPMSG0(RIP_WARNING, "RemoteConnect couldn't create gpevtDesktopDestroyed"); 00076 return STATUS_NO_MEMORY; 00077 } 00078 00079 gbConnected = TRUE; 00080 00081 /* 00082 * WinStations must have the video device handle passed to them. 00083 */ 00084 if (gbRemoteSession && !gVideoFileObject) { 00085 00086 PFILE_OBJECT pFileObject = NULL; 00087 PDEVICE_OBJECT pDeviceObject = NULL; 00088 00089 // 00090 // Dereference the file handle 00091 // and obtain a pointer to the device object for the handle. 00092 // 00093 00094 Status = ObReferenceObjectByHandle(ghRemoteVideoChannel, 00095 0, 00096 NULL, 00097 KernelMode, 00098 (PVOID*)&pFileObject, 00099 NULL); 00100 if (NT_SUCCESS(Status)) { 00101 00102 gVideoFileObject = pFileObject; 00103 00104 // 00105 // Get a pointer to the device object for this file. 00106 // 00107 pDeviceObject = IoGetRelatedDeviceObject(pFileObject); 00108 00109 Status = ObReferenceObjectByHandle(ghRemoteThinwireChannel, 00110 0, 00111 NULL, 00112 KernelMode, 00113 (PVOID*)&gThinwireFileObject, 00114 NULL); 00115 00116 /* 00117 * This must be done before any thinwire data. 00118 */ 00119 if (NT_SUCCESS(Status)) { 00120 00121 if (!GreMultiUserInitSession(ghRemoteThinwireChannel, 00122 (PBYTE)gpThinWireCache, 00123 gVideoFileObject, 00124 gThinwireFileObject, 00125 DisplayDriverNameLength, 00126 DisplayDriverName)) { 00127 RIPMSG0(RIP_WARNING, "UserInit: GreMultiUserInitSession failed"); 00128 Status = STATUS_UNSUCCESSFUL; 00129 } else { 00130 00131 DWORD BytesReturned; 00132 00133 Status = GreDeviceIoControl( pDeviceObject, 00134 IOCTL_VIDEO_ICA_ENABLE_GRAPHICS, 00135 NULL, 00136 0, 00137 NULL, 00138 0, 00139 &BytesReturned); 00140 if (!NT_SUCCESS(Status)) { 00141 RIPMSG1(RIP_WARNING, "UserInit: Enable graphics status %08lx", 00142 Status); 00143 } 00144 } 00145 } 00146 } 00147 } 00148 00149 if (!NT_SUCCESS(Status)) { 00150 RIPMSG0(RIP_WARNING, "RemoteConnect failed"); 00151 return Status; 00152 } 00153 00154 if (InitVideo(FALSE) == NULL) { 00155 gbConnected = FALSE; 00156 RIPMSG0(RIP_WARNING, "InitVideo failed"); 00157 return STATUS_UNSUCCESSFUL; 00158 } 00159 00160 if (!LW_BrushInit()) { 00161 RIPMSG0(RIP_WARNING, "LW_BrushInit failed"); 00162 return STATUS_NO_MEMORY; 00163 } 00164 00165 InitLoadResources(); 00166 00167 Status = ObReferenceObjectByHandle(ghRemoteBeepChannel, 00168 0, 00169 NULL, 00170 KernelMode, 00171 (PVOID*)&gpRemoteBeepDevice, 00172 NULL); 00173 00174 /* 00175 * video is initialized at this point 00176 */ 00177 if (NT_SUCCESS(Status)) { 00178 gbVideoInitialized = TRUE; 00179 } else { 00180 RIPMSG0(RIP_WARNING, "Bad Remote Beep Channel"); 00181 } 00182 00183 return Status; 00184 }

DWORD RemoteConnectState VOID   ) 
 

Definition at line 843 of file w32/ntuser/kernel/misc.c.

References DWORD, gbConnected, gbExitInProgress, gbRemoteSession, and gbVideoInitialized.

00845 { 00846 DWORD state = 0; 00847 00848 if (!gbRemoteSession) { 00849 00850 state = CTX_W32_CONNECT_STATE_CONSOLE; 00851 00852 } else if (!gbVideoInitialized) { 00853 00854 state = CTX_W32_CONNECT_STATE_IDLE; 00855 00856 } else if (gbExitInProgress) { 00857 00858 state = CTX_W32_CONNECT_STATE_EXIT_IN_PROGRESS; 00859 00860 } else if (gbConnected) { 00861 00862 state = CTX_W32_CONNECT_STATE_CONNECTED; 00863 00864 } else { 00865 state = CTX_W32_CONNECT_STATE_DISCONNECTED; 00866 } 00867 00868 return state; 00869 }

NTSTATUS RemoteDisableScreen VOID   ) 
 

Definition at line 1733 of file fullscr.c.

References CheckCritIn, DWORD, tagWINDOWSTATION::dwWSF_Flags, FALSE, gbDesktopLocked, gpDispInfo, grpdeskRitInput, gspdeskDisconnect, gspdeskShouldBeForeground, LockDesktop, NTSTATUS(), NULL, tagDISPLAYINFO::pmdev, PtiCurrentShared, tagDESKTOP::rpwinstaParent, Status, ThreadLockDesktop, ThreadUnlockDesktop, TRACE_HYDAPI, TRUE, WSF_SWITCHLOCK, and xxxSwitchDesktop().

Referenced by xxxDesktopThread(), and xxxRemoteStopScreenUpdates().

01735 { 01736 TL tlpdesk; 01737 DWORD dwFlagsPrev; 01738 PTHREADINFO ptiCurrent; 01739 PWINDOWSTATION pwinsta; 01740 NTSTATUS Status = STATUS_SUCCESS; 01741 01742 CheckCritIn(); 01743 01744 TRACE_HYDAPI(("RemoteDisableScreen\n")); 01745 01746 01747 ptiCurrent = PtiCurrentShared(); 01748 01749 if (grpdeskRitInput != gspdeskDisconnect && 01750 gspdeskDisconnect != NULL) { 01751 01752 pwinsta = gspdeskDisconnect->rpwinstaParent; 01753 01754 /* 01755 * Save current desktop 01756 */ 01757 UserAssert(grpdeskRitInput == pwinsta->pdeskCurrent); 01758 01759 LockDesktop(&gspdeskShouldBeForeground, 01760 grpdeskRitInput, 01761 LDL_DESKSHOULDBEFOREGROUND3, 0); 01762 01763 /* 01764 * Set desktop switch lock 01765 * (WSF_SWITCHLOCK must be clear for xxxSwitchDesktop to succeed) 01766 */ 01767 dwFlagsPrev = pwinsta->dwWSF_Flags; 01768 pwinsta->dwWSF_Flags &= ~WSF_SWITCHLOCK; 01769 gbDesktopLocked = TRUE; 01770 01771 /* 01772 * Switch to Disconnected desktop 01773 */ 01774 ThreadLockDesktop(ptiCurrent, gspdeskDisconnect, &tlpdesk, LDLT_FN_CTXDISABLESCREEN); 01775 xxxSwitchDesktop(pwinsta, gspdeskDisconnect, FALSE); 01776 ThreadUnlockDesktop(ptiCurrent, &tlpdesk, LDUT_FN_CTXDISABLESCREEN); 01777 01778 pwinsta->dwWSF_Flags = dwFlagsPrev; 01779 01780 /* 01781 * Disable screen updates 01782 */ 01783 DrvDisableMDEV(gpDispInfo->pmdev, TRUE); 01784 01785 } else if (gspdeskDisconnect != NULL) { 01786 /* 01787 * For some reason the disconnected desktop was the current desktop. 01788 * Now prevent switching from it. 01789 */ 01790 gbDesktopLocked = TRUE; 01791 } 01792 01793 return Status; 01794 }

NTSTATUS RemoteLogoff VOID   ) 
 

Definition at line 415 of file w32/ntuser/kernel/misc.c.

References _PostMessage(), gspwndLogonNotify, HH_REMOTELOGOFF, HYDRA_HINT, ISCSRSS, ISTS, NTSTATUS(), NULL, Status, and TRACE_HYDAPI.

00417 { 00418 NTSTATUS Status = STATUS_SUCCESS; 00419 00420 TRACE_HYDAPI(("RemoteLogoff\n")); 00421 00422 /* 00423 * Only allow CSRSS to do this 00424 */ 00425 if (!ISCSRSS() || !ISTS()) { 00426 return STATUS_ACCESS_DENIED; 00427 } 00428 00429 HYDRA_HINT(HH_REMOTELOGOFF); 00430 00431 UserAssert(ISCSRSS()); 00432 00433 /* 00434 * Tell winlogon about the logoff 00435 */ 00436 if (gspwndLogonNotify != NULL) { 00437 _PostMessage(gspwndLogonNotify, WM_LOGONNOTIFY, 00438 SESSION_LOGOFF, EWX_LOGOFF | EWX_FORCE); 00439 } 00440 00441 return Status; 00442 }

NTSTATUS RemoteNtSecurity VOID   ) 
 

Definition at line 582 of file w32/ntuser/kernel/misc.c.

References _PostMessage(), gspwndLogonNotify, ISCSRSS, ISTS, NULL, and TRACE_HYDAPI.

00584 { 00585 TRACE_HYDAPI(("RemoteNtSecurity\n")); 00586 00587 /* 00588 * Only allow CSRSS to do this 00589 */ 00590 if (!ISCSRSS() || !ISTS()) { 00591 return STATUS_ACCESS_DENIED; 00592 } 00593 00594 UserAssert(ISCSRSS()); 00595 00596 UserAssert(gspwndLogonNotify != NULL); 00597 00598 if (gspwndLogonNotify != NULL) { 00599 _PostMessage(gspwndLogonNotify, WM_HOTKEY, 0, 0); 00600 } 00601 return STATUS_SUCCESS; 00602 }

NTSTATUS RemotePassthruDisable VOID   ) 
 

Definition at line 781 of file w32/ntuser/kernel/misc.c.

References BOOL, FALSE, gbConnected, ghRemoteThinwireChannel, gnShadowers, gpDispInfo, gThinwireFileObject, tagDISPLAYINFO::hDev, ISCSRSS, ISTS, RemoteRedrawScreen(), TRACE_HYDAPI, and UpdateKeyLights().

00783 { 00784 BOOL fResult; 00785 00786 TRACE_HYDAPI(("RemotePassthruDisable\n")); 00787 00788 /* 00789 * Only allow CSRSS to do this 00790 */ 00791 if (!ISCSRSS() || !ISTS()) { 00792 return STATUS_ACCESS_DENIED; 00793 } 00794 00795 UserAssert(gnShadowers == 0); 00796 UserAssert(ISCSRSS()); 00797 00798 fResult = bDrvReconnect(gpDispInfo->hDev, ghRemoteThinwireChannel, 00799 gThinwireFileObject); 00800 if (!fResult) { 00801 return STATUS_CTX_BAD_VIDEO_MODE; 00802 } 00803 00804 if (gbConnected) { 00805 RemoteRedrawScreen(); 00806 UpdateKeyLights(FALSE); // Make sure LED's are correct 00807 } 00808 00809 return STATUS_SUCCESS; 00810 }

NTSTATUS RemoteRedrawRectangle WORD  Left,
WORD  Top,
WORD  Right,
WORD  Bottom
 

Definition at line 1634 of file fullscr.c.

References CheckCritIn, gpDispInfo, gspdeskShouldBeForeground, gspwndFullScreen, tagDISPLAYINFO::hDev, ISCSRSS, NULL, ThreadLock, ThreadUnlock, TRACE_HYDAPI, and xxxRedrawWindow().

Referenced by CtxDisplayIOCtl(), and NtUserRemoteRedrawRectangle().

01639 { 01640 TL tlpwnd; 01641 RECT rcl; 01642 01643 CheckCritIn(); 01644 01645 TRACE_HYDAPI(("RemoteRedrawRectangle\n")); 01646 01647 UserAssert(ISCSRSS()); 01648 /* 01649 * If xxxRemoteStopScreenUpdates has not been called, 01650 * then just repaint the current foreground window. 01651 */ 01652 if (gspdeskShouldBeForeground == NULL) { 01653 if (gspwndFullScreen) { 01654 01655 ThreadLock(gspwndFullScreen, &tlpwnd); 01656 01657 rcl.left = Left; 01658 rcl.top = Top; 01659 rcl.right = Right; 01660 rcl.bottom = Bottom; 01661 01662 vDrvInvalidateRect(gpDispInfo->hDev, &rcl); 01663 01664 xxxRedrawWindow(gspwndFullScreen, &rcl, NULL, 01665 RDW_INVALIDATE | RDW_ALLCHILDREN | 01666 RDW_ERASE | RDW_ERASENOW); 01667 ThreadUnlock(&tlpwnd); 01668 } 01669 } 01670 01671 return STATUS_SUCCESS; 01672 }

NTSTATUS RemoteRedrawScreen VOID   ) 
 

Definition at line 1675 of file fullscr.c.

References CheckCritIn, DF_DESTROYED, tagDESKTOP::dwDTFlags, DWORD, tagWINDOWSTATION::dwWSF_Flags, FALSE, gbDesktopLocked, gbFreezeScreenUpdates, gpDispInfo, gspdeskShouldBeForeground, LockDesktop, NULL, tagDISPLAYINFO::pmdev, PtiCurrentShared, tagDESKTOP::rpwinstaParent, ThreadLockDesktop, ThreadUnlockDesktop, TRACE_HYDAPI, TRUE, WSF_SWITCHLOCK, and xxxSwitchDesktop().

Referenced by NtUserRemoteRedrawScreen(), RemotePassthruDisable(), RemoteShadowCleanup(), RemoteShadowStart(), xxxRemoteDisconnect(), and xxxRemoteReconnect().

01677 { 01678 TL tlpdesk; 01679 PWINDOWSTATION pwinsta; 01680 DWORD dwFlagsPrev; 01681 PTHREADINFO ptiCurrent; 01682 01683 TRACE_HYDAPI(("RemoteRedrawScreen\n")); 01684 01685 CheckCritIn(); 01686 01687 if (!gbFreezeScreenUpdates) 01688 return STATUS_SUCCESS; 01689 01690 ptiCurrent = PtiCurrentShared(); 01691 01692 gbFreezeScreenUpdates = FALSE; 01693 01694 /* 01695 * Switch back to the previous desktop 01696 */ 01697 if (gspdeskShouldBeForeground == NULL) { 01698 RIPMSG0(RIP_WARNING, "RemoteRedrawScreen called with no gspdeskShouldBeForeground"); 01699 return STATUS_SUCCESS; 01700 } 01701 01702 /* 01703 * Clear desktop switch lock 01704 * (WSF_SWITCHLOCK must be clear for xxxSwitchDesktop to succeed) 01705 */ 01706 gbDesktopLocked = FALSE; 01707 01708 pwinsta = gspdeskShouldBeForeground->rpwinstaParent; 01709 01710 dwFlagsPrev = pwinsta->dwWSF_Flags; 01711 pwinsta->dwWSF_Flags &= ~WSF_SWITCHLOCK; 01712 01713 /* 01714 * Switch back to previous desktop 01715 */ 01716 if (!(gspdeskShouldBeForeground->dwDTFlags & DF_DESTROYED)) { 01717 ThreadLockDesktop(ptiCurrent, gspdeskShouldBeForeground, &tlpdesk, LDLT_FN_CTXREDRAWSCREEN); 01718 xxxSwitchDesktop(pwinsta, gspdeskShouldBeForeground, FALSE); 01719 ThreadUnlockDesktop(ptiCurrent, &tlpdesk, LDUT_FN_CTXREDRAWSCREEN); 01720 01721 /* 01722 * Enable screen updates 01723 */ 01724 DrvEnableMDEV(gpDispInfo->pmdev, TRUE); 01725 } 01726 pwinsta->dwWSF_Flags = dwFlagsPrev; 01727 LockDesktop(&gspdeskShouldBeForeground, NULL, LDL_DESKSHOULDBEFOREGROUND2, 0 ); 01728 01729 return STATUS_SUCCESS; 01730 }

NTSTATUS RemoteShadowCleanup IN PVOID  pThinwireData,
ULONG  ThinwireDataLength
 

Definition at line 700 of file w32/ntuser/kernel/misc.c.

References gbConnected, gnShadowers, gpDispInfo, tagDISPLAYINFO::hDev, ISCSRSS, ISTS, NTSTATUS(), RemoteRedrawScreen(), Status, and TRACE_HYDAPI.

00703 { 00704 NTSTATUS Status = STATUS_SUCCESS; 00705 00706 TRACE_HYDAPI(("RemoteShadowCleanup\n")); 00707 00708 /* 00709 * Only allow CSRSS to do this 00710 */ 00711 if (!ISCSRSS() || !ISTS()) { 00712 return STATUS_ACCESS_DENIED; 00713 } 00714 00715 UserAssert(ISCSRSS()); 00716 00717 /* 00718 * Tell the Thinwire driver about it 00719 */ 00720 bDrvShadowDisconnect(gpDispInfo->hDev, pThinwireData, 00721 ThinwireDataLength); 00722 00723 if (gnShadowers > 0) 00724 gnShadowers--; 00725 00726 if (gnShadowers || gbConnected) { 00727 RemoteRedrawScreen(); 00728 } 00729 00730 return Status; 00731 }

NTSTATUS RemoteShadowStart IN PVOID  pThinwireData,
ULONG  ThinwireDataLength
 

Definition at line 635 of file w32/ntuser/kernel/misc.c.

References BOOL, gpDispInfo, tagDISPLAYINFO::hDev, ISCSRSS, ISTS, NTSTATUS(), RemoteRedrawScreen(), Status, TRACE_HYDAPI, and TRUE.

00638 { 00639 BOOL fResult; 00640 NTSTATUS Status = STATUS_SUCCESS; 00641 00642 TRACE_HYDAPI(("RemoteShadowStart\n")); 00643 00644 /* 00645 * Only allow CSRSS to do this 00646 */ 00647 if (!ISCSRSS() || !ISTS()) { 00648 return STATUS_ACCESS_DENIED; 00649 } 00650 00651 UserAssert(ISCSRSS()); 00652 00653 /* 00654 * Call thinwire driver and check for thinwire mode compatibility 00655 */ 00656 fResult = bDrvShadowConnect(gpDispInfo->hDev, pThinwireData, 00657 ThinwireDataLength); 00658 00659 // Although originally defined as BOOL, allow more meaningful return codes. 00660 if (!fResult) { 00661 return STATUS_CTX_BAD_VIDEO_MODE; 00662 } 00663 else if (fResult != TRUE) { 00664 return fResult; 00665 } 00666 00667 RemoteRedrawScreen(); 00668 00669 return Status; 00670 }

NTSTATUS RemoteThinwireStats OUT PVOID  Stats  ) 
 

Definition at line 558 of file w32/ntuser/kernel/misc.c.

References DWORD, gpThinWireCache, ISCSRSS, ISTS, NULL, and TRACE_HYDAPI.

00560 { 00561 static DWORD sThinwireStatsLength = sizeof(CACHE_STATISTICS); 00562 00563 TRACE_HYDAPI(("RemoteThinwireStats\n")); 00564 00565 /* 00566 * Only allow CSRSS to do this 00567 */ 00568 if (!ISCSRSS() || !ISTS()) { 00569 return STATUS_ACCESS_DENIED; 00570 } 00571 00572 UserAssert(ISCSRSS()); 00573 if (gpThinWireCache != NULL) { 00574 RtlCopyMemory(Stats, gpThinWireCache, sThinwireStatsLength); 00575 return STATUS_SUCCESS; 00576 } 00577 return STATUS_NO_SUCH_DEVICE; 00578 }

__inline void RemoveFlashWindowState PWND  pwnd  ) 
 

Definition at line 5667 of file userk.h.

References _GetProp(), DWORD, gaFlashWState, MAKEINTATOM, and PROPF_INTERNAL.

Referenced by xxxFlashWindow().

05669 { 05670 return (DWORD)(ULONG_PTR)_GetProp(pwnd, MAKEINTATOM(gaFlashWState), PROPF_INTERNAL);

VOID RemoveHmodDependency int  iatom  ) 
 

Definition at line 158 of file libmgmt.c.

References aatomSysLoaded, acatomSysDepends, acatomSysUse, catomSysTableEntries, gcSysExpunge, gdwSysExpungeMask, and VOID().

Referenced by DestroyEventHook(), and FreeHook().

00160 { 00161 00162 UserAssert(iatom >= 0); 00163 if (iatom < catomSysTableEntries && 00164 --acatomSysDepends[iatom] == 0) { 00165 00166 if (acatomSysUse[iatom]) { 00167 00168 /* 00169 * Cause each thread to check for expunged dlls 00170 * the next time they awake. 00171 */ 00172 gcSysExpunge++; 00173 gdwSysExpungeMask |= (1 << iatom); 00174 } else { 00175 aatomSysLoaded[iatom] = 0; 00176 } 00177 } 00178 }

VOID RemoveKeyboardLayoutFile PKBDFILE  pkf  ) 
 

Definition at line 390 of file kbdlyout.c.

References gpKbdNlsTbl, gpKbdTbl, gpkfList, KbdTablesFallback, NULL, tagKBDFILE::pKbdNlsTbl, tagKBDFILE::pKbdTbl, tagKBDFILE::pkfNext, and VOID().

Referenced by DestroyKF().

00392 { 00393 PKBDFILE pkfPrev, pkfCur; 00394 00395 // FE: NT4 SP4 #107809 00396 if (gpKbdTbl == pkf->pKbdTbl) { 00397 gpKbdTbl = &KbdTablesFallback; 00398 } 00399 if (gpKbdNlsTbl == pkf->pKbdNlsTbl) { 00400 gpKbdNlsTbl = NULL; 00401 } 00402 00403 /* 00404 * Good old linked list management 101 00405 */ 00406 if (pkf == gpkfList) { 00407 /* 00408 * Head of the list. 00409 */ 00410 gpkfList = pkf->pkfNext; 00411 return; 00412 } 00413 pkfPrev = gpkfList; 00414 pkfCur = gpkfList->pkfNext; 00415 while (pkf != pkfCur) { 00416 pkfPrev = pkfCur; 00417 pkfCur = pkfCur->pkfNext; 00418 } 00419 /* 00420 * Found it! 00421 */ 00422 pkfPrev->pkfNext = pkfCur->pkfNext; 00423 }

BOOL RemoveProcessFromJob PPROCESSINFO  ppi  ) 
 

Definition at line 255 of file job.c.

References BOOL, CheckCritIn, FALSE, NULL, tagW32JOB::ppiTable, tagPROCESSINFO::pW32Job, TRUE, UINT, and tagW32JOB::uProcessCount.

Referenced by xxxUserProcessCallout().

00257 { 00258 PW32JOB pW32Job; 00259 UINT ip; 00260 00261 CheckCritIn(); 00262 00263 pW32Job = ppi->pW32Job; 00264 00265 TAGMSG2(DBGTAG_Job, "RemoveProcessFromJob: ppi 0x%x pW32Job 0x%x", 00266 ppi, pW32Job); 00267 00268 /* 00269 * The job might not have UI restrictions 00270 */ 00271 if (pW32Job == NULL) { 00272 return FALSE; 00273 } 00274 00275 /* 00276 * remove the ppi from the job's ppi table 00277 */ 00278 for (ip = 0; ip < pW32Job->uProcessCount; ip++) { 00279 00280 UserAssert(pW32Job->ppiTable[ip]->pW32Job == pW32Job); 00281 00282 if (ppi == pW32Job->ppiTable[ip]) { 00283 00284 ppi->pW32Job = NULL; 00285 00286 RtlMoveMemory(pW32Job->ppiTable + ip, 00287 pW32Job->ppiTable + ip + 1, 00288 (pW32Job->uProcessCount - ip - 1) * sizeof(PPROCESSINFO)); 00289 00290 (pW32Job->uProcessCount)--; 00291 00292 /* 00293 * free the process array if this is the last one. 00294 */ 00295 if (pW32Job->uProcessCount == 0) { 00296 UserFreePool(pW32Job->ppiTable); 00297 pW32Job->ppiTable = NULL; 00298 pW32Job->uMaxProcesses = 0; 00299 } 00300 00301 TAGMSG2(DBGTAG_Job, "RemoveProcessFromJob: ppi 0x%x removed from pW32Job 0x%x", 00302 ppi, pW32Job); 00303 00304 return TRUE; 00305 } 00306 } 00307 00308 TAGMSG2(DBGTAG_Job, "RemoveProcessFromJob: ppi 0x%x not found in pW32Job 0x%x", 00309 ppi, pW32Job); 00310 00311 UserAssert(0); 00312 00313 return FALSE; 00314 }

VOID RequestDeviceChange PDEVICEINFO  pDeviceInfo,
USHORT  usAction,
BOOL  fInDeviceInfoListCrit
 

Definition at line 1535 of file w32/ntuser/kernel/pnp.c.

References aDeviceTemplate, CheckCritOut, CheckDeviceInfoListCritIn, CheckDeviceInfoListCritOut, EnterDeviceInfoListCrit(), EVENT_INCREMENT, ExIsResourceAcquiredExclusiveLite(), FALSE, FreeDeviceInfo(), GDIAF_FREEME, GDIAF_PNPWAITING, gpresDeviceInfoList, KernelMode, KeSetEvent(), KeWaitForSingleObject(), LeaveDeviceInfoListCrit(), NULL, tagDEVICE_TEMPLATE::pkeHidChange, VOID(), and WrUserRequest.

Referenced by CreateDeviceInfo(), DeviceNotify(), NlsKbdSendIMENotification(), ProcessMouseInput(), and UpdateMouseInfo().

01539 { 01540 PDEVICE_TEMPLATE pDevTpl = &aDeviceTemplate[pDeviceInfo->type]; 01541 UserAssert(pDevTpl->pkeHidChange != NULL); 01542 UserAssert((usAction & GDIAF_FREEME) == 0); 01543 UserAssert((pDeviceInfo->usActions & GDIAF_PNPWAITING) == 0); 01544 01545 #if DBG 01546 if (pDeviceInfo->usActions != 0) { 01547 TAGMSG3(DBGTAG_PNP, "RequestDeviceChange(%#p, %x), but action %x pending", 01548 pDeviceInfo, usAction, pDeviceInfo->usActions); 01549 } 01550 01551 /* 01552 * We can't ask for synchronized actions to be performed on the Device List 01553 * if we are holding the Device List lock or the User Critical Section: 01554 * ProcessDeviceChanges() requires both of these itself. 01555 */ 01556 if (usAction & GDIAF_PNPWAITING) { 01557 CheckDeviceInfoListCritOut(); 01558 CheckCritOut(); 01559 } 01560 #endif 01561 01562 TAGMSG2(DBGTAG_PNP, "RequestDeviceChange(%p, %x)", pDeviceInfo, usAction); 01563 01564 /* 01565 * Grab the DeviceInfoList critical section if we don't already have it 01566 */ 01567 UserAssert(!fInDeviceInfoListCrit == !ExIsResourceAcquiredExclusiveLite(gpresDeviceInfoList)); 01568 if (fInDeviceInfoListCrit) { 01569 CheckDeviceInfoListCritIn(); 01570 pDeviceInfo->usActions |= usAction; 01571 } else { 01572 EnterDeviceInfoListCrit(); 01573 pDeviceInfo->usActions |= usAction; 01574 LeaveDeviceInfoListCrit(); 01575 } 01576 01577 if (usAction & GDIAF_PNPWAITING) { 01578 CheckDeviceInfoListCritOut(); 01579 KeSetEvent(pDevTpl->pkeHidChange, EVENT_INCREMENT, FALSE); 01580 KeWaitForSingleObject(pDeviceInfo->pkeHidChangeCompleted, WrUserRequest, KernelMode, FALSE, NULL); 01581 01582 EnterDeviceInfoListCrit(); 01583 /* 01584 * Assert that nothing else cleared GDIAF_PNPWAITING - only do it here. 01585 * Check that the action we were waiting for actually occurred. 01586 */ 01587 UserAssert(pDeviceInfo->usActions & GDIAF_PNPWAITING); 01588 pDeviceInfo->usActions &= ~GDIAF_PNPWAITING; 01589 UserAssert((pDeviceInfo->usActions & usAction) == 0); 01590 if (pDeviceInfo->usActions & GDIAF_FREEME) { 01591 FreeDeviceInfo(pDeviceInfo); 01592 } 01593 LeaveDeviceInfoListCrit(); 01594 } else { 01595 KeSetEvent(pDevTpl->pkeHidChange, EVENT_INCREMENT, FALSE); 01596 } 01597 }

void ResetMouseTracking PQ  pq,
PWND  pwnd
 

void RestoreForegroundActivate  ) 
 

Definition at line 1549 of file ntuser/kernel/input.c.

References gppiStarting, NULL, tagPROCESSINFO::ppiNext, PUDF_ALLOWFOREGROUNDACTIVATE, and SET_PUDF.

Referenced by xxxEndDeferWindowPosEx(), and xxxMinMaximize().

01550 { 01551 PPROCESSINFO ppiT; 01552 01553 for (ppiT = gppiStarting; ppiT != NULL; ppiT = ppiT->ppiNext) { 01554 if (ppiT->W32PF_Flags & W32PF_APPSTARTING) { 01555 ppiT->W32PF_Flags |= W32PF_ALLOWFOREGROUNDACTIVATE; 01556 TAGMSG1(DBGTAG_FOREGROUND, "RestoreForegroundActivate set W32PF %#p", ppiT); 01557 SET_PUDF(PUDF_ALLOWFOREGROUNDACTIVATE); 01558 TAGMSG0(DBGTAG_FOREGROUND, "RestoreForegroundActivate set PUDF"); 01559 } 01560 } 01561 }

UINT RestoreSpb PWND  pwnd,
HRGN  hrgnUncovered,
HDC *  phdcScreen
 

Definition at line 651 of file spb.c.

References Error, FindSpb(), tagSPB::flags, FreeSpb(), ghdcMem, ghrgnSPB1, ghrgnSPB2, gpDispInfo, tagSPB::hbm, tagDISPLAYINFO::hdcScreen, tagDISPLAYINFO::hDev, tagSPB::hrgn, tagWND::hrgnClip, IntersectRgn, IsVisible(), NULL, tagSPB::rc, RSPB_INVALIDATE, RSPB_INVALIDATE_SSB, RSPB_NO_INVALIDATE, SetRectRgnIndirect(), SPB_SAVESCREENBITS, SubtractRgn, UINT, and tagSPB::ulSaveId.

Referenced by zzzBltValidBits().

00655 { 00656 PSPB pspb; 00657 UINT uInvalidate; 00658 HRGN hrgnRestorable; 00659 00660 /* 00661 * Note that we DON'T call SpbCheck() here -- 00662 * SpbCheck() is called by zzzBltValidBits(). 00663 */ 00664 pspb = FindSpb(pwnd); 00665 00666 /* 00667 * Assume all of hrgnUncovered was restored, and there's nothing 00668 * for our caller to invalidate. 00669 */ 00670 uInvalidate = RSPB_NO_INVALIDATE; 00671 hrgnRestorable = hrgnUncovered; 00672 00673 /* 00674 * First determine whether or not there is any area at all to restore. 00675 * If hrgnUncovered & pspb->hrgn is empty, then all of hrgnUncovered 00676 * needs to be invalidated, and there's nothing to restore. 00677 */ 00678 if (pspb->hrgn != NULL) { 00679 /* 00680 * At least some of hrgnUncovered needs to be invalidated. 00681 */ 00682 uInvalidate = RSPB_INVALIDATE; 00683 00684 /* 00685 * Calculate the true area of bits to be restored. If it becomes 00686 * empty, then just free the SPB without changing hrgnUncovered, 00687 * which is the area that must be invalidated. 00688 */ 00689 hrgnRestorable = ghrgnSPB1; 00690 switch (IntersectRgn(hrgnRestorable, hrgnUncovered, pspb->hrgn)) { 00691 case ERROR: 00692 case NULLREGION: 00693 goto Error; 00694 00695 default: 00696 break; 00697 } 00698 } 00699 00700 if (pspb->flags & SPB_SAVESCREENBITS) { 00701 00702 RECT rc = pspb->rc; 00703 00704 /* 00705 * Since the restore frees the onboard memory, clear this 00706 * bit so FreeSpb() won't try to free it again (regardless of 00707 * whether we get an error or not) 00708 */ 00709 pspb->flags &= ~SPB_SAVESCREENBITS; 00710 if (!(GreSaveScreenBits(gpDispInfo->hDev, 00711 SS_RESTORE, 00712 pspb->ulSaveId, 00713 (RECTL *)&rc))) { 00714 goto Error; 00715 } 00716 00717 /* 00718 * The SS_RESTORE call will always restore the entire SPB 00719 * rectangle, part of which may fall outside of hrgnUncovered. 00720 * The area that must be invalidated by our caller is simply 00721 * the SPB rectangle minus the area of restorable bits. 00722 * 00723 * If this region is not empty, then the SPB was not completely 00724 * restored, so we must return FALSE. 00725 */ 00726 SetRectRgnIndirect(ghrgnSPB2, &pspb->rc); 00727 if (SubtractRgn(hrgnUncovered, ghrgnSPB2, hrgnRestorable) != NULLREGION) { 00728 uInvalidate = RSPB_INVALIDATE_SSB; 00729 } 00730 } else { 00731 00732 HDC hdcScreen; 00733 HBITMAP hbmSave; 00734 00735 /* 00736 * In the unlikely event we need a screen DC and one wasn't passed in, 00737 * get it now. If we get one, we return the handle in *phdcScreen 00738 * so that our caller can release it later. 00739 */ 00740 if (!*phdcScreen) { 00741 *phdcScreen = gpDispInfo->hdcScreen; 00742 } 00743 00744 hdcScreen = *phdcScreen; 00745 00746 hbmSave = (HBITMAP)GreSelectBitmap(ghdcMem, pspb->hbm); 00747 if (!hbmSave) 00748 goto Error; 00749 00750 /* 00751 * Be sure to clip to the area of restorable bits. 00752 */ 00753 00754 GreSelectVisRgn(hdcScreen, hrgnRestorable, SVR_COPYNEW); 00755 00756 GreBitBlt(hdcScreen, 00757 pspb->rc.left, pspb->rc.top, 00758 pspb->rc.right - pspb->rc.left, 00759 pspb->rc.bottom - pspb->rc.top, 00760 ghdcMem, 00761 pspb->rc.left & 0x0007, 00762 0, 00763 SRCCOPY, 00764 0); 00765 00766 GreSelectBitmap(ghdcMem, hbmSave); 00767 00768 /* 00769 * Now compute the area to be invalidated for return. 00770 * This is simply the original hrgnUncovered - hrgnRestorable 00771 */ 00772 SubtractRgn(hrgnUncovered, hrgnUncovered, hrgnRestorable); 00773 } 00774 00775 if (pwnd->hrgnClip == NULL || !IsVisible(pwnd)) 00776 FreeSpb(pspb); 00777 00778 return uInvalidate; 00779 00780 Error: 00781 FreeSpb(pspb); 00782 return RSPB_INVALIDATE; 00783 }

VOID RetryReadInput  ) 
 

void RtlInitUnicodeStringOrId PUNICODE_STRING  pstrName,
LPWSTR  lpstrName
 

Definition at line 204 of file base.c.

References IS_PTR, and RtlInitUnicodeString().

Referenced by xxxCreateWindowEx(), xxxGetScrollMenu(), xxxLoadSysMenu(), xxxUpdateSystemCursorsFromRegistry(), and xxxUpdateSystemIconsFromRegistry().

00207 { 00208 if (IS_PTR(lpstrName)) { 00209 RtlInitUnicodeString(pstrName, lpstrName); 00210 } else { 00211 pstrName->Length = pstrName->MaximumLength = 0; 00212 pstrName->Buffer = lpstrName; 00213 } 00214 }

int RtlLoadStringOrError UINT  ,
LPTSTR  ,
int  ,
WORD 
 

VOID SaveVolatileUserSettings VOID   ) 
 

VOID SBCtlSetup PSBWND  psbwnd  ) 
 

Definition at line 1012 of file sbctl.c.

References CalcSBStuff2(), GetRect(), GRECT_CLIENT, and GRECT_CLIENTCOORDS.

Referenced by DrawCtlThumb(), xxxDoScrollMenu(), and xxxSBWndProc().

01014 { 01015 RECT rc; 01016 01017 GetRect((PWND)psbwnd, &rc, GRECT_CLIENT | GRECT_CLIENTCOORDS); 01018 CalcSBStuff2(&psbwnd->SBCalc, &rc, (PSBDATA)&psbwnd->SBCalc, psbwnd->fVert); 01019 }

PCURSOR SearchIconCache PCURSOR  pCursorCache,
ATOM  atomModName,
PUNICODE_STRING  pstrResName,
PCURSOR  pCursorSrc,
PCURSORFIND  pcfSearch
 

Definition at line 254 of file loadbits.c.

References tagCURSORFIND::bpp, CURSORF_ACON, CURSORF_LRSHARED, tagCURSORFIND::cx, tagCURSORFIND::cy, NULL, ResStrCmp(), and tagCURSORFIND::rt.

Referenced by _FindExistingCursorIcon().

00260 { 00261 /* 00262 * Run through the list of 'resource' objects created, 00263 * and see if the cursor requested has already been loaded. 00264 * If so just return it. We do this to be consistent with 00265 * Win 3.0 where they simply return a pointer to the res-data 00266 * for a cursor/icon handle. Many apps count on this and 00267 * call LoadCursor/Icon() often. 00268 * 00269 * LR_SHARED implies: 00270 * 1) icons never get deleted till process (LATER or WOW module) 00271 * goes away. 00272 * 2) This cache is consulted before trying to load a res. 00273 */ 00274 for (; pCursorCache != NULL; pCursorCache = pCursorCache->pcurNext) { 00275 00276 /* 00277 * If we are given a specific cursor to look for, then 00278 * search for that first. 00279 */ 00280 if (pcurSrc && (pCursorCache == pcurSrc)) 00281 return pcurSrc; 00282 00283 /* 00284 * No need to look further if the module name doesn't match. 00285 */ 00286 if (atomModName != pCursorCache->atomModName) 00287 continue; 00288 00289 /* 00290 * We only return images that cannot be destroyed by the app. 00291 * so we don't have to deal with ref counts. This is owned 00292 * by us, but not LR_SHARED. 00293 */ 00294 if (!(pCursorCache->CURSORF_flags & CURSORF_LRSHARED)) 00295 continue; 00296 00297 /* 00298 * Check the other distinguishing search criteria for 00299 * a match. 00300 */ 00301 if ((pCursorCache->rt == LOWORD(pcfSearch->rt)) && 00302 ResStrCmp(cczpstrResName, &pCursorCache->strName)) { 00303 00304 /* 00305 * Acons don't have a size per se because each frame 00306 * can be a different size. We always make it a hit 00307 * on acons so replacement of system icons is possible. 00308 */ 00309 if (pCursorCache->CURSORF_flags & CURSORF_ACON) 00310 return pCursorCache; 00311 00312 /* 00313 * First hit wins. Nothing fancy here. Apps that use 00314 * LR_SHARED have to watch out for this. 00315 */ 00316 if ((!pcfSearch->cx || (pCursorCache->cx == pcfSearch->cx)) && 00317 (!pcfSearch->cy || ((pCursorCache->cy / 2) == pcfSearch->cy)) && 00318 (!pcfSearch->bpp || (pCursorCache->bpp == pcfSearch->bpp))) { 00319 00320 return pCursorCache; 00321 } 00322 } 00323 } 00324 00325 return NULL; 00326 }

void SelectWindowRgn PWND  pwnd,
HRGN  hrgnClip
 

Definition at line 5753 of file swp.c.

References _MonitorFromWindow(), ClrWF, HRGN_FULL, HRGN_MONITOR, tagWND::hrgnClip, tagMONITOR::hrgnMonitor, NULL, PWNDDESKTOP, tagWND::rcWindow, SetWF, tagWND::spwndParent, TestWF, WFMAXFAKEREGIONAL, WFMAXIMIZED, and WFREALLYMAXIMIZABLE.

Referenced by xxxCreateDisconnectDesktop(), and zzzChangeStates().

05756 { 05757 /* 05758 * If there is a region already there, delete it because 05759 * a new one is being set. For maximized windows in multiple monitor 05760 * mode, we always use the monitor HRGN. We don't make a copy. This 05761 * way, when the hrgn changes because of monitor config, the window's 05762 * monitor region automatically gets updated. Clever huh? Also saves 05763 * memory. 05764 */ 05765 if (pwnd->hrgnClip != NULL) { 05766 if (TestWF(pwnd, WFMAXFAKEREGIONAL)) { 05767 ClrWF(pwnd, WFMAXFAKEREGIONAL); 05768 } else { 05769 /* 05770 * Do NOT select in a monitor region if the window is normally 05771 * regional. The MinMaximize code will always pass HRGN_MONITOR 05772 * to us no matter what. But when we get here, bail out and 05773 * don't destroy the app's region if it has one. 05774 */ 05775 if (hrgnClip == HRGN_MONITOR) 05776 return; 05777 05778 GreDeleteObject(pwnd->hrgnClip); 05779 } 05780 05781 pwnd->hrgnClip = NULL; 05782 } 05783 05784 /* 05785 * NULL or HRGN_FULL means "set to NULL". If we have a real region, 05786 * use it. USER needs to own it, and it needs to be in screen 05787 * coordinates. 05788 */ 05789 if (hrgnClip > HRGN_FULL) { 05790 05791 if (hrgnClip == HRGN_MONITOR) { 05792 PMONITOR pMonitor; 05793 05794 /* 05795 * Use the monitor region if the window is really maxed 05796 * on a monitor. It's already happened by the time we get here, 05797 * if so. And xxxCheckFullScreen will clear the reallymaximed 05798 * style for a maximized window if it doesn't cover the whole 05799 * max area. 05800 */ 05801 UserAssert(pwnd->spwndParent == PWNDDESKTOP(pwnd)); 05802 05803 if (!TestWF(pwnd, WFMAXIMIZED) || !TestWF(pwnd, WFREALLYMAXIMIZABLE)) 05804 return; 05805 05806 /* 05807 * Do nothing for windows off screen. 05808 */ 05809 pMonitor = _MonitorFromWindow(pwnd, MONITOR_DEFAULTTONULL); 05810 if (!pMonitor) 05811 return; 05812 05813 hrgnClip = pMonitor->hrgnMonitor; 05814 SetWF(pwnd, WFMAXFAKEREGIONAL); 05815 } else { 05816 if (pwnd != PWNDDESKTOP(pwnd)) { 05817 GreOffsetRgn(hrgnClip, pwnd->rcWindow.left, pwnd->rcWindow.top); 05818 } 05819 05820 GreSetRegionOwner(hrgnClip, OBJECT_OWNER_PUBLIC); 05821 } 05822 05823 pwnd->hrgnClip = hrgnClip; 05824 } 05825 }

VOID SendMsgCleanup PTHREADINFO  ptiCurrent  ) 
 

Definition at line 2364 of file kernel/sendmsg.c.

References CheckCritIn, gpsmsList, PSMS, ReceiverDied(), SenderDied(), and VOID().

Referenced by xxxDestroyThreadInfo(), and zzzCancelJournalling().

02364 : free sms 02365 * R replied, R dies: no problem 02366 * 02367 * double death: 02368 * R no reply, S dies, R dies: free sms 02369 * R no reply, R dies, S dies: free sms 02370 * R replied, S dies, R dies: sms freed when S dies, as in single death 02371 * R replied, R dies, S dies: sms freed when S dies, as in single death 02372 * 02373 * History: 02374 * 01-13-91 DavidPe Ported. 02375 \***********************************************************************/ 02376 02377 VOID SendMsgCleanup( 02378 PTHREADINFO ptiCurrent) 02379 { 02380 PSMS *ppsms; 02381 PSMS psmsNext; 02382 02383 CheckCritIn(); 02384 02385 for (ppsms = &gpsmsList; *ppsms; ) { 02386 psmsNext = (*ppsms)->psmsNext; 02387 02388 if ((*ppsms)->ptiSender == ptiCurrent ||

ULONG_PTR SetClassCursor PWND  pwnd,
PCLS  pcls,
DWORD  index,
ULONG_PTR  dwData
 

Definition at line 1329 of file class.c.

References CheckLock, HMValidateHandle(), Lock, NULL, tagCLS::pclsBase, tagCLS::pclsClone, tagCLS::pclsNext, PtoH, TYPE_CURSOR, and xxxSetClassIcon().

Referenced by xxxSetClassData().

01334 { 01335 ULONG_PTR dwOld; 01336 01337 CheckLock(pwnd); 01338 01339 if ((HANDLE)dwData != NULL) { 01340 dwData = (ULONG_PTR)HMValidateHandle((HANDLE)dwData, TYPE_CURSOR); 01341 if ((PVOID)dwData == NULL) { 01342 if (index == GCLP_HICON || index == GCLP_HICONSM) { 01343 RIPERR0(ERROR_INVALID_ICON_HANDLE, RIP_WARNING, "SetClassData: invalid icon"); 01344 } else { 01345 RIPERR0(ERROR_INVALID_CURSOR_HANDLE, RIP_WARNING, "SetClassData: invalid cursor"); 01346 } 01347 } 01348 } 01349 01350 /* 01351 * Handle the locking issue. 01352 */ 01353 pcls = pcls->pclsBase; 01354 switch (index) { 01355 case GCLP_HICON: 01356 case GCLP_HICONSM: 01357 dwOld = (ULONG_PTR)xxxSetClassIcon(pwnd, pcls, (PCURSOR)dwData, index); 01358 break; 01359 01360 case GCLP_HCURSOR: 01361 dwOld = (ULONG_PTR)Lock(&pcls->spcur, dwData); 01362 break; 01363 } 01364 01365 /* 01366 * Now set it for each clone class. 01367 */ 01368 pcls = pcls->pclsClone; 01369 while (pcls != NULL) { 01370 switch(index) { 01371 case GCLP_HICON: 01372 case GCLP_HICONSM: 01373 xxxSetClassIcon(pwnd, pcls, (PCURSOR)dwData, index); 01374 break; 01375 01376 case GCLP_HCURSOR: 01377 Lock(&pcls->spcur, dwData); 01378 break; 01379 } 01380 pcls = pcls->pclsNext; 01381 } 01382 01383 return (ULONG_PTR)PtoH((PVOID)dwOld); 01384 }

VOID SetDebugHotKeys  ) 
 

Definition at line 26 of file hotkeys.c.

References _RegisterHotKey(), _UnregisterHotKey(), FastGetProfileDwordW(), gKeyboardInfo, IDHOT_DEBUG, IDHOT_DEBUGSERVER, L, NULL, PMAP_AEDEBUG, PWND_INPUTOWNER, UINT, and VOID().

Referenced by ProcessDeviceChanges(), and RawInputThread().

00027 { 00028 UINT VkDebug; 00029 00030 VkDebug = FastGetProfileDwordW(NULL, PMAP_AEDEBUG, L"UserDebuggerHotkey", 0); 00031 if (VkDebug == 0) { 00032 if (ENHANCED_KEYBOARD(gKeyboardInfo.KeyboardIdentifier)) { 00033 VkDebug = VK_F12; 00034 } else { 00035 VkDebug = VK_SUBTRACT; 00036 } 00037 } else { 00038 UserAssert((0xFFFFFF00 & VkDebug) == 0); 00039 } 00040 00041 _UnregisterHotKey(PWND_INPUTOWNER, IDHOT_DEBUG); 00042 _UnregisterHotKey(PWND_INPUTOWNER, IDHOT_DEBUGSERVER); 00043 00044 _RegisterHotKey(PWND_INPUTOWNER, IDHOT_DEBUG, 0, VkDebug); 00045 _RegisterHotKey(PWND_INPUTOWNER, IDHOT_DEBUGSERVER, MOD_SHIFT, VkDebug); 00046 }

void FAR SetDesktopMetrics  ) 
 

Definition at line 336 of file rare.c.

References GetPrimaryMonitor(), tagMONITOR::rcWork, and SYSMET.

Referenced by SetNCMetrics(), UpdateUserScreen(), and xxxSystemParametersInfo().

00337 { 00338 LPRECT lprcWork; 00339 00340 lprcWork = &GetPrimaryMonitor()->rcWork; 00341 00342 SYSMET(CXFULLSCREEN) = lprcWork->right - lprcWork->left; 00343 SYSMET(CXMAXIMIZED) = lprcWork->right - lprcWork->left + 2*SYSMET(CXSIZEFRAME); 00344 00345 SYSMET(CYFULLSCREEN) = lprcWork->bottom - lprcWork->top - SYSMET(CYCAPTION); 00346 SYSMET(CYMAXIMIZED) = lprcWork->bottom - lprcWork->top + 2*SYSMET(CYSIZEFRAME); 00347 }

VOID SetDialogPointer PWND  pwnd,
LONG_PTR  lPtr
 

Definition at line 24 of file miscutil.c.

References tagWND::cbwndExtra, ClrWF, FNID_CLEANEDUP_BIT, FNID_DIALOG, GETPTI, PpiCurrent, SetWF, TestWF, VOID(), WFDIALOGWINDOW, and WFSERVERSIDEPROC.

00024 { 00025 00026 if ((pwnd->cbwndExtra < DLGWINDOWEXTRA) 00027 || TestWF(pwnd, WFSERVERSIDEPROC) 00028 || (PpiCurrent() != GETPTI(pwnd)->ppi)) { 00029 RIPMSG1(RIP_WARNING, "SetDialogPointer: Unexpected pwnd:%#p", pwnd); 00030 return; 00031 } 00032 00033 ((PDIALOG)pwnd)->pdlg = (PDLG)lPtr; 00034 00035 if (lPtr == 0) { 00036 pwnd->fnid |= FNID_CLEANEDUP_BIT; 00037 ClrWF(pwnd, WFDIALOGWINDOW); 00038 } else { 00039 if (pwnd->fnid == 0) { 00040 pwnd->fnid = FNID_DIALOG; 00041 } 00042 SetWF(pwnd, WFDIALOGWINDOW); 00043 } 00044 00045 00046 }

BOOL SetEmptyRgn HRGN  hrgn  ) 
 

Definition at line 97 of file visrgn.c.

References PZERO, and SetRectRgnIndirect().

Referenced by _GetDCEx(), InternalScrollDC(), UserSetDCVisRgn(), xxxGetUpdateRgn(), xxxInternalInvalidate(), and xxxScrollWindowEx().

00098 { 00099 return SetRectRgnIndirect(hrgn, PZERO(RECT)); 00100 }

__inline void SetFlashWindowState PWND  pwnd,
DWORD  dwState
 

Definition at line 5662 of file userk.h.

References BOOL.

Referenced by xxxFlashWindow().

05669 {

VOID SetForegroundPriority PTHREADINFO  pti,
BOOL  fSetForeground
 

Definition at line 2708 of file focusact.c.

References NULL, tagTHREADINFO::ppi, SetForegroundPriorityProcess(), TIF_CSRSSTHREAD, tagTHREADINFO::TIF_flags, TIF_SYSTEMTHREAD, and VOID().

Referenced by CheckProcessForeground(), NtUserYieldTask(), SetForegroundThread(), SetWakeBit(), xxxCreateThreadInfo(), xxxInternalGetMessage(), and xxxMoveSize().

02711 { 02712 UserAssert(pti != NULL); 02713 02714 /* 02715 * We don't want to change the priority of system or console threads 02716 */ 02717 if (pti->TIF_flags & (TIF_SYSTEMTHREAD | TIF_CSRSSTHREAD)) 02718 return; 02719 02720 SetForegroundPriorityProcess(pti->ppi, pti, fSetForeground); 02721 }

VOID SetForegroundPriorityProcess PPROCESSINFO  ppi,
PTHREADINFO  pti,
BOOL  fSetForegound
 

Definition at line 2648 of file focusact.c.

References FALSE, gppiForegroundOld, gppiScreenSaver, NULL, _EPROCESS::PriorityClass, PsProcessPriorityBackground, PsProcessPriorityForeground, PsProcessPrioritySpinning, PsSetProcessPriorityByClass(), tagTHREADINFO::TIF_flags, TIF_GLOBALHOOKER, and VOID().

Referenced by IdleTimerProc(), SetForegroundPriority(), and xxxActivateThisWindow().

02652 { 02653 PEPROCESS Process; 02654 UCHAR PriorityClassSave; 02655 02656 UserAssert(ppi != NULL); 02657 02658 Process = ppi->Process; 02659 UserAssert(ppi->Process != NULL); 02660 02661 if (ppi->W32PF_Flags & W32PF_IDLESCREENSAVER) { 02662 fSetForeground = FALSE; 02663 PriorityClassSave = Process->PriorityClass; 02664 Process->PriorityClass = PROCESS_PRIORITY_CLASS_IDLE; 02665 } 02666 02667 /* 02668 * If we previously delayed setting some process to the background 02669 * because a screen saver was starting up, do it now. 02670 */ 02671 if (gppiForegroundOld != NULL) { 02672 if (gppiForegroundOld == ppi) { 02673 gppiForegroundOld = NULL; 02674 } else if (ppi != gppiScreenSaver) { 02675 PsSetProcessPriorityByClass(gppiForegroundOld->Process, PsProcessPriorityBackground); 02676 gppiForegroundOld = NULL; 02677 } 02678 } 02679 02680 /* 02681 * If this app should be background, don't let it go foreground. 02682 * Foreground apps run at a higher base priority. 02683 */ 02684 if (ppi->W32PF_Flags & W32PF_FORCEBACKGROUNDPRIORITY) { 02685 if (pti != NULL && !(pti->TIF_flags & TIF_GLOBALHOOKER)) { 02686 PsSetProcessPriorityByClass(Process, PsProcessPrioritySpinning); 02687 } 02688 } else if (fSetForeground) { 02689 PsSetProcessPriorityByClass(Process, PsProcessPriorityForeground); 02690 } else if (pti != NULL && !(pti->TIF_flags & TIF_GLOBALHOOKER)) { 02691 /* 02692 * Don't adjust the priority of the current foreground process if 02693 * the new foreground process is a screen saver. 02694 */ 02695 if (gppiScreenSaver && gppiScreenSaver != ppi) { 02696 gppiForegroundOld = ppi; 02697 } else { 02698 PsSetProcessPriorityByClass(Process, PsProcessPriorityBackground); 02699 } 02700 } 02701 02702 if (ppi->W32PF_Flags & W32PF_IDLESCREENSAVER) { 02703 Process->PriorityClass = PriorityClassSave; 02704 } 02705 }

VOID SetForegroundThread PTHREADINFO  pti  ) 
 

Definition at line 2588 of file focusact.c.

References CBKEYSTATERECENTDOWN, ChangeForegroundKeyboardTable(), FALSE, gafAsyncKeyStateRecentDown, gpqForeground, gpsi, gptiForeground, gptiRit, NULL, tagTHREADINFO::ppi, tagTHREADINFO::pq, SetForegroundPriority(), tagTHREADINFO::spklActive, TRUE, and VOID().

Referenced by xxxDestroyThreadInfo(), xxxSendFocusMessages(), and xxxSetForegroundWindow2().

02590 { 02591 PKL pklPrev; 02592 02593 if (pti == gptiForeground) 02594 return; 02595 02596 /* 02597 * The foregorund thread must be on the foreground queue. 02598 * xxxSendFocusMessages obtains this pti from a window 02599 * received as a parameter. If the owner of the window 02600 * exited during a callback (in the caller), then the pti 02601 * will be gptiRit,which might not be in the foreground queue 02602 */ 02603 UserAssert((pti == NULL) 02604 || (pti->pq == gpqForeground) 02605 || (pti == gptiRit)); 02606 02607 /* 02608 * If we're changing gptiForeground to another process, 02609 * change the base priorities of the two processes. We 02610 * know that if either 'pti' or 'gptiForeground' is NULL 02611 * that both aren't NULL due to the first test in this 02612 * function. 02613 */ 02614 if ((pti == NULL) || (gptiForeground == NULL) || 02615 (pti->ppi != gptiForeground->ppi)) { 02616 if (gptiForeground != NULL) { 02617 gptiForeground->ppi->W32PF_Flags &= ~W32PF_FORCEBACKGROUNDPRIORITY; 02618 SetForegroundPriority(gptiForeground, FALSE); 02619 } 02620 02621 if (pti != NULL) { 02622 SetForegroundPriority(pti, TRUE); 02623 } 02624 } 02625 02626 if (gptiForeground) { 02627 pklPrev = gptiForeground->spklActive; 02628 } else { 02629 pklPrev = NULL; 02630 } 02631 gptiForeground = pti; 02632 if (gptiForeground && gptiForeground->spklActive) { 02633 ChangeForegroundKeyboardTable(pklPrev, gptiForeground->spklActive); 02634 } 02635 02636 /* 02637 * Clear recent down information in the async key state to prevent 02638 * spying by apps. 02639 */ 02640 RtlZeroMemory(gafAsyncKeyStateRecentDown, CBKEYSTATERECENTDOWN); 02641 02642 /* 02643 * Update the async key cache index. 02644 */ 02645 gpsi->dwAsyncKeyCache++; 02646 }

BOOL SetHandleFlag HANDLE  ,
DWORD  ,
BOOL 
 

Definition at line 4494 of file desktop.c.

References tagPROCESSINFO::bmHandleFlags, BOOL, Buffer, EnterHandleFlagsCrit(), FALSE, HF_LIMIT, Index, LeaveHandleFlagsCrit(), NULL, PpiCurrent, RtlClearBits(), RtlInitializeBitMap(), RtlSetBits(), and TRUE.

Referenced by _SetUserObjectInformation(), EnterHandleFlagsCrit(), NtUserOpenInputDesktop(), OpenDesktopCompletion(), xxxCloseDesktop(), xxxCreateDesktop(), xxxGetInputDesktop(), xxxGetThreadDesktop(), xxxOpenDesktop(), xxxSetProcessWindowStation(), and zzzSetDesktop().

04498 { 04499 PPROCESSINFO ppi; 04500 ULONG Index = ((PEXHANDLE)&hObject)->Index * HF_LIMIT + dwFlag; 04501 PRTL_BITMAP pbm; 04502 ULONG cBits; 04503 PULONG Buffer; 04504 BOOL fRet = TRUE; 04505 04506 UserAssert(dwFlag < HF_LIMIT); 04507 04508 EnterHandleFlagsCrit(); 04509 04510 if ((ppi = PpiCurrent()) != NULL) { 04511 pbm = &ppi->bmHandleFlags; 04512 if (fSet) { 04513 04514 /* 04515 * Expand the bitmap if needed 04516 */ 04517 if (Index >= pbm->SizeOfBitMap) { 04518 /* 04519 * Index is zero-based - cBits is an exact number of dwords 04520 */ 04521 cBits = ((Index + 1) + 0x1F) & ~0x1F; 04522 Buffer = UserAllocPoolWithQuotaZInit(cBits / 8, TAG_PROCESSINFO); 04523 if (Buffer == NULL) { 04524 fRet = FALSE; 04525 goto Exit; 04526 } 04527 if (pbm->Buffer) { 04528 RtlCopyMemory(Buffer, pbm->Buffer, pbm->SizeOfBitMap / 8); 04529 UserFreePool(pbm->Buffer); 04530 } 04531 04532 RtlInitializeBitMap(pbm, Buffer, cBits); 04533 } 04534 04535 RtlSetBits(pbm, Index, 1); 04536 } else if (Index < pbm->SizeOfBitMap) { 04537 RtlClearBits(pbm, Index, 1); 04538 } 04539 } 04540 04541 Exit: 04542 LeaveHandleFlagsCrit(); 04543 04544 return fRet; 04545 }

VOID SetHandleInUse HANDLE   ) 
 

Definition at line 4579 of file desktop.c.

References EnterHandleFlagsCrit(), gHandleInUse, gProcessInUse, LeaveHandleFlagsCrit(), PsGetCurrentProcess, and VOID().

Referenced by NtUserGetObjectInformation(), and NtUserSetObjectInformation().

04581 { 04582 EnterHandleFlagsCrit(); 04583 gProcessInUse = PsGetCurrentProcess(); 04584 gHandleInUse = hObject; 04585 LeaveHandleFlagsCrit(); 04586 }

VOID SetHungFlag PWND  pwnd,
WORD  wFlag
 

Definition at line 26 of file hungapp.c.

References CHRLINCR, gpvwplHungRedraw, PWNDDESKTOP, SetWF, tagWND::spwndParent, TestWF, VOID(), VWPLAdd(), and WFANYHUNGREDRAW.

Referenced by InternalInvalidate3(), and xxxSetForegroundWindow2().

00029 { 00030 /* 00031 * If the window has no hung redraw bits set and it's a top-level 00032 * window, add it to the redraw list. 00033 */ 00034 if (!TestWF(pwnd, WFANYHUNGREDRAW) && pwnd->spwndParent == PWNDDESKTOP(pwnd)) { 00035 /* 00036 * Add pwnd to the Hung Redraw Volatile Window Pointer List. 00037 */ 00038 VWPLAdd(&gpvwplHungRedraw, pwnd, CHRLINCR); 00039 } 00040 00041 SetWF(pwnd, wFlag); 00042 }

BOOL SetIconMetrics PUNICODE_STRING  pProfileUserName,
LPICONMETRICS  lpicon
 

Definition at line 1213 of file inctlpan.c.

References BOOL, FALSE, HDCBITS, max, MetricGetID(), PUDF_ICONTITLEWRAP, SET_OR_CLEAR_PUDF, SetIconFonts(), SYSMET, and TRUE.

Referenced by SPISetIconMetrics(), xxxInitWindowStation(), and xxxUpdatePerUserSystemParameters().

01216 { 01217 ICONMETRICS icon; 01218 01219 if (!SetIconFonts(pProfileUserName,lpicon)) { 01220 RIPMSG0(RIP_WARNING, "SetIconMetrics failed in SetIconFonts"); 01221 return FALSE; 01222 } 01223 01224 if (!lpicon) { 01225 01226 icon.iTitleWrap = MetricGetID(pProfileUserName, 01227 STR_ICONTITLEWRAP, TRUE); 01228 01229 icon.iHorzSpacing = MetricGetID(pProfileUserName, 01230 STR_ICONHORZSPACING, 01231 (GreGetDeviceCaps(HDCBITS(), LOGPIXELSX) * 75) / 96); 01232 01233 icon.iVertSpacing = MetricGetID(pProfileUserName, 01234 STR_ICONVERTSPACING, 01235 (GreGetDeviceCaps(HDCBITS(), LOGPIXELSY) * 75) / 96); 01236 01237 lpicon = &icon; 01238 } 01239 01240 /* 01241 * SANITY CHECK for metric values 01242 */ 01243 lpicon->iHorzSpacing = max(lpicon->iHorzSpacing, (int)SYSMET(CXICON)); 01244 lpicon->iVertSpacing = max(lpicon->iVertSpacing, (int)SYSMET(CYICON)); 01245 01246 SYSMET(CXICONSPACING) = (int) lpicon->iHorzSpacing; 01247 SYSMET(CYICONSPACING) = (int) lpicon->iVertSpacing; 01248 SET_OR_CLEAR_PUDF(PUDF_ICONTITLEWRAP, lpicon->iTitleWrap); 01249 01250 return TRUE; 01251 }

BOOL SetImeHotKey DWORD  dwHotKeyID,
UINT  uModifiers,
UINT  uVKey,
HKL  hKL,
DWORD  dwAction
 

Definition at line 106 of file imehotky.c.

References AddImeHotKey(), DeleteImeHotKey(), _tagIMEHOTKEY::dwHotKeyID, FALSE, FindImeHotKeyByID(), FindImeHotKeyByKeyWithLang(), GetHotKeyLangID(), gpImeHotKeyListHeader, _tagIMEHOTKEYOBJ::hk, _tagIMEHOTKEY::hKL, IMEHOTKEYOBJ, ISHK_ADD, ISHK_INITIALIZE, ISHK_REMOVE, MOD_BOTH_SIDES, MOD_MODIFY_KEYS, NULL, _tagIMEHOTKEYOBJ::pNext, TRUE, _tagIMEHOTKEY::uModifiers, and _tagIMEHOTKEY::uVKey.

Referenced by NtUserSetImeHotKey().

00112 { 00113 PIMEHOTKEYOBJ ph; 00114 00115 switch ( dwAction ) { 00116 case ISHK_REMOVE: 00117 ph = FindImeHotKeyByID( gpImeHotKeyListHeader, dwHotKeyID ); 00118 if ( ph != NULL ) { 00119 if ( DeleteImeHotKey( &gpImeHotKeyListHeader, ph ) == ph ) { 00120 UserFreePool( ph ); 00121 return ( TRUE ); 00122 } else { 00123 RIPMSG0( RIP_ERROR, "IME hotkey list is messed up" ); 00124 return FALSE; 00125 } 00126 } else { 00127 RIPERR0( ERROR_INVALID_PARAMETER, 00128 RIP_WARNING, 00129 "no such IME hotkey registered"); 00130 return FALSE; 00131 } 00132 break; 00133 00134 case ISHK_INITIALIZE: 00135 ph = gpImeHotKeyListHeader; 00136 while ( ph != NULL ) { 00137 PIMEHOTKEYOBJ phNext; 00138 00139 phNext = ph->pNext; 00140 UserFreePool( ph ); 00141 ph = phNext; 00142 } 00143 gpImeHotKeyListHeader = NULL; 00144 return TRUE; 00145 00146 case ISHK_ADD: 00147 if (dwHotKeyID >= IME_KHOTKEY_FIRST && dwHotKeyID <= IME_KHOTKEY_LAST) { 00148 // Korean IME does not want any IMM hotkey handling. 00149 // We should not register any Korean IME hot keys. 00150 return FALSE; 00151 } 00152 00153 if ((WORD)uVKey == VK_PACKET) { 00154 // 00155 // VK_PACKET should not be a IME hot key. 00156 // 00157 return FALSE; 00158 } 00159 00160 ph = FindImeHotKeyByKeyWithLang(gpImeHotKeyListHeader, 00161 uModifiers & MOD_MODIFY_KEYS, 00162 uModifiers & MOD_BOTH_SIDES, 00163 uVKey, 00164 GetHotKeyLangID(dwHotKeyID)); 00165 if ( ph != NULL ) { 00166 if ( ph->hk.dwHotKeyID != dwHotKeyID ) { 00167 RIPERR0( ERROR_HOTKEY_ALREADY_REGISTERED, 00168 RIP_WARNING, 00169 "There is an IME hotkey that has the same vkey/modifiers/Lang Id"); 00170 return FALSE; 00171 } 00172 // So far we found a hotkey that has the 00173 // same vkey and same ID. 00174 // But because modifiers may be slightly 00175 // different, so go ahead and change it. 00176 } else { 00177 // 00178 // the specified vkey/modifiers combination cound not be found 00179 // in the hotkey list. The caller may want to change the key 00180 // assignment of an existing hotkey or add a new hotkey. 00181 // 00182 ph = FindImeHotKeyByID( gpImeHotKeyListHeader, dwHotKeyID ); 00183 } 00184 00185 if ( ph == NULL ) { 00186 // 00187 // adding a new hotkey 00188 // 00189 ph = (PIMEHOTKEYOBJ)UserAllocPool( sizeof(IMEHOTKEYOBJ), TAG_IMEHOTKEY ); 00190 if ( ph == NULL ) { 00191 RIPERR0( ERROR_OUTOFMEMORY, 00192 RIP_WARNING, 00193 "Memory allocation failed in SetImeHotKey"); 00194 return FALSE; 00195 } 00196 ph->hk.dwHotKeyID = dwHotKeyID; 00197 ph->hk.uModifiers = uModifiers; 00198 ph->hk.uVKey = uVKey; 00199 ph->hk.hKL = hKL; 00200 ph->pNext = NULL; 00201 AddImeHotKey( &gpImeHotKeyListHeader, ph ); 00202 00203 } else { 00204 // 00205 // changing an existing hotkey 00206 // 00207 ph->hk.uModifiers = uModifiers; 00208 ph->hk.uVKey = uVKey; 00209 ph->hk.hKL = hKL; 00210 00211 } 00212 return TRUE; 00213 } 00214 00215 return FALSE; 00216 }

BOOL SetImeInfoEx IN PWINDOWSTATION  pwinsta,
IN PIMEINFOEX  piiex
 

Referenced by NtUserSetImeInfoEx().

NTSTATUS SetInformationProcess IN HANDLE  hProcess,
IN USERPROCESSINFOCLASS  ProcessInfoClass,
IN PVOID  ProcessInformation,
IN ULONG  ProcessInformationLength
 

Definition at line 6357 of file queue.c.

References DWORD, FALSE, ISCSRSS, NT_SUCCESS, NTSTATUS(), NULL, ObReferenceObjectByHandle(), PpiFromProcess, PsProcessType, Status, UnlockProcess, and UserMode.

Referenced by NtUserSetInformationProcess().

06362 { 06363 PUSERPROCESS_FLAGS pFlags; 06364 DWORD dwOldFlags; 06365 NTSTATUS Status = STATUS_SUCCESS; 06366 PEPROCESS Process; 06367 PPROCESSINFO ppi; 06368 06369 UNREFERENCED_PARAMETER(ProcessInformationLength); 06370 06371 UserAssert(ISCSRSS()); 06372 06373 Status = ObReferenceObjectByHandle(hProcess, 06374 PROCESS_SET_INFORMATION, 06375 *PsProcessType, 06376 UserMode, 06377 &Process, 06378 NULL); 06379 if (!NT_SUCCESS(Status)) { 06380 return Status; 06381 } 06382 06383 ppi = PpiFromProcess(Process); 06384 06385 switch (ProcessInfoClass) { 06386 case UserProcessFlags: 06387 if (ppi == NULL) { 06388 Status = STATUS_INVALID_HANDLE; 06389 } else { 06390 UserAssert(ProcessInformationLength == sizeof(USERPROCESS_FLAGS)); 06391 pFlags = ProcessInformation; 06392 dwOldFlags = ppi->W32PF_Flags; 06393 ppi->W32PF_Flags ^= ((dwOldFlags ^ pFlags->dwFlags) & pFlags->dwMask); 06394 } 06395 break; 06396 06397 default: 06398 Status = STATUS_INVALID_INFO_CLASS; 06399 UserAssert(FALSE); 06400 break; 06401 } 06402 06403 UnlockProcess(Process); 06404 06405 return Status; 06406 }

VOID SetJournalTimer DWORD  dt,
UINT  msgJournal
 

Definition at line 693 of file timers.c.

References dt(), InternalSetTimer(), JournalTimer(), NULL, and PtiCurrent.

Referenced by xxxGetNextSysMsg().

00696 { 00697 static UINT_PTR idJournal = 0; 00698 00699 PtiCurrent()->pq->msgJournal = msgJournal; 00700 00701 /* 00702 * Remember idJournal - because TMRF_ONESHOT timers stay in the timer 00703 * list - by remembering the idJournal, we always reuse the same timer 00704 * rather than creating new ones always. 00705 */ 00706 idJournal = InternalSetTimer(NULL, 00707 idJournal, 00708 dt, 00709 JournalTimer, 00710 TMRF_RIT | TMRF_ONESHOT); 00711 }

VOID SetKeyboardRate UINT  nKeySpeed  ) 
 

Definition at line 2932 of file ntinput.c.

References gdwUpdateKeyboard, gKeyboardInfo, gktp, KDELAY_MASK, KDELAY_SHIFT, KSPEED_MASK, UINT, UPDATE_KBD_TYPEMATIC, USHORT, and VOID().

Referenced by LW_DriversInit(), and xxxSystemParametersInfo().

02935 { 02936 UINT nKeyDelay; 02937 UINT nKeySpeed; 02938 02939 nKeyDelay = (nKeySpeedAndDelay & KDELAY_MASK) >> KDELAY_SHIFT; 02940 02941 nKeySpeed = KSPEED_MASK & nKeySpeedAndDelay; 02942 02943 gktp.Rate = (USHORT)( ( gKeyboardInfo.KeyRepeatMaximum.Rate - 02944 gKeyboardInfo.KeyRepeatMinimum.Rate 02945 ) * nKeySpeed / KSPEED_MASK 02946 ) + 02947 gKeyboardInfo.KeyRepeatMinimum.Rate; 02948 02949 gktp.Delay = (USHORT)( ( gKeyboardInfo.KeyRepeatMaximum.Delay - 02950 gKeyboardInfo.KeyRepeatMinimum.Delay 02951 ) * nKeyDelay / (KDELAY_MASK >> KDELAY_SHIFT) 02952 ) + 02953 gKeyboardInfo.KeyRepeatMinimum.Delay; 02954 02955 /* 02956 * Hand off the IOCTL to the RIT, since only the system process can 02957 * access keyboard handles 02958 */ 02959 gdwUpdateKeyboard |= UPDATE_KBD_TYPEMATIC; 02960 }

VOID SetMinimize PWND  pwnd,
UINT  uFlags
 

Definition at line 5176 of file swp.c.

References cDecVis(), ClrWF, DecVisWindows(), IncVisWindows(), SetWF, SMIN_SET, TestWF, VOID(), WFMINIMIZED, and WFVISIBLE.

Referenced by xxxCreateWindowEx(), xxxMinMaximize(), and xxxMS_TrackMove().

05179 { 05180 /* 05181 * Note that Dec and IncVisWindows check the WFMINIMIZED flag, so the order 05182 * in which we set/clear the flag and call these functions is important 05183 * If the window is not WFVISIBLE, cVisWindows must not change. 05184 */ 05185 if (uFlags & SMIN_SET) { 05186 UserAssert(!TestWF(pwnd, WFMINIMIZED)); 05187 if (TestWF(pwnd, WFVISIBLE)) { 05188 /* 05189 * Decrement the count because the window is not minimized 05190 * and visible, and we're about to mark it as minimized 05191 */ 05192 05193 #if DBG 05194 cDecVis(pwnd); 05195 #else 05196 DecVisWindows(pwnd); 05197 #endif 05198 } 05199 SetWF(pwnd, WFMINIMIZED); 05200 05201 #if DBG 05202 VerifycVisWindows(pwnd); 05203 #endif 05204 } else { 05205 05206 UserAssert(TestWF(pwnd, WFMINIMIZED)); 05207 ClrWF(pwnd, WFMINIMIZED); 05208 if (TestWF(pwnd, WFVISIBLE)) { 05209 /* 05210 * Increment the count because the window is visible 05211 * and it's no longer marked as minimized 05212 */ 05213 IncVisWindows(pwnd); 05214 } 05215 } 05216 }

VOID SetMinMetrics PUNICODE_STRING  pProfileUserName,
LPMINIMIZEDMETRICS  lpmin
 

Definition at line 1170 of file inctlpan.c.

References max, MetricGetID(), min, SYSMET, and VOID().

Referenced by xxxInitWindowStation(), xxxSetAndDrawMinMetrics(), and xxxUpdatePerUserSystemParameters().

01173 { 01174 MINIMIZEDMETRICS min; 01175 01176 if (!lpmin) { 01177 01178 /* 01179 * Minimized 01180 */ 01181 min.iWidth = MetricGetID(pProfileUserName,STR_MINWIDTH, 154); 01182 min.iHorzGap = MetricGetID(pProfileUserName,STR_MINHORZGAP, 0); 01183 min.iVertGap = MetricGetID(pProfileUserName,STR_MINVERTGAP, 0); 01184 min.iArrange = MetricGetID(pProfileUserName,STR_MINARRANGE, ARW_BOTTOMLEFT | ARW_RIGHT); 01185 lpmin = &min; 01186 } 01187 01188 /* 01189 * SANITY CHECK for metric values 01190 */ 01191 01192 /* 01193 * Minimized window -- Text area must be >= 0, as must gap between 01194 * windows horizontally and vertically. 01195 */ 01196 lpmin->iWidth = max(lpmin->iWidth, 0); 01197 lpmin->iHorzGap = max(lpmin->iHorzGap, 0); 01198 lpmin->iVertGap = max(lpmin->iVertGap, 0); 01199 lpmin->iArrange &= ARW_VALID; 01200 01201 /* 01202 * Minimized size 01203 */ 01204 SYSMET(CXMINIMIZED) = 2*SYSMET(CXFIXEDFRAME) + (int) lpmin->iWidth; 01205 SYSMET(CYMINIMIZED) = 2*SYSMET(CYFIXEDFRAME) + SYSMET(CYSIZE); 01206 01207 SYSMET(CXMINSPACING) = SYSMET(CXMINIMIZED) + (int) lpmin->iHorzGap; 01208 SYSMET(CYMINSPACING) = SYSMET(CYMINIMIZED) + (int) lpmin->iVertGap; 01209 01210 SYSMET(ARRANGE) = (int) lpmin->iArrange; 01211 }

void SetMsgBox PWND  pwnd  ) 
 

Definition at line 3779 of file rare.c.

References tagWND::head, SetWF, and WFMSGBOX.

03780 { 03781 pwnd->head.rpdesk->pDeskInfo->cntMBox++; 03782 SetWF(pwnd, WFMSGBOX); 03783 return; 03784 }

HRGN SetOrCreateRectRgnIndirectPublic HRGN *  phrgn,
LPCRECT  lprc
 

Definition at line 115 of file visrgn.c.

References SetRectRgnIndirect().

Referenced by CalcVisRgn(), CalcWindowVisRgn(), SpbCheckRect2(), and UpdateUserScreen().

00116 { 00117 if (*phrgn) { 00118 UserVerify(SetRectRgnIndirect(*phrgn, lprc)); 00119 } else if (*phrgn = GreCreateRectRgnIndirect((LPRECT) lprc)) { 00120 UserVerify(GreSetRegionOwner(*phrgn, OBJECT_OWNER_PUBLIC)); 00121 } 00122 00123 return *phrgn; 00124 }

void SetPointer BOOL  fSet  ) 
 

Definition at line 676 of file ntuser/kernel/cursor.c.

References FCursorShadowed(), GETPCI, gpDispInfo, gpqCursor, tagDISPLAYINFO::hDev, tagQ::iCursorLevel, NULL, tagQ::spcurCurrent, and SYSMET.

Referenced by xxxMakeWindowForegroundWithState(), xxxRemoteReconnect(), xxxSwitchDesktop(), xxxSystemParametersInfo(), xxxUserChangeDisplaySettings(), xxxUserResetDisplayDevice(), and zzzUpdateCursorImage().

00677 { 00678 if (fSet) { 00679 if (gpqCursor != NULL && gpqCursor->iCursorLevel >= 0 && 00680 gpqCursor->spcurCurrent != NULL && 00681 SYSMET(MOUSEPRESENT)) { 00682 00683 PCURSINFO pci = GETPCI(gpqCursor->spcurCurrent); 00684 ULONG fl = FCursorShadowed(pci) ? SPS_ALPHA : 0; 00685 00686 GreSetPointer(gpDispInfo->hDev, pci, fl); 00687 } 00688 } else { 00689 GreSetPointer(gpDispInfo->hDev, NULL, 0); 00690 } 00691 }

BOOL SetRectRgnIndirect HRGN  hrgn,
LPCRECT  lprc
 

Definition at line 40 of file visrgn.c.

Referenced by CalcWindowRgn(), CalcWindowVisRgn(), CreateSpb(), InternalInvalidate2(), InternalScrollDC(), LockWindowUpdate2(), RestoreSpb(), SetEmptyRgn(), SetOrCreateRectRgnIndirectPublic(), SmartRectInRegion(), SpbCheckRect2(), ValidateParents(), xxxGetUpdateRgn(), xxxRedrawHungWindow(), xxxRedrawWindow(), and zzzBltValidBits().

00041 { 00042 return GreSetRectRgn(hrgn, lprc->left, lprc->top, lprc->right, lprc->bottom); 00043 }

VOID SetSysColor UINT  icol,
DWORD  rgb,
UINT  uOptions
 

Definition at line 121 of file sysmet.c.

References DWORD, tagDISPLAYINFO::fAnyPalette, gpDispInfo, gpsi, tagDISPLAYINFO::hdcScreen, NULL, SSCF_16COLORS, SSCF_FORCESOLIDCOLOR, SSCF_SETMAGICCOLORS, SYSHBRUSH, and VOID().

Referenced by xxxSetSysColors().

00126 { 00127 00128 if ((uOptions & SSCF_SETMAGICCOLORS) && gpDispInfo->fAnyPalette) { 00129 union { 00130 DWORD rgb; 00131 PALETTEENTRY pe; 00132 } peMagic; 00133 00134 peMagic.rgb = rgb; 00135 00136 /* 00137 * when any of the 3D colors are changing, call GDI to 00138 * set the apropiate "magic" color 00139 * 00140 * the four magic colors are reserved like so 00141 * 00142 * 8 - UI color (3D shadow) 00143 * 9 - UI color (3D face) 00144 * 00145 * F6 - UI color (3D hilight) 00146 * F7 - UI color (desktop) 00147 * 00148 * NOTE (3D hilight) inverts to (3D shadow) 00149 * (3D face) inverts to sys gray 00150 * 00151 */ 00152 00153 switch (icol) 00154 { 00155 case COLOR_3DSHADOW: 00156 GreSetMagicColors(gpDispInfo->hdcScreen, peMagic.pe, 8); 00157 break; 00158 00159 case COLOR_3DFACE: 00160 GreSetMagicColors(gpDispInfo->hdcScreen, peMagic.pe, 9); 00161 break; 00162 00163 case COLOR_3DHILIGHT: 00164 GreSetMagicColors(gpDispInfo->hdcScreen, peMagic.pe, 246); 00165 break; 00166 00167 case COLOR_DESKTOP: 00168 GreSetMagicColors(gpDispInfo->hdcScreen, peMagic.pe, 247); 00169 break; 00170 } 00171 } 00172 00173 if (uOptions & SSCF_16COLORS) { 00174 /* 00175 * Force solid colors for all elements in 16 color or less modes. 00176 */ 00177 rgb = GreGetNearestColor(gpDispInfo->hdcScreen, rgb); 00178 } else if (uOptions & SSCF_FORCESOLIDCOLOR) { 00179 /* 00180 * Force solid colors for certain window elements. 00181 */ 00182 switch (icol) { 00183 00184 /* 00185 * These can be dithers 00186 */ 00187 case COLOR_DESKTOP: 00188 case COLOR_ACTIVEBORDER: 00189 case COLOR_INACTIVEBORDER: 00190 case COLOR_APPWORKSPACE: 00191 case COLOR_INFOBK: 00192 case COLOR_GRADIENTACTIVECAPTION: 00193 case COLOR_GRADIENTINACTIVECAPTION: 00194 break; 00195 00196 default: 00197 rgb = GreGetNearestColor(gpDispInfo->hdcScreen, rgb); 00198 break; 00199 } 00200 } 00201 00202 gpsi->argbSystem[icol] = rgb; 00203 if (SYSHBRUSH(icol) == NULL) { 00204 /* 00205 * This is the first time we're setting up the system colors. 00206 * We need to create the brush 00207 */ 00208 SYSHBRUSH(icol) = GreCreateSolidBrush(rgb); 00209 GreMarkUndeletableBrush(SYSHBRUSH(icol)); 00210 GreSetBrushOwnerPublic(SYSHBRUSH(icol)); 00211 } else { 00212 GreSetSolidBrush(SYSHBRUSH(icol), rgb); 00213 } 00214 }

VOID SetTiledRect PWND  pwnd,
LPRECT  lprc,
PMONITOR  pMonitor
 

Definition at line 1333 of file createw.c.

References tagMONITOR::cWndStack, GetRealClientRect(), GRC_MINWNDS, MultDiv, PWNDDESKTOP, and SYSMET.

Referenced by xxxCreateWindowEx().

01337 { 01338 POINT pt; 01339 RECT rcT; 01340 01341 UserAssert(pMonitor->cWndStack >= 0); 01342 01343 /* 01344 * Get available desktop area, minus minimized spacing area. 01345 */ 01346 GetRealClientRect(PWNDDESKTOP(pwnd), &rcT, GRC_MINWNDS, pMonitor); 01347 01348 /* 01349 * Normalized rectangle is 3/4 width, 3/4 height of desktop area. We 01350 * offset it based on the value of giwndStack for cascading. 01351 */ 01352 01353 /* 01354 * We want the left edge of the new window to align with the 01355 * right edge of the old window's system menu. And we want the 01356 * top edge of the new window to align with the bottom edge of the 01357 * selected caption area (caption height - cyBorder) of the old 01358 * window. 01359 */ 01360 pt.x = pMonitor->cWndStack * (SYSMET(CXSIZEFRAME) + SYSMET(CXSIZE)); 01361 pt.y = pMonitor->cWndStack * (SYSMET(CYSIZEFRAME) + SYSMET(CYSIZE)); 01362 01363 /* 01364 * If below upper top left 1/4 of free area, reset. 01365 */ 01366 if ( (pt.x > ((rcT.right-rcT.left) / 4)) || 01367 (pt.y > ((rcT.bottom-rcT.top) / 4)) ) { 01368 01369 pMonitor->cWndStack = 0; 01370 pt.x = 0; 01371 pt.y = 0; 01372 } 01373 01374 /* 01375 * Get starting position 01376 */ 01377 pt.x += rcT.left; 01378 pt.y += rcT.top; 01379 01380 lprc->left = pt.x; 01381 lprc->top = pt.y; 01382 lprc->right = pt.x + MultDiv(rcT.right-rcT.left, 3, 4); 01383 lprc->bottom = pt.y + MultDiv(rcT.bottom-rcT.top, 3, 4); 01384 01385 /* 01386 * Increment the count of stacked windows. 01387 */ 01388 pMonitor->cWndStack++; 01389 }

VOID SetVisible PWND  pwnd,
UINT  flags
 

Definition at line 5237 of file swp.c.

References ClrFTrueVis(), ClrWF, DecVisWindows(), IncVisWindows(), SetWF, SV_CLRFTRUEVIS, SV_SET, TestWF, VOID(), WFDESTROYED, WFINDESTROY, and WFVISIBLE.

Referenced by xxxCreateWindowEx(), xxxCreateWindowStation(), xxxDesktopThread(), xxxDestroyWindow(), xxxDWP_SetRedraw(), xxxDWPPrint(), xxxFW_DestroyAllChildren(), xxxMinimizeHungWindow(), xxxMNCloseHierarchy(), xxxProcessHungThreadEvent(), xxxShowOwnedWindows(), xxxShowWindow(), zzzActiveCursorTracking(), and zzzChangeStates().

05240 { 05241 if (flags & SV_SET) { 05242 05243 #if DBG 05244 if (TestWF(pwnd, WFINDESTROY)) { 05245 RIPMSG1(RIP_WARNING, "SetVisible: show INDESTROY %#p", pwnd); 05246 } 05247 #endif 05248 05249 if (TestWF(pwnd, WFVISIBLE)) { 05250 RIPMSG1(RIP_WARNING, "SetVisible: already visible %#p", pwnd); 05251 } else { 05252 SetWF(pwnd, WFVISIBLE); 05253 IncVisWindows(pwnd); 05254 } 05255 } else { 05256 05257 if (flags & SV_CLRFTRUEVIS) 05258 ClrFTrueVis(pwnd); 05259 05260 #if DBG 05261 if (TestWF(pwnd, WFDESTROYED)) { 05262 RIPMSG1(RIP_WARNING, "SetVisible: hide DESTROYED %#p", pwnd); 05263 } 05264 #endif 05265 05266 if (TestWF(pwnd, WFVISIBLE)) { 05267 ClrWF(pwnd, WFVISIBLE); 05268 DecVisWindows(pwnd); 05269 } else { 05270 RIPMSG1(RIP_WARNING, "SetVisible: already hidden %#p", pwnd); 05271 } 05272 } 05273 }

VOID SetWakeBit PTHREADINFO  pti,
UINT  wWakeBit
 

Definition at line 4578 of file queue.c.

References CheckCritIn, FALSE, tagCLIENTTHREADINFO::fsChangeBits, tagCLIENTTHREADINFO::fsWakeBits, tagCLIENTTHREADINFO::fsWakeMask, gpsi, gptSSCursor, KeSetEvent(), tagTDB::nEvents, tagTHREADINFO::pcti, tagTHREADINFO::pEventQueueServer, tagTHREADINFO::ppi, tagTHREADINFO::pq, tagTHREADINFO::ptdb, tagQ::ptiKeyboard, tagQ::ptiMouse, SetForegroundPriority(), TIF_16BIT, tagTHREADINFO::TIF_flags, TRUE, VOID(), and WakeWowTask().

Referenced by _PostMessage(), _PostThreadMessage(), _ReplyMessage(), DestroyProcessInfo(), DoTimer(), IncPaintCount(), IPostQuitMessage(), PostEventMessage(), PostUpdateKeyStateEvent(), ReceiverDied(), RedistributeInput(), TimersProc(), WakeSomeone(), xxxCancelTrackingForThread(), xxxDeactivate(), xxxInterSendMsgEx(), xxxProcessEventMessage(), xxxReceiveMessage(), xxxScanSysQueue(), xxxSetForegroundWindow2(), xxxSystemTimerProc(), zzzDestroyQueue(), and zzzSetFMouseMoved().

04581 { 04582 CheckCritIn(); 04583 04584 UserAssert(pti); 04585 04586 /* 04587 * Win3.1 changes ptiKeyboard and ptiMouse accordingly if we're setting 04588 * those bits. 04589 */ 04590 if (wWakeBit & QS_MOUSE) 04591 pti->pq->ptiMouse = pti; 04592 04593 if (wWakeBit & QS_KEY) 04594 pti->pq->ptiKeyboard = pti; 04595 04596 /* 04597 * OR in these bits - these bits represent what input this app has 04598 * (fsWakeBits), or what input has arrived since that last look 04599 * (fsChangeBits). 04600 */ 04601 pti->pcti->fsWakeBits |= wWakeBit; 04602 pti->pcti->fsChangeBits |= wWakeBit; 04603 04604 /* 04605 * Before waking, do screen saver check to see if it should 04606 * go away. 04607 */ 04608 if ((wWakeBit & QS_INPUT) 04609 && (pti->ppi->W32PF_Flags & W32PF_IDLESCREENSAVER)) { 04610 if ((wWakeBit & QS_MOUSEMOVE) 04611 && (gpsi->ptCursor.x == gptSSCursor.x) 04612 && (gpsi->ptCursor.y == gptSSCursor.y)) { 04613 goto SkipScreenSaverStuff; 04614 } 04615 04616 /* 04617 * Our idle screen saver needs to be given a priority boost so that it 04618 * can process input. 04619 */ 04620 pti->ppi->W32PF_Flags &= ~W32PF_IDLESCREENSAVER; 04621 SetForegroundPriority(pti, TRUE); 04622 } 04623 04624 SkipScreenSaverStuff: 04625 if (wWakeBit & pti->pcti->fsWakeMask) { 04626 /* 04627 * Wake the Thread 04628 */ 04629 if (pti->TIF_flags & TIF_16BIT) { 04630 pti->ptdb->nEvents++; 04631 gpsi->nEvents++; 04632 WakeWowTask(pti); 04633 } else { 04634 KeSetEvent(pti->pEventQueueServer, 2, FALSE); 04635 } 04636 } 04637 }

VOID SetWindowState PWND  pwnd,
DWORD  flags
 

Definition at line 83 of file w32/ntuser/kernel/random.c.

References dwFlags, GETPTI, PtiCurrent, SetWF, and ValidateState().

Referenced by AnimateWindow(), ButtonWndProcWorker(), CalcClientScrolling(), CBNcCreateHandler(), DefDlgProcWorker(), DefFrameProcWorker(), ECSetPasswordChar(), EditWndProc(), MDIRemoveSysMenu(), and StaticWndProcWorker().

00086 { 00087 /* 00088 * Don't let anyone mess with someone else's window 00089 */ 00090 if (GETPTI(pwnd)->ppi == PtiCurrent()->ppi) { 00091 if (ValidateState(dwFlags)) { 00092 SetWF(pwnd, dwFlags); 00093 } else { 00094 RIPMSG1(RIP_ERROR, "SetWindowState: invalid flag %x", dwFlags); 00095 } 00096 } else { 00097 RIPMSG1(RIP_WARNING, "SetWindowState: current ppi doesn't own pwnd %#p", pwnd); 00098 } 00099 00100 }

PVOID __inline SharedAlloc ULONG  cb  ) 
 

Definition at line 2137 of file userk.h.

References gpvSharedAlloc.

Referenced by HMAllocObject(), InitWindowMsgTable(), and Win32UserInitialize().

02140 {

BOOL __inline SharedFree PVOID  pv  ) 
 

Definition at line 2143 of file userk.h.

References BOOL, and gpvSharedAlloc.

Referenced by HMFreeObject().

02146 {

__inline PVOID SharedRebaseToClient PPROCESSINFO  ppi,
PVOID  p
 

Definition at line 6723 of file userk.h.

References BOOL.

06729 {

void ShowFade void   ) 
 

Definition at line 850 of file sprite.c.

References ALPHASTART, BOOL, tagFADE::dwFlags, FADE_SHOW, FADE_SHOWN, gfade, tagFADE::hbm, tagFADE::hdc, NULL, tagFADE::ptDst, tagFADE::size, and UpdateFade().

Referenced by MNFadeSelection(), StartFade(), and xxxMenuWindowProc().

00851 { 00852 BLENDFUNCTION blend; 00853 POINT ptSrc; 00854 BOOL fShow; 00855 00856 UserAssert(gfade.hdc != NULL); 00857 UserAssert(gfade.hbm != NULL); 00858 00859 if (gfade.dwFlags & FADE_SHOWN) 00860 return; 00861 00862 fShow = (gfade.dwFlags & FADE_SHOW); 00863 ptSrc.x = ptSrc.y = 0; 00864 blend.BlendOp = AC_SRC_OVER; 00865 blend.BlendFlags = 0; 00866 blend.AlphaFormat = 0; 00867 blend.SourceConstantAlpha = fShow ? ALPHASTART : (255 - ALPHASTART); 00868 UpdateFade(&gfade.ptDst, &gfade.size, gfade.hdc, &ptSrc, &blend); 00869 00870 gfade.dwFlags |= FADE_SHOWN; 00871 }

PWND FAR SizeBoxHwnd PWND  pwnd  ) 
 

Definition at line 636 of file rtl/winmgr.c.

References BOOL, FNID_DESKTOP, GETFNID, NULL, tagWND::rcClient, tagWND::rcWindow, REBASEPWND, SYSMETRTL, TestWF, WFCHILD, WFCPRESENT, WFMAXIMIZED, and WFSIZEBOX.

Referenced by DrawSize(), FindNCHit(), and xxxWindowHitTest2().

00638 { 00639 #ifdef USE_MIRRORING 00640 BOOL bMirroredSizeBox = (BOOL) TestWF(pwnd, WEFLAYOUTRTL); 00641 #endif 00642 00643 int xbrChild; 00644 int ybrChild = pwnd->rcWindow.bottom; 00645 00646 #ifdef USE_MIRRORING 00647 if (bMirroredSizeBox) { 00648 xbrChild = pwnd->rcWindow.left; 00649 } else 00650 #endif 00651 { 00652 xbrChild = pwnd->rcWindow.right; 00653 } 00654 00655 while (GETFNID(pwnd) != FNID_DESKTOP) { 00656 if (TestWF(pwnd, WFSIZEBOX)) { 00657 // First sizeable parent found 00658 int xbrParent; 00659 int ybrParent; 00660 00661 if (TestWF(pwnd, WFMAXIMIZED)) 00662 return(NULL); 00663 00664 #ifdef USE_MIRRORING 00665 if (bMirroredSizeBox) { 00666 xbrParent = pwnd->rcClient.left; 00667 } else 00668 #endif 00669 { 00670 xbrParent = pwnd->rcClient.right; 00671 } 00672 ybrParent = pwnd->rcClient.bottom; 00673 00674 /* If the sizebox dude is within an EDGE of the client's bottom 00675 * right corner (left corner for mirrored windows), let this succeed. 00676 * That way people who draw their own sunken clients will be happy. 00677 */ 00678 #ifdef USE_MIRRORING 00679 if (bMirroredSizeBox) { 00680 if ((xbrChild - SYSMETRTL(CXEDGE) > xbrParent) || (ybrChild + SYSMETRTL(CYEDGE) < ybrParent)) { 00681 // 00682 // Child's bottom, left corner of SIZEBOX isn't close enough 00683 // to bottom left of parent's client. 00684 // 00685 return(NULL); 00686 } 00687 } else 00688 #endif 00689 { 00690 if ((xbrChild + SYSMETRTL(CXEDGE) < xbrParent) || (ybrChild + SYSMETRTL(CYEDGE) < ybrParent)) { 00691 // 00692 // Child's bottom, right corner of SIZEBOX isn't close enough 00693 // to bottom right of parent's client. 00694 // 00695 return(NULL); 00696 } 00697 } 00698 00699 return(pwnd); 00700 } 00701 00702 if (!TestWF(pwnd, WFCHILD) || TestWF(pwnd, WFCPRESENT)) 00703 break; 00704 00705 pwnd = REBASEPWND(pwnd, spwndParent); 00706 } 00707 return(NULL); 00708 }

VOID SleepInputIdle PTHREADINFO  pti  ) 
 

Definition at line 5249 of file ntuser/kernel/input.c.

References NULL, tagWOWTHREADINFO::pIdleEvent, tagTHREADINFO::ppi, tagTHREADINFO::ptdb, tagPROCESSINFO::ptiMainThread, tagTDB::pwti, RESET_PSEUDO_EVENT, TIF_16BIT, tagTHREADINFO::TIF_flags, and TIF_SHAREDWOW.

Referenced by xxxMsgWaitForMultipleObjects(), and xxxSleepThread().

05251 { 05252 PW32PROCESS W32Process; 05253 05254 /* 05255 * Shared Wow Apps use the per thread idle event for synchronization. 05256 * Separate Wow VDMs use the regular mechanism. 05257 */ 05258 if (pti->TIF_flags & TIF_SHAREDWOW) { 05259 UserAssert(pti->TIF_flags & TIF_16BIT); 05260 if (pti->ptdb->pwti) { 05261 RESET_PSEUDO_EVENT(&pti->ptdb->pwti->pIdleEvent); 05262 } 05263 } else { 05264 /* 05265 * If the main thread is NULL, set it to this queue: it is calling 05266 * GetMessage(). 05267 */ 05268 if (pti->ppi->ptiMainThread == NULL) 05269 pti->ppi->ptiMainThread = pti; 05270 05271 /* 05272 * Put to sleep up anyone waiting on this event. 05273 */ 05274 if (pti->ppi->ptiMainThread == pti) { 05275 W32Process = W32GetCurrentProcess(); 05276 RESET_PSEUDO_EVENT(&W32Process->InputIdleEvent); 05277 } 05278 } 05279 }

SMESSAGEPROTO INLPKDRAWSWITCHWND   ) 
 

SMESSAGEPROTO IMEREQUEST   ) 
 

SMESSAGEPROTO IMECONTROL   ) 
 

SMESSAGEPROTO LOGONNOTIFY   ) 
 

SMESSAGEPROTO POWERBROADCAST   ) 
 

SMESSAGEPROTO INOUTMENUGETOBJECT   ) 
 

SMESSAGEPROTO INDEVICECHANGE   ) 
 

SMESSAGEPROTO IMAGEOUT   ) 
 

SMESSAGEPROTO IMAGEIN   ) 
 

SMESSAGEPROTO INOUTSTYLECHANGE   ) 
 

SMESSAGEPROTO INOUTNEXTMENU   ) 
 

SMESSAGEPROTO INDESTROYCLIPBRD   ) 
 

SMESSAGEPROTO COPYDATA   ) 
 

SMESSAGEPROTO COPYGLOBALDATA   ) 
 

SMESSAGEPROTO OPTOUTLPDWORDOPTOUTLPDWORD   ) 
 

SMESSAGEPROTO OUTDWORDINDWORD   ) 
 

SMESSAGEPROTO OUTDWORDDWORD   ) 
 

SMESSAGEPROTO INSIZECLIPBRD   ) 
 

SMESSAGEPROTO INPAINTCLIPBRD   ) 
 

SMESSAGEPROTO FULLSCREEN   ) 
 

SMESSAGEPROTO INOUTDRAG   ) 
 

SMESSAGEPROTO OUTCBOXSTRING   ) 
 

SMESSAGEPROTO INCBOXSTRING   ) 
 

SMESSAGEPROTO OUTLBOXSTRING   ) 
 

SMESSAGEPROTO INLBOXSTRING   ) 
 

SMESSAGEPROTO INLPWINDOWPOS   ) 
 

SMESSAGEPROTO INOUTLPWINDOWPOS   ) 
 

SMESSAGEPROTO POPTINLPUINT   ) 
 

SMESSAGEPROTO POUTLPINT   ) 
 

SMESSAGEPROTO INCNTOUTSTRING   ) 
 

SMESSAGEPROTO OUTSTRING   ) 
 

SMESSAGEPROTO INPOSTEDSTRING   ) 
 

SMESSAGEPROTO INSTRING   ) 
 

SMESSAGEPROTO INOUTLPMEASUREITEMSTRUCT   ) 
 

SMESSAGEPROTO INLPDRAWITEMSTRUCT   ) 
 

SMESSAGEPROTO INLPHELPINFOSTRUCT   ) 
 

SMESSAGEPROTO INLPHLPSTRUCT   ) 
 

SMESSAGEPROTO INLPDELETEITEMSTRUCT   ) 
 

SMESSAGEPROTO INLPCOMPAREITEMSTRUCT   ) 
 

SMESSAGEPROTO INLPMDICREATESTRUCT   ) 
 

SMESSAGEPROTO OUTLPRECT   ) 
 

SMESSAGEPROTO INOUTNCCALCSIZE   ) 
 

SMESSAGEPROTO INOUTLPRECT   ) 
 

SMESSAGEPROTO INOUTLPSCROLLINFO   ) 
 

SMESSAGEPROTO INOUTLPPOINT5   ) 
 

SMESSAGEPROTO INLPDROPSTRUCT   ) 
 

SMESSAGEPROTO INLPCREATESTRUCT   ) 
 

SMESSAGEPROTO GETDBCSTEXTLENGTHS   ) 
 

SMESSAGEPROTO GETTEXTLENGTHS   ) 
 

SMESSAGEPROTO INWPARAMDBCSCHAR   ) 
 

SMESSAGEPROTO INWPARAMCHAR   ) 
 

SMESSAGEPROTO DWORD   ) 
 

SMESSAGEPROTO DDEINIT   ) 
 

SMESSAGEPROTO SENTDDEMSG   ) 
 

PMONITORRECTS SnapshotMonitorRects void   ) 
 

Definition at line 40 of file rare.c.

References tagMONITORRECTS::amp, tagMONITORRECTS::cMonitor, tagDISPLAYINFO::cMonitors, CopyRect, tagMONITOR::dwMONFlags, gpDispInfo, HdevFromMonitor(), MONF_VISIBLE, MONITORPOS, MONITORRECTS, NULL, tagMONITORPOS::pMonitor, tagDISPLAYINFO::pMonitorFirst, tagMONITOR::pMonitorNext, PMONITORPOS, tagMONITOR::rcMonitor, tagMONITORPOS::rcMonitor, tagMONITOR::rcWork, and tagMONITORPOS::rcWork.

Referenced by xxxResetDisplayDevice(), and xxxSystemParametersInfo().

00041 { 00042 PMONITOR pMonitor; 00043 PMONITORRECTS pmr; 00044 PMONITORPOS pmp; 00045 #if DBG 00046 ULONG cVisMon = 0; 00047 #endif 00048 00049 pmr = UserAllocPool( 00050 sizeof(MONITORRECTS) + sizeof(MONITORPOS) * (gpDispInfo->cMonitors - 1), 00051 TAG_MONITORRECTS); 00052 00053 if (!pmr) { 00054 RIPERR0(ERROR_OUTOFMEMORY, RIP_WARNING, "Out of memory in SnapshotMonitorRects"); 00055 return NULL; 00056 } 00057 00058 pmp = pmr->amp; 00059 for ( pMonitor = gpDispInfo->pMonitorFirst; 00060 pMonitor; 00061 pMonitor = pMonitor->pMonitorNext) { 00062 00063 if (!(pMonitor->dwMONFlags & MONF_VISIBLE)) 00064 continue; 00065 #if DBG 00066 cVisMon++; 00067 #endif 00068 00069 CopyRect(&pmp->rcMonitor, &pMonitor->rcMonitor); 00070 CopyRect(&pmp->rcWork, &pMonitor->rcWork); 00071 00072 /* 00073 * If the device for this monitor object is not active, don't store 00074 * the pointer to it in the list. This way the windows on the inactive 00075 * monitor will be later moved to the default one. 00076 */ 00077 if (HdevFromMonitor(pMonitor) == -1) { 00078 pmp->pMonitor = NULL; 00079 } else { 00080 pmp->pMonitor = pMonitor; 00081 } 00082 00083 pmp++; 00084 } 00085 UserAssert(cVisMon == gpDispInfo->cMonitors); 00086 00087 pmr->cMonitor = (int)(pmp - pmr->amp); 00088 00089 return pmr; 00090 }

VOID SpbCheck VOID   ) 
 

Definition at line 995 of file spb.c.

References AnySpbs, tagDCE::DCX_flags, gpDispInfo, tagDISPLAYINFO::hDev, NULL, tagDISPLAYINFO::pdceFirst, tagDCE::pdceNext, SpbCheckDce(), SpbCheckRect(), and VOID().

Referenced by CreateSpb(), LockWindowUpdate2(), and zzzBltValidBits().

00996 { 00997 PDCE pdce; 00998 RECT rcBounds; 00999 01000 if (AnySpbs()) { 01001 01002 GreLockDisplay(gpDispInfo->hDev); 01003 01004 /* 01005 * Walk through all of the DC's, accumulating dirty areas. 01006 */ 01007 for (pdce = gpDispInfo->pdceFirst; pdce != NULL; pdce = pdce->pdceNext) { 01008 01009 /* 01010 * Only check valid cache entries... 01011 */ 01012 if (pdce->DCX_flags & (DCX_INVALID | DCX_DESTROYTHIS)) 01013 continue; 01014 01015 SpbCheckDce(pdce); 01016 } 01017 01018 /* 01019 * Subtact out DirectDraw dirty rect from all the SPB's. The call to 01020 * GreGetDirectDrawBounds will also reset the accumulated bounds. 01021 */ 01022 if (GreGetDirectDrawBounds(gpDispInfo->hDev, &rcBounds)) { 01023 SpbCheckRect(NULL, &rcBounds, 0); 01024 } 01025 01026 GreUnlockDisplay(gpDispInfo->hDev); 01027 } 01028 }

VOID SpbCheckDce PDCE  pdce  ) 
 

Definition at line 1040 of file spb.c.

References tagDCE::DCX_flags, tagDCE::hdc, IntersectRect(), NULL, OffsetRect(), tagDCE::pMonitor, tagDCE::pwndOrg, tagMONITOR::rcMonitor, SpbCheckRect(), and VOID().

Referenced by _GetDCEx(), GetMonitorDC(), InvalidateDce(), and SpbCheck().

01042 { 01043 RECT rc; 01044 01045 if (pdce->DCX_flags & DCX_LAYERED) 01046 return; 01047 01048 /* 01049 * Query the dirty bounds rectangle. Doing this clears the bounds 01050 * as well. 01051 */ 01052 if (GreGetBounds(pdce->hdc, &rc, 0)) { 01053 01054 if (pdce->pMonitor != NULL) { 01055 /* 01056 * Convert the bounds rect to screen coords. 01057 */ 01058 OffsetRect(&rc, pdce->pMonitor->rcMonitor.left, 01059 pdce->pMonitor->rcMonitor.top); 01060 } 01061 01062 /* 01063 * Intersect the returned rectangle with the window rectangle 01064 * in case the guy was drawing outside his window 01065 */ 01066 if (IntersectRect(&rc, &rc, &(pdce->pwndOrg)->rcWindow)) 01067 SpbCheckRect(pdce->pwndOrg, &rc, pdce->DCX_flags); 01068 } 01069 }

VOID SpbCheckPwnd PWND  pwnd  ) 
 

Definition at line 1126 of file spb.c.

References FreeSpb(), gpDispInfo, NULL, tagDISPLAYINFO::pspbFirst, tagSPB::pspbNext, tagWND::rcWindow, SpbCheckRect(), tagSPB::spwnd, tagWND::spwndParent, and VOID().

Referenced by LockWindowUpdate2(), and xxxDWP_SetRedraw().

01128 { 01129 PSPB pspb; 01130 PWND pwndSpb; 01131 PSPB pspbNext; 01132 01133 /* 01134 * First blow away any SPBs owned by this window or its children. 01135 */ 01136 for (pspb = gpDispInfo->pspbFirst; pspb != NULL; pspb = pspbNext) { 01137 01138 /* 01139 * Get pspbNext now in case we free the SPB 01140 */ 01141 pspbNext = pspb->pspbNext; 01142 01143 /* 01144 * If pspb->spwnd is == pwnd or a child of pwnd, then free the SPB 01145 */ 01146 for (pwndSpb = pspb->spwnd; pwndSpb; pwndSpb = pwndSpb->spwndParent) { 01147 01148 if (pwnd == pwndSpb) 01149 FreeSpb(pspb); 01150 } 01151 } 01152 01153 /* 01154 * Then see if any other SPBs are affected... 01155 */ 01156 if (gpDispInfo->pspbFirst != NULL) { 01157 SpbCheckRect(pwnd, &pwnd->rcWindow, 0); 01158 } 01159 }

VOID SpbCheckRect PWND  pwnd,
LPRECT  lprc,
DWORD  flags
 

Definition at line 1081 of file spb.c.

References gpDispInfo, IsVisible(), NULL, tagDISPLAYINFO::pspbFirst, tagSPB::pspbNext, SpbCheckRect2(), and VOID().

Referenced by _ScrollDC(), BltValidInit(), SpbCheck(), SpbCheckDce(), SpbCheckPwnd(), xxxInternalInvalidate(), xxxScrollWindowEx(), and zzzBltValidBits().

01085 { 01086 PSPB pspb, pspbNext; 01087 01088 /* 01089 * If this window isn't visible, we're done. 01090 */ 01091 if (!IsVisible(pwnd)) 01092 return; 01093 01094 for (pspb = gpDispInfo->pspbFirst; pspb != NULL; pspb = pspbNext) { 01095 01096 /* 01097 * Get the pointer to the next save popup bits structure now 01098 * in case SpbCheckRect2() frees the current one. 01099 */ 01100 pspbNext = pspb->pspbNext; 01101 01102 /* 01103 * In win3.1 they used to exit the function if this function 01104 * returned false. This meant that if one of the spbs was freed 01105 * the rest of the spbs would not be invalidated. 01106 */ 01107 SpbCheckRect2(pspb, pwnd, lprc, flags); 01108 } 01109 }

PWND SpeedHitTest PWND  pwndParent,
POINT  pt
 

Definition at line 198 of file winwhere.c.

References tagWND::hrgnClip, LayerHitTest(), NULL, PtInRect(), tagWND::rcClient, tagWND::rcWindow, tagWND::spwndChild, tagWND::spwndNext, TestWF, WEFLAYERED, and WFVISIBLE.

Referenced by xxxButtonEvent(), and zzzSetFMouseMoved().

00201 { 00202 PWND pwndT; 00203 PWND pwnd; 00204 00205 if (pwndParent == NULL) 00206 return NULL; 00207 00208 for (pwnd = pwndParent->spwndChild; pwnd != NULL; pwnd = pwnd->spwndNext) { 00209 00210 /* 00211 * Are we looking at an hidden window? 00212 */ 00213 if (!TestWF(pwnd, WFVISIBLE)) 00214 continue; 00215 00216 /* 00217 * Are we barking up the wrong tree? 00218 */ 00219 if (!PtInRect((LPRECT)&pwnd->rcWindow, pt)) { 00220 continue; 00221 } 00222 00223 /* 00224 * Check to see if in window region (if it has one) 00225 */ 00226 if (pwnd->hrgnClip != NULL) { 00227 if (!GrePtInRegion(pwnd->hrgnClip, pt.x, pt.y)) 00228 continue; 00229 } 00230 00231 /* 00232 * Is this a sprite? 00233 */ 00234 if (TestWF(pwnd, WEFLAYERED)) { 00235 if (!LayerHitTest(pwnd, pt)) 00236 continue; 00237 } 00238 00239 #ifdef REDIRECTION 00240 if (TestWF(pwnd, WEFREDIRECTED)) { 00241 continue; 00242 } 00243 #endif // REDIRECTION 00244 00245 /* 00246 * Children? 00247 */ 00248 if ((pwnd->spwndChild != NULL) && 00249 PtInRect((LPRECT)&pwnd->rcClient, pt)) { 00250 00251 pwndT = SpeedHitTest(pwnd, pt); 00252 if (pwndT != NULL) 00253 return pwndT; 00254 } 00255 00256 return pwnd; 00257 } 00258 00259 return pwndParent; 00260 }

PDEVICEINFO StartDeviceRead PDEVICEINFO  pDeviceInfo  ) 
 

Definition at line 1099 of file w32/ntuser/kernel/pnp.c.

References aDeviceTemplate, BOOL, tagDEVICE_TEMPLATE::cbData, EnterDeviceInfoListCrit(), ExIsResourceAcquiredExclusiveLite(), FreeDeviceInfo(), GDIAF_FREEME, GDIAF_RETRYREAD, GDIF_DBGREAD, GDIF_READING, gnRetryReadInput, gpresDeviceInfoList, InputApc(), ISTS, LeaveDeviceInfoListCrit(), LOGTIME, MAXIMUM_READ_RETRIES, NT_SUCCESS, NULL, tagDEVICE_TEMPLATE::offData, PBYTE, PsGetCurrentThread, and PZERO.

Referenced by InputApc(), and ProcessDeviceChanges().

01101 { 01102 PDEVICE_TEMPLATE pDevTpl; 01103 01104 pDeviceInfo->bFlags |= GDIF_READING; 01105 01106 /* 01107 * If this device needs freeing, abandon reading now and request the free. 01108 */ 01109 if (pDeviceInfo->usActions & GDIAF_FREEME) { 01110 BOOL fPreviouslyAcquired = ExIsResourceAcquiredExclusiveLite(gpresDeviceInfoList); 01111 if (!fPreviouslyAcquired) { 01112 EnterDeviceInfoListCrit(); 01113 } 01114 pDeviceInfo->bFlags &= ~GDIF_READING; 01115 pDeviceInfo = FreeDeviceInfo(pDeviceInfo); 01116 if (!fPreviouslyAcquired) { 01117 LeaveDeviceInfoListCrit(); 01118 } 01119 return pDeviceInfo; 01120 } 01121 01122 /* 01123 * Initialize in case read fails 01124 */ 01125 pDeviceInfo->iosb.Status = STATUS_UNSUCCESSFUL; // catch concurrent writes? 01126 pDeviceInfo->iosb.Information = 0; 01127 01128 pDevTpl = &aDeviceTemplate[pDeviceInfo->type]; 01129 01130 UserAssert(pDeviceInfo->OpenerProcess == PsGetCurrentThread()->Cid.UniqueProcess); 01131 LOGTIME(pDeviceInfo->timeStartRead); 01132 #ifdef DIAGNOSE_IO 01133 pDeviceInfo->nReadsOutstanding++; 01134 #endif 01135 pDeviceInfo->ReadStatus = ZwReadFile( 01136 pDeviceInfo->handle, 01137 NULL, // hReadEvent 01138 InputApc, // InputApc() 01139 pDeviceInfo, // ApcContext 01140 &pDeviceInfo->iosb, 01141 (PVOID)((PBYTE)pDeviceInfo + pDevTpl->offData), 01142 pDevTpl->cbData, 01143 PZERO(LARGE_INTEGER), NULL); 01144 LOGTIME(pDeviceInfo->timeEndRead); 01145 01146 #if DBG 01147 if (pDeviceInfo->bFlags & GDIF_DBGREAD) { 01148 TAGMSG2(DBGTAG_PNP, "ZwReadFile of Device handle %lx returned status %lx", 01149 pDeviceInfo->handle, pDeviceInfo->ReadStatus); 01150 } 01151 #endif 01152 01153 if (!NT_SUCCESS(pDeviceInfo->ReadStatus)) { 01154 BOOL fPreviouslyAcquired = ExIsResourceAcquiredExclusiveLite(gpresDeviceInfoList); 01155 if (!fPreviouslyAcquired) { 01156 EnterDeviceInfoListCrit(); 01157 } 01158 01159 /* 01160 * If insufficient resources, retry the read the next time the RIT 01161 * wakes up for the ID_TIMER event by incrementing gnRetryReadInput 01162 * (Cheaper than setting our own timer), 01163 * Else just abandon reading. 01164 */ 01165 if (pDeviceInfo->ReadStatus == STATUS_INSUFFICIENT_RESOURCES) { 01166 if (pDeviceInfo->nRetryRead++ < MAXIMUM_READ_RETRIES) { 01167 pDeviceInfo->usActions |= GDIAF_RETRYREAD; 01168 gnRetryReadInput++; 01169 } 01170 } else { 01171 pDeviceInfo->bFlags &= ~GDIF_READING; 01172 } 01173 01174 #ifdef DIAGNOSE_IO 01175 pDeviceInfo->nReadsOutstanding--; 01176 #endif 01177 if (!fPreviouslyAcquired) { 01178 LeaveDeviceInfoListCrit(); 01179 } 01180 } else { 01181 pDeviceInfo->nRetryRead = 0; 01182 } 01183 01184 if (!ISTS() && !NT_SUCCESS(pDeviceInfo->ReadStatus)) 01185 RIPMSG2(RIP_WARNING, "StartDeviceRead %#p failed Status %#x", 01186 pDeviceInfo, pDeviceInfo->ReadStatus); 01187 01188 return NULL; 01189 }

void StartFade void   ) 
 

Definition at line 879 of file sprite.c.

References ALPHASTART, DWORD, tagFADE::dwStart, tagFADE::dwTime, gfade, gTermIO, tagFADE::hbm, tagFADE::hdc, IDSYS_FADE, InternalSetTimer(), NtGetTickCount(), NULL, ShowFade(), tagTERMINAL::spwndDesktopOwner, and xxxSystemTimerProc().

Referenced by xxxMenuWindowProc(), xxxMNDismissWithNotify(), and xxxTooltipWndProc().

00880 { 00881 DWORD dwElapsed; 00882 00883 UserAssert(gfade.hdc != NULL); 00884 UserAssert(gfade.hbm != NULL); 00885 00886 /* 00887 * Set dc and bitmap to public so the desktop thread can use them. 00888 */ 00889 GreSetDCOwner(gfade.hdc, OBJECT_OWNER_PUBLIC); 00890 GreSetBitmapOwner(gfade.hbm, OBJECT_OWNER_PUBLIC); 00891 00892 /* 00893 * If it's not already shown, do the initial update that makes copy of 00894 * the source. All other updates will only need to change the alpha value. 00895 */ 00896 ShowFade(); 00897 00898 /* 00899 * Get the start time for the fade animation. 00900 */ 00901 dwElapsed = (gfade.dwTime * ALPHASTART + 255) / 255; 00902 gfade.dwStart = NtGetTickCount() - dwElapsed; 00903 00904 /* 00905 * Set the timer in the desktop thread. This will insure that the 00906 * animation is smooth and won't get stuck if the current thread hangs. 00907 */ 00908 InternalSetTimer(gTermIO.spwndDesktopOwner, IDSYS_FADE, 10, 00909 xxxSystemTimerProc, TMRF_SYSTEM | TMRF_PTIWINDOW); 00910 }

VOID StartScreenSaver BOOL  bOnlyIfSecure  ) 
 

Definition at line 165 of file syscmd.c.

References _PostMessage(), tagPOWERSTATE::fInProgress, gPowerState, gppiScreenSaver, gspwndLogonNotify, and NULL.

Referenced by IdleTimerProc(), and xxxSysCommand().

00167 { 00168 /* 00169 * If a screen saver is already running or we're in the midst of powering 00170 * down the machine, ignore this request. 00171 */ 00172 if (gppiScreenSaver != NULL || gPowerState.fInProgress) 00173 return; 00174 00175 if (gspwndLogonNotify != NULL) { 00176 /* 00177 * Let the logon process take care of the screen saver 00178 */ 00179 _PostMessage(gspwndLogonNotify, 00180 WM_LOGONNOTIFY, LOGON_INPUT_TIMEOUT, bOnlyIfSecure); 00181 } 00182 }

UINT_PTR StartTimers VOID   ) 
 

Definition at line 722 of file timers.c.

References InternalSetTimer(), NULL, and xxxHungAppDemon().

Referenced by RawInputThread().

00723 { 00724 /* 00725 * Let GDI know that it can start settings timers on the RIT. 00726 */ 00727 GreStartTimers(); 00728 00729 /* 00730 * TMRF_RIT timers are called directly from ScanTimers -- no nasty 00731 * thread switching for these boys. 00732 */ 00733 return InternalSetTimer(NULL, 0, 1000, xxxHungAppDemon, TMRF_RIT); 00734 }

void StopFade void   ) 
 

Definition at line 918 of file sprite.c.

References _GetDCEx(), _KillSystemTimer(), _ReleaseDC(), DeleteFadeSprite(), tagFADE::dwFlags, DWORD, FADE_COMPLETED, FADE_SHOW, gfade, gpDispInfo, gTermIO, tagFADE::hbm, tagFADE::hdc, tagDISPLAYINFO::hdcScreen, IDSYS_FADE, NULL, tagFADE::ptDst, tagFADE::size, and tagTERMINAL::spwndDesktopOwner.

Referenced by AnimateFade(), MNAnimate(), xxxTooltipWndProc(), and xxxUserChangeDisplaySettings().

00919 { 00920 DWORD dwRop=SRCCOPY; 00921 PWND pwnd; 00922 00923 UserAssert(gfade.hdc != NULL); 00924 UserAssert(gfade.hbm != NULL); 00925 00926 /* 00927 * Stop the fade animation timer. 00928 */ 00929 _KillSystemTimer(gTermIO.spwndDesktopOwner, IDSYS_FADE); 00930 00931 pwnd = DeleteFadeSprite(); 00932 00933 /* 00934 * If showing and the animation isn't completed, blt the last frame. 00935 */ 00936 if (!(gfade.dwFlags & FADE_COMPLETED) && (gfade.dwFlags & FADE_SHOW)) { 00937 int x, y; 00938 HDC hdc; 00939 00940 /* 00941 * For a windowed fade, make sure we observe the current visrgn. 00942 */ 00943 if (pwnd != NULL) { 00944 hdc = _GetDCEx(pwnd, NULL, DCX_WINDOW | DCX_CACHE); 00945 x = 0; 00946 y = 0; 00947 } else { 00948 hdc = gpDispInfo->hdcScreen; 00949 x = gfade.ptDst.x; 00950 y = gfade.ptDst.y; 00951 } 00952 00953 #ifdef USE_MIRRORING 00954 /* 00955 * If the destination DC is RTL mirrored, then BitBlt call should mirror the 00956 * content, since we want the menu to preserve it text (i.e. not to 00957 * be flipped). [samera] 00958 */ 00959 if (GreGetLayout(hdc) & LAYOUT_RTL) { 00960 dwRop |= NOMIRRORBITMAP; 00961 } 00962 #endif 00963 00964 GreBitBlt(hdc, x, y, gfade.size.cx, gfade.size.cy, gfade.hdc, 0, 0, dwRop, 0); 00965 _ReleaseDC(hdc); 00966 } 00967 00968 /* 00969 * Clean up the animation data. 00970 */ 00971 GreSelectBitmap(gfade.hdc, GreGetStockObject(PRIV_STOCK_BITMAP)); 00972 GreDeleteObject(gfade.hbm); 00973 00974 gfade.hbm = NULL; 00975 gfade.dwFlags = 0; 00976 }

VOID StoreMessage LPMSG  pmsg,
PWND  pwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam,
DWORD  time
 

Definition at line 4799 of file queue.c.

References CheckCritIn, gpsi, HW, and NtGetTickCount().

Referenced by CheckQuitMessage(), and DoPaint().

04806 { 04807 CheckCritIn(); 04808 04809 pmsg->hwnd = HW(pwnd); 04810 pmsg->message = message; 04811 pmsg->wParam = wParam; 04812 pmsg->lParam = lParam; 04813 pmsg->time = (time != 0 ? time : NtGetTickCount()); 04814 04815 pmsg->pt = gpsi->ptCursor; 04816 }

VOID StoreQMessage PQMSG  pqmsg,
PWND  pwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam,
DWORD  time,
DWORD  dwQEvent,
ULONG_PTR  dwExtraInfo
 

Definition at line 4831 of file queue.c.

References CheckCritIn, tagQMSG::dwQEvent, tagQMSG::ExtraInfo, gpsi, HW, tagQMSG::msg, and NtGetTickCount().

Referenced by _PostMessage(), _PostThreadMessage(), DestroyProcessInfo(), DoTimer(), PostEventMessage(), PostInputMessage(), xxxCallJournalPlaybackHook(), and xxxSetForegroundWindow2().

04840 { 04841 CheckCritIn(); 04842 04843 pqmsg->msg.hwnd = HW(pwnd); 04844 pqmsg->msg.message = message; 04845 pqmsg->msg.wParam = wParam; 04846 pqmsg->msg.lParam = lParam; 04847 pqmsg->msg.time = (time == 0) ? NtGetTickCount() : time; 04848 04849 #ifdef REDIRECTION 04850 if (message >= WM_MOUSEFIRST && message <= WM_MOUSELAST) { 04851 pqmsg->msg.pt.x = LOWORD(lParam); 04852 pqmsg->msg.pt.y = HIWORD(lParam); 04853 } else { 04854 pqmsg->msg.pt = gpsi->ptCursor; 04855 } 04856 #else 04857 pqmsg->msg.pt = gpsi->ptCursor; 04858 #endif 04859 pqmsg->dwQEvent = dwQEvent; 04860 pqmsg->ExtraInfo = dwExtraInfo; 04861 }

void __inline StoreQMessagePti PQMSG  pqmsg,
PTHREADINFO  pti
 

Definition at line 5138 of file userk.h.

References tagQMSG::msg.

Referenced by DoTimer(), PostEventMessage(), WakeSomeone(), and xxxSetForegroundWindow2().

05138 { 05139 pqmsg->msg.pt.x = LOWORD(pqmsg->msg.lParam); 05140 pqmsg->msg.pt.y = HIWORD(pqmsg->msg.lParam); 05141 } else {

__inline DWORD SubtractTick IN DWORD  dwTime,
IN int  nDelta
 

Definition at line 6988 of file userk.h.

07001 {

BOOL SysHasKanji VOID   ) 
 

UINT SystoChar UINT  message,
LPARAM  lParam
 

Definition at line 461 of file mnaccel.c.

References CheckMsgFilter, SYS_ALTERNATE, and UINT.

Referenced by xxxSBTrackLoop(), and xxxTranslateAccelerator().

00464 { 00465 if (CheckMsgFilter(message, WM_SYSKEYDOWN, WM_SYSDEADCHAR) && 00466 !(HIWORD(lParam) & SYS_ALTERNATE)) 00467 return (message - (WM_SYSKEYDOWN - WM_KEYDOWN)); 00468 00469 return message; 00470 }

VOID TerminateConsole PDESKTOP   ) 
 

Definition at line 4420 of file desktop.c.

References _PostThreadMessage(), tagDESKTOP::dwConsoleThreadId, LockThreadByClientId(), NT_SUCCESS, NTSTATUS(), NULL, PtiFromThread, Status, UnlockThread, and VOID().

Referenced by DestroyWindowStation(), and UnmapDesktop().

04422 { 04423 NTSTATUS Status; 04424 PETHREAD Thread; 04425 PTHREADINFO pti; 04426 04427 if (pdesk->dwConsoleThreadId == 0) 04428 return; 04429 04430 /* 04431 * Locate the console thread. 04432 */ 04433 Status = LockThreadByClientId((HANDLE)LongToHandle( pdesk->dwConsoleThreadId ), &Thread); 04434 if (!NT_SUCCESS(Status)) 04435 return; 04436 04437 /* 04438 * Post a quit message to the console. 04439 */ 04440 pti = PtiFromThread(Thread); 04441 UserAssert(pti != NULL); 04442 if (pti != NULL) { 04443 _PostThreadMessage(pti, WM_QUIT, 0, 0); 04444 } 04445 04446 /* 04447 * Clear thread id so we don't post twice 04448 */ 04449 pdesk->dwConsoleThreadId = 0; 04450 04451 UnlockThread(Thread); 04452 }

__inline DWORD TestFadeFlags DWORD  dwFlags  ) 
 

Definition at line 6754 of file userk.h.

References dwFlags, DWORD, and gfade.

Referenced by MNAnimate(), xxxMenuWindowProc(), and xxxTooltipWndProc().

06765 {

NTSTATUS TestForInteractiveUser PLUID  pluidCaller  ) 
 

Definition at line 255 of file w32/ntuser/kernel/security.c.

References grpWinStaList, tagWINDOWSTATION::luidUser, NULL, and RtlEqualLuid().

Referenced by NtUserTestForInteractiveUser().

00258 { 00259 PWINDOWSTATION pwinsta; 00260 00261 UserAssert(grpWinStaList != NULL); 00262 00263 /* 00264 * !!! 00265 * 00266 * This relies on the fact that there is only ONE interactive 00267 * windowstation and that it is the first one in the list. 00268 * If multiple windowstations are ever supported 00269 * a lookup will have to be done here. 00270 */ 00271 pwinsta = grpWinStaList; 00272 00273 /* 00274 * Compare it with the id of the logged on user. 00275 */ 00276 if (RtlEqualLuid(pluidCaller, &pwinsta->luidUser)) 00277 return STATUS_SUCCESS; 00278 else 00279 return STATUS_ACCESS_DENIED; 00280 }

PVOID __inline ThreadLockExchange PVOID  pobj,
PTL  ptl
 

Definition at line 1316 of file userk.h.

References HMLockObject, and HMUnlockObject.

Referenced by xxxScanSysQueue().

01317 { 01318 PVOID pobjOld; 01319 01320 pobjOld = ptl->pobj; 01321 ptl->pobj = pobj; 01322 if (pobj) { 01323 HMLockObject(pobj); 01324 } 01325 01326 if (pobjOld) { 01327 pobjOld = HMUnlockObject((PHEAD)pobjOld); 01328 } 01329 01330 return pobjOld; 01331 }

PVOID __inline ThreadLockExchangeAlways PVOID  pobj,
PTL  ptl
 

Definition at line 1342 of file userk.h.

References HMLockObject, and HMUnlockObject.

Referenced by xxxRedrawHungWindow(), xxxScrollWindowEx(), xxxSendChildNCPaint(), xxxUpdateOtherThreadsWindows(), xxxUpdateThreadsWindows(), xxxUpdateWindow2(), and xxxWindowHitTest().

01343 { 01344 PVOID pobjOld; 01345 01346 pobjOld = ptl->pobj; 01347 ptl->pobj = pobj; 01348 HMLockObject(pobj); 01349 if (pobjOld) { 01350 pobjOld = HMUnlockObject((PHEAD)pobjOld); 01351 } 01352 01353 return pobjOld; 01354 }

PVOID ThreadUnlock1 VOID   ) 
 

Definition at line 1939 of file handtabl.c.

References HMUnlockObject, NULL, PtiCurrent, tagTHREADINFO::ptl, and TRUE.

01942 { 01943 PHEAD phead; 01944 PTHREADINFO ptiCurrent; 01945 PTL ptl; 01946 01947 ptiCurrent = PtiCurrent(); 01948 ptl = ptiCurrent->ptl; 01949 UserAssert(ptl != NULL); 01950 /* 01951 * Validate the thread lock list. 01952 */ 01953 ValidateThreadLocks(NULL, ptl, (ULONG_PTR)&ptlIn, TRUE); 01954 /* 01955 * Make sure the caller wants to unlock the top lock. 01956 */ 01957 UserAssert(ptlIn == ptl); 01958 ptiCurrent->ptl = ptl->next; 01959 /* 01960 * If the object address is not NULL, then unlock the object. 01961 */ 01962 phead = (PHEAD)(ptl->pobj); 01963 if (phead != NULL) { 01964 01965 /* 01966 * Unlock the object. 01967 */ 01968 01969 phead = (PHEAD)HMUnlockObject(phead); 01970 } 01971 #if DBG 01972 { 01973 /* 01974 * Remove the corresponding element from gFreeTLList 01975 */ 01976 ptl->ptl->next = gFreeTLList; 01977 ptl->ptl->uTLCount += TL_FREED_PATTERN; 01978 gFreeTLList = ptl->ptl; 01979 } 01980 #endif 01981 return (PVOID)phead; 01982 }

VOID TimersProc VOID   ) 
 

Definition at line 746 of file timers.c.

References tagTIMER::cmsCountdown, tagTIMER::cmsRate, ComputePastTickDelta(), tagTHREADINFO::cTimersReady, DWORD, EnterCrit, FALSE, tagTIMER::flags, gbMasterTimerSet, gcmsLastTimer, gdmsNextTimer, gptmrFirst, gptmrMaster, HMIsMarkDestroy, INT, KeSetTimer(), LeaveCrit, tagTIMER::nID, NtGetTickCount(), NULL, tagTIMER::pfn, tagTIMER::pti, tagTIMER::ptmrNext, SetWakeBit(), ThreadLock, ThreadUnlock, VOID(), and WM_SYSTIMER.

Referenced by RawInputThread().

00748 { 00749 INT dmsSinceLast; 00750 LARGE_INTEGER liT; 00751 PTIMER ptmr; 00752 DWORD cmsCur; 00753 00754 /* 00755 * Calculate how long it was since the last time we 00756 * processed timers so we can subtract that much time 00757 * from each timer's countdown value. 00758 */ 00759 EnterCrit(); 00760 00761 cmsCur = NtGetTickCount(); 00762 dmsSinceLast = ComputePastTickDelta(cmsCur, gcmsLastTimer); 00763 gcmsLastTimer = cmsCur; 00764 00765 /* 00766 * dmsNextTimer is the time delta before the next 00767 * timer should go off. As we loop through the 00768 * timers below this will shrink to the smallest 00769 * cmsCountdown value in the list. 00770 */ 00771 gdmsNextTimer = 0x7FFFFFFF; 00772 ptmr = gptmrFirst; 00773 gbMasterTimerSet = FALSE; 00774 while (ptmr != NULL) { 00775 00776 /* 00777 * ONESHOT timers go to a WAITING state after 00778 * they go off. This allows us to leave them 00779 * in the list but keep them from going off 00780 * over and over. 00781 */ 00782 if (ptmr->flags & TMRF_WAITING) { 00783 ptmr = ptmr->ptmrNext; 00784 continue; 00785 } 00786 00787 /* 00788 * The first time we encounter a timer we don't 00789 * want to set it off, we just want to use it to 00790 * compute the shortest countdown value. 00791 */ 00792 if (ptmr->flags & TMRF_INIT) { 00793 ptmr->flags &= ~TMRF_INIT; 00794 00795 } else { 00796 /* 00797 * If this timer is going off, wake up its 00798 * owner. 00799 */ 00800 ptmr->cmsCountdown -= dmsSinceLast; 00801 if (ptmr->cmsCountdown <= 0) { 00802 ptmr->cmsCountdown = ptmr->cmsRate; 00803 00804 /* 00805 * If the timer's owner hasn't handled the 00806 * last time it went off yet, throw this event 00807 * away. 00808 */ 00809 if (!(ptmr->flags & TMRF_READY)) { 00810 /* 00811 * A ONESHOT timer goes into a WAITING state 00812 * until SetTimer is called again to reset it. 00813 */ 00814 if (ptmr->flags & TMRF_ONESHOT) 00815 ptmr->flags |= TMRF_WAITING; 00816 00817 /* 00818 * RIT timers have the distinction of being 00819 * called directly and executing serially with 00820 * with incoming timer events. 00821 * NOTE: RIT timers get called while we're 00822 * inside the critical section. 00823 */ 00824 if (ptmr->flags & TMRF_RIT) { 00825 TL tlTimer; 00826 00827 ThreadLock(ptmr, &tlTimer); 00828 /* 00829 * May set gbMasterTimerSet 00830 */ 00831 (ptmr->pfn)(NULL, 00832 WM_SYSTIMER, 00833 ptmr->nID, 00834 (LPARAM)ptmr); 00835 00836 if (HMIsMarkDestroy(ptmr)) { 00837 ptmr = ptmr->ptmrNext; 00838 ThreadUnlock(&tlTimer); 00839 continue; 00840 } 00841 ThreadUnlock(&tlTimer); 00842 00843 } else { 00844 ptmr->flags |= TMRF_READY; 00845 ptmr->pti->cTimersReady++; 00846 SetWakeBit(ptmr->pti, QS_TIMER); 00847 } 00848 } 00849 } 00850 } 00851 00852 /* 00853 * Remember the shortest time left of the timers. 00854 */ 00855 if (ptmr->cmsCountdown < gdmsNextTimer) 00856 gdmsNextTimer = ptmr->cmsCountdown; 00857 00858 /* 00859 * Advance to the next timer structure. 00860 */ 00861 ptmr = ptmr->ptmrNext; 00862 } 00863 00864 if (!gbMasterTimerSet) { 00865 /* 00866 * Time in NT should be negative to specify a relative 00867 * time. It's also in hundred nanosecond units so multiply 00868 * by 10000 to get the right value from milliseconds. 00869 */ 00870 liT.QuadPart = Int32x32To64(-10000, gdmsNextTimer); 00871 KeSetTimer(gptmrMaster, liT, NULL); 00872 } 00873 00874 LeaveCrit(); 00875 }

void TrackLayeredZorder PWND  pwnd  ) 
 

Definition at line 1184 of file sprite.c.

References gpDispInfo, tagDISPLAYINFO::hDev, NULL, PtoH, PtoHq, tagWND::spwndNext, TestWF, and WEFLAYERED.

Referenced by LinkWindow(), and xxxSetLayeredWindow().

01185 { 01186 #ifdef CHILD_LAYERING 01187 01188 PWND pwndT = GetNextLayeredWindow(pwnd); 01189 01190 #else // CHILD_LAYERING 01191 01192 PWND pwndT = pwnd->spwndNext; 01193 01194 while (pwndT != NULL) { 01195 01196 if (TestWF(pwndT, WEFLAYERED)) 01197 break; 01198 01199 pwndT = pwndT->spwndNext; 01200 } 01201 01202 #endif // CHILD_LAYERING 01203 01204 GreZorderSprite(gpDispInfo->hDev, PtoHq(pwnd), PtoH(pwndT)); 01205 }

VOID TransferWakeBit PTHREADINFO  pti,
UINT  message
 

Definition at line 4649 of file queue.c.

References CalcWakeMask(), tagCLIENTTHREADINFO::fsChangeBits, tagCLIENTTHREADINFO::fsWakeBits, tagTHREADINFO::pcti, tagTHREADINFO::pq, tagQ::ptiKeyboard, tagQ::ptiMouse, and UINT.

Referenced by xxxScanSysQueue().

04652 { 04653 PTHREADINFO ptiT; 04654 UINT fsMask; 04655 04656 /* 04657 * Calculate the mask from the message range. Only interested 04658 * in hardware input here: mouse and keys. 04659 */ 04660 fsMask = CalcWakeMask(message, message, 0) & (QS_MOUSE | QS_KEY); 04661 04662 /* 04663 * If it is set in this thread's wakebits, nothing to do. 04664 * Otherwise transfer them from the owner to this thread. 04665 */ 04666 if (!(pti->pcti->fsWakeBits & fsMask)) { 04667 /* 04668 * Either mouse or key is set (not both). Remove this bit 04669 * from the thread that currently owns it, and change mouse / 04670 * key ownership to this thread. 04671 */ 04672 if (fsMask & QS_KEY) { 04673 ptiT = pti->pq->ptiKeyboard; 04674 pti->pq->ptiKeyboard = pti; 04675 } else { 04676 ptiT = pti->pq->ptiMouse; 04677 pti->pq->ptiMouse = pti; 04678 } 04679 ptiT->pcti->fsWakeBits &= ~fsMask; 04680 04681 /* 04682 * Transfer them to this thread (certainly this may be the 04683 * same thread for win32 threads not sharing queues). 04684 */ 04685 pti->pcti->fsWakeBits |= fsMask; 04686 pti->pcti->fsChangeBits |= fsMask; 04687 } 04688 }

VOID UnlinkWindow PWND  pwndUnlink,
PWND  pwndParent
 

Definition at line 2867 of file createw.c.

References FALSE, Lock, NULL, tagWND::spwndChild, tagWND::spwndNext, tagWND::spwndParent, Unlock, and VOID().

Referenced by ImeSetTopmost(), xxxDestroyWindow(), xxxFW_DestroyAllChildren(), xxxSetParent(), and zzzChangeStates().

02870 { 02871 PWND pwnd; 02872 02873 pwnd = pwndParent->spwndChild; 02874 02875 if (pwnd == pwndUnlink) { 02876 Lock(&(pwndParent->spwndChild), pwndUnlink->spwndNext); 02877 Unlock(&pwndUnlink->spwndNext); 02878 02879 #if DBG 02880 VerifyWindowLink (pwnd, pwndParent, FALSE); 02881 #endif 02882 02883 return; 02884 } 02885 02886 while (pwnd != NULL) { 02887 UserAssert(pwnd->spwndParent == pwndParent); 02888 if (pwnd->spwndNext == pwndUnlink) { 02889 Lock(&(pwnd->spwndNext), pwndUnlink->spwndNext); 02890 Unlock(&pwndUnlink->spwndNext); 02891 02892 #if DBG 02893 VerifyWindowLink (pwnd, pwndParent, FALSE); 02894 #endif 02895 return; 02896 } 02897 02898 pwnd = pwnd->spwndNext; 02899 } 02900 02901 /* 02902 * We should never get here unless the window isn't in the list! 02903 */ 02904 RIPMSG1(RIP_WARNING, 02905 "Unlinking previously unlinked window %#p\n", 02906 pwndUnlink); 02907 02908 #if DBG 02909 VerifyWindowLink (pwnd, pwndParent, FALSE); 02910 #endif 02911 02912 return; 02913 }

void UnloadCursorsAndIcons VOID   ) 
 

Definition at line 1642 of file w32/ntuser/kernel/init.c.

References gasyscur, gasysico, NULL, PpiCurrent, tagSYSCFGICO::spcur, TRACE_HYDAPI, Unlock, and VOID().

Referenced by CleanupResources().

01644 { 01645 PCURSOR pcur; 01646 int ind; 01647 01648 TRACE_HYDAPI(("UnloadCursorsAndIcons\n")); 01649 01650 /* 01651 * unlock the icons 01652 */ 01653 for (ind = 0; ind < COIC_CONFIGURABLE; ind++) { 01654 pcur = gasysico[ind].spcur; 01655 01656 if (pcur == NULL) 01657 continue; 01658 01659 pcur->head.ppi = PpiCurrent(); 01660 Unlock(&gasysico[ind].spcur); 01661 } 01662 01663 /* 01664 * unlock the cursors 01665 */ 01666 for (ind = 0; ind < COCR_CONFIGURABLE; ind++) { 01667 pcur = gasyscur[ind].spcur; 01668 01669 if (pcur == NULL) 01670 continue; 01671 01672 pcur->head.ppi = PpiCurrent(); 01673 Unlock(&gasyscur[ind].spcur); 01674 } 01675 }

__inline VOID UnlockCaptureWindow PQ  pq  ) 
 

Definition at line 7278 of file userk.h.

References gpsi.

Referenced by CancelInputState(), zzzAttachToQueue(), and zzzDestroyQueue().

07278 { 07279 UserAssert(gpsi->cCaptures > 0); 07280 gpsi->cCaptures--; 07281 } 07282 if (pwnd) { 07283 gpsi->cCaptures++; 07284 }

PVOID UnlockDesktopMenu PMENU ppmenu  ) 
 

Definition at line 124 of file mnsys.c.

References ClearMF, MFDESKTOP, NULL, TestMF, and Unlock.

Referenced by xxxDesktopThread().

00125 { 00126 UserAssert(*ppmenu != NULL); 00127 UserAssert(TestMF(*ppmenu, MFDESKTOP)); 00128 ClearMF(*ppmenu, MFDESKTOP); 00129 UserAssert(TestMF((*ppmenu)->rgItems->spSubMenu, MFDESKTOP)); 00130 ClearMF((*ppmenu)->rgItems->spSubMenu, MFDESKTOP); 00131 return Unlock(ppmenu); 00132 }

__inline PVOID UnlockDesktopSysMenu PMENU ppmenu  ) 
 

Definition at line 5479 of file userk.h.

References BOOL.

Referenced by xxxDesktopThread(), and xxxUpdatePerUserSystemParameters().

05490 {

void UnlockMFMWFPWindow PULONG_PTR  puHitArea  ) 
 

Definition at line 3128 of file ntuser/kernel/menu.c.

References IsMFMWFPWindow(), MFMWFP_OFFMENU, and Unlock.

Referenced by LockMFMWFPWindow(), MNCheckButtonDownState(), xxxHandleMenuMessages(), xxxMNDragLeave(), and xxxMNEndMenuState().

03129 { 03130 if (IsMFMWFPWindow(*puHitArea)) { 03131 Unlock(puHitArea); 03132 } else { 03133 *puHitArea = MFMWFP_OFFMENU; 03134 } 03135 }

VOID UnlockObjectAssignment PVOID *   ) 
 

Definition at line 421 of file ex.c.

References ExDesktopObjectType, FALSE, LogDesktop, NULL, ObDereferenceObject, OBJECT_TO_OBJECT_HEADER, and VOID().

00428 { 00429 if (*pplock != NULL) { 00430 #ifdef LOGDESKTOPLOCKS 00431 if (OBJECT_TO_OBJECT_HEADER(*pplock)->Type == *ExDesktopObjectType) { 00432 LogDesktop(*pplock, tag, FALSE, extra); 00433 } 00434 #endif 00435 ObDereferenceObject(*pplock); 00436 *pplock = NULL; 00437 } 00438 }

PVOID UnlockPopupMenu PPOPUPMENU  ppopup,
PMENU pspmenu
 

Definition at line 367 of file ntuser/kernel/menu.c.

References IsRootPopupMenu(), NULL, tagPOPUPMENU::spmenu, tagPOPUPMENU::spmenuAlternate, tagPOPUPMENU::spwndNotify, Unlock, and UnlockPopupMenuWindow().

Referenced by MNFreePopup(), and xxxMNKeyDown().

00368 { 00369 /* 00370 * If you hit this assertion, you're probably not passing the right thing 00371 */ 00372 UserAssert((pspmenu == &ppopup->spmenu) || (pspmenu == &ppopup->spmenuAlternate)); 00373 /* 00374 * If nothing is locked, bail. 00375 */ 00376 if (*pspmenu == NULL) { 00377 return NULL; 00378 } 00379 00380 /* 00381 * This won't work properly if the popup already unlocked the notification 00382 * window. However, this can happen with the root popup if the 00383 * notification window gets destroyed while in menu mode. 00384 */ 00385 UserAssert((ppopup->spwndNotify != NULL) || IsRootPopupMenu(ppopup)); 00386 00387 /* 00388 * When using modeless menus, menus can be shared by several active 00389 * popups/notification windows. If the menu has owner draw items, 00390 * the app better knows how to paint them right. It shouldn't 00391 * happen with modal menus though. 00392 */ 00393 #if DBG 00394 if (((*pspmenu)->spwndNotify != NULL) 00395 && (ppopup->spwndNotify != NULL) 00396 && (ppopup->spwndNotify != (*pspmenu)->spwndNotify)) { 00397 00398 RIPMSG3(RIP_WARNING, "UnlockPopupMenu: Menu %#p shared by %#p and %#p", 00399 *pspmenu, (*pspmenu)->spwndNotify, ppopup->spwndNotify); 00400 } 00401 #endif 00402 00403 /* 00404 * Unlock the menu's spwndNotify if needed 00405 */ 00406 UnlockPopupMenuWindow(*pspmenu, ppopup->spwndNotify); 00407 00408 /* 00409 * Unlock the menu from the popup structure 00410 */ 00411 return Unlock(pspmenu); 00412 }

PVOID UnlockWndMenu PWND  pwnd,
PMENU pspmenu
 

Definition at line 458 of file ntuser/kernel/menu.c.

References NULL, tagWND::spmenu, tagWND::spmenuSys, and Unlock.

Referenced by xxxFreeWindow(), xxxGetSystemMenu(), xxxSetWindowData(), and xxxSetWindowStyle().

00459 { 00460 /* 00461 * If you hit this assertion, you're probably not passing the right thing 00462 */ 00463 UserAssert((pspmenu == &pwnd->spmenu) || (pspmenu == &pwnd->spmenuSys)); 00464 00465 /* 00466 * If nothing is locked, bail 00467 */ 00468 if (*pspmenu == NULL) { 00469 return NULL; 00470 } 00471 00472 /* 00473 * If this window owns the menu, unlock it from the menu strucutre 00474 */ 00475 if (pwnd == (*pspmenu)->spwndNotify) { 00476 Unlock(&((*pspmenu)->spwndNotify)); 00477 } 00478 00479 /* 00480 * Unlock the menu from the window structure 00481 */ 00482 return Unlock(pspmenu); 00483 }

VOID UnmapDesktop IN PEPROCESS Process  OPTIONAL,
IN PVOID  Object,
IN ACCESS_MASK  GrantedAccess,
IN ULONG  ProcessHandleCount,
IN ULONG  SystemHandleCount
 

BOOL UnqueueMouseEvent PMOUSEEVENT  pme  ) 
 

Definition at line 997 of file ntinput.c.

References BOOL, DWORD, EnterMouseCrit(), FALSE, gdwMouseEvents, gdwMouseQueueHead, gMouseEventQueue, gMouseUnqueueMouseEventTime, LeaveMouseCrit(), LOGTIME, NELEM_BUTTONQUEUE, PMOUSEEVENT, and TRUE.

Referenced by ProcessQueuedMouseEvents().

01000 { 01001 DWORD dwTail; 01002 01003 EnterMouseCrit(); 01004 01005 LOGTIME(gMouseUnqueueMouseEventTime); 01006 01007 if (gdwMouseEvents == 0) { 01008 LeaveMouseCrit(); 01009 return FALSE; 01010 } else { 01011 dwTail = (gdwMouseQueueHead - gdwMouseEvents + 1) % NELEM_BUTTONQUEUE; 01012 *pme = gMouseEventQueue[dwTail]; 01013 gdwMouseEvents--; 01014 } 01015 01016 LeaveMouseCrit(); 01017 return TRUE; 01018 }

BOOL UnsetLayeredWindow PWND  pwnd  ) 
 

Definition at line 417 of file sprite.c.

References BEGINATOMICCHECK, BOOL, ClrWF, ENDATOMICCHECK, FALSE, gpDispInfo, tagDISPLAYINFO::hDev, IDC_DEFAULT, IDC_NOMOUSE, NULL, PtoHq, RemoveRedirectionBitmap(), TestWF, TRUE, WEFLAYERED, WFVISIBLE, and zzzInvalidateDCCache().

Referenced by DeleteFadeSprite(), xxxFreeWindow(), and xxxSetWindowStyle().

00418 { 00419 HWND hwnd = PtoHq(pwnd); 00420 00421 /* 00422 * Remove the layered redirection bitmap. 00423 */ 00424 RemoveRedirectionBitmap(pwnd); 00425 00426 /* 00427 * If the window is still visible, leave the sprite bits on the screen. 00428 */ 00429 if (TestWF(pwnd, WFVISIBLE)) { 00430 GreUpdateSprite(gpDispInfo->hDev, hwnd, NULL, NULL, NULL, NULL, 00431 NULL, NULL, 0, NULL, ULW_NOREPAINT, NULL); 00432 } 00433 00434 /* 00435 * Delete the sprite object. 00436 */ 00437 if (!GreDeleteSprite(gpDispInfo->hDev, PtoHq(pwnd), NULL)) { 00438 RIPMSG1(RIP_WARNING, "xxxSetLayeredWindow failed %X", pwnd); 00439 return FALSE; 00440 } 00441 ClrWF(pwnd, WEFLAYERED); 00442 00443 /* 00444 * No need to jiggle the mouse when the sprite is removed. As an 00445 * added bonus that means that zzzInvalidateDCCache won't leave 00446 * the critical section. 00447 * 00448 * Make sure the window gets painted if visible. 00449 * 00450 * BUGBUG: should jiggle the mouse. Remove IDC_NOMOUSE when 00451 * SetFMouseMoved and thus InvalidateDCCache don't leave crit. 00452 */ 00453 if (TestWF(pwnd, WFVISIBLE)) { 00454 BEGINATOMICCHECK(); 00455 zzzInvalidateDCCache(pwnd, IDC_DEFAULT | IDC_NOMOUSE); 00456 ENDATOMICCHECK(); 00457 } 00458 return TRUE; 00459 }

VOID UpdateAsyncKeyState PQ  pq,
UINT  wVK,
BOOL  fBreak
 

Definition at line 322 of file keyboard.c.

References tagQ::afKeyRecentDown, CheckCritIn, ClearAsyncKeyStateDown, ClearAsyncKeyStateToggle, CVKASYNCKEYCACHE, gpsi, grpdeskRitInput, NULL, PostUpdateKeyStateEvent(), tagTHREADINFO::pq, tagDESKTOP::PtiList, tagQ::QF_flags, QF_UPDATEKEYSTATE, SetAsyncKeyStateDown, SetAsyncKeyStateRecentDown, SetAsyncKeyStateToggle, SetKeyRecentDownBit, TestAsyncKeyStateDown, and TestAsyncKeyStateToggle.

Referenced by xxxButtonEvent(), and xxxKeyEvent().

00326 { 00327 PQ pqT; 00328 PLIST_ENTRY pHead, pEntry; 00329 PTHREADINFO pti; 00330 00331 CheckCritIn(); 00332 00333 /* 00334 * First check to see if the queue this key is going to has a pending 00335 * key state event. If it does, post it because we need to copy the 00336 * async key state into this event as it is before we modify 00337 * this key's state, or else we'll generate a key state event with 00338 * the wrong key state in it. 00339 */ 00340 if (pqOwner != NULL && pqOwner->QF_flags & QF_UPDATEKEYSTATE) { 00341 PostUpdateKeyStateEvent(pqOwner); 00342 } 00343 00344 if (!fBreak) { 00345 /* 00346 * This key has gone down - update the "recent down" bit in the 00347 * async key state table. 00348 */ 00349 SetAsyncKeyStateRecentDown(wVK); 00350 00351 /* 00352 * This is a key make. If the key was not already down, update the 00353 * toggle bit. 00354 */ 00355 if (!TestAsyncKeyStateDown(wVK)) { 00356 if (TestAsyncKeyStateToggle(wVK)) { 00357 ClearAsyncKeyStateToggle(wVK); 00358 } else { 00359 SetAsyncKeyStateToggle(wVK); 00360 } 00361 } 00362 00363 /* 00364 * This is a make, so turn on the key down bit. 00365 */ 00366 SetAsyncKeyStateDown(wVK); 00367 00368 } else { 00369 /* 00370 * This is a break, so turn off the key down bit. 00371 */ 00372 ClearAsyncKeyStateDown(wVK); 00373 } 00374 00375 /* 00376 * If this is one of the keys we cache, update the async key cache index. 00377 */ 00378 if (wVK < CVKASYNCKEYCACHE) { 00379 gpsi->dwAsyncKeyCache++; 00380 } 00381 00382 /* 00383 * A key has changed state. Update all queues not receiving this input so 00384 * they know that this key has changed state. This lets us know which keys to 00385 * update in the thread specific key state table to keep it in sync 00386 * with the user. Walking down the thread list may mean that an 00387 * individual queue may by updated more than once, but it is cheaper 00388 * than maintaining a list of queues on the desktop. 00389 */ 00390 UserAssert(grpdeskRitInput != NULL); 00391 00392 pHead = &grpdeskRitInput->PtiList; 00393 for (pEntry = pHead->Flink; pEntry != pHead; pEntry = pEntry->Flink) { 00394 pti = CONTAINING_RECORD(pEntry, THREADINFO, PtiLink); 00395 00396 /* 00397 * Don't update the queue this message is going to - it'll be 00398 * in sync because it is receiving this message. 00399 */ 00400 pqT = pti->pq; 00401 if (pqT == pqOwner) 00402 continue; 00403 00404 /* 00405 * Set the "recent down" bit. In this case this doesn't really mean 00406 * "recent down", it means "recent change" (since the last time 00407 * we synced this queue), either up or down. This tells us which 00408 * keys went down since the last time this thread synced with key 00409 * state. Set the "update key state" flag so we know that later 00410 * we need to sync with these keys. 00411 */ 00412 SetKeyRecentDownBit(pqT->afKeyRecentDown, wVK); 00413 pqT->QF_flags |= QF_UPDATEKEYSTATE; 00414 } 00415 00416 /* 00417 * Update the key cache index. 00418 */ 00419 gpsi->dwKeyCache++; 00420 }

BOOL UpdateInputContext IN PIMC  pImc,
IN UPDATEINPUTCONTEXTCLASS  UpdateType,
IN ULONG_PTR  UpdateValue
 

Definition at line 239 of file ntimm.c.

References BOOL, FALSE, GETPTI, tagTHREADINFO::ppi, PtiCurrent, TRUE, UpdateClientInputContext, and UpdateInUseImeWindow.

Referenced by NtUserUpdateInputContext().

00243 { 00244 PTHREADINFO ptiCurrent, ptiImcOwner; 00245 00246 ptiCurrent = PtiCurrent(); 00247 ptiImcOwner = GETPTI(pImc); 00248 00249 /* 00250 * Cannot update input context from other process. 00251 */ 00252 if (ptiImcOwner->ppi != ptiCurrent->ppi) { 00253 RIPERR0(ERROR_ACCESS_DENIED, RIP_WARNING, "UpdateInputContext: pImc not of current ppi"); 00254 return FALSE; 00255 } 00256 00257 00258 switch (UpdateType) { 00259 00260 case UpdateClientInputContext: 00261 if (pImc->dwClientImcData != 0) { 00262 RIPERR0(RIP_WARNING, RIP_WARNING, "UpdateInputContext: pImc->dwClientImcData != 0"); 00263 return FALSE; 00264 } 00265 pImc->dwClientImcData = UpdateValue; 00266 break; 00267 00268 case UpdateInUseImeWindow: 00269 pImc->hImeWnd = (HWND)UpdateValue; 00270 break; 00271 00272 default: 00273 return FALSE; 00274 } 00275 00276 return TRUE; 00277 }

VOID UpdateKeyLights BOOL  bInjected  ) 
 

Definition at line 2985 of file ntinput.c.

References CheckCritIn, ClearRawKeyToggle, DEVICE_TYPE_KEYBOARD, EnterDeviceInfoListCrit(), gbRemoteSession, gdwUpdateKeyboard, giosbKbdControl, gKeyboardInfo, gklp, gpDeviceInfoList, gptiRit, LeaveDeviceInfoListCrit(), NULL, PtiCurrent, SetRawKeyToggle, TestAsyncKeyStateToggle, UPDATE_KBD_LEDS, and VOID().

Referenced by _SetKeyboardState(), ChangeForegroundKeyboardTable(), ProcessDeviceChanges(), RemotePassthruDisable(), UpdatePerUserKeyboardIndicators(), xxxKeyEvent(), and xxxRemoteReconnect().

02986 { 02987 /* 02988 * Looking at async keystate. Must be in critical section. 02989 */ 02990 CheckCritIn(); 02991 02992 /* 02993 * Based on the toggle bits in the async keystate table, 02994 * set the key lights. 02995 */ 02996 gklp.LedFlags = 0; 02997 if (TestAsyncKeyStateToggle(VK_CAPITAL)) { 02998 gklp.LedFlags |= KEYBOARD_CAPS_LOCK_ON; 02999 SetRawKeyToggle(VK_CAPITAL); 03000 } else { 03001 ClearRawKeyToggle(VK_CAPITAL); 03002 } 03003 03004 if (TestAsyncKeyStateToggle(VK_NUMLOCK)) { 03005 gklp.LedFlags |= KEYBOARD_NUM_LOCK_ON; 03006 SetRawKeyToggle(VK_NUMLOCK); 03007 } else { 03008 ClearRawKeyToggle(VK_NUMLOCK); 03009 } 03010 03011 if (TestAsyncKeyStateToggle(VK_SCROLL)) { 03012 gklp.LedFlags |= KEYBOARD_SCROLL_LOCK_ON; 03013 SetRawKeyToggle(VK_SCROLL); 03014 } else { 03015 ClearRawKeyToggle(VK_SCROLL); 03016 } 03017 03018 /* 03019 * Only "Japanese keyboard hardware" has "KANA" LEDs, and switch to 03020 * "KANA" state. 03021 */ 03022 if (JAPANESE_KEYBOARD(gKeyboardInfo.KeyboardIdentifier)) { 03023 if (TestAsyncKeyStateToggle(VK_KANA)) { 03024 gklp.LedFlags |= KEYBOARD_KANA_LOCK_ON; 03025 SetRawKeyToggle(VK_KANA); 03026 } else { 03027 ClearRawKeyToggle(VK_KANA); 03028 } 03029 } 03030 03031 /* 03032 * On terminal server, we need to tell the WD about application injected 03033 * toggle keys so it can update the client accordingly. 03034 */ 03035 if (gbRemoteSession) { 03036 if (bInjected) 03037 gklp.LedFlags |= KEYBOARD_LED_INJECTED; 03038 else 03039 gklp.LedFlags &= ~KEYBOARD_LED_INJECTED; 03040 } 03041 03042 03043 if (PtiCurrent() != gptiRit) { 03044 /* 03045 * Hand off the IOCTL to the RIT, since only the system process can 03046 * access the keyboard handles. Happens when applying user's profile. 03047 * IanJa: Should we check PpiCurrent() == gptiRit->ppi instead? 03048 */ 03049 gdwUpdateKeyboard |= UPDATE_KBD_LEDS; 03050 } else { 03051 /* 03052 * Do it immediately (avoids a small delay between keydown and LED 03053 * on when typing) 03054 */ 03055 PDEVICEINFO pDeviceInfo; 03056 03057 EnterDeviceInfoListCrit(); 03058 for (pDeviceInfo = gpDeviceInfoList; pDeviceInfo; pDeviceInfo = pDeviceInfo->pNext) { 03059 if ((pDeviceInfo->type == DEVICE_TYPE_KEYBOARD) && (pDeviceInfo->handle)) { 03060 ZwDeviceIoControlFile(pDeviceInfo->handle, NULL, NULL, NULL, 03061 &giosbKbdControl, IOCTL_KEYBOARD_SET_INDICATORS, 03062 (PVOID)&gklp, sizeof(gklp), NULL, 0); 03063 } 03064 } 03065 LeaveDeviceInfoListCrit(); 03066 } 03067 }

VOID UpdateLayeredSprite PDCE  pdce  ) 
 

Definition at line 141 of file sprite.c.

References _GetProp(), BEGINATOMICCHECK, ENDATOMICCHECK, FLayeredOrRedirected(), FWINABLE, GetLayeredWindow(), ghdcMem, gpDispInfo, tagDCE::hdc, tagDISPLAYINFO::hDev, NULL, PROP_LAYER, PtoHq, tagDCE::pwndOrg, tagWND::rcWindow, TestWF, TRUE, VOID(), WEF_ASYNC, WEFLAYERED, and xxxWindowEvent().

Referenced by _GetDCEx(), ReleaseCacheDC(), and xxxSystemTimerProc().

00142 { 00143 RECT rcBounds; 00144 PWND pwnd; 00145 SIZE size; 00146 POINT pt; 00147 HBITMAP hbm, hbmOld; 00148 00149 /* 00150 * Check to see if any drawing has been done into this DC 00151 * that should be transferred to the sprite. 00152 */ 00153 if (!GreGetBounds(pdce->hdc, &rcBounds, 0)) 00154 return; 00155 00156 pwnd = GetLayeredWindow(pdce->pwndOrg); 00157 00158 UserAssert(FLayeredOrRedirected(pwnd)); 00159 00160 if (TestWF(pwnd, WEFLAYERED)) { 00161 hbm = (HBITMAP)_GetProp(pwnd, PROP_LAYER, TRUE); 00162 00163 UserAssert(hbm != NULL); 00164 00165 hbmOld = GreSelectBitmap(ghdcMem, hbm); 00166 00167 size.cx = pwnd->rcWindow.right - pwnd->rcWindow.left; 00168 size.cy = pwnd->rcWindow.bottom - pwnd->rcWindow.top; 00169 00170 pt.x = pt.y = 0; 00171 GreUpdateSprite(gpDispInfo->hDev, PtoHq(pwnd), NULL, NULL, NULL, 00172 &size, ghdcMem, &pt, 0, NULL, ULW_DEFAULT_ATTRIBUTES, &rcBounds); 00173 00174 GreSelectBitmap(ghdcMem, hbmOld); 00175 } 00176 00177 #ifdef REDIRECTION 00178 if (FWINABLE()) { 00179 BEGINATOMICCHECK(); 00180 xxxWindowEvent(EVENT_SYSTEM_REDIRECTEDPAINT, pwnd, 00181 MAKELONG(rcBounds.left, rcBounds.top), 00182 MAKELONG(rcBounds.right, rcBounds.bottom), 00183 WEF_ASYNC); 00184 ENDATOMICCHECK(); 00185 } 00186 #endif // REDIRECTION 00187 }

void UpdateMouseInfo void   ) 
 

Definition at line 385 of file ntinput.c.

References CheckCritIn, DEVICE_TYPE_MOUSE, DEVICEINFO, EnterDeviceInfoListCrit(), gbRemoteSession, GDIAF_ARRIVED, GDIAF_RECONNECT, ghRemoteMouseChannel, gnMice, gpDeviceInfoList, LeaveDeviceInfoListCrit(), NULL, RequestDeviceChange(), and TRUE.

Referenced by xxxRemoteReconnect().

00386 { 00387 DEVICEINFO *pDeviceInfo; 00388 CheckCritIn(); // expect no surprises 00389 00390 UserAssert(gbRemoteSession); 00391 00392 if (ghRemoteMouseChannel == NULL) { 00393 return; 00394 } 00395 00396 UserAssert(gnMice == 1); 00397 00398 /* 00399 * Mark the mice and signal the RIT to do the work asynchronously 00400 */ 00401 EnterDeviceInfoListCrit(); 00402 for (pDeviceInfo = gpDeviceInfoList; pDeviceInfo; pDeviceInfo = pDeviceInfo->pNext) { 00403 if (pDeviceInfo->type == DEVICE_TYPE_MOUSE) { 00404 TAGMSG1(DBGTAG_PNP, "UpdateMouseInfo(): pDeviceInfo %#p ARRIVED", pDeviceInfo); 00405 RequestDeviceChange(pDeviceInfo, GDIAF_ARRIVED | GDIAF_RECONNECT, TRUE); 00406 } 00407 } 00408 LeaveDeviceInfoListCrit(); 00409 }

VOID UpdatePerUserKeyboardIndicators PUNICODE_STRING  pProfileUserName  ) 
 

Definition at line 256 of file keyboard.c.

References ClearAsyncKeyStateToggle, ClearKeyStateToggle, ClearRawKeyToggle, DWORD, FALSE, FastGetProfileIntW(), gbRemoteSession, gfKanaToggle, gklpBootTime, PMAP_KEYBOARD, tagTHREADINFO::pq, PtiCurrent, SetAsyncKeyStateToggle, SetKeyStateToggle, SetRawKeyToggle, UpdateKeyLights(), and wszInitialKeyboardIndicators.

Referenced by xxxUpdatePerUserSystemParameters().

00257 { 00258 DWORD dw; 00259 PQ pq; 00260 PTHREADINFO ptiCurrent = PtiCurrent(); 00261 pq = ptiCurrent->pq; 00262 00263 /* 00264 * For terminal server, the client is responsible for synchronizing the 00265 * keyboard state. 00266 */ 00267 if (gbRemoteSession) { 00268 return; 00269 } 00270 00271 /* 00272 * Initial Keyboard state (Num-Lock only) 00273 */ 00274 dw = FastGetProfileIntW(pProfileUserName, 00275 PMAP_KEYBOARD, 00276 wszInitialKeyboardIndicators, 00277 2); 00278 00279 dw &= 0x80000002; 00280 00281 00282 /* 00283 * The special value 0x80000000 in the registry indicates that the BIOS 00284 * settings are to be used as the initial LED state. (This is undocumented) 00285 */ 00286 if (dw == 0x80000000) { 00287 dw = gklpBootTime.LedFlags; 00288 } 00289 if (dw & 0x02) { 00290 SetKeyStateToggle(pq, VK_NUMLOCK); 00291 SetAsyncKeyStateToggle(VK_NUMLOCK); 00292 SetRawKeyToggle(VK_NUMLOCK); 00293 } else { 00294 ClearKeyStateToggle(pq, VK_NUMLOCK); 00295 ClearAsyncKeyStateToggle(VK_NUMLOCK); 00296 ClearRawKeyToggle(VK_NUMLOCK); 00297 } 00298 00299 /* 00300 * Initialize KANA Toggle status 00301 */ 00302 gfKanaToggle = FALSE; 00303 ClearKeyStateToggle(pq, VK_KANA); 00304 ClearAsyncKeyStateToggle(VK_KANA); 00305 ClearRawKeyToggle(VK_KANA); 00306 00307 UpdateKeyLights(FALSE); 00308 }

BOOL UpdateWinIniInt PUNICODE_STRING  pProfileUserName,
UINT  idSection,
UINT  wKeyNameId,
int  value
 

Definition at line 306 of file rare.c.

References BOOL, FastWriteProfileStringW(), hModuleWin, L, and ServerLoadString.

Referenced by SetWindowMetricInt(), xxxSetIMEShowStatus(), and xxxSystemParametersInfo().

00311 { 00312 WCHAR szTemp[40]; 00313 WCHAR szKeyName[40]; 00314 swprintf(szTemp, L"%d", value); 00315 00316 ServerLoadString(hModuleWin, 00317 wKeyNameId, 00318 szKeyName, 00319 sizeof(szKeyName) / sizeof(WCHAR)); 00320 00321 return FastWriteProfileStringW(pProfileUserName, 00322 idSection, 00323 szKeyName, 00324 szTemp); 00325 00326 00327 }

__inline PPROFILEVALUEINFO UPDWORDPointer UINT  uSetting  ) 
 

Definition at line 6940 of file userk.h.

06943 { 06944 if (pttwnd != NULL) {

__inline DWORD UPDWORDValue UINT  uSetting  ) 
 

Definition at line 7059 of file userk.h.

References guSFWLockCount.

Referenced by xxxSystemParametersInfo().

07059 { 07060 guSFWLockCount++; 07061 } 07062

ATOM UserAddAtom LPCWSTR  lpAtom,
BOOL  bPin
 

Definition at line 35 of file w32/ntuser/kernel/atom.c.

References IS_PTR, NT_SUCCESS, NTSTATUS(), RtlAddAtomToAtomTable(), RtlPinAtomInAtomTable(), Status, and UserAtomTableHandle.

Referenced by _SetCursorIconData(), GetHmodTableIndex(), InitOLEFormats(), InternalRegisterClassEx(), InternalSetClipboardData(), NtUserRegisterWindowMessage(), SetupClassAtoms(), and Win32UserInitialize().

00037 { 00038 NTSTATUS Status; 00039 ATOM atom; 00040 00041 UserAssert(IS_PTR(ccxlpAtom)); 00042 00043 /* 00044 * Rtl routines protect accesses to strings with their 00045 * own try/except blocks. 00046 */ 00047 atom = 0; 00048 Status = RtlAddAtomToAtomTable( UserAtomTableHandle, 00049 (PWSTR)ccxlpAtom, 00050 &atom 00051 ); 00052 if (!NT_SUCCESS(Status)) { 00053 RIPNTERR0(Status, RIP_VERBOSE, "UserAddAtom: add failed"); 00054 } 00055 00056 if (atom && bPin) 00057 RtlPinAtomInAtomTable(UserAtomTableHandle,atom); 00058 00059 return atom; 00060 }

BOOL UserBeep DWORD  dwFreq,
DWORD  dwDuration
 

Definition at line 102 of file base.c.

References _UserSoundSentryWorker(), BOOL, CheckCritOut, DWORD, EnterCrit, FALSE, gbRemoteSession, gpRemoteBeepDevice, KeDelayExecutionThread(), KernelMode, L, LeaveCrit, NT_SUCCESS, NTSTATUS(), NULL, ObjectAttributes, ObOpenObjectByPointer(), RtlInitUnicodeString(), Status, TRUE, UserMode, and ZwCreateFile().

Referenced by DownSiren(), HighBeep(), KeyClick(), LowBeep(), ProcessKeyboardInput(), QueueMouseEvent(), UpSiren(), and xxxOldMessageBeep().

00105 { 00106 OBJECT_ATTRIBUTES ObjectAttributes; 00107 UNICODE_STRING NameString; 00108 NTSTATUS Status; 00109 IO_STATUS_BLOCK IoStatus; 00110 BEEP_SET_PARAMETERS BeepParameters; 00111 HANDLE hBeepDevice; 00112 LARGE_INTEGER TimeOut; 00113 00114 CheckCritOut(); 00115 00116 if (gbRemoteSession) { 00117 if (gpRemoteBeepDevice == NULL) 00118 Status = STATUS_UNSUCCESSFUL; 00119 else 00120 Status = ObOpenObjectByPointer( 00121 gpRemoteBeepDevice, 00122 0, 00123 NULL, 00124 EVENT_ALL_ACCESS, 00125 NULL, 00126 KernelMode, 00127 &hBeepDevice); 00128 } else { 00129 00130 RtlInitUnicodeString(&NameString, DD_BEEP_DEVICE_NAME_U); 00131 00132 InitializeObjectAttributes(&ObjectAttributes, 00133 &NameString, 00134 0, 00135 NULL, 00136 NULL); 00137 00138 Status = ZwCreateFile(&hBeepDevice, 00139 FILE_READ_DATA | FILE_WRITE_DATA, 00140 &ObjectAttributes, 00141 &IoStatus, 00142 NULL, 00143 0, 00144 FILE_SHARE_READ | FILE_SHARE_WRITE, 00145 FILE_OPEN_IF, 00146 0, 00147 (PVOID) NULL, 00148 0L); 00149 } 00150 00151 if (!NT_SUCCESS(Status)) { 00152 return FALSE; 00153 } 00154 00155 /* 00156 * 0,0 is a special case used to turn off a beep. Otherwise 00157 * validate the dwFreq parameter to be in range. 00158 */ 00159 if ((dwFreq != 0 || dwDuration != 0) && 00160 (dwFreq < (ULONG)0x25 || dwFreq > (ULONG)0x7FFF)) { 00161 00162 Status = STATUS_INVALID_PARAMETER; 00163 } else { 00164 BeepParameters.Frequency = dwFreq; 00165 BeepParameters.Duration = dwDuration; 00166 00167 Status = ZwDeviceIoControlFile(hBeepDevice, 00168 NULL, 00169 NULL, 00170 NULL, 00171 &IoStatus, 00172 IOCTL_BEEP_SET, 00173 &BeepParameters, 00174 sizeof(BeepParameters), 00175 NULL, 00176 0); 00177 } 00178 00179 EnterCrit(); 00180 _UserSoundSentryWorker(); 00181 LeaveCrit(); 00182 00183 if (!NT_SUCCESS(Status)) { 00184 ZwClose(hBeepDevice); 00185 return FALSE; 00186 } 00187 00188 /* 00189 * Beep device is asynchronous, so sleep for duration 00190 * to allow this beep to complete. 00191 */ 00192 if (dwDuration != (DWORD)-1 && (dwFreq != 0 || dwDuration != 0)) { 00193 TimeOut.QuadPart = Int32x32To64( dwDuration, -10000); 00194 00195 do { 00196 Status = KeDelayExecutionThread(UserMode, FALSE, &TimeOut); 00197 } 00198 while (Status == STATUS_ALERTED); 00199 } 00200 ZwClose(hBeepDevice); 00201 return TRUE; 00202 }

NTSTATUS UserCommitDesktopMemory PVOID  pBase,
PVOID *  ppCommit,
PSIZE_T  pCommitSize
 

Definition at line 15 of file w32/ntuser/kernel/heap.c.

References CommitReadOnlyMemory(), DWORD, GetDesktopView(), grpWinStaList, tagDESKTOP::hsectionDesktop, IS_SYSTEM_THREAD, MapDesktop(), NT_SUCCESS, NTSTATUS(), NULL, ObOpenHandle, PBYTE, tagDESKTOPVIEW::pdesk, tagDESKTOP::pDeskInfo, tagDESKTOPVIEW::pdvNext, PpiCurrent, PsGetCurrentProcess, PsGetCurrentThread, tagDESKTOPINFO::pvDesktopBase, tagWINDOWSTATION::rpdeskList, tagDESKTOP::rpdeskNext, tagWINDOWSTATION::rpwinstaNext, Status, TRUE, and tagDESKTOPVIEW::ulClientDelta.

Referenced by CreateDesktopHeap().

00019 { 00020 PDESKTOPVIEW pdv; 00021 DWORD dwCommitOffset; 00022 PWINDOWSTATION pwinsta; 00023 PDESKTOP pdesk; 00024 PBYTE pUserBase; 00025 int dCommit; 00026 NTSTATUS Status; 00027 ETHREAD *Thread = PsGetCurrentThread(); 00028 00029 /* 00030 * If this is a system thread, we have no view of the desktop 00031 * and must map it in. Fortunately, this does not happen often. 00032 * 00033 * We use the Thread variable because IS_SYSTEM_THREAD is a macro 00034 * that multiply resolves the parameter. 00035 */ 00036 if (IS_SYSTEM_THREAD(Thread)) { 00037 00038 /* 00039 * Find the desktop that owns the section. 00040 */ 00041 for (pwinsta = grpWinStaList; pwinsta; pwinsta = pwinsta->rpwinstaNext) { 00042 for (pdesk = pwinsta->rpdeskList; pdesk; pdesk = pdesk->rpdeskNext) { 00043 if (pdesk->pDeskInfo->pvDesktopBase == pBase) 00044 goto FoundIt; 00045 } 00046 } 00047 FoundIt: 00048 if (pwinsta == NULL) { 00049 RIPMSG3(RIP_ERROR, "UserCommitDesktopMemory failed: pBase %#p, ppCommit %#p, pCommitSize %d", 00050 pBase, ppCommit, *pCommitSize); 00051 return STATUS_NO_MEMORY; 00052 } 00053 00054 /* 00055 * Map the section into the current process and commit the 00056 * first page of the section. 00057 */ 00058 dwCommitOffset = (ULONG)((PBYTE)*ppCommit - (PBYTE)pBase); 00059 Status = CommitReadOnlyMemory(pdesk->hsectionDesktop, pCommitSize, 00060 dwCommitOffset, &dCommit); 00061 if (NT_SUCCESS(Status)) { 00062 *ppCommit = (PBYTE)*ppCommit + dCommit; 00063 } 00064 } else { 00065 00066 /* 00067 * Find the current process' view of the desktop 00068 */ 00069 for (pdv = PpiCurrent()->pdvList; pdv != NULL; pdv = pdv->pdvNext) { 00070 if (pdv->pdesk->pDeskInfo->pvDesktopBase == pBase) 00071 break; 00072 } 00073 00074 /* 00075 * 254954: If we didn't find a desktop view then map the desktop view 00076 * to the current process. 00077 */ 00078 if (pdv == NULL) { 00079 /* 00080 * Find the desktop that owns the section. 00081 */ 00082 for (pwinsta = grpWinStaList; pwinsta; pwinsta = pwinsta->rpwinstaNext) { 00083 for (pdesk = pwinsta->rpdeskList; pdesk; pdesk = pdesk->rpdeskNext) { 00084 if (pdesk->pDeskInfo->pvDesktopBase == pBase) 00085 goto FoundTheDesktop; 00086 } 00087 } 00088 00089 FoundTheDesktop: 00090 if (pwinsta == NULL) { 00091 RIPMSG3(RIP_ERROR, "UserCommitDesktopMemory failed: pBase %#p, ppCommit %#p, pCommitSize %d", 00092 pBase, ppCommit, *pCommitSize); 00093 return STATUS_NO_MEMORY; 00094 } 00095 00096 UserAssert(pdesk != NULL); 00097 00098 /* 00099 * Map the desktop into the current process 00100 */ 00101 try { 00102 MapDesktop(ObOpenHandle, PsGetCurrentProcess(), pdesk, 0, 1); 00103 } except (W32ExceptionHandler(TRUE, RIP_WARNING)) { 00104 00105 RIPMSG2(RIP_WARNING, "UserCommitDesktopMemory: Could't map pdesk %#p in ppi %#p", 00106 pdesk, PpiCurrent()); 00107 return STATUS_NO_MEMORY; 00108 } 00109 00110 pdv = GetDesktopView(PpiCurrent(), pdesk); 00111 } 00112 00113 UserAssert(pdv != NULL); 00114 00115 /* 00116 * Commit the memory 00117 */ 00118 pUserBase = (PVOID)((PBYTE)*ppCommit - pdv->ulClientDelta); 00119 Status = ZwAllocateVirtualMemory(NtCurrentProcess(), 00120 &pUserBase, 00121 0, 00122 pCommitSize, 00123 MEM_COMMIT, 00124 PAGE_EXECUTE_READ 00125 ); 00126 if (NT_SUCCESS(Status)) 00127 *ppCommit = (PVOID)((PBYTE)pUserBase + pdv->ulClientDelta); 00128 } 00129 00130 return Status; 00131 }

NTSTATUS UserCommitSharedMemory PVOID  pBase,
PVOID *  ppCommit,
PSIZE_T  pCommitSize
 

Definition at line 133 of file w32/ntuser/kernel/heap.c.

References CommitReadOnlyMemory(), DWORD, ghSectionShared, gpvSharedAlloc, gpvSharedBase, NT_SUCCESS, NTSTATUS(), NULL, PBYTE, PpiCurrent, PsGetCurrentProcess, Status, ValidateProcessSessionId, and _EPROCESS::Win32Process.

Referenced by InitCreateSharedSection().

00137 { 00138 ULONG_PTR ulClientDelta; 00139 DWORD dwCommitOffset; 00140 PBYTE pUserBase; 00141 NTSTATUS Status; 00142 PEPROCESS Process; 00143 int dCommit; 00144 00145 #if DBG 00146 if (pBase != Win32HeapGetHandle(gpvSharedAlloc)) { 00147 RIPMSG0(RIP_WARNING, "pBase != gpvSharedAlloc"); 00148 } 00149 #else 00150 UNREFERENCED_PARAMETER(pBase); 00151 #endif 00152 00153 Process = PsGetCurrentProcess(); 00154 00155 ValidateProcessSessionId(Process); 00156 00157 if (Process->Win32Process == NULL || 00158 ((PPROCESSINFO)Process->Win32Process)->pClientBase == NULL) { 00159 00160 dwCommitOffset = (ULONG)((PBYTE)*ppCommit - (PBYTE)gpvSharedBase); 00161 Status = CommitReadOnlyMemory( 00162 ghSectionShared, pCommitSize, dwCommitOffset, &dCommit); 00163 00164 if (NT_SUCCESS(Status)) { 00165 *ppCommit = (PBYTE) *ppCommit + dCommit; 00166 } 00167 } else { 00168 00169 /* 00170 * Commit the memory 00171 */ 00172 ulClientDelta = (ULONG_PTR)((PBYTE)gpvSharedBase - (PBYTE)(PpiCurrent()->pClientBase)); 00173 pUserBase = (PVOID)((PBYTE)*ppCommit - ulClientDelta); 00174 Status = ZwAllocateVirtualMemory( 00175 NtCurrentProcess(), 00176 &pUserBase, 00177 0, 00178 pCommitSize, 00179 MEM_COMMIT, 00180 PAGE_EXECUTE_READ); 00181 if (NT_SUCCESS(Status)) { 00182 *ppCommit = (PVOID)((PBYTE)pUserBase + ulClientDelta); 00183 } 00184 } 00185 00186 return Status; 00187 }

PWIN32HEAP UserCreateHeap HANDLE  hSection,
ULONG  ulViewOffset,
PVOID  pvBaseAddress,