#include <nt.h>
#include <ntdef.h>
#include <ntrtl.h>
#include <nturtl.h>
#include <windef.h>
#include <winbase.h>
Go to the source code of this file.
Defines | |
#define | GetSiteSidFromToken xxxGetSiteSidFromToken |
#define | GetMangledSiteSid xxxGetMangledSiteSid |
#define | IsTokenRestricted xxxIsTokenRestricted |
#define | CALL_CREATE(object) |
#define | CALL_OPEN(object) |
Enumerations | |
enum | { eUnRestricted = 0, eRestricted, eUnknownRestricted } |
Functions | |
void | Base32Encode (LPVOID pvData, UINT cbData, LPWSTR pchData) |
HRESULT | GetMangledSiteSid (PSID pSid, ULONG cchMangledSite, LPWSTR *ppwszMangledSite) |
PSID | GetSiteSidFromToken (IN HANDLE TokenHandle) |
BOOL | IsTokenRestricted (IN HANDLE TokenHandle) |
BOOL | IsInterestingPath (OBJECT_ATTRIBUTES *NormalFile, OBJECT_ATTRIBUTES *RestrictedFile) |
NTSTATUS | CopyRestrictedFile (OBJECT_ATTRIBUTES *SourceAttributes, OBJECT_ATTRIBUTES *DestinationAttributes) |
NTSTATUS | CreateDirectories (OBJECT_ATTRIBUTES *Attributes) |
BOOL | FileExists (OBJECT_ATTRIBUTES *Attributes) |
NTSTATUS | CopyStream (HANDLE SourceFile, HANDLE DestinationFile, FILE_STREAM_INFORMATION *StreamInfo, BYTE *Buffer, ULONG BufferSize) |
NTSTATUS | InitializeRestrictedStuff () |
NTSTATUS | NtUnRestrictedCreateFile (OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PLARGE_INTEGER AllocationSize OPTIONAL, IN ULONG FileAttributes, IN ULONG ShareAccess, IN ULONG CreateDisposition, IN ULONG CreateOptions, IN PVOID EaBuffer OPTIONAL, IN ULONG EaLength) |
NTSTATUS | NtUnRestrictedOpenFile (OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN ULONG ShareAccess, IN ULONG OpenOptions) |
NTSTATUS | NtUnRestrictedDeleteFile (IN POBJECT_ATTRIBUTES ObjectAttributes) |
NTSTATUS | NtUnRestrictedQueryAttributesFile (IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PFILE_BASIC_INFORMATION FileInformation) |
NTSTATUS | NtUnRestrictedSetInformationFile (IN HANDLE FileHandle, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PVOID FileInformation, IN ULONG Length, IN FILE_INFORMATION_CLASS FileInformationClass) |
void | CheckRestricted () |
__inline BOOL | IsRestricted () |
NTSTATUS | NtCreateFile (OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PLARGE_INTEGER AllocationSize OPTIONAL, IN ULONG FileAttributes, IN ULONG ShareAccess, IN ULONG CreateDisposition, IN ULONG CreateOptions, IN PVOID EaBuffer OPTIONAL, IN ULONG EaLength) |
NTSTATUS | ZwCreateFile (OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PLARGE_INTEGER AllocationSize OPTIONAL, IN ULONG FileAttributes, IN ULONG ShareAccess, IN ULONG CreateDisposition, IN ULONG CreateOptions, IN PVOID EaBuffer OPTIONAL, IN ULONG EaLength) |
NTSTATUS | NtOpenFile (OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN ULONG ShareAccess, IN ULONG OpenOptions) |
NTSTATUS | ZwOpenFile (OUT PHANDLE FileHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PIO_STATUS_BLOCK IoStatusBlock, IN ULONG ShareAccess, IN ULONG OpenOptions) |
NTSTATUS | NtDeleteFile (IN POBJECT_ATTRIBUTES ObjectAttributes) |
NTSTATUS | ZwDeleteFile (IN POBJECT_ATTRIBUTES ObjectAttributes) |
NTSTATUS | NtQueryAttributesFile (IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PFILE_BASIC_INFORMATION FileInformation) |
NTSTATUS | ZwQueryAttributesFile (IN POBJECT_ATTRIBUTES ObjectAttributes, OUT PFILE_BASIC_INFORMATION FileInformation) |
NTSTATUS | NtSetInformationFile (IN HANDLE FileHandle, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PVOID FileInformation, IN ULONG Length, IN FILE_INFORMATION_CLASS FileInformationClass) |
NTSTATUS | ZwSetInformationFile (IN HANDLE FileHandle, OUT PIO_STATUS_BLOCK IoStatusBlock, IN PVOID FileInformation, IN ULONG Length, IN FILE_INFORMATION_CLASS FileInformationClass) |
BOOL | IsInterestingPath (IN POBJECT_ATTRIBUTES NormalFile, IN OUT POBJECT_ATTRIBUTES RestrictedFile) |
Variables | |
enum { ... } | Restricted |
UNICODE_STRING | SystemPath1 = {0, 0, 0} |
UNICODE_STRING | SystemPath2 = {0, 0, 0} |
UNICODE_STRING | SystemPath3 = {0, 0, 0} |
UNICODE_STRING | SiteDirectory = {0, 0, 0} |
|
Value:
Referenced by NtCreateFile(). |
|
Value:
Referenced by NtOpenFile(). |
|
Definition at line 38 of file restrfil.c. Referenced by InitializeRestrictedStuff(). |
|
Definition at line 37 of file restrfil.c. Referenced by InitializeRestrictedStuff(). |
|
Definition at line 39 of file restrfil.c. Referenced by CheckRestricted(). |
|
Definition at line 113 of file restrfil.c.
|
|
Definition at line 1953 of file restrfil.c. Referenced by GetMangledSiteSid().
|
|
Definition at line 129 of file restrfil.c. References Buffer, BYTE, DWORD, eRestricted, eUnRestricted, InitializeRestrictedStuff(), IsTokenRestricted, L, NT_SUCCESS, NtClose(), NtOpenKey(), NtOpenProcessToken(), NtQueryValueKey(), NTSTATUS(), NULL, Restricted, RtlInitUnicodeString(), and Status. Referenced by IsRestricted().
|
|
Definition at line 1596 of file restrfil.c. References ASSERT, Buffer, BufferSize, BYTE, CopyStream(), CreateDirectories(), NT_SUCCESS, NtClose(), NtQueryInformationFile(), NtSetInformationFile(), NTSTATUS(), NtUnRestrictedCreateFile(), NtUnRestrictedDeleteFile(), NtUnRestrictedOpenFile(), NtUnRestrictedQueryAttributesFile(), NULL, RtlAllocateHeap, RtlFreeHeap, and Status. Referenced by NtCreateFile(), and NtOpenFile().
|
|
Definition at line 1451 of file restrfil.c. References Buffer, BufferSize, L, NT_SUCCESS, NtClose(), NtReadFile(), NTSTATUS(), NtUnRestrictedCreateFile(), NtUnRestrictedOpenFile(), NtWriteFile(), NULL, Status, and USHORT. Referenced by CopyRestrictedFile().
|
|
Definition at line 1311 of file restrfil.c. References ASSERT, L, NT_SUCCESS, NtClose(), NTSTATUS(), NtUnRestrictedCreateFile(), NULL, SiteDirectory, and Status. Referenced by CopyRestrictedFile(), and NtCreateFile().
|
|
Definition at line 1423 of file restrfil.c. References BOOL, NtQueryAttributesFile(), NTSTATUS(), and Status. Referenced by NtCreateFile().
|
|
Definition at line 1915 of file restrfil.c. References ASSERT, Base32Encode(), DWORD, RtlSubAuthorityCountSid(), and RtlSubAuthoritySid().
|
|
Definition at line 1844 of file restrfil.c. References NT_SUCCESS, NtQueryInformationToken(), NTSTATUS(), NULL, RtlAllocateHeap, RtlCopySid(), RtlFreeHeap, RtlLengthSid(), Status, and UINT.
|
|
Definition at line 879 of file restrfil.c. References BOOL, Buffer, BufferSize, FALSE, GetMangledSiteSid, GetSiteSidFromToken, Initialized, L, NT_SUCCESS, NtClose(), NtOpenKey(), NtOpenProcessToken(), NtQueryObject(), NtQueryValueKey(), NTSTATUS(), NtUnRestrictedOpenFile(), NULL, RtlAllocateHeap, RtlAppendUnicodeToString(), RtlCreateUnicodeString(), RtlExpandEnvironmentStrings_U(), RtlFormatCurrentUserKeyPath(), RtlFreeHeap, RtlFreeSid(), RtlFreeUnicodeString(), RtlInitUnicodeString(), SiteDirectory, Status, SystemPath1, SystemPath2, SystemPath3, and USHORT. Referenced by CheckRestricted().
|
|
Definition at line 1163 of file restrfil.c. References BOOL, Buffer, BYTE, FALSE, L, NT_SUCCESS, NtQueryObject(), NTSTATUS(), NULL, RtlAllocateHeap, RtlAppendUnicodeStringToString(), RtlAppendUnicodeToString(), RtlCopyUnicodeString(), RtlPrefixUnicodeString(), SiteDirectory, Status, SystemPath1, SystemPath2, SystemPath3, and TRUE. Referenced by NtCreateFile(), NtDeleteFile(), NtOpenFile(), NtQueryAttributesFile(), and NtSetInformationFile().
|
|
|
|
Definition at line 223 of file restrfil.c. References CheckRestricted(), eRestricted, eUnknownRestricted, eUnRestricted, FALSE, and Restricted. Referenced by NtCreateFile(), NtDeleteFile(), NtOpenFile(), NtQueryAttributesFile(), NtSetInformationFile(), xxxCallHook2(), and xxxProcessNotifyWinEvent().
|
|
Definition at line 2001 of file restrfil.c. References BOOL, FALSE, NT_SUCCESS, NtQueryInformationToken(), NTSTATUS(), NULL, RtlAllocateHeap, RtlFreeHeap, Status, and TRUE.
|
|
Definition at line 253 of file restrfil.c. References CALL_CREATE, CopyRestrictedFile(), CreateDirectories(), FileExists(), IsInterestingPath(), IsRestricted(), NT_SUCCESS, NTSTATUS(), ObjectAttributes, RtlFreeHeap, and Status.
|
|
Definition at line 602 of file restrfil.c. References IsInterestingPath(), IsRestricted(), NT_SUCCESS, NTSTATUS(), NtUnRestrictedDeleteFile(), ObjectAttributes, RtlFreeHeap, and Status.
|
|
Definition at line 449 of file restrfil.c. References CALL_OPEN, CopyRestrictedFile(), IsInterestingPath(), IsRestricted(), NT_SUCCESS, NTSTATUS(), ObjectAttributes, RtlFreeHeap, and Status.
|
|
Definition at line 663 of file restrfil.c. References IsInterestingPath(), IsRestricted(), NT_SUCCESS, NTSTATUS(), NtUnRestrictedQueryAttributesFile(), ObjectAttributes, RtlFreeHeap, and Status.
|
|
Definition at line 740 of file restrfil.c. References IsInterestingPath(), IsRestricted(), NT_SUCCESS, NTSTATUS(), NtUnRestrictedSetInformationFile(), NULL, RtlAllocateHeap, RtlFreeHeap, Status, and USHORT. Referenced by SepClientOpenPipe().
|
|
Referenced by CopyRestrictedFile(), CopyStream(), and CreateDirectories(). |
|
Referenced by CopyRestrictedFile(), and NtDeleteFile(). |
|
Referenced by CopyRestrictedFile(), CopyStream(), and InitializeRestrictedStuff(). |
|
Referenced by CopyRestrictedFile(), and NtQueryAttributesFile(). |
|
Referenced by NtSetInformationFile(). |
|
Definition at line 418 of file restrfil.c. References FileAttributes, NtCreateFile(), and ObjectAttributes. Referenced by CmpOpenFileWithExtremePrejudice(), CmpOpenHiveFiles(), FsRecCreateAndRegisterDO(), FsRtlpOpenDev(), IoepGetErrCaseDB(), IopBootLogToFile(), OpenDevice(), and UserBeep().
|
|
Definition at line 655 of file restrfil.c. References NtDeleteFile(), NTSTATUS(), and ObjectAttributes.
|
|
Definition at line 582 of file restrfil.c. References NtOpenFile(), and ObjectAttributes. Referenced by CmpOpenFileWithExtremePrejudice(), DbgkCreateThread(), DbgkpSectionHandleToFileHandle(), GetNextReparseVolumePath(), IoAttachDevice(), IoGetDeviceObjectPointer(), IopApplySystemPartitionProt(), IopGetDumpStack(), IopMarkBootPartition(), MiLoadSystemImage(), OpenDeviceReparseIndex(), PsLocateSystemDll(), QueryDeviceNameForPath(), RtlpOpenImageFile(), and xHalIoAssignDriveLetters().
|
|
Definition at line 729 of file restrfil.c. References NtQueryAttributesFile(), and ObjectAttributes. Referenced by CmpOpenFileWithExtremePrejudice().
|
|
Definition at line 861 of file restrfil.c. References NtSetInformationFile(). Referenced by CmpDoFileSetSize(), CmpOpenFileWithExtremePrejudice(), CmpWorker(), and NtCreatePagingFile().
|
|
Referenced by CheckRestricted(), IsRestricted(), SepMaximumAccessCheck(), SepNormalAccessCheck(), and SepSidInTokenEx(). |
|
Definition at line 124 of file restrfil.c. Referenced by CreateDirectories(), InitializeRestrictedStuff(), and IsInterestingPath(). |
|
Definition at line 121 of file restrfil.c. Referenced by InitializeRestrictedStuff(), and IsInterestingPath(). |
|
Definition at line 122 of file restrfil.c. Referenced by InitializeRestrictedStuff(), and IsInterestingPath(). |
|
Definition at line 123 of file restrfil.c. Referenced by InitializeRestrictedStuff(), and IsInterestingPath(). |