• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            小默

            [zz]IoCompletion

            IoCompletion

            The IoCompletion routine completes the processing of I/O operations.

            IO_COMPLETION_ROUTINE IoCompletion;

            NTSTATUS
              IoCompletion(
                __in PDEVICE_OBJECT  DeviceObject,
                __in PIRP  Irp,
                __in PVOID  Context
                )
              {...}

            Parameters

            DeviceObject
            Caller-supplied pointer to a DEVICE_OBJECT structure. This is the device object for the target device, previously created by the driver's AddDevice routine.
            Irp
            Caller-supplied pointer to an IRP structure that describes the I/O operation.
            Context
            Caller-supplied pointer to driver-specific context information, previously supplied when calling IoSetCompletionRoutine, or IoSetCompletionRoutineEx. Context information must be stored in nonpaged memory, since an IoCompletion routine can be called at DISPATCH_LEVEL (see the following Comments section).

            Return Value

            If the IoCompletion routine determines that additional processing is required for the IRP, it must return STATUS_MORE_PROCESSING_REQUIRED. For more information, see the following Comments section. Otherwise it should return STATUS_SUCCESS. (The I/O manager only checks for the presence or absence of STATUS_MORE_PROCESSING_REQUIRED.)

            Comments

            A driver's IoCompletion routine executes in an arbitrary thread or DPC context, and at an IRQL that is less than or equal to DISPATCH_LEVEL. Because code written to execute at DISPATCH_LEVEL will also execute at lower levels, IoCompletion routines should be designed for execution at DISPATCH_LEVEL. However, because these routines are not guaranteed to run at DISPATCH_LEVEL, they must not call system routines that actually require execution at DISPATCH_LEVEL. (For more information about IRQLs, see Managing Hardware Priorities.)

            To register an IoCompletion routine for a specific IRP, a driver must call IoSetCompletionRoutine or IoSetCompletionRoutineEx, which stores the IoCompletion routine's address in the next-lower driver's I/O stack location. (Thus, a lowest-level driver cannot register an IoCompletion routine.) A driver typically calls IoSetCompletionRoutine or IoSetCompletionRoutineEx from one of its dispatch routines, each time an IRP is received. Most drivers, including all PnP drivers, can use IoSetCompletionRoutine to register their IoCompletion routine. Non-PnP drivers that may be unloaded before their IoCompletion routine executes should use IoSetCompletionRoutineEx instead.

            When any driver completes an IRP, it calls IoCompleteRequest, which in turn calls the IoCompletion routine of each higher-level driver, from the next-highest to the highest, until all higher IoCompletion routines have been called or until one routine returns STATUS_MORE_PROCESSING_REQUIRED.

            When you create the IRP, allocate a stack location for the current driver as well as any lower drivers. If you do not allocate sufficient stack locations, the DeviceObject pointer might be set to NULL when the completion routine is called. You can avoid allocating extra stack location for the current driver if you use the Context field to pass information to IoCompletion rather then relying on the DeviceObject parameter.

            If an IoCompletion routine returns STATUS_MORE_PROCESSING_REQUIRED, the lower driver's call to IoCompleteRequest immediately returns. In this case, a higher-level driver will have to call IoCompleteRequest to complete the IRP.

            For more information about implementing IoCompletion routines, see Completing IRPs.

            Example

            To define an IoCompletion callback routine that is named MyIoCompletion, you must first provide a function declaration that Static Driver Verifier (SDV) and other verification tools require, as follows:

            IO_COMPLETION_ROUTINE MyIoCompletion;

             

            Then, implement your callback routine as follows:

            NTSTATUS
              MyIoCompletion(
                __in PDEVICE_OBJECT  DeviceObject,
                __in PIRP  Irp,
                __in PVOID  Context
                )
              {
                  // Function body
              }

             

            The IO_COMPLETION_ROUTINE function type is defined in the Wdm.h header file. For more information about SDV requirements for function declarations, see Declaring Functions Using Function Role Types for WDM Drivers.

            Requirements

            IRQL: <=DISPATCH_LEVEL (see Comments section)

            Headers: Declared in Wdm.h. Include Wdm.h, Ntddk.h, or Ntifs.h.

            posted on 2009-12-29 11:36 小默 閱讀(482) 評論(0)  編輯 收藏 引用 所屬分類: Windows

            導(dǎo)航

            統(tǒng)計

            留言簿(13)

            隨筆分類(287)

            隨筆檔案(289)

            漏洞

            搜索

            積分與排名

            最新評論

            閱讀排行榜

            中文字幕成人精品久久不卡| 国产成人无码久久久精品一| 色婷婷噜噜久久国产精品12p| 久久久久成人精品无码| 久久亚洲国产精品成人AV秋霞| 久久久精品国产免大香伊 | 亚洲AV无码久久精品色欲| 国产精品一久久香蕉产线看| 久久九九久精品国产| 伊人久久综合成人网| 久久国产高清一区二区三区| 新狼窝色AV性久久久久久| 久久e热在这里只有国产中文精品99 | 久久综合狠狠综合久久| 日产久久强奸免费的看| 国产精品青草久久久久婷婷 | 国产精品成人精品久久久 | 久久亚洲精品无码播放| 久久久久无码精品国产不卡| 亚洲欧洲中文日韩久久AV乱码| 久久精品男人影院| 久久夜色精品国产噜噜亚洲AV| 蜜桃麻豆www久久国产精品| 久久精品国产福利国产秒| 久久99精品久久久久婷婷| 一本色道久久综合亚洲精品| 久久影院午夜理论片无码| 国产福利电影一区二区三区,免费久久久久久久精 | 国产99久久九九精品无码| 久久男人Av资源网站无码软件| 亚洲成av人片不卡无码久久| 精品久久久久久国产牛牛app| 国产精品久久久久影院色| 国产V综合V亚洲欧美久久| 久久精品国产亚洲av麻豆色欲| 囯产极品美女高潮无套久久久 | 色综合久久综精品| 久久精品国产秦先生| 色综合久久综精品| 久久综合伊人77777| 久久福利资源国产精品999|