21#include "../../fxtargetsshared.hpp"
77 "WDFIOTARGET %p: query remove, default action (close for QR)",
90 "WDFIOTARGET %p: remove complete notification", pThis->
GetObjectHandle());
102 "WDFIOTARGET %p: remove complete, default action (close)",
111 else if (
FxIsEqualGuid(&pNotification->
Event, &GUID_TARGET_DEVICE_REMOVE_CANCELLED)) {
115 "WDFIOTARGET %p: remove canceled notification", pThis->
GetObjectHandle());
125 "WDFIOTARGET %p: remove canceled, default action (reopen)",
213 &pParams->TargetDeviceName,
219 pParams->DesiredAccess,
222 pParams->AllocationSizePointer,
223 pParams->FileAttributes,
224 pParams->ShareAccess,
225 pParams->CreateDisposition,
226 pParams->CreateOptions,
228 pParams->EaBufferLength);
235 "ZwCreateFile for WDFIOTARGET %p returned status %!STATUS!, info 0x%x",
244 pParams->DesiredAccess,
256 "WDFIOTARGET %p, could not convert filobj %p to devobj",
265 "WDFIOTARGET %p, could not convert handle %p to fileobject, "
273 "ZwCreateFile for WDFIOTARGET %p returned status %!STATUS!, info 0x%x",
345 "Unable to allocate memory for IRP WDFIOTARGET %p, %!STATUS!",
__inline MdDriverObject GetDriverObject(VOID)
FxIoTargetRemoveComplete m_EvtRemoveComplete
_Must_inspect_result_ NTSTATUS Open(__in PWDF_IO_TARGET_OPEN_PARAMS OpenParams)
__inline WDFIOTARGET GetHandle(VOID)
FxIoTargetQueryRemove m_EvtQueryRemove
NTSTATUS GetTargetDeviceRelations(_Out_ BOOLEAN *Close)
VOID UnregisterForPnpNotification(_In_ MdTargetNotifyHandle Handle)
MdTargetNotifyHandle m_TargetNotifyHandle
VOID Close(__in FxIoTargetRemoteCloseReason Reason)
NTSTATUS RegisterForPnpNotification(VOID)
FxIoTargetRemoveCanceled m_EvtRemoveCanceled
NTSTATUS OpenTargetHandle(_In_ PWDF_IO_TARGET_OPEN_PARAMS OpenParams, _Inout_ FxIoTargetRemoveOpenParams *pParams)
static DRIVER_NOTIFICATION_CALLBACK_ROUTINE _PlugPlayNotification
MdDeviceObject m_TargetDevice
MdDeviceObject m_TargetPdo
MdFileObject m_TargetFileObject
CHECK_RETURN_IF_USER_MODE NTSTATUS SendIrpSynchronously(__in MdDeviceObject DeviceObject)
VOID SetStatus(__in NTSTATUS Status)
PIO_STACK_LOCATION GetNextIrpStackLocation(VOID)
ULONG_PTR GetInformation()
PVOID __inline GetObjectHandle(VOID)
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
static __inline KIRQL MxGetCurrentIrql()
#define STATUS_NOT_SUPPORTED
#define NT_SUCCESS(StatCode)
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
PFX_DRIVER_GLOBALS pFxDriverGlobals
return pObject GetObjectHandle()
_Must_inspect_result_ BOOLEAN __inline FxIsEqualGuid(__in CONST GUID *Lhs, __in CONST GUID *Rhs)
PDEVICE_OBJECT pTopOfStack
@ FxIoTargetRemoteCloseReasonPlainClose
@ FxIoTargetRemoteCloseReasonQueryRemove
GLenum const GLfloat * params
#define OBJ_KERNEL_HANDLE
POBJECT_TYPE IoFileObjectType
#define InitializeObjectAttributes(p, n, a, r, s)
#define _Must_inspect_result_
PDEVICE_OBJECT NTAPI IoGetRelatedDeviceObject(IN PFILE_OBJECT FileObject)
PDEVICE_OBJECT NTAPI IoGetAttachedDeviceReference(PDEVICE_OBJECT DeviceObject)
PIRP NTAPI IoAllocateIrp(IN CCHAR StackSize, IN BOOLEAN ChargeQuota)
NTSTATUS NTAPI ObReferenceObjectByHandle(IN HANDLE Handle, IN ACCESS_MASK DesiredAccess, IN POBJECT_TYPE ObjectType, IN KPROCESSOR_MODE AccessMode, OUT PVOID *Object, OUT POBJECT_HANDLE_INFORMATION HandleInformation OPTIONAL)
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)
NTSTATUS NTAPI IoUnregisterPlugPlayNotification(_In_ PVOID NotificationEntry)
FxLibraryGlobalsType FxLibraryGlobals
#define TRACE_LEVEL_WARNING
#define TRACE_LEVEL_VERBOSE
#define TRACE_LEVEL_ERROR
PFN_WDF_IO_TARGET_QUERY_REMOVE m_Method
_Must_inspect_result_ NTSTATUS Invoke(__in WDFIOTARGET IoTarget)
VOID Invoke(__in WDFIOTARGET Target)
PFN_WDF_IO_TARGET_REMOVE_CANCELED m_Method
PFN_WDF_IO_TARGET_REMOVE_COMPLETE m_Method
VOID Invoke(__in WDFIOTARGET Target)
PFN_IO_UNREGISTER_PLUGPLAY_NOTIFICATION_EX IoUnregisterPlugPlayNotificationEx
PDEVICE_OBJECT Objects[1]
#define STATUS_NO_SUCH_DEVICE
#define STATUS_INSUFFICIENT_RESOURCES
_Must_inspect_result_ _In_ WDFIOTARGET _In_ PWDF_IO_TARGET_OPEN_PARAMS OpenParams
FORCEINLINE VOID WDF_IO_TARGET_OPEN_PARAMS_INIT_REOPEN(_Out_ PWDF_IO_TARGET_OPEN_PARAMS Params)
_In_ PVOID NotificationStructure
struct _DEVICE_RELATIONS * PDEVICE_RELATIONS
#define IRP_MN_QUERY_DEVICE_RELATIONS
@ EventCategoryTargetDeviceChange
struct _TARGET_DEVICE_REMOVAL_NOTIFICATION * PTARGET_DEVICE_REMOVAL_NOTIFICATION
#define ObDereferenceObject