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.

141 lines
4.6 KiB

  1. /**INC+**********************************************************************/
  2. /* Header: vchannel.h */
  3. /* */
  4. /* Purpose: virtual channel interaction */
  5. /* */
  6. /* Copyright(C) Microsoft Corporation 1999 */
  7. /* */
  8. /****************************************************************************/
  9. #ifndef __VCHANNEL_H_
  10. #define __VCHANNEL_H_
  11. #include <cchannel.h>
  12. //
  13. // Include the core (internal) virtual channel header
  14. // we need access to the structure pointed to by pInitHandle
  15. //
  16. #include "vchandle.h"
  17. #define NOTHING 0
  18. #define NON_V1_CONNECT 1
  19. #define V1_CONNECT 2
  20. BEGIN_EXTERN_C
  21. //
  22. // Virtual channel functions
  23. //
  24. VOID WINAPI VirtualChannelOpenEventEx(
  25. PVOID lpParam,
  26. DWORD openHandle,
  27. UINT event,
  28. LPVOID pdata,
  29. UINT32 dataLength,
  30. UINT32 totalLength,
  31. UINT32 dataFlags);
  32. VOID VCAPITYPE VirtualChannelInitEventProcEx(PVOID lpParam,
  33. LPVOID pInitHandle,
  34. UINT event,
  35. LPVOID pData,
  36. UINT dataLength);
  37. BOOL VCAPITYPE MSTSCAX_VirtualChannelEntryEx(PCHANNEL_ENTRY_POINTS_EX pEntryPointsEx,
  38. PVOID pAxCtlInstance);
  39. END_EXTERN_C
  40. enum ChanDataState
  41. {
  42. //
  43. // For received items
  44. //
  45. dataIncompleteAssemblingChunks,
  46. dataReceivedComplete
  47. };
  48. //
  49. // Holds queued data that is to be sent/received
  50. //
  51. typedef struct tag_ChannelDataItem
  52. {
  53. //
  54. // Pointer to the data buffer
  55. // this buffer is stored in a BSTR
  56. // so it can be handed directly to the calling script
  57. //
  58. LPVOID pData;
  59. //
  60. // size of the buffer in bytes
  61. //
  62. DWORD dwDataLen;
  63. //
  64. // Current write pointer used during chunk reassembly
  65. //
  66. LPBYTE pCurWritePointer;
  67. ChanDataState chanDataState;;
  68. } CHANDATA, *PCHANDATA;
  69. typedef struct tag_chanInfo
  70. {
  71. DCACHAR chanName[CHANNEL_NAME_LEN + 1];
  72. DWORD dwOpenHandle;
  73. BOOL fIsValidChannel;
  74. LONG channelOptions;
  75. DCBOOL fIsOpen;
  76. HWND hNotifyWnd;
  77. //
  78. // Info about data item we are in the process of receiving
  79. //
  80. CHANDATA CurrentlyReceivingData;
  81. } CHANINFO, *PCHANINFO;
  82. //
  83. // Channel information
  84. //
  85. class CVChannels
  86. {
  87. public:
  88. CVChannels();
  89. ~CVChannels();
  90. DCINT ChannelIndexFromOpenHandle(DWORD dwHandle);
  91. DCINT ChannelIndexFromName(PDCACHAR szChanName);
  92. DCBOOL SendDataOnChannel(DCUINT chanIndex, LPVOID pdata, DWORD datalength);
  93. DCBOOL HandleReceiveData(IN DCUINT chanIndex,
  94. IN LPVOID pdata,
  95. IN UINT32 dataLength,
  96. IN UINT32 totalLength,
  97. IN UINT32 dataFlags);
  98. VOID VCAPITYPE IntVirtualChannelInitEventProcEx(LPVOID pInitHandle,
  99. UINT event,
  100. LPVOID pData,
  101. UINT dataLength);
  102. VOID WINAPI IntVirtualChannelOpenEventEx(
  103. DWORD openHandle,
  104. UINT event,
  105. LPVOID pdata,
  106. UINT32 dataLength,
  107. UINT32 totalLength,
  108. UINT32 dataFlags);
  109. //Predicate, returns true if the VC entry function
  110. //has been called
  111. BOOL HasEntryBeenCalled() {return _pEntryPoints ? TRUE : FALSE;}
  112. PCHANINFO _pChanInfo;
  113. PCHANNEL_ENTRY_POINTS_EX _pEntryPoints;
  114. DWORD _dwConnectState;
  115. LPVOID _phInitHandle;
  116. UINT _ChanCount;
  117. HWND _hwndControl;
  118. };
  119. #endif //__VCHANNEL_H_