2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2024-04-03 16:39:46 +08:00
|
|
|
* Copyright (C) 2018-2024 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2021-05-30 22:42:47 +08:00
|
|
|
#if _WIN32
|
2023-10-20 22:34:45 +08:00
|
|
|
#if __clang__
|
|
|
|
#pragma clang diagnostic push
|
|
|
|
#pragma clang diagnostic ignored "-Wignored-pragma-intrinsic"
|
|
|
|
#pragma clang diagnostic ignored "-Wpragma-pack"
|
|
|
|
#pragma clang diagnostic ignored "-Wignored-attributes"
|
|
|
|
#pragma clang diagnostic ignored "-Wmacro-redefined"
|
|
|
|
#define UNICODE
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <Windows.h>
|
2021-08-30 22:57:25 +08:00
|
|
|
|
2023-09-08 19:22:54 +08:00
|
|
|
#include <ShlObj.h>
|
2024-04-10 13:31:23 +08:00
|
|
|
#include <cfgmgr32.h>
|
2021-08-30 22:57:25 +08:00
|
|
|
#include <winternl.h>
|
2024-04-10 13:31:23 +08:00
|
|
|
#pragma comment(lib, "cfgmgr32.lib")
|
2021-08-30 22:57:25 +08:00
|
|
|
|
2023-10-20 22:34:45 +08:00
|
|
|
#if __clang__
|
|
|
|
#pragma clang diagnostic pop
|
|
|
|
#endif
|
|
|
|
|
2018-05-08 19:19:26 +08:00
|
|
|
#pragma warning(push)
|
|
|
|
#pragma warning(disable : 4005)
|
|
|
|
#include <ntstatus.h>
|
|
|
|
#pragma warning(pop)
|
2019-04-04 19:32:49 +08:00
|
|
|
// There is a conflict with max/min defined as macro in windows headers with std::max/std::min
|
|
|
|
#undef min
|
|
|
|
#undef max
|
2018-10-10 22:02:19 +08:00
|
|
|
#undef RegOpenKeyExA
|
|
|
|
#undef RegQueryValueExA
|
|
|
|
#pragma warning(disable : 4273)
|
2021-05-30 22:42:47 +08:00
|
|
|
#else
|
|
|
|
#include <cstdint>
|
2021-06-08 03:47:12 +08:00
|
|
|
#if __clang__
|
|
|
|
#pragma clang diagnostic push
|
|
|
|
#pragma clang diagnostic ignored "-Wunused-value"
|
|
|
|
#endif
|
2021-08-30 22:57:25 +08:00
|
|
|
|
2021-05-31 00:42:47 +08:00
|
|
|
#include <winadapter.h>
|
2021-08-30 22:57:25 +08:00
|
|
|
|
2021-06-08 03:47:12 +08:00
|
|
|
#if __clang__
|
|
|
|
#pragma clang diagnostic pop
|
|
|
|
#endif
|
2021-05-30 22:42:47 +08:00
|
|
|
#include <x86intrin.h>
|
2021-06-08 03:47:12 +08:00
|
|
|
|
|
|
|
#define STATUS_GRAPHICS_NO_VIDEO_MEMORY ((NTSTATUS)0xC01E0100L)
|
|
|
|
|
|
|
|
#define PAGE_NOACCESS 0x01
|
|
|
|
#define PAGE_READWRITE 0x04
|
|
|
|
#define MEM_COMMIT 0x00001000
|
|
|
|
#define MEM_RESERVE 0x00002000
|
|
|
|
#define MEM_TOP_DOWN 0x00100000
|
|
|
|
#define MEM_RELEASE 0x00008000
|
|
|
|
#define MEM_FREE 0x00010000
|
|
|
|
|
|
|
|
#define DXGI_RESOURCE_PRIORITY_NORMAL 0x78000000
|
|
|
|
#define DXGI_RESOURCE_PRIORITY_HIGH 0xa0000000
|
|
|
|
#define DXGI_RESOURCE_PRIORITY_MAXIMUM 0xc8000000
|
2021-05-30 22:42:47 +08:00
|
|
|
#endif
|
2021-05-31 00:42:47 +08:00
|
|
|
|
|
|
|
#define NULL_HANDLE 0U
|