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.

61 lines
1.0 KiB

  1. /******************************************************************************/
  2. // synch.h
  3. //
  4. // Terminal Server Session Directory shared reader/writer header.
  5. //
  6. // Copyright (C) 2001 Microsoft Corporation
  7. /******************************************************************************/
  8. #include <windows.h>
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. typedef struct _SHAREDRESOURCE {
  13. CRITICAL_SECTION ReaderMutex;
  14. HANDLE WriterSemaphore;
  15. DWORD Readers;
  16. BOOL Valid;
  17. } SHAREDRESOURCE, *PSHAREDRESOURCE;
  18. BOOL
  19. InitializeSharedResource(
  20. IN OUT PSHAREDRESOURCE psr
  21. );
  22. VOID
  23. AcquireResourceShared(
  24. IN PSHAREDRESOURCE psr
  25. );
  26. VOID
  27. ReleaseResourceShared(
  28. IN PSHAREDRESOURCE psr
  29. );
  30. VOID
  31. AcquireResourceExclusive(
  32. IN PSHAREDRESOURCE psr
  33. );
  34. VOID
  35. ReleaseResourceExclusive(
  36. IN PSHAREDRESOURCE psr
  37. );
  38. VOID
  39. FreeSharedResource(
  40. IN OUT PSHAREDRESOURCE psr
  41. );
  42. BOOL
  43. VerifyNoSharedAccess(
  44. IN PSHAREDRESOURCE psr
  45. );
  46. #ifdef __cplusplus
  47. }
  48. #endif