Commit 2a2e303d authored by Alexandre Julliard's avatar Alexandre Julliard

oleaut32: Fixed asm proxys to support more than 128 methods.

Reported by Martin Kochanski.
parent d35c13c6
...@@ -372,12 +372,13 @@ static HRESULT num_of_funcs(ITypeInfo *tinfo, unsigned int *num) ...@@ -372,12 +372,13 @@ static HRESULT num_of_funcs(ITypeInfo *tinfo, unsigned int *num)
typedef struct _TMAsmProxy { typedef struct _TMAsmProxy {
BYTE popleax; BYTE popleax;
BYTE pushlval; BYTE pushlval;
BYTE nr; DWORD nr;
BYTE pushleax; BYTE pushleax;
BYTE lcall; BYTE lcall;
DWORD xcall; DWORD xcall;
BYTE lret; BYTE lret;
WORD bytestopop; WORD bytestopop;
BYTE nop;
} TMAsmProxy; } TMAsmProxy;
#include "poppack.h" #include "poppack.h"
...@@ -1709,7 +1710,7 @@ static HRESULT init_proxy_entry_point(TMProxyImpl *proxy, unsigned int num) ...@@ -1709,7 +1710,7 @@ static HRESULT init_proxy_entry_point(TMProxyImpl *proxy, unsigned int num)
* arg3 arg2 arg1 <method> <returnptr> * arg3 arg2 arg1 <method> <returnptr>
*/ */
xasm->popleax = 0x58; xasm->popleax = 0x58;
xasm->pushlval = 0x6a; xasm->pushlval = 0x68;
xasm->nr = num; xasm->nr = num;
xasm->pushleax = 0x50; xasm->pushleax = 0x50;
xasm->lcall = 0xe8; /* relative jump */ xasm->lcall = 0xe8; /* relative jump */
...@@ -1717,6 +1718,7 @@ static HRESULT init_proxy_entry_point(TMProxyImpl *proxy, unsigned int num) ...@@ -1717,6 +1718,7 @@ static HRESULT init_proxy_entry_point(TMProxyImpl *proxy, unsigned int num)
xasm->xcall -= (DWORD)&(xasm->lret); xasm->xcall -= (DWORD)&(xasm->lret);
xasm->lret = 0xc2; xasm->lret = 0xc2;
xasm->bytestopop = (nrofargs+2)*4; /* pop args, This, iMethod */ xasm->bytestopop = (nrofargs+2)*4; /* pop args, This, iMethod */
xasm->nop = 0x90;
proxy->lpvtbl[num] = xasm; proxy->lpvtbl[num] = xasm;
#else #else
FIXME("not implemented on non i386\n"); FIXME("not implemented on non i386\n");
...@@ -1754,7 +1756,7 @@ PSFacBuf_CreateProxy( ...@@ -1754,7 +1756,7 @@ PSFacBuf_CreateProxy(
proxy = CoTaskMemAlloc(sizeof(TMProxyImpl)); proxy = CoTaskMemAlloc(sizeof(TMProxyImpl));
if (!proxy) return E_OUTOFMEMORY; if (!proxy) return E_OUTOFMEMORY;
assert(sizeof(TMAsmProxy) == 12); assert(sizeof(TMAsmProxy) == 16);
proxy->dispatch = NULL; proxy->dispatch = NULL;
proxy->dispatch_proxy = NULL; proxy->dispatch_proxy = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment