Debugging-related exception in WlanUIEditProfile() resolved
This commit is contained in:
parent
8fbcf27f6a
commit
4598528765
@ -90,7 +90,6 @@ static int WLANManager()
|
||||
}
|
||||
|
||||
// Launch WLAN profile config dialog.
|
||||
// Note: When a debugger is attached to this process the WlanUIEditProfile() will raise an exception and fail.
|
||||
WLAN_REASON_CODE wlrc;
|
||||
DWORD dwResult = WlanUIEditProfile(WLAN_UI_API_VERSION, pwcArglist[2], &(interfaces->InterfaceInfo[i].InterfaceGuid), NULL, WLSecurityPage, NULL, &wlrc);
|
||||
if (dwResult != ERROR_SUCCESS) {
|
||||
@ -119,6 +118,13 @@ int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In
|
||||
UNREFERENCED_PARAMETER(lpCmdLine);
|
||||
UNREFERENCED_PARAMETER(nCmdShow);
|
||||
|
||||
int res = 0;
|
||||
|
||||
{
|
||||
// Note: When a debugger is attached to this process, the WlanUIEditProfile() will raise an exception and fail.
|
||||
// It was accidentially discovered, that COM initialization resolves this issue.
|
||||
com_initializer com_init(NULL);
|
||||
|
||||
{
|
||||
// Initialize Windows XP visual styles
|
||||
INITCOMMONCONTROLSEX icc;
|
||||
@ -129,7 +135,8 @@ int CALLBACK WinMain(_In_ HINSTANCE hInstance, _In_ HINSTANCE hPrevInstance, _In
|
||||
|
||||
pfnWlanReasonCodeToString = WlanReasonCodeToString;
|
||||
|
||||
int res = WLANManager();
|
||||
res = WLANManager();
|
||||
}
|
||||
|
||||
assert(!_CrtDumpMemoryLeaks());
|
||||
return res;
|
||||
|
Loading…
x
Reference in New Issue
Block a user