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.

184 lines
6.3 KiB

  1. //========================================================================
  2. //
  3. // NDDEAPIS.H supplemental include file for dde share apis
  4. //
  5. //========================================================================
  6. // tabstop = 4
  7. #ifndef NDDEAPI_INCLUDED
  8. #define NDDEAPI_INCLUDED
  9. #ifndef _INC_NDDESEC
  10. #include "nddesec.h"
  11. #endif
  12. // ============= connectFlags options =====
  13. #define DDEF_NOPASSWORDPROMPT 0x0001
  14. // others reserved!
  15. //============== Api Constants ============
  16. // String size constants
  17. #define CNLEN 15 // from netcons.
  18. #define UNCLEN (CNLEN+2)
  19. #define MAX_PASSWORD 15
  20. // Permission mask bits
  21. #define DDEACCESS_REQUEST NDDE_SHARE_REQUEST
  22. #define DDEACCESS_ADVISE NDDE_SHARE_ADVISE
  23. #define DDEACCESS_POKE NDDE_SHARE_POKE
  24. #define DDEACCESS_EXECUTE NDDE_SHARE_EXECUTE
  25. /*
  26. #define DDEACCESS_REQUEST 0x00000001L
  27. #define DDEACCESS_ADVISE 0x00000002L
  28. #define DDEACCESS_POKE 0x00000004L
  29. #define DDEACCESS_EXECUTE 0x00000008L
  30. #define DDEACCESS_START_APP 0x00000010L
  31. */
  32. // ============== Data Structures =========
  33. //=============================================================
  34. // DDESESSINFO - contains information about a DDE session
  35. // ddesess_Status defines
  36. #define DDESESS_CONNECTING_WAIT_NET_INI 1
  37. #define DDESESS_CONNECTING_WAIT_OTHR_ND 2
  38. #define DDESESS_CONNECTED 3
  39. #define DDESESS_DISCONNECTING 4
  40. struct DdeSessInfo_tag {
  41. char ddesess_ClientName[UNCLEN+1];
  42. short ddesess_Status;
  43. DWORD_PTR ddesess_Cookie; // used to distinguish
  44. // clients of the same
  45. // name on difft. nets
  46. };
  47. typedef struct DdeSessInfo_tag DDESESSINFO;
  48. typedef struct DdeSessInfo_tag * PDDESESSINFO;
  49. typedef struct DdeSessInfo_tag far * LPDDESESSINFO;
  50. //=============================================================
  51. // DDECONNINFO - contains information about a DDE conversation
  52. // ddeconn_Status defines
  53. #define DDECONN_WAIT_LOCAL_INIT_ACK 1
  54. #define DDECONN_WAIT_NET_INIT_ACK 2
  55. #define DDECONN_OK 3
  56. #define DDECONN_TERMINATING 4
  57. #define DDECONN_WAIT_USER_PASSWORD 5
  58. struct DdeConnInfo_tag {
  59. LPSTR ddeconn_ShareName;
  60. short ddeconn_Status;
  61. short ddeconn_pad;
  62. };
  63. typedef struct DdeConnInfo_tag DDECONNINFO;
  64. typedef struct DdeConnInfo_tag * PDDECONNINFO;
  65. typedef struct DdeConnInfo_tag far * LPDDECONNINFO;
  66. // typedef UINT WINAPI DDEAPIFUNCTION;
  67. //=============================================================
  68. //=============================================================
  69. //
  70. // API FUNCTION PROTOTYPES
  71. //
  72. //=============================================================
  73. //=============================================================
  74. // The following 3 functions are to be supplied (not necessarily part of API)
  75. LPBYTE WINAPI
  76. DdeGetSecurityKey( // pointer to security key or NULL if none
  77. LPDWORD lpcbSecurityKeySize // gets size of security key
  78. );
  79. LPBYTE WINAPI
  80. DdeEnkrypt1( // pointer to enkrypted byte stream returned
  81. LPBYTE lpPassword, // password to be enkrypted
  82. DWORD cPasswordSize, // size of password to be enkrypted
  83. LPBYTE lpKey, // pointer to key (NULL for phase 1)
  84. DWORD cKey, // size of key (0 for phase 1)
  85. LPDWORD lpcbPasswordK1Size // gets size of resulting enkrypted stream
  86. );
  87. LPBYTE WINAPI
  88. DdeEnkrypt2( // pointer to enkrypted byte stream returned
  89. LPBYTE lpPasswordK1, // password output in first phase
  90. DWORD cPasswordK1Size, // size of password to be enkrypted
  91. LPBYTE lpKey, // pointer to key
  92. DWORD cKey, // size of key
  93. LPDWORD lpcbPasswordK2Size // get size of resulting enkrypted stream
  94. );
  95. //////////////////////////////////////////////////////
  96. // NetDDE Statistics Access
  97. UINT WINAPI
  98. DdeSessionEnum (
  99. LPSTR lpszServer, // server to execute on ( must be NULL )
  100. UINT nLevel, // info level - must be 1
  101. LPBYTE lpBuffer, // pointer to buffer that receiv
  102. DWORD cBufSize, // size of supplied buffer
  103. LPDWORD lpcbTotalAvailable, // number of bytes filled in
  104. LPDWORD lpnItems // number of names
  105. );
  106. UINT WINAPI
  107. DdeConnectionEnum (
  108. LPSTR lpszServer, // server to execute on ( must be NULL )
  109. LPSTR lpszClientName, // name of client to enum shares from
  110. // if NULL, all
  111. DWORD Cookie, // cookie returned from ddesessi
  112. // is used to distinguish clients of the
  113. // same name.
  114. UINT nLevel, // info level - must be 1
  115. LPBYTE lpBuffer, // pointer to supplied buffer
  116. // which receive null terminated names
  117. // followed by a double null
  118. DWORD cBufSize, // size of supplied buffer
  119. LPDWORD lpcbTotalAvailable, // number of bytes filled in
  120. LPDWORD lpnItems // number of data items returned
  121. );
  122. UINT WINAPI
  123. DdeSessionClose (
  124. LPSTR lpszServer, // server to execute on ( must be NULL )
  125. LPSTR lpszClientName, // client to close
  126. DWORD cookie // cookie to identify client
  127. );
  128. UINT WINAPI
  129. DdeGetClientInfo (
  130. HWND hWndClient,
  131. LPSTR lpszClientNode,
  132. LONG cClientNodeLimit,
  133. LPSTR lpszClientApp,
  134. LONG cClientAppLimit
  135. );
  136. UINT WINAPI
  137. DdeGetNodeName(
  138. LPSTR lpszNodeName,
  139. LONG cNodeNameLimit
  140. );
  141. #endif // NDDEAPI_INCLUDED