00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
#ifndef _USER_
00016
#define _USER_
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
#include "w32wow64.h"
00097
00098
DECLARE_KHANDLE(HIMC);
00099
00100
00101
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
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
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
00163
00164 #define ICON_PROP_NAME L"SysIC"
00165
00166
00167
00168
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
00184
00185
00186
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
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
00221 #define GetClientInfo() ((PCLIENTINFO)((NtCurrentTebShared())->Win32ClientInfo))
00222
#endif
00223
00224
00225 #define HEVENT_REMOVEME ((HANDLE)IntToPtr( 0xFFFFFFFF ))
00226
00227
00228
00229
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
00244
00245
00246 #define DESTINATION (DWORD)0x00AA0000
00247 #define SOURCE (DWORD)0x00CC0000
00248 #define PATTERN (DWORD)0x00F00000
00249
00250
00251
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
00262
00263 #define MAX_MB_STRINGS 11
00264
00265
00266
00267
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
00293
00294
00295
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
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)
00323
00324
00325
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
00335 #define IDSYS_LBSEARCH 0x0000FFFCL
00336 #define IDSYS_MNUP MFMWFP_UPARROW
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
00346
00347
00348
00349
00350
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
00364
00365
00366
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
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
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418 #define CALLBACKSTACKLIMIT (KERNEL_PAGE_SIZE / 2)
00419
00420
00421
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
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
00446
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
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
00494
00495
typedef struct _DRAWICONEXDATA {
00496 HBITMAP
hbmMask;
00497 HBITMAP
hbmColor;
00498 int cx;
00499 int cy;
00500 }
DRAWICONEXDATA;
00501
00502
00503
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
00518
00519
00520
00521
00522
00523
typedef struct _CLIENTINFO {
00524 KERNEL_ULONG_PTR
CI_flags;
00525 KERNEL_ULONG_PTR
cSpins;
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];
00548
00549
00550
00551
00552
00553
00554 KERNEL_MSG
msgDbcsCB;
00555
00556
00557
00558
#ifdef LATER
00559
EVENTMSG eventCached;
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
00574
00575
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
00584
00585
00586
00587
00588 #define WMCR_IR_DBCSCHAR 0x80000000
00589
00590
00591
00592 #define IS_DBCS_MESSAGE(DbcsChar) (((DWORD)(DbcsChar)) & 0x0000FF00)
00593
00594
00595
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
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
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
00662
00663
00664
00665
00666 #define WMCSR_ALLOWSHUTDOWN 1
00667 #define WMCSR_DONE 2
00668 #define WMCSR_CANCEL 3
00669
00670
00671
00672
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
00686
00687
00688
00689
00690
00691
00692
00693 #define MFISPOPUP 0x00000001
00694 #define MFMULTIROW 0x00000002
00695 #define MFUNDERLINE 0x00000004
00696 #define MFWINDOWDC 0x00000008
00697 #define MFINACTIVE 0x00000010
00698 #define MFRTL 0x00000020
00699 #define MFDESKTOP 0x00000040
00700 #define MFSYSMENU 0x00000080
00701 #define MFAPPSYSMENU 0x00000100
00702 #define MFLAST 0x00000100
00703
00704
#if (MNS_LAST <= MFLAST)
00705
#error MNS_ AND MF defines conflict
00706
#endif // (MNS_LAST <= MFLAST)
00707
00708
00709
00710
typedef struct tagEVENT_PACKET {
00711 DWORD EventType;
00712 WORD
fSense;
00713 WORD
cbEventData;
00714 DWORD Data;
00715 }
EVENT_PACKET, *
PEVENT_PACKET;
00716
00717
00718
00719 #define GWLP_INSTANCE_INFO 0 // PCL_INSTANCE_INFO
00720
00721
00722
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
00735
00736 #define GWLP_PSI 0
00737
00738
00739
00740 #define GWLP_PSII 0
00741
00742
00743
00744
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
00776
00777
00778 #define WS_EX_MDICHILD 0x00000040L // Internal
00779 #define WS_EX_ANSICREATOR 0x80000000L // Internal
00780
00781
00782
00783
00784 #define FW_BOTH 0
00785 #define FW_16BIT 1
00786 #define FW_32BIT 2
00787
00788
00789
00790
00791 #define FIELD_SIZE(type, field) (sizeof(((type *)0)->field))
00792
00793 #define FLASTKEY 0x80
00794
00795
00796
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
00812
00813
00814
00815
00816
00817
00818
00819
00820
00821
00822
00823
00824
00825
00826
00827
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837
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
00881
00882
00883
00884
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
00915
00916
00917
typedef struct _PFNCLIENT {
00918 KPROC
pfnScrollBarWndProc;
00919 KPROC
pfnTitleWndProc;
00920 KPROC
pfnMenuWndProc;
00921 KPROC
pfnDesktopWndProc;
00922 KPROC
pfnDefWindowProc;
00923
00924
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
00937
00938 KPROC
pfnHkINLPCWPSTRUCT;
00939 KPROC
pfnHkINLPCWPRETSTRUCT;
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
00988
00989
00990
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
01016
typedef struct tagOEMBITMAPINFO
01017 {
01018 int x;
01019 int y;
01020 int cx;
01021 int cy;
01022 }
OEMBITMAPINFO, *
POEMBITMAPINFO;
01023
01024
01025
01026
01027
01028
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
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
01144
01145
01146
01147
01148 #define NCHARS 256
01149 #define NCTRLS 0x20
01150
01151 #define PUSIF_PALETTEDISPLAY 0x00000001
01152 #define PUSIF_SNAPTO 0x00000002
01153 #define PUSIF_COMBOBOXANIMATION 0x00000004
01154 #define PUSIF_LISTBOXSMOOTHSCROLLING 0x00000008
01155 #define PUSIF_KEYBOARDCUES 0x00000020
01156
01157 #define PUSIF_UIEFFECTS 0x80000000
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
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
01182
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;
01194
01195 UINT dtScroll;
01196 UINT dtLBSearch;
01197 UINT dtCaretBlink;
01198 UINT ucWheelScrollLines;
01199
01200 int wMaxLeftOverlapChars;
01201 int wMaxRightOverlapChars;
01202
01203
01204
01205
01206 int cxSysFontChar;
01207 int cySysFontChar;
01208 int cxMsgFontChar;
01209 int cyMsgFontChar;
01210 TEXTMETRIC
tmSysFont;
01211
01212
01213
01214
01215 KHICON
hIconSmWindows;
01216 KHICON
hIcoWindows;
01217
01218 KHFONT
hCaptionFont;
01219 KHFONT
hMsgFont;
01220
01221
01222
01223
01224 DWORD dwKeyCache;
01225 DWORD dwAsyncKeyCache;
01226 DWORD cCaptures;
01227
01228
01229
01230
01231
01232
01233
01234 OEMBITMAPINFO oembmi[
OBI_COUNT];
01235 RECT
rcScreen;
01236 WORD
BitCount;
01237 WORD
dmLogPixels;
01238 BYTE Planes;
01239 BYTE BitsPixel;
01240
01241 DWORD PUSIFlags;
01242 UINT uCaretWidth;
01243 LANGID
UILangID;
01244
01245 BOOL bLastRITWasKeyboard : 1;
01246 BOOL bKeyboardPref : 1;
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 {
01265 WORD
wRIPFlags;
01266 WORD
wSRVIFlags;
01267 WORD
wRIPPID;
01268 WORD
wRIPError;
01269
01270 KERNEL_ULONG_PTR
cHandleEntries;
01271
01272
01273
01274
01275
01276
01277
01278
01279 WNDPROC_PWNDEX mpFnidPfn[
FNID_ARRAY_SIZE];
01280 WNDPROC_PWND aStoCidPfn[(
FNID_WNDPROCEND -
FNID_START) + 1];
01281
01282
01283 WORD
mpFnid_serverCBWndProc[(
FNID_END -
FNID_START) + 1];
01284
01285
01286
01287
01288 struct _PFNCLIENT apfnClientA;
01289 struct _PFNCLIENT apfnClientW;
01290 struct _PFNCLIENTWORKER apfnClientWorker;
01291
01292 DWORD cbHandleTable;
01293
01294
01295
01296
01297 ATOM
atomSysClass[
ICLS_MAX];
01298
01299 DWORD dwDefaultHeapBase;
01300 DWORD dwDefaultHeapSize;
01301
01302 UINT uiShellMsg;
01303
01304 UINT wMaxBtnSize;
01305
01306 MBSTRING MBStrings[
MAX_MB_STRINGS];
01307
01308
01309
01310
01311 ATOM
atomIconSmProp;
01312 ATOM
atomIconProp;
01313
01314 ATOM
atomContextHelpIdProp;
01315
01316 char acOemToAnsi[
NCHARS];
01317 char acAnsiToOem[
NCHARS];
01318
01319
01320
01321
01322
01323 PERUSERSERVERINFO;
01324
01325
#if DEBUGTAGS
01326
DWORD adwDBGTAGFlags[DBGTAG_Max + 1];
01327
#endif // DEBUGTAGS
01328
01329 }
SERVERINFO;
01330
01331
01332
01333
01334
#ifdef _USERK_
01335
#define FWINABLE() gpWinEventHooks
01336
#else
01337 #define FWINABLE() TEST_SRVIF(SRVIF_WINEVENTHOOKS)
01338
#endif
01339
01340
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;
01351 PDISPLAYINFO pDispInfo;
01352 KERNEL_UINT_PTR
ulSharedDelta;
01353
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
01375
01376 #define SSCF_NOTIFY 0x00000001
01377 #define SSCF_FORCESOLIDCOLOR 0x00000002
01378 #define SSCF_SETMAGICCOLORS 0x00000004
01379 #define SSCF_16COLORS 0x00000008
01380
01381
01382
01383
01384
01385
typedef struct tagGETCLIPBDATA {
01386
01387 UINT uFmtRet;
01388 BOOL fGlobalHandle;
01389
union {
01390 HANDLE
hLocale;
01391 HANDLE
hPalette;
01392 };
01393
01394 }
GETCLIPBDATA, *
PGETCLIPBDATA;
01395
01396
01397
01398
01399
01400
typedef struct tagSETCLIPBDATA {
01401
01402 BOOL fGlobalHandle;
01403 BOOL fIncSerialNumber;
01404
01405 }
SETCLIPBDATA, *
PSETCLIPBDATA;
01406
01407
01408
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
01425
01426
01427
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
01443
01444
01445
01446
typedef struct _HEAD {
01447 KHANDLE
h;
01448 DWORD cLockObj;
01449 }
HEAD, *
PHEAD;
01450
01451
01452
01453
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
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
01505
01506
01507
01508
01509
01510
01511
typedef struct _HANDLEENTRY {
01512 PHEAD phead;
01513 KERNEL_PVOID
pOwner;
01514 BYTE bType;
01515 BYTE bFlags;
01516 WORD
wUniq;
01517
01518
#if DBG
01519
PLR plr;
01520
#endif // DBG
01521
01522 }
HANDLEENTRY;
01523
01524
01525
01526
01527
01528
01529
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
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
01595
01596
01597
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
01629
01630 #define GETPWNDPPI(p) (GETPTI(p)->ppi)
01631
01632
01633
01634
01635
01636
01637
01638 #define CPD_ANSI_TO_UNICODE 0x0001
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
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
01653
01654
typedef struct _CALLPROCDATA {
01655 PROCDESKHEAD head;
01656 PCALLPROCDATA spcpdNext;
01657 KERNEL_ULONG_PTR
pfnClientPrevious;
01658 WORD
wType;
01659 }
CALLPROCDATA;
01660
01661
01662
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
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
01695
typedef struct tagCOMMON_WNDCLASS
01696 {
01697
01698
01699
01700
01701 int cWndReferenceCount;
01702
01703 UINT style;
01704 WNDPROC_PWND lpfnWndProc;
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
01717
01718
01719
01720
typedef struct tagCLSMENUNAME
01721 {
01722 KLPSTR
pszClientAnsiMenuName;
01723 KLPWSTR
pwszClientUnicodeMenuName;
01724 PUNICODE_STRING
pusMenuName;
01725 }
CLSMENUNAME, *
PCLSMENUNAME;
01726
01727
01728
01729
01730
01731
01732
01733
01734
01735
typedef struct tagCLS {
01736
01737 PCLS pclsNext;
01738 ATOM
atomClassName;
01739 WORD
fnid;
01740
01741 PDESKTOP rpdeskParent;
01742 PDCE pdce;
01743 WORD
hTaskWow;
01744 WORD
CSF_flags;
01745 KLPSTR
lpszClientAnsiMenuName;
01746 KLPWSTR
lpszClientUnicodeMenuName;
01747
01748 PCALLPROCDATA spcpdFirst;
01749 PCLS pclsBase;
01750 PCLS pclsClone;
01751
01752 COMMON_WNDCLASS;
01753
01754
01755
01756
01757 }
CLS, **
PPCLS;
01758
01759
01760
01761
01762
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
01776
01777
01778
typedef struct tagSBDATA {
01779 int posMin;
01780 int posMax;
01781 int page;
01782 int pos;
01783 }
SBDATA, *
PSBDATA;
01784
01785
01786
01787
01788
01789
typedef struct tagSBINFO {
01790 int WSBflags;
01791 SBDATA Horz;
01792 SBDATA Vert;
01793 }
SBINFO, * KPTR_MODIFIER
PSBINFO;
01794
01795
01796
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
01811
01812
typedef struct tagPROPLIST {
01813 UINT cEntries;
01814 UINT iFirstFree;
01815 PROP aprop[1];
01816 }
PROPLIST, * KPTR_MODIFIER
PPROPLIST;
01817
01818
01819
01820
01821
01822
01823
01824
01825
01826
typedef struct tagWND {
01827 THRDESKHEAD head;
01828
01829 WW;
01830
01831
01832
01833 PWND spwndNext;
01834 PWND spwndParent;
01835 PWND spwndChild;
01836 PWND spwndOwner;
01837
01838 RECT
rcWindow;
01839 RECT
rcClient;
01840
01841 WNDPROC_PWND lpfnWndProc;
01842
01843 PCLS pcls;
01844
01845 KHRGN
hrgnUpdate;
01846
01847 PPROPLIST ppropList;
01848 PSBINFO pSBInfo;
01849
01850 PMENU spmenuSys;
01851 PMENU spmenu;
01852
01853 KHRGN
hrgnClip;
01854
01855 LARGE_UNICODE_STRING strName;
01856 int cbwndExtra;
01857 PWND spwndLastActive;
01858 KHIMC
hImc;
01859 KERNEL_ULONG_PTR
dwUserData;
01860 }
WND;
01861
01862 #define NEEDSPAINT(pwnd) (pwnd->hrgnUpdate != NULL || TestWF(pwnd, WFINTERNALPAINT))
01863
01864
01865
01866
01867
typedef struct tagCBox {
01868 PWND spwnd;
01869 PWND spwndParent;
01870 RECT
editrc;
01871
01872 RECT
buttonrc;
01873
01874 int cxCombo;
01875 int cyCombo;
01876 int cxDrop;
01877 int cyDrop;
01878
01879 PWND spwndEdit;
01880 PWND spwndList;
01881
01882 UINT CBoxStyle:2;
01883 UINT fFocus:1;
01884 UINT fNoRedraw:1;
01885 UINT fMouseDown:1;
01886
01887 UINT fButtonPressed:1;
01888
01889 UINT fLBoxVisible:1;
01890 UINT OwnerDraw:2;
01891
01892
01893 UINT fKeyboardSelInListBox:1;
01894
01895
01896
01897
01898
01899
01900 UINT fExtendedUI:1;
01901
01902
01903 UINT fCase:2;
01904
01905 UINT f3DCombo:1;
01906 UINT fNoEdit:1;
01907
01908
01909
#ifdef COLOR_HOTTRACKING
01910
UINT fButtonHotTracked:1;
01911
#endif // COLOR_HOTTRACKING
01912 UINT fRightAlign:1;
01913 UINT fRtoLReading:1;
01914 HANDLE
hFont;
01915 LONG
styleSave;
01916
01917
01918
01919
01920 }
CBOX, * KPTR_MODIFIER
PCBOX;
01921
01922
typedef struct tagCOMBOWND {
01923 WND wnd;
01924 PCBOX pcbox;
01925 }
COMBOWND, *
PCOMBOWND;
01926
01927
01928
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;
01940 PWND spwnd;
01941 INT iTop;
01942 INT iSel;
01943 INT iSelBase;
01944 INT cItemFullMax;
01945
01946
01947
01948 INT cMac;
01949 INT cMax;
01950
01951 PBYTE rgpch;
01952 LPWSTR
hStrings;
01953 INT cchStrings;
01954 INT ichAlloc;
01955
01956 INT cxChar;
01957 INT cyChar;
01958 INT cxColumn;
01959 INT itemsPerColumn;
01960 INT numberOfColumns;
01961 POINT
ptPrev;
01962
01963
01964 UINT OwnerDraw:2;
01965 UINT fRedraw:1;
01966 UINT fDeferUpdate:1;
01967 UINT wMultiple:2;
01968
01969
01970
01971
01972 UINT fSort:1;
01973 UINT fNotify:1;
01974 UINT fMouseDown:1;
01975 UINT fCaptured:1;
01976 UINT fCaret:1;
01977 UINT fDoubleClick:1;
01978 UINT fCaretOn:1;
01979 UINT fAddSelMode:1;
01980 UINT fHasStrings:1;
01981
01982
01983
01984 UINT fHasData:1;
01985
01986
01987
01988
01989
01990 UINT fNewItemState:1;
01991
01992 UINT fUseTabStops:1;
01993
01994
01995 UINT fMultiColumn:1;
01996 UINT fNoIntegralHeight:1;
01997
01998
01999 UINT fWantKeyboardInput:1;
02000
02001
02002
02003 UINT fDisableNoScroll:1;
02004
02005
02006
02007
02008
02009 UINT fHorzBar:1;
02010
02011 UINT fVertBar:1;
02012 UINT fFromInsert:1;
02013 UINT fNoSel:1;
02014
02015 UINT fHorzInitialized : 1;
02016 UINT fVertInitialized : 1;
02017
02018 UINT fSized : 1;
02019 UINT fIgnoreSizeMsg : 1;
02020
02021 UINT fInitialized : 1;
02022
02023 UINT fRightAlign:1;
02024 UINT fRtoLReading:1;
02025 UINT fSmoothScroll:1;
02026
02027 int xRightOrigin;
02028
02029 INT iLastSelection;
02030
02031
02032 INT iMouseDown;
02033
02034
02035
02036 INT iLastMouseMove;
02037
02038
02039
02040 LPINT
iTabPixelPositions;
02041 HANDLE
hFont;
02042 int xOrigin;
02043 int maxWidth;
02044
02045 PCBOX pcbox;
02046 HDC
hdc;
02047 DWORD dwLocaleId;
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
02061
02062
typedef struct tagIMC {
02063 THRDESKHEAD head;
02064 struct tagIMC *
pImcNext;
02065 ULONG_PTR
dwClientImcData;
02066 HWND
hImeWnd;
02067 }
IMC, *
PIMC;
02068
02069
02070
02071
02072
02073
#undef HOOKBATCH
02074
typedef struct tagHOOK {
02075 THRDESKHEAD head;
02076 PHOOK phkNext;
02077 int iHook;
02078 KERNEL_ULONG_PTR
offPfn;
02079 UINT flags;
02080 int ihmod;
02081 PTHREADINFO ptiHooked;
02082 PDESKTOP rpdesk;
02083
02084
#ifdef HOOKBATCH
02085
DWORD cEventMessages;
02086
DWORD iCurrentEvent;
02087
DWORD CacheTimeOut;
02088 PEVENTMSG aEventCache;
02089
#endif // HOOKBATCH
02090
}
HOOK;
02091
02092
02093
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
02111
02112
02113 #define WHF_FROM_WH(n) (1 << (n + 1))
02114
02115
02116
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
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
02148
02149
02150
02151
02152
typedef struct tagMONITOR {
02153 HEAD head;
02154
02155 PMONITOR pMonitorNext;
02156 DWORD dwMONFlags;
02157 RECT
rcMonitor;
02158 RECT
rcWork;
02159 KHRGN
hrgnMonitor;
02160 short cFullScreen;
02161 short cWndStack;
02162 KHANDLE
hDev;
02163 }
MONITOR;
02164
#endif
02165
02166
02167
02168
02169
02170
02171
02172
02173
02174
02175
02176
02177
02178
#ifndef _USERSRV_
02179
02180
typedef struct tagDISPLAYINFO {
02181
02182 KHANDLE
hDev;
02183 KERNEL_PVOID
pmdev;
02184 KHANDLE
hDevInfo;
02185
02186
02187 KHDC
hdcScreen;
02188 KHDC
hdcBits;
02189
02190
02191 KHDC
hdcGray;
02192 KHBITMAP
hbmGray;
02193 int cxGray;
02194 int cyGray;
02195
02196
02197 PDCE pdceFirst;
02198 PSPB pspbFirst;
02199
02200
02201 ULONG
cMonitors;
02202 PMONITOR pMonitorPrimary;
02203 PMONITOR pMonitorFirst;
02204
02205
02206 RECT
rcScreen;
02207 KHRGN
hrgnScreen;
02208 WORD
dmLogPixels;
02209 WORD
BitCountMax;
02210
02211 BOOL fDesktopIsRect:1;
02212 BOOL fAnyPalette:1;
02213
02214
02215
02216 }
DISPLAYINFO;
02217
02218
02219
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
02235
02236
02237
02238 typedef struct {
02239 DWORD cPwnd;
02240 DWORD cElem;
02241 DWORD cThreshhold;
02242 PWND aPwnd[0];
02243 }
VWPL, * KPTR_MODIFIER
PVWPL;
02244
02245
02246
02247
02248
02249
02250
02251
02252
typedef struct tagDESKTOPINFO {
02253
02254 KERNEL_PVOID
pvDesktopBase;
02255 KERNEL_PVOID
pvDesktopLimit;
02256 PWND spwnd;
02257 DWORD fsHooks;
02258 PHOOK aphkStart[
CWINHOOKS];
02259 PWND spwndShell;
02260 PPROCESSINFO ppiShellProcess;
02261 PWND spwndBkGnd;
02262 PWND spwndTaskman;
02263 PWND spwndProgman;
02264 PVWPL pvwplShellHook;
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;
02283
02284 DWORD bpp;
02285 DWORD cx;
02286 DWORD cy;
02287 }
CURSOR_COMMON;
02288
02289 typedef struct ACON_COMMON {
02290 int cpcur;
02291 int cicur;
02292 PCURSOR * KPTR_MODIFIER
aspcur;
02293 DWORD * KPTR_MODIFIER
aicur;
02294 JIF * KPTR_MODIFIER
ajifRate;
02295 int iicur;
02296 }
ACON_COMMON;
02297
02298 typedef struct tagCURSOR {
02299 CURSOR_ACON;
02300
02301 CURSOR_COMMON;
02302 }
CURSOR;
02303
02304 typedef struct tagACON {
02305 CURSOR_ACON;
02306
02307
02308
02309
02310
02311
02312
02313 DWORD CURSORF_flags;
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
02356
02357
02358
02359
02360
02361
02362
02363
02364
02365
02366
02367
02368
02369
02370
02371
02372
02373
02374
02375
02376
02377
02378
02379
02380
02381
02382
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
02405
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
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
02441
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
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
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
02479
02480
02481
02482
02483
02484
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
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
02520
02521
02522
02523 #define WEFPUIFOCUSHIDDEN 0x0B80 // focus indicators hidden
02524 #define WEFPUIACCELHIDDEN 0x0B40 // keyboard acceleraors hidden
02525
02526
02527
02528
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
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
02567
02568
02569
02570
02571
02572
02573
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
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
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
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
02645 #define SBFSIZEBOXTOPLEFT 0x0C02
02646 #define SBFSIZEBOXBOTTOMRIGHT 0x0C04
02647 #define SBFSIZEBOX 0x0C08
02648 #define SBFSIZEGRIP 0x0C10
02649
02650
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
02670
02671
02672
02673
02674
02675
02676
02677
02678
02679
02680
02681
02682 #define STATEOFFSET (FIELD_OFFSET(WND, state))
02683
02684
02685
02686
02687
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
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
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
02741
02742
typedef struct tagITEM {
02743 UINT fType;
02744 UINT fState;
02745 UINT wID;
02746 PMENU spSubMenu;
02747 KHANDLE
hbmpChecked;
02748 KHANDLE
hbmpUnchecked;
02749 KLPWSTR
lpstr;
02750 DWORD cch;
02751 KERNEL_ULONG_PTR
dwItemData;
02752 DWORD xItem;
02753 DWORD yItem;
02754 DWORD cxItem;
02755 DWORD cyItem;
02756 DWORD dxTab;
02757 DWORD ulX;
02758 DWORD ulWidth;
02759 KHBITMAP
hbmp;
02760 int cxBmp;
02761 int cyBmp;
02762 }
ITEM, * KPTR_MODIFIER
PITEM, * KPTR_MODIFIER
LPITEM;
02763
02764
02765
02766
02767
02768
02769 typedef struct tagMENULIST {
02770 struct tagMENULIST *
pNext;
02771 PMENU pMenu;
02772 }
MENULIST, * KPTR_MODIFIER
PMENULIST;
02773
02774
02775
02776
02777 #define MSA_OFF 0
02778 #define MSA_ON 1
02779 #define MSA_ATTOP 2
02780 #define MSA_ATBOTTOM 3
02781
02782
02783
02784
02785
typedef struct tagMENU {
02786 PROCDESKHEAD head;
02787 DWORD fFlags;
02788 int iItem;
02789
02790 UINT cAlloced;
02791 UINT cItems;
02792
02793 DWORD cxMenu;
02794 DWORD cyMenu;
02795 DWORD cxTextAlign;
02796 PWND spwndNotify;
02797 PITEM rgItems;
02798 PMENULIST pParentMenus;
02799 DWORD dwContextHelpId;
02800 DWORD cyMax;
02801 KERNEL_ULONG_PTR
dwMenuData;
02802
02803 KHBRUSH
hbrBack;
02804 int iTop;
02805 int iMaxTop;
02806 DWORD dwArrowsOn:2;
02807 }
MENU, * KPTR_MODIFIER
PMENU;
02808
02809
02810
02811
02812
02813
02814 #define ID_HELPMENU 4
02815
02816
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
02837
02838
02839
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;
02846 int pxTop;
02847 int pxBottom;
02848 int pxLeft;
02849 int pxRight;
02850 int cpxThumb;
02851 int pxUpArrow;
02852 int pxDownArrow;
02853 int pxStart;
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;
02873 int pxOld;
02874 int posOld;
02875 int posNew;
02876 int nBar;
02877 PSBCALC pSBCalc;
02878 }
SBTRACK, *
PSBTRACK;
02879
02880
02881
02882
02883
02884 #define CSPINBACKGROUND 100
02885
02886 #define CCHTITLEMAX 256
02887
02888 #define SW_MDIRESTORE 0xCC
02889
02890
02891
02892
02893
02894 #define CW2_USEDEFAULT 0x8000
02895 #define CW_FLAGS_DIFFHMOD 0x80000000
02896
02897
02898
02899
02900
02901
02902
02903
02904
02905
02906
02907 #define MENUSYSMENU TEXT(' ')
02908 #define MENUCHILDSYSMENU TEXT('-')
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
02916 #define MFMWFP_DOWNARROW 0xFFFFFFFC
02917 #define MFMWFP_MINVALID 0xFFFFFFFC
02918 #define MFMWFP_ALTMENU 0xFFFFFFFB
02919 #define MFMWFP_FIRSTITEM 0
02920
02921
02922
02923
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
02939
02940
02941
02942
02943
02944
02945
typedef struct _DLG {
02946 DLGPROC
lpfnDlg;
02947 DWORD flags;
02948 int cxChar;
02949 int cyChar;
02950 KHWND
hwndFocusSave;
02951 UINT fEnd : 1;
02952 UINT fDisabled : 1;
02953 KERNEL_INT_PTR
result;
02954 KHANDLE
hData;
02955 KHFONT
hUserFont;
02956
#ifdef SYSMODALWINDOWS
02957
KHWND hwndSysModalSave;
02958
#endif
02959
}
DLG, * KPTR_MODIFIER
PDLG;
02960
02961
typedef struct _DIALOG {
02962 WND wnd;
02963 KERNEL_LRESULT
resultWP;
02964 PDLG pdlg;
02965 KERNEL_LONG_PTR
unused;
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
02973
02974 #define DLGF_ANSI 0x01
02975
02976
02977
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;
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
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
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
03033
03034
03035
03036
03037
03038
typedef struct tagCLIENTTHREADINFO {
03039 UINT CTIF_flags;
03040 WORD
fsChangeBits;
03041 WORD
fsWakeBits;
03042 WORD
fsWakeBitsJournal;
03043 WORD
fsWakeMask;
03044 LONG
timeLastRead;
03045 }
CLIENTTHREADINFO;
03046
03047 #define CTIF_SYSQUEUELOCKED (UINT)0x00000001
03048 #define CTIF_INSENDMESSAGE (UINT)0x00000002
03049
03050
03051
03052
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
03064
03065
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
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
03104
03105
03106
03107
03108
03109
03110
03111 #define QF_TABSWITCHING (UINT)0x00080 // This bit is used as a
03112
03113
03114
03115
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
03129
03130 #define RNDFRM_CORNER 10
03131 #define RNDFRM_BORDER 3
03132
03133
03134
03135
03136 #define GRC_SCROLLS 0x0001
03137 #define GRC_MINWNDS 0x0002
03138 #define GRC_FULLSCREEN 0x0004
03139
03140
03141
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;
03150 SBCALC SBCalc;
03151 }
SBWND, *
PSBWND, *
LPSBWND;
03152
03153
03154
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
03163
03164
typedef struct tagSNDMSGTIMEOUT {
03165 UINT fuFlags;
03166 UINT uTimeout;
03167 ULONG_PTR
lSMTOReturn;
03168 ULONG_PTR
lSMTOResult;
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
03184
03185
typedef struct tagBUTN {
03186 PWND spwnd;
03187 UINT buttonState;
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
03200
03201
typedef struct tagIMEUI {
03202 PWND spwnd;
03203 KHIMC
hIMC;
03204 KHWND
hwndIMC;
03205 KHKL
hKL;
03206 KHWND
hwndUI;
03207 int nCntInIMEProc;
03208 BOOL fShowStatus:1;
03209 BOOL fActivate:1;
03210 BOOL fDestroy:1;
03211 BOOL fDefault:1;
03212 BOOL fChildThreadDef:1;
03213
03214 BOOL fCtrlShowStatus:1;
03215 BOOL fFreeActiveEvent:1;
03216 }
IMEUI, *
PIMEUI;
03217
03218
typedef struct tagIMEWND {
03219 WND wnd;
03220 PIMEUI pimeui;
03221 }
IMEWND, *
PIMEWND;
03222
03223
03224
03225
03226
03227 #define MAX_SEB_STYLES 11
03228
03229
03230
03231
03232
03233 #define SEB_OK 0
03234 #define SEB_CANCEL 1
03235 #define SEB_ABORT 2
03236 #define SEB_RETRY 3
03237 #define SEB_IGNORE 4
03238 #define SEB_YES 5
03239 #define SEB_NO 6
03240 #define SEB_CLOSE 7
03241 #define SEB_HELP 8
03242 #define SEB_TRYAGAIN 9
03243 #define SEB_CONTINUE 10
03244
03245 #define SEB_DEFBUTTON 0x8000
03246
03247
typedef struct _MSGBOXDATA {
03248 MSGBOXPARAMS;
03249 PWND pwndOwner;
03250 WORD
wLanguageId;
03251 INT *
pidButton;
03252 LPWSTR *
ppszButtonText;
03253 UINT cButtons;
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
03288
03289
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
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;
03320 int cxTabLength;
03321 int iXSign;
03322 int iYSign;
03323 int cyLineHeight;
03324 int cxMaxWidth;
03325 int cxMaxExtent;
03326 int cxRightMargin;
03327 LPFNTEXTDRAW lpfnTextDraw;
03328
03329 int cxOverhang;
03330 BOOL bCharsetDll;
03331 int iCharset;
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
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
03358
03359
03360
03361
03362
03363
03364
03365
03366
03367
03368
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
03425
03426
03427
03428
03429
03430
03431
03432
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
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
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
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
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
03648
03649 #define CMSSLEEP 250
03650 #define CMSHUNGAPPTIMEOUT (5 * 1000)
03651 #define CMSHUNGTOKILLCOUNT 4
03652 #define CMSWAITTOKILLTIMEOUT (CMSHUNGTOKILLCOUNT * CMSHUNGAPPTIMEOUT)
03653 #define CMSAPPSTARTINGTIMEOUT (6 * CMSHUNGAPPTIMEOUT)
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
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
03682
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_