]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/UserCredential.h
Update the copyright notice format
[mirror_edk2.git] / MdePkg / Include / Protocol / UserCredential.h
CommitLineData
2832b228 1/** @file\r
2 UEFI 2.2 User Credential Protocol definition.\r
3\r
4 Attached to a device handle, this protocol identifies a single means of identifying the user.\r
5\r
9df063a0
HT
6 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
7 This program and the accompanying materials \r
2832b228 8 are licensed and made available under the terms and conditions of the BSD License \r
9 which accompanies this distribution. The full text of the license may be found at \r
10 http://opensource.org/licenses/bsd-license.php \r
11\r
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
14\r
15**/\r
16\r
17#ifndef __USER_CREDENTIAL_H__\r
18#define __USER_CREDENTIAL_H__\r
19\r
75dad611 20#include <Protocol/UserManager.h>\r
21\r
2832b228 22#define EFI_USER_CREDENTIAL_PROTOCOL_GUID \\r
23 { \\r
24 0x71ee5e94, 0x65b9, 0x45d5, { 0x82, 0x1a, 0x3a, 0x4d, 0x86, 0xcf, 0xe6, 0xbe } \\r
25 }\r
26\r
2832b228 27typedef struct _EFI_USER_CREDENTIAL_PROTOCOL EFI_USER_CREDENTIAL_PROTOCOL;\r
28\r
29/**\r
30 Enroll a user on a credential provider.\r
31\r
7fedcf9d 32 This function enrolls and deletes a user profile using this credential provider. If a user profile\r
33 is successfully enrolled, it calls the User Manager Protocol function Notify() to notify the user \r
34 manager driver that credential information has changed. If an enrolled user does exist, delete the \r
35 user on the credential provider.\r
2832b228 36\r
37 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
38 @param[in] User The user profile to enroll.\r
39 \r
40 @retval EFI_SUCCESS User profile was successfully enrolled.\r
41 @retval EFI_ACCESS_DENIED Current user profile does not permit enrollment on the user profile \r
42 handle. Either the user profile cannot enroll on any user profile or \r
43 cannot enroll on a user profile other than the current user profile.\r
44 @retval EFI_UNSUPPORTED This credential provider does not support enrollment in the pre-OS.\r
45 @retval EFI_DEVICE_ERROR The new credential could not be created because of a device error.\r
46 @retval EFI_INVALID_PARAMETER User does not refer to a valid user profile handle.\r
47**/\r
48typedef\r
49EFI_STATUS\r
50(EFIAPI *EFI_CREDENTIAL_ENROLL)(\r
51 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
52 IN EFI_USER_PROFILE_HANDLE User\r
53 );\r
54\r
55/**\r
56 Returns the user interface information used during user identification.\r
57\r
58 This function returns information about the form used when interacting with the user during user \r
59 identification. The form is the first enabled form in the form-set class \r
60 EFI_HII_USER_CREDENTIAL_FORMSET_GUID installed on the HII handle HiiHandle. If \r
61 the user credential provider does not require a form to identify the user, then this function should \r
62 return EFI_NOT_FOUND.\r
63\r
7fedcf9d 64 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
65 @param[out] Hii On return, holds the HII database handle.\r
66 @param[out] FormSetId On return, holds the identifier of the form set which contains\r
67 the form used during user identification.\r
68 @param[out] FormId On return, holds the identifier of the form used during user \r
69 identification.\r
2832b228 70 \r
7fedcf9d 71 @retval EFI_SUCCESS Form returned successfully.\r
72 @retval EFI_NOT_FOUND Form not returned.\r
73 @retval EFI_INVALID_PARAMETER Hii is NULL or FormSetId is NULL or FormId is NULL.\r
2832b228 74**/\r
75typedef\r
76EFI_STATUS\r
77(EFIAPI *EFI_CREDENTIAL_FORM)(\r
78 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
79 OUT EFI_HII_HANDLE *Hii,\r
80 OUT EFI_GUID *FormSetId,\r
81 OUT EFI_FORM_ID *FormId\r
82 );\r
83\r
84/**\r
85 Returns bitmap used to describe the credential provider type.\r
86\r
87 This optional function returns a bitmap which is less than or equal to the number of pixels specified \r
88 by Width and Height. If no such bitmap exists, then EFI_NOT_FOUND is returned. \r
89\r
7fedcf9d 90 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
91 @param[in, out] Width On entry, points to the desired bitmap width. If NULL then no bitmap\r
92 information will be returned. On exit, points to the width of the \r
93 bitmap returned.\r
94 @param[in, out] Height On entry, points to the desired bitmap height. If NULL then no bitmap \r
95 information will be returned. On exit, points to the height of the \r
96 bitmap returned\r
97 @param[out] Hii On return, holds the HII database handle. \r
98 @param[out] Image On return, holds the HII image identifier. \r
2832b228 99 \r
7fedcf9d 100 @retval EFI_SUCCESS Image identifier returned successfully.\r
101 @retval EFI_NOT_FOUND Image identifier not returned.\r
102 @retval EFI_INVALID_PARAMETER Hii is NULL or Image is NULL.\r
2832b228 103**/\r
104typedef\r
105EFI_STATUS\r
106(EFIAPI *EFI_CREDENTIAL_TILE)(\r
107 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
108 IN OUT UINTN *Width,\r
109 IN OUT UINTN *Height,\r
110 OUT EFI_HII_HANDLE *Hii,\r
111 OUT EFI_IMAGE_ID *Image\r
112 );\r
113\r
114/**\r
115 Returns string used to describe the credential provider type.\r
116\r
117 This function returns a string which describes the credential provider. If no such string exists, then \r
118 EFI_NOT_FOUND is returned. \r
119\r
7fedcf9d 120 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
121 @param[out] Hii On return, holds the HII database handle.\r
122 @param[out] String On return, holds the HII string identifier.\r
2832b228 123 \r
7fedcf9d 124 @retval EFI_SUCCESS String identifier returned successfully.\r
125 @retval EFI_NOT_FOUND String identifier not returned.\r
126 @retval EFI_INVALID_PARAMETER Hii is NULL or String is NULL.\r
2832b228 127**/\r
128typedef\r
129EFI_STATUS\r
130(EFIAPI *EFI_CREDENTIAL_TITLE)(\r
131 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
132 OUT EFI_HII_HANDLE *Hii,\r
133 OUT EFI_STRING_ID *String\r
134 );\r
135\r
136/**\r
137 Return the user identifier associated with the currently authenticated user.\r
138\r
139 This function returns the user identifier of the user authenticated by this credential provider. This \r
140 function is called after the credential-related information has been submitted on a form OR after a \r
141 call to Default() has returned that this credential is ready to log on.\r
142\r
7fedcf9d 143 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
144 @param[in] User The user profile handle of the user profile currently being considered \r
145 by the user identity manager. If NULL, then no user profile is currently \r
146 under consideration.\r
147 @param[out] Identifier On return, points to the user identifier. \r
2832b228 148 \r
7fedcf9d 149 @retval EFI_SUCCESS User identifier returned successfully.\r
150 @retval EFI_NOT_READY No user identifier can be returned.\r
151 @retval EFI_ACCESS_DENIED The user has been locked out of this user credential.\r
152 @retval EFI_NOT_FOUND User is not NULL, and the specified user handle can't be found in user \r
153 profile database \r
154 @retval EFI_INVALID_PARAMETER Identifier is NULL.\r
2832b228 155**/\r
156typedef\r
157EFI_STATUS\r
158(EFIAPI *EFI_CREDENTIAL_USER)(\r
159 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
160 IN EFI_USER_PROFILE_HANDLE User,\r
161 OUT EFI_USER_INFO_IDENTIFIER *Identifier\r
162 );\r
163\r
164/**\r
165 Indicate that user interface interaction has begun for the specified credential.\r
166\r
167 This function is called when a credential provider is selected by the user. If AutoLogon returns \r
168 FALSE, then the user interface will be constructed by the User Identity Manager. \r
169\r
7fedcf9d 170 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
171 @param[out] AutoLogon On return, points to the credential provider's capabilities after \r
172 the credential provider has been selected by the user. \r
2832b228 173 \r
7fedcf9d 174 @retval EFI_SUCCESS Credential provider successfully selected.\r
175 @retval EFI_INVALID_PARAMETER AutoLogon is NULL.\r
2832b228 176**/\r
177typedef\r
178EFI_STATUS\r
179(EFIAPI *EFI_CREDENTIAL_SELECT)(\r
180 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
181 OUT EFI_CREDENTIAL_LOGON_FLAGS *AutoLogon\r
182 ); \r
183\r
184/**\r
185 Indicate that user interface interaction has ended for the specified credential.\r
186\r
187 This function is called when a credential provider is deselected by the user.\r
188\r
189 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
190 \r
191 @retval EFI_SUCCESS Credential provider successfully deselected.\r
192**/\r
193typedef\r
194EFI_STATUS\r
195(EFIAPI *EFI_CREDENTIAL_DESELECT)(\r
196 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This\r
197 );\r
198\r
199/**\r
200 Return the default logon behavior for this user credential.\r
201\r
202 This function reports the default login behavior regarding this credential provider. \r
203\r
7fedcf9d 204 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
205 @param[out] AutoLogon On return, holds whether the credential provider should be \r
206 used by default to automatically log on the user. \r
2832b228 207 \r
7fedcf9d 208 @retval EFI_SUCCESS Default information successfully returned.\r
209 @retval EFI_INVALID_PARAMETER AutoLogon is NULL.\r
2832b228 210**/\r
211typedef \r
212EFI_STATUS\r
213(EFIAPI *EFI_CREDENTIAL_DEFAULT)(\r
214 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
215 OUT EFI_CREDENTIAL_LOGON_FLAGS *AutoLogon\r
216 );\r
217\r
218/**\r
219 Return information attached to the credential provider.\r
220\r
221 This function returns user information. \r
222\r
223 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
224 @param[in] UserInfo Handle of the user information data record. \r
225 @param[out] Info On entry, points to a buffer of at least *InfoSize bytes. On exit, holds the user \r
226 information. If the buffer is too small to hold the information, then \r
227 EFI_BUFFER_TOO_SMALL is returned and InfoSize is updated to contain the \r
228 number of bytes actually required.\r
229 @param[in,out] InfoSize On entry, points to the size of Info. On return, points to the size of the user \r
230 information. \r
231 \r
232 @retval EFI_SUCCESS Information returned successfully.\r
2832b228 233 @retval EFI_BUFFER_TOO_SMALL The size specified by InfoSize is too small to hold all of the user \r
234 information. The size required is returned in *InfoSize.\r
7fedcf9d 235 @retval EFI_NOT_FOUND The specified UserInfo does not refer to a valid user info handle.\r
236 @retval EFI_INVALID_PARAMETER Info is NULL or InfoSize is NULL. \r
2832b228 237**/\r
238typedef\r
239EFI_STATUS\r
240(EFIAPI *EFI_CREDENTIAL_GET_INFO)(\r
241 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
242 IN EFI_USER_INFO_HANDLE UserInfo,\r
243 OUT EFI_USER_INFO *Info,\r
244 IN OUT UINTN *InfoSize\r
245 );\r
246\r
247/**\r
7fedcf9d 248 Enumerate all of the user information records on the credential provider.\r
2832b228 249\r
250 This function returns the next user information record. To retrieve the first user information record \r
251 handle, point UserInfo at a NULL. Each subsequent call will retrieve another user information \r
252 record handle until there are no more, at which point UserInfo will point to NULL. \r
253\r
7fedcf9d 254 @param[in] This Points to this instance of the EFI_USER_CREDENTIAL_PROTOCOL.\r
255 @param[in,out] UserInfo On entry, points to the previous user information handle or NULL to \r
256 start enumeration. On exit, points to the next user information handle \r
257 or NULL if there is no more user information.\r
2832b228 258 \r
7fedcf9d 259 @retval EFI_SUCCESS User information returned.\r
260 @retval EFI_NOT_FOUND No more user information found.\r
261 @retval EFI_INVALID_PARAMETER UserInfo is NULL.\r
2832b228 262**/\r
263typedef\r
264EFI_STATUS\r
265(EFIAPI *EFI_CREDENTIAL_GET_NEXT_INFO)(\r
266 IN CONST EFI_USER_CREDENTIAL_PROTOCOL *This,\r
267 IN OUT EFI_USER_INFO_HANDLE *UserInfo\r
268 );\r
269\r
270///\r
271/// This protocol provides support for a single class of credentials\r
272///\r
273struct _EFI_USER_CREDENTIAL_PROTOCOL {\r
274 EFI_GUID Identifier; ///< Uniquely identifies this credential provider.\r
275 EFI_GUID Type; ///< Identifies this class of User Credential Provider.\r
276 EFI_CREDENTIAL_ENROLL Enroll;\r
277 EFI_CREDENTIAL_FORM Form;\r
278 EFI_CREDENTIAL_TILE Tile;\r
279 EFI_CREDENTIAL_TITLE Title;\r
280 EFI_CREDENTIAL_USER User;\r
281 EFI_CREDENTIAL_SELECT Select; \r
282 EFI_CREDENTIAL_DESELECT Deselect;\r
283 EFI_CREDENTIAL_DEFAULT Default;\r
284 EFI_CREDENTIAL_GET_INFO GetInfo;\r
285 EFI_CREDENTIAL_GET_NEXT_INFO GetNextInfo;\r
286 EFI_CREDENTIAL_CAPABILITIES Capabilities;\r
287};\r
288\r
289extern EFI_GUID gEfiUserCredentialProtocolGuid;\r
290\r
291#endif\r