mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-22 21:21:03 +00:00
Implement NtUserEnumDisplaySettings syscall
This commit is contained in:
@@ -52,4 +52,63 @@ struct EMU_DISPLAY_DEVICEW
|
||||
char16_t DeviceKey[128];
|
||||
};
|
||||
|
||||
#ifndef ENUM_CURRENT_SETTINGS
|
||||
#define ENUM_CURRENT_SETTINGS ((DWORD) - 1)
|
||||
#endif
|
||||
|
||||
struct EMU_DEVMODEW
|
||||
{
|
||||
char16_t dmDeviceName[32];
|
||||
WORD dmSpecVersion;
|
||||
WORD dmDriverVersion;
|
||||
WORD dmSize;
|
||||
WORD dmDriverExtra;
|
||||
DWORD dmFields;
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
int16_t dmOrientation;
|
||||
int16_t dmPaperSize;
|
||||
int16_t dmPaperLength;
|
||||
int16_t dmPaperWidth;
|
||||
int16_t dmScale;
|
||||
int16_t dmCopies;
|
||||
int16_t dmDefaultSource;
|
||||
int16_t dmPrintQuality;
|
||||
} s;
|
||||
POINT dmPosition;
|
||||
struct
|
||||
{
|
||||
POINT dmPosition;
|
||||
DWORD dmDisplayOrientation;
|
||||
DWORD dmDisplayFixedOutput;
|
||||
} s2;
|
||||
} u;
|
||||
int16_t dmColor;
|
||||
int16_t dmDuplex;
|
||||
int16_t dmYResolution;
|
||||
int16_t dmTTOption;
|
||||
int16_t dmCollate;
|
||||
char16_t dmFormName[32];
|
||||
WORD dmLogPixels;
|
||||
DWORD dmBitsPerPel;
|
||||
DWORD dmPelsWidth;
|
||||
DWORD dmPelsHeight;
|
||||
union
|
||||
{
|
||||
DWORD dmDisplayFlags;
|
||||
DWORD dmNup;
|
||||
} u2;
|
||||
DWORD dmDisplayFrequency;
|
||||
DWORD dmICMMethod;
|
||||
DWORD dmICMIntent;
|
||||
DWORD dmMediaType;
|
||||
DWORD dmDitherType;
|
||||
DWORD dmReserved1;
|
||||
DWORD dmReserved2;
|
||||
DWORD dmPanningWidth;
|
||||
DWORD dmPanningHeight;
|
||||
};
|
||||
|
||||
// NOLINTEND(modernize-use-using,cppcoreguidelines-avoid-c-arrays,hicpp-avoid-c-arrays,modernize-avoid-c-arrays)
|
||||
|
||||
@@ -937,6 +937,31 @@ namespace syscalls
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
BOOL handle_NtUserEnumDisplaySettings(const syscall_context& c,
|
||||
const emulator_object<UNICODE_STRING<EmulatorTraits<Emu64>>> device_name, const DWORD mode_num,
|
||||
const emulator_object<EMU_DEVMODEW> dev_mode, const DWORD /*flags*/)
|
||||
{
|
||||
if (dev_mode && mode_num == ENUM_CURRENT_SETTINGS)
|
||||
{
|
||||
const auto dev_name = read_unicode_string(c.emu, device_name);
|
||||
|
||||
if (dev_name == u"\\\\.\\DISPLAY1")
|
||||
{
|
||||
dev_mode.access([](EMU_DEVMODEW& dm) {
|
||||
dm.dmFields = 0x5C0000; // DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFREQUENCY
|
||||
dm.dmPelsWidth = 1920;
|
||||
dm.dmPelsHeight = 1080;
|
||||
dm.dmBitsPerPel = 32;
|
||||
dm.dmDisplayFrequency = 60;
|
||||
});
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
NTSTATUS handle_NtAssociateWaitCompletionPacket()
|
||||
{
|
||||
return STATUS_SUCCESS;
|
||||
@@ -1131,6 +1156,7 @@ void syscall_dispatcher::add_handlers(std::map<std::string, syscall_handler>& ha
|
||||
add_handler(NtUserGetRawInputDeviceList);
|
||||
add_handler(NtUserGetKeyboardType);
|
||||
add_handler(NtUserEnumDisplayDevices);
|
||||
add_handler(NtUserEnumDisplaySettings);
|
||||
add_handler(NtUserSetProp);
|
||||
add_handler(NtUserSetProp2);
|
||||
add_handler(NtUserChangeWindowMessageFilterEx);
|
||||
|
||||
Reference in New Issue
Block a user