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.

115 lines
2.4 KiB

  1. //Copyright (c) 1998 - 1999 Microsoft Corporation
  2. /*******************************************************************************
  3. *
  4. * threads.h
  5. *
  6. * interface of WINCFG thread classes
  7. *
  8. * copyright notice: Copyright 1994, Citrix Systems Inc.
  9. *
  10. * $Author: butchd $ Butch Davis
  11. *
  12. * $Log: M:\NT\PRIVATE\UTILS\CITRIX\WINUTILS\WINCFG\VCS\THREADS.H $
  13. *
  14. * Rev 1.8 18 Jun 1997 15:13:28 butchd
  15. * Hydrix split
  16. *
  17. * Rev 1.7 12 Sep 1996 16:16:46 butchd
  18. * update
  19. *
  20. *******************************************************************************/
  21. //#include <citrix\modem.h> // for CITRIX MODEM.DLL
  22. #define MAX_COMMAND_LEN 255
  23. ////////////////////////////////////////////////////////////////////////////////
  24. // CThread class
  25. //
  26. class CThread
  27. {
  28. /*
  29. * Member variables.
  30. */
  31. public:
  32. HANDLE m_hThread;
  33. DWORD m_dwThreadID;
  34. /*
  35. * Implementation
  36. */
  37. public:
  38. virtual ~CThread();
  39. void* operator new(size_t nSize);
  40. void operator delete(void* p);
  41. protected:
  42. CThread();
  43. static DWORD __stdcall ThreadEntryPoint(LPVOID lpParam);
  44. virtual DWORD RunThread() = 0;
  45. /*
  46. * Operations: primary thread
  47. */
  48. public:
  49. HANDLE CreateThread( DWORD cbStack = 0,
  50. DWORD fdwCreate = 0 );
  51. }; // end CThread class interface
  52. ////////////////////////////////////////////////////////////////////////////////
  53. ////////////////////////////////////////////////////////////////////////////////
  54. // CATDlgInputThread class
  55. //
  56. #define MAX_STATUS_SEMAPHORE_COUNT 1
  57. #define MAX_SLEEP_COUNT 10
  58. class CATDlgInputThread : public CThread
  59. {
  60. /*
  61. * Member variables.
  62. */
  63. public:
  64. HWND m_hDlg;
  65. HANDLE m_hDevice;
  66. PDCONFIG m_PdConfig;
  67. PROTOCOLSTATUS m_Status;
  68. BYTE m_Buffer[MAX_COMMAND_LEN+1];
  69. DWORD m_BufferBytes;
  70. protected:
  71. DWORD m_ErrorStatus;
  72. HANDLE m_hConsumed;
  73. BOOL m_bExit;
  74. DWORD m_EventMask;
  75. OVERLAPPED m_OverlapSignal;
  76. OVERLAPPED m_OverlapRead;
  77. /*
  78. * Implementation
  79. */
  80. public:
  81. CATDlgInputThread();
  82. protected:
  83. virtual ~CATDlgInputThread();
  84. virtual DWORD RunThread();
  85. /*
  86. * Operations: primary thread.
  87. */
  88. public:
  89. void SignalConsumed();
  90. void ExitThread();
  91. /*
  92. * Operations: secondary thread.
  93. */
  94. protected:
  95. void NotifyAbort( UINT idError );
  96. int CommInputNotify();
  97. int CommStatusAndNotify();
  98. int PostInputRead();
  99. int PostStatusRead();
  100. }; // end CATDlgInputThread class interface
  101. ////////////////////////////////////////////////////////////////////////////////