I posted this query in platformsdk.networking and
win32.programmer.networks
But thought that this was more an appropriate place to have this and hence
this mail.
Hi All,
I have written a RPC server. Which call the export of an Interface. Here
is the code which makes a call to that.
I am running that in VisualStudio .Net. Interfaces are not getting exported
saying that the export call returns me 1737
which a happens to be UNSUPPORTED_NAME_SYNTAX. Would somebody please tell me
as to what is wrong with the code.
Code snippet follows.
Thanks & regards
Ravi
status = RpcServerUseProtseq((unsigned char *)pszProtocolSequence,
cMaxCalls, pszSecurity) ;
if(status) exit(status) ;
// Register the interface with the RPC run time.
status = RpcServerRegisterIf(INTERFACENAME_v1_0_s_ifspec, NULL, NULL) ;
if(status) exit(status) ;
// Collect the bindings provided by the RPC run time.
status = RpcServerInqBindings(&pBindingVec) ;
if(status) exit(status) ;
// Clear the endpoints out of the binding handles.
// This forces the clients through the Endpoint Mapper and
// reduces the volatility of the namespace entry for this
// service.
for (int i = 0; i < pBindingVec->Count; i++)
RpcBindingReset(pBindingVec->BindingH[i]);
// Create the entry in the name service for this service.
status = RpcNsBindingExport( RPC_C_NS_SYNTAX_DCE, (unsigned char
*)pszEntryName, INTERFACENAME_v1_0_s_ifspec, pBindingVec, NULL );
if(status) exit(status);
// Register the interface with the Endpoint Mapper.
// There are no Object UUIDs or Annotation strings in this example.
status = RpcEpRegister(INTERFACENAME_v1_0_s_ifspec, pBindingVec, NULL,
NULL);
// Start the server. RpcServerListen returns when the server shuts down.
if (status) exit(status) ;