ReactOS  0.4.15-dev-4857-g47842d7
misc.c File Reference
#include "precomp.h"
#include <debug.h>
Include dependency graph for misc.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

NTSTATUS NTAPI ForwardIrpAndForget (_In_ PDEVICE_OBJECT LowerDevice, _In_ PIRP Irp)
 
INTERFACE_TYPE GetBusInterface (PDEVICE_OBJECT DeviceObject)
 
static ULONG GetResourceListSize (PCM_RESOURCE_LIST ResourceList)
 
PCM_RESOURCE_LIST CopyResourceList (POOL_TYPE PoolType, PCM_RESOURCE_LIST Source)
 
NTSTATUS QueryBusInterface (PDEVICE_OBJECT DeviceObject, PGUID Guid, USHORT Size, USHORT Version, PBUS_INTERFACE_STANDARD Interface, PVOID InterfaceSpecificData)
 
BOOLEAN TranslateResourceListAddress (PFDO_DEVICE_EXTENSION DeviceExtension, INTERFACE_TYPE BusType, ULONG SystemIoBusNumber, STOR_PHYSICAL_ADDRESS IoAddress, ULONG NumberOfBytes, BOOLEAN InIoSpace, PPHYSICAL_ADDRESS TranslatedAddress)
 
NTSTATUS GetResourceListInterrupt (PFDO_DEVICE_EXTENSION DeviceExtension, PULONG Vector, PKIRQL Irql, KINTERRUPT_MODE *InterruptMode, PBOOLEAN ShareVector, PKAFFINITY Affinity)
 
NTSTATUS AllocateAddressMapping (PMAPPED_ADDRESS *MappedAddressList, STOR_PHYSICAL_ADDRESS IoAddress, PVOID MappedAddress, ULONG NumberOfBytes, ULONG BusNumber)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file misc.c.

Function Documentation

◆ AllocateAddressMapping()

NTSTATUS AllocateAddressMapping ( PMAPPED_ADDRESS MappedAddressList,
STOR_PHYSICAL_ADDRESS  IoAddress,
PVOID  MappedAddress,
ULONG  NumberOfBytes,
ULONG  BusNumber 
)

Definition at line 290 of file misc.c.

296 {
298 
299  DPRINT1("AllocateAddressMapping()\n");
300 
302  sizeof(MAPPED_ADDRESS),
304  if (Mapping == NULL)
305  {
306  DPRINT1("No memory!\n");
307  return STATUS_NO_MEMORY;
308  }
309 
311 
312  Mapping->NextMappedAddress = *MappedAddressList;
313  *MappedAddressList = Mapping;
314 
315  Mapping->IoAddress = IoAddress;
316  Mapping->MappedAddress = MappedAddress;
317  Mapping->NumberOfBytes = NumberOfBytes;
318  Mapping->BusNumber = BusNumber;
319 
320  return STATUS_SUCCESS;
321 }
static PVOID Mapping[EMS_PHYSICAL_PAGES]
Definition: emsdrv.c:41
#define TAG_ADDRESS_MAPPING
Definition: precomp.h:31
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER NumberOfBytes
Definition: iotypes.h:1035
#define NULL
Definition: types.h:112
#define DPRINT1
Definition: precomp.h:8
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by StorPortGetDeviceBase().

◆ CopyResourceList()

PCM_RESOURCE_LIST CopyResourceList ( POOL_TYPE  PoolType,
PCM_RESOURCE_LIST  Source 
)

Definition at line 91 of file misc.c.

94 {
96  ULONG Size;
97 
98  DPRINT1("CopyResourceList(%lu %p)\n",
99  PoolType, Source);
100 
101  /* Get the size of the resource list */
103 
104  /* Allocate a new buffer */
106  Size,
108  if (Destination == NULL)
109  return NULL;
110 
111  /* Copy the resource list */
113  Source,
114  Size);
115 
116  return Destination;
117 }
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
#define TAG_RESOURCE_LIST
Definition: precomp.h:30
static ULONG GetResourceListSize(PCM_RESOURCE_LIST ResourceList)
Definition: misc.c:60
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:2950
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define NULL
Definition: types.h:112
#define DPRINT1
Definition: precomp.h:8
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3810
unsigned int ULONG
Definition: retypes.h:1
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3167

Referenced by PortFdoStartDevice().

◆ ForwardIrpAndForget()

NTSTATUS NTAPI ForwardIrpAndForget ( _In_ PDEVICE_OBJECT  LowerDevice,
_In_ PIRP  Irp 
)

Definition at line 20 of file misc.c.

23 {
24  ASSERT(LowerDevice);
25 
27  return IoCallDriver(LowerDevice, Irp);
28 }
_In_ PIRP Irp
Definition: csq.h:116
#define ASSERT(a)
Definition: mode.c:44
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1218
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421

◆ GetBusInterface()

INTERFACE_TYPE GetBusInterface ( PDEVICE_OBJECT  DeviceObject)

Definition at line 32 of file misc.c.

34 {
35  GUID Guid;
36  ULONG Length;
38 
41  sizeof(Guid),
42  &Guid,
43  &Length);
44  if (!NT_SUCCESS(Status))
46 
47  if (RtlCompareMemory(&Guid, &GUID_BUS_TYPE_PCMCIA, sizeof(GUID)) == sizeof(GUID))
48  return PCMCIABus;
49  else if (RtlCompareMemory(&Guid, &GUID_BUS_TYPE_PCI, sizeof(GUID)) == sizeof(GUID))
50  return PCIBus;
51  else if (RtlCompareMemory(&Guid, &GUID_BUS_TYPE_ISAPNP, sizeof(GUID)) == sizeof(GUID))
52  return PNPISABus;
53 
55 }
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
LONG NTSTATUS
Definition: precomp.h:26
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
NTSTATUS NTAPI IoGetDeviceProperty(IN PDEVICE_OBJECT DeviceObject, IN DEVICE_REGISTRY_PROPERTY DeviceProperty, IN ULONG BufferLength, OUT PVOID PropertyBuffer, OUT PULONG ResultLength)
Definition: pnpmgr.c:1952
Status
Definition: gdiplustypes.h:24
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
_Must_inspect_result_ _In_ WDFOBJECT _In_ CONST GUID * Guid
Definition: wdfobject.h:760
unsigned int ULONG
Definition: retypes.h:1
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465

◆ GetResourceListInterrupt()

NTSTATUS GetResourceListInterrupt ( PFDO_DEVICE_EXTENSION  DeviceExtension,
PULONG  Vector,
PKIRQL  Irql,
KINTERRUPT_MODE InterruptMode,
PBOOLEAN  ShareVector,
PKAFFINITY  Affinity 
)

Definition at line 241 of file misc.c.

248 {
249  PCM_FULL_RESOURCE_DESCRIPTOR FullDescriptor;
250  PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptor;
251  INT i, j;
252 
253  DPRINT1("GetResourceListInterrupt(%p)\n",
254  DeviceExtension);
255 
256  FullDescriptor = DeviceExtension->TranslatedResources->List;
257  for (i = 0; i < DeviceExtension->TranslatedResources->Count; i++)
258  {
259  for (j = 0; j < FullDescriptor->PartialResourceList.Count; j++)
260  {
261  PartialDescriptor = FullDescriptor->PartialResourceList.PartialDescriptors + j;
262 
263  switch (PartialDescriptor->Type)
264  {
266  DPRINT1("Interrupt: Level %lu Vector %lu\n",
267  PartialDescriptor->u.Interrupt.Level,
268  PartialDescriptor->u.Interrupt.Vector);
269 
270  *Vector = PartialDescriptor->u.Interrupt.Vector;
271  *Irql = (KIRQL)PartialDescriptor->u.Interrupt.Level;
273  *ShareVector = (PartialDescriptor->ShareDisposition == CmResourceShareShared) ? TRUE : FALSE;
274  *Affinity = PartialDescriptor->u.Interrupt.Affinity;
275 
276  return STATUS_SUCCESS;
277  }
278  }
279 
280  /* Advance to next CM_FULL_RESOURCE_DESCRIPTOR block in memory. */
281  FullDescriptor = (PCM_FULL_RESOURCE_DESCRIPTOR)(FullDescriptor->PartialResourceList.PartialDescriptors +
282  FullDescriptor->PartialResourceList.Count);
283  }
284 
285  return STATUS_NOT_FOUND;
286 }
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID _In_opt_ PKSPIN_LOCK _In_ ULONG _In_ KIRQL _In_ KIRQL _In_ KINTERRUPT_MODE InterruptMode
Definition: iofuncs.h:800
CM_FULL_RESOURCE_DESCRIPTOR List[1]
Definition: hwresource.cpp:165
#define TRUE
Definition: types.h:120
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID _In_opt_ PKSPIN_LOCK _In_ ULONG _In_ KIRQL _In_ KIRQL _In_ KINTERRUPT_MODE _In_ BOOLEAN ShareVector
Definition: iofuncs.h:800
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@378 u
_Out_ PKIRQL Irql
Definition: csq.h:179
int32_t INT
Definition: typedefs.h:58
UCHAR KIRQL
Definition: env_spec_w32.h:591
CM_PARTIAL_RESOURCE_LIST PartialResourceList
Definition: hwresource.cpp:160
#define FALSE
Definition: types.h:117
struct _CM_FULL_RESOURCE_DESCRIPTOR * PCM_FULL_RESOURCE_DESCRIPTOR
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
#define STATUS_NOT_FOUND
Definition: shellext.h:72
_In_ ULONG _In_ ULONG _In_ ULONG _Out_ PKIRQL _Out_ PKAFFINITY Affinity
Definition: halfuncs.h:170
CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]
Definition: hwresource.cpp:119
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@378::@381 Interrupt
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 CmResourceTypeInterrupt
Definition: hwresource.cpp:124
#define DPRINT1
Definition: precomp.h:8
PCM_RESOURCE_LIST TranslatedResources
Definition: precomp.h:104
#define CM_RESOURCE_INTERRUPT_LATCHED
Definition: cmtypes.h:144
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by PortFdoConnectInterrupt().

◆ GetResourceListSize()

static ULONG GetResourceListSize ( PCM_RESOURCE_LIST  ResourceList)
static

Definition at line 60 of file misc.c.

62 {
64  ULONG Size;
65 
66  DPRINT1("GetResourceListSize(%p)\n", ResourceList);
67 
68  Size = sizeof(CM_RESOURCE_LIST);
69  if (ResourceList->Count == 0)
70  {
71  DPRINT1("Size: 0x%lx (%u)\n", Size, Size);
72  return Size;
73  }
74 
75  DPRINT1("ResourceList->Count: %lu\n", ResourceList->Count);
76 
77  Descriptor = &ResourceList->List[0];
78 
79  DPRINT1("PartialResourceList->Count: %lu\n", Descriptor->PartialResourceList.Count);
80 
81  /* Add the size of the partial descriptors */
82  if (Descriptor->PartialResourceList.Count > 1)
83  Size += (Descriptor->PartialResourceList.Count - 1) * sizeof(CM_PARTIAL_RESOURCE_DESCRIPTOR);
84 
85  DPRINT1("Size: 0x%lx (%u)\n", Size, Size);
86  return Size;
87 }
_Must_inspect_result_ _In_ WDFIORESLIST _In_ PIO_RESOURCE_DESCRIPTOR Descriptor
Definition: wdfresource.h:339
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
_Must_inspect_result_ _In_ WDFIORESREQLIST _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFIORESLIST * ResourceList
Definition: wdfresource.h:304
struct _CM_RESOURCE_LIST CM_RESOURCE_LIST
#define DPRINT1
Definition: precomp.h:8
unsigned int ULONG
Definition: retypes.h:1

Referenced by CopyResourceList().

◆ QueryBusInterface()

NTSTATUS QueryBusInterface ( PDEVICE_OBJECT  DeviceObject,
PGUID  Guid,
USHORT  Size,
USHORT  Version,
PBUS_INTERFACE_STANDARD  Interface,
PVOID  InterfaceSpecificData 
)

Definition at line 121 of file misc.c.

128 {
129  KEVENT Event;
131  PIRP Irp;
134 
136 
138  DeviceObject,
139  NULL,
140  0,
141  NULL,
142  &Event,
143  &IoStatus);
144  if (Irp == NULL)
146 
148 
149  Stack->MajorFunction = IRP_MJ_PNP;
150  Stack->MinorFunction = IRP_MN_QUERY_INTERFACE;
151  Stack->Parameters.QueryInterface.InterfaceType = Guid;
152  Stack->Parameters.QueryInterface.Size = Size;
153  Stack->Parameters.QueryInterface.Version = Version;
154  Stack->Parameters.QueryInterface.Interface = (PINTERFACE)Interface;
155  Stack->Parameters.QueryInterface.InterfaceSpecificData = InterfaceSpecificData;
156 
157  Irp->IoStatus.Status = STATUS_NOT_SUPPORTED;
158 
160  if (Status == STATUS_PENDING)
161  {
163 
164  Status=IoStatus.Status;
165  }
166 
167  return Status;
168 }
return STATUS_NOT_SUPPORTED
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT _In_opt_ PVOID InterfaceSpecificData
Definition: wdffdo.h:461
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
PIRP NTAPI IoBuildSynchronousFsdRequest(IN ULONG MajorFunction, IN PDEVICE_OBJECT DeviceObject, IN PVOID Buffer, IN ULONG Length, IN PLARGE_INTEGER StartingOffset, IN PKEVENT Event, IN PIO_STATUS_BLOCK IoStatusBlock)
Definition: irp.c:1069
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
LONG NTSTATUS
Definition: precomp.h:26
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
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
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:636
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
#define FALSE
Definition: types.h:117
_In_ PIRP Irp
Definition: csq.h:116
_In_ PVOID _In_ ULONG Event
Definition: iotypes.h:467
struct _INTERFACE * PINTERFACE
Status
Definition: gdiplustypes.h:24
#define STATUS_PENDING
Definition: ntstatus.h:82
_Must_inspect_result_ _In_ WDFOBJECT _In_ CONST GUID * Guid
Definition: wdfobject.h:760
IN PVOID IN PVOID IN USHORT Version
Definition: pci.h:361
#define IRP_MN_QUERY_INTERFACE
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2695
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
IN PVOID IN PVOID IN USHORT IN USHORT IN PINTERFACE Interface
Definition: pci.h:361
#define NULL
Definition: types.h:112
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1218
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
Definition: mxum.h:155
nsresult QueryInterface(nsIIDRef riid, void **result)

Referenced by PortFdoStartDevice().

◆ TranslateResourceListAddress()

BOOLEAN TranslateResourceListAddress ( PFDO_DEVICE_EXTENSION  DeviceExtension,
INTERFACE_TYPE  BusType,
ULONG  SystemIoBusNumber,
STOR_PHYSICAL_ADDRESS  IoAddress,
ULONG  NumberOfBytes,
BOOLEAN  InIoSpace,
PPHYSICAL_ADDRESS  TranslatedAddress 
)

Definition at line 172 of file misc.c.

180 {
181  PCM_FULL_RESOURCE_DESCRIPTOR FullDescriptorA, FullDescriptorT;
182  PCM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptorA, PartialDescriptorT;
183  INT i, j;
184 
185  DPRINT1("TranslateResourceListAddress(%p)\n", DeviceExtension);
186 
187  FullDescriptorA = DeviceExtension->AllocatedResources->List;
188  FullDescriptorT = DeviceExtension->TranslatedResources->List;
189  for (i = 0; i < DeviceExtension->AllocatedResources->Count; i++)
190  {
191  for (j = 0; j < FullDescriptorA->PartialResourceList.Count; j++)
192  {
193  PartialDescriptorA = FullDescriptorA->PartialResourceList.PartialDescriptors + j;
194  PartialDescriptorT = FullDescriptorT->PartialResourceList.PartialDescriptors + j;
195 
196  switch (PartialDescriptorA->Type)
197  {
198  case CmResourceTypePort:
199  DPRINT1("Port: 0x%I64x (0x%lx)\n",
200  PartialDescriptorA->u.Port.Start.QuadPart,
201  PartialDescriptorA->u.Port.Length);
202  if (InIoSpace &&
203  IoAddress.QuadPart >= PartialDescriptorA->u.Port.Start.QuadPart &&
204  IoAddress.QuadPart + NumberOfBytes <= PartialDescriptorA->u.Port.Start.QuadPart + PartialDescriptorA->u.Port.Length)
205  {
206  TranslatedAddress->QuadPart = PartialDescriptorT->u.Port.Start.QuadPart +
207  (IoAddress.QuadPart - PartialDescriptorA->u.Port.Start.QuadPart);
208  return TRUE;
209  }
210  break;
211 
213  DPRINT1("Memory: 0x%I64x (0x%lx)\n",
214  PartialDescriptorA->u.Memory.Start.QuadPart,
215  PartialDescriptorA->u.Memory.Length);
216  if (!InIoSpace &&
217  IoAddress.QuadPart >= PartialDescriptorA->u.Memory.Start.QuadPart &&
218  IoAddress.QuadPart + NumberOfBytes <= PartialDescriptorA->u.Memory.Start.QuadPart + PartialDescriptorA->u.Memory.Length)
219  {
220  TranslatedAddress->QuadPart = PartialDescriptorT->u.Memory.Start.QuadPart +
221  (IoAddress.QuadPart - PartialDescriptorA->u.Memory.Start.QuadPart);
222  return TRUE;
223  }
224  break;
225  }
226  }
227 
228  /* Advance to next CM_FULL_RESOURCE_DESCRIPTOR block in memory. */
229  FullDescriptorA = (PCM_FULL_RESOURCE_DESCRIPTOR)(FullDescriptorA->PartialResourceList.PartialDescriptors +
230  FullDescriptorA->PartialResourceList.Count);
231 
232  FullDescriptorT = (PCM_FULL_RESOURCE_DESCRIPTOR)(FullDescriptorT->PartialResourceList.PartialDescriptors +
233  FullDescriptorT->PartialResourceList.Count);
234  }
235 
236  return FALSE;
237 }
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 * u
Definition: glfuncs.h:240
CM_FULL_RESOURCE_DESCRIPTOR List[1]
Definition: hwresource.cpp:165
#define TRUE
Definition: types.h:120
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@378 u
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG _Out_ PPHYSICAL_ADDRESS TranslatedAddress
Definition: iofuncs.h:2272
int32_t INT
Definition: typedefs.h:58
#define CmResourceTypePort
Definition: hwresource.cpp:123
CM_PARTIAL_RESOURCE_LIST PartialResourceList
Definition: hwresource.cpp:160
#define FALSE
Definition: types.h:117
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@378::@380 Port
struct _CM_FULL_RESOURCE_DESCRIPTOR * PCM_FULL_RESOURCE_DESCRIPTOR
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@378::@383 Memory
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
CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]
Definition: hwresource.cpp:119
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 DPRINT1
Definition: precomp.h:8
PCM_RESOURCE_LIST TranslatedResources
Definition: precomp.h:104
#define CmResourceTypeMemory
Definition: hwresource.cpp:125
LONGLONG QuadPart
Definition: typedefs.h:114
PCM_RESOURCE_LIST AllocatedResources
Definition: precomp.h:103

Referenced by StorPortGetDeviceBase().