
RpcNsBindingLookupBegin SOMETIMES fails
I need to fix with some legacy code that uses RPC calls. When server
program is first started it sometimes fails in the following code:
EntryName[MAX_COMPUTERNAME_LENGTH + 5] = {"/.:/"};
GetComputerName(szCompName, &nSize))
strcat(EntryName, szCompName);
status = RpcNsBindingLookupBegin(RPC_C_NS_SYNTAX_DEFAULT,
EntryName, Recipe_Transfer_ServerIfHandle, NULL, 0, &LookupContext);
If the call fails status will be RPC_S_NAME_SERVICE_UNAVAILABLE or
RPC_S_ENTRY_NOT_FOUND. I have checked and the computer name looks good.
In frustration I substituted a nonsense name after the call to
GetComputerName it seemed to word better.
I can find no rhyme or reason to when or why RpcNsBindingLookupBegin
fails. If the program gets past this call every thing works fine.
Thanks In Advance.
Chris