MCPcopy Create free account
hub / github.com/NullArray/WinKernel-Resources / DriverEntry

Function DriverEntry

Drivers/Driver-SRC/elam/elamsample.c:48–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46 BdCbStatusPrepareForDependencyLoad;
47
48NTSTATUS
49DriverEntry(
50 _In_ PDRIVER_OBJECT DriverObject,
51 _In_ PUNICODE_STRING RegistryPath
52 )
53/*++
54
55Routine Description:
56
57 This routine is called by the Operating System to initialize the driver.
58
59 It creates the device object, fills in the dispatch entry points and
60 completes the initialization.
61
62Arguments:
63
64 DriverObject - Supplies a pointer to the object that represents this device
65 driver.
66
67 RegistryPath - Supplies a pointer to the Services key in the registry.
68
69Return Value:
70
71 STATUS_SUCCESS if initialized successfully.
72
73 Error status if the driver could not be initialized.
74
75--*/
76{
77 WDF_OBJECT_ATTRIBUTES Attributes;
78 WDF_DRIVER_CONFIG Config;
79 WDFDRIVER Driver;
80 NTSTATUS Status;
81
82 DbgPrintEx(DPFLTR_IHVDRIVER_ID,
83 ELAMSAMPLE_TRACE_LEVEL,
84 "ElamSample is being initialized.\r\n");
85
86 //
87 // Initialize a non-PnP driver with the framework.
88 //
89
90 WDF_DRIVER_CONFIG_INIT(&Config, WDF_NO_EVENT_CALLBACK);
91
92 Config.DriverInitFlags |= WdfDriverInitNonPnpDriver;
93
94 //
95 // Non-PnP drivers must register an unload routine.
96 //
97
98 Config.EvtDriverUnload = ElamSampleEvtDriverUnload;
99
100 //
101 // Create a framework driver object.
102 //
103
104 WDF_OBJECT_ATTRIBUTES_INIT(&Attributes);
105

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected