Commit 8b353f54 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

user32: Added a GetDisplayConfigBufferSizes stub.

parent 71118846
......@@ -757,6 +757,20 @@ BOOL WINAPI IsWindowRedirectedForPrint( HWND hwnd )
return FALSE;
}
/**********************************************************************
* GetDisplayConfigBufferSizes [USER32.@]
*/
LONG WINAPI GetDisplayConfigBufferSizes(UINT32 flags, UINT32 *num_path_info, UINT32 *num_mode_info)
{
FIXME("(0x%x %p %p): stub\n", flags, num_path_info, num_mode_info);
if (!num_path_info || !num_mode_info)
return ERROR_INVALID_PARAMETER;
*num_path_info = 0;
*num_mode_info = 0;
return ERROR_NOT_SUPPORTED;
}
static const WCHAR imeW[] = {'I','M','E',0};
const struct builtin_class_descr IME_builtin_class =
......
......@@ -34,6 +34,7 @@ static BOOL (WINAPI *pGetMonitorInfoW)(HMONITOR,LPMONITORINFO);
static HMONITOR (WINAPI *pMonitorFromPoint)(POINT,DWORD);
static HMONITOR (WINAPI *pMonitorFromRect)(LPCRECT,DWORD);
static HMONITOR (WINAPI *pMonitorFromWindow)(HWND,DWORD);
static LONG (WINAPI *pGetDisplayConfigBufferSizes)(UINT32,UINT32*,UINT32*);
static void init_function_pointers(void)
{
......@@ -48,6 +49,7 @@ static void init_function_pointers(void)
GET_PROC(ChangeDisplaySettingsExW)
GET_PROC(EnumDisplayDevicesA)
GET_PROC(EnumDisplayMonitors)
GET_PROC(GetDisplayConfigBufferSizes)
GET_PROC(GetMonitorInfoA)
GET_PROC(GetMonitorInfoW)
GET_PROC(MonitorFromPoint)
......@@ -543,6 +545,58 @@ static void test_work_area(void)
DestroyWindow(hwnd);
}
static void test_display_config(void)
{
UINT32 paths, modes;
LONG ret;
if (!pGetDisplayConfigBufferSizes)
{
win_skip("GetDisplayConfigBufferSizes is not supported\n");
return;
}
ret = pGetDisplayConfigBufferSizes(QDC_ALL_PATHS, NULL, NULL);
ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret);
paths = 100;
ret = pGetDisplayConfigBufferSizes(QDC_ALL_PATHS, &paths, NULL);
ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret);
ok(paths == 100, "got %u\n", paths);
modes = 100;
ret = pGetDisplayConfigBufferSizes(QDC_ALL_PATHS, NULL, &modes);
ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret);
ok(modes == 100, "got %u\n", modes);
paths = modes = 0;
ret = pGetDisplayConfigBufferSizes(QDC_ALL_PATHS, &paths, &modes);
if (!ret)
ok(paths > 0 && modes > 0, "got %u, %u\n", paths, modes);
else
ok(ret == ERROR_NOT_SUPPORTED, "got %d\n", ret);
/* Invalid flags, non-zero invalid flags validation is version (or driver?) dependent,
it's unreliable to use in tests. */
ret = pGetDisplayConfigBufferSizes(0, NULL, NULL);
ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret);
paths = 100;
ret = pGetDisplayConfigBufferSizes(0, &paths, NULL);
ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret);
ok(paths == 100, "got %u\n", paths);
modes = 100;
ret = pGetDisplayConfigBufferSizes(0, NULL, &modes);
ok(ret == ERROR_INVALID_PARAMETER, "got %d\n", ret);
ok(modes == 100, "got %u\n", modes);
paths = modes = 100;
ret = pGetDisplayConfigBufferSizes(0, &paths, &modes);
ok(ret == ERROR_INVALID_PARAMETER || ret == ERROR_NOT_SUPPORTED, "got %d\n", ret);
ok(modes == 0 && paths == 0, "got %u, %u\n", modes, paths);
}
START_TEST(monitor)
{
init_function_pointers();
......@@ -550,4 +604,5 @@ START_TEST(monitor)
test_ChangeDisplaySettingsEx();
test_monitors();
test_work_area();
test_display_config();
}
......@@ -281,6 +281,7 @@
@ stdcall GetDCEx(long long long)
@ stdcall GetDesktopWindow()
@ stdcall GetDialogBaseUnits()
@ stdcall GetDisplayConfigBufferSizes(long ptr ptr)
@ stdcall GetDlgCtrlID(long)
@ stdcall GetDlgItem(long long)
@ stdcall GetDlgItemInt(long long ptr long)
......
......@@ -3306,6 +3306,11 @@ DECL_WINELIB_TYPE_AW(LPDISPLAY_DEVICE)
#define DISPLAY_DEVICE_MIRRORING_DRIVER 0x00000008
#define DISPLAY_DEVICE_VGA_COMPATIBLE 0x00000010
/* For GetDisplayConfigBufferSizes */
#define QDC_ALL_PATHS 0x00000001
#define QDC_ONLY_ACTIVE_PATHS 0x00000002
#define QDC_DATABASE_CURRENT 0x00000004
#define GDI_ERROR (~0u)
#define HGDI_ERROR ((HANDLE)~(ULONG_PTR)0)
......
......@@ -3267,6 +3267,7 @@ WINUSERAPI BOOL WINAPI EnumDisplaySettingsW(LPCWSTR,DWORD,LPDEVMODEW);
WINUSERAPI BOOL WINAPI EnumDisplaySettingsExA(LPCSTR,DWORD,LPDEVMODEA,DWORD);
WINUSERAPI BOOL WINAPI EnumDisplaySettingsExW(LPCWSTR,DWORD,LPDEVMODEW,DWORD);
#define EnumDisplaySettingsEx WINELIB_NAME_AW(EnumDisplaySettingsEx)
WINUSERAPI LONG WINAPI GetDisplayConfigBufferSizes(UINT32,UINT32*,UINT32*);
WINUSERAPI BOOL WINAPI UpdateLayeredWindow(HWND,HDC,POINT*,SIZE*,HDC,POINT*,COLORREF,BLENDFUNCTION*,DWORD);
WINUSERAPI BOOL WINAPI UpdateLayeredWindowIndirect(HWND,UPDATELAYEREDWINDOWINFO const*);
#endif /* defined(_WINGDI_) && !defined(NOGDI) */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment