ReactOS  0.4.15-dev-976-g0f66c66
isapnp.c File Reference
#include <isapnp.h>
#include <debug.h>
Include dependency graph for isapnp.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

NTSTATUS NTAPI IsaPnpDuplicateUnicodeString (IN ULONG Flags, IN PCUNICODE_STRING SourceString, OUT PUNICODE_STRING DestinationString)
 
static NTSTATUS NTAPI IsaFdoCreateDeviceIDs (IN PISAPNP_PDO_EXTENSION PdoExt)
 
static NTSTATUS NTAPI IsaFdoCreateRequirements (IN PISAPNP_PDO_EXTENSION PdoExt)
 
static NTSTATUS NTAPI IsaFdoCreateResources (IN PISAPNP_PDO_EXTENSION PdoExt)
 
NTSTATUS NTAPI IsaPnpFillDeviceRelations (IN PISAPNP_FDO_EXTENSION FdoExt, IN PIRP Irp, IN BOOLEAN IncludeDataPort)
 
static NTSTATUS NTAPI ForwardIrpCompletion (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp, IN PVOID Context)
 
NTSTATUS NTAPI IsaForwardIrpSynchronous (IN PISAPNP_FDO_EXTENSION FdoExt, IN PIRP Irp)
 
static NTSTATUS NTAPI IsaCreateClose (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
static NTSTATUS NTAPI IsaIoctl (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
static NTSTATUS NTAPI IsaReadWrite (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
static NTSTATUS NTAPI IsaPnpCreateReadPortDORequirements (IN PISAPNP_PDO_EXTENSION PdoExt)
 
static NTSTATUS NTAPI IsaPnpCreateReadPortDOResources (IN PISAPNP_PDO_EXTENSION PdoExt)
 
static NTSTATUS NTAPI IsaPnpCreateReadPortDO (PISAPNP_FDO_EXTENSION FdoExt)
 
static NTSTATUS NTAPI IsaAddDevice (IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PhysicalDeviceObject)
 
NTSTATUS NTAPI IsaPower (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
static NTSTATUS NTAPI IsaPnp (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI DriverEntry (IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
 

Variables

static IO_COMPLETION_ROUTINE ForwardIrpCompletion
 
static DRIVER_DISPATCH IsaCreateClose
 
static DRIVER_DISPATCH IsaIoctl
 
static DRIVER_DISPATCH IsaReadWrite
 
DRIVER_DISPATCH IsaPower
 
static DRIVER_DISPATCH IsaPnp
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 11 of file isapnp.c.

Function Documentation

◆ DriverEntry()

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

Definition at line 862 of file isapnp.c.

865 {
866  DPRINT("%s(%p, %wZ)\n", __FUNCTION__, DriverObject, RegistryPath);
867 
876 
877  return STATUS_SUCCESS;
878 }
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
static DRIVER_DISPATCH IsaReadWrite
Definition: isapnp.c:589
static NTSTATUS NTAPI IsaAddDevice(IN PDRIVER_OBJECT DriverObject, IN PDEVICE_OBJECT PhysicalDeviceObject)
Definition: isapnp.c:763
DRIVER_DISPATCH IsaPower
Definition: isapnp.c:810
PDRIVER_EXTENSION DriverExtension
Definition: iotypes.h:2181
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
void DPRINT(...)
Definition: polytest.cpp:61
static DRIVER_DISPATCH IsaPnp
Definition: isapnp.c:832
_In_z_ PWSTR RegistryPath
Definition: classp.h:1930
#define IRP_MJ_POWER
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
PDRIVER_ADD_DEVICE AddDevice
Definition: iotypes.h:2119
#define IRP_MJ_READ
Definition: rdpdr.c:46
PDRIVER_DISPATCH MajorFunction[IRP_MJ_MAXIMUM_FUNCTION+1]
Definition: iotypes.h:2188
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
static DRIVER_DISPATCH IsaIoctl
Definition: isapnp.c:561
return STATUS_SUCCESS
Definition: btrfs.c:3014
#define __FUNCTION__
Definition: types.h:112
static DRIVER_DISPATCH IsaCreateClose
Definition: isapnp.c:542
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52

◆ ForwardIrpCompletion()

static NTSTATUS NTAPI ForwardIrpCompletion ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp,
IN PVOID  Context 
)
static

Definition at line 504 of file isapnp.c.

508 {
510 
511  if (Irp->PendingReturned)
513 
515 }
#define STATUS_MORE_PROCESSING_REQUIRED
Definition: shellext.h:68
_In_ PIRP Irp
Definition: csq.h:116
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:323
LONG NTAPI KeSetEvent(IN PKEVENT Event, IN KPRIORITY Increment, IN BOOLEAN Wait)
Definition: eventobj.c:159
#define FALSE
Definition: types.h:117
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1569
#define IO_NO_INCREMENT
Definition: iotypes.h:570

◆ IsaAddDevice()

static NTSTATUS NTAPI IsaAddDevice ( IN PDRIVER_OBJECT  DriverObject,
IN PDEVICE_OBJECT  PhysicalDeviceObject 
)
static

Definition at line 763 of file isapnp.c.

766 {
767  PDEVICE_OBJECT Fdo;
768  PISAPNP_FDO_EXTENSION FdoExt;
770 
772 
774  sizeof(*FdoExt),
775  NULL,
778  TRUE,
779  &Fdo);
780  if (!NT_SUCCESS(Status))
781  {
782  DPRINT1("Failed to create FDO (0x%x)\n", Status);
783  return Status;
784  }
785 
786  FdoExt = Fdo->DeviceExtension;
787  RtlZeroMemory(FdoExt, sizeof(*FdoExt));
788 
789  FdoExt->Common.Self = Fdo;
790  FdoExt->Common.IsFdo = TRUE;
791  FdoExt->Common.State = dsStopped;
792  FdoExt->DriverObject = DriverObject;
793  FdoExt->Pdo = PhysicalDeviceObject;
794  FdoExt->Ldo = IoAttachDeviceToDeviceStack(Fdo,
796 
798  KeInitializeSpinLock(&FdoExt->Lock);
799 
800  Status = IsaPnpCreateReadPortDO(FdoExt);
801  if (!NT_SUCCESS(Status))
802  return Status;
803 
804  Fdo->Flags &= ~DO_DEVICE_INITIALIZING;
806 
807  return STATUS_SUCCESS;
808 }
#define DO_DEVICE_INITIALIZING
Definition: env_spec_w32.h:399
PDEVICE_OBJECT DataPortPdo
Definition: isapnp.h:59
#define TRUE
Definition: types.h:120
LIST_ENTRY DeviceListHead
Definition: isapnp.h:60
LONG NTSTATUS
Definition: precomp.h:26
PDEVICE_OBJECT PhysicalDeviceObject
Definition: btrfs_drv.h:1155
PDEVICE_OBJECT Pdo
Definition: isapnp.h:58
PDEVICE_OBJECT NTAPI IoAttachDeviceToDeviceStack(IN PDEVICE_OBJECT SourceDevice, IN PDEVICE_OBJECT TargetDevice)
Definition: device.c:966
FORCEINLINE VOID KeInitializeSpinLock(_Out_ PKSPIN_LOCK SpinLock)
Definition: kefuncs.h:238
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
void DPRINT(...)
Definition: polytest.cpp:61
ISAPNP_DEVICE_STATE State
Definition: isapnp.h:52
KSPIN_LOCK Lock
Definition: isapnp.h:64
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
ISAPNP_COMMON_EXTENSION Common
Definition: isapnp.h:56
static NTSTATUS NTAPI IsaPnpCreateReadPortDO(PISAPNP_FDO_EXTENSION FdoExt)
Definition: isapnp.c:700
Status
Definition: gdiplustypes.h:24
PDRIVER_OBJECT DriverObject
Definition: isapnp.h:62
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define DPRINT1
Definition: precomp.h:8
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 FILE_DEVICE_SECURE_OPEN
Definition: cdrw_usr.h:46
PDEVICE_OBJECT Ldo
Definition: isapnp.h:57
return STATUS_SUCCESS
Definition: btrfs.c:3014
#define FILE_DEVICE_BUS_EXTENDER
Definition: winioctl.h:147
#define __FUNCTION__
Definition: types.h:112
PDEVICE_OBJECT Self
Definition: isapnp.h:50

Referenced by DriverEntry().

◆ IsaCreateClose()

static NTSTATUS NTAPI IsaCreateClose ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)
static

Definition at line 547 of file isapnp.c.

550 {
551  Irp->IoStatus.Status = STATUS_SUCCESS;
552  Irp->IoStatus.Information = FILE_OPENED;
553 
554  DPRINT("%s(%p, %p)\n", __FUNCTION__, DeviceObject, Irp);
555 
557 
558  return STATUS_SUCCESS;
559 }
_In_ PIRP Irp
Definition: csq.h:116
#define FILE_OPENED
Definition: nt_native.h:769
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1569
#define IO_NO_INCREMENT
Definition: iotypes.h:570
return STATUS_SUCCESS
Definition: btrfs.c:3014
#define __FUNCTION__
Definition: types.h:112

◆ IsaFdoCreateDeviceIDs()

static NTSTATUS NTAPI IsaFdoCreateDeviceIDs ( IN PISAPNP_PDO_EXTENSION  PdoExt)
static

Definition at line 64 of file isapnp.c.

66 {
67  PISAPNP_LOGICAL_DEVICE LogDev = PdoExt->IsaPnpDevice;
68  UNICODE_STRING TempString;
69  WCHAR TempBuffer[256];
70  PWCHAR End;
72  USHORT i;
73 
74  TempString.Buffer = TempBuffer;
75  TempString.MaximumLength = sizeof(TempBuffer);
76  TempString.Length = 0;
77 
78  /* Device ID */
79  Status = RtlStringCbPrintfExW(TempString.Buffer,
80  TempString.MaximumLength / sizeof(WCHAR),
81  &End,
82  NULL, 0,
83  L"ISAPNP\\%.3S%04x",
84  LogDev->VendorId,
85  LogDev->ProdId);
86  if (!NT_SUCCESS(Status))
87  return Status;
88  TempString.Length = (USHORT)((End - TempString.Buffer) * sizeof(WCHAR));
91  &TempString,
92  &PdoExt->DeviceID);
93  if (!NT_SUCCESS(Status))
94  return Status;
95 
96  /* HardwareIDs */
97  Status = RtlStringCbPrintfExW(TempString.Buffer,
98  TempString.MaximumLength / sizeof(WCHAR),
99  &End,
100  NULL, 0,
101  L"ISAPNP\\%.3S%04x@"
102  L"*%.3S%04x@",
103  LogDev->VendorId,
104  LogDev->ProdId,
105  LogDev->VendorId,
106  LogDev->ProdId);
107  if (!NT_SUCCESS(Status))
108  return Status;
109  TempString.Length = (USHORT)((End - TempString.Buffer) * sizeof(WCHAR));
112  &TempString,
113  &PdoExt->HardwareIDs);
114  if (!NT_SUCCESS(Status))
115  return Status;
116  for (i = 0; i < PdoExt->HardwareIDs.Length / sizeof(WCHAR); i++)
117  if (PdoExt->HardwareIDs.Buffer[i] == '@')
118  PdoExt->HardwareIDs.Buffer[i] = UNICODE_NULL;
119 
120  /* InstanceID */
121  Status = RtlStringCbPrintfExW(TempString.Buffer,
122  TempString.MaximumLength / sizeof(WCHAR),
123  &End,
124  NULL, 0,
125  L"%X",
126  LogDev->SerialNumber);
127  if (!NT_SUCCESS(Status))
128  return Status;
129  TempString.Length = (USHORT)((End - TempString.Buffer) * sizeof(WCHAR));
132  &TempString,
133  &PdoExt->InstanceID);
134  if (!NT_SUCCESS(Status))
135  return Status;
136 
137  return STATUS_SUCCESS;
138 }
USHORT MaximumLength
Definition: env_spec_w32.h:370
LONG NTSTATUS
Definition: precomp.h:26
PUSBHUB_PORT_PDO_EXTENSION NTAPI PdoExt(IN PDEVICE_OBJECT DeviceObject)
Definition: usbhub.c:133
NTSTRSAFEVAPI RtlStringCbPrintfExW(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _Outptr_opt_result_bytebuffer_(*pcbRemaining) NTSTRSAFE_PWSTR *ppszDestEnd, _Out_opt_ size_t *pcbRemaining, _In_ STRSAFE_DWORD dwFlags, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
Definition: ntstrsafe.h:1335
uint16_t * PWCHAR
Definition: typedefs.h:56
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
#define UNICODE_NULL
smooth NULL
Definition: ftsmooth.c:416
UCHAR VendorId[3]
Definition: isapnp.h:38
#define RTL_DUPLICATE_UNICODE_STRING_NULL_TERMINATE
Definition: isapnp.h:82
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
Status
Definition: gdiplustypes.h:24
static const WCHAR L[]
Definition: oid.c:1250
unsigned short USHORT
Definition: pedump.c:61
return STATUS_SUCCESS
Definition: btrfs.c:3014
NTSTATUS NTAPI IsaPnpDuplicateUnicodeString(IN ULONG Flags, IN PCUNICODE_STRING SourceString, OUT PUNICODE_STRING DestinationString)
Definition: isapnp.c:16

Referenced by IsaPnpFillDeviceRelations().

◆ IsaFdoCreateRequirements()

static NTSTATUS NTAPI IsaFdoCreateRequirements ( IN PISAPNP_PDO_EXTENSION  PdoExt)
static

Definition at line 143 of file isapnp.c.

145 {
146  PISAPNP_LOGICAL_DEVICE LogDev = PdoExt->IsaPnpDevice;
147  RTL_BITMAP IrqBitmap[ARRAYSIZE(LogDev->Irq)];
148  RTL_BITMAP DmaBitmap[ARRAYSIZE(LogDev->Dma)];
149  ULONG IrqData[ARRAYSIZE(LogDev->Irq)];
150  ULONG DmaData[ARRAYSIZE(LogDev->Dma)];
151  ULONG ResourceCount = 0;
152  ULONG ListSize, i, j;
153  BOOLEAN FirstIrq = TRUE, FirstDma = TRUE;
154  PIO_RESOURCE_REQUIREMENTS_LIST RequirementsList;
156 
157  /* Count number of requirements */
158  for (i = 0; i < ARRAYSIZE(LogDev->Io); i++)
159  {
160  if (!LogDev->Io[i].Description.Length)
161  break;
162  ResourceCount++;
163  }
164  for (i = 0; i < ARRAYSIZE(LogDev->Irq); i++)
165  {
166  if (!LogDev->Irq[i].Description.Mask)
167  break;
168  IrqData[i] = LogDev->Irq[i].Description.Mask;
169  RtlInitializeBitMap(&IrqBitmap[i], &IrqData[i], 16);
170  ResourceCount += RtlNumberOfSetBits(&IrqBitmap[i]);
171  if (LogDev->Irq[i].Description.Information & 0x4)
172  {
173  /* Add room for level sensitive */
174  ResourceCount += RtlNumberOfSetBits(&IrqBitmap[i]);
175  }
176  }
177  if (ResourceCount == 0)
178  return STATUS_SUCCESS;
179  for (i = 0; i < ARRAYSIZE(LogDev->Irq); i++)
180  {
181  if (!LogDev->Dma[i].Description.Mask)
182  break;
183  DmaData[i] = LogDev->Dma[i].Description.Mask;
184  RtlInitializeBitMap(&DmaBitmap[i], &DmaData[i], 8);
185  ResourceCount += RtlNumberOfSetBits(&DmaBitmap[i]);
186  }
187 
188  /* Allocate memory to store requirements */
189  ListSize = sizeof(IO_RESOURCE_REQUIREMENTS_LIST)
191  RequirementsList = ExAllocatePool(PagedPool, ListSize);
192  if (!RequirementsList)
193  return STATUS_NO_MEMORY;
194 
195  RtlZeroMemory(RequirementsList, ListSize);
196  RequirementsList->ListSize = ListSize;
197  RequirementsList->InterfaceType = Isa;
198  RequirementsList->AlternativeLists = 1;
199 
200  RequirementsList->List[0].Version = 1;
201  RequirementsList->List[0].Revision = 1;
202  RequirementsList->List[0].Count = ResourceCount;
203 
204  /* Store requirements */
205  Descriptor = RequirementsList->List[0].Descriptors;
206  for (i = 0; i < ARRAYSIZE(LogDev->Io); i++)
207  {
208  if (!LogDev->Io[i].Description.Length)
209  break;
210  DPRINT("Device.Io[%d].Information = 0x%02x\n", i, LogDev->Io[i].Description.Information);
211  DPRINT("Device.Io[%d].Minimum = 0x%02x\n", i, LogDev->Io[i].Description.Minimum);
212  DPRINT("Device.Io[%d].Maximum = 0x%02x\n", i, LogDev->Io[i].Description.Maximum);
213  DPRINT("Device.Io[%d].Alignment = 0x%02x\n", i, LogDev->Io[i].Description.Alignment);
214  DPRINT("Device.Io[%d].Length = 0x%02x\n", i, LogDev->Io[i].Description.Length);
216  Descriptor->ShareDisposition = CmResourceShareDeviceExclusive;
217  if (LogDev->Io[i].Description.Information & 0x1)
219  else
221  Descriptor->u.Port.Length = LogDev->Io[i].Description.Length;
222  Descriptor->u.Port.Alignment = LogDev->Io[i].Description.Alignment;
223  Descriptor->u.Port.MinimumAddress.LowPart = LogDev->Io[i].Description.Minimum;
224  Descriptor->u.Port.MaximumAddress.LowPart = LogDev->Io[i].Description.Maximum + LogDev->Io[i].Description.Length - 1;
225  Descriptor++;
226  }
227  for (i = 0; i < ARRAYSIZE(LogDev->Irq); i++)
228  {
229  if (!LogDev->Irq[i].Description.Mask)
230  break;
231  DPRINT("Device.Irq[%d].Mask = 0x%02x\n", i, LogDev->Irq[i].Description.Mask);
232  DPRINT("Device.Irq[%d].Information = 0x%02x\n", i, LogDev->Irq[i].Description.Information);
233  for (j = 0; j < 15; j++)
234  {
235  if (!RtlCheckBit(&IrqBitmap[i], j))
236  continue;
237  if (FirstIrq)
238  FirstIrq = FALSE;
239  else
243  Descriptor->u.Interrupt.MinimumVector = Descriptor->u.Interrupt.MaximumVector = j;
244  Descriptor++;
245  if (LogDev->Irq[i].Description.Information & 0x4)
246  {
247  /* Level interrupt */
251  Descriptor->u.Interrupt.MinimumVector = Descriptor->u.Interrupt.MaximumVector = j;
252  Descriptor++;
253  }
254  }
255  }
256  for (i = 0; i < ARRAYSIZE(LogDev->Dma); i++)
257  {
258  if (!LogDev->Dma[i].Description.Mask)
259  break;
260  DPRINT("Device.Dma[%d].Mask = 0x%02x\n", i, LogDev->Dma[i].Description.Mask);
261  DPRINT("Device.Dma[%d].Information = 0x%02x\n", i, LogDev->Dma[i].Description.Information);
262  for (j = 0; j < 8; j++)
263  {
264  if (!RtlCheckBit(&DmaBitmap[i], j))
265  continue;
266  if (FirstDma)
267  FirstDma = FALSE;
268  else
271  switch (LogDev->Dma[i].Description.Information & 0x3)
272  {
273  case 0x0: Descriptor->Flags |= CM_RESOURCE_DMA_8; break;
274  case 0x1: Descriptor->Flags |= CM_RESOURCE_DMA_8_AND_16; break;
275  case 0x2: Descriptor->Flags |= CM_RESOURCE_DMA_16; break;
276  default: break;
277  }
278  if (LogDev->Dma[i].Description.Information & 0x4)
280  switch ((LogDev->Dma[i].Description.Information >> 5) & 0x3)
281  {
282  case 0x1: Descriptor->Flags |= CM_RESOURCE_DMA_TYPE_A; break;
283  case 0x2: Descriptor->Flags |= CM_RESOURCE_DMA_TYPE_B; break;
284  case 0x3: Descriptor->Flags |= CM_RESOURCE_DMA_TYPE_F; break;
285  default: break;
286  }
287  Descriptor->u.Dma.MinimumChannel = Descriptor->u.Dma.MaximumChannel = j;
288  Descriptor++;
289  }
290  }
291 
292  PdoExt->RequirementsList = RequirementsList;
293  return STATUS_SUCCESS;
294 }
#define CM_RESOURCE_DMA_16
Definition: cmtypes.h:132
struct _IO_RESOURCE_REQUIREMENTS_LIST IO_RESOURCE_REQUIREMENTS_LIST
ISAPNP_IO_DESCRIPTION Description
Definition: isapnp.h:21
#define TRUE
Definition: types.h:120
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
NTSYSAPI void WINAPI RtlInitializeBitMap(PRTL_BITMAP, PULONG, ULONG)
PUSBHUB_PORT_PDO_EXTENSION NTAPI PdoExt(IN PDEVICE_OBJECT DeviceObject)
Definition: usbhub.c:133
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define RtlCheckBit(BMH, BP)
Definition: rtlfuncs.h:3154
ISAPNP_IO Io[8]
Definition: isapnp.h:41
#define CM_RESOURCE_DMA_TYPE_F
Definition: cmtypes.h:138
#define CM_RESOURCE_DMA_TYPE_A
Definition: cmtypes.h:136
#define CmResourceTypePort
Definition: hwresource.cpp:123
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
ISAPNP_DMA_DESCRIPTION Description
Definition: isapnp.h:32
#define FALSE
Definition: types.h:117
NTSYSAPI ULONG WINAPI RtlNumberOfSetBits(PCRTL_BITMAP)
unsigned char BOOLEAN
#define CM_RESOURCE_DMA_8_AND_16
Definition: cmtypes.h:134
#define CM_RESOURCE_PORT_16_BIT_DECODE
Definition: cmtypes.h:112
void DPRINT(...)
Definition: polytest.cpp:61
#define CM_RESOURCE_PORT_10_BIT_DECODE
Definition: cmtypes.h:110
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 GLint GLint j
Definition: glfuncs.h:250
IO_RESOURCE_DESCRIPTOR Descriptors[1]
#define IO_RESOURCE_ALTERNATIVE
#define CM_RESOURCE_DMA_TYPE_B
Definition: cmtypes.h:137
static ULONG ResourceCount
Definition: inbv.c:92
#define CM_RESOURCE_DMA_8
Definition: cmtypes.h:131
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
ISAPNP_IRQ_DESCRIPTION Description
Definition: isapnp.h:27
ISAPNP_DMA Dma[2]
Definition: isapnp.h:43
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
#define CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE
Definition: cmtypes.h:143
#define CmResourceTypeInterrupt
Definition: hwresource.cpp:124
#define CM_RESOURCE_INTERRUPT_LATCHED
Definition: cmtypes.h:144
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
return STATUS_SUCCESS
Definition: btrfs.c:3014
#define CM_RESOURCE_DMA_BUS_MASTER
Definition: cmtypes.h:135
#define CmResourceTypeDma
Definition: hwresource.cpp:126
_In_ PSTORAGE_PROPERTY_ID _Outptr_ PVOID * Descriptor
Definition: classpnp.h:1159
ISAPNP_IRQ Irq[2]
Definition: isapnp.h:42

Referenced by IsaPnpFillDeviceRelations().

◆ IsaFdoCreateResources()

static NTSTATUS NTAPI IsaFdoCreateResources ( IN PISAPNP_PDO_EXTENSION  PdoExt)
static

Definition at line 299 of file isapnp.c.

301 {
302  PISAPNP_LOGICAL_DEVICE LogDev = PdoExt->IsaPnpDevice;
303  ULONG ResourceCount = 0;
304  ULONG ListSize, i;
307 
308  /* Count number of required resources */
309  for (i = 0; i < ARRAYSIZE(LogDev->Io); i++)
310  {
311  if (LogDev->Io[i].CurrentBase)
312  ResourceCount++;
313  else
314  break;
315  }
316  for (i = 0; i < ARRAYSIZE(LogDev->Irq); i++)
317  {
318  if (LogDev->Irq[i].CurrentNo)
319  ResourceCount++;
320  else
321  break;
322  }
323  for (i = 0; i < ARRAYSIZE(LogDev->Dma); i++)
324  {
325  if (LogDev->Dma[i].CurrentChannel != 4)
326  ResourceCount++;
327  else
328  break;
329  }
330  if (ResourceCount == 0)
331  return STATUS_SUCCESS;
332 
333  /* Allocate memory to store resources */
334  ListSize = sizeof(CM_RESOURCE_LIST)
337  if (!ResourceList)
338  return STATUS_NO_MEMORY;
339 
340  RtlZeroMemory(ResourceList, ListSize);
341  ResourceList->Count = 1;
342  ResourceList->List[0].InterfaceType = Isa;
343  ResourceList->List[0].PartialResourceList.Version = 1;
344  ResourceList->List[0].PartialResourceList.Revision = 1;
345  ResourceList->List[0].PartialResourceList.Count = ResourceCount;
346 
347  /* Store resources */
348  ResourceCount = 0;
349  for (i = 0; i < ARRAYSIZE(LogDev->Io); i++)
350  {
351  if (!LogDev->Io[i].CurrentBase)
352  continue;
353  Descriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[ResourceCount++];
355  Descriptor->ShareDisposition = CmResourceShareDeviceExclusive;
356  if (LogDev->Io[i].Description.Information & 0x1)
358  else
360  Descriptor->u.Port.Length = LogDev->Io[i].Description.Length;
361  Descriptor->u.Port.Start.LowPart = LogDev->Io[i].CurrentBase;
362  }
363  for (i = 0; i < ARRAYSIZE(LogDev->Irq); i++)
364  {
365  if (!LogDev->Irq[i].CurrentNo)
366  continue;
367  Descriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[ResourceCount++];
369  Descriptor->ShareDisposition = CmResourceShareDeviceExclusive;
370  if (LogDev->Irq[i].CurrentType & 0x01)
372  else
374  Descriptor->u.Interrupt.Level = LogDev->Irq[i].CurrentNo;
375  Descriptor->u.Interrupt.Vector = LogDev->Irq[i].CurrentNo;
376  Descriptor->u.Interrupt.Affinity = -1;
377  }
378  for (i = 0; i < ARRAYSIZE(LogDev->Dma); i++)
379  {
380  if (LogDev->Dma[i].CurrentChannel == 4)
381  continue;
382  Descriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[ResourceCount++];
384  Descriptor->ShareDisposition = CmResourceShareDeviceExclusive;
385  switch (LogDev->Dma[i].Description.Information & 0x3)
386  {
387  case 0x0: Descriptor->Flags |= CM_RESOURCE_DMA_8; break;
388  case 0x1: Descriptor->Flags |= CM_RESOURCE_DMA_8 | CM_RESOURCE_DMA_16; break;
389  case 0x2: Descriptor->Flags |= CM_RESOURCE_DMA_16; break;
390  default: break;
391  }
392  if (LogDev->Dma[i].Description.Information & 0x4)
394  switch ((LogDev->Dma[i].Description.Information >> 5) & 0x3)
395  {
396  case 0x1: Descriptor->Flags |= CM_RESOURCE_DMA_TYPE_A; break;
397  case 0x2: Descriptor->Flags |= CM_RESOURCE_DMA_TYPE_B; break;
398  case 0x3: Descriptor->Flags |= CM_RESOURCE_DMA_TYPE_F; break;
399  default: break;
400  }
401  Descriptor->u.Dma.Channel = LogDev->Dma[i].CurrentChannel;
402  }
403 
404  PdoExt->ResourceList = ResourceList;
405  PdoExt->ResourceListSize = ListSize;
406  return STATUS_SUCCESS;
407 }
#define CM_RESOURCE_DMA_16
Definition: cmtypes.h:132
UCHAR CurrentNo
Definition: isapnp.h:25
ISAPNP_IO_DESCRIPTION Description
Definition: isapnp.h:21
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
PUSBHUB_PORT_PDO_EXTENSION NTAPI PdoExt(IN PDEVICE_OBJECT DeviceObject)
Definition: usbhub.c:133
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
UCHAR CurrentType
Definition: isapnp.h:26
ISAPNP_IO Io[8]
Definition: isapnp.h:41
#define CM_RESOURCE_DMA_TYPE_F
Definition: cmtypes.h:138
#define CM_RESOURCE_DMA_TYPE_A
Definition: cmtypes.h:136
const MUI_LANGUAGE_RESOURCE ResourceList[]
Definition: muilanguages.h:414
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR CM_PARTIAL_RESOURCE_DESCRIPTOR
#define CmResourceTypePort
Definition: hwresource.cpp:123
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
ISAPNP_DMA_DESCRIPTION Description
Definition: isapnp.h:32
#define CM_RESOURCE_PORT_16_BIT_DECODE
Definition: cmtypes.h:112
UCHAR CurrentChannel
Definition: isapnp.h:31
#define CM_RESOURCE_PORT_10_BIT_DECODE
Definition: cmtypes.h:110
USHORT CurrentBase
Definition: isapnp.h:20
#define CM_RESOURCE_DMA_TYPE_B
Definition: cmtypes.h:137
static ULONG ResourceCount
Definition: inbv.c:92
#define CM_RESOURCE_DMA_8
Definition: cmtypes.h:131
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
struct _CM_RESOURCE_LIST CM_RESOURCE_LIST
ISAPNP_DMA Dma[2]
Definition: isapnp.h:43
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
#define CM_RESOURCE_INTERRUPT_LEVEL_SENSITIVE
Definition: cmtypes.h:143
#define CmResourceTypeInterrupt
Definition: hwresource.cpp:124
#define CM_RESOURCE_INTERRUPT_LATCHED
Definition: cmtypes.h:144
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
return STATUS_SUCCESS
Definition: btrfs.c:3014
#define CM_RESOURCE_DMA_BUS_MASTER
Definition: cmtypes.h:135
#define CmResourceTypeDma
Definition: hwresource.cpp:126
_In_ PSTORAGE_PROPERTY_ID _Outptr_ PVOID * Descriptor
Definition: classpnp.h:1159
ISAPNP_IRQ Irq[2]
Definition: isapnp.h:42

Referenced by IsaPnpFillDeviceRelations().

◆ 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().

◆ IsaIoctl()

static NTSTATUS NTAPI IsaIoctl ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)
static

Definition at line 566 of file isapnp.c.

569 {
572 
573  DPRINT("%s(%p, %p)\n", __FUNCTION__, DeviceObject, Irp);
574 
575  switch (IrpSp->Parameters.DeviceIoControl.IoControlCode)
576  {
577  default:
578  DPRINT1("Unknown ioctl code: %x\n", IrpSp->Parameters.DeviceIoControl.IoControlCode);
580  break;
581  }
582 
583  Irp->IoStatus.Status = Status;
585 
586  return Status;
587 }
_In_ PIRP Irp
Definition: csq.h:116
LONG NTSTATUS
Definition: precomp.h:26
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1569
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2789
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
#define DPRINT1
Definition: precomp.h:8
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:423
#define IO_NO_INCREMENT
Definition: iotypes.h:570
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2779
#define __FUNCTION__
Definition: types.h:112

◆ IsaPnp()

static NTSTATUS NTAPI IsaPnp ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)
static

Definition at line 837 of file isapnp.c.

840 {
843 
844  DPRINT("%s(%p, %p)\n", __FUNCTION__, DeviceObject, Irp);
845 
846  if (DevExt->IsFdo)
847  {
848  return IsaFdoPnp((PISAPNP_FDO_EXTENSION)DevExt,
849  Irp,
850  IrpSp);
851  }
852  else
853  {
854  return IsaPdoPnp((PISAPNP_PDO_EXTENSION)DevExt,
855  Irp,
856  IrpSp);
857  }
858 }
_In_ PIRP Irp
Definition: csq.h:116
NTSTATUS NTAPI IsaPdoPnp(IN PISAPNP_PDO_EXTENSION PdoDeviceExtension, IN PIRP Irp, IN PIO_STACK_LOCATION IrpSp)
Definition: pdo.c:298
PVOID DeviceExtension
Definition: env_spec_w32.h:418
void DPRINT(...)
Definition: polytest.cpp:61
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1569
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2789
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
#define __FUNCTION__
Definition: types.h:112
NTSTATUS NTAPI IsaFdoPnp(IN PISAPNP_FDO_EXTENSION FdoExt, IN PIRP Irp, IN PIO_STACK_LOCATION IrpSp)
Definition: fdo.c:44

◆ IsaPnpCreateReadPortDO()

static NTSTATUS NTAPI IsaPnpCreateReadPortDO ( PISAPNP_FDO_EXTENSION  FdoExt)
static

Definition at line 700 of file isapnp.c.

701 {
702  UNICODE_STRING DeviceID = RTL_CONSTANT_STRING(L"ISAPNP\\ReadDataPort\0");
703  UNICODE_STRING HardwareIDs = RTL_CONSTANT_STRING(L"ISAPNP\\ReadDataPort\0\0");
704  UNICODE_STRING CompatibleIDs = RTL_CONSTANT_STRING(L"\0\0");
705  UNICODE_STRING InstanceID = RTL_CONSTANT_STRING(L"0\0");
707 
710  sizeof(ISAPNP_PDO_EXTENSION),
711  NULL,
714  FALSE,
715  &FdoExt->DataPortPdo);
716  if (!NT_SUCCESS(Status))
717  return Status;
720  PdoExt->Common.IsFdo = FALSE;
721  PdoExt->Common.Self = FdoExt->DataPortPdo;
722  PdoExt->Common.State = dsStopped;
723  PdoExt->FdoExt = FdoExt;
724 
726  &DeviceID,
727  &PdoExt->DeviceID);
728  if (!NT_SUCCESS(Status))
729  return Status;
730 
732  &HardwareIDs,
733  &PdoExt->HardwareIDs);
734  if (!NT_SUCCESS(Status))
735  return Status;
736 
738  &CompatibleIDs,
739  &PdoExt->CompatibleIDs);
740  if (!NT_SUCCESS(Status))
741  return Status;
742 
744  &InstanceID,
745  &PdoExt->InstanceID);
746  if (!NT_SUCCESS(Status))
747  return Status;
748 
750  if (!NT_SUCCESS(Status))
751  return Status;
752 
754  if (!NT_SUCCESS(Status))
755  return Status;
756 
757  return Status;
758 }
PDEVICE_OBJECT DataPortPdo
Definition: isapnp.h:59
_In_ USHORT DeviceID
Definition: iotypes.h:864
LONG NTSTATUS
Definition: precomp.h:26
PUSBHUB_PORT_PDO_EXTENSION NTAPI PdoExt(IN PDEVICE_OBJECT DeviceObject)
Definition: usbhub.c:133
#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
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
static NTSTATUS NTAPI IsaPnpCreateReadPortDOResources(IN PISAPNP_PDO_EXTENSION PdoExt)
Definition: isapnp.c:661
Status
Definition: gdiplustypes.h:24
static const WCHAR L[]
Definition: oid.c:1250
static NTSTATUS NTAPI IsaPnpCreateReadPortDORequirements(IN PISAPNP_PDO_EXTENSION PdoExt)
Definition: isapnp.c:611
PDRIVER_OBJECT DriverObject
Definition: isapnp.h:62
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 FILE_DEVICE_SECURE_OPEN
Definition: cdrw_usr.h:46
NTSTATUS NTAPI IsaPnpDuplicateUnicodeString(IN ULONG Flags, IN PCUNICODE_STRING SourceString, OUT PUNICODE_STRING DestinationString)
Definition: isapnp.c:16
struct _ISAPNP_PDO_EXTENSION * PISAPNP_PDO_EXTENSION
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14

Referenced by IsaAddDevice().

◆ IsaPnpCreateReadPortDORequirements()

static NTSTATUS NTAPI IsaPnpCreateReadPortDORequirements ( IN PISAPNP_PDO_EXTENSION  PdoExt)
static

Definition at line 611 of file isapnp.c.

613 {
614  USHORT Ports[] = { ISAPNP_WRITE_DATA, ISAPNP_ADDRESS, 0x274, 0x3e4, 0x204, 0x2e4, 0x354, 0x2f4 };
615  ULONG ListSize, i;
616  PIO_RESOURCE_REQUIREMENTS_LIST RequirementsList;
618 
619  ListSize = sizeof(IO_RESOURCE_REQUIREMENTS_LIST)
620  + 2 * ARRAYSIZE(Ports) * sizeof(IO_RESOURCE_DESCRIPTOR);
621  RequirementsList = ExAllocatePool(PagedPool, ListSize);
622  if (!RequirementsList)
623  return STATUS_NO_MEMORY;
624 
625  RtlZeroMemory(RequirementsList, ListSize);
626  RequirementsList->ListSize = ListSize;
627  RequirementsList->AlternativeLists = 1;
628 
629  RequirementsList->List[0].Version = 1;
630  RequirementsList->List[0].Revision = 1;
631  RequirementsList->List[0].Count = 2 * ARRAYSIZE(Ports);
632 
633  for (i = 0; i < 2 * ARRAYSIZE(Ports); i += 2)
634  {
635  Descriptor = &RequirementsList->List[0].Descriptors[i];
636 
637  /* Expected port */
638  Descriptor[0].Type = CmResourceTypePort;
639  Descriptor[0].ShareDisposition = CmResourceShareDeviceExclusive;
641  Descriptor[0].u.Port.Length = Ports[i / 2] & 1 ? 0x01 : 0x04;
642  Descriptor[0].u.Port.Alignment = 0x01;
643  Descriptor[0].u.Port.MinimumAddress.LowPart = Ports[i / 2];
644  Descriptor[0].u.Port.MaximumAddress.LowPart = Ports[i / 2] + Descriptor[0].u.Port.Length - 1;
645 
646  /* ... but mark it as optional */
648  Descriptor[1].Type = CmResourceTypePort;
649  Descriptor[1].ShareDisposition = CmResourceShareDeviceExclusive;
651  Descriptor[1].u.Port.Alignment = 0x01;
652  }
653 
654  PdoExt->RequirementsList = RequirementsList;
655  return STATUS_SUCCESS;
656 }
struct _IO_RESOURCE_REQUIREMENTS_LIST IO_RESOURCE_REQUIREMENTS_LIST
PUSBHUB_PORT_PDO_EXTENSION NTAPI PdoExt(IN PDEVICE_OBJECT DeviceObject)
Definition: usbhub.c:133
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
#define CmResourceTypePort
Definition: hwresource.cpp:123
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
#define CM_RESOURCE_PORT_16_BIT_DECODE
Definition: cmtypes.h:112
#define ISAPNP_ADDRESS
Definition: isapnphw.h:7
struct _IO_RESOURCE_DESCRIPTOR IO_RESOURCE_DESCRIPTOR
IO_RESOURCE_DESCRIPTOR Descriptors[1]
#define IO_RESOURCE_ALTERNATIVE
static PS2_PORT Ports[PS2_PORTS]
Definition: ps2.c:52
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
unsigned short USHORT
Definition: pedump.c:61
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define ISAPNP_WRITE_DATA
Definition: isapnphw.h:8
return STATUS_SUCCESS
Definition: btrfs.c:3014
_In_ PSTORAGE_PROPERTY_ID _Outptr_ PVOID * Descriptor
Definition: classpnp.h:1159

Referenced by IsaPnpCreateReadPortDO().

◆ IsaPnpCreateReadPortDOResources()

static NTSTATUS NTAPI IsaPnpCreateReadPortDOResources ( IN PISAPNP_PDO_EXTENSION  PdoExt)
static

Definition at line 661 of file isapnp.c.

663 {
665  ULONG ListSize, i;
668 
669  ListSize = sizeof(CM_RESOURCE_LIST)
672  if (!ResourceList)
673  return STATUS_NO_MEMORY;
674 
675  RtlZeroMemory(ResourceList, ListSize);
676  ResourceList->Count = 1;
677  ResourceList->List[0].InterfaceType = Internal;
678  ResourceList->List[0].PartialResourceList.Version = 1;
679  ResourceList->List[0].PartialResourceList.Revision = 1;
680  ResourceList->List[0].PartialResourceList.Count = 2;
681 
682  for (i = 0; i < ARRAYSIZE(Ports); i++)
683  {
684  Descriptor = &ResourceList->List[0].PartialResourceList.PartialDescriptors[i];
686  Descriptor->ShareDisposition = CmResourceShareDeviceExclusive;
688  Descriptor->u.Port.Length = 0x01;
689  Descriptor->u.Port.Start.LowPart = Ports[i];
690  }
691 
692  PdoExt->ResourceList = ResourceList;
693  PdoExt->ResourceListSize = ListSize;
694  return STATUS_SUCCESS;
695 }
PUSBHUB_PORT_PDO_EXTENSION NTAPI PdoExt(IN PDEVICE_OBJECT DeviceObject)
Definition: usbhub.c:133
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
const MUI_LANGUAGE_RESOURCE ResourceList[]
Definition: muilanguages.h:414
#define CmResourceTypePort
Definition: hwresource.cpp:123
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
#define CM_RESOURCE_PORT_16_BIT_DECODE
Definition: cmtypes.h:112
#define ISAPNP_ADDRESS
Definition: isapnphw.h:7
static PS2_PORT Ports[PS2_PORTS]
Definition: ps2.c:52
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
struct _CM_RESOURCE_LIST CM_RESOURCE_LIST
unsigned short USHORT
Definition: pedump.c:61
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define ISAPNP_WRITE_DATA
Definition: isapnphw.h:8
return STATUS_SUCCESS
Definition: btrfs.c:3014
_In_ PSTORAGE_PROPERTY_ID _Outptr_ PVOID * Descriptor
Definition: classpnp.h:1159

Referenced by IsaPnpCreateReadPortDO().

◆ 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().

◆ IsaPower()

NTSTATUS NTAPI IsaPower ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 813 of file isapnp.c.

816 {
819 
820  if (!DevExt->IsFdo)
821  {
822  Status = Irp->IoStatus.Status;
824  return Status;
825  }
826 
829  return PoCallDriver(((PISAPNP_FDO_EXTENSION)DevExt)->Ldo, Irp);
830 }
_In_ PIRP Irp
Definition: csq.h:116
LONG NTSTATUS
Definition: precomp.h:26
PVOID DeviceExtension
Definition: env_spec_w32.h:418
#define IoCompleteRequest
Definition: irp.c:1240
Status
Definition: gdiplustypes.h:24
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1569
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
Definition: power.c:737
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
#define IO_NO_INCREMENT
Definition: iotypes.h:570

◆ IsaReadWrite()

static NTSTATUS NTAPI IsaReadWrite ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)
static

Definition at line 594 of file isapnp.c.

597 {
598  DPRINT("%s(%p, %p)\n", __FUNCTION__, DeviceObject, Irp);
599 
600  Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
601  Irp->IoStatus.Information = 0;
602 
604 
605  return STATUS_NOT_SUPPORTED;
606 }
_In_ PIRP Irp
Definition: csq.h:116
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1569
#define STATUS_NOT_SUPPORTED
Definition: ntstatus.h:423
#define IO_NO_INCREMENT
Definition: iotypes.h:570
#define __FUNCTION__
Definition: types.h:112

Variable Documentation

◆ ForwardIrpCompletion

IO_COMPLETION_ROUTINE ForwardIrpCompletion
static

Definition at line 499 of file isapnp.c.

Referenced by IsaForwardIrpSynchronous().

◆ IsaCreateClose

DRIVER_DISPATCH IsaCreateClose
static

Definition at line 542 of file isapnp.c.

Referenced by DriverEntry().

◆ IsaIoctl

DRIVER_DISPATCH IsaIoctl
static

Definition at line 561 of file isapnp.c.

Referenced by DriverEntry().

◆ IsaPnp

DRIVER_DISPATCH IsaPnp
static

Definition at line 832 of file isapnp.c.

Referenced by DriverEntry().

◆ IsaPower

DRIVER_DISPATCH IsaPower

Definition at line 810 of file isapnp.c.

Referenced by DriverEntry().

◆ IsaReadWrite

DRIVER_DISPATCH IsaReadWrite
static

Definition at line 589 of file isapnp.c.

Referenced by DriverEntry().