My Project
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

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

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)
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)

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

◆ PRUNDOWN_REF

typedef struct _RUNDOWN_REF * PRUNDOWN_REF

◆ PSPINLOCK

typedef struct _SPINLOCK * PSPINLOCK

◆ 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 60 of file ms.h.

Function Documentation

◆ InitializeListHead()

FORCEINLINE void InitializeListHead ( PDOUBLY_LINKED_LIST Head)

Definition at line 166 of file ms.h.

◆ InsertHeadList()

FORCEINLINE void InsertHeadList ( PDOUBLY_LINKED_LIST Head,
PDOUBLY_LINKED_LIST Entry )

Definition at line 196 of file ms.h.

◆ InsertTailList()

FORCEINLINE void InsertTailList ( PDOUBLY_LINKED_LIST Head,
PDOUBLY_LINKED_LIST Entry )

Definition at line 179 of file ms.h.

◆ InterlockedPopEntry()

FORCEINLINE PSINGLE_LINKED_LIST InterlockedPopEntry ( PSINGLE_LINKED_LIST * ListHeadPtr)

Definition at line 291 of file ms.h.

◆ InterlockedPushEntry()

FORCEINLINE void InterlockedPushEntry ( PSINGLE_LINKED_LIST * ListHeadPtr,
PSINGLE_LINKED_LIST Entry )

Definition at line 266 of file ms.h.

◆ MsAcquireMutexObject()

MTSTATUS MsAcquireMutexObject ( IN PMUTEX mut)

Definition at line 73 of file mutex.c.

◆ MsAcquireRundownProtection()

bool MsAcquireRundownProtection ( IN PRUNDOWN_REF rundown)

Definition at line 7 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)

#else #undef MsAcquireSpinlock #undef MsReleaseSpinlock

#define MsAcquireSpinlock() // NO-OP #define MsReleaseSpinlock() // NO-OP #endif

Definition at line 13 of file mutex.c.

◆ MsReleaseMutexObject()

MTSTATUS MsReleaseMutexObject ( IN PMUTEX mut)

Definition at line 135 of file mutex.c.

◆ MsReleaseRundownProtection()

void MsReleaseRundownProtection ( IN PRUNDOWN_REF rundown)

Definition at line 40 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 113 of file events.c.

◆ MsWaitForRundownProtectionRelease()

void MsWaitForRundownProtectionRelease ( IN PRUNDOWN_REF rundown)

Definition at line 63 of file rundown.c.

◆ RemoveEntryList()

FORCEINLINE void RemoveEntryList ( PDOUBLY_LINKED_LIST Entry)

Definition at line 240 of file ms.h.

◆ RemoveHeadList()

Definition at line 215 of file ms.h.