ReactOS  0.4.15-dev-994-ga9f6032
isapnp.h File Reference
#include <wdm.h>
#include <ntstrsafe.h>
#include <isapnphw.h>
Include dependency graph for isapnp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _ISAPNP_IO
 
struct  _ISAPNP_IRQ
 
struct  _ISAPNP_DMA
 
struct  _ISAPNP_LOGICAL_DEVICE
 
struct  _ISAPNP_COMMON_EXTENSION
 
struct  _ISAPNP_FDO_EXTENSION
 
struct  _ISAPNP_PDO_EXTENSION
 

Macros

#define TAG_ISAPNP   'PNPI'
 
#define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE   1
 
#define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING   2
 

Typedefs

typedef struct _ISAPNP_IO ISAPNP_IO
 
typedef struct _ISAPNP_IO PISAPNP_IO
 
typedef struct _ISAPNP_IRQ ISAPNP_IRQ
 
typedef struct _ISAPNP_IRQPISAPNP_IRQ
 
typedef struct _ISAPNP_DMA ISAPNP_DMA
 
typedef struct _ISAPNP_DMAPISAPNP_DMA
 
typedef struct _ISAPNP_LOGICAL_DEVICE ISAPNP_LOGICAL_DEVICE
 
typedef struct _ISAPNP_LOGICAL_DEVICEPISAPNP_LOGICAL_DEVICE
 
typedef struct _ISAPNP_COMMON_EXTENSION ISAPNP_COMMON_EXTENSION
 
typedef struct _ISAPNP_COMMON_EXTENSIONPISAPNP_COMMON_EXTENSION
 
typedef struct _ISAPNP_FDO_EXTENSION ISAPNP_FDO_EXTENSION
 
typedef struct _ISAPNP_FDO_EXTENSIONPISAPNP_FDO_EXTENSION
 
typedef struct _ISAPNP_PDO_EXTENSION ISAPNP_PDO_EXTENSION
 
typedef struct _ISAPNP_PDO_EXTENSIONPISAPNP_PDO_EXTENSION
 

Enumerations

enum  ISAPNP_DEVICE_STATE { dsStopped, dsStarted }
 

Functions

NTSTATUS NTAPI IsaPnpDuplicateUnicodeString (IN ULONG Flags, IN PCUNICODE_STRING SourceString, OUT PUNICODE_STRING DestinationString)
 
NTSTATUS NTAPI IsaPnpFillDeviceRelations (IN PISAPNP_FDO_EXTENSION FdoExt, IN PIRP Irp, IN BOOLEAN IncludeDataPort)
 
NTSTATUS NTAPI DriverEntry (IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
 
NTSTATUS NTAPI IsaForwardIrpSynchronous (IN PISAPNP_FDO_EXTENSION FdoExt, IN PIRP Irp)
 
NTSTATUS NTAPI IsaFdoPnp (IN PISAPNP_FDO_EXTENSION FdoExt, IN PIRP Irp, IN PIO_STACK_LOCATION IrpSp)
 
NTSTATUS NTAPI IsaPdoPnp (IN PISAPNP_PDO_EXTENSION PdoDeviceExtension, IN PIRP Irp, IN PIO_STACK_LOCATION IrpSp)
 
NTSTATUS NTAPI IsaHwTryReadDataPort (IN PUCHAR ReadDataPort)
 
NTSTATUS NTAPI IsaHwFillDeviceList (IN PISAPNP_FDO_EXTENSION FdoExt)
 
NTSTATUS NTAPI IsaHwDeactivateDevice (IN PISAPNP_LOGICAL_DEVICE LogicalDevice)
 
NTSTATUS NTAPI IsaHwActivateDevice (IN PISAPNP_LOGICAL_DEVICE LogicalDevice)
 

Variables

DRIVER_INITIALIZE DriverEntry
 

Macro Definition Documentation

◆ RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING

#define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING   2

Definition at line 83 of file isapnp.h.

◆ RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE

#define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE   1

Definition at line 82 of file isapnp.h.

◆ TAG_ISAPNP

#define TAG_ISAPNP   'PNPI'

Definition at line 12 of file isapnp.h.

Typedef Documentation

◆ ISAPNP_COMMON_EXTENSION

◆ ISAPNP_DMA

◆ ISAPNP_FDO_EXTENSION

◆ ISAPNP_IO

◆ ISAPNP_IRQ

◆ ISAPNP_LOGICAL_DEVICE

◆ ISAPNP_PDO_EXTENSION

◆ PISAPNP_COMMON_EXTENSION

◆ PISAPNP_DMA

◆ PISAPNP_FDO_EXTENSION

◆ PISAPNP_IO

◆ PISAPNP_IRQ

◆ PISAPNP_LOGICAL_DEVICE

◆ PISAPNP_PDO_EXTENSION

Enumeration Type Documentation

◆ ISAPNP_DEVICE_STATE

Enumerator
dsStopped 
dsStarted 

Definition at line 14 of file isapnp.h.

14  {
15  dsStopped,
16  dsStarted
ISAPNP_DEVICE_STATE
Definition: isapnp.h:14

Function Documentation

◆ DriverEntry()

NTSTATUS NTAPI DriverEntry ( IN PDRIVER_OBJECT  DriverObject,
IN PUNICODE_STRING  RegistryPath 
)

Definition at line 367 of file beep.c.

369 {
370  PDEVICE_EXTENSION DeviceExtension;
372  UNICODE_STRING DeviceName = RTL_CONSTANT_STRING(L"\\Device\\Beep");
374 
376 
377  /* Create the device */
379  sizeof(DEVICE_EXTENSION),
380  &DeviceName,
382  0,
383  FALSE,
384  &DeviceObject);
385  if (!NT_SUCCESS(Status)) return Status;
386 
387  /* Make it use buffered I/O */
389 
390  /* Setup the Driver Object */
397 
398  /* Set up device extension */
399  DeviceExtension = DeviceObject->DeviceExtension;
400  DeviceExtension->ReferenceCount = 0;
401  DeviceExtension->TimerActive = FALSE;
403  KeInitializeTimer(&DeviceExtension->Timer);
404  ExInitializeFastMutex(&DeviceExtension->Mutex);
405 
406  /* Page the entire driver */
408  return STATUS_SUCCESS;
409 }
DRIVER_DISPATCH BeepClose
Definition: beep.c:78
FORCEINLINE VOID IoInitializeDpcRequest(_In_ PDEVICE_OBJECT DeviceObject, _In_ PIO_DPC_ROUTINE DpcRoutine)
Definition: iofuncs.h:2836
DRIVER_STARTIO BeepStartIo
Definition: beep.c:295
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
LONG NTSTATUS
Definition: precomp.h:26
WCHAR DeviceName[]
Definition: adapter.cpp:21
#define FILE_DEVICE_BEEP
Definition: winioctl.h:106
DRIVER_DISPATCH BeepDeviceControl
Definition: beep.c:206
NTSTATUS NTAPI DriverEntry(IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
Definition: beep.c:367
#define FALSE
Definition: types.h:117
PVOID DeviceExtension
Definition: env_spec_w32.h:418
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
VOID NTAPI KeInitializeTimer(OUT PKTIMER Timer)
Definition: timerobj.c:233
DRIVER_DISPATCH BeepCreate
Definition: beep.c:52
_In_z_ PWSTR RegistryPath
Definition: classp.h:1930
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define DO_BUFFERED_IO
Definition: env_spec_w32.h:394
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition: exfuncs.h:274
PVOID NTAPI MmPageEntireDriver(IN PVOID AddressWithinSection)
Definition: sysldr.c:3370
IO_DPC_ROUTINE * PIO_DPC_ROUTINE
Definition: iotypes.h:2499
VOID NTAPI BeepDPC(IN PKDPC Dpc, IN PDEVICE_OBJECT DeviceObject, IN PVOID SystemArgument1, IN PVOID SystemArgument2)
Definition: beep.c:34
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
Status
Definition: gdiplustypes.h:24
static const WCHAR L[]
Definition: oid.c:1250
PDRIVER_UNLOAD DriverUnload
Definition: iotypes.h:2187
DRIVER_DISPATCH BeepCleanup
Definition: beep.c:145
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1569
FAST_MUTEX Mutex
Definition: beep.c:24
DRIVER_UNLOAD BeepUnload
Definition: beep.c:268
#define IRP_MJ_CLEANUP
PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION+1]
Definition: iotypes.h:2188
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031
PDRIVER_STARTIO DriverStartIo
Definition: iotypes.h:2186
return STATUS_SUCCESS
Definition: btrfs.c:3014
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14

◆ IsaFdoPnp()

NTSTATUS NTAPI IsaFdoPnp ( IN PISAPNP_FDO_EXTENSION  FdoExt,
IN PIRP  Irp,
IN PIO_STACK_LOCATION  IrpSp 
)

Definition at line 44 of file fdo.c.

48 {
49  NTSTATUS Status = Irp->IoStatus.Status;
50 
51  switch (IrpSp->MinorFunction)
52  {
55 
56  if (NT_SUCCESS(Status))
57  Status = IsaFdoStartDevice(FdoExt, Irp, IrpSp);
58 
59  Irp->IoStatus.Status = Status;
60 
62  return Status;
63 
64  case IRP_MN_STOP_DEVICE:
65  FdoExt->Common.State = dsStopped;
66 
68  break;
69 
72 
73  Irp->IoStatus.Status = Status;
74 
76  return Status;
77 
79  DPRINT("IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
80  break;
81 
82  default:
83  DPRINT1("Unknown PnP code: %x\n", IrpSp->MinorFunction);
84  break;
85  }
86 
88 
89  return IoCallDriver(FdoExt->Ldo, Irp);
90 }
NTSTATUS NTAPI IsaFdoQueryDeviceRelations(IN PISAPNP_FDO_EXTENSION FdoExt, IN PIRP Irp, IN PIO_STACK_LOCATION IrpSp)
Definition: fdo.c:31
_In_ PIRP Irp
Definition: csq.h:116
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS
LONG NTSTATUS
Definition: precomp.h:26
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
NTSTATUS NTAPI IsaForwardIrpSynchronous(IN PISAPNP_FDO_EXTENSION FdoExt, IN PIRP Irp)
Definition: isapnp.c:519
#define IRP_MN_STOP_DEVICE
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define IRP_MN_START_DEVICE
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI IsaFdoStartDevice(IN PISAPNP_FDO_EXTENSION FdoExt, IN PIRP Irp, IN PIO_STACK_LOCATION IrpSp)
Definition: fdo.c:16
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1218
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
#define DPRINT1
Definition: precomp.h:8
#define IO_NO_INCREMENT
Definition: iotypes.h:570
return STATUS_SUCCESS
Definition: btrfs.c:3014

Referenced by IsaPnp().

◆ IsaForwardIrpSynchronous()

NTSTATUS NTAPI IsaForwardIrpSynchronous ( IN PISAPNP_FDO_EXTENSION  FdoExt,
IN PIRP  Irp 
)

Definition at line 519 of file isapnp.c.

522 {
523  KEVENT Event;
525 
528 
530 
531  Status = IoCallDriver(FdoExt->Ldo, Irp);
532  if (Status == STATUS_PENDING)
533  {
535  if (NT_SUCCESS(Status))
536  Status = Irp->IoStatus.Status;
537  }
538 
539  return Status;
540 }
_In_ PIRP Irp
Definition: csq.h:116
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS NTAPI KeWaitForSingleObject(IN PVOID Object, IN KWAIT_REASON WaitReason, IN KPROCESSOR_MODE WaitMode, IN BOOLEAN Alertable, IN PLARGE_INTEGER Timeout OPTIONAL)
Definition: wait.c:416
#define IoSetCompletionRoutine(_Irp, _CompletionRoutine, _Context, _InvokeOnSuccess, _InvokeOnError, _InvokeOnCancel)
Definition: irp.cpp:498
FORCEINLINE VOID IoCopyCurrentIrpStackLocationToNext(_Inout_ PIRP Irp)
Definition: iofuncs.h:2864
#define FALSE
Definition: types.h:117
_In_ PVOID _In_ ULONG Event
Definition: iotypes.h:439
smooth NULL
Definition: ftsmooth.c:416
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_PENDING
Definition: ntstatus.h:82
Status
Definition: gdiplustypes.h:24
static IO_COMPLETION_ROUTINE ForwardIrpCompletion
Definition: isapnp.c:499
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1218

Referenced by IsaFdoPnp().

◆ IsaHwActivateDevice()

NTSTATUS NTAPI IsaHwActivateDevice ( IN PISAPNP_LOGICAL_DEVICE  LogicalDevice)

Definition at line 599 of file hardware.c.

601 {
602  DeviceActivation(LogicalDevice,
603  TRUE);
604 
605  return STATUS_SUCCESS;
606 }
#define TRUE
Definition: types.h:120
VOID DeviceActivation(IN PISAPNP_LOGICAL_DEVICE IsaDevice, IN BOOLEAN Activate)
Definition: hardware.c:499
return STATUS_SUCCESS
Definition: btrfs.c:3014

Referenced by IsaPdoPnp().

◆ IsaHwDeactivateDevice()

NTSTATUS NTAPI IsaHwDeactivateDevice ( IN PISAPNP_LOGICAL_DEVICE  LogicalDevice)

Definition at line 610 of file hardware.c.

612 {
613  DeviceActivation(LogicalDevice,
614  FALSE);
615 
616  return STATUS_SUCCESS;
617 }
VOID DeviceActivation(IN PISAPNP_LOGICAL_DEVICE IsaDevice, IN BOOLEAN Activate)
Definition: hardware.c:499
#define FALSE
Definition: types.h:117
return STATUS_SUCCESS
Definition: btrfs.c:3014

Referenced by IsaPdoPnp().

◆ IsaHwFillDeviceList()

NTSTATUS NTAPI IsaHwFillDeviceList ( IN PISAPNP_FDO_EXTENSION  FdoExt)

Definition at line 621 of file hardware.c.

623 {
624  return ProbeIsaPnpBus(FdoExt);
625 }
NTSTATUS ProbeIsaPnpBus(IN PISAPNP_FDO_EXTENSION FdoExt)
Definition: hardware.c:518

Referenced by IsaPdoStartReadPort().

◆ IsaHwTryReadDataPort()

NTSTATUS NTAPI IsaHwTryReadDataPort ( IN PUCHAR  ReadDataPort)

Definition at line 591 of file hardware.c.

593 {
594  return TryIsolate(ReadDataPort) > 0 ? STATUS_SUCCESS : STATUS_INSUFFICIENT_RESOURCES;
595 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
static INT TryIsolate(IN PUCHAR ReadDataPort)
Definition: hardware.c:394
return STATUS_SUCCESS
Definition: btrfs.c:3014

Referenced by IsaPdoStartReadPort().

◆ IsaPdoPnp()

NTSTATUS NTAPI IsaPdoPnp ( IN PISAPNP_PDO_EXTENSION  PdoDeviceExtension,
IN PIRP  Irp,
IN PIO_STACK_LOCATION  IrpSp 
)

Definition at line 298 of file pdo.c.

302 {
303  NTSTATUS Status = Irp->IoStatus.Status;
304 
305  switch (IrpSp->MinorFunction)
306  {
307  case IRP_MN_START_DEVICE:
308  if (PdoExt->IsaPnpDevice)
309  Status = IsaHwActivateDevice(PdoExt->IsaPnpDevice);
310  else
312 
313  if (NT_SUCCESS(Status))
314  PdoExt->Common.State = dsStarted;
315  break;
316 
317  case IRP_MN_STOP_DEVICE:
318  if (PdoExt->IsaPnpDevice)
319  Status = IsaHwDeactivateDevice(PdoExt->IsaPnpDevice);
320  else
322 
323  if (NT_SUCCESS(Status))
324  PdoExt->Common.State = dsStopped;
325  break;
326 
329  break;
330 
333  break;
334 
336  if (PdoExt->Common.Self == PdoExt->FdoExt->DataPortPdo)
338  break;
339 
342  break;
343 
346  break;
347 
348  case IRP_MN_QUERY_ID:
350  break;
351 
361  break;
362 
363  case IRP_MN_READ_CONFIG:
364  case IRP_MN_WRITE_CONFIG:
365  case IRP_MN_EJECT:
366  case IRP_MN_SET_LOCK:
370 
371  default:
372  DPRINT1("Unknown PnP code: %x\n", IrpSp->MinorFunction);
373  break;
374  }
375 
376  Irp->IoStatus.Status = Status;
378 
379  return Status;
380 }
#define IRP_MN_CANCEL_REMOVE_DEVICE
#define IRP_MN_QUERY_RESOURCES
#define IRP_MN_REMOVE_DEVICE
#define IRP_MN_QUERY_ID
_In_ PIRP Irp
Definition: csq.h:116
#define TRUE
Definition: types.h:120
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS
#define IRP_MN_QUERY_RESOURCE_REQUIREMENTS
#define IRP_MN_WRITE_CONFIG
LONG NTSTATUS
Definition: precomp.h:26
PUSBHUB_PORT_PDO_EXTENSION NTAPI PdoExt(IN PDEVICE_OBJECT DeviceObject)
Definition: usbhub.c:133
#define IRP_MN_EJECT
NTSTATUS NTAPI IsaPdoQueryCapabilities(IN PISAPNP_PDO_EXTENSION PdoExt, IN PIRP Irp, IN PIO_STACK_LOCATION IrpSp)
Definition: pdo.c:47
NTSTATUS NTAPI IsaPdoRepeatRequest(IN PISAPNP_PDO_EXTENSION PdoExt, IN PIRP Irp, IN BOOLEAN NeedsVote)
Definition: pdo.c:269
#define IRP_MN_QUERY_REMOVE_DEVICE
COMMON_DEVICE_EXTENSION Common
Definition: usbhub.h:204
NTSTATUS NTAPI IsaPdoQueryDeviceRelations(IN PISAPNP_PDO_EXTENSION PdoExt, IN PIRP Irp, IN PIO_STACK_LOCATION IrpSp)
Definition: pdo.c:16
#define IoCompleteRequest
Definition: irp.c:1240
NTSTATUS NTAPI IsaPdoQueryResourceRequirements(IN PISAPNP_PDO_EXTENSION PdoExt, IN PIRP Irp, IN PIO_STACK_LOCATION IrpSp)
Definition: pdo.c:165
#define IRP_MN_READ_CONFIG
#define IRP_MN_QUERY_STOP_DEVICE
NTSTATUS NTAPI IsaPdoQueryResources(IN PISAPNP_PDO_EXTENSION PdoExt, IN PIRP Irp, IN PIO_STACK_LOCATION IrpSp)
Definition: pdo.c:142
#define IRP_MN_SURPRISE_REMOVAL
Definition: ntifs_ex.h:408
static NTSTATUS NTAPI IsaPdoStartReadPort(IN PISAPNP_FDO_EXTENSION FdoExt, IN PIO_STACK_LOCATION IrpSp)
Definition: pdo.c:189
#define IRP_MN_STOP_DEVICE
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define IRP_MN_START_DEVICE
#define IRP_MN_QUERY_DEVICE_TEXT
NTSTATUS NTAPI IsaPdoQueryPnpDeviceState(IN PISAPNP_PDO_EXTENSION PdoExt, IN PIRP Irp, IN PIO_STACK_LOCATION IrpSp)
Definition: pdo.c:81
#define IRP_MN_QUERY_BUS_INFORMATION
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI IsaHwActivateDevice(IN PISAPNP_LOGICAL_DEVICE LogicalDevice)
Definition: hardware.c:599
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
#define IRP_MN_QUERY_DEVICE_RELATIONS
NTSTATUS NTAPI IsaHwDeactivateDevice(IN PISAPNP_LOGICAL_DEVICE LogicalDevice)
Definition: hardware.c:610
#define DPRINT1
Definition: precomp.h:8
#define IRP_MN_SET_LOCK
#define IO_NO_INCREMENT
Definition: iotypes.h:570
#define IRP_MN_CANCEL_STOP_DEVICE
#define IRP_MN_DEVICE_USAGE_NOTIFICATION
return STATUS_SUCCESS
Definition: btrfs.c:3014
NTSTATUS NTAPI IsaPdoQueryId(IN PISAPNP_PDO_EXTENSION PdoExt, IN PIRP Irp, IN PIO_STACK_LOCATION IrpSp)
Definition: pdo.c:92
#define IRP_MN_QUERY_PNP_DEVICE_STATE
#define IRP_MN_QUERY_CAPABILITIES

Referenced by IsaPnp().

◆ IsaPnpDuplicateUnicodeString()

NTSTATUS NTAPI IsaPnpDuplicateUnicodeString ( IN ULONG  Flags,
IN PCUNICODE_STRING  SourceString,
OUT PUNICODE_STRING  DestinationString 
)

Definition at line 16 of file isapnp.c.

20 {
21  if (SourceString == NULL ||
26  Flags >= 4)
27  {
29  }
30 
31  if ((SourceString->Length == 0) &&
34  {
38  }
39  else
40  {
41  USHORT DestMaxLength = SourceString->Length;
42 
44  DestMaxLength += sizeof(UNICODE_NULL);
45 
48  return STATUS_NO_MEMORY;
49 
52  DestinationString->MaximumLength = DestMaxLength;
53 
56  }
57 
58  return STATUS_SUCCESS;
59 }
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
unsigned short Length
Definition: sprintf.c:451
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
void * Buffer
Definition: sprintf.c:453
#define UNICODE_NULL
_Out_ _Inout_ POEM_STRING DestinationString
Definition: rtlfuncs.h:1868
smooth NULL
Definition: ftsmooth.c:416
#define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE
Definition: isapnp.h:82
__wchar_t WCHAR
Definition: xmlstorage.h:180
_Out_ _Inout_ POEM_STRING _In_ PCUNICODE_STRING SourceString
Definition: rtlfuncs.h:1868
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
#define RTL_DUPLICATE_UNICODE_STRING_ALLOCATE_NULL_STRING
Definition: isapnp.h:83
unsigned short USHORT
Definition: pedump.c:61
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
return STATUS_SUCCESS
Definition: btrfs.c:3014
unsigned short MaximumLength
Definition: sprintf.c:452

Referenced by IsaFdoCreateDeviceIDs(), and IsaPnpCreateReadPortDO().

◆ IsaPnpFillDeviceRelations()

NTSTATUS NTAPI IsaPnpFillDeviceRelations ( IN PISAPNP_FDO_EXTENSION  FdoExt,
IN PIRP  Irp,
IN BOOLEAN  IncludeDataPort 
)

Definition at line 411 of file isapnp.c.

415 {
418  PLIST_ENTRY CurrentEntry;
419  PISAPNP_LOGICAL_DEVICE IsaDevice;
420  PDEVICE_RELATIONS DeviceRelations;
421  ULONG i = 0;
422 
423  DeviceRelations = ExAllocatePool(NonPagedPool,
424  sizeof(DEVICE_RELATIONS) + sizeof(DEVICE_OBJECT) * FdoExt->DeviceCount);
425  if (!DeviceRelations)
426  {
427  return STATUS_NO_MEMORY;
428  }
429 
430  if (IncludeDataPort)
431  {
432  DeviceRelations->Objects[i++] = FdoExt->DataPortPdo;
433  ObReferenceObject(FdoExt->DataPortPdo);
434  }
435 
436  CurrentEntry = FdoExt->DeviceListHead.Flink;
437  while (CurrentEntry != &FdoExt->DeviceListHead)
438  {
439  IsaDevice = CONTAINING_RECORD(CurrentEntry, ISAPNP_LOGICAL_DEVICE, ListEntry);
440 
441  if (!IsaDevice->Pdo)
442  {
443  Status = IoCreateDevice(FdoExt->DriverObject,
444  sizeof(ISAPNP_PDO_EXTENSION),
445  NULL,
448  FALSE,
449  &IsaDevice->Pdo);
450  if (!NT_SUCCESS(Status))
451  {
452  break;
453  }
454 
455  IsaDevice->Pdo->Flags &= ~DO_DEVICE_INITIALIZING;
456 
457  //Device->Pdo->Flags |= DO_POWER_PAGABLE;
458 
460 
462 
463  PdoExt->Common.IsFdo = FALSE;
464  PdoExt->Common.Self = IsaDevice->Pdo;
465  PdoExt->Common.State = dsStopped;
466  PdoExt->IsaPnpDevice = IsaDevice;
467  PdoExt->FdoExt = FdoExt;
468 
470 
471  if (NT_SUCCESS(Status))
473 
474  if (NT_SUCCESS(Status))
476 
477  if (!NT_SUCCESS(Status))
478  {
479  IoDeleteDevice(IsaDevice->Pdo);
480  IsaDevice->Pdo = NULL;
481  break;
482  }
483  }
484  DeviceRelations->Objects[i++] = IsaDevice->Pdo;
485 
486  ObReferenceObject(IsaDevice->Pdo);
487 
488  CurrentEntry = CurrentEntry->Flink;
489  }
490 
491  DeviceRelations->Count = i;
492 
493  Irp->IoStatus.Information = (ULONG_PTR)DeviceRelations;
494 
495  return Status;
496 }
#define DO_DEVICE_INITIALIZING
Definition: env_spec_w32.h:399
_In_ PIRP Irp
Definition: csq.h:116
PDEVICE_OBJECT Objects[1]
Definition: iotypes.h:2062
LONG NTSTATUS
Definition: precomp.h:26
PUSBHUB_PORT_PDO_EXTENSION NTAPI PdoExt(IN PDEVICE_OBJECT DeviceObject)
Definition: usbhub.c:133
static NTSTATUS NTAPI IsaFdoCreateRequirements(IN PISAPNP_PDO_EXTENSION PdoExt)
Definition: isapnp.c:143
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static NTSTATUS NTAPI IsaFdoCreateResources(IN PISAPNP_PDO_EXTENSION PdoExt)
Definition: isapnp.c:299
#define FILE_DEVICE_CONTROLLER
Definition: winioctl.h:109
#define FALSE
Definition: types.h:117
COMMON_DEVICE_EXTENSION Common
Definition: usbhub.h:204
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
PDEVICE_OBJECT Pdo
Definition: isapnp.h:36
#define FILE_AUTOGENERATED_DEVICE_NAME
Definition: iotypes.h:138
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
static NTSTATUS NTAPI IsaFdoCreateDeviceIDs(IN PISAPNP_PDO_EXTENSION PdoExt)
Definition: isapnp.c:64
Status
Definition: gdiplustypes.h:24
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
Definition: typedefs.h:119
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
#define ObReferenceObject
Definition: obfuncs.h:204
unsigned int ULONG
Definition: retypes.h:1
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define ULONG_PTR
Definition: config.h:101
#define FILE_DEVICE_SECURE_OPEN
Definition: cdrw_usr.h:46
return STATUS_SUCCESS
Definition: btrfs.c:3014
struct _ISAPNP_PDO_EXTENSION * PISAPNP_PDO_EXTENSION

Referenced by IsaFdoQueryDeviceRelations(), and IsaPdoQueryDeviceRelations().

Variable Documentation

◆ DriverEntry

DRIVER_INITIALIZE DriverEntry

Definition at line 99 of file isapnp.h.