forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
fscache: teach fscache to use NtQueryDirectoryFile #1937
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dscho
merged 2 commits into
git-for-windows:master
from
benpeart:fscache-NtQueryDirectoryFile-gfw
Nov 27, 2018
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
#ifndef _NTIFS_ | ||
#define _NTIFS_ | ||
|
||
/* | ||
* Copy necessary structures and definitions out of the Windows DDK | ||
benpeart marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* to enable calling NtQueryDirectoryFile() | ||
*/ | ||
|
||
typedef _Return_type_success_(return >= 0) LONG NTSTATUS; | ||
#define NT_SUCCESS(Status) (((NTSTATUS)(Status)) >= 0) | ||
|
||
typedef struct _UNICODE_STRING { | ||
USHORT Length; | ||
USHORT MaximumLength; | ||
#ifdef MIDL_PASS | ||
[size_is(MaximumLength / 2), length_is((Length) / 2)] USHORT * Buffer; | ||
#else // MIDL_PASS | ||
_Field_size_bytes_part_(MaximumLength, Length) PWCH Buffer; | ||
#endif // MIDL_PASS | ||
} UNICODE_STRING; | ||
typedef UNICODE_STRING *PUNICODE_STRING; | ||
typedef const UNICODE_STRING *PCUNICODE_STRING; | ||
|
||
typedef enum _FILE_INFORMATION_CLASS { | ||
FileDirectoryInformation = 1, | ||
FileFullDirectoryInformation, | ||
FileBothDirectoryInformation, | ||
FileBasicInformation, | ||
FileStandardInformation, | ||
FileInternalInformation, | ||
FileEaInformation, | ||
FileAccessInformation, | ||
FileNameInformation, | ||
FileRenameInformation, | ||
FileLinkInformation, | ||
FileNamesInformation, | ||
FileDispositionInformation, | ||
FilePositionInformation, | ||
FileFullEaInformation, | ||
FileModeInformation, | ||
FileAlignmentInformation, | ||
FileAllInformation, | ||
FileAllocationInformation, | ||
FileEndOfFileInformation, | ||
FileAlternateNameInformation, | ||
FileStreamInformation, | ||
FilePipeInformation, | ||
FilePipeLocalInformation, | ||
FilePipeRemoteInformation, | ||
FileMailslotQueryInformation, | ||
FileMailslotSetInformation, | ||
FileCompressionInformation, | ||
FileObjectIdInformation, | ||
FileCompletionInformation, | ||
FileMoveClusterInformation, | ||
FileQuotaInformation, | ||
FileReparsePointInformation, | ||
FileNetworkOpenInformation, | ||
FileAttributeTagInformation, | ||
FileTrackingInformation, | ||
FileIdBothDirectoryInformation, | ||
FileIdFullDirectoryInformation, | ||
FileValidDataLengthInformation, | ||
FileShortNameInformation, | ||
FileIoCompletionNotificationInformation, | ||
FileIoStatusBlockRangeInformation, | ||
FileIoPriorityHintInformation, | ||
FileSfioReserveInformation, | ||
FileSfioVolumeInformation, | ||
FileHardLinkInformation, | ||
FileProcessIdsUsingFileInformation, | ||
FileNormalizedNameInformation, | ||
FileNetworkPhysicalNameInformation, | ||
FileIdGlobalTxDirectoryInformation, | ||
FileIsRemoteDeviceInformation, | ||
FileAttributeCacheInformation, | ||
FileNumaNodeInformation, | ||
FileStandardLinkInformation, | ||
FileRemoteProtocolInformation, | ||
FileMaximumInformation | ||
} FILE_INFORMATION_CLASS, *PFILE_INFORMATION_CLASS; | ||
|
||
typedef struct _FILE_FULL_DIR_INFORMATION { | ||
ULONG NextEntryOffset; | ||
ULONG FileIndex; | ||
LARGE_INTEGER CreationTime; | ||
LARGE_INTEGER LastAccessTime; | ||
LARGE_INTEGER LastWriteTime; | ||
LARGE_INTEGER ChangeTime; | ||
LARGE_INTEGER EndOfFile; | ||
LARGE_INTEGER AllocationSize; | ||
ULONG FileAttributes; | ||
ULONG FileNameLength; | ||
ULONG EaSize; | ||
WCHAR FileName[1]; | ||
} FILE_FULL_DIR_INFORMATION, *PFILE_FULL_DIR_INFORMATION; | ||
|
||
typedef struct _IO_STATUS_BLOCK { | ||
union { | ||
NTSTATUS Status; | ||
PVOID Pointer; | ||
} DUMMYUNIONNAME; | ||
ULONG_PTR Information; | ||
} IO_STATUS_BLOCK, *PIO_STATUS_BLOCK; | ||
|
||
typedef VOID | ||
(NTAPI *PIO_APC_ROUTINE)( | ||
IN PVOID ApcContext, | ||
IN PIO_STATUS_BLOCK IoStatusBlock, | ||
IN ULONG Reserved); | ||
|
||
NTSYSCALLAPI | ||
NTSTATUS | ||
NTAPI | ||
NtQueryDirectoryFile( | ||
_In_ HANDLE FileHandle, | ||
_In_opt_ HANDLE Event, | ||
_In_opt_ PIO_APC_ROUTINE ApcRoutine, | ||
_In_opt_ PVOID ApcContext, | ||
_Out_ PIO_STATUS_BLOCK IoStatusBlock, | ||
_Out_writes_bytes_(Length) PVOID FileInformation, | ||
_In_ ULONG Length, | ||
_In_ FILE_INFORMATION_CLASS FileInformationClass, | ||
_In_ BOOLEAN ReturnSingleEntry, | ||
_In_opt_ PUNICODE_STRING FileName, | ||
_In_ BOOLEAN RestartScan | ||
); | ||
|
||
#define STATUS_NO_MORE_FILES ((NTSTATUS)0x80000006L) | ||
|
||
#endif |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.