Something went wrong. Try again.
Reactos
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475/*++
Copyright (c) Microsoft Corporation
Module Name:
FxWaitLock.cpp
Abstract:
This module implements the FxWaitLock's factory method.
Author:
Revision History:
--*/
#include "fxsupportpch.hpp"
#if defined(EVENT_TRACING)// Tracing supportextern "C" {#include "fxwaitlock.tmh"}#endif
__checkReturnNTSTATUSFxWaitLock::_Create( __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in_opt PWDF_OBJECT_ATTRIBUTES Attributes, __in_opt FxObject* ParentObject, __in BOOLEAN AssignDriverAsDefaultParent, __out WDFWAITLOCK* LockHandle ){ FxWaitLock* lock; NTSTATUS status;
*LockHandle = NULL;
lock = new (FxDriverGlobals, Attributes) FxWaitLock(FxDriverGlobals); if (lock == NULL) { status = STATUS_INSUFFICIENT_RESOURCES; DoTraceLevelMessage(FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGIO, "Memory allocation failed: %!STATUS!", status); return status; }
status = lock->Initialize(); if (!NT_SUCCESS(status)) { lock->DeleteFromFailedCreate(); DoTraceLevelMessage(FxDriverGlobals, TRACE_LEVEL_ERROR, TRACINGIO, "faield to initialize wait lock: %!STATUS!", status); return status; }
status = lock->Commit(Attributes, (WDFOBJECT*)LockHandle, ParentObject, AssignDriverAsDefaultParent);
if (!NT_SUCCESS(status)) { lock->DeleteFromFailedCreate(); }
return status;}