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

Matthias Bolte matthias.bolte at googlemail.com
Fri Dec 17 22:23:41 UTC 2010


2010/12/17 Eric Blake <eblake at redhat.com>:
> 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.
>

I addressed the two comments and pushed it, thanks.

Matthias




More information about the libvir-list mailing list