Rob Shearman : rpcrt4: Set the ProcNum of RPC_MESSAGE in NdrClientInitializeNew to include RPC_VALID_FLAGS_BIT .
Alexandre Julliard
julliard at winehq.org
Mon Jan 7 16:25:00 CST 2008
Module: wine
Branch: master
Commit: 31676530c2ec59886c167404467e1eb8840337f5
URL: http://source.winehq.org/git/wine.git/?a=commit;h=31676530c2ec59886c167404467e1eb8840337f5
Author: Rob Shearman <rob at codeweavers.com>
Date: Mon Jan 7 15:19:57 2008 +0000
rpcrt4: Set the ProcNum of RPC_MESSAGE in NdrClientInitializeNew to include RPC_VALID_FLAGS_BIT.
Mask out RPC_VALID_FLAGS_BIT from ProcNum when it is used to build a
packet to send to the server.
---
dlls/rpcrt4/ndr_clientserver.c | 2 +-
dlls/rpcrt4/rpc_message.c | 3 ++-
dlls/rpcrt4/tests/ndr_marshall.c | 1 -
include/rpcdcep.h | 3 +++
4 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/dlls/rpcrt4/ndr_clientserver.c b/dlls/rpcrt4/ndr_clientserver.c
index 809d4cb..8cce9d7 100644
--- a/dlls/rpcrt4/ndr_clientserver.c
+++ b/dlls/rpcrt4/ndr_clientserver.c
@@ -54,7 +54,7 @@ void WINAPI NdrClientInitializeNew( PRPC_MESSAGE pRpcMessage, PMIDL_STUB_MESSAGE
pRpcMessage, pStubMsg, pStubDesc, ProcNum);
pRpcMessage->Handle = NULL;
- pRpcMessage->ProcNum = ProcNum;
+ pRpcMessage->ProcNum = ProcNum | RPC_FLAGS_VALID_BIT;
pRpcMessage->RpcInterfaceInformation = pStubDesc->RpcInterfaceInformation;
pRpcMessage->RpcFlags = 0;
pRpcMessage->DataRepresentation = NDR_LOCAL_DATA_REPRESENTATION;
diff --git a/dlls/rpcrt4/rpc_message.c b/dlls/rpcrt4/rpc_message.c
index 9f0df05..c7282e7 100644
--- a/dlls/rpcrt4/rpc_message.c
+++ b/dlls/rpcrt4/rpc_message.c
@@ -1000,7 +1000,8 @@ RPC_STATUS WINAPI I_RpcSend(PRPC_MESSAGE pMsg)
if (status != RPC_S_OK) return status;
hdr = RPCRT4_BuildRequestHeader(pMsg->DataRepresentation,
- pMsg->BufferLength, pMsg->ProcNum,
+ pMsg->BufferLength,
+ pMsg->ProcNum & ~RPC_FLAGS_VALID_BIT,
&bind->ObjectUuid);
if (!hdr)
{
diff --git a/dlls/rpcrt4/tests/ndr_marshall.c b/dlls/rpcrt4/tests/ndr_marshall.c
index eebed49..c9b8fa9 100644
--- a/dlls/rpcrt4/tests/ndr_marshall.c
+++ b/dlls/rpcrt4/tests/ndr_marshall.c
@@ -901,7 +901,6 @@ static void test_client_init(void)
ok(rpcMsg.Handle == NULL, "rpcMsg.Handle should have been NULL instead of %p\n", rpcMsg.Handle);
TEST_POINTER_UNSET(Buffer);
ok(rpcMsg.BufferLength == 0xcccccccc, "rpcMsg.BufferLength should have been unset instead of %d\n", rpcMsg.BufferLength);
- todo_wine
ok(rpcMsg.ProcNum == 0x8001, "rpcMsg.ProcNum should have been 0x8001 instead of 0x%x\n", rpcMsg.ProcNum);
TEST_POINTER_UNSET(TransferSyntax);
ok(rpcMsg.RpcInterfaceInformation == Object_StubDesc.RpcInterfaceInformation,
diff --git a/include/rpcdcep.h b/include/rpcdcep.h
index b93c9a6..f0b78c1 100644
--- a/include/rpcdcep.h
+++ b/include/rpcdcep.h
@@ -48,6 +48,9 @@ typedef struct _RPC_MESSAGE
unsigned long RpcFlags;
} RPC_MESSAGE, *PRPC_MESSAGE;
+/* or'd with ProcNum */
+#define RPC_FLAGS_VALID_BIT 0x00008000
+
#define RPC_CONTEXT_HANDLE_DEFAULT_GUARD ((void *)0xfffff00d)
#define RPC_CONTEXT_HANDLE_DEFAULT_FLAGS 0x00000000
More information about the wine-cvs
mailing list