大网数据广告活动
网络与域名解析

Explicit Binding Handles

· 52CE 我爱测

For maximum control over the binding process, client/server applications may use explicit binding handles.

For maximum control over the binding process, client/server applications may use explicit binding handles. Like implicit handles, explicit binding handles enable your client application to select a server to execute its calls. In addition, explicit binding handles enable your client/server application to create an authenticated RPC communication session. With explicit handles, your client can connect to more than one server and execute remote procedures on multiple servers. Multithreaded and asynchronous client applications can even connect to multiple servers and execute multiple remote procedures at the same time.

Your client application must pass the explicit handle as a parameter to each remote procedure call. To conform to the OSF standard, the handle should be specified as the first parameter on each remote procedure. However, the Microsoft extensions to RPC enable you to specify the binding handle in other positions. For more information, see Microsoft RPC Binding-Handle Extensions.

To create an explicit handle, declare the handle as a parameter to the remote operations in the IDL file. The Hello, World example can be redefined to use an explicit handle as shown:

/* IDL file for explicit handles */
 
[ 
  uuid(20B309B1-015C-101A-B308-02608C4C9B53),
  version(1.0) 
]
interface hello
{
  void HelloProc([in] handle_t h1,
                 [in, string] char *  pszString); 
}

You can combine explicit and implicit handles in a single interface. If a function has an explicit handle in its parameter list, that handle will be used. If a function in an interface using implicit handles does not specify an explicit handle, then the default implicit handle will be used.

Source: Microsoft Learn / Windows Win32 documentation by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / Windows Win32 documentation
适用范围
Windows Win32 API · Source date 05/31/2018
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。