RpcNsProfileEltAdd  9TD1_JO

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

 

   );

 

 

Parameters

ProfileNameSyntax

Specifies an integer value that indicates the syntax of the next argument, ProfileName.

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.

ProfileName

Points to the name of the profile to receive a new element.

IfId

Points to the interface identification of the new profile element. To add or replace the default profile element, specify a null value.

MemberNameSyntax

Specifies an integer value that indicates the syntax of the next argument, MemberName.

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.

MemberName

Points to a name-service entry name to include in the new profile element.

Priority

Specifies an integer value (0 through 7) that indicates the relative priority for using the new profile element during the  import  and  lookup  operations. A value of 0 is the highest priority; a value of 7 is the lowest priority.

When adding a default profile member, use a value of 0.

Annotation

Points to an annotation string stored as part of the new profile element. The string can be up to 17 characters long. Specify a null value or a null-terminated string if there is no annotation string.

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.

 

Remarks

 

Note  This DCE function is not supported by the Microsoft Locator.

 

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.

Return Values

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

 

See Also

RpcIfInqId, RpcNsMgmtEntryCreate, RpcNsProfileEltRemove