33#include "FxDriverUm.tmh"
42 _In_ IWudfDeviceStack * DevStack,
78 _In_ IWudfDeviceStack * DevStack,
93 "Enter AddDevice DevStack %p", DevStack);
109 init.DevStack = DevStack;
110 init.DriverID = DriverID;
122 "Registry key open failed for the PDO key, "
123 "winerror %!WINERROR!", lRetVal);
133 "Registry path string too long or badly formed "
134 "path. Invalid configuration HRESULT %!hresult!",
141 if (
NULL ==
init.ConfigRegistryPath) {
144 "Failed to allocate memory for Config path"
145 " HRESULT %!hresult!",
hr);
153 "Failed to copy the configuration path status "
165 "Device Instance ID string too long or badly formed"
166 " path. Invalid configuration %!hresult!",
hr);
174 "Failed to allocate memory for DevInstanceID "
183 "Unable to copy DevInstanceID %!hresult!",
hr);
194 "Unable to determine KernelDeviceName length"
201 if (
init.KernelDeviceName ==
NULL) {
203 "Failed to allocate memory for KernelDeviceName "
212 "Unable to copy kernel device name KernelDeviceName"
229 "Driver did not create a device in "
230 "EvtDriverAddDevice, status %!STATUS!",
status);
239 "Filter returned %!STATUS! without creating a WDFDEVICE, "
240 "converting to STATUS_SUCCESS",
status);
269 "Exit, status %!STATUS!",
status);
297FxDriver::ClearDriverObjectFxDriver(
303 if (pDriverObj !=
NULL) {
309FxDriver::OpenParametersKey(
320 UMINT::WDF_PROPERTY_STORE_ROOT rootSpecifier;
321 UMINT::WDF_PROPERTY_STORE_RETRIEVE_FLAGS
flags;
331 rootSpecifier.LengthCb =
sizeof(UMINT::WDF_PROPERTY_STORE_ROOT);
332 rootSpecifier.RootClass = UMINT::WdfPropertyStoreRootDriverParametersKey;
333 rootSpecifier.Qualifier.ParametersKey.ServiceName = serviceNameW.Buffer;
335 flags = UMINT::WdfPropertyStoreCreateIfMissing;
337 hr =
pDevStack->CreateRegistryEntry(&rootSpecifier,
345 m_DriverParametersKey =
hKey;
static WCHAR ServiceName[]
__inline BOOLEAN IsPnp(VOID)
WDF_DEVICE_PNP_STATE m_CurrentPnpState
static NTSTATUS NtStatusFromHr(_In_ IWudfDeviceStack *DevStack, _In_ HRESULT Hr)
VOID FinishInitializing(VOID)
_Must_inspect_result_ NTSTATUS DeleteDeviceFromFailedCreate(__in NTSTATUS FailedStatus, __in BOOLEAN UseStateMachine)
_Must_inspect_result_ NTSTATUS Invoke(__in WDFDRIVER Driver, __in PWDFDEVICE_INIT DeviceInit)
_Must_inspect_result_ NTSTATUS AllocateDriverObjectExtensionAndStoreFxDriver(VOID)
static MdDriverAddDeviceType AddDevice
FxDriver(__in MdDriverObject DriverObject, __in PWDF_DRIVER_CONFIG DriverConfig, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
FxDriverDeviceAdd m_DriverDeviceAdd
static FxDriver * GetFxDriver(__in MdDriverObject DriverObject)
MxDriverObject m_DriverObject
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
__inline MdDriverObject GetObject(VOID)
#define NT_SUCCESS(StatCode)
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
IWudfDeviceStack * pDevStack
return pDriver GetDriverObject()
#define _Must_inspect_result_
NTSYSAPI NTSTATUS NTAPI RtlAnsiStringToUnicodeString(PUNICODE_STRING DestinationString, PANSI_STRING SourceString, BOOLEAN AllocateDestinationString)
#define KEY_CREATE_SUB_KEY
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
#define UNREFERENCED_PARAMETER(P)
#define TRACE_LEVEL_WARNING
#define TRACE_LEVEL_VERBOSE
#define TRACE_LEVEL_INFORMATION
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
STRSAFEAPI StringCchLengthW(STRSAFE_LPCWSTR psz, size_t cchMax, size_t *pcchLength)
IWudfDeviceStack2 * WudfDevStack
#define STATUS_UNSUCCESSFUL
#define DECLARE_UNICODE_STRING_SIZE(_var, _size)
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
#define WDF_DRIVER_GLOBALS_NAME_LEN
#define HRESULT_FROM_WIN32(x)