WlanGetProfile (Compact 7)
3/12/2014
This function retrieves information about a profile.
Syntax
DWORD WINAPI WlanGetProfile(
__in HANDLE hClientHandle,
__in const GUID* pInterfaceGuid,
__in LPCWSTR strProfileName,
__reserved LPVOID pReserved1,
__out LPWSTR* pstrProfileXml,
__reserved LPVOID pReserved2,
__reserved LPVOID pReserved3
);
Parameters
Term |
Definition |
hClientHandle |
[in] Handle to the session on the client. To obtain a handle, call WlanOpenHandle. |
pInterfaceGuid |
[in] GUID of the interface. |
strProfileName |
[in] Name of the profile, NULL-terminated. Profile names are case sensitive. The maximum length of the profile name is 255 characters; therefore, the maximum string length including the NULL terminator is 256 characters. |
pReserved1 |
Reserved; always set to NULL. |
pstrProfileXml |
[out] XML that represents the profile. |
pReserved2 |
Reserved, Always set to NULL. |
pReserved3 |
pReserved. Always set to NULL. |
Return Values
The following table shows the possible return values.
Value |
Description |
ERROR_SUCCESS |
Function succeeds. |
ERROR_INVALID_PARAMETER |
Can be one of the following:
|
ERROR_INVALID_HANDLE |
Handle hClientHandle was not found in the handle table. |
RPC_STATUS |
Can be any remote procedure call (RPC) error code. The RPC may be unsuccessful due to WLAN RPC server issues, such as when the RPC server is not started. Refer to RPC for more information. |
ERROR_NOT_ENOUGH_MEMORY |
Could not allocate memory for the profile list. |
ERROR_ACCESS_DENIED |
You included Connection Manager in your OS. |
ERROR_NOT_FOUND |
Profile in strProfileName was not found. |
Remarks
If you include Connection Manager in your OS design:
- You must handle Wi-Fi connection operations using Connection Manager APIs such as CmAcquireConnection, CmAddConnectionConfig, or CmReleaseConnection.
- Otherwise, if you use this API, it returns ERROR_ACCESS_DENIED.
To free the memory allocated to pstrProfileXml, you must call WlanFreeMemory.
The key material returned in the profile pstrProfileXml is always encrypted. If your process runs in the context of the LocalSystem account, you can remove encryption from key material by calling CryptUnprotectData.
See Also
Reference
Native Wi-Fi Functions
WlanOpenHandle
WlanFreeMemory
WlanSetProfile
WlanSaveTemporaryProfile
WlanDeleteProfile
WlanRenameProfile
Native Wi-Fi Reference