NtQueryInformationFile

C# Signature:

[DllImport("ntdll.dll", SetLastError=true)] static extern IntPtr NtQueryInformationFile(IntPtr fileHandle, ref IO_STATUS_BLOCK IoStatusBlock, IntPtr pInfoBlock, uint length, FILE_INFORMATION_CLASS fileInformation);

VB Signature:

Declare Function NtQueryInformationFile Lib "ntdll.dll" (ByVal fileHandle As IntPtr, ByRef IoStatusBlock As IO_STATUS_BLOCK, ByVal pInfoBlock As IntPtr, ByVal length As UInteger, ByVal fileInformation As FILE_INFORMATION_CLASS) As IntPtr

VB User-Defined Types:

Structure IO_STATUS_BLOCK
        Dim status As UInteger
        Dim information As ULong
    End Structure

VB User-Defined Types:

Enum FILE_INFORMATION_CLASS
        FileDirectoryInformation = 1
        FileFullDirectoryInformation
        FileBothDirectoryInformation
        FileBasicInformation
        FileStandardInformation
        FileInternalInformation
        FileEaInformation
        FileAccessInformation
        FileNameInformation
        FileRenameInformation
        FileLinkInformation
        FileNamesInformation
        FileDispositionInformation
        FilePositionInformation
        FileFullEaInformation
        FileModeInformation = 16
        FileAlignmentInformation
        FileAllInformation
        FileAllocationInformation
        FileEndOfFileInformation
        FileAlternateNameInformation
        FileStreamInformation
        FilePipeInformation
        FilePipeLocalInformation
        FilePipeRemoteInformation
        FileMailslotQueryInformation
        FileMailslotSetInformation
        FileCompressionInformation
        FileObjectIdInformation
        FileCompletionInformation
        FileMoveClusterInformation
        FileQuotaInformation
        FileReparsePointInformation
        FileNetworkOpenInformation
        FileAttributeTagInformation
        FileTrackingInformation
        FileIdBothDirectoryInformation
        FileIdFullDirectoryInformation
        FileValidDataLengthInformation
        FileShortNameInformation
        FileHardLinkInformation = 46
    End Enum

C# User-Defined Types:

Sample Code:

Última actualización