summaryrefslogtreecommitdiffstats
path: root/private/ntos/rtl/eballoc.c
diff options
context:
space:
mode:
authorAdam <you@example.com>2020-05-17 05:51:50 +0200
committerAdam <you@example.com>2020-05-17 05:51:50 +0200
commite611b132f9b8abe35b362e5870b74bce94a1e58e (patch)
treea5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/ntos/rtl/eballoc.c
downloadNT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst
NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip
Diffstat (limited to 'private/ntos/rtl/eballoc.c')
-rw-r--r--private/ntos/rtl/eballoc.c59
1 files changed, 59 insertions, 0 deletions
diff --git a/private/ntos/rtl/eballoc.c b/private/ntos/rtl/eballoc.c
new file mode 100644
index 000000000..204a680b1
--- /dev/null
+++ b/private/ntos/rtl/eballoc.c
@@ -0,0 +1,59 @@
+/*++
+
+Copyright (c) 1990 Microsoft Corporation
+
+Module Name:
+
+ eballoc.c
+
+Abstract:
+
+ Process/Thread Environment Block allocation functions
+
+Author:
+
+ Steve Wood (stevewo) 10-May-1990
+
+Revision History:
+
+--*/
+
+#include "ntrtlp.h"
+#include <nturtl.h>
+
+#if defined(ALLOC_PRAGMA) && defined(NTOS_KERNEL_RUNTIME)
+#pragma alloc_text(PAGE,RtlAcquirePebLock)
+#pragma alloc_text(PAGE,RtlReleasePebLock)
+#endif
+
+typedef VOID (*PEB_LOCK_ROUTINE)(PVOID FastLock);
+
+VOID
+RtlAcquirePebLock( VOID )
+{
+ PEB_LOCK_ROUTINE LockRoutine;
+ PPEB Peb;
+
+ RTL_PAGED_CODE();
+
+ Peb = NtCurrentPeb();
+
+ LockRoutine = (PEB_LOCK_ROUTINE)Peb->FastPebLockRoutine;
+ ASSERT(LockRoutine);
+ (LockRoutine)(Peb->FastPebLock);
+}
+
+VOID
+RtlReleasePebLock( VOID )
+{
+ PEB_LOCK_ROUTINE LockRoutine;
+ PPEB Peb;
+
+ RTL_PAGED_CODE();
+
+ Peb = NtCurrentPeb();
+
+ LockRoutine = (PEB_LOCK_ROUTINE)Peb->FastPebUnlockRoutine;
+ ASSERT(LockRoutine);
+ (LockRoutine)(Peb->FastPebLock);
+}