rpcrt4: Allow Annotation to be NULL
Juan Lang
juan.lang at gmail.com
Wed Aug 19 16:28:29 CDT 2009
Fixes bug 19760.
--Juan
-------------- next part --------------
From afb4d6b943345e19952fe34bd1d8ab4c411563ae Mon Sep 17 00:00:00 2001
From: Juan Lang <juan.lang at gmail.com>
Date: Wed, 19 Aug 2009 14:27:20 -0700
Subject: [PATCH 3/3] Allow Annotation to be NULL
---
dlls/rpcrt4/rpc_epmap.c | 5 +++--
dlls/rpcrt4/tests/rpc_protseq.c | 3 +++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/dlls/rpcrt4/rpc_epmap.c b/dlls/rpcrt4/rpc_epmap.c
index 2a03484..6d62b20 100644
--- a/dlls/rpcrt4/rpc_epmap.c
+++ b/dlls/rpcrt4/rpc_epmap.c
@@ -225,7 +225,7 @@ 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);
+ int len = Annotation ? strlen((char *)Annotation) : 0;
status = TowerConstruct(&If->InterfaceId, &If->TransferSyntax,
bind->Protseq, bind->Endpoint,
bind->NetworkAddr,
@@ -236,7 +236,8 @@ 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(len + 1, ept_max_annotation_size));
}
}
diff --git a/dlls/rpcrt4/tests/rpc_protseq.c b/dlls/rpcrt4/tests/rpc_protseq.c
index 4837f6a..3acc38b 100644
--- a/dlls/rpcrt4/tests/rpc_protseq.c
+++ b/dlls/rpcrt4/tests/rpc_protseq.c
@@ -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);
--
1.6.3.2
More information about the wine-patches
mailing list