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

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? hcd.cpp

?? Latest USB 802.3, HID printer and mass storage divers from Microsoft for Platform Builder 4.2.
?? CPP
字號(hào):
//
// Copyright (c) Microsoft Corporation.  All rights reserved.
//
//
// Use of this source code is subject to the terms of the Microsoft end-user
// license agreement (EULA) under which you licensed this SOFTWARE PRODUCT.
// If you did not accept the terms of the EULA, you are not authorized to use
// this source code. For a copy of the EULA, please see the LICENSE.RTF on your
// install media.
//
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Module Name:
//     hcd.cpp
// Abstract:
//     This file contains the Chcd object, which is the main entry
//     point for all HCDI calls by USBD
//
// Notes:
//
#include <globals.hpp>
#include <hcd.hpp>
CHcd::CHcd( )
{
    m_pCRootHub=NULL;
}
CHcd::~CHcd()
{
    Lock();
    CRootHub *pRoot = m_pCRootHub;
    m_pCRootHub = NULL;
    Unlock();
     // signal root hub to close
    if ( pRoot ) {
        pRoot->HandleDetach();
        delete pRoot;
    }
   
}
CRootHub* CHcd::SetRootHub(CRootHub* pRootHub)
{
    Lock();
    CRootHub* pReturn=m_pCRootHub;
    m_pCRootHub=pRootHub;
    Unlock();
    return pReturn;
}

// ******************************************************************
BOOL CHcd::OpenPipe( IN UINT address,
                      IN LPCUSB_ENDPOINT_DESCRIPTOR lpEndpointDescriptor,
                      OUT LPUINT lpPipeIndex )
//
// Purpose: Create a logical communication pipe to the endpoint described
//          by lpEndpointDescriptor for device address.
//
// Parameters:  address - address of device to open pipe for
//
//              lpEndpointDescriptor - describes endpoint to open
//
//              lpPipeIndex - out param, indicating index of opened pipe
//
// Returns: TRUE if pipe opened ok, FALSE otherwise
//
// Notes: This needs to be implemented for HCDI
// ******************************************************************
{
    DEBUGMSG(ZONE_UHCD, (TEXT("+CHcd::OpenPipe for device on addr %d\n"), address));
    BOOL fSuccess = FALSE;

    Lock();
    CRootHub *pRoot = m_pCRootHub;

    if ( pRoot != NULL &&
         lpEndpointDescriptor != NULL &&
         lpEndpointDescriptor->bDescriptorType == USB_ENDPOINT_DESCRIPTOR_TYPE &&
         lpEndpointDescriptor->bLength >= sizeof( USB_ENDPOINT_DESCRIPTOR ) &&
         lpPipeIndex != NULL ) {

        // root hub will send the request to the appropriate device
        fSuccess = ( requestOK == pRoot->OpenPipe( address,
                                                   lpEndpointDescriptor,
                                                   lpPipeIndex ) );
    }
    Unlock();
    DEBUGMSG(ZONE_UHCD, (TEXT("-CHcd::OpenPipe for address %d, returning BOOL %d\n"), address, fSuccess ));
    return fSuccess;
}

// ******************************************************************
BOOL CHcd::ClosePipe( IN UINT address,
                       IN UINT pipeIndex )
//
// Purpose: Close the logical communication pipe to this device's endpoint
//
// Parameters:  address - address of device to close pipe for
//
//              pipeIndex - indicating index of pipe to close
//
// Returns: TRUE if call to m_pCRootHub succeeds, else FALSE
//
// Notes: This needs to be implemented for HCDI
// ******************************************************************
{
    DEBUGMSG( ZONE_UHCD, (TEXT("+CHcd::ClosePipe - address = %d, pipeIndex = %d\n"), address, pipeIndex) );
    BOOL fSuccess = FALSE;

    Lock();
    CRootHub *pRoot = m_pCRootHub;

    if (pRoot != NULL)
        fSuccess = (requestOK == pRoot->ClosePipe( address, pipeIndex ) );

    Unlock();
    DEBUGMSG( ZONE_UHCD, (TEXT("-CHcd::ClosePipe - address = %d, pipeIndex = %d, returning BOOL %d\n"), address, pipeIndex, fSuccess) );
    return fSuccess;
}

// ******************************************************************
BOOL CHcd::IssueTransfer( IN UINT address,
                           IN UINT pipeIndex,
                           IN LPTRANSFER_NOTIFY_ROUTINE lpStartAddress,
                           IN LPVOID lpvNotifyParameter,
                           IN DWORD dwFlags,
                           IN LPCVOID lpvControlHeader,
                           IN DWORD dwStartingFrame,
                           IN DWORD dwFrames,
                           IN LPCDWORD aLengths,
                           IN DWORD dwBufferSize,
                           IN_OUT LPVOID lpvBuffer,
                           IN ULONG paBuffer,
                           IN LPCVOID lpvCancelId,
                           OUT LPDWORD adwIsochErrors,
                           OUT LPDWORD adwIsochLengths,
                           OUT LPBOOL lpfComplete,
                           OUT LPDWORD lpdwBytesTransfered,
                           OUT LPDWORD lpdwError )
// Purpose: Issue a USB transfer
//
// Parameters:  address - address of device
//
//              pipeIndex - index of pipe to issue transfer on (NOT the endpoint address)
//
//              lpStartAddress - ptr to function to callback when transfer completes
//                               (this can be NULL)
//
//              lpvNotifyParameter - parameter to pass to lpStartAddress in callback
//
//              dwFlags - combination of
//                              USB_IN_TRANSFER
//                              USB_OUT_TRANSFER
//                              USB_NO_WAIT
//                              USB_SHORT_TRANSFER_OK
//                              USB_START_ISOCH_ASAP
//                              USB_COMPRESS_ISOCH
//                              USB_SEND_TO_DEVICE
//                              USB_SEND_TO_INTERFACE
//                              USB_SEND_TO_ENDPOINT
//                              USB_DONT_BLOCK_FOR_MEM
//                         defined in usbtypes.h
//
//              lpvControlHeader - for control transfers, a pointer to the
//                                 USB_DEVICE_REQUEST structure
//
//
//              dwStartingFrame - for Isoch transfers, this indicates the
//                                first frame of the transfer. If the
//                                USB_START_ISOCH_ASAP flag is set in
//                                dwFlags, the dwStartingFrame is ignored
//                                and the transfer is scheduled As Soon
//                                As Possible
//
//              dwFrames - indicates over how many frames to conduct this
//                         Isochronous transfer. Also should be the # of
//                         entries in aLengths, adwIsochErrors, adwIsochLengths
//
//
//              aLengths - array of dwFrames long. aLengths[i] is how much
//                         isoch data to transfer in the i'th frame. The
//                         sum of all entries should be dwBufferSize
//
//              dwBufferSize - size of data buffer passed in lpvBuffer
//
//              lpvBuffer - data buffer (may be NULL)
//
//              paBuffer - physical address of data buffer (may be 0)
//
//              lpvCancelId - identifier used to refer to this transfer
//                            in case it needs to be canceled later
//
//              adwIsochErrors - array of dwFrames long. adwIsochErrors[ i ]
//                               is set on transfer complete to be the status
//                               of the i'th frame of the isoch transfer
//
//              adwIsochLengths - array of dwFrames long. adwIsochLengths[ i ]
//                                is set on transfer complete to be the amount
//                                of data transferred in the i'th frame of
//                                the isoch transfer
//
//              lpfComplete - pointer to BOOL indicating TRUE/FALSE on
//                            whether this transfer is complete
//
//              lpdwBytesTransfered - pointer to DWORD indicating total # of
//                                    bytes successfully transferred
//
//              lpdwError - pointer to DWORD set to error status on
//                          transfer complete
//
// Returns: TRUE if transfer scheduled ok, otherwise FALSE
//
// Notes: This needs to be implemented for HCDI
// ******************************************************************
{
   DEBUGMSG( ZONE_UHCD | ZONE_TRANSFER, (TEXT("+CHcd::IssueTransfer - address = %d, pipe = %d, dwFlags = 0x%x, lpvControlHeader = 0x%x, lpvBuffer = 0x%x, dwBufferSize = %d\n"), address, pipeIndex, dwFlags, lpvControlHeader, lpvBuffer, dwBufferSize));
   BOOL fSuccess = FALSE;
   Lock();
   CRootHub *pRoot = m_pCRootHub;

   if (pRoot != NULL) {
       fSuccess = (requestOK == pRoot->IssueTransfer(
                                                address,
                                                pipeIndex,
                                                lpStartAddress,
                                                lpvNotifyParameter,
                                                dwFlags,
                                                lpvControlHeader,
                                                dwStartingFrame,
                                                dwFrames,
                                                aLengths,
                                                dwBufferSize,
                                                lpvBuffer,
                                                paBuffer,
                                                lpvCancelId,
                                                adwIsochErrors,
                                                adwIsochLengths,
                                                lpfComplete,
                                                lpdwBytesTransfered,
                                                lpdwError ) );
   }

   Unlock();
   DEBUGMSG( ZONE_UHCD | ZONE_TRANSFER, (TEXT("-CHcd::IssueTransfer - returing BOOL %d\n"), fSuccess ) );
   return fSuccess;
}


// ******************************************************************
BOOL CHcd::AbortTransfer( IN UINT address,
                           IN UINT pipeIndex,
                           IN LPTRANSFER_NOTIFY_ROUTINE lpCancelAddress,
                           IN LPVOID lpvNotifyParameter,
                           IN LPCVOID lpvCancelId )
//
// Purpose: Abort a previously issued transfer
//
// Parameters:  address - address of device on which transfer was issued
//
//              pipeIndex - index of pipe on which transfer was issued
//
//              lpCancelAddress - function to callback when this transfer has aborted
//
//              lpvNotifyParameter - parameter to callback lpCancelAddress
//
//              lpvCancelId - used to identify the transfer to abort. This was passed
//                            in when IssueTransfer was called
//
// Returns: TRUE if call to m_pCRootHub succeeds, else FALSE
//
// Notes: This needs to be implemented for HCDI
// ******************************************************************
{
    DEBUGMSG( ZONE_UHCD | ZONE_TRANSFER, (TEXT("+CHcd::AbortTransfer - address = %d, pipeIndex = %d, lpvCancelId = 0x%x\n"), address, pipeIndex, lpvCancelId) );
    BOOL fSuccess = FALSE;

    Lock();
    CRootHub *pRoot = m_pCRootHub;

    if (pRoot != NULL)
        fSuccess = (requestOK == pRoot->AbortTransfer( address,
                                                       pipeIndex,
                                                       lpCancelAddress,
                                                       lpvNotifyParameter,
                                                       lpvCancelId ) );

    Unlock();
    DEBUGMSG( ZONE_UHCD | ZONE_TRANSFER, (TEXT("-CHcd::AbortTransfer - address = %d, pipeIndex = %d, returning BOOL %d\n"), address, pipeIndex, fSuccess ) );
    return fSuccess;
}

// ******************************************************************
BOOL CHcd::IsPipeHalted( IN UINT address,
                          IN UINT pipeIndex,
                          OUT LPBOOL lpbHalted )
//
// Purpose: Check whether the pipe indicated by address/pipeIndex is
//          halted (stalled) and return result in *lpbHalted
//
// Parameters:  address - address of device to check pipe for
//
//              pipeIndex - indicating index of pipe to check
//
//              lpbHalted - out param, indicating TRUE if pipe is halted,
//                          else FALSE
//
// Returns: TRUE if correct status placed in *lpbHalted, else FALSE
//
// Notes: This needs to be implemented for HCDI
// ******************************************************************
{
    DEBUGMSG(ZONE_UHCD,(TEXT("+CHcd::IsPipeHalted - address = %d, pipeIndex = %d\n"), address, pipeIndex ));
    BOOL retval = FALSE;

    Lock();
    CRootHub *pRoot = m_pCRootHub;

    if ( pRoot != NULL && lpbHalted != NULL ) {
        retval = ( requestOK == pRoot->IsPipeHalted( address,
                                                     pipeIndex,
                                                     lpbHalted ) );
    }
    Unlock();
    DEBUGMSG(ZONE_UHCD,(TEXT("-CHcd::IsPipeHalted - address = %d, pipeIndex = %d, *lpbHalted = %d, retval = %d\n"), address, pipeIndex, ((lpbHalted) ? *lpbHalted : -1), retval ));
    return retval;
}

// ******************************************************************
BOOL CHcd::ResetPipe( IN UINT address,
                       IN UINT pipeIndex )
//
// Purpose: Reset a stalled pipe on device at address "address"
//
// Parameters:  address - address of device to reset pipe for
//
//              pipeIndex - indicating index of pipe to check
//
//              lpbHalted - out param, indicating TRUE if pipe is halted,
//                          else FALSE
//
// Returns: TRUE if correct status placed in *lpbHalted, else FALSE
//
// Notes: This needs to be implemented for HCDI
// ******************************************************************
{
    DEBUGMSG( ZONE_UHCD, (TEXT("+CHcd::ResetPipe - address = %d, pipeIndex = %d\n"), address, pipeIndex) );
    BOOL fSuccess = FALSE;

    Lock();
    CRootHub *pRoot = m_pCRootHub;

    if (pRoot != NULL)
        fSuccess = (requestOK == pRoot->ResetPipe( address, pipeIndex ) );

    Unlock();
    DEBUGMSG( ZONE_UHCD, (TEXT("-CHcd::ResetPipe - address = %d, pipeIndex = %d, returning BOOL %d\n"), address, pipeIndex, fSuccess) );
    return fSuccess;
}



?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品久久一区二区三区| 欧美mv日韩mv国产网站app| 精品精品欲导航| 一区二区久久久| 国产成人精品亚洲午夜麻豆| 日韩你懂的电影在线观看| 日韩成人一级片| 7777精品伊人久久久大香线蕉的| 性做久久久久久免费观看| 欧美午夜影院一区| 视频一区二区三区中文字幕| 91精品国产综合久久精品性色| 国产乱码精品一品二品| 中文字幕av一区 二区| 国产成人h网站| 奇米四色…亚洲| 欧美韩日一区二区三区| 欧美一级片免费看| 懂色av一区二区三区免费看| 国产精品乱人伦| 色综合久久久网| 亚洲人成7777| 在线观看www91| 蜜臀av一区二区三区| 久久久久久久久久久电影| 成人av在线影院| 夜夜嗨av一区二区三区网页| 欧美激情一区二区三区全黄| 精品成人一区二区三区四区| 日韩一区二区在线看片| 波多野结衣欧美| 日本美女一区二区| 肉肉av福利一精品导航| 午夜精品123| 国产精品婷婷午夜在线观看| 国产午夜精品一区二区三区视频| 91国产免费观看| 国产精品99久久久久| 狠狠色丁香婷婷综合| 中文字幕一区二区三区在线播放| 欧美色图第一页| 风间由美性色一区二区三区| 国产成人在线影院| 国产成人精品免费网站| 福利电影一区二区三区| 国产精品系列在线观看| 国产成人久久精品77777最新版本| 韩国成人福利片在线播放| 国产麻豆午夜三级精品| 丝袜美腿亚洲一区二区图片| 日本中文在线一区| 精品一区二区三区欧美| 午夜视频一区二区三区| 日韩高清不卡在线| 麻豆精品国产传媒mv男同| 久久99国产精品尤物| 国产精品一区二区在线观看网站| 狠狠狠色丁香婷婷综合久久五月| 韩国女主播一区二区三区| 国产91丝袜在线播放0| www.66久久| 欧美色图激情小说| 欧美电影免费提供在线观看| 久久精品日韩一区二区三区| 国产精品午夜久久| 亚洲大片一区二区三区| 免费人成精品欧美精品| 国产一区在线观看视频| 91视频在线看| 成人av网站免费| 欧美视频日韩视频| 精品精品国产高清一毛片一天堂| 欧美国产丝袜视频| 一二三区精品福利视频| 免费一级欧美片在线观看| 丁香五精品蜜臀久久久久99网站| 欧美亚洲自拍偷拍| www欧美成人18+| 2024国产精品视频| 亚洲欧美日本在线| 激情六月婷婷久久| 91黄色在线观看| 久久久99精品免费观看不卡| 亚洲免费视频中文字幕| 欧美高清在线视频| 一区二区在线观看视频在线观看| 91精品国产一区二区三区 | 在线一区二区观看| 欧美区视频在线观看| 在线观看成人小视频| 欧美精品一区二区三区视频| 亚洲男人的天堂一区二区| 加勒比av一区二区| 日本高清不卡aⅴ免费网站| 精品国产伦一区二区三区免费 | 国产精品人妖ts系列视频| 午夜精品福利在线| a在线播放不卡| 欧美一级片在线观看| 亚洲激情综合网| 国产xxx精品视频大全| 欧美欧美欧美欧美首页| 国产精品久久影院| 亚洲精品免费在线| 风间由美一区二区三区在线观看| 欧美日韩一区二区在线视频| 国产日韩综合av| 亚洲精选视频在线| 高清视频一区二区| 日韩女同互慰一区二区| 亚洲国产中文字幕在线视频综合| 免费日本视频一区| 精品视频1区2区3区| 椎名由奈av一区二区三区| 亚洲成人综合网站| 91在线看国产| 欧美一二三四在线| 亚洲6080在线| 欧美性videosxxxxx| 亚洲男人的天堂在线aⅴ视频 | 中文字幕视频一区| 激情小说欧美图片| 日韩欧美不卡在线观看视频| 午夜婷婷国产麻豆精品| 欧美性xxxxxx少妇| 亚洲韩国一区二区三区| 97成人超碰视| 日韩一区日韩二区| av一区二区三区黑人| 国产精品久久夜| 成人av动漫在线| 亚洲欧美一区二区在线观看| 成人午夜又粗又硬又大| 91久久奴性调教| 亚洲视频一区二区免费在线观看| 成人开心网精品视频| 日本一区二区视频在线观看| 国产福利精品导航| 中文字幕免费不卡在线| 成人午夜看片网址| 中文字幕在线播放不卡一区| 粉嫩高潮美女一区二区三区 | 综合亚洲深深色噜噜狠狠网站| 国产经典欧美精品| 国产欧美日韩中文久久| 懂色av一区二区三区蜜臀| 国产精品久久久久影院| 91蜜桃传媒精品久久久一区二区| 日韩毛片一二三区| www.综合网.com| 一卡二卡三卡日韩欧美| 777午夜精品免费视频| 久久成人av少妇免费| 一本大道av伊人久久综合| 亚洲高清久久久| 精品少妇一区二区三区 | 91在线云播放| 亚洲超丰满肉感bbw| 日韩精品在线一区| 高清久久久久久| 亚洲综合久久久久| 成人a区在线观看| 亚洲国产精品天堂| 欧美成人免费网站| 丁香网亚洲国际| 亚洲激情六月丁香| 日韩精品一区二区三区在线播放| 国产99久久久国产精品免费看| 专区另类欧美日韩| 日韩一区二区在线看| 成人丝袜高跟foot| 午夜视黄欧洲亚洲| 中文字幕的久久| 欧美日韩一卡二卡三卡| 国产精品综合在线视频| 亚洲男人的天堂一区二区| 日韩女优制服丝袜电影| 99re这里只有精品视频首页| 午夜精品视频一区| 国产视频在线观看一区二区三区| 欧美主播一区二区三区| 国产精品一区二区黑丝| 亚洲电影一区二区三区| 久久这里只有精品首页| 日本电影亚洲天堂一区| 精品亚洲porn| 亚洲综合另类小说| 国产三级三级三级精品8ⅰ区| 欧美视频中文一区二区三区在线观看| 乱一区二区av| 亚洲一二三四在线| 久久精品亚洲麻豆av一区二区| 欧美日韩精品三区| proumb性欧美在线观看| 久色婷婷小香蕉久久| 亚洲在线观看免费视频| 国产精品传媒入口麻豆| 精品久久99ma| 777精品伊人久久久久大香线蕉| 99免费精品视频|