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.

153 lines
4.6 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. /*
  54. Connection status information
  55. */
  56. #define NDDE_CONN_OK ((DWORD)0x00000001L)
  57. #define NDDE_CONN_CONNECTING ((DWORD)0x00000002L)
  58. #define NDDE_CONN_STATUS_MASK (NDDE_CONN_OK | NDDE_CONN_CONNECTING)
  59. #define NDDE_CALL_RCV_PKT ((DWORD)0x00000004L)
  60. #define NDDE_READY_TO_XMT ((DWORD)0x00000008L)
  61. /*
  62. Packet Status
  63. */
  64. #define NDDE_PKT_HDR_OK (0x0001)
  65. #define NDDE_PKT_HDR_ERR (0x0002)
  66. #define NDDE_PKT_DATA_OK (0x0004)
  67. #define NDDE_PKT_DATA_ERR (0x0008)
  68. #ifdef _WINDOWS
  69. typedef BOOL (*FP_Init) ( LPSTR lpszNodeName, HWND hWndNetdde );
  70. #else
  71. typedef BOOL (*FP_Init) ( LPSTR lpszNodeName );
  72. #endif
  73. typedef void (*FP_TimeSlice) ( void );
  74. typedef void (*FP_Shutdown) ( void );
  75. typedef DWORD (*FP_GetCAPS) ( WORD nIndex );
  76. #ifdef _WINDOWS
  77. typedef CONNID (*FP_AddConnection) ( LPSTR nodeName );
  78. #else
  79. typedef CONNID (*FP_AddConnection) ( LPSTR nodeName, HPKTZ hPktzNotify );
  80. #endif
  81. typedef CONNID (*FP_GetNewConnection) ( void );
  82. typedef VOID (*FP_DeleteConnection) ( CONNID connId );
  83. typedef DWORD (*FP_GetConnectionStatus) ( CONNID connId );
  84. typedef BOOL (*FP_RcvPacket) ( CONNID connId, LPVOID lpRcvBuf,
  85. LPWORD lpwLen, LPWORD lpwPktStatus );
  86. typedef BOOL (*FP_XmtPacket) ( CONNID connId, LPVOID lpXmtBuf, WORD wPktLen );
  87. typedef BOOL (*FP_SetConnectionConfig) ( CONNID connId,
  88. WORD wMaxUnAckPkts,
  89. WORD wPktSize,
  90. LPSTR lpszName );
  91. typedef BOOL (*FP_GetConnectionConfig) ( CONNID connId,
  92. WORD FAR *lpwMaxUnAckPkts,
  93. WORD FAR *lpwPktSize,
  94. DWORD FAR *lptimeoutRcvConnCmd,
  95. DWORD FAR *lptimeoutRcvConnRsp,
  96. DWORD FAR *lptimeoutMemoryPause,
  97. DWORD FAR *lptimeoutKeepAlive,
  98. DWORD FAR *lptimeoutXmtStuck,
  99. DWORD FAR *lptimeoutSendRsp,
  100. WORD FAR *lpwMaxNoResponse,
  101. WORD FAR *lpwMaxXmtErr,
  102. WORD FAR *lpwMaxMemErr );
  103. typedef struct {
  104. FP_Init Init;
  105. FP_GetCAPS GetCAPS;
  106. FP_GetNewConnection GetNewConnection;
  107. FP_AddConnection AddConnection;
  108. FP_DeleteConnection DeleteConnection;
  109. FP_GetConnectionStatus GetConnectionStatus;
  110. FP_RcvPacket RcvPacket;
  111. FP_XmtPacket XmtPacket;
  112. FP_SetConnectionConfig SetConnectionConfig;
  113. FP_GetConnectionConfig GetConnectionConfig;
  114. FP_Shutdown Shutdown;
  115. FP_TimeSlice TimeSlice;
  116. char dllName[ 9 ];
  117. } NIPTRS;
  118. typedef NIPTRS FAR *LPNIPTRS;
  119. /* returns the next available network interface that supports mapping names
  120. to addresses */
  121. BOOL GetNextMappingNetIntf( LPNIPTRS FAR *lplpNiPtrs, int FAR *lpnNi );
  122. /* converts a string representation of netintf to pointer set */
  123. BOOL NameToNetIntf( LPSTR lpszName, LPNIPTRS FAR *lplpNiPtrs );
  124. #endif
  125.