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.

324 lines
13 KiB

  1. //+---------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (c) Microsoft Corporation. All rights reserved.
  5. //
  6. // File: shgina.h
  7. //
  8. // Contents: MIDL definitions for ILogonEnumUsers, ILogonUser, ILogonUserEnumNotifications,
  9. // ILogonUserNotification
  10. //
  11. //----------------------------------------------------------------------------
  12. // TODO: Notes from BryanSt's code review of Reiner's check in.
  13. // 1. #define DISPIDs in another file. ___id.h
  14. // 2. Rename to lower case first letter of all APIs
  15. // 3. Imple IObjectWithSite for security
  16. // 4. Rename ILogonEnumUsers to LogonUsers (LogonUserCollection)
  17. // 5. get_Domain() should return a INTDomain w/ get_name()
  18. // 6. Break EnumFlags into ::put_sort() and ::put_filter()
  19. // 7. Rename "Count" to "length" to be compatible with the new JavaScript OMs.
  20. typedef enum ILUEOrder
  21. {
  22. ILEU_MOSTRECENT = 0,
  23. ILEU_ALPHABETICAL = 1,
  24. } ILUEORDER;
  25. import "oaidl.idl";
  26. import "ocidl.idl";
  27. [
  28. uuid(0A055C02-BABE-4480-BB7B-A8EC723CE9C0), // LIBID_SHGINALib
  29. helpstring("SHGINA 1.0 Type Library"),
  30. lcid(0x0000),
  31. version(1.0)
  32. ]
  33. library SHGINALib
  34. {
  35. importlib("stdole2.tlb");
  36. /* TODO:
  37. [
  38. object,
  39. uuid(60664CAF-AF0D-1001-A300-5C7D25FF22A0),
  40. dual,
  41. hidden,
  42. helpstring("ILogonUserNotification Interface"),
  43. oleautomation
  44. ]
  45. interface ILogonUserNotification : IDispatch
  46. {
  47. // Properties
  48. [id(1), propget, helpstring("Get the unique ID of the Notification.")]
  49. HRESULT UniqueID([out, retval] BSTR* pbstr);
  50. [id(2), propget, helpstring("Get the image associated with the notification.")]
  51. HRESULT Image([out, retval] BSTR* pbstr);
  52. [id(3), propget, helpstring("Get the text string associated with the notification.")]
  53. HRESULT Text([out, retval] BSTR* pbstr);
  54. [id(4), propget, helpstring("Get the URL string associated with the notification.")]
  55. HRESULT URL([out, retval] BSTR* pbstr);
  56. };
  57. [
  58. uuid(60664CAF-AF0D-0001-A300-5C7D25FF22A0),
  59. helpstring("LogonUserNotification Class")
  60. ]
  61. coclass LogonUserNotification
  62. {
  63. [default] interface ILogonUserNotification;
  64. };
  65. [
  66. object,
  67. uuid(60664CAF-AF0D-1002-A300-5C7D25FF22A0),
  68. dual,
  69. hidden,
  70. helpstring("ILogonUserEnumNotification Interface"),
  71. oleautomation
  72. ]
  73. interface ILogonUserEnumNotifications : IDispatch
  74. {
  75. // Properties
  76. [id(1), propget, helpstring("Get the total number of user notifications.")]
  77. HRESULT Count([out, retval] UINT* pcNotifications);
  78. // Methods
  79. [id(DISPID_VALUE), helpstring("Return a LogonUserNotification given the specified index.")]
  80. HRESULT Item([in] VARIANT varUserID, [out, retval] ILogonUserNotification** ppUserNotification);
  81. };
  82. [
  83. uuid(60664CAF-AF0D-0002-A300-5C7D25FF22A0),
  84. helpstring("LogonUserEnumNotifications Class")
  85. ]
  86. coclass LogonUserEnumNotifications
  87. {
  88. [default] interface ILogonUserEnumNotifications;
  89. };
  90. */
  91. [
  92. object,
  93. uuid(60664CAF-AF0D-1003-A300-5C7D25FF22A0),
  94. dual,
  95. hidden,
  96. helpstring("ILogonUser Interface"),
  97. oleautomation
  98. ]
  99. interface ILogonUser : IDispatch
  100. {
  101. // Properties
  102. [id(1), propget, helpstring("Get the named user setting.")]
  103. HRESULT setting([in] BSTR bstrName, [out, retval] VARIANT* pvarVal);
  104. [id(1), propput, helpstring("Set the named user setting.")]
  105. HRESULT setting([in] BSTR bstrName, [in] VARIANT varVal);
  106. [id(2), propget, helpstring("Test whether the user is logged on.")]
  107. HRESULT isLoggedOn([out, retval] VARIANT_BOOL* pbLoggedIn);
  108. [id(3), propget, helpstring("Test whether the user requires a password.")]
  109. HRESULT passwordRequired([out, retval] VARIANT_BOOL* pbPasswordRequired);
  110. [id(4), propget, helpstring("Test whether the user has the interactive logon right.")]
  111. HRESULT interactiveLogonAllowed([out, retval] VARIANT_BOOL* pbInteractiveLogonAllowed);
  112. [id(5), propget, helpstring("Check whether the user's profile folder is private.")]
  113. HRESULT isProfilePrivate([out, retval] VARIANT_BOOL* pbPrivate);
  114. [id(6), propget, helpstring("Check whether the user has created a password reset disk.")]
  115. HRESULT isPasswordResetAvailable([out, retval] VARIANT_BOOL* pbResetAvailable);
  116. // Methods
  117. [helpstring("Log the user onto the system with the given password.")]
  118. HRESULT logon([in] BSTR pstrPassword, [out, retval] VARIANT_BOOL* pbRet);
  119. [helpstring("Log the user off the system.")]
  120. HRESULT logoff([out, retval] VARIANT_BOOL* pbRet);
  121. [helpstring("Change the users password.")]
  122. HRESULT changePassword([in] VARIANT varNewPassword, [in] VARIANT varOldPassword, [out, retval] VARIANT_BOOL* pbRet);
  123. [helpstring("Set ACLs to make the user's profile folder private.")]
  124. HRESULT makeProfilePrivate([in] VARIANT_BOOL bPrivate);
  125. [helpstring("Get the email account name and number of unread messages.")]
  126. HRESULT getMailAccountInfo([in] UINT uiAccountIndex, [out] VARIANT *pvarAccountName, [out] UINT *pcUnreadMessages);
  127. /* TODO:
  128. [helpstring("Return an ILogonUserEnumNotifications to enumerate all notifications associated with the user.")]
  129. HRESULT EnumUserNotifications([out] ILogonUserEnumNotifications** ppEnumNotifications);
  130. */
  131. };
  132. [
  133. uuid(60664CAF-AF0D-0003-A300-5C7D25FF22A0),
  134. helpstring("LogonUser Class")
  135. ]
  136. coclass ShellLogonUser
  137. {
  138. [default] interface ILogonUser;
  139. };
  140. [
  141. object,
  142. uuid(60664CAF-AF0D-1004-A300-5C7D25FF22A0),
  143. dual,
  144. hidden,
  145. helpstring("ILogonEnumUsers Interface"),
  146. oleautomation
  147. ]
  148. interface ILogonEnumUsers : IDispatch
  149. {
  150. // Properties
  151. [id(1), propget, helpstring("Get the current domain we are enumerating users on.")]
  152. HRESULT Domain([out, retval] BSTR* pbstr);
  153. [id(1), propput, helpstring("Set the current domain we are enumerating users on.")]
  154. HRESULT Domain([in] BSTR bstr);
  155. [id(2), propget, helpstring("Get the current enumeration flags.")]
  156. HRESULT EnumFlags([out, retval] ILUEORDER* porder);
  157. [id(2), propput, helpstring("Set the current enumeration flags.")]
  158. HRESULT EnumFlags([in] ILUEORDER order);
  159. [id(3), propget, helpstring("Get the total number of users.")]
  160. HRESULT length([out, retval] UINT* pcUsers);
  161. [id(6), propget, helpstring("Get the current user.")]
  162. HRESULT currentUser([out, retval] ILogonUser** ppLogonUserInfo);
  163. // Methods
  164. [id(DISPID_VALUE), helpstring("Return a LogonUser given the specified name/index.")]
  165. HRESULT item([in] VARIANT varUserId, [out, retval] ILogonUser** ppLogonUserInfo);
  166. [id(DISPID_NEWENUM), helpstring("Return an IEnumVARIANT ojbect for all of the users.")]
  167. HRESULT _NewEnum([out, retval] IUnknown** retval);
  168. [id(4), helpstring("Create a new user.")]
  169. HRESULT create([in] BSTR bstrLoginName, [out, retval] ILogonUser **ppLogonUser);
  170. [id(5), helpstring("Delete a user.")]
  171. HRESULT remove([in] VARIANT varUserId, [in, optional] VARIANT varBackupPath, [out, retval] VARIANT_BOOL *pbSuccess);
  172. };
  173. [
  174. uuid(60664CAF-AF0D-0004-A300-5C7D25FF22A0),
  175. helpstring("LogonEnumUsers Class")
  176. ]
  177. coclass ShellLogonEnumUsers
  178. {
  179. [default] interface ILogonEnumUsers;
  180. };
  181. typedef enum ILM_GUEST_FLAGS
  182. {
  183. ILM_GUEST_ACCOUNT = 0x00000000,
  184. ILM_GUEST_INTERACTIVE_LOGON = 0x00000001,
  185. ILM_GUEST_NETWORK_LOGON = 0x00000002,
  186. } ILM_GUEST_FLAGS;
  187. [
  188. object,
  189. uuid(60664CAF-AF0D-1005-A300-5C7D25FF22A0),
  190. dual,
  191. hidden,
  192. helpstring("ILocalMachine Interface"),
  193. oleautomation
  194. ]
  195. interface ILocalMachine : IDispatch
  196. {
  197. // Properties
  198. [id(1), propget, helpstring("Get the machine name.")]
  199. HRESULT MachineName([out, retval] VARIANT* pvarVal);
  200. [id(2), propget, helpstring("Test whether the Guest account is enabled.")]
  201. HRESULT isGuestEnabled([in] ILM_GUEST_FLAGS flags, [out, retval] VARIANT_BOOL* pbEnabled);
  202. [id(3), propget, helpstring("Test whether friendly UI is enabled.")]
  203. HRESULT isFriendlyUIEnabled([out, retval] VARIANT_BOOL* pbEnabled);
  204. [id(3), propput, helpstring("Enable or disable friendly UI.")]
  205. HRESULT isFriendlyUIEnabled([in] VARIANT_BOOL bEnabled);
  206. [id(4), propget, helpstring("Test whether multiple users is enabled.")]
  207. HRESULT isMultipleUsersEnabled([out, retval] VARIANT_BOOL* pbEnabled);
  208. [id(4), propput, helpstring("Enable or disable multiple users.")]
  209. HRESULT isMultipleUsersEnabled([in] VARIANT_BOOL bEnabled);
  210. [id(5), propget, helpstring("Test whether remote connections are enabled.")]
  211. HRESULT isRemoteConnectionsEnabled([out, retval] VARIANT_BOOL* pbEnabled);
  212. [id(5), propput, helpstring("Enable or disable remote connections.")]
  213. HRESULT isRemoteConnectionsEnabled([in] VARIANT_BOOL bEnabled);
  214. [id(6), propget, helpstring("Get a well-known user account name.")]
  215. HRESULT AccountName([in] VARIANT varAccount, [out, retval] VARIANT* pvarVal);
  216. [id(7), propget, helpstring("Test whether the machine can be undocked.")]
  217. HRESULT isUndockEnabled([out, retval] VARIANT_BOOL* pbEnabled);
  218. [id(8), propget, helpstring("Test whether the machine can be shut down.")]
  219. HRESULT isShutdownAllowed([out, retval] VARIANT_BOOL* pbEnabled);
  220. [id(9), propget, helpstring("Test whether all network traffic will be treated as through it were local guest account.")]
  221. HRESULT isGuestAccessMode([out, retval] VARIANT_BOOL* pbForceGuest);
  222. [id(100), propget, helpstring("Test whether Offline Files is enabled.")]
  223. HRESULT isOfflineFilesEnabled([out, retval] VARIANT_BOOL *pbEnabled);
  224. // Methods
  225. [id(10), helpstring("Turn Off Computer.")]
  226. HRESULT TurnOffComputer(void);
  227. [id(20), helpstring("Signal UI host failure.")]
  228. HRESULT SignalUIHostFailure(void);
  229. [id(30), helpstring("Allow external credentials.")]
  230. HRESULT AllowExternalCredentials(void);
  231. [id(31), helpstring("Request external credentials.")]
  232. HRESULT RequestExternalCredentials(void);
  233. [id(32), helpstring("Logon with external credentials.")]
  234. HRESULT LogonWithExternalCredentials([in] BSTR pstrUsername, [in] BSTR pstrDomain, [in] BSTR pstrPassword, [out, retval] VARIANT_BOOL* pbRet);
  235. [id(33), helpstring("Initiate interactive logon with credentials.")]
  236. HRESULT InitiateInteractiveLogon([in] BSTR pstrUsername, [in] BSTR pstrDomain, [in] BSTR pstrPassword, [in] DWORD dwTimeout, [out, retval] VARIANT_BOOL* pbRet);
  237. [id(40), helpstring("Undock Computer.")]
  238. HRESULT UndockComputer(void);
  239. [id(50), helpstring("Enable the Guest account for interactive and/or network logon.")]
  240. HRESULT EnableGuest(ILM_GUEST_FLAGS flags);
  241. [id(51), helpstring("Disable the Guest account for interactive and/or network logon.")]
  242. HRESULT DisableGuest(ILM_GUEST_FLAGS flags);
  243. };
  244. [
  245. uuid(60664CAF-AF0D-0005-A300-5C7D25FF22A0),
  246. helpstring("LocalMachine Class")
  247. ]
  248. coclass ShellLocalMachine
  249. {
  250. [default] interface ILocalMachine;
  251. };
  252. [
  253. object,
  254. uuid(60664CAF-AF0D-1007-A300-5C7D25FF22A0),
  255. dual,
  256. hidden,
  257. helpstring("ILogonStatusHost Interface"),
  258. oleautomation
  259. ]
  260. interface ILogonStatusHost : IDispatch
  261. {
  262. // Methods
  263. [id(10), helpstring("Initialize.")]
  264. HRESULT Initialize([in] HINSTANCE hInstance, [in] HWND hwndHost);
  265. [id(11), helpstring("Window procedure helper.")]
  266. HRESULT WindowProcedureHelper([in] HWND hwnd, [in] UINT uMsg, [in] VARIANT wParam, [in] VARIANT lParam);
  267. [id(12), helpstring("UnInitialize.")]
  268. HRESULT UnInitialize(void);
  269. };
  270. [
  271. uuid(60664CAF-AF0D-0007-A300-5C7D25FF22A0),
  272. helpstring("LogonStatusHost Class")
  273. ]
  274. coclass ShellLogonStatusHost
  275. {
  276. [default] interface ILogonStatusHost;
  277. };
  278. };