2006-05-10 17:47:44 +00:00
|
|
|
/*++ NDK Version: 0098
|
2005-11-22 04:57:45 +00:00
|
|
|
|
|
|
|
Copyright (c) Alex Ionescu. All rights reserved.
|
|
|
|
|
|
|
|
Header Name:
|
|
|
|
|
|
|
|
sefuncs.h
|
|
|
|
|
|
|
|
Abstract:
|
|
|
|
|
|
|
|
Function definitions for the security manager.
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
Author:
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
--*/
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
#ifndef _SEFUNCS_H
|
|
|
|
#define _SEFUNCS_H
|
|
|
|
|
2005-11-25 00:17:40 +00:00
|
|
|
//
|
|
|
|
// Dependencies
|
|
|
|
//
|
|
|
|
#include <umtypes.h>
|
|
|
|
|
|
|
|
#ifndef NTOS_MODE_USER
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Security Descriptors
|
|
|
|
//
|
2006-03-04 17:27:40 +00:00
|
|
|
NTKERNELAPI
|
2005-06-23 04:42:49 +00:00
|
|
|
NTSTATUS
|
2005-09-05 04:48:20 +00:00
|
|
|
NTAPI
|
2005-06-23 04:42:49 +00:00
|
|
|
SeCaptureSecurityDescriptor(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSECURITY_DESCRIPTOR OriginalSecurityDescriptor,
|
|
|
|
_In_ KPROCESSOR_MODE CurrentMode,
|
|
|
|
_In_ POOL_TYPE PoolType,
|
|
|
|
_In_ BOOLEAN CaptureIfKernel,
|
2021-08-20 09:48:19 +00:00
|
|
|
_Out_ PSECURITY_DESCRIPTOR *CapturedSecurityDescriptor);
|
2005-06-23 04:42:49 +00:00
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTKERNELAPI
|
2005-11-22 04:57:45 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
SeReleaseSecurityDescriptor(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSECURITY_DESCRIPTOR CapturedSecurityDescriptor,
|
|
|
|
_In_ KPROCESSOR_MODE CurrentMode,
|
2021-08-20 09:48:19 +00:00
|
|
|
_In_ BOOLEAN CaptureIfKernelMode);
|
2005-11-22 04:57:45 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Access States
|
|
|
|
//
|
2006-03-04 17:27:40 +00:00
|
|
|
NTKERNELAPI
|
2005-08-02 03:56:29 +00:00
|
|
|
NTSTATUS
|
2005-09-05 04:48:20 +00:00
|
|
|
NTAPI
|
2005-08-02 03:56:29 +00:00
|
|
|
SeCreateAccessState(
|
2021-08-20 09:48:19 +00:00
|
|
|
_In_ PACCESS_STATE AccessState,
|
|
|
|
_In_ PAUX_ACCESS_DATA AuxData,
|
|
|
|
_In_ ACCESS_MASK Access,
|
|
|
|
_In_ PGENERIC_MAPPING GenericMapping);
|
2005-08-02 03:56:29 +00:00
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTKERNELAPI
|
2005-08-02 03:56:29 +00:00
|
|
|
VOID
|
2005-09-05 04:48:20 +00:00
|
|
|
NTAPI
|
2005-11-22 04:57:45 +00:00
|
|
|
SeDeleteAccessState(
|
2021-08-20 09:48:19 +00:00
|
|
|
_In_ PACCESS_STATE AccessState);
|
2005-06-26 01:08:55 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Impersonation
|
|
|
|
//
|
2006-03-04 17:27:40 +00:00
|
|
|
NTKERNELAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
SECURITY_IMPERSONATION_LEVEL
|
2005-09-05 04:48:20 +00:00
|
|
|
NTAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
SeTokenImpersonationLevel(
|
2021-08-20 09:48:19 +00:00
|
|
|
_In_ PACCESS_TOKEN Token);
|
2005-06-18 23:33:40 +00:00
|
|
|
|
|
|
|
#endif
|
2005-11-25 00:17:40 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// Native Calls
|
|
|
|
//
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSCALLAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtAccessCheck(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
|
|
|
_In_ HANDLE ClientToken,
|
|
|
|
_In_ ACCESS_MASK DesiredAccess,
|
|
|
|
_In_ PGENERIC_MAPPING GenericMapping,
|
|
|
|
_Out_ PPRIVILEGE_SET PrivilegeSet,
|
|
|
|
_Out_ PULONG ReturnLength,
|
|
|
|
_Out_ PACCESS_MASK GrantedAccess,
|
2021-08-20 09:48:19 +00:00
|
|
|
_Out_ PNTSTATUS AccessStatus);
|
2005-11-25 00:17:40 +00:00
|
|
|
|
2006-10-23 21:19:15 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtAccessCheckByType(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
|
|
|
_In_ PSID PrincipalSelfSid,
|
|
|
|
_In_ HANDLE ClientToken,
|
|
|
|
_In_ ACCESS_MASK DesiredAccess,
|
|
|
|
_In_ POBJECT_TYPE_LIST ObjectTypeList,
|
|
|
|
_In_ ULONG ObjectTypeLength,
|
|
|
|
_In_ PGENERIC_MAPPING GenericMapping,
|
|
|
|
_In_ PPRIVILEGE_SET PrivilegeSet,
|
|
|
|
_Inout_ PULONG PrivilegeSetLength,
|
|
|
|
_Out_ PACCESS_MASK GrantedAccess,
|
2021-08-20 09:48:19 +00:00
|
|
|
_Out_ PNTSTATUS AccessStatus);
|
2006-10-23 21:19:15 +00:00
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtAccessCheckByTypeResultList(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
|
|
|
_In_ PSID PrincipalSelfSid,
|
|
|
|
_In_ HANDLE ClientToken,
|
|
|
|
_In_ ACCESS_MASK DesiredAccess,
|
|
|
|
_In_ POBJECT_TYPE_LIST ObjectTypeList,
|
|
|
|
_In_ ULONG ObjectTypeLength,
|
|
|
|
_In_ PGENERIC_MAPPING GenericMapping,
|
|
|
|
_In_ PPRIVILEGE_SET PrivilegeSet,
|
|
|
|
_Inout_ PULONG PrivilegeSetLength,
|
|
|
|
_Out_ PACCESS_MASK GrantedAccess,
|
2021-08-20 09:48:19 +00:00
|
|
|
_Out_ PNTSTATUS AccessStatus);
|
2006-10-23 21:19:15 +00:00
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
|
|
|
__kernel_entry NTSYSCALLAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtAccessCheckAndAuditAlarm(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PUNICODE_STRING SubsystemName,
|
|
|
|
_In_opt_ PVOID HandleId,
|
|
|
|
_In_ PUNICODE_STRING ObjectTypeName,
|
|
|
|
_In_ PUNICODE_STRING ObjectName,
|
|
|
|
_In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
|
|
|
_In_ ACCESS_MASK DesiredAccess,
|
|
|
|
_In_ PGENERIC_MAPPING GenericMapping,
|
|
|
|
_In_ BOOLEAN ObjectCreation,
|
|
|
|
_Out_ PACCESS_MASK GrantedAccess,
|
|
|
|
_Out_ PNTSTATUS AccessStatus,
|
2021-08-20 09:48:19 +00:00
|
|
|
_Out_ PBOOLEAN GenerateOnClose);
|
2013-01-13 14:49:21 +00:00
|
|
|
|
|
|
|
_Must_inspect_result_
|
|
|
|
__kernel_entry
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSYSCALLAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtAdjustGroupsToken(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE TokenHandle,
|
|
|
|
_In_ BOOLEAN ResetToDefault,
|
|
|
|
_In_opt_ PTOKEN_GROUPS NewState,
|
|
|
|
_In_opt_ ULONG BufferLength,
|
|
|
|
_Out_writes_bytes_to_opt_(BufferLength, *ReturnLength) PTOKEN_GROUPS PreviousState,
|
2021-09-18 15:14:27 +00:00
|
|
|
_When_(PreviousState != NULL, _Out_) PULONG ReturnLength);
|
2005-11-25 00:17:40 +00:00
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
|
|
|
__kernel_entry
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSYSCALLAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtAdjustPrivilegesToken(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE TokenHandle,
|
|
|
|
_In_ BOOLEAN DisableAllPrivileges,
|
|
|
|
_In_opt_ PTOKEN_PRIVILEGES NewState,
|
|
|
|
_In_ ULONG BufferLength,
|
|
|
|
_Out_writes_bytes_to_opt_(BufferLength, *ReturnLength) PTOKEN_PRIVILEGES PreviousState,
|
2021-08-20 09:48:19 +00:00
|
|
|
_When_(PreviousState != NULL, _Out_) PULONG ReturnLength);
|
2005-11-25 00:17:40 +00:00
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSCALLAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtAllocateLocallyUniqueId(
|
2021-08-20 09:48:19 +00:00
|
|
|
_Out_ LUID *LocallyUniqueId);
|
2005-11-25 00:17:40 +00:00
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSCALLAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtAllocateUuids(
|
2021-08-20 09:48:19 +00:00
|
|
|
_Out_ PULARGE_INTEGER Time,
|
|
|
|
_Out_ PULONG Range,
|
|
|
|
_Out_ PULONG Sequence,
|
|
|
|
_Out_ PUCHAR Seed);
|
2005-11-25 00:17:40 +00:00
|
|
|
|
2006-10-15 19:12:41 +00:00
|
|
|
NTSYSCALLAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtCompareTokens(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE FirstTokenHandle,
|
|
|
|
_In_ HANDLE SecondTokenHandle,
|
|
|
|
_Out_ PBOOLEAN Equal);
|
2006-10-15 19:12:41 +00:00
|
|
|
|
2018-06-26 20:50:53 +00:00
|
|
|
__kernel_entry
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSCALLAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtCreateToken(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PHANDLE TokenHandle,
|
|
|
|
_In_ ACCESS_MASK DesiredAccess,
|
2018-06-26 20:49:34 +00:00
|
|
|
_In_opt_ POBJECT_ATTRIBUTES ObjectAttributes,
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ TOKEN_TYPE TokenType,
|
|
|
|
_In_ PLUID AuthenticationId,
|
|
|
|
_In_ PLARGE_INTEGER ExpirationTime,
|
|
|
|
_In_ PTOKEN_USER TokenUser,
|
|
|
|
_In_ PTOKEN_GROUPS TokenGroups,
|
|
|
|
_In_ PTOKEN_PRIVILEGES TokenPrivileges,
|
2018-06-26 20:49:34 +00:00
|
|
|
_In_opt_ PTOKEN_OWNER TokenOwner,
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PTOKEN_PRIMARY_GROUP TokenPrimaryGroup,
|
2018-06-26 20:49:34 +00:00
|
|
|
_In_opt_ PTOKEN_DEFAULT_DACL TokenDefaultDacl,
|
2021-08-20 09:48:19 +00:00
|
|
|
_In_ PTOKEN_SOURCE TokenSource);
|
2013-01-13 14:49:21 +00:00
|
|
|
|
|
|
|
_Must_inspect_result_
|
|
|
|
__kernel_entry
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSYSCALLAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtDuplicateToken(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ExistingTokenHandle,
|
|
|
|
_In_ ACCESS_MASK DesiredAccess,
|
|
|
|
_In_opt_ POBJECT_ATTRIBUTES ObjectAttributes,
|
|
|
|
_In_ BOOLEAN EffectiveOnly,
|
|
|
|
_In_ TOKEN_TYPE TokenType,
|
2021-08-20 09:48:19 +00:00
|
|
|
_Out_ PHANDLE NewTokenHandle);
|
2005-11-25 00:17:40 +00:00
|
|
|
|
2021-10-19 09:20:59 +00:00
|
|
|
_Must_inspect_result_
|
|
|
|
__kernel_entry
|
|
|
|
NTSYSCALLAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtFilterToken(
|
|
|
|
_In_ HANDLE ExistingTokenHandle,
|
|
|
|
_In_ ULONG Flags,
|
|
|
|
_In_opt_ PTOKEN_GROUPS SidsToDisable,
|
|
|
|
_In_opt_ PTOKEN_PRIVILEGES PrivilegesToDelete,
|
|
|
|
_In_opt_ PTOKEN_GROUPS RestrictedSids,
|
|
|
|
_Out_ PHANDLE NewTokenHandle);
|
|
|
|
|
2006-01-05 12:27:03 +00:00
|
|
|
NTSYSCALLAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtImpersonateAnonymousToken(
|
2021-08-20 09:48:19 +00:00
|
|
|
_In_ HANDLE ThreadHandle);
|
2006-01-05 12:27:03 +00:00
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
__kernel_entry
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSYSCALLAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtOpenObjectAuditAlarm(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PUNICODE_STRING SubsystemName,
|
|
|
|
_In_opt_ PVOID HandleId,
|
|
|
|
_In_ PUNICODE_STRING ObjectTypeName,
|
|
|
|
_In_ PUNICODE_STRING ObjectName,
|
|
|
|
_In_opt_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
|
|
|
_In_ HANDLE ClientToken,
|
|
|
|
_In_ ACCESS_MASK DesiredAccess,
|
|
|
|
_In_ ACCESS_MASK GrantedAccess,
|
|
|
|
_In_opt_ PPRIVILEGE_SET Privileges,
|
|
|
|
_In_ BOOLEAN ObjectCreation,
|
|
|
|
_In_ BOOLEAN AccessGranted,
|
2021-08-20 09:48:19 +00:00
|
|
|
_Out_ PBOOLEAN GenerateOnClose);
|
2005-11-25 00:17:40 +00:00
|
|
|
|
|
|
|
NTSYSCALLAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtOpenProcessTokenEx(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_In_ ACCESS_MASK DesiredAccess,
|
|
|
|
_In_ ULONG HandleAttributes,
|
2021-08-20 09:48:19 +00:00
|
|
|
_Out_ PHANDLE TokenHandle);
|
2005-11-25 00:17:40 +00:00
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
|
|
|
__kernel_entry
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSYSCALLAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtPrivilegeCheck(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ClientToken,
|
|
|
|
_Inout_ PPRIVILEGE_SET RequiredPrivileges,
|
2021-08-20 09:48:19 +00:00
|
|
|
_Out_ PBOOLEAN Result);
|
2005-11-25 00:17:40 +00:00
|
|
|
|
|
|
|
NTSYSCALLAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtPrivilegedServiceAuditAlarm(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PUNICODE_STRING SubsystemName,
|
|
|
|
_In_ PUNICODE_STRING ServiceName,
|
|
|
|
_In_ HANDLE ClientToken,
|
|
|
|
_In_ PPRIVILEGE_SET Privileges,
|
2021-08-20 09:48:19 +00:00
|
|
|
_In_ BOOLEAN AccessGranted);
|
2005-11-25 00:17:40 +00:00
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
__kernel_entry
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSYSCALLAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtPrivilegeObjectAuditAlarm(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PUNICODE_STRING SubsystemName,
|
|
|
|
_In_opt_ PVOID HandleId,
|
|
|
|
_In_ HANDLE ClientToken,
|
|
|
|
_In_ ACCESS_MASK DesiredAccess,
|
|
|
|
_In_ PPRIVILEGE_SET Privileges,
|
2021-08-20 09:48:19 +00:00
|
|
|
_In_ BOOLEAN AccessGranted);
|
2013-01-13 14:49:21 +00:00
|
|
|
|
|
|
|
_When_(TokenInformationClass == TokenAccessInformation,
|
|
|
|
_At_(TokenInformationLength, _In_range_(>=, sizeof(TOKEN_ACCESS_INFORMATION))))
|
|
|
|
_Must_inspect_result_
|
|
|
|
__kernel_entry
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSYSCALLAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtQueryInformationToken(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE TokenHandle,
|
|
|
|
_In_ TOKEN_INFORMATION_CLASS TokenInformationClass,
|
|
|
|
_Out_writes_bytes_to_opt_(TokenInformationLength, *ReturnLength) PVOID TokenInformation,
|
|
|
|
_In_ ULONG TokenInformationLength,
|
2021-08-20 09:48:19 +00:00
|
|
|
_Out_ PULONG ReturnLength);
|
2005-11-25 00:17:40 +00:00
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
|
|
|
__kernel_entry
|
2006-05-10 17:47:44 +00:00
|
|
|
NTSYSCALLAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
NtSetInformationToken(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE TokenHandle,
|
|
|
|
_In_ TOKEN_INFORMATION_CLASS TokenInformationClass,
|
|
|
|
_In_reads_bytes_(TokenInformationLength) PVOID TokenInformation,
|
2021-08-20 09:48:19 +00:00
|
|
|
_In_ ULONG TokenInformationLength);
|
2005-11-25 00:17:40 +00:00
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwAccessCheck(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
|
|
|
_In_ HANDLE ClientToken,
|
|
|
|
_In_ ACCESS_MASK DesiredAccess,
|
|
|
|
_In_ PGENERIC_MAPPING GenericMapping,
|
|
|
|
_Out_ PPRIVILEGE_SET PrivilegeSet,
|
|
|
|
_Out_ PULONG ReturnLength,
|
|
|
|
_Out_ PACCESS_MASK GrantedAccess,
|
2021-08-20 09:48:19 +00:00
|
|
|
_Out_ PNTSTATUS AccessStatus);
|
2005-11-25 00:17:40 +00:00
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwAdjustGroupsToken(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE TokenHandle,
|
|
|
|
_In_ BOOLEAN ResetToDefault,
|
|
|
|
_In_ PTOKEN_GROUPS NewState,
|
|
|
|
_In_ ULONG BufferLength,
|
|
|
|
_Out_opt_ PTOKEN_GROUPS PreviousState,
|
2021-08-20 09:48:19 +00:00
|
|
|
_Out_ PULONG ReturnLength);
|
2005-11-25 00:17:40 +00:00
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_Must_inspect_result_
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwAdjustPrivilegesToken(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE TokenHandle,
|
|
|
|
_In_ BOOLEAN DisableAllPrivileges,
|
|
|
|
_In_opt_ PTOKEN_PRIVILEGES NewState,
|
|
|
|
_In_ ULONG BufferLength,
|
|
|
|
_Out_writes_bytes_to_opt_(BufferLength, *ReturnLength) PTOKEN_PRIVILEGES PreviousState,
|
2021-08-20 09:48:19 +00:00
|
|
|
_When_(PreviousState != NULL, _Out_) PULONG ReturnLength);
|
2005-11-25 00:17:40 +00:00
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwAllocateLocallyUniqueId(
|
2021-08-20 09:48:19 +00:00
|
|
|
_Out_ LUID *LocallyUniqueId);
|
2005-11-25 00:17:40 +00:00
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwAllocateUuids(
|
2021-08-20 09:48:19 +00:00
|
|
|
_Out_ PULARGE_INTEGER Time,
|
|
|
|
_Out_ PULONG Range,
|
|
|
|
_Out_ PULONG Sequence,
|
|
|
|
_Out_ PUCHAR Seed);
|
2005-11-25 00:17:40 +00:00
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwCreateToken(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Out_ PHANDLE TokenHandle,
|
|
|
|
_In_ ACCESS_MASK DesiredAccess,
|
|
|
|
_In_ POBJECT_ATTRIBUTES ObjectAttributes,
|
|
|
|
_In_ TOKEN_TYPE TokenType,
|
|
|
|
_In_ PLUID AuthenticationId,
|
|
|
|
_In_ PLARGE_INTEGER ExpirationTime,
|
|
|
|
_In_ PTOKEN_USER TokenUser,
|
|
|
|
_In_ PTOKEN_GROUPS TokenGroups,
|
|
|
|
_In_ PTOKEN_PRIVILEGES TokenPrivileges,
|
|
|
|
_In_ PTOKEN_OWNER TokenOwner,
|
|
|
|
_In_ PTOKEN_PRIMARY_GROUP TokenPrimaryGroup,
|
|
|
|
_In_ PTOKEN_DEFAULT_DACL TokenDefaultDacl,
|
2021-08-20 09:48:19 +00:00
|
|
|
_In_ PTOKEN_SOURCE TokenSource);
|
2013-01-13 14:49:21 +00:00
|
|
|
|
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwDuplicateToken(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ExistingTokenHandle,
|
|
|
|
_In_ ACCESS_MASK DesiredAccess,
|
|
|
|
_In_opt_ POBJECT_ATTRIBUTES ObjectAttributes,
|
|
|
|
_In_ BOOLEAN EffectiveOnly,
|
|
|
|
_In_ TOKEN_TYPE TokenType,
|
2021-08-20 09:48:19 +00:00
|
|
|
_Out_ PHANDLE NewTokenHandle);
|
2005-11-25 00:17:40 +00:00
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2006-01-05 12:27:03 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwImpersonateAnonymousToken(
|
2021-08-20 09:48:19 +00:00
|
|
|
_In_ HANDLE Thread);
|
2006-01-05 12:27:03 +00:00
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwOpenObjectAuditAlarm(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PUNICODE_STRING SubsystemName,
|
|
|
|
_In_ PVOID HandleId,
|
|
|
|
_In_ PUNICODE_STRING ObjectTypeName,
|
|
|
|
_In_ PUNICODE_STRING ObjectName,
|
|
|
|
_In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
|
|
|
_In_ HANDLE ClientToken,
|
|
|
|
_In_ ULONG DesiredAccess,
|
|
|
|
_In_ ULONG GrantedAccess,
|
|
|
|
_In_ PPRIVILEGE_SET Privileges,
|
|
|
|
_In_ BOOLEAN ObjectCreation,
|
|
|
|
_In_ BOOLEAN AccessGranted,
|
2021-08-20 09:48:19 +00:00
|
|
|
_Out_ PBOOLEAN GenerateOnClose);
|
2013-01-13 14:49:21 +00:00
|
|
|
|
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwOpenProcessToken(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_In_ ACCESS_MASK DesiredAccess,
|
2021-08-20 09:48:19 +00:00
|
|
|
_Out_ PHANDLE TokenHandle);
|
2005-11-25 00:17:40 +00:00
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwOpenProcessTokenEx(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ProcessHandle,
|
|
|
|
_In_ ACCESS_MASK DesiredAccess,
|
|
|
|
_In_ ULONG HandleAttributes,
|
2021-08-20 09:48:19 +00:00
|
|
|
_Out_ PHANDLE TokenHandle);
|
2005-11-25 00:17:40 +00:00
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwPrivilegeCheck(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE ClientToken,
|
|
|
|
_In_ PPRIVILEGE_SET RequiredPrivileges,
|
2021-08-20 09:48:19 +00:00
|
|
|
_In_ PBOOLEAN Result);
|
2005-11-25 00:17:40 +00:00
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwPrivilegedServiceAuditAlarm(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PUNICODE_STRING SubsystemName,
|
|
|
|
_In_ PUNICODE_STRING ServiceName,
|
|
|
|
_In_ HANDLE ClientToken,
|
|
|
|
_In_ PPRIVILEGE_SET Privileges,
|
2021-08-20 09:48:19 +00:00
|
|
|
_In_ BOOLEAN AccessGranted);
|
2005-11-25 00:17:40 +00:00
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwPrivilegeObjectAuditAlarm(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PUNICODE_STRING SubsystemName,
|
|
|
|
_In_ PVOID HandleId,
|
|
|
|
_In_ HANDLE ClientToken,
|
|
|
|
_In_ ULONG DesiredAccess,
|
|
|
|
_In_ PPRIVILEGE_SET Privileges,
|
2021-08-20 09:48:19 +00:00
|
|
|
_In_ BOOLEAN AccessGranted);
|
2005-11-25 00:17:40 +00:00
|
|
|
|
2013-01-13 14:49:21 +00:00
|
|
|
_IRQL_requires_max_(PASSIVE_LEVEL)
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwQueryInformationToken(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE TokenHandle,
|
|
|
|
_In_ TOKEN_INFORMATION_CLASS TokenInformationClass,
|
2013-01-19 21:49:12 +00:00
|
|
|
_Out_writes_bytes_to_opt_(Length,*ResultLength) PVOID TokenInformation,
|
|
|
|
_In_ ULONG Length,
|
2021-08-20 09:48:19 +00:00
|
|
|
_Out_ PULONG ResultLength);
|
2005-11-25 00:17:40 +00:00
|
|
|
|
2006-03-04 17:27:40 +00:00
|
|
|
NTSYSAPI
|
2005-11-25 00:17:40 +00:00
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwSetInformationToken(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ HANDLE TokenHandle,
|
|
|
|
_In_ TOKEN_INFORMATION_CLASS TokenInformationClass,
|
|
|
|
_Out_ PVOID TokenInformation,
|
2021-08-20 09:48:19 +00:00
|
|
|
_In_ ULONG TokenInformationLength);
|
|
|
|
|
2005-11-25 00:17:40 +00:00
|
|
|
#endif
|