Commit d82cbcf0 authored by Juan Lang's avatar Juan Lang Committed by Alexandre Julliard

rpcrt4: Allow Annotation to be NULL.

Fixes bug 19760. --Juan From afb4d6b943345e19952fe34bd1d8ab4c411563ae Mon Sep 17 00:00:00 2001 From: Juan Lang <juan.lang@gmail.com> Date: Wed, 19 Aug 2009 14:27:20 -0700 Subject: [PATCH 3/3] Allow Annotation to be NULL
parent 742de5ae
......@@ -225,7 +225,6 @@ RPC_STATUS WINAPI RpcEpRegisterA( RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR *Bind
RpcBinding* bind = BindingVector->BindingH[i];
for (j = 0; j < (UuidVector ? UuidVector->Count : 1); j++)
{
int len = strlen((char *)Annotation);
status = TowerConstruct(&If->InterfaceId, &If->TransferSyntax,
bind->Protseq, bind->Endpoint,
bind->NetworkAddr,
......@@ -236,7 +235,9 @@ RPC_STATUS WINAPI RpcEpRegisterA( RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR *Bind
memcpy(&entries[i * UuidVector->Count].object, &UuidVector->Uuid[j], sizeof(GUID));
else
memset(&entries[i].object, 0, sizeof(entries[i].object));
memcpy(entries[i].annotation, Annotation, min(len + 1, ept_max_annotation_size));
if (Annotation)
memcpy(entries[i].annotation, Annotation,
min(strlen((char *)Annotation) + 1, ept_max_annotation_size));
}
}
......
......@@ -157,6 +157,9 @@ static void test_endpoint_mapper(RPC_CSTR protseq, RPC_CSTR address)
/* register endpoints created in test_RpcServerUseProtseq */
status = RpcEpRegisterA(IFoo_v0_0_s_ifspec, binding_vector, NULL, annotation);
ok(status == RPC_S_OK, "%s: RpcEpRegisterA failed with error %u\n", protseq, status);
/* reregister the same endpoint with no annotation */
status = RpcEpRegisterA(IFoo_v0_0_s_ifspec, binding_vector, NULL, NULL);
ok(status == RPC_S_OK, "%s: RpcEpRegisterA failed with error %u\n", protseq, status);
status = RpcStringBindingCompose(NULL, protseq, address,
NULL, NULL, &binding);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment