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.

498 lines
16 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1992 **/
  4. /**********************************************************************/
  5. /*
  6. smx.h
  7. This file contains the common messages, manifests, types, and
  8. structures used by Server Manager Extensions.
  9. NOTE: You must include windows.h and lmcons.h *before* this file.
  10. FILE HISTORY:
  11. KeithMo 19-Oct-1992 Created, version 1.2+ of SMX spec.
  12. KeithMo 07-Dec-1992 Conform with version 1.6 of SMX spec.
  13. JonN 16-May-1996 Added GETSERVERSEL2 and GETCURFOCUS2
  14. */
  15. #ifndef _SMX_H_
  16. #define _SMX_H_
  17. //
  18. // This is the maximum length allowed for an extension menu item.
  19. //
  20. #define MENU_TEXT_LEN 50
  21. //
  22. // This is the current version number of the extension interface.
  23. // Version 0 is the original version (NT 3.x).
  24. // Version 1 supports GETSERVERSEL2 and GETCURFOCUS2 (NT 4.x).
  25. //
  26. #define SME_VERSION 1
  27. //
  28. // These are the messages sent from the extension to the
  29. // Server Manager application.
  30. //
  31. // SM_GETSELCOUNT
  32. //
  33. // Purpose - Retrieves the number of selected items in
  34. // the specified listbox.
  35. //
  36. // wParam - Listbox index. This 0-based index specifies
  37. // the listbox to query. For the Server Manager,
  38. // this must always be zero.
  39. //
  40. // lParam - Points to an SMS_GETSELCOUNT structure.
  41. //
  42. // Returns - TRUE if successful, FALSE if unsuccessful.
  43. //
  44. //
  45. // SM_GETSERVERSEL[A][2]
  46. // New clients should use version 2 when
  47. // SMS_LOADMENU.dwVersion is 1 or greater.
  48. //
  49. // Purpose - Retrieves a particular selection.
  50. //
  51. // wParam - Selection index. This 0-based index specifies
  52. // the selected item to query. This is useful
  53. // for muliple-select listboxes. Since the Server
  54. // manager uses a single-select listbox, this
  55. // value must always be zero.
  56. //
  57. // lParam - Points to an SMS_GETSERVERSEL[AW] structure.
  58. //
  59. // Returns - TRUE if successful, FALSE if unsuccessful.
  60. //
  61. // SM_GETCURFOCUS[AW][2]
  62. //
  63. // Purpose - Retrieves the current application focus.
  64. // New clients should use version 2 when
  65. // SMS_LOADMENU.dwVersion is 1 or greater.
  66. //
  67. // wParam - Must be zero.
  68. //
  69. // lParam - Points to a SMS_GETCURFOCUS structure.
  70. //
  71. // Returns - TRUE if successful, FALSE if unsuccessful.
  72. //
  73. //
  74. // SM_GETOPTIONS
  75. //
  76. // Purpose - Retrieves the current option settings
  77. //
  78. // wParam - Must be zero.
  79. //
  80. // lParam - Points to a SMS_GETOPTIONS structure.
  81. //
  82. // Returns - TRUE if successful, FALSE if unsuccessful.
  83. //
  84. #define SM_GETSELCOUNT (WM_USER + 1000)
  85. #define SM_GETSERVERSELA (WM_USER + 1001)
  86. #define SM_GETSERVERSELW (WM_USER + 1002)
  87. #define SM_GETCURFOCUSA (WM_USER + 1003)
  88. #define SM_GETCURFOCUSW (WM_USER + 1004)
  89. #define SM_GETOPTIONS (WM_USER + 1005)
  90. #define SM_GETSERVERSEL2A (WM_USER + 1006)
  91. #define SM_GETSERVERSEL2W (WM_USER + 1007)
  92. #define SM_GETCURFOCUS2A (WM_USER + 1008)
  93. #define SM_GETCURFOCUS2W (WM_USER + 1009)
  94. #ifdef UNICODE
  95. #define SM_GETSERVERSEL SM_GETSERVERSELW
  96. #define SM_GETCURFOCUS SM_GETCURFOCUSW
  97. #define SM_GETSERVERSEL2 SM_GETSERVERSEL2W
  98. #define SM_GETCURFOCUS2 SM_GETCURFOCUS2W
  99. #else // !UNICODE
  100. #define SM_GETSERVERSEL SM_GETSERVERSELA
  101. #define SM_GETCURFOCUS SM_GETCURFOCUSA
  102. #define SM_GETSERVERSEL2 SM_GETSERVERSEL2A
  103. #define SM_GETCURFOCUS2 SM_GETCURFOCUS2A
  104. #endif // UNICODE
  105. //
  106. // These structures are used when the extension is
  107. // communicating with the application.
  108. //
  109. //
  110. // The SMS_LOADMENU[AW] structure is passed to the extension's
  111. // SMELoadMenu[AW] entrypoint when the extension is loaded.
  112. //
  113. // dwVersion - On entry to SMELoadMenu[AW], this will
  114. // contain the maximum extension version
  115. // supported by the Server Manager. If the
  116. // extension supports a lower version, it
  117. // should set this field appropriately before
  118. // returning. The Server Manager will use
  119. // the returned value to determine the
  120. // capabilities of the extension.
  121. //
  122. // Version 0 is the original version (NT 3.x).
  123. // Version 1 supports GETSERVERSEL2 and GETCURFOCUS2.
  124. //
  125. // szMenuName - The name of the menu item that is to appear
  126. // in the app's main menu. This value will also
  127. // appear in the "Help On Extensions" submene and
  128. // the "View" menu.
  129. //
  130. // hMenu - A valid HMENU for the popup-menu to be inserted
  131. // into the app's main menu. Ownership of this
  132. // handle transfers to the Server Manager. The
  133. // extension should *not* destroy this handle.
  134. //
  135. // szHelpFileName - The name of the help file associated with this
  136. // extension. This file will be used for the
  137. // "Help On Extensions" menu. This will also be
  138. // used when the user presses [F1] while the
  139. // extension's menu is dropped.
  140. //
  141. // dwServerType - A bitmask containing the appropriate server type
  142. // bit associated with the extension. It is
  143. // assumed that each extension will be associated
  144. // with a unique server type. For example,
  145. // SV_TYPE_WFW represents Windows for Workgroups
  146. // servers.
  147. //
  148. // dwMenuDelta - The Server Manager will apply this delta
  149. // to each menu ID present in hMenu. This is
  150. // to prevent conflicts with other extension's
  151. // menu IDs.
  152. //
  153. typedef struct _SMS_LOADMENUA
  154. {
  155. DWORD dwVersion;
  156. CHAR szMenuName[MENU_TEXT_LEN + 1];
  157. HMENU hMenu;
  158. CHAR szHelpFileName[MAX_PATH];
  159. DWORD dwServerType;
  160. DWORD dwMenuDelta;
  161. } SMS_LOADMENUA, * PSMS_LOADMENUA;
  162. typedef struct _SMS_LOADMENUW
  163. {
  164. DWORD dwVersion;
  165. WCHAR szMenuName[MENU_TEXT_LEN + 1];
  166. HMENU hMenu;
  167. WCHAR szHelpFileName[MAX_PATH];
  168. DWORD dwServerType;
  169. DWORD dwMenuDelta;
  170. } SMS_LOADMENUW, * PSMS_LOADMENUW;
  171. #ifdef UNICODE
  172. #define SMS_LOADMENU SMS_LOADMENUW
  173. #define PSMS_LOADMENU PSMS_LOADMENUW
  174. #else // !UNICODE
  175. #define SMS_LOADMENU SMS_LOADMENUA
  176. #define PSMS_LOADMENU PSMS_LOADMENUA
  177. #endif // UNICODE
  178. //
  179. // The SMS_GETSERVERSEL[AW][2] structure is filled in by the
  180. // Server Manager when it handles SM_GETSERVERSEL[AW][2] messages.
  181. // This is used to return the current selection to the extension.
  182. //
  183. // SMS_GETSERVERSEL is outdated due to the change in server name length,
  184. // use SMS_GETSERVERSEL2 when SMS_LOADMENU.dwVersion is 1 or greater.
  185. //
  186. // szServerName - Will receive the UNC name of the selected
  187. // server.
  188. //
  189. // dwServerType - Will receive the server type mask associated
  190. // with the server. This field may be 0 if
  191. // the type is unknown.
  192. //
  193. typedef struct _SMS_GETSERVERSELA
  194. {
  195. CHAR szServerName[UNCLEN+1];
  196. DWORD dwServerType;
  197. } SMS_GETSERVERSELA, * PSMS_GETSERVERSELA;
  198. typedef struct _SMS_GETSERVERSELW
  199. {
  200. WCHAR szServerName[UNCLEN+1];
  201. DWORD dwServerType;
  202. } SMS_GETSERVERSELW, * PSMS_GETSERVERSELW;
  203. typedef struct _SMS_GETSERVERSEL2A
  204. {
  205. CHAR szServerName[MAX_PATH];
  206. DWORD dwServerType;
  207. } SMS_GETSERVERSEL2A, * PSMS_GETSERVERSEL2A;
  208. typedef struct _SMS_GETSERVERSEL2W
  209. {
  210. WCHAR szServerName[MAX_PATH];
  211. DWORD dwServerType;
  212. } SMS_GETSERVERSEL2W, * PSMS_GETSERVERSEL2W;
  213. #ifdef UNICODE
  214. #define SMS_GETSERVERSEL SMS_GETSERVERSELW
  215. #define PSMS_GETSERVERSEL PSMS_GETSERVERSELW
  216. #define SMS_GETSERVERSEL2 SMS_GETSERVERSEL2W
  217. #define PSMS_GETSERVERSEL2 PSMS_GETSERVERSEL2W
  218. #else // !UNICODE
  219. #define SMS_GETSERVERSEL SMS_GETSERVERSELA
  220. #define PSMS_GETSERVERSEL PSMS_GETSERVERSELA
  221. #define SMS_GETSERVERSEL2 SMS_GETSERVERSEL2A
  222. #define PSMS_GETSERVERSEL2 PSMS_GETSERVERSEL2A
  223. #endif // UNICODE
  224. //
  225. // The SMS_GETSELCOUNT structure is filled in by the Server Manager
  226. // when it handles the SM_GETSELCOUNT message. This is used to
  227. // return the number of selected items to the extension. In the
  228. // current implementation, this will be either 0 (empty listbox)
  229. // or 1 (single selection).
  230. //
  231. // dwItems - The number of selected items in the listbox.
  232. //
  233. typedef struct _SMS_GETSELCOUNT
  234. {
  235. DWORD dwItems;
  236. } SMS_GETSELCOUNT, * PSMS_GETSELCOUNT;
  237. //
  238. // The SMS_GETCURFOCUS[AW][2] structure is filled in by the Server Manager
  239. // when it handles the SM_GETCURFOCUS[2] message. This is used to
  240. // return the current focus of the User Manager application.
  241. //
  242. // SMS_GETCURFOCUS is outdated due to the change in server name length,
  243. // use SMS_GETCURFOCUS2 when SMS_LOADMENU.dwVersion is 1 or greater.
  244. //
  245. // szFocus - The domain name or server name of the current
  246. // focus. Server names can be distinguished
  247. // by the leading backslashes, or by dwFocusType.
  248. //
  249. // dwFocusType - This is the type of focus, either
  250. // SM_FOCUS_TYPE_NT_DOMAIN
  251. // SM_FOCUS_TYPE_LM_DOMAIN
  252. // SM_FOCUS_TYPE_UNKNOWN_DOMAIN
  253. // SM_FOCUS_TYPE_NT_SERVER
  254. // SM_FOCUS_TYPE_LM_SERVER
  255. // SM_FOCUS_TYPE_WFW_SERVER
  256. // SM_FOCUS_TYPE_UNKNOWN_SERVER
  257. //
  258. #define SM_FOCUS_TYPE_NT_DOMAIN 1
  259. #define SM_FOCUS_TYPE_LM_DOMAIN 2
  260. #define SM_FOCUS_TYPE_UNKNOWN_DOMAIN 3
  261. #define SM_FOCUS_TYPE_NT_SERVER 4
  262. #define SM_FOCUS_TYPE_LM_SERVER 5
  263. #define SM_FOCUS_TYPE_WFW_SERVER 6
  264. #define SM_FOCUS_TYPE_UNKNOWN_SERVER 7
  265. typedef struct _SMS_GETCURFOCUSA
  266. {
  267. CHAR szFocus[UNCLEN+1];
  268. DWORD dwFocusType;
  269. } SMS_GETCURFOCUSA, * PSMS_GETCURFOCUSA;
  270. typedef struct _SMS_GETCURFOCUSW
  271. {
  272. WCHAR szFocus[UNCLEN+1];
  273. DWORD dwFocusType;
  274. } SMS_GETCURFOCUSW, * PSMS_GETCURFOCUSW;
  275. typedef struct _SMS_GETCURFOCUS2A
  276. {
  277. CHAR szFocus[MAX_PATH];
  278. DWORD dwFocusType;
  279. } SMS_GETCURFOCUS2A, * PSMS_GETCURFOCUS2A;
  280. typedef struct _SMS_GETCURFOCUS2W
  281. {
  282. WCHAR szFocus[MAX_PATH];
  283. DWORD dwFocusType;
  284. } SMS_GETCURFOCUS2W, * PSMS_GETCURFOCUS2W;
  285. #ifdef UNICODE
  286. #define SMS_GETCURFOCUS SMS_GETCURFOCUSW
  287. #define PSMS_GETCURFOCUS PSMS_GETCURFOCUSW
  288. #define SMS_GETCURFOCUS2 SMS_GETCURFOCUS2W
  289. #define PSMS_GETCURFOCUS2 PSMS_GETCURFOCUS2W
  290. #else // UNICODE
  291. #define SMS_GETCURFOCUS SMS_GETCURFOCUSA
  292. #define PSMS_GETCURFOCUS PSMS_GETCURFOCUSA
  293. #define SMS_GETCURFOCUS2 SMS_GETCURFOCUS2A
  294. #define PSMS_GETCURFOCUS2 PSMS_GETCURFOCUS2A
  295. #endif // UNICODE
  296. //
  297. // The SMS_GETOPTIONS structure is filled in by the Server Manager
  298. // when it handles the SM_GETOPTIONS message. This is used to
  299. // return the current option settings of the Server Manager
  300. // application.
  301. //
  302. // fSaveSettingsOnExit - Should Server Manager settings be saved
  303. // on exit?
  304. //
  305. // fConfirmation - Should permanent and/or dangerous
  306. // actions be confirmed? In the current
  307. // Server Manager implementation, this
  308. // will always be TRUE.
  309. //
  310. typedef struct _SMS_GETOPTIONS
  311. {
  312. BOOL fSaveSettingsOnExit;
  313. BOOL fConfirmation;
  314. } SMS_GETOPTIONS, * PSMS_GETOPTIONS;
  315. //
  316. // The SMS_VALIDATE[AW] structure is passed between the Server Manager
  317. // application and the extension to validate a particular "alien"
  318. // (non-LANMan) server.
  319. //
  320. // pszServer - The (UNC) name of the server to validate. This
  321. // is filled in by the Server Manager.
  322. //
  323. // pszType - The type string to display in the Server Manager's
  324. // main window. This is filled in by the extension.
  325. //
  326. // pszComment - The comment to display in the Server Manager's
  327. // main window. This is filled in by the extension.
  328. //
  329. typedef struct _SMS_VALIDATEA
  330. {
  331. const CHAR * pszServer;
  332. CHAR * pszType;
  333. CHAR * pszComment;
  334. } SMS_VALIDATEA, * PSMS_VALIDATEA;
  335. typedef struct _SMS_VALIDATEW
  336. {
  337. const WCHAR * pszServer;
  338. WCHAR * pszType;
  339. WCHAR * pszComment;
  340. } SMS_VALIDATEW, * PSMS_VALIDATEW;
  341. #ifdef UNICODE
  342. #define SMS_VALIDATE SMS_VALIDATEW
  343. #define PSMS_VALIDATE PSMS_VALIDATEW
  344. #else // UNICODE
  345. #define SMS_VALIDATE SMS_VALIDATEA
  346. #define PSMS_VALIDATE PSMS_VALIDATEA
  347. #endif // UNICODE
  348. //
  349. // These are the names of the extension entrypoints.
  350. //
  351. #define SZ_SME_UNLOADMENU "SMEUnloadMenu"
  352. #define SZ_SME_INITIALIZEMENU "SMEInitializeMenu"
  353. #define SZ_SME_REFRESH "SMERefresh"
  354. #define SZ_SME_MENUACTION "SMEMenuAction"
  355. #define SZ_SME_LOADMENUW "SMELoadMenuW"
  356. #define SZ_SME_GETEXTENDEDERRORSTRINGW "SMEGetExtendedErrorStringW"
  357. #define SZ_SME_VALIDATEW "SMEValidateW"
  358. #define SZ_SME_LOADMENUA "SMELoadMenuA"
  359. #define SZ_SME_GETEXTENDEDERRORSTRINGA "SMEGetExtendedErrorStringA"
  360. #define SZ_SME_VALIDATEA "SMEValidateA"
  361. #ifdef UNICODE
  362. #define SZ_SME_LOADMENU SZ_SME_LOADMENUW
  363. #define SZ_SME_GETEXTENDEDERRORSTRING SZ_SME_GETEXTENDEDERRORSTRINGW
  364. #define SZ_SME_VALIDATE SZ_SME_VALIDATEW
  365. #else // !UNICODE
  366. #define SZ_SME_LOADMENU SZ_SME_LOADMENUA
  367. #define SZ_SME_GETEXTENDEDERRORSTRING SZ_SME_GETEXTENDEDERRORSTRINGA
  368. #define SZ_SME_VALIDATE SZ_SME_VALIDATEA
  369. #endif // UNICODE
  370. //
  371. // Typedefs for the extension entrypoints.
  372. //
  373. typedef DWORD (PASCAL * PSMX_LOADMENU)( HWND hWnd,
  374. PSMS_LOADMENU psmsload );
  375. typedef LPTSTR (PASCAL * PSMX_GETEXTENDEDERRORSTRING)( VOID );
  376. typedef VOID (PASCAL * PSMX_UNLOADMENU)( VOID );
  377. typedef VOID (PASCAL * PSMX_INITIALIZEMENU)( VOID );
  378. typedef VOID (PASCAL * PSMX_REFRESH)( HWND hwndParent );
  379. typedef VOID (PASCAL * PSMX_MENUACTION)( HWND hwndParent, DWORD dwEventId );
  380. typedef BOOL (PASCAL * PSMX_VALIDATE)( PSMS_VALIDATE psmsvalidate );
  381. //
  382. // Prototypes for the extension entrypoints.
  383. //
  384. DWORD PASCAL SMELoadMenuA( HWND hWnd,
  385. PSMS_LOADMENUA psmsload );
  386. DWORD PASCAL SMELoadMenuW( HWND hWnd,
  387. PSMS_LOADMENUW psmsload );
  388. LPSTR PASCAL SMEGetExtendedErrorStringA( VOID );
  389. LPWSTR PASCAL SMEGetExtendedErrorStringW( VOID );
  390. VOID PASCAL SMEUnloadMenu( VOID );
  391. VOID PASCAL SMEInitializeMenu( VOID );
  392. VOID PASCAL SMERefresh( HWND hwndParent );
  393. VOID PASCAL SMEMenuAction( HWND hwndParent, DWORD dwEventId );
  394. BOOL PASCAL SMEValidateA( PSMS_VALIDATEA psmsValidate );
  395. BOOL PASCAL SMEValidateW( PSMS_VALIDATEW psmsValidate );
  396. #endif // _SMX_H_