From: Rémi Bernon rbernon@codeweavers.com
--- dlls/win32u/d3dkmt.c | 121 ++++++++++++++++++++++++++++++++----- dlls/win32u/tests/d3dkmt.c | 62 +++++++++---------- dlls/wow64win/gdi.c | 8 ++- server/d3dkmt.c | 4 +- server/protocol.def | 3 +- 5 files changed, 148 insertions(+), 50 deletions(-)
diff --git a/dlls/win32u/d3dkmt.c b/dlls/win32u/d3dkmt.c index 3536d8732e1..665a7b36175 100644 --- a/dlls/win32u/d3dkmt.c +++ b/dlls/win32u/d3dkmt.c @@ -202,7 +202,7 @@ static NTSTATUS d3dkmt_object_create( struct d3dkmt_object *object, BOOL shared, return status; }
-static NTSTATUS d3dkmt_object_open( struct d3dkmt_object *obj, D3DKMT_HANDLE global, +static NTSTATUS d3dkmt_object_open( struct d3dkmt_object *obj, D3DKMT_HANDLE global, HANDLE handle, void *runtime, UINT *runtime_size ) { NTSTATUS status; @@ -211,6 +211,7 @@ static NTSTATUS d3dkmt_object_open( struct d3dkmt_object *obj, D3DKMT_HANDLE glo { req->type = obj->type; req->global = global; + req->handle = wine_server_obj_handle( handle ); if (runtime) wine_server_set_reply( req, runtime, *runtime_size ); status = wine_server_call( req ); obj->handle = wine_server_ptr_handle( reply->handle ); @@ -221,8 +222,8 @@ static NTSTATUS d3dkmt_object_open( struct d3dkmt_object *obj, D3DKMT_HANDLE glo SERVER_END_REQ; if (!status) status = alloc_object_handle( obj );
- if (status) WARN( "Failed to open global object %#x, status %#x\n", global, status ); - else TRACE( "Opened global object %#x as %p/%#x\n", global, obj, obj->local ); + if (status) WARN( "Failed to open global object %#x/%p, status %#x\n", global, handle, status ); + else TRACE( "Opened global object %#x/%p as %p/%#x\n", global, handle, obj, obj->local ); return status; }
@@ -1120,7 +1121,7 @@ NTSTATUS WINAPI NtGdiDdDDIOpenResource( D3DKMT_OPENRESOURCE *params ) if ((status = d3dkmt_object_alloc( sizeof(*allocation), D3DKMT_ALLOCATION, (void **)&allocation ))) goto failed;
runtime_size = params->PrivateRuntimeDataSize; - if ((status = d3dkmt_object_open( &resource->obj, params->hGlobalShare, params->pPrivateRuntimeData, &runtime_size ))) goto failed; + if ((status = d3dkmt_object_open( &resource->obj, params->hGlobalShare, NULL, params->pPrivateRuntimeData, &runtime_size ))) goto failed;
if ((status = alloc_object_handle( allocation ))) goto failed; resource->allocation = allocation->local; @@ -1163,7 +1164,7 @@ NTSTATUS WINAPI NtGdiDdDDIOpenResource2( D3DKMT_OPENRESOURCE *params ) if ((status = d3dkmt_object_alloc( sizeof(*allocation), D3DKMT_ALLOCATION, (void **)&allocation ))) goto failed;
runtime_size = params->PrivateRuntimeDataSize; - if ((status = d3dkmt_object_open( &resource->obj, params->hGlobalShare, params->pPrivateRuntimeData, &runtime_size ))) goto failed; + if ((status = d3dkmt_object_open( &resource->obj, params->hGlobalShare, NULL, params->pPrivateRuntimeData, &runtime_size ))) goto failed;
if ((status = alloc_object_handle( allocation ))) goto failed; resource->allocation = allocation->local; @@ -1186,8 +1187,51 @@ failed: */ NTSTATUS WINAPI NtGdiDdDDIOpenResourceFromNtHandle( D3DKMT_OPENRESOURCEFROMNTHANDLE *params ) { - FIXME( "params %p stub!\n", params ); - return STATUS_NOT_IMPLEMENTED; + struct d3dkmt_object *mutex = NULL, *sync = NULL; + struct d3dkmt_resource *resource = NULL; + NTSTATUS status; + UINT dummy = 0; + + FIXME( "params %p semi-stub!\n", params ); + + if (!params) return STATUS_INVALID_PARAMETER; + if (!params->pPrivateRuntimeData) return STATUS_INVALID_PARAMETER; + if (!params->pTotalPrivateDriverDataBuffer) return STATUS_INVALID_PARAMETER; + if (!params->pOpenAllocationInfo2) return STATUS_INVALID_PARAMETER; + if (!params->NumAllocations) return STATUS_INVALID_PARAMETER; + + if ((status = d3dkmt_object_alloc( sizeof(*resource), D3DKMT_RESOURCE, (void **)&resource ))) return status; + if ((status = d3dkmt_object_alloc( sizeof(*mutex), D3DKMT_MUTEX, (void **)&mutex ))) goto failed; + if ((status = d3dkmt_object_alloc( sizeof(*sync), D3DKMT_SYNC, (void **)&sync ))) goto failed; + + if ((status = d3dkmt_object_open( &resource->obj, 0, params->hNtHandle, params->pPrivateRuntimeData, + ¶ms->PrivateRuntimeDataSize ))) + goto failed; + + if (d3dkmt_object_open( mutex, 0, params->hNtHandle, params->pKeyedMutexPrivateRuntimeData, ¶ms->KeyedMutexPrivateRuntimeDataSize )) + { + d3dkmt_object_free( mutex ); + mutex = NULL; + } + + if (d3dkmt_object_open( sync, 0, params->hNtHandle, NULL, &dummy )) + { + d3dkmt_object_free( sync ); + sync = NULL; + } + + params->hResource = resource->obj.local; + params->hKeyedMutex = mutex ? mutex->local : 0; + params->hSyncObject = sync ? sync->local : 0; + params->TotalPrivateDriverDataBufferSize = 0; + params->ResourcePrivateDriverDataSize = 0; + return STATUS_SUCCESS; + +failed: + if (sync) d3dkmt_object_free( sync ); + if (mutex) d3dkmt_object_free( mutex ); + if (resource) d3dkmt_object_free( &resource->obj ); + return status; }
/****************************************************************************** @@ -1322,7 +1366,7 @@ NTSTATUS WINAPI NtGdiDdDDIOpenKeyedMutex2( D3DKMT_OPENKEYEDMUTEX2 *params ) if ((status = d3dkmt_object_alloc( sizeof(*mutex), D3DKMT_MUTEX, (void **)&mutex ))) return status;
runtime_size = params->PrivateRuntimeDataSize; - if ((status = d3dkmt_object_open( mutex, params->hSharedHandle, params->pPrivateRuntimeData, &runtime_size ))) goto failed; + if ((status = d3dkmt_object_open( mutex, params->hSharedHandle, NULL, params->pPrivateRuntimeData, &runtime_size ))) goto failed;
params->hKeyedMutex = mutex->local; return STATUS_SUCCESS; @@ -1355,8 +1399,22 @@ NTSTATUS WINAPI NtGdiDdDDIOpenKeyedMutex( D3DKMT_OPENKEYEDMUTEX *params ) */ NTSTATUS WINAPI NtGdiDdDDIOpenKeyedMutexFromNtHandle( D3DKMT_OPENKEYEDMUTEXFROMNTHANDLE *params ) { - FIXME( "params %p stub!\n", params ); - return STATUS_NOT_IMPLEMENTED; + struct d3dkmt_object *mutex; + NTSTATUS status; + + FIXME( "params %p semi-stub!\n", params ); + + if ((status = d3dkmt_object_alloc( sizeof(*mutex), D3DKMT_MUTEX, (void **)&mutex ))) return status; + if ((status = d3dkmt_object_open( mutex, 0, params->hNtHandle, params->pPrivateRuntimeData, + ¶ms->PrivateRuntimeDataSize ))) + goto failed; + + params->hKeyedMutex = mutex->local; + return STATUS_SUCCESS; + +failed: + d3dkmt_object_free( mutex ); + return status; }
@@ -1422,8 +1480,26 @@ NTSTATUS WINAPI NtGdiDdDDICreateSynchronizationObject( D3DKMT_CREATESYNCHRONIZAT */ NTSTATUS WINAPI NtGdiDdDDIOpenSyncObjectFromNtHandle2( D3DKMT_OPENSYNCOBJECTFROMNTHANDLE2 *params ) { - FIXME( "params %p stub!\n", params ); - return STATUS_NOT_IMPLEMENTED; + struct d3dkmt_object *sync, *device; + NTSTATUS status; + UINT dummy = 0; + + FIXME( "params %p semi-stub!\n", params ); + + if (!params) return STATUS_INVALID_PARAMETER; + if (!(device = get_d3dkmt_object( params->hDevice, D3DKMT_DEVICE ))) return STATUS_INVALID_PARAMETER; + + if ((status = d3dkmt_object_alloc( sizeof(*sync), D3DKMT_SYNC, (void **)&sync ))) return status; + if ((status = d3dkmt_object_open( sync, 0, params->hNtHandle, NULL, &dummy ))) goto failed; + + params->hSyncObject = sync->local; + params->MonitoredFence.FenceValueCPUVirtualAddress = 0; + params->MonitoredFence.FenceValueGPUVirtualAddress = 0; + return STATUS_SUCCESS; + +failed: + d3dkmt_object_free( sync ); + return status; }
/****************************************************************************** @@ -1431,8 +1507,23 @@ NTSTATUS WINAPI NtGdiDdDDIOpenSyncObjectFromNtHandle2( D3DKMT_OPENSYNCOBJECTFROM */ NTSTATUS WINAPI NtGdiDdDDIOpenSyncObjectFromNtHandle( D3DKMT_OPENSYNCOBJECTFROMNTHANDLE *params ) { - FIXME( "params %p stub!\n", params ); - return STATUS_NOT_IMPLEMENTED; + struct d3dkmt_object *sync; + NTSTATUS status; + UINT dummy = 0; + + FIXME( "params %p semi-stub!\n", params ); + + if (!params) return STATUS_INVALID_PARAMETER; + + if ((status = d3dkmt_object_alloc( sizeof(*sync), D3DKMT_SYNC, (void **)&sync ))) return status; + if ((status = d3dkmt_object_open( sync, 0, params->hNtHandle, NULL, &dummy ))) goto failed; + + params->hSyncObject = sync->local; + return STATUS_SUCCESS; + +failed: + d3dkmt_object_free( sync ); + return status; }
/****************************************************************************** @@ -1459,7 +1550,7 @@ NTSTATUS WINAPI NtGdiDdDDIOpenSynchronizationObject( D3DKMT_OPENSYNCHRONIZATIONO if (!is_d3dkmt_global( params->hSharedHandle )) return STATUS_INVALID_PARAMETER;
if ((status = d3dkmt_object_alloc( sizeof(*sync), D3DKMT_SYNC, (void **)&sync ))) return status; - if ((status = d3dkmt_object_open( sync, params->hSharedHandle, NULL, &dummy ))) goto failed; + if ((status = d3dkmt_object_open( sync, params->hSharedHandle, NULL, NULL, &dummy ))) goto failed;
params->hSyncObject = sync->local; return STATUS_SUCCESS; diff --git a/dlls/win32u/tests/d3dkmt.c b/dlls/win32u/tests/d3dkmt.c index ececd663449..4a7578f2588 100644 --- a/dlls/win32u/tests/d3dkmt.c +++ b/dlls/win32u/tests/d3dkmt.c @@ -2211,12 +2211,12 @@ static void test_D3DKMTShareObjects( void )
/* the sync object can be opened from the NT handle */ status = D3DKMTOpenSyncObjectFromNtHandle( &open_sync ); - todo_wine ok_nt( STATUS_INVALID_HANDLE, status ); + ok_nt( STATUS_INVALID_HANDLE, status ); open_sync.hNtHandle = handle; open_sync.hSyncObject = 0x1eadbeed; status = D3DKMTOpenSyncObjectFromNtHandle( &open_sync ); - todo_wine ok_nt( STATUS_SUCCESS, status ); - todo_wine check_d3dkmt_local( open_sync.hSyncObject, NULL ); + ok_nt( STATUS_SUCCESS, status ); + check_d3dkmt_local( open_sync.hSyncObject, NULL );
/* objects opened with D3DKMTOpenSyncObjectFromNtHandle cannot be reshared */ InitializeObjectAttributes( &attr, &name, 0, 0, NULL ); @@ -2225,19 +2225,19 @@ static void test_D3DKMTShareObjects( void )
destroy_sync.hSyncObject = open_sync.hSyncObject; status = D3DKMTDestroySynchronizationObject( &destroy_sync ); - todo_wine ok_nt( STATUS_SUCCESS, status ); + ok_nt( STATUS_SUCCESS, status );
status = D3DKMTOpenSyncObjectFromNtHandle2( &open_sync2 ); - todo_wine ok_nt( STATUS_INVALID_PARAMETER, status ); + ok_nt( STATUS_INVALID_PARAMETER, status ); open_sync2.hNtHandle = open_sync.hNtHandle; status = D3DKMTOpenSyncObjectFromNtHandle2( &open_sync2 ); - todo_wine ok_nt( STATUS_INVALID_PARAMETER, status ); + ok_nt( STATUS_INVALID_PARAMETER, status ); open_sync2.hDevice = create_device.hDevice; open_sync2.hSyncObject = 0x1eadbeed; status = D3DKMTOpenSyncObjectFromNtHandle2( &open_sync2 ); - todo_wine ok_nt( STATUS_SUCCESS, status ); - todo_wine check_d3dkmt_local( open_sync2.hSyncObject, NULL ); + ok_nt( STATUS_SUCCESS, status ); + check_d3dkmt_local( open_sync2.hSyncObject, NULL );
/* objects opened with Shared/NtSecuritySharing flags don't seem to matter */ ok_x4( open_sync2.Flags.Shared, ==, 0 ); @@ -2245,12 +2245,12 @@ static void test_D3DKMTShareObjects( void ) InitializeObjectAttributes( &attr, &name2, 0, 0, NULL ); handle = (HANDLE)0xdeadbeef; status = D3DKMTShareObjects( 1, &open_sync2.hSyncObject, &attr, STANDARD_RIGHTS_READ, &handle ); - todo_wine ok_nt( STATUS_SUCCESS, status ); + ok_nt( STATUS_SUCCESS, status ); CloseHandle( handle );
destroy_sync.hSyncObject = open_sync2.hSyncObject; status = D3DKMTDestroySynchronizationObject( &destroy_sync ); - todo_wine ok_nt( STATUS_SUCCESS, status ); + ok_nt( STATUS_SUCCESS, status );
status = D3DKMTOpenSyncObjectNtHandleFromName( &open_sync_name ); @@ -2272,7 +2272,7 @@ static void test_D3DKMTShareObjects( void ) CloseHandle( open_sync2.hNtHandle );
status = D3DKMTOpenSyncObjectFromNtHandle2( &open_sync2 ); - todo_wine ok_nt( STATUS_INVALID_HANDLE, status ); + ok_nt( STATUS_INVALID_HANDLE, status ); open_sync2.hNtHandle = open_sync_name.hNtHandle; open_sync2.hSyncObject = 0x1eadbeed; status = D3DKMTOpenSyncObjectFromNtHandle2( &open_sync2 ); @@ -2455,16 +2455,16 @@ static void test_D3DKMTShareObjects( void ) open_resource.pTotalPrivateDriverDataBuffer = driver_data; open_resource.TotalPrivateDriverDataBufferSize = query_resource.TotalPrivateDriverDataSize; status = D3DKMTOpenResourceFromNtHandle( &open_resource ); - todo_wine ok_nt( STATUS_SUCCESS, status ); + ok_nt( STATUS_SUCCESS, status ); ok_u4( open_resource.NumAllocations, ==, 1 ); - todo_wine ok_x4( open_resource.PrivateRuntimeDataSize, ==, sizeof(expect_runtime_data) ); + ok_x4( open_resource.PrivateRuntimeDataSize, ==, sizeof(expect_runtime_data) ); ok_x4( open_resource.ResourcePrivateDriverDataSize, ==, 0 ); - ok_x4( open_resource.TotalPrivateDriverDataBufferSize, >, 0 ); - todo_wine ok_x4( open_resource.TotalPrivateDriverDataBufferSize, <, sizeof(driver_data) ); - todo_wine check_d3dkmt_local( open_resource.hResource, NULL ); - todo_wine ok_x4( open_resource.hKeyedMutex, ==, 0 ); + todo_wine ok_x4( open_resource.TotalPrivateDriverDataBufferSize, >, 0 ); + ok_x4( open_resource.TotalPrivateDriverDataBufferSize, <, sizeof(driver_data) ); + check_d3dkmt_local( open_resource.hResource, NULL ); + ok_x4( open_resource.hKeyedMutex, ==, 0 ); ok_x4( open_resource.KeyedMutexPrivateRuntimeDataSize, ==, 0 ); - todo_wine ok_x4( open_resource.hSyncObject, ==, 0 ); + ok_x4( open_resource.hSyncObject, ==, 0 ); todo_wine check_d3dkmt_local( open_alloc.hAllocation, NULL ); todo_wine ok_x4( open_alloc.PrivateDriverDataSize, >, 0 ); ok_x4( open_alloc.PrivateDriverDataSize, <, sizeof(alloc_data) ); @@ -2473,32 +2473,32 @@ static void test_D3DKMTShareObjects( void )
destroy_alloc.hResource = open_resource.hResource; status = D3DKMTDestroyAllocation( &destroy_alloc ); - todo_wine ok_nt( STATUS_SUCCESS, status ); + ok_nt( STATUS_SUCCESS, status ); open_resource.hResource = 0;
open_resource.pOpenAllocationInfo2 = NULL; status = D3DKMTOpenResourceFromNtHandle( &open_resource ); - todo_wine ok( status == STATUS_INVALID_PARAMETER || broken(status == STATUS_ACCESS_VIOLATION) /* win32 */, "got %#lx\n", status ); + ok( status == STATUS_INVALID_PARAMETER || broken(status == STATUS_ACCESS_VIOLATION) /* win32 */, "got %#lx\n", status ); open_resource.pOpenAllocationInfo2 = &open_alloc;
open_resource.NumAllocations = 0; status = D3DKMTOpenResourceFromNtHandle( &open_resource ); - todo_wine ok_nt( STATUS_INVALID_PARAMETER, status ); + ok_nt( STATUS_INVALID_PARAMETER, status ); open_resource.NumAllocations = 1;
open_resource.pPrivateRuntimeData = NULL; status = D3DKMTOpenResourceFromNtHandle( &open_resource ); - todo_wine ok_nt( STATUS_INVALID_PARAMETER, status ); + ok_nt( STATUS_INVALID_PARAMETER, status ); open_resource.pPrivateRuntimeData = runtime_data;
open_resource.PrivateRuntimeDataSize += 1; status = D3DKMTOpenResourceFromNtHandle( &open_resource ); - todo_wine ok_nt( STATUS_INVALID_PARAMETER, status ); + ok_nt( STATUS_INVALID_PARAMETER, status ); open_resource.PrivateRuntimeDataSize = query_resource.PrivateRuntimeDataSize;
open_resource.pTotalPrivateDriverDataBuffer = NULL; status = D3DKMTOpenResourceFromNtHandle( &open_resource ); - todo_wine ok_nt( STATUS_INVALID_PARAMETER, status ); + ok_nt( STATUS_INVALID_PARAMETER, status ); open_resource.pTotalPrivateDriverDataBuffer = driver_data;
open_resource.TotalPrivateDriverDataBufferSize -= 1; @@ -2621,32 +2621,32 @@ static void test_D3DKMTShareObjects( void ) open_resource.pKeyedMutexPrivateRuntimeData = mutex_data; open_resource.KeyedMutexPrivateRuntimeDataSize = sizeof(expect_mutex_data); status = D3DKMTOpenResourceFromNtHandle( &open_resource ); - todo_wine ok_nt( STATUS_SUCCESS, status ); + ok_nt( STATUS_SUCCESS, status ); ok_u4( open_resource.NumAllocations, ==, 1 ); ok_x4( open_resource.PrivateRuntimeDataSize, ==, sizeof(expect_runtime_data) ); ok_x4( open_resource.ResourcePrivateDriverDataSize, ==, 0 ); todo_wine ok_x4( open_resource.TotalPrivateDriverDataBufferSize, >, 0 ); ok_x4( open_resource.TotalPrivateDriverDataBufferSize, <, sizeof(driver_data) ); - todo_wine check_d3dkmt_local( open_resource.hResource, NULL ); - todo_wine check_d3dkmt_local( open_resource.hKeyedMutex, NULL ); + check_d3dkmt_local( open_resource.hResource, NULL ); + check_d3dkmt_local( open_resource.hKeyedMutex, NULL ); ok_x4( open_resource.KeyedMutexPrivateRuntimeDataSize, ==, sizeof(expect_mutex_data) ); - todo_wine check_d3dkmt_local( open_resource.hSyncObject, NULL ); + check_d3dkmt_local( open_resource.hSyncObject, NULL ); todo_wine check_d3dkmt_local( open_alloc.hAllocation, NULL ); todo_wine ok_x4( open_alloc.PrivateDriverDataSize, >, 0 );
destroy_alloc.hResource = open_resource.hResource; status = D3DKMTDestroyAllocation( &destroy_alloc ); - todo_wine ok_nt( STATUS_SUCCESS, status ); + ok_nt( STATUS_SUCCESS, status ); open_resource.hResource = 0;
destroy_mutex.hKeyedMutex = open_resource.hKeyedMutex; status = D3DKMTDestroyKeyedMutex( &destroy_mutex ); - todo_wine ok_nt( STATUS_SUCCESS, status ); + ok_nt( STATUS_SUCCESS, status ); open_resource.hKeyedMutex = 0;
destroy_sync.hSyncObject = open_resource.hSyncObject; status = D3DKMTDestroySynchronizationObject( &destroy_sync ); - todo_wine ok_nt( STATUS_SUCCESS, status ); + ok_nt( STATUS_SUCCESS, status ); open_resource.hSyncObject = 0;
memset( &open_resource, 0, sizeof(open_resource) ); diff --git a/dlls/wow64win/gdi.c b/dlls/wow64win/gdi.c index 7b96e7d3a34..a03dd4e4990 100644 --- a/dlls/wow64win/gdi.c +++ b/dlls/wow64win/gdi.c @@ -1183,13 +1183,13 @@ NTSTATUS WINAPI wow64_NtGdiDdDDIOpenResourceFromNtHandle( UINT *args ) desc.hDevice = desc32->hDevice; desc.hNtHandle = UlongToHandle( desc32->hNtHandle ); desc.NumAllocations = desc32->NumAllocations; + allocs32 = UlongToPtr( desc32->pOpenAllocationInfo2 ); desc.pOpenAllocationInfo2 = NULL; if (desc32->pOpenAllocationInfo2 && desc32->NumAllocations) { if (!(desc.pOpenAllocationInfo2 = Wow64AllocateTemp( desc32->NumAllocations + sizeof(*desc.pOpenAllocationInfo2) ))) return STATUS_NO_MEMORY;
- allocs32 = UlongToPtr( desc32->pOpenAllocationInfo2 ); for (i = 0; i < desc32->NumAllocations; i++) { desc.pOpenAllocationInfo2[i].hAllocation = allocs32->hAllocation; @@ -1211,12 +1211,18 @@ NTSTATUS WINAPI wow64_NtGdiDdDDIOpenResourceFromNtHandle( UINT *args ) desc.hSyncObject = desc32->hSyncObject;
status = NtGdiDdDDIOpenResourceFromNtHandle( &desc ); + desc32->PrivateRuntimeDataSize = desc.PrivateRuntimeDataSize; + desc32->ResourcePrivateDriverDataSize = desc.ResourcePrivateDriverDataSize; desc32->TotalPrivateDriverDataBufferSize = desc.TotalPrivateDriverDataBufferSize; desc32->hResource = desc.hResource; desc32->hKeyedMutex = desc.hKeyedMutex; desc32->hSyncObject = desc.hSyncObject; for (i = 0; desc32->pOpenAllocationInfo2 && i < desc32->NumAllocations; i++) + { + allocs32->hAllocation = desc.pOpenAllocationInfo2[i].hAllocation; + allocs32->PrivateDriverDataSize = desc.pOpenAllocationInfo2[i].PrivateDriverDataSize; allocs32->GpuVirtualAddress = desc.pOpenAllocationInfo2[i].GpuVirtualAddress; + } return status; }
diff --git a/server/d3dkmt.c b/server/d3dkmt.c index ce81521a2ff..4cc4f3ad0bd 100644 --- a/server/d3dkmt.c +++ b/server/d3dkmt.c @@ -408,8 +408,8 @@ DECL_HANDLER(d3dkmt_object_open) struct d3dkmt_object *object; obj_handle_t handle;
- if (!req->global) return; - object = d3dkmt_object_open( req->global, req->type ); + if (req->global) object = d3dkmt_object_open( req->global, req->type ); + else object = d3dkmt_object_open_shared( req->handle, req->type ); if (!object) return;
/* only resource objects require exact runtime buffer size match */ diff --git a/server/protocol.def b/server/protocol.def index 036e35cdf68..29f05cf1273 100644 --- a/server/protocol.def +++ b/server/protocol.def @@ -4173,10 +4173,11 @@ enum inproc_sync_type @END
-/* Open a global d3dkmt object */ +/* Open a global/shared d3dkmt object */ @REQ(d3dkmt_object_open) unsigned int type; /* d3dkmt object type */ d3dkmt_handle_t global; /* global d3dkmt handle */ + obj_handle_t handle; /* shared object handle */ @REPLY d3dkmt_handle_t global; /* global d3dkmt handle */ obj_handle_t handle; /* internal handle of the server object */