Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
87cf6ec7
Commit
87cf6ec7
authored
Jun 07, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Fix parameter stack size computation in the old-style stubless marshaller.
parent
5d7e4da8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
27 deletions
+15
-27
ndr_stubless.c
dlls/rpcrt4/ndr_stubless.c
+15
-27
No files found.
dlls/rpcrt4/ndr_stubless.c
View file @
87cf6ec7
...
...
@@ -412,26 +412,23 @@ static unsigned int type_stack_size(unsigned char fc)
case
RPC_FC_CHAR
:
case
RPC_FC_SMALL
:
case
RPC_FC_USMALL
:
return
sizeof
(
char
);
case
RPC_FC_WCHAR
:
case
RPC_FC_SHORT
:
case
RPC_FC_USHORT
:
return
sizeof
(
short
);
case
RPC_FC_LONG
:
case
RPC_FC_ULONG
:
case
RPC_FC_INT3264
:
case
RPC_FC_UINT3264
:
case
RPC_FC_ENUM16
:
case
RPC_FC_ENUM32
:
return
sizeof
(
int
);
case
RPC_FC_FLOAT
:
return
sizeof
(
float
);
case
RPC_FC_ERROR_STATUS_T
:
case
RPC_FC_IGNORE
:
return
sizeof
(
void
*
);
case
RPC_FC_DOUBLE
:
return
sizeof
(
double
);
case
RPC_FC_HYPER
:
return
sizeof
(
ULONGLONG
);
case
RPC_FC_ERROR_STATUS_T
:
return
sizeof
(
error_status_t
);
case
RPC_FC_IGNORE
:
return
sizeof
(
void
*
);
default:
ERR
(
"invalid base type 0x%x
\n
"
,
fc
);
RpcRaiseException
(
RPC_S_INTERNAL_ERROR
);
...
...
@@ -463,7 +460,7 @@ void client_do_args_old_format(PMIDL_STUB_MESSAGE pStubMsg,
/* current format string offset */
int
current_offset
=
0
;
/* current stack offset */
unsigned
short
current_stack_offset
=
0
;
unsigned
short
current_stack_offset
=
object_proc
?
sizeof
(
void
*
)
:
0
;
/* counter */
unsigned
short
i
;
...
...
@@ -475,19 +472,15 @@ void client_do_args_old_format(PMIDL_STUB_MESSAGE pStubMsg,
{
const
NDR_PARAM_OI_BASETYPE
*
pParam
=
(
const
NDR_PARAM_OI_BASETYPE
*
)
&
pFormat
[
current_offset
];
/* note: current_stack_offset starts after the This pointer
* if present, so adjust this */
unsigned
short
current_stack_offset_adjusted
=
current_stack_offset
+
(
object_proc
?
sizeof
(
void
*
)
:
0
);
unsigned
char
*
pArg
=
ARG_FROM_OFFSET
(
args
,
current_stack_offset_adjusted
);
unsigned
char
*
pArg
=
ARG_FROM_OFFSET
(
args
,
current_stack_offset
);
/* no more parameters; exit loop */
if
(
current_stack_offset
_adjusted
>=
stack_size
)
if
(
current_stack_offset
>=
stack_size
)
break
;
TRACE
(
"param[%d]: old format
\n
"
,
i
);
TRACE
(
"
\t
param_direction: 0x%x
\n
"
,
pParam
->
param_direction
);
TRACE
(
"
\t
stack_offset: 0x%x
\n
"
,
current_stack_offset
_adjusted
);
TRACE
(
"
\t
stack_offset: 0x%x
\n
"
,
current_stack_offset
);
TRACE
(
"
\t
memory addr (before): %p
\n
"
,
pArg
);
if
(
pParam
->
param_direction
==
RPC_FC_IN_PARAM_BASETYPE
||
...
...
@@ -567,10 +560,9 @@ void client_do_args_old_format(PMIDL_STUB_MESSAGE pStubMsg,
RpcRaiseException
(
RPC_S_INTERNAL_ERROR
);
}
current_stack_offset
+=
pParamOther
->
stack_size
*
sizeof
(
INT
);
current_stack_offset
+=
pParamOther
->
stack_size
*
sizeof
(
void
*
);
current_offset
+=
sizeof
(
NDR_PARAM_OI_OTHER
);
}
TRACE
(
"
\t
memory addr (after): %p
\n
"
,
pArg
);
}
}
...
...
@@ -1242,7 +1234,7 @@ static LONG_PTR *stub_do_old_args(MIDL_STUB_MESSAGE *pStubMsg,
/* current format string offset */
int
current_offset
=
0
;
/* current stack offset */
unsigned
short
current_stack_offset
=
0
;
unsigned
short
current_stack_offset
=
object
?
sizeof
(
void
*
)
:
0
;
/* location to put retval into */
LONG_PTR
*
retval_ptr
=
NULL
;
...
...
@@ -1250,19 +1242,15 @@ static LONG_PTR *stub_do_old_args(MIDL_STUB_MESSAGE *pStubMsg,
{
const
NDR_PARAM_OI_BASETYPE
*
pParam
=
(
const
NDR_PARAM_OI_BASETYPE
*
)
&
pFormat
[
current_offset
];
/* note: current_stack_offset starts after the This pointer
* if present, so adjust this */
unsigned
short
current_stack_offset_adjusted
=
current_stack_offset
+
(
object
?
sizeof
(
void
*
)
:
0
);
unsigned
char
*
pArg
=
args
+
current_stack_offset_adjusted
;
unsigned
char
*
pArg
=
args
+
current_stack_offset
;
/* no more parameters; exit loop */
if
(
current_stack_offset
_adjusted
>=
stack_size
)
if
(
current_stack_offset
>=
stack_size
)
break
;
TRACE
(
"param[%d]: old format
\n
"
,
i
);
TRACE
(
"
\t
param_direction: 0x%x
\n
"
,
pParam
->
param_direction
);
TRACE
(
"
\t
stack_offset: 0x%x
\n
"
,
current_stack_offset
_adjusted
);
TRACE
(
"
\t
stack_offset: 0x%x
\n
"
,
current_stack_offset
);
if
(
pParam
->
param_direction
==
RPC_FC_IN_PARAM_BASETYPE
||
pParam
->
param_direction
==
RPC_FC_RETURN_PARAM_BASETYPE
)
...
...
@@ -1372,7 +1360,7 @@ static LONG_PTR *stub_do_old_args(MIDL_STUB_MESSAGE *pStubMsg,
RpcRaiseException
(
RPC_S_INTERNAL_ERROR
);
}
current_stack_offset
+=
pParamOther
->
stack_size
*
sizeof
(
INT
);
current_stack_offset
+=
pParamOther
->
stack_size
*
sizeof
(
void
*
);
current_offset
+=
sizeof
(
NDR_PARAM_OI_OTHER
);
}
}
...
...
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