[libvirt] [PATCH 4/6] vbox: Handle different array representations of XPCOM and MSCOM

Eric Blake eblake at redhat.com
Fri Dec 17 20:29:11 UTC 2010


On 12/17/2010 11:56 AM, Matthias Bolte wrote:
> Add a vboxArray to hide the details from the general driver code.
> ---
>  src/vbox/vbox_MSCOMGlue.c  |  107 +++++++++++
>  src/vbox/vbox_MSCOMGlue.h  |   15 ++
>  src/vbox/vbox_XPCOMCGlue.c |  115 ++++++++++++
>  src/vbox/vbox_XPCOMCGlue.h |   14 ++
>  src/vbox/vbox_tmpl.c       |  445 +++++++++++++++++++-------------------------
>  5 files changed, 447 insertions(+), 249 deletions(-)
> 
> diff --git a/src/vbox/vbox_MSCOMGlue.c b/src/vbox/vbox_MSCOMGlue.c
> index 81a2c99..ded1275 100644
> --- a/src/vbox/vbox_MSCOMGlue.c
> +++ b/src/vbox/vbox_MSCOMGlue.c
> @@ -647,3 +647,110 @@ void
>  VBoxCGlueTerm(void)
>  {
>  }
> +
> +
> +
> +/*
> + * In MSCOM an array is represented by a SAFEARRAY pointer. To access the items
> + * in the array the SafeArrayAccessData function is used to lock the array and
> + * get its contents. When the items aren't needed anymore the
> + * SafeArrayUnaccessData function is used to unlock the array. The pointer
> + * retuned by SafeArrayAccessData function get's invalid. Finally the

s/get's/becomes/

> + * SafeArrayDestroy function is called to destroy the array, it also releases
> + * or frees all items in the array according to their type.
> + */
> +
> +typedef HRESULT __stdcall (*SaveArrayGetter)(void *self, SAFEARRAY **array);
> +typedef HRESULT __stdcall (*SaveArrayGetterWithArg)(void *self, void *arg, SAFEARRAY **array);

Perhaps s/SaveArrayGetter/SafeArrayGetter/g?

But it looks like a good wrapper, as well as a mechanical change to
implement its use.

ACK.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20101217/6e05e224/attachment-0001.sig>


More information about the libvir-list mailing list