ReactOS 0.4.15-dev-7958-gcd0bb1a
fxiotargetremote.cpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5Module Name:
6
7 FxIoTargetRemote.cpp
8
9Abstract:
10
11Author:
12
13Environment:
14
15 Both kernel and user mode
16
17Revision History:
18
19--*/
20
21#include "../fxtargetsshared.hpp"
22
23extern "C" {
24// #include "FxIoTargetRemote.tmh"
25}
26
27#include <initguid.h>
28#include "wdmguid.h"
29
30
32 __in PFX_DRIVER_GLOBALS FxDriverGlobals
33 ) :
34 FxIoTarget(FxDriverGlobals, sizeof(FxIoTargetRemote)),
35 m_EvtQueryRemove(FxDriverGlobals),
36 m_EvtRemoveCanceled(FxDriverGlobals),
37 m_EvtRemoveComplete(FxDriverGlobals)
38{
39
40 //
41 // No automatic state changes based on the pnp state changes of our own
42 // device stack. The one exception is remove where we need to shut
43 // everything down.
44 //
46
49
51
55
56#if (FX_CORE_MODE == FX_CORE_KERNEL_MODE)
58#elif (FX_CORE_MODE == FX_CORE_USER_MODE)
59 m_TargetNotifyHandle = WUDF_TARGET_CONTEXT_INVALID;
60
61 m_pIoDispatcher = NULL;
62 m_pRemoteDispatcher = NULL;
63 m_NotificationCallback = NULL;
64#endif
65}
66
68{
69}
70
74 __in PFX_DRIVER_GLOBALS FxDriverGlobals,
78 )
79{
82 WDFOBJECT hTarget;
84
85 *Target = NULL;
86
87 if (Attributes == NULL || Attributes->ParentObject == NULL) {
89 }
90 else {
91 CfxDeviceBase* pSearchDevice;
92
93 FxObjectHandleGetPtr(FxDriverGlobals,
94 Attributes->ParentObject,
96 (PVOID*) &pParent);
97
99
100 if (pSearchDevice == NULL) {
102
104 FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGIOTARGET,
105 "Attributes->ParentObject 0x%p must have WDFDEVICE as an "
106 "eventual ancestor, %!STATUS!",
107 Attributes->ParentObject, status);
108
109 return status;
110 }
111 else if (pSearchDevice != Device) {
113
115 FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGIOTARGET,
116 "Attributes->ParentObject 0x%p ancestor is WDFDEVICE %p, but "
117 "not the same WDFDEVICE 0x%p passed to WdfIoTargetCreate, "
118 "%!STATUS!",
119 Attributes->ParentObject, pSearchDevice->GetHandle(),
120 Device->GetHandle(), status);
121
122 return status;
123 }
124 }
125
126 pTarget = new (FxDriverGlobals, Attributes)
127 FxIoTargetRemote(FxDriverGlobals);
128
129 if (pTarget == NULL) {
132 FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGIOTARGET,
133 "Could not allocate memory for target, %!STATUS!", status);
134 return status;
135 }
136
137 //
138 // initialize the new target
139 //
140 status = pTarget->InitRemote(Device);
141 if (!NT_SUCCESS(status)) {
142 return status;
143 }
144
145 //
146 // Commit and apply the attributes
147 //
148 status = pTarget->Commit(Attributes, &hTarget, pParent);
149
150 if (NT_SUCCESS(status)) {
151 *Target = pTarget;
152 }
153 else {
154 //
155 // This will properly clean up the target's state and free it
156 //
158 FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGIOTARGET,
159 "Commit failed for target, %!STATUS!", status);
161 }
162
163 return status;
164}
165
169 )
170{
172
173 //
174 // do the base class mode-specific initialization
175 //
176 status = FxIoTarget::InitModeSpecific(Device); // __super call
177 if (!NT_SUCCESS(status)) {
178 return status;
179 }
180
181 //
182 // Do mode-specific initilialization
183 //
185 if (!NT_SUCCESS(status)) {
186 return status;
187 }
188
189 m_Driver = Device->GetDriver();
190
192 m_InStackDevice = Device->GetDeviceObject();
193
194 (void) Device->AddIoTarget(this);
195
196 return STATUS_SUCCESS;
197}
198
203 )
204{
207 LIST_ENTRY pended;
210 BOOLEAN close, reopen;
211 PVOID pEa;
212 ULONG eaLength;
213 KIRQL irql;
214
215 RtlZeroMemory(&name, sizeof(name));
216 close = FALSE;
217 reopen = OpenParams->Type == WdfIoTargetOpenReopen ? TRUE : FALSE;
218
219 pEa = NULL;
220 eaLength = 0;
221
222 //
223 // We only support reopening using stored settings when we open by name
224 //
229 "Reopen only supported if the open type is WdfIoTargetOpenByName WDFIOTARGET %p %!STATUS!",
231 return status;
232 }
233
234 //
235 // Must preallocate all settings now
236 //
237 if (reopen) {
238 //
239 // convert the type into the type used for the previous open
240 //
242 pParams = &m_OpenParams;
243 }
244 else {
245 type = OpenParams->Type;
246 pParams = &params;
247
248 if (OpenParams->Type == WdfIoTargetOpenByName) {
249
251 &OpenParams->TargetDeviceName,
252 &name);
253 if (!NT_SUCCESS(status)) {
256 "Could not allocate memory for target name for WDFIOTARGET %p",
258 goto Done;
259 }
260 if (OpenParams->EaBuffer != NULL && OpenParams->EaBufferLength > 0) {
261
262 pEa = FxPoolAllocate(GetDriverGlobals(),
263 PagedPool,
264 OpenParams->EaBufferLength);
265
266 if (pEa == NULL) {
269 "Could not allocate memory for target name "
270 "for WDFIOTARGET %p", GetObjectHandle());
272 goto Done;
273 }
274 else {
275 eaLength = OpenParams->EaBufferLength;
276 RtlCopyMemory(pEa, OpenParams->EaBuffer, eaLength);
277 }
278 }
279 }
280 }
281
282 Lock(&irql);
283
287 "Opening WDFIOTARGET %p which is removed, state %d",
290 }
292 //
293 // We are either open or are opening
294 //
297 "Opening an already open WDFIOTARGET %p, open state %d",
300 }
301 else {
304 "Opening WDFIOTARGET %p", GetObjectHandle());
305
306 //
307 // Clear the event so that if something is waiting on the state
308 // transition, they will block until we are done.
309 //
311
314 }
315 Unlock(irql);
316
317 if (!NT_SUCCESS(status)) {
318 goto Done;
319 }
320
325
326 //
327 // m_TargetNotifyHandle can be a valid value if the caller has previously
328 // opened the target, received a query remove, then a cancel remove, and
329 // is now reopening the target.
330 //
333
334 //
335 // Only clear the open parameters if we are not attempting a reopen.
336 //
337 if (reopen == FALSE) {
339 }
340
341 switch (type) {
344
345 //
346 // OpenParams must be non NULL b/c we can't reopen a target with a
347 // previous device object.
348 //
350
351 m_TargetDevice = (MdDeviceObject) OpenParams->TargetDeviceObject;
352 m_TargetFileObject = (MdFileObject) OpenParams->TargetFileObject;
354
355 //
356 // By taking a manual reference here, we simplify the code in
357 // FxIoTargetRemote::Close where we can assume there is an outstanding
358 // reference on the PFILE_OBJECT at all times as long as we have a non
359 // NULL pointer.
360 //
361 if (m_TargetFileObject != NULL) {
363 }
364
366
367 break;
368
371
373 break;
374
376 //
377 // Only capture the open parameters if we are not reopening.
378 //
379 if (reopen == FALSE) {
380 pParams->Set(OpenParams, &name, pEa, eaLength);
381 }
382
384 if (NT_SUCCESS(status)) {
385 if (reopen == FALSE) {
386 m_OpenParams.Set(OpenParams, &name, pEa, eaLength);
387
388 //
389 // Setting pEa to NULL stops it from being freed later.
390 // Zeroing out name stops it from being freed later.
391 //
392 pEa = NULL;
393 RtlZeroMemory(&name, sizeof(name));
394 }
395 }
396 else {
397 close = TRUE;
398 }
399 break;
400 }
401
402 InitializeListHead(&pended);
403
404 //
405 // Get Target file object for KMDF. Noop for UMDF.
406 //
407 if (NT_SUCCESS(status)) {
409 }
410
412 if (reopen == FALSE) {
413 //
414 // Set the values before the register so that if a notification
415 // comes in before the register returns, we have a function to call.
416 //
417 m_EvtQueryRemove.m_Method = OpenParams->EvtIoTargetQueryRemove;
418 m_EvtRemoveCanceled.m_Method = OpenParams->EvtIoTargetRemoveCanceled;
419 m_EvtRemoveComplete.m_Method = OpenParams->EvtIoTargetRemoveComplete;
420 }
421
423
424 //
425 // Even if we can't register, we still are successful in opening
426 // up the device and we will proceed from there.
427 //
428 if (!NT_SUCCESS(status)) {
431 "WDFIOTARGET %p, could not register pnp notification, %!STATUS! not "
432 "treated as an error", GetObjectHandle(), status);
433
437
439 }
440 }
441
442 //
443 // UMDF only. Bind handle to remote dispatcher.
444 //
445#if (FX_CORE_MODE == FX_CORE_USER_MODE)
447 status = BindToHandle();
448 if (!NT_SUCCESS(status)) {
449 close = TRUE;
450 }
451 }
452#endif
453
454 Lock(&irql);
455
456 if (NT_SUCCESS(status)) {
457
458#if (FX_CORE_MODE == FX_CORE_KERNEL_MODE)
461#endif
462
464
465 //
466 // Set our state to started. This will also resend any pended requests
467 // due to a query remove.
468 //
469 status = GotoStartState(&pended, FALSE);
470
471 //
472 // We could not successfully start, close back down
473 //
474 if (!NT_SUCCESS(status)) {
477 "WDFIOTARGET %p could not transition to started state, %!STATUS!",
479
480 close = TRUE;
481 }
482 }
483 else {
485 }
486
487 //
488 // No matter what, indicate to any waiters that our state change has
489 // completed.
490 //
492
493 Unlock(irql);
494
495Done:
496 //
497 // Resubmit any reads that were pended until now.
498 //
499 if (NT_SUCCESS(status)) {
500 SubmitPendedRequests(&pended);
501 }
502 else if (close) {
504 }
505
506 if (name.Buffer != NULL) {
507 FxPoolFree(name.Buffer);
508 }
509
510 if (pEa != NULL) {
511 FxPoolFree(pEa);
512 }
513
514 return status;
515}
516
517
518VOID
521 )
522{
524 MdTargetNotifyHandle pNotifyHandle;
526 LIST_ENTRY pended;
527 WDF_IO_TARGET_STATE removeState;
528 KIRQL irql;
529 BOOLEAN wait;
531
534 "enter: WDFIOTARGET %p, reason %d", GetObjectHandle(), Reason);
535
536 RtlZeroMemory(&pointers, sizeof(pointers));
537 pNotifyHandle = NULL;
538
539 sent.Next = NULL;
540 InitializeListHead(&pended);
541
542 wait = FALSE;
543
544 //
545 // Pick a value that is not used anywhere in the function and make sure that
546 // we have changed it, before we go to the Remove state
547 //
548#pragma prefast(suppress: __WARNING_UNUSED_SCALAR_ASSIGNMENT, "PFD is warning that the following assignement is unused. Suppress it to prevent changing any logic.")
549 removeState = WdfIoTargetStarted;
550
552 Lock(&irql);
553
554 //
555 // If we are in the process of opening the target, wait for that to finish.
556 //
558 Unlock(irql);
559
562 "Closing WDFIOTARGET %p which is opening, waiting on event %p",
564
566
567 //
568 // Jump back to the top and recheck
569 //
570 goto CheckState;
571 }
572
576 "Closing WDFIOTARGET %p, reason: delete", GetObjectHandle());
577
578 removeState = WdfIoTargetDeleted;
579 }
584 "Closing WDFIOTARGET %p, reason: query remove",
586 //
587 // Not really being removed, but that is what the API name is...
588 //
590 }
591 else {
592
595 "Closing WDFIOTARGET %p, reason: close", GetObjectHandle());
596
598 removeState = WdfIoTargetClosed;
599 }
600 else {
602 }
603 }
604
605 //
606 // Either way, we are no longer open for business
607 //
609 }
610 else {
613 "Closing WDFIOTARGET %p which is not open", GetObjectHandle());
614
615 //
616 // We are not opened, so treat this as a cleanup
617 //
618 removeState = WdfIoTargetClosed;
619 }
620
623 "WDFIOTARGET %p: fileobj %p, devobj %p, handle %p, notify handle %I64d",
626
628 //
629 // If we are closing for a query remove, we want to keep the handle
630 // around so that we can be notified of the final close or if the close
631 // was canceled.
632 //
633 pNotifyHandle = m_TargetNotifyHandle;
635 }
636
637 ASSERT(removeState != WdfIoTargetStarted);
638 m_ClearedPointers = &pointers;
639 GotoRemoveState(removeState, &pended, &sent, FALSE, &wait);
640
641 Unlock(irql);
642
643 UnregisterForPnpNotification(pNotifyHandle);
644
645 //
646 // Complete any requests we might have pulled off of our lists
647 //
650
651 //
652 // We were just removed, wait for any I/O to complete back if necessary.
653 //
654 if (wait) {
657 "WDFIOTARGET %p, waiting for stop to complete", GetObjectHandle());
658
660 }
661
662 switch (Reason) {
664 //
665 // m_OpenParams is needed for reopen on canceled query remove
666 //
667 DO_NOTHING();
668 break;
669
672 break;
673
674 default:
675 //
676 // If this object is not about to be deleted, we need to revert some
677 // of the state that just changed.
678 //
680 break;
681 }
682
683 if (removeState == WdfIoTargetDeleted) {
685 }
686
687 //
688 // Finally, close down our handle and pointers
689 //
690 if (pointers.TargetPdo != NULL) {
693 "WDFIOTARGET %p derefing PDO %p on close",
694 GetObjectHandle(), pointers.TargetPdo);
695
697 }
698
699 if (pointers.TargetFileObject != NULL) {
702 "WDFIOTARGET %p derefing FileObj %p on close",
705
706#if (FX_CORE_MODE == FX_CORE_USER_MODE)
707 CloseWdfFileObject(pointers.TargetFileObject);
708#endif
709 }
710
711#if (FX_CORE_MODE == FX_CORE_USER_MODE)
712 UnbindHandle(&pointers);
713#endif
714
715 if (pointers.TargetHandle != NULL) {
718 "WDFIOTARGET %p closing handle %p on close",
719 GetObjectHandle(), pointers.TargetHandle);
720 Mx::MxClose(pointers.TargetHandle);
721 }
722}
723
724VOID
726 VOID
727 )
728{
731 "WDFIOTARGET %p cleared pointers %p state %!WDF_IO_TARGET_STATE!,"
732 " open state %d, pdo %p, fileobj %p, handle %p",
735
736 //
737 // Check to see if the caller who is changing state wants these pointer
738 // values before they being cleared out.
739 //
740 if (m_ClearedPointers != NULL) {
745 }
746
747 //
748 // m_TargetHandle is only an FxIoTargetRemote field, clear it now
749 //
751
752 //
753 // m_TargetPdo and m_TargetFileObject will be cleared in the following call.
754 //
755 // m_TargetNotifyHandle is not cleared in the following call and is left
756 // valid because we want to receive the notification about query remove being
757 // canceled or completing. When we receive either of those notifications,
758 // m_TargetNotifyHandle will be freed then.
759 //
760 FxIoTarget::ClearTargetPointers(); // __super call
761}
762
763VOID
765 VOID
766 )
767{
768 //
769 // Close is the same as remove in this object
770 //
772
773 //
774 // Do mode-specific work
775 //
777
778 return ;
779}
780
781VOID
783 VOID
784 )
785{
786 if (EaBuffer != NULL) {
788 }
789
792 }
793
795}
796
797VOID
801 __in PVOID Ea,
803 )
804{
806
807 EaBuffer = Ea;
809
811
812 DesiredAccess = OpenParams->DesiredAccess;
813 FileAttributes = OpenParams->FileAttributes;
814 ShareAccess = OpenParams->ShareAccess;
815 CreateDisposition = OpenParams->CreateDisposition;
816 CreateOptions = OpenParams->CreateOptions;
817
818 if (OpenParams->AllocationSize != NULL) {
819 AllocationSize.QuadPart = *(OpenParams->AllocationSize);
821 }
822 else {
824 }
825}
#define CheckState(OldState, NewState)
unsigned char BOOLEAN
unsigned long long UINT64
@ sent
Definition: SystemMenu.c:27
#define close
Definition: acwin.h:98
LONG NTSTATUS
Definition: precomp.h:26
return
Definition: dirsup.c:529
static FxDeviceBase * _SearchForDevice(__in FxObject *Object, __out_opt IFxHasCallbacks **Callbacks)
WDFDEVICE __inline GetHandle(VOID)
Definition: fxdevice.hpp:237
FxIoTargetClearedPointers * m_ClearedPointers
virtual VOID Remove(VOID)
FxIoTargetRemoveComplete m_EvtRemoveComplete
_Must_inspect_result_ NTSTATUS OpenLocalTargetByFile(_In_ PWDF_IO_TARGET_OPEN_PARAMS OpenParams)
_Must_inspect_result_ NTSTATUS Open(__in PWDF_IO_TARGET_OPEN_PARAMS OpenParams)
FxIoTargetRemote(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
FxIoTargetQueryRemove m_EvtQueryRemove
virtual VOID ClearTargetPointers(VOID)
BOOLEAN CanRegisterForPnpNotification(VOID)
VOID ResetTargetNotifyHandle(VOID)
FxIoTargetRemoveOpenParams m_OpenParams
NTSTATUS InitRemote(__in FxDeviceBase *Device)
NTSTATUS GetTargetDeviceRelations(_Out_ BOOLEAN *Close)
VOID UnregisterForPnpNotification(_In_ MdTargetNotifyHandle Handle)
MdTargetNotifyHandle m_TargetNotifyHandle
VOID Close(__in FxIoTargetRemoteCloseReason Reason)
NTSTATUS RegisterForPnpNotification(VOID)
NTSTATUS InitRemoteModeSpecific(__in FxDeviceBase *Device)
VOID RemoveModeSpecific(VOID)
FxIoTargetRemoveCanceled m_EvtRemoveCanceled
NTSTATUS OpenTargetHandle(_In_ PWDF_IO_TARGET_OPEN_PARAMS OpenParams, _Inout_ FxIoTargetRemoveOpenParams *pParams)
static _Must_inspect_result_ NTSTATUS _Create(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PWDF_OBJECT_ATTRIBUTES Attributes, __in FxDeviceBase *Device, __out FxIoTargetRemote **Target)
virtual _Must_inspect_result_ NTSTATUS GotoStartState(__in PLIST_ENTRY RequestListHead, __in BOOLEAN Lock=TRUE)
Definition: fxiotarget.cpp:306
UCHAR GetTargetIoType(VOID)
Definition: fxiotarget.hpp:631
MdDeviceObject m_TargetDevice
Definition: fxiotarget.hpp:910
MdDeviceObject m_TargetPdo
Definition: fxiotarget.hpp:918
virtual VOID WaitForDisposeEvent(VOID)
Definition: fxiotarget.cpp:124
BOOLEAN m_InStack
Definition: fxiotarget.hpp:855
UCHAR m_TargetIoType
Definition: fxiotarget.hpp:947
MdDeviceObject m_InStackDevice
Definition: fxiotarget.hpp:905
WDF_IO_TARGET_STATE m_State
Definition: fxiotarget.hpp:928
VOID SubmitPendedRequests(__in PLIST_ENTRY RequestListHeadHead)
Definition: fxiotarget.cpp:268
VOID CompletePendedRequestList(__in PLIST_ENTRY RequestListHead)
Definition: fxiotarget.cpp:520
virtual VOID ClearTargetPointers(VOID)
Definition: fxiotarget.hpp:618
FxDriver * m_Driver
Definition: fxiotarget.hpp:900
CCHAR m_TargetStackSize
Definition: fxiotarget.hpp:941
static VOID _CancelSentRequests(__in PSINGLE_LIST_ENTRY RequestListHead)
Definition: fxiotarget.cpp:550
FxCREvent m_SentIoEvent
Definition: fxiotarget.hpp:878
_Must_inspect_result_ NTSTATUS InitModeSpecific(__in CfxDeviceBase *Device)
virtual VOID GotoRemoveState(__in WDF_IO_TARGET_STATE NewState, __in PLIST_ENTRY PendedRequestListHead, __in PSINGLE_LIST_ENTRY SentRequestListHead, __in BOOLEAN Lock, __out PBOOLEAN Wait)
Definition: fxiotarget.cpp:964
virtual VOID WaitForSentIoToComplete(VOID)
Definition: fxiotarget.hpp:676
MdFileObject m_TargetFileObject
Definition: fxiotarget.hpp:923
VOID SetDeviceBase(__in CfxDeviceBase *DeviceBase)
Definition: fxobject.hpp:797
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
__drv_restoresIRQL KIRQL __in BOOLEAN Unlock
Definition: fxobject.hpp:1474
VOID DeleteFromFailedCreate(VOID)
Definition: fxobject.cpp:391
_Must_inspect_result_ NTSTATUS Commit(__in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __out_opt WDFOBJECT *ObjectHandle, __in_opt FxObject *Parent=NULL, __in BOOLEAN AssignDriverAsDefaultParent=TRUE)
Definition: fxobject.cpp:904
static __inline VOID MxDereferenceObject(__in PVOID Object)
Definition: mxgeneralkm.h:247
static __inline VOID MxReferenceObject(__in PVOID Object)
Definition: mxgeneralkm.h:238
static __inline NTSTATUS MxClose(__in HANDLE Handle)
Definition: mxgeneralkm.h:758
#define __in
Definition: dbghelp.h:35
#define __out
Definition: dbghelp.h:62
#define TRACINGIOTARGET
Definition: dbgtrace.h:72
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
KIRQL irql
Definition: wave.h:1
UCHAR KIRQL
Definition: env_spec_w32.h:591
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define PagedPool
Definition: env_spec_w32.h:308
IN PVCB IN PDIRENT OUT PULONG EaLength
Definition: fatprocs.h:878
#define KMDF_ONLY_CODE_PATH_ASSERT()
Definition: fx.hpp:55
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
PFX_DRIVER_GLOBALS pFxDriverGlobals
return pObject GetObjectHandle()
FxIoTarget * pTarget
Definition: fxdeviceapi.cpp:97
FxObjectHandleGetPtr(GetFxDriverGlobals(DriverGlobals), Fdo, FX_TYPE_DEVICE,(PVOID *)&pFdo)
FxObject * pParent
Definition: fxdpcapi.cpp:86
FxIoTargetRemoteCloseReason
@ FxIoTargetRemoteCloseReasonPlainClose
@ FxIoTargetRemoteCloseReasonQueryRemove
@ FxIoTargetRemoteCloseReasonDelete
@ FxIoTargetRemoteOpenStateClosed
@ FxIoTargetRemoteOpenStateOpening
@ FxIoTargetRemoteOpenStateOpen
#define UMDF_ONLY_CODE_PATH_ASSERT()
Definition: fxmin.hpp:132
void FxPoolFree(__in_xcount(ptr is at an offset from AllocationStart) PVOID ptr)
Definition: wdfpool.cpp:361
@ FX_TYPE_OBJECT
Definition: fxtypes.h:45
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLenum const GLfloat * params
Definition: glext.h:5645
#define ASSERT(a)
Definition: mode.c:44
PVOID PVOID PWCHAR PVOID USHORT PULONG Reason
Definition: env.c:47
#define _Must_inspect_result_
Definition: ms_sal.h:558
#define DO_NOTHING()
Definition: mxgeneral.h:32
PFILE_OBJECT MdFileObject
Definition: mxgeneralkm.h:32
PDEVICE_OBJECT MdDeviceObject
Definition: mxgeneralkm.h:30
@ Close
Definition: sacdrv.h:268
#define STATUS_SUCCESS
Definition: shellext.h:65
#define TRACE_LEVEL_VERBOSE
Definition: storswtr.h:30
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
#define TRACE_LEVEL_INFORMATION
Definition: storswtr.h:29
_Must_inspect_result_ NTSTATUS FxDuplicateUnicodeString(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in const UNICODE_STRING *Source, __out PUNICODE_STRING Destination)
Definition: stringutil.cpp:180
NTSTATUS EnterCRAndWaitAndLeave(VOID)
Definition: fxwaitlock.hpp:87
PVOID GetEvent(VOID)
Definition: fxwaitlock.hpp:172
VOID Set(VOID)
Definition: fxwaitlock.hpp:144
VOID Clear(VOID)
Definition: fxwaitlock.hpp:152
PFN_WDF_IO_TARGET_QUERY_REMOVE m_Method
PFN_WDF_IO_TARGET_REMOVE_CANCELED m_Method
PFN_WDF_IO_TARGET_REMOVE_COMPLETE m_Method
WDF_IO_TARGET_OPEN_TYPE OpenType
VOID Set(__in PWDF_IO_TARGET_OPEN_PARAMS OpenParams, __in PUNICODE_STRING Name, __in PVOID Ea, __in ULONG EaLength)
_Must_inspect_result_ BOOLEAN IsVersionGreaterThanOrEqualTo(__in ULONG Major, __in ULONG Minor)
Definition: globalskm.cpp:92
Definition: typedefs.h:120
Definition: ntbasedef.h:628
Definition: name.c:39
Definition: ps.c:97
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
uint32_t ULONG
Definition: typedefs.h:59
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define STATUS_INVALID_DEVICE_STATE
Definition: udferr_usr.h:178
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
LONGLONG QuadPart
Definition: typedefs.h:114
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
_Must_inspect_result_ _In_ WDFDEVICE _In_ ULONG _In_ ACCESS_MASK DesiredAccess
Definition: wdfdevice.h:2658
enum _WDF_IO_TARGET_OPEN_TYPE WDF_IO_TARGET_OPEN_TYPE
@ WdfIoTargetOpenLocalTargetByFile
Definition: wdfiotarget.h:66
@ WdfIoTargetOpenReopen
Definition: wdfiotarget.h:65
@ WdfIoTargetOpenUseExistingDevice
Definition: wdfiotarget.h:63
@ WdfIoTargetOpenByName
Definition: wdfiotarget.h:64
_Must_inspect_result_ _In_ WDFIOTARGET _In_ PWDF_IO_TARGET_OPEN_PARAMS OpenParams
Definition: wdfiotarget.h:401
@ WdfIoTargetClosed
Definition: wdfiotarget.h:56
@ WdfIoTargetStarted
Definition: wdfiotarget.h:53
@ WdfIoTargetClosedForQueryRemove
Definition: wdfiotarget.h:55
@ WdfIoTargetDeleted
Definition: wdfiotarget.h:57
WDF_EXTERN_C_START enum _WDF_IO_TARGET_STATE WDF_IO_TARGET_STATE
_Must_inspect_result_ _In_opt_ WDFKEY _In_ PCUNICODE_STRING _In_ ACCESS_MASK _In_ ULONG _Out_opt_ PULONG CreateDisposition
Definition: wdfregistry.h:120
_Must_inspect_result_ _In_opt_ WDFKEY _In_ PCUNICODE_STRING _In_ ACCESS_MASK _In_ ULONG CreateOptions
Definition: wdfregistry.h:118
_In_ WDFIOTARGET Target
Definition: wdfrequest.h:306
_Must_inspect_result_ _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_ WDFWAITLOCK * Lock
Definition: wdfsync.h:127
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG _In_ ULONG _In_ ULONG _In_ ULONG _In_opt_ PVOID EaBuffer
Definition: iofuncs.h:845
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList