26 Aug 2011 01:20
Re: Passing address of pointer
Luís Oliveira <luismbo <at> gmail.com>
2011-08-25 23:20:44 GMT
2011-08-25 23:20:44 GMT
Hello Frank,
On Thu, Aug 25, 2011 at 6:19 PM, Frank Goenninger <frgo <at> me.com> wrote:
> In the sample code from Apple the C function is called like this:
>
> typedef struct MyPrivateData {
> io_object_t notification;
> IOUSBDeviceInterface **deviceInterface;
> CFStringRef deviceName;
> UInt32 locationID;
> } MyPrivateData;
Why is deviceInterface a pointer to a pointer?
> IOCFPlugInInterface **plugInInterface = NULL;
> SInt32 score;
> HRESULT res;
>
> res = (*plugInInterface)->QueryInterface( plugInInterface,
> CFUUIDGetUUIDBytes( kIOUSBDeviceInterfaceID ),
> (LPVOID*) &privateDataRef->deviceInterface );
--
--
Luís Oliveira
http://r42.eu/~luis/
RSS Feed