ReactOS 0.4.15-dev-7834-g00c4b3d
pcivrify.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS PCI Bus Driver
3 * LICENSE: BSD - See COPYING.ARM in the top level directory
4 * FILE: drivers/bus/pci/pcivrify.c
5 * PURPOSE: PCI Driver Verifier Support
6 * PROGRAMMERS: ReactOS Portable Systems Group
7 */
8
9/* INCLUDES *******************************************************************/
10
11#include <pci.h>
12
13#define NDEBUG
14#include <debug.h>
15
16/* GLOBALS ********************************************************************/
17
20
22{
23 {
24 1,
26 0,
27 "The BIOS has reprogrammed the bus numbers of an active PCI device "
28 "(!devstack %DevObj) during a dock or undock!"
29 },
30 {
31 2,
33 0,
34 "A device in the system did not update it's PMCSR register in the spec "
35 "mandated time (!devstack %DevObj, Power state D%Ulong)"
36 },
37 {
38 3,
40 0,
41 "A driver controlling a PCI device has tried to access OS controlled "
42 "configuration space registers (!devstack %DevObj, Offset 0x%Ulong1, "
43 "Length 0x%Ulong2)"
44 },
45 {
46 4,
48 0,
49 "A driver controlling a PCI device has tried to read or write from an "
50 "invalid space using IRP_MN_READ/WRITE_CONFIG or via BUS_INTERFACE_STANDARD."
51 " NB: These functions take WhichSpace parameters of the form PCI_WHICHSPACE_*"
52 " and not a BUS_DATA_TYPE (!devstack %DevObj, WhichSpace 0x%Ulong1)"
53 },
54};
55
56/* FUNCTIONS ******************************************************************/
57
61{
62 PPCI_VERIFIER_DATA VerifierData;
63
64 /* Scan the verifier failure table for this code */
65 VerifierData = PciVerifierFailureTable;
66 while (VerifierData->FailureCode != FailureCode)
67 {
68 /* Keep searching */
69 ++VerifierData;
71 }
72
73 /* Return the entry for this code */
74 return VerifierData;
75}
76
77DRIVER_NOTIFICATION_CALLBACK_ROUTINE PciVerifierProfileChangeCallback;
78
83{
86
87 /* This function is not yet implemented */
89 return STATUS_SUCCESS;
90}
91
92VOID
95{
97
98 /* Check if the kernel driver verifier is enabled */
100 {
101 /* Register a notification for changes, to keep track of the PCI tree */
103 0,
104 NULL,
107 NULL,
110 }
111}
112
113/* EOF */
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define PCI_VERIFIER_CODES
Definition: pci.h:82
#define UNIMPLEMENTED_DBGBREAK(...)
Definition: debug.h:57
Status
Definition: gdiplustypes.h:25
#define ASSERT(a)
Definition: mode.c:44
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
BOOLEAN NTAPI VfIsVerificationEnabled(IN VF_OBJECT_TYPE VfObjectType, IN PVOID Object OPTIONAL)
Definition: driver.c:22
VOID NTAPI PciVerifierInit(IN PDRIVER_OBJECT DriverObject)
Definition: pcivrify.c:94
DRIVER_NOTIFICATION_CALLBACK_ROUTINE PciVerifierProfileChangeCallback
Definition: pcivrify.c:77
PPCI_VERIFIER_DATA NTAPI PciVerifierRetrieveFailureData(IN ULONG FailureCode)
Definition: pcivrify.c:60
PCI_VERIFIER_DATA PciVerifierFailureTable[PCI_VERIFIER_CODES]
Definition: pcivrify.c:21
PVOID PciVerifierNotificationHandle
Definition: pcivrify.c:19
BOOLEAN PciVerifierRegistered
Definition: pcivrify.c:18
NTSTATUS NTAPI IoRegisterPlugPlayNotification(_In_ IO_NOTIFICATION_EVENT_CATEGORY EventCategory, _In_ ULONG EventCategoryFlags, _In_opt_ PVOID EventCategoryData, _In_ PDRIVER_OBJECT DriverObject, _In_ PDRIVER_NOTIFICATION_CALLBACK_ROUTINE CallbackRoutine, _Inout_opt_ PVOID Context, _Out_ PVOID *NotificationEntry)
Definition: pnpnotify.c:345
#define STATUS_SUCCESS
Definition: shellext.h:65
ULONG FailureCode
Definition: pci.h:415
#define NTAPI
Definition: typedefs.h:36
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
@ VFFAILURE_FAIL_LOGO
Definition: vftypes.h:33
@ VFFAILURE_FAIL_UNDER_DEBUGGER
Definition: vftypes.h:34
@ VFOBJTYPE_SYSTEM_BIOS
Definition: vftypes.h:44
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_In_ PVOID NotificationStructure
Definition: iofuncs.h:1206
@ EventCategoryHardwareProfileChange
Definition: iotypes.h:1225