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
a1758ed6
Commit
a1758ed6
authored
Nov 28, 2005
by
Robert Shearman
Committed by
Alexandre Julliard
Nov 28, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
We should always allocate in NdrConformantStringUnmarshal if the
memory pointer is NULL.
parent
809dd5b0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
15 deletions
+4
-15
ndr_marshall.c
dlls/rpcrt4/ndr_marshall.c
+4
-15
No files found.
dlls/rpcrt4/ndr_marshall.c
View file @
a1758ed6
...
...
@@ -526,7 +526,6 @@ unsigned char *WINAPI NdrConformantStringUnmarshall( PMIDL_STUB_MESSAGE pStubMsg
unsigned
char
**
ppMemory
,
PFORMAT_STRING
pFormat
,
unsigned
char
fMustAlloc
)
{
unsigned
long
len
,
esize
,
ofs
;
unsigned
char
*
pMem
;
TRACE
(
"(pStubMsg == ^%p, *pMemory == ^%p, pFormat == ^%p, fMustAlloc == %u)
\n
"
,
pStubMsg
,
*
ppMemory
,
pFormat
,
fMustAlloc
);
...
...
@@ -551,28 +550,18 @@ unsigned char *WINAPI NdrConformantStringUnmarshall( PMIDL_STUB_MESSAGE pStubMsg
FIXME
(
"sized string format=%d
\n
"
,
pFormat
[
1
]);
}
if
(
fMustAlloc
)
{
if
(
fMustAlloc
||
!*
ppMemory
)
*
ppMemory
=
NdrAllocate
(
pStubMsg
,
len
*
esize
+
BUFFER_PARANOIA
);
}
else
{
if
(
pStubMsg
->
ReuseBuffer
&&
!*
ppMemory
)
/* for servers, we may just point straight into the RPC buffer, I think
* (I guess that's what MS does since MIDL code doesn't try to free) */
*
ppMemory
=
pStubMsg
->
Buffer
-
ofs
*
esize
;
/* for clients, memory should be provided by caller */
}
pMem
=
*
ppMemory
+
ofs
*
esize
;
if
(
pMem
!=
pStubMsg
->
Buffer
)
memcpy
(
pMem
,
pStubMsg
->
Buffer
,
len
*
esize
);
memcpy
(
*
ppMemory
,
pStubMsg
->
Buffer
,
len
*
esize
);
pStubMsg
->
Buffer
+=
len
*
esize
;
if
(
*
pFormat
==
RPC_FC_C_CSTRING
)
{
TRACE
(
"string=%s
\n
"
,
debugstr_a
((
char
*
)
pMem
));
TRACE
(
"string=%s
\n
"
,
debugstr_a
((
char
*
)
*
ppMemory
));
}
else
if
(
*
pFormat
==
RPC_FC_C_WSTRING
)
{
TRACE
(
"string=%s
\n
"
,
debugstr_w
((
LPWSTR
)
pMem
));
TRACE
(
"string=%s
\n
"
,
debugstr_w
((
LPWSTR
)
*
ppMemory
));
}
return
NULL
;
/* FIXME: is this always right? */
...
...
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