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.

992 lines
30 KiB

  1. #pragma once
  2. # ifdef __cplusplus
  3. extern "C" {
  4. # endif
  5. PVOID
  6. MIDL_user_allocate(size_t NumBytes);
  7. VOID
  8. MIDL_user_free(void * MemPointer);
  9. //---------------------------------------
  10. // Macros for handling additional attributes on WZC_WLAN_CONFIG structures
  11. // Coding of additional attributes in the Reserved bytes of WZC_WLAN_CONFIG objects:
  12. // Reserved
  13. // [1] [0]
  14. // ---SSSAA CCCCCCCC
  15. // SSS = [0-7; used: 0-6] selection set category, one of VPI, VI, PI, VPA, VA, PA, N
  16. // AA = [0-3; used: 0-3] authentication mode, NDIS_802_11_AUTHENTICATION_MODE value
  17. // CCCCCCCC = [0-255] retry counter for this object.
  18. //
  19. #define NWB_AUTHMODE_MASK 0x03
  20. #define NWB_SELCATEG_MASK 0x1C
  21. #define NWB_SET_AUTHMODE(pNWB, nAM) (pNWB)->Reserved[1] = (((pNWB)->Reserved[1] & ~NWB_AUTHMODE_MASK) | ((nAM) & NWB_AUTHMODE_MASK))
  22. #define NWB_GET_AUTHMODE(pNWB) ((pNWB)->Reserved[1] & NWB_AUTHMODE_MASK)
  23. #define NWB_SET_SELCATEG(pNWB, nSC) (pNWB)->Reserved[1] = (((pNWB)->Reserved[1] & ~NWB_SELCATEG_MASK) | (((nSC)<<2) & NWB_SELCATEG_MASK))
  24. #define NWB_GET_SELCATEG(pNWB) (((pNWB)->Reserved[1] & NWB_SELCATEG_MASK)>>2)
  25. //---------------------------------------
  26. // [P]RAW_DATA: generic description of a BLOB
  27. typedef struct
  28. {
  29. DWORD dwDataLen;
  30. #if defined(MIDL_PASS)
  31. [unique, size_is(dwDataLen)] LPBYTE pData;
  32. #else
  33. LPBYTE pData;
  34. #endif
  35. } RAW_DATA, *PRAW_DATA;
  36. #if !defined(MIDL_PASS)
  37. #include <ntddndis.h>
  38. #define WZCCTL_MAX_WEPK_MATERIAL 32
  39. #define WZCCTL_WEPK_PRESENT 0x0001 // specifies whether the configuration includes or not a WEP key
  40. #define WZCCTL_WEPK_XFORMAT 0x0002 // the WEP Key material (if any) is entered as hexadecimal digits
  41. #define WZCCTL_VOLATILE 0x0004 // this configuration should not be stored
  42. #define WZCCTL_POLICY 0x0008 // this configuration is enforced by the policy
  43. //---------------------------------------
  44. // [P]WZC_WLAN_CONFIG: like NDIS_WLAN_BSSID, but contains all the additional
  45. // data that defines a [Preferred] Wireless Zero Configuration
  46. typedef struct
  47. {
  48. ULONG Length; // Length of this structure
  49. DWORD dwCtlFlags; // control flags (NON-NDIS) see WZC_WEPK* constants
  50. // fields from the NDIS_WLAN_BSSID structure
  51. NDIS_802_11_MAC_ADDRESS MacAddress; // BSSID
  52. UCHAR Reserved[2];
  53. NDIS_802_11_SSID Ssid; // SSID
  54. ULONG Privacy; // WEP encryption requirement
  55. NDIS_802_11_RSSI Rssi; // receive signal strength in dBm
  56. NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;
  57. NDIS_802_11_CONFIGURATION Configuration;
  58. NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode;
  59. NDIS_802_11_RATES SupportedRates;
  60. // fields from NDIS_802_11_WEP structure
  61. ULONG KeyIndex; // 0 is the per-client key, 1-N are the global keys
  62. ULONG KeyLength; // length of key in bytes
  63. UCHAR KeyMaterial[WZCCTL_MAX_WEPK_MATERIAL]; // variable length depending on above field
  64. // aditional field for the Authentication mode
  65. NDIS_802_11_AUTHENTICATION_MODE AuthenticationMode;
  66. RAW_DATA rdUserData; // upper level buffer, attached to this config
  67. } WZC_WLAN_CONFIG, *PWZC_WLAN_CONFIG;
  68. //---------------------------------------
  69. // [P]WZC_802_11_CONFIG_LIST: like NDIS_802_11_BSSID_LIST but indexes a
  70. // set of [Preferred] Wireless Zero Configurations
  71. typedef struct
  72. {
  73. ULONG NumberOfItems; // number of elements in the array below
  74. ULONG Index; // [start] index in the array below
  75. WZC_WLAN_CONFIG Config[1]; // array of WZC_WLAN_CONFIGs
  76. } WZC_802_11_CONFIG_LIST, *PWZC_802_11_CONFIG_LIST;
  77. // WZC dialog codes have the 16th bit set to 1. This is what quickly sepparates them from EAPOL signals.
  78. #define WZCDLG_IS_WZC(x) (((x) & 0x00010000) == 0x00010000)
  79. #define WZCDLG_FAILED 0x00010001 // 802.11 automatic configuration failed
  80. // Dialog BLOB passed through the UI pipe to netman and wzcdlg
  81. typedef struct _WZCDLG_DATA
  82. {
  83. DWORD dwCode;
  84. DWORD lParam; // long numeric data
  85. } WZCDLG_DATA, *PWZCDLG_DATA;
  86. #endif
  87. //---------------------------------------
  88. // [P]INTF_ENTRY: describes the key info for one interface
  89. // this is used in conjunction with [P]INTFS_KEY_TABLE and WZCEnumInterfaces
  90. typedef struct
  91. {
  92. #if defined(MIDL_PASS)
  93. [unique, string] LPWSTR wszGuid;
  94. #else
  95. LPWSTR wszGuid;
  96. #endif
  97. } INTF_KEY_ENTRY, *PINTF_KEY_ENTRY;
  98. //---------------------------------------
  99. // [P]INTFS_KEY_TABLE: describes the table of key info for all interfaces
  100. // this is used in conjunction with [P]INTF_KEY_ENTRY and WZCEnumInterfaces
  101. typedef struct
  102. {
  103. DWORD dwNumIntfs;
  104. #if defined(MIDL_PASS)
  105. [size_is(dwNumIntfs)] PINTF_KEY_ENTRY pIntfs;
  106. #else
  107. PINTF_KEY_ENTRY pIntfs;
  108. #endif
  109. } INTFS_KEY_TABLE, *PINTFS_KEY_TABLE;
  110. //---------------------------------------
  111. // Bits used in conjunction with INTF_ENTRY, WZCQueryInterface
  112. // and WZCSetInterface. They point to the relevant information
  113. // that is requested from the service or to the relevant information
  114. // to be set down to the interface. On the output, they point to
  115. // the information that was processed (queried/set) successfully.
  116. #define INTF_ALL 0xffffffff
  117. #define INTF_ALL_FLAGS 0x0000ffff
  118. #define INTF_CM_MASK 0x00000007 // mask for the configuration mode (NDIS_802_11_NETWORK_INFRASTRUCTURE value)
  119. #define INTF_ENABLED 0x00008000 // zero conf enabled for this interface
  120. #define INTF_FALLBACK 0x00004000 // attempt to connect to visible non-preferred networks also
  121. #define INTF_OIDSSUPP 0x00002000 // 802.11 OIDs are supported by the driver/firmware (can't be set)
  122. #define INTF_VOLATILE 0x00001000 // the service parameters are volatile.
  123. #define INTF_POLICY 0x00000800 // the service parameters are enforced by the policy.
  124. #define INTF_DESCR 0x00010000
  125. #define INTF_NDISMEDIA 0x00020000
  126. #define INTF_PREFLIST 0x00040000
  127. #define INTF_ALL_OIDS 0xfff00000
  128. #define INTF_HANDLE 0x00100000
  129. #define INTF_INFRAMODE 0x00200000
  130. #define INTF_AUTHMODE 0x00400000
  131. #define INTF_WEPSTATUS 0x00800000
  132. #define INTF_SSID 0x01000000
  133. #define INTF_BSSID 0x02000000
  134. #define INTF_BSSIDLIST 0x04000000
  135. #define INTF_LIST_SCAN 0x08000000
  136. #define INTF_ADDWEPKEY 0x10000000
  137. #define INTF_REMWEPKEY 0x20000000
  138. #define INTF_LDDEFWKEY 0x40000000 // reload the default WEP_KEY
  139. //---------------------------------------
  140. // Bits used to specify particular control options for the interface
  141. // entry
  142. #define INTFCTL_CM_MASK 0x0007 // mask for the configuration mode (NDIS_802_11_NETWORK_INFRASTRUCTURE value)
  143. #define INTFCTL_ENABLED 0x8000 // zero conf enabled for this interface
  144. #define INTFCTL_FALLBACK 0x4000 // attempt to connect to visible non-preferred networks also
  145. #define INTFCTL_OIDSSUPP 0x2000 // 802.11 OIDs are supported by the driver/firmware (can't be set)
  146. #define INTFCTL_VOLATILE 0x1000 // the service parameters are volatile.
  147. #define INTFCTL_POLICY 0x0800 // the service parameters policy enforced.
  148. //---------------------------------------
  149. // [P]INTF_ENTRY: contains everything an RPC client needs to know
  150. // about an interface. It is used in conjunction with RpcQueryInterface.
  151. // Flags below are to be used to specify what info is queried for the
  152. // interface. Guid field is not covered since this is the key of the
  153. // structure so it has to be specified eather way.
  154. typedef struct
  155. {
  156. #if defined(MIDL_PASS)
  157. [string] LPWSTR wszGuid;
  158. #else
  159. LPWSTR wszGuid;
  160. #endif
  161. #if defined(MIDL_PASS)
  162. [string] LPWSTR wszDescr;
  163. #else
  164. LPWSTR wszDescr;
  165. #endif
  166. ULONG ulMediaState;
  167. ULONG ulMediaType;
  168. ULONG ulPhysicalMediaType;
  169. INT nInfraMode;
  170. INT nAuthMode;
  171. INT nWepStatus;
  172. DWORD dwCtlFlags; // control flags (see INTFCTL_* defines)
  173. RAW_DATA rdSSID; // encapsulates the SSID raw binary
  174. RAW_DATA rdBSSID; // encapsulates the BSSID raw binary
  175. RAW_DATA rdBSSIDList; // encapsulates one WZC_802_11_CONFIG_LIST structure
  176. RAW_DATA rdStSSIDList; // encapsulates one WZC_802_11_CONFIG_LIST structure
  177. RAW_DATA rdCtrlData; // data for various control actions on the interface
  178. } INTF_ENTRY, *PINTF_ENTRY;
  179. //---------------------------------------
  180. // Defines and datastucture for handling the WZC Service Context (generic service params)
  181. // Default values for WZC internal timers (WZC_CONTEXT.tmT* fields)
  182. #define TMMS_DEFAULT_TR 0x00000bb8 // Timeout until a rescan completes: ms (3sec)
  183. #define TMMS_DEFAULT_TC 0x0000ea60 // Timeout to retry a valid configuration: ms (1min)
  184. #define TMMS_DEFAULT_TP 0x000007d0 // Timeout to expect a media connect for a selected config: ms (2sec)
  185. #define TMMS_DEFAULT_TF 0x0000ea60 // Timeout to recover from a failed configuration: ms (1min)
  186. #define TMMS_DEFAULT_TD 0x00001388 // Timeout to delay the {SSr} processing: ms (5sec)
  187. // Default turns logging on
  188. #define WZC_CTXT_LOGGING_ON 0x00000001
  189. // Structure: WZC_CONTEXT holds all global service options that may be customized
  190. typedef struct _wzc_context_t
  191. {
  192. DWORD dwFlags; //service flags (see WZC_CTXT_*)
  193. //Service specific timers
  194. DWORD tmTr; //Rescan timeout
  195. DWORD tmTc; //Retry valid config timeout
  196. DWORD tmTp; //Timeout to expect a media connect
  197. DWORD tmTf; //Timeout to recover from an invalid config
  198. DWORD tmTd; //Timeout to delay {Ssr} processing
  199. } WZC_CONTEXT, *PWZC_CONTEXT;
  200. // Context control flags (see WZCSet/QueryContext() calls)
  201. #define WZC_CONTEXT_CTL_LOG 0x00000001
  202. #define WZC_CONTEXT_CTL_TIMER_TR 0x00000002
  203. #define WZC_CONTEXT_CTL_TIMER_TC 0x00000004
  204. #define WZC_CONTEXT_CTL_TIMER_TP 0x00000008
  205. #define WZC_CONTEXT_CTL_TIMER_TF 0x00000010
  206. #define WZC_CONTEXT_CTL_TIMER_TD 0x00000020
  207. //---------------------------------------
  208. // Utility Rpc memory management routines
  209. #define RpcCAlloc(nBytes) MIDL_user_allocate(nBytes)
  210. #define RpcFree(pMem) MIDL_user_free(pMem)
  211. //---------------------------------------
  212. // GetSPResModule: Utility function used to return
  213. // the handle to the module having WZC UI resources
  214. // (needed for XP.QFE & XP.SP1 builds)
  215. HINSTANCE
  216. WZCGetSPResModule();
  217. //---------------------------------------
  218. // GetSPResModule: Utility function used to return
  219. // the handle to the module having WZC UI resources
  220. // (needed for XP.QFE & XP.SP1 builds)
  221. HINSTANCE
  222. WZCGetDlgResModule();
  223. //---------------------------------------
  224. // WZCDeleteIntfObj: cleans an INTF_ENTRY object that is
  225. // allocated within any RPC call.
  226. //
  227. // Parameters
  228. // pIntf
  229. // [in] pointer to the INTF_ENTRY object to delete
  230. VOID
  231. WZCDeleteIntfObj(
  232. PINTF_ENTRY pIntf);
  233. //---------------------------------------
  234. // WZCEnumInterfaces: provides the table of key
  235. // information for all the interfaces that are managed.
  236. // For all subsequent calls the clients need to identify
  237. // the Interface it operates on by providing the respective
  238. // key info.
  239. //
  240. // Parameters:
  241. // pSrvAddr
  242. // [in] WZC Server to contact
  243. // pIntf
  244. // [out] table of key info for all interfaces
  245. // Returned value:
  246. // Win32 error code
  247. DWORD
  248. WZCEnumInterfaces(
  249. LPWSTR pSrvAddr,
  250. PINTFS_KEY_TABLE pIntfs);
  251. //---------------------------------------
  252. // WZCQueryIterface: provides detailed information for a
  253. // given interface.
  254. //
  255. // Parameters:
  256. // pSrvAddr:
  257. // [in] WZC Server to contact
  258. // dwInFlags:
  259. // [in] Fields to be queried (bitmask of INTF_*)
  260. // pIntf:
  261. // [in] Key of the interface to query
  262. // [out] Requested data from the interface.
  263. // pdwOutFlags
  264. // [out] Fields successfully retrieved (bitmask of INTF_*)
  265. //
  266. // Returned value:
  267. // Win32 error code
  268. DWORD
  269. WZCQueryInterface(
  270. LPWSTR pSrvAddr,
  271. DWORD dwInFlags,
  272. PINTF_ENTRY pIntf,
  273. LPDWORD pdwOutFlags);
  274. //---------------------------------------
  275. // WZCSetIterface: sets specific information on the interface
  276. //
  277. // Parameters:
  278. // pSrvAddr:
  279. // [in] WZC Server to contact
  280. // dwInFlags:
  281. // [in] Fields to be set (bitmask of INTF_*)
  282. // pIntf:
  283. // [in] Key of the interface to query and data to be set
  284. // pdwOutFlags:
  285. // [out] Fields successfully set (bitmask of INTF_*)
  286. //
  287. // Returned value:
  288. // Win32 error code
  289. DWORD
  290. WZCSetInterface(
  291. LPWSTR pSrvAddr,
  292. DWORD dwInFlags,
  293. PINTF_ENTRY pIntf,
  294. LPDWORD pdwOutFlags);
  295. //---------------------------------------
  296. // WZCRefreshInterface: refreshes specific information for the interface
  297. //
  298. // Parameters:
  299. // pSrvAddr:
  300. // [in] WZC Server to contact
  301. // dwInFlags:
  302. // [in] Fields to be refreshed and specific refresh actions to be
  303. // taken (bitmask of INTF_*)
  304. // pIntf:
  305. // [in] Key of the interface to be refreshed
  306. // pdwOutFlags:
  307. // [out] Fields successfully refreshed (bitmask of INTF_*)
  308. //
  309. // Returned value:
  310. // Win32 error code
  311. DWORD
  312. WZCRefreshInterface(
  313. LPWSTR pSrvAddr,
  314. DWORD dwInFlags,
  315. PINTF_ENTRY pIntf,
  316. LPDWORD pdwOutFlags);
  317. //---------------------------------------
  318. // WZCQueryContext: retrieves the WZC service parameters
  319. //
  320. // Parameters:
  321. // pSrvAddr:
  322. // [in] WZC Server to contact
  323. // dwInFlags:
  324. // [in] Fields to be retrieved (bitmask of WZC_CONTEXT_CTL*)
  325. // pContext:
  326. // [in] Placeholder for the service parameters
  327. // pdwOutFlags:
  328. // [out] Fields successfully retrieved (bitmask of WZC_CONTEXT_CTL*)
  329. //
  330. // Returned value:
  331. // Win32 error code
  332. DWORD
  333. WZCQueryContext(
  334. LPWSTR pSrvAddr,
  335. DWORD dwInFlags,
  336. PWZC_CONTEXT pContext,
  337. LPDWORD pdwOutFlags);
  338. //---------------------------------------
  339. // WZCSetContext: sets specific WZC service parameters
  340. //
  341. // Parameters:
  342. // pSrvAddr:
  343. // [in] WZC Server to contact
  344. // dwInFlags:
  345. // [in] Fields to be set (bitmask of WZC_CONTEXT_CTL*)
  346. // pContext:
  347. // [in] Context buffer containing the specific parameters to be set
  348. // pdwOutFlags:
  349. // [out] Fields successfully set (bitmask of WZC_CONTEXT_CTL*)
  350. //
  351. // Returned value:
  352. // Win32 error code
  353. DWORD
  354. WZCSetContext(
  355. LPWSTR pSrvAddr,
  356. DWORD dwInFlags,
  357. PWZC_CONTEXT pContext,
  358. LPDWORD pdwOutFlags);
  359. //============================================================================================
  360. //
  361. // EAPOL-related definitions
  362. //
  363. #define EAPOL_DISABLED 0
  364. #define EAPOL_ENABLED 0x80000000
  365. #define EAPOL_MACHINE_AUTH_DISABLED 0
  366. #define EAPOL_MACHINE_AUTH_ENABLED 0x40000000
  367. #define EAPOL_GUEST_AUTH_DISABLED 0
  368. #define EAPOL_GUEST_AUTH_ENABLED 0x20000000
  369. #define EAP_TYPE_MD5 4
  370. #define EAP_TYPE_TLS 13
  371. #define EAP_TYPE_PEAP 25
  372. #define EAP_TYPE_MSCHAPv2 26
  373. #define DEFAULT_EAP_TYPE EAP_TYPE_TLS
  374. #define DEFAULT_EAPOL_STATE EAPOL_ENABLED
  375. #define DEFAULT_MACHINE_AUTH_STATE EAPOL_MACHINE_AUTH_ENABLED
  376. #define DEFAULT_GUEST_AUTH_STATE EAPOL_GUEST_AUTH_DISABLED
  377. #define DEFAULT_EAP_STATE (DEFAULT_EAPOL_STATE | DEFAULT_MACHINE_AUTH_STATE | DEFAULT_GUEST_AUTH_STATE)
  378. #define IS_EAPOL_ENABLED(x) \
  379. ((x & EAPOL_ENABLED)?1:0)
  380. #define IS_MACHINE_AUTH_ENABLED(x) \
  381. ((x & EAPOL_MACHINE_AUTH_ENABLED)?1:0)
  382. #define IS_GUEST_AUTH_ENABLED(x) \
  383. ((x & EAPOL_GUEST_AUTH_ENABLED)?1:0)
  384. // Supplicant modes of operation depending on network state and
  385. // administrator decision
  386. #define SUPPLICANT_MODE_0 0
  387. #define SUPPLICANT_MODE_1 1
  388. #define SUPPLICANT_MODE_2 2
  389. #define SUPPLICANT_MODE_3 3
  390. #define MAX_SUPPLICANT_MODE SUPPLICANT_MODE_3
  391. #define EAPOL_DEFAULT_SUPPLICANT_MODE SUPPLICANT_MODE_2
  392. // Auth modes of operation depending on administrator decision
  393. #define EAPOL_AUTH_MODE_0 0
  394. #define EAPOL_AUTH_MODE_1 1
  395. #define EAPOL_AUTH_MODE_2 2
  396. #define MAX_EAPOL_AUTH_MODE EAPOL_AUTH_MODE_2
  397. #define EAPOL_DEFAULT_AUTH_MODE EAPOL_AUTH_MODE_1
  398. #define GUID_STRING_LEN_WITH_TERM 39
  399. //
  400. // Heap-related functions
  401. //
  402. #define MALLOC(s) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (s))
  403. #define FREE(p) HeapFree(GetProcessHeap(), 0, (p))
  404. // Double-threaded linked list node control block. There is one node for each
  405. // entry in a list.
  406. //
  407. // Applications should not access this structure directly.
  408. //
  409. typedef struct
  410. _DTLNODE
  411. {
  412. struct _DTLNODE* pdtlnodePrev; // Address of previous node or NULL if none
  413. struct _DTLNODE* pdtlnodeNext; // Address of next node or NULL if none
  414. VOID* pData; // Address of user's data
  415. LONG_PTR lNodeId; // User-defined node identification code
  416. }
  417. DTLNODE;
  418. //
  419. // Double-threaded linked list control block. There is one for each list.
  420. //
  421. // Applications should not access this structure directly.
  422. //
  423. typedef struct
  424. _DTLLIST
  425. {
  426. struct _DTLNODE* pdtlnodeFirst; // Address of first node or NULL if none
  427. struct _DTLNODE* pdtlnodeLast; // Address of last node or NULL if none
  428. LONG lNodes; // Number of nodes in list
  429. LONG_PTR lListId; // User-defined list identification code
  430. }
  431. DTLLIST;
  432. // List node free function. See FreeList.
  433. //
  434. typedef VOID (*PDESTROYNODE)( IN DTLNODE* );
  435. #define DtlGetFirstNode( pdtllist ) ((pdtllist)->pdtlnodeFirst)
  436. #define DtlGetNextNode( pdtlnode ) ((pdtlnode)->pdtlnodeNext)
  437. #define DtlGetData( pdtlnode ) ((pdtlnode)->pData)
  438. typedef enum _EAPTLS_CONNPROP_ATTRIBUTE_TYPE_
  439. {
  440. ecatMinimum = 0, //Undefined
  441. ecatFlagRegistryCert, //Value is a pointer to BOOL
  442. ecatFlagScard, //Value is a pointer to BOOL
  443. ecatFlagValidateServer, //Value is a pointer to BOOL
  444. ecatFlagValidateName, //Value is a pointer to BOOL
  445. ecatFlagDiffUser, //Value is a pointer to BOOL
  446. ecatServerNames, //Value is a pointer to NULL
  447. //terminated string of semi
  448. //colon delimited server names
  449. ecatRootHashes //Value is a pointer to
  450. //SHA1 hashes of Root certs.
  451. }EAPTLS_CONNPROP_ATTRIBUTE_TYPE;
  452. typedef struct _EAPTLS_CONNPROP_ATTRIBUTE
  453. {
  454. EAPTLS_CONNPROP_ATTRIBUTE_TYPE ecaType;
  455. DWORD dwLength; //includes byte length of the value
  456. //if it is a LPWSTR, it includes
  457. //the null termination.
  458. PVOID Value;
  459. }EAPTLS_CONNPROP_ATTRIBUTE, *PEAPTLS_CONNPROP_ATTRIBUTE;
  460. // EAP configuration DLL entrypoints. These definitions must match the
  461. // raseapif.h prototypes for RasEapInvokeConfigUI and RasEapFreeUserData.
  462. typedef DWORD (APIENTRY * RASEAPFREE)( PBYTE );
  463. typedef DWORD (APIENTRY * RASEAPINVOKECONFIGUI)( DWORD, HWND, DWORD, PBYTE, DWORD, PBYTE*, DWORD*);
  464. typedef DWORD (APIENTRY * RASEAPGETIDENTITY)( DWORD, HWND, DWORD, const WCHAR*, const WCHAR*, PBYTE, DWORD, PBYTE, DWORD, PBYTE*, DWORD*, WCHAR** );
  465. typedef DWORD (APIENTRY * RASEAPINVOKEINTERACTIVEUI)( DWORD, HWND, PBYTE, DWORD, PBYTE*, DWORD* );
  466. typedef DWORD (APIENTRY * RASEAPCREATECONNPROP)( PEAPTLS_CONNPROP_ATTRIBUTE, PVOID*, DWORD*, PVOID*, DWORD*);
  467. #define RAS_EAP_VALUENAME_HIDEPEAPMSCHAPv2 TEXT("HidePEAPMSCHAPv2")
  468. // Flags
  469. #define EAPCFG_FLAG_RequireUsername 0x1
  470. #define EAPCFG_FLAG_RequirePassword 0x2
  471. // EAP configuration package definition.
  472. typedef struct
  473. _EAPCFG
  474. {
  475. // The package's unique EAP algorithm code.
  476. //
  477. DWORD dwKey;
  478. // The friendly name of the package suitable for display to the user.
  479. //
  480. TCHAR* pszFriendlyName;
  481. // The SystemRoot-relative path to the package's configuration DLL. May
  482. // be NULL indicating there is none.
  483. //
  484. TCHAR* pszConfigDll;
  485. // The SystemRoot-relative path to the package's identity DLL. May
  486. // be NULL indicating there is none.
  487. //
  488. TCHAR* pszIdentityDll;
  489. // Flags that specify what standard credentials are required at dial
  490. // time.
  491. //
  492. DWORD dwStdCredentialFlags;
  493. // True if user is to be forced to run the configuration API for the
  494. // package, i.e. defaults are not sufficient.
  495. //
  496. BOOL fForceConfig;
  497. // True if the package provides MPPE encryption keys, false if not.
  498. //
  499. BOOL fProvidesMppeKeys;
  500. // The package's default configuration blob, which can be overwritten by
  501. // the configuration DLL. May be NULL and 0 indicating there is none.
  502. //
  503. BYTE* pData;
  504. DWORD cbData;
  505. // EAP per user data to be stored in HKCU. This data is returned from
  506. // the EapInvokeConfigUI entrypoint in the eap dll.
  507. //
  508. BYTE* pUserData;
  509. DWORD cbUserData;
  510. // Set when the configuration DLL has been called on the package. This is
  511. // not a registry setting. It is provided for the convenience of the UI
  512. // only.
  513. //
  514. BOOL fConfigDllCalled;
  515. // Specifies the class ID of the configuration UI for remote machines.
  516. // Not used
  517. GUID guidConfigCLSID;
  518. } EAPCFG;
  519. VOID DtlDestroyList( DTLLIST*, PDESTROYNODE );
  520. DTLNODE *
  521. CreateEapcfgNode(
  522. void);
  523. VOID
  524. DestroyEapcfgNode(
  525. IN OUT DTLNODE* pNode);
  526. DTLNODE*
  527. EapcfgNodeFromKey(
  528. IN DTLLIST* pList,
  529. IN DWORD dwKey);
  530. #define EAPOL_MUTUAL_AUTH_EAP_ONLY 0x00000001
  531. DTLLIST*
  532. ReadEapcfgList(IN DWORD dwFlags);
  533. #define MAX_SSID_LEN 32
  534. //
  535. // Structure : EAPOL_INTF_PARAMS
  536. //
  537. typedef struct _EAPOL_INTF_PARAMS
  538. {
  539. DWORD dwVersion;
  540. DWORD dwReserved2;
  541. DWORD dwEapFlags;
  542. DWORD dwEapType;
  543. DWORD dwSizeOfSSID;
  544. BYTE bSSID[MAX_SSID_LEN];
  545. } EAPOL_INTF_PARAMS, *PEAPOL_INTF_PARAMS;
  546. //
  547. // EAPOL states
  548. //
  549. typedef enum _EAPOL_STATE
  550. {
  551. EAPOLSTATE_LOGOFF = 0,
  552. EAPOLSTATE_DISCONNECTED,
  553. EAPOLSTATE_CONNECTING,
  554. EAPOLSTATE_ACQUIRED,
  555. EAPOLSTATE_AUTHENTICATING,
  556. EAPOLSTATE_HELD,
  557. EAPOLSTATE_AUTHENTICATED,
  558. EAPOLSTATE_UNDEFINED
  559. } EAPOL_STATE;
  560. //
  561. // EAP UI State
  562. //
  563. typedef enum _EAPUISTATE
  564. {
  565. EAPUISTATE_WAITING_FOR_IDENTITY = 1,
  566. EAPUISTATE_WAITING_FOR_UI_RESPONSE
  567. } EAPUISTATE;
  568. //
  569. // Structure : EAPOL_INTF_STATE
  570. //
  571. typedef struct _EAPOL_INTF_STATE
  572. {
  573. #if defined(MIDL_PASS)
  574. [unique, string] LPWSTR pwszLocalMACAddr;
  575. #else
  576. LPWSTR pwszLocalMACAddr;
  577. #endif
  578. #if defined(MIDL_PASS)
  579. [unique, string] LPWSTR pwszRemoteMACAddr;
  580. #else
  581. LPWSTR pwszRemoteMACAddr;
  582. #endif
  583. DWORD dwSizeOfSSID;
  584. BYTE bSSID[MAX_SSID_LEN+1];
  585. #if defined(MIDL_PASS)
  586. [unique, string] LPSTR pszEapIdentity;
  587. #else
  588. LPSTR pszEapIdentity;
  589. #endif
  590. EAPOL_STATE dwState;
  591. EAPUISTATE dwEapUIState;
  592. DWORD dwEAPOLAuthMode;
  593. DWORD dwEAPOLAuthenticationType;
  594. DWORD dwEapType;
  595. DWORD dwFailCount;
  596. DWORD dwPhysicalMediumType;
  597. } EAPOL_INTF_STATE, *PEAPOL_INTF_STATE;
  598. #define EAPOL_VERSION_1 1
  599. #define EAPOL_VERSION_2 2
  600. #define EAPOL_VERSION_3 3
  601. #define EAPOL_CURRENT_VERSION EAPOL_VERSION_3
  602. //
  603. // Structure : EAPOL_AUTH_DATA
  604. //
  605. typedef struct _EAPOL_AUTH_DATA
  606. {
  607. DWORD dwEapType;
  608. DWORD dwSize;
  609. BYTE bData[1];
  610. } EAPOL_AUTH_DATA, *PEAPOL_AUTH_DATA;
  611. DWORD
  612. WZCGetEapUserInfo (
  613. IN WCHAR *pwszGUID,
  614. IN DWORD dwEapTypeId,
  615. IN DWORD dwSizOfSSID,
  616. IN BYTE *pbSSID,
  617. IN OUT PBYTE pbUserInfo,
  618. IN OUT DWORD *pdwInfoSize
  619. );
  620. // Structure used to define the UI Response.
  621. // Currently it contains upto 3 blobs.
  622. // If more are required, add to the structure
  623. #define NUM_RESP_BLOBS 3
  624. typedef struct _EAPOLUI_RESP
  625. {
  626. RAW_DATA rdData0;
  627. RAW_DATA rdData1;
  628. RAW_DATA rdData2;
  629. } EAPOLUI_RESP, *PEAPOLUI_RESP;
  630. //
  631. // EAPOL Policy related parameters
  632. //
  633. #define EAPOL_CERT_TYPE_SMARTCARD 1
  634. #define EAPOL_CERT_TYPE_MC_CERT 2
  635. typedef struct _EAPOL_POLICY_DATA {
  636. BYTE pbWirelessSSID[32];
  637. DWORD dwWirelessSSIDLen;
  638. DWORD dwEnable8021x;
  639. DWORD dw8021xMode;
  640. DWORD dwEAPType;
  641. DWORD dwMachineAuthentication;
  642. DWORD dwMachineAuthenticationType;
  643. DWORD dwGuestAuthentication;
  644. DWORD dwIEEE8021xMaxStart;
  645. DWORD dwIEEE8021xStartPeriod;
  646. DWORD dwIEEE8021xAuthPeriod;
  647. DWORD dwIEEE8021xHeldPeriod;
  648. DWORD dwEAPDataLen;
  649. LPBYTE pbEAPData;
  650. } EAPOL_POLICY_DATA, *PEAPOL_POLICY_DATA;
  651. typedef struct _EAPOL_POLICY_LIST {
  652. DWORD dwNumberOfItems;
  653. EAPOL_POLICY_DATA EAPOLPolicy[1];
  654. } EAPOL_POLICY_LIST, *PEAPOL_POLICY_LIST;
  655. #if !defined(MIDL_PASS)
  656. //---------------------------------------
  657. // WZCEapolGetCustomAuthData: Get EAP-specific configuration data for interface
  658. //
  659. // Parameters:
  660. // pSrvAddr:
  661. // [in] WZC Server to contact
  662. // pwszGuid:
  663. // [in] Interface GUID
  664. // dwEapTypeId:
  665. // [in] EAP type Id
  666. // dwSizeOfSSID:
  667. // [in] Size of SSID for which data is to be stored
  668. // pbSSID:
  669. // [in] SSID for which data is to be stored
  670. // pbConnInfo:
  671. // [in out] Connection EAP info
  672. // pdwInfoSize:
  673. // [in out] Size of pbConnInfo
  674. //
  675. // Returned value:
  676. // Win32 error code
  677. DWORD
  678. WZCEapolGetCustomAuthData (
  679. IN LPWSTR pSrvAddr,
  680. IN PWCHAR pwszGuid,
  681. IN DWORD dwEapTypeId,
  682. IN DWORD dwSizeOfSSID,
  683. IN BYTE *pbSSID,
  684. IN OUT PBYTE pbConnInfo,
  685. IN OUT PDWORD pdwInfoSize
  686. );
  687. //---------------------------------------
  688. // WZCEapolSetCustomAuthData: Set EAP-specific configuration data for interface
  689. //
  690. // Parameters:
  691. // pSrvAddr:
  692. // [in] WZC Server to contact
  693. // pwszGuid:
  694. // [in] Interface GUID
  695. // dwEapTypeId:
  696. // [in] EAP type Id
  697. // dwSizeOfSSID:
  698. // [in] Size of SSID for which data is to be stored
  699. // pbSSID:
  700. // [in] SSID for which data is to be stored
  701. // pbConnInfo:
  702. // [in] Connection EAP info
  703. // pdwInfoSize:
  704. // [in] Size of pbConnInfo
  705. //
  706. // Returned value:
  707. // Win32 error code
  708. DWORD
  709. WZCEapolSetCustomAuthData (
  710. IN LPWSTR pSrvAddr,
  711. IN PWCHAR pwszGuid,
  712. IN DWORD dwEapTypeId,
  713. IN DWORD dwSizeOfSSID,
  714. IN BYTE *pbSSID,
  715. IN PBYTE pbConnInfo,
  716. IN DWORD dwInfoSize
  717. );
  718. //---------------------------------------
  719. // WZCEapolGetInterfaceParams: Get configuration parameters for interface
  720. //
  721. // Parameters:
  722. // pSrvAddr:
  723. // [in] WZC Server to contact
  724. // pwszGuid:
  725. // [in] Interface GUID
  726. // pIntfParams:
  727. // [in out] Interface Parameters
  728. //
  729. // Returned value:
  730. // Win32 error code
  731. DWORD
  732. WZCEapolGetInterfaceParams (
  733. IN LPWSTR pSrvAddr,
  734. IN PWCHAR pwszGuid,
  735. IN OUT EAPOL_INTF_PARAMS *pIntfParams
  736. );
  737. //---------------------------------------
  738. // WZCEapolSetInterfaceParams: Set configuration parameters for interface
  739. //
  740. // Parameters:
  741. // pSrvAddr:
  742. // [in] WZC Server to contact
  743. // pwszGuid:
  744. // [in] Interface GUID
  745. // pIntfParams:
  746. // [in] Interface parameters
  747. // Returned value:
  748. // Win32 error code
  749. DWORD
  750. WZCEapolSetInterfaceParams (
  751. IN LPWSTR pSrvAddr,
  752. IN PWCHAR pwszGuid,
  753. IN EAPOL_INTF_PARAMS *pIntfParams
  754. );
  755. //---------------------------------------
  756. // WZCEapolReAuthenticate : Restart 802.1X authentication on an interface
  757. //
  758. // Parameters:
  759. // pSrvAddr:
  760. // [in] WZC Server to contact
  761. // pwszGuid:
  762. // [in] Interface GUID
  763. // Returned value:
  764. // Win32 error code
  765. DWORD
  766. WZCEapolReAuthenticate (
  767. IN LPWSTR pSrvAddr,
  768. IN PWCHAR pwszGuid
  769. );
  770. //---------------------------------------
  771. // WZCEapolQueryState: Query the interface 802.1X/EAPOL state
  772. //
  773. // Parameters:
  774. // pSrvAddr:
  775. // [in] WZC Server to contact
  776. // pwszGuid:
  777. // [in] Interface GUID
  778. // pIntfState:
  779. // [in out] EAPOL Interface State
  780. //
  781. // Returned value:
  782. // Win32 error code
  783. DWORD
  784. WZCEapolQueryState (
  785. IN LPWSTR pSrvAddr,
  786. IN PWCHAR pwszGuid,
  787. IN OUT EAPOL_INTF_STATE *pIntfState
  788. );
  789. #endif // MIDL_PASS
  790. //
  791. // Free EAPOL interface state information on the client side obtained via
  792. // RPC query
  793. //
  794. DWORD
  795. WZCEapolFreeState (
  796. IN EAPOL_INTF_STATE *pIntfState
  797. );
  798. //
  799. // Structure: EAPOL_EAP_UI_CONTEXT
  800. //
  801. typedef struct _EAPOL_EAP_UI_CONTEXT
  802. {
  803. DWORD dwEAPOLUIMsgType;
  804. WCHAR wszGUID[39];
  805. DWORD dwSessionId;
  806. DWORD dwContextId;
  807. DWORD dwEapId;
  808. DWORD dwEapTypeId;
  809. DWORD dwEapFlags;
  810. WCHAR wszSSID[MAX_SSID_LEN+1];
  811. DWORD dwSizeOfSSID;
  812. BYTE bSSID[MAX_SSID_LEN];
  813. DWORD dwEAPOLState;
  814. DWORD dwRetCode;
  815. DWORD dwSizeOfEapUIData;
  816. BYTE bEapUIData[1];
  817. } EAPOL_EAP_UI_CONTEXT, *PEAPOL_EAP_UI_CONTEXT;
  818. //
  819. // Defines for messaging between Service and Dialog DLL
  820. //
  821. #define EAPOLUI_GET_USERIDENTITY 0x00000001
  822. #define EAPOLUI_GET_USERNAMEPASSWORD 0x00000002
  823. #define EAPOLUI_INVOKEINTERACTIVEUI 0x00000004
  824. #define EAPOLUI_EAP_NOTIFICATION 0x00000008
  825. #define EAPOLUI_REAUTHENTICATE 0x00000010
  826. #define EAPOLUI_CREATEBALLOON 0x00000020
  827. #define EAPOLUI_CLEANUP 0x00000040
  828. #define EAPOLUI_DUMMY 0x00000080
  829. #define NUM_EAPOL_DLG_MSGS 8
  830. //---------------------------------------
  831. // WZCEapolUIResponse: Send Dlg response to Service
  832. //
  833. // Parameters:
  834. // pSrvAddr:
  835. // [in] WZC Server to contact
  836. // EapolUIContext:
  837. // [in] EAPOLUI Context data
  838. // EapolUI:
  839. // [in] EAPOLUI response data
  840. //
  841. // Returned value:
  842. // Win32 error code
  843. DWORD
  844. WZCEapolUIResponse (
  845. IN LPWSTR pSrvAddr,
  846. IN EAPOL_EAP_UI_CONTEXT EapolUIContext,
  847. IN EAPOLUI_RESP EapolUIResp
  848. );
  849. # ifdef __cplusplus
  850. }
  851. # endif