Support more features

This commit is contained in:
momo5502
2025-02-05 19:24:36 +01:00
parent 518a813003
commit dbf39fce0a
3 changed files with 67 additions and 1 deletions

View File

@@ -731,6 +731,12 @@ typedef struct _SYSTEM_RANGE_START_INFORMATION64
EmulatorTraits<Emu64>::SIZE_T SystemRangeStart;
} SYSTEM_RANGE_START_INFORMATION64, *PSYSTEM_RANGE_START_INFORMATION64;
typedef struct _SYSTEM_KERNEL_DEBUGGER_INFORMATION
{
BOOLEAN KernelDebuggerEnabled;
BOOLEAN KernelDebuggerNotPresent;
} SYSTEM_KERNEL_DEBUGGER_INFORMATION, *PSYSTEM_KERNEL_DEBUGGER_INFORMATION;
struct SID_AND_ATTRIBUTES64
{
EMULATOR_CAST(EmulatorTraits<Emu64>::PVOID, PSID) Sid;

View File

@@ -397,6 +397,7 @@ constexpr auto BASE_NAMED_OBJECTS_DIRECTORY = make_pseudo_handle(0x2, handle_typ
constexpr auto KNOWN_DLLS_SYMLINK = make_pseudo_handle(0x1, handle_types::symlink);
constexpr auto SHARED_SECTION = make_pseudo_handle(0x1, handle_types::section);
constexpr auto DBWIN_BUFFER = make_pseudo_handle(0x2, handle_types::section);
constexpr auto WER_PORT_READY = make_pseudo_handle(0x1, handle_types::event);

View File

@@ -651,6 +651,12 @@ namespace
return STATUS_SUCCESS;
}
if (filename == u"DBWIN_BUFFER")
{
section_handle.write(DBWIN_BUFFER);
return STATUS_SUCCESS;
}
if (filename == u"windows_shell_global_counters" //
|| filename == u"{00020000-0000-1005-8005-0000C06B5161}" //
|| filename == u"Global\\{00020000-0000-1005-8005-0000C06B5161}")
@@ -1052,6 +1058,28 @@ namespace
return STATUS_SUCCESS;
}
if (info_class == SystemKernelDebuggerInformation)
{
if (return_length)
{
return_length.write(sizeof(SYSTEM_KERNEL_DEBUGGER_INFORMATION));
}
if (system_information_length != sizeof(SYSTEM_KERNEL_DEBUGGER_INFORMATION))
{
return STATUS_BUFFER_TOO_SMALL;
}
const emulator_object<SYSTEM_KERNEL_DEBUGGER_INFORMATION> info_obj{c.emu, system_information};
info_obj.access([&](SYSTEM_KERNEL_DEBUGGER_INFORMATION& info) {
info.KernelDebuggerEnabled = FALSE;
info.KernelDebuggerNotPresent = TRUE;
});
return STATUS_SUCCESS;
}
if (info_class == SystemProcessInformation || info_class == SystemModuleInformation)
{
return STATUS_NOT_SUPPORTED;
@@ -1341,7 +1369,8 @@ namespace
return STATUS_SUCCESS;
}
if (info_class == ProcessDefaultHardErrorMode || info_class == ProcessWx86Information)
if (info_class == ProcessDefaultHardErrorMode || info_class == ProcessWx86Information ||
info_class == ProcessDebugFlags)
{
if (return_length)
{
@@ -1359,6 +1388,24 @@ namespace
return STATUS_SUCCESS;
}
if (info_class == ProcessDebugObjectHandle)
{
if (return_length)
{
return_length.write(sizeof(handle));
}
if (process_information_length != sizeof(handle))
{
return STATUS_BUFFER_OVERFLOW;
}
const emulator_object<handle> info{c.emu, process_information};
info.write(NULL_HANDLE);
return STATUS_SUCCESS;
}
if (info_class == ProcessEnclaveInformation || info_class == ProcessMitigationPolicy)
{
return STATUS_NOT_SUPPORTED;
@@ -3524,11 +3571,21 @@ namespace
return STATUS_NOT_SUPPORTED;
}
NTSTATUS handle_NtSystemDebugControl()
{
return STATUS_NOT_SUPPORTED;
}
NTSTATUS handle_NtUserFindWindowEx()
{
return 0;
}
NTSTATUS handle_NtUserMoveWindow()
{
return 0;
}
NTSTATUS handle_NtGetNextThread(const syscall_context& c, const handle process_handle, const handle thread_handle,
const ACCESS_MASK /*desired_access*/, const ULONG /*handle_attributes*/,
const ULONG flags, const emulator_object<handle> new_thread_handle)
@@ -3763,6 +3820,8 @@ void syscall_dispatcher::add_handlers(std::map<std::string, syscall_handler>& ha
add_handler(NtUserFindExistingCursorIcon);
add_handler(NtSetContextThread);
add_handler(NtUserFindWindowEx);
add_handler(NtUserMoveWindow);
add_handler(NtSystemDebugControl);
#undef add_handler
}