VirtualBox

Changeset 56822 in vbox


Ignore:
Timestamp:
Jul 6, 2015 3:26:34 PM (10 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
101473
Message:

Main/HostUSBdevice: added USB device aliases dictionary and script to update the dictionary

Location:
trunk/src/VBox/Main
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/Makefile.kmk

    r56085 r56822  
    453453        src-server/USBDeviceFilterImpl.cpp \
    454454        src-server/USBProxyService.cpp \
    455         src-server/HostUSBDeviceImpl.cpp
     455        src-server/HostUSBDeviceImpl.cpp\
     456        src-server/USBDevAliases.cpp
    456457 VBoxSVC_SOURCES.darwin  +=  src-server/darwin/USBProxyServiceDarwin.cpp
    457458 VBoxSVC_SOURCES.linux   +=   src-server/linux/USBProxyServiceLinux.cpp
  • trunk/src/VBox/Main/src-server/HostUSBDeviceImpl.cpp

    r53297 r56822  
    55
    66/*
    7  * Copyright (C) 2005-2014 Oracle Corporation
     7 * Copyright (C) 2005-2015 Oracle Corporation
    88 *
    99 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    3030#include <VBox/err.h>
    3131#include <iprt/cpp/utils.h>
     32#include "USBDevAliases.h"
    3233
    3334// constructor / destructor
     
    167168
    168169    aManufacturer = mUsb->pszManufacturer;
    169 
     170    if (mUsb->pszManufacturer == NULL || mUsb->pszManufacturer[0] == 0)
     171    {
     172        USBNameAlias* alias = USBDevTableAdapter::findAlias(mUsb->idVendor, mUsb->idProduct);
     173        if (alias != NULL)
     174        {
     175            aManufacturer = alias->vendor;
     176        }
     177    }
    170178    return S_OK;
    171179}
     
    177185
    178186    aProduct = mUsb->pszProduct;
    179 
     187    if (mUsb->pszProduct == NULL || mUsb->pszProduct[0]== 0)
     188    {
     189        USBNameAlias* alias = USBDevTableAdapter::findAlias(mUsb->idVendor, mUsb->idProduct);
     190        if (alias != NULL)
     191        {
     192            aProduct = alias->product;
     193        }
     194    }
    180195    return S_OK;
    181196}
     
    328343        name = Utf8StrFmt("%s", mUsb->pszProduct);
    329344    else
    330         name = "<unknown>";
    331 
     345    {
     346        USBNameAlias* alias = USBDevTableAdapter::findAlias(mUsb->idVendor, mUsb->idProduct);
     347        if (alias == NULL)
     348        {
     349            name = "<unknown>";
     350            LogRel(("USB: Unknown USB device detected ( idVendor: 0x%04x, idProduct: 0x%04x ). \
     351                    Please, report the idVendor and idProduct to vbox.org.\n", mUsb->idVendor, mUsb->idProduct));
     352        }
     353        else
     354        {
     355            name = Utf8StrFmt("%s %s", alias->vendor, alias->product);
     356        }
     357    }
    332358    return name;
    333359}
Note: See TracChangeset for help on using the changeset viewer.

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