[Win32k]
[reactos.git] / reactos / win32ss / user / ntuser / userfuncs.h
1 #pragma once
2
3 FORCEINLINE PMENU UserGetMenuObject(HMENU hMenu)
4 {
5 return ValidateHandle(hMenu, TYPE_MENU);
6 }
7
8 #define ASSERT_REFS_CO(_obj_) \
9 { \
10 LONG ref = ((PHEAD)_obj_)->cLockObj;\
11 if (!(ref >= 1)){ \
12 ERR_CH(UserObj, "ASSERT: obj 0x%p, refs %ld\n", _obj_, ref); \
13 ASSERT(FALSE); \
14 } \
15 }
16
17 #if 0
18 #define ASSERT_REFS_CO(_obj_) \
19 { \
20 PSINGLE_LIST_ENTRY e; \
21 BOOL gotit=FALSE; \
22 LONG ref = ((PHEAD)_obj_)->cLockObj;\
23 if (!(ref >= 1)){ \
24 ERR_CH(UserObj, "obj 0x%p, refs %i\n", _obj_, ref); \
25 ASSERT(FALSE); \
26 } \
27 \
28 e = PsGetCurrentThreadWin32Thread()->ReferencesList.Next; \
29 while (e) \
30 { \
31 PUSER_REFERENCE_ENTRY ref = CONTAINING_RECORD(e, USER_REFERENCE_ENTRY, Entry); \
32 if (ref->obj == _obj_){ gotit=TRUE; break; } \
33 e = e->Next; \
34 } \
35 ASSERT(gotit); \
36 }
37 #endif
38
39 #define DUMP_REFS(obj) TRACE_CH(UserObj,"obj 0x%x, refs %i\n",obj, ((PHEAD)obj)->cLockObj)
40
41 PWND FASTCALL IntGetWindowObject(HWND hWnd);
42
43 /*************** MAIN.C ***************/
44
45 NTSTATUS NTAPI UserCreateThreadInfo(struct _ETHREAD *Thread);
46
47 /*************** WINSTA.C ***************/
48
49 HWINSTA FASTCALL UserGetProcessWindowStation(VOID);
50
51 /*************** FOCUS.C ***************/
52
53 HWND FASTCALL UserGetActiveWindow(VOID);
54
55 HWND FASTCALL UserGetForegroundWindow(VOID);
56
57 HWND FASTCALL co_UserSetFocus(PWND Window);
58
59 /*************** WINDC.C ***************/
60
61 INT FASTCALL UserReleaseDC(PWND Window, HDC hDc, BOOL EndPaint);
62 HDC FASTCALL UserGetDCEx(PWND Window OPTIONAL, HANDLE ClipRegion, ULONG Flags);
63 HDC FASTCALL UserGetWindowDC(PWND Wnd);
64
65 /*************** SESSION.C ***************/
66
67 extern PRTL_ATOM_TABLE gAtomTable;
68 NTSTATUS FASTCALL InitSessionImpl(VOID);
69
70 /*************** METRIC.C ***************/
71
72 BOOL NTAPI InitMetrics(VOID);
73 LONG NTAPI UserGetSystemMetrics(ULONG Index);
74
75 /*************** KEYBOARD.C ***************/
76
77 DWORD FASTCALL UserGetKeyState(DWORD key);
78 DWORD FASTCALL UserGetKeyboardType(DWORD TypeFlag);
79 HKL FASTCALL UserGetKeyboardLayout(DWORD dwThreadId);
80
81
82 /*************** MISC.C ***************/
83
84 BOOL FASTCALL
85 UserSystemParametersInfo(
86 UINT uiAction,
87 UINT uiParam,
88 PVOID pvParam,
89 UINT fWinIni);
90
91 VOID FASTCALL IntSetWindowState(PWND, UINT);
92 VOID FASTCALL IntClearWindowState(PWND, UINT);
93 PTHREADINFO FASTCALL IntTID2PTI(HANDLE);
94
95 /*************** MESSAGE.C ***************/
96
97 BOOL FASTCALL
98 UserPostMessage(HWND Wnd,
99 UINT Msg,
100 WPARAM wParam,
101 LPARAM lParam);
102
103 /*************** WINDOW.C ***************/
104
105 PWND FASTCALL UserGetWindowObject(HWND hWnd);
106 VOID FASTCALL co_DestroyThreadWindows(struct _ETHREAD *Thread);
107 HWND FASTCALL UserGetShellWindow(VOID);
108 HDC FASTCALL UserGetDCEx(PWND Window OPTIONAL, HANDLE ClipRegion, ULONG Flags);
109 BOOLEAN FASTCALL co_UserDestroyWindow(PWND Wnd);
110 PWND FASTCALL UserGetAncestor(PWND Wnd, UINT Type);
111
112 /*************** MENU.C ***************/
113
114 HMENU FASTCALL UserCreateMenu(BOOL PopupMenu);
115 BOOL FASTCALL UserSetMenuDefaultItem(PMENU Menu, UINT uItem, UINT fByPos);
116 BOOL FASTCALL UserDestroyMenu(HMENU hMenu);
117
118 /*************** SCROLLBAR.C ***************/
119
120 DWORD FASTCALL
121 co_UserShowScrollBar(PWND Wnd, int nBar, BOOL fShowH, BOOL fShowV);
122
123 /* EOF */