Exception from HRESULT: 0x8001010D (RPC_E_CANTCALLOUT_ININPUTSYNCCALL))

在hook windows USB消息时遇到了这样的一个异常Exception from HRESULT: 0x8001010D (RPC_E_CANTCALLOUT_ININPUTSYNCCALL))。

经过一番google之后,发现这个可能是微软的问题,在使用CLR和COM的时候,很多人都出现了这样的问题,微软给出的解决方案是禁止debugger里面的Managed Debugging Assistants.或者不使用debugger,直接运行。

附:

https://social.msdn.microsoft.com/Forums/en-US/1ece03b1-86b3-40af-87ed-f9203756b24d/disconnectedcontext-error?forum=winappswithcsharp

https://social.msdn.microsoft.com/Forums/en-US/c3ac33bc-fe82-4892-8ee4-b46803e7cf7d/com-error?forum=winappswithcsharp

https://stackoverflow.com/questions/4871013/clr-has-been-unable-to-transition-from-com-context-0x3b2d70-to-com-context

原文地址:https://www.cnblogs.com/cg88/p/9140034.html