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

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

?? pnp.c

?? The Disk sample is used with Classpnp.sys as disk driver. The sample supports Plug and Play, Power M
?? C
?? 第 1 頁 / 共 3 頁
字號:
        } 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);

    //
    // Initialize the flush group context
    //

    RtlZeroMemory(&diskData->FlushContext, sizeof(DISK_GROUP_CONTEXT));

    InitializeListHead(&diskData->FlushContext.CurrList);
    InitializeListHead(&diskData->FlushContext.NextList);

    KeInitializeMutex(&diskData->FlushContext.Mutex, 0);
    KeInitializeEvent(&diskData->FlushContext.Event, SynchronizationEvent, FALSE);

    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 (!TEST_FLAG(Pdo->Characteristics, FILE_REMOVABLE_MEDIA)) {

            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] = { 0 };

        if (!TEST_FLAG(Pdo->Characteristics, FILE_REMOVABLE_MEDIA)) {

            if (diskData->PartitionStyle == PARTITION_STYLE_MBR) {

                _snprintf(string, sizeof(string) - 1,
                          "S%08lx_O%I64lx_L%I64lx",
                          diskData->Mbr.Signature,
                          commonExtension->StartingOffset.QuadPart,
                          commonExtension->PartitionLength.QuadPart);

            } else {

                _snprintf(string, sizeof(string) - 1,
                          "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.QuadPart,
                          commonExtension->PartitionLength.QuadPart);
            }

        } 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)%#I64x-%#I64x+%lx"
#define FDO_NAME_FORMAT "\\Device\\Harddisk%d\\DR%d"

{
    UCHAR rawName[64] = { 0 };

    PAGED_CODE();

    if(!IsFdo) {

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

        _snprintf(rawName, sizeof(rawName) - 1, 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));

        _snprintf(rawName, sizeof(rawName) - 1, FDO_NAME_FORMAT, DeviceNumber,
                                                diskDeviceSequenceNumber++);

    }

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

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

    strncpy(*RawName, rawName, strlen(rawName) + 1);

    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] = { 0 };
    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
        //

        _snwprintf(wideSourceName, sizeof(wideSourceName) / sizeof(wideSourceName[0]) - 1, 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));

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品一区中文字幕| 91精品一区二区三区久久久久久| 99久久伊人久久99| 精品视频在线看| 久久精品免视看| 亚洲va欧美va国产va天堂影院| 国产乱国产乱300精品| 在线播放国产精品二区一二区四区| 国产亚洲va综合人人澡精品| 香蕉乱码成人久久天堂爱免费| 国产成人无遮挡在线视频| 欧美蜜桃一区二区三区| 亚洲人xxxx| 国产白丝精品91爽爽久久| 欧美一区午夜视频在线观看| 亚洲欧美一区二区不卡| 菠萝蜜视频在线观看一区| 欧美zozozo| 蜜臀av在线播放一区二区三区| 91日韩精品一区| 国产精品网站在线| 国产suv精品一区二区三区| 日韩免费高清视频| 老司机午夜精品| 7777精品伊人久久久大香线蕉最新版 | 成人小视频免费观看| 精品久久久久久久人人人人传媒| 午夜国产不卡在线观看视频| 91电影在线观看| 亚洲欧美经典视频| 久久免费看少妇高潮| 免费精品视频在线| 制服丝袜中文字幕亚洲| 日韩电影在线观看电影| 欧美高清视频不卡网| 日韩av一区二区三区| 欧美精三区欧美精三区| 日本aⅴ精品一区二区三区| 91精品视频网| 麻豆久久久久久| 欧美精品一区二区三区视频| 国产一区二区在线免费观看| 久久久夜色精品亚洲| 成人精品一区二区三区四区| 欧美国产精品专区| 99视频热这里只有精品免费| 亚洲日本韩国一区| 欧美日韩精品久久久| 美女一区二区三区在线观看| 久久新电视剧免费观看| 成人免费视频一区二区| 亚洲码国产岛国毛片在线| 在线影视一区二区三区| 日韩国产高清在线| 久久久精品国产99久久精品芒果| 成人午夜免费电影| 夜夜精品视频一区二区| 4438x亚洲最大成人网| 久久国产精品露脸对白| 国产日产欧产精品推荐色| 不卡的av网站| 偷拍日韩校园综合在线| 久久午夜色播影院免费高清| 97se亚洲国产综合自在线| 天天色 色综合| 久久精品欧美日韩精品| 欧美在线观看视频一区二区| 裸体一区二区三区| 国产精品国产自产拍高清av| 欧美色综合网站| 黄页视频在线91| 一区二区三区自拍| 欧美tickling挠脚心丨vk| 99精品偷自拍| 久久99国产精品久久99果冻传媒 | 欧美色综合久久| 国产一区二区不卡老阿姨| 亚洲欧美日韩国产综合| 精品少妇一区二区三区日产乱码| 99久久久精品| 蜜臀av亚洲一区中文字幕| **性色生活片久久毛片| 欧美一区二区啪啪| 色妞www精品视频| 91精品国产色综合久久久蜜香臀| 国产一区二区三区高清播放| 亚洲国产裸拍裸体视频在线观看乱了| 欧美成人性战久久| 欧美三级一区二区| 成人黄色综合网站| 六月婷婷色综合| 亚洲国产欧美另类丝袜| 国产精品久久久久精k8| 久久这里只精品最新地址| 欧美日本一区二区三区| 91麻豆福利精品推荐| 国产精品一区二区在线看| 青青草精品视频| 亚洲电影在线免费观看| 亚洲欧美一区二区三区极速播放| 久久久影视传媒| 亚洲精品一区二区精华| 欧美一区二区三区视频在线| 欧美在线观看视频一区二区三区 | 色噜噜久久综合| 成人app软件下载大全免费| 狠狠色综合播放一区二区| 日本午夜精品一区二区三区电影| 亚洲一区二区在线播放相泽| 中文字幕日韩欧美一区二区三区| 欧美精品一区二区三区四区| 日韩一卡二卡三卡四卡| 91精品国产高清一区二区三区蜜臀| 在线精品亚洲一区二区不卡| 91香蕉视频黄| 91麻豆精品秘密| 色综合中文字幕国产 | 国产精品国产精品国产专区不片| 国产亚洲精品超碰| 久久精品一区蜜桃臀影院| 久久久噜噜噜久久人人看| 久久久精品黄色| 国产欧美日韩在线| 国产精品久久久一本精品 | 风间由美性色一区二区三区| 大胆亚洲人体视频| 99天天综合性| 欧美最猛黑人xxxxx猛交| 欧美亚洲综合久久| 欧美日韩在线播放三区四区| 91精品国产高清一区二区三区蜜臀| 欧美一区二区福利视频| 精品国产乱码久久久久久影片| 日本成人在线看| 久久精品国产久精国产| 国产一区二区不卡在线| 高清beeg欧美| 色婷婷综合久色| 欧美精品亚洲一区二区在线播放| 欧美二区乱c少妇| 精品国产三级a在线观看| 中文字幕乱码亚洲精品一区| 亚洲天堂av一区| 午夜精彩视频在线观看不卡| 国模无码大尺度一区二区三区| 丁香婷婷综合网| 欧美在线影院一区二区| 日韩欧美国产午夜精品| 国产精品女同一区二区三区| 天天综合天天做天天综合| 精品在线亚洲视频| 色综合久久中文字幕综合网| 91精品国产91热久久久做人人| 久久久亚洲精品一区二区三区| 亚洲乱码国产乱码精品精可以看 | 激情五月婷婷综合| 91丝袜高跟美女视频| 日韩一区二区三区免费观看| 亚洲国产精品t66y| 午夜国产不卡在线观看视频| 成人小视频免费在线观看| 欧美电影一区二区三区| 日本一区二区视频在线观看| 视频一区视频二区中文字幕| 成人午夜私人影院| 日韩欧美一区二区不卡| 亚洲激情图片小说视频| 美女一区二区久久| 在线观看亚洲一区| 欧美激情一区二区三区蜜桃视频| 一区二区三区成人| 国产福利精品导航| 91精品国产色综合久久不卡电影 | 亚洲高清视频中文字幕| 国产98色在线|日韩| 日韩你懂的在线观看| 一区二区久久久| www.欧美色图| 久久久久国色av免费看影院| 日本特黄久久久高潮| 在线一区二区三区四区| 国产精品国产三级国产专播品爱网 | 欧美主播一区二区三区| 国产精品麻豆欧美日韩ww| 国产美女精品一区二区三区| 宅男在线国产精品| 亚洲v中文字幕| 欧美日韩在线三区| 一区二区三区小说| 99这里都是精品| 中文字幕亚洲区| 懂色av一区二区三区免费看| 石原莉奈在线亚洲三区| 欧美在线不卡一区| 一区二区在线观看视频在线观看| 波多野结衣91| 18欧美乱大交hd1984| 色拍拍在线精品视频8848| 一区二区三区四区在线| 色综合中文综合网|