Commit 344556f7 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

gdi32: Implement D3DKMTCloseAdapter.

parent d3703052
......@@ -5,7 +5,7 @@
@ stdcall D3D11CreateDevice(ptr long ptr long ptr long long ptr ptr ptr)
@ stdcall D3D11CreateDeviceAndSwapChain(ptr long ptr long ptr long long ptr ptr ptr ptr ptr)
@ stdcall D3D11On12CreateDevice(ptr long ptr long ptr long long ptr ptr ptr)
@ stub D3DKMTCloseAdapter
@ stdcall D3DKMTCloseAdapter(ptr) gdi32.D3DKMTCloseAdapter
@ stub D3DKMTCreateAllocation
@ stub D3DKMTCreateContext
@ stub D3DKMTCreateDevice
......
......@@ -1279,8 +1279,28 @@ NTSTATUS WINAPI D3DKMTEscape( const void *pData )
*/
NTSTATUS WINAPI D3DKMTCloseAdapter( const D3DKMT_CLOSEADAPTER *desc )
{
FIXME("(%p): stub\n", desc);
return STATUS_SUCCESS;
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;
}
/******************************************************************************
......
......@@ -179,11 +179,11 @@ static void test_D3DKMTCloseAdapter(void)
/* Invalid parameters */
status = pD3DKMTCloseAdapter(NULL);
todo_wine ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status);
memset(&close_adapter_desc, 0, sizeof(close_adapter_desc));
status = pD3DKMTCloseAdapter(&close_adapter_desc);
todo_wine ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status);
ok(status == STATUS_INVALID_PARAMETER, "Got unexpected return code %#x.\n", status);
}
static void test_D3DKMTCreateDevice(void)
......
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