Source code of Windows XP (NT5)
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.

44 lines
928 B

  1. //
  2. // dll.h
  3. //
  4. #ifndef __DLL_H__
  5. #define __DLL_H__
  6. extern HINSTANCE g_hinst;
  7. #ifdef WIN32
  8. // Notes:
  9. // 1. Never "return" from the critical section.
  10. // 2. Never "SendMessage" or "Yield" from the critical section.
  11. // 3. Never call USER API which may yield.
  12. // 4. Always make the critical section as small as possible.
  13. // 5. Critical sections in Win95 block across processes. In NT
  14. // they are per-process only, so use mutexes instead.
  15. //
  16. #define WIN32_CODE(x) x
  17. void PUBLIC Dll_EnterExclusive(void);
  18. void PUBLIC Dll_LeaveExclusive(void);
  19. extern BOOL g_bExclusive;
  20. extern BOOL g_bAdminUser;
  21. #define USER_IS_ADMIN() (g_bAdminUser)
  22. #define ENTER_X() Dll_EnterExclusive();
  23. #define LEAVE_X() Dll_LeaveExclusive();
  24. #define ASSERT_X() ASSERT(g_bExclusive)
  25. #else // WIN32
  26. #define WIN32_CODE(x)
  27. #define ENTER_X()
  28. #define LEAVE_X()
  29. #define ASSERT_X()
  30. #endif // WIN32
  31. #endif //!__DLL_H__