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
95d79e2c
Commit
95d79e2c
authored
May 10, 2006
by
Robert Shearman
Committed by
Alexandre Julliard
May 10, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Correctly align the buffer before reading/writing structure data.
parent
5616c415
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
ndr_marshall.c
dlls/rpcrt4/ndr_marshall.c
+19
-0
No files found.
dlls/rpcrt4/ndr_marshall.c
View file @
95d79e2c
...
...
@@ -1321,6 +1321,8 @@ unsigned char * WINAPI NdrSimpleStructMarshall(PMIDL_STUB_MESSAGE pStubMsg,
unsigned
size
=
*
(
const
WORD
*
)(
pFormat
+
2
);
TRACE
(
"(%p,%p,%p)
\n
"
,
pStubMsg
,
pMemory
,
pFormat
);
ALIGN_POINTER
(
pStubMsg
->
Buffer
,
pFormat
[
1
]
+
1
);
memcpy
(
pStubMsg
->
Buffer
,
pMemory
,
size
);
pStubMsg
->
BufferMark
=
pStubMsg
->
Buffer
;
pStubMsg
->
Buffer
+=
size
;
...
...
@@ -1344,6 +1346,8 @@ unsigned char * WINAPI NdrSimpleStructUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
unsigned
size
=
*
(
const
WORD
*
)(
pFormat
+
2
);
TRACE
(
"(%p,%p,%p,%d)
\n
"
,
pStubMsg
,
ppMemory
,
pFormat
,
fMustAlloc
);
ALIGN_POINTER
(
pStubMsg
->
Buffer
,
pFormat
[
1
]
+
1
);
if
(
fMustAlloc
)
{
*
ppMemory
=
NdrAllocate
(
pStubMsg
,
size
);
memcpy
(
*
ppMemory
,
pStubMsg
->
Buffer
,
size
);
...
...
@@ -1396,6 +1400,9 @@ void WINAPI NdrSimpleStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
{
unsigned
size
=
*
(
const
WORD
*
)(
pFormat
+
2
);
TRACE
(
"(%p,%p,%p)
\n
"
,
pStubMsg
,
pMemory
,
pFormat
);
ALIGN_LENGTH
(
pStubMsg
->
BufferLength
,
pFormat
[
1
]
+
1
);
pStubMsg
->
BufferLength
+=
size
;
if
(
pFormat
[
0
]
!=
RPC_FC_STRUCT
)
EmbeddedPointerBufferSize
(
pStubMsg
,
pMemory
,
pFormat
+
4
);
...
...
@@ -1751,6 +1758,8 @@ unsigned char * WINAPI NdrComplexStructMarshall(PMIDL_STUB_MESSAGE pStubMsg,
TRACE
(
"(%p,%p,%p)
\n
"
,
pStubMsg
,
pMemory
,
pFormat
);
ALIGN_POINTER
(
pStubMsg
->
Buffer
,
pFormat
[
1
]
+
1
);
pFormat
+=
4
;
if
(
*
(
const
WORD
*
)
pFormat
)
conf_array
=
pFormat
+
*
(
const
WORD
*
)
pFormat
;
pFormat
+=
2
;
...
...
@@ -1786,6 +1795,8 @@ unsigned char * WINAPI NdrComplexStructUnmarshall(PMIDL_STUB_MESSAGE pStubMsg,
TRACE
(
"(%p,%p,%p,%d)
\n
"
,
pStubMsg
,
ppMemory
,
pFormat
,
fMustAlloc
);
ALIGN_POINTER
(
pStubMsg
->
Buffer
,
pFormat
[
1
]
+
1
);
if
(
fMustAlloc
||
!*
ppMemory
)
{
*
ppMemory
=
NdrAllocate
(
pStubMsg
,
size
);
...
...
@@ -1819,6 +1830,8 @@ void WINAPI NdrComplexStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
TRACE
(
"(%p,%p,%p)
\n
"
,
pStubMsg
,
pMemory
,
pFormat
);
ALIGN_LENGTH
(
pStubMsg
->
BufferLength
,
pFormat
[
1
]
+
1
);
pFormat
+=
4
;
if
(
*
(
const
WORD
*
)
pFormat
)
conf_array
=
pFormat
+
*
(
const
WORD
*
)
pFormat
;
pFormat
+=
2
;
...
...
@@ -2479,6 +2492,8 @@ unsigned char * WINAPI NdrConformantStructMarshall(PMIDL_STUB_MESSAGE pStubMsg,
return
NULL
;
}
ALIGN_POINTER
(
pStubMsg
->
Buffer
,
pCStructFormat
->
alignment
+
1
);
TRACE
(
"memory_size = %d
\n
"
,
pCStructFormat
->
memory_size
);
/* copy constant sized part of struct */
...
...
@@ -2516,6 +2531,8 @@ unsigned char * WINAPI NdrConformantStructUnmarshall(PMIDL_STUB_MESSAGE pStubMs
return
NULL
;
}
ALIGN_POINTER
(
pStubMsg
->
Buffer
,
pCStructFormat
->
alignment
+
1
);
TRACE
(
"memory_size = %d
\n
"
,
pCStructFormat
->
memory_size
);
/* work out how much memory to allocate if we need to do so */
...
...
@@ -2571,6 +2588,8 @@ void WINAPI NdrConformantStructBufferSize(PMIDL_STUB_MESSAGE pStubMsg,
return
;
}
ALIGN_LENGTH
(
pStubMsg
->
BufferLength
,
pCStructFormat
->
alignment
+
1
);
TRACE
(
"memory_size = %d
\n
"
,
pCStructFormat
->
memory_size
);
/* add constant sized part of struct to buffer size */
...
...
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