Commit fef170af authored by David Lawrie's avatar David Lawrie Committed by Alexandre Julliard

dinput: Print location ID in debugstr_device on the Mac.

parent b69b9a6e
...@@ -175,6 +175,30 @@ static HRESULT osx_to_win32_hresult(HRESULT in) ...@@ -175,6 +175,30 @@ static HRESULT osx_to_win32_hresult(HRESULT in)
return in; return in;
} }
static long get_device_property_long(IOHIDDeviceRef device, CFStringRef key)
{
CFTypeRef ref;
long result = 0;
if (device)
{
assert(IOHIDDeviceGetTypeID() == CFGetTypeID(device));
ref = IOHIDDeviceGetProperty(device, key);
if (ref && CFNumberGetTypeID() == CFGetTypeID(ref))
CFNumberGetValue((CFNumberRef)ref, kCFNumberLongType, &result);
}
return result;
}
static long get_device_location_ID(IOHIDDeviceRef device)
{
return get_device_property_long(device, CFSTR(kIOHIDLocationIDKey));
}
static void CFSetApplierFunctionCopyToCFArray(const void *value, void *context) static void CFSetApplierFunctionCopyToCFArray(const void *value, void *context)
{ {
CFArrayAppendValue( ( CFMutableArrayRef ) context, value ); CFArrayAppendValue( ( CFMutableArrayRef ) context, value );
...@@ -212,8 +236,9 @@ static const char* debugstr_cf(CFTypeRef t) ...@@ -212,8 +236,9 @@ static const char* debugstr_cf(CFTypeRef t)
static const char* debugstr_device(IOHIDDeviceRef device) static const char* debugstr_device(IOHIDDeviceRef device)
{ {
return wine_dbg_sprintf("<IOHIDDevice %p product %s>", device, return wine_dbg_sprintf("<IOHIDDevice %p product %s IOHIDLocationID %lu>", device,
debugstr_cf(IOHIDDeviceGetProperty(device, CFSTR(kIOHIDProductKey)))); debugstr_cf(IOHIDDeviceGetProperty(device, CFSTR(kIOHIDProductKey))),
get_device_location_ID(device));
} }
static const char* debugstr_element(IOHIDElementRef element) static const char* debugstr_element(IOHIDElementRef element)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment