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

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

?? volinfo.c

?? Windows內核級文件系統訪問操作驅動程序
?? C
字號:
/*++

Copyright (c) Microsoft Corporation. All rights reserved. 

You may only use this code if you agree to the terms of the Windows Research Kernel Source Code License agreement (see License.txt).
If you do not agree to the terms, do not use the code.


Module Name:

    VolInfo.c

Abstract:

    This module implements the volume information routines for Raw called by
    the dispatch driver.

--*/

#include "RawProcs.h"

NTSTATUS
RawQueryFsVolumeInfo (
    IN PVCB Vcb,
    IN PFILE_FS_VOLUME_INFORMATION Buffer,
    IN OUT PULONG Length
    );

NTSTATUS
RawQueryFsSizeInfo (
    IN PVCB Vcb,
    IN PFILE_FS_SIZE_INFORMATION Buffer,
    IN OUT PULONG Length
    );

NTSTATUS
RawQueryFsDeviceInfo (
    IN PVCB Vcb,
    IN PFILE_FS_DEVICE_INFORMATION Buffer,
    IN OUT PULONG Length
    );

NTSTATUS
RawQueryFsAttributeInfo (
    IN PVCB Vcb,
    IN PFILE_FS_ATTRIBUTE_INFORMATION Buffer,
    IN OUT PULONG Length
    );

#ifdef ALLOC_PRAGMA
#pragma alloc_text(PAGE, RawQueryVolumeInformation)
#pragma alloc_text(PAGE, RawQueryFsVolumeInfo)
#pragma alloc_text(PAGE, RawQueryFsSizeInfo)
#pragma alloc_text(PAGE, RawQueryFsDeviceInfo)
#pragma alloc_text(PAGE, RawQueryFsAttributeInfo)
#endif


NTSTATUS
RawQueryVolumeInformation (
    IN PVCB Vcb,
    IN PIRP Irp,
    IN PIO_STACK_LOCATION IrpSp
    )

/*++

Routine Description:

    This routine implements the NtQueryVolumeInformation API call.

Arguments:

    Vcb - Supplies the volume being queried.

    Irp - Supplies the Irp being processed.

    IrpSp - Supplies parameters describing the read

Return Value:

    NTSTATUS - The status for the Irp.

--*/

{
    NTSTATUS Status;

    ULONG Length;
    FS_INFORMATION_CLASS FsInformationClass;
    PVOID Buffer;

    PAGED_CODE();

    //
    //  Reference our input parameters to make things easier
    //

    Length = IrpSp->Parameters.QueryVolume.Length;
    FsInformationClass = IrpSp->Parameters.QueryVolume.FsInformationClass;
    Buffer = Irp->AssociatedIrp.SystemBuffer;

    //
    //  Based on the information class we'll do different actions.  Each
    //  of the procedures that we're calling fills up the output buffer
    //  if possible and returns true if it successfully filled the buffer
    //  and false if it couldn't wait for any I/O to complete.
    //

    switch (FsInformationClass) {

    case FileFsVolumeInformation:

        Status = RawQueryFsVolumeInfo( Vcb, Buffer, &Length );
        break;

    case FileFsSizeInformation:

        Status = RawQueryFsSizeInfo( Vcb, Buffer, &Length );
        break;

    case FileFsDeviceInformation:

        Status = RawQueryFsDeviceInfo( Vcb, Buffer, &Length );
        break;

    case FileFsAttributeInformation:

        Status = RawQueryFsAttributeInfo( Vcb, Buffer, &Length );
        break;

    default:

        Status = STATUS_INVALID_PARAMETER;
        break;
    }

    //
    //  Set the information field to the number of bytes actually filled in,
    //  and complete the request.
    //

    Irp->IoStatus.Information = IrpSp->Parameters.QueryVolume.Length - Length;

    RawCompleteRequest( Irp, Status );

    return Status;
}


//
//  Internal support routine
//

NTSTATUS
RawQueryFsVolumeInfo (
    IN PVCB Vcb,
    IN PFILE_FS_VOLUME_INFORMATION Buffer,
    IN OUT PULONG Length
    )

/*++

Routine Description:

    This routine implements the query volume info call

Arguments:

    Vcb - Supplies the Vcb being queried

    Buffer - Supplies a pointer to the output buffer where the information
        is to be returned

    Length - Supplies the length of the buffer in byte.  This variable
        upon return receives the remaining bytes free in the buffer

Return Value:

    NTSTATUS - Returns the status for the query

--*/

{
    PAGED_CODE();

    //
    //  Zero out the buffer, then extract and fill up the non zero fields.
    //

    RtlZeroMemory( Buffer, sizeof(FILE_FS_VOLUME_INFORMATION) );

    Buffer->VolumeSerialNumber = Vcb->Vpb->SerialNumber;

    Buffer->SupportsObjects = FALSE;

    Buffer->VolumeLabelLength = 0;

    *Length -= FIELD_OFFSET(FILE_FS_VOLUME_INFORMATION, VolumeLabel[0]);

    //
    //  Set our status and return to our caller
    //

    return STATUS_SUCCESS;
}


//
//  Internal support routine
//

NTSTATUS
RawQueryFsSizeInfo (
    IN PVCB Vcb,
    IN PFILE_FS_SIZE_INFORMATION Buffer,
    IN OUT PULONG Length
    )

/*++

Routine Description:

    This routine implements the query volume size call

Arguments:

    Vcb - Supplies the Vcb being queried

    Buffer - Supplies a pointer to the output buffer where the information
        is to be returned

    Length - Supplies the length of the buffer in byte.  This variable
        upon return receives the remaining bytes free in the buffer

Return Value:

    Status - Returns the status for the query

--*/

{
    PIRP Irp;
    KEVENT Event;
    NTSTATUS Status;
    IO_STATUS_BLOCK Iosb;
    PDEVICE_OBJECT RealDevice;

    DISK_GEOMETRY DiskGeometry;
    PARTITION_INFORMATION PartitionInformation;
    GET_LENGTH_INFORMATION GetLengthInformation;

    BOOLEAN DriveIsPartitioned;

    PAGED_CODE();

    //
    //  Make sure the buffer is large enough
    //

    if (*Length < sizeof(FILE_FS_SIZE_INFORMATION)) {

        return STATUS_BUFFER_OVERFLOW;
    }

    RtlZeroMemory( Buffer, sizeof(FILE_FS_SIZE_INFORMATION) );

    //
    //  Prepare for our device control below.  The device drivers only
    //  have to copy geometry and partition info from in-memory structures,
    //  so it is OK to make these calls even when we can't wait.
    //

    KeInitializeEvent( &Event, NotificationEvent, FALSE );
    RealDevice = Vcb->Vpb->RealDevice;

    //
    //  Query the disk geometry
    //

    Irp = IoBuildDeviceIoControlRequest( IOCTL_DISK_GET_DRIVE_GEOMETRY,
                                         RealDevice,
                                         NULL,
                                         0,
                                         &DiskGeometry,
                                         sizeof(DISK_GEOMETRY),
                                         FALSE,
                                         &Event,
                                         &Iosb );

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

    if ( (Status = IoCallDriver( RealDevice, Irp )) == STATUS_PENDING ) {

        (VOID) KeWaitForSingleObject( &Event,
                                      Executive,
                                      KernelMode,
                                      FALSE,
                                      (PLARGE_INTEGER)NULL );

        Status = Iosb.Status;
    }

    //
    //  If this call didn't succeed, the drive hasn't even been low-level
    //  formatted, and thus geometry information is undefined.
    //

    if (!NT_SUCCESS( Status )) {

        *Length = 0;
        return Status;
    }

    //
    //  See if we have to check the partition information (floppy disks are
    //  the only type that can't have partitions )
    //

    if ( FlagOn( RealDevice->Characteristics, FILE_FLOPPY_DISKETTE )) {

        DriveIsPartitioned = FALSE;
        PartitionInformation.PartitionLength.QuadPart = 0;

    } else {

        //
        //  Query the length info.
        //

        KeResetEvent( &Event );

        Irp = IoBuildDeviceIoControlRequest( IOCTL_DISK_GET_LENGTH_INFO,
                                             RealDevice,
                                             NULL,
                                             0,
                                             &GetLengthInformation,
                                             sizeof(GET_LENGTH_INFORMATION),
                                             FALSE,
                                             &Event,
                                             &Iosb );

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

        if ( (Status = IoCallDriver( RealDevice, Irp )) == STATUS_PENDING ) {

            (VOID) KeWaitForSingleObject( &Event,
                                          Executive,
                                          KernelMode,
                                          FALSE,
                                          (PLARGE_INTEGER)NULL );

            Status = Iosb.Status;
        }

        PartitionInformation.PartitionLength = GetLengthInformation.Length;

        if ( !NT_SUCCESS (Status) ) {

            //
            //  Query the partition table
            //

            KeResetEvent( &Event );

            Irp = IoBuildDeviceIoControlRequest( IOCTL_DISK_GET_PARTITION_INFO,
                                                 RealDevice,
                                                 NULL,
                                                 0,
                                                 &PartitionInformation,
                                                 sizeof(PARTITION_INFORMATION),
                                                 FALSE,
                                                 &Event,
                                                 &Iosb );

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

            if ( (Status = IoCallDriver( RealDevice, Irp )) == STATUS_PENDING ) {

                (VOID) KeWaitForSingleObject( &Event,
                                              Executive,
                                              KernelMode,
                                              FALSE,
                                              (PLARGE_INTEGER)NULL );

                Status = Iosb.Status;
            }

            //
            //  If we get back invalid device request, the disk is not partitioned
            //

            if ( !NT_SUCCESS (Status) ) {

                DriveIsPartitioned = FALSE;

            } else {

                DriveIsPartitioned = TRUE;
            }

        } else {

            DriveIsPartitioned = TRUE;
        }
    }

    //
    //  Set the output buffer
    //

    Buffer->BytesPerSector = DiskGeometry.BytesPerSector;

    Buffer->SectorsPerAllocationUnit = 1;

    //
    //  Now, based on whether the disk is partitioned, compute the
    //  total number of sectors on this disk.
    //

    Buffer->TotalAllocationUnits =
    Buffer->AvailableAllocationUnits = ( DriveIsPartitioned == TRUE ) ?

        RtlExtendedLargeIntegerDivide( PartitionInformation.PartitionLength,
                                       DiskGeometry.BytesPerSector,
                                       NULL )

                                        :

        RtlExtendedIntegerMultiply( DiskGeometry.Cylinders,
                                    DiskGeometry.TracksPerCylinder *
                                    DiskGeometry.SectorsPerTrack );

    //
    //  Adjust the length variable
    //

    *Length -= sizeof(FILE_FS_SIZE_INFORMATION);

    //
    //  And return success to our caller
    //

    return STATUS_SUCCESS;
}


//
//  Internal support routine
//

NTSTATUS
RawQueryFsDeviceInfo (
    IN PVCB Vcb,
    IN PFILE_FS_DEVICE_INFORMATION Buffer,
    IN OUT PULONG Length
    )

/*++

Routine Description:

    This routine implements the query volume device call

Arguments:

    Vcb - Supplies the Vcb being queried

    Buffer - Supplies a pointer to the output buffer where the information
        is to be returned

    Length - Supplies the length of the buffer in byte.  This variable
        upon return receives the remaining bytes free in the buffer

Return Value:

    Status - Returns the status for the query

--*/

{
    PAGED_CODE();

    //
    //  Make sure the buffer is large enough
    //

    if (*Length < sizeof(FILE_FS_DEVICE_INFORMATION)) {

        return STATUS_BUFFER_OVERFLOW;
    }

    RtlZeroMemory( Buffer, sizeof(FILE_FS_DEVICE_INFORMATION) );

    //
    //  Set the output buffer
    //

    Buffer->DeviceType = FILE_DEVICE_DISK;

    Buffer->Characteristics = Vcb->TargetDeviceObject->Characteristics;

    //
    //  Adjust the length variable
    //

    *Length -= sizeof(FILE_FS_DEVICE_INFORMATION);

    //
    //  And return success to our caller
    //

    return STATUS_SUCCESS;
}


//
//  Internal support routine
//

NTSTATUS
RawQueryFsAttributeInfo (
    IN PVCB Vcb,
    IN PFILE_FS_ATTRIBUTE_INFORMATION Buffer,
    IN OUT PULONG Length
    )

/*++

Routine Description:

    This routine implements the query volume attribute call

Arguments:

    Vcb - Supplies the Vcb being queried

    Buffer - Supplies a pointer to the output buffer where the information
        is to be returned

    Length - Supplies the length of the buffer in byte.  This variable
        upon return receives the remaining bytes free in the buffer

Return Value:

    Status - Returns the status for the query

--*/

{
    ULONG LengthUsed;

    UNREFERENCED_PARAMETER( Vcb );

    PAGED_CODE();

    //
    //  Check if the buffer we're given is long enough to contain "Raw"
    //

    LengthUsed = FIELD_OFFSET(FILE_FS_ATTRIBUTE_INFORMATION, FileSystemName[0]) + 6;

    if (*Length < LengthUsed) {

        return STATUS_BUFFER_OVERFLOW;
    }

    //
    //  Set the output buffer
    //

    Buffer->FileSystemAttributes       = 0;
    Buffer->MaximumComponentNameLength = 0;
    Buffer->FileSystemNameLength       = 6;
    RtlCopyMemory( &Buffer->FileSystemName[0], L"RAW", 6 );

    //
    //  Adjust the length variable
    //

    *Length -= LengthUsed;

    //
    //  And return success to our caller
    //

    return STATUS_SUCCESS;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久综合国产精品| 色域天天综合网| 亚洲激情男女视频| 精品1区2区3区| 久久国产精品99久久久久久老狼| 337p日本欧洲亚洲大胆精品| av激情成人网| 午夜精品久久一牛影视| 精品国产乱码久久久久久浪潮| 成人av免费在线观看| 久久草av在线| 亚洲精品欧美综合四区| 日韩欧美的一区| 91老司机福利 在线| 久久成人18免费观看| 亚洲乱码国产乱码精品精可以看| 日韩一级黄色大片| 成人黄色软件下载| 久久精品国产网站| 亚洲人成电影网站色mp4| 欧美v日韩v国产v| 欧美亚洲一区二区在线| 国产成人精品一区二区三区网站观看| 亚洲福利国产精品| 国产精品超碰97尤物18| 日韩久久精品一区| 91传媒视频在线播放| 高清不卡在线观看av| 免费av网站大全久久| 亚洲摸摸操操av| 久久精品一区蜜桃臀影院| 成人app网站| 久久精品国产亚洲高清剧情介绍 | 一区二区三区美女| 日本一区二区三区国色天香| 日韩精品一区国产麻豆| 欧美日韩精品专区| 色综合色综合色综合色综合色综合 | 精品成人一区二区| 91福利在线免费观看| 国产成人免费在线视频| 久久精品国产色蜜蜜麻豆| 亚洲免费在线播放| 国产精品高潮呻吟久久| 国产亚洲一区二区三区在线观看| 日韩精品在线网站| 欧美一卡在线观看| 在线播放一区二区三区| 欧美日韩欧美一区二区| 国产91清纯白嫩初高中在线观看| 久草在线在线精品观看| 日韩国产成人精品| 午夜亚洲福利老司机| 亚洲一区二区视频在线观看| 一区二区中文字幕在线| 欧美高清在线一区二区| 亚洲啪啪综合av一区二区三区| 亚洲激情av在线| 视频在线观看国产精品| 久久成人免费网| 欧美日韩亚洲综合| 在线一区二区三区做爰视频网站| 欧美日韩在线三级| 欧美白人最猛性xxxxx69交| 国产亚洲一二三区| 亚洲欧美日韩一区二区 | 高清成人免费视频| 色老头久久综合| 91精品国产91综合久久蜜臀| 久久女同互慰一区二区三区| 亚洲私人黄色宅男| 日韩精品91亚洲二区在线观看| 国产一区二区电影| 日本黄色一区二区| 日韩欧美一级二级三级久久久| 久久五月婷婷丁香社区| 亚洲激情男女视频| 久久电影网电视剧免费观看| 99久久久无码国产精品| 欧美精品黑人性xxxx| 精品成人佐山爱一区二区| 亚洲三级在线观看| 日本亚洲电影天堂| 91亚洲资源网| 日韩美女视频一区二区在线观看| 18涩涩午夜精品.www| 视频一区国产视频| 成人免费av在线| 欧美疯狂做受xxxx富婆| 国产精品久久久久永久免费观看| 亚洲国产精品影院| 国产精品一区二区三区99| 欧美色图12p| 国产欧美视频一区二区| 日韩精品乱码免费| av电影在线观看一区| 欧美一区2区视频在线观看| 亚洲人123区| 国产精品一区在线观看乱码| 欧美日韩国产天堂| 国产精品毛片a∨一区二区三区| 天堂久久久久va久久久久| 成人自拍视频在线观看| 欧美成人r级一区二区三区| 一区二区欧美视频| www.色综合.com| 日韩色视频在线观看| 亚洲综合视频网| 成人avav影音| 久久久不卡影院| 免费成人结看片| 欧美日韩国产成人在线免费| 国产精品久久久久一区二区三区共 | 欧美精品亚洲二区| 亚洲色图制服诱惑 | 久久久噜噜噜久久中文字幕色伊伊 | 成人污视频在线观看| 精品免费日韩av| 青青草一区二区三区| 欧美视频精品在线观看| 亚洲人成在线播放网站岛国| 国产白丝网站精品污在线入口| 日韩欧美国产午夜精品| 午夜电影久久久| 欧美性大战xxxxx久久久| 亚洲欧洲成人自拍| 国产精品系列在线观看| 亚洲精品一区二区三区99| 日韩—二三区免费观看av| 色诱视频网站一区| 亚洲精选视频免费看| 波多野结衣亚洲| 欧美国产精品久久| 成人国产在线观看| 国产精品乱码妇女bbbb| 成人ar影院免费观看视频| 国产精品午夜免费| 成人性生交大片免费| 国产亚洲综合色| 国产iv一区二区三区| 国产亚洲视频系列| 粉嫩一区二区三区在线看| 亚洲成a人片在线不卡一二三区| 99久久精品国产网站| 亚洲视频一区在线观看| 色就色 综合激情| 亚洲18女电影在线观看| 91精品欧美综合在线观看最新| 麻豆国产一区二区| 26uuu欧美| av一二三不卡影片| 亚洲午夜久久久久久久久电影院| 欧美日本一道本在线视频| 奇米一区二区三区av| 久久综合国产精品| 99re热这里只有精品免费视频| 自拍偷在线精品自拍偷无码专区| 在线视频亚洲一区| 婷婷综合另类小说色区| 日韩女优视频免费观看| 国产老肥熟一区二区三区| 国产精品福利影院| 欧美久久久一区| 国产精品白丝jk白祙喷水网站 | 亚洲成av人片观看| 欧美一区午夜精品| 成人理论电影网| 亚洲国产精品人人做人人爽| 欧美成人三级电影在线| 波多野结衣在线一区| 亚洲成人av在线电影| 久久综合九色综合欧美就去吻 | 日日欢夜夜爽一区| 国产丝袜欧美中文另类| 欧美色欧美亚洲另类二区| 国产自产v一区二区三区c| 国产精品久久久久久久久快鸭| 欧美在线影院一区二区| 黄色小说综合网站| 亚洲欧美日韩国产另类专区| 精品国产一区二区国模嫣然| av综合在线播放| 日本成人超碰在线观看| 国产精品高潮呻吟久久| 欧美一级视频精品观看| 91在线你懂得| 国产一区二区三区电影在线观看| 一区二区三区四区在线免费观看| 精品日韩一区二区三区| 欧洲av一区二区嗯嗯嗯啊| 国产毛片精品一区| 日本中文字幕一区二区有限公司| 国产精品嫩草影院com| 日韩一区二区精品在线观看| 91蜜桃在线观看| 国产精品123区| 日韩av一区二区在线影视| 亚洲人成网站精品片在线观看| 久久精品夜夜夜夜久久| 91精品国产色综合久久久蜜香臀|