From: Michael Müller michael@fds-team.de
We cannot check the status value reliable since there is a good change that all the possible values will be returned from different setups.
Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com --- dlls/user32/sysparams.c | 11 +++++++++-- dlls/user32/tests/sysparams.c | 24 ++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/dlls/user32/sysparams.c b/dlls/user32/sysparams.c index 3245f20..fc55b06 100644 --- a/dlls/user32/sysparams.c +++ b/dlls/user32/sysparams.c @@ -3387,8 +3387,15 @@ BOOL WINAPI PhysicalToLogicalPointForPerMonitorDPI( HWND hwnd, POINT *pt ) */ BOOL WINAPI GetAutoRotationState( AR_STATE *state ) { - FIXME("(%p): stub\n", state); - *state = AR_NOT_SUPPORTED; + TRACE("(%p)\n", state); + + if (!state) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + *state = AR_NOSENSOR; return TRUE; }
diff --git a/dlls/user32/tests/sysparams.c b/dlls/user32/tests/sysparams.c index 3db058f..fec37b6 100644 --- a/dlls/user32/tests/sysparams.c +++ b/dlls/user32/tests/sysparams.c @@ -55,6 +55,7 @@ static INT (WINAPI *pGetSystemMetricsForDpi)(INT,UINT); static BOOL (WINAPI *pSystemParametersInfoForDpi)(UINT,UINT,void*,UINT,UINT); static BOOL (WINAPI *pLogicalToPhysicalPointForPerMonitorDPI)(HWND,POINT*); static BOOL (WINAPI *pPhysicalToLogicalPointForPerMonitorDPI)(HWND,POINT*); +static LONG (WINAPI *pGetAutoRotationState)(PAR_STATE);
static BOOL strict; static int dpi, real_dpi; @@ -3621,6 +3622,27 @@ static void test_dpi_window(void) pSetThreadDpiAwarenessContext( orig ); }
+static void test_GetAutoRotationState(void) +{ + AR_STATE state; + BOOL ret; + + if (!pGetAutoRotationState) + { + win_skip("GetAutoRotationState not supported\n"); + return; + } + + SetLastError(0xdeadbeef); + ret = pGetAutoRotationState(NULL); + ok(!ret, "Expected GetAutoRotationState to fail\n"); + ok(GetLastError() == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", GetLastError()); + + state = 0; + ret = pGetAutoRotationState(&state); + ok(ret, "Expected GetAutoRotationState to succeed, error %d\n", GetLastError()); +} + START_TEST(sysparams) { int argc; @@ -3650,6 +3672,7 @@ START_TEST(sysparams) pSystemParametersInfoForDpi = (void*)GetProcAddress(hdll, "SystemParametersInfoForDpi"); pLogicalToPhysicalPointForPerMonitorDPI = (void*)GetProcAddress(hdll, "LogicalToPhysicalPointForPerMonitorDPI"); pPhysicalToLogicalPointForPerMonitorDPI = (void*)GetProcAddress(hdll, "PhysicalToLogicalPointForPerMonitorDPI"); + pGetAutoRotationState = (void*)GetProcAddress(hdll, "GetAutoRotationState");
hInstance = GetModuleHandleA( NULL ); hdc = GetDC(0); @@ -3671,6 +3694,7 @@ START_TEST(sysparams) test_metrics_for_dpi( 192 ); test_EnumDisplaySettings( ); test_GetSysColorBrush( ); + test_GetAutoRotationState( );
change_counter = 0; change_last_param = 0;
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at https://testbot.winehq.org/JobDetails.pl?Key=39476
Your paranoid android.
=== w8 (32 bit sysparams) === sysparams.c:2512: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2523: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w8adm (32 bit sysparams) === sysparams.c:962: testing SPI_{GET,SET}SCREENSAVETIMEOUT sysparams.c:2512: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2523: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1
=== w864 (32 bit sysparams) === sysparams.c:2512: Test failed: Waiting for the WM_DISPLAYCHANGE message timed out sysparams.c:2523: Test failed: Set bpp 32, but WM_DISPLAYCHANGE reported bpp -1