VirtualBox

Changeset 48930 in vbox


Ignore:
Timestamp:
Oct 7, 2013 7:20:52 PM (11 years ago)
Author:
vboxsync
Message:

OS X host: leds sync: hopefully fixed GUI SEGFAULT if using old IOKit framework.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/platform/darwin/DarwinKeyboard.cpp

    r48888 r48930  
    2222*******************************************************************************/
    2323#define LOG_GROUP LOG_GROUP_GUI
    24 //#define VBOX_WITH_KBD_LEDS_SYNC
     24#define VBOX_WITH_KBD_LEDS_SYNC
    2525
    2626#include "DarwinKeyboard.h"
     
    11851185                                                       &kCFTypeDictionaryValueCallBacks);
    11861186
     1187            if (deviceMatchingDictRef)
     1188            {
     1189                CFRelease(usageKeyCFNumberRef);
     1190                CFRelease(usagePageKeyCFNumberRef);
     1191
     1192                return deviceMatchingDictRef;
     1193            }
     1194
    11871195            CFRelease(usageKeyCFNumberRef);
    1188             CFRelease(usagePageKeyCFNumberRef);
    1189 
    1190             return deviceMatchingDictRef;
    11911196        }
    11921197
     
    12201225                                                    &kCFTypeDictionaryValueCallBacks);
    12211226
     1227        if (elementMatchingDictRef)
     1228        {
     1229            CFRelease(usagePageKeyCFNumberRef);
     1230            return elementMatchingDictRef;
     1231        }
     1232
    12221233        CFRelease(usagePageKeyCFNumberRef);
    1223         return elementMatchingDictRef;
    12241234    }
    12251235
     
    12841294    int        rc2 = 0;
    12851295
    1286     matchingElementsArrayRef = IOHIDDeviceCopyMatchingElements(hidDevice, elementMatchingDict, 0);
     1296    matchingElementsArrayRef = IOHIDDeviceCopyMatchingElements(hidDevice, elementMatchingDict, kIOHIDOptionsTypeNone);
    12871297    if (matchingElementsArrayRef)
    12881298    {
     
    13301340    int        rc2 = 0;
    13311341
    1332     matchingElementsArrayRef = IOHIDDeviceCopyMatchingElements(hidDevice, elementMatchingDict, 0);
     1342    matchingElementsArrayRef = IOHIDDeviceCopyMatchingElements(hidDevice, elementMatchingDict, kIOHIDOptionsTypeNone);
    13331343    if (matchingElementsArrayRef)
    13341344    {
     
    14841494    uint32_t  vendorId = 0;
    14851495
    1486     pNumberRef = IOHIDDeviceGetProperty(pHidDeviceRef, CFSTR(kIOHIDVendorIDKey));
    1487     if (pNumberRef)
    1488     {
    1489         if (CFGetTypeID(pNumberRef) == CFNumberGetTypeID())
    1490         {
    1491             if (CFNumberGetValue((CFNumberRef)pNumberRef, kCFNumberSInt32Type, &vendorId))
     1496    if (pHidDeviceRef)
     1497    {
     1498        pNumberRef = IOHIDDeviceGetProperty(pHidDeviceRef, CFSTR(kIOHIDVendorIDKey));
     1499        if (pNumberRef)
     1500        {
     1501            if (CFGetTypeID(pNumberRef) == CFNumberGetTypeID())
    14921502            {
    1493                 switch (vendorId)
     1503                if (CFNumberGetValue((CFNumberRef)pNumberRef, kCFNumberSInt32Type, &vendorId))
    14941504                {
    1495                     case kIOUSBVendorIDAppleComputer:   /** Apple devices always in the list */
    1496                     case 0x03F0:                        /** Hewlett-Packard (verified with model KU-0316) */
    1497                         fSupported = true;
    1498                         break;
     1505                    switch (vendorId)
     1506                    {
     1507                        case kIOUSBVendorIDAppleComputer:   /** Apple devices always in the list */
     1508                        case 0x03F0:                        /** Hewlett-Packard (verified with model KU-0316) */
     1509                            fSupported = true;
     1510                            break;
     1511                    }
     1512
     1513                    Log2(("HID device Vendor ID 0x%X %s in the list of supported devices.\n", vendorId, (fSupported ? "is" : "is not")));
    14991514                }
    1500 
    1501                 Log2(("HID device Vendor ID 0x%X %s in the list of supported devices.\n", vendorId, (fSupported ? "is" : "is not")));
    15021515            }
    1503         }
    1504 
    1505         CFRelease(pNumberRef);
     1516
     1517            //CFRelease(pNumberRef);
     1518        }
    15061519    }
    15071520
     
    15211534    if (hidsState)
    15221535    {
    1523         hidsState->hidManagerRef = IOHIDManagerCreate(kCFAllocatorDefault, 0);
     1536        hidsState->hidManagerRef = IOHIDManagerCreate(kCFAllocatorDefault, kIOHIDOptionsTypeNone);
    15241537        if (hidsState->hidManagerRef)
    15251538        {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette