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.

216 lines
9.0 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (c) Microsoft Corporation. All rights reserved.
  5. //
  6. //--------------------------------------------------------------------------
  7. cpp_quote("//=--------------------------------------------------------------------------=")
  8. cpp_quote("// msident.h")
  9. cpp_quote("//=--------------------------------------------------------------------------=")
  10. cpp_quote("// Copyright (c) Microsoft Corporation. All rights reserved.")
  11. cpp_quote("//")
  12. cpp_quote("// THIS CODE AND INFORMATION IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF")
  13. cpp_quote("// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO")
  14. cpp_quote("// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A")
  15. cpp_quote("// PARTICULAR PURPOSE.")
  16. cpp_quote("//=--------------------------------------------------------------------------=")
  17. cpp_quote("")
  18. cpp_quote("#pragma comment(lib,\"uuid.lib\")")
  19. cpp_quote("")
  20. cpp_quote("//---------------------------------------------------------------------------=")
  21. cpp_quote("// Lightweight User Profile Interfaces.")
  22. cpp_quote("")
  23. cpp_quote("// --------------------------------------------------------------------------------")
  24. cpp_quote("// GUIDS")
  25. cpp_quote("// --------------------------------------------------------------------------------")
  26. cpp_quote("// {A9AE6C91-1D1B-11D2-B21A-00C04FA357FA}")
  27. cpp_quote("DEFINE_GUID(CLSID_UserIdentityManager, 0xa9ae6C91, 0x1d1b, 0x11d2, 0xb2, 0x1a, 0x0, 0xc0, 0x4f, 0xa3, 0x57, 0xfa);")
  28. cpp_quote("// {A9AE6C8E-1D1B-11D2-B21A-00C04FA357FA}")
  29. cpp_quote("DEFINE_GUID(IID_IUserIdentity, 0xa9ae6C8e, 0x1d1b, 0x11d2, 0xb2, 0x1a, 0x0, 0xc0, 0x4f, 0xa3, 0x57, 0xfa);")
  30. cpp_quote("// {A9AE6C8F-1D1B-11D2-B21A-00C04FA357FA}")
  31. cpp_quote("DEFINE_GUID(IID_IEnumUserIdentity, 0xa9ae6C8f, 0x1d1b, 0x11d2, 0xb2, 0x1a, 0x0, 0xc0, 0x4f, 0xa3, 0x57, 0xfa);")
  32. cpp_quote("// {A9AE6C90-1D1B-11D2-B21A-00C04FA357FA}")
  33. cpp_quote("DEFINE_GUID(IID_IUserIdentityManager, 0xa9ae6C90, 0x1d1b, 0x11d2, 0xb2, 0x1a, 0x0, 0xc0, 0x4f, 0xa3, 0x57, 0xfa);")
  34. cpp_quote("// {A9AE6C92-1D1B-11D2-B21A-00C04FA357FA}")
  35. cpp_quote("DEFINE_GUID(IID_IIdentityChangeNotify, 0xa9ae6C92, 0x1d1b, 0x11d2, 0xb2, 0x1a, 0x0, 0xc0, 0x4f, 0xa3, 0x57, 0xfa);")
  36. cpp_quote("// {A9AE6C93-1D1B-11D2-B21A-00C04FA357FA}")
  37. cpp_quote("DEFINE_GUID(IID_IPrivateIdentityManager, 0xa9ae6C93, 0x1d1b, 0x11d2, 0xb2, 0x1a, 0x0, 0xc0, 0x4f, 0xa3, 0x57, 0xfa);")
  38. cpp_quote("// {A9AE6C94-1D1B-11D2-B21A-00C04FA357FA}")
  39. cpp_quote("DEFINE_GUID(IID_IUserIdentity2, 0xa9ae6C94, 0x1d1b, 0x11d2, 0xb2, 0x1a, 0x0, 0xc0, 0x4f, 0xa3, 0x57, 0xfa);")
  40. cpp_quote("// {47172E6C-EA67-4ccd-B5CE-2EABBE051404}")
  41. cpp_quote("DEFINE_GUID(IID_IPrivateIdentityManager2, 0x47172e6c, 0xea67, 0x4ccd, 0xb5, 0xce, 0x2e, 0xab, 0xbe, 0x5, 0x14, 0x4);")
  42. cpp_quote("// {C28E26E6-219D-11d2-B200-0000F8085266}")
  43. cpp_quote("DEFINE_GUID(UID_GIBC_DEFAULT_USER, 0xc28e26e6, 0x219d, 0x11d2, 0xb2, 0x0, 0x0, 0x0, 0xf8, 0x8, 0x52, 0x66);")
  44. cpp_quote("// {C28E26E7-219D-11d2-B200-0000F8085266}")
  45. cpp_quote("DEFINE_GUID(UID_GIBC_CURRENT_USER, 0xc28e26e7, 0x219d, 0x11d2, 0xb2, 0x0, 0x0, 0x0, 0xf8, 0x8, 0x52, 0x66);")
  46. cpp_quote("// {C28E26E8-219D-11d2-B200-0000F8085266}")
  47. cpp_quote("DEFINE_GUID(UID_GIBC_OUTGOING_USER, 0xc28e26e8, 0x219d, 0x11d2, 0xb2, 0x0, 0x0, 0x0, 0xf8, 0x8, 0x52, 0x66);")
  48. cpp_quote("// {C28E26E9-219D-11d2-B200-0000F8085266}")
  49. cpp_quote("DEFINE_GUID(UID_GIBC_INCOMING_USER, 0xc28e26e9, 0x219d, 0x11d2, 0xb2, 0x0, 0x0, 0x0, 0xf8, 0x8, 0x52, 0x66);")
  50. cpp_quote("")
  51. cpp_quote("// --------------------------------------------------------------------------------")
  52. cpp_quote("// ERROR CODES")
  53. cpp_quote("// --------------------------------------------------------------------------------")
  54. cpp_quote("#define E_IDENTITIES_DISABLED _HRESULT_TYPEDEF_(0x80007110L)")
  55. cpp_quote("#define S_IDENTITIES_DISABLED _HRESULT_TYPEDEF_(0x00007110L)")
  56. cpp_quote("#define E_NO_CURRENT_IDENTITY _HRESULT_TYPEDEF_(0x80007111L)")
  57. cpp_quote("#define E_USER_CANCELLED _HRESULT_TYPEDEF_(0x80007112L)")
  58. cpp_quote("#define E_PROCESS_CANCELLED_SWITCH _HRESULT_TYPEDEF_(0x80007113L)")
  59. cpp_quote("#define E_IDENTITY_NOT_FOUND _HRESULT_TYPEDEF_(0x80007114L)")
  60. cpp_quote("#define E_IDENTITY_EXISTS _HRESULT_TYPEDEF_(0x80007115L)")
  61. cpp_quote("#define E_IDENTITY_CHANGING _HRESULT_TYPEDEF_(0x80007116L)")
  62. cpp_quote("")
  63. cpp_quote("#define CCH_IDENTITY_NAME_MAX_LENGTH (63)")
  64. #ifndef DO_NO_IMPORTS
  65. import "unknwn.idl";
  66. import "ocidl.idl";
  67. import "oleidl.idl";
  68. import "oaidl.idl";
  69. #endif
  70. [
  71. uuid(A9AE6C8E-1D1B-11D2-B21A-00C04FA357FA), // IID_IUserIdentity
  72. helpstring("User Identity interface")
  73. ]
  74. interface IUserIdentity : IUnknown
  75. {
  76. // Get cookie for this user
  77. HRESULT GetCookie([out] GUID *puidCookie);
  78. // Get user name
  79. HRESULT GetName([in] WCHAR *pszName, [in] ULONG ulBuffSize);
  80. // Get private registry location
  81. [local]
  82. HRESULT OpenIdentityRegKey([in]DWORD dwDesiredAccess, [out] HKEY *phKey);
  83. // Get a per-user folder
  84. HRESULT GetIdentityFolder([in] DWORD dwFlags, [in] WCHAR *pszPath, [in] ULONG ulBuffSize);
  85. cpp_quote("#define GIF_ROAMING_FOLDER 0x00000001")
  86. cpp_quote("#define GIF_NON_ROAMING_FOLDER 0x00000002")
  87. }
  88. [
  89. uuid(A9AE6C8F-1D1B-11D2-B21A-00C04FA357FA), // IID_IEnumUserIdentity
  90. helpstring("Enum User Identity interface"),
  91. odl
  92. ]
  93. interface IEnumUserIdentity : IUnknown
  94. {
  95. HRESULT Next(
  96. [in] ULONG celt,
  97. [out, size_is(celt), length_is(*pceltFetched)]
  98. IUnknown **rgelt,
  99. [out] ULONG *pceltFetched);
  100. HRESULT Skip([in] ULONG celt);
  101. HRESULT Reset();
  102. HRESULT Clone([out] IEnumUserIdentity **ppenum);
  103. HRESULT GetCount([out] ULONG *pnCount);
  104. }
  105. [
  106. uuid(A9AE6C90-1D1B-11D2-B21A-00C04FA357FA), // IID_IUserIdentityManager
  107. helpstring("User Identity manager interface")
  108. ]
  109. interface IUserIdentityManager : IUnknown
  110. {
  111. // Get a list of all users
  112. HRESULT EnumIdentities([out] IEnumUserIdentity **ppEnumUser);
  113. // Show UI to manage users
  114. HRESULT ManageIdentities([in] HWND hwndParent, [in] DWORD dwFlags);
  115. cpp_quote("#define UIMI_CREATE_NEW_IDENTITY 0x00000001")
  116. // Show UI to logon a user
  117. HRESULT Logon([in] HWND hwndParent, [in] DWORD dwFlags, [out] IUserIdentity **ppIdentity);
  118. cpp_quote("#define UIL_FORCE_UI 0x80000001")
  119. // Log the current user off
  120. HRESULT Logoff([in] HWND hwndParent);
  121. // Get an arbitrary user by cookie
  122. HRESULT GetIdentityByCookie([in] GUID *uidCookie, [out] IUserIdentity **ppIdentity);
  123. }
  124. [
  125. uuid(A9AE6C92-1D1B-11D2-B21A-00C04FA357FA), // IID_IIdentityChangeNotify
  126. helpstring("User Identity change notification interface")
  127. ]
  128. interface IIdentityChangeNotify : IUnknown
  129. {
  130. // The user has requested a switch. Return E_PROCESS_CANCELLED_SWITCH
  131. // if the switch should not take place.
  132. HRESULT QuerySwitchIdentities();
  133. // A switch has occurred. Reload any settings necessary from the current identity
  134. HRESULT SwitchIdentities();
  135. // Some property (name, etc) of an identity has been updated or an identity has been added/deleted.
  136. HRESULT IdentityInformationChanged(DWORD dwType);
  137. cpp_quote("#define IIC_CURRENT_IDENTITY_CHANGED 0x00000001")
  138. cpp_quote("#define IIC_IDENTITY_CHANGED 0x00000002")
  139. cpp_quote("#define IIC_IDENTITY_DELETED 0x00000004")
  140. cpp_quote("#define IIC_IDENTITY_ADDED 0x00000008")
  141. }
  142. [
  143. uuid(A9AE6C93-1D1B-11D2-B21A-00C04FA357FA), // IID_IPrivateIdentityManager
  144. helpstring("PRIVATE User Identity user list manipulation interface")
  145. ]
  146. interface IPrivateIdentityManager : IUnknown
  147. {
  148. // Create a new identity with a given name.
  149. HRESULT CreateIdentity([in] WCHAR *pszName, [out] IUserIdentity **ppIdentity);
  150. // Verify a password for the indicated identity
  151. HRESULT ConfirmPassword([in] GUID *uidCookie, [in] WCHAR *pszPassword);
  152. }
  153. [
  154. uuid(15E84C92-2E4D-11d3-9C92-00104B35E7F9), // IID_IPrivateIdentityManager2
  155. helpstring("PRIVATE User Identity user list manipulation interface 2")
  156. ]
  157. interface IPrivateIdentityManager2 : IUnknown
  158. {
  159. // Create a new identity with a given name.
  160. HRESULT CreateIdentity2([in] WCHAR *pszName, [in] WCHAR *pszPassword, [out] IUserIdentity **ppIdentity);
  161. // Removes an identity
  162. HRESULT DestroyIdentity([in] GUID *uidCookie);
  163. // Logon as named user with password
  164. HRESULT LogonAs([in] WCHAR *pszName, [in] WCHAR *pszPassword, [out] IUserIdentity **ppIdentity);
  165. HRESULT SetDefaultIdentity([in] GUID *puidCookie);
  166. HRESULT GetDefaultIdentity([out] GUID *puidCookie);
  167. }
  168. cpp_quote("extern const IID CLSID_UserIdentityManager;")
  169. [
  170. uuid(A9AE6C94-1D1B-11D2-B21A-00C04FA357FA), // IID_IUserIdentity2
  171. helpstring("User Identity interface")
  172. ]
  173. interface IUserIdentity2 : IUserIdentity
  174. {
  175. // Get ordinal for this user
  176. HRESULT GetOrdinal([out] DWORD* dwOrdinal);
  177. HRESULT SetName([in] WCHAR *pszName);
  178. HRESULT ChangePassword([in] WCHAR *szOldPass, [in] WCHAR *szNewPass);
  179. }