user32/tests: Use GetProcAddress() on ChangeDisplaySettingsExA() because it is missing on Windows 95.
This commit is contained in:
parent
91c205e8c0
commit
69f83a6f9f
|
@ -37,6 +37,8 @@
|
||||||
# define SPI_GETDESKWALLPAPER 0x0073
|
# define SPI_GETDESKWALLPAPER 0x0073
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static LONG (WINAPI *pChangeDisplaySettingsExA)(LPCSTR, LPDEVMODEA, HWND, DWORD, LPVOID);
|
||||||
|
|
||||||
static int strict;
|
static int strict;
|
||||||
static int dpi;
|
static int dpi;
|
||||||
static int iswin9x;
|
static int iswin9x;
|
||||||
|
@ -2188,6 +2190,12 @@ static void test_WM_DISPLAYCHANGE(void)
|
||||||
LONG change_ret;
|
LONG change_ret;
|
||||||
DWORD wait_ret;
|
DWORD wait_ret;
|
||||||
|
|
||||||
|
if (!pChangeDisplaySettingsExA)
|
||||||
|
{
|
||||||
|
skip("ChangeDisplaySettingsExA is not available\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
displaychange_test_active = TRUE;
|
displaychange_test_active = TRUE;
|
||||||
|
|
||||||
memset(&startmode, 0, sizeof(startmode));
|
memset(&startmode, 0, sizeof(startmode));
|
||||||
|
@ -2209,7 +2217,7 @@ static void test_WM_DISPLAYCHANGE(void)
|
||||||
|
|
||||||
change_counter = 0; /* This sends a SETTINGSCHANGE message as well in which we aren't interested */
|
change_counter = 0; /* This sends a SETTINGSCHANGE message as well in which we aren't interested */
|
||||||
displaychange_ok = TRUE;
|
displaychange_ok = TRUE;
|
||||||
change_ret = ChangeDisplaySettingsEx(NULL, &mode, NULL, 0, NULL);
|
change_ret = pChangeDisplaySettingsExA(NULL, &mode, NULL, 0, NULL);
|
||||||
/* Wait quite long for the message, screen setting changes can take some time */
|
/* Wait quite long for the message, screen setting changes can take some time */
|
||||||
if(change_ret == DISP_CHANGE_SUCCESSFUL) {
|
if(change_ret == DISP_CHANGE_SUCCESSFUL) {
|
||||||
wait_ret = WaitForSingleObject(displaychange_sem, 10000);
|
wait_ret = WaitForSingleObject(displaychange_sem, 10000);
|
||||||
|
@ -2240,7 +2248,7 @@ static void test_WM_DISPLAYCHANGE(void)
|
||||||
mode.dmPelsHeight = GetSystemMetrics(SM_CYSCREEN);
|
mode.dmPelsHeight = GetSystemMetrics(SM_CYSCREEN);
|
||||||
|
|
||||||
displaychange_ok = TRUE;
|
displaychange_ok = TRUE;
|
||||||
change_ret = ChangeDisplaySettingsEx(NULL, &mode, NULL, 0, NULL);
|
change_ret = pChangeDisplaySettingsExA(NULL, &mode, NULL, 0, NULL);
|
||||||
WaitForSingleObject(displaychange_sem, 10000);
|
WaitForSingleObject(displaychange_sem, 10000);
|
||||||
displaychange_ok = FALSE;
|
displaychange_ok = FALSE;
|
||||||
CloseHandle(displaychange_sem);
|
CloseHandle(displaychange_sem);
|
||||||
|
@ -2552,8 +2560,12 @@ START_TEST(sysparams)
|
||||||
MSG msg;
|
MSG msg;
|
||||||
HANDLE hThread;
|
HANDLE hThread;
|
||||||
DWORD dwThreadId;
|
DWORD dwThreadId;
|
||||||
HANDLE hInstance = GetModuleHandleA( NULL );
|
HANDLE hInstance, hdll;
|
||||||
|
|
||||||
|
hdll = GetModuleHandleA("user32.dll");
|
||||||
|
pChangeDisplaySettingsExA=(void*)GetProcAddress(hdll, "ChangeDisplaySettingsExA");
|
||||||
|
|
||||||
|
hInstance = GetModuleHandleA( NULL );
|
||||||
hdc = GetDC(0);
|
hdc = GetDC(0);
|
||||||
dpi = GetDeviceCaps( hdc, LOGPIXELSY);
|
dpi = GetDeviceCaps( hdc, LOGPIXELSY);
|
||||||
iswin9x = GetVersion() & 0x80000000;
|
iswin9x = GetVersion() & 0x80000000;
|
||||||
|
|
Loading…
Reference in New Issue