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

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

?? pnp.c

?? The Disk sample is used with Classpnp.sys as disk driver. The sample supports Plug and Play, Power M
?? C
?? 第 1 頁 / 共 3 頁
字號:

        RtlInitUnicodeString(&interfaceName, NULL);

        status = IoRegisterDeviceInterface(fdoExtension->LowerPdo,
                                           (LPGUID) &DiskClassGuid,
                                           NULL,
                                           &interfaceName);

        if(NT_SUCCESS(status)) {

            diskData->DiskInterfaceString = interfaceName;
            status = IoSetDeviceInterfaceState(&interfaceName, TRUE);

        } else {
            interfaceName.Buffer = NULL;
        }

        if(!NT_SUCCESS(status)) {

            DebugPrint((1, "DiskInitFdo: Unable to register or set disk DCA "
                           "for fdo %p [%lx]\n", Fdo, status));

            RtlFreeUnicodeString(&interfaceName);
            RtlInitUnicodeString(&(diskData->DiskInterfaceString), NULL);
        }
    }

    DiskCreateSymbolicLinks(Fdo);

    //
    // Determine the type of disk and enable failure preiction in the hardware
    // and enable failure prediction polling.
    //

    if (*InitSafeBootMode == 0)
    {
        DiskDetectFailurePrediction(fdoExtension,
                                  &diskData->FailurePredictionCapability);

        if (diskData->FailurePredictionCapability != FailurePredictionNone)
        {
            //
            // Cool, we've got some sort of failure prediction, enable it
            // at the hardware and then enable polling for it
            //

            //
            // By default we allow performance to be degradeded if failure
            // prediction is enabled.
            //
            // TODO: Make a registry entry ?
            //

            diskData->AllowFPPerfHit = TRUE;

            //
            // Enable polling only after Atapi and SBP2 add support for the new
            // SRB flag that indicates that the request should not reset the
            // drive spin down idle timer.
            //

            status = DiskEnableDisableFailurePredictPolling(fdoExtension,
                                          TRUE,
                                          DISK_DEFAULT_FAILURE_POLLING_PERIOD);

            DebugPrint((3, "DiskInitFdo: Failure Prediction Poll enabled as "
                           "%d for device %p\n",
                     diskData->FailurePredictionCapability,
                     Fdo));
        }
    } else {

        //
        // In safe boot mode we do not enable failure prediction, as perhaps
        // it is the reason why normal boot does not work
        //

        diskData->FailurePredictionCapability = FailurePredictionNone;

    }

    //
    // Initialize the verify mutex
    //

    KeInitializeMutex(&diskData->VerifyMutex, MAX_SECTORS_PER_VERIFY);

    return(STATUS_SUCCESS);

} // end DiskInitFdo()


NTSTATUS
DiskInitPdo(
    IN PDEVICE_OBJECT Pdo
    )

/*++

Routine Description:

    This routine will create the well known names for a PDO and register
    it's device interfaces.

--*/

{
    PCOMMON_DEVICE_EXTENSION pdoExtension = Pdo->DeviceExtension;
    PDISK_DATA diskData = pdoExtension->DriverData;

    UNICODE_STRING interfaceName;

    NTSTATUS status;

    PAGED_CODE();

    DiskCreateSymbolicLinks(Pdo);

    //
    // Register interfaces for this device
    //

    RtlInitUnicodeString(&interfaceName, NULL);

    status = IoRegisterDeviceInterface(Pdo,
                                       (LPGUID) &PartitionClassGuid,
                                       NULL,
                                       &interfaceName);

    if(NT_SUCCESS(status)) {

        diskData->PartitionInterfaceString = interfaceName;
        status = IoSetDeviceInterfaceState(&interfaceName, TRUE);

    } else {
        interfaceName.Buffer = NULL;
    }

    if(!NT_SUCCESS(status)) {
        DebugPrint((1, "DiskInitPdo: Unable to register partition DCA for "
                    "pdo %p [%lx]\n", Pdo, status));

        RtlFreeUnicodeString(&interfaceName);
        RtlInitUnicodeString(&(diskData->PartitionInterfaceString), NULL);
    }

    return STATUS_SUCCESS;
}


NTSTATUS
DiskStartPdo(
    IN PDEVICE_OBJECT Pdo
    )

/*++

Routine Description:

    This routine will create the well known names for a PDO and register
    it's device interfaces.

--*/

{
    PAGED_CODE();

    return STATUS_SUCCESS;
}

NTSTATUS
DiskStopDevice(
    IN PDEVICE_OBJECT DeviceObject,
    IN UCHAR Type
    )

{
    PFUNCTIONAL_DEVICE_EXTENSION fdo = DeviceObject->DeviceExtension;

    if(fdo->CommonExtension.IsFdo) {
        DiskAcquirePartitioningLock(fdo);
        DiskInvalidatePartitionTable(fdo, TRUE);
        DiskReleasePartitioningLock(fdo);
    }

    return STATUS_SUCCESS;
}


NTSTATUS
DiskQueryId(
    IN PDEVICE_OBJECT Pdo,
    IN BUS_QUERY_ID_TYPE IdType,
    IN PUNICODE_STRING UnicodeIdString
    )

/*++

Routine Description:

    This routine generates the PNP id's for the disk's "children".  If the
    specified ID isn't one that the routine can generate it must return
    STATUS_NOT_IMPLEMENTED so classpnp will know not to do anything with the
    PNP request's status.

    This routine allocates the buffer for the UnicodeIdString.  It is the
    caller's responsibility to free the buffer when it's done.

Arguments:

    Pdo - a pointer to the PDO we are to generate an ID for

    IdType - the type of ID to be generated

    UnicodeIdString - a string to put the results into.

Return Value:

    STATUS_SUCCCESS if successful

    STATUS_NOT_IMPLEMENTED if the IdType is not one supported by this routine

    error status otherwise.

--*/

{
    ANSI_STRING ansiIdString;

    NTSTATUS status;

    PAGED_CODE();
    ASSERT_PDO(Pdo);

    if(IdType == BusQueryDeviceID) {

        if((Pdo->Characteristics & FILE_REMOVABLE_MEDIA) == 0) {
            RtlInitAnsiString(&ansiIdString, "STORAGE\\Partition");
            return RtlAnsiStringToUnicodeString(UnicodeIdString, &ansiIdString, TRUE);
        }

        RtlInitAnsiString(&ansiIdString,
                          "STORAGE\\RemovableMedia");

        return RtlAnsiStringToUnicodeString(UnicodeIdString, &ansiIdString, TRUE);
    }

    if(IdType == BusQueryInstanceID) {

        PPHYSICAL_DEVICE_EXTENSION pdoExtension = Pdo->DeviceExtension;
        PCOMMON_DEVICE_EXTENSION commonExtension = Pdo->DeviceExtension;
        PDISK_DATA diskData = commonExtension->PartitionZeroExtension->CommonExtension.DriverData;

        UCHAR string[64];

        if((Pdo->Characteristics & FILE_REMOVABLE_MEDIA) == 0) {

            if (diskData->PartitionStyle == PARTITION_STYLE_MBR) {
                sprintf(string, "S%08lx_O%I64lx_L%I64lx",
                        diskData->Mbr.Signature,
                        commonExtension->StartingOffset,
                        commonExtension->PartitionLength);
            } else {
                sprintf(string,
                        "S%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02xS_O%I64lx_L%I64lx",
                        diskData->Efi.DiskId.Data1,
                        diskData->Efi.DiskId.Data2,
                        diskData->Efi.DiskId.Data3,
                        diskData->Efi.DiskId.Data4[0],
                        diskData->Efi.DiskId.Data4[1],
                        diskData->Efi.DiskId.Data4[2],
                        diskData->Efi.DiskId.Data4[3],
                        diskData->Efi.DiskId.Data4[4],
                        diskData->Efi.DiskId.Data4[5],
                        diskData->Efi.DiskId.Data4[6],
                        diskData->Efi.DiskId.Data4[7],
                        commonExtension->StartingOffset,
                        commonExtension->PartitionLength);
            }
        } else {
            sprintf(string, "RM");
        }

        RtlInitAnsiString(&ansiIdString, string);

        return RtlAnsiStringToUnicodeString(UnicodeIdString, &ansiIdString, TRUE);
    }

    if((IdType == BusQueryHardwareIDs) || (IdType == BusQueryCompatibleIDs)) {

        RtlInitAnsiString(&ansiIdString, "STORAGE\\Volume");

        UnicodeIdString->MaximumLength = (USHORT) RtlAnsiStringToUnicodeSize(&ansiIdString) + sizeof(UNICODE_NULL);

        UnicodeIdString->Buffer = ExAllocatePoolWithTag(PagedPool,
                                                        UnicodeIdString->MaximumLength,
                                                        DISK_TAG_PNP_ID);

        if(UnicodeIdString->Buffer == NULL) {
            return STATUS_INSUFFICIENT_RESOURCES;
        }

        RtlZeroMemory(UnicodeIdString->Buffer, UnicodeIdString->MaximumLength);

        return RtlAnsiStringToUnicodeString(UnicodeIdString,
                                            &ansiIdString,
                                            FALSE);
    }

    return STATUS_NOT_IMPLEMENTED;
}


NTSTATUS
DiskGenerateDeviceName(
    IN BOOLEAN IsFdo,
    IN ULONG DeviceNumber,
    IN OPTIONAL ULONG PartitionNumber,
    IN OPTIONAL PLARGE_INTEGER StartingOffset,
    IN OPTIONAL PLARGE_INTEGER PartitionLength,
    OUT PUCHAR *RawName
    )

/*++

Routine Description:

    This routine will allocate a unicode string buffer and then fill it in
    with a generated name for the specified device object.

    It is the responsibility of the user to allocate a UNICODE_STRING structure
    to pass in and to free UnicodeName->Buffer when done with it.

Arguments:

    DeviceObject - a pointer to the device object

    UnicodeName - a unicode string to put the name buffer into

Return Value:

    status

--*/

//#define PDO_NAME_FORMAT "\\Device\\Harddisk%d\\DP(%d)%d"
#define PDO_NAME_FORMAT "\\Device\\Harddisk%d\\DP(%d)%#I64x-%#I64x+%lx"
#define FDO_NAME_FORMAT "\\Device\\Harddisk%d\\DR%d"

//#define PDO_NAME_FORMAT (PDO_BASE_NAME "+%#I64x+%#I64x+%#lx")

{
    UCHAR rawName[64];
    static ULONG diskDeviceSequenceNumber = 0;

    PAGED_CODE();

    if(!IsFdo) {

        ASSERT(ARGUMENT_PRESENT((PVOID)(ULONG_PTR) PartitionNumber));
        ASSERT(ARGUMENT_PRESENT(PartitionLength));
        ASSERT(ARGUMENT_PRESENT(StartingOffset));

        sprintf(rawName, PDO_NAME_FORMAT, DeviceNumber, PartitionNumber,
                                          StartingOffset->QuadPart,
                                          PartitionLength->QuadPart,
                                          diskDeviceSequenceNumber++);
    } else {

        ASSERT(!ARGUMENT_PRESENT((PVOID)(ULONG_PTR) PartitionNumber));
        ASSERT(!ARGUMENT_PRESENT(PartitionLength));
        ASSERT(!ARGUMENT_PRESENT(StartingOffset));

        sprintf(rawName, FDO_NAME_FORMAT, DeviceNumber,
                                          diskDeviceSequenceNumber++);

    }

    *RawName = ExAllocatePoolWithTag(PagedPool,
                                     strlen(rawName) + 1,
                                     DISK_TAG_NAME);

    if(*RawName == NULL) {
        return STATUS_INSUFFICIENT_RESOURCES;
    }

    strcpy(*RawName, rawName);

    DebugPrint((2, "DiskGenerateDeviceName: generated \"%s\"\n", rawName));

    return STATUS_SUCCESS;
}


VOID
DiskCreateSymbolicLinks(
    IN PDEVICE_OBJECT DeviceObject
    )

/*++

Routine Description:

    This routine will generate a symbolic link for the specified device object
    using the well known form \\Device\HarddiskX\PartitionY, where X and Y are
    filled in using the partition information in the device object's extension.

    This routine will not try to delete any previous symbolic link for the
    same generated name - the caller must make sure the symbolic link has
    been broken before calling this routine.

Arguments:

    DeviceObject - the device object to make a well known name for

Return Value:

    STATUS

--*/

{
    PCOMMON_DEVICE_EXTENSION commonExtension = DeviceObject->DeviceExtension;

    PDISK_DATA diskData = commonExtension->DriverData;

    WCHAR wideSourceName[64];
    UNICODE_STRING unicodeSourceName;

    NTSTATUS status;

    PAGED_CODE();

    //
    // Build the destination for the link first using the device name
    // stored in the device object
    //

    ASSERT(commonExtension->DeviceName.Buffer);

    if(!diskData->LinkStatus.WellKnownNameCreated) {
        //
        // Put together the source name using the partition and device number
        // in the device extension and disk data segment
        //

        swprintf(wideSourceName, L"\\Device\\Harddisk%d\\Partition%d",
                 commonExtension->PartitionZeroExtension->DeviceNumber,
                 (commonExtension->IsFdo ?
                    0 :
                    commonExtension->PartitionNumber));

        RtlInitUnicodeString(&unicodeSourceName, wideSourceName);

        DebugPrint((1, "DiskCreateSymbolicLink: Linking %wZ to %wZ\n",
                   &unicodeSourceName,
                   &commonExtension->DeviceName));

        status = IoCreateSymbolicLink(&unicodeSourceName,
                                      &commonExtension->DeviceName);

    #if DBG

        if((status == STATUS_OBJECT_NAME_EXISTS) ||
           (status == STATUS_OBJECT_NAME_COLLISION)) {

            DebugPrint((1, "DiskCreateSymbolicLink: name %wZ already exists\n",
                        &unicodeSourceName));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
97se亚洲国产综合自在线不卡 | 色老汉一区二区三区| jizzjizzjizz欧美| 欧美一区二区三区在线观看| 欧美韩日一区二区三区四区| 亚洲成人免费视频| 高清视频一区二区| 9191成人精品久久| 亚洲日本一区二区三区| 黄一区二区三区| 在线观看日韩av先锋影音电影院| 国产欧美精品日韩区二区麻豆天美| 亚洲国产精品久久一线不卡| 波多野结衣亚洲| 久久综合九色综合97婷婷女人 | 欧美一区日韩一区| 亚洲精品国产一区二区精华液 | 国产精品国产精品国产专区不片| 亚洲 欧美综合在线网络| 99re亚洲国产精品| 中文字幕乱码久久午夜不卡 | 欧美剧情片在线观看| 亚洲免费电影在线| 欧美疯狂做受xxxx富婆| 亚洲精品中文字幕在线观看| av一区二区三区在线| 国产婷婷色一区二区三区在线| 日本午夜一本久久久综合| 欧美特级限制片免费在线观看| 亚洲男女毛片无遮挡| 99久久精品国产观看| 最新不卡av在线| 99久久国产综合精品麻豆| 国产精品萝li| 97久久人人超碰| 亚洲欧洲日产国产综合网| 成人午夜免费av| 国产精品美女久久福利网站| 成人动漫中文字幕| 中文字幕在线免费不卡| 成人a级免费电影| 一区精品在线播放| 日本道精品一区二区三区| 亚洲欧洲综合另类| 色噜噜久久综合| 亚洲最新在线观看| 欧美剧情电影在线观看完整版免费励志电影| 亚洲精品国产无天堂网2021| 91豆麻精品91久久久久久| 香蕉乱码成人久久天堂爱免费| 欧美日韩国产影片| 久久国产剧场电影| 欧美激情在线一区二区| 91免费国产在线观看| 亚洲一区二区中文在线| 日韩一级片网站| 国产福利精品导航| 亚洲精品日韩专区silk| 欧美久久一二区| 国产精品99久久久久久久女警| 国产精品五月天| 精品视频在线免费| 久久91精品久久久久久秒播| 国产精品久久毛片| 国产精品免费久久久久| 91欧美一区二区| 免费日本视频一区| 国产精品三级视频| 欧美嫩在线观看| 国产91在线观看| 亚洲午夜久久久久久久久久久| 日韩免费在线观看| 972aa.com艺术欧美| 蜜臀久久99精品久久久画质超高清 | 国产日韩在线不卡| 欧美曰成人黄网| 国产成人在线视频网站| 亚洲国产日韩a在线播放性色| 欧美成人精品3d动漫h| 99re热这里只有精品视频| 美腿丝袜亚洲三区| 一区二区三区四区乱视频| 久久嫩草精品久久久精品| 欧美日韩在线免费视频| 成人国产精品免费观看视频| 亚洲与欧洲av电影| 国产精品青草综合久久久久99| 91精品国产黑色紧身裤美女| 一本大道久久a久久精二百| 国产乱一区二区| 免费在线欧美视频| 亚洲制服丝袜在线| 综合久久一区二区三区| 久久久精品免费观看| 欧美一区二区视频在线观看2020 | 成人黄页毛片网站| 久久电影网电视剧免费观看| 亚洲成人手机在线| 一区二区三区不卡在线观看| 日本一区二区在线不卡| 2014亚洲片线观看视频免费| 日韩一区二区精品葵司在线| 欧美在线|欧美| 欧美中文字幕久久| 91理论电影在线观看| aaa亚洲精品一二三区| 成av人片一区二区| 波多野结衣一区二区三区| 丁香婷婷综合激情五月色| 国产精品18久久久久久vr| 激情综合色播激情啊| 久久国产综合精品| 久久66热re国产| 国产精品88av| 国产福利一区在线| 成人国产免费视频| 91老师国产黑色丝袜在线| 99精品视频在线观看免费| 99久久99久久精品国产片果冻 | 亚洲久草在线视频| 亚洲男同性恋视频| 一区二区三区欧美| 亚洲国产va精品久久久不卡综合| 亚洲成人综合网站| 蜜臀av亚洲一区中文字幕| 免费成人深夜小野草| 久久99久久99| 国产精品中文字幕欧美| 大白屁股一区二区视频| av男人天堂一区| 欧美无人高清视频在线观看| 欧美日韩激情在线| 日韩欧美中文字幕公布| 久久久久久久一区| 综合分类小说区另类春色亚洲小说欧美| 国产精品久久久久天堂| 一区二区三区精品久久久| 午夜av电影一区| 激情综合网av| 一本色道久久综合亚洲91| 欧美日韩一区三区| 337p粉嫩大胆色噜噜噜噜亚洲| 国产亲近乱来精品视频| 樱桃视频在线观看一区| 免费成人深夜小野草| 成人久久18免费网站麻豆| 日本高清免费不卡视频| 日韩一区二区不卡| 国产精品免费久久久久| 日韩成人一区二区三区在线观看| 国产一区二区电影| 91久久久免费一区二区| 精品国产99国产精品| 亚洲日本电影在线| 久久国产生活片100| 色婷婷综合久久久| 精品国产不卡一区二区三区| 亚洲黄色小视频| 国产专区欧美精品| 欧美四级电影网| 国产精品无圣光一区二区| 日韩高清一级片| 91无套直看片红桃| 精品99999| 亚洲成a人v欧美综合天堂下载| 国产精品 日产精品 欧美精品| 欧美日韩一二三区| 中文字幕免费一区| 久久99九九99精品| 欧美性高清videossexo| 欧美激情一区二区三区不卡 | 日韩免费看网站| 一区二区三区四区精品在线视频| 国产一区二区日韩精品| 欧美日韩一级二级| 亚洲精品免费电影| 成人天堂资源www在线| 91精品国产综合久久久蜜臀粉嫩| 自拍偷自拍亚洲精品播放| 国产黑丝在线一区二区三区| 欧美精品第1页| 亚洲电影视频在线| 91亚洲精品乱码久久久久久蜜桃| 国产亚洲综合色| 韩国视频一区二区| 91麻豆精品国产91久久久久| 亚洲一区免费在线观看| 91论坛在线播放| 亚洲欧美另类久久久精品| 福利一区在线观看| 国产偷国产偷亚洲高清人白洁| 久久国产精品99久久久久久老狼 | 美腿丝袜一区二区三区| 欧美久久久久久久久中文字幕| 亚洲人成网站色在线观看| 91在线视频在线| 日韩久久一区二区| 99re8在线精品视频免费播放| 中文字幕乱码亚洲精品一区| www.色综合.com|