RpcBindingToStringBindingA function (rpcdce.h)

The RpcBindingToStringBinding function returns a string representation of a binding handle.

Syntax

RPC_STATUS RpcBindingToStringBindingA(
  RPC_BINDING_HANDLE Binding,
  RPC_CSTR           *StringBinding
);

Parameters

Binding

Client or server binding handle to convert to a string representation of a binding handle.

StringBinding

Returns a pointer to a pointer to the string representation of the binding handle specified in the Binding parameter.

Specify a null value to prevent RpcBindingToStringBinding from returning the StringBinding parameter. In this case, the application does not call the RpcStringFree function.

Return value

Value Meaning
RPC_S_OK
The call succeeded.
RPC_S_INVALID_BINDING
The binding handle was invalid.
 
Note  For a list of valid error codes, see RPC Return Values.
 

Remarks

The RpcBindingToStringBinding function converts a client or server binding handle to its string representation.

The RPC run-time library allocates memory for the string returned in the StringBinding parameter. The application is responsible for calling the RpcStringFree function to deallocate that memory.

If the binding handle in the Binding parameter contained a nil object UUID, the object UUID field is not included in the returned string.

To parse the returned StringBinding parameter, call the RpcStringBindingParse function.

Note  To query a client's address, an application starts by calling the RpcBindingServerFromClient function to obtain a partially bound server binding handle. The server binding handle can be used to obtain a string binding by invoking RpcBindingToStringBinding. The server can then call RpcStringBindingParse to extract the client's network address from the string binding.
 

Note

The rpcdce.h header defines RpcBindingToStringBinding as an alias that automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that is not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps | UWP apps]
Minimum supported server Windows 2000 Server [desktop apps | UWP apps]
Target Platform Windows
Header rpcdce.h (include Rpc.h)
Library Rpcrt4.lib
DLL Rpcrt4.dll

See also

RpcBindingFromStringBinding

RpcStringBindingParse

RpcStringFree