c++代码(大体逻辑没问题,细节需要确认)
DWORD __stdcall *ComFriendlyWaitMtaThreadProc(LPVOID lpThreadParameter)
{
CoInitializeEx(0,0);
ThreadParam* pParam =(ThreadParam*)lpThreadParameter;
ComFriendlyWaiter* pData =newComFriendlyWaiter(pParam->p2, pParam->p1);
hr =CoMarshalInterThreadInterfaceInStream(GUID_6d5140c1_7436_11ce_8034_00aa006009fa, pData,&pStream);
pData->Release();
SetEvent(pParam->hEvent);
WaitForSingleObject(pParam->hXXX);
CoUninitialize();
}
汇编码
uiautomationcore!ComFriendlyWaitMtaThreadProc:
7303f5f18bff mov edi,edi
7303f5f355 push ebp
7303f5f48bec mov ebp,esp
7303f5f656 push esi
7303f5f757 push edi
7303f5f86a00 push 0
7303f5fa6a00 push 0
7303f5fc ff1504130373 call dword ptr [uiautomationcore!_imp__CoInitializeEx (73031304)]
7303f6026a18 push 18h
7303f604 e80c34ffff call uiautomationcore!operatornew(73032a15)
7303f6098b7d08 mov edi,dword ptr [ebp+8]
7303f60c59 pop ecx
7303f60d85c0 test eax,eax
7303f60f7452 je uiautomationcore!ComFriendlyWaitMtaThreadProc+0x2e(7303f663)Branch
uiautomationcore!ComFriendlyWaitMtaThreadProc+0x20:
7303f611 ff7704 push dword ptr [edi+4]
7303f6148bc8 mov ecx,eax
7303f616 ff37 push dword ptr [edi]
7303f618 e84f000000 call uiautomationcore!ComFriendlyWaiter::ComFriendlyWaiter(7303f66c)
uiautomationcore!ComFriendlyWaitMtaThreadProc+0x30:
7303f61d8bf0 mov esi,eax
7303f61f83c008 add eax,8
7303f622 f7de neg esi
7303f6241bf6 sbb esi,esi
7303f62623f0 and esi,eax
7303f6288d470c lea eax,[edi+0Ch]
7303f62b50 push eax
7303f62c56 push esi
7303f62d68e4230373 push offset uiautomationcore!_GUID_6d5140c1_7436_11ce_8034_00aa006009fa (730323e4)
7303f632 ff150c130373 call dword ptr [uiautomationcore!_imp__CoMarshalInterThreadInterfaceInStream (7303130c)]
7303f638894708 mov dword ptr [edi+8],eax
7303f63b8b06 mov eax,dword ptr [esi]
7303f63d56 push esi
7303f63e ff5008 call dword ptr [eax+8]
7303f641 ff7710 push dword ptr [edi+10h]
7303f644 ff152c120373 call dword ptr [uiautomationcore!_imp__SetEvent (7303122c)]
7303f64a6aff push 0FFFFFFFFh
7303f64c ff7714 push dword ptr [edi+14h]
7303f64f ff1528120373 call dword ptr [uiautomationcore!_imp__WaitForSingleObject (73031228)]
7303f655 ff1508130373 call dword ptr [uiautomationcore!_imp__CoUninitialize (73031308)]
7303f65b5f pop edi
7303f65c33c0 xor eax,eax
7303f65e5e pop esi
7303f65f5d pop ebp
7303f660 c20400 ret 4
uiautomationcore!ComFriendlyWaitMtaThreadProc+0x2e:
7303f66333c0 xor eax,eax
7303f665 ebb6 jmp uiautomationcore!ComFriendlyWaitMtaThreadProc+0x30(7303f61d)Branch