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
7d793715
Commit
7d793715
authored
Mar 16, 2014
by
Stefan Dösinger
Committed by
Alexandre Julliard
Mar 17, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ddraw: Use the new private store api.
parent
e50c4d0f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
31 deletions
+50
-31
ddraw_private.h
dlls/ddraw/ddraw_private.h
+1
-0
surface.c
dlls/ddraw/surface.c
+49
-25
resource.c
dlls/wined3d/resource.c
+0
-6
No files found.
dlls/ddraw/ddraw_private.h
View file @
7d793715
...
...
@@ -150,6 +150,7 @@ struct ddraw_surface
struct
ddraw
*
ddraw
;
struct
wined3d_surface
*
wined3d_surface
;
struct
wined3d_texture
*
wined3d_texture
;
struct
wined3d_private_store
private_store
;
struct
d3d_device
*
device1
;
/* This implementation handles attaching surfaces to other surfaces */
...
...
dlls/ddraw/surface.c
View file @
7d793715
...
...
@@ -2246,25 +2246,18 @@ static HRESULT WINAPI ddraw_surface7_GetPriority(IDirectDrawSurface7 *iface, DWO
*
*****************************************************************************/
static
HRESULT
WINAPI
ddraw_surface7_SetPrivateData
(
IDirectDrawSurface7
*
iface
,
REFGUID
tag
,
void
*
Data
,
DWORD
Size
,
DWORD
F
lags
)
REFGUID
tag
,
void
*
data
,
DWORD
size
,
DWORD
f
lags
)
{
struct
ddraw_surface
*
surface
=
impl_from_IDirectDrawSurface7
(
iface
);
struct
wined3d_resource
*
resource
;
HRESULT
hr
;
TRACE
(
"iface %p, tag %s, data %p, data_size %u, flags %#x.
\n
"
,
iface
,
debugstr_guid
(
tag
),
Data
,
Size
,
F
lags
);
iface
,
debugstr_guid
(
tag
),
data
,
size
,
f
lags
);
wined3d_mutex_lock
();
resource
=
wined3d_surface_get_resource
(
surface
->
wined3d_surface
);
hr
=
wined3d_resource_set_private_data
(
resource
,
tag
,
Data
,
Size
,
Flags
);
hr
=
wined3d_private_store_set_private_data
(
&
surface
->
private_store
,
tag
,
data
,
size
,
flags
);
wined3d_mutex_unlock
();
switch
(
hr
)
{
case
WINED3DERR_INVALIDCALL
:
return
DDERR_INVALIDPARAMS
;
default:
return
hr
;
}
return
hr_ddraw_from_wined3d
(
hr
);
}
static
HRESULT
WINAPI
ddraw_surface4_SetPrivateData
(
IDirectDrawSurface4
*
iface
,
...
...
@@ -2294,23 +2287,45 @@ static HRESULT WINAPI ddraw_surface4_SetPrivateData(IDirectDrawSurface4 *iface,
* For more details, see IWineD3DSurface::GetPrivateData
*
*****************************************************************************/
static
HRESULT
WINAPI
ddraw_surface7_GetPrivateData
(
IDirectDrawSurface7
*
iface
,
REFGUID
tag
,
void
*
Data
,
DWORD
*
S
ize
)
static
HRESULT
WINAPI
ddraw_surface7_GetPrivateData
(
IDirectDrawSurface7
*
iface
,
REFGUID
tag
,
void
*
data
,
DWORD
*
s
ize
)
{
struct
ddraw_surface
*
surface
=
impl_from_IDirectDrawSurface7
(
iface
);
struct
wined3d_resource
*
resource
;
const
struct
wined3d_private_data
*
stored_data
;
HRESULT
hr
;
TRACE
(
"iface %p, tag %s, data %p, data_size %p.
\n
"
,
iface
,
debugstr_guid
(
tag
),
Data
,
Size
);
if
(
!
Data
)
return
DDERR_INVALIDPARAMS
;
iface
,
debugstr_guid
(
tag
),
data
,
size
);
wined3d_mutex_lock
();
resource
=
wined3d_surface_get_resource
(
surface
->
wined3d_surface
);
hr
=
wined3d_resource_get_private_data
(
resource
,
tag
,
Data
,
Size
);
wined3d_mutex_unlock
();
stored_data
=
wined3d_private_store_get_private_data
(
&
surface
->
private_store
,
tag
);
if
(
!
stored_data
)
{
hr
=
DDERR_NOTFOUND
;
goto
done
;
}
if
(
!
size
)
{
hr
=
DDERR_INVALIDPARAMS
;
goto
done
;
}
if
(
*
size
<
stored_data
->
size
)
{
*
size
=
stored_data
->
size
;
hr
=
DDERR_MOREDATA
;
goto
done
;
}
if
(
!
data
)
{
hr
=
DDERR_INVALIDPARAMS
;
goto
done
;
}
*
size
=
stored_data
->
size
;
memcpy
(
data
,
stored_data
->
content
.
data
,
stored_data
->
size
);
hr
=
DD_OK
;
done:
wined3d_mutex_unlock
();
return
hr
;
}
...
...
@@ -2340,17 +2355,22 @@ static HRESULT WINAPI ddraw_surface4_GetPrivateData(IDirectDrawSurface4 *iface,
static
HRESULT
WINAPI
ddraw_surface7_FreePrivateData
(
IDirectDrawSurface7
*
iface
,
REFGUID
tag
)
{
struct
ddraw_surface
*
surface
=
impl_from_IDirectDrawSurface7
(
iface
);
struct
wined3d_resource
*
resource
;
HRESULT
hr
;
struct
wined3d_private_data
*
entry
;
TRACE
(
"iface %p, tag %s.
\n
"
,
iface
,
debugstr_guid
(
tag
));
wined3d_mutex_lock
();
resource
=
wined3d_surface_get_resource
(
surface
->
wined3d_surface
);
hr
=
wined3d_resource_free_private_data
(
resource
,
tag
);
entry
=
wined3d_private_store_get_private_data
(
&
surface
->
private_store
,
tag
);
if
(
!
entry
)
{
wined3d_mutex_unlock
();
return
DDERR_NOTFOUND
;
}
return
hr
;
wined3d_private_store_free_private_data
(
&
surface
->
private_store
,
entry
);
wined3d_mutex_unlock
();
return
DD_OK
;
}
static
HRESULT
WINAPI
ddraw_surface4_FreePrivateData
(
IDirectDrawSurface4
*
iface
,
REFGUID
tag
)
...
...
@@ -5469,6 +5489,8 @@ static void STDMETHODCALLTYPE ddraw_surface_wined3d_object_destroyed(void *paren
if
(
surface
==
surface
->
ddraw
->
primary
)
surface
->
ddraw
->
primary
=
NULL
;
wined3d_private_store_cleanup
(
&
surface
->
private_store
);
HeapFree
(
GetProcessHeap
(),
0
,
surface
);
}
...
...
@@ -6095,5 +6117,7 @@ HRESULT ddraw_surface_init(struct ddraw_surface *surface, struct ddraw *ddraw, s
surface
->
wined3d_surface
=
wined3d_surface
;
*
parent_ops
=
&
ddraw_surface_wined3d_parent_ops
;
wined3d_private_store_init
(
&
surface
->
private_store
);
return
DD_OK
;
}
dlls/wined3d/resource.c
View file @
7d793715
...
...
@@ -192,14 +192,8 @@ HRESULT CDECL wined3d_resource_get_private_data(const struct wined3d_resource *r
if
(
d
->
flags
&
WINED3DSPD_IUNKNOWN
)
{
*
(
IUnknown
**
)
data
=
d
->
content
.
object
;
if
(
resource
->
device
->
wined3d
->
dxVersion
!=
7
)
{
/* D3D8 and D3D9 addref the private data, DDraw does not. This
* can't be handled in ddraw because it doesn't know if the
* pointer returned is an IUnknown * or just a blob. */
IUnknown_AddRef
(
d
->
content
.
object
);
}
}
else
{
memcpy
(
data
,
d
->
content
.
data
,
d
->
size
);
...
...
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