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.

545 lines
18 KiB

  1. /**********************************************************************/
  2. /** Microsoft Windows NT **/
  3. /** Copyright(c) Microsoft Corp., 1992 **/
  4. /**********************************************************************/
  5. /*
  6. umx.h
  7. This file contains the common messages, manifests, types, and
  8. structures used by User Manager Extensions.
  9. NOTE: You must include windows.h and lmcons.h *before* this file.
  10. FILE HISTORY:
  11. JonN 19-Nov-1992 Created, templated from SMX spec
  12. JonN 16-May-1996 Added GETCURFOCUS2
  13. */
  14. #ifndef _UMX_H_
  15. #define _UMX_H_
  16. //
  17. // This is the maximum length allowed for an extension menu item.
  18. //
  19. #define UME_MENU_TEXT_LEN 50
  20. //
  21. // This is the current version number of the extension interface.
  22. // Version 0 is the original version (NT 3.x).
  23. // Version 1 supports GETCURFOCUS2 (NT 4.x).
  24. //
  25. #define UME_VERSION 1
  26. //
  27. // These are the two listboxes in the User Manager main window.
  28. //
  29. #define UMS_LISTBOX_USERS 0
  30. #define UMS_LISTBOX_GROUPS 1
  31. //
  32. // These are the messages sent from the extension to the
  33. // User Manager application.
  34. //
  35. // UM_GETSELCOUNT
  36. //
  37. // Purpose - Retrieves the number of selected items in
  38. // the specified listbox.
  39. //
  40. // wParam - Listbox index. This 0-based index specifies
  41. // the listbox to query. For the User Manager,
  42. // this may be either UMS_LISTBOX_USERS or
  43. // UMS_LISTBOX_GROUPS.
  44. //
  45. // lParam - Points to a UMS_GETSELCOUNT structure.
  46. //
  47. // Returns - TRUE if successful, FALSE if unsuccessful.
  48. //
  49. //
  50. // UM_GETUSERSEL[AW]
  51. //
  52. // Purpose - Retrieves a particular selection.
  53. //
  54. // wParam - Selection index. This 0-based index specifies
  55. // the selected item to query. This is used here
  56. // since the Users listbox is multiple-select.
  57. //
  58. // lParam - Points to a UMS_GETSEL[AW] structure.
  59. //
  60. // Returns - TRUE if successful, FALSE if unsuccessful.
  61. //
  62. //
  63. // UM_GETGROUPSEL[AW]
  64. //
  65. // Purpose - Retrieves a particular selection.
  66. //
  67. // wParam - Selection index. This 0-based index specifies
  68. // the selected item to query. This is useful
  69. // for muliple-select listboxes. Since the Groups
  70. // listbox is single-select, this value must always
  71. // be zero.
  72. //
  73. // lParam - Points to a UMS_GETSEL[AW] structure.
  74. //
  75. // Returns - TRUE if successful, FALSE if unsuccessful.
  76. //
  77. //
  78. // UM_GETCURFOCUS[AW][2]
  79. //
  80. // Purpose - Retrieves the current application focus.
  81. // New clients should use version 2 when
  82. // UMS_LOADMENU.dwVersion is 1 or greater.
  83. //
  84. // wParam - Must be zero.
  85. //
  86. // lParam - Points to a UMS_GETCURFOCUS[2] structure.
  87. //
  88. // Returns - TRUE if successful, FALSE if unsuccessful.
  89. //
  90. //
  91. // UM_GETOPTIONS[2]
  92. //
  93. // Purpose - Retrieves the current option settings
  94. //
  95. // wParam - Must be zero.
  96. //
  97. // lParam - Points to a UMS_GETOPTIONS[2] structure.
  98. //
  99. // Returns - TRUE if successful, FALSE if unsuccessful.
  100. //
  101. #define UM_GETSELCOUNT (WM_USER + 1000)
  102. #define UM_GETUSERSELA (WM_USER + 1001)
  103. #define UM_GETUSERSELW (WM_USER + 1002)
  104. #define UM_GETGROUPSELA (WM_USER + 1003)
  105. #define UM_GETGROUPSELW (WM_USER + 1004)
  106. #define UM_GETCURFOCUSA (WM_USER + 1005)
  107. #define UM_GETCURFOCUSW (WM_USER + 1006)
  108. #define UM_GETOPTIONS (WM_USER + 1007)
  109. #define UM_GETOPTIONS2 (WM_USER + 1008)
  110. #define UM_GETCURFOCUS2A (WM_USER + 1009)
  111. #define UM_GETCURFOCUS2W (WM_USER + 1010)
  112. #ifdef UNICODE
  113. #define UM_GETUSERSEL UM_GETUSERSELW
  114. #define UM_GETGROUPSEL UM_GETGROUPSELW
  115. #define UM_GETCURFOCUS UM_GETCURFOCUSW
  116. #define UM_GETCURFOCUS2 UM_GETCURFOCUS2W
  117. #else // !UNICODE
  118. #define UM_GETUSERSEL UM_GETUSERSELA
  119. #define UM_GETGROUPSEL UM_GETGROUPSELA
  120. #define UM_GETCURFOCUS UM_GETCURFOCUSA
  121. #define UM_GETCURFOCUS2 UM_GETCURFOCUS2A
  122. #endif // UNICODE
  123. //
  124. // These structures are used when the extension is
  125. // communicating with the application.
  126. //
  127. //
  128. // The UMS_LOADMENU[AW] structure is passed to the extension's
  129. // UMELoadMenu[AW] entrypoint when the extension is loaded.
  130. //
  131. // dwVersion - On entry to UMELoadMenu[AW], this will
  132. // contain the maximum extension version
  133. // supported by the User Manager. If the
  134. // extension supports a lower version, it
  135. // should set this field appropriately before
  136. // returning. The User Manager will use
  137. // the returned value to determine the
  138. // capabilities of the extension.
  139. //
  140. // Version 0 is the original version (NT 3.x).
  141. // Version 1 supports GETCURFOCUS2.
  142. //
  143. // szMenuName - The name of the menu item that is to appear
  144. // in the app's main menu. This value will also
  145. // appear in the "Help On Extensions" submene and
  146. // the "View" menu.
  147. //
  148. // hMenu - A valid HMENU for the popup-menu to be inserted
  149. // into the app's main menu. Ownership of this
  150. // handle transfers to the User Manager. The
  151. // extension should *not* destroy this handle.
  152. //
  153. // szHelpFileName - The name of the help file associated with this
  154. // extension. This file will be used for the
  155. // "Help On Extensions" menu. This will also be
  156. // used when the user presses [F1] while the
  157. // extension's menu is dropped.
  158. //
  159. // dwMenuDelta - The User Manager will apply this delta
  160. // to each menu ID present in hMenu. This is
  161. // to prevent conflicts with other extension's
  162. // menu IDs.
  163. //
  164. typedef struct _UMS_LOADMENUA
  165. {
  166. DWORD dwVersion;
  167. CHAR szMenuName[UME_MENU_TEXT_LEN + 1];
  168. HMENU hMenu;
  169. CHAR szHelpFileName[MAX_PATH];
  170. DWORD dwMenuDelta;
  171. } UMS_LOADMENUA, * PUMS_LOADMENUA;
  172. typedef struct _UMS_LOADMENUW
  173. {
  174. DWORD dwVersion;
  175. WCHAR szMenuName[UME_MENU_TEXT_LEN + 1];
  176. HMENU hMenu;
  177. WCHAR szHelpFileName[MAX_PATH];
  178. DWORD dwMenuDelta;
  179. } UMS_LOADMENUW, * PUMS_LOADMENUW;
  180. #ifdef UNICODE
  181. #define UMS_LOADMENU UMS_LOADMENUW
  182. #define PUMS_LOADMENU PUMS_LOADMENUW
  183. #else // !UNICODE
  184. #define UMS_LOADMENU UMS_LOADMENUA
  185. #define PUMS_LOADMENU PUMS_LOADMENUA
  186. #endif // UNICODE
  187. #define UM_SELTYPE_USER 0x10
  188. #define UM_SELTYPE_NORMALUSER 0x1 | UM_SELTYPE_USER
  189. #define UM_SELTYPE_REMOTEUSER 0x2 | UM_SELTYPE_USER
  190. #define UM_SELTYPE_GROUP 0x20
  191. #define UM_SELTYPE_LOCALGROUP 0x4 | UM_SELTYPE_GROUP
  192. #define UM_SELTYPE_GLOBALGROUP 0x8 | UM_SELTYPE_GROUP
  193. //
  194. // The UMS_GETSEL[AW] structure is filled in by the User Manager
  195. // when it handles UM_GETUSERSEL[AW] or UM_GETGROUPSEL[AW] messages.
  196. // This is used to return the current selection to the extension.
  197. // Note that this structure contains pointers. The extension should not
  198. // assume that these pointers will be valid forever, instead the
  199. // extension should promptly copy these strings and use the copies.
  200. //
  201. // dwRID - The RID of the item. Note that the RID is not
  202. // valid when the UMS_GETSEL describes a group.
  203. //
  204. // pchName - Will receive the name of the selected account.
  205. //
  206. // dwSelType - Will receive the account type mask associated
  207. // with the account.
  208. //
  209. // pchName - Will receive the fullname of the selected account.
  210. // Note that groups do not have fullnames.
  211. //
  212. // pchComment - Will receive the comment of the selected account.
  213. //
  214. typedef struct _UMS_GETSELA
  215. {
  216. DWORD dwRID;
  217. LPSTR pchName;
  218. DWORD dwSelType;
  219. LPSTR pchFullName;
  220. LPSTR pchComment;
  221. } UMS_GETSELA, * PUMS_GETSELA;
  222. typedef struct _UMS_GETSELW
  223. {
  224. DWORD dwRID;
  225. LPWSTR pchName;
  226. DWORD dwSelType;
  227. LPWSTR pchFullName;
  228. LPWSTR pchComment;
  229. } UMS_GETSELW, * PUMS_GETSELW;
  230. #ifdef UNICODE
  231. #define UMS_GETSEL UMS_GETSELW
  232. #define PUMS_GETSEL PUMS_GETSELW
  233. #else // !UNICODE
  234. #define UMS_GETSEL UMS_GETSELA
  235. #define PUMS_GETSEL PUMS_GETSELA
  236. #endif // UNICODE
  237. //
  238. // The UMS_GETSELCOUNT structure is filled in by the User Manager
  239. // when it handles the UM_GETSELCOUNT message. This is used to
  240. // return the number of selected items to the extension. This could
  241. // be more than 1 for the user listbox.
  242. //
  243. // dwItems - The number of selected items in the listbox.
  244. //
  245. typedef struct _UMS_GETSELCOUNT
  246. {
  247. DWORD dwItems;
  248. } UMS_GETSELCOUNT, * PUMS_GETSELCOUNT;
  249. //
  250. // The UMS_GETCURFOCUS structure is filled in by the User Manager
  251. // when it handles the UM_GETCURFOCUS message. This is used to
  252. // return the current focus of the User Manager application.
  253. //
  254. // UMS_GETCURFOCUS is outdated due to the change in server name length,
  255. // use UMS_GETCURFOCUS2 when SMS_LOADMENU.dwVersion is 1 or greater.
  256. //
  257. // szFocus - The domain name or server name of the current
  258. // focus. Server names can be distinguished
  259. // by the leading backslashes, or by dwFocusType.
  260. //
  261. // dwFocusType - This is the type of focus, either
  262. // UM_FOCUS_TYPE_DOMAIN (and szFocus is a domain name)
  263. // UM_FOCUS_TYPE_WINNT (and szFocus is a server name)
  264. // UM_FOCUS_TYPE_LM (and szFocus is a server name)
  265. // UM_FOCUS_TYPE_UNKNOWN
  266. //
  267. // szFocusPDC - This is the PDC of the domain of focus, and is valid
  268. // only if focus is set to UM_FOCUS_TYPE_DOMAIN.
  269. //
  270. // psidFocus - This points to the SID of the domain of focus. It
  271. // may be NULL. Note that this pointer will not be
  272. // valid forever, the extension should copy the SID
  273. // immediately if it intends to use it.
  274. //
  275. #define UM_FOCUS_TYPE_DOMAIN 1
  276. #define UM_FOCUS_TYPE_WINNT 2
  277. #define UM_FOCUS_TYPE_LM 3
  278. #define UM_FOCUS_TYPE_UNKNOWN 4
  279. typedef struct _UMS_GETCURFOCUSA
  280. {
  281. CHAR szFocus[UNCLEN+1];
  282. DWORD dwFocusType;
  283. CHAR szFocusPDC[UNCLEN+1];
  284. PVOID psidFocus; // actually a SID pointer
  285. } UMS_GETCURFOCUSA, * PUMS_GETCURFOCUSA;
  286. typedef struct _UMS_GETCURFOCUSW
  287. {
  288. WCHAR szFocus[UNCLEN+1];
  289. DWORD dwFocusType;
  290. WCHAR szFocusPDC[UNCLEN+1];
  291. PVOID psidFocus; // actually a SID pointer
  292. } UMS_GETCURFOCUSW, * PUMS_GETCURFOCUSW;
  293. typedef struct _UMS_GETCURFOCUS2A
  294. {
  295. CHAR szFocus[MAX_PATH];
  296. DWORD dwFocusType;
  297. CHAR szFocusPDC[MAX_PATH];
  298. PVOID psidFocus; // actually a SID pointer
  299. } UMS_GETCURFOCUS2A, * PUMS_GETCURFOCUS2A;
  300. typedef struct _UMS_GETCURFOCUS2W
  301. {
  302. WCHAR szFocus[MAX_PATH];
  303. DWORD dwFocusType;
  304. WCHAR szFocusPDC[MAX_PATH];
  305. PVOID psidFocus; // actually a SID pointer
  306. } UMS_GETCURFOCUS2W, * PUMS_GETCURFOCUS2W;
  307. #ifdef UNICODE
  308. #define UMS_GETCURFOCUS UMS_GETCURFOCUSW
  309. #define PUMS_GETCURFOCUS PUMS_GETCURFOCUSW
  310. #define UMS_GETCURFOCUS2 UMS_GETCURFOCUS2W
  311. #define PUMS_GETCURFOCUS2 PUMS_GETCURFOCUS2W
  312. #else // UNICODE
  313. #define UMS_GETCURFOCUS UMS_GETCURFOCUSA
  314. #define PUMS_GETCURFOCUS PUMS_GETCURFOCUSA
  315. #define UMS_GETCURFOCUS2 UMS_GETCURFOCUS2A
  316. #define PUMS_GETCURFOCUS2 PUMS_GETCURFOCUS2A
  317. #endif // UNICODE
  318. //
  319. // The UMS_GETOPTIONS[2] structure is filled in by the User Manager
  320. // when it handles the UM_GETOPTIONS[2] message. This is used to
  321. // return the current option settings of the User Manager application.
  322. //
  323. // fSaveSettingsOnExit - Should User Manager settings be saved on exit?
  324. //
  325. // fConfirmation - Should permanent and/or dangerous actions be
  326. // confirmed?
  327. //
  328. // fSortByFullName - Should the main user listbox be sorted by
  329. // fullname rather than by user name?
  330. //
  331. // fMiniUserManager - (UMS_GETOPTIONS2 only) Is this the User Manager
  332. // rather than the User Manager for Domains?
  333. //
  334. // fLowSpeedConnection - (UMS_GETOPTIONS2 only) Is the User Manager
  335. // optimized for use across a slow network link?
  336. //
  337. typedef struct _UMS_GETOPTIONS
  338. {
  339. BOOL fSaveSettingsOnExit;
  340. BOOL fConfirmation;
  341. BOOL fSortByFullName;
  342. } UMS_GETOPTIONS, * PUMS_GETOPTIONS;
  343. typedef struct _UMS_GETOPTIONS2
  344. {
  345. BOOL fSaveSettingsOnExit;
  346. BOOL fConfirmation;
  347. BOOL fSortByFullName;
  348. BOOL fMiniUserManager;
  349. BOOL fLowSpeedConnection;
  350. } UMS_GETOPTIONS2, * PUMS_GETOPTIONS2;
  351. //
  352. // These are the names of the extension entrypoints.
  353. //
  354. #define SZ_UME_UNLOADMENU "UMEUnloadMenu"
  355. #define SZ_UME_INITIALIZEMENU "UMEInitializeMenu"
  356. #define SZ_UME_REFRESH "UMERefresh"
  357. #define SZ_UME_MENUACTION "UMEMenuAction"
  358. #define SZ_UME_LOADMENUW "UMELoadMenuW"
  359. #define SZ_UME_GETEXTENDEDERRORSTRINGW "UMEGetExtendedErrorStringW"
  360. #define SZ_UME_CREATEW "UMECreateW"
  361. #define SZ_UME_DELETEW "UMEDeleteW"
  362. #define SZ_UME_RENAMEW "UMERenameW"
  363. #define SZ_UME_LOADMENUA "UMELoadMenuA"
  364. #define SZ_UME_GETEXTENDEDERRORSTRINGA "UMEGetExtendedErrorStringA"
  365. #define SZ_UME_CREATEA "UMECreateA"
  366. #define SZ_UME_DELETEA "UMEDeleteA"
  367. #define SZ_UME_RENAMEA "UMERenameA"
  368. #ifdef UNICODE
  369. #define SZ_UME_LOADMENU SZ_UME_LOADMENUW
  370. #define SZ_UME_GETEXTENDEDERRORSTRING SZ_UME_GETEXTENDEDERRORSTRINGW
  371. #define SZ_UME_CREATE SZ_UME_CREATEW
  372. #define SZ_UME_DELETE SZ_UME_DELETEW
  373. #define SZ_UME_RENAME SZ_UME_RENAMEW
  374. #else // !UNICODE
  375. #define SZ_UME_LOADMENU SZ_UME_LOADMENUA
  376. #define SZ_UME_GETEXTENDEDERRORSTRING SZ_UME_GETEXTENDEDERRORSTRINGA
  377. #define SZ_UME_CREATE SZ_UME_CREATEA
  378. #define SZ_UME_DELETE SZ_UME_DELETEA
  379. #define SZ_UME_RENAME SZ_UME_RENAMEA
  380. #endif // UNICODE
  381. //
  382. // Typedefs for the extension entrypoints.
  383. //
  384. typedef DWORD (PASCAL * PUMX_LOADMENUW)( HWND hWnd,
  385. PUMS_LOADMENUW pumsload );
  386. typedef DWORD (PASCAL * PUMX_LOADMENUA)( HWND hWnd,
  387. PUMS_LOADMENUA pumsload );
  388. typedef LPWSTR (PASCAL * PUMX_GETEXTENDEDERRORSTRINGW)( VOID );
  389. typedef LPSTR (PASCAL * PUMX_GETEXTENDEDERRORSTRINGA)( VOID );
  390. typedef VOID (PASCAL * PUMX_UNLOADMENU)( VOID );
  391. typedef VOID (PASCAL * PUMX_INITIALIZEMENU)( VOID );
  392. typedef VOID (PASCAL * PUMX_REFRESH)( HWND hwndParent );
  393. typedef VOID (PASCAL * PUMX_MENUACTION)( HWND hwndParent,
  394. DWORD dwEventId );
  395. typedef VOID (PASCAL * PUMX_CREATEW)( HWND hwndParent,
  396. PUMS_GETSELW pumsSelection );
  397. typedef VOID (PASCAL * PUMX_CREATEA)( HWND hwndParent,
  398. PUMS_GETSELA pumsSelection );
  399. typedef VOID (PASCAL * PUMX_DELETEW)( HWND hwndParent,
  400. PUMS_GETSELW pumsSelection );
  401. typedef VOID (PASCAL * PUMX_DELETEA)( HWND hwndParent,
  402. PUMS_GETSELA pumsSelection );
  403. typedef VOID (PASCAL * PUMX_RENAMEW)( HWND hwndParent,
  404. PUMS_GETSELW pumsSelection,
  405. LPWSTR pchNewName );
  406. typedef VOID (PASCAL * PUMX_RENAMEA)( HWND hwndParent,
  407. PUMS_GETSELA pumsSelection,
  408. LPSTR pchNewName );
  409. #ifdef UNICODE
  410. #define PUMX_LOADMENU PUMX_LOADMENUW
  411. #define PUMX_GETEXTENDEDERRORSTRING PUMX_GETEXTENDEDERRORSTRINGW
  412. #define PUMX_CREATE PUMX_CREATEW
  413. #define PUMX_DELETE PUMX_DELETEW
  414. #define PUMX_RENAME PUMX_RENAMEW
  415. #else // !UNICODE
  416. #define PUMX_LOADMENU PUMX_LOADMENUA
  417. #define PUMX_GETEXTENDEDERRORSTRING PUMX_GETEXTENDEDERRORSTRINGA
  418. #define PUMX_CREATE PUMX_CREATEA
  419. #define PUMX_DELETE PUMX_DELETEA
  420. #define PUMX_RENAME PUMX_RENAMEA
  421. #endif // UNICODE
  422. //
  423. // Prototypes for the extension entrypoints.
  424. //
  425. DWORD PASCAL UMELoadMenuA( HWND hwndMessage,
  426. PUMS_LOADMENUA pumsload );
  427. DWORD PASCAL UMELoadMenuW( HWND hwndMessage,
  428. PUMS_LOADMENUW pumsload );
  429. LPSTR PASCAL UMEGetExtendedErrorStringA( VOID );
  430. LPWSTR PASCAL UMEGetExtendedErrorStringW( VOID );
  431. VOID PASCAL UMEUnloadMenu( VOID );
  432. VOID PASCAL UMEInitializeMenu( VOID );
  433. VOID PASCAL UMERefresh( HWND hwndParent );
  434. VOID PASCAL UMEMenuAction( HWND hwndParent,
  435. DWORD dwEventId );
  436. VOID PASCAL UMECreateA( HWND hwndParent,
  437. PUMS_GETSELA pumsSelection );
  438. VOID PASCAL UMECreateW( HWND hwndParent,
  439. PUMS_GETSELW pumsSelection );
  440. VOID PASCAL UMEDeleteA( HWND hwndParent,
  441. PUMS_GETSELA pumsSelection );
  442. VOID PASCAL UMEDeleteW( HWND hwndParent,
  443. PUMS_GETSELW pumsSelection );
  444. VOID PASCAL UMERenameA( HWND hwndParent,
  445. PUMS_GETSELA pumsSelection,
  446. LPSTR pchNewName );
  447. VOID PASCAL UMERenameW( HWND hwndParent,
  448. PUMS_GETSELW pumsSelection,
  449. LPWSTR pchNewName );
  450. #endif // _UMX_H_