efa89aec13fa52944d62bb9a91b3e5b6d166467e
[reactos.git] / win32ss / user / ntuser / userfuncs.h
1 #pragma once
2
3 FORCEINLINE PMENU UserGetMenuObject(HMENU hMenu)
4 {
5 PMENU pMenu = UserGetObject(gHandleTable, hMenu, TYPE_MENU);
6 if (!pMenu)
7 {
8 EngSetLastError(ERROR_INVALID_MENU_HANDLE);
9 }
10 return pMenu;
11 }
12
13 #define ASSERT_REFS_CO(_obj_) \
14 { \
15 LONG ref = ((PHEAD)_obj_)->cLockObj;\
16 if (!(ref >= 1)){ \
17 ERR_CH(UserObj, "ASSERT: obj 0x%p, refs %ld\n", _obj_, ref); \
18 ASSERT(FALSE); \
19 } \
20 }
21
22 #if 0
23 #define ASSERT_REFS_CO(_obj_) \
24 { \
25 PSINGLE_LIST_ENTRY e; \
26 BOOL gotit=FALSE; \
27 LONG ref = ((PHEAD)_obj_)->cLockObj;\
28 if (!(ref >= 1)){ \
29 ERR_CH(UserObj, "obj 0x%p, refs %i\n", _obj_, ref); \
30 ASSERT(FALSE); \
31 } \
32 \
33 e = PsGetCurrentThreadWin32Thread()->ReferencesList.Next; \
34 while (e) \
35 { \
36 PUSER_REFERENCE_ENTRY ref = CONTAINING_RECORD(e, USER_REFERENCE_ENTRY, Entry); \
37 if (ref->obj == _obj_){ gotit=TRUE; break; } \
38 e = e->Next; \
39 } \
40 ASSERT(gotit); \
41 }
42 #endif
43
44 #define DUMP_REFS(obj) TRACE_CH(UserObj,"obj 0x%x, refs %i\n",obj, ((PHEAD)obj)->cLockObj)
45
46 PWND FASTCALL IntGetWindowObject(HWND hWnd);
47
48 /*************** DDE.C ****************/
49
50 BOOL FASTCALL IntDdeSendMessageHook(PWND,UINT,WPARAM,LPARAM);
51 BOOL APIENTRY IntDdePostMessageHook(IN PWND,IN UINT,IN WPARAM,IN OUT LPARAM*,IN OUT LONG_PTR*);
52 BOOL APIENTRY IntDdeGetMessageHook(PMSG,LONG_PTR);
53
54 /*************** MAIN.C ***************/
55
56 NTSTATUS NTAPI InitThreadCallback(PETHREAD Thread);
57
58 /*************** WINSTA.C ***************/
59
60 HWINSTA FASTCALL UserGetProcessWindowStation(VOID);
61
62 /*************** FOCUS.C ***************/
63
64 HWND FASTCALL UserGetActiveWindow(VOID);
65
66 HWND FASTCALL UserGetForegroundWindow(VOID);
67
68 HWND FASTCALL co_UserSetFocus(PWND Window);
69
70 /*************** WINDC.C ***************/
71
72 INT FASTCALL UserReleaseDC(PWND Window, HDC hDc, BOOL EndPaint);
73 HDC FASTCALL UserGetDCEx(PWND Window OPTIONAL, HANDLE ClipRegion, ULONG Flags);
74 HDC FASTCALL UserGetWindowDC(PWND Wnd);
75
76 /*************** SESSION.C ***************/
77
78 extern PRTL_ATOM_TABLE gAtomTable;
79 NTSTATUS FASTCALL InitSessionImpl(VOID);
80
81 /*************** METRIC.C ***************/
82
83 BOOL NTAPI InitMetrics(VOID);
84 LONG NTAPI UserGetSystemMetrics(ULONG Index);
85
86 /*************** KEYBOARD.C ***************/
87
88 DWORD FASTCALL UserGetKeyState(DWORD key);
89 DWORD FASTCALL UserGetKeyboardType(DWORD TypeFlag);
90 HKL FASTCALL UserGetKeyboardLayout(DWORD dwThreadId);
91
92
93 /*************** MISC.C ***************/
94
95 BOOL FASTCALL
96 UserSystemParametersInfo(
97 UINT uiAction,
98 UINT uiParam,
99 PVOID pvParam,
100 UINT fWinIni);
101
102 VOID FASTCALL IntSetWindowState(PWND, UINT);
103 VOID FASTCALL IntClearWindowState(PWND, UINT);
104 PTHREADINFO FASTCALL IntTID2PTI(HANDLE);
105 HBRUSH FASTCALL GetControlBrush(PWND,HDC,UINT);
106 HBRUSH FASTCALL GetControlColor(PWND,PWND,HDC,UINT);
107
108 NTSTATUS
109 GetProcessLuid(
110 IN PETHREAD Thread OPTIONAL,
111 IN PEPROCESS Process OPTIONAL,
112 OUT PLUID Luid);
113
114 /*************** MESSAGE.C ***************/
115
116 BOOL FASTCALL UserPostMessage(HWND Wnd,UINT Msg, WPARAM wParam, LPARAM lParam);
117
118 /*************** WINDOW.C ***************/
119
120 PWND FASTCALL UserGetWindowObject(HWND hWnd);
121 VOID FASTCALL co_DestroyThreadWindows(struct _ETHREAD *Thread);
122 HWND FASTCALL UserGetShellWindow(VOID);
123 HDC FASTCALL UserGetDCEx(PWND Window OPTIONAL, HANDLE ClipRegion, ULONG Flags);
124 BOOLEAN co_UserDestroyWindow(PVOID Object);
125 PWND FASTCALL UserGetAncestor(PWND Wnd, UINT Type);
126 BOOL APIENTRY DefSetText(PWND Wnd, PCWSTR WindowText);
127 DWORD FASTCALL IntGetWindowContextHelpId( PWND pWnd );
128
129 /*************** MENU.C ***************/
130
131 HMENU FASTCALL UserCreateMenu(PDESKTOP Desktop, BOOL PopupMenu);
132 BOOL FASTCALL UserSetMenuDefaultItem(PMENU Menu, UINT uItem, UINT fByPos);
133 BOOL FASTCALL UserDestroyMenu(HMENU hMenu);
134
135 /************** NONCLIENT **************/
136
137 VOID FASTCALL DefWndDoSizeMove(PWND pwnd, WORD wParam);
138 LRESULT NC_DoNCPaint(PWND,HDC,INT);
139 void FASTCALL NC_GetSysPopupPos(PWND, RECT *);
140 LRESULT NC_HandleNCActivate( PWND Wnd, WPARAM wParam, LPARAM lParam );
141 LRESULT NC_HandleNCCalcSize( PWND wnd, WPARAM wparam, RECTL *winRect, BOOL Suspended );
142 VOID NC_DrawFrame( HDC hDC, RECT *CurrentRect, BOOL Active, DWORD Style, DWORD ExStyle);
143 VOID UserDrawCaptionBar( PWND pWnd, HDC hDC, INT Flags);
144 void FASTCALL NC_GetInsideRect(PWND Wnd, RECT *rect);
145 LRESULT NC_HandleNCLButtonDown(PWND Wnd, WPARAM wParam, LPARAM lParam);
146 LRESULT NC_HandleNCLButtonDblClk(PWND Wnd, WPARAM wParam, LPARAM lParam);
147 LRESULT NC_HandleNCRButtonDown( PWND wnd, WPARAM wParam, LPARAM lParam );
148
149 /************** DEFWND **************/
150
151 HBRUSH FASTCALL DefWndControlColor(HDC hDC,UINT ctlType);
152 BOOL UserDrawSysMenuButton(PWND pWnd, HDC hDC, LPRECT Rect, BOOL Down);
153 BOOL UserPaintCaption(PWND pWnd, INT Flags);
154
155 /************** LAYERED **************/
156
157 BOOL FASTCALL SetLayeredStatus(PWND pWnd, BYTE set);
158 BOOL FASTCALL GetLayeredStatus(PWND pWnd);
159
160 /* EOF */