Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
2d18cf57
Commit
2d18cf57
authored
Feb 12, 2015
by
Henri Verbeet
Committed by
Alexandre Julliard
Feb 12, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dxgi: Implement dxgi_device_GetPrivateData().
parent
2190f026
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
64 additions
and
18 deletions
+64
-18
device.c
dlls/dxgi/device.c
+4
-2
dxgi_private.h
dlls/dxgi/dxgi_private.h
+2
-0
device.c
dlls/dxgi/tests/device.c
+16
-16
utils.c
dlls/dxgi/utils.c
+42
-0
No files found.
dlls/dxgi/device.c
View file @
2d18cf57
...
...
@@ -116,9 +116,11 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_SetPrivateDataInterface(IWineDXGIDe
static
HRESULT
STDMETHODCALLTYPE
dxgi_device_GetPrivateData
(
IWineDXGIDevice
*
iface
,
REFGUID
guid
,
UINT
*
data_size
,
void
*
data
)
{
FIXME
(
"iface %p, guid %s, data_size %p, data %p stub!
\n
"
,
iface
,
debugstr_guid
(
guid
),
data_size
,
data
);
struct
dxgi_device
*
device
=
impl_from_IWineDXGIDevice
(
iface
);
return
E_NOTIMPL
;
TRACE
(
"iface %p, guid %s, data_size %p, data %p.
\n
"
,
iface
,
debugstr_guid
(
guid
),
data_size
,
data
);
return
dxgi_get_private_data
(
&
device
->
private_store
,
guid
,
data_size
,
data
);
}
static
HRESULT
STDMETHODCALLTYPE
dxgi_device_GetParent
(
IWineDXGIDevice
*
iface
,
REFIID
riid
,
void
**
parent
)
...
...
dlls/dxgi/dxgi_private.h
View file @
2d18cf57
...
...
@@ -76,6 +76,8 @@ const char *debug_dxgi_format(DXGI_FORMAT format) DECLSPEC_HIDDEN;
DXGI_FORMAT
dxgi_format_from_wined3dformat
(
enum
wined3d_format_id
format
)
DECLSPEC_HIDDEN
;
enum
wined3d_format_id
wined3dformat_from_dxgi_format
(
DXGI_FORMAT
format
)
DECLSPEC_HIDDEN
;
HRESULT
dxgi_get_private_data
(
struct
wined3d_private_store
*
store
,
REFGUID
guid
,
UINT
*
data_size
,
void
*
data
)
DECLSPEC_HIDDEN
;
HRESULT
dxgi_set_private_data
(
struct
wined3d_private_store
*
store
,
REFGUID
guid
,
UINT
data_size
,
const
void
*
data
)
DECLSPEC_HIDDEN
;
HRESULT
dxgi_set_private_data_interface
(
struct
wined3d_private_store
*
store
,
...
...
dlls/dxgi/tests/device.c
View file @
2d18cf57
...
...
@@ -634,9 +634,9 @@ static void test_private_data(void)
size
=
sizeof
(
ptr
)
*
2
;
ptr
=
(
IUnknown
*
)
0xdeadbeef
;
hr
=
IDXGIDevice_GetPrivateData
(
device
,
&
dxgi_private_data_test_guid
,
&
size
,
&
ptr
);
todo_wine
ok
(
hr
==
S_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
!
ptr
,
"Got unexpected pointer %p.
\n
"
,
ptr
);
todo_wine
ok
(
size
==
sizeof
(
IUnknown
*
),
"Got unexpected size %u.
\n
"
,
size
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
!
ptr
,
"Got unexpected pointer %p.
\n
"
,
ptr
);
ok
(
size
==
sizeof
(
IUnknown
*
),
"Got unexpected size %u.
\n
"
,
size
);
refcount
=
get_refcount
((
IUnknown
*
)
test_object
);
hr
=
IDXGIDevice_SetPrivateDataInterface
(
device
,
&
dxgi_private_data_test_guid
,
...
...
@@ -677,11 +677,11 @@ static void test_private_data(void)
size
=
2
*
sizeof
(
ptr
);
ptr
=
NULL
;
hr
=
IDXGIDevice_GetPrivateData
(
device
,
&
dxgi_private_data_test_guid
,
&
size
,
&
ptr
);
todo_wine
ok
(
hr
==
S_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
size
==
sizeof
(
test_object
),
"Got unexpected size %u.
\n
"
,
size
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
size
==
sizeof
(
test_object
),
"Got unexpected size %u.
\n
"
,
size
);
expected_refcount
++
;
refcount
=
get_refcount
((
IUnknown
*
)
test_object
);
todo_wine
ok
(
refcount
==
expected_refcount
,
"Got unexpected refcount %u, expected %u.
\n
"
,
refcount
,
expected_refcount
);
ok
(
refcount
==
expected_refcount
,
"Got unexpected refcount %u, expected %u.
\n
"
,
refcount
,
expected_refcount
);
if
(
ptr
)
IUnknown_Release
(
ptr
);
expected_refcount
--
;
...
...
@@ -689,29 +689,29 @@ static void test_private_data(void)
ptr
=
(
IUnknown
*
)
0xdeadbeef
;
size
=
1
;
hr
=
IDXGIDevice_GetPrivateData
(
device
,
&
dxgi_private_data_test_guid
,
&
size
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
size
==
sizeof
(
device
),
"Got unexpected size %u.
\n
"
,
size
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
size
==
sizeof
(
device
),
"Got unexpected size %u.
\n
"
,
size
);
size
=
2
*
sizeof
(
ptr
);
hr
=
IDXGIDevice_GetPrivateData
(
device
,
&
dxgi_private_data_test_guid
,
&
size
,
NULL
);
todo_wine
ok
(
hr
==
S_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
size
==
sizeof
(
device
),
"Got unexpected size %u.
\n
"
,
size
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
size
==
sizeof
(
device
),
"Got unexpected size %u.
\n
"
,
size
);
refcount
=
get_refcount
((
IUnknown
*
)
test_object
);
ok
(
refcount
==
expected_refcount
,
"Got unexpected refcount %u, expected %u.
\n
"
,
refcount
,
expected_refcount
);
size
=
1
;
hr
=
IDXGIDevice_GetPrivateData
(
device
,
&
dxgi_private_data_test_guid
,
&
size
,
&
ptr
);
todo_wine
ok
(
hr
==
DXGI_ERROR_MORE_DATA
,
"Got unexpected hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
size
==
sizeof
(
device
),
"Got unexpected size %u.
\n
"
,
size
);
ok
(
hr
==
DXGI_ERROR_MORE_DATA
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
size
==
sizeof
(
device
),
"Got unexpected size %u.
\n
"
,
size
);
ok
(
ptr
==
(
IUnknown
*
)
0xdeadbeef
,
"Got unexpected pointer %p.
\n
"
,
ptr
);
hr
=
IDXGIDevice_GetPrivateData
(
device
,
&
dxgi_private_data_test_guid2
,
NULL
,
NULL
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Got unexpected hr %#x.
\n
"
,
hr
);
size
=
0xdeadbabe
;
hr
=
IDXGIDevice_GetPrivateData
(
device
,
&
dxgi_private_data_test_guid2
,
&
size
,
&
ptr
);
todo_wine
ok
(
hr
==
DXGI_ERROR_NOT_FOUND
,
"Got unexpected hr %#x.
\n
"
,
hr
);
todo_wine
ok
(
size
==
0
,
"Got unexpected size %u.
\n
"
,
size
);
ok
(
hr
==
DXGI_ERROR_NOT_FOUND
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
size
==
0
,
"Got unexpected size %u.
\n
"
,
size
);
ok
(
ptr
==
(
IUnknown
*
)
0xdeadbeef
,
"Got unexpected pointer %p.
\n
"
,
ptr
);
hr
=
IDXGIDevice_GetPrivateData
(
device
,
&
dxgi_private_data_test_guid
,
NULL
,
&
ptr
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
hr
==
E_INVALIDARG
,
"Got unexpected hr %#x.
\n
"
,
hr
);
ok
(
ptr
==
(
IUnknown
*
)
0xdeadbeef
,
"Got unexpected pointer %p.
\n
"
,
ptr
);
refcount
=
IDXGIDevice_Release
(
device
);
...
...
dlls/dxgi/utils.c
View file @
2d18cf57
...
...
@@ -325,6 +325,48 @@ enum wined3d_format_id wined3dformat_from_dxgi_format(DXGI_FORMAT format)
}
}
HRESULT
dxgi_get_private_data
(
struct
wined3d_private_store
*
store
,
REFGUID
guid
,
UINT
*
data_size
,
void
*
data
)
{
const
struct
wined3d_private_data
*
stored_data
;
DWORD
size_in
;
HRESULT
hr
;
if
(
!
data_size
)
return
E_INVALIDARG
;
EnterCriticalSection
(
&
dxgi_cs
);
if
(
!
(
stored_data
=
wined3d_private_store_get_private_data
(
store
,
guid
)))
{
hr
=
DXGI_ERROR_NOT_FOUND
;
*
data_size
=
0
;
goto
done
;
}
size_in
=
*
data_size
;
*
data_size
=
stored_data
->
size
;
if
(
!
data
)
{
hr
=
S_OK
;
goto
done
;
}
if
(
size_in
<
stored_data
->
size
)
{
hr
=
DXGI_ERROR_MORE_DATA
;
goto
done
;
}
if
(
stored_data
->
flags
&
WINED3DSPD_IUNKNOWN
)
IUnknown_AddRef
(
stored_data
->
content
.
object
);
memcpy
(
data
,
stored_data
->
content
.
data
,
stored_data
->
size
);
hr
=
S_OK
;
done:
LeaveCriticalSection
(
&
dxgi_cs
);
return
hr
;
}
HRESULT
dxgi_set_private_data
(
struct
wined3d_private_store
*
store
,
REFGUID
guid
,
UINT
data_size
,
const
void
*
data
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment