ntoskrnl.exe: Implement KeReleaseSemaphore() and waiting on semaphores.
[wine.git] / include / ddk / ntddk.h
blobdc051e1e1827f19b176941c031c76993733bece4
1 /*
2 * Copyright 2008 Francois Gouget for CodeWeavers
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19 #ifndef _NTDDK_
20 #define _NTDDK_
22 /* Note: We will probably have to duplicate everything ultimately :-( */
23 #include <ddk/wdm.h>
25 #include <excpt.h>
26 /* FIXME: #include <ntdef.h> */
27 #include <ntstatus.h>
28 /* FIXME: #include <bugcodes.h> */
29 /* FIXME: #include <ntiologc.h> */
32 typedef enum _BUS_DATA_TYPE
34 ConfigurationSpaceUndefined = -1,
35 Cmos,
36 EisaConfiguration,
37 Pos,
38 CbusConfiguration,
39 PCIConfiguration,
40 VMEConfiguration,
41 NuBusConfiguration,
42 PCMCIAConfiguration,
43 MPIConfiguration,
44 MPSAConfiguration,
45 PNPISAConfiguration,
46 MaximumBusDataType
47 } BUS_DATA_TYPE, *PBUS_DATA_TYPE;
49 typedef struct _CONFIGURATION_INFORMATION
51 ULONG DiskCount;
52 ULONG FloppyCount;
53 ULONG CdRomCount;
54 ULONG TapeCount;
55 ULONG ScsiPortCount;
56 ULONG SerialCount;
57 ULONG ParallelCount;
58 BOOLEAN AtDiskPrimaryAddressClaimed;
59 BOOLEAN AtDiskSecondaryAddressClaimed;
60 ULONG Version;
61 ULONG MediumChangerCount;
62 } CONFIGURATION_INFORMATION, *PCONFIGURATION_INFORMATION;
64 typedef enum _CONFIGURATION_TYPE
66 ArcSystem = 0,
67 CentralProcessor,
68 FloatingPointProcessor,
69 PrimaryIcache,
70 PrimaryDcache,
71 SecondaryIcache,
72 SecondaryDcache,
73 SecondaryCache,
74 EisaAdapter,
75 TcAdapter,
76 ScsiAdapter,
77 DtiAdapter,
78 MultiFunctionAdapter,
79 DiskController,
80 TapeController,
81 CdromController,
82 WormController,
83 SerialController,
84 NetworkController,
85 DisplayController,
86 ParallelController,
87 PointerController,
88 KeyboardController,
89 AudioController,
90 OtherController,
91 DiskPeripheral,
92 FloppyDiskPeripheral,
93 TapePeripheral,
94 ModemPeripheral,
95 MonitorPeripheral,
96 PrinterPeripheral,
97 PointerPeripheral,
98 KeyboardPeripheral,
99 TerminalPeripheral,
100 OtherPeripheral,
101 LinePeripheral,
102 NetworkPeripheral,
103 SystemMemory,
104 DockingInformation,
105 RealModeIrqRoutingTable,
106 RealModePCIEnumeration,
107 MaximunType
108 } CONFIGURATION_TYPE, *PCONFIGURATION_TYPE;
110 typedef struct _IMAGE_INFO
112 union
114 ULONG Properties;
115 struct
117 ULONG ImageAddressingMode : 8;
118 ULONG SystemModeImage : 1;
119 ULONG ImageMappedToAllPids : 1;
120 ULONG ExtendedInfoPresent : 1;
121 ULONG Reserved : 21;
122 } DUMMYSTRUCTNAME;
123 } DUMMYUNIONNAME;
124 PVOID ImageBase;
125 ULONG ImageSelector;
126 SIZE_T ImageSize;
127 ULONG ImageSectionNumber;
128 } IMAGE_INFO, *PIMAGE_INFO;
130 typedef enum _IO_NOTIFICATION_EVENT_CATEGORY
132 EventCategoryReserved,
133 EventCategoryHardwareProfileChange,
134 EventCategoryDeviceInterfaceChange,
135 EventCategoryTargetDeviceChange
136 } IO_NOTIFICATION_EVENT_CATEGORY;
138 typedef struct _FILE_VALID_DATA_LENGTH_INFORMATION
140 LARGE_INTEGER ValidDataLength;
141 } FILE_VALID_DATA_LENGTH_INFORMATION, *PFILE_VALID_DATA_LENGTH_INFORMATION;
143 typedef struct _RTL_BALANCED_LINKS {
144 struct _RTL_BALANCED_LINKS *Parent;
145 struct _RTL_BALANCED_LINKS *LeftChild;
146 struct _RTL_BALANCED_LINKS *RightChild;
147 CHAR Balance;
148 UCHAR Reserved[3];
149 } RTL_BALANCED_LINKS;
150 typedef RTL_BALANCED_LINKS *PRTL_BALANCED_LINKS;
152 struct _RTL_AVL_TABLE;
154 typedef enum _RTL_GENERIC_COMPARE_RESULTS {
155 GenericLessThan,
156 GenericGreaterThan,
157 GenericEqual
158 } RTL_GENERIC_COMPARE_RESULTS;
160 typedef RTL_GENERIC_COMPARE_RESULTS (WINAPI *PRTL_AVL_COMPARE_ROUTINE)(struct _RTL_AVL_TABLE *, void *, void *);
162 typedef void (WINAPI *PRTL_AVL_ALLOCATE_ROUTINE)(struct _RTL_AVL_TABLE *, LONG);
164 typedef void (WINAPI *PRTL_AVL_FREE_ROUTINE )(struct _RTL_AVL_TABLE *, void *buffer);
166 typedef struct _RTL_AVL_TABLE {
167 RTL_BALANCED_LINKS BalancedRoot;
168 void *OrderedPointer;
169 ULONG WhichOrderedElement;
170 ULONG NumberGenericTableElements;
171 ULONG DepthOfTree;
172 PRTL_BALANCED_LINKS RestartKey;
173 ULONG DeleteCount;
174 PRTL_AVL_COMPARE_ROUTINE CompareRoutine;
175 PRTL_AVL_ALLOCATE_ROUTINE AllocateRoutine;
176 PRTL_AVL_FREE_ROUTINE FreeRoutine;
177 void *TableContext;
178 } RTL_AVL_TABLE, *PRTL_AVL_TABLE;
180 typedef struct _PS_CREATE_NOTIFY_INFO {
181 SIZE_T Size;
182 union {
183 ULONG Flags;
184 struct {
185 ULONG FileOpenNameAvailable :1;
186 ULONG IsSubsystemProcess :1;
187 ULONG Reserved :30;
188 } DUMMYSTRUCTNAME;
189 } DUMMYUNIONNAME;
190 HANDLE ParentProcessId;
191 CLIENT_ID CreatingThreadId;
192 struct _FILE_OBJECT *FileObject;
193 PCUNICODE_STRING ImageFileName;
194 PCUNICODE_STRING CommandLine;
195 NTSTATUS CreationStatus;
196 } PS_CREATE_NOTIFY_INFO, *PPS_CREATE_NOTIFY_INFO;
198 typedef VOID (WINAPI *PDRIVER_NOTIFICATION_CALLBACK_ROUTINE)(PVOID,PVOID);
199 typedef VOID (WINAPI *PDRIVER_REINITIALIZE)(PDRIVER_OBJECT,PVOID,ULONG);
200 typedef VOID (WINAPI *PLOAD_IMAGE_NOTIFY_ROUTINE)(PUNICODE_STRING,HANDLE,PIMAGE_INFO);
201 typedef NTSTATUS (WINAPI *PIO_QUERY_DEVICE_ROUTINE)(PVOID,PUNICODE_STRING,INTERFACE_TYPE,ULONG,
202 PKEY_VALUE_FULL_INFORMATION*,CONFIGURATION_TYPE,ULONG,PKEY_VALUE_FULL_INFORMATION*);
204 NTSTATUS WINAPI IoQueryDeviceDescription(PINTERFACE_TYPE,PULONG,PCONFIGURATION_TYPE,PULONG,
205 PCONFIGURATION_TYPE,PULONG,PIO_QUERY_DEVICE_ROUTINE,PVOID);
206 void WINAPI IoRegisterDriverReinitialization(PDRIVER_OBJECT,PDRIVER_REINITIALIZE,PVOID);
207 NTSTATUS WINAPI IoRegisterShutdownNotification(PDEVICE_OBJECT);
208 void WINAPI KeSetTargetProcessorDpc(PRKDPC,CCHAR);
209 BOOLEAN WINAPI MmIsAddressValid(void *);
210 NTSTATUS WINAPI PsSetLoadImageNotifyRoutine(PLOAD_IMAGE_NOTIFY_ROUTINE);
211 void WINAPI RtlInitializeGenericTableAvl(PRTL_AVL_TABLE,PRTL_AVL_COMPARE_ROUTINE,PRTL_AVL_ALLOCATE_ROUTINE, PRTL_AVL_FREE_ROUTINE,void *);
212 void WINAPI RtlInsertElementGenericTableAvl(PRTL_AVL_TABLE,void *,ULONG,BOOL*);
214 #endif