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
62bbaf70
Commit
62bbaf70
authored
May 18, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
May 18, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Fix the wire protocol of the user marshal functions to match MS/RPC.
parent
2aa52b07
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
49 additions
and
3 deletions
+49
-3
ndr_marshall.c
dlls/rpcrt4/ndr_marshall.c
+49
-3
No files found.
dlls/rpcrt4/ndr_marshall.c
View file @
62bbaf70
...
...
@@ -2518,6 +2518,10 @@ unsigned long UserMarshalFlags(PMIDL_STUB_MESSAGE pStubMsg)
pStubMsg
->
RpcMsg
->
DataRepresentation
);
}
#define USER_MARSHAL_PTR_PREFIX \
( (DWORD)'U' | ( (DWORD)'s' << 8 ) | \
( (DWORD)'e' << 16 ) | ( (DWORD)'r' << 24 ) )
/***********************************************************************
* NdrUserMarshalMarshall [RPCRT4.@]
*/
...
...
@@ -2525,12 +2529,22 @@ unsigned char * WINAPI NdrUserMarshalMarshall(PMIDL_STUB_MESSAGE pStubMsg,
unsigned
char
*
pMemory
,
PFORMAT_STRING
pFormat
)
{
/* unsigned flags = pFormat[1]; */
unsigned
flags
=
pFormat
[
1
];
unsigned
index
=
*
(
const
WORD
*
)
&
pFormat
[
2
];
unsigned
long
uflag
=
UserMarshalFlags
(
pStubMsg
);
TRACE
(
"(%p,%p,%p)
\n
"
,
pStubMsg
,
pMemory
,
pFormat
);
TRACE
(
"index=%d
\n
"
,
index
);
if
(
flags
&
USER_MARSHAL_POINTER
)
{
ALIGN_POINTER
(
pStubMsg
->
Buffer
,
4
);
NDR_LOCAL_UINT32_WRITE
(
pStubMsg
->
Buffer
,
USER_MARSHAL_PTR_PREFIX
);
pStubMsg
->
Buffer
+=
4
;
ALIGN_POINTER
(
pStubMsg
->
Buffer
,
8
);
}
else
ALIGN_POINTER
(
pStubMsg
->
Buffer
,
(
flags
&
0xf
)
+
1
);
pStubMsg
->
Buffer
=
pStubMsg
->
StubDesc
->
aUserMarshalQuadruple
[
index
].
pfnMarshall
(
&
uflag
,
pStubMsg
->
Buffer
,
pMemory
);
...
...
@@ -2548,13 +2562,23 @@ unsigned char * WINAPI NdrUserMarshalUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
PFORMAT_STRING
pFormat
,
unsigned
char
fMustAlloc
)
{
/* unsigned flags = pFormat[1];*/
unsigned
flags
=
pFormat
[
1
];
unsigned
index
=
*
(
const
WORD
*
)
&
pFormat
[
2
];
DWORD
memsize
=
*
(
const
WORD
*
)
&
pFormat
[
4
];
unsigned
long
uflag
=
UserMarshalFlags
(
pStubMsg
);
TRACE
(
"(%p,%p,%p,%d)
\n
"
,
pStubMsg
,
ppMemory
,
pFormat
,
fMustAlloc
);
TRACE
(
"index=%d
\n
"
,
index
);
if
(
flags
&
USER_MARSHAL_POINTER
)
{
ALIGN_POINTER
(
pStubMsg
->
Buffer
,
4
);
/* skip pointer prefix */
pStubMsg
->
Buffer
+=
4
;
ALIGN_POINTER
(
pStubMsg
->
Buffer
,
8
);
}
else
ALIGN_POINTER
(
pStubMsg
->
Buffer
,
(
flags
&
0xf
)
+
1
);
if
(
fMustAlloc
||
!*
ppMemory
)
*
ppMemory
=
NdrAllocate
(
pStubMsg
,
memsize
);
...
...
@@ -2572,13 +2596,23 @@ void WINAPI NdrUserMarshalBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
unsigned
char
*
pMemory
,
PFORMAT_STRING
pFormat
)
{
/* unsigned flags = pFormat[1];*/
unsigned
flags
=
pFormat
[
1
];
unsigned
index
=
*
(
const
WORD
*
)
&
pFormat
[
2
];
DWORD
bufsize
=
*
(
const
WORD
*
)
&
pFormat
[
6
];
unsigned
long
uflag
=
UserMarshalFlags
(
pStubMsg
);
TRACE
(
"(%p,%p,%p)
\n
"
,
pStubMsg
,
pMemory
,
pFormat
);
TRACE
(
"index=%d
\n
"
,
index
);
if
(
flags
&
USER_MARSHAL_POINTER
)
{
ALIGN_LENGTH
(
pStubMsg
->
BufferLength
,
4
);
/* skip pointer prefix */
pStubMsg
->
BufferLength
+=
4
;
ALIGN_LENGTH
(
pStubMsg
->
BufferLength
,
8
);
}
else
ALIGN_LENGTH
(
pStubMsg
->
BufferLength
,
(
flags
&
0xf
)
+
1
);
if
(
bufsize
)
{
TRACE
(
"size=%ld
\n
"
,
bufsize
);
pStubMsg
->
BufferLength
+=
bufsize
;
...
...
@@ -2596,6 +2630,7 @@ void WINAPI NdrUserMarshalBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
unsigned
long
WINAPI
NdrUserMarshalMemorySize
(
PMIDL_STUB_MESSAGE
pStubMsg
,
PFORMAT_STRING
pFormat
)
{
unsigned
flags
=
pFormat
[
1
];
unsigned
index
=
*
(
const
WORD
*
)
&
pFormat
[
2
];
DWORD
memsize
=
*
(
const
WORD
*
)
&
pFormat
[
4
];
DWORD
bufsize
=
*
(
const
WORD
*
)
&
pFormat
[
6
];
...
...
@@ -2604,6 +2639,17 @@ unsigned long WINAPI NdrUserMarshalMemorySize(PMIDL_STUB_MESSAGE pStubMsg,
TRACE
(
"index=%d
\n
"
,
index
);
pStubMsg
->
MemorySize
+=
memsize
;
if
(
flags
&
USER_MARSHAL_POINTER
)
{
ALIGN_POINTER
(
pStubMsg
->
Buffer
,
4
);
/* skip pointer prefix */
pStubMsg
->
Buffer
+=
4
;
ALIGN_POINTER
(
pStubMsg
->
Buffer
,
8
);
}
else
ALIGN_POINTER
(
pStubMsg
->
Buffer
,
(
flags
&
0xf
)
+
1
);
pStubMsg
->
Buffer
+=
bufsize
;
return
pStubMsg
->
MemorySize
;
...
...
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