2001-07-27 21:37:31 +02:00
|
|
|
/*
|
|
|
|
* Graphics driver management functions
|
|
|
|
*
|
2004-02-12 03:17:51 +01:00
|
|
|
* Copyright 1994 Bob Amstadt
|
|
|
|
* Copyright 1996, 2001 Alexandre Julliard
|
2002-03-10 00:29:33 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2001-07-27 21:37:31 +02:00
|
|
|
*/
|
|
|
|
|
2011-03-16 21:45:39 +01:00
|
|
|
#include <assert.h>
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
2001-07-27 21:37:31 +02:00
|
|
|
#include <string.h>
|
2005-05-06 21:38:50 +02:00
|
|
|
#include <stdio.h>
|
2019-03-14 09:49:14 +01:00
|
|
|
#include "ntstatus.h"
|
|
|
|
#define WIN32_NO_STATUS
|
2003-09-06 01:08:26 +02:00
|
|
|
#include "windef.h"
|
2001-07-27 21:37:31 +02:00
|
|
|
#include "winbase.h"
|
2019-03-14 09:49:14 +01:00
|
|
|
#include "wingdi.h"
|
2020-06-11 16:00:32 +02:00
|
|
|
#include "winreg.h"
|
2009-06-05 18:58:55 +02:00
|
|
|
#include "ddrawgdi.h"
|
2009-12-05 11:45:31 +01:00
|
|
|
#include "wine/winbase16.h"
|
2018-08-22 11:21:05 +02:00
|
|
|
#include "winuser.h"
|
2015-04-15 19:26:07 +02:00
|
|
|
#include "winternl.h"
|
2020-06-11 16:00:32 +02:00
|
|
|
#include "initguid.h"
|
|
|
|
#include "devguid.h"
|
|
|
|
#include "setupapi.h"
|
2019-03-14 09:49:14 +01:00
|
|
|
#include "ddk/d3dkmthk.h"
|
2001-07-27 21:37:31 +02:00
|
|
|
|
2021-07-09 15:28:26 +02:00
|
|
|
#include "ntgdi_private.h"
|
2010-04-20 13:20:49 +02:00
|
|
|
#include "wine/list.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
2019-06-05 17:18:25 +02:00
|
|
|
#include "wine/heap.h"
|
2001-07-27 21:37:31 +02:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(driver);
|
2001-07-27 21:37:31 +02:00
|
|
|
|
2020-06-11 16:00:32 +02:00
|
|
|
DEFINE_DEVPROPKEY(DEVPROPKEY_GPU_LUID, 0x60b193cb, 0x5276, 0x4d0f, 0x96, 0xfc, 0xf1, 0x73, 0xab, 0xad, 0x3e, 0xc6, 2);
|
|
|
|
|
2001-07-27 21:37:31 +02:00
|
|
|
struct graphics_driver
|
|
|
|
{
|
2011-07-13 14:18:26 +02:00
|
|
|
struct list entry;
|
|
|
|
HMODULE module; /* module handle */
|
|
|
|
const struct gdi_dc_funcs *funcs;
|
2001-07-27 21:37:31 +02:00
|
|
|
};
|
|
|
|
|
2019-06-05 17:18:25 +02:00
|
|
|
struct d3dkmt_adapter
|
|
|
|
{
|
|
|
|
D3DKMT_HANDLE handle; /* Kernel mode graphics adapter handle */
|
|
|
|
struct list entry; /* List entry */
|
|
|
|
};
|
|
|
|
|
2019-06-05 17:18:52 +02:00
|
|
|
struct d3dkmt_device
|
|
|
|
{
|
|
|
|
D3DKMT_HANDLE handle; /* Kernel mode graphics device handle*/
|
|
|
|
struct list entry; /* List entry */
|
|
|
|
};
|
|
|
|
|
2010-04-20 13:20:49 +02:00
|
|
|
static struct list drivers = LIST_INIT( drivers );
|
2001-07-27 21:37:31 +02:00
|
|
|
static struct graphics_driver *display_driver;
|
2003-08-13 01:50:54 +02:00
|
|
|
|
2019-06-05 17:18:25 +02:00
|
|
|
static struct list d3dkmt_adapters = LIST_INIT( d3dkmt_adapters );
|
2019-06-05 17:18:52 +02:00
|
|
|
static struct list d3dkmt_devices = LIST_INIT( d3dkmt_devices );
|
2019-06-05 17:18:25 +02:00
|
|
|
|
2003-08-13 01:50:54 +02:00
|
|
|
static CRITICAL_SECTION driver_section;
|
|
|
|
static CRITICAL_SECTION_DEBUG critsect_debug =
|
|
|
|
{
|
|
|
|
0, 0, &driver_section,
|
|
|
|
{ &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
|
2005-09-09 12:19:44 +02:00
|
|
|
0, 0, { (DWORD_PTR)(__FILE__ ": driver_section") }
|
2003-08-13 01:50:54 +02:00
|
|
|
};
|
|
|
|
static CRITICAL_SECTION driver_section = { &critsect_debug, -1, 0, 0, 0, 0 };
|
2001-07-27 21:37:31 +02:00
|
|
|
|
2021-01-24 05:14:20 +01:00
|
|
|
static BOOL (WINAPI *pEnumDisplayMonitors)(HDC, LPRECT, MONITORENUMPROC, LPARAM);
|
2021-01-24 05:14:32 +01:00
|
|
|
static BOOL (WINAPI *pEnumDisplaySettingsW)(LPCWSTR, DWORD, LPDEVMODEW);
|
2018-09-20 06:44:15 +02:00
|
|
|
static HWND (WINAPI *pGetDesktopWindow)(void);
|
2021-01-24 05:14:20 +01:00
|
|
|
static BOOL (WINAPI *pGetMonitorInfoW)(HMONITOR, LPMONITORINFO);
|
2018-09-20 06:44:15 +02:00
|
|
|
static INT (WINAPI *pGetSystemMetrics)(INT);
|
|
|
|
static DPI_AWARENESS_CONTEXT (WINAPI *pSetThreadDpiAwarenessContext)(DPI_AWARENESS_CONTEXT);
|
2018-08-22 11:21:05 +02:00
|
|
|
|
2001-07-27 21:37:31 +02:00
|
|
|
/**********************************************************************
|
|
|
|
* create_driver
|
|
|
|
*
|
|
|
|
* Allocate and fill the driver structure for a given module.
|
|
|
|
*/
|
|
|
|
static struct graphics_driver *create_driver( HMODULE module )
|
|
|
|
{
|
2011-07-13 14:18:26 +02:00
|
|
|
static const struct gdi_dc_funcs empty_funcs;
|
|
|
|
const struct gdi_dc_funcs *funcs = NULL;
|
2001-07-27 21:37:31 +02:00
|
|
|
struct graphics_driver *driver;
|
|
|
|
|
|
|
|
if (!(driver = HeapAlloc( GetProcessHeap(), 0, sizeof(*driver)))) return NULL;
|
|
|
|
driver->module = module;
|
|
|
|
|
2005-10-31 16:43:10 +01:00
|
|
|
if (module)
|
|
|
|
{
|
2011-07-13 14:18:26 +02:00
|
|
|
const struct gdi_dc_funcs * (CDECL *wine_get_gdi_driver)( unsigned int version );
|
2006-10-03 19:52:17 +02:00
|
|
|
|
2011-07-13 14:18:26 +02:00
|
|
|
if ((wine_get_gdi_driver = (void *)GetProcAddress( module, "wine_get_gdi_driver" )))
|
|
|
|
funcs = wine_get_gdi_driver( WINE_GDI_DRIVER_VERSION );
|
2005-10-31 16:43:10 +01:00
|
|
|
}
|
2011-07-13 14:18:26 +02:00
|
|
|
if (!funcs) funcs = &empty_funcs;
|
|
|
|
driver->funcs = funcs;
|
2001-07-27 21:37:31 +02:00
|
|
|
return driver;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
2011-09-07 15:36:58 +02:00
|
|
|
* get_display_driver
|
2001-07-27 21:37:31 +02:00
|
|
|
*
|
|
|
|
* Special case for loading the display driver: get the name from the config file
|
|
|
|
*/
|
2013-12-30 17:42:48 +01:00
|
|
|
static const struct gdi_dc_funcs *get_display_driver(void)
|
2001-07-27 21:37:31 +02:00
|
|
|
{
|
2013-10-29 12:43:30 +01:00
|
|
|
if (!display_driver)
|
2001-07-27 21:37:31 +02:00
|
|
|
{
|
2013-10-29 12:43:30 +01:00
|
|
|
HMODULE user32 = LoadLibraryA( "user32.dll" );
|
2018-08-22 11:21:05 +02:00
|
|
|
pGetDesktopWindow = (void *)GetProcAddress( user32, "GetDesktopWindow" );
|
2001-07-27 21:37:31 +02:00
|
|
|
|
2013-10-29 12:43:30 +01:00
|
|
|
if (!pGetDesktopWindow() || !display_driver)
|
|
|
|
{
|
|
|
|
WARN( "failed to load the display driver, falling back to null driver\n" );
|
|
|
|
__wine_set_display_driver( 0 );
|
|
|
|
}
|
2004-07-13 05:53:55 +02:00
|
|
|
}
|
2011-07-13 14:18:26 +02:00
|
|
|
return display_driver->funcs;
|
2001-07-27 21:37:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-06-25 10:39:11 +02:00
|
|
|
/**********************************************************************
|
|
|
|
* is_display_device
|
|
|
|
*/
|
2021-01-24 05:14:20 +01:00
|
|
|
BOOL is_display_device( LPCWSTR name )
|
2019-06-25 10:39:11 +02:00
|
|
|
{
|
|
|
|
const WCHAR *p = name;
|
|
|
|
|
2021-01-24 05:14:20 +01:00
|
|
|
if (!name)
|
|
|
|
return FALSE;
|
|
|
|
|
2020-11-06 12:08:16 +01:00
|
|
|
if (wcsnicmp( name, L"\\\\.\\DISPLAY", lstrlenW(L"\\\\.\\DISPLAY") )) return FALSE;
|
2019-06-25 10:39:11 +02:00
|
|
|
|
2020-11-06 12:08:16 +01:00
|
|
|
p += lstrlenW(L"\\\\.\\DISPLAY");
|
2019-06-25 10:39:11 +02:00
|
|
|
|
2020-11-05 10:44:16 +01:00
|
|
|
if (!iswdigit( *p++ ))
|
2019-06-25 10:39:11 +02:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
for (; *p; p++)
|
|
|
|
{
|
2020-11-05 10:44:16 +01:00
|
|
|
if (!iswdigit( *p ))
|
2019-06-25 10:39:11 +02:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2020-06-11 16:00:32 +02:00
|
|
|
static HANDLE get_display_device_init_mutex( void )
|
|
|
|
{
|
2020-11-06 12:08:16 +01:00
|
|
|
HANDLE mutex = CreateMutexW( NULL, FALSE, L"display_device_init" );
|
2020-06-11 16:00:32 +02:00
|
|
|
|
|
|
|
WaitForSingleObject( mutex, INFINITE );
|
|
|
|
return mutex;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void release_display_device_init_mutex( HANDLE mutex )
|
|
|
|
{
|
|
|
|
ReleaseMutex( mutex );
|
|
|
|
CloseHandle( mutex );
|
|
|
|
}
|
2019-06-25 10:39:11 +02:00
|
|
|
|
2021-03-31 10:18:54 +02:00
|
|
|
#ifdef __i386__
|
|
|
|
static const WCHAR printer_env[] = L"w32x86";
|
|
|
|
#elif defined __x86_64__
|
|
|
|
static const WCHAR printer_env[] = L"x64";
|
|
|
|
#elif defined __arm__
|
|
|
|
static const WCHAR printer_env[] = L"arm";
|
|
|
|
#elif defined __aarch64__
|
|
|
|
static const WCHAR printer_env[] = L"arm64";
|
|
|
|
#else
|
|
|
|
#error not defined for this cpu
|
|
|
|
#endif
|
|
|
|
|
2001-07-27 21:37:31 +02:00
|
|
|
/**********************************************************************
|
|
|
|
* DRIVER_load_driver
|
|
|
|
*/
|
2013-12-30 17:42:48 +01:00
|
|
|
const struct gdi_dc_funcs *DRIVER_load_driver( LPCWSTR name )
|
2001-07-27 21:37:31 +02:00
|
|
|
{
|
|
|
|
HMODULE module;
|
2010-05-06 13:48:24 +02:00
|
|
|
struct graphics_driver *driver, *new_driver;
|
2001-07-27 21:37:31 +02:00
|
|
|
|
|
|
|
/* display driver is a special case */
|
2020-11-06 12:08:16 +01:00
|
|
|
if (!wcsicmp( name, L"display" ) || is_display_device( name )) return get_display_driver();
|
2010-05-06 13:50:30 +02:00
|
|
|
|
2003-08-12 22:42:18 +02:00
|
|
|
if ((module = GetModuleHandleW( name )))
|
2001-07-27 21:37:31 +02:00
|
|
|
{
|
2013-12-30 17:42:48 +01:00
|
|
|
if (display_driver && display_driver->module == module) return display_driver->funcs;
|
|
|
|
|
2010-05-06 13:48:24 +02:00
|
|
|
EnterCriticalSection( &driver_section );
|
2010-04-20 13:20:49 +02:00
|
|
|
LIST_FOR_EACH_ENTRY( driver, &drivers, struct graphics_driver, entry )
|
2001-07-27 21:37:31 +02:00
|
|
|
{
|
2010-05-06 13:48:24 +02:00
|
|
|
if (driver->module == module) goto done;
|
2001-07-27 21:37:31 +02:00
|
|
|
}
|
2010-05-06 13:48:24 +02:00
|
|
|
LeaveCriticalSection( &driver_section );
|
2001-07-27 21:37:31 +02:00
|
|
|
}
|
|
|
|
|
2021-03-31 10:18:54 +02:00
|
|
|
if (!(module = LoadLibraryW( name )))
|
|
|
|
{
|
|
|
|
WCHAR path[MAX_PATH];
|
|
|
|
|
|
|
|
GetSystemDirectoryW( path, MAX_PATH );
|
|
|
|
swprintf( path + wcslen(path), MAX_PATH - wcslen(path), L"\\spool\\drivers\\%s\\3\\%s",
|
|
|
|
printer_env, name );
|
|
|
|
if (!(module = LoadLibraryW( path ))) return NULL;
|
|
|
|
}
|
2010-05-06 13:48:24 +02:00
|
|
|
|
|
|
|
if (!(new_driver = create_driver( module )))
|
2001-07-27 21:37:31 +02:00
|
|
|
{
|
2010-05-06 13:48:24 +02:00
|
|
|
FreeLibrary( module );
|
2003-02-27 01:11:54 +01:00
|
|
|
return NULL;
|
2001-07-27 21:37:31 +02:00
|
|
|
}
|
|
|
|
|
2010-05-06 13:48:24 +02:00
|
|
|
/* check if someone else added it in the meantime */
|
|
|
|
EnterCriticalSection( &driver_section );
|
|
|
|
LIST_FOR_EACH_ENTRY( driver, &drivers, struct graphics_driver, entry )
|
2001-07-27 21:37:31 +02:00
|
|
|
{
|
2010-05-06 13:48:24 +02:00
|
|
|
if (driver->module != module) continue;
|
2001-07-27 21:37:31 +02:00
|
|
|
FreeLibrary( module );
|
2010-05-06 13:48:24 +02:00
|
|
|
HeapFree( GetProcessHeap(), 0, new_driver );
|
|
|
|
goto done;
|
2001-07-27 21:37:31 +02:00
|
|
|
}
|
2010-05-06 13:48:24 +02:00
|
|
|
driver = new_driver;
|
|
|
|
list_add_head( &drivers, &driver->entry );
|
2003-08-12 22:42:18 +02:00
|
|
|
TRACE( "loaded driver %p for %s\n", driver, debugstr_w(name) );
|
2010-05-06 13:48:24 +02:00
|
|
|
done:
|
2003-04-01 02:12:50 +02:00
|
|
|
LeaveCriticalSection( &driver_section );
|
2011-07-13 14:18:26 +02:00
|
|
|
return driver->funcs;
|
2001-07-27 21:37:31 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-10-29 12:39:46 +01:00
|
|
|
/***********************************************************************
|
2014-01-02 00:35:57 +01:00
|
|
|
* __wine_set_display_driver (GDI32.@)
|
2013-10-29 12:39:46 +01:00
|
|
|
*/
|
|
|
|
void CDECL __wine_set_display_driver( HMODULE module )
|
|
|
|
{
|
|
|
|
struct graphics_driver *driver;
|
2018-08-22 11:21:05 +02:00
|
|
|
HMODULE user32;
|
2013-10-29 12:39:46 +01:00
|
|
|
|
|
|
|
if (!(driver = create_driver( module )))
|
|
|
|
{
|
|
|
|
ERR( "Could not create graphics driver\n" );
|
|
|
|
ExitProcess(1);
|
|
|
|
}
|
|
|
|
if (InterlockedCompareExchangePointer( (void **)&display_driver, driver, NULL ))
|
|
|
|
HeapFree( GetProcessHeap(), 0, driver );
|
2018-08-22 11:21:05 +02:00
|
|
|
|
|
|
|
user32 = LoadLibraryA( "user32.dll" );
|
2021-01-24 05:14:20 +01:00
|
|
|
pGetMonitorInfoW = (void *)GetProcAddress( user32, "GetMonitorInfoW" );
|
2018-08-22 11:21:05 +02:00
|
|
|
pGetSystemMetrics = (void *)GetProcAddress( user32, "GetSystemMetrics" );
|
2021-01-24 05:14:20 +01:00
|
|
|
pEnumDisplayMonitors = (void *)GetProcAddress( user32, "EnumDisplayMonitors" );
|
2021-01-24 05:14:32 +01:00
|
|
|
pEnumDisplaySettingsW = (void *)GetProcAddress( user32, "EnumDisplaySettingsW" );
|
2018-08-22 12:56:53 +02:00
|
|
|
pSetThreadDpiAwarenessContext = (void *)GetProcAddress( user32, "SetThreadDpiAwarenessContext" );
|
2013-10-29 12:39:46 +01:00
|
|
|
}
|
|
|
|
|
2021-01-24 05:14:20 +01:00
|
|
|
struct monitor_info
|
|
|
|
{
|
|
|
|
const WCHAR *name;
|
|
|
|
RECT rect;
|
|
|
|
};
|
|
|
|
|
|
|
|
static BOOL CALLBACK monitor_enum_proc( HMONITOR monitor, HDC hdc, LPRECT rect, LPARAM lparam )
|
|
|
|
{
|
|
|
|
struct monitor_info *info = (struct monitor_info *)lparam;
|
|
|
|
MONITORINFOEXW mi;
|
|
|
|
|
|
|
|
mi.cbSize = sizeof(mi);
|
|
|
|
pGetMonitorInfoW( monitor, (MONITORINFO *)&mi );
|
|
|
|
if (!lstrcmpiW( info->name, mi.szDevice ))
|
|
|
|
{
|
|
|
|
info->rect = mi.rcMonitor;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
2013-10-29 12:39:46 +01:00
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static INT CDECL nulldrv_AbortDoc( PHYSDEV dev )
|
2011-03-08 21:36:52 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_Arc( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
|
|
|
INT xstart, INT ystart, INT xend, INT yend )
|
2011-03-18 12:59:26 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_Chord( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
|
|
|
INT xstart, INT ystart, INT xend, INT yend )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_CreateCompatibleDC( PHYSDEV orig, PHYSDEV *pdev )
|
2011-09-07 15:36:58 +02:00
|
|
|
{
|
|
|
|
if (!display_driver || !display_driver->funcs->pCreateCompatibleDC) return TRUE;
|
|
|
|
return display_driver->funcs->pCreateCompatibleDC( NULL, pdev );
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_CreateDC( PHYSDEV *dev, LPCWSTR driver, LPCWSTR device,
|
|
|
|
LPCWSTR output, const DEVMODEW *devmode )
|
2011-03-16 21:45:39 +01:00
|
|
|
{
|
|
|
|
assert(0); /* should never be called */
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_DeleteDC( PHYSDEV dev )
|
2011-03-16 21:45:39 +01:00
|
|
|
{
|
|
|
|
assert(0); /* should never be called */
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_DeleteObject( PHYSDEV dev, HGDIOBJ obj )
|
2011-03-09 21:19:09 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static DWORD CDECL nulldrv_DeviceCapabilities( LPSTR buffer, LPCSTR device, LPCSTR port,
|
|
|
|
WORD cap, LPSTR output, DEVMODEA *devmode )
|
2011-03-11 12:15:38 +01:00
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_Ellipse( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static INT CDECL nulldrv_EndDoc( PHYSDEV dev )
|
2011-03-08 21:36:52 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static INT CDECL nulldrv_EndPage( PHYSDEV dev )
|
2011-03-08 21:36:52 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_EnumFonts( PHYSDEV dev, LOGFONTW *logfont, FONTENUMPROCW proc, LPARAM lParam )
|
2011-03-15 20:42:49 +01:00
|
|
|
{
|
2011-10-19 15:34:21 +02:00
|
|
|
return TRUE;
|
2011-03-15 20:42:49 +01:00
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static INT CDECL nulldrv_EnumICMProfiles( PHYSDEV dev, ICMENUMPROCW func, LPARAM lparam )
|
2011-03-11 12:33:34 +01:00
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static INT CDECL nulldrv_ExtDeviceMode( LPSTR buffer, HWND hwnd, DEVMODEA *output, LPSTR device,
|
|
|
|
LPSTR port, DEVMODEA *input, LPSTR profile, DWORD mode )
|
2011-03-11 12:15:38 +01:00
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static INT CDECL nulldrv_ExtEscape( PHYSDEV dev, INT escape, INT in_size, const void *in_data,
|
2011-03-11 12:15:38 +01:00
|
|
|
INT out_size, void *out_data )
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_ExtFloodFill( PHYSDEV dev, INT x, INT y, COLORREF color, UINT type )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_FontIsLinked( PHYSDEV dev )
|
2011-10-19 21:51:39 +02:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static UINT CDECL nulldrv_GetBoundsRect( PHYSDEV dev, RECT *rect, UINT flags )
|
2012-04-10 16:17:14 +02:00
|
|
|
{
|
|
|
|
return DCB_RESET;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_GetCharABCWidths( PHYSDEV dev, UINT first, UINT last, LPABC abc )
|
2011-10-19 21:51:39 +02:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_GetCharABCWidthsI( PHYSDEV dev, UINT first, UINT count, WORD *indices, LPABC abc )
|
2011-10-19 21:51:39 +02:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_GetCharWidth( PHYSDEV dev, UINT first, UINT last, INT *buffer )
|
2011-03-15 20:42:49 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_GetCharWidthInfo( PHYSDEV dev, void *info )
|
2019-04-09 11:32:59 +02:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static INT CDECL nulldrv_GetDeviceCaps( PHYSDEV dev, INT cap )
|
2011-03-16 22:04:51 +01:00
|
|
|
{
|
2017-05-18 12:54:45 +02:00
|
|
|
int bpp;
|
|
|
|
|
|
|
|
switch (cap)
|
2011-03-16 22:04:51 +01:00
|
|
|
{
|
2017-05-18 12:54:45 +02:00
|
|
|
case DRIVERVERSION: return 0x4000;
|
|
|
|
case TECHNOLOGY: return DT_RASDISPLAY;
|
|
|
|
case HORZSIZE: return MulDiv( GetDeviceCaps( dev->hdc, HORZRES ), 254,
|
|
|
|
GetDeviceCaps( dev->hdc, LOGPIXELSX ) * 10 );
|
|
|
|
case VERTSIZE: return MulDiv( GetDeviceCaps( dev->hdc, VERTRES ), 254,
|
|
|
|
GetDeviceCaps( dev->hdc, LOGPIXELSY ) * 10 );
|
2021-01-24 05:14:20 +01:00
|
|
|
case HORZRES:
|
|
|
|
{
|
|
|
|
DC *dc = get_nulldrv_dc( dev );
|
|
|
|
struct monitor_info info;
|
|
|
|
|
|
|
|
if (dc->display[0] && pEnumDisplayMonitors && pGetMonitorInfoW)
|
|
|
|
{
|
|
|
|
info.name = dc->display;
|
|
|
|
SetRectEmpty( &info.rect );
|
|
|
|
pEnumDisplayMonitors( NULL, NULL, monitor_enum_proc, (LPARAM)&info );
|
|
|
|
if (!IsRectEmpty( &info.rect ))
|
|
|
|
return info.rect.right - info.rect.left;
|
|
|
|
}
|
|
|
|
|
|
|
|
return pGetSystemMetrics ? pGetSystemMetrics( SM_CXSCREEN ) : 640;
|
|
|
|
}
|
|
|
|
case VERTRES:
|
|
|
|
{
|
|
|
|
DC *dc = get_nulldrv_dc( dev );
|
|
|
|
struct monitor_info info;
|
|
|
|
|
|
|
|
if (dc->display[0] && pEnumDisplayMonitors && pGetMonitorInfoW)
|
|
|
|
{
|
|
|
|
info.name = dc->display;
|
|
|
|
SetRectEmpty( &info.rect );
|
|
|
|
pEnumDisplayMonitors( NULL, NULL, monitor_enum_proc, (LPARAM)&info );
|
|
|
|
if (!IsRectEmpty( &info.rect ))
|
|
|
|
return info.rect.bottom - info.rect.top;
|
|
|
|
}
|
|
|
|
|
|
|
|
return pGetSystemMetrics ? pGetSystemMetrics( SM_CYSCREEN ) : 480;
|
|
|
|
}
|
2021-05-31 10:12:44 +02:00
|
|
|
case BITSPIXEL:
|
|
|
|
{
|
|
|
|
DEVMODEW devmode;
|
|
|
|
WCHAR *display;
|
|
|
|
DC *dc;
|
|
|
|
|
|
|
|
if (GetDeviceCaps( dev->hdc, TECHNOLOGY ) == DT_RASDISPLAY && pEnumDisplaySettingsW)
|
|
|
|
{
|
|
|
|
dc = get_nulldrv_dc( dev );
|
|
|
|
display = dc->display[0] ? dc->display : NULL;
|
|
|
|
memset( &devmode, 0, sizeof(devmode) );
|
|
|
|
devmode.dmSize = sizeof(devmode);
|
|
|
|
if (pEnumDisplaySettingsW( display, ENUM_CURRENT_SETTINGS, &devmode )
|
|
|
|
&& devmode.dmFields & DM_BITSPERPEL && devmode.dmBitsPerPel)
|
|
|
|
return devmode.dmBitsPerPel;
|
|
|
|
}
|
|
|
|
return 32;
|
|
|
|
}
|
2017-05-18 12:54:45 +02:00
|
|
|
case PLANES: return 1;
|
|
|
|
case NUMBRUSHES: return -1;
|
|
|
|
case NUMPENS: return -1;
|
|
|
|
case NUMMARKERS: return 0;
|
|
|
|
case NUMFONTS: return 0;
|
|
|
|
case PDEVICESIZE: return 0;
|
|
|
|
case CURVECAPS: return (CC_CIRCLES | CC_PIE | CC_CHORD | CC_ELLIPSES | CC_WIDE |
|
|
|
|
CC_STYLED | CC_WIDESTYLED | CC_INTERIORS | CC_ROUNDRECT);
|
|
|
|
case LINECAPS: return (LC_POLYLINE | LC_MARKER | LC_POLYMARKER | LC_WIDE |
|
|
|
|
LC_STYLED | LC_WIDESTYLED | LC_INTERIORS);
|
|
|
|
case POLYGONALCAPS: return (PC_POLYGON | PC_RECTANGLE | PC_WINDPOLYGON | PC_SCANLINE |
|
|
|
|
PC_WIDE | PC_STYLED | PC_WIDESTYLED | PC_INTERIORS);
|
|
|
|
case TEXTCAPS: return (TC_OP_CHARACTER | TC_OP_STROKE | TC_CP_STROKE |
|
|
|
|
TC_CR_ANY | TC_SF_X_YINDEP | TC_SA_DOUBLE | TC_SA_INTEGER |
|
|
|
|
TC_SA_CONTIN | TC_UA_ABLE | TC_SO_ABLE | TC_RA_ABLE | TC_VA_ABLE);
|
|
|
|
case CLIPCAPS: return CP_RECTANGLE;
|
|
|
|
case RASTERCAPS: return (RC_BITBLT | RC_BITMAP64 | RC_GDI20_OUTPUT | RC_DI_BITMAP | RC_DIBTODEV |
|
|
|
|
RC_BIGFONT | RC_STRETCHBLT | RC_FLOODFILL | RC_STRETCHDIB | RC_DEVBITS |
|
|
|
|
(GetDeviceCaps( dev->hdc, SIZEPALETTE ) ? RC_PALETTE : 0));
|
|
|
|
case ASPECTX: return 36;
|
|
|
|
case ASPECTY: return 36;
|
|
|
|
case ASPECTXY: return (int)(hypot( GetDeviceCaps( dev->hdc, ASPECTX ),
|
|
|
|
GetDeviceCaps( dev->hdc, ASPECTY )) + 0.5);
|
|
|
|
case CAPS1: return 0;
|
|
|
|
case SIZEPALETTE: return 0;
|
|
|
|
case NUMRESERVED: return 20;
|
|
|
|
case PHYSICALWIDTH: return 0;
|
|
|
|
case PHYSICALHEIGHT: return 0;
|
|
|
|
case PHYSICALOFFSETX: return 0;
|
|
|
|
case PHYSICALOFFSETY: return 0;
|
|
|
|
case SCALINGFACTORX: return 0;
|
|
|
|
case SCALINGFACTORY: return 0;
|
2021-01-24 05:14:32 +01:00
|
|
|
case VREFRESH:
|
|
|
|
{
|
|
|
|
DEVMODEW devmode;
|
|
|
|
WCHAR *display;
|
|
|
|
DC *dc;
|
|
|
|
|
|
|
|
if (GetDeviceCaps( dev->hdc, TECHNOLOGY ) != DT_RASDISPLAY)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
if (pEnumDisplaySettingsW)
|
|
|
|
{
|
|
|
|
dc = get_nulldrv_dc( dev );
|
|
|
|
|
|
|
|
memset( &devmode, 0, sizeof(devmode) );
|
|
|
|
devmode.dmSize = sizeof(devmode);
|
|
|
|
display = dc->display[0] ? dc->display : NULL;
|
|
|
|
if (pEnumDisplaySettingsW( display, ENUM_CURRENT_SETTINGS, &devmode ))
|
|
|
|
return devmode.dmDisplayFrequency ? devmode.dmDisplayFrequency : 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
2018-08-22 12:56:53 +02:00
|
|
|
case DESKTOPHORZRES:
|
2018-09-05 19:52:16 +02:00
|
|
|
if (GetDeviceCaps( dev->hdc, TECHNOLOGY ) == DT_RASDISPLAY && pGetSystemMetrics)
|
2018-08-22 12:56:53 +02:00
|
|
|
{
|
|
|
|
DPI_AWARENESS_CONTEXT context;
|
|
|
|
UINT ret;
|
|
|
|
context = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE );
|
|
|
|
ret = pGetSystemMetrics( SM_CXVIRTUALSCREEN );
|
|
|
|
pSetThreadDpiAwarenessContext( context );
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
return GetDeviceCaps( dev->hdc, HORZRES );
|
|
|
|
case DESKTOPVERTRES:
|
2018-09-05 19:52:16 +02:00
|
|
|
if (GetDeviceCaps( dev->hdc, TECHNOLOGY ) == DT_RASDISPLAY && pGetSystemMetrics)
|
2018-08-22 12:56:53 +02:00
|
|
|
{
|
|
|
|
DPI_AWARENESS_CONTEXT context;
|
|
|
|
UINT ret;
|
|
|
|
context = pSetThreadDpiAwarenessContext( DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE );
|
|
|
|
ret = pGetSystemMetrics( SM_CYVIRTUALSCREEN );
|
|
|
|
pSetThreadDpiAwarenessContext( context );
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
return GetDeviceCaps( dev->hdc, VERTRES );
|
2017-05-18 12:54:45 +02:00
|
|
|
case BLTALIGNMENT: return 0;
|
|
|
|
case SHADEBLENDCAPS: return 0;
|
|
|
|
case COLORMGMTCAPS: return 0;
|
|
|
|
case LOGPIXELSX:
|
2018-04-12 13:25:16 +02:00
|
|
|
case LOGPIXELSY: return get_system_dpi();
|
2017-05-18 12:54:45 +02:00
|
|
|
case NUMCOLORS:
|
|
|
|
bpp = GetDeviceCaps( dev->hdc, BITSPIXEL );
|
|
|
|
return (bpp > 8) ? -1 : (1 << bpp);
|
|
|
|
case COLORRES:
|
|
|
|
/* The observed correspondence between BITSPIXEL and COLORRES is:
|
|
|
|
* BITSPIXEL: 8 -> COLORRES: 18
|
|
|
|
* BITSPIXEL: 16 -> COLORRES: 16
|
|
|
|
* BITSPIXEL: 24 -> COLORRES: 24
|
|
|
|
* BITSPIXEL: 32 -> COLORRES: 24 */
|
|
|
|
bpp = GetDeviceCaps( dev->hdc, BITSPIXEL );
|
|
|
|
return (bpp <= 8) ? 18 : min( 24, bpp );
|
|
|
|
default:
|
|
|
|
FIXME("(%p): unsupported capability %d, will return 0\n", dev->hdc, cap );
|
|
|
|
return 0;
|
2011-03-16 22:04:51 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_GetDeviceGammaRamp( PHYSDEV dev, void *ramp )
|
2011-03-11 12:33:34 +01:00
|
|
|
{
|
2012-01-06 17:45:16 +01:00
|
|
|
SetLastError( ERROR_INVALID_PARAMETER );
|
2011-03-11 12:33:34 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static DWORD CDECL nulldrv_GetFontData( PHYSDEV dev, DWORD table, DWORD offset, LPVOID buffer, DWORD length )
|
2011-10-19 21:51:39 +02:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_GetFontRealizationInfo( PHYSDEV dev, void *info )
|
2015-08-29 18:54:17 +02:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static DWORD CDECL nulldrv_GetFontUnicodeRanges( PHYSDEV dev, LPGLYPHSET glyphs )
|
2011-10-19 21:51:39 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static DWORD CDECL nulldrv_GetGlyphIndices( PHYSDEV dev, LPCWSTR str, INT count, LPWORD indices, DWORD flags )
|
2011-10-19 21:51:39 +02:00
|
|
|
{
|
|
|
|
return GDI_ERROR;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static DWORD CDECL nulldrv_GetGlyphOutline( PHYSDEV dev, UINT ch, UINT format, LPGLYPHMETRICS metrics,
|
|
|
|
DWORD size, LPVOID buffer, const MAT2 *mat )
|
2011-10-19 21:51:39 +02:00
|
|
|
{
|
|
|
|
return GDI_ERROR;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_GetICMProfile( PHYSDEV dev, LPDWORD size, LPWSTR filename )
|
2011-03-11 12:33:34 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static DWORD CDECL nulldrv_GetImage( PHYSDEV dev, BITMAPINFO *info, struct gdi_image_bits *bits,
|
|
|
|
struct bitblt_coords *src )
|
2012-05-23 22:26:35 +02:00
|
|
|
{
|
|
|
|
return ERROR_NOT_SUPPORTED;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static DWORD CDECL nulldrv_GetKerningPairs( PHYSDEV dev, DWORD count, LPKERNINGPAIR pairs )
|
2011-10-19 21:51:39 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static UINT CDECL nulldrv_GetOutlineTextMetrics( PHYSDEV dev, UINT size, LPOUTLINETEXTMETRICW otm )
|
2011-10-19 21:51:39 +02:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static UINT CDECL nulldrv_GetTextCharsetInfo( PHYSDEV dev, LPFONTSIGNATURE fs, DWORD flags )
|
2011-10-19 21:51:39 +02:00
|
|
|
{
|
|
|
|
return DEFAULT_CHARSET;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_GetTextExtentExPoint( PHYSDEV dev, LPCWSTR str, INT count, INT *dx )
|
2011-03-15 20:42:49 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_GetTextExtentExPointI( PHYSDEV dev, const WORD *indices, INT count, INT *dx )
|
2011-10-19 21:51:39 +02:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static INT CDECL nulldrv_GetTextFace( PHYSDEV dev, INT size, LPWSTR name )
|
2011-10-19 21:51:39 +02:00
|
|
|
{
|
2011-10-20 17:14:53 +02:00
|
|
|
INT ret = 0;
|
|
|
|
LOGFONTW font;
|
2016-07-29 16:09:34 +02:00
|
|
|
DC *dc = get_nulldrv_dc( dev );
|
2011-10-20 17:14:53 +02:00
|
|
|
|
2016-07-29 16:09:34 +02:00
|
|
|
if (GetObjectW( dc->hFont, sizeof(font), &font ))
|
2011-10-20 17:14:53 +02:00
|
|
|
{
|
2020-11-05 10:44:16 +01:00
|
|
|
ret = lstrlenW( font.lfFaceName ) + 1;
|
2011-10-20 17:14:53 +02:00
|
|
|
if (name)
|
|
|
|
{
|
|
|
|
lstrcpynW( name, font.lfFaceName, size );
|
|
|
|
ret = min( size, ret );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ret;
|
2011-10-19 21:51:39 +02:00
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_GetTextMetrics( PHYSDEV dev, TEXTMETRICW *metrics )
|
2011-03-15 20:42:49 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_LineTo( PHYSDEV dev, INT x, INT y )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_MoveTo( PHYSDEV dev, INT x, INT y )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_PaintRgn( PHYSDEV dev, HRGN rgn )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_PatBlt( PHYSDEV dev, struct bitblt_coords *dst, DWORD rop )
|
2011-03-17 14:54:56 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_Pie( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
|
|
|
INT xstart, INT ystart, INT xend, INT yend )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_PolyPolygon( PHYSDEV dev, const POINT *points, const INT *counts, UINT polygons )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_PolyPolyline( PHYSDEV dev, const POINT *points, const DWORD *counts, DWORD lines )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static DWORD CDECL nulldrv_PutImage( PHYSDEV dev, HRGN clip, BITMAPINFO *info,
|
|
|
|
const struct gdi_image_bits *bits, struct bitblt_coords *src,
|
|
|
|
struct bitblt_coords *dst, DWORD rop )
|
2012-05-23 22:26:35 +02:00
|
|
|
{
|
|
|
|
return ERROR_SUCCESS;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static UINT CDECL nulldrv_RealizeDefaultPalette( PHYSDEV dev )
|
2011-03-11 18:26:55 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static UINT CDECL nulldrv_RealizePalette( PHYSDEV dev, HPALETTE palette, BOOL primary )
|
2011-03-11 18:26:55 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_Rectangle( PHYSDEV dev, INT left, INT top, INT right, INT bottom )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2021-08-23 13:50:47 +02:00
|
|
|
static BOOL CDECL nulldrv_ResetDC( PHYSDEV dev, const DEVMODEW *devmode )
|
2011-03-15 20:17:58 +01:00
|
|
|
{
|
2021-08-23 13:50:47 +02:00
|
|
|
return FALSE;
|
2011-03-15 20:17:58 +01:00
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_RoundRect( PHYSDEV dev, INT left, INT top, INT right, INT bottom,
|
|
|
|
INT ell_width, INT ell_height )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static HBITMAP CDECL nulldrv_SelectBitmap( PHYSDEV dev, HBITMAP bitmap )
|
2011-03-09 21:19:09 +01:00
|
|
|
{
|
|
|
|
return bitmap;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static HBRUSH CDECL nulldrv_SelectBrush( PHYSDEV dev, HBRUSH brush, const struct brush_pattern *pattern )
|
2011-03-09 21:19:09 +01:00
|
|
|
{
|
|
|
|
return brush;
|
|
|
|
}
|
|
|
|
|
2020-11-03 11:25:30 +01:00
|
|
|
static HFONT CDECL nulldrv_SelectFont( PHYSDEV dev, HFONT font, UINT *aa_flags )
|
|
|
|
{
|
|
|
|
return font;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static HPEN CDECL nulldrv_SelectPen( PHYSDEV dev, HPEN pen, const struct brush_pattern *pattern )
|
2011-03-09 21:19:09 +01:00
|
|
|
{
|
|
|
|
return pen;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static COLORREF CDECL nulldrv_SetBkColor( PHYSDEV dev, COLORREF color )
|
2011-03-10 21:58:47 +01:00
|
|
|
{
|
|
|
|
return color;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static UINT CDECL nulldrv_SetBoundsRect( PHYSDEV dev, RECT *rect, UINT flags )
|
2012-04-25 12:26:44 +02:00
|
|
|
{
|
|
|
|
return DCB_RESET;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static COLORREF CDECL nulldrv_SetDCBrushColor( PHYSDEV dev, COLORREF color )
|
2011-03-10 20:42:05 +01:00
|
|
|
{
|
|
|
|
return color;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static COLORREF CDECL nulldrv_SetDCPenColor( PHYSDEV dev, COLORREF color )
|
2011-03-10 20:42:05 +01:00
|
|
|
{
|
|
|
|
return color;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static void CDECL nulldrv_SetDeviceClipping( PHYSDEV dev, HRGN rgn )
|
2011-03-09 16:21:45 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_SetDeviceGammaRamp( PHYSDEV dev, void *ramp )
|
2011-03-11 12:33:34 +01:00
|
|
|
{
|
2012-01-06 17:45:16 +01:00
|
|
|
SetLastError( ERROR_INVALID_PARAMETER );
|
2011-03-11 12:33:34 +01:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static COLORREF CDECL nulldrv_SetPixel( PHYSDEV dev, INT x, INT y, COLORREF color )
|
2011-03-08 20:30:03 +01:00
|
|
|
{
|
|
|
|
return color;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static COLORREF CDECL nulldrv_SetTextColor( PHYSDEV dev, COLORREF color )
|
2011-03-10 21:58:47 +01:00
|
|
|
{
|
|
|
|
return color;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static INT CDECL nulldrv_StartDoc( PHYSDEV dev, const DOCINFOW *info )
|
2011-03-08 21:36:52 +01:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static INT CDECL nulldrv_StartPage( PHYSDEV dev )
|
2011-03-08 21:36:52 +01:00
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static BOOL CDECL nulldrv_UnrealizePalette( HPALETTE palette )
|
2011-03-16 22:58:07 +01:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2019-10-22 10:38:56 +02:00
|
|
|
static NTSTATUS CDECL nulldrv_D3DKMTCheckVidPnExclusiveOwnership( const D3DKMT_CHECKVIDPNEXCLUSIVEOWNERSHIP *desc )
|
|
|
|
{
|
|
|
|
return STATUS_PROCEDURE_NOT_FOUND;
|
|
|
|
}
|
|
|
|
|
|
|
|
static NTSTATUS CDECL nulldrv_D3DKMTSetVidPnSourceOwner( const D3DKMT_SETVIDPNSOURCEOWNER *desc )
|
|
|
|
{
|
|
|
|
return STATUS_PROCEDURE_NOT_FOUND;
|
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static struct opengl_funcs * CDECL nulldrv_wine_get_wgl_driver( PHYSDEV dev, UINT version )
|
2012-06-28 16:25:22 +02:00
|
|
|
{
|
2012-07-18 23:58:41 +02:00
|
|
|
return (void *)-1;
|
2012-06-28 16:25:22 +02:00
|
|
|
}
|
|
|
|
|
2019-07-06 20:45:50 +02:00
|
|
|
static const struct vulkan_funcs * CDECL nulldrv_wine_get_vulkan_driver( PHYSDEV dev, UINT version )
|
2018-02-26 19:42:15 +01:00
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2011-10-17 20:39:54 +02:00
|
|
|
const struct gdi_dc_funcs null_driver =
|
2011-03-08 19:37:08 +01:00
|
|
|
{
|
2011-03-08 21:36:52 +01:00
|
|
|
nulldrv_AbortDoc, /* pAbortDoc */
|
2011-03-11 20:43:15 +01:00
|
|
|
nulldrv_AbortPath, /* pAbortPath */
|
2011-03-18 12:59:26 +01:00
|
|
|
nulldrv_AlphaBlend, /* pAlphaBlend */
|
2011-03-08 21:15:59 +01:00
|
|
|
nulldrv_AngleArc, /* pAngleArc */
|
2011-03-08 20:30:03 +01:00
|
|
|
nulldrv_Arc, /* pArc */
|
2011-03-08 21:15:59 +01:00
|
|
|
nulldrv_ArcTo, /* pArcTo */
|
2011-03-11 20:43:15 +01:00
|
|
|
nulldrv_BeginPath, /* pBeginPath */
|
2011-09-14 11:57:45 +02:00
|
|
|
nulldrv_BlendImage, /* pBlendImage */
|
2011-03-08 20:30:03 +01:00
|
|
|
nulldrv_Chord, /* pChord */
|
2011-03-11 20:43:15 +01:00
|
|
|
nulldrv_CloseFigure, /* pCloseFigure */
|
2011-09-07 15:36:58 +02:00
|
|
|
nulldrv_CreateCompatibleDC, /* pCreateCompatibleDC */
|
2011-03-16 21:45:39 +01:00
|
|
|
nulldrv_CreateDC, /* pCreateDC */
|
|
|
|
nulldrv_DeleteDC, /* pDeleteDC */
|
2011-03-09 21:19:09 +01:00
|
|
|
nulldrv_DeleteObject, /* pDeleteObject */
|
2011-03-11 12:15:38 +01:00
|
|
|
nulldrv_DeviceCapabilities, /* pDeviceCapabilities */
|
2011-03-08 20:30:03 +01:00
|
|
|
nulldrv_Ellipse, /* pEllipse */
|
2011-03-08 21:36:52 +01:00
|
|
|
nulldrv_EndDoc, /* pEndDoc */
|
|
|
|
nulldrv_EndPage, /* pEndPage */
|
2011-03-11 20:43:15 +01:00
|
|
|
nulldrv_EndPath, /* pEndPath */
|
2011-10-19 15:37:10 +02:00
|
|
|
nulldrv_EnumFonts, /* pEnumFonts */
|
2011-03-11 12:33:34 +01:00
|
|
|
nulldrv_EnumICMProfiles, /* pEnumICMProfiles */
|
2011-03-11 12:15:38 +01:00
|
|
|
nulldrv_ExtDeviceMode, /* pExtDeviceMode */
|
|
|
|
nulldrv_ExtEscape, /* pExtEscape */
|
2011-03-08 20:30:03 +01:00
|
|
|
nulldrv_ExtFloodFill, /* pExtFloodFill */
|
2011-03-15 20:42:49 +01:00
|
|
|
nulldrv_ExtTextOut, /* pExtTextOut */
|
2011-03-11 20:43:15 +01:00
|
|
|
nulldrv_FillPath, /* pFillPath */
|
2011-03-08 21:15:59 +01:00
|
|
|
nulldrv_FillRgn, /* pFillRgn */
|
2011-10-19 21:51:39 +02:00
|
|
|
nulldrv_FontIsLinked, /* pFontIsLinked */
|
2011-03-08 21:15:59 +01:00
|
|
|
nulldrv_FrameRgn, /* pFrameRgn */
|
2012-04-10 16:17:14 +02:00
|
|
|
nulldrv_GetBoundsRect, /* pGetBoundsRect */
|
2011-10-19 21:51:39 +02:00
|
|
|
nulldrv_GetCharABCWidths, /* pGetCharABCWidths */
|
|
|
|
nulldrv_GetCharABCWidthsI, /* pGetCharABCWidthsI */
|
2011-03-15 20:42:49 +01:00
|
|
|
nulldrv_GetCharWidth, /* pGetCharWidth */
|
2019-04-09 11:32:59 +02:00
|
|
|
nulldrv_GetCharWidthInfo, /* pGetCharWidthInfo */
|
2011-03-16 22:04:51 +01:00
|
|
|
nulldrv_GetDeviceCaps, /* pGetDeviceCaps */
|
2011-03-11 12:33:34 +01:00
|
|
|
nulldrv_GetDeviceGammaRamp, /* pGetDeviceGammaRamp */
|
2011-10-19 21:51:39 +02:00
|
|
|
nulldrv_GetFontData, /* pGetFontData */
|
2015-08-29 18:54:17 +02:00
|
|
|
nulldrv_GetFontRealizationInfo, /* pGetFontRealizationInfo */
|
2011-10-19 21:51:39 +02:00
|
|
|
nulldrv_GetFontUnicodeRanges, /* pGetFontUnicodeRanges */
|
|
|
|
nulldrv_GetGlyphIndices, /* pGetGlyphIndices */
|
|
|
|
nulldrv_GetGlyphOutline, /* pGetGlyphOutline */
|
2011-03-11 12:33:34 +01:00
|
|
|
nulldrv_GetICMProfile, /* pGetICMProfile */
|
2011-07-14 11:30:58 +02:00
|
|
|
nulldrv_GetImage, /* pGetImage */
|
2011-10-19 21:51:39 +02:00
|
|
|
nulldrv_GetKerningPairs, /* pGetKerningPairs */
|
2011-03-11 18:26:55 +01:00
|
|
|
nulldrv_GetNearestColor, /* pGetNearestColor */
|
2011-10-19 21:51:39 +02:00
|
|
|
nulldrv_GetOutlineTextMetrics, /* pGetOutlineTextMetrics */
|
2011-03-08 20:30:03 +01:00
|
|
|
nulldrv_GetPixel, /* pGetPixel */
|
2011-03-11 18:26:55 +01:00
|
|
|
nulldrv_GetSystemPaletteEntries, /* pGetSystemPaletteEntries */
|
2011-10-19 21:51:39 +02:00
|
|
|
nulldrv_GetTextCharsetInfo, /* pGetTextCharsetInfo */
|
2011-03-15 20:42:49 +01:00
|
|
|
nulldrv_GetTextExtentExPoint, /* pGetTextExtentExPoint */
|
2011-10-19 21:51:39 +02:00
|
|
|
nulldrv_GetTextExtentExPointI, /* pGetTextExtentExPointI */
|
|
|
|
nulldrv_GetTextFace, /* pGetTextFace */
|
2011-03-15 20:42:49 +01:00
|
|
|
nulldrv_GetTextMetrics, /* pGetTextMetrics */
|
2011-10-31 23:51:38 +01:00
|
|
|
nulldrv_GradientFill, /* pGradientFill */
|
2011-03-08 21:15:59 +01:00
|
|
|
nulldrv_InvertRgn, /* pInvertRgn */
|
2011-03-08 20:30:03 +01:00
|
|
|
nulldrv_LineTo, /* pLineTo */
|
|
|
|
nulldrv_MoveTo, /* pMoveTo */
|
|
|
|
nulldrv_PaintRgn, /* pPaintRgn */
|
2011-03-17 14:54:56 +01:00
|
|
|
nulldrv_PatBlt, /* pPatBlt */
|
2011-03-08 20:30:03 +01:00
|
|
|
nulldrv_Pie, /* pPie */
|
2011-03-08 21:15:59 +01:00
|
|
|
nulldrv_PolyBezier, /* pPolyBezier */
|
|
|
|
nulldrv_PolyBezierTo, /* pPolyBezierTo */
|
|
|
|
nulldrv_PolyDraw, /* pPolyDraw */
|
2011-03-08 20:30:03 +01:00
|
|
|
nulldrv_PolyPolygon, /* pPolyPolygon */
|
|
|
|
nulldrv_PolyPolyline, /* pPolyPolyline */
|
2011-03-08 21:15:59 +01:00
|
|
|
nulldrv_PolylineTo, /* pPolylineTo */
|
2011-07-14 11:30:58 +02:00
|
|
|
nulldrv_PutImage, /* pPutImage */
|
2011-03-11 18:26:55 +01:00
|
|
|
nulldrv_RealizeDefaultPalette, /* pRealizeDefaultPalette */
|
|
|
|
nulldrv_RealizePalette, /* pRealizePalette */
|
2011-03-08 20:30:03 +01:00
|
|
|
nulldrv_Rectangle, /* pRectangle */
|
2011-03-15 20:17:58 +01:00
|
|
|
nulldrv_ResetDC, /* pResetDC */
|
2011-03-08 20:30:03 +01:00
|
|
|
nulldrv_RoundRect, /* pRoundRect */
|
2011-03-09 21:19:09 +01:00
|
|
|
nulldrv_SelectBitmap, /* pSelectBitmap */
|
|
|
|
nulldrv_SelectBrush, /* pSelectBrush */
|
|
|
|
nulldrv_SelectFont, /* pSelectFont */
|
|
|
|
nulldrv_SelectPen, /* pSelectPen */
|
2011-03-10 21:58:47 +01:00
|
|
|
nulldrv_SetBkColor, /* pSetBkColor */
|
2012-04-25 12:26:44 +02:00
|
|
|
nulldrv_SetBoundsRect, /* pSetBoundsRect */
|
2011-03-10 20:42:05 +01:00
|
|
|
nulldrv_SetDCBrushColor, /* pSetDCBrushColor */
|
|
|
|
nulldrv_SetDCPenColor, /* pSetDCPenColor */
|
2011-03-16 21:14:24 +01:00
|
|
|
nulldrv_SetDIBitsToDevice, /* pSetDIBitsToDevice */
|
2011-03-09 16:21:45 +01:00
|
|
|
nulldrv_SetDeviceClipping, /* pSetDeviceClipping */
|
2011-03-11 12:33:34 +01:00
|
|
|
nulldrv_SetDeviceGammaRamp, /* pSetDeviceGammaRamp */
|
2011-03-08 20:30:03 +01:00
|
|
|
nulldrv_SetPixel, /* pSetPixel */
|
2011-03-10 21:58:47 +01:00
|
|
|
nulldrv_SetTextColor, /* pSetTextColor */
|
2011-03-08 21:36:52 +01:00
|
|
|
nulldrv_StartDoc, /* pStartDoc */
|
|
|
|
nulldrv_StartPage, /* pStartPage */
|
2011-03-18 12:59:26 +01:00
|
|
|
nulldrv_StretchBlt, /* pStretchBlt */
|
2011-03-18 12:42:56 +01:00
|
|
|
nulldrv_StretchDIBits, /* pStretchDIBits */
|
2011-03-11 20:43:15 +01:00
|
|
|
nulldrv_StrokeAndFillPath, /* pStrokeAndFillPath */
|
|
|
|
nulldrv_StrokePath, /* pStrokePath */
|
2011-03-16 22:58:07 +01:00
|
|
|
nulldrv_UnrealizePalette, /* pUnrealizePalette */
|
2019-10-22 10:38:56 +02:00
|
|
|
nulldrv_D3DKMTCheckVidPnExclusiveOwnership, /* pD3DKMTCheckVidPnExclusiveOwnership */
|
|
|
|
nulldrv_D3DKMTSetVidPnSourceOwner, /* pD3DKMTSetVidPnSourceOwner */
|
2012-06-28 14:13:24 +02:00
|
|
|
nulldrv_wine_get_wgl_driver, /* wine_get_wgl_driver */
|
2018-02-26 19:42:15 +01:00
|
|
|
nulldrv_wine_get_vulkan_driver, /* wine_get_vulkan_driver */
|
2012-05-08 12:16:05 +02:00
|
|
|
|
|
|
|
GDI_PRIORITY_NULL_DRV /* priority */
|
2011-03-08 19:37:08 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2001-07-27 21:37:31 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* DRIVER_GetDriverName
|
|
|
|
*
|
|
|
|
*/
|
2003-08-12 22:42:18 +02:00
|
|
|
BOOL DRIVER_GetDriverName( LPCWSTR device, LPWSTR driver, DWORD size )
|
2001-07-27 21:37:31 +02:00
|
|
|
{
|
2003-08-12 22:42:18 +02:00
|
|
|
WCHAR *p;
|
2003-06-23 22:51:41 +02:00
|
|
|
|
|
|
|
/* display is a special case */
|
2020-11-06 12:08:16 +01:00
|
|
|
if (!wcsicmp( device, L"display" ) || is_display_device( device ))
|
2003-06-23 22:51:41 +02:00
|
|
|
{
|
2020-11-06 12:08:16 +01:00
|
|
|
lstrcpynW( driver, L"display", size );
|
2003-06-23 22:51:41 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2020-11-06 12:08:16 +01:00
|
|
|
size = GetProfileStringW(L"devices", device, L"", driver, size);
|
2001-07-27 21:37:31 +02:00
|
|
|
if(!size) {
|
2003-08-12 22:42:18 +02:00
|
|
|
WARN("Unable to find %s in [devices] section of win.ini\n", debugstr_w(device));
|
2001-07-27 21:37:31 +02:00
|
|
|
return FALSE;
|
|
|
|
}
|
2020-11-05 10:44:16 +01:00
|
|
|
p = wcschr(driver, ',');
|
2001-07-27 21:37:31 +02:00
|
|
|
if(!p)
|
|
|
|
{
|
2003-08-12 22:42:18 +02:00
|
|
|
WARN("%s entry in [devices] section of win.ini is malformed.\n", debugstr_w(device));
|
2001-07-27 21:37:31 +02:00
|
|
|
return FALSE;
|
|
|
|
}
|
2003-08-12 22:42:18 +02:00
|
|
|
*p = 0;
|
|
|
|
TRACE("Found %s for %s\n", debugstr_w(driver), debugstr_w(device));
|
2001-07-27 21:37:31 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2003-08-12 22:42:18 +02:00
|
|
|
|
|
|
|
/***********************************************************************
|
|
|
|
* GdiConvertToDevmodeW (GDI32.@)
|
|
|
|
*/
|
|
|
|
DEVMODEW * WINAPI GdiConvertToDevmodeW(const DEVMODEA *dmA)
|
|
|
|
{
|
|
|
|
DEVMODEW *dmW;
|
2007-12-19 04:43:05 +01:00
|
|
|
WORD dmW_size, dmA_size;
|
2003-08-12 22:42:18 +02:00
|
|
|
|
2007-12-19 04:43:05 +01:00
|
|
|
dmA_size = dmA->dmSize;
|
2007-12-20 07:49:59 +01:00
|
|
|
|
|
|
|
/* this is the minimal dmSize that XP accepts */
|
|
|
|
if (dmA_size < FIELD_OFFSET(DEVMODEA, dmFields))
|
|
|
|
return NULL;
|
|
|
|
|
2007-12-19 04:43:05 +01:00
|
|
|
if (dmA_size > sizeof(DEVMODEA))
|
|
|
|
dmA_size = sizeof(DEVMODEA);
|
2007-12-18 13:21:40 +01:00
|
|
|
|
2007-12-19 04:43:05 +01:00
|
|
|
dmW_size = dmA_size + CCHDEVICENAME;
|
|
|
|
if (dmA_size >= FIELD_OFFSET(DEVMODEA, dmFormName) + CCHFORMNAME)
|
2003-08-12 22:42:18 +02:00
|
|
|
dmW_size += CCHFORMNAME;
|
|
|
|
|
|
|
|
dmW = HeapAlloc(GetProcessHeap(), 0, dmW_size + dmA->dmDriverExtra);
|
|
|
|
if (!dmW) return NULL;
|
|
|
|
|
2008-06-22 23:22:06 +02:00
|
|
|
MultiByteToWideChar(CP_ACP, 0, (const char*) dmA->dmDeviceName, -1,
|
2003-08-12 22:42:18 +02:00
|
|
|
dmW->dmDeviceName, CCHDEVICENAME);
|
|
|
|
/* copy slightly more, to avoid long computations */
|
2007-12-19 04:43:05 +01:00
|
|
|
memcpy(&dmW->dmSpecVersion, &dmA->dmSpecVersion, dmA_size - CCHDEVICENAME);
|
2003-08-12 22:42:18 +02:00
|
|
|
|
2007-12-19 04:43:05 +01:00
|
|
|
if (dmA_size >= FIELD_OFFSET(DEVMODEA, dmFormName) + CCHFORMNAME)
|
2003-08-12 22:42:18 +02:00
|
|
|
{
|
2008-06-22 23:22:06 +02:00
|
|
|
if (dmA->dmFields & DM_FORMNAME)
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, (const char*) dmA->dmFormName, -1,
|
2003-08-12 22:42:18 +02:00
|
|
|
dmW->dmFormName, CCHFORMNAME);
|
2008-06-22 23:22:06 +02:00
|
|
|
else
|
|
|
|
dmW->dmFormName[0] = 0;
|
|
|
|
|
2007-12-19 04:43:05 +01:00
|
|
|
if (dmA_size > FIELD_OFFSET(DEVMODEA, dmLogPixels))
|
|
|
|
memcpy(&dmW->dmLogPixels, &dmA->dmLogPixels, dmA_size - FIELD_OFFSET(DEVMODEA, dmLogPixels));
|
2003-08-12 22:42:18 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (dmA->dmDriverExtra)
|
2007-12-19 04:43:05 +01:00
|
|
|
memcpy((char *)dmW + dmW_size, (const char *)dmA + dmA_size, dmA->dmDriverExtra);
|
2003-08-12 22:42:18 +02:00
|
|
|
|
|
|
|
dmW->dmSize = dmW_size;
|
|
|
|
|
|
|
|
return dmW;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2001-07-27 21:37:31 +02:00
|
|
|
/*****************************************************************************
|
|
|
|
* @ [GDI32.100]
|
|
|
|
*
|
|
|
|
* This should thunk to 16-bit and simply call the proc with the given args.
|
|
|
|
*/
|
|
|
|
INT WINAPI GDI_CallDevInstall16( FARPROC16 lpfnDevInstallProc, HWND hWnd,
|
|
|
|
LPSTR lpModelName, LPSTR OldPort, LPSTR NewPort )
|
|
|
|
{
|
2002-11-22 23:16:53 +01:00
|
|
|
FIXME("(%p, %p, %s, %s, %s)\n", lpfnDevInstallProc, hWnd, lpModelName, OldPort, NewPort );
|
2001-07-27 21:37:31 +02:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* @ [GDI32.101]
|
|
|
|
*
|
|
|
|
* This should load the correct driver for lpszDevice and calls this driver's
|
2002-06-01 01:06:46 +02:00
|
|
|
* ExtDeviceModePropSheet proc.
|
2001-07-27 21:37:31 +02:00
|
|
|
*
|
2002-06-01 01:06:46 +02:00
|
|
|
* Note: The driver calls a callback routine for each property sheet page; these
|
2001-07-27 21:37:31 +02:00
|
|
|
* pages are supposed to be filled into the structure pointed to by lpPropSheet.
|
|
|
|
* The layout of this structure is:
|
2002-06-01 01:06:46 +02:00
|
|
|
*
|
2001-07-27 21:37:31 +02:00
|
|
|
* struct
|
|
|
|
* {
|
|
|
|
* DWORD nPages;
|
|
|
|
* DWORD unknown;
|
|
|
|
* HPROPSHEETPAGE pages[10];
|
|
|
|
* };
|
|
|
|
*/
|
|
|
|
INT WINAPI GDI_CallExtDeviceModePropSheet16( HWND hWnd, LPCSTR lpszDevice,
|
|
|
|
LPCSTR lpszPort, LPVOID lpPropSheet )
|
|
|
|
{
|
2002-11-22 23:16:53 +01:00
|
|
|
FIXME("(%p, %s, %s, %p)\n", hWnd, lpszDevice, lpszPort, lpPropSheet );
|
2001-07-27 21:37:31 +02:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* @ [GDI32.102]
|
|
|
|
*
|
2009-02-11 13:35:25 +01:00
|
|
|
* This should load the correct driver for lpszDevice and call this driver's
|
2001-07-27 21:37:31 +02:00
|
|
|
* ExtDeviceMode proc.
|
2003-08-12 22:42:18 +02:00
|
|
|
*
|
|
|
|
* FIXME: convert ExtDeviceMode to unicode in the driver interface
|
2001-07-27 21:37:31 +02:00
|
|
|
*/
|
|
|
|
INT WINAPI GDI_CallExtDeviceMode16( HWND hwnd,
|
|
|
|
LPDEVMODEA lpdmOutput, LPSTR lpszDevice,
|
|
|
|
LPSTR lpszPort, LPDEVMODEA lpdmInput,
|
|
|
|
LPSTR lpszProfile, DWORD fwMode )
|
|
|
|
{
|
2003-08-12 22:42:18 +02:00
|
|
|
WCHAR deviceW[300];
|
|
|
|
WCHAR bufW[300];
|
2001-07-27 21:37:31 +02:00
|
|
|
char buf[300];
|
|
|
|
HDC hdc;
|
|
|
|
DC *dc;
|
|
|
|
INT ret = -1;
|
|
|
|
|
2006-10-12 22:56:56 +02:00
|
|
|
TRACE("(%p, %p, %s, %s, %p, %s, %d)\n",
|
2001-07-27 21:37:31 +02:00
|
|
|
hwnd, lpdmOutput, lpszDevice, lpszPort, lpdmInput, lpszProfile, fwMode );
|
|
|
|
|
2003-08-12 22:42:18 +02:00
|
|
|
if (!lpszDevice) return -1;
|
|
|
|
if (!MultiByteToWideChar(CP_ACP, 0, lpszDevice, -1, deviceW, 300)) return -1;
|
|
|
|
|
|
|
|
if(!DRIVER_GetDriverName( deviceW, bufW, 300 )) return -1;
|
|
|
|
|
|
|
|
if (!WideCharToMultiByte(CP_ACP, 0, bufW, -1, buf, 300, NULL, NULL)) return -1;
|
2001-07-27 21:37:31 +02:00
|
|
|
|
2001-07-31 19:25:47 +02:00
|
|
|
if (!(hdc = CreateICA( buf, lpszDevice, lpszPort, NULL ))) return -1;
|
2001-07-27 21:37:31 +02:00
|
|
|
|
2007-09-24 18:23:42 +02:00
|
|
|
if ((dc = get_dc_ptr( hdc )))
|
2001-07-27 21:37:31 +02:00
|
|
|
{
|
2011-03-11 12:15:38 +01:00
|
|
|
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pExtDeviceMode );
|
|
|
|
ret = physdev->funcs->pExtDeviceMode( buf, hwnd, lpdmOutput, lpszDevice, lpszPort,
|
|
|
|
lpdmInput, lpszProfile, fwMode );
|
2007-09-24 18:23:42 +02:00
|
|
|
release_dc_ptr( dc );
|
2001-07-27 21:37:31 +02:00
|
|
|
}
|
|
|
|
DeleteDC( hdc );
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* @ [GDI32.103]
|
|
|
|
*
|
|
|
|
* This should load the correct driver for lpszDevice and calls this driver's
|
|
|
|
* AdvancedSetupDialog proc.
|
|
|
|
*/
|
|
|
|
INT WINAPI GDI_CallAdvancedSetupDialog16( HWND hwnd, LPSTR lpszDevice,
|
|
|
|
LPDEVMODEA devin, LPDEVMODEA devout )
|
|
|
|
{
|
2002-11-22 23:16:53 +01:00
|
|
|
TRACE("(%p, %s, %p, %p)\n", hwnd, lpszDevice, devin, devout );
|
2001-07-27 21:37:31 +02:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************
|
|
|
|
* @ [GDI32.104]
|
|
|
|
*
|
|
|
|
* This should load the correct driver for lpszDevice and calls this driver's
|
|
|
|
* DeviceCapabilities proc.
|
2003-08-12 22:42:18 +02:00
|
|
|
*
|
|
|
|
* FIXME: convert DeviceCapabilities to unicode in the driver interface
|
2001-07-27 21:37:31 +02:00
|
|
|
*/
|
|
|
|
DWORD WINAPI GDI_CallDeviceCapabilities16( LPCSTR lpszDevice, LPCSTR lpszPort,
|
|
|
|
WORD fwCapability, LPSTR lpszOutput,
|
|
|
|
LPDEVMODEA lpdm )
|
|
|
|
{
|
2003-08-12 22:42:18 +02:00
|
|
|
WCHAR deviceW[300];
|
|
|
|
WCHAR bufW[300];
|
2001-07-27 21:37:31 +02:00
|
|
|
char buf[300];
|
|
|
|
HDC hdc;
|
|
|
|
DC *dc;
|
|
|
|
INT ret = -1;
|
|
|
|
|
|
|
|
TRACE("(%s, %s, %d, %p, %p)\n", lpszDevice, lpszPort, fwCapability, lpszOutput, lpdm );
|
|
|
|
|
2003-08-12 22:42:18 +02:00
|
|
|
if (!lpszDevice) return -1;
|
|
|
|
if (!MultiByteToWideChar(CP_ACP, 0, lpszDevice, -1, deviceW, 300)) return -1;
|
|
|
|
|
|
|
|
if(!DRIVER_GetDriverName( deviceW, bufW, 300 )) return -1;
|
|
|
|
|
|
|
|
if (!WideCharToMultiByte(CP_ACP, 0, bufW, -1, buf, 300, NULL, NULL)) return -1;
|
2001-07-27 21:37:31 +02:00
|
|
|
|
2001-07-31 19:25:47 +02:00
|
|
|
if (!(hdc = CreateICA( buf, lpszDevice, lpszPort, NULL ))) return -1;
|
2001-07-27 21:37:31 +02:00
|
|
|
|
2007-09-24 18:23:42 +02:00
|
|
|
if ((dc = get_dc_ptr( hdc )))
|
2001-07-27 21:37:31 +02:00
|
|
|
{
|
2011-03-11 12:15:38 +01:00
|
|
|
PHYSDEV physdev = GET_DC_PHYSDEV( dc, pDeviceCapabilities );
|
|
|
|
ret = physdev->funcs->pDeviceCapabilities( buf, lpszDevice, lpszPort,
|
|
|
|
fwCapability, lpszOutput, lpdm );
|
2007-09-24 18:23:42 +02:00
|
|
|
release_dc_ptr( dc );
|
2001-07-27 21:37:31 +02:00
|
|
|
}
|
|
|
|
DeleteDC( hdc );
|
|
|
|
return ret;
|
|
|
|
}
|
2004-02-12 03:17:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************
|
2021-08-13 12:09:34 +02:00
|
|
|
* NtGdiExtEscape (win32u.@)
|
2004-02-12 03:17:51 +01:00
|
|
|
*
|
2005-11-05 11:45:02 +01:00
|
|
|
* Access capabilities of a particular device that are not available through GDI.
|
2004-02-12 03:17:51 +01:00
|
|
|
*/
|
2021-08-13 12:09:34 +02:00
|
|
|
INT WINAPI NtGdiExtEscape( HDC hdc, WCHAR *driver, int driver_id, INT escape, INT input_size,
|
|
|
|
const char *input, INT output_size, char *output )
|
2004-02-12 03:17:51 +01:00
|
|
|
{
|
2012-09-20 21:07:04 +02:00
|
|
|
PHYSDEV physdev;
|
|
|
|
INT ret;
|
2007-09-24 18:23:42 +02:00
|
|
|
DC * dc = get_dc_ptr( hdc );
|
2011-03-11 12:15:38 +01:00
|
|
|
|
2012-09-20 21:07:04 +02:00
|
|
|
if (!dc) return 0;
|
|
|
|
update_dc( dc );
|
|
|
|
physdev = GET_DC_PHYSDEV( dc, pExtEscape );
|
2021-08-13 12:09:34 +02:00
|
|
|
ret = physdev->funcs->pExtEscape( physdev, escape, input_size, input, output_size, output );
|
2012-09-20 21:07:04 +02:00
|
|
|
release_dc_ptr( dc );
|
2004-02-12 03:17:51 +01:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************
|
|
|
|
* DrawEscape [GDI32.@]
|
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
INT WINAPI DrawEscape(HDC hdc, INT nEscape, INT cbInput, LPCSTR lpszInData)
|
|
|
|
{
|
|
|
|
FIXME("DrawEscape, stub\n");
|
|
|
|
return 0;
|
|
|
|
}
|
2009-01-25 08:04:25 +01:00
|
|
|
|
|
|
|
/*******************************************************************
|
|
|
|
* NamedEscape [GDI32.@]
|
|
|
|
*/
|
|
|
|
INT WINAPI NamedEscape( HDC hdc, LPCWSTR pDriver, INT nEscape, INT cbInput, LPCSTR lpszInData,
|
|
|
|
INT cbOutput, LPSTR lpszOutData )
|
|
|
|
{
|
|
|
|
FIXME("(%p, %s, %d, %d, %p, %d, %p)\n",
|
|
|
|
hdc, wine_dbgstr_w(pDriver), nEscape, cbInput, lpszInData, cbOutput,
|
|
|
|
lpszOutData);
|
|
|
|
return 0;
|
|
|
|
}
|
2009-06-05 18:58:55 +02:00
|
|
|
|
|
|
|
/*******************************************************************
|
|
|
|
* DdQueryDisplaySettingsUniqueness [GDI32.@]
|
|
|
|
* GdiEntry13 [GDI32.@]
|
|
|
|
*/
|
|
|
|
ULONG WINAPI DdQueryDisplaySettingsUniqueness(VOID)
|
|
|
|
{
|
2010-03-26 10:33:21 +01:00
|
|
|
static int warn_once;
|
|
|
|
|
|
|
|
if (!warn_once++)
|
|
|
|
FIXME("stub\n");
|
2009-06-05 18:58:55 +02:00
|
|
|
return 0;
|
|
|
|
}
|
2015-04-15 19:26:07 +02:00
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* D3DKMTOpenAdapterFromHdc [GDI32.@]
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI D3DKMTOpenAdapterFromHdc( void *pData )
|
|
|
|
{
|
|
|
|
FIXME("(%p): stub\n", pData);
|
|
|
|
return STATUS_NO_MEMORY;
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* D3DKMTEscape [GDI32.@]
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI D3DKMTEscape( const void *pData )
|
|
|
|
{
|
|
|
|
FIXME("(%p): stub\n", pData);
|
|
|
|
return STATUS_NO_MEMORY;
|
|
|
|
}
|
2019-03-14 09:49:14 +01:00
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* D3DKMTCloseAdapter [GDI32.@]
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI D3DKMTCloseAdapter( const D3DKMT_CLOSEADAPTER *desc )
|
|
|
|
{
|
2019-06-05 17:18:44 +02:00
|
|
|
NTSTATUS status = STATUS_INVALID_PARAMETER;
|
|
|
|
struct d3dkmt_adapter *adapter;
|
|
|
|
|
|
|
|
TRACE("(%p)\n", desc);
|
|
|
|
|
|
|
|
if (!desc || !desc->hAdapter)
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
|
|
|
|
EnterCriticalSection( &driver_section );
|
|
|
|
LIST_FOR_EACH_ENTRY( adapter, &d3dkmt_adapters, struct d3dkmt_adapter, entry )
|
|
|
|
{
|
|
|
|
if (adapter->handle == desc->hAdapter)
|
|
|
|
{
|
|
|
|
list_remove( &adapter->entry );
|
|
|
|
heap_free( adapter );
|
|
|
|
status = STATUS_SUCCESS;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
LeaveCriticalSection( &driver_section );
|
|
|
|
|
|
|
|
return status;
|
2019-03-14 09:49:14 +01:00
|
|
|
}
|
2019-06-05 17:18:25 +02:00
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* D3DKMTOpenAdapterFromGdiDisplayName [GDI32.@]
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI D3DKMTOpenAdapterFromGdiDisplayName( D3DKMT_OPENADAPTERFROMGDIDISPLAYNAME *desc )
|
|
|
|
{
|
2020-06-11 16:00:32 +02:00
|
|
|
WCHAR *end, key_nameW[MAX_PATH], bufferW[MAX_PATH];
|
|
|
|
HDEVINFO devinfo = INVALID_HANDLE_VALUE;
|
|
|
|
NTSTATUS status = STATUS_UNSUCCESSFUL;
|
2019-06-05 17:18:25 +02:00
|
|
|
static D3DKMT_HANDLE handle_start = 0;
|
|
|
|
struct d3dkmt_adapter *adapter;
|
2020-06-11 16:00:32 +02:00
|
|
|
SP_DEVINFO_DATA device_data;
|
|
|
|
DWORD size, state_flags;
|
|
|
|
DEVPROPTYPE type;
|
|
|
|
HANDLE mutex;
|
|
|
|
LUID luid;
|
|
|
|
int index;
|
|
|
|
|
|
|
|
TRACE("(%p)\n", desc);
|
2019-06-05 17:18:25 +02:00
|
|
|
|
2020-06-11 16:00:32 +02:00
|
|
|
if (!desc)
|
|
|
|
return STATUS_UNSUCCESSFUL;
|
2019-06-05 17:18:25 +02:00
|
|
|
|
2020-06-11 16:00:32 +02:00
|
|
|
TRACE("DeviceName: %s\n", wine_dbgstr_w( desc->DeviceName ));
|
2020-11-06 12:08:16 +01:00
|
|
|
if (wcsnicmp( desc->DeviceName, L"\\\\.\\DISPLAY", lstrlenW(L"\\\\.\\DISPLAY") ))
|
2019-06-05 17:18:25 +02:00
|
|
|
return STATUS_UNSUCCESSFUL;
|
|
|
|
|
2020-11-06 12:08:16 +01:00
|
|
|
index = wcstol( desc->DeviceName + lstrlenW(L"\\\\.\\DISPLAY"), &end, 10 ) - 1;
|
2019-10-22 10:38:46 +02:00
|
|
|
if (*end)
|
2019-06-05 17:18:25 +02:00
|
|
|
return STATUS_UNSUCCESSFUL;
|
|
|
|
|
|
|
|
adapter = heap_alloc( sizeof( *adapter ) );
|
|
|
|
if (!adapter)
|
|
|
|
return STATUS_NO_MEMORY;
|
|
|
|
|
2020-06-11 16:00:32 +02:00
|
|
|
/* Get adapter LUID from SetupAPI */
|
|
|
|
mutex = get_display_device_init_mutex();
|
|
|
|
|
|
|
|
size = sizeof( bufferW );
|
2020-11-06 12:08:16 +01:00
|
|
|
swprintf( key_nameW, MAX_PATH, L"\\Device\\Video%d", index );
|
|
|
|
if (RegGetValueW( HKEY_LOCAL_MACHINE, L"HARDWARE\\DEVICEMAP\\VIDEO", key_nameW, RRF_RT_REG_SZ, NULL, bufferW, &size ))
|
2020-06-11 16:00:32 +02:00
|
|
|
goto done;
|
|
|
|
|
|
|
|
/* Strip \Registry\Machine\ prefix and retrieve Wine specific data set by the display driver */
|
|
|
|
lstrcpyW( key_nameW, bufferW + 18 );
|
|
|
|
size = sizeof( state_flags );
|
2020-11-06 12:08:16 +01:00
|
|
|
if (RegGetValueW( HKEY_CURRENT_CONFIG, key_nameW, L"StateFlags", RRF_RT_REG_DWORD, NULL,
|
2020-06-11 16:00:32 +02:00
|
|
|
&state_flags, &size ))
|
|
|
|
goto done;
|
|
|
|
|
|
|
|
if (!(state_flags & DISPLAY_DEVICE_ATTACHED_TO_DESKTOP))
|
|
|
|
goto done;
|
|
|
|
|
|
|
|
size = sizeof( bufferW );
|
2020-11-06 12:08:16 +01:00
|
|
|
if (RegGetValueW( HKEY_CURRENT_CONFIG, key_nameW, L"GPUID", RRF_RT_REG_SZ, NULL, bufferW, &size ))
|
2020-06-11 16:00:32 +02:00
|
|
|
goto done;
|
|
|
|
|
|
|
|
devinfo = SetupDiCreateDeviceInfoList( &GUID_DEVCLASS_DISPLAY, NULL );
|
|
|
|
device_data.cbSize = sizeof( device_data );
|
|
|
|
SetupDiOpenDeviceInfoW( devinfo, bufferW, NULL, 0, &device_data );
|
|
|
|
if (!SetupDiGetDevicePropertyW( devinfo, &device_data, &DEVPROPKEY_GPU_LUID, &type,
|
|
|
|
(BYTE *)&luid, sizeof( luid ), NULL, 0))
|
|
|
|
goto done;
|
|
|
|
|
2019-06-05 17:18:25 +02:00
|
|
|
EnterCriticalSection( &driver_section );
|
|
|
|
/* D3DKMT_HANDLE is UINT, so we can't use pointer as handle */
|
|
|
|
adapter->handle = ++handle_start;
|
|
|
|
list_add_tail( &d3dkmt_adapters, &adapter->entry );
|
|
|
|
LeaveCriticalSection( &driver_section );
|
|
|
|
|
|
|
|
desc->hAdapter = handle_start;
|
2020-06-11 16:00:32 +02:00
|
|
|
desc->AdapterLuid = luid;
|
|
|
|
desc->VidPnSourceId = index;
|
|
|
|
status = STATUS_SUCCESS;
|
|
|
|
|
|
|
|
done:
|
|
|
|
SetupDiDestroyDeviceInfoList( devinfo );
|
|
|
|
release_display_device_init_mutex( mutex );
|
|
|
|
if (status != STATUS_SUCCESS)
|
|
|
|
heap_free( adapter );
|
|
|
|
return status;
|
2019-06-05 17:18:25 +02:00
|
|
|
}
|
2019-06-05 17:18:52 +02:00
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* D3DKMTCreateDevice [GDI32.@]
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI D3DKMTCreateDevice( D3DKMT_CREATEDEVICE *desc )
|
|
|
|
{
|
|
|
|
static D3DKMT_HANDLE handle_start = 0;
|
|
|
|
struct d3dkmt_adapter *adapter;
|
|
|
|
struct d3dkmt_device *device;
|
|
|
|
BOOL found = FALSE;
|
|
|
|
|
|
|
|
TRACE("(%p)\n", desc);
|
|
|
|
|
|
|
|
if (!desc)
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
|
|
|
|
EnterCriticalSection( &driver_section );
|
|
|
|
LIST_FOR_EACH_ENTRY( adapter, &d3dkmt_adapters, struct d3dkmt_adapter, entry )
|
|
|
|
{
|
|
|
|
if (adapter->handle == desc->hAdapter)
|
|
|
|
{
|
|
|
|
found = TRUE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
LeaveCriticalSection( &driver_section );
|
|
|
|
|
|
|
|
if (!found)
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
|
|
|
|
if (desc->Flags.LegacyMode || desc->Flags.RequestVSync || desc->Flags.DisableGpuTimeout)
|
|
|
|
FIXME("Flags unsupported.\n");
|
|
|
|
|
|
|
|
device = heap_alloc_zero( sizeof( *device ) );
|
|
|
|
if (!device)
|
|
|
|
return STATUS_NO_MEMORY;
|
|
|
|
|
|
|
|
EnterCriticalSection( &driver_section );
|
|
|
|
device->handle = ++handle_start;
|
|
|
|
list_add_tail( &d3dkmt_devices, &device->entry );
|
|
|
|
LeaveCriticalSection( &driver_section );
|
|
|
|
|
|
|
|
desc->hDevice = device->handle;
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
2019-06-05 17:19:09 +02:00
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* D3DKMTDestroyDevice [GDI32.@]
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI D3DKMTDestroyDevice( const D3DKMT_DESTROYDEVICE *desc )
|
|
|
|
{
|
|
|
|
NTSTATUS status = STATUS_INVALID_PARAMETER;
|
2019-10-22 10:38:56 +02:00
|
|
|
D3DKMT_SETVIDPNSOURCEOWNER set_owner_desc;
|
2019-06-05 17:19:09 +02:00
|
|
|
struct d3dkmt_device *device;
|
|
|
|
|
|
|
|
TRACE("(%p)\n", desc);
|
|
|
|
|
|
|
|
if (!desc || !desc->hDevice)
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
|
|
|
|
EnterCriticalSection( &driver_section );
|
|
|
|
LIST_FOR_EACH_ENTRY( device, &d3dkmt_devices, struct d3dkmt_device, entry )
|
|
|
|
{
|
|
|
|
if (device->handle == desc->hDevice)
|
|
|
|
{
|
2019-10-22 10:38:56 +02:00
|
|
|
memset( &set_owner_desc, 0, sizeof(set_owner_desc) );
|
|
|
|
set_owner_desc.hDevice = desc->hDevice;
|
|
|
|
D3DKMTSetVidPnSourceOwner( &set_owner_desc );
|
2019-06-05 17:19:09 +02:00
|
|
|
list_remove( &device->entry );
|
|
|
|
heap_free( device );
|
|
|
|
status = STATUS_SUCCESS;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
LeaveCriticalSection( &driver_section );
|
|
|
|
|
|
|
|
return status;
|
|
|
|
}
|
2019-08-02 05:34:31 +02:00
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* D3DKMTQueryStatistics [GDI32.@]
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI D3DKMTQueryStatistics(D3DKMT_QUERYSTATISTICS *stats)
|
|
|
|
{
|
|
|
|
FIXME("(%p): stub\n", stats);
|
|
|
|
return STATUS_SUCCESS;
|
|
|
|
}
|
2019-10-22 10:38:56 +02:00
|
|
|
|
2020-01-29 08:34:01 +01:00
|
|
|
/******************************************************************************
|
|
|
|
* D3DKMTSetQueuedLimit [GDI32.@]
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI D3DKMTSetQueuedLimit( D3DKMT_SETQUEUEDLIMIT *desc )
|
|
|
|
{
|
|
|
|
FIXME( "(%p): stub\n", desc );
|
|
|
|
return STATUS_NOT_IMPLEMENTED;
|
|
|
|
}
|
|
|
|
|
2019-10-22 10:38:56 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* D3DKMTSetVidPnSourceOwner [GDI32.@]
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI D3DKMTSetVidPnSourceOwner( const D3DKMT_SETVIDPNSOURCEOWNER *desc )
|
|
|
|
{
|
|
|
|
TRACE("(%p)\n", desc);
|
|
|
|
|
|
|
|
if (!get_display_driver()->pD3DKMTSetVidPnSourceOwner)
|
|
|
|
return STATUS_PROCEDURE_NOT_FOUND;
|
|
|
|
|
|
|
|
if (!desc || !desc->hDevice || (desc->VidPnSourceCount && (!desc->pType || !desc->pVidPnSourceId)))
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
|
|
|
|
/* Store the VidPN source ownership info in the graphics driver because
|
|
|
|
* the graphics driver needs to change ownership sometimes. For example,
|
|
|
|
* when a new window is moved to a VidPN source with an exclusive owner,
|
|
|
|
* such an exclusive owner will be released before showing the new window */
|
|
|
|
return get_display_driver()->pD3DKMTSetVidPnSourceOwner( desc );
|
|
|
|
}
|
|
|
|
|
|
|
|
/******************************************************************************
|
|
|
|
* D3DKMTCheckVidPnExclusiveOwnership [GDI32.@]
|
|
|
|
*/
|
|
|
|
NTSTATUS WINAPI D3DKMTCheckVidPnExclusiveOwnership( const D3DKMT_CHECKVIDPNEXCLUSIVEOWNERSHIP *desc )
|
|
|
|
{
|
|
|
|
TRACE("(%p)\n", desc);
|
|
|
|
|
|
|
|
if (!get_display_driver()->pD3DKMTCheckVidPnExclusiveOwnership)
|
|
|
|
return STATUS_PROCEDURE_NOT_FOUND;
|
|
|
|
|
|
|
|
if (!desc || !desc->hAdapter)
|
|
|
|
return STATUS_INVALID_PARAMETER;
|
|
|
|
|
|
|
|
return get_display_driver()->pD3DKMTCheckVidPnExclusiveOwnership( desc );
|
|
|
|
}
|