116{
128 BOOLEAN bUseDMA, bUseInterrupt;
135
136
138
139
141
143
144
146
147 if (!RequestBlock)
148 {
149
152 }
153
154
156
157
159
160
162 ASSERT(DriverObjectExtension);
163
164
166
167
170
171
176
178 Config->HwDeviceExtension = (
PVOID) (DeviceExtension + 1);
183
186
187
189
190
192 bUseInterrupt =
FALSE;
193
195
197 {
198
200
202 {
204 {
205
209 Config->NumberOfAccessRanges++;
210 break;
211 }
213 {
214
219 bUseInterrupt =
TRUE;
220 break;
221 }
223 {
226 if (!MappedAddr || !Mem)
227 {
228 if (Mem)
229 {
230
232 }
233
234 if (MappedAddr)
235 {
236
238 }
239
240
242
246 }
247
251 Config->NumberOfAccessRanges++;
252
254 Mem->
Start = MappedAddr;
256 break;
257 }
259 {
262 break;
263 }
264 }
265 }
266
268 {
269
271 }
272 else
273 {
274
276
277
280 (
PVOID)DeviceExtension,
282 Config->BusInterruptVector,
283 Config->BusInterruptLevel,
284 Config->BusInterruptLevel,
290 {
291
293
295
298 }
299
300
302 }
303
304
306 {
307
309
320
322 if (!Adapter)
323 {
324
326
328
331 }
332
334 {
337 {
338
340
342
345 }
346 }
347
348
352 }
353
354
355
357 {
359 }
360 else
361 {
363 }
364
366 {
367
369
371
374 }
375
377
378
379
380
383 {
384
386
388 }
389
390
392
393
395 {
396
398
400
403 }
404
405
407 if (!StreamDescriptor)
408 {
409
411
413
416 }
417
418
420
421
425
426
429 {
430
432
434 }
435
437 {
438
440 }
441 else
442 {
443
445 }
446
448
450
452}
#define NT_SUCCESS(StatCode)
struct _ACCESS_RANGE ACCESS_RANGE
struct _PORT_CONFIGURATION_INFORMATION * PPORT_CONFIGURATION_INFORMATION
struct _ACCESS_RANGE * PACCESS_RANGE
NTSTATUS NTAPI StreamClassAddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PhysicalDeviceObject)
VOID NTAPI StreamClassReleaseResources(IN PDEVICE_OBJECT DeviceObject)
VOID CompleteIrp(IN PIRP Irp, IN NTSTATUS Status, IN ULONG_PTR Information)
BOOLEAN NTAPI StreamClassSynchronize(IN PKINTERRUPT Interrupt, IN PKSYNCHRONIZE_ROUTINE SynchronizeRoutine, IN PVOID SynchronizeContext)
BOOLEAN NTAPI StreamClassInterruptRoutine(IN PKINTERRUPT Interrupt, IN PVOID ServiceContext)
#define InsertTailList(ListHead, Entry)
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeInitializeEvent(pEvt, foo, foo2)
VOID NTAPI KeClearEvent(IN PKEVENT Event)
#define ExAllocatePool(type, size)
#define CmResourceTypeMemory
#define CmResourceTypeDma
enum _INTERFACE_TYPE INTERFACE_TYPE
#define CmResourceTypePort
#define CmResourceTypeInterrupt
PVOID NTAPI MmMapIoSpace(IN PHYSICAL_ADDRESS PhysicalAddress, IN SIZE_T NumberOfBytes, IN MEMORY_CACHING_TYPE CacheType)
PVOID NTAPI IoGetDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress)
BOOLEAN NTAPI IoForwardIrpSynchronously(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
NTSTATUS NTAPI IoConnectInterrupt(OUT PKINTERRUPT *InterruptObject, IN PKSERVICE_ROUTINE ServiceRoutine, IN PVOID ServiceContext, IN PKSPIN_LOCK SpinLock, IN ULONG Vector, IN KIRQL Irql, IN KIRQL SynchronizeIrql, IN KINTERRUPT_MODE InterruptMode, IN BOOLEAN ShareVector, IN KAFFINITY ProcessorEnableMask, IN BOOLEAN FloatingSave)
BOOLEAN NTAPI KeSynchronizeExecution(IN OUT PKINTERRUPT Interrupt, IN PKSYNCHRONIZE_ROUTINE SynchronizeRoutine, IN PVOID SynchronizeContext OPTIONAL)
PDMA_ADAPTER NTAPI IoGetDmaAdapter(IN PDEVICE_OBJECT PhysicalDeviceObject, IN PDEVICE_DESCRIPTION DeviceDescription, IN OUT PULONG NumberOfMapRegisters)
NTSTATUS NTAPI IoGetDeviceProperty(IN PDEVICE_OBJECT DeviceObject, IN DEVICE_REGISTRY_PROPERTY DeviceProperty, IN ULONG BufferLength, OUT PVOID PropertyBuffer, OUT PULONG ResultLength)
struct _HW_STREAM_REQUEST_BLOCK HW_STREAM_REQUEST_BLOCK
HW_STREAM_REQUEST_BLOCK Block
PHW_STREAM_DESCRIPTOR StreamDescriptor
PDEVICE_OBJECT PhysicalDeviceObject
ULONG StreamDescriptorSize
PHYSICAL_ADDRESS DmaPhysicalAddress
PDEVICE_OBJECT LowerDeviceObject
SYNCHRONIZE_FUNC SynchronizeFunction
INTERFACE_TYPE InterfaceType
BOOLEAN Dma32BitAddresses
PHW_RECEIVE_DEVICE_SRB HwReceivePacket
BOOLEAN Dma24BitAddresses
union _HW_STREAM_REQUEST_BLOCK::_CommandData CommandData
union _IO_STACK_LOCATION::@1579 Parameters
struct _IO_STACK_LOCATION::@3978::@4015 StartDevice
#define RtlZeroMemory(Destination, Length)
#define STATUS_UNSUCCESSFUL
#define STATUS_INSUFFICIENT_RESOURCES
PHW_STREAM_DESCRIPTOR StreamBuffer
struct _PORT_CONFIGURATION_INFORMATION * ConfigInfo
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_CHILD_LIST_CONFIG Config
_In_ WDFCOLLECTION _In_ ULONG Index
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ ULONG _Out_ PULONG ResultLength
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
_Must_inspect_result_ _In_ WDFCMRESLIST List
struct _DMA_ADAPTER * PADAPTER_OBJECT
_In_ ULONG _In_ ULONG _In_ ULONG _Out_ PKIRQL _Out_ PKAFFINITY Affinity
#define DEVICE_DESCRIPTION_VERSION
@ DevicePropertyBusNumber
@ DevicePropertyLegacyBusType