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

user.h

Go to the documentation of this file.
00001 /*++ build version: 0002 // increment this if a change has global effects 00002 00003 /****************************** Module Header ******************************\ 00004 * Module Name: user.h 00005 * 00006 * Copyright (c) 1985 - 1999, Microsoft Corporation 00007 * 00008 * This header file contains stuff shared by all the modules of the USER.DLL. 00009 * 00010 * History: 00011 * 09-18-90 DarrinM Created. 00012 * 04-27-91 DarrinM Merged in USERCALL.H, removed some dead wood. 00013 \***************************************************************************/ 00014 00015 #ifndef _USER_ 00016 #define _USER_ 00017 00018 /******************************WOW64***NOTE********************************\ 00019 * Note: Win32k Memory shared with User-Mode and Wow64 00020 * 00021 * For Wow64 (Win32 apps on Win64) we build a 32-bit version 00022 * of user32.dll & gdi32.dll which can run against the 64-bit kernel 00023 * with no changes to the 64-bit kernel code. 00024 * 00025 * For the 32 on 64 bit dlls all data structures which are shared with 00026 * win32k must be 64-bit. These data structures include the shared 00027 * sections, as well as members of the TEB. 00028 * These shared data structures are now declared so that they can be 00029 * built as 32 bit in a 32 bit dll, 64 bit in a 64 bit dll, and now 00030 * 64 bit in a 32 bit dll. 00031 * 00032 * The following rules should be followed when declaring 00033 * shared data structures: 00034 * 00035 * Pointers in shared data structures use the KPTR_MODIFIER in their 00036 * declaration. 00037 * 00038 * Handles in shared data structures are declared KHxxx. 00039 * 00040 * xxx_PTR changes to KERNEL_xxx_PTR. 00041 * 00042 * Pointers to basic types are declared as KPxxx; 00043 * 00044 * Also on Wow64 every thread has both a 32-bit TEB and a 64-bit TEB. 00045 * GetCurrentTeb() returns the current 32-bit TEB while the kernel 00046 * will allways reference the 64-bit TEB. 00047 * 00048 * All client side references to shared data in the TEB should use 00049 * the new GetCurrentTebShared() macro which returns the 64-bit TEB 00050 * for Wow64 builds and returns GetCurrentTeb() for regular builds. 00051 * The exception to this rule is LastErrorValue, which should allways 00052 * be referenced through GetCurrentTeb(). 00053 * 00054 * Ex: 00055 * 00056 * DECLARE_HANDLE(HFOO); 00057 * 00058 * typedef struct _MY_STRUCT *PMPTR; 00059 * 00060 * struct _SHARED_STRUCT 00061 * { 00062 * struct _SHARED_STRUCT * pNext; 00063 * PMPTR pmptr; 00064 * HFOO hFoo; 00065 * UINT_PTR cb; 00066 * PBYTE pb; 00067 * PVOID pv; 00068 * 00069 * DWORD dw; 00070 * USHORT us; 00071 * } SHARED_STRUCT; 00072 * 00073 * 00074 * Changes to: 00075 * 00076 * 00077 * DECLARE_HANDLE(HFOO); 00078 * DECLARE_KHANDLE(HFOO); 00079 * 00080 * typedef struct _MY_STRUCT * KPTR_MODIFIER PMPTR; 00081 * 00082 * struct _SHARED_STRUCT 00083 * { 00084 * struct _SHARED_STRUCT * KPTR_MODIFIER pNext; 00085 * PMPTR pmptr; 00086 * KHFOO hFoo; 00087 * KERNEL_UINT_PTR cb; 00088 * KPBYTE pb; 00089 * KERNEL_PVOID pv; 00090 * 00091 * DWORD dw; 00092 * USHORT us; 00093 * } SHARED_STRUCT; 00094 * 00095 \***************************************************************************/ 00096 #include "w32wow64.h" 00097 00098 DECLARE_KHANDLE(HIMC); 00099 00100 /* 00101 * Enable warnings that are turned off default for NT but we want on 00102 */ 00103 #ifndef RC_INVOKED // RC can't handle #pragmas 00104 #pragma warning(error:4100) // Unreferenced formal parameter 00105 #pragma warning(error:4101) // Unreferenced local variable 00106 // #pragma warning(error:4702) // Unreachable code 00107 #pragma warning(error:4705) // Statement has no effect 00108 #endif // RC_INVOKED 00109 00110 #if !defined(FASTCALL) 00111 #if defined(_X86_) 00112 #define FASTCALL _fastcall 00113 #else // defined(_X86_) 00114 #define FASTCALL 00115 #endif // defined(_X86_) 00116 #endif // !defined(FASTCALL) 00117 00118 #ifdef UNICODE 00119 #define UTCHAR WCHAR 00120 #else // UINCODE 00121 #define UTCHAR UCHAR 00122 #endif // UINCODE 00123 00124 /* 00125 * These types are needed before they are fully defined. 00126 */ 00127 typedef struct tagWINDOWSTATION * KPTR_MODIFIER PWINDOWSTATION; 00128 typedef struct _LOCKRECORD * KPTR_MODIFIER PLR; 00129 typedef struct _TL * KPTR_MODIFIER PTL; 00130 typedef struct tagDESKTOP * KPTR_MODIFIER PDESKTOP; 00131 typedef struct tagTDB * KPTR_MODIFIER PTDB; 00132 typedef struct tagSVR_INSTANCE_INFO *PSVR_INSTANCE_INFO; 00133 typedef struct _MOVESIZEDATA *PMOVESIZEDATA; 00134 typedef struct tagCURSOR * KPTR_MODIFIER PCURSOR; 00135 typedef struct tagPOPUPMENU * KPTR_MODIFIER PPOPUPMENU; 00136 typedef struct tagQMSG * KPTR_MODIFIER PQMSG; 00137 typedef struct tagWND * KPTR_MODIFIER PWND; 00138 typedef struct _ETHREAD *PETHREAD; 00139 typedef struct tagDESKTOPINFO * KPTR_MODIFIER PDESKTOPINFO; 00140 typedef struct tagDISPLAYINFO * KPTR_MODIFIER PDISPLAYINFO; 00141 typedef struct tagCLIENTTHREADINFO * KPTR_MODIFIER PCLIENTTHREADINFO; 00142 typedef struct tagDCE * KPTR_MODIFIER PDCE; 00143 typedef struct tagSPB * KPTR_MODIFIER PSPB; 00144 typedef struct tagQ * KPTR_MODIFIER PQ; 00145 typedef struct tagTHREADINFO * KPTR_MODIFIER PTHREADINFO; 00146 typedef struct tagPROCESSINFO * KPTR_MODIFIER PPROCESSINFO; 00147 typedef struct tagWOWTHREADINFO *PWOWTHREADINFO; 00148 typedef struct tagPERUSERDATA *PPERUSERDATA; 00149 typedef struct tagPERUSERSERVERINFO *PPERUSERSERVERINFO; 00150 typedef struct tagTERMINAL *PTERMINAL; 00151 typedef struct _CLIENTINFO *PCLIENTINFO; 00152 typedef struct tagMENU * KPTR_MODIFIER PMENU; 00153 typedef struct tagHOOK * KPTR_MODIFIER PHOOK; 00154 typedef struct _HANDLEENTRY * KPTR_MODIFIER PHE; 00155 typedef struct tagSERVERINFO * KPTR_MODIFIER PSERVERINFO; 00156 typedef struct _CALLPROCDATA * KPTR_MODIFIER PCALLPROCDATA; 00157 typedef struct tagCLS * KPTR_MODIFIER PCLS; 00158 typedef struct tagMONITOR * KPTR_MODIFIER PMONITOR; 00159 DECLARE_HANDLE(HQ); 00160 00161 /* 00162 * This name is used both in kernel\server.c and ntuser\server\exitwin.c 00163 */ 00164 #define ICON_PROP_NAME L"SysIC" 00165 00166 /* 00167 * Define DbgPrint to be something bogus on free builds so we won't 00168 * include it accidentally. 00169 */ 00170 #if DBG 00171 #else 00172 #define DbgPrint UserDbgPrint 00173 #endif 00174 00175 typedef struct tagMBSTRING 00176 { 00177 WCHAR szName[15]; 00178 UINT uID; 00179 UINT uStr; 00180 } MBSTRING; 00181 00182 /* 00183 * SIZERECT is a rectangle represented by a top-left coordinate, width, 00184 * and height. 00185 * 00186 * Hungarian is "src". 00187 */ 00188 typedef struct tagSIZERECT { 00189 int x; 00190 int y; 00191 int cx; 00192 int cy; 00193 } SIZERECT, *PSIZERECT, *LPSIZERECT; 00194 00195 typedef const SIZERECT * PCSIZERECT; 00196 typedef const SIZERECT * LPCSIZERECT; 00197 00198 00199 void RECTFromSIZERECT(PRECT prc, PCSIZERECT psrc); 00200 void SIZERECTFromRECT(PSIZERECT psrc, LPCRECT prc); 00201 00202 /* 00203 * Use these macros to unpack things packed by MAKELPARAM. 00204 */ 00205 00206 #define LOSHORT(l) ((short)LOWORD(l)) 00207 #define HISHORT(l) ((short)HIWORD(l)) 00208 00209 #ifndef GET_X_LPARAM 00210 #define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp)) 00211 #endif 00212 00213 #ifndef GET_Y_LPARAM 00214 #define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp)) 00215 #endif 00216 00217 #ifdef _USERK_ 00218 #define GetClientInfo() (((PTHREADINFO)(W32GetCurrentThread()))->pClientInfo) 00219 #else 00220 // We don't grab it this way in the kernel in case it is a kernel only thread 00221 #define GetClientInfo() ((PCLIENTINFO)((NtCurrentTebShared())->Win32ClientInfo)) 00222 #endif 00223 00224 /* Used by xxxSleepTask */ 00225 #define HEVENT_REMOVEME ((HANDLE)IntToPtr( 0xFFFFFFFF )) 00226 00227 00228 /* 00229 * Access to system metrics, colors, and brushes. 00230 */ 00231 #define SYSMET(i) ((int)gpsi->aiSysMet[SM_##i]) 00232 #define SYSMETRTL(i) ((int)gpsi->aiSysMet[SM_##i]) 00233 #define SYSRGB(i) gpsi->argbSystem[COLOR_##i] 00234 #define SYSRGBRTL(i) gpsi->argbSystem[COLOR_##i] 00235 #define SYSHBR(i) gpsi->ahbrSystem[COLOR_##i] 00236 #define SYSHBRUSH(i) gpsi->ahbrSystem[i] 00237 00238 #ifdef _USERK_ 00239 #define SYSMETFROMPROCESS(i) gpsi->aiSysMet[SM_##i] 00240 #endif 00241 00242 /***************************************************************************\ 00243 * These cool constants can be used to specify rops 00244 \***************************************************************************/ 00245 00246 #define DESTINATION (DWORD)0x00AA0000 00247 #define SOURCE (DWORD)0x00CC0000 00248 #define PATTERN (DWORD)0x00F00000 00249 00250 /************************** 00251 * Chicago equates 00252 ***************************/ 00253 #define BI_CHECKBOX 0 00254 #define BI_RADIOBUTTON 1 00255 #define BI_3STATE 2 00256 00257 #define NUM_BUTTON_TYPES 3 00258 #define NUM_BUTTON_STATES 4 00259 00260 /* 00261 * Total number of strings used as button strings in MessageBoxes 00262 */ 00263 #define MAX_MB_STRINGS 11 00264 00265 00266 /* 00267 * Rectangle macros. Inlining these is both faster and smaller 00268 */ 00269 #define CopyRect CopyRectInl 00270 #define EqualRect EqualRectInl 00271 #define SetRectEmpty SetRectEmptyInl 00272 00273 __inline void 00274 CopyRectInl(LPRECT prcDest, LPCRECT prcSrc) 00275 { 00276 *prcDest = *prcSrc; 00277 } 00278 00279 __inline DWORD 00280 EqualRectInl(LPCRECT prc1, LPCRECT prc2) 00281 { 00282 return RtlEqualMemory(prc1, prc2, sizeof(*prc1)); 00283 } 00284 00285 __inline void 00286 SetRectEmptyInl(LPRECT prc) 00287 { 00288 RtlZeroMemory(prc, sizeof(*prc)); 00289 } 00290 00291 /***************************************************************************\ 00292 * ANSI/Unicode function names 00293 * 00294 * For non-API Client/Server stubs, an "A" or "W" suffix must be added. 00295 * (API function names are generated by running wcshdr.exe over winuser.x) 00296 * 00297 \***************************************************************************/ 00298 #ifdef UNICODE 00299 #define TEXT_FN(fn) fn##W 00300 #else // UNICODE 00301 #define TEXT_FN(fn) fn##A 00302 #endif // UNICODE 00303 00304 #ifdef UNICODE 00305 #define BYTESTOCHARS(cb) ((cb) / sizeof(TCHAR)) 00306 #define CHARSTOBYTES(cch) ((cch) * sizeof(TCHAR)) 00307 #else // UNICODE 00308 #define BYTESTOCHARS(cb) (cb) 00309 #define CHARSTOBYTES(cch) (cch) 00310 #endif // UNICODE 00311 00312 /* 00313 * Internal window class names 00314 */ 00315 #define DESKTOPCLASS MAKEINTATOM(0x8001) 00316 #define DIALOGCLASS MAKEINTATOM(0x8002) 00317 #define SWITCHWNDCLASS MAKEINTATOM(0x8003) 00318 #define ICONTITLECLASS MAKEINTATOM(0x8004) 00319 #define INFOCLASS MAKEINTATOM(0x8005) 00320 #define TOOLTIPCLASS MAKEINTATOM(0x8006) 00321 #define GHOSTCLASS MAKEINTATOM(0x8007) 00322 #define MENUCLASS MAKEINTATOM(0x8000) /* Public Knowledge */ 00323 00324 // 00325 // System timer IDs 00326 // 00327 #define IDSYS_LAYER 0x0000FFF5L 00328 #define IDSYS_FADE 0x0000FFF6L 00329 #define IDSYS_WNDTRACKING 0x0000FFF7L 00330 #define IDSYS_FLASHWND 0x0000FFF8L 00331 #define IDSYS_MNAUTODISMISS 0x0000FFF9L 00332 #define IDSYS_MOUSEHOVER 0x0000FFFAL 00333 #define IDSYS_MNANIMATE 0x0000FFFBL 00334 #define IDSYS_MNDOWN MFMWFP_DOWNARROW /* 0xFFFFFFFC */ 00335 #define IDSYS_LBSEARCH 0x0000FFFCL 00336 #define IDSYS_MNUP MFMWFP_UPARROW /* 0xFFFFFFFD */ 00337 #define IDSYS_STANIMATE 0x0000FFFDL 00338 #define IDSYS_MNSHOW 0x0000FFFEL 00339 #define IDSYS_SCROLL 0x0000FFFEL 00340 #define IDSYS_MNHIDE 0x0000FFFFL 00341 #define IDSYS_CARET 0x0000FFFFL 00342 00343 00344 /* 00345 * Special case string token codes. These must be the same as in the resource 00346 * compiler's RC.H file. 00347 */ 00348 /* 00349 * NOTE: Order is assumed and much be this way for applications to be 00350 * compatable with windows 2.0 00351 */ 00352 #define CODEBIT 0x80 00353 #define BUTTONCODE 0x80 00354 #define EDITCODE 0x81 00355 #define STATICCODE 0x82 00356 #define LISTBOXCODE 0x83 00357 #define SCROLLBARCODE 0x84 00358 #define COMBOBOXCODE 0x85 00359 #define MDICLIENTCODE 0x86 00360 #define COMBOLISTBOXCODE 0x87 00361 00362 /* 00363 * Internal window classes. These numbers serve as indices into the 00364 * atomSysClass table so that we can get the atoms for the various classes. 00365 * The order of the control classes (through COMBOLISTBOXCLASS) is assumed 00366 * to be the same as the class codes above. 00367 */ 00368 #define ICLS_BUTTON 0 00369 #define ICLS_EDIT 1 00370 #define ICLS_STATIC 2 00371 #define ICLS_LISTBOX 3 00372 #define ICLS_SCROLLBAR 4 00373 #define ICLS_COMBOBOX 5 // End of special dlgmgr indices 00374 00375 #define ICLS_MDICLIENT 6 00376 #define ICLS_COMBOLISTBOX 7 00377 #define ICLS_DDEMLEVENT 8 00378 #define ICLS_DDEMLMOTHER 9 00379 #define ICLS_DDEML16BIT 10 00380 #define ICLS_DDEMLCLIENTA 11 00381 #define ICLS_DDEMLCLIENTW 12 00382 #define ICLS_DDEMLSERVERA 13 00383 #define ICLS_DDEMLSERVERW 14 00384 #define ICLS_IME 15 00385 00386 #define ICLS_CTL_MAX 16 // Number of public control classes 00387 00388 00389 #define ICLS_DESKTOP 16 00390 #define ICLS_DIALOG 17 00391 #define ICLS_MENU 18 00392 #define ICLS_SWITCH 19 00393 #define ICLS_ICONTITLE 20 00394 #define ICLS_TOOLTIP 21 00395 #define ICLS_MAX 22 // Number of system classes 00396 00397 /* 00398 * Directory name for windowstations and desktops 00399 */ 00400 #define WINSTA_DIR L"\\Windows\\WindowStations" 00401 #define WINSTA_SESSION_DIR L"\\Sessions\\xxxxxxxxxxx\\Windows\\WindowStations" 00402 #define WINSTA_NAME L"Service-0x0000-0000$" 00403 #define MAX_SESSION_PATH 256 00404 #define SESSION_ROOT L"\\Sessions" 00405 00406 /***************************************************************************\ 00407 * Normal Stuff 00408 * 00409 * Nice normal typedefs, defines, prototypes, etc that everyone wants to share. 00410 * 00411 \***************************************************************************/ 00412 00413 /* 00414 * Define size limit of callback data. Below or equal to this limit, put data 00415 * on the client-side stack. Above this limit allocate virtual memory 00416 * for the data 00417 */ 00418 #define CALLBACKSTACKLIMIT (KERNEL_PAGE_SIZE / 2) 00419 00420 /* 00421 * Capture buffer definition for callbacks 00422 */ 00423 typedef struct _CAPTUREBUF { 00424 DWORD cbCallback; 00425 DWORD cbCapture; 00426 DWORD cCapturedPointers; 00427 PBYTE pbFree; 00428 DWORD offPointers; 00429 PVOID pvVirtualAddress; 00430 } CAPTUREBUF, *PCAPTUREBUF; 00431 00432 /* 00433 * Callback return status 00434 */ 00435 typedef struct _CALLBACKSTATUS { 00436 KERNEL_ULONG_PTR retval; 00437 DWORD cbOutput; 00438 KERNEL_PVOID pOutput; 00439 } CALLBACKSTATUS, *PCALLBACKSTATUS; 00440 00441 #define IS_PTR(p) ((((ULONG_PTR)(p)) & ~MAXUSHORT) != 0) 00442 #define PTR_TO_ID(p) ((USHORT)(((ULONG_PTR)(p)) & MAXUSHORT)) 00443 00444 // 00445 // Strings are counted 16-bit character strings. If they are 00446 // NULL terminated, Length does not include trailing NULL. 00447 // 00448 typedef struct _LARGE_STRING { 00449 ULONG Length; 00450 ULONG MaximumLength : 31; 00451 ULONG bAnsi : 1; 00452 KERNEL_PVOID Buffer; 00453 } LARGE_STRING, *PLARGE_STRING; 00454 00455 typedef struct _LARGE_ANSI_STRING { 00456 ULONG Length; 00457 ULONG MaximumLength : 31; 00458 ULONG bAnsi : 1; 00459 KPSTR Buffer; 00460 } LARGE_ANSI_STRING, *PLARGE_ANSI_STRING; 00461 00462 typedef struct _LARGE_UNICODE_STRING { 00463 ULONG Length; 00464 ULONG MaximumLength : 31; 00465 ULONG bAnsi : 1; 00466 KPWSTR Buffer; 00467 } LARGE_UNICODE_STRING, *PLARGE_UNICODE_STRING; 00468 00469 /* 00470 * String macros 00471 */ 00472 __inline BOOL IsEmptyString(PVOID p, ULONG bAnsi) 00473 { 00474 return (BOOL)!(bAnsi ? *(LPSTR)p : *(LPWSTR)p); 00475 } 00476 __inline void NullTerminateString(PVOID p, ULONG bAnsi) 00477 { 00478 if (bAnsi) *(LPSTR)p = (CHAR)0; else *(LPWSTR)p = (WCHAR)0; 00479 } 00480 __inline UINT StringLength(PVOID p, ULONG bAnsi) 00481 { 00482 return (bAnsi ? strlen((LPSTR)p) : wcslen((LPWSTR)p)); 00483 } 00484 00485 typedef struct _CTLCOLOR { 00486 COLORREF crText; 00487 COLORREF crBack; 00488 int iBkMode; 00489 } CTLCOLOR, *PCTLCOLOR; 00490 00491 00492 /* 00493 * This is used by the cool client side DrawIcon code 00494 */ 00495 typedef struct _DRAWICONEXDATA { 00496 HBITMAP hbmMask; 00497 HBITMAP hbmColor; 00498 int cx; 00499 int cy; 00500 } DRAWICONEXDATA; 00501 00502 /* 00503 * Static items stored in the TEB 00504 */ 00505 typedef struct _CALLBACKWND { 00506 KHWND hwnd; 00507 PWND pwnd; 00508 } CALLBACKWND, *PCALLBACKWND; 00509 00510 #define CVKKEYCACHE 32 00511 #define CBKEYCACHE (CVKKEYCACHE >> 2) 00512 00513 #define CVKASYNCKEYCACHE 32 00514 #define CBASYNCKEYCACHE (CVKASYNCKEYCACHE >> 2) 00515 00516 /* 00517 * The offset to cSpins must match WIN32_CLIENT_INFO_SPIN_COUNT defined 00518 * in ntpsapi.h. GDI uses this offset to reset the spin count. 00519 * WARNING! This struct cannot be made larger without changing the TEB struct: 00520 * It must fit in ULONG_PTR Win32ClientInfo[WIN32_CLIENT_INFO_LENGTH]; (ntpsapi.h) 00521 * (ifdef FE_SB, sizeof(CLIENTINFO) == 0x7c == 4 * WIN32_CLIENT_INFO_LENGTH) 00522 */ 00523 typedef struct _CLIENTINFO { 00524 KERNEL_ULONG_PTR CI_flags; // Needs to be first because CSR sets this 00525 KERNEL_ULONG_PTR cSpins; // GDI resets this 00526 DWORD dwExpWinVer; 00527 DWORD dwCompatFlags; 00528 DWORD dwCompatFlags2; 00529 DWORD dwTIFlags; 00530 PDESKTOPINFO pDeskInfo; 00531 KERNEL_ULONG_PTR ulClientDelta; 00532 PHOOK phkCurrent; 00533 DWORD fsHooks; 00534 CALLBACKWND CallbackWnd; 00535 DWORD dwHookCurrent; 00536 int cInDDEMLCallback; 00537 PCLIENTTHREADINFO pClientThreadInfo; 00538 KERNEL_ULONG_PTR dwHookData; 00539 DWORD dwKeyCache; 00540 BYTE afKeyState[CBKEYCACHE]; 00541 DWORD dwAsyncKeyCache; 00542 BYTE afAsyncKeyState[CBASYNCKEYCACHE]; 00543 BYTE afAsyncKeyStateRecentDown[CBASYNCKEYCACHE]; 00544 KHKL hKL; 00545 WORD CodePage; 00546 00547 BYTE achDbcsCF[2]; // Save ANSI DBCS LeadByte character code 00548 // in this field for ANSI to Unicode. 00549 // Uses SendMessageA/PostMessageA from CLIENT 00550 // to SERVER (index 0) 00551 // And... 00552 // Uses SendMessageA/DispatchMessageA 00553 // for CLIENT to CLIENT (index 1) 00554 KERNEL_MSG msgDbcsCB; // Save ANSI DBCS character message in 00555 // this field for convert Unicode to ANSI. 00556 // Uses GetMessageA/PeekMessageA from 00557 // SERVER to CLIENT 00558 #ifdef LATER 00559 EVENTMSG eventCached; // Cached Event for Journal Hook 00560 #endif 00561 } CLIENTINFO, *PCLIENTINFO; 00562 00563 00564 #define CI_IN_SYNC_TRANSACTION 0x00000001 00565 #define CI_PROCESSING_QUEUE 0x00000002 00566 #define CI_16BIT 0x00000004 00567 #define CI_INITIALIZED 0x00000008 00568 #define CI_INTERTHREAD_HOOK 0x00000010 00569 #define CI_REGISTERCLASSES 0x00000020 00570 #define CI_INPUTCONTEXT_REINIT 0x00000040 00571 00572 // 00573 // THREAD_CODEPAGE() 00574 // 00575 // Returns the CodePage based on the current keyboard layout. 00576 // 00577 #ifdef _USERK_ 00578 #define THREAD_CODEPAGE() (PtiCurrent()->pClientInfo->CodePage) 00579 #else // _USERK_ 00580 #define THREAD_CODEPAGE() (GetClientInfo()->CodePage) 00581 #endif // _USERK_ 00582 00583 // WMCR_IR_DBCSCHAR and DBCS Macros 00584 /* 00585 * Flags used for the WM_CHAR HIWORD of wParam for DBCS messaging. 00586 * (LOWORD of wParam will have character codepoint) 00587 */ 00588 #define WMCR_IR_DBCSCHAR 0x80000000 00589 /* 00590 * Macros to determine this is DBCS message or not. 00591 */ 00592 #define IS_DBCS_MESSAGE(DbcsChar) (((DWORD)(DbcsChar)) & 0x0000FF00) 00593 00594 /* 00595 * Macros for IR_DBCSCHAR format to/from regular format. 00596 */ 00597 #define MAKE_IR_DBCSCHAR(DbcsChar) \ 00598 (IS_DBCS_MESSAGE((DbcsChar)) ? \ 00599 (MAKEWPARAM(MAKEWORD(HIBYTE((DbcsChar)),LOBYTE((DbcsChar))),0)) : \ 00600 ((WPARAM)((DbcsChar) & 0x00FF)) \ 00601 ) 00602 00603 #define MAKE_WPARAM_DBCSCHAR(DbcsChar) \ 00604 (IS_DBCS_MESSAGE((DbcsChar)) ? \ 00605 (MAKEWPARAM(MAKEWORD(HIBYTE((DbcsChar)),LOBYTE((DbcsChar))),0)) : \ 00606 ((WPARAM)((DbcsChar) & 0x00FF)) \ 00607 ) 00608 00609 #define DBCS_CHARSIZE (2) 00610 00611 #define IS_DBCS_ENABLED() (TEST_SRVIF(SRVIF_DBCS)) 00612 #define _IS_IME_ENABLED() (TEST_SRVIF(SRVIF_IME)) 00613 #ifdef _IMMCLI_ 00614 #define IS_IME_ENABLED() (gpsi && _IS_IME_ENABLED()) 00615 #else // _IMMCLI_ 00616 #define IS_IME_ENABLED() _IS_IME_ENABLED() 00617 #endif // _IMMCLI_ 00618 00619 #define IS_DBCS_HKL() (IS_ANY_DBCS_CODEPAGE(THREAD_CODEPAGE())) 00620 #define IS_DBCS_INPUT() (IS_DBCS_ENABLED() || IS_DBCS_HKL()) 00621 00622 00623 #define CP_JAPANESE (932) 00624 #define CP_KOREAN (949) 00625 #define CP_CHINESE_SIMP (936) 00626 #define CP_CHINESE_TRAD (950) 00627 00628 #define IS_DBCS_CODEPAGE(wCodePage) \ 00629 ((wCodePage) == CP_JAPANESE || \ 00630 (wCodePage) == CP_KOREAN || \ 00631 (wCodePage) == CP_CHINESE_TRAD || \ 00632 (wCodePage) == CP_CHINESE_SIMP) 00633 00634 #define IS_DBCS_CHARSET(charset) \ 00635 ((charset) == SHIFTJIS_CHARSET || \ 00636 (charset) == HANGEUL_CHARSET || \ 00637 (charset) == CHINESEBIG5_CHARSET || \ 00638 (charset) == GB2312_CHARSET) 00639 00640 #define IS_JPN_1BYTE_KATAKANA(c) ((c) >= 0xa1 && (c) <= 0xdf) 00641 00642 00643 // IMM dynamic loading support 00644 #define IMM_MAGIC_CALLER_ID (0x19650412) 00645 00646 BOOL User32InitializeImmEntryTable(DWORD dwMagic); 00647 00648 #define IS_MIDEAST_ENABLED() (TEST_SRVIF(SRVIF_MIDEAST)) 00649 00650 /* 00651 * Flags used for the WM_CLIENTSHUTDOWN wParam. 00652 */ 00653 #define WMCS_EXIT 0x0001 00654 #define WMCS_QUERYEND 0x0002 00655 #define WMCS_SHUTDOWN 0x0004 00656 #define WMCS_CONTEXTLOGOFF 0x0008 00657 #define WMCS_ENDTASK 0x0010 00658 #define WMCS_CONSOLE 0x0020 00659 #define WMCS_NODLGIFHUNG 0x0040 00660 #define WMCS_NORETRY 0x0080 00661 #define WMCS_LOGOFF ENDSESSION_LOGOFF /* from winuser.w */ 00662 00663 /* 00664 * WM_CLIENTSHUTDOWN return value 00665 */ 00666 #define WMCSR_ALLOWSHUTDOWN 1 00667 #define WMCSR_DONE 2 00668 #define WMCSR_CANCEL 3 00669 00670 /* 00671 * We don't need 64-bit intermediate precision so we use this macro 00672 * instead of calling MulDiv. 00673 */ 00674 #define MultDiv(x, y, z) (((INT)(x) * (INT)(y) + (INT)(z) / 2) / (INT)(z)) 00675 00676 typedef DWORD ICH; 00677 typedef ICH *LPICH; 00678 00679 typedef struct _PROPSET { 00680 HANDLE hData; 00681 ATOM atom; 00682 } PROPSET, *PPROPSET; 00683 00684 /* 00685 * Old MENUHBM used to be here. They are now public for NT5 and defined 00686 * in winuser.w as HBMMENU_* 00687 */ 00688 00689 /* 00690 * Internal menu flags stored in pMenu->fFlags. 00691 * High order bits are used for public MNS_ flags defined in winuser.w 00692 */ 00693 #define MFISPOPUP 0x00000001 00694 #define MFMULTIROW 0x00000002 00695 #define MFUNDERLINE 0x00000004 00696 #define MFWINDOWDC 0x00000008 /* Window DC vs Client area DC when drawing*/ 00697 #define MFINACTIVE 0x00000010 00698 #define MFRTL 0x00000020 00699 #define MFDESKTOP 0x00000040 /* Set on the desktop menu AND its submenus */ 00700 #define MFSYSMENU 0x00000080 /* Set on desktop menu but NOT on its submenus */ 00701 #define MFAPPSYSMENU 0x00000100 /* Set on (sub)menu we return to the app via GetSystemMenu */ 00702 #define MFLAST 0x00000100 00703 00704 #if (MNS_LAST <= MFLAST) 00705 #error MNS_ AND MF defines conflict 00706 #endif // (MNS_LAST <= MFLAST) 00707 00708 // Event stuff -------------------------------------------- 00709 00710 typedef struct tagEVENT_PACKET { 00711 DWORD EventType; // == apropriate afCmd filter flag 00712 WORD fSense; // TRUE means flag on is passed. 00713 WORD cbEventData; // size of data starting at Data field. 00714 DWORD Data; // event specific data - must be last 00715 } EVENT_PACKET, *PEVENT_PACKET; 00716 00717 // Window long offsets in mother window (szDDEMLMOTHERCLASS) 00718 00719 #define GWLP_INSTANCE_INFO 0 // PCL_INSTANCE_INFO 00720 00721 00722 // Window long offsets in client window (szDDEMLCLIENTCLASS) 00723 00724 #define GWLP_PCI 0 00725 #define GWL_CONVCONTEXT GWLP_PCI + sizeof(PVOID) 00726 #define GWL_CONVSTATE GWL_CONVCONTEXT + sizeof(CONVCONTEXT) // See CLST_ flags 00727 #define GWLP_SHINST GWL_CONVSTATE + sizeof(LONG) 00728 #define GWLP_CHINST GWLP_SHINST + sizeof(HANDLE) 00729 00730 #define CLST_CONNECTED 0 00731 #define CLST_SINGLE_INITIALIZING 1 00732 #define CLST_MULT_INITIALIZING 2 00733 00734 // Window long offsets in server window (szDDEMLSERVERCLASS) 00735 00736 #define GWLP_PSI 0 00737 00738 // Window long offsets in event window (szDDEMLEVENTCLASS) 00739 00740 #define GWLP_PSII 0 00741 00742 00743 /* 00744 * DrawFrame defines 00745 */ 00746 #define DF_SHIFT0 0x0000 00747 #define DF_SHIFT1 0x0001 00748 #define DF_SHIFT2 0x0002 00749 #define DF_SHIFT3 0x0003 00750 #define DF_PATCOPY 0x0000 00751 #define DF_PATINVERT 0x0004 00752 #define DF_SHIFTMASK (DF_SHIFT0 | DF_SHIFT1 | DF_SHIFT2 | DF_SHIFT3) 00753 #define DF_ROPMASK (DF_PATCOPY | DF_PATINVERT) 00754 #define DF_HBRMASK ~(DF_SHIFTMASK | DF_ROPMASK) 00755 00756 #define DF_SCROLLBAR (COLOR_SCROLLBAR << 3) 00757 #define DF_BACKGROUND (COLOR_BACKGROUND << 3) 00758 #define DF_ACTIVECAPTION (COLOR_ACTIVECAPTION << 3) 00759 #define DF_INACTIVECAPTION (COLOR_INACTIVECAPTION << 3) 00760 #define DF_MENU (COLOR_MENU << 3) 00761 #define DF_WINDOW (COLOR_WINDOW << 3) 00762 #define DF_WINDOWFRAME (COLOR_WINDOWFRAME << 3) 00763 #define DF_MENUTEXT (COLOR_MENUTEXT << 3) 00764 #define DF_WINDOWTEXT (COLOR_WINDOWTEXT << 3) 00765 #define DF_CAPTIONTEXT (COLOR_CAPTIONTEXT << 3) 00766 #define DF_ACTIVEBORDER (COLOR_ACTIVEBORDER << 3) 00767 #define DF_INACTIVEBORDER (COLOR_INACTIVEBORDER << 3) 00768 #define DF_APPWORKSPACE (COLOR_APPWORKSPACE << 3) 00769 #define DF_3DSHADOW (COLOR_3DSHADOW << 3) 00770 #define DF_3DFACE (COLOR_3DFACE << 3) 00771 #define DF_GRAY (COLOR_MAX << 3) 00772 00773 00774 /* 00775 * CreateWindowEx internal flags for dwExStyle 00776 */ 00777 00778 #define WS_EX_MDICHILD 0x00000040L // Internal 00779 #define WS_EX_ANSICREATOR 0x80000000L // Internal 00780 00781 /* 00782 * These flags are used in the internal version of NtUserFindWindowEx 00783 */ 00784 #define FW_BOTH 0 00785 #define FW_16BIT 1 00786 #define FW_32BIT 2 00787 00788 /* 00789 * Calculate the size of a field in a structure of type type. 00790 */ 00791 #define FIELD_SIZE(type, field) (sizeof(((type *)0)->field)) 00792 00793 #define FLASTKEY 0x80 00794 00795 /* 00796 * Special types we've fabricated for special thunks. 00797 */ 00798 typedef struct { 00799 POINT point1; 00800 POINT point2; 00801 POINT point3; 00802 POINT point4; 00803 POINT point5; 00804 } POINT5, *LPPOINT5; 00805 00806 typedef struct { 00807 DWORD dwRecipients; 00808 DWORD dwFlags; 00809 } BROADCASTSYSTEMMSGPARAMS, *LPBROADCASTSYSTEMMSGPARAMS; 00810 /* 00811 * Server side address constants. When we want to call a server side proc, 00812 * we pass an index indentifying the function, rather than the server side 00813 * address itself. More robust. The functions between WNDPROCSTART/END 00814 * have client side sutbs which map to this routines. 00815 * 00816 * Adding a new FNID (This is just what I figured out...so fix it if wrong or incomplete) 00817 * -Decide what range it should be in: 00818 * FNID_WNDPROCSTART to FNID_WNDPROCEND: Server side proc with client 00819 * stub 00820 * FIND_CONTROLSTART to FNID_CONTROLEND: Client side controls with no 00821 * server side proc 00822 * After FNID_CONTROLEND: other, like server side only procs or client 00823 * side only.... 00824 * -Make sure to adjust FNID_*START and FNID_*END appropriately. 00825 * -If the ID is to be associated with a window class, and it is for all 00826 * windows of the class, make sure that the InternalRegisterClassEx call 00827 * receives the id as a parameter. 00828 * -If in FNID_WNDPROCSTART-END range, make the proper STOCID call in InitFunctionTables. 00829 * -Add proper FNID call in InitFunctionTables. 00830 * -If the class has a client side worker function (pcls->lpfnWorker) or you expect 00831 * apps to send messages to it or call its window proc directly, define 00832 * a message table in kernel\server.c and initialize it in InitMessageTables. 00833 * -If there is a client side for this proc, you probably need to add it to 00834 * PFNCLIENT. 00835 * -Add the debug-only text description of this FNID to in gapszFNID in globals.c 00836 * -See if you need to modify aiClassWow in client\client.c 00837 * -Modify the gaFNIDtoICLS table in kernel\ntstubs.c 00838 */ 00839 #define FNID_START 0x0000029A 00840 #define FNID_WNDPROCSTART 0x0000029A 00841 00842 #define FNID_SCROLLBAR 0x0000029A // xxxSBWndProc; 00843 #define FNID_ICONTITLE 0x0000029B // xxxDefWindowProc; 00844 #define FNID_MENU 0x0000029C // xxxMenuWindowProc; 00845 #define FNID_DESKTOP 0x0000029D // xxxDesktopWndProc; 00846 #define FNID_DEFWINDOWPROC 0x0000029E // xxxDefWindowProc; 00847 00848 #define FNID_WNDPROCEND 0x0000029E // see PatchThreadWindows 00849 #define FNID_CONTROLSTART 0x0000029F 00850 00851 #define FNID_BUTTON 0x0000029F // No server side proc 00852 #define FNID_COMBOBOX 0x000002A0 // No server side proc 00853 #define FNID_COMBOLISTBOX 0x000002A1 // No server side proc 00854 #define FNID_DIALOG 0x000002A2 // No server side proc 00855 #define FNID_EDIT 0x000002A3 // No server side proc 00856 #define FNID_LISTBOX 0x000002A4 // No server side proc 00857 #define FNID_MDICLIENT 0x000002A5 // No server side proc 00858 #define FNID_STATIC 0x000002A6 // No server side proc 00859 00860 #define FNID_IME 0x000002A7 // No server side proc 00861 #define FNID_CONTROLEND 0x000002A7 00862 00863 #define FNID_HKINLPCWPEXSTRUCT 0x000002A8 00864 #define FNID_HKINLPCWPRETEXSTRUCT 0x000002A9 00865 #define FNID_DEFFRAMEPROC 0x000002AA // No server side proc 00866 #define FNID_DEFMDICHILDPROC 0x000002AB // No server side proc 00867 #define FNID_MB_DLGPROC 0x000002AC // No server side proc 00868 #define FNID_MDIACTIVATEDLGPROC 0x000002AD // No server side proc 00869 #define FNID_SENDMESSAGE 0x000002AE 00870 00871 #define FNID_SENDMESSAGEFF 0x000002AF 00872 #define FNID_SENDMESSAGEEX 0x000002B0 00873 #define FNID_CALLWINDOWPROC 0x000002B1 00874 #define FNID_SENDMESSAGEBSM 0x000002B2 00875 #define FNID_SWITCH 0x000002B3 // Just used by GetTopMostInserAfter 00876 #define FNID_TOOLTIP 0x000002B4 00877 #define FNID_END 0x000002B4 00878 00879 /* 00880 * The size of the server side function table is defined as a power of two 00881 * so a simple "and" operation can be used to determine if a function index 00882 * is legal or not. Unused entries in the table are fill with a routine that 00883 * catches invalid functions that have indices within range, but are not 00884 * implemented. 00885 */ 00886 00887 #define FNID_ARRAY_SIZE 32 00888 00889 #if (FNID_END - FNID_START + 1) > FNID_ARRAY_SIZE 00890 #error"The size of the function array is greater than the allocated storage" 00891 #endif // (FNID_END - FNID_START + 1) > FNID_ARRAY_SIZE 00892 00893 #define FNID_DDE_BIT 0x00002000 // Used by RegisterClassExWOW 00894 #define FNID_CLEANEDUP_BIT 0x00004000 00895 #define FNID_DELETED_BIT 0x00008000 00896 #define FNID_STATUS_BITS (FNID_CLEANEDUP_BIT | FNID_DELETED_BIT) 00897 00898 #define FNID(s) (gpsi->mpFnidPfn[((DWORD)(s) - FNID_START) & (FNID_ARRAY_SIZE - 1)]) 00899 #define STOCID(s) (gpsi->aStoCidPfn[(DWORD)((s) & ~FNID_STATUS_BITS) - FNID_START]) 00900 #define CBFNID(s) (gpsi->mpFnid_serverCBWndProc[(DWORD)((s) & ~FNID_STATUS_BITS) - FNID_START]) 00901 #define GETFNID(pwnd) ((pwnd)->fnid & ~FNID_STATUS_BITS) 00902 00903 #ifndef BUILD_WOW6432 00904 typedef LRESULT (APIENTRY * WNDPROC_PWND)(PWND, UINT, WPARAM, LPARAM); 00905 typedef LRESULT (APIENTRY * WNDPROC_PWNDEX)(PWND, UINT, WPARAM, LPARAM, ULONG_PTR); 00906 #else 00907 typedef KERNEL_PVOID WNDPROC_PWND; 00908 typedef KERNEL_PVOID WNDPROC_PWNDEX; 00909 #endif 00910 typedef BOOL (APIENTRY * WNDENUMPROC_PWND)(PWND, LPARAM); 00911 typedef VOID (APIENTRY * TIMERPROC_PWND)(PWND, UINT, UINT_PTR, LPARAM); 00912 00913 /* 00914 * Structure passed by client during process initialization that holds some 00915 * client-side callback addresses. 00916 */ 00917 typedef struct _PFNCLIENT { 00918 KPROC pfnScrollBarWndProc; // and must be paired Unicode then ANSI 00919 KPROC pfnTitleWndProc; 00920 KPROC pfnMenuWndProc; 00921 KPROC pfnDesktopWndProc; 00922 KPROC pfnDefWindowProc; 00923 00924 // Below not in FNID_WNDPROCSTART FNID_WNDPROCEND range 00925 00926 KPROC pfnButtonWndProc; 00927 KPROC pfnComboBoxWndProc; 00928 KPROC pfnComboListBoxProc; 00929 KPROC pfnDialogWndProc; 00930 KPROC pfnEditWndProc; 00931 KPROC pfnListBoxWndProc; 00932 KPROC pfnMDIClientWndProc; 00933 KPROC pfnStaticWndProc; 00934 KPROC pfnImeWndProc; 00935 00936 // Below not in FNID_CONTROLSTART FNID_CONTROLEND range 00937 00938 KPROC pfnHkINLPCWPSTRUCT; // client-side callback for hook thunks 00939 KPROC pfnHkINLPCWPRETSTRUCT; // client-side callback for hook thunks 00940 KPROC pfnDispatchHook; 00941 KPROC pfnDispatchMessage; 00942 KPROC pfnMB_DlgProc; 00943 KPROC pfnMDIActivateDlgProc; 00944 } PFNCLIENT, *PPFNCLIENT; 00945 00946 typedef struct _PFNCLIENTWORKER { 00947 KPROC pfnButtonWndProc; 00948 KPROC pfnComboBoxWndProc; 00949 KPROC pfnComboListBoxProc; 00950 KPROC pfnDialogWndProc; 00951 KPROC pfnEditWndProc; 00952 KPROC pfnListBoxWndProc; 00953 KPROC pfnMDIClientWndProc; 00954 KPROC pfnStaticWndProc; 00955 KPROC pfnImeWndProc; 00956 } PFNCLIENTWORKER, *PPFNCLIENTWORKER; 00957 00958 #ifdef BUILD_WOW6432 00959 00960 extern const PFNCLIENT pfnClientA; 00961 extern const PFNCLIENT pfnClientW; 00962 extern const PFNCLIENTWORKER pfnClientWorker; 00963 00964 #define FNID_TO_CLIENT_PFNA_CLIENT(s) ((ULONG_PTR)(*(((KERNEL_ULONG_PTR *)&pfnClientA) + (s - FNID_START)))) 00965 #define FNID_TO_CLIENT_PFNW_CLIENT(s) ((ULONG_PTR)(*(((KERNEL_ULONG_PTR *)&pfnClientW) + (s - FNID_START)))) 00966 #define FNID_TO_CLIENT_PFNWORKER(s) ((ULONG_PTR)(*(((KERNEL_ULONG_PTR *)&pfnClientWorker) + (s - FNID_CONTROLSTART)))) 00967 00968 WNDPROC_PWND MapKernelClientFnToClientFn(WNDPROC_PWND lpfnWndProc); 00969 00970 #else 00971 00972 #define FNID_TO_CLIENT_PFNA_CLIENT FNID_TO_CLIENT_PFNA_KERNEL 00973 #define FNID_TO_CLIENT_PFNW_CLIENT FNID_TO_CLIENT_PFNW_KERNEL 00974 #define FNID_TO_CLIENT_PFNWORKER(s) (*(((KERNEL_ULONG_PTR *)&gpsi->apfnClientWorker) + (s - FNID_CONTROLSTART))) 00975 00976 #define MapKernelClientFnToClientFn(lpfnWndProc) (lpfnWndProc) 00977 00978 #endif 00979 00980 #define FNID_TO_CLIENT_PFNA_KERNEL(s) (*(((KERNEL_ULONG_PTR *)&gpsi->apfnClientA) + (s - FNID_START))) 00981 #define FNID_TO_CLIENT_PFNW_KERNEL(s) (*(((KERNEL_ULONG_PTR *)&gpsi->apfnClientW) + (s - FNID_START))) 00982 00983 #define FNID_TO_CLIENT_PFNA FNID_TO_CLIENT_PFNA_KERNEL 00984 #define FNID_TO_CLIENT_PFNW FNID_TO_CLIENT_PFNW_KERNEL 00985 00986 /* 00987 * Object types 00988 * 00989 * NOTE: Changing this table means changing hard-coded arrays that depend 00990 * on the index number (in security.c and in debug.c) 00991 */ 00992 #define TYPE_FREE 0 // must be zero! 00993 #define TYPE_WINDOW 1 // in order of use for C code lookups 00994 #define TYPE_MENU 2 00995 #define TYPE_CURSOR 3 00996 #define TYPE_SETWINDOWPOS 4 00997 #define TYPE_HOOK 5 00998 #define TYPE_CLIPDATA 6 // clipboard data 00999 #define TYPE_CALLPROC 7 01000 #define TYPE_ACCELTABLE 8 01001 #define TYPE_DDEACCESS 9 01002 #define TYPE_DDECONV 10 01003 #define TYPE_DDEXACT 11 // DDE transaction tracking info. 01004 #define TYPE_MONITOR 12 01005 #define TYPE_KBDLAYOUT 13 // Keyboard Layout handle (HKL) object. 01006 #define TYPE_KBDFILE 14 // Keyboard Layout file object. 01007 #define TYPE_WINEVENTHOOK 15 // WinEvent hook (EVENTHOOK) 01008 #define TYPE_TIMER 16 01009 #define TYPE_INPUTCONTEXT 17 // Input Context info structure 01010 01011 #define TYPE_CTYPES 18 // Count of TYPEs; Must be LAST + 1 01012 01013 #define TYPE_GENERIC 255 // used for generic handle validation 01014 01015 /* OEM Bitmap Information Structure */ 01016 typedef struct tagOEMBITMAPINFO 01017 { 01018 int x; 01019 int y; 01020 int cx; 01021 int cy; 01022 } OEMBITMAPINFO, *POEMBITMAPINFO; 01023 01024 // For the following OBI_ defines : 01025 // 01026 // a pushed state bitmap should be at +1 from it's normal state bitmap 01027 // an inactive state bitmap should be at +2 from it's normal state bitmap 01028 // A small caption bitmap should be +2 from the normal bitmap 01029 01030 #define DOBI_NORMAL 0 01031 #define DOBI_PUSHED 1 01032 #define DOBI_HOT 2 01033 #define DOBI_INACTIVE 3 01034 01035 #define DOBI_CHECK 1 // checkbox/radio/3state button states 01036 #define DOBI_DOWN 2 01037 #define DOBI_CHECKDOWN 3 01038 01039 #define DOBI_CAPON 0 // caption states 01040 #define DOBI_CAPOFF 1 01041 01042 // shared bitmap mappings 01043 #define DOBI_3STATE 8 // offset from checkbox to 3state 01044 #define DOBI_MBAR OBI_CLOSE_MBAR // offset to menu bar equivalent 01045 01046 #define OBI_CLOSE 0 // caption close button 01047 #define OBI_CLOSE_D 1 01048 #define OBI_CLOSE_H 2 01049 #define OBI_CLOSE_I 3 01050 #define OBI_REDUCE 4 // caption minimize button 01051 #define OBI_REDUCE_D 5 01052 #define OBI_REDUCE_H 6 01053 #define OBI_REDUCE_I 7 01054 #define OBI_RESTORE 8 // caption restore button 01055 #define OBI_RESTORE_D 9 01056 #define OBI_RESTORE_H 10 01057 #define OBI_HELP 11 01058 #define OBI_HELP_D 12 01059 #define OBI_HELP_H 13 01060 #define OBI_ZOOM 14 // caption maximize button 01061 #define OBI_ZOOM_D 15 01062 #define OBI_ZOOM_H 16 01063 #define OBI_ZOOM_I 17 01064 #define OBI_CLOSE_MBAR 18 // menu bar close button 01065 #define OBI_CLOSE_MBAR_D 19 01066 #define OBI_CLOSE_MBAR_H 20 01067 #define OBI_CLOSE_MBAR_I 21 01068 #define OBI_REDUCE_MBAR 22 // menu bar minimize button 01069 #define OBI_REDUCE_MBAR_D 23 01070 #define OBI_REDUCE_MBAR_H 24 01071 #define OBI_REDUCE_MBAR_I 25 01072 #define OBI_RESTORE_MBAR 26 // menu bar restore button 01073 #define OBI_RESTORE_MBAR_D 27 01074 #define OBI_RESTORE_MBAR_H 28 01075 #define OBI_CAPCACHE1 29 // caption icon cache entry #1 01076 #define OBI_CAPCACHE1_I 30 01077 #define OBI_CAPCACHE2 31 // caption icon cache entry #2 01078 #define OBI_CAPCACHE2_I 32 01079 #define OBI_CAPCACHE3 33 // caption icon cache entry #3 01080 #define OBI_CAPCACHE3_I 34 01081 #define OBI_CAPCACHE4 35 // caption icon cache entry #4 01082 #define OBI_CAPCACHE4_I 36 01083 #define OBI_CAPCACHE5 37 // caption icon cache entry #5 01084 #define OBI_CAPCACHE5_I 38 01085 #define OBI_CAPBTNS 39 // caption buttons cache 01086 #define OBI_CAPBTNS_I 40 01087 #define OBI_CLOSE_PAL 41 // small caption close button 01088 #define OBI_CLOSE_PAL_D 42 01089 #define OBI_CLOSE_PAL_H 43 01090 #define OBI_CLOSE_PAL_I 44 01091 #define OBI_NCGRIP 45 // bottom/right size grip 01092 #define OBI_UPARROW 46 // up scroll arrow 01093 #define OBI_UPARROW_D 47 01094 #define OBI_UPARROW_H 48 01095 #define OBI_UPARROW_I 49 01096 #define OBI_DNARROW 50 // down scroll arrow 01097 #define OBI_DNARROW_D 51 01098 #define OBI_DNARROW_H 52 01099 #define OBI_DNARROW_I 53 01100 #define OBI_RGARROW 54 // right scroll arrow 01101 #define OBI_RGARROW_D 55 01102 #define OBI_RGARROW_H 56 01103 #define OBI_RGARROW_I 57 01104 #define OBI_LFARROW 58 // left scroll arrow 01105 #define OBI_LFARROW_D 59 01106 #define OBI_LFARROW_H 60 01107 #define OBI_LFARROW_I 61 01108 #define OBI_MENUARROW 62 // menu hierarchy arrow 01109 #define OBI_MENUCHECK 63 // menu check mark 01110 #define OBI_MENUBULLET 64 // menu bullet mark 01111 #define OBI_MENUARROWUP 65 01112 #define OBI_MENUARROWUP_H 66 01113 #define OBI_MENUARROWUP_I 67 01114 #define OBI_MENUARROWDOWN 68 01115 #define OBI_MENUARROWDOWN_H 69 01116 #define OBI_MENUARROWDOWN_I 70 01117 #define OBI_RADIOMASK 71 // radio button mask 01118 #define OBI_CHECK 72 // check box 01119 #define OBI_CHECK_C 73 01120 #define OBI_CHECK_D 74 01121 #define OBI_CHECK_CD 75 01122 #define OBI_CHECK_CDI 76 01123 #define OBI_RADIO 77 // radio button 01124 #define OBI_RADIO_C 78 01125 #define OBI_RADIO_D 79 01126 #define OBI_RADIO_CD 80 01127 #define OBI_RADIO_CDI 81 01128 #define OBI_3STATE 82 // 3-state button 01129 #define OBI_3STATE_C 83 01130 #define OBI_3STATE_D 84 01131 #define OBI_3STATE_CD 85 01132 #define OBI_3STATE_CDI 86 01133 #define OBI_POPUPFIRST 87 // System popupmenu bitmaps. 01134 #define OBI_CLOSE_POPUP 87 01135 #define OBI_RESTORE_POPUP 88 01136 #define OBI_ZOOM_POPUP 89 01137 #define OBI_REDUCE_POPUP 90 01138 #define OBI_NCGRIP_L 91 01139 #define OBI_MENUARROW_L 92 01140 #define OBI_COUNT 93 // bitmap count 01141 01142 /* 01143 * One global instance of this structure is allocated into memory that is 01144 * mapped into all clients' address space. Client-side functions will 01145 * read this data to avoid calling the server. 01146 */ 01147 01148 #define NCHARS 256 01149 #define NCTRLS 0x20 01150 01151 #define PUSIF_PALETTEDISPLAY 0x00000001 /* Is the display palettized? */ 01152 #define PUSIF_SNAPTO 0x00000002 /* Is SnapTo enabled? */ 01153 #define PUSIF_COMBOBOXANIMATION 0x00000004 /* Must match UPBOOLMask(SPI_GETCOMBOBOXANIMATION) */ 01154 #define PUSIF_LISTBOXSMOOTHSCROLLING 0x00000008 /* Must match UPBOOLMask(SPI_GETLISTBOXSMOOTHSCROLLING) */ 01155 #define PUSIF_KEYBOARDCUES 0x00000020 /* Must match UPBOOLMask(SPI_GETKEYBOARDCUES) */ 01156 01157 #define PUSIF_UIEFFECTS 0x80000000 /* Must match UPBOOLMask(SPI_GETUIEFFECTS) */ 01158 01159 #define TEST_PUSIF(f) TEST_FLAG(gpsi->PUSIFlags, f) 01160 #define TEST_BOOL_PUSIF(f) TEST_BOOL_FLAG(gpsi->PUSIFlags, f) 01161 #define SET_PUSIF(f) SET_FLAG(gpsi->PUSIFlags, f) 01162 #define CLEAR_PUSIF(f) CLEAR_FLAG(gpsi->PUSIFlags, f) 01163 #define SET_OR_CLEAR_PUSIF(f, fSet) SET_OR_CLEAR_FLAG(gpsi->PUSIFlags, f, fSet) 01164 #define TOGGLE_PUSIF(f) TOGGLE_FLAG(gpsi->PUSIFlags, f) 01165 01166 #define TEST_EffectPUSIF(f) \ 01167 ((gpsi->PUSIFlags & (f | PUSIF_UIEFFECTS)) == (f | PUSIF_UIEFFECTS)) 01168 01169 /* 01170 * Some UI effects have an "inverted" disabled value (ie, disabled is TRUE) 01171 */ 01172 #define TEST_EffectInvertPUSIF(f) (TEST_PUSIF(f) || !TEST_PUSIF(PUSIF_UIEFFECTS)) 01173 01174 #define TEST_KbdCuesPUSIF (!gpsi->bKeyboardPref \ 01175 && !TEST_EffectInvertPUSIF(PUSIF_KEYBOARDCUES) \ 01176 && !(GetAppCompatFlags2(VER40) & GACF2_KCOFF)) 01177 01178 01179 typedef struct tagPERUSERSERVERINFO { 01180 /* 01181 * All of this information should be mapped to the server, but put in 01182 * the desktop section so it can vary from desktop to desktop. 01183 */ 01184 01185 int aiSysMet[SM_CMETRICS]; 01186 COLORREF argbSystem[COLOR_MAX]; 01187 KHBRUSH ahbrSystem[COLOR_MAX]; 01188 KHBRUSH hbrGray; 01189 POINT ptCursor; 01190 DWORD dwLastRITEventTickCount; 01191 int nEvents; 01192 01193 int gclBorder; /* # of logical units in window frame */ 01194 01195 UINT dtScroll; 01196 UINT dtLBSearch; 01197 UINT dtCaretBlink; 01198 UINT ucWheelScrollLines; /* # of lines to scroll when wheel is rolled */ 01199 01200 int wMaxLeftOverlapChars; 01201 int wMaxRightOverlapChars; 01202 01203 /* 01204 * these are here to lose a thunk for GetDialogBaseUnits 01205 */ 01206 int cxSysFontChar; 01207 int cySysFontChar; 01208 int cxMsgFontChar; 01209 int cyMsgFontChar; 01210 TEXTMETRIC tmSysFont; 01211 01212 /* 01213 * values to allow HasCaptionIcon to be in user32 01214 */ 01215 KHICON hIconSmWindows; 01216 KHICON hIcoWindows; 01217 01218 KHFONT hCaptionFont; 01219 KHFONT hMsgFont; 01220 01221 /* 01222 * These are needed for various user-mode performance hacks. 01223 */ 01224 DWORD dwKeyCache; 01225 DWORD dwAsyncKeyCache; 01226 DWORD cCaptures; 01227 01228 /* 01229 * Information about the current state of the display which needs to 01230 * be shared with the client side. The information here corresponds 01231 * to the display in gpDispInfo. Note that much of this information 01232 * is only for the primary monitor. 01233 */ 01234 OEMBITMAPINFO oembmi[OBI_COUNT]; /* OEM bitmap information */ 01235 RECT rcScreen; /* rectangle of the virtual screen */ 01236 WORD BitCount; /* Planes * Depth */ 01237 WORD dmLogPixels; /* logical pixels per inch, both X and Y */ 01238 BYTE Planes; /* Planes */ 01239 BYTE BitsPixel; /* Depth */ 01240 01241 DWORD PUSIFlags; // PUSIF_ flags 01242 UINT uCaretWidth; /* caret width in edits */ 01243 LANGID UILangID; // Default UI language 01244 01245 BOOL bLastRITWasKeyboard : 1; 01246 BOOL bKeyboardPref : 1; /* To propagate ACCF_KEYBOARDPREF to client side */ 01247 01248 01249 } PERUSERSERVERINFO, *PPERUSERSERVERINFO; 01250 01251 #define SRVIF_CHECKED 0x0001 01252 #define SRVIF_WINEVENTHOOKS 0x0002 01253 #define SRVIF_DBCS 0x0004 01254 #define SRVIF_IME 0x0008 01255 #define SRVIF_MIDEAST 0x0010 01256 01257 #define TEST_SRVIF(f) TEST_FLAG(gpsi->wSRVIFlags, f) 01258 #define TEST_BOOL_SRVIF(f) TEST_BOOL_FLAG(gpsi->wSRVIFlags, f) 01259 #define SET_SRVIF(f) SET_FLAG(gpsi->wSRVIFlags, f) 01260 #define CLEAR_SRVIF(f) CLEAR_FLAG(gpsi->wSRVIFlags, f) 01261 #define SET_OR_CLEAR_SRVIF(f, fSet) SET_OR_CLEAR_FLAG(gpsi->wSRVIFlags, f, fSet) 01262 #define TOGGLE_SRVIF(f) TOGGLE_FLAG(gpsi->wSRVIFlags, f) 01263 01264 typedef struct tagSERVERINFO { // si 01265 WORD wRIPFlags; // RIPF_ flags 01266 WORD wSRVIFlags; // SRVIF_ flags 01267 WORD wRIPPID; // PID of process to apply RIP flags to (zero means all) 01268 WORD wRIPError; // Error to break on (zero means all errors are treated equal) 01269 01270 KERNEL_ULONG_PTR cHandleEntries; // count of handle entries in array 01271 01272 /* 01273 * Array of server-side function pointers. 01274 * Client passes servers function ID so they can be easily validated; 01275 * this array maps function ID into server-side function address. 01276 * The order of these are enforced by the FNID_ constants, and must match 01277 * the client-side mpFnidClientPfn[] order as well. 01278 */ 01279 WNDPROC_PWNDEX mpFnidPfn[FNID_ARRAY_SIZE]; // function mapping table 01280 WNDPROC_PWND aStoCidPfn[(FNID_WNDPROCEND - FNID_START) + 1]; 01281 01282 // mapping of fnid to min bytes need by public windproc user 01283 WORD mpFnid_serverCBWndProc[(FNID_END - FNID_START) + 1]; 01284 01285 /* 01286 * Client side functions pointer structure. 01287 */ 01288 struct _PFNCLIENT apfnClientA; 01289 struct _PFNCLIENT apfnClientW; 01290 struct _PFNCLIENTWORKER apfnClientWorker; 01291 01292 DWORD cbHandleTable; 01293 01294 /* 01295 * Class atoms to allow fast checks on the client. 01296 */ 01297 ATOM atomSysClass[ICLS_MAX]; // Atoms for control classes 01298 01299 DWORD dwDefaultHeapBase; // so WOW can do handle validation 01300 DWORD dwDefaultHeapSize; 01301 01302 UINT uiShellMsg; // message for shell hooks 01303 01304 UINT wMaxBtnSize; /* Size of the longest button string in any MessageBox */ 01305 01306 MBSTRING MBStrings[MAX_MB_STRINGS]; 01307 01308 /* 01309 * values to allow HasCaptionIcon to be in user32 01310 */ 01311 ATOM atomIconSmProp; 01312 ATOM atomIconProp; 01313 01314 ATOM atomContextHelpIdProp; 01315 01316 char acOemToAnsi[NCHARS]; 01317 char acAnsiToOem[NCHARS]; 01318 01319 /* 01320 * Per user settings. We use _HYDRA_'s PERUSERSERVERINO struct 01321 * to avoid defining fields in two places. 01322 */ 01323 PERUSERSERVERINFO; 01324 01325 #if DEBUGTAGS 01326 DWORD adwDBGTAGFlags[DBGTAG_Max + 1]; 01327 #endif // DEBUGTAGS 01328 01329 } SERVERINFO; 01330 01331 /* 01332 * Quick test for any Window Event Hooks. 01333 */ 01334 #ifdef _USERK_ 01335 #define FWINABLE() gpWinEventHooks 01336 #else 01337 #define FWINABLE() TEST_SRVIF(SRVIF_WINEVENTHOOKS) 01338 #endif 01339 01340 /* MessageBox String pointers from offset in the gpsi struct */ 01341 #define GETGPSIMBPSTR(u) (LPWSTR) (gpsi->MBStrings[(u)].szName) 01342 01343 typedef struct _WNDMSG { 01344 UINT maxMsgs; 01345 KPBYTE abMsgs; 01346 } WNDMSG, *PWNDMSG; 01347 01348 typedef struct tagSHAREDINFO { 01349 PSERVERINFO psi; 01350 PHE aheList; /* handle table pointer */ 01351 PDISPLAYINFO pDispInfo; /* global displayinfo */ 01352 KERNEL_UINT_PTR ulSharedDelta; /* delta between client and kernel mapping of ...*/ 01353 /* shared memory section. Only valid/used in client.*/ 01354 01355 WNDMSG awmControl[FNID_END - FNID_START + 1]; 01356 01357 WNDMSG DefWindowMsgs; 01358 WNDMSG DefWindowSpecMsgs; 01359 } SHAREDINFO, *PSHAREDINFO; 01360 01361 typedef struct _USERCONNECT { 01362 IN ULONG ulVersion; 01363 OUT ULONG ulCurrentVersion; 01364 IN DWORD dwDispatchCount; 01365 OUT SHAREDINFO siClient; 01366 } USERCONNECT, *PUSERCONNECT; 01367 01368 #define USER_MAJOR_VERSION 0x0005 01369 #define USER_MINOR_VERSION 0x0000 01370 01371 #define USERCURRENTVERSION MAKELONG(USER_MINOR_VERSION, USER_MAJOR_VERSION) 01372 01373 /* 01374 * Options used for NtUserSetSysColors 01375 */ 01376 #define SSCF_NOTIFY 0x00000001 01377 #define SSCF_FORCESOLIDCOLOR 0x00000002 01378 #define SSCF_SETMAGICCOLORS 0x00000004 01379 #define SSCF_16COLORS 0x00000008 01380 01381 /* 01382 * Structure used for GetClipboardData, where we can have 01383 * extra information returned from the kernel. 01384 */ 01385 typedef struct tagGETCLIPBDATA { 01386 01387 UINT uFmtRet; // Identifies returned format. 01388 BOOL fGlobalHandle; // Indicates if handle is global. 01389 union { 01390 HANDLE hLocale; // Locale (text-type formats only). 01391 HANDLE hPalette; // Palette (bitmap-type formats only). 01392 }; 01393 01394 } GETCLIPBDATA, *PGETCLIPBDATA; 01395 01396 /* 01397 * Structure used for SetClipboardData, where we can have 01398 * extra information passed to the kernel. 01399 */ 01400 typedef struct tagSETCLIPBDATA { 01401 01402 BOOL fGlobalHandle; // Indicates if handle is global. 01403 BOOL fIncSerialNumber; // Indicates if we should increment serial# 01404 01405 } SETCLIPBDATA, *PSETCLIPBDATA; 01406 01407 /* 01408 * HM Object definition control flags 01409 */ 01410 #define OCF_THREADOWNED 0x01 01411 #define OCF_PROCESSOWNED 0x02 01412 #define OCF_MARKPROCESS 0x04 01413 #define OCF_USEPOOLQUOTA 0x08 01414 #define OCF_DESKTOPHEAP 0x10 01415 #define OCF_USEPOOLIFNODESKTOP 0x20 01416 #define OCF_SHAREDHEAP 0x40 01417 #if DBG 01418 #define OCF_VARIABLESIZE 0x80 01419 #else 01420 #define OCF_VARIABLESIZE 0 01421 #endif 01422 01423 /* 01424 * From HANDTABL.C 01425 */ 01426 /* 01427 * Static information about each handle type. 01428 */ 01429 typedef void (*FnDestroyUserObject)(void *); 01430 01431 typedef struct tagHANDLETYPEINFO { 01432 #if DBG 01433 LPCSTR szObjectType; 01434 UINT uSize; 01435 #endif 01436 FnDestroyUserObject fnDestroy; 01437 DWORD dwAllocTag; 01438 BYTE bObjectCreateFlags; 01439 } HANDLETYPEINFO, *PHANDLETYPEINFO; 01440 01441 /* 01442 * The following is the header of all objects managed in the handle list. 01443 * (allocated as part of the object for easy access). All object 01444 * headers must start with the members of a HEAD structure. 01445 */ 01446 typedef struct _HEAD { 01447 KHANDLE h; 01448 DWORD cLockObj; 01449 } HEAD, *PHEAD; 01450 01451 /* 01452 * sizeof(THROBJHEAD) must be equal to sizeof(PROCOBJHEAD) 01453 * This is to make sure that DESKHEAD fields are always at the same offset. 01454 */ 01455 typedef struct _THROBJHEAD { 01456 HEAD; 01457 PTHREADINFO pti; 01458 } THROBJHEAD, *PTHROBJHEAD; 01459 01460 typedef struct _PROCOBJHEAD { 01461 HEAD; 01462 DWORD hTaskWow; 01463 } PROCOBJHEAD, *PPROCOBJHEAD; 01464 01465 typedef struct _PROCMARKHEAD { 01466 PROCOBJHEAD; 01467 PPROCESSINFO ppi; 01468 } PROCMARKHEAD, *PPROCMARKHEAD; 01469 01470 typedef struct _DESKHEAD { 01471 PDESKTOP rpdesk; 01472 KPBYTE pSelf; 01473 } DESKHEAD, *PDESKHEAD; 01474 01475 /* 01476 * This type is for HM casting only. Use THRDESKHEAD or PROCDESKHEAD instead. 01477 */ 01478 typedef struct _DESKOBJHEAD { 01479 HEAD; 01480 KERNEL_PVOID pOwner; 01481 DESKHEAD; 01482 } DESKOBJHEAD, *PDESKOBJHEAD; 01483 01484 typedef struct _THRDESKHEAD { 01485 THROBJHEAD; 01486 DESKHEAD; 01487 } THRDESKHEAD, *PTHRDESKHEAD; 01488 01489 typedef struct _PROCDESKHEAD { 01490 PROCOBJHEAD; 01491 DESKHEAD; 01492 } PROCDESKHEAD, *PPROCDESKHEAD; 01493 01494 01495 01496 #define HANDLEF_DESTROY 0x01 01497 #define HANDLEF_INDESTROY 0x02 01498 #define HANDLEF_MARKED_OK 0x10 01499 #define HANDLEF_GRANTED 0x20 01500 #define HANDLEF_POOL 0x40 // for the mother desktop window 01501 #define HANDLEF_VALID 0x7F 01502 01503 /* 01504 * The following is a handle table entry. 01505 * 01506 * Note that by keeping a pointer to the owning entity (process or 01507 * thread), cleanup will touch only those objects that belong to 01508 * the entity being destroyed. This helps keep the working set 01509 * size down. Look at DestroyProcessesObjects() for an example. 01510 */ 01511 typedef struct _HANDLEENTRY { 01512 PHEAD phead; /* pointer to the real object */ 01513 KERNEL_PVOID pOwner; /* pointer to owning entity (pti or ppi) */ 01514 BYTE bType; /* type of object */ 01515 BYTE bFlags; /* flags - like destroy flag */ 01516 WORD wUniq; /* uniqueness count */ 01517 01518 #if DBG 01519 PLR plr; /* lock record pointer */ 01520 #endif // DBG 01521 01522 } HANDLEENTRY; 01523 01524 /* 01525 * Change HMINDEXBITS for bits that make up table index in handle 01526 * Change HMUNIQSHIFT for count of bits to shift uniqueness left. 01527 * Change HMUNIQBITS for bits that make up uniqueness. 01528 * 01529 * Currently 64K handles can be created, w/16 bits of uniqueness. 01530 */ 01531 #define HMINDEXBITS 0x0000FFFF // bits where index is stored 01532 #define HMUNIQSHIFT 16 // bits to shift uniqueness 01533 #define HMUNIQBITS 0xFFFF // valid uniqueness bits 01534 01535 #ifdef _USERK_ 01536 #define HMHandleFromIndex(i) LongToHandle((LONG)(i) | ((LONG)gSharedInfo.aheList[i].wUniq << HMUNIQSHIFT)) 01537 #define HMObjectFlags(p) (gahti[HMObjectType(p)].bObjectCreateFlags) 01538 #endif 01539 01540 #define HMIndexFromHandle(h) ((ULONG)(((ULONG_PTR)(h)) & HMINDEXBITS)) 01541 #define _HMPheFromObject(p) (&gSharedInfo.aheList[HMIndexFromHandle((((PHEAD)p)->h))]) 01542 #define _HMObjectFromHandle(h) ((KERNEL_PVOID)(gSharedInfo.aheList[HMIndexFromHandle(h)].phead)) 01543 #define HMUniqFromHandle(h) ((WORD)((((ULONG_PTR)h) >> HMUNIQSHIFT) & HMUNIQBITS)) 01544 #define HMObjectType(p) (HMPheFromObject(p)->bType) 01545 01546 #define HMIsMarkDestroy(p) (HMPheFromObject(p)->bFlags & HANDLEF_DESTROY) 01547 01548 /* 01549 * Validation, handle mapping, etc. 01550 */ 01551 #define HMRevalidateHandle(h) HMValidateHandleNoSecure(h, TYPE_GENERIC) 01552 #define HMRevalidateCatHandle(h) HMValidateCatHandleNoSecure(h, TYPE_GENERIC) 01553 01554 #define HMRevalidateHandleNoRip(h) HMValidateHandleNoRip(h, TYPE_GENERIC) 01555 #define RevalidateHmenu(hmenuX) HMValidateHandleNoRip(hmenuX, TYPE_MENU) 01556 01557 #define _PtoHq(p) ((HANDLE)(((PHEAD)p)->h)) 01558 #define _PtoH(p) ((HANDLE)((p) == NULL ? NULL : _PtoHq(p))) 01559 #define _HW(pwnd) ((HWND)_PtoH(pwnd)) 01560 #define _HWCCX(ccxPwnd) ((HWND)_PtoH(ccxPwnd)) 01561 #define _HWq(pwnd) ((HWND)_PtoHq(pwnd)) 01562 01563 #if DBG && defined(_USERK_) 01564 01565 PHE DBGHMPheFromObject (PVOID p); 01566 PVOID DBGHMObjectFromHandle (HANDLE h); 01567 PVOID DBGHMCatObjectFromHandle (HANDLE h); 01568 HANDLE DBGPtoH (PVOID p); 01569 HANDLE DBGPtoHq (PVOID p); 01570 HWND DBGHW (PWND pwnd); 01571 HWND DBGHWCCX (PWND pwnd); 01572 HWND DBGHWq (PWND pwnd); 01573 01574 #define HMPheFromObject(p) DBGHMPheFromObject((p)) 01575 #define HMObjectFromHandle(h) DBGHMObjectFromHandle((HANDLE)(h)) 01576 #define HMCatObjectFromHandle(h) DBGHMCatObjectFromHandle((HANDLE)(h)) 01577 #define PtoH(p) DBGPtoH((PVOID)(p)) 01578 #define PtoHq(p) DBGPtoHq((PVOID)(p)) 01579 #define HW(pwnd) DBGHW((PWND)(pwnd)) 01580 #define HWCCX(ccxPwnd) DBGHWCCX((PWND)(ccxPwnd)) 01581 #define HWq(pwnd) DBGHWq((PWND)(pwnd)) 01582 01583 #else 01584 01585 #define HMPheFromObject(p) _HMPheFromObject(p) 01586 #define HMObjectFromHandle(h) _HMObjectFromHandle(h) 01587 #define HMCatObjectFromHandle(h) _HMObjectFromHandle(h) 01588 #define PtoH(p) _PtoH(p) 01589 #define PtoHq(p) _PtoHq(p) 01590 #define HW(pwnd) _HW(pwnd) 01591 #define HWCCX(ccxPwnd) _HW(ccxPwnd) 01592 #define HWq(pwnd) _HWq(pwnd) 01593 01594 #endif /* #else #if DBG && defined(_USERK_) */ 01595 01596 /* 01597 * Inline functions / macros to access HM object head fields 01598 */ 01599 #define _GETPTI(p) (((PTHROBJHEAD)p)->pti) 01600 #define _GETPDESK(p) (((PDESKOBJHEAD)p)->rpdesk) 01601 #define _GETPPI(p) (((PPROCMARKHEAD)p)->ppi) 01602 01603 #if DBG && defined(_USERK_) 01604 extern CONST HANDLETYPEINFO gahti[]; 01605 extern SHAREDINFO gSharedInfo; 01606 __inline PTHREADINFO GETPTI (PVOID p) 01607 { 01608 UserAssert(HMObjectFlags(p) & OCF_THREADOWNED); 01609 return _GETPTI(p); 01610 } 01611 __inline PDESKTOP GETPDESK (PVOID p) 01612 { 01613 UserAssert(HMObjectFlags(p) & OCF_DESKTOPHEAP); 01614 return _GETPDESK(p); 01615 } 01616 __inline PPROCESSINFO GETPPI (PVOID p) 01617 { 01618 UserAssert(HMObjectFlags(p) & OCF_MARKPROCESS); 01619 return _GETPPI(p); 01620 } 01621 01622 #else 01623 01624 #define GETPTI(p) _GETPTI(p) 01625 #define GETPDESK(p) _GETPDESK(p) 01626 #define GETPPI(p) _GETPPI(p) 01627 01628 #endif /* #else #if DBG && defined(_USERK_) */ 01629 01630 #define GETPWNDPPI(p) (GETPTI(p)->ppi) 01631 01632 01633 /* 01634 * NOTE!: there is code in exitwin.c that assumes HMIsMarkDestroy is defined as 01635 * (HMPheFromObject(p)->bFlags & HANDLEF_DESTROY) 01636 */ 01637 01638 #define CPD_ANSI_TO_UNICODE 0x0001 /* CPD represents ansi to U transition */ 01639 #define CPD_UNICODE_TO_ANSI 0x0002 01640 #define CPD_TRANSITION_TYPES (CPD_ANSI_TO_UNICODE|CPD_UNICODE_TO_ANSI) 01641 01642 #define CPD_CLASS 0x0010 /* Get CPD for a class */ 01643 #define CPD_WND 0x0020 01644 #define CPD_DIALOG 0x0040 01645 #define CPD_WNDTOCLS 0x0080 01646 01647 #define CPDHANDLE_HI ((ULONG_PTR)~HMINDEXBITS) 01648 #define MAKE_CPDHANDLE(h) (HMIndexFromHandle(h) | CPDHANDLE_HI) 01649 #define ISCPDTAG(x) (((ULONG_PTR)(x) & CPDHANDLE_HI) == CPDHANDLE_HI) 01650 01651 /* 01652 * Call Proc Handle Info 01653 */ 01654 typedef struct _CALLPROCDATA { 01655 PROCDESKHEAD head; 01656 PCALLPROCDATA spcpdNext; 01657 KERNEL_ULONG_PTR pfnClientPrevious; 01658 WORD wType; 01659 } CALLPROCDATA; 01660 01661 /* 01662 * Class styles 01663 */ 01664 #define CFVREDRAW 0x0001 01665 #define CFHREDRAW 0x0002 01666 #define CFKANJIWINDOW 0x0004 01667 #define CFDBLCLKS 0x0008 01668 #define CFSERVERSIDEPROC 0x0010 // documented as reserved in winuser.h 01669 #define CFOWNDC 0x0020 01670 #define CFCLASSDC 0x0040 01671 #define CFPARENTDC 0x0080 01672 #define CFNOKEYCVT 0x0101 01673 #define CFNOCLOSE 0x0102 01674 #define CFLVB 0x0104 01675 #define CFSAVEBITS 0x0108 01676 #define CFOEMCHARS 0x0140 01677 #define CFIME 0x0201 01678 01679 /* 01680 * Offset from the beginning of the CLS structure to the WNDCLASS section. 01681 */ 01682 #define CFOFFSET (FIELD_OFFSET(CLS, style)) 01683 01684 #define TestCF(hwnd, flag) (*((BYTE *)((PWND)(hwnd))->pcls + CFOFFSET + HIBYTE(flag)) & LOBYTE(flag)) 01685 #define SetCF(hwnd, flag) (*((BYTE *)((PWND)(hwnd))->pcls + CFOFFSET + HIBYTE(flag)) |= LOBYTE(flag)) 01686 #define ClrCF(pcls, flag) (*((BYTE *)((PWND)(hwnd))->pcls + CFOFFSET + HIBYTE(flag)) &= ~LOBYTE(flag)) 01687 01688 #define TestCF2(pcls, flag) (*((BYTE *)(pcls) + CFOFFSET + (int)HIBYTE(flag)) & LOBYTE(flag)) 01689 #define SetCF2(pcls, flag) (*((BYTE *)(pcls) + CFOFFSET + (int)HIBYTE(flag)) |= LOBYTE(flag)) 01690 #define ClrCF2(pcls, flag) (*((BYTE *)(pcls) + CFOFFSET + (int)HIBYTE(flag)) &= ~LOBYTE(flag)) 01691 01692 #define PWCFromPCLS(pcls) ((PWC)((PBYTE)(pcls) + sizeof(CLS) + (pcls)->cbclsExtra)) 01693 01694 /* Window class structure */ 01695 typedef struct tagCOMMON_WNDCLASS 01696 { 01697 /* 01698 * We'll add cWndReferenceCount here so COMMON_WNDCLASS and WNDCLASSEX have 01699 * the same layout. Otherwise padding will screw us up on 64-bit platforms. 01700 */ 01701 int cWndReferenceCount; /* The number of windows registered 01702 with this class */ 01703 UINT style; 01704 WNDPROC_PWND lpfnWndProc; // HI BIT on means WOW PROC 01705 int cbclsExtra; 01706 int cbwndExtra; 01707 KHANDLE hModule; 01708 PCURSOR spicn; 01709 PCURSOR spcur; 01710 KHBRUSH hbrBackground; 01711 KLPWSTR lpszMenuName; 01712 KLPSTR lpszAnsiClassName; 01713 PCURSOR spicnSm; 01714 } COMMON_WNDCLASS; 01715 /* 01716 * Class Menu names structure. For performance reasons (GetClassInfo) 01717 * we keep two client side copies of wndcls.lpszMenu and another kernel side copy. 01718 * This structure is used to pass menu names info between client and kernel. 01719 */ 01720 typedef struct tagCLSMENUNAME 01721 { 01722 KLPSTR pszClientAnsiMenuName; 01723 KLPWSTR pwszClientUnicodeMenuName; 01724 PUNICODE_STRING pusMenuName; 01725 } CLSMENUNAME, *PCLSMENUNAME; 01726 01727 /* 01728 * This is the window class structure. All window classes are linked 01729 * together in a master list pointed to by pclsList. 01730 * 01731 * RED ALERT! Do not add any fields after the COMMON_WNDCLASS structure; 01732 * CFOFFSET depends on this. 01733 */ 01734 01735 typedef struct tagCLS { 01736 /* NOTE: The order of the following fields is assumed. */ 01737 PCLS pclsNext; 01738 ATOM atomClassName; 01739 WORD fnid; // record window proc used by this hwnd 01740 // access through GETFNID 01741 PDESKTOP rpdeskParent;/* Parent desktop */ 01742 PDCE pdce; /* PDCE to DC associated with class */ 01743 WORD hTaskWow; 01744 WORD CSF_flags; /* internal class flags */ 01745 KLPSTR lpszClientAnsiMenuName; /* string or resource ID */ 01746 KLPWSTR lpszClientUnicodeMenuName; /* string or resource ID */ 01747 01748 PCALLPROCDATA spcpdFirst; /* Pointer to first CallProcData element (or 0) */ 01749 PCLS pclsBase; /* Pointer to base class */ 01750 PCLS pclsClone; /* Pointer to clone class list */ 01751 01752 COMMON_WNDCLASS; 01753 /* 01754 * WARNING: 01755 * CFOFFSET expects COMMON_WNDCLASS to be last fields in CLS 01756 */ 01757 } CLS, **PPCLS; 01758 01759 /* 01760 * This class flag is used to distinguish classes that were registered 01761 * by the server (most system classes) from those registered by the client. 01762 * Note -- flags are a WORD in the class structure now. 01763 */ 01764 #define CSF_SERVERSIDEPROC 0x0001 01765 #define CSF_ANSIPROC 0x0002 01766 #define CSF_WOWDEFERDESTROY 0x0004 01767 #define CSF_SYSTEMCLASS 0x0008 01768 #define CSF_WOWCLASS 0x0010 // extra words at end for wow info 01769 #define CSF_WOWEXTRA 0x0020 01770 #define CSF_CACHEDSMICON 0x0040 01771 #define CSF_WIN40COMPAT 0x0080 01772 #define CSF_VALID (CSF_ANSIPROC | CSF_WIN40COMPAT) 01773 01774 /* 01775 * SBDATA are the values for one scrollbar 01776 */ 01777 01778 typedef struct tagSBDATA { 01779 int posMin; 01780 int posMax; 01781 int page; 01782 int pos; 01783 } SBDATA, *PSBDATA; 01784 01785 /* 01786 * SBINFO is the set of values that hang off of a window structure, if the 01787 * window has scrollbars. 01788 */ 01789 typedef struct tagSBINFO { 01790 int WSBflags; 01791 SBDATA Horz; 01792 SBDATA Vert; 01793 } SBINFO, * KPTR_MODIFIER PSBINFO; 01794 01795 /* 01796 * Window Property structure 01797 */ 01798 typedef struct tagPROP { 01799 KHANDLE hData; 01800 ATOM atomKey; 01801 WORD fs; 01802 } PROP, *PPROP; 01803 01804 #define PROPF_INTERNAL 0x0001 01805 #define PROPF_STRING 0x0002 01806 #define PROPF_NOPOOL 0x0004 01807 01808 01809 /* 01810 * Window Property List structure 01811 */ 01812 typedef struct tagPROPLIST { 01813 UINT cEntries; 01814 UINT iFirstFree; 01815 PROP aprop[1]; 01816 } PROPLIST, * KPTR_MODIFIER PPROPLIST; 01817 01818 /* 01819 * NOTE -- this structure has been sorted (roughly) in order of use 01820 * of the fields. The x86 code set allows cheaper access to fields 01821 * that are in the first 0x80 bytes of a structure. Please attempt 01822 * to ensure that frequently-used fields are below this boundary. 01823 * FritzS 01824 */ 01825 01826 typedef struct tagWND { // wnd 01827 THRDESKHEAD head; 01828 01829 WW; // WOW-USER common fields. Defined in wowuserp.h 01830 // The presence of "state" at the start of this structure is assumed 01831 // by the STATEOFFSET macro. 01832 01833 PWND spwndNext; // Handle to the next window 01834 PWND spwndParent; // Backpointer to the parent window. 01835 PWND spwndChild; // Handle to child 01836 PWND spwndOwner; // Popup window owner field 01837 01838 RECT rcWindow; // Window outer rectangle 01839 RECT rcClient; // Client rectangle 01840 01841 WNDPROC_PWND lpfnWndProc; // Can be WOW address or standard address 01842 01843 PCLS pcls; // Pointer to window class 01844 01845 KHRGN hrgnUpdate; // Accumulated paint region 01846 01847 PPROPLIST ppropList; // Pointer to property list 01848 PSBINFO pSBInfo; // Words used for scrolling 01849 01850 PMENU spmenuSys; // Handle to system menu 01851 PMENU spmenu; // Menu handle or ID 01852 01853 KHRGN hrgnClip; // Clipping region for this window 01854 01855 LARGE_UNICODE_STRING strName; 01856 int cbwndExtra; // Extra bytes in window 01857 PWND spwndLastActive; // Last active in owner/ownee list 01858 KHIMC hImc; // Associated input context handle 01859 KERNEL_ULONG_PTR dwUserData; // Reserved for random application data 01860 } WND; 01861 01862 #define NEEDSPAINT(pwnd) (pwnd->hrgnUpdate != NULL || TestWF(pwnd, WFINTERNALPAINT)) 01863 01864 /* 01865 * Combo Box stuff 01866 */ 01867 typedef struct tagCBox { 01868 PWND spwnd; /* Window for the combo box */ 01869 PWND spwndParent;/* Parent of the combo box */ 01870 RECT editrc; /* Rectangle for the edit control/static text 01871 area */ 01872 RECT buttonrc; /* Rectangle where the dropdown button is */ 01873 01874 int cxCombo; // Width of sunken area 01875 int cyCombo; // Height of sunken area 01876 int cxDrop; // 0x24 Width of dropdown 01877 int cyDrop; // Height of dropdown or shebang if simple 01878 01879 PWND spwndEdit; /* Edit control window handle */ 01880 PWND spwndList; /* List box control window handle */ 01881 01882 UINT CBoxStyle:2; /* Combo box style */ 01883 UINT fFocus:1; /* Combo box has focus? */ 01884 UINT fNoRedraw:1; /* Stop drawing? */ 01885 UINT fMouseDown:1; /* Was the popdown button just clicked and 01886 mouse still down? */ 01887 UINT fButtonPressed:1; /* Is the dropdown button in an inverted state? 01888 */ 01889 UINT fLBoxVisible:1; /* Is list box visible? (dropped down?) */ 01890 UINT OwnerDraw:2; /* Owner draw combo box if nonzero. value 01891 * specifies either fixed or varheight 01892 */ 01893 UINT fKeyboardSelInListBox:1; /* Is the user keyboarding through the 01894 * listbox. So that we don't hide the 01895 * listbox on selchanges caused by the 01896 * user keyboard through it but we do 01897 * hide it if the mouse causes the 01898 * selchange. 01899 */ 01900 UINT fExtendedUI:1; /* Are we doing TandyT's UI changes on this 01901 * combo box? 01902 */ 01903 UINT fCase:2; 01904 01905 UINT f3DCombo:1; // 3D or flat border? 01906 UINT fNoEdit:1; /* True if editing is not allowed in the edit 01907 * window. 01908 */ 01909 #ifdef COLOR_HOTTRACKING 01910 UINT fButtonHotTracked:1; /* Is the dropdown hot-tracked? */ 01911 #endif // COLOR_HOTTRACKING 01912 UINT fRightAlign:1; /* used primarily for MidEast right align */ 01913 UINT fRtoLReading:1; /* used only for MidEast, text rtol reading order */ 01914 HANDLE hFont; /* Font for the combo box */ 01915 LONG styleSave; /* Temp to save the style bits when creating 01916 * window. Needed because we strip off some 01917 * bits and pass them on to the listbox or 01918 * edit box. 01919 */ 01920 } CBOX, * KPTR_MODIFIER PCBOX; 01921 01922 typedef struct tagCOMBOWND { 01923 WND wnd; 01924 PCBOX pcbox; 01925 } COMBOWND, *PCOMBOWND; 01926 01927 /* 01928 * List Box 01929 */ 01930 typedef struct _SCROLLPOS { 01931 INT cItems; 01932 UINT iPage; 01933 INT iPos; 01934 UINT fMask; 01935 INT iReturn; 01936 } SCROLLPOS, *PSCROLLPOS; 01937 01938 typedef struct tagLBIV { 01939 PWND spwndParent; /* parent window */ 01940 PWND spwnd; /* lbox ctl window */ 01941 INT iTop; /* index of top item displayed */ 01942 INT iSel; /* index of current item selected */ 01943 INT iSelBase; /* base sel for multiple selections */ 01944 INT cItemFullMax; /* cnt of Fully Visible items. Always contains 01945 result of CItemInWindow(plb, FALSE) for fixed 01946 height listboxes. Contains 1 for var height 01947 listboxes. */ 01948 INT cMac; /* cnt of items in listbox */ 01949 INT cMax; /* cnt of total # items allocated for rgpch. 01950 Not all are necessarly in use */ 01951 PBYTE rgpch; /* pointer to array of string offsets */ 01952 LPWSTR hStrings; /* string storage handle */ 01953 INT cchStrings; /* Size in bytes of hStrings */ 01954 INT ichAlloc; /* Pointer to end of hStrings (end of last valid 01955 string) */ 01956 INT cxChar; /* Width of a character */ 01957 INT cyChar; /* height of line */ 01958 INT cxColumn; /* width of a column in multicolumn listboxes */ 01959 INT itemsPerColumn; /* for multicolumn listboxes */ 01960 INT numberOfColumns; /* for multicolumn listboxes */ 01961 POINT ptPrev; /* coord of last tracked mouse pt. used for auto 01962 scrolling the listbox during timer's */ 01963 01964 UINT OwnerDraw:2; /* Owner draw styles. Non-zero if ownerdraw. */ 01965 UINT fRedraw:1; /* if TRUE then do repaints */ 01966 UINT fDeferUpdate:1; /* */ 01967 UINT wMultiple:2; /* SINGLESEL allows a single item to be selected. 01968 * MULTIPLESEL allows simple toggle multi-selection 01969 * EXTENDEDSEL allows extended multi selection; 01970 */ 01971 01972 UINT fSort:1; /* if TRUE the sort list */ 01973 UINT fNotify:1; /* if TRUE then Notify parent */ 01974 UINT fMouseDown:1; /* if TRUE then process mouse moves/mouseup */ 01975 UINT fCaptured:1; // if TRUE then process mouse messages 01976 UINT fCaret:1; /* flashing caret allowed */ 01977 UINT fDoubleClick:1; /* mouse down in double click */ 01978 UINT fCaretOn:1; /* if TRUE then caret is on */ 01979 UINT fAddSelMode:1; /* if TRUE, then it is in ADD selection mode */ 01980 UINT fHasStrings:1; /* True if the listbox has a string associated 01981 * with each item else it has an app suppled LONG 01982 * value and is ownerdraw 01983 */ 01984 UINT fHasData:1; /* if FALSE, then lb doesn't keep any line data 01985 * beyond selection state, but instead calls back 01986 * to the client for each line's definition. 01987 * Forces OwnerDraw==OWNERDRAWFIXED, !fSort, 01988 * and !fHasStrings. 01989 */ 01990 UINT fNewItemState:1; /* select/deselect mode? for multiselection lb 01991 */ 01992 UINT fUseTabStops:1; /* True if the non-ownerdraw listbox should handle 01993 * tabstops 01994 */ 01995 UINT fMultiColumn:1; /* True if this is a multicolumn listbox */ 01996 UINT fNoIntegralHeight:1; /* True if we don't want to size the listbox 01997 * an integral lineheight 01998 */ 01999 UINT fWantKeyboardInput:1; /* True if we should pass on WM_KEY & CHAR 02000 * so that the app can go to special items 02001 * with them. 02002 */ 02003 UINT fDisableNoScroll:1; /* True if the listbox should 02004 * automatically Enable/disable 02005 * it's scroll bars. If false, the scroll 02006 * bars will be hidden/Shown automatically 02007 * if they are present. 02008 */ 02009 UINT fHorzBar:1; // TRUE if WS_HSCROLL specified at create time 02010 02011 UINT fVertBar:1; // TRUE if WS_VSCROLL specified at create time 02012 UINT fFromInsert:1; // TRUE if client drawing should be deferred during delete/insert ops 02013 UINT fNoSel:1; 02014 02015 UINT fHorzInitialized : 1; // Horz scroll cache initialized 02016 UINT fVertInitialized : 1; // Vert scroll cache initialized 02017 02018 UINT fSized : 1; // Listbox was resized. 02019 UINT fIgnoreSizeMsg : 1; // If TRUE, ignore WM_SIZE message 02020 02021 UINT fInitialized : 1; 02022 02023 UINT fRightAlign:1; // used primarily for MidEast right align 02024 UINT fRtoLReading:1; // used only for MidEast, text rtol reading order 02025 UINT fSmoothScroll:1; // allow just one smooth-scroll per scroll cycle 02026 02027 int xRightOrigin; // For horizontal scrolling. The current x origin 02028 02029 INT iLastSelection; /* Used for cancelable selection. Last selection 02030 * in listbox for combo box support 02031 */ 02032 INT iMouseDown; /* For multiselection mouse click & drag extended 02033 * selection. It is the ANCHOR point for range 02034 * selections 02035 */ 02036 INT iLastMouseMove; /* selection of listbox items */ 02037 /* 02038 * IanJa/Win32: Tab positions remain int for 32-bit API ?? 02039 */ 02040 LPINT iTabPixelPositions; /* List of positions for tabs */ 02041 HANDLE hFont; /* User settable font for listboxes */ 02042 int xOrigin; /* For horizontal scrolling. The current x origin */ 02043 int maxWidth; /* Maximum width of listbox in pixels for 02044 horizontal scrolling purposes */ 02045 PCBOX pcbox; /* Combo box pointer */ 02046 HDC hdc; /* hdc currently in use */ 02047 DWORD dwLocaleId; /* Locale used for sorting strings in list box */ 02048 int iTypeSearch; 02049 LPWSTR pszTypeSearch; 02050 SCROLLPOS HPos; 02051 SCROLLPOS VPos; 02052 } LBIV, *PLBIV; 02053 02054 typedef struct tagLBWND { 02055 WND wnd; 02056 PLBIV pLBIV; 02057 } LBWND, *PLBWND; 02058 02059 /* 02060 * kernel side input context structure. 02061 */ 02062 typedef struct tagIMC { /* hImc */ 02063 THRDESKHEAD head; 02064 struct tagIMC *pImcNext; 02065 ULONG_PTR dwClientImcData; // Client side data 02066 HWND hImeWnd; // in use Ime Window 02067 } IMC, *PIMC; 02068 02069 02070 /* 02071 * Hook structure. 02072 */ 02073 #undef HOOKBATCH 02074 typedef struct tagHOOK { /* hk */ 02075 THRDESKHEAD head; 02076 PHOOK phkNext; 02077 int iHook; // WH_xxx hook type 02078 KERNEL_ULONG_PTR offPfn; 02079 UINT flags; // HF_xxx flags 02080 int ihmod; 02081 PTHREADINFO ptiHooked; // Thread hooked. 02082 PDESKTOP rpdesk; // Global hook pdesk. Only used when 02083 // hook is locked and owner is destroyed 02084 #ifdef HOOKBATCH 02085 DWORD cEventMessages; // Number of events in the cache 02086 DWORD iCurrentEvent; // Current cache event 02087 DWORD CacheTimeOut; // Timeout between keys 02088 PEVENTMSG aEventCache; // The array of Events 02089 #endif // HOOKBATCH 02090 } HOOK; 02091 02092 /* 02093 * Hook defines. 02094 */ 02095 #define HF_GLOBAL 0x0001 02096 #define HF_ANSI 0x0002 02097 #define HF_NEEDHC_SKIP 0x0004 02098 #define HF_HUNG 0x0008 // Hook Proc hung don't call if system 02099 #define HF_HOOKFAULTED 0x0010 // Hook Proc faulted 02100 #define HF_NOPLAYBACKDELAY 0x0020 // Ignore requested delay 02101 #define HF_WX86KNOWNDLL 0x0040 // Hook Module is x86 machine type 02102 #define HF_DESTROYED 0x0080 // Set by FreeHook 02103 #if DBG 02104 #define HF_INCHECKWHF 0x0100 // fsHooks is being updated 02105 #define HF_FREED 0x0200 // Object has been freed. 02106 #define HF_DBGUSED 0x03FF // Update if adding a flag 02107 #endif 02108 02109 /* 02110 * Macro to convert the WH_* index into a bit position for 02111 * the fsHooks fields of SERVERINFO and THREADINFO. 02112 */ 02113 #define WHF_FROM_WH(n) (1 << (n + 1)) 02114 02115 /* 02116 * Flags for IsHooked(). 02117 */ 02118 #define WHF_MSGFILTER WHF_FROM_WH(WH_MSGFILTER) 02119 #define WHF_JOURNALRECORD WHF_FROM_WH(WH_JOURNALRECORD) 02120 #define WHF_JOURNALPLAYBACK WHF_FROM_WH(WH_JOURNALPLAYBACK) 02121 #define WHF_KEYBOARD WHF_FROM_WH(WH_KEYBOARD) 02122 #define WHF_GETMESSAGE WHF_FROM_WH(WH_GETMESSAGE) 02123 #define WHF_CALLWNDPROC WHF_FROM_WH(WH_CALLWNDPROC) 02124 #define WHF_CALLWNDPROCRET WHF_FROM_WH(WH_CALLWNDPROCRET) 02125 #define WHF_CBT WHF_FROM_WH(WH_CBT) 02126 #define WHF_SYSMSGFILTER WHF_FROM_WH(WH_SYSMSGFILTER) 02127 #define WHF_MOUSE WHF_FROM_WH(WH_MOUSE) 02128 #define WHF_HARDWARE WHF_FROM_WH(WH_HARDWARE) 02129 #define WHF_DEBUG WHF_FROM_WH(WH_DEBUG) 02130 #define WHF_SHELL WHF_FROM_WH(WH_SHELL) 02131 #define WHF_FOREGROUNDIDLE WHF_FROM_WH(WH_FOREGROUNDIDLE) 02132 02133 /* 02134 * Windowstation and desktop enum list structure. 02135 */ 02136 typedef struct tagNAMELIST { 02137 DWORD cb; 02138 DWORD cNames; 02139 WCHAR awchNames[1]; 02140 } NAMELIST, *PNAMELIST; 02141 02142 #define MONF_VISIBLE 0x01 // monitor is visible on desktop 02143 #define MONF_PALETTEDISPLAY 0x02 // monitor has palette 02144 02145 #ifndef _USERSRV_ 02146 /* 02147 * Monitor information structure. 02148 * 02149 * This structure defines the attributes of a single monitor 02150 * in a virtual display. 02151 */ 02152 typedef struct tagMONITOR { 02153 HEAD head; // object handle stuff 02154 02155 PMONITOR pMonitorNext; // next monitor in free or used list 02156 DWORD dwMONFlags; // flags 02157 RECT rcMonitor; // location of monitor in virtual screen coordinates 02158 RECT rcWork; // work area of monitor in virtual screen coordinates 02159 KHRGN hrgnMonitor; // monitor region in virtual screen coordinates 02160 short cFullScreen; // number of fullscreen apps on this monitor 02161 short cWndStack; // number of tiled top-level windows 02162 KHANDLE hDev; // hdev associated with this monitor 02163 } MONITOR; 02164 #endif 02165 02166 /* 02167 * Display Information Structure. 02168 * 02169 * This structure defines the display attributes for the 02170 * desktop. This is usually maintained in the DESKTOP 02171 * structure. The current display in use is pointed to 02172 * by gpDispInfo. 02173 * 02174 * CONSIDER: How many of these fields need to be actually kept 02175 * in a DISPLAYINFO that is not in use, rather than just be put 02176 * in gpsi or a kernel-side global? 02177 */ 02178 #ifndef _USERSRV_ 02179 02180 typedef struct tagDISPLAYINFO { 02181 // device stuff 02182 KHANDLE hDev; 02183 KERNEL_PVOID pmdev; 02184 KHANDLE hDevInfo; 02185 02186 // useful dcs 02187 KHDC hdcScreen; // Device-Context for screen 02188 KHDC hdcBits; // Holds system-bitmap resource 02189 02190 // Graystring resources 02191 KHDC hdcGray; // GrayString DC. 02192 KHBITMAP hbmGray; // GrayString Bitmap Surface. 02193 int cxGray; // width of gray bitmap 02194 int cyGray; // height of gray bitmap 02195 02196 // random stuff 02197 PDCE pdceFirst; // list of dcs 02198 PSPB pspbFirst; // list of spbs 02199 02200 // Monitors on this device 02201 ULONG cMonitors; // number of MONF_VISIBLE monitors attached to desktop 02202 PMONITOR pMonitorPrimary; // the primary monitor (display) 02203 PMONITOR pMonitorFirst; // monitor in use list 02204 02205 // device characteristics 02206 RECT rcScreen; // Rectangle of entire desktop surface 02207 KHRGN hrgnScreen; // region describing virtual screen 02208 WORD dmLogPixels; // pixels per inch 02209 WORD BitCountMax; // Maximum bitcount across all monitors 02210 02211 BOOL fDesktopIsRect:1; // Is the desktop a simple rectangle? 02212 BOOL fAnyPalette:1; // Are any of the monitors paletized? 02213 02214 // NOTE: if you need more flags, make fDesktopIsRect a flags field instead. 02215 02216 } DISPLAYINFO; 02217 02218 /* 02219 * Multimonitor function in rtl\mmrtl.c 02220 */ 02221 PMONITOR _MonitorFromPoint(POINT pt, DWORD dwFlags); 02222 PMONITOR _MonitorFromRect(LPCRECT lprc, DWORD dwFlags); 02223 PMONITOR _MonitorFromWindow(PWND pwnd, DWORD dwFlags); 02224 #endif 02225 02226 #define HDCBITS() gpDispInfo->hdcBits 02227 02228 #define DTF_NEEDSPALETTECHANGED 0x00000001 02229 #define DTF_NEEDSREDRAW 0x00000002 02230 02231 #define CWINHOOKS (WH_MAX - WH_MIN + 1) 02232 02233 /* 02234 * VWPL - Volatile Window Pointer List (see rare.c) 02235 * VPWLs are manipulate with the functions: 02236 * VWPLAdd(), VWPLRemove() and VWPLNext() 02237 */ 02238 typedef struct { 02239 DWORD cPwnd; // number of pwnds in apwnd[] 02240 DWORD cElem; // number of elements in apwnd[] 02241 DWORD cThreshhold; // (re)allocation increment/decrement 02242 PWND aPwnd[0]; // array of pwnds 02243 } VWPL, * KPTR_MODIFIER PVWPL; 02244 02245 /* 02246 * Desktop Information Structure. 02247 * 02248 * This structure contains information regading the 02249 * desktop. This is viewable from both the client and 02250 * kernel processes. 02251 */ 02252 typedef struct tagDESKTOPINFO { 02253 02254 KERNEL_PVOID pvDesktopBase; // For handle validation 02255 KERNEL_PVOID pvDesktopLimit; // ??? 02256 PWND spwnd; // Desktop window 02257 DWORD fsHooks; // Deskop global hooks 02258 PHOOK aphkStart[CWINHOOKS]; // List of hooks 02259 PWND spwndShell; // Shell window 02260 PPROCESSINFO ppiShellProcess; // Shell Process 02261 PWND spwndBkGnd; // Shell background window 02262 PWND spwndTaskman; // Task-Manager window 02263 PWND spwndProgman; // Program-Manager window 02264 PVWPL pvwplShellHook; // see (De)RegisterShellHookWindow 02265 int cntMBox; // ??? 02266 } DESKTOPINFO; 02267 02268 02269 #define CURSOR_ALWAYSDESTROY 0 02270 #define CURSOR_CALLFROMCLIENT 1 02271 #define CURSOR_THREADCLEANUP 2 02272 02273 typedef struct tagCURSOR_ACON { 02274 PROCMARKHEAD head; 02275 PCURSOR pcurNext; 02276 UNICODE_STRING strName; 02277 ATOM atomModName; 02278 WORD rt; 02279 } CURSOR_ACON; 02280 02281 typedef struct CURSOR_COMMON { 02282 CURSINFO; // CURSINFO includes the flags 02283 02284 DWORD bpp; 02285 DWORD cx; 02286 DWORD cy; 02287 } CURSOR_COMMON; 02288 02289 typedef struct ACON_COMMON { 02290 int cpcur; // Count of image frames 02291 int cicur; // Count of steps in animation sequence 02292 PCURSOR * KPTR_MODIFIER aspcur; // Array of image frame pointers 02293 DWORD * KPTR_MODIFIER aicur; // Array of frame indices (seq-table) 02294 JIF * KPTR_MODIFIER ajifRate; // Array of time offsets 02295 int iicur; // Current step in animation 02296 } ACON_COMMON; 02297 02298 typedef struct tagCURSOR { 02299 CURSOR_ACON; // common cursor/acon elements - 02300 // See SetSystemImage() 02301 CURSOR_COMMON; 02302 } CURSOR; 02303 02304 typedef struct tagACON { // acon 02305 CURSOR_ACON; // common cursor/acon elements - 02306 // See SetSystemImage() 02307 /* 02308 * CURSORF_flags must be the first element to follow CURSOR_ACON. This 02309 * way all members up to and including CURSORF_flags are the same in 02310 * tagCURSOR and tagACON which is needed for SetSystemImage. See more 02311 * comments for CI_FIRST in wingdi.w. 02312 */ 02313 DWORD CURSORF_flags; // same as CI_FIRST in CURSINFO 02314 02315 ACON_COMMON; 02316 } ACON, *PACON; 02317 02318 #define PICON PCURSOR 02319 02320 typedef struct tagCURSORDATA { 02321 KLPWSTR lpName; 02322 KLPWSTR lpModName; 02323 WORD rt; 02324 WORD dummy; 02325 02326 CURSOR_COMMON; 02327 02328 ACON_COMMON; 02329 } CURSORDATA, *PCURSORDATA; 02330 02331 02332 typedef struct tagCURSORFIND { 02333 02334 KHCURSOR hcur; 02335 DWORD rt; 02336 DWORD cx; 02337 DWORD cy; 02338 DWORD bpp; 02339 02340 } CURSORFIND, *PCURSORFIND; 02341 02342 #define MSGFLAG_MASK 0xFFFE0000 02343 #define MSGFLAG_WOW_RESERVED 0x00010000 // Used by WOW 02344 #define MSGFLAG_DDE_MID_THUNK 0x80000000 // DDE tracking thunk 02345 #define MSGFLAG_DDE_SPECIAL_SEND 0x40000000 // WOW bad DDE app hack 02346 #define MSGFLAG_SPECIAL_THUNK 0x10000000 // server->client thunk needs special handling 02347 02348 #define WIDTHBYTES(i) \ 02349 ((((i) + 31) & ~31) >> 3) 02350 02351 #define BITMAPWIDTHSIZE(cx, cy, planes, bpp) \ 02352 (WIDTHBYTES((cx * bpp)) * (cy) * (planes)) 02353 02354 /* 02355 * Window Style and State Masks - 02356 * 02357 * High byte of word is byte index from the start of the state field 02358 * in the WND structure, low byte is the mask to use on the byte. 02359 * These masks assume the order of the state and style fields of a 02360 * window instance structure. 02361 * 02362 * This is how the Test/Set/Clr/MaskWF value ranges map to the corresponding 02363 * fields in the window structure. 02364 * 02365 * offset WND field 02366 * 0 - 3 state - private 02367 * 4 - 7 state2 - private 02368 * 8 - B ExStyle - public, exposed in SetWindowLong(GWL_EXSTYLE) 02369 * C - F style - public, exposed in SetWindowLong(GWL_STYLE) 02370 * C-D are reserved for window class designer. 02371 * E-F are reserved for WS_ styles. 02372 * 02373 * NOTE: Be sure to add the flag to the wFlags array in kd\userexts.c!!! 02374 */ 02375 02376 /* 02377 * State flags, from 0x0000 to 0x0780. 02378 */ 02379 02380 /* 02381 * DON'T MOVE ANY ONE OF THE FOLLOWING WFXPRESENT FLAGS, 02382 * BECAUSE WFFRAMEPRESENTMASK DEPENDS ON THEIR VALUES 02383 */ 02384 #define WFMPRESENT 0x0001 02385 #define WFVPRESENT 0x0002 02386 #define WFHPRESENT 0x0004 02387 #define WFCPRESENT 0x0008 02388 #define WFFRAMEPRESENTMASK 0x000F 02389 02390 #define WFSENDSIZEMOVE 0x0010 02391 #define WFMSGBOX 0x0020 // used to maintain count of msg boxes on screen 02392 #define WFFRAMEON 0x0040 02393 #define WFHASSPB 0x0080 02394 #define WFNONCPAINT 0x0101 02395 #define WFSENDERASEBKGND 0x0102 02396 #define WFERASEBKGND 0x0104 02397 #define WFSENDNCPAINT 0x0108 02398 #define WFINTERNALPAINT 0x0110 02399 #define WFUPDATEDIRTY 0x0120 02400 #define WFHIDDENPOPUP 0x0140 02401 #define WFMENUDRAW 0x0180 02402 02403 /* 02404 * NOTE -- WFDIALOGWINDOW is used in WOW. DO NOT CHANGE without 02405 * changing WD_DIALOG_WINDOW in winuser.w 02406 */ 02407 #define WFDIALOGWINDOW 0x0201 02408 02409 #define WFTITLESET 0x0202 02410 #define WFSERVERSIDEPROC 0x0204 02411 #define WFANSIPROC 0x0208 02412 #define WFBEINGACTIVATED 0x0210 // prevent recursion in xxxActivateThis Window 02413 #define WFHASPALETTE 0x0220 02414 #define WFPAINTNOTPROCESSED 0x0240 // WM_PAINT message not processed 02415 #define WFSYNCPAINTPENDING 0x0280 02416 #define WFGOTQUERYSUSPENDMSG 0x0301 02417 #define WFGOTSUSPENDMSG 0x0302 02418 #define WFTOGGLETOPMOST 0x0304 // Toggle the WS_EX_TOPMOST bit ChangeStates 02419 02420 /* 02421 * DON'T MOVE REDRAWIFHUNGFLAGS WITHOUT ADJUSTING WFANYHUNGREDRAW 02422 */ 02423 #define WFREDRAWIFHUNG 0x0308 02424 #define WFREDRAWFRAMEIFHUNG 0x0310 02425 #define WFANYHUNGREDRAW 0x0318 02426 02427 #define WFANSICREATOR 0x0320 02428 #define WFREALLYMAXIMIZABLE 0x0340 // The window fills the work area or monitor when maximized 02429 #define WFDESTROYED 0x0380 02430 #define WFWMPAINTSENT 0x0401 02431 #define WFDONTVALIDATE 0x0402 02432 #define WFSTARTPAINT 0x0404 02433 #define WFOLDUI 0x0408 02434 #define WFCEPRESENT 0x0410 // Client edge present 02435 #define WFBOTTOMMOST 0x0420 // Bottommost window 02436 #define WFFULLSCREEN 0x0440 02437 #define WFINDESTROY 0x0480 02438 02439 /* 02440 * DON'T MOVE ANY ONE OF THE FOLLOWING WFWINXXCOMPAT FLAGS, 02441 * BECAUSE WFWINCOMPATMASK DEPENDS ON THEIR VALUES 02442 */ 02443 #define WFWIN31COMPAT 0x0501 // Win 3.1 compatible window 02444 #define WFWIN40COMPAT 0x0502 // Win 4.0 compatible window 02445 #define WFWIN50COMPAT 0x0504 // Win 5.0 compatibile window 02446 #define WFWINCOMPATMASK 0x0507 // Compatibility flag mask 02447 02448 #define WFMAXFAKEREGIONAL 0x0508 // Window has a fake region for maxing on 1 monitor 02449 02450 // Active Accessibility (Window Event) state 02451 #define WFCLOSEBUTTONDOWN 0x0510 02452 #define WFZOOMBUTTONDOWN 0x0520 02453 #define WFREDUCEBUTTONDOWN 0x0540 02454 #define WFHELPBUTTONDOWN 0x0580 02455 #define WFLINEUPBUTTONDOWN 0x0601 // Line up/left scroll button down 02456 #define WFPAGEUPBUTTONDOWN 0x0602 // Page up/left scroll area down 02457 #define WFPAGEDNBUTTONDOWN 0x0604 // Page down/right scroll area down 02458 #define WFLINEDNBUTTONDOWN 0x0608 // Line down/right scroll area down 02459 #define WFSCROLLBUTTONDOWN 0x0610 // Any scroll button down? 02460 #define WFVERTSCROLLTRACK 0x0620 // Vertical or horizontal scroll track... 02461 02462 #define WFALWAYSSENDNCPAINT 0x0640 // Always send WM_NCPAINT to children 02463 #define WFPIXIEHACK 0x0680 // Send (HRGN)1 to WM_NCPAINT (see PixieHack) 02464 02465 /* 02466 * WFFULLSCREENBASE MUST HAVE LOWORD OF 0. See SetFullScreen macro. 02467 */ 02468 #define WFFULLSCREENBASE 0x0700 // Fullscreen flags take up 0x0701 02469 #define WFFULLSCREENMASK 0x0707 // and 0x0702 and 0x0704 02470 #define WEFTRUNCATEDCAPTION 0x0708 // The caption text was truncated -> caption tootip 02471 02472 #define WFNOANIMATE 0x0710 // ??? 02473 #define WFSMQUERYDRAGICON 0x0720 // ??? Small icon comes from WM_QUERYDRAGICON 02474 #define WFSHELLHOOKWND 0x0740 // ??? 02475 #define WFISINITIALIZED 0x0780 // Window is initialized -- checked by WoW32 02476 02477 /* 02478 * Add more state flags here, up to 0x0780. 02479 * Look for empty slots above before adding to the end. 02480 * Be sure to add the flag to the wFlags array in kd\userexts.c 02481 */ 02482 02483 /* 02484 * Window Extended Style, from 0x0800 to 0x0B80. 02485 */ 02486 #define WEFDLGMODALFRAME 0x0801 // WS_EX_DLGMODALFRAME 02487 #define WEFDRAGOBJECT 0x0802 // ??? 02488 #define WEFNOPARENTNOTIFY 0x0804 // WS_EX_NOPARENTNOTIFY 02489 #define WEFTOPMOST 0x0808 // WS_EX_TOPMOST 02490 #define WEFACCEPTFILES 0x0810 // WS_EX_ACCEPTFILES 02491 #define WEFTRANSPARENT 0x0820 // WS_EX_TRANSPARENT 02492 #define WEFMDICHILD 0x0840 // WS_EX_MDICHILD 02493 #define WEFTOOLWINDOW 0x0880 // WS_EX_TOOLWINDOW 02494 #define WEFWINDOWEDGE 0x0901 // WS_EX_WINDOWEDGE 02495 #define WEFCLIENTEDGE 0x0902 // WS_EX_CLIENTEDGE 02496 #define WEFEDGEMASK 0x0903 // WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE 02497 #define WEFCONTEXTHELP 0x0904 // WS_EX_CONTEXTHELP 02498 02499 02500 // intl styles 02501 #define WEFRIGHT 0x0910 // WS_EX_RIGHT 02502 #define WEFRTLREADING 0x0920 // WS_EX_RTLREADING 02503 #define WEFLEFTSCROLL 0x0940 // WS_EX_LEFTSCROLLBAR 02504 02505 02506 #define WEFCONTROLPARENT 0x0A01 // WS_EX_CONTROLPARENT 02507 #define WEFSTATICEDGE 0x0A02 // WS_EX_STATICEDGE 02508 #define WEFAPPWINDOW 0x0A04 // WS_EX_APPWINDOW 02509 #define WEFLAYERED 0x0A08 // WS_EX_LAYERED 02510 02511 #ifdef USE_MIRRORING 02512 #define WEFNOINHERITLAYOUT 0x0A10 // WS_EX_NOINHERITLAYOUT 02513 #define WEFLAYOUTVBHRESERVED 0x0A20 // WS_EX_LAYOUTVBHRESERVED 02514 #define WEFLAYOUTRTL 0x0A40 // WS_EX_LAYOUTRTL 02515 #define WEFLAYOUTBTTRESERVED 0x0A80 // WS_EX_LAYOUTBTTRESERVED 02516 #endif 02517 02518 /* 02519 * To delay adding a new state3 DWORD in the WW structure, we're using 02520 * the extended style bits for now. If we'll need more of these, we'll 02521 * add the new DWORD and move these ones around 02522 */ 02523 #define WEFPUIFOCUSHIDDEN 0x0B80 // focus indicators hidden 02524 #define WEFPUIACCELHIDDEN 0x0B40 // keyboard acceleraors hidden 02525 02526 /* 02527 * Add more Window Extended Style flags here, up to 0x0B80. 02528 * Be sure to add the flag to the wFlags array in kd\userexts.c 02529 */ 02530 #ifdef REDIRECTION 02531 #define WEFREDIRECTED 0x0B01 // WS_EX_REDIRECTED 02532 #endif // REDIRECTION 02533 02534 #define WEFNOACTIVATE 0x0B08 // WS_EX_NOACTIVATE 02535 02536 /* 02537 * Window styles, from 0x0E00 to 0x0F80. 02538 */ 02539 #define WFMAXBOX 0x0E01 // WS_MAXIMIZEBOX 02540 #define WFTABSTOP 0x0E01 // WS_TABSTOP 02541 #define WFMINBOX 0x0E02 // WS_MAXIMIZEBOX 02542 #define WFGROUP 0x0E02 // WS_GROUP 02543 #define WFSIZEBOX 0x0E04 // WS_THICKFRAME, WS_SIZEBOX 02544 #define WFSYSMENU 0x0E08 // WS_SYSMENU 02545 #define WFHSCROLL 0x0E10 // WS_HSCROLL 02546 #define WFVSCROLL 0x0E20 // WS_VSCROLL 02547 #define WFDLGFRAME 0x0E40 // WS_DLGFRAME 02548 #define WFTOPLEVEL 0x0E40 // ??? 02549 #define WFBORDER 0x0E80 // WS_BORDER 02550 #define WFBORDERMASK 0x0EC0 // WS_BORDER | WS_DLGFRAME 02551 #define WFCAPTION 0x0EC0 // WS_CAPTION 02552 02553 #define WFTILED 0x0F00 // WS_OVERLAPPED, WS_TILED 02554 #define WFMAXIMIZED 0x0F01 // WS_MAXIMIZE 02555 #define WFCLIPCHILDREN 0x0F02 // WS_CLIPCHILDREN 02556 #define WFCLIPSIBLINGS 0x0F04 // WS_CLIPSIBLINGS 02557 #define WFDISABLED 0x0F08 // WS_DISABLED 02558 #define WFVISIBLE 0x0F10 // WS_VISIBLE 02559 #define WFMINIMIZED 0x0F20 // WS_MINIMIZE 02560 #define WFCHILD 0x0F40 // WS_CHILD 02561 #define WFPOPUP 0x0F80 // WS_POPUP 02562 #define WFTYPEMASK 0x0FC0 // WS_CHILD | WS_POPUP 02563 #define WFICONICPOPUP 0x0FC0 // WS_CHILD | WS_POPUP 02564 #define WFICONIC WFMINIMIZED 02565 /* 02566 * No more Window style flags are available, use Extended window styles. 02567 */ 02568 02569 /* 02570 * Window Styles for built-in classes, from 0x0C00 to 0x0D80. 02571 */ 02572 02573 // Buttons 02574 #define BFTYPEMASK 0x0C0F 02575 02576 #define BFRIGHTBUTTON 0x0C20 02577 #define BFICON 0x0C40 02578 #define BFBITMAP 0x0C80 02579 #define BFIMAGEMASK 0x0CC0 02580 02581 #define BFLEFT 0x0D01 02582 #define BFRIGHT 0x0D02 02583 #define BFCENTER 0x0D03 02584 #define BFHORZMASK 0x0D03 02585 #define BFTOP 0x0D04 02586 #define BFBOTTOM 0x0D08 02587 #define BFVCENTER 0x0D0C 02588 #define BFVERTMASK 0x0D0C 02589 #define BFALIGNMASK 0x0D0F 02590 02591 #define BFPUSHLIKE 0x0D10 02592 #define BFMULTILINE 0x0D20 02593 #define BFNOTIFY 0x0D40 02594 #define BFFLAT 0x0D80 02595 02596 #define ISBSTEXTOROD(pwnd) (!TestWF(pwnd, BFBITMAP) && !TestWF(pwnd, BFICON)) 02597 02598 // Combos 02599 #define CBFSIMPLE 0x0C01 02600 #define CBFDROPDOWN 0x0C02 02601 #define CBFDROPDOWNLIST 0x0C03 02602 02603 #define CBFEDITABLE 0x0C01 02604 #define CBFDROPPABLE 0x0C02 02605 #define CBFDROPTYPE 0x0C03 02606 02607 #define CBFOWNERDRAWFIXED 0x0C10 02608 #define CBFOWNERDRAWVAR 0x0C20 02609 #define CBFOWNERDRAW 0x0C30 02610 02611 #define CBFAUTOHSCROLL 0x0C40 02612 #define CBFOEMCONVERT 0x0C80 02613 #define CBFSORT 0x0D01 02614 #define CBFHASSTRINGS 0x0D02 02615 #define CBFNOINTEGRALHEIGHT 0x0D04 02616 #define CBFDISABLENOSCROLL 0x0D08 02617 #define CBFBUTTONUPTRACK 0x0D10 02618 02619 #define CBFUPPERCASE 0x0D20 02620 #define CBFLOWERCASE 0x0D40 02621 02622 // Dialogs 02623 #define DFSYSMODAL 0x0C02 02624 #define DF3DLOOK 0x0C04 02625 #define DFNOFAILCREATE 0x0C10 02626 #define DFLOCALEDIT 0x0C20 02627 #define WFNOIDLEMSG 0x0D01 02628 #define DFCONTROL 0x0D04 02629 02630 // Edits 02631 #define EFMULTILINE 0x0C04 02632 #define EFUPPERCASE 0x0C08 02633 #define EFLOWERCASE 0x0C10 02634 #define EFPASSWORD 0x0C20 02635 #define EFAUTOVSCROLL 0x0C40 02636 #define EFAUTOHSCROLL 0x0C80 02637 #define EFNOHIDESEL 0x0D01 02638 #define EFCOMBOBOX 0x0D02 02639 #define EFOEMCONVERT 0x0D04 02640 #define EFREADONLY 0x0D08 02641 #define EFWANTRETURN 0x0D10 02642 #define EFNUMBER 0x0D20 02643 02644 // Scrollbars 02645 #define SBFSIZEBOXTOPLEFT 0x0C02 02646 #define SBFSIZEBOXBOTTOMRIGHT 0x0C04 02647 #define SBFSIZEBOX 0x0C08 02648 #define SBFSIZEGRIP 0x0C10 02649 02650 // Statics 02651 #define SFTYPEMASK 0x0C1F 02652 #define SFNOPREFIX 0x0C80 02653 #define SFNOTIFY 0x0D01 02654 #define SFCENTERIMAGE 0x0D02 02655 #define SFRIGHTJUST 0x0D04 02656 #define SFREALSIZEIMAGE 0x0D08 02657 #define SFSUNKEN 0x0D10 02658 #define SFEDITCONTROL 0x0D20 02659 #define SFELLIPSISMASK 0x0DC0 02660 #define SFWIDELINESPACING 0x0C20 02661 02662 02663 /* 02664 * 02665 */ 02666 #define SYS_ALTERNATE 0x2000 02667 #define SYS_PREVKEYSTATE 0x4000 02668 02669 /*** AWESOME HACK ALERT!!! 02670 * 02671 * The low byte of the WF?PRESENT state flags must NOT be the 02672 * same as the low byte of the WFBORDER and WFCAPTION flags, 02673 * since these are used as paint hint masks. The masks are calculated 02674 * with the MaskWF macro below. 02675 * 02676 * The magnitude of this hack compares favorably with that of the national debt. 02677 * 02678 * STATEOFFSET is the offset into the WND structure of the state field. 02679 * The state field is actually part of the WW structure defined in wowuserp.h 02680 * which is embedded in the WND structure. 02681 */ 02682 #define STATEOFFSET (FIELD_OFFSET(WND, state)) 02683 02684 02685 /* 02686 * Redefine LOBYTE to get rid of compiler warning C4309: 02687 * 'cast' : truncation of constant value 02688 */ 02689 #ifdef LOBYTE 02690 #undef LOBYTE 02691 #endif 02692 02693 #define LOBYTE(w) ((BYTE)((w) & 0x00FF)) 02694 02695 #define TestWF(hwnd, flag) (*(((BYTE *)(hwnd)) + STATEOFFSET + (int)HIBYTE(flag)) & LOBYTE(flag)) 02696 #define SetWF(hwnd, flag) (*(((BYTE *)(hwnd)) + STATEOFFSET + (int)HIBYTE(flag)) |= LOBYTE(flag)) 02697 #define ClrWF(hwnd, flag) (*(((BYTE *)(hwnd)) + STATEOFFSET + (int)HIBYTE(flag)) &= ~LOBYTE(flag)) 02698 #define MaskWF(flag) ((WORD)( (HIBYTE(flag) & 1) ? LOBYTE(flag) << 8 : LOBYTE(flag))) 02699 02700 02701 #define TestwndChild(hwnd) (TestWF(hwnd, WFTYPEMASK) == LOBYTE(WFCHILD)) 02702 #define TestwndIPopup(hwnd) (TestWF(hwnd, WFTYPEMASK) == LOBYTE(WFICONICPOPUP)) 02703 #define TestwndTiled(hwnd) (TestWF(hwnd, WFTYPEMASK) == LOBYTE(WFTILED)) 02704 #define TestwndNIPopup(hwnd) (TestWF(hwnd, WFTYPEMASK) == LOBYTE(WFPOPUP)) 02705 #define TestwndPopup(hwnd) (TestwndNIPopup(hwnd) || TestwndIPopup(hwnd)) 02706 #define TestwndHI(hwnd) (TestwndTiled(hwnd) || TestwndIPopup(hwnd)) 02707 02708 #define GetChildParent(pwnd) (TestwndChild(pwnd) ? pwnd->spwndParent : (PWND)NULL) 02709 #define GetWindowCreator(pwnd) (TestwndChild(pwnd) ? pwnd->spwndParent : pwnd->spwndOwner) 02710 02711 #define TestwndFrameOn(pwnd) (TestWF(pwnd, WFFRAMEON) && (GETPTI(pwnd)->pq == gpqForeground)) 02712 02713 #define GetFullScreen(pwnd) (TestWF(pwnd, WFFULLSCREENMASK)) 02714 #define SetFullScreen(pwnd, state) (ClrWF(pwnd, WFFULLSCREENMASK), \ 02715 SetWF(pwnd, WFFULLSCREENBASE | (state & WFFULLSCREENMASK))) 02716 02717 //#define FTrueVis(pwnd) (pwnd->fs & WF_TRUEVIS) 02718 #define FTrueVis(pwnd) (_IsWindowVisible(pwnd)) 02719 #define _IsWindowEnabled(pwnd) (TestWF(pwnd, WFDISABLED) == 0) 02720 #define _IsIconic(pwnd) (TestWF(pwnd, WFMINIMIZED) != 0) 02721 #define _IsZoomed(pwnd) (TestWF(pwnd, WFMAXIMIZED) != 0) 02722 02723 WORD VersionFromWindowFlag(PWND pwnd); 02724 02725 #define SV_UNSET 0x0000 02726 #define SV_SET 0x0001 02727 #define SV_CLRFTRUEVIS 0x0002 02728 02729 /* 02730 * System menu IDs 02731 */ 02732 #define ID_SYSMENU 0x10 02733 #define ID_CLOSEMENU 0x20 02734 #define CHILDSYSMENU ID_CLOSEMENU 02735 #define ID_DIALOGSYSMENU 0x30 02736 #define ID_HSCROLLMENU 0x40 02737 #define ID_VSCROLLMENU 0x50 02738 02739 /* 02740 * Menu Item Structure 02741 */ 02742 typedef struct tagITEM { 02743 UINT fType; // Item Type Flags 02744 UINT fState; // Item State Flags 02745 UINT wID; 02746 PMENU spSubMenu; /* Handle to a popup */ 02747 KHANDLE hbmpChecked; /* Bitmap for an on check */ 02748 KHANDLE hbmpUnchecked; /* Bitmap for an off check */ 02749 KLPWSTR lpstr; //item's text 02750 DWORD cch; /* String: WCHAR count */ 02751 KERNEL_ULONG_PTR dwItemData; 02752 DWORD xItem; 02753 DWORD yItem; 02754 DWORD cxItem; 02755 DWORD cyItem; 02756 DWORD dxTab; 02757 DWORD ulX; /* String: Underline start */ 02758 DWORD ulWidth; /* String: underline width */ 02759 KHBITMAP hbmp; // item's bitmap 02760 int cxBmp; // bitmap width 02761 int cyBmp; // bitmap height 02762 } ITEM, * KPTR_MODIFIER PITEM, * KPTR_MODIFIER LPITEM; 02763 02764 /* 02765 * MENULIST structure, holds the PMENUs that contain a submenu 02766 * We store a list of menus in MENU.pParentMenus as a menu 02767 * can be submenu in more items 02768 */ 02769 typedef struct tagMENULIST { 02770 struct tagMENULIST *pNext; 02771 PMENU pMenu; 02772 } MENULIST, * KPTR_MODIFIER PMENULIST; 02773 02774 /* 02775 * Scroll menu arrow flags 02776 */ 02777 #define MSA_OFF 0 02778 #define MSA_ON 1 02779 #define MSA_ATTOP 2 02780 #define MSA_ATBOTTOM 3 02781 02782 /* 02783 * Menu Structure 02784 */ 02785 typedef struct tagMENU { 02786 PROCDESKHEAD head; 02787 DWORD fFlags; /* Menu Flags */ 02788 int iItem; /* Contains the position of the selected 02789 item in the menu. -1 if no selection */ 02790 UINT cAlloced; // Number of items that can fit in rgItems 02791 UINT cItems; /* Number of items in rgItems */ 02792 02793 DWORD cxMenu; 02794 DWORD cyMenu; 02795 DWORD cxTextAlign; /* Text align offset for popups*/ 02796 PWND spwndNotify; /* The owner hwnd of this menu */ 02797 PITEM rgItems; /* The list of items in this menu */ 02798 PMENULIST pParentMenus; // The list of parents (menus that have this as submenu) 02799 DWORD dwContextHelpId;// Context help Id for the whole menu 02800 DWORD cyMax; /* max menu height after which menu scrolls */ 02801 KERNEL_ULONG_PTR dwMenuData; /* app-supplied menu data */ 02802 02803 KHBRUSH hbrBack; // background brush for menu 02804 int iTop; // Scroll top 02805 int iMaxTop; // Scroll MaxTop 02806 DWORD dwArrowsOn:2; // Scroll flags 02807 } MENU, * KPTR_MODIFIER PMENU; 02808 02809 02810 /* 02811 * Items used for WinHelp and Context Sensitive help support 02812 */ 02813 02814 #define ID_HELPMENU 4 02815 02816 // WINHELP4 invoked type 02817 enum { 02818 TYPE_NORMAL, 02819 TYPE_POPUP, 02820 TYPE_TCARD 02821 }; 02822 02823 typedef struct tagDLGENUMDATA { 02824 PWND pwndDialog; 02825 PWND pwndControl; 02826 POINT ptCurHelp; 02827 } DLGENUMDATA, *PDLGENUMDATA; 02828 02829 BOOL CALLBACK EnumPwndDlgChildProc(PWND pwnd, LPARAM lParam); 02830 BOOL FIsParentDude(PWND pwnd); 02831 02832 02833 #define MNF_DONTSKIPSEPARATORS 0x0001 02834 02835 /* 02836 * The following masks can be used along with the wDisableFlags field of SB 02837 * to find if the Up/Left or Down/Right arrow or Both are disabled; 02838 * Now it is possible to selectively Enable/Disable just one or both the 02839 * arrows in a scroll bar control; 02840 */ 02841 #define LTUPFLAG 0x0001 // Left/Up arrow disable flag. 02842 #define RTDNFLAG 0x0002 // Right/Down arrow disable flag. 02843 02844 typedef struct tagSBCALC { 02845 SBDATA; /* this must be first -- we cast structure pointers */ 02846 int pxTop; 02847 int pxBottom; 02848 int pxLeft; 02849 int pxRight; 02850 int cpxThumb; 02851 int pxUpArrow; 02852 int pxDownArrow; 02853 int pxStart; /* Initial position of thumb */ 02854 int pxThumbBottom; 02855 int pxThumbTop; 02856 int cpx; 02857 int pxMin; 02858 } SBCALC, *PSBCALC; 02859 02860 typedef struct tagSBTRACK { 02861 DWORD fHitOld : 1; 02862 DWORD fTrackVert : 1; 02863 DWORD fCtlSB : 1; 02864 DWORD fTrackRecalc: 1; 02865 PWND spwndTrack; 02866 PWND spwndSB; 02867 PWND spwndSBNotify; 02868 RECT rcTrack; 02869 VOID (*xxxpfnSB)(PWND, UINT, WPARAM, LPARAM, PSBCALC); 02870 UINT cmdSB; 02871 UINT_PTR hTimerSB; 02872 int dpxThumb; /* Offset from mouse point to start of thumb box */ 02873 int pxOld; /* Previous position of thumb */ 02874 int posOld; 02875 int posNew; 02876 int nBar; 02877 PSBCALC pSBCalc; 02878 } SBTRACK, *PSBTRACK; 02879 02880 /* 02881 * How many times a thread can spin through get/peek message without idling 02882 * before the system puts the app in the background. 02883 */ 02884 #define CSPINBACKGROUND 100 02885 02886 #define CCHTITLEMAX 256 02887 02888 #define SW_MDIRESTORE 0xCC /* special xxxMinMaximize() command for MDI */ 02889 02890 /* 02891 * This is used by CreateWindow() - the 16 bit version of CW_USEDEFAULT, 02892 * that we still need to support. 02893 */ 02894 #define CW2_USEDEFAULT 0x8000 02895 #define CW_FLAGS_DIFFHMOD 0x80000000 02896 02897 02898 /* 02899 * Menu commands 02900 */ 02901 //#define MENUBIT (0x8000) 02902 //#define MENUUP (0x8000 | VK_UP) 02903 //#define MENUDOWN (0x8000 | VK_DOWN) 02904 //#define MENULEFT (0x8000 | VK_LEFT) 02905 //#define MENURIGHT (0x8000 | VK_RIGHT) 02906 //#define MENUEXECUTE TEXT('\r') /* Return character */ 02907 #define MENUSYSMENU TEXT(' ') /* Space character */ 02908 #define MENUCHILDSYSMENU TEXT('-') /* Hyphen */ 02909 02910 #define MF_ALLSTATE 0x00FF 02911 #define MF_MAINMENU 0xFFFF 02912 #define MFMWFP_OFFMENU 0 02913 #define MFMWFP_MAINMENU 0x0000FFFF 02914 #define MFMWFP_NOITEM 0xFFFFFFFF 02915 #define MFMWFP_UPARROW 0xFFFFFFFD /* Warning: Also used to define IDSYS_MNUP */ 02916 #define MFMWFP_DOWNARROW 0xFFFFFFFC /* Warning: Also used to define IDSYS_MNDOWN */ 02917 #define MFMWFP_MINVALID 0xFFFFFFFC 02918 #define MFMWFP_ALTMENU 0xFFFFFFFB 02919 #define MFMWFP_FIRSTITEM 0 02920 02921 02922 /* 02923 * NOTE: SMF() can only be used on single bit flags (NOT MRGFDISABLED!). 02924 */ 02925 #define SetMF(pmenu, flag) ((pmenu)->fFlags |= (flag)) 02926 #define ClearMF(pmenu, flag) ((pmenu)->fFlags &= ~(flag)) 02927 #define TestMF(pmenu, flag) ((pmenu)->fFlags & (flag)) 02928 02929 #define SetMFS(pitem, flag) ((pitem)->fState |= (flag)) 02930 #define TestMFS(pitem, flag) ((pitem)->fState & (flag)) 02931 #define ClearMFS(pitem, flag) ((pitem)->fState &= ~(flag)) 02932 02933 #define SetMFT(pitem, flag) ((pitem)->fType |= (flag)) 02934 #define TestMFT(pitem, flag) ((pitem)->fType & (flag)) 02935 #define ClearMFT(pitem, flag) ((pitem)->fType &= ~(flag)) 02936 02937 /* 02938 * Dialog structure (dlg). The window-words for the dialog structure must 02939 * be EXACTLY 30 bytes long! This is because Windows 3.0 exported a constant 02940 * called DLGWINDOWEXTRA that resolved to 30. Although we could redefine this 02941 * for 32-bit windows apps, we cannot redefine it for 16 bit apps (it is 02942 * a difficult problem). So instead we peg the window-words at 30 bytes 02943 * exactly, and allocate storage for the other information. 02944 */ 02945 typedef struct _DLG { 02946 DLGPROC lpfnDlg; 02947 DWORD flags; /* Various useful flags -- see definitions below */ 02948 int cxChar; 02949 int cyChar; 02950 KHWND hwndFocusSave; 02951 UINT fEnd : 1; 02952 UINT fDisabled : 1; 02953 KERNEL_INT_PTR result; /* DialogBox result */ 02954 KHANDLE hData; /* Global handle for edit ctl storage. */ 02955 KHFONT hUserFont; /* Handle of the font mentioned by the user in template*/ 02956 #ifdef SYSMODALWINDOWS 02957 KHWND hwndSysModalSave; /* Previous sysmodal window saved here */ 02958 #endif 02959 } DLG, * KPTR_MODIFIER PDLG; 02960 02961 typedef struct _DIALOG { 02962 WND wnd; 02963 KERNEL_LRESULT resultWP; /* window proc result -- DWL_MSGRESULT (+0) */ 02964 PDLG pdlg; 02965 KERNEL_LONG_PTR unused; /* DWL_USER (+8) */ 02966 BYTE reserved[DLGWINDOWEXTRA - sizeof(KERNEL_LRESULT) - sizeof(PDLG) - sizeof(KERNEL_LONG_PTR)]; 02967 } DIALOG, *PDIALOG; 02968 02969 #define PDLG(pwnd) (((PDIALOG)pwnd)->pdlg) 02970 02971 /* 02972 * Flags definitions for DLG.flags 02973 */ 02974 #define DLGF_ANSI 0x01 /* lpfnDlg is an ANSI proc */ 02975 02976 /* 02977 * MDI typedefs 02978 */ 02979 typedef struct tagMDI { 02980 UINT cKids; 02981 HWND hwndMaxedChild; 02982 HWND hwndActiveChild; 02983 HMENU hmenuWindow; 02984 UINT idFirstChild; 02985 UINT wScroll; 02986 LPWSTR pTitle; 02987 UINT iChildTileLevel; 02988 } MDI, * KPTR_MODIFIER PMDI; 02989 02990 typedef struct tagMDIWND { 02991 WND wnd; 02992 UINT dwReserved; // quattro pro 1.0 stores stuff here!! 02993 PMDI pmdi; 02994 } MDIWND, *PMDIWND; 02995 02996 #define GWLP_MDIDATA (FIELD_OFFSET(MDIWND, pmdi) - sizeof(WND)) 02997 02998 #define TIF_INCLEANUP (UINT)0x00000001 02999 #define TIF_16BIT (UINT)0x00000002 03000 #define TIF_SYSTEMTHREAD (UINT)0x00000004 03001 #define TIF_CSRSSTHREAD (UINT)0x00000008 03002 #define TIF_TRACKRECTVISIBLE (UINT)0x00000010 03003 #define TIF_ALLOWFOREGROUNDACTIVATE (UINT)0x00000020 03004 #define TIF_DONTATTACHQUEUE (UINT)0x00000040 03005 #define TIF_DONTJOURNALATTACH (UINT)0x00000080 03006 #define TIF_WOW64 (UINT)0x00000100 /* Thread is in a emulated 32bit process */ 03007 #define TIF_INACTIVATEAPPMSG (UINT)0x00000200 03008 #define TIF_SPINNING (UINT)0x00000400 03009 #define TIF_PALETTEAWARE (UINT)0x00000800 03010 #define TIF_SHAREDWOW (UINT)0x00001000 03011 #define TIF_FIRSTIDLE (UINT)0x00002000 03012 #define TIF_WAITFORINPUTIDLE (UINT)0x00004000 03013 #define TIF_MOVESIZETRACKING (UINT)0x00008000 03014 #define TIF_VDMAPP (UINT)0x00010000 03015 #define TIF_DOSEMULATOR (UINT)0x00020000 03016 #define TIF_GLOBALHOOKER (UINT)0x00040000 03017 #define TIF_DELAYEDEVENT (UINT)0x00080000 03018 #define TIF_MSGPOSCHANGED (UINT)0x00100000 03019 // 0x00200000 Unused. was TIF_SHUTDOWNCOMPLETE 03020 #define TIF_IGNOREPLAYBACKDELAY (UINT)0x00400000 03021 #define TIF_ALLOWOTHERACCOUNTHOOK (UINT)0x00800000 03022 #define TIF_GUITHREADINITIALIZED (UINT)0x02000000 03023 #define TIF_DISABLEIME (UINT)0x04000000 03024 #define TIF_INGETTEXTLENGTH (UINT)0x08000000 03025 #define TIF_ANSILENGTH (UINT)0x10000000 03026 03027 #define TIF_DISABLEHOOKS (UINT)0x20000000 03028 03029 #define TIF_RESTRICTED (UINT)0x40000000 03030 03031 /* 03032 * Client Thread Information Structure. 03033 * 03034 * This structure contains information regarding the 03035 * thread. This is viewable from both the client and 03036 * kernel processes. 03037 */ 03038 typedef struct tagCLIENTTHREADINFO { 03039 UINT CTIF_flags; 03040 WORD fsChangeBits; // Bits changes since last compared 03041 WORD fsWakeBits; // Bits currently available 03042 WORD fsWakeBitsJournal; // Bits saved while journalling 03043 WORD fsWakeMask; // Bits looking for when asleep 03044 LONG timeLastRead; // Time of last input read 03045 } CLIENTTHREADINFO; 03046 03047 #define CTIF_SYSQUEUELOCKED (UINT)0x00000001 03048 #define CTIF_INSENDMESSAGE (UINT)0x00000002 03049 03050 /* 03051 * First check for a 0, 0 filter which means we want all input. 03052 * If inverted message range, filter is exclusive. 03053 */ 03054 #define CheckMsgFilter(wMsg, wMsgFilterMin, wMsgFilterMax) \ 03055 ( ((wMsgFilterMin) == 0 && (wMsgFilterMax) == 0xFFFFFFFF) \ 03056 || ( ((wMsgFilterMin) > (wMsgFilterMax)) \ 03057 ? (((wMsg) < (wMsgFilterMax)) || ((wMsg) > (wMsgFilterMin))) \ 03058 : (((wMsg) >= (wMsgFilterMin)) && ((wMsg) <= (wMsgFilterMax))))) 03059 03060 UINT CalcWakeMask(UINT wMsgFilterMin, UINT wMsgFilterMax, UINT fsWakeMaskFilter); 03061 03062 /* 03063 * GetInputBits 03064 * This function checks if the specified input (fsWakeMask) has arrived (fsChangeBits) 03065 * or it's available (fsWakeBits) 03066 */ 03067 __inline WORD GetInputBits (PCLIENTTHREADINFO pcti, WORD fsWakeMask, BOOL fAvailable) 03068 { 03069 return (pcti->fsChangeBits | (fAvailable ? pcti->fsWakeBits : 0)) & fsWakeMask; 03070 } 03071 03072 03073 typedef struct tagCARET { 03074 struct tagWND *spwnd; 03075 UINT fVisible : 1; 03076 UINT fOn : 1; 03077 int iHideLevel; 03078 int x; 03079 int y; 03080 int cy; 03081 int cx; 03082 HBITMAP hBitmap; 03083 UINT_PTR hTimer; 03084 DWORD tid; 03085 } CARET, *PCARET; 03086 03087 #define XPixFromXDU(x, cxChar) MultDiv(x, cxChar, 4) 03088 #define YPixFromYDU(y, cyChar) MultDiv(y, cyChar, 8) 03089 #define XDUFromXPix(x, cxChar) MultDiv(x, 4, cxChar) 03090 #define YDUFromYPix(y, cyChar) MultDiv(y, 8, cyChar) 03091 03092 03093 /* 03094 * Flags for the Q structure. 03095 */ 03096 #define QF_UPDATEKEYSTATE (UINT)0x00001 03097 03098 #define QF_FMENUSTATUSBREAK (UINT)0x00004 03099 #define QF_FMENUSTATUS (UINT)0x00008 03100 #define QF_FF10STATUS (UINT)0x00010 03101 #define QF_MOUSEMOVED (UINT)0x00020 03102 #define QF_ACTIVATIONCHANGE (UINT)0x00040 // This flag is examined in the 03103 // menu loop code so that we 03104 // exit from menu mode if 03105 // another window was activated 03106 // while we were tracking 03107 // menus. This flag is set 03108 // whenever we activate a new 03109 // window. 03110 03111 #define QF_TABSWITCHING (UINT)0x00080 // This bit is used as a 03112 // safety check when alt- 03113 // tabbing between apps. It 03114 // tells us when to expect 03115 // a tab-switch in dwp.c. 03116 03117 #define QF_KEYSTATERESET (UINT)0x00100 03118 #define QF_INDESTROY (UINT)0x00200 03119 #define QF_LOCKNOREMOVE (UINT)0x00400 03120 #define QF_FOCUSNULLSINCEACTIVE (UINT)0x00800 03121 #define QF_DIALOGACTIVE (UINT)0x04000 03122 #define QF_EVENTDEACTIVATEREMOVED (UINT)0x08000 03123 03124 #define QF_CAPTURELOCKED 0x00100000 03125 #define QF_ACTIVEWNDTRACKING 0x00200000 03126 03127 /* 03128 * Constants for Round Frame balloons 03129 */ 03130 #define RNDFRM_CORNER 10 03131 #define RNDFRM_BORDER 3 03132 03133 /* 03134 * Constants for GetRealClientRect 03135 */ 03136 #define GRC_SCROLLS 0x0001 03137 #define GRC_MINWNDS 0x0002 03138 #define GRC_FULLSCREEN 0x0004 03139 03140 /* 03141 * Scroll bar info structure 03142 */ 03143 typedef struct tagSBWND { 03144 WND wnd; 03145 BOOL fVert; 03146 #ifdef COLOR_HOTTRACKING 03147 int ht; 03148 #endif // COLOR_HOTTRACKING 03149 UINT wDisableFlags; /* Indicates which arrow is disabled; */ 03150 SBCALC SBCalc; 03151 } SBWND, *PSBWND, *LPSBWND; 03152 03153 // 03154 // Special regions 03155 // 03156 #define HRGN_EMPTY ((HRGN)0) 03157 #define HRGN_FULL ((HRGN)1) 03158 #define HRGN_MONITOR ((HRGN)2) 03159 #define HRGN_SPECIAL_LAST HRGN_MONITOR 03160 03161 /* 03162 * SendMsgTimeout client/server transition struct 03163 */ 03164 typedef struct tagSNDMSGTIMEOUT { /* smto */ 03165 UINT fuFlags; // how to send the message, SMTO_BLOCK, SMTO_ABORTIFHUNG 03166 UINT uTimeout; // time-out duration 03167 ULONG_PTR lSMTOReturn; // return value TRUE or FALSE 03168 ULONG_PTR lSMTOResult; // result value for lpdwResult 03169 } SNDMSGTIMEOUT, *PSNDMSGTIMEOUT; 03170 03171 03172 #ifndef _USERK_ 03173 #define ConnectIfNecessary() \ 03174 { \ 03175 if ((NtCurrentTebShared()->Win32ThreadInfo == NULL) \ 03176 && !NtUserGetThreadState(UserThreadConnect)) { \ 03177 return 0; \ 03178 } \ 03179 } 03180 #endif 03181 03182 /* 03183 * Button data structures (use to be in usercli.h) 03184 */ 03185 typedef struct tagBUTN { 03186 PWND spwnd; 03187 UINT buttonState; // Leave this a word for compatibility with SetWindowWord( 0L ) 03188 HANDLE hFont; 03189 HANDLE hImage; 03190 UINT fPaintKbdCuesOnly : 1; 03191 } BUTN, *PBUTN; 03192 03193 typedef struct tagBUTNWND { 03194 WND wnd; 03195 PBUTN pbutn; 03196 } BUTNWND, *PBUTNWND; 03197 03198 /* 03199 * IME control data structures 03200 */ 03201 typedef struct tagIMEUI { 03202 PWND spwnd; 03203 KHIMC hIMC; 03204 KHWND hwndIMC; 03205 KHKL hKL; 03206 KHWND hwndUI; // To keep handle for UI window. 03207 int nCntInIMEProc; // Non-zero if hwnd has called into ImeWndProc. 03208 BOOL fShowStatus:1; // TRUE if don't want to show IME's window. 03209 BOOL fActivate:1; // TRUE if hwnd has called into ImeWndProc. 03210 BOOL fDestroy:1; // TRUE if hwnd has called into ImeWndProc. 03211 BOOL fDefault:1; // TRUE if this is the default IME. 03212 BOOL fChildThreadDef:1; // TRUE if this is the default IME which 03213 // thread has only child window. 03214 BOOL fCtrlShowStatus:1; // Control status of show status bar. 03215 BOOL fFreeActiveEvent:1; // Control status of show status bar. 03216 } IMEUI, *PIMEUI; 03217 03218 typedef struct tagIMEWND { 03219 WND wnd; 03220 PIMEUI pimeui; 03221 } IMEWND, *PIMEWND; 03222 03223 /* 03224 * SysErrorBox is a 3.1 API that has no 32-bit equivalent. It's 03225 * implemented for WOW in harderr.c. 03226 */ 03227 #define MAX_SEB_STYLES 11 /* number of SEB_* values */ 03228 03229 /* 03230 * The next values should be in the same order 03231 * with the ones in IDOK and STR_OK lists 03232 */ 03233 #define SEB_OK 0 /* Button with "OK". */ 03234 #define SEB_CANCEL 1 /* Button with "Cancel" */ 03235 #define SEB_ABORT 2 /* Button with "&Abort" */ 03236 #define SEB_RETRY 3 /* Button with "&Retry" */ 03237 #define SEB_IGNORE 4 /* Button with "&Ignore" */ 03238 #define SEB_YES 5 /* Button with "&Yes" */ 03239 #define SEB_NO 6 /* Button with "&No" */ 03240 #define SEB_CLOSE 7 /* Button with "&Close" */ 03241 #define SEB_HELP 8 /* Button with "&Help" */ 03242 #define SEB_TRYAGAIN 9 /* Button with "&Try Again" */ 03243 #define SEB_CONTINUE 10 /* Button with "&Continue" */ 03244 03245 #define SEB_DEFBUTTON 0x8000 /* Mask to make this button default */ 03246 03247 typedef struct _MSGBOXDATA { // mbd 03248 MSGBOXPARAMS; // Must be 1st item in structure 03249 PWND pwndOwner; // Converted hwndOwner 03250 WORD wLanguageId; 03251 INT * pidButton; // Array of button IDs 03252 LPWSTR * ppszButtonText; // Array of button text strings 03253 UINT cButtons; // Number of buttons 03254 UINT DefButton; 03255 UINT CancelId; 03256 } MSGBOXDATA, *PMSGBOXDATA, *LPMSGBOXDATA; 03257 03258 LPWSTR MB_GetString(UINT wBtn); 03259 int SoftModalMessageBox(LPMSGBOXDATA lpmb); 03260 03261 DWORD GetContextHelpId(PWND pwnd); 03262 03263 PITEM MNLookUpItem(PMENU pMenu, UINT wCmd, BOOL fByPosition, PMENU *ppMenuItemIsOn); 03264 BOOL xxxMNCanClose(PWND pwnd); 03265 PMENU xxxGetSysMenuHandle(PWND pwnd); 03266 PWND GetPrevPwnd(PWND pwndList, PWND pwndFind); 03267 BOOL _RegisterServicesProcess(DWORD dwProcessId); 03268 03269 #ifdef _USERK_ 03270 #define RTLMENU PMENU 03271 #define xxxRtlSetMenuInfo xxxSetMenuInfo 03272 #define xxxRtlSetMenuItemInfo(rtlMenu, uId, pmii) \ 03273 xxxSetMenuItemInfo(rtlMenu, uId, FALSE, pmii, NULL) 03274 #else 03275 #define RTLMENU HMENU 03276 #define xxxRtlSetMenuInfo NtUserThunkedMenuInfo 03277 #define xxxRtlSetMenuItemInfo(rtlMenu, uId, pmii) \ 03278 NtUserThunkedMenuItemInfo(rtlMenu, uId, FALSE, FALSE, pmii, NULL) 03279 #endif 03280 RTLMENU xxxLoadSysMenu (UINT uMenuId); 03281 03282 03283 BOOL _FChildVisible(PWND pwnd); 03284 03285 #define CH_PREFIX TEXT('&') 03286 // 03287 // Japan support both Kanji and English mnemonic characters, 03288 // toggled from control panel. Both mnemonics are embedded in menu 03289 // resource templates. The following prefixes guide their parsing. 03290 // 03291 #define CH_ENGLISHPREFIX 0x1E 03292 #define CH_KANJIPREFIX 0x1F 03293 03294 03295 BOOL RtlWCSMessageWParamCharToMB(DWORD msg, WPARAM *pWParam); 03296 BOOL RtlMBMessageWParamCharToWCS(DWORD msg, WPARAM *pWParam); 03297 03298 VOID RtlInitLargeAnsiString(PLARGE_ANSI_STRING plstr, LPCSTR psz, 03299 UINT cchLimit); 03300 VOID RtlInitLargeUnicodeString(PLARGE_UNICODE_STRING plstr, LPCWSTR psz, 03301 UINT cchLimit); 03302 03303 DWORD RtlGetExpWinVer(HANDLE hmod); 03304 03305 /***************************************************************************\ 03306 * 03307 * International multi-keyboard layout/font support 03308 * 03309 \***************************************************************************/ 03310 03311 #define DT_CHARSETDRAW 1 03312 #define DT_CHARSETINIT 2 03313 #define DT_CHARSETDONE 3 03314 #define DT_GETNEXTWORD 4 03315 03316 typedef void (FAR *LPFNTEXTDRAW)(HDC, int, int, LPWSTR, int, DWORD); 03317 03318 typedef struct { 03319 RECT rcFormat; // Format rectangle. 03320 int cxTabLength; // Tab length in pixels. 03321 int iXSign; 03322 int iYSign; 03323 int cyLineHeight; // Height of a line based on DT_EXTERNALLEADING 03324 int cxMaxWidth; // Width of the format rectangle. 03325 int cxMaxExtent; // Width of the longest line drawn. 03326 int cxRightMargin; // Right margin in pixels (with proper sign) 03327 LPFNTEXTDRAW lpfnTextDraw; // pointer to PSTextOut or PSMTextOut based 03328 // on DT_NOPREFIX flag. 03329 int cxOverhang; // Character overhang. 03330 BOOL bCharsetDll; // redirect to intl DLL, not textout 03331 int iCharset; // ANSI charset value 03332 } DRAWTEXTDATA, *LPDRAWTEXTDATA; 03333 03334 typedef LONG (*FPLPKTABBEDTEXTOUT) 03335 (HDC, int, int, LPCWSTR, int, int, CONST INT *, int, BOOL, int, int, int); 03336 03337 typedef void (*FPLPKPSMTEXTOUT) 03338 (HDC, int, int, LPWSTR, int, DWORD); 03339 03340 typedef int (*FPLPKDRAWTEXTEX) 03341 (HDC, int, int, LPCWSTR, int, BOOL, UINT, LPDRAWTEXTDATA, UINT, int); 03342 03343 extern FPLPKTABBEDTEXTOUT fpLpkTabbedTextOut; 03344 extern FPLPKPSMTEXTOUT fpLpkPSMTextOut; 03345 extern FPLPKDRAWTEXTEX fpLpkDrawTextEx; 03346 03347 03348 // The number of characters in the ellipsis string (string defined in rtl\drawtext.c). 03349 #define CCHELLIPSIS 3 03350 03351 int DrawTextExWorker(HDC hdc, LPWSTR lpchText, int cchText, LPRECT lprc, 03352 UINT dwDTformat, LPDRAWTEXTPARAMS lpDTparams, int iCharset); 03353 03354 03355 /***************************************************************************\ 03356 * 03357 * Language pack edit control callouts. 03358 * 03359 * Functions are accessed through the pLpkEditCallout pointer in the ED 03360 * structure. pLpkEditCallout points to a structure containing a pointer 03361 * to each callout routine. These are typedef'd here. 03362 * 03363 * (In Windows95 this was achieved through a single function pointer 03364 * - lpfnCharset - which was written in assembler and called from over 30 03365 * places with different parameters. Since for NT the Lpk is written in C, 03366 * the ED structure now points to a list of function pointers, each properly 03367 * typedef'd, improving performance, enabling typechecking and avoiding 03368 * varargs discrepancies between architectures.) 03369 * 03370 \***************************************************************************/ 03371 03372 typedef struct tagED *PED; 03373 03374 typedef BOOL LpkEditCreate (PED ped, HWND hWnd); 03375 03376 typedef int LpkEditIchToXY (PED ped, HDC hDC, PSTR pText, ICH cch, ICH ichPos); 03377 03378 typedef ICH LpkEditMouseToIch (PED ped, HDC hDC, PSTR pText, ICH cch, INT iX); 03379 03380 typedef ICH LpkEditCchInWidth (PED ped, HDC hdc, PSTR pText, ICH cch, int width); 03381 03382 typedef INT LpkEditGetLineWidth (PED ped, HDC hdc, PSTR pText, ICH cch); 03383 03384 typedef void LpkEditDrawText (PED ped, HDC hdc, PSTR pText, INT cch, INT iMinSel, INT iMaxSel, INT iY); 03385 03386 typedef BOOL LpkEditHScroll (PED ped, HDC hdc, PSTR pText); 03387 03388 typedef ICH LpkEditMoveSelection (PED ped, HDC hdc, PSTR pText, ICH ich, BOOL fLeft); 03389 03390 typedef int LpkEditVerifyText (PED ped, HDC hdc, PSTR pText, ICH ichInsert, PSTR pInsertText, ICH cchInsert); 03391 03392 typedef void LpkEditNextWord (PED ped, HDC hdc, PSTR pText, ICH ichStart, BOOL fLeft, ICH *pichMin, ICH *pichMax); 03393 03394 typedef void LpkEditSetMenu (PED ped, HMENU hMenu); 03395 03396 typedef int LpkEditProcessMenu (PED ped, UINT idMenuItem); 03397 03398 typedef int LpkEditCreateCaret (PED ped, HDC hdc, INT nWidth, INT nHeight, UINT hkl); 03399 03400 typedef ICH LpkEditAdjustCaret (PED ped, HDC hdc, PSTR pText, ICH ich); 03401 03402 03403 typedef struct tagLPKEDITCALLOUT { 03404 LpkEditCreate *EditCreate; 03405 LpkEditIchToXY *EditIchToXY; 03406 LpkEditMouseToIch *EditMouseToIch; 03407 LpkEditCchInWidth *EditCchInWidth; 03408 LpkEditGetLineWidth *EditGetLineWidth; 03409 LpkEditDrawText *EditDrawText; 03410 LpkEditHScroll *EditHScroll; 03411 LpkEditMoveSelection *EditMoveSelection; 03412 LpkEditVerifyText *EditVerifyText; 03413 LpkEditNextWord *EditNextWord; 03414 LpkEditSetMenu *EditSetMenu; 03415 LpkEditProcessMenu *EditProcessMenu; 03416 LpkEditCreateCaret *EditCreateCaret; 03417 LpkEditAdjustCaret *EditAdjustCaret; 03418 } LPKEDITCALLOUT, *PLPKEDITCALLOUT; 03419 03420 extern PLPKEDITCALLOUT fpLpkEditControl; 03421 03422 /***************************************************************************\ 03423 * 03424 * Structure for client-side thread-info. 03425 * dwHookCurrent HIWORD is current hook filter type (eg: WH_GETMESSAGE) 03426 * LOWORD is TRUE if current hook is ANSI, FALSE if Unicode 03427 * 03428 \***************************************************************************/ 03429 03430 03431 /* 03432 * Hook thunks. 03433 */ 03434 #ifdef REDIRECTION 03435 LRESULT CALLBACK fnHkINLPPOINT(DWORD nCode, 03436 WPARAM wParam, LPPOINT lParam, 03437 ULONG_PTR xParam, PROC xpfnProc); 03438 #endif // REDIRECTION 03439 03440 LRESULT CALLBACK fnHkINLPRECT(DWORD nCode, 03441 WPARAM wParam, LPRECT lParam, 03442 ULONG_PTR xParam, PROC xpfnProc); 03443 LRESULT CALLBACK fnHkINDWORD(DWORD nCode, 03444 WPARAM wParam, LPARAM lParam, 03445 ULONG_PTR xParam, PROC xpfnProc, LPDWORD lpFlags); 03446 LRESULT CALLBACK fnHkINLPMSG(DWORD nCode, 03447 WPARAM wParam, LPMSG lParam, 03448 ULONG_PTR xParam, PROC xpfnProc, BOOL bAnsi, LPDWORD lpFlags); 03449 LRESULT CALLBACK fnHkOPTINLPEVENTMSG(DWORD nCode, 03450 WPARAM wParam, LPEVENTMSGMSG lParam, 03451 ULONG_PTR xParam, PROC xpfnProc); 03452 LRESULT CALLBACK fnHkINLPDEBUGHOOKSTRUCT(DWORD nCode, 03453 WPARAM wParam, LPDEBUGHOOKINFO lParam, 03454 ULONG_PTR xParam, PROC xpfnProc); 03455 LRESULT CALLBACK fnHkINLPMOUSEHOOKSTRUCTEX(DWORD nCode, 03456 WPARAM wParam, LPMOUSEHOOKSTRUCTEX lParam, 03457 ULONG_PTR xParam, PROC xpfnProc, LPDWORD lpFlags); 03458 LRESULT CALLBACK fnHkINLPKBDLLHOOKSTRUCT(DWORD nCode, 03459 WPARAM wParam, LPKBDLLHOOKSTRUCT lParam, 03460 ULONG_PTR xParam, PROC xpfnProc); 03461 LRESULT CALLBACK fnHkINLPMSLLHOOKSTRUCT(DWORD nCode, 03462 WPARAM wParam, LPMSLLHOOKSTRUCT lParam, 03463 ULONG_PTR xParam, PROC xpfnProc); 03464 LRESULT CALLBACK fnHkINLPCBTACTIVATESTRUCT(DWORD nCode, 03465 WPARAM wParam, LPCBTACTIVATESTRUCT lParam, 03466 ULONG_PTR xParam, PROC xpfnProc); 03467 LRESULT CALLBACK fnHkINLPCBTCSTRUCT(UINT msg, 03468 WPARAM wParam, LPCBT_CREATEWND pcbt, 03469 PROC xpfnProc, BOOL bAnsi); 03470 LRESULT CALLBACK fnHkINLPCBTMDICCSTRUCT(UINT msg, 03471 WPARAM wParam, LPCBT_CREATEWND pcbt, 03472 PROC xpfnProc, BOOL bAnsi); 03473 03474 #ifdef REDIRECTION 03475 LRESULT CALLBACK fnHkINLPHTHOOKSTRUCT(DWORD nCode, 03476 WPARAM wParam, LPHTHOOKSTRUCT lParam, 03477 ULONG_PTR xParam, PROC xpfnProc); 03478 #endif // REDIRECTION 03479 03480 /***************************************************************************\ 03481 * 03482 * Definitions for client/server-specific data referenced by rtl routines. 03483 * 03484 \***************************************************************************/ 03485 03486 extern HBRUSH ghbrWhite; 03487 extern HBRUSH ghbrBlack; 03488 03489 03490 ULONG_PTR GetCPD(PVOID pWndOrCls, DWORD options, ULONG_PTR dwData); 03491 03492 BOOL TestWindowProcess(PWND pwnd); 03493 DWORD GetAppCompatFlags(PTHREADINFO pti); 03494 DWORD GetAppCompatFlags2(WORD wVer); 03495 DWORD GetAppImeCompatFlags(PTHREADINFO pti); 03496 PWND _GetDesktopWindow(VOID); 03497 PWND _GetMessageWindow(VOID); 03498 03499 /***************************************************************************\ 03500 * 03501 * Shared function prototypes 03502 * 03503 \***************************************************************************/ 03504 03505 03506 PVOID FASTCALL HMValidateHandle(HANDLE h, BYTE btype); 03507 PVOID FASTCALL HMValidateCatHandleNoRip(HANDLE h, BYTE btype); 03508 PVOID FASTCALL HMValidateHandleNoRip(HANDLE h, BYTE btype); 03509 KERNEL_PVOID FASTCALL HMValidateHandleNoDesktop(HANDLE h, BYTE btype); 03510 PVOID FASTCALL HMValidateSharedHandle(HANDLE h, BYTE bType); 03511 03512 PVOID FASTCALL HMValidateCatHandleNoSecure(HANDLE h, BYTE bType); 03513 PVOID FASTCALL HMValidateCatHandleNoSecureCCX(HANDLE h, BYTE bType, PCLIENTINFO ccxPci); 03514 PVOID FASTCALL HMValidateHandleNoSecure(HANDLE h, BYTE bType); 03515 03516 ULONG_PTR MapClientNeuterToClientPfn(PCLS pcls, KERNEL_ULONG_PTR dw, BOOL bAnsi); 03517 ULONG_PTR MapServerToClientPfn(KERNEL_ULONG_PTR dw, BOOL bAnsi); 03518 03519 BOOL IsSysFontAndDefaultMode(HDC hdc); 03520 03521 int GetCharDimensions(HDC hDC, TEXTMETRICW *lpTextMetrics, LPINT lpcy); 03522 03523 int GetWindowBorders(LONG lStyle, DWORD dwExStyle, BOOL fWindow, BOOL fClient); 03524 PWND SizeBoxHwnd(PWND pwnd); 03525 VOID _GetClientRect(PWND pwnd, LPRECT prc); 03526 03527 #ifndef _USERSRV_ 03528 void GetRealClientRect(PWND pwnd, LPRECT prc, UINT uFlags, PMONITOR pMonitor); 03529 #endif 03530 03531 VOID _GetWindowRect(PWND pwnd, LPRECT prc); 03532 PWND _GetLastActivePopup(PWND pwnd); 03533 BOOL _IsChild(PWND pwndParent, PWND pwnd); 03534 BOOL _AdjustWindowRectEx(LPRECT lprc, LONG style, BOOL fMenu, DWORD dwExStyle); 03535 BOOL NeedsWindowEdge(DWORD dwStyle, DWORD dwExStyle, BOOL fNewApp); 03536 VOID _ClientToScreen(PWND pwnd, PPOINT ppt); 03537 VOID _ScreenToClient(PWND pwnd, PPOINT ppt); 03538 int _MapWindowPoints(PWND pwndFrom, PWND pwndTo, LPPOINT lppt, DWORD cpt); 03539 BOOL _IsWindowVisible(PWND pwnd); 03540 BOOL _IsDescendant(PWND pwndParent, PWND pwndChild); 03541 BOOL IsVisible(PWND pwnd); 03542 PWND _GetWindow(PWND pwnd, UINT cmd); 03543 PWND _GetParent(PWND pwnd); 03544 int FindNCHit(PWND pwnd, LONG lPt); 03545 SHORT _GetKeyState(int vk); 03546 PHOOK PhkNextValid(PHOOK phk); 03547 03548 #define GRECT_CLIENT 0x0001 03549 #define GRECT_WINDOW 0x0002 03550 #define GRECT_RECTMASK 0x0003 03551 03552 #define GRECT_CLIENTCOORDS 0x0010 03553 #define GRECT_WINDOWCOORDS 0x0020 03554 #define GRECT_PARENTCOORDS 0x0040 03555 #define GRECT_COORDMASK 0x0070 03556 03557 void GetRect(PWND pwnd, LPRECT lprc, UINT uCoords); 03558 03559 PPROP _FindProp(PWND pwnd, PCWSTR pszKey, BOOL fInternal); 03560 HANDLE _GetProp(PWND pwnd, PCWSTR pszKey, BOOL fInternal); 03561 BOOL _HasCaptionIcon(PWND pwnd); 03562 PWND GetTopLevelWindow(PWND pwnd); 03563 03564 BOOL _SBGetParms(PWND pwnd, int code, PSBDATA pw, LPSCROLLINFO lpsi); 03565 BOOL PSMGetTextExtent(HDC hdc, LPCWSTR lpstr, int cch, PSIZE psize); 03566 03567 LONG GetPrefixCount(LPCWSTR lpstr, int cb, LPWSTR lpstrCopy, int cbCopy); 03568 PMENU _GetSubMenu(PMENU pMenu, int nPos); 03569 DWORD _GetMenuDefaultItem(PMENU pMenu, BOOL fByPosition, UINT uFlags); 03570 UINT _GetMenuState(PMENU pMenu, UINT wID, UINT dwFlags); 03571 03572 BOOL APIENTRY CopyInflateRect(LPRECT prcDst, CONST RECT *prcSrc, int cx, int cy); 03573 BOOL APIENTRY CopyOffsetRect(LPRECT prcDst, CONST RECT *prcSrc, int cx, int cy); 03574 03575 DWORD FindCharPosition(LPWSTR lpString, WCHAR ch); 03576 LPWSTR TextAlloc(LPCWSTR lpsz); 03577 UINT TextCopy(PLARGE_UNICODE_STRING pstr, LPWSTR lpstr, UINT size); 03578 DWORD wcsncpycch(LPWSTR pwsDest, LPCWSTR pwszSrc, DWORD cch); 03579 DWORD strncpycch(LPSTR pszDest, LPCSTR pszSrc, DWORD cch); 03580 03581 03582 #define TextPointer(h) ((LPWSTR)h) 03583 03584 BOOL DrawFrame(HDC hdc, LPRECT prect, int clFrame, int cmd); 03585 void DrawPushButton(HDC hdc, LPRECT lprc, UINT state, UINT flags); 03586 BOOL ClientFrame(HDC hDC, CONST RECT *pRect, HBRUSH hBrush, DWORD patOp); 03587 03588 HBITMAP OwnerLoadBitmap( 03589 HANDLE hInstLoad, 03590 LPWSTR lpName, 03591 HANDLE hOwner); 03592 03593 PCURSOR ClassSetSmallIcon( 03594 PCLS pcls, 03595 PCURSOR pcursor, 03596 BOOL fServerCreated); 03597 03598 #define DO_DROPFILE 0x454C4946L 03599 03600 #define ISTS() (!!(USER_SHARED_DATA->SuiteMask & (1 << TerminalServer))) 03601 03602 /* 03603 * Structure for DoConnect system call. 03604 */ 03605 typedef struct _DOCONNECTDATA { 03606 BOOL fMouse; 03607 BOOL fINetClient; 03608 BOOL fInitialProgram; 03609 BOOL fHideTitleBar; 03610 HANDLE IcaVideoChannel; 03611 HANDLE IcaBeepChannel; 03612 HANDLE IcaMouseChannel; 03613 HANDLE IcaKeyboardChannel; 03614 HANDLE IcaThinwireChannel; 03615 WCHAR WinStationName[32]; 03616 WCHAR ProtocolName[10]; 03617 WCHAR AudioDriverName[10]; 03618 BOOL fClientDoubleClickSupport; 03619 BOOL fEnableWindowsKey; 03620 DWORD drBitsPerPel; 03621 DWORD drPelsWidth; 03622 DWORD drPelsHeight; 03623 DWORD drDisplayFrequency; 03624 USHORT drProtocolType; 03625 CLIENTKEYBOARDTYPE ClientKeyboardType; 03626 } DOCONNECTDATA, *PDOCONNECTDATA; 03627 03628 /* 03629 * Structure for DoReconnect system call. 03630 */ 03631 typedef struct _DORECONNECTDATA { 03632 BOOL fMouse; 03633 BOOL fINetClient; 03634 WCHAR WinStationName[32]; 03635 BOOL fClientDoubleClickSupport; 03636 BOOL fEnableWindowsKey; 03637 DWORD drBitsPerPel; 03638 DWORD drPelsWidth; 03639 DWORD drPelsHeight; 03640 DWORD drDisplayFrequency; 03641 USHORT drProtocolType; 03642 BOOL fChangeDisplaySettings; 03643 CLIENTKEYBOARDTYPE ClientKeyboardType; 03644 } DORECONNECTDATA, *PDORECONNECTDATA; 03645 03646 /* 03647 * EndTask, ExitWindows, hung app, etc time outs 03648 */ 03649 #define CMSSLEEP 250 03650 #define CMSHUNGAPPTIMEOUT (5 * 1000) 03651 #define CMSHUNGTOKILLCOUNT 4 03652 #define CMSWAITTOKILLTIMEOUT (CMSHUNGTOKILLCOUNT * CMSHUNGAPPTIMEOUT) 03653 #define CMSAPPSTARTINGTIMEOUT (6 * CMSHUNGAPPTIMEOUT) /* Some setup apps are pretty slow. bug 195832 */ 03654 #define CMS_QANIMATION 165 03655 #define CMS_FLASHWND 500 03656 #define CMS_MENUFADE 175 03657 #define CMS_SELECTIONFADE 350 03658 #define CMS_TOOLTIP 135 03659 #define PROCESSTERMINATETIMEOUT (90 * 1000) 03660 03661 void KernelBP(void); 03662 03663 /* 03664 * Message table definitions 03665 */ 03666 typedef struct tagMSG_TABLE_ENTRY { 03667 BYTE iFunction:6; 03668 BYTE bThunkMessage:1; 03669 BYTE bSyncOnlyMessage:1; 03670 } MSG_TABLE_ENTRY; 03671 03672 extern CONST MSG_TABLE_ENTRY MessageTable[]; 03673 03674 #define TESTSYNCONLYMESSAGE(msg, wParam) (((msg) < WM_USER) ? \ 03675 ( (MessageTable[msg].bSyncOnlyMessage) || \ 03676 (((msg) == WM_DEVICECHANGE) && ((wParam) & 0x8000))) : \ 03677 0) 03678 03679 03680 /* 03681 * Drag and Drop menus. 03682 * MNDragOver output info 03683 */ 03684 typedef struct tagMNDRAGOVERINFO 03685 { 03686 DWORD dwFlags; 03687 HMENU hmenu; 03688 UINT uItemIndex; 03689 HWND hwndNotify; 03690 } MNDRAGOVERINFO, * PMNDRAGOVERINFO; 03691 03692 #ifdef _USERK_ 03693 typedef struct tagMOUSECURSOR { 03694 BYTE bAccelTableLen; 03695 BYTE bAccelTable[128]; 03696 BYTE bConstantTableLen; 03697 BYTE bConstantTable[128]; 03698 } MOUSECURSOR; 03699 #endif 03700 03701 typedef struct tagINTERNALSETHIGHCONTRAST { 03702 UINT cbSize; 03703 DWORD dwFlags; 03704 UNICODE_STRING usDefaultScheme; 03705 } INTERNALSETHIGHCONTRAST, *LPINTERNALSETHIGHCONTRAST; 03706 03707 03708 #endif // _USER_

Generated on Sat May 15 19:42:12 2004 for test by doxygen 1.3.7