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.

83 lines
1.5 KiB

  1. /*
  2. * serial.h - Access serialization routines description.
  3. */
  4. /* Types
  5. ********/
  6. typedef struct _serialcontrol
  7. {
  8. BOOL (*AttachProcess)(HMODULE);
  9. BOOL (*DetachProcess)(HMODULE);
  10. BOOL (*AttachThread)(HMODULE);
  11. BOOL (*DetachThread)(HMODULE);
  12. }
  13. SERIALCONTROL;
  14. DECLARE_STANDARD_TYPES(SERIALCONTROL);
  15. typedef struct _nonreentrantcriticalsection
  16. {
  17. CRITICAL_SECTION critsec;
  18. #ifdef DEBUG
  19. DWORD dwOwnerThread;
  20. #endif /* DEBUG */
  21. BOOL bEntered;
  22. }
  23. NONREENTRANTCRITICALSECTION;
  24. DECLARE_STANDARD_TYPES(NONREENTRANTCRITICALSECTION);
  25. /* Prototypes
  26. *************/
  27. /* serial.c */
  28. #ifdef DEBUG
  29. extern BOOL SetSerialModuleIniSwitches(void);
  30. #endif /* DEBUG */
  31. extern void ReinitializeNonReentrantCriticalSection(PNONREENTRANTCRITICALSECTION);
  32. extern BOOL EnterNonReentrantCriticalSection(PNONREENTRANTCRITICALSECTION);
  33. extern void LeaveNonReentrantCriticalSection(PNONREENTRANTCRITICALSECTION);
  34. #ifdef DEBUG
  35. extern BOOL NonReentrantCriticalSectionIsOwned(PCNONREENTRANTCRITICALSECTION);
  36. #endif
  37. extern BOOL BeginExclusiveAccess(void);
  38. extern void EndExclusiveAccess(void);
  39. #ifdef DEBUG
  40. extern BOOL AccessIsExclusive(void);
  41. #endif /* DEBUG */
  42. extern HMODULE GetThisModulesHandle(void);
  43. /* functions to be provided by client */
  44. extern BOOL InitializeDLL(void);
  45. extern BOOL TerminateDLL(void);
  46. #ifdef DEBUG
  47. extern BOOL SetAllIniSwitches(void);
  48. #endif
  49. /* Global Variables
  50. *******************/
  51. /* serialization control structure */
  52. extern CSERIALCONTROL g_cserctrl;