Trying to implement an IThumbnailProvider
, and came across this example:
https://github.com/microsoft/Windows-classic-samples/blob/main/Samples/CloudMirror/CloudMirror/ShellServices.cpp
Some questions:
- AFAIK the behavior for detached
std::thread
s when the program exits is unspecified (or UB? not sure); is this example depending on some Windows implementation detail? Would the class object eventually be properly revoked in this case? Does it have anything to do with theIf the caller resides in a single-thread apartment, CoWaitForMultipleHandles enters the COM modal loop, and the thread's message loop will continue to dispatch messages using the thread's message filter.
inCoWaitForMultipleHandles
‘s docs? - Why
COWAIT_DISPATCH_CALLS
if it only works in Application STA? Does it mean that in this case it’s equivalent toCOWAIT_DEFAULT
?