描述:
这里的大大,有谁对类似这样的 RPC API 比较熟悉的
NdrConformantArrayMarshall
NdrProxySendReceive
NdrXXXXXXXXXX....
.......
.......
我想了解,在什么样的情况下,会用到这样的 RPC API ,
最好有个简单的例子模板,不知道大大们对这些有没有研究了。。。
实在是没办法了。。
活生生找了两天的资料,没看到一篇是讲这些的,都快疯了。。。。
解决方案1:
msdn的rpc主題 帶了sample的
Platform SDK: Remote Procedure Call
Examples
The Platform SDK includes examples that demonstrate a variety of Remote Procedure Call (RPC) concepts, as follows:
ASYNCRPC illustrates the structure of an RPC application that uses asynchronous remote procedure calls. It also demonstrates various methods of notification of the call's completion.
CALLBACK demonstrates use of the [callback] attribute.
CLUUID demonstrates use of the client-object UUID to enable a client to select from multiple implementations of a remote procedure.
DATA directory contains four programs: DUNION illustrates discriminated (nonencapsulated) unions; INOUT demonstrates [in, out] parameters; REPAS demonstrates the [represent_as] attribute; XMIT demonstrates the [transmit_as] attribute.
DICT is a remote splay tree-based dictionary program that uses the [implicit_handle], [context_handle], [in] attribute, and [out] attribute.
DOCTOR is an RPC psychotherapy application that demonstrates arrays, strings, and the [size_is] attribute.
DYNEPT demonstrates a client application managing its connection to the server through dynamic endpoints.
DYNOUT demonstrates how to allocate memory at a server for an n-byte object and pass it back to the client as an [out]-only parameter. The client then frees the memory. This technique allows the stub to call the server without knowing in advance how much data will be returned.
HANDLES directory contains three programs, AUTO, CXHNDL, USRDEF, which demonstrate [auto_handle], [context_handle], and generic (user-defined) handles, respectively.
HELLO is a client/server implementation of "Hello, world."
INTEROP demonstrates portability between Open Software Foundation–Distributed Computing Environment (OSF-DCE) and Microsoft? RPC.
MANDEL is a distributed fractal drawing program. It uses [ref] pointers, the [implicit_handle] attribute, and handle_t primitive types.
NS directory contains the NHELLO program, which demonstrates name service usage. The CDS directory contains the files that describe the gateway protocol to the DCE Cell Directory Service (CDS).
OBJECT directory contains two programs that demonstrate OLE custom interfaces. CALLAS uses the [call_as] attribute to transmit a nonremotable interface. OHELLO demonstrates correct reference counting and shutdown behavior for a multiple-use local server. OHELLO also demonstrates how to use the Windows registry functions to install a local server and a proxy DLL in the registry.
PICKLE directory contains two programs: PICKLP demonstrates data procedure serialization; PICKLT demonstrates data type serialization; both programs use the [encode] and [decode] attributes.
PIPES demonstrates the use of the pipe type constructor.
RPCSSM demonstrates the RPCSS memory management model.
RPCSVC demonstrates the implementation of a Windows NT?/Windows? 2000? service with RPC.
STROUT demonstrates how to allocate memory at a server for a two-dimensional object (an array of pointers) and pass it back to the client as an [out]-only parameter. The client then frees the memory. This technique allows the stub to call the server without knowing in advance how much data will be returned.
This program also allows the user to compile either for UNICODE or ANSI.
You can browse through most of these files in Reference/Code Samples/NETDS/RPC in the Platform SDK. All of the source files and makefiles for these programs are located in the SDK at mstools\samples\rpc.
Platform SDK Release: August 2001 What did you think of this topic?
Let us know. Order a Platform SDK CD Online
(U.S/Canada) (International)