[PATCH 1/5] include: Add ExInitializeFastMutex() definition.

Zebediah Figura z.figura12 at gmail.com
Tue Jan 29 22:01:44 CST 2019


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 include/ddk/wdm.h | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h
index 81f41f5a97..c85b831a04 100644
--- a/include/ddk/wdm.h
+++ b/include/ddk/wdm.h
@@ -168,12 +168,14 @@ typedef struct _OBJECT_TYPE *POBJECT_TYPE;
 typedef struct _OBJECT_HANDLE_INFORMATION *POBJECT_HANDLE_INFORMATION;
 typedef struct _ZONE_HEADER *PZONE_HEADER;
 
+#define FM_LOCK_BIT 0x1
+
 typedef struct _FAST_MUTEX
 {
     LONG Count;
     PKTHREAD Owner;
     ULONG Contention;
-    KEVENT Gate;
+    KEVENT Event;
     ULONG OldIrql;
 } FAST_MUTEX, *PFAST_MUTEX;
 
@@ -1622,4 +1624,12 @@ NTSTATUS  WINAPI ZwWaitForMultipleObjects(ULONG,const HANDLE*,BOOLEAN,BOOLEAN,co
 NTSTATUS  WINAPI ZwWriteFile(HANDLE,HANDLE,PIO_APC_ROUTINE,PVOID,PIO_STATUS_BLOCK,const void*,ULONG,PLARGE_INTEGER,PULONG);
 NTSTATUS  WINAPI ZwYieldExecution(void);
 
+static inline void ExInitializeFastMutex( FAST_MUTEX *mutex )
+{
+    mutex->Count = FM_LOCK_BIT;
+    mutex->Owner = NULL;
+    mutex->Contention = 0;
+    KeInitializeEvent( &mutex->Event, SynchronizationEvent, FALSE );
+}
+
 #endif
-- 
2.20.1




More information about the wine-devel mailing list