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.

174 lines
5.0 KiB

  1. #ifndef H__netintf
  2. #define H__netintf
  3. #include "netbasic.h"
  4. #ifdef _WINDOWS
  5. DWORD NDDEInit( LPSTR lpszNodeName, HWND hWndNetdde );
  6. #else
  7. BOOL NDDEInit( LPSTR lpszNodeName );
  8. #endif
  9. /* interface init status return */
  10. #define NDDE_INIT_OK 1
  11. #define NDDE_INIT_NO_SERVICE 2
  12. #define NDDE_INIT_FAIL 3
  13. void NDDETimeSlice( void );
  14. void NDDEShutdown( void );
  15. DWORD NDDEGetCAPS( WORD nIndex );
  16. #define NDDE_SPEC_VERSION 0x0001
  17. #define NDDE_CUR_VERSION (0x0000030AL)
  18. #define NDDE_MAPPING_SUPPORT 0x0002
  19. #define NDDE_MAPS_YES (0x00000001L)
  20. #define NDDE_MAPS_NO (0x00000000L)
  21. #define NDDE_SCHEDULE_METHOD 0x0003
  22. #define NDDE_TIMESLICE (0x00000000L)
  23. #define NDDE_CONFIG_PARAMS 0x5701 /* Wonderware Params 0x57='W' */
  24. #define NDDE_PARAMS_OK (0x00000001L)
  25. #define NDDE_PARAMS_NO (0x00000000L)
  26. #ifdef _WINDOWS
  27. CONNID NDDEAddConnection( LPSTR nodeName );
  28. #else
  29. CONNID NDDEAddConnection( LPSTR nodeName, HPKTZ hPktz );
  30. #endif
  31. CONNID NDDEGetNewConnection( void );
  32. VOID NDDEDeleteConnection( CONNID connID );
  33. DWORD NDDEGetConnectionStatus( CONNID connID );
  34. BOOL NDDERcvPacket( CONNID connID, LPVOID lpRcvBuf,
  35. LPWORD lpwLen, LPWORD lpwPktStatus );
  36. BOOL NDDEXmtPacket( CONNID connID, LPVOID lpXmtBuf, WORD wPktLen );
  37. BOOL NDDESetConnectionConfig( CONNID connID,
  38. WORD wMaxUnAckPkts,
  39. WORD wPktSize,
  40. LPSTR lpszName );
  41. BOOL NDDEGetConnectionConfig( CONNID connID,
  42. WORD FAR *lpwMaxUnAckPkts,
  43. WORD FAR *lpwPktSize,
  44. DWORD FAR *lptimeoutRcvConnCmd,
  45. DWORD FAR *lptimeoutRcvConnRsp,
  46. DWORD FAR *lptimeoutMemoryPause,
  47. DWORD FAR *lptimeoutKeepAlive,
  48. DWORD FAR *lptimeoutXmtStuck,
  49. DWORD FAR *lptimeoutSendRsp,
  50. WORD FAR *lpwMaxNoResponse,
  51. WORD FAR *lpwMaxXmtErr,
  52. WORD FAR *lpwMaxMemErr );
  53. #ifdef HASUI
  54. #ifdef _WINDOWS
  55. VOID _export LogDebugInfo( CONNID connID, DWORD dwFlags );
  56. typedef VOID (*FP_LogDebugInfo) ( CONNID connId, DWORD dwFlags );
  57. VOID _export Configure( void );
  58. typedef VOID (*FP_Configure) ( void );
  59. #endif
  60. #ifdef VAX
  61. VOID LogDebugInfo( CONNID connID, DWORD dwFlags );
  62. typedef VOID (*FP_LogDebugInfo) ( CONNID connId, DWORD dwFlags );
  63. #endif
  64. #endif
  65. /*
  66. Connection status information
  67. */
  68. #define NDDE_CONN_OK ((DWORD)0x00000001L)
  69. #define NDDE_CONN_CONNECTING ((DWORD)0x00000002L)
  70. #define NDDE_CONN_STATUS_MASK (NDDE_CONN_OK | NDDE_CONN_CONNECTING)
  71. #define NDDE_CALL_RCV_PKT ((DWORD)0x00000004L)
  72. #define NDDE_READY_TO_XMT ((DWORD)0x00000008L)
  73. /*
  74. Packet Status
  75. */
  76. #define NDDE_PKT_HDR_OK (0x0001)
  77. #define NDDE_PKT_HDR_ERR (0x0002)
  78. #define NDDE_PKT_DATA_OK (0x0004)
  79. #define NDDE_PKT_DATA_ERR (0x0008)
  80. #ifdef _WINDOWS
  81. typedef BOOL (*FP_Init) ( LPSTR lpszNodeName, HWND hWndNetdde );
  82. #else
  83. typedef BOOL (*FP_Init) ( LPSTR lpszNodeName );
  84. #endif
  85. typedef void (*FP_TimeSlice) ( void );
  86. typedef void (*FP_Shutdown) ( void );
  87. typedef DWORD (*FP_GetCAPS) ( WORD nIndex );
  88. #ifdef _WINDOWS
  89. typedef CONNID (*FP_AddConnection) ( LPSTR nodeName );
  90. #else
  91. typedef CONNID (*FP_AddConnection) ( LPSTR nodeName, HPKTZ hPktzNotify );
  92. #endif
  93. typedef CONNID (*FP_GetNewConnection) ( void );
  94. typedef VOID (*FP_DeleteConnection) ( CONNID connId );
  95. typedef DWORD (*FP_GetConnectionStatus) ( CONNID connId );
  96. typedef BOOL (*FP_RcvPacket) ( CONNID connId, LPVOID lpRcvBuf,
  97. LPWORD lpwLen, LPWORD lpwPktStatus );
  98. typedef BOOL (*FP_XmtPacket) ( CONNID connId, LPVOID lpXmtBuf, WORD wPktLen );
  99. typedef BOOL (*FP_SetConnectionConfig) ( CONNID connId,
  100. WORD wMaxUnAckPkts,
  101. WORD wPktSize,
  102. LPSTR lpszName );
  103. typedef BOOL (*FP_GetConnectionConfig) ( CONNID connId,
  104. WORD FAR *lpwMaxUnAckPkts,
  105. WORD FAR *lpwPktSize,
  106. DWORD FAR *lptimeoutRcvConnCmd,
  107. DWORD FAR *lptimeoutRcvConnRsp,
  108. DWORD FAR *lptimeoutMemoryPause,
  109. DWORD FAR *lptimeoutKeepAlive,
  110. DWORD FAR *lptimeoutXmtStuck,
  111. DWORD FAR *lptimeoutSendRsp,
  112. WORD FAR *lpwMaxNoResponse,
  113. WORD FAR *lpwMaxXmtErr,
  114. WORD FAR *lpwMaxMemErr );
  115. typedef struct {
  116. FP_Init Init;
  117. FP_GetCAPS GetCAPS;
  118. FP_GetNewConnection GetNewConnection;
  119. FP_AddConnection AddConnection;
  120. FP_DeleteConnection DeleteConnection;
  121. FP_GetConnectionStatus GetConnectionStatus;
  122. FP_RcvPacket RcvPacket;
  123. FP_XmtPacket XmtPacket;
  124. FP_SetConnectionConfig SetConnectionConfig;
  125. FP_GetConnectionConfig GetConnectionConfig;
  126. FP_Shutdown Shutdown;
  127. FP_TimeSlice TimeSlice;
  128. #ifdef HASUI
  129. #ifdef _WINDOWS
  130. FP_LogDebugInfo LogDebugInfo;
  131. FP_Configure Configure;
  132. #endif
  133. #ifdef VAX
  134. FP_LogDebugInfo LogDebugInfo;
  135. #endif
  136. #endif
  137. char dllName[ 9 ];
  138. } NIPTRS;
  139. typedef NIPTRS FAR *LPNIPTRS;
  140. /* returns the next available network interface that supports mapping names
  141. to addresses */
  142. BOOL GetNextMappingNetIntf( LPNIPTRS FAR *lplpNiPtrs, int FAR *lpnNi );
  143. /* converts a string representation of netintf to pointer set */
  144. BOOL NameToNetIntf( LPSTR lpszName, LPNIPTRS FAR *lplpNiPtrs );
  145. #endif
  146.