xref: /reactos/win32ss/user/ntuser/ntuser.h (revision 5b87c95e)
1 #pragma once
2 
3 #define DECLARE_RETURN(type) type _ret_
4 #define RETURN(value) { _ret_ = value; goto _cleanup_; }
5 #define CLEANUP /*unreachable*/ ASSERT(FALSE); _cleanup_
6 #define END_CLEANUP return _ret_;
7 
8 #define UserEnterCo UserEnterExclusive
9 #define UserLeaveCo UserLeave
10 
11 typedef VOID (*TL_FN_FREE)(PVOID);
12 
13 /* Thread Lock structure */
14 typedef struct _TL
15 {
16     struct _TL* next;
17     PVOID pobj;
18     TL_FN_FREE pfnFree;
19 } TL, *PTL;
20 
21 extern PSERVERINFO gpsi;
22 extern PTHREADINFO gptiCurrent;
23 extern PPROCESSINFO gppiList;
24 extern PPROCESSINFO ppiScrnSaver;
25 extern PPROCESSINFO gppiInputProvider;
26 extern BOOL g_AlwaysDisplayVersion;
27 extern ATOM gaGuiConsoleWndClass;
28 extern ATOM AtomDDETrack;
29 extern ATOM AtomQOS;
30 extern ATOM AtomImeLevel;
31 extern ERESOURCE UserLock;
32 
33 CODE_SEG("INIT") NTSTATUS NTAPI InitUserImpl(VOID);
34 VOID FASTCALL CleanupUserImpl(VOID);
35 VOID FASTCALL UserEnterShared(VOID);
36 VOID FASTCALL UserEnterExclusive(VOID);
37 VOID FASTCALL UserLeave(VOID);
38 BOOL FASTCALL UserIsEntered(VOID);
39 BOOL FASTCALL UserIsEnteredExclusive(VOID);
40 DWORD FASTCALL UserGetLanguageToggle(VOID);
41 
42 _Success_(return != FALSE)
43 BOOL
44 NTAPI
45 RegReadUserSetting(
46     _In_z_ PCWSTR pwszKeyName,
47     _In_z_ PCWSTR pwszValueName,
48     _In_ ULONG ulType,
49     _Out_writes_bytes_(cjDataSize) _When_(ulType == REG_SZ, _Post_z_) PVOID pvData,
50     _In_ ULONG cjDataSize);
51 
52 _Success_(return != FALSE)
53 BOOL
54 NTAPI
55 RegWriteUserSetting(
56     _In_z_ PCWSTR pwszKeyName,
57     _In_z_ PCWSTR pwszValueName,
58     _In_ ULONG ulType,
59     _In_reads_bytes_(cjDataSize) const VOID *pvData,
60     _In_ ULONG cjDataSize);
61 
62 PGRAPHICS_DEVICE
63 NTAPI
64 InitDisplayDriver(
65     IN PWSTR pwszDeviceName,
66     IN PWSTR pwszRegKey);
67 
68 /* EOF */
69