mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 05:52:57 +00:00
[WDF] Add Windows Driver Framework files
Takern from Microsoft GitHub repo:
d9c6040fe9
Licensed under MIT
This commit is contained in:
parent
545df81502
commit
8a978a179f
475 changed files with 285099 additions and 0 deletions
109
sdk/lib/drivers/wdf/shared/inc/primitives/common/mxlock.h
Normal file
109
sdk/lib/drivers/wdf/shared/inc/primitives/common/mxlock.h
Normal file
|
@ -0,0 +1,109 @@
|
|||
/*++
|
||||
|
||||
Copyright (c) Microsoft Corporation
|
||||
|
||||
ModuleName:
|
||||
|
||||
MxLock.h
|
||||
|
||||
Abstract:
|
||||
|
||||
Mode agnostic definition of lock
|
||||
|
||||
See MxLockKm.h and MxLockUm.h for mode
|
||||
specific implementations
|
||||
|
||||
Author:
|
||||
|
||||
|
||||
|
||||
Revision History:
|
||||
|
||||
|
||||
|
||||
--*/
|
||||
|
||||
#pragma once
|
||||
|
||||
//
|
||||
// MxLockNoDynam has no c'tor/d'tor
|
||||
// so as to be usable in global structs in km
|
||||
//
|
||||
// MxLock dervies from it and adds c'tor/d'tor
|
||||
//
|
||||
class MxLockNoDynam
|
||||
{
|
||||
|
||||
DECLARE_DBGFLAG_INITIALIZED;
|
||||
|
||||
protected:
|
||||
MdLock m_Lock;
|
||||
public:
|
||||
MdLock &
|
||||
Get(
|
||||
)
|
||||
{
|
||||
return m_Lock;
|
||||
}
|
||||
|
||||
__inline
|
||||
VOID
|
||||
Initialize(
|
||||
);
|
||||
|
||||
_Acquires_lock_(this->m_Lock)
|
||||
__drv_maxIRQL(DISPATCH_LEVEL)
|
||||
__drv_setsIRQL(DISPATCH_LEVEL)
|
||||
__inline
|
||||
VOID
|
||||
Acquire(
|
||||
__out __drv_deref(__drv_savesIRQL) KIRQL * OldIrql
|
||||
);
|
||||
|
||||
#if ((FX_CORE_MODE)==(FX_CORE_USER_MODE))
|
||||
|
||||
CHECK_RETURN_IF_USER_MODE
|
||||
__inline
|
||||
BOOLEAN
|
||||
TryToAcquire(
|
||||
VOID
|
||||
);
|
||||
#endif
|
||||
|
||||
_Acquires_lock_(this->m_Lock)
|
||||
__drv_requiresIRQL(DISPATCH_LEVEL)
|
||||
__inline
|
||||
VOID
|
||||
AcquireAtDpcLevel(
|
||||
);
|
||||
|
||||
_Releases_lock_(this->m_Lock)
|
||||
__drv_requiresIRQL(DISPATCH_LEVEL)
|
||||
__inline
|
||||
VOID
|
||||
Release(
|
||||
__drv_restoresIRQL KIRQL NewIrql
|
||||
);
|
||||
|
||||
_Releases_lock_(this->m_Lock)
|
||||
__drv_requiresIRQL(DISPATCH_LEVEL)
|
||||
__inline
|
||||
VOID
|
||||
ReleaseFromDpcLevel(
|
||||
);
|
||||
|
||||
__inline
|
||||
VOID
|
||||
Uninitialize(
|
||||
);
|
||||
};
|
||||
|
||||
class MxLock : public MxLockNoDynam
|
||||
{
|
||||
public:
|
||||
__inline
|
||||
MxLock();
|
||||
|
||||
__inline
|
||||
~MxLock();
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue