The RpcNsProfileEltAdd function adds an element to a profile. If necessary, it creates the entry.
#include <rpc.h>
RPC_STATUS RPC_ENTRY RpcNsProfileEltAdd(
unsigned long ProfileNameSyntax,
unsigned char * ProfileName,
RPC_IF_ID * IfId,
unsigned long MemberNameSyntax,
unsigned char * MemberName,
unsigned long Priority,
unsigned char * Annotation
);
To use the syntax specified in the registry value HKEY_LOCAL_MACHINE\Software\Microsoft\Rpc\NameService\
DefaultSyntax, provide a value of RPC_C_NS_SYNTAX_DEFAULT.
To use the syntax specified in the registry value HKEY_LOCAL_MACHINE\Software\Microsoft\Rpc\NameService\
DefaultSyntax, provide a value of RPC_C_NS_SYNTAX_DEFAULT.
When adding a default profile member, use a value of 0.
The string is used by applications for informational purposes only. For example, an application can use this string to store the interface-name string specified in the IDL file.
RPC does not use the annotation string during "lookup" or "import" operations or for enumerating profile elements.
Note The Windows NT 5.0 Active Directory Service supports this function. Support is not available from the Microsoft Locator in earlier versions of NT.
The RpcNsProfileEltAdd routine adds an element to the profile attribute of the name-service entry specified by the ProfileName argument.
If the ProfileName entry does not exist, RpcNsProfileEltAdd tries to create the entry with a profile attribute and adds the profile element specified by the IfId, MemberName, Priority, and Annotation arguments. In this case, the application must have the privilege to create the entry. Otherwise, a management application with the necessary privileges should create the entry by calling the RpcNsMgmtEntryCreate routine before the application is run.
If an element with the specified member name and interface identification is already in the profile, RpcNsProfileEltAdd updates the element's priority and annotation string using the values provided in the Priority and Annotation arguments.
Value | Meaning |
---|---|
RPC_S_OK | Success |
RPC_S_INVALID_NAME_SYNTAX | Invalid name syntax |
RPC_S_UNSUPPORTED_NAME_SYNTAX | Unsupported name syntax |
RPC_S_INCOMPLETE_NAME | Incomplete name |
RPC_S_NAME_SERVICE_UNAVAILABLE | Name service unavailable |
Windows NT: Yes
Windows CE: Unsupported.
Header: Declared in rpcnsi.h.
Import Library: Link with rpcns4.lib.
RpcIfInqId, RpcNsMgmtEntryCreate, RpcNsProfileEltRemove