ReactOS  0.4.14-dev-556-g4c5b21f
ntifs_ex.h File Reference
#include "Include/ntddk_ex.h"
Include dependency graph for ntifs_ex.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FULL_SECURITY_INFORMATION   (OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION)
 
#define IsFileObjectReadOnly(FO)   (!((FO)->WriteAccess | (FO)->DeleteAccess))
 
#define FSCTL_GET_COMPRESSION   CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)
 
#define FSCTL_SET_COMPRESSION   CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 16, METHOD_BUFFERED, FILE_READ_DATA | FILE_WRITE_DATA)
 
#define FSCTL_GET_NTFS_VOLUME_DATA   CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 25, METHOD_BUFFERED, FILE_ANY_ACCESS)
 
#define FSCTL_GET_NTFS_FILE_RECORD   CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 26, METHOD_BUFFERED, FILE_ANY_ACCESS)
 
#define FSCTL_GET_HFS_INFORMATION   CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 31, METHOD_BUFFERED, FILE_ANY_ACCESS)
 
#define FILE_VOLUME_QUOTAS   0x00000020
 
#define FILE_SUPPORTS_SPARSE_FILES   0x00000040
 
#define FILE_SUPPORTS_REPARSE_POINTS   0x00000080
 
#define FILE_SUPPORTS_REMOTE_STORAGE   0x00000100
 
#define FS_LFN_APIS   0x00004000
 
#define FILE_SUPPORTS_OBJECT_IDS   0x00010000
 
#define FILE_SUPPORTS_ENCRYPTION   0x00020000
 
#define FILE_NAMED_STREAMS   0x00040000
 
#define FILE_READ_ONLY_VOLUME   0x00080000
 
#define VOLUME_IS_DIRTY   (0x00000001)
 
#define VOLUME_UPGRADE_SCHEDULED   (0x00000002)
 
#define FILE_ATTRIBUTE_SPARSE_FILE   0x00000200
 
#define FILE_ATTRIBUTE_REPARSE_POINT   0x00000400
 
#define FILE_ATTRIBUTE_COMPRESSED   0x00000800
 
#define FILE_ATTRIBUTE_OFFLINE   0x00001000
 
#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED   0x00002000
 
#define FILE_ATTRIBUTE_ENCRYPTED   0x00004000
 
#define FileFsFullSizeInformation   (FS_INFORMATION_CLASS(7))
 
#define FileFsObjectIdInformation   (FS_INFORMATION_CLASS(8))
 
#define FileFsDriverPathInformation   (FS_INFORMATION_CLASS(9))
 
#define IRP_MN_SURPRISE_REMOVAL   0x17
 
#define IoCopyCurrentIrpStackLocationToNext(Irp)
 
#define IoSkipCurrentIrpStackLocation(Irp)
 
#define VPB_REMOVE_PENDING   0x00000008
 
#define FSRTL_VOLUME_DISMOUNT   1
 
#define FSRTL_VOLUME_DISMOUNT_FAILED   2
 
#define FSRTL_VOLUME_LOCK   3
 
#define FSRTL_VOLUME_LOCK_FAILED   4
 
#define FSRTL_VOLUME_UNLOCK   5
 
#define FSRTL_VOLUME_MOUNT   6
 

Typedefs

typedef NTSTATUS(* ptrFsRtlNotifyVolumeEvent) (IN PFILE_OBJECT FileObject, IN ULONG EventCode)
 

Functions

__inline PVOID MmGetSystemAddressForMdlSafer (IN PMDL Mdl)
 
NTSYSAPI NTSTATUS NTAPI RtlSetGroupSecurityDescriptor (IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor, IN PSID Group, IN BOOLEAN GroupDefaulted)
 
NTSYSAPI NTSTATUS NTAPI RtlSetSaclSecurityDescriptor (IN OUT PSECURITY_DESCRIPTOR SecurityDescriptor, IN BOOLEAN SaclPresent, IN PACL Sacl, IN BOOLEAN SaclDefaulted)
 
NTSYSAPI PUCHAR NTAPI RtlSubAuthorityCountSid (IN PSID Sid)
 
NTSYSAPI NTSTATUS NTAPI RtlAbsoluteToSelfRelativeSD (IN PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor, IN OUT PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor, IN PULONG BufferLength)
 
NTSYSAPI NTSTATUS NTAPI RtlAllocateAndInitializeSid (IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, IN UCHAR SubAuthorityCount, IN ULONG SubAuthority0, IN ULONG SubAuthority1, IN ULONG SubAuthority2, IN ULONG SubAuthority3, IN ULONG SubAuthority4, IN ULONG SubAuthority5, IN ULONG SubAuthority6, IN ULONG SubAuthority7, OUT PSID *Sid)
 
NTSYSAPI NTSTATUS NTAPI RtlConvertSidToUnicodeString (OUT PUNICODE_STRING DestinationString, IN PVOID Sid, IN BOOLEAN AllocateDestinationString)
 
NTSYSAPI NTSTATUS NTAPI RtlGetGroupSecurityDescriptor (IN PSECURITY_DESCRIPTOR SecurityDescriptor, OUT PSID *Group, OUT PBOOLEAN GroupDefaulted)
 
NTSYSAPI NTSTATUS NTAPI RtlGetOwnerSecurityDescriptor (IN PSECURITY_DESCRIPTOR SecurityDescriptor, OUT PSID *Owner, OUT PBOOLEAN OwnerDefaulted)
 
NTSYSAPI NTSTATUS NTAPI RtlInitializeSid (IN OUT PSID Sid, IN PSID_IDENTIFIER_AUTHORITY IdentifierAuthority, IN UCHAR SubAuthorityCount)
 
NTSYSAPI NTSTATUS NTAPI ZwFsControlFile (IN HANDLE DeviceHandle, IN HANDLE Event OPTIONAL, IN PIO_APC_ROUTINE ApcRoutine OPTIONAL, IN PVOID ApcContext OPTIONAL, OUT PIO_STATUS_BLOCK IoStatusBlock, IN ULONG IoControlCode, IN PVOID InputBuffer, IN ULONG InputBufferSize, OUT PVOID OutputBuffer, IN ULONG OutputBufferSize)
 
NTSYSAPI NTSTATUS NTAPI ZwDeviceIoControlFile (IN HANDLE DeviceHandle, IN HANDLE Event OPTIONAL, IN PIO_APC_ROUTINE UserApcRoutine OPTIONAL, IN PVOID UserApcContext OPTIONAL, OUT PIO_STATUS_BLOCK IoStatusBlock, IN ULONG IoControlCode, IN PVOID InputBuffer, IN ULONG InputBufferSize, OUT PVOID OutputBuffer, IN ULONG OutputBufferSize)
 
NTSYSAPI NTSTATUS NTAPI ZwQueryVolumeInformationFile (IN HANDLE FileHandle, OUT PIO_STATUS_BLOCK IoStatusBlock, OUT PVOID FsInformation, IN ULONG Length, IN FS_INFORMATION_CLASS FsInformationClass)
 

Macro Definition Documentation

◆ FILE_ATTRIBUTE_COMPRESSED

#define FILE_ATTRIBUTE_COMPRESSED   0x00000800

Definition at line 382 of file ntifs_ex.h.

◆ FILE_ATTRIBUTE_ENCRYPTED

#define FILE_ATTRIBUTE_ENCRYPTED   0x00004000

Definition at line 385 of file ntifs_ex.h.

◆ FILE_ATTRIBUTE_NOT_CONTENT_INDEXED

#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED   0x00002000

Definition at line 384 of file ntifs_ex.h.

◆ FILE_ATTRIBUTE_OFFLINE

#define FILE_ATTRIBUTE_OFFLINE   0x00001000

Definition at line 383 of file ntifs_ex.h.

◆ FILE_ATTRIBUTE_REPARSE_POINT

#define FILE_ATTRIBUTE_REPARSE_POINT   0x00000400

Definition at line 381 of file ntifs_ex.h.

◆ FILE_ATTRIBUTE_SPARSE_FILE

#define FILE_ATTRIBUTE_SPARSE_FILE   0x00000200

Definition at line 380 of file ntifs_ex.h.

◆ FILE_NAMED_STREAMS

#define FILE_NAMED_STREAMS   0x00040000

Definition at line 324 of file ntifs_ex.h.

◆ FILE_READ_ONLY_VOLUME

#define FILE_READ_ONLY_VOLUME   0x00080000

Definition at line 325 of file ntifs_ex.h.

◆ FILE_SUPPORTS_ENCRYPTION

#define FILE_SUPPORTS_ENCRYPTION   0x00020000

Definition at line 323 of file ntifs_ex.h.

◆ FILE_SUPPORTS_OBJECT_IDS

#define FILE_SUPPORTS_OBJECT_IDS   0x00010000

Definition at line 322 of file ntifs_ex.h.

◆ FILE_SUPPORTS_REMOTE_STORAGE

#define FILE_SUPPORTS_REMOTE_STORAGE   0x00000100

Definition at line 320 of file ntifs_ex.h.

◆ FILE_SUPPORTS_REPARSE_POINTS

#define FILE_SUPPORTS_REPARSE_POINTS   0x00000080

Definition at line 319 of file ntifs_ex.h.

◆ FILE_SUPPORTS_SPARSE_FILES

#define FILE_SUPPORTS_SPARSE_FILES   0x00000040

Definition at line 318 of file ntifs_ex.h.

◆ FILE_VOLUME_QUOTAS

#define FILE_VOLUME_QUOTAS   0x00000020

Definition at line 317 of file ntifs_ex.h.

◆ FileFsDriverPathInformation

#define FileFsDriverPathInformation   (FS_INFORMATION_CLASS(9))

Definition at line 391 of file ntifs_ex.h.

◆ FileFsFullSizeInformation

#define FileFsFullSizeInformation   (FS_INFORMATION_CLASS(7))

Definition at line 389 of file ntifs_ex.h.

◆ FileFsObjectIdInformation

#define FileFsObjectIdInformation   (FS_INFORMATION_CLASS(8))

Definition at line 390 of file ntifs_ex.h.

◆ FS_LFN_APIS

#define FS_LFN_APIS   0x00004000

Definition at line 321 of file ntifs_ex.h.

◆ FSCTL_GET_COMPRESSION

Definition at line 258 of file ntifs_ex.h.

◆ FSCTL_GET_HFS_INFORMATION

#define FSCTL_GET_HFS_INFORMATION   CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 31, METHOD_BUFFERED, FILE_ANY_ACCESS)

Definition at line 264 of file ntifs_ex.h.

◆ FSCTL_GET_NTFS_FILE_RECORD

#define FSCTL_GET_NTFS_FILE_RECORD   CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 26, METHOD_BUFFERED, FILE_ANY_ACCESS)

Definition at line 262 of file ntifs_ex.h.

◆ FSCTL_GET_NTFS_VOLUME_DATA

#define FSCTL_GET_NTFS_VOLUME_DATA   CTL_CODE(FILE_DEVICE_FILE_SYSTEM, 25, METHOD_BUFFERED, FILE_ANY_ACCESS)

Definition at line 261 of file ntifs_ex.h.

◆ FSCTL_SET_COMPRESSION

Definition at line 259 of file ntifs_ex.h.

◆ FSRTL_VOLUME_DISMOUNT

#define FSRTL_VOLUME_DISMOUNT   1

Definition at line 439 of file ntifs_ex.h.

◆ FSRTL_VOLUME_DISMOUNT_FAILED

#define FSRTL_VOLUME_DISMOUNT_FAILED   2

Definition at line 440 of file ntifs_ex.h.

◆ FSRTL_VOLUME_LOCK

#define FSRTL_VOLUME_LOCK   3

Definition at line 441 of file ntifs_ex.h.

◆ FSRTL_VOLUME_LOCK_FAILED

#define FSRTL_VOLUME_LOCK_FAILED   4

Definition at line 442 of file ntifs_ex.h.

◆ FSRTL_VOLUME_MOUNT

#define FSRTL_VOLUME_MOUNT   6

Definition at line 444 of file ntifs_ex.h.

◆ FSRTL_VOLUME_UNLOCK

#define FSRTL_VOLUME_UNLOCK   5

Definition at line 443 of file ntifs_ex.h.

◆ FULL_SECURITY_INFORMATION

◆ IoCopyCurrentIrpStackLocationToNext

#define IoCopyCurrentIrpStackLocationToNext (   Irp)
Value:
{ \
PIO_STACK_LOCATION irpSp; \
PIO_STACK_LOCATION nextIrpSp; \
nextIrpSp = IoGetNextIrpStackLocation( (Irp) ); \
RtlCopyMemory( nextIrpSp, irpSp, FIELD_OFFSET(IO_STACK_LOCATION, CompletionRoutine)); \
nextIrpSp->Control = 0; }
_In_ PIRP Irp
Definition: csq.h:116
irpSp
Definition: iofuncs.h:2671
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetNextIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2647
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2745
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:254
_In_ PIRP _In_opt_ PVOID _In_opt_ POPLOCK_WAIT_COMPLETE_ROUTINE CompletionRoutine
Definition: fsrtlfuncs.h:673

Definition at line 413 of file ntifs_ex.h.

◆ IoSkipCurrentIrpStackLocation

#define IoSkipCurrentIrpStackLocation (   Irp)
Value:
(Irp)->CurrentLocation++; \
(Irp)->Tail.Overlay.CurrentStackLocation++;
_In_ PIRP Irp
Definition: csq.h:116

Definition at line 421 of file ntifs_ex.h.

◆ IRP_MN_SURPRISE_REMOVAL

#define IRP_MN_SURPRISE_REMOVAL   0x17

Definition at line 408 of file ntifs_ex.h.

◆ IsFileObjectReadOnly

#define IsFileObjectReadOnly (   FO)    (!((FO)->WriteAccess | (FO)->DeleteAccess))

Definition at line 253 of file ntifs_ex.h.

◆ VOLUME_IS_DIRTY

#define VOLUME_IS_DIRTY   (0x00000001)

Definition at line 330 of file ntifs_ex.h.

◆ VOLUME_UPGRADE_SCHEDULED

#define VOLUME_UPGRADE_SCHEDULED   (0x00000002)

Definition at line 331 of file ntifs_ex.h.

◆ VPB_REMOVE_PENDING

#define VPB_REMOVE_PENDING   0x00000008

Definition at line 428 of file ntifs_ex.h.

Typedef Documentation

◆ ptrFsRtlNotifyVolumeEvent

typedef NTSTATUS(* ptrFsRtlNotifyVolumeEvent) (IN PFILE_OBJECT FileObject, IN ULONG EventCode)

Definition at line 453 of file ntifs_ex.h.

Function Documentation

◆ MmGetSystemAddressForMdlSafer()

__inline PVOID MmGetSystemAddressForMdlSafer ( IN PMDL  Mdl)

Definition at line 101 of file ntifs_ex.h.

102 {
103  PVOID Addr;
104 
105  if (Mdl->MdlFlags & (MDL_MAPPED_TO_SYSTEM_VA | MDL_SOURCE_IS_NONPAGED_POOL)) {
106  Addr = Mdl->MappedSystemVa;
107  } else {
108  CSHORT PrevFlag = Mdl->MdlFlags & MDL_MAPPING_CAN_FAIL;
109 
110  Mdl->MdlFlags |= MDL_MAPPING_CAN_FAIL;
111  Addr = MmMapLockedPages(Mdl, KernelMode);
112  Mdl->MdlFlags = (Mdl->MdlFlags & ~MDL_MAPPING_CAN_FAIL) | PrevFlag;
113  }
114 
115  return(Addr);
116 }
#define MDL_MAPPED_TO_SYSTEM_VA
Definition: mmtypes.h:18
PVOID NTAPI MmMapLockedPages(IN PMDL Mdl, IN KPROCESSOR_MODE AccessMode)
Definition: mdlsup.c:822
#define MDL_MAPPING_CAN_FAIL
Definition: mmtypes.h:31
#define MDL_SOURCE_IS_NONPAGED_POOL
Definition: mmtypes.h:20
short CSHORT
Definition: umtypes.h:127

Referenced by UDFGetCallersBuffer(), and UDFQueryDirectory().

◆ RtlAbsoluteToSelfRelativeSD()

NTSYSAPI NTSTATUS NTAPI RtlAbsoluteToSelfRelativeSD ( IN PSECURITY_DESCRIPTOR  AbsoluteSecurityDescriptor,
IN OUT PSECURITY_DESCRIPTOR  SelfRelativeSecurityDescriptor,
IN PULONG  BufferLength 
)

Definition at line 626 of file sd.c.

629 {
631  PAGED_CODE_RTL();
632 
633  /* Can't already be relative */
635 
636  /* Call the other API */
639  BufferLength);
640 }
#define SE_SELF_RELATIVE
Definition: setypes.h:780
#define PAGED_CODE_RTL()
Definition: rtlp.h:16
_In_ ULONG BufferLength
Definition: usbdlib.h:225
NTSTATUS NTAPI RtlMakeSelfRelativeSD(IN PSECURITY_DESCRIPTOR AbsoluteSD, OUT PSECURITY_DESCRIPTOR SelfRelativeSD, IN OUT PULONG BufferLength)
Definition: sd.c:647
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR AbsoluteSecurityDescriptor
Definition: rtlfuncs.h:1551
_Out_writes_bytes_to_opt_ BufferLength PSECURITY_DESCRIPTOR SelfRelativeSecurityDescriptor
Definition: rtlfuncs.h:1094
#define STATUS_BAD_DESCRIPTOR_FORMAT
Definition: ntstatus.h:453
struct _SECURITY_DESCRIPTOR * PISECURITY_DESCRIPTOR

Referenced by get_top_level_sd(), LsapCreateAccountSd(), LsapCreatePolicySd(), LsapCreateSecretSd(), MakeSelfRelativeSD(), RtlpSysVolCheckOwnerAndSecurity(), RtlQuerySecurityObject(), SampCreateAccountDomainSD(), SampCreateAliasSD(), SampCreateBuiltinDomainSD(), SampCreateGroupSD(), SampCreateServerSD(), SampCreateUserSD(), and ScmCreateDefaultServiceSD().

◆ RtlAllocateAndInitializeSid()

NTSYSAPI NTSTATUS NTAPI RtlAllocateAndInitializeSid ( IN PSID_IDENTIFIER_AUTHORITY  IdentifierAuthority,
IN UCHAR  SubAuthorityCount,
IN ULONG  SubAuthority0,
IN ULONG  SubAuthority1,
IN ULONG  SubAuthority2,
IN ULONG  SubAuthority3,
IN ULONG  SubAuthority4,
IN ULONG  SubAuthority5,
IN ULONG  SubAuthority6,
IN ULONG  SubAuthority7,
OUT PSID Sid 
)

Definition at line 290 of file sid.c.

301 {
302  PISID pSid;
303  PAGED_CODE_RTL();
304 
305  /* SIDs can only have up to 8 subauthorities */
306  if (SubAuthorityCount > 8) return STATUS_INVALID_SID;
307 
308  /* Allocate memory to hold the SID */
310  if (!pSid) return STATUS_NO_MEMORY;
311 
312  /* Fill out the header */
316 
317  /* Iteraratively drop into each successive lower count */
318  switch (SubAuthorityCount)
319  {
320  /* And copy the needed subahority */
321  case 8: pSid->SubAuthority[7] = SubAuthority7;
322  case 7: pSid->SubAuthority[6] = SubAuthority6;
323  case 6: pSid->SubAuthority[5] = SubAuthority5;
324  case 5: pSid->SubAuthority[4] = SubAuthority4;
325  case 4: pSid->SubAuthority[3] = SubAuthority3;
326  case 3: pSid->SubAuthority[2] = SubAuthority2;
327  case 2: pSid->SubAuthority[1] = SubAuthority1;
328  case 1: pSid->SubAuthority[0] = SubAuthority0;
329  default: break;
330  }
331 
332  /* Return the allocated SID */
333  *Sid = pSid;
334  return STATUS_SUCCESS;
335 }
#define SID_REVISION
Definition: setypes.h:453
#define TAG_SID
Definition: sid.c:15
#define PAGED_CODE_RTL()
Definition: rtlp.h:16
PVOID NTAPI RtlpAllocateMemory(_In_ ULONG Bytes, _In_ ULONG Tag)
Definition: rtlcompat.c:34
_In_ ULONG _In_ ACCESS_MASK _In_ PSID Sid
Definition: rtlfuncs.h:1104
#define STATUS_INVALID_SID
Definition: ntstatus.h:342
ULONG NTAPI RtlLengthRequiredSid(IN ULONG SubAuthorityCount)
Definition: sid.c:54
_In_ PSID_IDENTIFIER_AUTHORITY _In_ UCHAR SubAuthorityCount
Definition: rtlfuncs.h:1487
DWORD SubAuthority[*]
Definition: ms-dtyp.idl:202
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
BYTE SubAuthorityCount
Definition: ms-dtyp.idl:200
static PSID pSid
Definition: security.c:74
SID_IDENTIFIER_AUTHORITY IdentifierAuthority
Definition: ms-dtyp.idl:201
_In_ PSID_IDENTIFIER_AUTHORITY IdentifierAuthority
Definition: rtlfuncs.h:1487
BYTE Revision
Definition: ms-dtyp.idl:199
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by AllocateAndInitializeSid(), AppendRidToSid(), BuildTokenGroups(), CreateBaseAcls(), CSR_API(), CsrCreateLocalSystemSD(), CsrpConnectToServer(), DllMain(), GetDosDevicesProtection(), K32CreateDBMonMutex(), LogonUserExW(), LsapAppendRidToSid(), LsapCreateAccountSd(), LsapCreatePolicySd(), LsapCreateRandomDomainSid(), LsapCreateSecretSd(), LsapGetDomainInfo(), MyLogonUser(), RtlpSysVolCheckOwnerAndSecurity(), RtlpSysVolCreateSecurityDescriptor(), RtlpSysVolTakeOwnership(), SampCreateAccountDomainSD(), SampCreateAliasSD(), SampCreateBuiltinDomainSD(), SampCreateGroupSD(), SampCreateServerSD(), SampCreateUserSD(), and SmpCreateSecurityDescriptors().

◆ RtlConvertSidToUnicodeString()

◆ RtlGetGroupSecurityDescriptor()

NTSYSAPI NTSTATUS NTAPI RtlGetGroupSecurityDescriptor ( IN PSECURITY_DESCRIPTOR  SecurityDescriptor,
OUT PSID Group,
OUT PBOOLEAN  GroupDefaulted 
)

Definition at line 280 of file sd.c.

283 {
285  PAGED_CODE_RTL();
286 
287  /* Fail on invalid revision */
289 
290  /* Get the group and if defaulted */
293 
294  /* All good */
295  return STATUS_SUCCESS;
296 }
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:182
_In_opt_ PSID Group
Definition: rtlfuncs.h:1606
#define PAGED_CODE_RTL()
Definition: rtlp.h:16
#define SECURITY_DESCRIPTOR_REVISION
Definition: setypes.h:58
#define SE_GROUP_DEFAULTED
Definition: setypes.h:766
FORCEINLINE PSID SepGetGroupFromDescriptor(PVOID _Descriptor)
Definition: se.h:29
_In_opt_ PSID _In_opt_ BOOLEAN GroupDefaulted
Definition: rtlfuncs.h:1606
return STATUS_SUCCESS
Definition: btrfs.c:2938
#define STATUS_UNKNOWN_REVISION
Definition: ntstatus.h:310
struct _SECURITY_DESCRIPTOR * PISECURITY_DESCRIPTOR

Referenced by _test_group(), CheckDirectorySecurity__(), CheckKeySecurity__(), GetSecurityDescriptorGroup(), RtlpSetSecurityObject(), and RtlQuerySecurityObject().

◆ RtlGetOwnerSecurityDescriptor()

NTSYSAPI NTSTATUS NTAPI RtlGetOwnerSecurityDescriptor ( IN PSECURITY_DESCRIPTOR  SecurityDescriptor,
OUT PSID Owner,
OUT PBOOLEAN  OwnerDefaulted 
)

Definition at line 257 of file sd.c.

260 {
262  PAGED_CODE_RTL();
263 
264  /* Fail on invalid revision */
266 
267  /* Get the owner and if defaulted */
270 
271  /* All good */
272  return STATUS_SUCCESS;
273 }
_In_opt_ PSID _In_opt_ BOOLEAN OwnerDefaulted
Definition: rtlfuncs.h:1630
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:182
#define PAGED_CODE_RTL()
Definition: rtlp.h:16
#define SE_OWNER_DEFAULTED
Definition: setypes.h:765
#define SECURITY_DESCRIPTOR_REVISION
Definition: setypes.h:58
FORCEINLINE PSID SepGetOwnerFromDescriptor(PVOID _Descriptor)
Definition: se.h:48
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ SaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ OwnerSize PSID Owner
Definition: rtlfuncs.h:1557
return STATUS_SUCCESS
Definition: btrfs.c:2938
#define STATUS_UNKNOWN_REVISION
Definition: ntstatus.h:310
struct _SECURITY_DESCRIPTOR * PISECURITY_DESCRIPTOR

Referenced by CheckDirectorySecurity__(), CheckKeySecurity__(), create_directory_fcb(), create_subvol(), fcb_get_new_sd(), GetSecurityDescriptorOwner(), mknod(), RtlpSetSecurityObject(), RtlpSysVolCheckOwnerAndSecurity(), and RtlQuerySecurityObject().

◆ RtlInitializeSid()

◆ RtlSetGroupSecurityDescriptor()

NTSYSAPI NTSTATUS NTAPI RtlSetGroupSecurityDescriptor ( IN OUT PSECURITY_DESCRIPTOR  SecurityDescriptor,
IN PSID  Group,
IN BOOLEAN  GroupDefaulted 
)

Definition at line 410 of file sd.c.

413 {
415  PAGED_CODE_RTL();
416 
417  /* Fail on invalid revision */
419 
420  /* Fail on relative descriptors */
422 
423  /* Group being set or cleared */
424  Sd->Group = Group;
425 
426  /* Set if defaulted */
427  Sd->Control &= ~SE_GROUP_DEFAULTED;
429 
430  /* All good */
431  return STATUS_SUCCESS;
432 }
#define STATUS_INVALID_SECURITY_DESCR
Definition: ntstatus.h:343
#define SE_SELF_RELATIVE
Definition: setypes.h:780
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:182
_In_opt_ PSID Group
Definition: rtlfuncs.h:1606
#define PAGED_CODE_RTL()
Definition: rtlp.h:16
#define SECURITY_DESCRIPTOR_REVISION
Definition: setypes.h:58
#define SE_GROUP_DEFAULTED
Definition: setypes.h:766
_In_opt_ PSID _In_opt_ BOOLEAN GroupDefaulted
Definition: rtlfuncs.h:1606
return STATUS_SUCCESS
Definition: btrfs.c:2938
#define STATUS_UNKNOWN_REVISION
Definition: ntstatus.h:310
struct _SECURITY_DESCRIPTOR * PISECURITY_DESCRIPTOR

Referenced by CheckTokenMembership(), fcb_get_sd(), get_top_level_sd(), LsapCreateAccountSd(), LsapCreatePolicySd(), LsapCreateSecretSd(), RtlQuerySecurityObject(), SampCreateAccountDomainSD(), SampCreateAliasSD(), SampCreateBuiltinDomainSD(), SampCreateGroupSD(), SampCreateServerSD(), SampCreateUserSD(), ScmCreateDefaultSD(), ScmCreatePipeSD(), and SetSecurityDescriptorGroup().

◆ RtlSetSaclSecurityDescriptor()

NTSYSAPI NTSTATUS NTAPI RtlSetSaclSecurityDescriptor ( IN OUT PSECURITY_DESCRIPTOR  SecurityDescriptor,
IN BOOLEAN  SaclPresent,
IN PACL  Sacl,
IN BOOLEAN  SaclDefaulted 
)

Definition at line 342 of file sd.c.

346 {
348  PAGED_CODE_RTL();
349 
350  /* Fail on invalid revision */
352 
353  /* Fail on relative descriptors */
355 
356  /* Is there a SACL? */
357  if (!SaclPresent)
358  {
359  /* Caller is clearing the SACL, unset the flag and we're done */
360  Sd->Control = Sd->Control & ~SE_SACL_PRESENT;
361  return STATUS_SUCCESS;
362  }
363 
364  /* Caller is setting a new SACL, set it and the flag */
365  Sd->Sacl = Sacl;
366  Sd->Control |= SE_SACL_PRESENT;
367 
368  /* Set if defaulted */
369  Sd->Control &= ~SE_SACL_DEFAULTED;
371 
372  /* All good */
373  return STATUS_SUCCESS;
374 }
#define SE_SACL_PRESENT
Definition: setypes.h:769
#define STATUS_INVALID_SECURITY_DESCR
Definition: ntstatus.h:343
#define SE_SELF_RELATIVE
Definition: setypes.h:780
_In_ USHORT _In_ ULONG _In_ PSOCKADDR _In_ PSOCKADDR _Reserved_ ULONG _In_opt_ PVOID _In_opt_ const WSK_CLIENT_CONNECTION_DISPATCH _In_opt_ PEPROCESS _In_opt_ PETHREAD _In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor
Definition: wsk.h:182
#define PAGED_CODE_RTL()
Definition: rtlp.h:16
#define SECURITY_DESCRIPTOR_REVISION
Definition: setypes.h:58
_Out_ PBOOLEAN SaclPresent
Definition: rtlfuncs.h:2415
_Out_writes_bytes_to_opt_ AbsoluteSecurityDescriptorSize PSECURITY_DESCRIPTOR _Inout_ PULONG _Out_writes_bytes_to_opt_ DaclSize PACL _Inout_ PULONG _Out_writes_bytes_to_opt_ SaclSize PACL Sacl
Definition: rtlfuncs.h:1555
#define SE_SACL_DEFAULTED
Definition: setypes.h:770
_Out_ PBOOLEAN _Out_ PACL _Out_ PBOOLEAN SaclDefaulted
Definition: rtlfuncs.h:2415
return STATUS_SUCCESS
Definition: btrfs.c:2938
#define STATUS_UNKNOWN_REVISION
Definition: ntstatus.h:310
struct _SECURITY_DESCRIPTOR * PISECURITY_DESCRIPTOR

Referenced by RtlQuerySecurityObject(), SampCreateAccountDomainSD(), SampCreateAliasSD(), SampCreateBuiltinDomainSD(), SampCreateGroupSD(), SampCreateServerSD(), SampCreateUserSD(), ScmCreateDefaultSD(), SetSecurityDescriptorSacl(), and TestSeAssignSecurity().

◆ RtlSubAuthorityCountSid()

NTSYSAPI PUCHAR NTAPI RtlSubAuthorityCountSid ( IN PSID  Sid)

Definition at line 104 of file sid.c.

105 {
106  PISID Sid = Sid_;
107  PAGED_CODE_RTL();
108 
109  /* Return the offset to the count */
110  return &Sid->SubAuthorityCount;
111 }
#define PAGED_CODE_RTL()
Definition: rtlp.h:16
_In_ ULONG _In_ ACCESS_MASK _In_ PSID Sid
Definition: rtlfuncs.h:1104
BYTE SubAuthorityCount
Definition: ms-dtyp.idl:200

Referenced by AppendRidToSid(), BuildSidFromSidAndRid(), CopySidFromSidAndRid(), CreateDomainSidFromAccountSid(), CreateSidFromSidAndRid(), GetSidSubAuthorityCount(), LsapAppendRidToSid(), LsapCopySid(), SampGetRidFromSid(), and ScDomainIdToSid().

◆ ZwDeviceIoControlFile()

NTSYSAPI NTSTATUS NTAPI ZwDeviceIoControlFile ( IN HANDLE  DeviceHandle,
IN HANDLE Event  OPTIONAL,
IN PIO_APC_ROUTINE UserApcRoutine  OPTIONAL,
IN PVOID UserApcContext  OPTIONAL,
OUT PIO_STATUS_BLOCK  IoStatusBlock,
IN ULONG  IoControlCode,
IN PVOID  InputBuffer,
IN ULONG  InputBufferSize,
OUT PVOID  OutputBuffer,
IN ULONG  OutputBufferSize 
)

◆ ZwFsControlFile()

NTSYSAPI NTSTATUS NTAPI ZwFsControlFile ( IN HANDLE  DeviceHandle,
IN HANDLE Event  OPTIONAL,
IN PIO_APC_ROUTINE ApcRoutine  OPTIONAL,
IN PVOID ApcContext  OPTIONAL,
OUT PIO_STATUS_BLOCK  IoStatusBlock,
IN ULONG  IoControlCode,
IN PVOID  InputBuffer,
IN ULONG  InputBufferSize,
OUT PVOID  OutputBuffer,
IN ULONG  OutputBufferSize 
)

◆ ZwQueryVolumeInformationFile()

NTSYSAPI NTSTATUS NTAPI ZwQueryVolumeInformationFile ( IN HANDLE  FileHandle,
OUT PIO_STATUS_BLOCK  IoStatusBlock,
OUT PVOID  FsInformation,
IN ULONG  Length,
IN FS_INFORMATION_CLASS  FsInformationClass 
)