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

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

?? floppy.c

?? The sfloppy sample is a super floppy driver that resides in the directory \NtddkSrcStoragesfloppy. I
?? C
?? 第 1 頁 / 共 5 頁
字號:

       numberOfHeads = pageData->NumberOfHeads;
       maximumTrack = pageData->NumberOfCylinders[1];
       maximumTrack |= pageData->NumberOfCylinders[0] << 8;
       sectorsPerTrack = pageData->SectorsPerTrack;


       //
       // Convert from number of cylinders to maximum track.
       //

       maximumTrack--;

       //
       // Search for the maximum supported media. Based on the number of heads,
       // sectors per track and number of cylinders
       //
       for (index = 0; index < NUMBER_OF_DRIVE_MEDIA_COMBINATIONS; index++) {

            //
            // Walk the table forward until the drive capacity holds all of the
            // data and the bytes per setor are equal
            //

            if (DriveMediaConstants[index].NumberOfHeads == numberOfHeads &&
                DriveMediaConstants[index].MaximumTrack == maximumTrack &&
                DriveMediaConstants[index].SectorsPerTrack ==sectorsPerTrack) {

                ExFreePool(modeData);

                //
                // index is now a drive media combination.  Compare this to
                // the maximum drive media type in the drive media table.
                //

                for (length = 0; length < NUMBER_OF_DRIVE_TYPES; length++) {

                    if (DriveMediaLimits[length].HighestDriveMediaType == index) {
                        return(length);
                    }
                }
                return(DRIVE_TYPE_NONE);
           }
       }

       // If the maximum track is greater than 8 bits then divide the
       // number of tracks by 3 and multiply the number of heads by 3.
       // This is a special case for the 20.8 MB floppy.
       //

       if (!applyFix && maximumTrack >= 0x0100) {
           applyFix = TRUE;
           maximumTrack++;
           maximumTrack /= 3;
           maximumTrack--;
           numberOfHeads *= 3;
       } else {
           ExFreePool(modeData);
           return(DRIVE_TYPE_NONE);
       }

    }

    ExFreePool(modeData);
    return(DRIVE_TYPE_NONE);
}


BOOLEAN
FlCheckFormatParameters(
    IN PDEVICE_OBJECT DeviceObject,
    IN PFORMAT_PARAMETERS FormatParameters
    )

/*++

Routine Description:

    This routine checks the supplied format parameters to make sure that
    they'll work on the drive to be formatted.

Arguments:

    DeviceObject - Pointer to the device object to be formated.

    FormatParameters - a pointer to the caller's parameters for the FORMAT.

Return Value:

    TRUE if parameters are OK.
    FALSE if the parameters are bad.

--*/

{
    PDRIVE_MEDIA_CONSTANTS driveMediaConstants;
    DRIVE_MEDIA_TYPE driveMediaType;
    ULONG index;

    //
    // Get the device type.
    //

    index = DetermineDriveType(DeviceObject);

    if (index == DRIVE_TYPE_NONE) {

        //
        // If the determine device type failed then just use the media type
        // and try the parameters.
        //

        driveMediaType = Drive360Media160;

        while (( DriveMediaConstants[driveMediaType].MediaType !=
               FormatParameters->MediaType ) &&
               ( driveMediaType < Drive288Media288) ) {

               driveMediaType++;
        }

    } else {

        //
        // Figure out which entry in the DriveMediaConstants table to use.
        //

        driveMediaType =
            DriveMediaLimits[index].HighestDriveMediaType;

        while ( ( DriveMediaConstants[driveMediaType].MediaType !=
            FormatParameters->MediaType ) &&
            ( driveMediaType > DriveMediaLimits[index].
            LowestDriveMediaType ) ) {

            driveMediaType--;
        }

    }


    if ( DriveMediaConstants[driveMediaType].MediaType !=
        FormatParameters->MediaType ) {
        return FALSE;

    } else {

        driveMediaConstants = &DriveMediaConstants[driveMediaType];

        if ( ( FormatParameters->StartHeadNumber >
            (ULONG)( driveMediaConstants->NumberOfHeads - 1 ) ) ||
            ( FormatParameters->EndHeadNumber >
            (ULONG)( driveMediaConstants->NumberOfHeads - 1 ) ) ||
            ( FormatParameters->StartCylinderNumber >
            driveMediaConstants->MaximumTrack ) ||
            ( FormatParameters->EndCylinderNumber >
            driveMediaConstants->MaximumTrack ) ||
            ( FormatParameters->EndCylinderNumber <
            FormatParameters->StartCylinderNumber ) ) {

            return FALSE;

        } else {

            return TRUE;
        }
    }
}

NTSTATUS
FormatMedia(
    PDEVICE_OBJECT DeviceObject,
    MEDIA_TYPE MediaType
    )
/*++

Routine Description:

    This routine formats the floppy disk.  The entire floppy is formated in
    one shot.

Arguments:

    DeviceObject - Supplies the device object to be tested.

    Irp - Supplies a pointer to the requesting Irp.

    MediaType - Supplies the media type format the device for.

Return Value:

    Returns a status for the operation.

--*/
{
    PVOID modeData;
    PSCSI_REQUEST_BLOCK srb;
    PMODE_FLEXIBLE_DISK_PAGE pageData;
    DRIVE_MEDIA_TYPE driveMediaType;
    PDRIVE_MEDIA_CONSTANTS driveMediaConstants;
    ULONG length;
    NTSTATUS status;

    modeData = ExAllocatePool(NonPagedPoolCacheAligned, MODE_DATA_SIZE);

    if (modeData == NULL) {
        return(STATUS_INSUFFICIENT_RESOURCES);
    }

    RtlZeroMemory(modeData, MODE_DATA_SIZE);

    length = ClassModeSense(DeviceObject,
                            modeData,
                            MODE_DATA_SIZE,
                            MODE_PAGE_FLEXIBILE);

    if (length < sizeof(MODE_PARAMETER_HEADER)) {
        ExFreePool(modeData);
        return(STATUS_INVALID_DEVICE_REQUEST);
    }

    //
    // Look for the flexible disk mode page.
    //

    pageData = ClassFindModePage( modeData, length, MODE_PAGE_FLEXIBILE, TRUE);

    //
    // Make sure the page is returned and is large enough.
    //

    if ((pageData == NULL) ||
        (pageData->PageLength + 2 <
         offsetof(MODE_FLEXIBLE_DISK_PAGE, StartWritePrecom))) {

        ExFreePool(modeData);
        return(STATUS_INVALID_DEVICE_REQUEST);

    }

    //
    // Look for a drive media type which matches the requested media type.
    //
    //
    //start from Drive120MMedia120M instead of Drive2080Media2080
    //
    for (driveMediaType = Drive120MMedia120M;
    DriveMediaConstants[driveMediaType].MediaType != MediaType;
    driveMediaType--) {
         if (driveMediaType == Drive360Media160) {

             ExFreePool(modeData);
             return(STATUS_INVALID_PARAMETER);

         }
    }

    driveMediaConstants = &DriveMediaConstants[driveMediaType];

    if ((pageData->NumberOfHeads != driveMediaConstants->NumberOfHeads) ||
        (pageData->SectorsPerTrack != driveMediaConstants->SectorsPerTrack) ||
        ((pageData->NumberOfCylinders[0] != (UCHAR)((driveMediaConstants->MaximumTrack+1) >> 8)) &&
         (pageData->NumberOfCylinders[1] != (UCHAR)driveMediaConstants->MaximumTrack+1)) ||
        (pageData->BytesPerSector[0] != driveMediaConstants->BytesPerSector >> 8 )) {

        //
        // Update the flexible parameters page with the new parameters.
        //

        pageData->NumberOfHeads = driveMediaConstants->NumberOfHeads;
        pageData->SectorsPerTrack = driveMediaConstants->SectorsPerTrack;
        pageData->NumberOfCylinders[0] = (UCHAR)((driveMediaConstants->MaximumTrack+1) >> 8);
        pageData->NumberOfCylinders[1] = (UCHAR)driveMediaConstants->MaximumTrack+1;
        pageData->BytesPerSector[0] = driveMediaConstants->BytesPerSector >> 8;

        //
        // Clear the mode parameter header.
        //

        RtlZeroMemory(modeData, sizeof(MODE_PARAMETER_HEADER));

        //
        // Set the length equal to the length returned for the flexible page.
        //

        length = pageData->PageLength + 2;

        //
        // Copy the page after the mode parameter header.
        //

        RtlMoveMemory((PCHAR) modeData + sizeof(MODE_PARAMETER_HEADER),
                pageData,
                length
                );
            length += sizeof(MODE_PARAMETER_HEADER);


        //
        // Allocate a Srb for the format command.
        //

        srb = ExAllocatePool(NonPagedPool, SCSI_REQUEST_BLOCK_SIZE);

        if (srb == NULL) {

            ExFreePool(modeData);
            return(STATUS_INSUFFICIENT_RESOURCES);
        }

        RtlZeroMemory(srb, SCSI_REQUEST_BLOCK_SIZE);

        srb->CdbLength = 6;
        srb->Cdb[0] = SCSIOP_MODE_SELECT;
        srb->Cdb[4] = (UCHAR) length;

        //
        // Set the PF bit.
        //

        srb->Cdb[1] |= 0x10;

        //
        // Set timeout value.
        //

        srb->TimeOutValue = 2;

        //
        // Send the mode select data.
        //

        status = ClassSendSrbSynchronous(DeviceObject,
                  srb,
                  modeData,
                  length,
                  TRUE
                  );

        //
        // The mode data not needed any more so free it.
        //

        ExFreePool(modeData);

        if (!NT_SUCCESS(status)) {
            ExFreePool(srb);
            return(status);
        }

    } else {

        //
        // The mode data not needed any more so free it.
        //

        ExFreePool(modeData);

        //
        // Allocate a Srb for the format command.
        //

        srb = ExAllocatePool(NonPagedPool, SCSI_REQUEST_BLOCK_SIZE);

        if (srb == NULL) {
            return(STATUS_INSUFFICIENT_RESOURCES);
        }

    }

    RtlZeroMemory(srb, SCSI_REQUEST_BLOCK_SIZE);

    srb->CdbLength = 6;

    srb->Cdb[0] = SCSIOP_FORMAT_UNIT;

    //
    // Set timeout value.
    //

    srb->TimeOutValue = 10 * 60;

    status = ClassSendSrbSynchronous(DeviceObject,
                                     srb,
                                     NULL,
                                     0,
                                     FALSE
                                     );
    ExFreePool(srb);

    return(status);

}

VOID
ScsiFlopProcessError(
    PDEVICE_OBJECT DeviceObject,
    PSCSI_REQUEST_BLOCK Srb,
    NTSTATUS *Status,
    BOOLEAN *Retry
    )
/*++

Routine Description:

   This routine checks the type of error.  If the error indicate the floppy
   controller needs to be reinitialize a command is made to do it.

Arguments:

    DeviceObject - Supplies a pointer to the device object.

    Srb - Supplies a pointer to the failing Srb.

    Status - Status with which the IRP will be completed.

    Retry - Indication of whether the request will be retried.

Return Value:

    None.

--*/

{
    PFUNCTIONAL_DEVICE_EXTENSION fdoExtension = DeviceObject->DeviceExtension;
    PDISK_DATA diskData = (PDISK_DATA) fdoExtension->CommonExtension.DriverData;
    PSENSE_DATA senseBuffer = Srb->SenseInfoBuffer;
    PIO_STACK_LOCATION irpStack;
    PIRP irp;
    PSCSI_REQUEST_BLOCK srb;
    LARGE_INTEGER largeInt;
    PCOMPLETION_CONTEXT context;
    PCDB cdb;
    ULONG_PTR alignment;
    ULONG majorFunction;

    UNREFERENCED_PARAMETER(Status);
    UNREFERENCED_PARAMETER(Retry);

    largeInt.QuadPart = 1;

    //
    // Check the status.  The initialization command only needs to be sent
    // if UNIT ATTENTION or LUN NOT READY is returned.
    //

    if (!(Srb->SrbStatus & SRB_STATUS_AUTOSENSE_VALID)) {

        //
        // The drive does not require reinitialization.
        //

        return;
    }

    //
    // Reset the drive type.
    //

    diskData->DriveType = DRIVE_TYPE_NONE;
    diskData->IsDMF = FALSE;

    fdoExtension->DiskGeometry.MediaType = Unknown;

    if (fdoExtension->AdapterDescriptor->BusType == BusTypeUsb) {

        // FLPYDISK.SYS never returns a non-zero value for the ChangeCount
        // on an IOCTL_DISK_CHECK_VERIFY.  Some things seem to work better
        // if we do the same.  In particular, FatVerifyVolume() can exit between
        // the IOCTL_DISK_CHECK_VERIFY and the IOCTL_DISK_GET_DRIVE_GEOMETRY
        // if a non-zero ChangeCount is returned, and this appears to cause
        // issues formatting unformatted media in some situations.
        //
        // This is something that should probably be revisited at some point.
        //
        fdoExtension->MediaChangeCount = 0;

        if (((senseBuffer->SenseKey & 0xf) == SCSI_SENS

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成人先锋电影| 日日嗨av一区二区三区四区| 一区在线观看视频| 亚洲欧美国产三级| 全国精品久久少妇| 高清beeg欧美| 欧美日韩一级视频| 久久尤物电影视频在线观看| 中文字幕一区在线观看| 免费精品视频在线| a亚洲天堂av| 欧洲一区在线观看| 久久嫩草精品久久久精品一| 亚洲成人av免费| 国产91在线看| 欧美一二三区精品| 伊人一区二区三区| 激情小说欧美图片| 欧美日韩免费电影| 欧美主播一区二区三区| 中文字幕欧美日本乱码一线二线| 偷拍亚洲欧洲综合| 91免费版在线| 国产情人综合久久777777| 亚洲第一精品在线| 94-欧美-setu| 久久免费视频色| 亚洲va韩国va欧美va精品| 成人午夜碰碰视频| 欧美电影免费提供在线观看| 亚洲成av人综合在线观看| 日韩欧美一卡二卡| 亚洲黄网站在线观看| 成人av免费在线| 日韩欧美激情四射| 亚洲成人先锋电影| 欧美日韩精品二区第二页| 亚洲欧洲无码一区二区三区| 国产成人综合在线观看| 欧美精品一区二区蜜臀亚洲| 免费成人深夜小野草| 在线不卡欧美精品一区二区三区| 亚洲免费毛片网站| 99久久99久久久精品齐齐| 国产精品视频在线看| 国产成人午夜视频| 国产网站一区二区三区| 国产精品91一区二区| 欧美精品一区二区在线播放| 毛片一区二区三区| 欧美一区二区视频观看视频| 三级影片在线观看欧美日韩一区二区| 欧美综合在线视频| 亚洲一区在线观看网站| 欧美日韩你懂得| 亚洲高清不卡在线| 欧美剧情电影在线观看完整版免费励志电影 | 国产亚洲婷婷免费| 国产一区福利在线| 欧美国产欧美亚州国产日韩mv天天看完整 | 国产欧美一区二区精品忘忧草| 亚洲国产精品久久人人爱蜜臀| 欧美调教femdomvk| 蜜臀av性久久久久蜜臀aⅴ流畅| 日韩欧美一级二级| 国产精品18久久久久久久久| 国产调教视频一区| av一区二区不卡| 亚洲综合色成人| 91精品国产综合久久久久久| 免费成人深夜小野草| 久久精品视频一区| 99久久精品国产一区| 亚洲一区二区三区在线播放| 日韩视频在线一区二区| 日本不卡视频一二三区| 久久久综合九色合综国产精品| 成人午夜电影小说| 一区二区三区视频在线观看| 666欧美在线视频| 国产成人精品免费网站| 国产精品第五页| 亚洲乱码国产乱码精品精98午夜| 欧美日韩国产一二三| 韩国三级在线一区| 日韩码欧中文字| 欧美精品在线观看播放| 国产a精品视频| 午夜久久久久久电影| 久久久激情视频| 欧美日韩黄色一区二区| 国产成人夜色高潮福利影视| 亚洲综合无码一区二区| 777a∨成人精品桃花网| 成人av免费在线播放| 青草av.久久免费一区| 国产精品大尺度| 日韩欧美一二区| 色噜噜狠狠色综合中国| 久久精品国产成人一区二区三区| 一个色妞综合视频在线观看| 久久久精品一品道一区| 欧美日韩国产美女| av一区二区三区黑人| 奇米影视一区二区三区小说| 亚洲免费在线视频| 国产精品美女久久久久高潮 | 日本一道高清亚洲日美韩| 最新中文字幕一区二区三区| 精品国产人成亚洲区| 欧美情侣在线播放| 欧美色综合久久| 国产91精品露脸国语对白| 秋霞国产午夜精品免费视频| 亚洲午夜三级在线| 国产精品久久久久久久午夜片| 精品久久久久久久久久久久久久久| 色婷婷久久久综合中文字幕| 丰满少妇久久久久久久| 九九九精品视频| 青椒成人免费视频| 五月综合激情婷婷六月色窝| 亚洲欧洲av色图| 国产成人亚洲综合a∨婷婷图片| 狠狠色丁香婷综合久久| 国产一区 二区| 成人自拍视频在线观看| av亚洲精华国产精华精| 色老综合老女人久久久| 欧美三级在线看| 欧美精品自拍偷拍动漫精品| 日韩情涩欧美日韩视频| 久久久久成人黄色影片| 国产精品免费av| 亚洲一区在线看| 老司机免费视频一区二区| 国产精品夜夜爽| 色综合久久综合| 欧美丰满嫩嫩电影| 久久久三级国产网站| 亚洲人亚洲人成电影网站色| 亚洲综合清纯丝袜自拍| 老司机精品视频在线| 99久久精品国产一区二区三区 | 国产麻豆一精品一av一免费| 国产999精品久久久久久绿帽| 91丝袜美女网| 亚洲一区在线观看免费| 久久精品国产一区二区三| 成人高清免费观看| 7777女厕盗摄久久久| 日本一区二区视频在线观看| 亚洲一二三级电影| 国产永久精品大片wwwapp| 91香蕉视频mp4| 精品国产欧美一区二区| 一区二区三区欧美视频| 国产一区欧美一区| 欧美色倩网站大全免费| 国产三级精品三级在线专区| 性欧美大战久久久久久久久| 高清久久久久久| 欧美精品久久天天躁| 日韩美女视频一区二区| 国产制服丝袜一区| 欧美日韩成人综合在线一区二区 | 国产精品18久久久久久vr| 欧美日韩一二三区| 亚洲国产精品精华液2区45| 日本视频中文字幕一区二区三区| 成人av资源下载| 欧美不卡视频一区| 亚洲国产精品久久一线不卡| av高清久久久| 欧美经典一区二区| 另类中文字幕网| 欧美一区二区女人| 亚洲成av人片一区二区| proumb性欧美在线观看| 久久综合久久久久88| 日韩和欧美一区二区三区| 欧美性受极品xxxx喷水| 亚洲天堂成人网| 成人黄页毛片网站| 国产午夜精品一区二区| 国内精品伊人久久久久影院对白| 欧美高清www午色夜在线视频| 亚洲乱码精品一二三四区日韩在线| 丰满岳乱妇一区二区三区| 久久综合久久综合九色| 激情综合网av| 日韩免费观看高清完整版在线观看| 亚洲h精品动漫在线观看| 欧美在线小视频| 一区二区三区蜜桃网| 色婷婷久久久久swag精品| 亚洲欧洲日韩在线| 色综合色综合色综合| 一区二区三区国产精品| 色综合 综合色|