亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cdevice.cpp

?? Latest USB 802.3, HID printer and mass storage divers from Microsoft for Platform Builder 4.2.
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
        TEXT("ISOCHRONOUS"),
        TEXT("BULK"),
        TEXT("INTERRUPT")
    };
    DEBUGCHK( pDescriptor != NULL );
    DEBUGMSG( ZONE_DESCRIPTORS, (TEXT("+Dump USB_ENDPOINT_DESCRIPTOR\n")) );
    DEBUGMSG( ZONE_DESCRIPTORS, (TEXT("\tbLength = 0x%02x\n"), pDescriptor->bLength ));
    DEBUGMSG( ZONE_DESCRIPTORS, (TEXT("\tbDescriptorType = 0x%02x\n"), pDescriptor->bDescriptorType ));
    DEBUGMSG( ZONE_DESCRIPTORS, (TEXT("\tbEndpointAddress = 0x%02x\n"), pDescriptor->bEndpointAddress ));
    DEBUGMSG( ZONE_DESCRIPTORS, (TEXT("\t\tbEndpointAddress, endpoint # = %d\n"), pDescriptor->bEndpointAddress & TD_ENDPOINT_MASK ));
    DEBUGMSG( ZONE_DESCRIPTORS, (TEXT("\t\tbEndpointAddress, direction = %s\n"), (USB_ENDPOINT_DIRECTION_IN(pDescriptor->bEndpointAddress) ? TEXT("IN") : TEXT("OUT")) ));
    DEBUGMSG( ZONE_DESCRIPTORS, (TEXT("\tbmAttributes = 0x%02x\n"), pDescriptor->bmAttributes ));
    DEBUGCHK( (pDescriptor->bmAttributes & USB_ENDPOINT_TYPE_MASK) < 4 );
    DEBUGMSG( ZONE_DESCRIPTORS, (TEXT("\t\tbmAttributes, endpoint type = %s\n"), cszEndpointTypes[ pDescriptor->bmAttributes & USB_ENDPOINT_TYPE_MASK ] ));
    DEBUGMSG( ZONE_DESCRIPTORS, (TEXT("\twMaxPacketSize = 0x%04x\n"), pDescriptor->wMaxPacketSize ));
    DEBUGMSG( ZONE_DESCRIPTORS, (TEXT("\tbInterval = 0x%02x\n"), pDescriptor->bInterval ));
    DEBUGMSG( ZONE_DESCRIPTORS, (TEXT("-Dump USB_ENDPOINT_DESCRIPTOR\n")) );
}
#endif // DEBUG

#ifdef DEBUG
// ******************************************************************
void CDevice::DumpExtendedBytes( IN const PBYTE pByteArray, IN const DWORD dwSize ) const
//
// Purpose: print out the bytes of pByteArray
//
// Parameters: pByteArray - array of extended bytes for a descriptor
//
//             dwSize - number of entries in pByteArray
//
// Returns: Nothing.
//
// Notes: Used in debug mode only
// ******************************************************************
{
    DEBUGCHK( pByteArray != NULL && dwSize > 0 );
    DEBUGMSG( ZONE_DESCRIPTORS, (TEXT("+Dump extended bytes, size = %d\n"), dwSize) );
    for ( DWORD dwPrinted = 0; dwPrinted < dwSize; dwPrinted += 4 ) {
        DWORD dwFourBytes = 0;
        for ( UCHAR index = 0; index < 4; index++  ) {
            dwFourBytes <<= 8;
            if ( dwPrinted + index < dwSize ) {
                dwFourBytes |= pByteArray[ dwPrinted + index ];
            }
        }
        DEBUGMSG( ZONE_DESCRIPTORS, (TEXT("\tBytes %d to %d = 0x%08x\n"), dwPrinted + 1, dwPrinted + 4, dwFourBytes ) );
    }
    DEBUGMSG( ZONE_DESCRIPTORS, (TEXT("-Dump extended bytes, size = %d\n"), dwSize) );
}
#endif // DEBUG

// ******************************************************************
CHub::CHub( IN const UCHAR address,
            IN const USB_DEVICE_INFO& rDeviceInfo,
            IN const BOOL fIsLowSpeed,
            IN const UCHAR tierNumber,
            IN const USB_HUB_DESCRIPTOR& rUsbHubDescriptor,
            IN CHcd * const pCHcd  )
//
// Purpose: Constructor for CHub
//
// Parameters: address, rDeviceInfo, fIsLowSpeed, tierNumber - see CDevice::CDevice
//
//             rUsbHubDescriptor - USB descriptor for a hub
//
// Returns: Nothing.
//
// Notes: Do not initialize static variables here. Do that in
//        the Initialize() routine
// ******************************************************************
: CDevice( address, rDeviceInfo, fIsLowSpeed, tierNumber,pCHcd  ) // call base class constructor
, m_pCHcd(pCHcd)
, m_usbHubDescriptor( rUsbHubDescriptor ) // USB descriptor of this hub
, m_ppCDeviceOnPort( NULL ) // dynamic array of pointers to the devices on this hub's ports
, m_fHubThreadClosing( FALSE )       // indicator to thread that it should close
, m_hHubStatusChangeEvent( NULL ) // event for hub status change thread
, m_hHubStatusChangeThread( NULL ) // checks for connect changes on the hub's ports
{
    DEBUGMSG( ZONE_HUB && ZONE_VERBOSE, (TEXT("+CHub::CHub\n")) );
    m_pDetachedDevice=NULL;
    m_pDetachedDeviceHandled = CreateEvent(NULL,TRUE,FALSE,NULL); // Manual Reset Event;
    DEBUGCHK( rDeviceInfo.Descriptor.bDeviceClass == USB_DEVICE_CLASS_HUB &&
              rUsbHubDescriptor.bDescriptorType == USB_HUB_DESCRIPTOR_TYPE &&
              rUsbHubDescriptor.bDescriptorLength >= USB_HUB_DESCRIPTOR_MINIMUM_SIZE &&
              rUsbHubDescriptor.bNumberOfPorts > 0 &&
              tierNumber <= USB_MAXIMUM_HUB_TIER );

    DEBUGMSG( ZONE_HUB && ZONE_VERBOSE, (TEXT("-CHub::CHub\n")) );
}

// ******************************************************************
CHub::~CHub( )
//
// Purpose: Destructor for CHub
//
// Parameters: None
//
// Returns: Nothing.
//
// Notes: Do not delete static variables here. Do that in
//        DeInitialize();
// ******************************************************************
{
    DEBUGMSG( ZONE_HUB && ZONE_VERBOSE, (TEXT("+CHub::~CHub\n")) );

    // this should have been taken care of in HandleDetach,
    // or if EnterOperationalState failed.
    DEBUGCHK( m_hHubStatusChangeEvent == NULL );
    DEBUGCHK( m_hHubStatusChangeThread == NULL );
    DEBUGCHK( m_pDetachedDevice == NULL);

#ifdef DEBUG
    if ( m_ppCDeviceOnPort != NULL ) {
        for ( UCHAR port = 1; port <= m_usbHubDescriptor.bNumberOfPorts; port++ ) {
            // devices should have been freed by HandleDetach
            DEBUGCHK( m_ppCDeviceOnPort[ port - 1 ] == NULL );
        }
    }
#endif // DEBUG
    delete [] m_ppCDeviceOnPort;
    m_ppCDeviceOnPort = NULL;
    if (m_pDetachedDeviceHandled)
        CloseHandle(m_pDetachedDeviceHandled );

    // nothing to do with m_usbHubDescriptor
    // nothing to do with m_fHubThreadClosing

    // rest of work done in ~CDevice

    DEBUGMSG( ZONE_HUB && ZONE_VERBOSE, (TEXT("-CHub::~CHub\n")) );
}


// ******************************************************************
DWORD CALLBACK CHub::HubStatusChangeThreadStub( IN PVOID context )
//
// Purpose: Stub function for starting HubStatusChangeThread
//
// Parameters: context - pointer to descendant of CHub which contains
//                       the actual HubStatusChangeThread function
//
// Returns: Return value of HubStatusChangeThread
//
// Notes:
// ******************************************************************
{
    return ((CHub*)context)->HubStatusChangeThread();
}
// ******************************************************************
DWORD CHub::HubStatusChangeThread( void )
//
// Purpose: Main hub thread for handling changes to the hub's ports
//
// Parameters: None
//
// Returns: 0 on thread exit
//
// Notes: This routine needs to work for both root/external hubs
// ******************************************************************
{
    DEBUGMSG( ZONE_HUB && ZONE_VERBOSE, (TEXT("+CHub(%s tier %d)::HubStatusChangeThread\n"), GetDeviceType(), m_tierNumber ) );
    DEBUGCHK( m_hHubStatusChangeEvent != NULL && m_hHubStatusChangeThread != NULL );

    UCHAR                       port;
    USB_HUB_AND_PORT_STATUS     hubStatus;
    BOOL                        fSuccess = FALSE;

    // before we can process port changes, we need
    // to power all ports
    while ( !m_fHubThreadClosing && !fSuccess) {
        fSuccess = PowerAllHubPorts();
    }
    if ( !m_fHubThreadClosing ) {
#if 0
        Sleep( 2 * m_usbHubDescriptor.bPowerOnToPowerGood );
#else
        // According to the USB spec 1.1, section 7.1.7.1, there
        // is supposed to be a delay of up to 100ms (t2) before the device
        // can signal attach. I don't know if the software is
        // supposed to implement this delay. No harm in implementing
        // it though.
        Sleep( 100 + 2 * m_usbHubDescriptor.bPowerOnToPowerGood );
#endif
    }
    SetOrClearRemoteWakup(TRUE);
    while ( !m_fHubThreadClosing ) {
        fSuccess = WaitForPortStatusChange( port, hubStatus );
        if ( m_fHubThreadClosing || !fSuccess ) {
            DEBUGMSG( ZONE_ERROR && !m_fHubThreadClosing, (TEXT("CHub(%s tier %d)::HubStatusChangeThread - error reading port status change\n"), GetDeviceType(), m_tierNumber ));
            continue; // loop will exit if m_fHubThreadClosing is set
        }
        // we will get here if the status of port # "port" has changed.
        // the status information will be in "hubStatus"
        DEBUGCHK( port <= m_usbHubDescriptor.bNumberOfPorts );
        DEBUGMSG( ZONE_ATTACH, (TEXT("CHub(%s tier %d)::HubStatusChangeThread - port %d, change = 0x%04x, status = 0x%04x\n"), GetDeviceType(), m_tierNumber, port, hubStatus.change.word, hubStatus.status.word ) );
        // todo - what if the change is for the hub itself?
        DEBUGCHK( port > 0 ); // port == 0 is the hub

        if ( port > 0 && hubStatus.change.port.OverCurrentChange ) {
            if ( hubStatus.status.port.PortOverCurrent ) {
                RETAILMSG(1, (TEXT("CHub(tier %d)::HubStatusChangeThread - addr %d port %d over current!\n"),
                              m_tierNumber, m_address, port));
                DetachDevice( port );
#if 1   // the "correct" thing to do, according to my reading of the USB spec
                SetOrClearFeature( port, USB_REQUEST_CLEAR_FEATURE, USB_HUB_FEATURE_PORT_POWER );
#else   // another approach
                do {
                    Sleep( 500 );
                    GetStatus( port, hubStatus );
                } while (hubStatus.status.port.PortOverCurrent && !m_fHubThreadClosing);
                hubStatus.change.port.ConnectStatusChange = 1;
#endif
            } else {
                // port is no longer over current - pretend this is a normal attach
                // simulate a connect status change. this has the undesirable but basically harmless
                // side effect of wasting 100 ms to needlessly debounce the power rail.
                hubStatus.change.port.ConnectStatusChange = 1;
            }
        }
        if ( port == 0 && hubStatus.change.hub.OverCurrentIndicatorChange ) {
            if ( hubStatus.status.hub.OverCurrentIndicator ) {
                RETAILMSG(1, (TEXT("CHub(tier %d)::HubStatusChangeThread - addr %d port %d over current!\n"),
                              m_tierNumber, m_address, port));
            } else {
                // hub is no longer over current - re-enumerate all ports
                // todo - re-enumerate all hub ports during hub over-current recovery
            }
        }

        if ( hubStatus.change.port.PortEnableChange &&
             !hubStatus.status.port.PortEnabled &&
             hubStatus.status.port.PortConnected ) {
            // Connected device has become disabled. If the device was
            // already successfully attached, let's try detach/reattach.
            // It is important to check that the device was successfully
            // attached - otherwise, we can get into an infinite loop
            // of try attach, fail, disable port, retry attach.
            BOOL fDeviceIsPresent;

            EnterCriticalSection( &m_csDeviceLock );
            DEBUGCHK( m_ppCDeviceOnPort != NULL );
            fDeviceIsPresent = ( m_ppCDeviceOnPort[ port - 1 ] != NULL );
            LeaveCriticalSection( &m_csDeviceLock );

            if ( fDeviceIsPresent ) {
                DEBUGMSG( ZONE_WARNING, (TEXT("CHub(%s tier %d)::HubStatusChangeThread - device on port %d is connected but has been disabled. Trying to detach & re-attach\n"), GetDeviceType(), m_tierNumber, port) );
                DetachDevice( port );
                // this will cause device attach below, since
                // hubStatus.status.port.PortConnected is already set
                hubStatus.change.port.ConnectStatusChange = 1;
                DEBUGCHK( hubStatus.status.port.PortConnected );
            }
        } // we can ignore all other enabled changes

        // now check for connect changes
        if ( hubStatus.change.port.ConnectStatusChange ) {
            EnterCriticalSection( &m_csDeviceLock );
            BOOL fDeviceAlreadyExists = (m_ppCDeviceOnPort[ port - 1 ] != NULL);
            LeaveCriticalSection( &m_csDeviceLock );

            // we got a connect status change notification on this port, so...
            if (fDeviceAlreadyExists) {
                // ... a change when the device is already here must be a detach;
                //     if there's still something connected then it must be new.
                DEBUGMSG( ZONE_ATTACH, (TEXT("CHub(%s tier %d)::HubStatusChangeThread - device detached on port %d\n"), GetDeviceType(), m_tierNumber, port ) );
                DetachDevice(port);
#ifdef DEBUG
                if ( hubStatus.status.port.PortConnected ) {
                    DEBUGMSG( (ZONE_WARNING && ZONE_VERBOSE) || ZONE_ATTACH,
                              (TEXT("CHub(%s tier %d)::HubStatusChangeThread -")
                               TEXT(" quick detach and re-attach on port %d\n"),
                               GetDeviceType(), m_tierNumber, port) );
                }
#endif // DEBUG
            }
            // ... a change with no device present must be an attach
            //     but section 7.1.7.1 of the USB 1.1 spec says we're

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久美女高清视频| 亚洲精品免费在线| 国产美女精品一区二区三区| 欧美日韩国产一级片| 青青草原综合久久大伊人精品| 99久久伊人网影院| 亚洲精品国产品国语在线app| 色综合天天性综合| 视频在线观看国产精品| 日韩欧美国产精品| 91在线视频免费91| 日本亚洲免费观看| 国产精品日产欧美久久久久| 91在线视频在线| 精品在线亚洲视频| 亚洲女与黑人做爰| 欧美岛国在线观看| 欧美日韩1234| 欧美日韩电影一区| 91麻豆123| 久久国产精品第一页| 久久久99久久精品欧美| 欧美日韩免费一区二区三区视频 | 色综合久久天天综合网| 亚洲国产综合人成综合网站| 色999日韩国产欧美一区二区| 三级在线观看一区二区| 亚洲欧美在线另类| 国产午夜亚洲精品不卡| 欧美一级视频精品观看| 99re这里都是精品| www.亚洲免费av| 成人深夜视频在线观看| 国产在线精品一区二区三区不卡 | 色香蕉久久蜜桃| 99精品一区二区| 色av成人天堂桃色av| 99久久久无码国产精品| a美女胸又www黄视频久久| 成人午夜激情视频| 99久久精品国产毛片| 欧美在线影院一区二区| 欧美日韩一区二区三区不卡| 一道本成人在线| 不卡一区二区在线| 91黄色激情网站| 欧美日韩日日夜夜| 久久久精品国产免大香伊| 国产精品色婷婷久久58| 亚洲国产精品影院| 国模套图日韩精品一区二区| 国产另类ts人妖一区二区| 成人深夜视频在线观看| 在线欧美小视频| 精品国产一区二区三区av性色| 777亚洲妇女| 国产精品夫妻自拍| 日韩国产欧美一区二区三区| 亚洲一级片在线观看| 亚洲精品视频在线看| 久久激情五月激情| 色婷婷久久久亚洲一区二区三区| 欧美一二三在线| 亚洲一区av在线| 色天天综合久久久久综合片| 亚洲精品一线二线三线| 亚洲gay无套男同| 91免费国产在线观看| 2023国产精品自拍| 欧美a级一区二区| 91精品国产欧美一区二区| 亚洲精品中文字幕乱码三区| 成熟亚洲日本毛茸茸凸凹| 欧美v亚洲v综合ⅴ国产v| 一区二区三区不卡视频在线观看| 极品少妇一区二区三区精品视频 | 久久久久久免费| 麻豆91精品视频| 欧美精品一区二区三区久久久| 亚洲欧美日韩国产另类专区| 久久精品国产亚洲高清剧情介绍 | 国产激情一区二区三区桃花岛亚洲| 欧美三级乱人伦电影| 亚洲va欧美va人人爽| 欧美日本一道本在线视频| 天天射综合影视| 欧美精品一区男女天堂| 国产精品自产自拍| 中文子幕无线码一区tr| 色综合欧美在线| 亚洲综合视频在线| 欧美日韩精品免费观看视频| 天天影视网天天综合色在线播放| 精品国产乱码久久久久久久| 精品在线你懂的| 亚洲精品成人悠悠色影视| 日韩精品专区在线影院观看| 国产在线观看免费一区| 国产精品第五页| 精品少妇一区二区三区视频免付费 | 亚洲国产精品一区二区尤物区| 91精品国产高清一区二区三区蜜臀| 麻豆91免费观看| 一区二区久久久| 国产欧美在线观看一区| 精品国产三级电影在线观看| 色综合久久久久综合体| 国产成人自拍网| 亚洲小说春色综合另类电影| 国产精品久久久久9999吃药| 欧美疯狂做受xxxx富婆| 色哦色哦哦色天天综合| 不卡一区中文字幕| 国产麻豆一精品一av一免费| 久久不见久久见中文字幕免费| 午夜精品久久久久| 亚洲国产精品一区二区久久 | 亚洲第一主播视频| 亚洲国产精品久久久久秋霞影院| 中文字幕av一区二区三区高| 久久亚洲综合av| 欧美日韩国产乱码电影| 精油按摩中文字幕久久| 亚瑟在线精品视频| 亚洲成人你懂的| 亚洲日本一区二区三区| 日韩一区在线播放| 国产精品国产三级国产aⅴ原创| 国产精品系列在线| 国产性天天综合网| 亚洲色图另类专区| 丝袜脚交一区二区| 日韩精品1区2区3区| 成人黄色片在线观看| 色哟哟在线观看一区二区三区| 色综合久久天天| 欧美一区二区视频网站| 久久嫩草精品久久久精品| 欧美激情中文字幕| 自拍偷在线精品自拍偷无码专区| 亚洲另类在线制服丝袜| 丝袜诱惑制服诱惑色一区在线观看| 蜜桃免费网站一区二区三区| 国产精华液一区二区三区| 欧美群妇大交群中文字幕| 91麻豆精品国产91久久久久| 欧美国产精品v| 国产福利精品导航| 久久亚洲欧美国产精品乐播| 亚洲综合无码一区二区| 9久草视频在线视频精品| 91精品免费在线| 亚洲精品国产品国语在线app| 久久99精品久久久久久动态图| 91国在线观看| 亚洲资源在线观看| 欧美日韩国产免费| 天天影视涩香欲综合网| 欧美人成免费网站| 亚洲国产欧美一区二区三区丁香婷| 成人精品一区二区三区四区 | 激情亚洲综合在线| 欧美精品自拍偷拍| 欧美韩国日本不卡| 91原创在线视频| 亚洲日本一区二区| 91精品在线麻豆| 精品在线免费视频| 国产精品初高中害羞小美女文| 高清国产一区二区三区| 国产精品不卡一区二区三区| 91原创在线视频| 日韩av一级电影| 国产日韩av一区二区| 99re这里只有精品首页| 午夜精品久久久久久久蜜桃app| 88在线观看91蜜桃国自产| 九九**精品视频免费播放| 亚洲视频一二区| 欧美麻豆精品久久久久久| 国产在线视频一区二区| 亚洲制服丝袜在线| 久久久99久久精品欧美| 51精品国自产在线| 91久久精品一区二区| 国产麻豆视频一区| 免费在线视频一区| 亚洲卡通欧美制服中文| 欧美日韩综合色| 日本电影亚洲天堂一区| 国产精品一区免费在线观看| 亚洲国产成人av| 亚洲精品国产高清久久伦理二区| www国产精品av| 欧美日韩一区二区三区四区五区| 国产乱子轮精品视频| 日本视频中文字幕一区二区三区| 国产精品日韩成人| 国产精品色婷婷久久58| 久久精品在线免费观看|