- Fix compilation with GCC 4.0-20041219.
[reactos.git] / reactos / ntoskrnl / include / internal / ex.h
1 /*
2 * internal executive prototypes
3 */
4
5 #ifndef __NTOSKRNL_INCLUDE_INTERNAL_EXECUTIVE_H
6 #define __NTOSKRNL_INCLUDE_INTERNAL_EXECUTIVE_H
7
8 #define NTOS_MODE_KERNEL
9 #include <ntos.h>
10
11 typedef enum
12 {
13 wmCenter = 0,
14 wmTile,
15 wmStretch
16 } WALLPAPER_MODE;
17
18 typedef struct _WINSTATION_OBJECT
19 {
20 CSHORT Type;
21 CSHORT Size;
22 KSPIN_LOCK Lock;
23 UNICODE_STRING Name;
24 LIST_ENTRY DesktopListHead;
25 PRTL_ATOM_TABLE AtomTable;
26 PVOID HandleTable;
27 HANDLE SystemMenuTemplate;
28 PVOID SystemCursor;
29 UINT CaretBlinkRate;
30 HANDLE ShellWindow;
31 HANDLE ShellListView;
32
33 /* Wallpaper */
34 HANDLE hbmWallpaper;
35 ULONG cxWallpaper, cyWallpaper;
36 WALLPAPER_MODE WallpaperMode;
37
38 ULONG Flags;
39 struct _DESKTOP_OBJECT* ActiveDesktop;
40 /* FIXME: Clipboard */
41 LIST_ENTRY HotKeyListHead;
42 FAST_MUTEX HotKeyListLock;
43 } WINSTATION_OBJECT, *PWINSTATION_OBJECT;
44
45 typedef struct _DESKTOP_OBJECT
46 {
47 CSHORT Type;
48 CSHORT Size;
49 LIST_ENTRY ListEntry;
50 KSPIN_LOCK Lock;
51 UNICODE_STRING Name;
52 /* Pointer to the associated window station. */
53 struct _WINSTATION_OBJECT *WindowStation;
54 /* Pointer to the active queue. */
55 PVOID ActiveMessageQueue;
56 /* Rectangle of the work area */
57 #ifdef __WIN32K__
58 RECT WorkArea;
59 #else
60 LONG WorkArea[4];
61 #endif
62 /* Handle of the desktop window. */
63 HANDLE DesktopWindow;
64 HANDLE PrevActiveWindow;
65 /* Thread blocking input */
66 PVOID BlockInputThread;
67 } DESKTOP_OBJECT, *PDESKTOP_OBJECT;
68
69
70 typedef VOID (*PLOOKASIDE_MINMAX_ROUTINE)(
71 POOL_TYPE PoolType,
72 ULONG Size,
73 PUSHORT MinimumDepth,
74 PUSHORT MaximumDepth);
75
76 /* GLOBAL VARIABLES *********************************************************/
77
78 extern TIME_ZONE_INFORMATION ExpTimeZoneInfo;
79 extern LARGE_INTEGER ExpTimeZoneBias;
80 extern ULONG ExpTimeZoneId;
81
82 extern POBJECT_TYPE ExEventPairObjectType;
83
84
85 /* INITIALIZATION FUNCTIONS *************************************************/
86
87 VOID
88 ExpWin32kInit(VOID);
89
90 VOID
91 ExInit2(VOID);
92 VOID
93 ExInit3(VOID);
94 VOID
95 ExpInitTimeZoneInfo(VOID);
96 VOID
97 ExInitializeWorkerThreads(VOID);
98 VOID
99 ExpInitLookasideLists(VOID);
100 VOID
101 ExpInitializeCallbacks(VOID);
102 VOID
103 ExpInitUuids(VOID);
104
105 /* OTHER FUNCTIONS **********************************************************/
106
107 #ifdef _ENABLE_THRDEVTPAIR
108 VOID
109 ExpSwapThreadEventPair(
110 IN struct _ETHREAD* Thread,
111 IN struct _KEVENT_PAIR* EventPair
112 );
113 #endif /* _ENABLE_THRDEVTPAIR */
114
115 LONGLONG
116 FASTCALL
117 ExfpInterlockedExchange64(LONGLONG volatile * Destination,
118 PLONGLONG Exchange);
119
120 NTSTATUS
121 ExpSetTimeZoneInformation(PTIME_ZONE_INFORMATION TimeZoneInformation);
122
123 #define InterlockedDecrementUL(Addend) \
124 (ULONG)InterlockedDecrement((PLONG)(Addend))
125
126 #define InterlockedIncrementUL(Addend) \
127 (ULONG)InterlockedIncrement((PLONG)(Addend))
128
129 #define InterlockedExchangeUL(Target, Value) \
130 (ULONG)InterlockedExchange((PLONG)(Target), (LONG)(Value))
131
132 #define InterlockedExchangeAddUL(Addend, Value) \
133 (ULONG)InterlockedExchangeAdd((PLONG)(Addend), (LONG)(Value))
134
135 #define InterlockedCompareExchangeUL(Destination, Exchange, Comperand) \
136 (ULONG)InterlockedCompareExchange((PLONG)(Destination), (LONG)(Exchange), (LONG)(Comperand))
137
138 #define ExfInterlockedCompareExchange64UL(Destination, Exchange, Comperand) \
139 (ULONGLONG)ExfInterlockedCompareExchange64((PLONGLONG)(Destination), (PLONGLONG)(Exchange), (PLONGLONG)(Comperand))
140
141 #define ExfpInterlockedExchange64UL(Target, Value) \
142 (ULONGLONG)ExfpInterlockedExchange64((PLONGLONG)(Target), (PLONGLONG)(Value))
143
144 #endif /* __NTOSKRNL_INCLUDE_INTERNAL_EXECUTIVE_H */