' ########################################################################################
' Microsoft Windows
' File: eaptypes.inc
' Contents: IDL source for interaction with EAPHost supplicants.
' Copyright (c) 2011 Jos? Roca
' Portions Copyright (c) Microsoft Corporation.
' All Rights Reserved.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################
#IF NOT %DEF(PBX_eaptypes_PBI)
#DEFINE PBX_eaptypes_PBI
%EQUATE `EAPTYPES_INC = 1
#INCLUDE ONCE "Legacy/UI/Guiddef.inc" ' // Used by EAP_ERROR structure.
'// Properties that EAP Methods support
%EQUATE `eapPropCipherSuiteNegotiation = &H00000001
%EQUATE `eapPropMutualAuth = &H00000002
%EQUATE `eapPropIntegrity = &H00000004
%EQUATE `eapPropReplayProtection = &H00000008
%EQUATE `eapPropConfidentiality = &H00000010
%EQUATE `eapPropKeyDerivation = &H00000020
%EQUATE `eapPropKeyStrength64 = &H00000040
%EQUATE `eapPropKeyStrength128 = &H00000080
%EQUATE `eapPropKeyStrength256 = &H00000100
%EQUATE `eapPropKeyStrength512 = &H00000200
%EQUATE `eapPropKeyStrength1024 = &H00000400
%EQUATE `eapPropDictionaryAttackResistance = &H00000800
%EQUATE `eapPropFastReconnect = &H00001000
%EQUATE `eapPropCryptoBinding = &H00002000
%EQUATE `eapPropSessionIndependence = &H00004000
%EQUATE `eapPropFragmentation = &H00008000
%EQUATE `eapPropChannelBinding = &H00010000
%EQUATE `eapPropNap = &H00020000
%EQUATE `eapPropStandalone = &H00040000
%EQUATE `eapPropMppeEncryption = &H00080000
%EQUATE `eapPropTunnelMethod = &H00100000
%EQUATE `eapPropSupportsConfig = &H00200000
%EQUATE `eapPropCertifiedMethod = &H00400000
%EQUATE `eapPropHiddenMethod = &H00800000
%EQUATE `eapPropMachineAuth = &H01000000
%EQUATE `eapPropUserAuth = &H02000000
%EQUATE `eapPropIdentityPrivacy = &H04000000
%EQUATE `eapPropMethodChaining = &H08000000
%EQUATE `eapPropSharedStateEquivalence = &H10000000
%EQUATE `eapPropReserved = &H80000000
'// Registry NameValue that stores Properties supported by EAP Method
'#define EAP_VALUENAME_PROPERTIES L"Properties"
$EAP_VALUENAME_PROPERTIES = "Properties"
'typedef DWORD EAP_SESSIONID;
'#IF %DEF(%USEPBDECL)
'' // Note: It's using a wrong alignment.
'TYPE EAP_TYPE
' type AS BYTE
' dwVendorId AS DWORD
' dwVendorType AS DWORD
'END TYPE
'#ELSE
' // Size = 12 bytes
TYPE EAP_TYPE DWORD
 type AS BYTE ' BYTE
 dwVendorId AS DWORD
 dwVendorType AS DWORD
END TYPE
'#ENDIF
' // Size = 16 bytes
TYPE EAP_METHOD_TYPE DWORD
 eapType AS EAP_TYPE ' EAP_TYPE
 dwAuthorId AS DWORD
END TYPE
' // Size = 32 bytes
TYPE EAP_METHOD_INFO DWORD
 eaptype AS EAP_METHOD_TYPE ' EAP_METHOD_TYPE
 pwszAuthorName AS WSTRINGZ PTR
 pwszFriendlyName AS WSTRINGZ PTR
 eapProperties AS DWORD
 pInnerMethodInfo AS EAP_METHOD_INFO PTR ' struct _EAP_METHOD_INFO*
END TYPE
'// EAPHost populates this array with the information for all the eap-methods installed
'// on machine and passes it to a supplicant
' // Size = 8 bytes
TYPE EAP_METHOD_INFO_ARRAY DWORD
 dwNumberOfMethods AS DWORD
 pEapMethods AS EAP_METHOD_INFO PTR ' EAP_METHOD_INFO*
END TYPE
' // Size = 32 bytes
TYPE EAP_METHOD_INFO_EX DWORD
 eaptype AS EAP_METHOD_TYPE ' EAP_METHOD_TYPE
 pwszAuthorName AS WSTRINGZ PTR
 pwszFriendlyName AS WSTRINGZ PTR
 eapProperties AS DWORD
#IF %DEF(%USEPBDECL)
 pInnerMethodInfoArray AS DWORD ' EAP_METHOD_INFO_ARRAY_EX PTR
#ELSE
 pInnerMethodInfoArray AS EAP_METHOD_INFO_ARRAY PTR ' struct _EAP_METHOD_INFO_ARRAY_EX*
#ENDIF
END TYPE
'// EAPHost populates this error structs with appropriate information and passes it to
'// supplicant, which can use this information for error reporting and troubleshooting
' // Size = 8 bytes
TYPE EAP_METHOD_INFO_ARRAY_EX DWORD
 dwNumberOfMethods AS DWORD
 pEapMethods AS EAP_METHOD_INFO_EX PTR ' EAP_METHOD_INFO_EX*
END TYPE
' // Size = 80 bytes
TYPE EAP_ERROR DWORD
 dwWinError AS DWORD
 type AS EAP_METHOD_TYPE ' EAP_METHOD_TYPE
 dwReasonCode AS DWORD
 rootCauseGuid AS GUID ' GUID
 repairGuid AS GUID ' GUID
 helpLinkGuid AS GUID ' GUID
 pRootCauseString AS WSTRINGZ PTR
 pRepairString AS WSTRINGZ PTR
END TYPE
$GUID_EapHost_Default = GUID$("{00000000-0000-0000-0000-000000000000}")
$GUID_EapHost_Cause_MethodDLLNotFound = GUID$("{9612fc67-6150-4209-a85e-a8d800000001}")
$GUID_EapHost_Cause_EapNegotiationFailed = GUID$("{9612fc67-6150-4209-a85e-a8d80000001C}")
$GUID_EapHost_Cause_ThirdPartyMethod_Host_Reset = GUID$("{9612fc67-6150-4209-a85e-a8d800000212}")
$GUID_EapHost_Cause_XmlMalformed = GUID$("{9612fc67-6150-4209-a85e-a8d80000001D}")
$GUID_EapHost_Cause_MethodDoesNotSupportOperation = GUID$("{9612fc67-6150-4209-a85e-a8d80000001E}")
$GUID_EapHost_Cause_EapQecInaccessible = GUID$("{9612fc67-6150-4209-a85e-a8d800000312}")
$GUID_EapHost_Cause_Generic_AuthFailure = GUID$("{9612fc67-6150-4209-a85e-a8d800000104}")
$GUID_EapHost_Cause_IdentityUnknown = GUID$("{9612fc67-6150-4209-a85e-a8d800000204}")
$GUID_EapHost_Cause_CertStoreInaccessible = GUID$("{9612fc67-6150-4209-a85e-a8d800000004}")
$GUID_EapHost_Cause_User_CertExpired = GUID$("{9612fc67-6150-4209-a85e-a8d800000009}")
$GUID_EapHost_Cause_User_CertInvalid = GUID$("{9612fc67-6150-4209-a85e-a8d80000000A}")
$GUID_EapHost_Cause_User_CertNotFound = GUID$("{9612fc67-6150-4209-a85e-a8d80000000B}")
$GUID_EapHost_Cause_User_CertOtherError = GUID$("{9612fc67-6150-4209-a85e-a8d80000000C}")
$GUID_EapHost_Cause_User_CertRejected = GUID$("{9612fc67-6150-4209-a85e-a8d80000000D}")
$GUID_EapHost_Cause_User_CertRevoked = GUID$("{9612fc67-6150-4209-a85e-a8d80000000E}")
$GUID_EapHost_Cause_User_Account_OtherProblem = GUID$("{9612fc67-6150-4209-a85e-a8d80000010E}")
$GUID_EapHost_Cause_User_CredsRejected = GUID$("{9612fc67-6150-4209-a85e-a8d80000020E}")
$GUID_EapHost_Cause_Server_CertExpired = GUID$("{9612fc67-6150-4209-a85e-a8d800000005}")
$GUID_EapHost_Cause_Server_CertInvalid = GUID$("{9612fc67-6150-4209-a85e-a8d800000006}")
$GUID_EapHost_Cause_Server_CertNotFound = GUID$("{9612fc67-6150-4209-a85e-a8d800000007}")
$GUID_EapHost_Cause_Server_CertOtherError = GUID$("{9612fc67-6150-4209-a85e-a8d800000108}")
$GUID_EapHost_Cause_Server_CertRevoked = GUID$("{9612fc67-6150-4209-a85e-a8d800000008}")
$GUID_EapHost_Cause_User_Root_CertExpired = GUID$("{9612fc67-6150-4209-a85e-a8d80000000F}")
$GUID_EapHost_Cause_User_Root_CertInvalid = GUID$("{9612fc67-6150-4209-a85e-a8d800000010}")
$GUID_EapHost_Cause_User_Root_CertNotFound = GUID$("{9612fc67-6150-4209-a85e-a8d800000011}")
$GUID_EapHost_Cause_Server_Root_CertNotFound = GUID$("{9612fc67-6150-4209-a85e-a8d800000112}")
$GUID_EapHost_Cause_Server_Root_CertNameRequired = GUID$("{9612fc67-6150-4209-a85e-a8d800000012}")
$GUID_EapHost_Cause_No_SmartCardReader_Found = GUID$("{9612fc67-6150-4209-a85e-a8d80000002B}")
$GUID_EapHost_Repair_ContactSysadmin = GUID$("{9612fc67-6150-4209-a85e-a8d800000002}")
$GUID_EapHost_Repair_Retry_Authentication = GUID$("{9612fc67-6150-4209-a85e-a8d80000011B}")
$GUID_EapHost_Repair_User_AuthFailure = GUID$("{9612fc67-6150-4209-a85e-a8d800000019}")
$GUID_EapHost_Repair_User_GetNewCert = GUID$("{9612fc67-6150-4209-a85e-a8d80000001A}")
$GUID_EapHost_Repair_User_SelectValidCert = GUID$("{9612fc67-6150-4209-a85e-a8d80000001B}")
$GUID_EapHost_Repair_Server_ClientSelectServerCert = GUID$("{9612fc67-6150-4209-a85e-a8d800000019}")
$GUID_EapHost_Repair_ContactAdmin_AuthFailure = GUID$("{9612fc67-6150-4209-a85e-a8d80000001F}")
$GUID_EapHost_Repair_ContactAdmin_IdentityUnknown = GUID$("{9612fc67-6150-4209-a85e-a8d800000020}")
$GUID_EapHost_Repair_ContactAdmin_NegotiationFailed = GUID$("{9612fc67-6150-4209-a85e-a8d800000021}")
$GUID_EapHost_Repair_ContactAdmin_MethodNotFound = GUID$("{9612fc67-6150-4209-a85e-a8d800000022}")
$GUID_EapHost_Repair_RestartNap = GUID$("{9612fc67-6150-4209-a85e-a8d800000023}")
$GUID_EapHost_Repair_ContactAdmin_CertStoreInaccessible = GUID$("{9612fc67-6150-4209-a85e-a8d800000024}")
$GUID_EapHost_Repair_ContactAdmin_InvalidUserAccount = GUID$("{9612fc67-6150-4209-a85e-a8d800000025}")
$GUID_EapHost_Repair_ContactAdmin_InvalidUserCert = GUID$("{9612fc67-6150-4209-a85e-a8d80000002C}")
$GUID_EapHost_Repair_ContactAdmin_RootCertInvalid = GUID$("{9612fc67-6150-4209-a85e-a8d800000026}")
$GUID_EapHost_Repair_ContactAdmin_RootCertNotFound = GUID$("{9612fc67-6150-4209-a85e-a8d800000027}")
$GUID_EapHost_Repair_ContactAdmin_RootExpired = GUID$("{9612fc67-6150-4209-a85e-a8d800000028}")
$GUID_EapHost_Repair_ContactAdmin_CertNameAbsent = GUID$("{9612fc67-6150-4209-a85e-a8d800000029}")
$GUID_EapHost_Repair_ContactAdmin_NoSmartCardReader = GUID$("{9612fc67-6150-4209-a85e-a8d80000002A}")
$GUID_EapHost_Repair_Method_Not_Support_Sso = GUID$("{9612fc67-6150-4209-a85e-a8d80000002D}")
$GUID_EapHost_Help_ObtainingCerts = GUID$("{f535eea3-1bdd-46ca-a2fc-a6655939b7e8}")
$GUID_EapHost_Help_Troubleshooting = GUID$("{33307acf-0698-41ba-b014-ea0a2eb8d0a8}")
$GUID_EapHost_Cause_Method_Config_Does_Not_Support_Sso = GUID$("{da18bd32-004f-41fa-ae08-0bc85e5845ac}")
' // The following guids are mentioned in the MSDN documentation about the ONEX_EAP_ERROR structure,
' // but not included in eatypes.h
$GUID_EapHost_Help_EapConfigureTypes = GUID$("{9612fc67-6150-4209-a85e-a8d800000003}")
$GUID_EapHost_Help_FailedAuth = GUID$("{9612fc67-6150-4209-a85e-a8d800000013}")
$GUID_EapHost_Help_SelectingCerts = GUID$("{9612fc67-6150-4209-a85e-a8d800000015}")
$GUID_EapHost_Help_SetupEapServer = GUID$("{9612fc67-6150-4209-a85e-a8d800000016}")
'//--------------------------
' enum EAP_ATTRIBUTE_TYPE
%EQUATE `eatMinimum = 0 ' // Undefined
%EQUATE `eatUserName = 1 ' // Value field is a Pointer
%EQUATE `eatUserPassword = 2 ' // Value field is a Pointer
%EQUATE `eatMD5CHAPPassword = 3 ' // Value field is a Pointer
%EQUATE `eatNASIPAddress = 4 ' // Value field is a 32 bit integral value
%EQUATE `eatNASPort = 5 ' // Value field is a 32 bit integral value
%EQUATE `eatServiceType = 6 ' // Value field is a 32 bit integral value
%EQUATE `eatFramedProtocol = 7 ' // Value field is a 32 bit integral value
%EQUATE `eatFramedIPAddress = 8 ' // Value field is a 32 bit integral value
%EQUATE `eatFramedIPNetmask = 9 ' // Value field is a 32 bit integral value
%EQUATE `eatFramedRouting = 10 ' // Value field is a 32 bit integral value
%EQUATE `eatFilterId = 11 ' // Value field is a Pointer
%EQUATE `eatFramedMTU = 12 ' // Value field is a 32 bit integral value
%EQUATE `eatFramedCompression = 13 ' // Value field is a 32 bit integral value
%EQUATE `eatLoginIPHost = 14 ' // Value field is a 32 bit integral value
%EQUATE `eatLoginService = 15 ' // Value field is a 32 bit integral value
%EQUATE `eatLoginTCPPort = 16 ' // Value field is a 32 bit integral value
%EQUATE `eatUnassigned17 = 17 ' // Undefined
%EQUATE `eatReplyMessage = 18 ' // Value field is a Pointer
%EQUATE `eatCallbackNumber = 19 ' // Value field is a Pointer
%EQUATE `eatCallbackId = 20 ' // Value field is a Pointer
%EQUATE `eatUnassigned21 = 21 ' // Undefined
%EQUATE `eatFramedRoute = 22 ' // Value field is a Pointer
%EQUATE `eatFramedIPXNetwork = 23 ' // Value field is a 32 bit integral value
%EQUATE `eatState = 24 ' // Value field is a Pointer
%EQUATE `eatClass = 25 ' // Value field is a Pointer
%EQUATE `eatVendorSpecific = 26 ' // Value field is a Pointer
%EQUATE `eatSessionTimeout = 27 ' // Value field is a 32 bit integral value
%EQUATE `eatIdleTimeout = 28 ' // Value field is a 32 bit integral value
%EQUATE `eatTerminationAction = 29 ' // Value field is a 32 bit integral value
%EQUATE `eatCalledStationId = 30 ' // Value field is a Pointer
%EQUATE `eatCallingStationId = 31 ' // Value field is a Pointer
%EQUATE `eatNASIdentifier = 32 ' // Value field is a Pointer
%EQUATE `eatProxyState = 33 ' // Value field is a Pointer
%EQUATE `eatLoginLATService = 34 ' // Value field is a Pointer
%EQUATE `eatLoginLATNode = 35 ' // Value field is a Pointer
%EQUATE `eatLoginLATGroup = 36 ' // Value field is a Pointer
%EQUATE `eatFramedAppleTalkLink = 37 ' // Value field is a 32 bit integral value
%EQUATE `eatFramedAppleTalkNetwork = 38 ' // Value field is a 32 bit integral value
%EQUATE `eatFramedAppleTalkZone = 39 ' // Value field is a Pointer
%EQUATE `eatAcctStatusType = 40 ' // Value field is a 32 bit integral value
%EQUATE `eatAcctDelayTime = 41 ' // Value field is a 32 bit integral value
%EQUATE `eatAcctInputOctets = 42 ' // Value field is a 32 bit integral value
%EQUATE `eatAcctOutputOctets = 43 ' // Value field is a 32 bit integral value
%EQUATE `eatAcctSessionId = 44 ' // Value field is a Pointer
%EQUATE `eatAcctAuthentic = 45 ' // Value field is a 32 bit integral value
%EQUATE `eatAcctSessionTime = 46 ' // Value field is a 32 bit integral value
%EQUATE `eatAcctInputPackets = 47 ' // Value field is a 32 bit integral value
%EQUATE `eatAcctOutputPackets = 48 ' // Value field is a 32 bit integral value
%EQUATE `eatAcctTerminateCause = 49 ' // Value field is a 32 bit integral value
%EQUATE `eatAcctMultiSessionId = 50 ' // Value field is a Pointer
%EQUATE `eatAcctLinkCount = 51 ' // Value field is a 32 bit integral value
%EQUATE `eatAcctEventTimeStamp = 55 ' // Value field is a 32 bit integral value
%EQUATE `eatMD5CHAPChallenge = 60 ' // Value field is a Pointer
%EQUATE `eatNASPortType = 61 ' // Value field is a 32 bit integral value
%EQUATE `eatPortLimit = 62 ' // Value field is a 32 bit integral value
%EQUATE `eatLoginLATPort = 63 ' // Value field is a Pointer
%EQUATE `eatTunnelType = 64 ' // Value field is a 32 bit integral value
%EQUATE `eatTunnelMediumType = 65 ' // Value field is a 32 bit integral value
%EQUATE `eatTunnelClientEndpoint = 66 ' // Value field is a Pointer
%EQUATE `eatTunnelServerEndpoint = 67 ' // Value field is a Pointer
%EQUATE `eatARAPPassword = 70 ' // Value field is a Pointer
%EQUATE `eatARAPFeatures = 71 ' // Value field is a Pointer
%EQUATE `eatARAPZoneAccess = 72 ' // Value field is a 32 bit integral value
%EQUATE `eatARAPSecurity = 73 ' // Value field is a 32 bit integral value
%EQUATE `eatARAPSecurityData = 74 ' // Value field is a Pointer
%EQUATE `eatPasswordRetry = 75 ' // Value field is a 32 bit integral value
%EQUATE `eatPrompt = 76 ' // Value field is a 32 bit integral value
%EQUATE `eatConnectInfo = 77 ' // Value field is a Pointer
%EQUATE `eatConfigurationToken = 78 ' // Value field is a Pointer
%EQUATE `eatEAPMessage = 79 ' // Value field is a Pointer
%EQUATE `eatSignature = 80 ' // Value field is a Pointer
%EQUATE `eatARAPChallengeResponse = 84 ' // Value field is a Pointer
%EQUATE `eatAcctInterimInterval = 85 ' // Value field is a 32 bit integral value
%EQUATE `eatNASIPv6Address = 95 ' // Value field is a Pointer
%EQUATE `eatFramedInterfaceId = 96 ' // Value field is a Pointer
%EQUATE `eatFramedIPv6Prefix = 97 ' // Value field is a Pointer
%EQUATE `eatLoginIPv6Host = 98 ' // Value field is a Pointer
%EQUATE `eatFramedIPv6Route = 99 ' // Value field is a Pointer
%EQUATE `eatFramedIPv6Pool = 100 ' // Value field is a Pointer
%EQUATE `eatARAPGuestLogon = 8096 ' // Value field is a 32 bit integral value
%EQUATE `eatCertificateOID = 8097 ' // Value field is a Pointer
%EQUATE `eatEAPConfiguration = 8098 ' // Value field is a Pointer
%EQUATE `eatPEAPEmbeddedEAPTypeId = 8099 ' // Value field is a 32 bit integral value
%EQUATE `eatPEAPFastRoamedSession = 8100 ' // Value field is a 32 bit integral value
%EQUATE `eatEAPTLV = 8102 ' // Value field is a Pointer
%EQUATE `eatCredentialsChanged = 8103 ' // Value field is a Integer with boolean
 ' // semantics
%EQUATE `eatInnerEapMethodType = 8104 ' // Value field is a pointer
 ' // EapMethodType of the inner method in
 ' // case of Tunnelled method
%EQUATE `eatClearTextPassword = 8107 ' // Value field is a pointer
 ' // Clear text password that can be used
 ' // by certain password based eap methods
 ' // to authenticate a user.
%EQUATE `eatQuarantineSoH = 8150 ' // Value field is a pointer
%EQUATE `eatPeerId = 9000 ' // Value field is a pointer
%EQUATE `eatServerId = 9001 ' // Value field is a pointer
%EQUATE `eatMethodId = 9002 ' // Value field is a pointer
%EQUATE `eatEMSK = 9003 ' // Value field is a pointer
%EQUATE `eatSessionId = 9004 ' // Value field is a pointer
%EQUATE `eatReserved = &HFFFFFFFF ' // Undefined
' // Size = 12 bytes
TYPE EAP_ATTRIBUTE DWORD
 eaType AS LONG ' EAP_ATTRIBUTE_TYPE
 dwLength AS DWORD
 pValue AS BYTE PTR ' BYTE *
END TYPE
MACRO EapAttribute = EAP_ATTRIBUTE
' // Size = 8 bytes
TYPE EAP_ATTRIBUTES DWORD
 dwNumberOfAttributes AS DWORD
 pAttribs AS EAP_ATTRIBUTE PTR ' EAP_ATTRIBUTE *
END TYPE
MACRO EapAttributes = EAP_ATTRIBUTES
'// No UI should be displayed
%EQUATE `EAP_FLAG_Reserved1 = &H00000001
%EQUATE `EAP_FLAG_NON_INTERACTIVE = &H00000002
'// The user data was obtained from Winlogon
%EQUATE `EAP_FLAG_LOGON = &H00000004
'// Show the Credentails UI before authenticating even if cached creds are present
%EQUATE `EAP_FLAG_PREVIEW = &H00000008
%EQUATE `EAP_FLAG_Reserved2 = &H00000010
'// Authentication is for machine, i.e. not for user. Not setting this flag means
'// it is user authentication.
%EQUATE `EAP_FLAG_MACHINE_AUTH = &H00000020
'// Request to provide guest access
%EQUATE `EAP_FLAG_GUEST_ACCESS = &H00000040
%EQUATE `EAP_FLAG_Reserved3 = &H00000080
%EQUATE `EAP_FLAG_Reserved4 = &H00000100
'// Indicates this is the first call after m/c resumed from hibernation.
%EQUATE `EAP_FLAG_RESUME_FROM_HIBERNATE = &H00000200
%EQUATE `EAP_FLAG_Reserved5 = &H00000400
%EQUATE `EAP_FLAG_Reserved6 = &H00000800
'// Should have this or make it reserved?
%EQUATE `EAP_FLAG_FULL_AUTH = &H00001000
'/// New EapHost Flags
'// Prefer Credentails passed in BeginSession instead of other form of
'// credentials, even if config says use certain way of cred retrieval. If this fails, fallback to
'// Method specific credentail retrieval
%EQUATE `EAP_FLAG_PREFER_ALT_CREDENTIALS = &H00002000
%EQUATE `EAP_FLAG_Reserved7 = &H00004000
'// To inform the cause of reauth is a NAP callback
%EQUATE `EAP_PEER_FLAG_HEALTH_STATE_CHANGE = &H00008000
'// Continue authentication with information available. If can not proceed, fail
'// the authentication
%EQUATE `EAP_FLAG_SUPRESS_UI = &H00010000
'// Pre logon scenario like PLAP
%EQUATE `EAP_FLAG_PRE_LOGON = &H00020000
'// User Authentication. For legacy Methods not setting EAP_FLAG_MACHINE_AUTH
'// also means user authentication.
%EQUATE `EAP_FLAG_USER_AUTH = &H00040000
'// Config can be viewed but not updated
%EQUATE `EAP_FLAG_CONFG_READONLY = &H00080000
%EQUATE `EAP_FLAG_Reserved8 = &H00100000
'// the various states of the input fields
%EQUATE `EAP_CONFIG_INPUT_FIELD_PROPS_DEFAULT = 0
%EQUATE `EAP_CONFIG_INPUT_FIELD_PROPS_NON_DISPLAYABLE = 1
'// This specifies that supplicant should cache this field data
%EQUATE `EAP_CONFIG_INPUT_FIELD_PROPS_NON_PERSIST = &H00000002
'// default property value for entries field to be shown in UI
%EQUATE `EAP_UI_INPUT_FIELD_PROPS_DEFAULT = %EAP_CONFIG_INPUT_FIELD_PROPS_DEFAULT
'// To qualify certain entry data on UI is non-displayable (e.g. password)
%EQUATE `EAP_UI_INPUT_FIELD_PROPS_NON_DISPLAYABLE = %EAP_CONFIG_INPUT_FIELD_PROPS_NON_DISPLAYABLE
'// This specifies that supplicant should cache this field data
%EQUATE `EAP_UI_INPUT_FIELD_PROPS_NON_PERSIST = &H00000002
'// This specifies that following field is read only (non-editable)
%EQUATE `EAP_UI_INPUT_FIELD_PROPS_READ_ONLY = &H00000004
'// the types of fileds that eap can request to show
' enum EAP_CONFIG_INPUT_FIELD_TYPE {
%EQUATE `EapConfigInputUsername = 0
%EQUATE `EapConfigInputPassword = 1
%EQUATE `EapConfigInputNetworkUsername = 2
%EQUATE `EapConfigInputNetworkPassword = 3
%EQUATE `EapConfigInputPin = 4
%EQUATE `EapConfigInputPSK = 5
%EQUATE `EapConfigInputEdit = 6
%EQUATE `EapConfigSmartCardUsername = 7
%EQUATE `EapConfigSmartCardError = 8
%EQUATE `EAP_CREDENTIAL_VERSION = 1
%EQUATE `EAP_INTERACTIVE_UI_DATA_VERSION = 1
%EQUATE `EAPHOST_PEER_API_VERSION = 1
%EQUATE `EAPHOST_METHOD_API_VERSION = 1
%EQUATE `MAX_EAP_CONFIG_INPUT_FIELD_LENGTH = 256
%EQUATE `MAX_EAP_CONFIG_INPUT_FIELD_VALUE_LENGTH = 1024
' // Size = 28 bytes
TYPE EAP_CONFIG_INPUT_FIELD_DATA DWORD
 dwSize AS DWORD
 Type AS LONG ' EAP_CONFIG_INPUT_FIELD_TYPE
 dwFlagProps AS DWORD
 pwszLabel AS WSTRINGZ PTR
 pwszData AS WSTRINGZ PTR
 dwMinDataLength AS DWORD
 dwMaxDataLength AS DWORD
END TYPE
' // Size = 12 bytes
TYPE EAP_CONFIG_INPUT_FIELD_ARRAY DWORD
 dwVersion AS DWORD ' DWORD // used for versioning
 dwNumberOfFields AS DWORD
 pFields AS EAP_CONFIG_INPUT_FIELD_DATA PTR ' EAP_CONFIG_INPUT_FIELD_DATA *
END TYPE
'// provides type of data, EAP_INTERACTIVE_UI_DATA can carry
' enum EAP_INTERACTIVE_UI_DATA_TYPE
%EQUATE `EapCredReq = 0 ' // Credential request during retry
%EQUATE `EapCredResp = 1 ' // Credential response during retry
%EQUATE `EapCredExpiryReq = 2 ' // Credential request during cred expiry
%EQUATE `EapCredExpiryResp = 3 ' // Credential response during cred expiry
%EQUATE `EapCredLogonReq = 4 ' // Initial credential request during auth
%EQUATE `EapCredLogonResp = 5 ' // Initial credential response during auth
'// following determine type of data blob that can be pointed by
'// pbUiData member of EAP_INTERACTIVE_UI_DATA
MACRO EAP_CRED_REQ = EAP_CONFIG_INPUT_FIELD_ARRAY
MACRO EAP_CRED_RESP = EAP_CONFIG_INPUT_FIELD_ARRAY
MACRO EAP_CRED_LOGON_REQ = EAP_CONFIG_INPUT_FIELD_ARRAY
MACRO EAP_CRED_LOGON_RESP = EAP_CONFIG_INPUT_FIELD_ARRAY
'// pNewCreds can be NULL in case of EAP_CRED_EXPIRY_REQ
'// in case of REQ, pNewCreds can be empty (will not be looked at)
' // Size = 24 bytes
TYPE EAP_CRED_EXPIRY_REQ DWORD
 curCreds AS EAP_CONFIG_INPUT_FIELD_ARRAY
 newCreds AS EAP_CONFIG_INPUT_FIELD_ARRAY
END TYPE
' // Size = 4 bytes
UNION EAP_UI_DATA_FORMAT DWORD
 credData AS EAP_CRED_REQ PTR ' EAP_CRED_REQ*
 credExpiryData AS EAP_CRED_EXPIRY_REQ PTR ' EAP_CRED_EXPIRY_REQ*
 credLogonData AS EAP_CRED_LOGON_REQ PTR ' EAP_CRED_LOGON_REQ*
END UNION
'// Data carried from EAP-method to supplicant for interactive UI to raised
' // Size = 20 bytes
TYPE EAP_INTERACTIVE_UI_DATA DWORD
 ' //specifies version of data structure. It must be 0.
 dwVersion AS DWORD
 ' //specifies size of the entire structure.
 dwSize AS DWORD
 ' // this determines what kind of interactive data is passed.
 dwDataType AS LONG ' EAP_INTERACTIVE_UI_DATA_TYPE
 ' // specifies size of the data pointed by pbUiByte.
 cbUiData AS DWORD
 ' // pointer to a data blob of a type determined by dwDataType above.
 ' // This can be of type EAP_CRED_REQ/EAP_CRED_RESP or
 ' // EAP_CRED_EXPIRY_REQ/EAP_CRED_EXPIRY_RESP or
 ' // EAP_CRED_LOGON_REQ/EAP_CRED_LOGON_RESP depending on uiDataType above
 pbUiData AS EAP_UI_DATA_FORMAT
END TYPE
'// Property types that EAP methods support
' enum EAP_METHOD_PROPERTY_TYPE
%EQUATE `emptPropCipherSuiteNegotiation = 0 ' // value field is boolean
%EQUATE `emptPropMutualAuth = 1 ' // value field is boolean
%EQUATE `emptPropIntegrity = 2 ' // value field is boolean
%EQUATE `emptPropReplayProtection = 3 ' // value field is boolean
%EQUATE `emptPropConfidentiality = 4 ' // value field is boolean
%EQUATE `emptPropKeyDerivation = 5 ' // value field is boolean
%EQUATE `emptPropKeyStrength64 = 6 ' // value field is boolean
%EQUATE `emptPropKeyStrength128 = 7 ' // value field is boolean
%EQUATE `emptPropKeyStrength256 = 8 ' // value field is boolean
%EQUATE `emptPropKeyStrength512 = 9 ' // value field is boolean
%EQUATE `emptPropKeyStrength1024 = 10 ' // value field is boolean
%EQUATE `emptPropDictionaryAttackResistance = 11 ' // value field is boolean
%EQUATE `emptPropFastReconnect = 12 ' // value field is boolean
%EQUATE `emptPropCryptoBinding = 13 ' // value field is boolean
%EQUATE `emptPropSessionIndependence = 14 ' // value field is boolean
%EQUATE `emptPropFragmentation = 15 ' // value field is boolean
%EQUATE `emptPropChannelBinding = 16 ' // value field is boolean
%EQUATE `emptPropNap = 17 ' // value field is boolean
%EQUATE `emptPropStandalone = 18 ' // value field is boolean
%EQUATE `emptPropMppeEncryption = 19 ' // value field is boolean
%EQUATE `emptPropTunnelMethod = 20 ' // value field is boolean
%EQUATE `emptPropSupportsConfig = 21 ' // value field is boolean
%EQUATE `emptPropCertifiedMethod = 22 ' // value field is boolean
%EQUATE `emptPropHiddenMethod = 23 ' // value field is boolean
%EQUATE `emptPropMachineAuth = 24 ' // value field is boolean
%EQUATE `emptPropUserAuth = 25 ' // value field is boolean
%EQUATE `emptPropIdentityPrivacy = 26 ' // value field is boolean
%EQUATE `emptPropMethodChaining = 27 ' // value field is boolean
%EQUATE `emptPropSharedStateEquivalence = 28 ' // value field is boolean
%EQUATE `emptLegacyMethodPropertyFlag = 31 ' // value field is dword
%EQUATE `emptPropVendorSpecific = 255 ' // value field is string
'// Method property value types that EAP methods support
' enum EAP_METHOD_PROPERTY_VALUE_TYPE
%EQUATE `empvtBool = 0 ' // value type is boolean
%EQUATE `empvtDword = 1 ' // value type is dword
%EQUATE `empvtString = 2 ' // value type is string
' // Size = 8 bytes
TYPE EAP_METHOD_PROPERTY_VALUE_BOOL DWORD
 length AS DWORD
 value AS LONG
END TYPE
' // Size = 8 bytes
TYPE EAP_METHOD_PROPERTY_VALUE_DWORD DWORD
 length AS DWORD
 value AS DWORD
END TYPE
' // Size = 8 bytes
TYPE EAP_METHOD_PROPERTY_VALUE_STRING DWORD
 length AS DWORD
 value AS BYTE PTR ' BYTE*
END TYPE
' // Size = 8 bytes
UNION EAP_METHOD_PROPERTY_VALUE DWORD
 empvBool AS EAP_METHOD_PROPERTY_VALUE_BOOL ' // value is boolean type
 empvDword AS EAP_METHOD_PROPERTY_VALUE_DWORD ' // value is dword type
 empvString AS EAP_METHOD_PROPERTY_VALUE_STRING ' // value is string type
END UNION
'// Structure to represent a method property
' // Size = 16 bytes
TYPE EAP_METHOD_PROPERTY DWORD
 ' // specifies the method property type
 eapMethodPropertyType AS LONG ' EAP_METHOD_PROPERTY_TYPE
 ' // specifies the data type of value
 eapMethodPropertyValueType AS LONG ' EAP_METHOD_PROPERTY_VALUE_TYPE
 ' // specifies the value of the method property
 eapMethodPropertyValue AS EAP_METHOD_PROPERTY_VALUE
END TYPE
'// Structure to represent an array of method properties
' // Size = 8 bytes
TYPE EAP_METHOD_PROPERTY_ARRAY DWORD
 ' // specifies the number of method properties in array
 dwNumberOfProperties AS DWORD
 ' // specifies the array of method property
 pMethodProperty AS EAP_METHOD_PROPERTY PTR ' EAP_METHOD_PROPERTY*
END TYPE
#ENDIF
