OPC 关于 COM 内存管理的说明

来源:互联网 发布:吉林师范大学网络 编辑:程序博客网 时间:2024/06/07 18:55

转自《OPC HDA 1.20 Specification》 P42

 

[in] something* means "The client will pass the address of a something that he allocated (by any
means he wishes) and the server may look at it but may not change it."
[out] something* means "The client will pass the address of a something that he allocated (by any
means he wishes) and the server may not look at it, the server can only write to it."
[in,out] something* means "The client will pass the address of a something that he allocated (by any
means he wishes) and the server may both look at and change it."
[in] something** is not used.
[out] something** means "The client will pass the address of a (something*), allocated by any means
he wishes, and the server will use CoTaskMemAlloc to allocate a new "something" and store its
address there."
[in,out] something** means "The client will allocate a "something" via CoTaskMemAlloc and pass the
address of a pointer to it.  [The pointer variable can be allocated anywhere.]  The server may free the
"something*" via CoTaskMemFree and allocate a new "something" via CoTaskMemAlloc.  The server
will place the address of the allocated memory into the parameter and return it to the client."

原创粉丝点击