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.
This commit is contained in:
Rob Shearman 2008-01-07 15:19:57 +00:00 committed by Alexandre Julliard
parent 4d6aa7ca95
commit 31676530c2
4 changed files with 6 additions and 3 deletions

View file

@ -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;

View file

@ -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)
{

View file

@ -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,

View file

@ -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