1 // Licensed under the Apache License, Version 2.0 2 // <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license 3 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option. 4 // All files in the project carrying such notice may not be copied, modified, or distributed 5 // except according to those terms. 6 use shared::guiddef::GUID; 7 use shared::minwindef::{BOOL, DWORD}; 8 use um::eaptypes::EAP_METHOD_TYPE; 9 use um::l2cmn::L2_REASON_CODE_ONEX_BASE; 10 use um::winnt::HANDLE; 11 ENUM!{enum ONEX_AUTH_IDENTITY { 12 OneXAuthIdentityNone = 0, 13 OneXAuthIdentityMachine = 1, 14 OneXAuthIdentityUser = 2, 15 OneXAuthIdentityExplicitUser = 3, 16 OneXAuthIdentityGuest = 4, 17 OneXAuthIdentityInvalid = 5, 18 }} 19 pub type PONEX_AUTH_IDENTITY = *mut ONEX_AUTH_IDENTITY; 20 ENUM!{enum ONEX_AUTH_STATUS { 21 OneXAuthNotStarted = 0, 22 OneXAuthInProgress = 1, 23 OneXAuthNoAuthenticatorFound = 2, 24 OneXAuthSuccess = 3, 25 OneXAuthFailure = 4, 26 OneXAuthInvalid = 5, 27 }} 28 pub type PONEX_AUTH_STATUS = *mut ONEX_AUTH_STATUS; 29 ENUM!{enum ONEX_REASON_CODE { 30 ONEX_REASON_CODE_SUCCESS = 0, 31 ONEX_REASON_START = L2_REASON_CODE_ONEX_BASE, 32 ONEX_UNABLE_TO_IDENTIFY_USER = 327681, 33 ONEX_IDENTITY_NOT_FOUND = 327682, 34 ONEX_UI_DISABLED = 327683, 35 ONEX_UI_FAILURE = 327684, 36 ONEX_EAP_FAILURE_RECEIVED = 327685, 37 ONEX_AUTHENTICATOR_NO_LONGER_PRESENT = 327686, 38 ONEX_NO_RESPONSE_TO_IDENTITY = 327687, 39 ONEX_PROFILE_VERSION_NOT_SUPPORTED = 327688, 40 ONEX_PROFILE_INVALID_LENGTH = 327689, 41 ONEX_PROFILE_DISALLOWED_EAP_TYPE = 327690, 42 ONEX_PROFILE_INVALID_EAP_TYPE_OR_FLAG = 327691, 43 ONEX_PROFILE_INVALID_ONEX_FLAGS = 327692, 44 ONEX_PROFILE_INVALID_TIMER_VALUE = 327693, 45 ONEX_PROFILE_INVALID_SUPPLICANT_MODE = 327694, 46 ONEX_PROFILE_INVALID_AUTH_MODE = 327695, 47 ONEX_PROFILE_INVALID_EAP_CONNECTION_PROPERTIES = 327696, 48 ONEX_UI_CANCELLED = 327697, 49 ONEX_PROFILE_INVALID_EXPLICIT_CREDENTIALS = 327698, 50 ONEX_PROFILE_EXPIRED_EXPLICIT_CREDENTIALS = 327699, 51 ONEX_UI_NOT_PERMITTED = 327700, 52 }} 53 pub type PONEX_REASON_CODE = *mut ONEX_REASON_CODE; 54 ENUM!{enum ONEX_NOTIFICATION_TYPE { 55 OneXPublicNotificationBase = 0, 56 OneXNotificationTypeResultUpdate = 1, 57 OneXNotificationTypeAuthRestarted = 2, 58 OneXNotificationTypeEventInvalid = 3, 59 OneXNumNotifications = OneXNotificationTypeEventInvalid, 60 }} 61 pub type PONEX_NOTIFICATION_TYPE = *mut ONEX_NOTIFICATION_TYPE; 62 ENUM!{enum ONEX_AUTH_RESTART_REASON { 63 OneXRestartReasonPeerInitiated = 0, 64 OneXRestartReasonMsmInitiated = 1, 65 OneXRestartReasonOneXHeldStateTimeout = 2, 66 OneXRestartReasonOneXAuthTimeout = 3, 67 OneXRestartReasonOneXConfigurationChanged = 4, 68 OneXRestartReasonOneXUserChanged = 5, 69 OneXRestartReasonQuarantineStateChanged = 6, 70 OneXRestartReasonAltCredsTrial = 7, 71 OneXRestartReasonInvalid = 8, 72 }} 73 pub type PONEX_AUTH_RESTART_REASON = *mut ONEX_AUTH_RESTART_REASON; 74 STRUCT!{struct ONEX_VARIABLE_BLOB { 75 dwSize: DWORD, 76 dwOffset: DWORD, 77 }} 78 pub type PONEX_VARIABLE_BLOB = *mut ONEX_VARIABLE_BLOB; 79 STRUCT!{struct ONEX_AUTH_PARAMS { 80 fUpdatePending: BOOL, 81 oneXConnProfile: ONEX_VARIABLE_BLOB, 82 authIdentity: ONEX_AUTH_IDENTITY, 83 dwQuarantineState: DWORD, 84 Bitfields: DWORD, 85 dwSessionId: DWORD, 86 hUserToken: HANDLE, 87 OneXUserProfile: ONEX_VARIABLE_BLOB, 88 Identity: ONEX_VARIABLE_BLOB, 89 UserName: ONEX_VARIABLE_BLOB, 90 Domain: ONEX_VARIABLE_BLOB, 91 }} 92 BITFIELD!{ONEX_AUTH_PARAMS Bitfields: DWORD [ 93 fSessionId set_fSessionId[0..1], 94 fhUserToken set_fhUserToken[1..2], 95 fOnexUserProfile set_fOnexUserProfile[2..3], 96 fIdentity set_fIdentity[3..4], 97 fUserName set_fUserName[4..5], 98 fDomain set_fDomain[5..6], 99 ]} 100 pub type PONEX_AUTH_PARAMS = *mut ONEX_AUTH_PARAMS; 101 STRUCT!{struct ONEX_EAP_ERROR { 102 dwWinError: DWORD, 103 type_: EAP_METHOD_TYPE, 104 dwReasonCode: DWORD, 105 rootCauseGuid: GUID, 106 repairGuid: GUID, 107 helpLinkGuid: GUID, 108 Bitfields: DWORD, 109 RootCauseString: ONEX_VARIABLE_BLOB, 110 RepairString: ONEX_VARIABLE_BLOB, 111 }} 112 BITFIELD!{ONEX_EAP_ERROR Bitfields: DWORD [ 113 fRootCauseString set_fRootCauseString[0..1], 114 fRepairString set_fRepairString[1..2], 115 ]} 116 pub type PONEX_EAP_ERROR = *mut ONEX_EAP_ERROR; 117 STRUCT!{struct ONEX_STATUS { 118 authStatus: ONEX_AUTH_STATUS, 119 dwReason: DWORD, 120 dwError: DWORD, 121 }} 122 pub type PONEX_STATUS = *mut ONEX_STATUS; 123 ENUM!{enum ONEX_EAP_METHOD_BACKEND_SUPPORT { 124 OneXEapMethodBackendSupportUnknown = 0, 125 OneXEapMethodBackendSupported = 1, 126 OneXEapMethodBackendUnsupported = 2, 127 }} 128 STRUCT!{struct ONEX_RESULT_UPDATE_DATA { 129 oneXStatus: ONEX_STATUS, 130 BackendSupport: ONEX_EAP_METHOD_BACKEND_SUPPORT, 131 fBackendEngaged: BOOL, 132 Bitfields: DWORD, 133 authParams: ONEX_VARIABLE_BLOB, 134 eapError: ONEX_VARIABLE_BLOB, 135 }} 136 BITFIELD!{ONEX_RESULT_UPDATE_DATA Bitfields: DWORD [ 137 fOneXAuthParams set_fOneXAuthParams[0..1], 138 fEapError set_fEapError[1..2], 139 ]} 140 pub type PONEX_RESULT_UPDATE_DATA = *mut ONEX_RESULT_UPDATE_DATA; 141 STRUCT!{struct ONEX_USER_INFO { 142 authIdentity: ONEX_AUTH_IDENTITY, 143 Bitfields: DWORD, 144 UserName: ONEX_VARIABLE_BLOB, 145 DomainName: ONEX_VARIABLE_BLOB, 146 }} 147 BITFIELD!{ONEX_USER_INFO Bitfields: DWORD [ 148 fUserName set_fUserName[0..1], 149 fDomainName set_fDomainName[1..2], 150 ]} 151 pub type PONEX_USER_INFO = *mut ONEX_USER_INFO; 152