Leaked source code of windows server 2003
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.

977 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. // WZCDeleteIntfObj: cleans an INTF_ENTRY object that is
  213. // allocated within any RPC call.
  214. //
  215. // Parameters
  216. // pIntf
  217. // [in] pointer to the INTF_ENTRY object to delete
  218. VOID
  219. WZCDeleteIntfObj(
  220. PINTF_ENTRY pIntf);
  221. //---------------------------------------
  222. // WZCEnumInterfaces: provides the table of key
  223. // information for all the interfaces that are managed.
  224. // For all subsequent calls the clients need to identify
  225. // the Interface it operates on by providing the respective
  226. // key info.
  227. //
  228. // Parameters:
  229. // pSrvAddr
  230. // [in] WZC Server to contact
  231. // pIntf
  232. // [out] table of key info for all interfaces
  233. // Returned value:
  234. // Win32 error code
  235. DWORD
  236. WZCEnumInterfaces(
  237. LPWSTR pSrvAddr,
  238. PINTFS_KEY_TABLE pIntfs);
  239. //---------------------------------------
  240. // WZCQueryIterface: provides detailed information for a
  241. // given interface.
  242. //
  243. // Parameters:
  244. // pSrvAddr:
  245. // [in] WZC Server to contact
  246. // dwInFlags:
  247. // [in] Fields to be queried (bitmask of INTF_*)
  248. // pIntf:
  249. // [in] Key of the interface to query
  250. // [out] Requested data from the interface.
  251. // pdwOutFlags
  252. // [out] Fields successfully retrieved (bitmask of INTF_*)
  253. //
  254. // Returned value:
  255. // Win32 error code
  256. DWORD
  257. WZCQueryInterface(
  258. LPWSTR pSrvAddr,
  259. DWORD dwInFlags,
  260. PINTF_ENTRY pIntf,
  261. LPDWORD pdwOutFlags);
  262. //---------------------------------------
  263. // WZCSetIterface: sets specific information on the interface
  264. //
  265. // Parameters:
  266. // pSrvAddr:
  267. // [in] WZC Server to contact
  268. // dwInFlags:
  269. // [in] Fields to be set (bitmask of INTF_*)
  270. // pIntf:
  271. // [in] Key of the interface to query and data to be set
  272. // pdwOutFlags:
  273. // [out] Fields successfully set (bitmask of INTF_*)
  274. //
  275. // Returned value:
  276. // Win32 error code
  277. DWORD
  278. WZCSetInterface(
  279. LPWSTR pSrvAddr,
  280. DWORD dwInFlags,
  281. PINTF_ENTRY pIntf,
  282. LPDWORD pdwOutFlags);
  283. //---------------------------------------
  284. // WZCRefreshInterface: refreshes specific information for the interface
  285. //
  286. // Parameters:
  287. // pSrvAddr:
  288. // [in] WZC Server to contact
  289. // dwInFlags:
  290. // [in] Fields to be refreshed and specific refresh actions to be
  291. // taken (bitmask of INTF_*)
  292. // pIntf:
  293. // [in] Key of the interface to be refreshed
  294. // pdwOutFlags:
  295. // [out] Fields successfully refreshed (bitmask of INTF_*)
  296. //
  297. // Returned value:
  298. // Win32 error code
  299. DWORD
  300. WZCRefreshInterface(
  301. LPWSTR pSrvAddr,
  302. DWORD dwInFlags,
  303. PINTF_ENTRY pIntf,
  304. LPDWORD pdwOutFlags);
  305. //---------------------------------------
  306. // WZCQueryContext: retrieves the WZC service parameters
  307. //
  308. // Parameters:
  309. // pSrvAddr:
  310. // [in] WZC Server to contact
  311. // dwInFlags:
  312. // [in] Fields to be retrieved (bitmask of WZC_CONTEXT_CTL*)
  313. // pContext:
  314. // [in] Placeholder for the service parameters
  315. // pdwOutFlags:
  316. // [out] Fields successfully retrieved (bitmask of WZC_CONTEXT_CTL*)
  317. //
  318. // Returned value:
  319. // Win32 error code
  320. DWORD
  321. WZCQueryContext(
  322. LPWSTR pSrvAddr,
  323. DWORD dwInFlags,
  324. PWZC_CONTEXT pContext,
  325. LPDWORD pdwOutFlags);
  326. //---------------------------------------
  327. // WZCSetContext: sets specific WZC service parameters
  328. //
  329. // Parameters:
  330. // pSrvAddr:
  331. // [in] WZC Server to contact
  332. // dwInFlags:
  333. // [in] Fields to be set (bitmask of WZC_CONTEXT_CTL*)
  334. // pContext:
  335. // [in] Context buffer containing the specific parameters to be set
  336. // pdwOutFlags:
  337. // [out] Fields successfully set (bitmask of WZC_CONTEXT_CTL*)
  338. //
  339. // Returned value:
  340. // Win32 error code
  341. DWORD
  342. WZCSetContext(
  343. LPWSTR pSrvAddr,
  344. DWORD dwInFlags,
  345. PWZC_CONTEXT pContext,
  346. LPDWORD pdwOutFlags);
  347. //============================================================================================
  348. //
  349. // EAPOL-related definitions
  350. //
  351. #define EAPOL_DISABLED 0
  352. #define EAPOL_ENABLED 0x80000000
  353. #define EAPOL_MACHINE_AUTH_DISABLED 0
  354. #define EAPOL_MACHINE_AUTH_ENABLED 0x40000000
  355. #define EAPOL_GUEST_AUTH_DISABLED 0
  356. #define EAPOL_GUEST_AUTH_ENABLED 0x20000000
  357. #define EAP_TYPE_MD5 4
  358. #define EAP_TYPE_TLS 13
  359. #define EAP_TYPE_PEAP 25
  360. #define EAP_TYPE_MSCHAPv2 26
  361. #define DEFAULT_EAP_TYPE EAP_TYPE_TLS
  362. #define DEFAULT_EAPOL_STATE EAPOL_ENABLED
  363. #define DEFAULT_MACHINE_AUTH_STATE EAPOL_MACHINE_AUTH_ENABLED
  364. #define DEFAULT_GUEST_AUTH_STATE EAPOL_GUEST_AUTH_DISABLED
  365. #define DEFAULT_EAP_STATE (DEFAULT_EAPOL_STATE | DEFAULT_MACHINE_AUTH_STATE | DEFAULT_GUEST_AUTH_STATE)
  366. #define IS_EAPOL_ENABLED(x) \
  367. ((x & EAPOL_ENABLED)?1:0)
  368. #define IS_MACHINE_AUTH_ENABLED(x) \
  369. ((x & EAPOL_MACHINE_AUTH_ENABLED)?1:0)
  370. #define IS_GUEST_AUTH_ENABLED(x) \
  371. ((x & EAPOL_GUEST_AUTH_ENABLED)?1:0)
  372. // Supplicant modes of operation depending on network state and
  373. // administrator decision
  374. #define SUPPLICANT_MODE_0 0
  375. #define SUPPLICANT_MODE_1 1
  376. #define SUPPLICANT_MODE_2 2
  377. #define SUPPLICANT_MODE_3 3
  378. #define MAX_SUPPLICANT_MODE SUPPLICANT_MODE_3
  379. #define EAPOL_DEFAULT_SUPPLICANT_MODE SUPPLICANT_MODE_2
  380. // Auth modes of operation depending on administrator decision
  381. #define EAPOL_AUTH_MODE_0 0
  382. #define EAPOL_AUTH_MODE_1 1
  383. #define EAPOL_AUTH_MODE_2 2
  384. #define MAX_EAPOL_AUTH_MODE EAPOL_AUTH_MODE_2
  385. #define EAPOL_DEFAULT_AUTH_MODE EAPOL_AUTH_MODE_1
  386. #define GUID_STRING_LEN_WITH_TERM 39
  387. //
  388. // Heap-related functions
  389. //
  390. #define MALLOC(s) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, (s))
  391. #define FREE(p) HeapFree(GetProcessHeap(), 0, (p))
  392. // Double-threaded linked list node control block. There is one node for each
  393. // entry in a list.
  394. //
  395. // Applications should not access this structure directly.
  396. //
  397. typedef struct
  398. _DTLNODE
  399. {
  400. struct _DTLNODE* pdtlnodePrev; // Address of previous node or NULL if none
  401. struct _DTLNODE* pdtlnodeNext; // Address of next node or NULL if none
  402. VOID* pData; // Address of user's data
  403. LONG_PTR lNodeId; // User-defined node identification code
  404. }
  405. DTLNODE;
  406. //
  407. // Double-threaded linked list control block. There is one for each list.
  408. //
  409. // Applications should not access this structure directly.
  410. //
  411. typedef struct
  412. _DTLLIST
  413. {
  414. struct _DTLNODE* pdtlnodeFirst; // Address of first node or NULL if none
  415. struct _DTLNODE* pdtlnodeLast; // Address of last node or NULL if none
  416. LONG lNodes; // Number of nodes in list
  417. LONG_PTR lListId; // User-defined list identification code
  418. }
  419. DTLLIST;
  420. // List node free function. See FreeList.
  421. //
  422. typedef VOID (*PDESTROYNODE)( IN DTLNODE* );
  423. #define DtlGetFirstNode( pdtllist ) ((pdtllist)->pdtlnodeFirst)
  424. #define DtlGetNextNode( pdtlnode ) ((pdtlnode)->pdtlnodeNext)
  425. #define DtlGetData( pdtlnode ) ((pdtlnode)->pData)
  426. typedef enum _EAPTLS_CONNPROP_ATTRIBUTE_TYPE_
  427. {
  428. ecatMinimum = 0, //Undefined
  429. ecatFlagRegistryCert, //Value is a pointer to BOOL
  430. ecatFlagScard, //Value is a pointer to BOOL
  431. ecatFlagValidateServer, //Value is a pointer to BOOL
  432. ecatFlagValidateName, //Value is a pointer to BOOL
  433. ecatFlagDiffUser, //Value is a pointer to BOOL
  434. ecatServerNames, //Value is a pointer to NULL
  435. //terminated string of semi
  436. //colon delimited server names
  437. ecatRootHashes //Value is a pointer to
  438. //SHA1 hashes of Root certs.
  439. }EAPTLS_CONNPROP_ATTRIBUTE_TYPE;
  440. typedef struct _EAPTLS_CONNPROP_ATTRIBUTE
  441. {
  442. EAPTLS_CONNPROP_ATTRIBUTE_TYPE ecaType;
  443. DWORD dwLength; //includes byte length of the value
  444. //if it is a LPWSTR, it includes
  445. //the null termination.
  446. PVOID Value;
  447. }EAPTLS_CONNPROP_ATTRIBUTE, *PEAPTLS_CONNPROP_ATTRIBUTE;
  448. // EAP configuration DLL entrypoints. These definitions must match the
  449. // raseapif.h prototypes for RasEapInvokeConfigUI and RasEapFreeUserData.
  450. typedef DWORD (APIENTRY * RASEAPFREE)( PBYTE );
  451. typedef DWORD (APIENTRY * RASEAPINVOKECONFIGUI)( DWORD, HWND, DWORD, PBYTE, DWORD, PBYTE*, DWORD*);
  452. typedef DWORD (APIENTRY * RASEAPGETIDENTITY)( DWORD, HWND, DWORD, const WCHAR*, const WCHAR*, PBYTE, DWORD, PBYTE, DWORD, PBYTE*, DWORD*, WCHAR** );
  453. typedef DWORD (APIENTRY * RASEAPINVOKEINTERACTIVEUI)( DWORD, HWND, PBYTE, DWORD, PBYTE*, DWORD* );
  454. typedef DWORD (APIENTRY * RASEAPCREATECONNPROP)( PEAPTLS_CONNPROP_ATTRIBUTE, PVOID*, DWORD*, PVOID*, DWORD*);
  455. #define RAS_EAP_VALUENAME_HIDEPEAPMSCHAPv2 TEXT("HidePEAPMSCHAPv2")
  456. // Flags
  457. #define EAPCFG_FLAG_RequireUsername 0x1
  458. #define EAPCFG_FLAG_RequirePassword 0x2
  459. // EAP configuration package definition.
  460. typedef struct
  461. _EAPCFG
  462. {
  463. // The package's unique EAP algorithm code.
  464. //
  465. DWORD dwKey;
  466. // The friendly name of the package suitable for display to the user.
  467. //
  468. TCHAR* pszFriendlyName;
  469. // The SystemRoot-relative path to the package's configuration DLL. May
  470. // be NULL indicating there is none.
  471. //
  472. TCHAR* pszConfigDll;
  473. // The SystemRoot-relative path to the package's identity DLL. May
  474. // be NULL indicating there is none.
  475. //
  476. TCHAR* pszIdentityDll;
  477. // Flags that specify what standard credentials are required at dial
  478. // time.
  479. //
  480. DWORD dwStdCredentialFlags;
  481. // True if user is to be forced to run the configuration API for the
  482. // package, i.e. defaults are not sufficient.
  483. //
  484. BOOL fForceConfig;
  485. // True if the package provides MPPE encryption keys, false if not.
  486. //
  487. BOOL fProvidesMppeKeys;
  488. // The package's default configuration blob, which can be overwritten by
  489. // the configuration DLL. May be NULL and 0 indicating there is none.
  490. //
  491. BYTE* pData;
  492. DWORD cbData;
  493. // EAP per user data to be stored in HKCU. This data is returned from
  494. // the EapInvokeConfigUI entrypoint in the eap dll.
  495. //
  496. BYTE* pUserData;
  497. DWORD cbUserData;
  498. // Set when the configuration DLL has been called on the package. This is
  499. // not a registry setting. It is provided for the convenience of the UI
  500. // only.
  501. //
  502. BOOL fConfigDllCalled;
  503. // Specifies the class ID of the configuration UI for remote machines.
  504. // Not used
  505. GUID guidConfigCLSID;
  506. } EAPCFG;
  507. VOID DtlDestroyList( DTLLIST*, PDESTROYNODE );
  508. DTLNODE *
  509. CreateEapcfgNode(
  510. void);
  511. VOID
  512. DestroyEapcfgNode(
  513. IN OUT DTLNODE* pNode);
  514. DTLNODE*
  515. EapcfgNodeFromKey(
  516. IN DTLLIST* pList,
  517. IN DWORD dwKey);
  518. #define EAPOL_MUTUAL_AUTH_EAP_ONLY 0x00000001
  519. DTLLIST*
  520. ReadEapcfgList(IN DWORD dwFlags);
  521. #define MAX_SSID_LEN 32
  522. //
  523. // Structure : EAPOL_INTF_PARAMS
  524. //
  525. typedef struct _EAPOL_INTF_PARAMS
  526. {
  527. DWORD dwVersion;
  528. DWORD dwReserved2;
  529. DWORD dwEapFlags;
  530. DWORD dwEapType;
  531. DWORD dwSizeOfSSID;
  532. BYTE bSSID[MAX_SSID_LEN];
  533. } EAPOL_INTF_PARAMS, *PEAPOL_INTF_PARAMS;
  534. //
  535. // EAPOL states
  536. //
  537. typedef enum _EAPOL_STATE
  538. {
  539. EAPOLSTATE_LOGOFF = 0,
  540. EAPOLSTATE_DISCONNECTED,
  541. EAPOLSTATE_CONNECTING,
  542. EAPOLSTATE_ACQUIRED,
  543. EAPOLSTATE_AUTHENTICATING,
  544. EAPOLSTATE_HELD,
  545. EAPOLSTATE_AUTHENTICATED,
  546. EAPOLSTATE_UNDEFINED
  547. } EAPOL_STATE;
  548. //
  549. // EAP UI State
  550. //
  551. typedef enum _EAPUISTATE
  552. {
  553. EAPUISTATE_WAITING_FOR_IDENTITY = 1,
  554. EAPUISTATE_WAITING_FOR_UI_RESPONSE
  555. } EAPUISTATE;
  556. //
  557. // Structure : EAPOL_INTF_STATE
  558. //
  559. typedef struct _EAPOL_INTF_STATE
  560. {
  561. #if defined(MIDL_PASS)
  562. [unique, string] LPWSTR pwszLocalMACAddr;
  563. #else
  564. LPWSTR pwszLocalMACAddr;
  565. #endif
  566. #if defined(MIDL_PASS)
  567. [unique, string] LPWSTR pwszRemoteMACAddr;
  568. #else
  569. LPWSTR pwszRemoteMACAddr;
  570. #endif
  571. DWORD dwSizeOfSSID;
  572. BYTE bSSID[MAX_SSID_LEN+1];
  573. #if defined(MIDL_PASS)
  574. [unique, string] LPSTR pszEapIdentity;
  575. #else
  576. LPSTR pszEapIdentity;
  577. #endif
  578. EAPOL_STATE dwState;
  579. EAPUISTATE dwEapUIState;
  580. DWORD dwEAPOLAuthMode;
  581. DWORD dwEAPOLAuthenticationType;
  582. DWORD dwEapType;
  583. DWORD dwFailCount;
  584. DWORD dwPhysicalMediumType;
  585. } EAPOL_INTF_STATE, *PEAPOL_INTF_STATE;
  586. #define EAPOL_VERSION_1 1
  587. #define EAPOL_VERSION_2 2
  588. #define EAPOL_VERSION_3 3
  589. #define EAPOL_CURRENT_VERSION EAPOL_VERSION_3
  590. //
  591. // Structure : EAPOL_AUTH_DATA
  592. //
  593. typedef struct _EAPOL_AUTH_DATA
  594. {
  595. DWORD dwEapType;
  596. DWORD dwSize;
  597. BYTE bData[1];
  598. } EAPOL_AUTH_DATA, *PEAPOL_AUTH_DATA;
  599. DWORD
  600. WZCGetEapUserInfo (
  601. IN WCHAR *pwszGUID,
  602. IN DWORD dwEapTypeId,
  603. IN DWORD dwSizOfSSID,
  604. IN BYTE *pbSSID,
  605. IN OUT PBYTE pbUserInfo,
  606. IN OUT DWORD *pdwInfoSize
  607. );
  608. // Structure used to define the UI Response.
  609. // Currently it contains upto 3 blobs.
  610. // If more are required, add to the structure
  611. #define NUM_RESP_BLOBS 3
  612. typedef struct _EAPOLUI_RESP
  613. {
  614. RAW_DATA rdData0;
  615. RAW_DATA rdData1;
  616. RAW_DATA rdData2;
  617. } EAPOLUI_RESP, *PEAPOLUI_RESP;
  618. //
  619. // EAPOL Policy related parameters
  620. //
  621. #define EAPOL_CERT_TYPE_SMARTCARD 1
  622. #define EAPOL_CERT_TYPE_MC_CERT 2
  623. typedef struct _EAPOL_POLICY_DATA {
  624. BYTE pbWirelessSSID[32];
  625. DWORD dwWirelessSSIDLen;
  626. DWORD dwEnable8021x;
  627. DWORD dw8021xMode;
  628. DWORD dwEAPType;
  629. DWORD dwMachineAuthentication;
  630. DWORD dwMachineAuthenticationType;
  631. DWORD dwGuestAuthentication;
  632. DWORD dwIEEE8021xMaxStart;
  633. DWORD dwIEEE8021xStartPeriod;
  634. DWORD dwIEEE8021xAuthPeriod;
  635. DWORD dwIEEE8021xHeldPeriod;
  636. DWORD dwEAPDataLen;
  637. LPBYTE pbEAPData;
  638. } EAPOL_POLICY_DATA, *PEAPOL_POLICY_DATA;
  639. typedef struct _EAPOL_POLICY_LIST {
  640. DWORD dwNumberOfItems;
  641. EAPOL_POLICY_DATA EAPOLPolicy[1];
  642. } EAPOL_POLICY_LIST, *PEAPOL_POLICY_LIST;
  643. #if !defined(MIDL_PASS)
  644. //---------------------------------------
  645. // WZCEapolGetCustomAuthData: Get EAP-specific configuration data for interface
  646. //
  647. // Parameters:
  648. // pSrvAddr:
  649. // [in] WZC Server to contact
  650. // pwszGuid:
  651. // [in] Interface GUID
  652. // dwEapTypeId:
  653. // [in] EAP type Id
  654. // dwSizeOfSSID:
  655. // [in] Size of SSID for which data is to be stored
  656. // pbSSID:
  657. // [in] SSID for which data is to be stored
  658. // pbConnInfo:
  659. // [in out] Connection EAP info
  660. // pdwInfoSize:
  661. // [in out] Size of pbConnInfo
  662. //
  663. // Returned value:
  664. // Win32 error code
  665. DWORD
  666. WZCEapolGetCustomAuthData (
  667. IN LPWSTR pSrvAddr,
  668. IN PWCHAR pwszGuid,
  669. IN DWORD dwEapTypeId,
  670. IN DWORD dwSizeOfSSID,
  671. IN BYTE *pbSSID,
  672. IN OUT PBYTE pbConnInfo,
  673. IN OUT PDWORD pdwInfoSize
  674. );
  675. //---------------------------------------
  676. // WZCEapolSetCustomAuthData: Set EAP-specific configuration data for interface
  677. //
  678. // Parameters:
  679. // pSrvAddr:
  680. // [in] WZC Server to contact
  681. // pwszGuid:
  682. // [in] Interface GUID
  683. // dwEapTypeId:
  684. // [in] EAP type Id
  685. // dwSizeOfSSID:
  686. // [in] Size of SSID for which data is to be stored
  687. // pbSSID:
  688. // [in] SSID for which data is to be stored
  689. // pbConnInfo:
  690. // [in] Connection EAP info
  691. // pdwInfoSize:
  692. // [in] Size of pbConnInfo
  693. //
  694. // Returned value:
  695. // Win32 error code
  696. DWORD
  697. WZCEapolSetCustomAuthData (
  698. IN LPWSTR pSrvAddr,
  699. IN PWCHAR pwszGuid,
  700. IN DWORD dwEapTypeId,
  701. IN DWORD dwSizeOfSSID,
  702. IN BYTE *pbSSID,
  703. IN PBYTE pbConnInfo,
  704. IN DWORD dwInfoSize
  705. );
  706. //---------------------------------------
  707. // WZCEapolGetInterfaceParams: Get configuration parameters for interface
  708. //
  709. // Parameters:
  710. // pSrvAddr:
  711. // [in] WZC Server to contact
  712. // pwszGuid:
  713. // [in] Interface GUID
  714. // pIntfParams:
  715. // [in out] Interface Parameters
  716. //
  717. // Returned value:
  718. // Win32 error code
  719. DWORD
  720. WZCEapolGetInterfaceParams (
  721. IN LPWSTR pSrvAddr,
  722. IN PWCHAR pwszGuid,
  723. IN OUT EAPOL_INTF_PARAMS *pIntfParams
  724. );
  725. //---------------------------------------
  726. // WZCEapolSetInterfaceParams: Set configuration parameters for interface
  727. //
  728. // Parameters:
  729. // pSrvAddr:
  730. // [in] WZC Server to contact
  731. // pwszGuid:
  732. // [in] Interface GUID
  733. // pIntfParams:
  734. // [in] Interface parameters
  735. // Returned value:
  736. // Win32 error code
  737. DWORD
  738. WZCEapolSetInterfaceParams (
  739. IN LPWSTR pSrvAddr,
  740. IN PWCHAR pwszGuid,
  741. IN EAPOL_INTF_PARAMS *pIntfParams
  742. );
  743. //---------------------------------------
  744. // WZCEapolReAuthenticate : Restart 802.1X authentication on an interface
  745. //
  746. // Parameters:
  747. // pSrvAddr:
  748. // [in] WZC Server to contact
  749. // pwszGuid:
  750. // [in] Interface GUID
  751. // Returned value:
  752. // Win32 error code
  753. DWORD
  754. WZCEapolReAuthenticate (
  755. IN LPWSTR pSrvAddr,
  756. IN PWCHAR pwszGuid
  757. );
  758. //---------------------------------------
  759. // WZCEapolQueryState: Query the interface 802.1X/EAPOL state
  760. //
  761. // Parameters:
  762. // pSrvAddr:
  763. // [in] WZC Server to contact
  764. // pwszGuid:
  765. // [in] Interface GUID
  766. // pIntfState:
  767. // [in out] EAPOL Interface State
  768. //
  769. // Returned value:
  770. // Win32 error code
  771. DWORD
  772. WZCEapolQueryState (
  773. IN LPWSTR pSrvAddr,
  774. IN PWCHAR pwszGuid,
  775. IN OUT EAPOL_INTF_STATE *pIntfState
  776. );
  777. #endif // MIDL_PASS
  778. //
  779. // Free EAPOL interface state information on the client side obtained via
  780. // RPC query
  781. //
  782. DWORD
  783. WZCEapolFreeState (
  784. IN EAPOL_INTF_STATE *pIntfState
  785. );
  786. //
  787. // Structure: EAPOL_EAP_UI_CONTEXT
  788. //
  789. typedef struct _EAPOL_EAP_UI_CONTEXT
  790. {
  791. DWORD dwEAPOLUIMsgType;
  792. WCHAR wszGUID[39];
  793. DWORD dwSessionId;
  794. DWORD dwContextId;
  795. DWORD dwEapId;
  796. DWORD dwEapTypeId;
  797. DWORD dwEapFlags;
  798. WCHAR wszSSID[MAX_SSID_LEN+1];
  799. DWORD dwSizeOfSSID;
  800. BYTE bSSID[MAX_SSID_LEN];
  801. DWORD dwEAPOLState;
  802. DWORD dwRetCode;
  803. DWORD dwSizeOfEapUIData;
  804. BYTE bEapUIData[1];
  805. } EAPOL_EAP_UI_CONTEXT, *PEAPOL_EAP_UI_CONTEXT;
  806. //
  807. // Defines for messaging between Service and Dialog DLL
  808. //
  809. #define EAPOLUI_GET_USERIDENTITY 0x00000001
  810. #define EAPOLUI_GET_USERNAMEPASSWORD 0x00000002
  811. #define EAPOLUI_INVOKEINTERACTIVEUI 0x00000004
  812. #define EAPOLUI_EAP_NOTIFICATION 0x00000008
  813. #define EAPOLUI_REAUTHENTICATE 0x00000010
  814. #define EAPOLUI_CREATEBALLOON 0x00000020
  815. #define EAPOLUI_CLEANUP 0x00000040
  816. #define EAPOLUI_DUMMY 0x00000080
  817. #define NUM_EAPOL_DLG_MSGS 8
  818. //---------------------------------------
  819. // WZCEapolUIResponse: Send Dlg response to Service
  820. //
  821. // Parameters:
  822. // pSrvAddr:
  823. // [in] WZC Server to contact
  824. // EapolUIContext:
  825. // [in] EAPOLUI Context data
  826. // EapolUI:
  827. // [in] EAPOLUI response data
  828. //
  829. // Returned value:
  830. // Win32 error code
  831. DWORD
  832. WZCEapolUIResponse (
  833. IN LPWSTR pSrvAddr,
  834. IN EAPOL_EAP_UI_CONTEXT EapolUIContext,
  835. IN EAPOLUI_RESP EapolUIResp
  836. );
  837. # ifdef __cplusplus
  838. }
  839. # endif