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
44649e85
Commit
44649e85
authored
Jun 26, 2008
by
Rob Shearman
Committed by
Alexandre Julliard
Jul 04, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Fix NdrComplexArrayUnmarshall and NdrComplexStructUnmarshall to reuse…
rpcrt4: Fix NdrComplexArrayUnmarshall and NdrComplexStructUnmarshall to reuse memory for embedded pointers.
parent
517844e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
11 deletions
+5
-11
ndr_marshall.c
dlls/rpcrt4/ndr_marshall.c
+5
-11
No files found.
dlls/rpcrt4/ndr_marshall.c
View file @
44649e85
...
@@ -2331,7 +2331,8 @@ static unsigned char * ComplexMarshall(PMIDL_STUB_MESSAGE pStubMsg,
...
@@ -2331,7 +2331,8 @@ static unsigned char * ComplexMarshall(PMIDL_STUB_MESSAGE pStubMsg,
static
unsigned
char
*
ComplexUnmarshall
(
PMIDL_STUB_MESSAGE
pStubMsg
,
static
unsigned
char
*
ComplexUnmarshall
(
PMIDL_STUB_MESSAGE
pStubMsg
,
unsigned
char
*
pMemory
,
unsigned
char
*
pMemory
,
PFORMAT_STRING
pFormat
,
PFORMAT_STRING
pFormat
,
PFORMAT_STRING
pPointer
)
PFORMAT_STRING
pPointer
,
unsigned
char
fMustAlloc
)
{
{
PFORMAT_STRING
desc
;
PFORMAT_STRING
desc
;
NDR_UNMARSHALL
m
;
NDR_UNMARSHALL
m
;
...
@@ -2390,7 +2391,7 @@ static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
...
@@ -2390,7 +2391,7 @@ static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
else
else
safe_buffer_increment
(
pStubMsg
,
4
);
/* for pointer ID */
safe_buffer_increment
(
pStubMsg
,
4
);
/* for pointer ID */
PointerUnmarshall
(
pStubMsg
,
saved_buffer
,
(
unsigned
char
**
)
pMemory
,
*
(
unsigned
char
**
)
pMemory
,
pPointer
,
TRUE
);
PointerUnmarshall
(
pStubMsg
,
saved_buffer
,
(
unsigned
char
**
)
pMemory
,
*
(
unsigned
char
**
)
pMemory
,
pPointer
,
fMustAlloc
);
if
(
pointer_buffer_mark_set
)
if
(
pointer_buffer_mark_set
)
{
{
STD_OVERFLOW_CHECK
(
pStubMsg
);
STD_OVERFLOW_CHECK
(
pStubMsg
);
...
@@ -2430,7 +2431,6 @@ static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
...
@@ -2430,7 +2431,6 @@ static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
size
=
EmbeddedComplexSize
(
pStubMsg
,
desc
);
size
=
EmbeddedComplexSize
(
pStubMsg
,
desc
);
TRACE
(
"embedded complex (size=%ld) => %p
\n
"
,
size
,
pMemory
);
TRACE
(
"embedded complex (size=%ld) => %p
\n
"
,
size
,
pMemory
);
m
=
NdrUnmarshaller
[
*
desc
&
NDR_TABLE_MASK
];
m
=
NdrUnmarshaller
[
*
desc
&
NDR_TABLE_MASK
];
memset
(
pMemory
,
0
,
size
);
/* just in case */
if
(
m
)
if
(
m
)
{
{
/* for some reason interface pointers aren't generated as
/* for some reason interface pointers aren't generated as
...
@@ -2884,10 +2884,7 @@ unsigned char * WINAPI NdrComplexStructUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
...
@@ -2884,10 +2884,7 @@ unsigned char * WINAPI NdrComplexStructUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
ALIGN_POINTER
(
pStubMsg
->
Buffer
,
pFormat
[
1
]
+
1
);
ALIGN_POINTER
(
pStubMsg
->
Buffer
,
pFormat
[
1
]
+
1
);
if
(
fMustAlloc
||
!*
ppMemory
)
if
(
fMustAlloc
||
!*
ppMemory
)
{
*
ppMemory
=
NdrAllocate
(
pStubMsg
,
size
);
*
ppMemory
=
NdrAllocate
(
pStubMsg
,
size
);
memset
(
*
ppMemory
,
0
,
size
);
}
pFormat
+=
4
;
pFormat
+=
4
;
if
(
*
(
const
WORD
*
)
pFormat
)
conf_array
=
pFormat
+
*
(
const
WORD
*
)
pFormat
;
if
(
*
(
const
WORD
*
)
pFormat
)
conf_array
=
pFormat
+
*
(
const
WORD
*
)
pFormat
;
...
@@ -2895,7 +2892,7 @@ unsigned char * WINAPI NdrComplexStructUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
...
@@ -2895,7 +2892,7 @@ unsigned char * WINAPI NdrComplexStructUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
if
(
*
(
const
WORD
*
)
pFormat
)
pointer_desc
=
pFormat
+
*
(
const
WORD
*
)
pFormat
;
if
(
*
(
const
WORD
*
)
pFormat
)
pointer_desc
=
pFormat
+
*
(
const
WORD
*
)
pFormat
;
pFormat
+=
2
;
pFormat
+=
2
;
pMemory
=
ComplexUnmarshall
(
pStubMsg
,
*
ppMemory
,
pFormat
,
pointer_desc
);
pMemory
=
ComplexUnmarshall
(
pStubMsg
,
*
ppMemory
,
pFormat
,
pointer_desc
,
fMustAlloc
);
if
(
conf_array
)
if
(
conf_array
)
NdrConformantArrayUnmarshall
(
pStubMsg
,
&
pMemory
,
conf_array
,
fMustAlloc
);
NdrConformantArrayUnmarshall
(
pStubMsg
,
&
pMemory
,
conf_array
,
fMustAlloc
);
...
@@ -3470,17 +3467,14 @@ unsigned char * WINAPI NdrComplexArrayUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
...
@@ -3470,17 +3467,14 @@ unsigned char * WINAPI NdrComplexArrayUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
pFormat
=
ReadVariance
(
pStubMsg
,
pFormat
,
pStubMsg
->
MaxCount
);
pFormat
=
ReadVariance
(
pStubMsg
,
pFormat
,
pStubMsg
->
MaxCount
);
if
(
fMustAlloc
||
!*
ppMemory
)
if
(
fMustAlloc
||
!*
ppMemory
)
{
*
ppMemory
=
NdrAllocate
(
pStubMsg
,
size
);
*
ppMemory
=
NdrAllocate
(
pStubMsg
,
size
);
memset
(
*
ppMemory
,
0
,
size
);
}
ALIGN_POINTER
(
pStubMsg
->
Buffer
,
alignment
);
ALIGN_POINTER
(
pStubMsg
->
Buffer
,
alignment
);
pMemory
=
*
ppMemory
;
pMemory
=
*
ppMemory
;
count
=
pStubMsg
->
ActualCount
;
count
=
pStubMsg
->
ActualCount
;
for
(
i
=
0
;
i
<
count
;
i
++
)
for
(
i
=
0
;
i
<
count
;
i
++
)
pMemory
=
ComplexUnmarshall
(
pStubMsg
,
pMemory
,
pFormat
,
NULL
);
pMemory
=
ComplexUnmarshall
(
pStubMsg
,
pMemory
,
pFormat
,
NULL
,
fMustAlloc
);
if
(
pointer_buffer_mark_set
)
if
(
pointer_buffer_mark_set
)
{
{
...
...
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