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
44922d29
Commit
44922d29
authored
Nov 10, 2006
by
Rob Shearman
Committed by
Alexandre Julliard
Nov 10, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rpcrt4: Correctly align the results in the RPC Bind Ack packet.
parent
50a18ca5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
6 deletions
+9
-6
rpc_defs.h
dlls/rpcrt4/rpc_defs.h
+2
-2
rpc_message.c
dlls/rpcrt4/rpc_message.c
+7
-4
No files found.
dlls/rpcrt4/rpc_defs.h
View file @
44922d29
...
@@ -88,9 +88,8 @@ typedef struct
...
@@ -88,9 +88,8 @@ typedef struct
typedef
struct
typedef
struct
{
{
unsigned
char
padding1
[
2
];
/* Force alignment! */
unsigned
char
num_results
;
/* Number of results */
unsigned
char
num_results
;
/* Number of results */
unsigned
char
padding2
[
3
];
/* Force alignment! */
unsigned
char
reserved
[
3
];
/* Force alignment! */
struct
{
struct
{
unsigned
short
result
;
unsigned
short
result
;
unsigned
short
reason
;
unsigned
short
reason
;
...
@@ -106,6 +105,7 @@ typedef struct
...
@@ -106,6 +105,7 @@ typedef struct
/*
/*
* Following this header are these fields:
* Following this header are these fields:
* RpcAddressString server_address;
* RpcAddressString server_address;
* [0 - 3 bytes of padding so that results is 4-byte aligned]
* RpcResults results;
* RpcResults results;
* RPC_SYNTAX_IDENTIFIER transfer;
* RPC_SYNTAX_IDENTIFIER transfer;
*/
*/
...
...
dlls/rpcrt4/rpc_message.c
View file @
44922d29
...
@@ -49,6 +49,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(rpc);
...
@@ -49,6 +49,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(rpc);
/* gets the amount needed to round a value up to the specified alignment */
/* gets the amount needed to round a value up to the specified alignment */
#define ROUND_UP_AMOUNT(value, alignment) \
#define ROUND_UP_AMOUNT(value, alignment) \
(((alignment) - (((value) % (alignment)))) % (alignment))
(((alignment) - (((value) % (alignment)))) % (alignment))
#define ROUND_UP(value, alignment) (((value) + ((alignment) - 1)) & ~((alignment)-1))
static
RPC_STATUS
I_RpcReAllocateBuffer
(
PRPC_MESSAGE
pMsg
);
static
RPC_STATUS
I_RpcReAllocateBuffer
(
PRPC_MESSAGE
pMsg
);
...
@@ -230,9 +231,10 @@ RpcPktHdr *RPCRT4_BuildBindAckHeader(unsigned long DataRepresentation,
...
@@ -230,9 +231,10 @@ RpcPktHdr *RPCRT4_BuildBindAckHeader(unsigned long DataRepresentation,
RpcResults
*
results
;
RpcResults
*
results
;
RPC_SYNTAX_IDENTIFIER
*
transfer_id
;
RPC_SYNTAX_IDENTIFIER
*
transfer_id
;
header_size
=
sizeof
(
header
->
bind_ack
)
+
sizeof
(
RpcResults
)
+
header_size
=
sizeof
(
header
->
bind_ack
)
+
sizeof
(
RPC_SYNTAX_IDENTIFIER
)
+
sizeof
(
RpcAddressString
)
+
ROUND_UP
(
FIELD_OFFSET
(
RpcAddressString
,
string
[
strlen
(
ServerAddress
)
+
1
]),
4
)
+
strlen
(
ServerAddress
);
sizeof
(
RpcResults
)
+
sizeof
(
RPC_SYNTAX_IDENTIFIER
);
header
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
header_size
);
header
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
header_size
);
if
(
header
==
NULL
)
{
if
(
header
==
NULL
)
{
...
@@ -246,7 +248,8 @@ RpcPktHdr *RPCRT4_BuildBindAckHeader(unsigned long DataRepresentation,
...
@@ -246,7 +248,8 @@ RpcPktHdr *RPCRT4_BuildBindAckHeader(unsigned long DataRepresentation,
server_address
=
(
RpcAddressString
*
)(
&
header
->
bind_ack
+
1
);
server_address
=
(
RpcAddressString
*
)(
&
header
->
bind_ack
+
1
);
server_address
->
length
=
strlen
(
ServerAddress
)
+
1
;
server_address
->
length
=
strlen
(
ServerAddress
)
+
1
;
strcpy
(
server_address
->
string
,
ServerAddress
);
strcpy
(
server_address
->
string
,
ServerAddress
);
results
=
(
RpcResults
*
)((
ULONG_PTR
)
server_address
+
sizeof
(
RpcAddressString
)
+
server_address
->
length
-
1
);
/* results is 4-byte aligned */
results
=
(
RpcResults
*
)((
ULONG_PTR
)
server_address
+
ROUND_UP
(
FIELD_OFFSET
(
RpcAddressString
,
string
[
server_address
->
length
]),
4
));
results
->
num_results
=
1
;
results
->
num_results
=
1
;
results
->
results
[
0
].
result
=
Result
;
results
->
results
[
0
].
result
=
Result
;
results
->
results
[
0
].
reason
=
Reason
;
results
->
results
[
0
].
reason
=
Reason
;
...
...
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