ReactOS 0.4.16-dev-338-g34e76ad
precomp.h File Reference
#include <wdm.h>
#include <ntddk.h>
#include <stdio.h>
#include <memory.h>
#include <storport.h>
#include <ntddscsi.h>
#include <ntdddisk.h>
#include <mountdev.h>
#include <wdmguid.h>
Include dependency graph for precomp.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _DRIVER_INIT_DATA
 
struct  _DRIVER_OBJECT_EXTENSION
 
struct  _MINIPORT_DEVICE_EXTENSION
 
struct  _MINIPORT
 
struct  _UNIT_DATA
 
struct  _FDO_DEVICE_EXTENSION
 
struct  _PDO_DEVICE_EXTENSION
 

Macros

#define _STORPORT_
 
#define TAG_GLOBAL_DATA   'DGtS'
 
#define TAG_INIT_DATA   'DItS'
 
#define TAG_MINIPORT_DATA   'DMtS'
 
#define TAG_ACCRESS_RANGE   'RAtS'
 
#define TAG_RESOURCE_LIST   'LRtS'
 
#define TAG_ADDRESS_MAPPING   'MAtS'
 
#define TAG_INQUIRY_DATA   'QItS'
 
#define TAG_SENSE_DATA   'NStS'
 

Typedefs

typedef struct _DRIVER_INIT_DATA DRIVER_INIT_DATA
 
typedef struct _DRIVER_INIT_DATAPDRIVER_INIT_DATA
 
typedef struct _DRIVER_OBJECT_EXTENSION DRIVER_OBJECT_EXTENSION
 
typedef struct _DRIVER_OBJECT_EXTENSIONPDRIVER_OBJECT_EXTENSION
 
typedef struct _MINIPORT_DEVICE_EXTENSION MINIPORT_DEVICE_EXTENSION
 
typedef struct _MINIPORT_DEVICE_EXTENSIONPMINIPORT_DEVICE_EXTENSION
 
typedef struct _MINIPORT MINIPORT
 
typedef struct _MINIPORTPMINIPORT
 
typedef struct _UNIT_DATA UNIT_DATA
 
typedef struct _UNIT_DATAPUNIT_DATA
 
typedef struct _FDO_DEVICE_EXTENSION FDO_DEVICE_EXTENSION
 
typedef struct _FDO_DEVICE_EXTENSIONPFDO_DEVICE_EXTENSION
 
typedef struct _PDO_DEVICE_EXTENSION PDO_DEVICE_EXTENSION
 
typedef struct _PDO_DEVICE_EXTENSIONPPDO_DEVICE_EXTENSION
 

Enumerations

enum  DEVICE_STATE {
  dsStopped , dsStarted , dsPaused , dsRemoved ,
  dsSurpriseRemoved , NotStarted = 0 , Started , StopPending ,
  Stopped , RemovePending , SurpriseRemovePending , Deleted ,
  dsStopped , dsStarted , dsPaused , dsRemoved ,
  dsSurpriseRemoved , dsStopped , dsStarted , dsPaused ,
  dsRemoved , dsSurpriseRemoved
}
 
enum  EXTENSION_TYPE { InvalidExtension = 0 , DriverExtension , FdoExtension , PdoExtension }
 

Functions

NTSTATUS NTAPI PortFdoScsi (_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp)
 
NTSTATUS NTAPI PortFdoPnp (_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp)
 
NTSTATUS MiniportInitialize (_In_ PMINIPORT Miniport, _In_ PFDO_DEVICE_EXTENSION DeviceExtension, _In_ PHW_INITIALIZATION_DATA HwInitializationData)
 
NTSTATUS MiniportFindAdapter (_In_ PMINIPORT Miniport)
 
NTSTATUS MiniportHwInitialize (_In_ PMINIPORT Miniport)
 
BOOLEAN MiniportHwInterrupt (_In_ PMINIPORT Miniport)
 
BOOLEAN MiniportStartIo (_In_ PMINIPORT Miniport, _In_ PSCSI_REQUEST_BLOCK Srb)
 
NTSTATUS NTAPI ForwardIrpAndForget (_In_ PDEVICE_OBJECT LowerDevice, _In_ PIRP Irp)
 
INTERFACE_TYPE GetBusInterface (PDEVICE_OBJECT DeviceObject)
 
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)
 
NTSTATUS PortCreatePdo (_In_ PFDO_DEVICE_EXTENSION FdoExtension, _In_ ULONG Bus, _In_ ULONG Target, _In_ ULONG Lun, _Out_ PPDO_DEVICE_EXTENSION *PdoExtension)
 
NTSTATUS PortDeletePdo (_In_ PPDO_DEVICE_EXTENSION PdoExtension)
 
NTSTATUS NTAPI PortPdoScsi (_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp)
 
NTSTATUS NTAPI PortPdoPnp (_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp)
 
PHW_INITIALIZATION_DATA PortGetDriverInitData (PDRIVER_OBJECT_EXTENSION DriverExtension, INTERFACE_TYPE InterfaceType)
 
NTSTATUS NTAPI DriverEntry (_In_ PDRIVER_OBJECT DriverObject, _In_ PUNICODE_STRING RegistryPath)
 

Macro Definition Documentation

◆ _STORPORT_

#define _STORPORT_

Definition at line 17 of file precomp.h.

◆ TAG_ACCRESS_RANGE

#define TAG_ACCRESS_RANGE   'RAtS'

Definition at line 29 of file precomp.h.

◆ TAG_ADDRESS_MAPPING

#define TAG_ADDRESS_MAPPING   'MAtS'

Definition at line 31 of file precomp.h.

◆ TAG_GLOBAL_DATA

#define TAG_GLOBAL_DATA   'DGtS'

Definition at line 26 of file precomp.h.

◆ TAG_INIT_DATA

#define TAG_INIT_DATA   'DItS'

Definition at line 27 of file precomp.h.

◆ TAG_INQUIRY_DATA

#define TAG_INQUIRY_DATA   'QItS'

Definition at line 32 of file precomp.h.

◆ TAG_MINIPORT_DATA

#define TAG_MINIPORT_DATA   'DMtS'

Definition at line 28 of file precomp.h.

◆ TAG_RESOURCE_LIST

#define TAG_RESOURCE_LIST   'LRtS'

Definition at line 30 of file precomp.h.

◆ TAG_SENSE_DATA

#define TAG_SENSE_DATA   'NStS'

Definition at line 33 of file precomp.h.

Typedef Documentation

◆ DRIVER_INIT_DATA

◆ DRIVER_OBJECT_EXTENSION

◆ FDO_DEVICE_EXTENSION

◆ MINIPORT

◆ MINIPORT_DEVICE_EXTENSION

◆ PDO_DEVICE_EXTENSION

◆ PDRIVER_INIT_DATA

◆ PDRIVER_OBJECT_EXTENSION

◆ PFDO_DEVICE_EXTENSION

◆ PMINIPORT

◆ PMINIPORT_DEVICE_EXTENSION

◆ PPDO_DEVICE_EXTENSION

◆ PUNIT_DATA

◆ UNIT_DATA

Enumeration Type Documentation

◆ DEVICE_STATE

Enumerator
dsStopped 
dsStarted 
dsPaused 
dsRemoved 
dsSurpriseRemoved 
NotStarted 
Started 
StopPending 
Stopped 
RemovePending 
SurpriseRemovePending 
Deleted 
dsStopped 
dsStarted 
dsPaused 
dsRemoved 
dsSurpriseRemoved 
dsStopped 
dsStarted 
dsPaused 
dsRemoved 
dsSurpriseRemoved 

Definition at line 35 of file precomp.h.

36{
DEVICE_STATE
Definition: precomp.h:36
@ dsSurpriseRemoved
Definition: precomp.h:41
@ dsStopped
Definition: precomp.h:37
@ dsPaused
Definition: precomp.h:39
@ dsStarted
Definition: precomp.h:38
@ dsRemoved
Definition: precomp.h:40

◆ EXTENSION_TYPE

Enumerator
InvalidExtension 
DriverExtension 
FdoExtension 
PdoExtension 

Definition at line 44 of file precomp.h.

45{
EXTENSION_TYPE
Definition: precomp.h:45
@ InvalidExtension
Definition: precomp.h:46
@ PdoExtension
Definition: precomp.h:49
@ DriverExtension
Definition: precomp.h:47
@ FdoExtension
Definition: precomp.h:48

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}
#define DPRINT1
Definition: precomp.h:8
#define STATUS_NO_MEMORY
Definition: d3dkmdt.h:51
#define NULL
Definition: types.h:112
#define TAG_ADDRESS_MAPPING
Definition: precomp.h:31
static PVOID Mapping[EMS_PHYSICAL_PAGES]
Definition: emsdrv.c:41
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define NonPagedPool
Definition: env_spec_w32.h:307
#define STATUS_SUCCESS
Definition: shellext.h:65
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:160
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER NumberOfBytes
Definition: iotypes.h:1036

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",
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}
static ULONG GetResourceListSize(PCM_RESOURCE_LIST ResourceList)
Definition: misc.c:60
#define TAG_RESOURCE_LIST
Definition: precomp.h:30
_In_ UINT _In_ UINT _In_ PNDIS_PACKET Source
Definition: ndis.h:3169
_In_ PUNICODE_STRING _Inout_ PUNICODE_STRING Destination
Definition: rtlfuncs.h:3016
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ _In_ WDFDEVICE _In_ DEVICE_REGISTRY_PROPERTY _In_ _Strict_type_match_ POOL_TYPE PoolType
Definition: wdfdevice.h:3815
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533

Referenced by PortFdoStartDevice().

◆ DriverEntry()

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

Definition at line 1412 of file isapnp.c.

1415{
1416 DPRINT("%s(%p, %wZ)\n", __FUNCTION__, DriverObject, RegistryPath);
1417
1418 if (IsNEC_98)
1419 {
1422 }
1423
1424 DriverObject->MajorFunction[IRP_MJ_CREATE] = IsaCreateClose;
1425 DriverObject->MajorFunction[IRP_MJ_CLOSE] = IsaCreateClose;
1426 DriverObject->MajorFunction[IRP_MJ_DEVICE_CONTROL] = IsaForwardOrIgnore;
1427 DriverObject->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = IsaForwardOrIgnore;
1428 DriverObject->MajorFunction[IRP_MJ_PNP] = IsaPnp;
1429 DriverObject->MajorFunction[IRP_MJ_POWER] = IsaPower;
1430 DriverObject->DriverExtension->AddDevice = IsaAddDevice;
1431
1432 /* FIXME: Fix SDK headers */
1433#if 0
1435#endif
1436
1438 InitializeListHead(&BusListHead);
1439
1440 /* FIXME: Fix SDK headers */
1441#if 0
1443#endif
1444
1445 return STATUS_SUCCESS;
1446}
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
#define _No_competing_thread_begin_
#define _No_competing_thread_end_
#define TRUE
Definition: types.h:120
ULONG IsaConfigPorts[2]
Definition: hardware.c:23
#define __FUNCTION__
Definition: types.h:116
#define KeInitializeEvent(pEvt, foo, foo2)
Definition: env_spec_w32.h:477
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
KEVENT BusSyncEvent
Definition: isapnp.c:21
#define ISAPNP_ADDRESS_PC98
Definition: isapnphw.h:19
#define ISAPNP_WRITE_DATA_PC98
Definition: isapnphw.h:20
@ SynchronizationEvent
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
#define DPRINT
Definition: sndvol32.h:73
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
#define IRP_MJ_SYSTEM_CONTROL
#define IRP_MJ_POWER
#define IsNEC_98
Definition: ketypes.h:911

◆ ForwardIrpAndForget()

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

Definition at line 5 of file utils.c.

8{
9 // this part of a structure is identical in both FDO and PDO
10 PDEVICE_OBJECT LowerDevice = ((PFDO_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
11
12 ASSERT(LowerDevice);
13
15 return IoCallDriver(LowerDevice, Irp);
16}
_In_ PIRP Irp
Definition: csq.h:116
#define ASSERT(a)
Definition: mode.c:44
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
#define IoCallDriver
Definition: irp.c:1225
struct _FDO_EXTENSION * PFDO_EXTENSION
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055

◆ GetBusInterface()

INTERFACE_TYPE GetBusInterface ( PDEVICE_OBJECT  DeviceObject)

Definition at line 32 of file misc.c.

34{
35 GUID Guid;
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}
LONG NTSTATUS
Definition: precomp.h:26
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465
Status
Definition: gdiplustypes.h:25
@ InterfaceTypeUndefined
Definition: hwresource.cpp:136
@ PCIBus
Definition: hwresource.cpp:142
@ PNPISABus
Definition: hwresource.cpp:151
@ PCMCIABus
Definition: hwresource.cpp:145
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
NTSTATUS NTAPI IoGetDeviceProperty(IN PDEVICE_OBJECT DeviceObject, IN DEVICE_REGISTRY_PROPERTY DeviceProperty, IN ULONG BufferLength, OUT PVOID PropertyBuffer, OUT PULONG ResultLength)
Definition: pnpmgr.c:1382
_Must_inspect_result_ _In_ WDFOBJECT _In_ CONST GUID * Guid
Definition: wdfobject.h:762
@ DevicePropertyBusTypeGuid
Definition: iotypes.h:1207

Referenced by PortFdoStartMiniport().

◆ 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}
_Out_ PKIRQL Irql
Definition: csq.h:179
#define FALSE
Definition: types.h:117
UCHAR KIRQL
Definition: env_spec_w32.h:591
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
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
struct _CM_FULL_RESOURCE_DESCRIPTOR * PCM_FULL_RESOURCE_DESCRIPTOR
#define CmResourceTypeInterrupt
Definition: hwresource.cpp:124
#define CM_RESOURCE_INTERRUPT_LATCHED
Definition: cmtypes.h:144
@ Latched
Definition: miniport.h:81
@ LevelSensitive
Definition: miniport.h:80
#define STATUS_NOT_FOUND
Definition: shellext.h:72
CM_PARTIAL_RESOURCE_LIST PartialResourceList
Definition: hwresource.cpp:160
union _CM_PARTIAL_RESOURCE_DESCRIPTOR::@392 u
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@392::@395 Interrupt
CM_PARTIAL_RESOURCE_DESCRIPTOR PartialDescriptors[1]
Definition: hwresource.cpp:119
CM_FULL_RESOURCE_DESCRIPTOR List[1]
Definition: hwresource.cpp:165
PCM_RESOURCE_LIST TranslatedResources
Definition: precomp.h:104
int32_t INT
Definition: typedefs.h:58
@ CmResourceShareShared
Definition: cmtypes.h:243
_In_ ULONG _In_ ULONG _In_ ULONG _Out_ PKIRQL _Out_ PKAFFINITY Affinity
Definition: halfuncs.h:174
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID _In_opt_ PKSPIN_LOCK _In_ ULONG _In_ KIRQL _In_ KIRQL _In_ KINTERRUPT_MODE InterruptMode
Definition: iofuncs.h:806
_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:807

Referenced by PortFdoConnectInterrupt().

◆ MiniportFindAdapter()

NTSTATUS MiniportFindAdapter ( _In_ PMINIPORT  Miniport)

Definition at line 285 of file miniport.c.

287{
291
292 DPRINT1("MiniportFindAdapter(%p)\n", Miniport);
293
294 /* Call the miniport HwFindAdapter routine */
295 Result = Miniport->InitData->HwFindAdapter(&Miniport->MiniportExtension->HwDeviceExtension,
296 NULL,
297 NULL,
298 NULL,
299 &Miniport->PortConfig,
300 &Reserved);
301 DPRINT1("HwFindAdapter() returned %lu\n", Result);
302
303 /* Convert the result to a status code */
304 switch (Result)
305 {
307 DPRINT1("SP_RETURN_NOT_FOUND\n");
309 break;
310
311 case SP_RETURN_FOUND:
312 DPRINT1("SP_RETURN_FOUND\n");
314 break;
315
316 case SP_RETURN_ERROR:
317 DPRINT1("SP_RETURN_ERROR\n");
319 break;
320
322 DPRINT1("SP_RETURN_BAD_CONFIG\n");
324 break;
325
326 default:
327 DPRINT1("Unknown result: %lu\n", Result);
329 break;
330 }
331
332 return Status;
333}
unsigned char BOOLEAN
#define SP_RETURN_ERROR
Definition: srb.h:523
#define SP_RETURN_FOUND
Definition: srb.h:522
#define SP_RETURN_BAD_CONFIG
Definition: srb.h:524
#define SP_RETURN_NOT_FOUND
Definition: srb.h:521
#define STATUS_INTERNAL_ERROR
Definition: ntstatus.h:465
#define STATUS_DEVICE_CONFIGURATION_ERROR
Definition: ntstatus.h:619
#define STATUS_ADAPTER_HARDWARE_ERROR
Definition: ntstatus.h:430
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409

Referenced by PortFdoStartMiniport().

◆ MiniportHwInitialize()

NTSTATUS MiniportHwInitialize ( _In_ PMINIPORT  Miniport)

Definition at line 337 of file miniport.c.

339{
341
342 DPRINT1("MiniportHwInitialize(%p)\n", Miniport);
343
344 /* Call the miniport HwInitialize routine */
345 Result = Miniport->InitData->HwInitialize(&Miniport->MiniportExtension->HwDeviceExtension);
346 DPRINT1("HwInitialize() returned %u\n", Result);
347
349}
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132

Referenced by PortFdoStartMiniport().

◆ MiniportHwInterrupt()

BOOLEAN MiniportHwInterrupt ( _In_ PMINIPORT  Miniport)

Definition at line 353 of file miniport.c.

355{
357
358 DPRINT1("MiniportHwInterrupt(%p)\n",
359 Miniport);
360
361 Result = Miniport->InitData->HwInterrupt(&Miniport->MiniportExtension->HwDeviceExtension);
362 DPRINT1("HwInterrupt() returned %u\n", Result);
363
364 return Result;
365}

Referenced by PortFdoInterruptRoutine().

◆ MiniportInitialize()

NTSTATUS MiniportInitialize ( _In_ PMINIPORT  Miniport,
_In_ PFDO_DEVICE_EXTENSION  DeviceExtension,
_In_ PHW_INITIALIZATION_DATA  HwInitializationData 
)

Definition at line 236 of file miniport.c.

240{
241 PMINIPORT_DEVICE_EXTENSION MiniportExtension;
242 ULONG Size;
244
245 DPRINT1("MiniportInitialize(%p %p %p)\n",
246 Miniport, DeviceExtension, InitData);
247
248 Miniport->DeviceExtension = DeviceExtension;
249 Miniport->InitData = InitData;
250
251 /* Calculate the miniport device extension size */
253 Miniport->InitData->DeviceExtensionSize;
254
255 /* Allocate and initialize the miniport device extension */
256 MiniportExtension = ExAllocatePoolWithTag(NonPagedPool,
257 Size,
259 if (MiniportExtension == NULL)
260 return STATUS_NO_MEMORY;
261
262 RtlZeroMemory(MiniportExtension, Size);
263
264 MiniportExtension->Miniport = Miniport;
265 Miniport->MiniportExtension = MiniportExtension;
266
267 /* Initialize the port configuration */
268 Status = InitializeConfiguration(&Miniport->PortConfig,
269 InitData,
270 DeviceExtension->BusNumber,
271 DeviceExtension->SlotNumber);
272 if (!NT_SUCCESS(Status))
273 return Status;
274
275 /* Assign the resources to the port configuration */
276 AssignResourcesToConfiguration(&Miniport->PortConfig,
277 DeviceExtension->AllocatedResources,
278 InitData->NumberOfAccessRanges);
279
280 return STATUS_SUCCESS;
281}
#define TAG_MINIPORT_DATA
Definition: precomp.h:28
struct _MINIPORT_DEVICE_EXTENSION MINIPORT_DEVICE_EXTENSION
static VOID AssignResourcesToConfiguration(_In_ PPORT_CONFIGURATION_INFORMATION PortConfiguration, _In_ PCM_RESOURCE_LIST ResourceList, _In_ ULONG NumberOfAccessRanges)
Definition: miniport.c:96
static NTSTATUS InitializeConfiguration(_In_ PPORT_CONFIGURATION_INFORMATION PortConfig, _In_ PHW_INITIALIZATION_DATA InitData, _In_ ULONG BusNumber, _In_ ULONG SlotNumber)
Definition: miniport.c:20
struct _MINIPORT * Miniport
Definition: precomp.h:72

◆ MiniportStartIo()

BOOLEAN MiniportStartIo ( _In_ PMINIPORT  Miniport,
_In_ PSCSI_REQUEST_BLOCK  Srb 
)

Definition at line 369 of file miniport.c.

372{
374
375 DPRINT1("MiniportHwStartIo(%p %p)\n",
376 Miniport, Srb);
377
378 Result = Miniport->InitData->HwStartIo(&Miniport->MiniportExtension->HwDeviceExtension, Srb);
379 DPRINT1("HwStartIo() returned %u\n", Result);
380
381 return Result;
382}
_In_ PSCSI_REQUEST_BLOCK Srb
Definition: cdrom.h:989

◆ PortCreatePdo()

NTSTATUS PortCreatePdo ( _In_ PFDO_DEVICE_EXTENSION  FdoExtension,
_In_ ULONG  Bus,
_In_ ULONG  Target,
_In_ ULONG  Lun,
_Out_ PPDO_DEVICE_EXTENSION PdoExtension 
)

Definition at line 19 of file pdo.c.

25{
26 PPDO_DEVICE_EXTENSION DeviceExtension = NULL;
30
31 DPRINT("PortCreatePdo(%p %p)\n",
32 FdoDeviceExtension, PdoDeviceExtension);
33
34 /* Create the port device */
35 Status = IoCreateDevice(FdoDeviceExtension->Device->DriverObject,
37 NULL,
40 FALSE,
41 &Pdo);
42 if (!NT_SUCCESS(Status))
43 {
44 DPRINT1("IoCreateDevice() failed (Status 0x%lX)\n", Status);
45 return Status;
46 }
47
48 /* Initialize the device */
49 Pdo->Flags |= DO_DIRECT_IO;
50 Pdo->Flags |= DO_POWER_PAGABLE;
51
52 DeviceExtension = (PPDO_DEVICE_EXTENSION)Pdo->DeviceExtension;
53 RtlZeroMemory(DeviceExtension, sizeof(PDO_DEVICE_EXTENSION));
54
55 DeviceExtension->ExtensionType = PdoExtension;
56
57 DeviceExtension->Device = Pdo;
58 DeviceExtension->FdoExtension = FdoDeviceExtension;
59 DeviceExtension->PnpState = dsStopped;
60
61 /* Add the PDO to the PDO list*/
62 KeAcquireInStackQueuedSpinLock(&FdoDeviceExtension->PdoListLock,
63 &LockHandle);
64 InsertHeadList(&FdoDeviceExtension->PdoListHead,
65 &DeviceExtension->PdoListEntry);
66 FdoDeviceExtension->PdoCount++;
68
69 DeviceExtension->Bus = Bus;
70 DeviceExtension->Target = Target;
71 DeviceExtension->Lun = Lun;
72
73
74 // FIXME: More initialization
75
76
77 /* The device has been initialized */
78 Pdo->Flags &= ~DO_DEVICE_INITIALIZING;
79
80 *PdoDeviceExtension = DeviceExtension;
81
82 return STATUS_SUCCESS;
83}
#define FILE_DEVICE_SECURE_OPEN
Definition: cdrw_usr.h:46
_In_ ULONG _In_ BOOLEAN _In_ ULONG _In_ UCHAR _In_ UCHAR _In_ UCHAR Lun
Definition: classpnp.h:1315
struct _PDO_DEVICE_EXTENSION * PPDO_DEVICE_EXTENSION
#define InsertHeadList(ListHead, Entry)
#define DO_DIRECT_IO
Definition: env_spec_w32.h:396
VOID FASTCALL KeAcquireInStackQueuedSpinLock(IN PKSPIN_LOCK SpinLock, IN PKLOCK_QUEUE_HANDLE LockHandle)
Definition: spinlock.c:130
VOID FASTCALL KeReleaseInStackQueuedSpinLock(IN PKLOCK_QUEUE_HANDLE LockHandle)
Definition: spinlock.c:166
@ dsStopped
Definition: isapnp.h:30
#define FILE_DEVICE_MASS_STORAGE
Definition: imports.h:60
#define FILE_AUTOGENERATED_DEVICE_NAME
Definition: iotypes.h:138
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
PFDO_DEVICE_EXTENSION FdoExtension
Definition: precomp.h:126
LIST_ENTRY PdoListEntry
Definition: precomp.h:128
PDEVICE_OBJECT Device
Definition: precomp.h:125
DEVICE_STATE PnpState
Definition: precomp.h:127
EXTENSION_TYPE ExtensionType
Definition: precomp.h:123
WDF_EXTERN_C_START typedef _Must_inspect_result_ _In_ WDFDRIVER _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT _In_opt_ PDEVICE_OBJECT Pdo
Definition: wdfminiport.h:72
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
#define DO_POWER_PAGABLE
*LockHandle LockHandle _Out_ PKLOCK_QUEUE_HANDLE LockHandle
Definition: kefuncs.h:717

Referenced by PortFdoScanBus().

◆ PortDeletePdo()

NTSTATUS PortDeletePdo ( _In_ PPDO_DEVICE_EXTENSION  PdoExtension)

Definition at line 87 of file pdo.c.

89{
91
92 DPRINT("PortDeletePdo(%p)\n", PdoExtension);
93
94 /* Remove the PDO from the PDO list*/
95 KeAcquireInStackQueuedSpinLock(&PdoExtension->FdoExtension->PdoListLock,
96 &LockHandle);
97 RemoveEntryList(&PdoExtension->PdoListEntry);
98 PdoExtension->FdoExtension->PdoCount--;
100
101 if (PdoExtension->InquiryBuffer)
102 {
104 PdoExtension->InquiryBuffer = NULL;
105 }
106
107
108 // FIXME: More uninitialization
109
110
111 /* Delete the PDO */
113
114 return STATUS_SUCCESS;
115}
#define TAG_INQUIRY_DATA
Definition: precomp.h:32
#define RemoveEntryList(Entry)
Definition: env_spec_w32.h:986
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251

Referenced by PortFdoScanBus().

◆ PortFdoPnp()

NTSTATUS NTAPI PortFdoPnp ( _In_ PDEVICE_OBJECT  DeviceObject,
_In_ PIRP  Irp 
)

Definition at line 596 of file fdo.c.

599{
600 PFDO_DEVICE_EXTENSION DeviceExtension;
604
605 DPRINT1("PortFdoPnp(%p %p)\n",
607
608 DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
609 ASSERT(DeviceExtension);
610 ASSERT(DeviceExtension->ExtensionType == FdoExtension);
611
613
614 switch (Stack->MinorFunction)
615 {
616 case IRP_MN_START_DEVICE: /* 0x00 */
617 DPRINT1("IRP_MJ_PNP / IRP_MN_START_DEVICE\n");
618 Status = PortFdoStartDevice(DeviceExtension, Irp);
619 break;
620
621 case IRP_MN_QUERY_REMOVE_DEVICE: /* 0x01 */
622 DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_REMOVE_DEVICE\n");
623 break;
624
625 case IRP_MN_REMOVE_DEVICE: /* 0x02 */
626 DPRINT1("IRP_MJ_PNP / IRP_MN_REMOVE_DEVICE\n");
627 break;
628
629 case IRP_MN_CANCEL_REMOVE_DEVICE: /* 0x03 */
630 DPRINT1("IRP_MJ_PNP / IRP_MN_CANCEL_REMOVE_DEVICE\n");
631 break;
632
633 case IRP_MN_STOP_DEVICE: /* 0x04 */
634 DPRINT1("IRP_MJ_PNP / IRP_MN_STOP_DEVICE\n");
635 break;
636
637 case IRP_MN_QUERY_STOP_DEVICE: /* 0x05 */
638 DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_STOP_DEVICE\n");
639 break;
640
641 case IRP_MN_CANCEL_STOP_DEVICE: /* 0x06 */
642 DPRINT1("IRP_MJ_PNP / IRP_MN_CANCEL_STOP_DEVICE\n");
643 break;
644
645 case IRP_MN_QUERY_DEVICE_RELATIONS: /* 0x07 */
646 DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS\n");
647 switch (Stack->Parameters.QueryDeviceRelations.Type)
648 {
649 case BusRelations:
650 DPRINT1(" IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / BusRelations\n");
651 Status = PortFdoQueryBusRelations(DeviceExtension, &Information);
652 break;
653
654 case RemovalRelations:
655 DPRINT1(" IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / RemovalRelations\n");
656 return ForwardIrpAndForget(DeviceExtension->LowerDevice, Irp);
657
658 default:
659 DPRINT1(" IRP_MJ_PNP / IRP_MN_QUERY_DEVICE_RELATIONS / Unknown type 0x%lx\n",
660 Stack->Parameters.QueryDeviceRelations.Type);
661 return ForwardIrpAndForget(DeviceExtension->LowerDevice, Irp);
662 }
663 break;
664
666 DPRINT1("IRP_MJ_PNP / IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
667 PortFdoFilterRequirements(DeviceExtension, Irp);
668 return ForwardIrpAndForget(DeviceExtension->LowerDevice, Irp);
669
670 case IRP_MN_QUERY_PNP_DEVICE_STATE: /* 0x14 */
671 DPRINT1("IRP_MJ_PNP / IRP_MN_QUERY_PNP_DEVICE_STATE\n");
672 break;
673
674 case IRP_MN_DEVICE_USAGE_NOTIFICATION: /* 0x16 */
675 DPRINT1("IRP_MJ_PNP / IRP_MN_DEVICE_USAGE_NOTIFICATION\n");
676 break;
677
678 case IRP_MN_SURPRISE_REMOVAL: /* 0x17 */
679 DPRINT1("IRP_MJ_PNP / IRP_MN_SURPRISE_REMOVAL\n");
680 break;
681
682 default:
683 DPRINT1("IRP_MJ_PNP / Unknown IOCTL 0x%lx\n", Stack->MinorFunction);
684 return ForwardIrpAndForget(DeviceExtension->LowerDevice, Irp);
685 }
686
687 Irp->IoStatus.Information = Information;
688 Irp->IoStatus.Status = Status;
690
691 return Status;
692}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
#define STATUS_NOT_SUPPORTED
Definition: d3dkmdt.h:48
struct _FDO_DEVICE_EXTENSION * PFDO_DEVICE_EXTENSION
DRIVER_DISPATCH ForwardIrpAndForget
Definition: i8042prt.h:341
#define IRP_MN_SURPRISE_REMOVAL
Definition: ntifs_ex.h:408
#define IoCompleteRequest
Definition: irp.c:1240
static NTSTATUS PortFdoFilterRequirements(PFDO_DEVICE_EXTENSION DeviceExtension, PIRP Irp)
Definition: fdo.c:546
static NTSTATUS NTAPI PortFdoStartDevice(_In_ PFDO_DEVICE_EXTENSION DeviceExtension, _In_ PIRP Irp)
Definition: fdo.c:176
static NTSTATUS PortFdoQueryBusRelations(_In_ PFDO_DEVICE_EXTENSION DeviceExtension, _Out_ PULONG_PTR Information)
Definition: fdo.c:525
PDEVICE_OBJECT LowerDevice
Definition: i8042prt.h:130
EXTENSION_TYPE ExtensionType
Definition: precomp.h:92
uint32_t ULONG_PTR
Definition: typedefs.h:65
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:639
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
Definition: wdfrequest.h:1049
#define IRP_MN_CANCEL_STOP_DEVICE
@ RemovalRelations
Definition: iotypes.h:2155
@ BusRelations
Definition: iotypes.h:2152
#define IRP_MN_QUERY_PNP_DEVICE_STATE
#define IO_NO_INCREMENT
Definition: iotypes.h:598
#define IRP_MN_START_DEVICE
#define IRP_MN_DEVICE_USAGE_NOTIFICATION
#define IRP_MN_REMOVE_DEVICE
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define IRP_MN_QUERY_STOP_DEVICE
#define IRP_MN_CANCEL_REMOVE_DEVICE
#define IRP_MN_STOP_DEVICE
#define IRP_MN_QUERY_REMOVE_DEVICE

Referenced by PortDispatchPnp().

◆ PortFdoScsi()

NTSTATUS NTAPI PortFdoScsi ( _In_ PDEVICE_OBJECT  DeviceObject,
_In_ PIRP  Irp 
)

Definition at line 568 of file fdo.c.

571{
572 PFDO_DEVICE_EXTENSION DeviceExtension;
573// PIO_STACK_LOCATION Stack;
576
577 DPRINT("PortFdoScsi(%p %p)\n", DeviceObject, Irp);
578
579 DeviceExtension = (PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension;
580 ASSERT(DeviceExtension);
581 ASSERT(DeviceExtension->ExtensionType == FdoExtension);
582
583// Stack = IoGetCurrentIrpStackLocation(Irp);
584
585
586 Irp->IoStatus.Information = Information;
587 Irp->IoStatus.Status = Status;
589
590 return Status;
591}

Referenced by PortDispatchScsi().

◆ PortGetDriverInitData()

PHW_INITIALIZATION_DATA PortGetDriverInitData ( PDRIVER_OBJECT_EXTENSION  DriverExtension,
INTERFACE_TYPE  InterfaceType 
)

Definition at line 78 of file storport.c.

81{
82 PDRIVER_INIT_DATA InitData;
83 PLIST_ENTRY ListEntry;
84
85 DPRINT1("PortGetDriverInitData()\n");
86
87 ListEntry = DriverExtension->InitDataListHead.Flink;
88 while (ListEntry != &DriverExtension->InitDataListHead)
89 {
90 InitData = CONTAINING_RECORD(ListEntry,
92 Entry);
94 return &InitData->HwInitData;
95
96 ListEntry = ListEntry->Flink;
97 }
98
99 return NULL;
100}
PPCI_DRIVER_EXTENSION DriverExtension
Definition: pci.c:31
base of all file and directory entries
Definition: entries.h:83
HW_INITIALIZATION_DATA HwInitData
Definition: precomp.h:55
INTERFACE_TYPE AdapterInterfaceType
Definition: srb.h:565
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID InterfaceType
Definition: wdffdo.h:463

Referenced by PortFdoStartMiniport().

◆ PortPdoPnp()

NTSTATUS NTAPI PortPdoPnp ( _In_ PDEVICE_OBJECT  DeviceObject,
_In_ PIRP  Irp 
)

Definition at line 135 of file pdo.c.

138{
139 DPRINT1("PortPdoPnp(%p %p)\n", DeviceObject, Irp);
140
141 Irp->IoStatus.Information = 0;
142 Irp->IoStatus.Status = STATUS_SUCCESS;
144 return STATUS_SUCCESS;
145}

Referenced by PortDispatchPnp().

◆ PortPdoScsi()

NTSTATUS NTAPI PortPdoScsi ( _In_ PDEVICE_OBJECT  DeviceObject,
_In_ PIRP  Irp 
)

Definition at line 120 of file pdo.c.

123{
124 DPRINT1("PortPdoScsi(%p %p)\n", DeviceObject, Irp);
125
126 Irp->IoStatus.Information = 0;
127 Irp->IoStatus.Status = STATUS_SUCCESS;
129 return STATUS_SUCCESS;
130}

Referenced by PortDispatchScsi().

◆ 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{
131 PIRP Irp;
134
136
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}
#define STATUS_PENDING
Definition: d3dkmdt.h:43
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
Definition: env_spec_w32.h:478
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
nsresult QueryInterface(nsIIDRef riid, void **result)
__in UCHAR __in POWER_STATE __in_opt PVOID __in PIO_STATUS_BLOCK IoStatus
Definition: mxum.h:159
#define KernelMode
Definition: asm.h:34
@ NotificationEvent
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
struct _INTERFACE * PINTERFACE
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE Interface
Definition: wdffdo.h:465
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
Definition: wdffdo.h:469
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT _In_opt_ PVOID InterfaceSpecificData
Definition: wdffdo.h:472
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2695
#define IRP_MN_QUERY_INTERFACE
@ Executive
Definition: ketypes.h:415

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 {
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
#define CmResourceTypeMemory
Definition: hwresource.cpp:125
#define CmResourceTypePort
Definition: hwresource.cpp:123
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@392::@394 Port
struct _CM_PARTIAL_RESOURCE_DESCRIPTOR::@392::@397 Memory
PCM_RESOURCE_LIST AllocatedResources
Definition: precomp.h:103
LONGLONG QuadPart
Definition: typedefs.h:114
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG _Out_ PPHYSICAL_ADDRESS TranslatedAddress
Definition: iofuncs.h:2275

Referenced by StorPortGetDeviceBase().