Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
f1da672d
Commit
f1da672d
authored
May 17, 2007
by
Huw Davies
Committed by
Alexandre Julliard
May 18, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleaut32: Move the proxy thunk creation code to a separate function.
parent
117f21de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
49 deletions
+55
-49
tmarshal.c
dlls/oleaut32/tmarshal.c
+55
-49
No files found.
dlls/oleaut32/tmarshal.c
View file @
f1da672d
...
...
@@ -1640,6 +1640,58 @@ static inline HRESULT get_facbuf_for_iid(REFIID riid, IPSFactoryBuffer **facbuf)
&
IID_IPSFactoryBuffer
,
(
LPVOID
*
)
facbuf
);
}
static
HRESULT
init_proxy_entry_point
(
TMProxyImpl
*
proxy
,
unsigned
int
num
)
{
int
j
;
/* nrofargs without This */
int
nrofargs
;
ITypeInfo
*
tinfo2
;
TMAsmProxy
*
xasm
=
proxy
->
asmstubs
+
num
;
HRESULT
hres
;
const
FUNCDESC
*
fdesc
;
hres
=
get_funcdesc
(
proxy
->
tinfo
,
num
,
&
tinfo2
,
&
fdesc
,
NULL
,
NULL
,
NULL
);
if
(
hres
)
{
ERR
(
"GetFuncDesc %x should not fail here.
\n
"
,
hres
);
return
hres
;
}
ITypeInfo_Release
(
tinfo2
);
/* some args take more than 4 byte on the stack */
nrofargs
=
0
;
for
(
j
=
0
;
j
<
fdesc
->
cParams
;
j
++
)
nrofargs
+=
_argsize
(
fdesc
->
lprgelemdescParam
[
j
].
tdesc
.
vt
);
#ifdef __i386__
if
(
fdesc
->
callconv
!=
CC_STDCALL
)
{
ERR
(
"calling convention is not stdcall????
\n
"
);
return
E_FAIL
;
}
/* popl %eax - return ptr
* pushl <nr>
* pushl %eax
* call xCall
* lret <nr> (+4)
*
*
* arg3 arg2 arg1 <method> <returnptr>
*/
xasm
->
popleax
=
0x58
;
xasm
->
pushlval
=
0x6a
;
xasm
->
nr
=
num
;
xasm
->
pushleax
=
0x50
;
xasm
->
lcall
=
0xe8
;
/* relative jump */
xasm
->
xcall
=
(
DWORD
)
xCall
;
xasm
->
xcall
-=
(
DWORD
)
&
(
xasm
->
lret
);
xasm
->
lret
=
0xc2
;
xasm
->
bytestopop
=
(
nrofargs
+
2
)
*
4
;
/* pop args, This, iMethod */
proxy
->
lpvtbl
[
num
]
=
xasm
;
#else
FIXME
(
"not implemented on non i386
\n
"
);
return
E_FAIL
;
#endif
return
S_OK
;
}
static
HRESULT
WINAPI
PSFacBuf_CreateProxy
(
LPPSFACTORYBUFFER
iface
,
IUnknown
*
pUnkOuter
,
REFIID
riid
,
...
...
@@ -1648,7 +1700,6 @@ PSFacBuf_CreateProxy(
HRESULT
hres
;
ITypeInfo
*
tinfo
;
int
i
,
nroffuncs
;
const
FUNCDESC
*
fdesc
;
TMProxyImpl
*
proxy
;
TYPEATTR
*
typeattr
;
...
...
@@ -1685,8 +1736,6 @@ PSFacBuf_CreateProxy(
proxy
->
lpvtbl
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
LPBYTE
)
*
nroffuncs
);
for
(
i
=
0
;
i
<
nroffuncs
;
i
++
)
{
TMAsmProxy
*
xasm
=
proxy
->
asmstubs
+
i
;
switch
(
i
)
{
case
0
:
proxy
->
lpvtbl
[
i
]
=
ProxyIUnknown_QueryInterface
;
...
...
@@ -1697,52 +1746,9 @@ PSFacBuf_CreateProxy(
case
2
:
proxy
->
lpvtbl
[
i
]
=
ProxyIUnknown_Release
;
break
;
default:
{
int
j
;
/* nrofargs without This */
int
nrofargs
;
ITypeInfo
*
tinfo2
;
hres
=
get_funcdesc
(
tinfo
,
i
,
&
tinfo2
,
&
fdesc
,
NULL
,
NULL
,
NULL
);
if
(
hres
)
{
ERR
(
"GetFuncDesc %x should not fail here.
\n
"
,
hres
);
return
hres
;
}
ITypeInfo_Release
(
tinfo2
);
/* some args take more than 4 byte on the stack */
nrofargs
=
0
;
for
(
j
=
0
;
j
<
fdesc
->
cParams
;
j
++
)
nrofargs
+=
_argsize
(
fdesc
->
lprgelemdescParam
[
j
].
tdesc
.
vt
);
#ifdef __i386__
if
(
fdesc
->
callconv
!=
CC_STDCALL
)
{
ERR
(
"calling convention is not stdcall????
\n
"
);
return
E_FAIL
;
}
/* popl %eax - return ptr
* pushl <nr>
* pushl %eax
* call xCall
* lret <nr> (+4)
*
*
* arg3 arg2 arg1 <method> <returnptr>
*/
xasm
->
popleax
=
0x58
;
xasm
->
pushlval
=
0x6a
;
xasm
->
nr
=
i
;
xasm
->
pushleax
=
0x50
;
xasm
->
lcall
=
0xe8
;
/* relative jump */
xasm
->
xcall
=
(
DWORD
)
xCall
;
xasm
->
xcall
-=
(
DWORD
)
&
(
xasm
->
lret
);
xasm
->
lret
=
0xc2
;
xasm
->
bytestopop
=
(
nrofargs
+
2
)
*
4
;
/* pop args, This, iMethod */
proxy
->
lpvtbl
[
i
]
=
xasm
;
break
;
#else
FIXME
(
"not implemented on non i386
\n
"
);
return
E_FAIL
;
#endif
}
default:
hres
=
init_proxy_entry_point
(
proxy
,
i
);
if
(
FAILED
(
hres
))
return
hres
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment