RpcNsBindingUnexport  I_VVWV

The RpcNsBindingUnexport function removes the binding handles for an interface and objects from an entry in the name-service database.

This function is supported by both 32-bit platforms   Windows NT and Windows 95.

#include <rpc.h>

RPC_STATUS RPC_ENTRY RpcNsBindingUnexport(

    unsigned long  EntryNameSyntax,

 

    unsigned char *  EntryName,

 

    RPC_IF_HANDLE  IfSpec,

 

    UUID_VECTOR *  ObjectUuidVec

 

   );

 

 

Parameters

EntryNameSyntax

Specifies an unsigned long value that indicates the syntax of the next argument, EntryName.

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.

EntryName

Points to the entry name from which to remove binding handles and object UUIDs.

IfSpec

Specifies an interface. A null argument value indicates not to unexport any binding handles (only object UUIDs are to be unexported).

ObjectUuidVec

Points to a vector of object UUIDs that the server no longer wants to offer. The application constructs this vector. A null argument value indicates there are no object UUIDs to unexport (only binding handles are to be unexported).

 

Remarks

The RpcNsBindingUnexport routine allows a server application to remove the following from a name-service database entry:

    All the binding handles for a specific interface

    One or more object UUIDs of resources

    Both the binding handles and object UUIDs of resources

 

The RpcNsBindingUnexport routine unexports only the binding handles that match the interface UUID and the major and minor interface version numbers found in the IfSpec argument.

A server application can unexport the specified interface and objects in a single call to RpcNsBindingUnexport, or it can unexport them separately.

If RpcNsBindingUnexport does not find any binding handles for the specified interface, the routine returns an RPC_S_INTERFACE_NOT_FOUND status code and does not unexport the object UUIDs, if any were specified.

If one or more binding handles for the specified interface are found and unexported without error, RpcNsBindingUnexport unexports the specified object UUIDs, if any.

If any of the specified object UUIDs were not found, RpcNsBindingUnexport returns the RPC_S_NOT_ALL_OBJS_UNEXPORTED status code.

In addition to calling RpcNsBindingUnexport, a server should also call the RpcEpUnregister routine to unregister the endpoints the server previously registered with the local endpoint-map database.

A server entry must have at least one binding handle to exist. As a result, exporting only UUIDs to a non-existing entry has no effect, and unexporting all binding handles deletes the entry.

Use RpcNsBindingUnexport judiciously. To keep an automatically activated server available, you must leave its binding handles in the name-service database between the times when server processes are activated. Therefore, reserve this routine for when you expect a server to be unavailable for an extended time   for example, when it is being permanently removed from service.

 

Note  Name-service databases are designed to be relatively stable. In replicated name-service databases, frequent use of the RpcNsBindingExport and RpcNsBindingUnexport routines causes the name-service database to repeatedly remove and replace the same entry and can cause performance problems.

 

Return Values

Value

Meaning

RPC_S_OK

Success

RPC_S_INVALID_VERS_OPTION

Invalid version option

RPC_S_NOTHING_TO_UNEXPORT

Nothing to unexport

RPC_S_INVALID_NAME_SYNTAX

Invalid name syntax

RPC_S_UNSUPPORTED_NAME_SYNTAX

Unsupported name syntax

RPC_S_INCOMPLETE_NAME

Incomplete name

RPC_S_ENTRY_NOT_FOUND

Name-service entry not found

RPC_S_NAME_SERVICE_UNAVAILABLE

Name service unavailable

RPC_S_INTERFACE_NOT_FOUND

Interface not found

RPC_S_NOT_ALL_OBJS_UNEXPORTED

Not all objects unexported

 

See Also

RpcEpUnregister, RpcNsBindingExport