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.

107 lines
2.3 KiB

  1. /*******************************************************************************
  2. *
  3. * threads.h
  4. *
  5. * declarations of the thread classes
  6. *
  7. * copyright notice: Copyright 1997, Citrix Systems Inc.
  8. * Copyright (c) 1998 - 1999 Microsoft Corporation
  9. *
  10. * $Author: butchd $ Don Messerli
  11. *
  12. * $Log: M:\NT\PRIVATE\UTILS\CITRIX\WINUTILS\WINADMIN\VCS\THREADS.H $
  13. *
  14. * Rev 1.0 30 Jul 1997 17:12:48 butchd
  15. * Initial revision.
  16. *
  17. *******************************************************************************/
  18. ////////////////////////////////////////////////////////////////////////////////
  19. // CThread class
  20. //
  21. class CThread
  22. {
  23. /*
  24. * Member variables.
  25. */
  26. protected:
  27. HANDLE m_hThread;
  28. DWORD m_dwThreadID;
  29. /*
  30. * Implementation
  31. */
  32. public:
  33. virtual ~CThread();
  34. // void* operator new(size_t nSize);
  35. // void operator delete(void* p);
  36. protected:
  37. CThread();
  38. static DWORD __stdcall ThreadEntryPoint(LPVOID lpParam);
  39. virtual DWORD RunThread() = 0;
  40. /*
  41. * Operations: primary thread
  42. */
  43. public:
  44. HANDLE CreateThread( DWORD cbStack = 0,
  45. DWORD fdwCreate = 0 );
  46. }; // end CThread class interface
  47. ////////////////////////////////////////////////////////////////////////////////
  48. ////////////////////////////////////////////////////////////////////////////////
  49. // CWSStatusThread structures, defines, and typedefs
  50. //
  51. #define MAX_STATUS_SEMAPHORE_COUNT 1
  52. #define MAX_SLEEP_COUNT 10
  53. ////////////////////////////////////////////////////////////////////////////////
  54. // CWSStatusThread class
  55. //
  56. class CWSStatusThread : public CThread
  57. {
  58. /*
  59. * Member variables.
  60. */
  61. public:
  62. ULONG m_LogonId;
  63. HANDLE m_hServer;
  64. HWND m_hDlg;
  65. WINSTATIONINFORMATION m_WSInfo;
  66. PDCONFIG m_PdConfig;
  67. protected:
  68. HANDLE m_hWakeUp;
  69. HANDLE m_hConsumed;
  70. BOOL m_bExit;
  71. /*
  72. * Implementation
  73. */
  74. public:
  75. CWSStatusThread();
  76. protected:
  77. virtual ~CWSStatusThread();
  78. virtual DWORD RunThread();
  79. /*
  80. * Operations: primary thread.
  81. */
  82. public:
  83. void SignalWakeUp();
  84. void SignalConsumed();
  85. void ExitThread();
  86. /*
  87. * Operations: secondary thread.
  88. */
  89. protected:
  90. BOOL WSPdQuery();
  91. BOOL WSInfoQuery();
  92. }; // end CWSStatusThread class interface
  93. ////////////////////////////////////////////////////////////////////////////////