win-pvdrivers

view mingw/w32api.diff @ 1066:24fae56a87bf

Fix build errors
author James Harper <james.harper@bendigoit.com.au>
date Tue Oct 29 19:38:31 2013 +1100 (2013-10-29)
parents 8f94eeae17f9
children
line source
1 diff -r 0717ca718d88 include/ddk/ndis.h
2 --- a/include/ddk/ndis.h Tue Jul 08 21:35:58 2008 -0700
3 +++ b/include/ddk/ndis.h Thu Jul 17 23:09:31 2008 -0700
4 @@ -52,12 +52,16 @@
5 #if defined(NDIS50_MINIPORT)
6 #ifndef NDIS50
7 #define NDIS50
8 +#define NDIS_MINIPORT_MAJOR_VERSION 5
9 +#define NDIS_MINIPORT_MINOR_VERSION 0
10 #endif
11 #endif /* NDIS50_MINIPORT */
13 #if defined(NDIS51_MINIPORT)
14 #ifndef NDIS51
15 #define NDIS51
16 +#define NDIS_MINIPORT_MAJOR_VERSION 5
17 +#define NDIS_MINIPORT_MINOR_VERSION 1
18 #endif
19 #endif /* NDIS51_MINIPORT */
21 @@ -399,19 +403,19 @@
23 typedef struct _NDIS_PACKET {
24 NDIS_PACKET_PRIVATE Private;
25 - union {
26 - struct {
27 + _ANONYMOUS_UNION union {
28 + _ANONYMOUS_STRUCT struct {
29 UCHAR MiniportReserved[2 * sizeof(PVOID)];
30 UCHAR WrapperReserved[2 * sizeof(PVOID)];
31 - } s1;
32 - struct {
33 + } DUMMYSTRUCTNAME;
34 + _ANONYMOUS_STRUCT struct {
35 UCHAR MiniportReservedEx[3 * sizeof(PVOID)];
36 UCHAR WrapperReservedEx[sizeof(PVOID)];
37 - } s2;
38 - struct {
39 + } DUMMYSTRUCTNAME;
40 + _ANONYMOUS_STRUCT struct {
41 UCHAR MacReserved[4 * sizeof(PVOID)];
42 - } s3;
43 - } u;
44 + } DUMMYSTRUCTNAME;
45 + } DUMMYUNIONNAME;
46 ULONG_PTR Reserved[2];
47 UCHAR ProtocolReserved[1];
48 } NDIS_PACKET, *PNDIS_PACKET, **PPNDIS_PACKET;
49 @@ -642,6 +646,11 @@
50 #define NDIS_DEVICE_DISABLE_WAKE_ON_MAGIC_PACKET 0x00000080
51 #define NDIS_DEVICE_DISABLE_WAKE_ON_PATTERN_MATCH 0x00000100
53 +/* _NDIS_DEVICE_PNP_EVENT */
54 +typedef enum _NDIS_DEVICE_PNP_EVENT
55 +{
56 + Unused
57 +} NDIS_DEVICE_PNP_EVENT;
59 /* OID_GEN_NETWORK_LAYER_ADDRESSES */
60 typedef struct _NETWORK_ADDRESS {
61 @@ -915,6 +924,33 @@
62 } V4ESP;
63 } NDIS_TASK_IPSEC, *PNDIS_TASK_IPSEC;
65 +typedef enum _NDIS_ENCAPSULATION {
66 + UNSPECIFIED_Encapsulation,
67 + NULL_Encapsulation,
68 + IEEE_802_3_Encapsulation,
69 + IEEE_802_5_Encapsulation,
70 + LLC_SNAP_ROUTED_Encapsulation,
71 + LLC_SNAP_BRIDGED_Encapsulation
72 +} NDIS_ENCAPSULATION;
73 +
74 +typedef struct _NDIS_ENCAPSULATION_FORMAT {
75 + NDIS_ENCAPSULATION Encapsulation;
76 + struct {
77 + ULONG FixedHeaderSize : 1;
78 + ULONG Reserved : 31;
79 + } Flags;
80 + ULONG EncapsulationHeaderSize;
81 +} NDIS_ENCAPSULATION_FORMAT, *PNDIS_ENCAPSULATION_FORMAT;
82 +
83 +typedef struct _NDIS_TASK_OFFLOAD_HEADER
84 +{
85 + ULONG Version;
86 + ULONG Size;
87 + ULONG Reserved;
88 + UCHAR OffsetFirstTask;
89 + NDIS_ENCAPSULATION_FORMAT EncapsulationFormat;
90 +} NDIS_TASK_OFFLOAD_HEADER, *PNDIS_TASK_OFFLOAD_HEADER;
91 +
92 typedef struct _NDIS_TASK_OFFLOAD {
93 ULONG Version;
94 ULONG Size;
95 @@ -926,24 +962,6 @@
97 /* NDIS_TASK_OFFLOAD_HEADER.Version constants */
98 #define NDIS_TASK_OFFLOAD_VERSION 1
99 -
100 -typedef enum _NDIS_ENCAPSULATION {
101 - UNSPECIFIED_Encapsulation,
102 - NULL_Encapsulation,
103 - IEEE_802_3_Encapsulation,
104 - IEEE_802_5_Encapsulation,
105 - LLC_SNAP_ROUTED_Encapsulation,
106 - LLC_SNAP_BRIDGED_Encapsulation
107 -} NDIS_ENCAPSULATION;
108 -
109 -typedef struct _NDIS_ENCAPSULATION_FORMAT {
110 - NDIS_ENCAPSULATION Encapsulation;
111 - struct {
112 - ULONG FixedHeaderSize : 1;
113 - ULONG Reserved : 31;
114 - } Flags;
115 - ULONG EncapsulationHeaderSize;
116 -} NDIS_ENCAPSULATION_FORMAT, *PNDIS_ENCAPSULATION_FORMAT;
118 typedef struct _NDIS_TASK_TCP_IP_CHECKSUM {
119 struct {
120 @@ -1542,6 +1560,8 @@
121 /*OUT*/ PNDIS_HANDLE PoolHandle,
122 /*IN*/ UINT NumberOfDescriptors,
123 /*IN*/ UINT ProtocolReservedLength);
124 +
125 +#define PROTOCOL_RESERVED_SIZE_IN_PACKET (4 * sizeof(PVOID))
127 NDISAPI
128 VOID
129 @@ -1756,6 +1776,46 @@
131 /*
132 * VOID
133 + * NdisGetFirstBufferFromPacketSafe(
134 + * IN PNDIS_PACKET _Packet,
135 + * OUT PNDIS_BUFFER * _FirstBuffer,
136 + * OUT PVOID * _FirstBufferVA,
137 + * OUT PUINT _FirstBufferLength,
138 + * OUT PUINT _TotalBufferLength),
139 + * IN MM_PAGE_PRIORITY _Priority)
140 + */
141 +#define NdisGetFirstBufferFromPacketSafe(_Packet, \
142 + _FirstBuffer, \
143 + _FirstBufferVA, \
144 + _FirstBufferLength, \
145 + _TotalBufferLength, \
146 + _Priority) \
147 +{ \
148 + PNDIS_BUFFER _Buffer; \
149 + \
150 + _Buffer = (_Packet)->Private.Head; \
151 + *(_FirstBuffer) = _Buffer; \
152 + if (_Buffer != NULL) \
153 + { \
154 + *(_FirstBufferVA) = MmGetSystemAddressForMdlSafe(_Buffer, _Priority); \
155 + *(_FirstBufferLength) = MmGetMdlByteCount(_Buffer); \
156 + _Buffer = _Buffer->Next; \
157 + *(_TotalBufferLength) = *(_FirstBufferLength); \
158 + while (_Buffer != NULL) { \
159 + *(_TotalBufferLength) += MmGetMdlByteCount(_Buffer); \
160 + _Buffer = _Buffer->Next; \
161 + } \
162 + } \
163 + else \
164 + { \
165 + *(_FirstBufferVA) = 0; \
166 + *(_FirstBufferLength) = 0; \
167 + *(_TotalBufferLength) = 0; \
168 + } \
169 +}
170 +
171 +/*
172 + * VOID
173 * NdisQueryBuffer(
174 * IN PNDIS_BUFFER Buffer,
175 * OUT PVOID *VirtualAddress OPTIONAL,
176 @@ -2092,7 +2152,7 @@
177 * NdisReinitializePacket(
178 * IN OUT PNDIS_PACKET Packet);
179 */
180 -#define NdisReinitializePacketCounts(Packet) \
181 +#define NdisReinitializePacket(Packet) \
182 { \
183 (Packet)->Private.Head = (PNDIS_BUFFER)NULL; \
184 (Packet)->Private.ValidCounts = FALSE; \
185 @@ -2967,6 +3027,11 @@
186 /*IN*/ PUCHAR PacketBuffer,
187 /*IN*/ UINT PacketSize);
189 +#define NdisMIndicateReceivePacket(_handle, _packets, _number) \
190 +{ \
191 + (*((PNDIS_MINIPORT_BLOCK)(_handle))->PacketIndicateHandler)(_handle, _packets, _number); \
192 +}
193 +
194 NDISAPI
195 VOID
196 DDKAPI
197 @@ -3155,6 +3220,13 @@
198 DDKAPI
199 NdisPacketPoolUsage(
200 /*IN*/ NDIS_HANDLE PoolHandle);
201 +
202 +NTOSAPI
203 +VOID
204 +DDKAPI
205 +NdisSetPacketPoolProtocolId(
206 + /*IN*/ NDIS_HANDLE PacketPoolHandle,
207 + /*IN*/ UINT ProtocolId);
209 NDISAPI
210 NDIS_STATUS
211 @@ -4517,6 +4589,29 @@
213 /* Routines for NDIS miniport drivers */
215 +NTOSAPI
216 +VOID
217 +DDKAPI
218 +NdisMInitializeTimer(
219 + /*IN*/ /*OUT*/ PNDIS_MINIPORT_TIMER Timer,
220 + /*IN*/ NDIS_HANDLE MiniportAdapterHandle,
221 + /*IN*/ PNDIS_TIMER_FUNCTION TimerFunction,
222 + /*IN*/ PVOID FunctionContext);
223 +
224 +NTOSAPI
225 +VOID
226 +DDKAPI
227 +NdisMSetPeriodicTimer(
228 + /*IN*/ PNDIS_MINIPORT_TIMER Timer,
229 + /*IN*/ UINT MillisecondsPeriod);
230 +
231 +NTOSAPI
232 +VOID
233 +DDKAPI
234 +NdisMCancelTimer(
235 + /*IN*/ PNDIS_MINIPORT_TIMER Timer,
236 + /*OUT*/ PBOOLEAN TimerCancelled);
237 +
238 NDISAPI
239 VOID
240 DDKAPI
241 diff -r 0717ca718d88 include/ddk/ntddndis.h
242 --- a/include/ddk/ntddndis.h Tue Jul 08 21:35:58 2008 -0700
243 +++ b/include/ddk/ntddndis.h Thu Jul 17 23:09:31 2008 -0700
244 @@ -152,6 +152,8 @@
245 #define OID_802_3_XMIT_TIMES_CRS_LOST 0x01020206
246 #define OID_802_3_XMIT_LATE_COLLISIONS 0x01020207
248 +#define OID_TCP_TASK_OFFLOAD 0xFC010201
249 +
250 /* OID_GEN_MINIPORT_INFO constants */
251 #define NDIS_MINIPORT_BUS_MASTER 0x00000001
252 #define NDIS_MINIPORT_WDM_DRIVER 0x00000002
253 diff -r 0717ca718d88 include/ddk/scsi.h
254 --- a/include/ddk/scsi.h Tue Jul 08 21:35:58 2008 -0700
255 +++ b/include/ddk/scsi.h Thu Jul 17 23:09:31 2008 -0700
256 @@ -1272,6 +1272,13 @@
257 #define IOCTL_SCSI_MINIPORT_NOT_QUORUM_CAPABLE ((FILE_DEVICE_SCSI << 16) + 0x0520)
258 #define IOCTL_SCSI_MINIPORT_NOT_CLUSTER_CAPABLE ((FILE_DEVICE_SCSI << 16) + 0x0521)
260 +/* READ_TOC formats */
261 +#define READ_TOC_FORMAT_TOC 0x00
262 +#define READ_TOC_FORMAT_SESSION 0x01
263 +#define READ_TOC_FORMAT_FULL_TOC 0x02
264 +#define READ_TOC_FORMAT_PMA 0x03
265 +#define READ_TOC_FORMAT_ATIP 0x04
266 +
267 /* Read Capacity Data. Returned in Big Endian format */
268 typedef struct _READ_CAPACITY_DATA {
269 ULONG LogicalBlockAddress;
270 diff -r 0717ca718d88 include/ddk/winddk.h
271 --- a/include/ddk/winddk.h Tue Jul 08 21:35:58 2008 -0700
272 +++ b/include/ddk/winddk.h Thu Jul 17 23:09:31 2008 -0700
273 @@ -3828,7 +3828,7 @@
274 * VOID)
275 */
276 #define KeGetCurrentProcessorNumber() \
277 - ((ULONG)KeGetCurrentKPCR()->ProcessorNumber)
278 + ((ULONG)KeGetCurrentKPCR()->Number)
281 #if __USE_NTOSKRNL__
282 @@ -3842,13 +3842,13 @@
283 LONG
284 DDKFASTAPI
285 InterlockedIncrement(
286 - /*IN*/ PLONG VOLATILE Addend);
287 + /*IN*/ LONG VOLATILE *Addend);
289 NTOSAPI
290 LONG
291 DDKFASTAPI
292 InterlockedDecrement(
293 - /*IN*/ PLONG VOLATILE Addend);
294 + /*IN*/ LONG VOLATILE *Addend);
296 NTOSAPI
297 LONG
298 @@ -4895,6 +4895,10 @@
299 RtlStringFromGUID(
300 /*IN*/ REFGUID Guid,
301 /*OUT*/ PUNICODE_STRING GuidString);
302 +
303 +#define RtlStringCbCopyA(dst, dst_len, src) strncpy(dst, src, dst_len)
304 +#define RtlStringCbPrintfA(args...) snprintf(args)
305 +#define RtlStringCbVPrintfA(args...) vsnprintf(args)
307 NTOSAPI
308 BOOLEAN
309 @@ -7350,6 +7354,11 @@
310 #define KeFlushIoBuffers(_Mdl, _ReadOperation, _DmaOperation)
312 NTOSAPI
313 +VOID
314 +DDKAPI
315 +KeFlushQueuedDpcs(VOID);
316 +
317 +NTOSAPI
318 PRKTHREAD
319 DDKAPI
320 KeGetCurrentThread(
321 @@ -7448,6 +7457,8 @@
322 DDKAPI
323 KeLeaveCriticalRegion(
324 VOID);
325 +
326 +#define KeMemoryBarrier() asm("mfence;")
328 NTOSAPI
329 NTSTATUS
330 @@ -7719,38 +7730,18 @@
331 /*IN*/ BOOLEAN Alertable,
332 /*IN*/ PLARGE_INTEGER Timeout /*OPTIONAL*/);
334 -#if defined(_X86_)
335 -
336 -NTOSAPI
337 -VOID
338 -FASTCALL
339 -KfLowerIrql(
340 - /*IN*/ KIRQL NewIrql);
341 -
342 -NTOSAPI
343 -KIRQL
344 -FASTCALL
345 -KfRaiseIrql(
346 - /*IN*/ KIRQL NewIrql);
347 -
348 -#define KeLowerIrql(a) KfLowerIrql(a)
349 -#define KeRaiseIrql(a,b) *(b) = KfRaiseIrql(a)
350 -
351 -#else
352 +NTOSAPI
353 +VOID
354 +DDKAPI
355 +KeRaiseIrql(
356 + /*IN*/ KIRQL new_irql,
357 + /*OUT*/ PKIRQL old_irql);
359 NTOSAPI
360 VOID
361 DDKAPI
362 KeLowerIrql(
363 - /*IN*/ KIRQL NewIrql);
364 -
365 -NTOSAPI
366 -KIRQL
367 -DDKAPI
368 -KeRaiseIrql(
369 - /*IN*/ KIRQL NewIrql);
370 -
371 -#endif
372 + /*IN*/ KIRQL irql);
374 NTOSAPI
375 KIRQL
376 diff -r 0717ca718d88 lib/ddk/ndis.def
377 --- a/lib/ddk/ndis.def Tue Jul 08 21:35:58 2008 -0700
378 +++ b/lib/ddk/ndis.def Thu Jul 17 23:09:31 2008 -0700
379 @@ -130,8 +130,8 @@
380 ;NdisImmediateWritePortUlong
381 ;NdisImmediateWritePortUshort
382 NdisImmediateWriteSharedMemory@16
383 -;NdisInitAnsiString DATA
384 -;NdisInitUnicodeString DATA
385 +NdisInitAnsiString@8
386 +NdisInitUnicodeString@8
387 ;NdisInitializeEvent
388 NdisInitializeReadWriteLock@4
389 ;NdisInitializeString
390 @@ -149,7 +149,7 @@
391 NdisMAllocateMapRegisters@20
392 NdisMAllocateSharedMemory@20
393 NdisMAllocateSharedMemoryAsync@16
394 -;NdisMCancelTimer
395 +NdisMCancelTimer@8
396 NdisMCloseLog@4
397 NdisMCmActivateVc@8
398 NdisMCmCreateVc@16
399 @@ -179,7 +179,7 @@
400 ;NdisMIndicateStatus
401 ;NdisMIndicateStatusComplete
402 NdisMInitializeScatterGatherDma@12
403 -;NdisMInitializeTimer
404 +NdisMInitializeTimer@16
405 NdisMMapIoSpace@20
406 ;NdisMPciAssignResources
407 NdisMPromoteMiniport@4
408 @@ -202,7 +202,7 @@
409 NdisMSetAttributesEx@20
410 ;NdisMSetInformationComplete
411 NdisMSetMiniportSecondary@8
412 -;NdisMSetPeriodicTimer
413 +NdisMSetPeriodicTimer@8
414 ;NdisMSetTimer
415 NdisMSleep@4
416 ;NdisMStartBufferPhysicalMapping
417 @@ -252,7 +252,7 @@
418 NdisSendPackets@12
419 ;NdisSetEvent
420 ;NdisSetPacketCancelId
421 -;NdisSetPacketPoolProtocolId
422 +NdisSetPacketPoolProtocolId@8
423 ;NdisSetPacketStatus
424 ;NdisSetProtocolFilter
425 ;NdisSetTimer
426 diff -r 0717ca718d88 lib/ddk/ntoskrnl.def
427 --- a/lib/ddk/ntoskrnl.def Tue Jul 08 21:35:58 2008 -0700
428 +++ b/lib/ddk/ntoskrnl.def Thu Jul 17 23:09:31 2008 -0700
429 @@ -506,6 +506,7 @@
430 ;KeFindConfigurationEntry
431 ;KeFindConfigurationNextEntry
432 ;KeFlushEntireTb
433 +KeFlushQueuedDpcs@0
434 KeGetCurrentThread@0
435 KeGetPreviousMode@0
436 KeGetRecommendedSharedDataAlignment@0
437 @@ -542,7 +543,7 @@
438 ;KeIsExecutingDpc
439 KeLeaveCriticalRegion@0
440 ;KeLoaderBlock DATA
441 -;KeNumberProcessors DATA
442 +KeNumberProcessors DATA
443 ;KeProfileInterrupt
444 ;KeProfileInterruptWithSource
445 KePulseEvent@12
446 diff -r 0717ca718d88 lib/ddk/scsiport.def
447 --- a/lib/ddk/scsiport.def Tue Jul 08 21:35:58 2008 -0700
448 +++ b/lib/ddk/scsiport.def Thu Jul 17 23:09:31 2008 -0700
449 @@ -8,7 +8,7 @@
450 ScsiPortFlushDma@4
451 ScsiPortFreeDeviceBase@8
452 ScsiPortGetBusData@24
453 -ScsiPortGetDeviceBase@24
454 +ScsiPortGetDeviceBase@28
455 ScsiPortGetLogicalUnit@16
456 ScsiPortGetPhysicalAddress@16
457 ScsiPortGetSrb@20