kernel
Loading...
Searching...
No Matches
ms.h File Reference
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include "../mtstatus.h"
#include "annotations.h"
#include "core.h"

Go to the source code of this file.

Data Structures

struct  _SPINLOCK
struct  _RUNDOWN_REF
struct  _Queue
struct  _EVENT
struct  _MUTEX
struct  _PUSH_LOCK
struct  _PUSH_LOCK_WAIT_BLOCK

Macros

#define PL_FLAGS_EXCLUSIVE   0x1
#define PL_FLAGS_SHARED   0x2
#define PL_LOCK_BIT   0x1
#define PL_WAIT_BIT   0x2
#define PL_WAKE_BIT   0x4
#define PL_FLAG_MASK   0xF
#define PL_SHARE_INC   0x10

Typedefs

typedef struct _SPINLOCK SPINLOCK
typedef struct _SPINLOCKPSPINLOCK
typedef struct _RUNDOWN_REF RUNDOWN_REF
typedef struct _RUNDOWN_REFPRUNDOWN_REF
typedef struct _Queue Queue
typedef enum _EVENT_TYPE EVENT_TYPE
typedef struct _EVENT EVENT
typedef struct _EVENTPEVENT
typedef struct _MUTEX MUTEX
typedef struct _MUTEXPMUTEX
typedef struct _PUSH_LOCK PUSH_LOCK
typedef struct _PUSH_LOCK_WAIT_BLOCK PUSH_LOCK_WAIT_BLOCK
typedef struct _PUSH_LOCK_WAIT_BLOCKPPUSH_LOCK_WAIT_BLOCK

Enumerations

enum  _EVENT_TYPE { NotificationEvent , SynchronizationEvent }

Functions

void MsAcquireSpinlock (IN PSPINLOCK lock, IN PIRQL OldIrql)
void MsReleaseSpinlock (IN PSPINLOCK lock, IN IRQL OldIrql)
MTSTATUS MsInitializeMutexObject (IN PMUTEX mut)
MTSTATUS MsAcquireMutexObject (IN PMUTEX mut)
MTSTATUS MsReleaseMutexObject (IN PMUTEX mut)
bool MsAcquireRundownProtection (IN PRUNDOWN_REF rundown)
void MsReleaseRundownProtection (IN PRUNDOWN_REF rundown)
void MsWaitForRundownProtectionRelease (IN PRUNDOWN_REF rundown)
MTSTATUS MsSetEvent (IN PEVENT event)
MTSTATUS MsWaitForEvent (IN PEVENT event)
void MsAcquireSpinlockAtDpcLevel (IN PSPINLOCK Lock)
void MsReleaseSpinlockFromDpcLevel (IN PSPINLOCK Lock)
void MsAcquirePushLockExclusive (IN PUSH_LOCK *Lock)
void MsReleasePushLockExclusive (IN PUSH_LOCK *Lock)
void MsAcquirePushLockShared (IN PUSH_LOCK *Lock)
void MsReleasePushLockShared (IN PUSH_LOCK *Lock)
FORCEINLINE void InitializeListHead (PDOUBLY_LINKED_LIST Head)
FORCEINLINE void InsertTailList (PDOUBLY_LINKED_LIST Head, PDOUBLY_LINKED_LIST Entry)
FORCEINLINE void InsertHeadList (PDOUBLY_LINKED_LIST Head, PDOUBLY_LINKED_LIST Entry)
FORCEINLINE PDOUBLY_LINKED_LIST RemoveHeadList (PDOUBLY_LINKED_LIST Head)
FORCEINLINE void RemoveEntryList (PDOUBLY_LINKED_LIST Entry)
FORCEINLINE void InterlockedPushEntry (PSINGLE_LINKED_LIST *ListHeadPtr, PSINGLE_LINKED_LIST Entry)
FORCEINLINE PSINGLE_LINKED_LIST InterlockedPopEntry (PSINGLE_LINKED_LIST *ListHeadPtr)

Macro Definition Documentation

◆ PL_FLAG_MASK

#define PL_FLAG_MASK   0xF

Definition at line 124 of file ms.h.

◆ PL_FLAGS_EXCLUSIVE

#define PL_FLAGS_EXCLUSIVE   0x1

Definition at line 117 of file ms.h.

◆ PL_FLAGS_SHARED

#define PL_FLAGS_SHARED   0x2

Definition at line 118 of file ms.h.

◆ PL_LOCK_BIT

#define PL_LOCK_BIT   0x1

Definition at line 121 of file ms.h.

◆ PL_SHARE_INC

#define PL_SHARE_INC   0x10

Definition at line 125 of file ms.h.

◆ PL_WAIT_BIT

#define PL_WAIT_BIT   0x2

Definition at line 122 of file ms.h.

◆ PL_WAKE_BIT

#define PL_WAKE_BIT   0x4

Definition at line 123 of file ms.h.

Typedef Documentation

◆ EVENT

typedef struct _EVENT EVENT

EVENT - kernel event object

◆ EVENT_TYPE

typedef enum _EVENT_TYPE EVENT_TYPE

EVENT_TYPE - controls wake behavior

◆ MUTEX

typedef struct _MUTEX MUTEX

MUTEX - Mutual exclusion.

Used to sleep instead of busy waiting, used in non critical paths (e.g IRQL < DISPATCH_LEVEL)

◆ PEVENT

typedef struct _EVENT * PEVENT

◆ PMUTEX

typedef struct _MUTEX * PMUTEX

◆ PPUSH_LOCK_WAIT_BLOCK

◆ PRUNDOWN_REF

typedef struct _RUNDOWN_REF * PRUNDOWN_REF

◆ PSPINLOCK

typedef struct _SPINLOCK * PSPINLOCK

◆ PUSH_LOCK

typedef struct _PUSH_LOCK PUSH_LOCK

◆ PUSH_LOCK_WAIT_BLOCK

◆ Queue

typedef struct _Queue Queue

◆ RUNDOWN_REF

typedef struct _RUNDOWN_REF RUNDOWN_REF

Rundown Reference Protection.

Used to protect current acquisition of destruction, for example, acquiring a rundown protection on a PROCESS or a Thread to assert they will not be destroyed during modification.

◆ SPINLOCK

typedef struct _SPINLOCK SPINLOCK

SPINLOCK - a tiny embedded spinlock representation.

Implementation note: keep this embedded (not a pointer) inside structures.

Enumeration Type Documentation

◆ _EVENT_TYPE

EVENT_TYPE - controls wake behavior

Enumerator
NotificationEvent 
SynchronizationEvent 

Definition at line 61 of file ms.h.

Function Documentation

◆ InitializeListHead()

FORCEINLINE void InitializeListHead ( PDOUBLY_LINKED_LIST Head)

Definition at line 223 of file ms.h.

◆ InsertHeadList()

FORCEINLINE void InsertHeadList ( PDOUBLY_LINKED_LIST Head,
PDOUBLY_LINKED_LIST Entry )

Definition at line 253 of file ms.h.

◆ InsertTailList()

FORCEINLINE void InsertTailList ( PDOUBLY_LINKED_LIST Head,
PDOUBLY_LINKED_LIST Entry )

Definition at line 236 of file ms.h.

◆ InterlockedPopEntry()

FORCEINLINE PSINGLE_LINKED_LIST InterlockedPopEntry ( PSINGLE_LINKED_LIST * ListHeadPtr)

Definition at line 348 of file ms.h.

◆ InterlockedPushEntry()

FORCEINLINE void InterlockedPushEntry ( PSINGLE_LINKED_LIST * ListHeadPtr,
PSINGLE_LINKED_LIST Entry )

Definition at line 323 of file ms.h.

◆ MsAcquireMutexObject()

MTSTATUS MsAcquireMutexObject ( IN PMUTEX mut)

Definition at line 73 of file mutex.c.

◆ MsAcquirePushLockExclusive()

void MsAcquirePushLockExclusive ( IN PUSH_LOCK * Lock)

Definition at line 80 of file pushlock.c.

◆ MsAcquirePushLockShared()

void MsAcquirePushLockShared ( IN PUSH_LOCK * Lock)

Definition at line 150 of file pushlock.c.

◆ MsAcquireRundownProtection()

bool MsAcquireRundownProtection ( IN PRUNDOWN_REF rundown)

Definition at line 8 of file rundown.c.

◆ MsAcquireSpinlock()

void MsAcquireSpinlock ( IN PSPINLOCK lock,
IN PIRQL OldIrql )

Definition at line 13 of file spinlock.c.

◆ MsAcquireSpinlockAtDpcLevel()

void MsAcquireSpinlockAtDpcLevel ( IN PSPINLOCK Lock)

Definition at line 74 of file spinlock.c.

◆ MsInitializeMutexObject()

MTSTATUS MsInitializeMutexObject ( IN PMUTEX mut)

Definition at line 13 of file mutex.c.

◆ MsReleaseMutexObject()

MTSTATUS MsReleaseMutexObject ( IN PMUTEX mut)

Definition at line 135 of file mutex.c.

◆ MsReleasePushLockExclusive()

void MsReleasePushLockExclusive ( IN PUSH_LOCK * Lock)

Definition at line 99 of file pushlock.c.

◆ MsReleasePushLockShared()

void MsReleasePushLockShared ( IN PUSH_LOCK * Lock)

Definition at line 179 of file pushlock.c.

◆ MsReleaseRundownProtection()

void MsReleaseRundownProtection ( IN PRUNDOWN_REF rundown)

Definition at line 41 of file rundown.c.

◆ MsReleaseSpinlock()

void MsReleaseSpinlock ( IN PSPINLOCK lock,
IN IRQL OldIrql )

Definition at line 45 of file spinlock.c.

◆ MsReleaseSpinlockFromDpcLevel()

void MsReleaseSpinlockFromDpcLevel ( IN PSPINLOCK Lock)

Definition at line 100 of file spinlock.c.

◆ MsSetEvent()

MTSTATUS MsSetEvent ( IN PEVENT event)

Definition at line 13 of file events.c.

◆ MsWaitForEvent()

MTSTATUS MsWaitForEvent ( IN PEVENT event)

Definition at line 117 of file events.c.

◆ MsWaitForRundownProtectionRelease()

void MsWaitForRundownProtectionRelease ( IN PRUNDOWN_REF rundown)

Definition at line 64 of file rundown.c.

◆ RemoveEntryList()

FORCEINLINE void RemoveEntryList ( PDOUBLY_LINKED_LIST Entry)

Definition at line 297 of file ms.h.

◆ RemoveHeadList()

Definition at line 272 of file ms.h.