You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My test app is using winrt::Windows::Devices::Enumeration::DeviceWatcher and creating winrt::Windows::Devices::SmartCards::SmartCardReader instance by calling:
co_await winrt::Windows::Devices::Enumeration::DeviceInformation::FindAllAsync(SmartCardReader::GetDeviceSelector())
and then creating a reader instance with co_await SmartCardReader::FromIdAsync(device.Id()) from the collection above.
App is running fine with one problem - when main window is closed, I'd expect the app process (in TaskManager) would exit too. But it lingers for quite some time with the following stack trace:
If I disable the call to winrt::Windows::Devices::Enumeration::DeviceInformation::FindAllAsync() - the process exits immediately. Is there anything needed to shutdown reader instance properly on exit? The only option I've found is DeviceWatcher::Stop() method, but that doesn't help.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
My test app is using winrt::Windows::Devices::Enumeration::DeviceWatcher and creating winrt::Windows::Devices::SmartCards::SmartCardReader instance by calling:
co_await winrt::Windows::Devices::Enumeration::DeviceInformation::FindAllAsync(SmartCardReader::GetDeviceSelector())
and then creating a reader instance with co_await SmartCardReader::FromIdAsync(device.Id()) from the collection above.
App is running fine with one problem - when main window is closed, I'd expect the app process (in TaskManager) would exit too. But it lingers for quite some time with the following stack trace:
ntdll.dll!NtWaitForSingleObject�() KERNELBASE.dll!WaitForSingleObjectEx�() Windows.Devices.SmartCards.dll!Windows::Devices::SmartCards::SmartCardReaderEventManager::WaitForEvent(void *,unsigned long) Windows.Devices.SmartCards.dll!Windows::Devices::SmartCards::SmartCardReaderEventManager::InternalDeinitialize(void) Windows.Devices.SmartCards.dll!ComErrorContract<<lambda_da5d591f47daddf166a5d7c13fa896d9>>() Windows.Devices.SmartCards.dll!Windows::Devices::SmartCards::SmartCardReaderEventManager::~SmartCardReaderEventManager(void) ucrtbase.dll!<lambda>(void)() ucrtbase.dll!__crt_seh_guarded_call<int>::operator()<<lambda_7777bce6b2f8c936911f934f8298dc43>,<lambda>(void) &,<lambda_3883c3dff614d5e0c5f61bb1ac94921c>>() ucrtbase.dll!_execute_onexit_table�() ucrtbase.dll!__crt_state_management::wrapped_invoke<int (*)(int *),int *,int>(int (*)(int *),int *) Windows.Devices.SmartCards.dll!dllmain_crt_process_detach() Windows.Devices.SmartCards.dll!dllmain_dispatch() ntdll.dll!LdrpCallInitRoutine() ntdll.dll!LdrShutdownProcess�()
If I disable the call to winrt::Windows::Devices::Enumeration::DeviceInformation::FindAllAsync() - the process exits immediately. Is there anything needed to shutdown reader instance properly on exit? The only option I've found is DeviceWatcher::Stop() method, but that doesn't help.
Beta Was this translation helpful? Give feedback.
All reactions