Process Hacker
fastlock.h
Go to the documentation of this file.
1 #ifndef _PH_FASTLOCK_H
2 #define _PH_FASTLOCK_H
3 
4 // FastLock is a port of FastResourceLock from PH 1.x.
5 
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9 
10 typedef struct _PH_FAST_LOCK
11 {
12  ULONG Value;
16 
17 #define PH_FAST_LOCK_INIT { 0, NULL, NULL }
18 
20 VOID
21 NTAPI
23  _Out_ PPH_FAST_LOCK FastLock
24  );
25 
27 VOID
28 NTAPI
30  _Inout_ PPH_FAST_LOCK FastLock
31  );
32 
33 #define PhAcquireFastLockExclusive PhfAcquireFastLockExclusive
35 _Acquires_exclusive_lock_(*FastLock)
37 VOID
40  _Inout_ PPH_FAST_LOCK FastLock
41  );
42 
43 #define PhAcquireFastLockShared PhfAcquireFastLockShared
45 _Acquires_shared_lock_(*FastLock)
47 VOID
50  _Inout_ PPH_FAST_LOCK FastLock
51  );
52 
53 #define PhReleaseFastLockExclusive PhfReleaseFastLockExclusive
54 _Releases_exclusive_lock_(*FastLock)
56 VOID
59  _Inout_ PPH_FAST_LOCK FastLock
60  );
61 
62 #define PhReleaseFastLockShared PhfReleaseFastLockShared
63 _Releases_shared_lock_(*FastLock)
65 VOID
68  _Inout_ PPH_FAST_LOCK FastLock
69  );
70 
71 #define PhTryAcquireFastLockExclusive PhfTryAcquireFastLockExclusive
72 _When_(return != 0, _Acquires_exclusive_lock_(*FastLock))
74 BOOLEAN
77  _Inout_ PPH_FAST_LOCK FastLock
78  );
79 
80 #define PhTryAcquireFastLockShared PhfTryAcquireFastLockShared
81 _When_(return != 0, _Acquires_shared_lock_(*FastLock))
83 BOOLEAN
86  _Inout_ PPH_FAST_LOCK FastLock
87  );
88 
89 #ifdef __cplusplus
90 }
91 #endif
92 
93 #endif