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.

82 lines
1.6 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 InitializeNonReentrantCriticalSection(PNONREENTRANTCRITICALSECTION);
  32. extern BOOL EnterNonReentrantCriticalSection(PNONREENTRANTCRITICALSECTION);
  33. extern void LeaveNonReentrantCriticalSection(PNONREENTRANTCRITICALSECTION);
  34. extern void DeleteNonReentrantCriticalSection(PNONREENTRANTCRITICALSECTION);
  35. #ifdef DEBUG
  36. extern BOOL NonReentrantCriticalSectionIsOwned(PCNONREENTRANTCRITICALSECTION);
  37. extern DWORD GetNonReentrantCriticalSectionOwner(PCNONREENTRANTCRITICALSECTION);
  38. #endif
  39. extern BOOL BeginExclusiveAccess(void);
  40. extern void EndExclusiveAccess(void);
  41. #ifdef DEBUG
  42. extern BOOL AccessIsExclusive(void);
  43. #endif /* DEBUG */
  44. extern HMODULE GetThisModulesHandle(void);
  45. /* functions to be provided by client */
  46. #ifdef DEBUG
  47. extern BOOL SetAllIniSwitches(void);
  48. #endif
  49. /* Global Variables
  50. *******************/
  51. /* serialization control structure */
  52. extern CSERIALCONTROL g_cserctrl;