1
0
mirror of https://github.com/djhackersdev/bemanitools.git synced 2024-11-24 06:40:11 +01:00

d3d9exhook: actually rotate the right monitor

This commit is contained in:
Will Xyen 2020-01-29 00:27:55 -05:00
parent 5da6997805
commit 5969573dc9
2 changed files with 16 additions and 4 deletions

View File

@ -228,7 +228,8 @@ static HRESULT STDCALL my_CreateDeviceEx(
ZeroMemory(&dm, sizeof(dm));
dm.dmSize = sizeof(dm);
if (EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dm)) {
if (EnumDisplaySettings(
adapter_ident.DeviceName, ENUM_CURRENT_SETTINGS, &dm)) {
int32_t delta =
d3d9ex_force_orientation - dm.dmDisplayOrientation;
@ -242,12 +243,22 @@ static HRESULT STDCALL my_CreateDeviceEx(
dm.dmDisplayOrientation = d3d9ex_force_orientation;
long cd_ret = ChangeDisplaySettings(&dm, CDS_FULLSCREEN);
long cd_ret = ChangeDisplaySettingsEx(
adapter_ident.DeviceName,
&dm,
NULL,
CDS_FULLSCREEN,
NULL);
if (cd_ret == DISP_CHANGE_SUCCESSFUL) {
log_info("Overriding rotation suceeded");
log_info(
"Overriding rotation suceeded: %s",
adapter_ident.DeviceName);
} else {
log_info("Overriding rotation failed");
log_info(
"Overriding rotation failed %s %ld",
adapter_ident.DeviceName,
cd_ret);
}
}
}

View File

@ -128,6 +128,7 @@ void adapter_hook_override(const char *adapter_address)
// empty, do nothing
return;
}
if (strlen(adapter_address) > sizeof(IP_ADDRESS_STRING)) {
log_warning(
"%s: %s is not an ipv4 address", __FUNCTION__, adapter_address);