• <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>

            兩個控制碼,Windows下發(fā)送ATAPI Command必須用到的

            雖然文檔說只有Server 2003才有,但在XP SP2下也可以發(fā)送,只是支持可能不是那么完全,某些硬件配置下可能不起作用。

             


            Storage Devices: Windows Driver Kit

            IOCTL_ATA_PASS_THROUGH

            Operation

            Allows an application to send almost any ATA command to a target device, with the following restrictions:

            • If a class driver for the target type of device exists, the application must send the request to the class driver. Thus, an application can send this request directly to the system port driver for a target logical unit (LU) only if there is no class driver for the type of device connected to that LU. The system port driver does not check to determine if a device has been claimed by a class driver before processing a pass-through request. Therefore, if an application bypasses a class driver that has claimed a device and sends a pass-through request for that device directly to the port driver, a conflict for control of the device can occur between the class driver and the application.
            • This request cannot be used if the command requires the underlying driver to access memory directly. If the caller's command might require direct access to memory, use IOCTL_ATA_PASS_THROUGH_DIRECT instead.
            • Applications must not attempt to send a pass-through request asynchronously. All pass-through requests must be synchronous.
            • Applications do not require administrative privileges to send a pass-through request to a device, but they must have read-write access to the device.

            The calling application provides the ATA task file register contents for the intended command in the ATA_PASS_THROUGH_EX structure. The system double buffers all data transfers. This request is typically used for transferring small amounts of data (less than 16 KB).

            Input

            Parameters.DeviceIoControl.InputBufferLength indicates the size in bytes of the buffer at Irp->AssociatedIrp.SystemBuffer. If the embedded ATA command is a write operation, the size of the input buffer should be the sum of sizeof(ATA_PASS_THROUGH_EX) and the value in the DataTransferLength member of ATA_PASS_THROUGH_EX. The following pseudocode example shows how to calculate the buffer size:

            ULONG buffsize; // size of the buffer
            ATA_PASS_THROUGH_EX hdr;
            hdr.DataTransferLength = size in bytes of the data transfer
            buffsize = sizeof (ATA_PASS_THROUGH_EX) + hdr.DataTransferLength

            If the embedded ATA command is a read operation or a device control operation that does not involve data transfer, InputBufferLength should be equal to sizeof (ATA_PASS_THROUGH_EX).

            In either case, if InputBufferLength is less than sizeof (ATA_PASS_THROUGH_EX), the port driver fails the I/O request and returns an error.

            The buffer at Irp->AssociatedIrp.SystemBuffer should contain an ATA_PASS_THROUGH_EX structure, which includes a set of task file input registers that indicate the sort of command to be performed and its parameters. The caller must initialize all the members of this structure except for PathId, TargetId, and Lun, which the port driver fills in. For a data-out command, the DataBufferOffset member of the structure must point to a cache-aligned buffer containing the data to be written.

            Output

            The port driver formats the return data using an ATA_PASS_THROUGH_EX structure and stores the data in the buffer at Irp->AssociatedIrp.SystemBuffer.

            The port driver updates the DataTransferLength member of ATA_PASS_THROUGH_EX to indicate the amount of data actually transferred from the device. If the embedded ATA command is a write operation or a device control operation that does not transfer data, OutputBufferLength is equal to sizeof(ATA_PASS_THROUGH_EX). If the embedded ATA command is a read operation, OutputBufferLength is equal to sizeof(ATA_PASS_THROUGH_EX) + DataTransferLength.

            The port driver fills the CurrentTaskFile member with the values that are present in the device's output registers at the completion of the embedded ATA command. If the command was a data transfer, the port driver stores the transferred data in a cache-aligned buffer that is located at an offset of DataBufferOffset bytes from the beginning of the structure. The application is responsible for interpreting the contents of the output registers to determine what errors, if any, were returned by the device.

            I/O Status Block

            The Information member is set to the number of bytes returned in the output buffer at Irp->AssociatedIrp.SystemBuffer. The Status member is set to STATUS_SUCCESS or possibly to STATUS_BUFFER_TOO_SMALL or STATUS_INVALID_PARAMETER if the input Length value in ATA_PASS_THROUGH is improperly set.

            Requirements

            Versions: Available in Microsoft Windows Server 2003 and later operating systems.

            Headers: Defined in ntddscsi.h. Include ntddscsi.h.

            ? 2007 Microsoft Corporation
            Send feedback on this topic
            Windows Driver Kit
            Built on August 15, 2007

            Build machine: CAPEBUILD

            Requirements

            Versions: Available in Microsoft Windows Server 2003 and later operating systems.

            Headers: Defined in ntddscsi.h. Include ntddscsi.h.

             


            Storage Devices: Windows Driver Kit

            IOCTL_ATA_PASS_THROUGH_DIRECT

            Operation

            Allows an application to send almost any ATA command to a target device, with the following restrictions:

            • If a class driver for the target type of device exists, the application must send the request to the class driver. Thus, an application can send this request directly to the system port driver for a target logical unit only if there is no class driver for the device.
            • The application must use this request rather than IOCTL_ATA_PASS_THROUGH if the embedded ATA command might require the underlying miniport driver to access memory directly.

            If the ATA command requests a data transfer operation, the caller must set up a cache-aligned buffer from which, or into which, the driver can transfer data directly. The IOCTL_ATA_PASS_THROUGH_DIRECT request is typically used for transferring large amounts of data (more than 16 KB).

            Input

            Parameters.DeviceIoControl.InputBufferLength indicates the size in bytes of the buffer at Irp->AssociatedIrp.SystemBuffer. The value of InputBufferLength is fixed and does not depend on the amount of data transferred. It is equal to sizeof (ATA_PASS_THROUGH_DIRECT). If the size of the buffer is less than sizeof(ATA_PASS_THROUGH_DIRECT), the port driver fails the I/O request and returns an error.

            The buffer at Irp->AssociatedIrp.SystemBuffer contains an ATA_PASS_THROUGH_DIRECT structure that includes a set of task file input registers that indicate the sort of command to be performed. The caller must initialize all the members of this structure except for PathId, TargetId, and Lun, which the port driver fills in. For a data-out command, the DataBuffer member of ATA_PASS_THROUGH_DIRECT must point to a cache-aligned buffer containing the data to be written.

            Output

            The port driver formats the return data using an ATA_PASS_THROUGH_DIRECT structure that it stores in the buffer at Irp->AssociatedIrp.SystemBuffer. The port driver updates the DataTransferLength member of the ATA_PASS_THROUGH_DIRECT structure to indicate the amount of data that was transferred from the device.

            The port driver stores the transferred data in the cache-aligned buffer pointed to by the DataBuffer member of ATA_PASS_THROUGH_DIRECT.

            The port driver fills the CurrentTaskFile member of ATA_PASS_THROUGH_DIRECT with the values present in the device's output registers at the completion of the ATA command. The application is responsible for interpreting the contents of the output registers to determine what errors, if any, were returned by the device.

            I/O Status Block

            The Information member is set to the number of bytes returned in the output buffer at Irp->AssociatedIrp.SystemBuffer. The Status member is set to STATUS_SUCCESS or possibly to STATUS_BUFFER_TOO_SMALL or STATUS_INVALID_PARAMETER if the input Length value in ATA_PASS_THROUGH is improperly set.

            Requirements

            Headers: Defined in ntddscsi.h. Include ntddscsi.h.

            ? 2007 Microsoft Corporation
            Send feedback on this topic
            Windows Driver Kit
            Built on August 15, 2007

            Build machine: CAPEBUILD

            Requirements

            Headers: Defined in ntddscsi.h. Include ntddscsi.h.

            posted on 2008-07-01 14:12 FongLuo 閱讀(2755) 評論(0)  編輯 收藏 引用


            只有注冊用戶登錄后才能發(fā)表評論。
            網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


            <2008年7月>
            293012345
            6789101112
            13141516171819
            20212223242526
            272829303112
            3456789

            導(dǎo)航

            常用鏈接

            留言簿

            隨筆分類(11)

            隨筆檔案(79)

            文章檔案(1)

            收藏夾(38)

            學(xué)習(xí)網(wǎng)站

            一般網(wǎng)站

            最新隨筆

            搜索

            積分與排名

            最新評論

            閱讀排行榜

            久久久久久亚洲精品不卡 | 欧美一区二区三区久久综合| 色综合合久久天天给综看| 伊人久久大香线蕉AV一区二区| 一本大道久久香蕉成人网| 少妇人妻综合久久中文字幕| 午夜精品久久久久久久久| 97久久精品国产精品青草| 99久久99久久精品国产| 狠狠色丁香久久婷婷综合图片| 久久精品中文騷妇女内射| 国产69精品久久久久9999| 日韩欧美亚洲综合久久影院Ds| 久久久久久久女国产乱让韩| 国产V亚洲V天堂无码久久久| 久久免费香蕉视频| 国内精品久久久久久99| 久久综合伊人77777| 久久精品国产影库免费看| 亚洲国产精品成人AV无码久久综合影院| 亚洲精品无码久久久久| 久久久国产精品亚洲一区| 亚洲AV日韩AV天堂久久| 亚洲国产天堂久久综合网站 | 综合人妻久久一区二区精品| 国产综合久久久久久鬼色| 久久乐国产精品亚洲综合| 久久99中文字幕久久| 日本人妻丰满熟妇久久久久久| 国产真实乱对白精彩久久| 国产精品青草久久久久婷婷 | 久久久亚洲欧洲日产国码aⅴ| 一本久道久久综合狠狠躁AV| 国产农村妇女毛片精品久久| 97久久综合精品久久久综合| 亚洲国产欧美国产综合久久| 超级97碰碰碰碰久久久久最新| 久久国产精品一区| 精品久久久久久无码国产| 国产一区二区三精品久久久无广告 | 精品久久久久久中文字幕大豆网|