Is there a problem to call WRL/ WinRT APIs from a DLL? If yes, what, why? Is there a workaround? Why does my code work sometimes but crash sometimes? Call stack is as displayed below:
0: kd> kb
*** Stack trace for last set context - .thread/.cxr resets it
Child-SP RetAddr : Args to Child : Call Site
01d9f740 766901aa : e0797977 00000001 00000000 77611edb : KERNELBASE!RaiseException+0x36
*** ERROR: Symbol file could not be found. Defaulted to export symbols for EMCLIENT.dll -
01d9f7a0 6ffca522 : 76690171 800705aa 01d9f800 6ffca523 : EMCLIENT!SHTerminateProcessForOOM+0x3a
*** ERROR: Symbol file could not be found. Defaulted to export symbols for CaptureServiceClient.dll -
01d9f7b0 6ffc5dec : 00000000 00000000 00000000 00000000 : CaptureServiceClient!PInvoke_LegacyAPIHelper_ClearCallback+0x2ce
01d9f808 6ffaf2cc : 800705aa 00fb61a8 8000ffff 800705aa : CaptureServiceClient!DllCanUnloadNow+0x1901c
01d9f820 6ffbcafa : ffffff00 777ffff9 00fb61a8 8000ffff : CaptureServiceClient!DllCanUnloadNow+0x24fc
01d9f838 6ffad674 : 800705aa 013738c8 00000000 00000000 : CaptureServiceClient!DllCanUnloadNow+0xfd2a
01d9f898 6ffaeb1e : 800705aa fefefefe 000003c4 0000003f : CaptureServiceClient!DllCanUnloadNow+0x8a4
01d9f908 6ffae8da : 800705aa fefefefe 000003c4 0000003f : CaptureServiceClient!DllCanUnloadNow+0x1d4e
01d9fb50 6ffae71a : 4ea8649e 35ffdfc5 6ffa2860 7fb14000 : CaptureServiceClient!DllCanUnloadNow+0x1b0a
01d9fdb0 77825966 : 01045418 00000000 00000000 6ffae705 : CaptureServiceClient!DllCanUnloadNow+0x194a
01d9fdd0 00000000 : 00000000 77825951 00000000 00000000 : ntdll!RtlUserThreadStart+0x16
EMC