HRESULT device_init(struct d3d8_device *device, struct d3d8 *parent, struct wined3d *wined3d, UINT adapter,
D3DDEVTYPE device_type, HWND focus_window, DWORD flags, D3DPRESENT_PARAMETERS *parameters) DECLSPEC_HIDDEN;
+struct d3d8_resource
+{
+ LONG refcount;
+ struct wined3d_private_store private_store;
+};
+
+void d3d8_resource_cleanup(struct d3d8_resource *resource) DECLSPEC_HIDDEN;
+HRESULT d3d8_resource_free_private_data(struct d3d8_resource *resource, const GUID *guid) DECLSPEC_HIDDEN;
+HRESULT d3d8_resource_get_private_data(struct d3d8_resource *resource, const GUID *guid,
+ void *data, DWORD *data_size) DECLSPEC_HIDDEN;
+void d3d8_resource_init(struct d3d8_resource *resource) DECLSPEC_HIDDEN;
+HRESULT d3d8_resource_set_private_data(struct d3d8_resource *resource, const GUID *guid,
+ const void *data, DWORD data_size, DWORD flags) DECLSPEC_HIDDEN;
+
struct d3d8_volume
{
IDirect3DVolume8 IDirect3DVolume8_iface;
- LONG refcount;
+ struct d3d8_resource resource;
struct wined3d_volume *wined3d_volume;
IUnknown *container;
IUnknown *forwardReference;
struct d3d8_surface
{
IDirect3DSurface8 IDirect3DSurface8_iface;
- LONG refcount;
+ struct d3d8_resource resource;
struct wined3d_surface *wined3d_surface;
IDirect3DDevice8 *parent_device;
struct d3d8_vertexbuffer
{
IDirect3DVertexBuffer8 IDirect3DVertexBuffer8_iface;
- LONG refcount;
+ struct d3d8_resource resource;
struct wined3d_buffer *wined3d_buffer;
IDirect3DDevice8 *parent_device;
DWORD fvf;
struct d3d8_indexbuffer
{
IDirect3DIndexBuffer8 IDirect3DIndexBuffer8_iface;
- LONG refcount;
+ struct d3d8_resource resource;
struct wined3d_buffer *wined3d_buffer;
IDirect3DDevice8 *parent_device;
enum wined3d_format_id format;
struct d3d8_texture
{
IDirect3DBaseTexture8 IDirect3DBaseTexture8_iface;
- LONG refcount;
+ struct d3d8_resource resource;
struct wined3d_texture *wined3d_texture;
IDirect3DDevice8 *parent_device;
};