mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-21 12:43:57 +00:00
Support for KnownDLLs and Some Refactoring
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "kernel_mapped.hpp"
|
||||
|
||||
// NOLINTBEGIN(modernize-use-using,cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
|
||||
|
||||
#define ACCESS_MASK DWORD
|
||||
|
||||
@@ -2,6 +2,12 @@
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "primitives.hpp"
|
||||
#include "traits.hpp"
|
||||
#include "unicode.hpp"
|
||||
#include "status.hpp"
|
||||
#include "process.hpp"
|
||||
|
||||
// NOLINTBEGIN(modernize-use-using,cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
|
||||
|
||||
#ifndef NT_SUCCESS
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "traits.hpp"
|
||||
#include "primitives.hpp"
|
||||
|
||||
template <typename Traits>
|
||||
struct EMU_WSABUF
|
||||
{
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include "unicode.hpp"
|
||||
#include "status.hpp"
|
||||
#include "process.hpp"
|
||||
#include "user.hpp"
|
||||
#include "kernel_mapped.hpp"
|
||||
#include "memory.hpp"
|
||||
#include "file_management.hpp"
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include "compiler.hpp"
|
||||
|
||||
// NOLINTBEGIN(modernize-use-using)
|
||||
|
||||
#ifdef OS_WINDOWS
|
||||
|
||||
#include "../utils/win.hpp"
|
||||
#include "winnt.h"
|
||||
#include <winnt.h>
|
||||
|
||||
#else
|
||||
|
||||
@@ -50,6 +51,14 @@ typedef union _LARGE_INTEGER
|
||||
|
||||
using BYTE = std::uint8_t;
|
||||
#define CHAR BYTE
|
||||
|
||||
typedef struct _RECT
|
||||
{
|
||||
LONG left;
|
||||
LONG top;
|
||||
LONG right;
|
||||
LONG bottom;
|
||||
} RECT;
|
||||
#endif
|
||||
|
||||
using WORD = std::uint16_t;
|
||||
|
||||
@@ -110,4 +110,12 @@ struct KEY_VALUE_FULL_INFORMATION
|
||||
char16_t Name[1];
|
||||
};
|
||||
|
||||
struct KEY_VALUE_ENTRY
|
||||
{
|
||||
EmulatorTraits<Emu64>::PVOID ValueName;
|
||||
ULONG DataLength;
|
||||
ULONG DataOffset;
|
||||
ULONG Type;
|
||||
};
|
||||
|
||||
// NOLINTEND(modernize-use-using,cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
|
||||
|
||||
@@ -50,6 +50,7 @@ using NTSTATUS = std::uint32_t;
|
||||
#define STATUS_PROCEDURE_NOT_FOUND ((NTSTATUS)0xC000007AL)
|
||||
#define STATUS_NO_TOKEN ((NTSTATUS)0xC000007CL)
|
||||
#define STATUS_FILE_INVALID ((NTSTATUS)0xC0000098L)
|
||||
#define STATUS_INSUFFICIENT_RESOURCES ((NTSTATUS)0xC000009AL)
|
||||
#define STATUS_FREE_VM_NOT_AT_BASE ((NTSTATUS)0xC000009FL)
|
||||
#define STATUS_MEMORY_NOT_ALLOCATED ((NTSTATUS)0xC00000A0L)
|
||||
#define STATUS_PIPE_BUSY ((NTSTATUS)0xC00000AAL)
|
||||
@@ -78,6 +79,7 @@ using NTSTATUS = std::uint32_t;
|
||||
#define STATUS_PIPE_BROKEN ((NTSTATUS)0xC000014BL)
|
||||
#define STATUS_CONNECTION_RESET ((NTSTATUS)0xC000020DL)
|
||||
#define STATUS_NOT_FOUND ((NTSTATUS)0xC0000225L)
|
||||
#define STATUS_NOT_SAME_OBJECT ((NTSTATUS)0xC00001ACL)
|
||||
#define STATUS_CONNECTION_REFUSED ((NTSTATUS)0xC0000236L)
|
||||
#define STATUS_TIMER_RESOLUTION_NOT_SET ((NTSTATUS)0xC0000245L)
|
||||
#define STATUS_ADDRESS_ALREADY_ASSOCIATED ((NTSTATUS)0xC0000328L)
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "kernel_mapped.hpp"
|
||||
|
||||
// NOLINTBEGIN(modernize-use-using,cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
|
||||
|
||||
typedef enum _THREADINFOCLASS
|
||||
|
||||
117
src/common/platform/user.hpp
Normal file
117
src/common/platform/user.hpp
Normal file
@@ -0,0 +1,117 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
// NOLINTBEGIN(modernize-use-using,cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
|
||||
|
||||
struct USER_SERVERINFO
|
||||
{
|
||||
DWORD dwSRVIFlags;
|
||||
uint64_t cHandleEntries;
|
||||
uint8_t unknown[0x1000];
|
||||
};
|
||||
|
||||
struct USER_DISPINFO
|
||||
{
|
||||
DWORD dwMonitorCount;
|
||||
EMULATOR_CAST(uint64_t, USER_MONITOR*) pPrimaryMonitor;
|
||||
uint8_t unknown[0xFF];
|
||||
};
|
||||
|
||||
struct USER_HANDLEENTRY
|
||||
{
|
||||
uint64_t pHead;
|
||||
uint64_t pOwner;
|
||||
uint64_t unknown;
|
||||
uint8_t bType;
|
||||
uint8_t bFlags;
|
||||
uint16_t wUniq;
|
||||
};
|
||||
static_assert(sizeof(USER_HANDLEENTRY) == 0x20);
|
||||
|
||||
struct USER_SHAREDINFO
|
||||
{
|
||||
uint64_t psi;
|
||||
uint64_t aheList;
|
||||
uint32_t HeEntrySize;
|
||||
uint64_t pDispInfo;
|
||||
uint8_t unknown[0xFF];
|
||||
};
|
||||
|
||||
struct USER_THROBJHEAD
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint64_t h;
|
||||
uint32_t cLockObj;
|
||||
} h;
|
||||
uint64_t pti;
|
||||
};
|
||||
|
||||
struct USER_THRDESKHEAD
|
||||
{
|
||||
USER_THROBJHEAD h;
|
||||
uint64_t rpdesk;
|
||||
uint64_t pSelf;
|
||||
};
|
||||
|
||||
enum USER_HANDLETYPE : uint8_t
|
||||
{
|
||||
TYPE_FREE = 0,
|
||||
TYPE_WINDOW = 1,
|
||||
TYPE_MENU = 2,
|
||||
TYPE_CURSOR = 3,
|
||||
TYPE_SETWINDOWPOS = 4,
|
||||
TYPE_HOOK = 5,
|
||||
TYPE_CLIPDATA = 6,
|
||||
TYPE_CALLPROC = 7,
|
||||
TYPE_ACCELTABLE = 8,
|
||||
TYPE_DDEACCESS = 9,
|
||||
TYPE_DDECONV = 10,
|
||||
TYPE_DDEXACT = 11,
|
||||
TYPE_MONITOR = 12,
|
||||
TYPE_KBDLAYOUT = 13,
|
||||
TYPE_KBDFILE = 14,
|
||||
TYPE_WINEVENTHOOK = 15,
|
||||
TYPE_TIMER = 16,
|
||||
TYPE_INPUTCONTEXT = 17,
|
||||
TYPE_HIDDATA = 18,
|
||||
TYPE_DEVICEINFO = 19,
|
||||
TYPE_TOUCHINPUTINFO = 20,
|
||||
TYPE_GESTUREINFOOBJ = 21,
|
||||
TYPE_CTYPES = 22,
|
||||
TYPE_GENERIC = 255
|
||||
};
|
||||
|
||||
struct USER_MONITOR
|
||||
{
|
||||
EMULATOR_CAST(uint64_t, HMONITOR) hmon;
|
||||
uint8_t unknown1[0x14];
|
||||
RECT rcMonitor;
|
||||
RECT rcWork;
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint16_t monitorDpi;
|
||||
uint16_t nativeDpi;
|
||||
} b26;
|
||||
struct
|
||||
{
|
||||
uint32_t unknown1;
|
||||
uint16_t monitorDpi;
|
||||
uint16_t nativeDpi;
|
||||
uint16_t cachedDpi;
|
||||
uint16_t unknown2;
|
||||
RECT rcMonitorDpiAware;
|
||||
} b20;
|
||||
};
|
||||
uint8_t unknown4[0xFF];
|
||||
};
|
||||
|
||||
struct USER_WINDOW
|
||||
{
|
||||
uint8_t unknown[0xFF];
|
||||
};
|
||||
|
||||
// NOLINTEND(modernize-use-using,cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
|
||||
@@ -9,6 +9,8 @@
|
||||
#include <array>
|
||||
#include "../utils/buffer_accessor.hpp"
|
||||
|
||||
#include "primitives.hpp"
|
||||
|
||||
// NOLINTBEGIN(modernize-use-using,cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
|
||||
|
||||
#define IMAGE_DIRECTORY_ENTRY_EXPORT 0 // Export Directory
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "kernel_mapped.hpp"
|
||||
|
||||
// NOLINTBEGIN(modernize-use-using,cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
|
||||
|
||||
using pointer = uint64_t;
|
||||
|
||||
Reference in New Issue
Block a user