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.

178 lines
6.8 KiB

  1. /*****************************************************************************\
  2. * *
  3. * nddeapi.h - Network DDE share manipulation and control functions *
  4. * *
  5. * Version 1.0 *
  6. * *
  7. * NOTE: windows.h must be #included first *
  8. * *
  9. * Copyright (c) 1992, Microsoft Corp. All rights reserved. *
  10. * *
  11. \*****************************************************************************/
  12. #ifndef _INC_NDDEAPI
  13. #define _INC_NDDEAPI
  14. #ifndef RC_INVOKED
  15. #pragma pack(1) /* Assume byte packing throughout */
  16. #endif /* !RC_INVOKED */
  17. #ifdef __cplusplus
  18. extern "C" { /* Assume C declarations for C++ */
  19. #endif /* __cplusplus */
  20. #ifndef WINAPI /* If not included with 3.1 headers... */
  21. #define WINAPI FAR PASCAL
  22. #define CALLBACK FAR PASCAL
  23. #define LPCSTR LPSTR
  24. #define UINT WORD
  25. #define LPARAM LONG
  26. #define WPARAM WORD
  27. #define LRESULT LONG
  28. #define HMODULE HANDLE
  29. #define HINSTANCE HANDLE
  30. #define HLOCAL HANDLE
  31. #define HGLOBAL HANDLE
  32. #endif /* WINAPI */
  33. #ifndef CNLEN /* If not included with netapi header */
  34. #define CNLEN 15 /* Computer name length */
  35. #define UNCLEN (CNLEN+2) /* UNC computer name length */
  36. #endif /* CNLEN */
  37. /* API error codes */
  38. #define NDDE_NO_ERROR 0
  39. #define NDDE_ACCESS_DENIED 1
  40. #define NDDE_BUF_TOO_SMALL 2
  41. #define NDDE_ERROR_MORE_DATA 3
  42. #define NDDE_INVALID_SERVER 4
  43. #define NDDE_INVALID_SHARE 5
  44. #define NDDE_INVALID_PARAMETER 6
  45. #define NDDE_INVALID_LEVEL 7
  46. #define NDDE_INVALID_PASSWORD 8
  47. #define NDDE_INVALID_ITEMNAME 9
  48. #define NDDE_INVALID_TOPIC 10
  49. #define NDDE_INTERNAL_ERROR 11
  50. #define NDDE_OUT_OF_MEMORY 12
  51. #define NDDE_INVALID_APPNAME 13
  52. #define NDDE_NOT_IMPLEMENTED 14
  53. #define NDDE_SHARE_ALREADY_EXIST 15
  54. #define NDDE_SHARE_NOT_EXIST 16
  55. #define NDDE_INVALID_FILENAME 17
  56. #define NDDE_NOT_RUNNING 18
  57. #define NDDE_INVALID_WINDOW 19
  58. #define NDDE_INVALID_SESSION 20
  59. /* string size constants */
  60. #define MAX_NDDESHARENAME 64
  61. #define MAX_PASSWORD 15
  62. #define MAX_USERNAME 15
  63. #define MAX_DOMAINNAME 15
  64. #define MAX_APPNAME 255
  65. #define MAX_TOPICNAME 255
  66. #define MAX_ITEMNAME 255
  67. /* permission mask bits */
  68. #define NDDEACCESS_REQUEST 0x00000001L
  69. #define NDDEACCESS_ADVISE 0x00000002L
  70. #define NDDEACCESS_POKE 0x00000004L
  71. #define NDDEACCESS_EXECUTE 0x00000008L
  72. #define NDDEACCESS_START_APP 0x00000010L
  73. /* connectFlags bits for ndde service affix */
  74. #define NDDEF_NOPASSWORDPROMPT 0x0001
  75. #define NDDEF_NOCACHELOOKUP 0x0002
  76. #define NDDEF_STRIP_NDDE 0x0004
  77. /* NDDESHAREITEMINFO - contains information about item security */
  78. struct NDdeShareItemInfo_tag {
  79. LPSTR lpszItem;
  80. DWORD dwPermissions;
  81. };
  82. typedef struct NDdeShareItemInfo_tag NDDESHAREITEMINFO;
  83. typedef struct NDdeShareItemInfo_tag * PNDDESHAREITEMINFO;
  84. typedef struct NDdeShareItemInfo_tag far * LPNDDESHAREITEMINFO;
  85. /* NDDESHAREINFO - contains information about a NDDE share */
  86. struct NDdeShareInfo_tag {
  87. char szShareName[ MAX_NDDESHARENAME+1 ];
  88. LPSTR lpszTargetApp;
  89. LPSTR lpszTargetTopic;
  90. LPBYTE lpbPassword1;
  91. DWORD cbPassword1;
  92. DWORD dwPermissions1;
  93. LPBYTE lpbPassword2;
  94. DWORD cbPassword2;
  95. DWORD dwPermissions2;
  96. LPSTR lpszItem;
  97. LONG cAddItems;
  98. LPNDDESHAREITEMINFO lpNDdeShareItemInfo;
  99. };
  100. typedef struct NDdeShareInfo_tag NDDESHAREINFO;
  101. typedef struct NDdeShareInfo_tag * PNDDESHAREINFO;
  102. typedef struct NDdeShareInfo_tag far * LPNDDESHAREINFO;
  103. /* ddesess_Status defines */
  104. #define NDDESESS_CONNECTING_WAIT_NET_INI 1
  105. #define NDDESESS_CONNECTING_WAIT_OTHR_ND 2
  106. #define NDDESESS_CONNECTED 3
  107. #define NDDESESS_DISCONNECTING 4
  108. /* NDDESESSINFO - contains information about a NDDE session */
  109. struct NDdeSessInfo_tag {
  110. char szClientName[UNCLEN+1];
  111. short Status;
  112. DWORD UniqueID;
  113. };
  114. typedef struct NDdeSessInfo_tag NDDESESSINFO;
  115. typedef struct NDdeSessInfo_tag * PNDDESESSINFO;
  116. typedef struct NDdeSessInfo_tag far * LPNDDESESSINFO;
  117. /* ddeconn_Status defines */
  118. #define NDDECONN_WAIT_LOCAL_INIT_ACK 1
  119. #define NDDECONN_WAIT_NET_INIT_ACK 2
  120. #define NDDECONN_OK 3
  121. #define NDDECONN_TERMINATING 4
  122. #define NDDECONN_WAIT_USER_PASSWORD 5
  123. /* NDDECONNINFO - contains information about a NDDE conversation */
  124. struct NDdeConnInfo_tag {
  125. LPSTR lpszShareName;
  126. short Status;
  127. short pad;
  128. };
  129. typedef struct NDdeConnInfo_tag NDDECONNINFO;
  130. typedef struct NDdeConnInfo_tag * PNDDECONNINFO;
  131. typedef struct NDdeConnInfo_tag far * LPNDDECONNINFO;
  132. UINT WINAPI NDdeShareAdd(LPSTR, UINT, LPBYTE, DWORD );
  133. UINT WINAPI NDdeShareDel(LPSTR, LPSTR, UINT );
  134. UINT WINAPI NDdeShareEnum(LPSTR, UINT, LPBYTE, DWORD, LPDWORD, LPDWORD );
  135. UINT WINAPI NDdeShareGetInfo(LPSTR, LPSTR, UINT, LPBYTE, DWORD, LPDWORD, LPWORD);
  136. UINT WINAPI NDdeShareSetInfo(LPSTR, LPSTR, UINT, LPBYTE, DWORD, WORD);
  137. UINT WINAPI NDdeGetErrorString(UINT, LPSTR, DWORD);
  138. BOOL WINAPI NDdeIsValidShareName(LPSTR);
  139. BOOL WINAPI NDdeIsValidPassword(LPSTR);
  140. BOOL WINAPI NDdeIsValidTopic(LPSTR);
  141. BOOL WINAPI NDdeIsSharingAllowed(VOID);
  142. UINT WINAPI NDdeSessionEnum(LPSTR, UINT, LPBYTE, DWORD, LPDWORD, LPDWORD);
  143. UINT WINAPI NDdeConnectionEnum(LPSTR, LPSTR, DWORD, UINT, LPBYTE, DWORD, LPDWORD, LPDWORD);
  144. UINT WINAPI NDdeSessionClose(LPSTR, LPSTR, DWORD);
  145. HWND WINAPI NDdeGetWindow(VOID);
  146. UINT WINAPI NDdeGetClientInfo(HWND, LPSTR, LONG, LPSTR, LONG);
  147. UINT WINAPI NDdeGetNodeName(LPSTR, LONG);
  148. #ifdef __cplusplus
  149. }
  150. #endif /* __cplusplus */
  151. #ifndef RC_INVOKED
  152. #pragma pack()
  153. #endif /* !RC_INVOKED */
  154. #endif /* _INC_NDDEAPI */