Passing address of pointer
2011-08-25 17:19:41 GMT
Hi all,
I have a C struct as follows:
(defcstruct MyPrivateData
(notification io_object_t)
(deviceInterface :pointer) ;; void pointer
(deviceName CFStringRef)
(locationID UInt32))
of which the deviceInterface slot is the one I'm interested in. I need to pass the address of the
deviceInterface pointer to a function that sets the pointer to valid device interface struct.
So...
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;
IOCFPlugInInterface **plugInInterface = NULL;
SInt32 score;
HRESULT res;
res = (*plugInInterface)->QueryInterface( plugInInterface,
CFUUIDGetUUIDBytes( kIOUSBDeviceInterfaceID ),
(Continue reading)
RSS Feed