2019-07-23 08:37:10 +02:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0
|
|
|
|
*
|
2021-01-30 16:45:26 +01:00
|
|
|
* Copyright (C) 2018-2021 WireGuard LLC. All Rights Reserved.
|
2019-07-23 08:37:10 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <wdm.h>
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
SystemExtendedHandleInformation = 0x40
|
|
|
|
} SYSTEM_INFORMATION_CLASS;
|
|
|
|
|
|
|
|
typedef struct _SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX
|
|
|
|
{
|
|
|
|
PVOID Object;
|
|
|
|
HANDLE UniqueProcessId;
|
|
|
|
HANDLE HandleValue;
|
|
|
|
ACCESS_MASK GrantedAccess;
|
|
|
|
USHORT CreatorBackTraceIndex;
|
|
|
|
USHORT ObjectTypeIndex;
|
|
|
|
ULONG HandleAttributes;
|
|
|
|
ULONG Reserved;
|
|
|
|
} SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX, *PSYSTEM_HANDLE_TABLE_ENTRY_INFO_EX;
|
|
|
|
|
|
|
|
typedef struct _SYSTEM_HANDLE_INFORMATION_EX
|
|
|
|
{
|
|
|
|
ULONG_PTR NumberOfHandles;
|
|
|
|
ULONG_PTR Reserved;
|
|
|
|
SYSTEM_HANDLE_TABLE_ENTRY_INFO_EX Handles[ANYSIZE_ARRAY];
|
|
|
|
} SYSTEM_HANDLE_INFORMATION_EX, *PSYSTEM_HANDLE_INFORMATION_EX;
|
|
|
|
|
2020-11-03 14:42:18 +01:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
2019-07-23 08:37:10 +02:00
|
|
|
ZwQuerySystemInformation(
|
|
|
|
SYSTEM_INFORMATION_CLASS SystemInformationClass,
|
|
|
|
PVOID SystemInformation,
|
|
|
|
ULONG SystemInformationLength,
|
|
|
|
ULONG *ReturnLength);
|
2019-08-03 22:43:16 +02:00
|
|
|
|
2020-11-03 14:42:18 +01:00
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
ZwYieldExecution(VOID);
|
2021-06-24 12:10:12 +02:00
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlSetSaclSecurityDescriptor(
|
|
|
|
_In_ PSECURITY_DESCRIPTOR SecurityDescriptor,
|
|
|
|
_In_ BOOLEAN SaclPresent,
|
|
|
|
_In_opt_ PACL Sacl,
|
|
|
|
_In_opt_ BOOLEAN SaclDefaulted);
|
|
|
|
|
|
|
|
NTSYSAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
RtlAddMandatoryAce(
|
|
|
|
_Inout_ PACL Acl,
|
|
|
|
_In_ ULONG AceRevision,
|
|
|
|
_In_ ULONG AceFlags,
|
|
|
|
_In_ PSID Sid,
|
|
|
|
_In_ UCHAR AceType,
|
|
|
|
_In_ ULONG AccessMask);
|