Commit d3703052 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

gdi32: Implement D3DKMTOpenAdapterFromGdiDisplayName.

parent 4ce467ff
......@@ -46,7 +46,7 @@
@ stub D3DKMTLock
@ stub D3DKMTOfferAllocations
@ stub D3DKMTOpenAdapterFromDeviceName
@ stub D3DKMTOpenAdapterFromGdiDisplayName
@ stdcall D3DKMTOpenAdapterFromGdiDisplayName(ptr) gdi32.D3DKMTOpenAdapterFromGdiDisplayName
@ stdcall D3DKMTOpenAdapterFromHdc(ptr) gdi32.D3DKMTOpenAdapterFromHdc
@ stub D3DKMTOpenKeyedMutex
@ stub D3DKMTOpenKeyedMutex2
......
......@@ -22,6 +22,7 @@
@ stub D3DKMTGetRuntimeData
@ stub D3DKMTGetSharedPrimaryHandle
@ stub D3DKMTLock
@ stdcall D3DKMTOpenAdapterFromGdiDisplayName(ptr) gdi32.D3DKMTOpenAdapterFromGdiDisplayName
@ stub D3DKMTOpenAdapterFromHdc
@ stub D3DKMTOpenResource
@ stub D3DKMTPresent
......
......@@ -41,6 +41,7 @@
#include "wine/unicode.h"
#include "wine/list.h"
#include "wine/debug.h"
#include "wine/heap.h"
WINE_DEFAULT_DEBUG_CHANNEL(driver);
......@@ -51,9 +52,18 @@ struct graphics_driver
const struct gdi_dc_funcs *funcs;
};
struct d3dkmt_adapter
{
D3DKMT_HANDLE handle; /* Kernel mode graphics adapter handle */
INT ordinal; /* Graphics adapter ordinal */
struct list entry; /* List entry */
};
static struct list drivers = LIST_INIT( drivers );
static struct graphics_driver *display_driver;
static struct list d3dkmt_adapters = LIST_INIT( d3dkmt_adapters );
const struct gdi_dc_funcs *font_driver = NULL;
static CRITICAL_SECTION driver_section;
......@@ -1272,3 +1282,43 @@ NTSTATUS WINAPI D3DKMTCloseAdapter( const D3DKMT_CLOSEADAPTER *desc )
FIXME("(%p): stub\n", desc);
return STATUS_SUCCESS;
}
/******************************************************************************
* D3DKMTOpenAdapterFromGdiDisplayName [GDI32.@]
*/
NTSTATUS WINAPI D3DKMTOpenAdapterFromGdiDisplayName( D3DKMT_OPENADAPTERFROMGDIDISPLAYNAME *desc )
{
static const WCHAR display1W[] = {'\\','\\','.','\\','D','I','S','P','L','A','Y','1',0};
static D3DKMT_HANDLE handle_start = 0;
struct d3dkmt_adapter *adapter;
TRACE("(%p) semi-stub\n", desc);
if (!desc)
return STATUS_UNSUCCESSFUL;
/* FIXME: Support multiple monitors */
if (lstrcmpiW( desc->DeviceName, display1W ))
{
FIXME("%s is unsupported\n", wine_dbgstr_w( desc->DeviceName ));
return STATUS_UNSUCCESSFUL;
}
adapter = heap_alloc( sizeof( *adapter ) );
if (!adapter)
return STATUS_NO_MEMORY;
EnterCriticalSection( &driver_section );
/* D3DKMT_HANDLE is UINT, so we can't use pointer as handle */
adapter->handle = ++handle_start;
adapter->ordinal = 0;
list_add_tail( &d3dkmt_adapters, &adapter->entry );
LeaveCriticalSection( &driver_section );
desc->hAdapter = handle_start;
/* FIXME: Support AdapterLuid */
desc->AdapterLuid.LowPart = 0;
desc->AdapterLuid.HighPart = 0;
desc->VidPnSourceId = 0;
return STATUS_SUCCESS;
}
......@@ -84,6 +84,7 @@
@ stdcall D3DKMTCreateDCFromMemory(ptr)
@ stdcall D3DKMTDestroyDCFromMemory(ptr)
@ stdcall D3DKMTEscape(ptr)
@ stdcall D3DKMTOpenAdapterFromGdiDisplayName(ptr)
@ stdcall D3DKMTOpenAdapterFromHdc(ptr)
@ stdcall DPtoLP(long ptr long)
@ stdcall DeleteColorSpace(long)
......
......@@ -56,7 +56,7 @@ static void test_D3DKMTOpenAdapterFromGdiDisplayName(void)
if (!pD3DKMTOpenAdapterFromGdiDisplayName
|| pD3DKMTOpenAdapterFromGdiDisplayName(&open_adapter_gdi_desc) == STATUS_PROCEDURE_NOT_FOUND)
{
skip("D3DKMTOpenAdapterFromGdiDisplayName() is unavailable.\n");
win_skip("D3DKMTOpenAdapterFromGdiDisplayName() is unavailable.\n");
return;
}
......
......@@ -168,6 +168,7 @@ extern "C"
NTSTATUS WINAPI D3DKMTCloseAdapter(const D3DKMT_CLOSEADAPTER *desc);
NTSTATUS WINAPI D3DKMTCreateDCFromMemory(D3DKMT_CREATEDCFROMMEMORY *desc);
NTSTATUS WINAPI D3DKMTDestroyDCFromMemory(const D3DKMT_DESTROYDCFROMMEMORY *desc);
NTSTATUS WINAPI D3DKMTOpenAdapterFromGdiDisplayName(D3DKMT_OPENADAPTERFROMGDIDISPLAYNAME *desc);
#ifdef __cplusplus
}
......
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