Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
1.0 KiB

  1. /*++
  2. Copyright (c) 1990 Microsoft Corporation
  3. Module Name:
  4. eballoc.c
  5. Abstract:
  6. Process/Thread Environment Block allocation functions
  7. Author:
  8. Steve Wood (stevewo) 10-May-1990
  9. Revision History:
  10. --*/
  11. #include "ntrtlp.h"
  12. #include <nturtl.h>
  13. #if defined(ALLOC_PRAGMA) && defined(NTOS_KERNEL_RUNTIME)
  14. #pragma alloc_text(INIT,RtlAcquirePebLock)
  15. #pragma alloc_text(INIT,RtlReleasePebLock)
  16. #endif
  17. #undef RtlAcquirePebLock
  18. VOID
  19. RtlAcquirePebLock( VOID )
  20. {
  21. #if !defined(NTOS_KERNEL_RUNTIME)
  22. PPEB Peb;
  23. Peb = NtCurrentPeb();
  24. RtlEnterCriticalSection (Peb->FastPebLock);
  25. #endif
  26. }
  27. #undef RtlReleasePebLock
  28. VOID
  29. RtlReleasePebLock( VOID )
  30. {
  31. #if !defined(NTOS_KERNEL_RUNTIME)
  32. PPEB Peb;
  33. Peb = NtCurrentPeb();
  34. RtlLeaveCriticalSection (Peb->FastPebLock);
  35. #endif
  36. }
  37. #if DBG
  38. VOID
  39. RtlAssertPebLockOwned( VOID )
  40. {
  41. #if !defined(NTOS_KERNEL_RUNTIME)
  42. ASSERT(NtCurrentPeb()->FastPebLock->OwningThread == NtCurrentTeb()->ClientId.UniqueThread);
  43. #endif
  44. }
  45. #endif