#include <pci.h>
#include <debug.h>
Go to the source code of this file.
|
| NTSTATUS NTAPI | devpresent_Initializer (IN PVOID Instance) |
| |
| static VOID NTAPI | devpresent_Reference (_In_ PVOID Context) |
| |
| static VOID NTAPI | devpresent_Dereference (_In_ PVOID Context) |
| |
| static BOOLEAN NTAPI | devpresent_IsMatch (_In_ PPCI_PDO_EXTENSION PdoExtension, _In_ PPCI_DEVICE_PRESENCE_PARAMETERS Parameters) |
| | Compares one child against the fields selected by the search flags.
|
| |
| static BOOLEAN NTAPI | devpresent_SearchBus (_In_ PPCI_FDO_EXTENSION FdoExtension, _In_opt_ PPCI_SLOT_NUMBER Slot, _In_ PPCI_DEVICE_PRESENCE_PARAMETERS Parameters) |
| | Searches the children of one bus.
|
| |
| static BOOLEAN NTAPI | devpresent_SearchAllBuses (_In_ PPCI_DEVICE_PRESENCE_PARAMETERS Parameters) |
| | Searches every PCI bus in the machine.
|
| |
| static BOOLEAN NTAPI | devpresent_IsDevicePresent (_In_ USHORT VendorID, _In_ USHORT DeviceID, _In_ UCHAR RevisionID, _In_ USHORT SubVendorID, _In_ USHORT SubSystemID, _In_ ULONG Flags) |
| |
| static BOOLEAN NTAPI | devpresent_FlagsValid (_In_ ULONG Flags) |
| | Checks that the search flags name the device by IDs, class, or both. Subsystem and revision refine an ID match, programming interface refines a class match.
|
| |
| static BOOLEAN NTAPI | devpresent_IsDevicePresentEx (_In_ PVOID Context, _In_ PPCI_DEVICE_PRESENCE_PARAMETERS Parameters) |
| |
| NTSTATUS NTAPI | devpresent_Constructor (IN PVOID DeviceExtension, IN PVOID Instance, IN PVOID InterfaceData, IN USHORT Version, IN USHORT Size, IN PINTERFACE Interface) |
| |
◆ NDEBUG
◆ devpresent_Constructor()
Definition at line 270 of file devhere.c.
276{
280
284
285
286 HasEx = (
Size >=
sizeof(*PresentInterface));
287
289 if (HasEx)
291
294 PresentInterface->
Context = DeviceExtension;
296 PresentInterface->
Size = (
USHORT)(HasEx ?
sizeof(*PresentInterface) :
298
300}
static BOOLEAN NTAPI devpresent_IsDevicePresent(_In_ USHORT VendorID, _In_ USHORT DeviceID, _In_ UCHAR RevisionID, _In_ USHORT SubVendorID, _In_ USHORT SubSystemID, _In_ ULONG Flags)
static VOID NTAPI devpresent_Dereference(_In_ PVOID Context)
static BOOLEAN NTAPI devpresent_IsDevicePresentEx(_In_ PVOID Context, _In_ PPCI_DEVICE_PRESENCE_PARAMETERS Parameters)
static VOID NTAPI devpresent_Reference(_In_ PVOID Context)
#define UNREFERENCED_PARAMETER(P)
PINTERFACE_REFERENCE InterfaceReference
PINTERFACE_DEREFERENCE InterfaceDereference
PPCI_IS_DEVICE_PRESENT_EX IsDevicePresentEx
PPCI_IS_DEVICE_PRESENT IsDevicePresent
#define FIELD_OFFSET(t, f)
_In_ UCXUSBDEVICE _In_ ULONG Interface
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID _Out_ PINTERFACE _In_ USHORT _In_ USHORT Version
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_opt_ WDFWMIINSTANCE * Instance
#define PCI_DEVICE_PRESENT_INTERFACE_VERSION
struct _PCI_DEVICE_PRESENT_INTERFACE * PPCI_DEVICE_PRESENT_INTERFACE
◆ devpresent_Dereference()
Definition at line 57 of file devhere.c.
59{
61
63}
#define InterlockedDecrement
_In_ PIRP _In_ PIO_COMPLETION_ROUTINE _In_ PVOID Context
Referenced by devpresent_Constructor().
◆ devpresent_FlagsValid()
Checks that the search flags name the device by IDs, class, or both. Subsystem and revision refine an ID match, programming interface refines a class match.
Definition at line 215 of file devhere.c.
217{
219
224
226 ((
Flags & Needed) == Needed);
227}
_In_ D3DDDI_VIDEO_PRESENT_TARGET_ID _In_ ULONG _In_ ULONG Flags
#define PCI_USE_VENDEV_IDS
#define PCI_USE_CLASS_SUBCLASS
#define PCI_USE_SUBSYSTEM_IDS
Referenced by devpresent_IsDevicePresentEx().
◆ devpresent_Initializer()
Definition at line 35 of file devhere.c.
36{
38
39 ASSERTMSG(
"PCI devpresent_Initializer, unexpected call.\n",
FALSE);
41}
#define ASSERTMSG(msg, exp)
#define STATUS_UNSUCCESSFUL
◆ devpresent_IsDevicePresent()
Definition at line 182 of file devhere.c.
189{
192
200
201
204
206}
_In_ HANDLE _In_ CONST PDXGKMDT_OPM_GET_INFO_PARAMETERS Parameters
static BOOLEAN NTAPI devpresent_SearchAllBuses(_In_ PPCI_DEVICE_PRESENCE_PARAMETERS Parameters)
Searches every PCI bus in the machine.
#define RtlZeroMemory(Destination, Length)
_Must_inspect_result_ _In_ PWDFDEVICE_INIT _In_ PCUNICODE_STRING DeviceID
_In_ USHORT _In_ UCHAR _In_ USHORT _In_ USHORT SubSystemID
_In_ USHORT _In_ UCHAR RevisionID
_In_ USHORT _In_ UCHAR _In_ USHORT SubVendorID
Referenced by devpresent_Constructor().
◆ devpresent_IsDevicePresentEx()
Definition at line 232 of file devhere.c.
235{
239
243 {
245 }
246
248 {
249 case 0:
251
253 break;
254
255 default:
258 break;
259 }
260
261
264
266}
static BOOLEAN NTAPI devpresent_SearchBus(_In_ PPCI_FDO_EXTENSION FdoExtension, _In_opt_ PPCI_SLOT_NUMBER Slot, _In_ PPCI_DEVICE_PRESENCE_PARAMETERS Parameters)
Searches the children of one bus.
static BOOLEAN NTAPI devpresent_FlagsValid(_In_ ULONG Flags)
Checks that the search flags name the device by IDs, class, or both. Subsystem and revision refine an...
#define PCI_USE_LOCAL_DEVICE
#define PCI_USE_LOCAL_BUS
Referenced by devpresent_Constructor().
◆ devpresent_IsMatch()
Compares one child against the fields selected by the search flags.
Definition at line 71 of file devhere.c.
74{
76
77
80
84 {
86 }
87
91 {
93 }
94
97 {
99 }
100
104 {
106 }
107
110 {
112 }
113
115}
Referenced by devpresent_SearchBus().
◆ devpresent_Reference()
◆ devpresent_SearchAllBuses()
Searches every PCI bus in the machine.
Definition at line 156 of file devhere.c.
158{
162
165
168 {
171 }
172
175
177}
SINGLE_LIST_ENTRY PciFdoExtensionListHead
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
struct _PCI_FDO_EXTENSION * PPCI_FDO_EXTENSION
#define KeWaitForSingleObject(pEvt, foo, a, b, c)
#define KeSetEvent(pEvt, foo, foo2)
#define KeLeaveCriticalRegion()
#define KeEnterCriticalRegion()
struct _SINGLE_LIST_ENTRY * Next
Referenced by devpresent_IsDevicePresent(), and devpresent_IsDevicePresentEx().
◆ devpresent_SearchBus()
Searches the children of one bus.
- Parameters
-
| Slot | When not NULL, only functions of the device in this slot are checked. |
Definition at line 124 of file devhere.c.
128{
131
134
136 {
137 if (Slot && (
Child->Slot.u.bits.DeviceNumber != Slot->u.bits.DeviceNumber))
138 continue;
139
141 break;
142 }
143
146
148}
static BOOLEAN NTAPI devpresent_IsMatch(_In_ PPCI_PDO_EXTENSION PdoExtension, _In_ PPCI_DEVICE_PRESENCE_PARAMETERS Parameters)
Compares one child against the fields selected by the search flags.
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFDEVICE Child
Referenced by devpresent_IsDevicePresentEx(), and devpresent_SearchAllBuses().
◆ PciDevicePresentInterface
Initial value:=
{
&GUID_PCI_DEVICE_PRESENT_INTERFACE,
0,
}
#define PCI_INTERFACE_PDO
@ PciInterface_DevicePresent
NTSTATUS NTAPI devpresent_Constructor(IN PVOID DeviceExtension, IN PVOID Instance, IN PVOID InterfaceData, IN USHORT Version, IN USHORT Size, IN PINTERFACE Interface)
NTSTATUS NTAPI devpresent_Initializer(IN PVOID Instance)
Definition at line 18 of file devhere.c.
Referenced by PdoQueryInterface(), and VideoPortCheckForDeviceExistence().