ReactOS 0.4.16-dev-297-gc569aee
fxwaitlock.cpp
Go to the documentation of this file.
1/*++
2
3Copyright (c) Microsoft Corporation
4
5Module Name:
6
7 FxWaitLock.cpp
8
9Abstract:
10
11 This module implements the FxWaitLock's factory method.
12
13Author:
14
15
16Revision History:
17
18
19--*/
20
21#include "fxsupportpch.hpp"
22
23#if defined(EVENT_TRACING)
24// Tracing support
25extern "C" {
26#include "fxwaitlock.tmh"
27}
28#endif
29
33 __in PFX_DRIVER_GLOBALS FxDriverGlobals,
35 __in_opt FxObject* ParentObject,
36 __in BOOLEAN AssignDriverAsDefaultParent,
37 __out WDFWAITLOCK* LockHandle
38 )
39{
42
44
45 lock = new (FxDriverGlobals, Attributes) FxWaitLock(FxDriverGlobals);
46 if (lock == NULL) {
49 "Memory allocation failed: %!STATUS!", status);
50 return status;
51 }
52
53 status = lock->Initialize();
54 if (!NT_SUCCESS(status)) {
55 lock->DeleteFromFailedCreate();
57 "faield to initialize wait lock: %!STATUS!", status);
58 return status;
59 }
60
61 status = lock->Commit(Attributes,
63 ParentObject,
64 AssignDriverAsDefaultParent);
65
66 if (!NT_SUCCESS(status)) {
67 lock->DeleteFromFailedCreate();
68 }
69
70 return status;
71}
72
73
74
unsigned char BOOLEAN
LONG NTSTATUS
Definition: precomp.h:26
static _Must_inspect_result_ NTSTATUS _Create(__in PFX_DRIVER_GLOBALS DriverGlobals, __in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __in_opt FxObject *ParentObject, __in BOOLEAN AssignDriverAsDefaultParent, __out WDFWAITLOCK *LockHandle)
Definition: fxwaitlock.cpp:32
#define __in
Definition: dbghelp.h:35
#define __in_opt
Definition: dbghelp.h:38
#define __out
Definition: dbghelp.h:62
#define TRACINGIO
Definition: dbgtrace.h:66
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
DoTraceLevelMessage(pFxDriverGlobals, TRACE_LEVEL_VERBOSE, TRACINGPNP, "Enter, WDFDEVICE %p", Device)
#define __checkReturn
Definition: sal_old.h:113
#define TRACE_LEVEL_ERROR
Definition: storswtr.h:27
Definition: ps.c:97
rwlock_t lock
Definition: tcpcore.h:0
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_Must_inspect_result_ _In_ WDFDMAENABLER _In_ _In_opt_ PWDF_OBJECT_ATTRIBUTES Attributes
*LockHandle LockHandle _Out_ PKLOCK_QUEUE_HANDLE LockHandle
Definition: kefuncs.h:717