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

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

?? usbfx2lk_queue.cpp

?? VisualC++寫的一個(gè)USB的驅(qū)動(dòng)程序。
?? CPP
?? 第 1 頁 / 共 2 頁
字號(hào):
    OsrTracePrint(TRACE_LEVEL_INFORMATION,OSRDBG_READWRITE, 
        ("OsrCsqPeekNextIoIrp: Next Irp is Irp 0x%p...\n",nextIrp));

    return nextIrp;
    
}


///////////////////////////////////////////////////////////////////////////////
//
// OsrCsqAcquireIoLock
//
//      We're called here when the CSQ lib wants to synchronize
//      access to our queue.
//
//  INPUTS:
//
//      Csq  -  Our cancel safe queue
//
//  OUTPUTS:
//
//      Irql -  We return the IRQL at which we want to drop
//              back down to when called at our release routine
//              in the Irql parameter
//
//  RETURNS:
//
//      None
//
//  IRQL:
//
//      This routine is called at IRQL <= DISPATCH_LEVEL
//
//  CONTEXT:
//
//      Arbitrary
//
//  NOTES:
//
//
///////////////////////////////////////////////////////////////////////////////
VOID OsrCsqAcquireIoLock(PIO_CSQ Csq,PKIRQL Irql)
{

    PUSBFX2LK_EXT devExt;

    //
    // We should never be here and not at <= DISPATCH_LEVEL
    //
    ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL);

    //
    // Get a pointer to our device extension...
    // 
    devExt = CONTAINING_RECORD(Csq, USBFX2LK_EXT, CancelSafeIoQueue);

    OsrTracePrint(TRACE_LEVEL_INFORMATION,OSRDBG_READWRITE, 
        ("OsrCsqAcquireIoLock: Acquiring the cancel safe queue lock...\n"));

    //
    // Simply acquire our spinlock. The current IRQL (which
    //  is the IRQL we'll want to return to when dropping the lock)
    //  will be returned in the Irql parameter.
    //
    KeAcquireSpinLock(&devExt->CancelSafeIoLock, Irql);

}


///////////////////////////////////////////////////////////////////////////////
//
// OsrCsqReleaseIoLock
//
//      We're called here when the CSQ lib is finished accessing
//      our queue
//
//  INPUTS:
//
//      Csq  -  Our cancel safe queue
//
//      Irql -  This is the IRQL value that we previously stored
//              in OsrCsqAcquireIoLock
//
//  OUTPUTS:
//
//      None
//
//  RETURNS:
//
//      None
//
//  IRQL:
//
//      This routine is called at IRQL == DISPATCH_LEVEL (since
//      we're holding the CancelSafeIoLock)
//
//  CONTEXT:
//
//      Arbitrary
//
//  NOTES:
//
//
///////////////////////////////////////////////////////////////////////////////
VOID OsrCsqReleaseIoLock(PIO_CSQ Csq,KIRQL Irql) 
{
    PUSBFX2LK_EXT  devExt;

    //
    // We should never be here and not at DISPATCH_LEVEL
    //
    ASSERT(KeGetCurrentIrql() == DISPATCH_LEVEL);

    //
    // Get a pointer to our device extension...
    // 
    devExt = CONTAINING_RECORD(Csq, 
                               USBFX2LK_EXT, 
                               CancelSafeIoQueue);

    OsrTracePrint(TRACE_LEVEL_INFORMATION,OSRDBG_READWRITE, 
        ("OsrCsqReleaseIoLock: Releasing the cancel safe queue lock...\n"));

    //
    // Drop the lock, restoring the old Irql...
    //
    KeReleaseSpinLock(&devExt->CancelSafeIoLock, Irql);

}



///////////////////////////////////////////////////////////////////////////////
//
// OsrCsqCompleteCancelledIoIrp
//
//      The CSQ library calls us here when it has a Irp that needs to be 
//      cancelled.
//
//  INPUTS:
//
//      Csq  -  Our cancel safe queue
//
//      Irp  -  The Irp to cancel
//
//  OUTPUTS:
//
//      None
//
//  RETURNS:
//
//      None
//
//  IRQL:
//
//      This routine is called at IRQL <= DISPATCH_LEVEL
//
//  CONTEXT:
//
//      Arbitrary
//
//  NOTES:
//
//      Note that while the Irp is in our Queue the 
//      Irp->Tail.Overlay.DriverContext[0], contains our IO Context for the
//      operation.   
//
///////////////////////////////////////////////////////////////////////////////
VOID OsrCsqCompleteCancelledIoIrp(PIO_CSQ Csq,PIRP Irp)
{
    PUSBFX2LK_EXT        devExt;
    PUSBFX2LK_IO_CONTEXT pFx2Context = NULL;
    PURB                 ioctlUrb = NULL; 

    //
    // We should never be here and not at <= DISPATCH_LEVEL
    //
    ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL);

    //
    // Get a pointer to our device extension...
    // 
    devExt = (PUSBFX2LK_EXT)CONTAINING_RECORD(Csq, USBFX2LK_EXT, CancelSafeIoQueue);

    OsrTracePrint(TRACE_LEVEL_INFORMATION,OSRDBG_READWRITE, 
        ("OsrCsqCompleteCancelledIoIrp: Cancelling Irp 0x%p!\n", 
                Irp));

    //
    // See if we have a read/write context stored in the DriverContext field.  
    //  We can do this because we are not using system queuing.  Also 
    //  we can use DriverContext[0]. The IoCsq routines use DriverContext[3]
    //
    pFx2Context = (PUSBFX2LK_IO_CONTEXT) Irp->Tail.Overlay.DriverContext[0];
    
    if(pFx2Context) {
        IoFreeMdl(pFx2Context->Mdl);
        ExFreePool(pFx2Context->Urb);
        IoFreeWorkItem(pFx2Context->PWorkItem);
        ExFreePool(pFx2Context);
    }

    //
    // For some IOCTLs, we queue them off and put the 
    //  URBs that we've allocated in the DriverContext[1] 
    //  pointer. Again, we can do this because these contexts
    //  are ours while we own the IRP
    //
    ioctlUrb = (PURB)Irp->Tail.Overlay.DriverContext[1];

    if (ioctlUrb) {

        ExFreePool(ioctlUrb);

    }

    //
    // Just go ahead and cancel the Irp
    //
    Irp->IoStatus.Status      = STATUS_CANCELLED;
    Irp->IoStatus.Information = 0;
    
    IoCompleteRequest(Irp, IO_NO_INCREMENT);

    //
    // One less request, don't forget to decrement our outstanding
    // IO count! 
    //
    OsrDecrementOutstandingIoCount(devExt,__FILE__,__LINE__);

}

///////////////////////////////////////////////////////////////////////////////
//
// OsrClearQueues
//
//    This routine is called to clear out all read and write requests
//    that are either in progress or pending
//
//  INPUTS:
//
//      DevExt - The device extension for the device whose queues we want
//               clear
//
//  OUTPUTS:
//
//      None.
//
//  RETURNS:
//
//      None
//
//  IRQL:
//
//      This routine is called at IRQL <= DISPATCH_LEVEL
//
//  CONTEXT:
//
//      This routine can be called from anywhere in the driver
//      so the context should be assumed arbitrary 
//
//  NOTES:
//
//
///////////////////////////////////////////////////////////////////////////////
VOID OsrClearQueues(PUSBFX2LK_EXT DevExt)
{
    PIRP irp;
    PUSBFX2LK_IO_CONTEXT pFx2Context = NULL;
    PURB ioctlUrb = NULL; ;

    //
    // We should never be here and not at <= DISPATCH_LEVEL
    //
    ASSERT(KeGetCurrentIrql() <= DISPATCH_LEVEL);

    //
    // Traverse the Io queue and fail any outstanding write 
    //  requests
    //
    while(irp = IoCsqRemoveNextIrp(&DevExt->CancelSafeIoQueue, NULL)) {

        //
        // See if we have a context stored in the DriverContext field.  We can do this
        // because we are not using system queuing.  Also we can use DriverContext[0],
        // The IoCsq routines use DriverContext[3].
        //
        pFx2Context = (PUSBFX2LK_IO_CONTEXT) irp->Tail.Overlay.DriverContext[0];
        if(pFx2Context) {
            IoFreeMdl(pFx2Context->Mdl);
            ExFreePool(pFx2Context->Urb);
            IoFreeWorkItem(pFx2Context->PWorkItem);
            ExFreePool(pFx2Context);
        }

        //
        // For some IOCTLs, we queue them off and put the 
        //  URBs that we've allocated in the DriverContext[1] 
        //  pointer. Again, we can do this because these contexts
        //  are ours while we own the IRP
        //
        ioctlUrb = (PURB)irp->Tail.Overlay.DriverContext[1];

        if (ioctlUrb) {

            ExFreePool(ioctlUrb);

        }

        //
        // Mark the Irp as offline.....
        //
        irp->IoStatus.Status      = STATUS_DEVICE_OFF_LINE;
        irp->IoStatus.Information = 0;
    
        IoCompleteRequest(irp, IO_NO_INCREMENT);

    }

}    

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本在线不卡一区| 成人午夜视频网站| 99re这里只有精品首页| 日韩三级伦理片妻子的秘密按摩| 国产精品少妇自拍| 久久精品国产亚洲高清剧情介绍| 91在线播放网址| 久久婷婷色综合| 免费成人美女在线观看| 欧美三级视频在线观看| 中文字幕一区二区三区视频| 国产美女精品人人做人人爽| 日韩一区二区在线免费观看| 亚洲六月丁香色婷婷综合久久| 狠狠色狠狠色综合| 日韩一区二区免费在线观看| 亚洲成av人影院在线观看网| 色网综合在线观看| 亚洲另类春色国产| 日本精品视频一区二区| 国产日韩欧美精品综合| 国产福利一区二区| 久久久久久久网| 国产精品资源站在线| 欧美成人一级视频| 另类小说一区二区三区| 欧美久久一区二区| 午夜精品免费在线观看| 欧美性大战xxxxx久久久| 亚洲免费高清视频在线| 91美女在线观看| 亚洲黄色av一区| 91黄色免费观看| 亚洲午夜日本在线观看| 欧美色爱综合网| 五月天国产精品| 欧美精品粉嫩高潮一区二区| 日本欧美久久久久免费播放网| 欧美日本在线看| 久久成人18免费观看| 精品国产一区二区精华| 丰满少妇久久久久久久 | 久久99最新地址| 日韩精品资源二区在线| 激情综合色综合久久综合| 久久女同性恋中文字幕| www.亚洲精品| 一区二区三区小说| 欧美美女喷水视频| 精品亚洲porn| 中文字幕精品一区二区精品绿巨人 | 久久久久久电影| 成人v精品蜜桃久久一区| 亚洲精品国产第一综合99久久| 91蝌蚪porny| 视频一区二区三区中文字幕| 精品欧美一区二区久久 | 久久国产尿小便嘘嘘| 国产丝袜欧美中文另类| 色婷婷综合久久久久中文| 日韩av中文在线观看| 国产日韩欧美不卡在线| 色噜噜久久综合| 久久疯狂做爰流白浆xx| 亚洲色图欧洲色图| 日韩一级完整毛片| 福利电影一区二区三区| 亚洲成人免费视| 久久久国际精品| 欧美在线高清视频| 国产aⅴ综合色| 日韩不卡一区二区| 亚洲欧洲日韩av| 日韩一级大片在线观看| av资源网一区| 激情图片小说一区| 亚洲国产美女搞黄色| 国产日韩精品视频一区| 欧美日韩久久一区| 成人av在线网站| 美女视频第一区二区三区免费观看网站| 国产亚洲精品aa午夜观看| 欧美日本乱大交xxxxx| 成人av一区二区三区| 久久国产剧场电影| 午夜精品福利久久久| 国产精品成人一区二区艾草| 日韩三级精品电影久久久 | 成人免费看视频| 久99久精品视频免费观看| 亚洲五月六月丁香激情| 国产精品久久久久久久久晋中| 欧美一卡2卡3卡4卡| 色天天综合色天天久久| 国产成人日日夜夜| 国产一区二区三区免费播放| 免费在线观看日韩欧美| 亚洲成av人片在线观看| 亚洲一区在线观看视频| 一区二区三区在线观看国产| 国产精品久久久久久久第一福利| 欧美tk丨vk视频| 欧美电影免费观看高清完整版在线观看| 色欧美乱欧美15图片| 91影视在线播放| 成人av网址在线| 成人av资源网站| 99热在这里有精品免费| 成人精品视频一区二区三区| 国产a视频精品免费观看| 国产盗摄一区二区| 国产精品一区二区三区四区| 国产乱人伦精品一区二区在线观看| 蜜桃精品视频在线观看| 奇米777欧美一区二区| 日本免费在线视频不卡一不卡二| 婷婷激情综合网| 捆绑调教一区二区三区| 精品一区二区三区蜜桃| 国产精品亚洲一区二区三区妖精 | 99re成人在线| 成人av片在线观看| 色婷婷国产精品综合在线观看| 色婷婷综合激情| 欧美日免费三级在线| 在线不卡一区二区| 久久久三级国产网站| 久久日一线二线三线suv| 国产区在线观看成人精品 | 亚洲成人免费在线| 强制捆绑调教一区二区| 国产在线一区二区| 成人中文字幕电影| 91麻豆国产福利精品| 欧美美女喷水视频| 精品国产一区二区亚洲人成毛片 | 91精品国产91久久综合桃花| 精品欧美久久久| 日韩美女精品在线| 亚洲成av人片一区二区三区| 激情六月婷婷久久| jizz一区二区| 欧美美女视频在线观看| 久久久久久电影| 亚洲一级片在线观看| 麻豆精品一区二区三区| caoporm超碰国产精品| 欧美伦理电影网| 国产精品乱人伦| 婷婷成人综合网| 北岛玲一区二区三区四区| 欧美日韩精品电影| 国产亚洲成aⅴ人片在线观看| 国产精品高潮久久久久无| 日韩激情中文字幕| proumb性欧美在线观看| 717成人午夜免费福利电影| 国产精品无码永久免费888| 午夜精品成人在线视频| 成人天堂资源www在线| 91精品蜜臀在线一区尤物| 国产精品女主播av| 毛片av一区二区| 欧美伊人精品成人久久综合97| 欧美tickling挠脚心丨vk| 一区二区高清视频在线观看| 极品少妇xxxx精品少妇偷拍| 91传媒视频在线播放| 国产欧美日韩另类一区| 美洲天堂一区二卡三卡四卡视频| 北岛玲一区二区三区四区| 精品国产免费久久| 日韩中文字幕麻豆| 日本高清不卡视频| 欧美韩日一区二区三区四区| 蜜臀va亚洲va欧美va天堂 | 日韩福利视频网| 欧美三级一区二区| 亚洲女人的天堂| 99久久伊人久久99| 国产欧美日韩中文久久| 美女视频一区在线观看| 欧美精品第1页| 亚洲国产一区二区三区| 在线观看不卡一区| 1区2区3区精品视频| 成人一区二区三区中文字幕| 精品国产伦一区二区三区观看体验| 捆绑变态av一区二区三区 | 色哟哟一区二区在线观看 | 99热在这里有精品免费| 中文天堂在线一区| 粉嫩欧美一区二区三区高清影视| 日韩你懂的在线播放| 奇米精品一区二区三区四区| 6080yy午夜一二三区久久| 日本中文在线一区| 日韩一区二区电影| 久久精品国产亚洲a| 精品国产三级电影在线观看|