Skip to content

Commit

Permalink
FB
Browse files Browse the repository at this point in the history
  • Loading branch information
jkotas committed Sep 20, 2024
1 parent b810c3c commit e91f3f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/coreclr/vm/i386/asmconstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,9 @@ ASMCONSTANTS_C_ASSERT(CLRToCOMCallInfo__m_pRetThunk == offsetof(CLRToCOMCallInfo
#define COMMETHOD_PREPAD_ASM 8
ASMCONSTANTS_C_ASSERT(COMMETHOD_PREPAD_ASM == COMMETHOD_PREPAD)

#define OFFSETOF__UnmanagedToManagedFrame__m_pvDatum 8
ASMCONSTANTS_C_ASSERT(OFFSETOF__UnmanagedToManagedFrame__m_pvDatum == offsetof(UnmanagedToManagedFrame, m_pvDatum))

#endif // FEATURE_COMINTEROP

#define ASM__VTABLE_SLOTS_PER_CHUNK 8
Expand Down
8 changes: 5 additions & 3 deletions src/coreclr/vm/i386/asmhelpers.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,8 @@ _GenericComCallStub@0 proc public
; Pop ComCallMethodDesc* pushed by prestub
pop eax

; Create UnmanagedToManagedFrame on stack

; push ebp-frame
push ebp
mov ebp,esp
Expand All @@ -1251,15 +1253,15 @@ _GenericComCallStub@0 proc public
push esi
push edi

push eax ; datum
sub esp, 3*4 ; next, vtable, gscookie
push eax ; UnmanagedToManagedFrame::m_pvDatum = ComCallMethodDesc*
sub esp, (SIZEOF_GSCookie + OFFSETOF__UnmanagedToManagedFrame__m_pvDatum)

lea eax, [esp+4]

push eax
call _COMToCLRWorker@4

add esp, 3*4
add esp, (SIZEOF_GSCookie + OFFSETOF__UnmanagedToManagedFrame__m_pvDatum)

; pop the MethodDesc*
pop ecx
Expand Down

0 comments on commit e91f3f9

Please sign in to comment.