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
Show 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,
static
unsigned
char
*
ComplexUnmarshall
(
PMIDL_STUB_MESSAGE
pStubMsg
,
unsigned
char
*
pMemory
,
PFORMAT_STRING
pFormat
,
PFORMAT_STRING
pPointer
)
PFORMAT_STRING
pPointer
,
unsigned
char
fMustAlloc
)
{
PFORMAT_STRING
desc
;
NDR_UNMARSHALL
m
;
...
...
@@ -2390,7 +2391,7 @@ static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
else
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
)
{
STD_OVERFLOW_CHECK
(
pStubMsg
);
...
...
@@ -2430,7 +2431,6 @@ static unsigned char * ComplexUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
size
=
EmbeddedComplexSize
(
pStubMsg
,
desc
);
TRACE
(
"embedded complex (size=%ld) => %p
\n
"
,
size
,
pMemory
);
m
=
NdrUnmarshaller
[
*
desc
&
NDR_TABLE_MASK
];
memset
(
pMemory
,
0
,
size
);
/* just in case */
if
(
m
)
{
/* for some reason interface pointers aren't generated as
...
...
@@ -2884,10 +2884,7 @@ unsigned char * WINAPI NdrComplexStructUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
ALIGN_POINTER
(
pStubMsg
->
Buffer
,
pFormat
[
1
]
+
1
);
if
(
fMustAlloc
||
!*
ppMemory
)
{
*
ppMemory
=
NdrAllocate
(
pStubMsg
,
size
);
memset
(
*
ppMemory
,
0
,
size
);
}
pFormat
+=
4
;
if
(
*
(
const
WORD
*
)
pFormat
)
conf_array
=
pFormat
+
*
(
const
WORD
*
)
pFormat
;
...
...
@@ -2895,7 +2892,7 @@ unsigned char * WINAPI NdrComplexStructUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
if
(
*
(
const
WORD
*
)
pFormat
)
pointer_desc
=
pFormat
+
*
(
const
WORD
*
)
pFormat
;
pFormat
+=
2
;
pMemory
=
ComplexUnmarshall
(
pStubMsg
,
*
ppMemory
,
pFormat
,
pointer_desc
);
pMemory
=
ComplexUnmarshall
(
pStubMsg
,
*
ppMemory
,
pFormat
,
pointer_desc
,
fMustAlloc
);
if
(
conf_array
)
NdrConformantArrayUnmarshall
(
pStubMsg
,
&
pMemory
,
conf_array
,
fMustAlloc
);
...
...
@@ -3470,17 +3467,14 @@ unsigned char * WINAPI NdrComplexArrayUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
pFormat
=
ReadVariance
(
pStubMsg
,
pFormat
,
pStubMsg
->
MaxCount
);
if
(
fMustAlloc
||
!*
ppMemory
)
{
*
ppMemory
=
NdrAllocate
(
pStubMsg
,
size
);
memset
(
*
ppMemory
,
0
,
size
);
}
ALIGN_POINTER
(
pStubMsg
->
Buffer
,
alignment
);
pMemory
=
*
ppMemory
;
count
=
pStubMsg
->
ActualCount
;
for
(
i
=
0
;
i
<
count
;
i
++
)
pMemory
=
ComplexUnmarshall
(
pStubMsg
,
pMemory
,
pFormat
,
NULL
);
pMemory
=
ComplexUnmarshall
(
pStubMsg
,
pMemory
,
pFormat
,
NULL
,
fMustAlloc
);
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