ReactOS  0.4.15-dev-3182-g7b62228
ddraw.c File Reference
#include "config.h"
#include "wine/port.h"
#include "ddraw_private.h"
#include "wine/exception.h"
Include dependency graph for ddraw.c:

Go to the source code of this file.

Classes

struct  enum_device_entry
 
struct  displaymodescallback_context
 
struct  surfacescallback2_context
 
struct  surfacescallback_context
 

Macros

#define CMP(FLAG, FIELD)
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (ddraw)
 
static void STDMETHODCALLTYPE ddraw_null_wined3d_object_destroyed (void *parent)
 
static struct ddrawimpl_from_IDirectDraw (IDirectDraw *iface)
 
static struct ddrawimpl_from_IDirectDraw2 (IDirectDraw2 *iface)
 
static struct ddrawimpl_from_IDirectDraw4 (IDirectDraw4 *iface)
 
static struct ddrawimpl_from_IDirectDraw7 (IDirectDraw7 *iface)
 
static struct ddrawimpl_from_IDirect3D (IDirect3D *iface)
 
static struct ddrawimpl_from_IDirect3D2 (IDirect3D2 *iface)
 
static struct ddrawimpl_from_IDirect3D3 (IDirect3D3 *iface)
 
static struct ddrawimpl_from_IDirect3D7 (IDirect3D7 *iface)
 
static HRESULT WINAPI ddraw7_QueryInterface (IDirectDraw7 *iface, REFIID riid, void **out)
 
static HRESULT WINAPI ddraw4_QueryInterface (IDirectDraw4 *iface, REFIID riid, void **object)
 
static HRESULT WINAPI ddraw2_QueryInterface (IDirectDraw2 *iface, REFIID riid, void **object)
 
static HRESULT WINAPI ddraw1_QueryInterface (IDirectDraw *iface, REFIID riid, void **object)
 
static HRESULT WINAPI d3d7_QueryInterface (IDirect3D7 *iface, REFIID riid, void **object)
 
static HRESULT WINAPI d3d3_QueryInterface (IDirect3D3 *iface, REFIID riid, void **object)
 
static HRESULT WINAPI d3d2_QueryInterface (IDirect3D2 *iface, REFIID riid, void **object)
 
static HRESULT WINAPI d3d1_QueryInterface (IDirect3D *iface, REFIID riid, void **object)
 
static ULONG WINAPI ddraw7_AddRef (IDirectDraw7 *iface)
 
static ULONG WINAPI ddraw4_AddRef (IDirectDraw4 *iface)
 
static ULONG WINAPI ddraw2_AddRef (IDirectDraw2 *iface)
 
static ULONG WINAPI ddraw1_AddRef (IDirectDraw *iface)
 
static ULONG WINAPI d3d7_AddRef (IDirect3D7 *iface)
 
static ULONG WINAPI d3d3_AddRef (IDirect3D3 *iface)
 
static ULONG WINAPI d3d2_AddRef (IDirect3D2 *iface)
 
static ULONG WINAPI d3d1_AddRef (IDirect3D *iface)
 
static void ddraw_destroy_swapchain (struct ddraw *ddraw)
 
static void ddraw_destroy (struct ddraw *This)
 
static ULONG WINAPI ddraw7_Release (IDirectDraw7 *iface)
 
static ULONG WINAPI ddraw4_Release (IDirectDraw4 *iface)
 
static ULONG WINAPI ddraw2_Release (IDirectDraw2 *iface)
 
static ULONG WINAPI ddraw1_Release (IDirectDraw *iface)
 
static ULONG WINAPI d3d7_Release (IDirect3D7 *iface)
 
static ULONG WINAPI d3d3_Release (IDirect3D3 *iface)
 
static ULONG WINAPI d3d2_Release (IDirect3D2 *iface)
 
static ULONG WINAPI d3d1_Release (IDirect3D *iface)
 
static HRESULT ddraw_set_focus_window (struct ddraw *ddraw, HWND window)
 
static HRESULT ddraw_attach_d3d_device (struct ddraw *ddraw, struct wined3d_swapchain_desc *swapchain_desc)
 
static HRESULT ddraw_create_swapchain (struct ddraw *ddraw, HWND window, BOOL windowed)
 
static HRESULT WINAPI ddraw7_RestoreDisplayMode (IDirectDraw7 *iface)
 
static HRESULT WINAPI ddraw4_RestoreDisplayMode (IDirectDraw4 *iface)
 
static HRESULT WINAPI ddraw2_RestoreDisplayMode (IDirectDraw2 *iface)
 
static HRESULT WINAPI ddraw1_RestoreDisplayMode (IDirectDraw *iface)
 
static HRESULT ddraw_set_cooperative_level (struct ddraw *ddraw, HWND window, DWORD cooplevel, BOOL restore_mode_on_normal)
 
static HRESULT WINAPI ddraw7_SetCooperativeLevel (IDirectDraw7 *iface, HWND window, DWORD flags)
 
static HRESULT WINAPI ddraw4_SetCooperativeLevel (IDirectDraw4 *iface, HWND window, DWORD flags)
 
static HRESULT WINAPI ddraw2_SetCooperativeLevel (IDirectDraw2 *iface, HWND window, DWORD flags)
 
static HRESULT WINAPI ddraw1_SetCooperativeLevel (IDirectDraw *iface, HWND window, DWORD flags)
 
static HRESULT WINAPI ddraw7_SetDisplayMode (IDirectDraw7 *iface, DWORD width, DWORD height, DWORD bpp, DWORD refresh_rate, DWORD flags)
 
static HRESULT WINAPI ddraw4_SetDisplayMode (IDirectDraw4 *iface, DWORD width, DWORD height, DWORD bpp, DWORD refresh_rate, DWORD flags)
 
static HRESULT WINAPI ddraw2_SetDisplayMode (IDirectDraw2 *iface, DWORD width, DWORD height, DWORD bpp, DWORD refresh_rate, DWORD flags)
 
static HRESULT WINAPI ddraw1_SetDisplayMode (IDirectDraw *iface, DWORD width, DWORD height, DWORD bpp)
 
void ddraw_d3dcaps1_from_7 (D3DDEVICEDESC *caps1, D3DDEVICEDESC7 *caps7)
 
HRESULT ddraw_get_d3dcaps (const struct ddraw *ddraw, D3DDEVICEDESC7 *caps)
 
HRESULT CALLBACK enum_zbuffer (DDPIXELFORMAT *format, void *ctx)
 
static HRESULT WINAPI ddraw7_GetCaps (IDirectDraw7 *iface, DDCAPS *DriverCaps, DDCAPS *HELCaps)
 
static HRESULT WINAPI ddraw4_GetCaps (IDirectDraw4 *iface, DDCAPS *driver_caps, DDCAPS *hel_caps)
 
static HRESULT WINAPI ddraw2_GetCaps (IDirectDraw2 *iface, DDCAPS *driver_caps, DDCAPS *hel_caps)
 
static HRESULT WINAPI ddraw1_GetCaps (IDirectDraw *iface, DDCAPS *driver_caps, DDCAPS *hel_caps)
 
static HRESULT WINAPI ddraw7_Compact (IDirectDraw7 *iface)
 
static HRESULT WINAPI ddraw4_Compact (IDirectDraw4 *iface)
 
static HRESULT WINAPI ddraw2_Compact (IDirectDraw2 *iface)
 
static HRESULT WINAPI ddraw1_Compact (IDirectDraw *iface)
 
static HRESULT WINAPI ddraw7_GetDisplayMode (IDirectDraw7 *iface, DDSURFACEDESC2 *DDSD)
 
static HRESULT WINAPI ddraw4_GetDisplayMode (IDirectDraw4 *iface, DDSURFACEDESC2 *surface_desc)
 
static HRESULT WINAPI ddraw2_GetDisplayMode (IDirectDraw2 *iface, DDSURFACEDESC *surface_desc)
 
static HRESULT WINAPI ddraw1_GetDisplayMode (IDirectDraw *iface, DDSURFACEDESC *surface_desc)
 
static HRESULT WINAPI ddraw7_GetFourCCCodes (IDirectDraw7 *iface, DWORD *NumCodes, DWORD *Codes)
 
static HRESULT WINAPI ddraw4_GetFourCCCodes (IDirectDraw4 *iface, DWORD *codes_count, DWORD *codes)
 
static HRESULT WINAPI ddraw2_GetFourCCCodes (IDirectDraw2 *iface, DWORD *codes_count, DWORD *codes)
 
static HRESULT WINAPI ddraw1_GetFourCCCodes (IDirectDraw *iface, DWORD *codes_count, DWORD *codes)
 
static HRESULT WINAPI ddraw7_GetMonitorFrequency (IDirectDraw7 *iface, DWORD *frequency)
 
static HRESULT WINAPI ddraw4_GetMonitorFrequency (IDirectDraw4 *iface, DWORD *frequency)
 
static HRESULT WINAPI ddraw2_GetMonitorFrequency (IDirectDraw2 *iface, DWORD *frequency)
 
static HRESULT WINAPI ddraw1_GetMonitorFrequency (IDirectDraw *iface, DWORD *frequency)
 
static HRESULT WINAPI ddraw7_GetVerticalBlankStatus (IDirectDraw7 *iface, BOOL *status)
 
static HRESULT WINAPI ddraw4_GetVerticalBlankStatus (IDirectDraw4 *iface, BOOL *status)
 
static HRESULT WINAPI ddraw2_GetVerticalBlankStatus (IDirectDraw2 *iface, BOOL *status)
 
static HRESULT WINAPI ddraw1_GetVerticalBlankStatus (IDirectDraw *iface, BOOL *status)
 
static HRESULT WINAPI ddraw7_GetAvailableVidMem (IDirectDraw7 *iface, DDSCAPS2 *caps, DWORD *total, DWORD *free)
 
static HRESULT WINAPI ddraw4_GetAvailableVidMem (IDirectDraw4 *iface, DDSCAPS2 *caps, DWORD *total, DWORD *free)
 
static HRESULT WINAPI ddraw2_GetAvailableVidMem (IDirectDraw2 *iface, DDSCAPS *caps, DWORD *total, DWORD *free)
 
static HRESULT WINAPI ddraw7_Initialize (IDirectDraw7 *iface, GUID *guid)
 
static HRESULT WINAPI ddraw4_Initialize (IDirectDraw4 *iface, GUID *guid)
 
static HRESULT WINAPI ddraw2_Initialize (IDirectDraw2 *iface, GUID *guid)
 
static HRESULT WINAPI ddraw1_Initialize (IDirectDraw *iface, GUID *guid)
 
static HRESULT WINAPI d3d1_Initialize (IDirect3D *iface, REFIID riid)
 
static HRESULT WINAPI ddraw7_FlipToGDISurface (IDirectDraw7 *iface)
 
static HRESULT WINAPI ddraw4_FlipToGDISurface (IDirectDraw4 *iface)
 
static HRESULT WINAPI ddraw2_FlipToGDISurface (IDirectDraw2 *iface)
 
static HRESULT WINAPI ddraw1_FlipToGDISurface (IDirectDraw *iface)
 
static HRESULT WINAPI ddraw7_WaitForVerticalBlank (IDirectDraw7 *iface, DWORD Flags, HANDLE event)
 
static HRESULT WINAPI ddraw4_WaitForVerticalBlank (IDirectDraw4 *iface, DWORD flags, HANDLE event)
 
static HRESULT WINAPI ddraw2_WaitForVerticalBlank (IDirectDraw2 *iface, DWORD flags, HANDLE event)
 
static HRESULT WINAPI ddraw1_WaitForVerticalBlank (IDirectDraw *iface, DWORD flags, HANDLE event)
 
static HRESULT WINAPI ddraw7_GetScanLine (IDirectDraw7 *iface, DWORD *Scanline)
 
static HRESULT WINAPI ddraw4_GetScanLine (IDirectDraw4 *iface, DWORD *line)
 
static HRESULT WINAPI ddraw2_GetScanLine (IDirectDraw2 *iface, DWORD *line)
 
static HRESULT WINAPI ddraw1_GetScanLine (IDirectDraw *iface, DWORD *line)
 
static HRESULT WINAPI ddraw7_TestCooperativeLevel (IDirectDraw7 *iface)
 
static HRESULT WINAPI ddraw4_TestCooperativeLevel (IDirectDraw4 *iface)
 
static HRESULT WINAPI ddraw7_GetGDISurface (IDirectDraw7 *iface, IDirectDrawSurface7 **GDISurface)
 
static HRESULT WINAPI ddraw4_GetGDISurface (IDirectDraw4 *iface, IDirectDrawSurface4 **surface)
 
static HRESULT WINAPI ddraw2_GetGDISurface (IDirectDraw2 *iface, IDirectDrawSurface **surface)
 
static HRESULT WINAPI ddraw1_GetGDISurface (IDirectDraw *iface, IDirectDrawSurface **surface)
 
static HRESULT CALLBACK EnumDisplayModesCallbackThunk (DDSURFACEDESC2 *surface_desc, void *context)
 
static HRESULT WINAPI ddraw7_EnumDisplayModes (IDirectDraw7 *iface, DWORD Flags, DDSURFACEDESC2 *DDSD, void *Context, LPDDENUMMODESCALLBACK2 cb)
 
static HRESULT WINAPI ddraw4_EnumDisplayModes (IDirectDraw4 *iface, DWORD flags, DDSURFACEDESC2 *surface_desc, void *context, LPDDENUMMODESCALLBACK2 callback)
 
static HRESULT WINAPI ddraw2_EnumDisplayModes (IDirectDraw2 *iface, DWORD flags, DDSURFACEDESC *surface_desc, void *context, LPDDENUMMODESCALLBACK callback)
 
static HRESULT WINAPI ddraw1_EnumDisplayModes (IDirectDraw *iface, DWORD flags, DDSURFACEDESC *surface_desc, void *context, LPDDENUMMODESCALLBACK callback)
 
static HRESULT WINAPI ddraw7_EvaluateMode (IDirectDraw7 *iface, DWORD Flags, DWORD *Timeout)
 
static HRESULT WINAPI ddraw7_GetDeviceIdentifier (IDirectDraw7 *iface, DDDEVICEIDENTIFIER2 *DDDI, DWORD Flags)
 
static HRESULT WINAPI ddraw4_GetDeviceIdentifier (IDirectDraw4 *iface, DDDEVICEIDENTIFIER *identifier, DWORD flags)
 
static HRESULT WINAPI ddraw7_GetSurfaceFromDC (IDirectDraw7 *iface, HDC dc, IDirectDrawSurface7 **surface)
 
static HRESULT WINAPI ddraw4_GetSurfaceFromDC (IDirectDraw4 *iface, HDC dc, IDirectDrawSurface4 **surface)
 
static HRESULT CALLBACK restore_callback (IDirectDrawSurface7 *surface, DDSURFACEDESC2 *desc, void *context)
 
static HRESULT WINAPI ddraw7_RestoreAllSurfaces (IDirectDraw7 *iface)
 
static HRESULT WINAPI ddraw4_RestoreAllSurfaces (IDirectDraw4 *iface)
 
static HRESULT WINAPI ddraw7_StartModeTest (IDirectDraw7 *iface, SIZE *Modes, DWORD NumModes, DWORD Flags)
 
static HRESULT WINAPI ddraw7_CreateSurface (IDirectDraw7 *iface, DDSURFACEDESC2 *surface_desc, IDirectDrawSurface7 **surface, IUnknown *outer_unknown)
 
static HRESULT WINAPI ddraw4_CreateSurface (IDirectDraw4 *iface, DDSURFACEDESC2 *surface_desc, IDirectDrawSurface4 **surface, IUnknown *outer_unknown)
 
static HRESULT WINAPI ddraw2_CreateSurface (IDirectDraw2 *iface, DDSURFACEDESC *surface_desc, IDirectDrawSurface **surface, IUnknown *outer_unknown)
 
static HRESULT WINAPI ddraw1_CreateSurface (IDirectDraw *iface, DDSURFACEDESC *surface_desc, IDirectDrawSurface **surface, IUnknown *outer_unknown)
 
static BOOL Main_DirectDraw_DDPIXELFORMAT_Match (const DDPIXELFORMAT *requested, const DDPIXELFORMAT *provided)
 
static BOOL ddraw_match_surface_desc (const DDSURFACEDESC2 *requested, const DDSURFACEDESC2 *provided)
 
static HRESULT CALLBACK EnumSurfacesCallback2Thunk (IDirectDrawSurface7 *surface, DDSURFACEDESC2 *surface_desc, void *context)
 
static HRESULT CALLBACK EnumSurfacesCallbackThunk (IDirectDrawSurface7 *surface, DDSURFACEDESC2 *surface_desc, void *context)
 
static HRESULT WINAPI ddraw7_EnumSurfaces (IDirectDraw7 *iface, DWORD Flags, DDSURFACEDESC2 *DDSD, void *Context, LPDDENUMSURFACESCALLBACK7 Callback)
 
static HRESULT WINAPI ddraw4_EnumSurfaces (IDirectDraw4 *iface, DWORD flags, DDSURFACEDESC2 *surface_desc, void *context, LPDDENUMSURFACESCALLBACK2 callback)
 
static HRESULT WINAPI ddraw2_EnumSurfaces (IDirectDraw2 *iface, DWORD flags, DDSURFACEDESC *surface_desc, void *context, LPDDENUMSURFACESCALLBACK callback)
 
static HRESULT WINAPI ddraw1_EnumSurfaces (IDirectDraw *iface, DWORD flags, DDSURFACEDESC *surface_desc, void *context, LPDDENUMSURFACESCALLBACK callback)
 
HRESULT WINAPI DirectDrawCreateClipper (DWORD flags, IDirectDrawClipper **clipper, IUnknown *outer_unknown)
 
static HRESULT WINAPI ddraw7_CreateClipper (IDirectDraw7 *iface, DWORD Flags, IDirectDrawClipper **Clipper, IUnknown *UnkOuter)
 
static HRESULT WINAPI ddraw4_CreateClipper (IDirectDraw4 *iface, DWORD flags, IDirectDrawClipper **clipper, IUnknown *outer_unknown)
 
static HRESULT WINAPI ddraw2_CreateClipper (IDirectDraw2 *iface, DWORD flags, IDirectDrawClipper **clipper, IUnknown *outer_unknown)
 
static HRESULT WINAPI ddraw1_CreateClipper (IDirectDraw *iface, DWORD flags, IDirectDrawClipper **clipper, IUnknown *outer_unknown)
 
static HRESULT WINAPI ddraw7_CreatePalette (IDirectDraw7 *iface, DWORD Flags, PALETTEENTRY *ColorTable, IDirectDrawPalette **Palette, IUnknown *pUnkOuter)
 
static HRESULT WINAPI ddraw4_CreatePalette (IDirectDraw4 *iface, DWORD flags, PALETTEENTRY *entries, IDirectDrawPalette **palette, IUnknown *outer_unknown)
 
static HRESULT WINAPI ddraw2_CreatePalette (IDirectDraw2 *iface, DWORD flags, PALETTEENTRY *entries, IDirectDrawPalette **palette, IUnknown *outer_unknown)
 
static HRESULT WINAPI ddraw1_CreatePalette (IDirectDraw *iface, DWORD flags, PALETTEENTRY *entries, IDirectDrawPalette **palette, IUnknown *outer_unknown)
 
static HRESULT WINAPI ddraw7_DuplicateSurface (IDirectDraw7 *iface, IDirectDrawSurface7 *Src, IDirectDrawSurface7 **Dest)
 
static HRESULT WINAPI ddraw4_DuplicateSurface (IDirectDraw4 *iface, IDirectDrawSurface4 *src, IDirectDrawSurface4 **dst)
 
static HRESULT WINAPI ddraw2_DuplicateSurface (IDirectDraw2 *iface, IDirectDrawSurface *src, IDirectDrawSurface **dst)
 
static HRESULT WINAPI ddraw1_DuplicateSurface (IDirectDraw *iface, IDirectDrawSurface *src, IDirectDrawSurface **dst)
 
static HRESULT WINAPI d3d7_EnumDevices (IDirect3D7 *iface, LPD3DENUMDEVICESCALLBACK7 callback, void *context)
 
static HRESULT WINAPI d3d3_EnumDevices (IDirect3D3 *iface, LPD3DENUMDEVICESCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d2_EnumDevices (IDirect3D2 *iface, LPD3DENUMDEVICESCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d1_EnumDevices (IDirect3D *iface, LPD3DENUMDEVICESCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d3_CreateLight (IDirect3D3 *iface, IDirect3DLight **light, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d2_CreateLight (IDirect3D2 *iface, IDirect3DLight **light, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d1_CreateLight (IDirect3D *iface, IDirect3DLight **light, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d3_CreateMaterial (IDirect3D3 *iface, IDirect3DMaterial3 **material, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d2_CreateMaterial (IDirect3D2 *iface, IDirect3DMaterial2 **material, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d1_CreateMaterial (IDirect3D *iface, IDirect3DMaterial **material, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d3_CreateViewport (IDirect3D3 *iface, IDirect3DViewport3 **viewport, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d2_CreateViewport (IDirect3D2 *iface, IDirect3DViewport2 **viewport, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d1_CreateViewport (IDirect3D *iface, IDirect3DViewport **viewport, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d3_FindDevice (IDirect3D3 *iface, D3DFINDDEVICESEARCH *fds, D3DFINDDEVICERESULT *fdr)
 
static HRESULT WINAPI d3d2_FindDevice (IDirect3D2 *iface, D3DFINDDEVICESEARCH *fds, D3DFINDDEVICERESULT *fdr)
 
static HRESULT WINAPI d3d1_FindDevice (IDirect3D *iface, D3DFINDDEVICESEARCH *fds, D3DFINDDEVICERESULT *fdr)
 
static HRESULT WINAPI d3d7_CreateDevice (IDirect3D7 *iface, REFCLSID riid, IDirectDrawSurface7 *surface, IDirect3DDevice7 **device)
 
static HRESULT WINAPI d3d3_CreateDevice (IDirect3D3 *iface, REFCLSID riid, IDirectDrawSurface4 *surface, IDirect3DDevice3 **device, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d2_CreateDevice (IDirect3D2 *iface, REFCLSID riid, IDirectDrawSurface *surface, IDirect3DDevice2 **device)
 
static HRESULT WINAPI d3d7_CreateVertexBuffer (IDirect3D7 *iface, D3DVERTEXBUFFERDESC *desc, IDirect3DVertexBuffer7 **vertex_buffer, DWORD flags)
 
static HRESULT WINAPI d3d3_CreateVertexBuffer (IDirect3D3 *iface, D3DVERTEXBUFFERDESC *desc, IDirect3DVertexBuffer **vertex_buffer, DWORD flags, IUnknown *outer_unknown)
 
static HRESULT WINAPI d3d7_EnumZBufferFormats (IDirect3D7 *iface, REFCLSID device_iid, LPD3DENUMPIXELFORMATSCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d3_EnumZBufferFormats (IDirect3D3 *iface, REFCLSID device_iid, LPD3DENUMPIXELFORMATSCALLBACK callback, void *context)
 
static HRESULT WINAPI d3d7_EvictManagedTextures (IDirect3D7 *iface)
 
static HRESULT WINAPI d3d3_EvictManagedTextures (IDirect3D3 *iface)
 
struct wined3d_vertex_declarationddraw_find_decl (struct ddraw *This, DWORD fvf)
 
static struct ddrawddraw_from_device_parent (struct wined3d_device_parent *device_parent)
 
static void CDECL device_parent_wined3d_device_created (struct wined3d_device_parent *device_parent, struct wined3d_device *device)
 
static void CDECL device_parent_mode_changed (struct wined3d_device_parent *device_parent)
 
static void CDECL device_parent_activate (struct wined3d_device_parent *device_parent, BOOL activate)
 
void ddraw_update_lost_surfaces (struct ddraw *ddraw)
 
static HRESULT CDECL device_parent_surface_created (struct wined3d_device_parent *device_parent, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, void **parent, const struct wined3d_parent_ops **parent_ops)
 
static HRESULT CDECL device_parent_volume_created (struct wined3d_device_parent *device_parent, struct wined3d_texture *wined3d_texture, unsigned int sub_resource_idx, void **parent, const struct wined3d_parent_ops **parent_ops)
 
static void STDMETHODCALLTYPE ddraw_frontbuffer_destroyed (void *parent)
 
static HRESULT CDECL device_parent_create_swapchain_texture (struct wined3d_device_parent *device_parent, void *container_parent, const struct wined3d_resource_desc *desc, DWORD texture_flags, struct wined3d_texture **texture)
 
static HRESULT CDECL device_parent_create_swapchain (struct wined3d_device_parent *device_parent, struct wined3d_swapchain_desc *desc, struct wined3d_swapchain **swapchain)
 
HRESULT ddraw_init (struct ddraw *ddraw, DWORD flags, enum wined3d_device_type device_type)
 

Variables

static const struct ddrawexclusive_ddraw
 
static HWND exclusive_window
 
static const DDDEVICEIDENTIFIER2 deviceidentifier
 
static struct enum_device_entry device_list7 []
 
const struct wined3d_parent_ops ddraw_null_wined3d_parent_ops
 
static const struct IDirectDraw7Vtbl ddraw7_vtbl
 
static const struct IDirectDraw4Vtbl ddraw4_vtbl
 
static const struct IDirectDraw2Vtbl ddraw2_vtbl
 
static struct IDirectDrawVtbl ddraw1_vtbl
 
static const struct IDirect3D7Vtbl d3d7_vtbl
 
static const struct IDirect3D3Vtbl d3d3_vtbl
 
static const struct IDirect3D2Vtbl d3d2_vtbl
 
static const struct IDirect3DVtbl d3d1_vtbl
 
static const struct wined3d_parent_ops ddraw_frontbuffer_parent_ops
 
static const struct wined3d_device_parent_ops ddraw_wined3d_device_parent_ops
 

Macro Definition Documentation

◆ CMP

#define CMP (   FLAG,
  FIELD 
)
Value:
{ DDSD_##FLAG, offsetof(DDSURFACEDESC2, FIELD), \
sizeof(((DDSURFACEDESC2 *)(NULL))->FIELD) }
#define offsetof(TYPE, MEMBER)
Definition: inflate.c:14
#define NULL
Definition: types.h:112

Function Documentation

◆ d3d1_AddRef()

static ULONG WINAPI d3d1_AddRef ( IDirect3D *  iface)
static

Definition at line 359 of file ddraw.c.

360 {
361  struct ddraw *This = impl_from_IDirect3D(iface);
362 
363  TRACE("iface %p.\n", iface);
364 
365  return ddraw1_AddRef(&This->IDirectDraw_iface);
366 }
static struct ddraw * impl_from_IDirect3D(IDirect3D *iface)
Definition: ddraw.c:108
#define TRACE(s)
Definition: solgame.cpp:4
static ULONG WINAPI ddraw1_AddRef(IDirectDraw *iface)
Definition: ddraw.c:320

◆ d3d1_CreateLight()

static HRESULT WINAPI d3d1_CreateLight ( IDirect3D *  iface,
IDirect3DLight **  light,
IUnknown outer_unknown 
)
static

Definition at line 3971 of file ddraw.c.

3972 {
3973  struct ddraw *ddraw = impl_from_IDirect3D(iface);
3974 
3975  TRACE("iface %p, light %p, outer_unknown %p.\n", iface, light, outer_unknown);
3976 
3977  return d3d3_CreateLight(&ddraw->IDirect3D3_iface, light, outer_unknown);
3978 }
static struct ddraw * impl_from_IDirect3D(IDirect3D *iface)
Definition: ddraw.c:108
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum light
Definition: glfuncs.h:170
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT WINAPI d3d3_CreateLight(IDirect3D3 *iface, IDirect3DLight **light, IUnknown *outer_unknown)
Definition: ddraw.c:3937
IDirect3D3 IDirect3D3_iface
Definition: ddraw_private.h:84

◆ d3d1_CreateMaterial()

static HRESULT WINAPI d3d1_CreateMaterial ( IDirect3D *  iface,
IDirect3DMaterial **  material,
IUnknown outer_unknown 
)
static

Definition at line 4044 of file ddraw.c.

4046 {
4047  struct ddraw *ddraw = impl_from_IDirect3D(iface);
4048  struct d3d_material *object;
4049 
4050  TRACE("iface %p, material %p, outer_unknown %p.\n", iface, material, outer_unknown);
4051 
4052  object = d3d_material_create(ddraw);
4053  if (!object)
4054  {
4055  ERR("Failed to allocate material memory.\n");
4056  return DDERR_OUTOFMEMORY;
4057  }
4058 
4059  TRACE("Created material %p.\n", object);
4060  *material = &object->IDirect3DMaterial_iface;
4061 
4062  return D3D_OK;
4063 }
coclass MSXML2::XSLTemplate40 object
static struct ddraw * impl_from_IDirect3D(IDirect3D *iface)
Definition: ddraw.c:108
#define DDERR_OUTOFMEMORY
Definition: ddraw.h:111
#define TRACE(s)
Definition: solgame.cpp:4
#define ERR(fmt,...)
Definition: debug.h:110
#define D3D_OK
Definition: d3d.h:106
struct d3d_material * d3d_material_create(struct ddraw *ddraw) DECLSPEC_HIDDEN
Definition: material.c:501

◆ d3d1_CreateViewport()

static HRESULT WINAPI d3d1_CreateViewport ( IDirect3D *  iface,
IDirect3DViewport **  viewport,
IUnknown outer_unknown 
)
static

Definition at line 4119 of file ddraw.c.

4120 {
4121  struct ddraw *ddraw = impl_from_IDirect3D(iface);
4122 
4123  TRACE("iface %p, viewport %p, outer_unknown %p.\n", iface, viewport, outer_unknown);
4124 
4125  return d3d3_CreateViewport(&ddraw->IDirect3D3_iface, (IDirect3DViewport3 **)viewport,
4126  outer_unknown);
4127 }
static HRESULT WINAPI d3d3_CreateViewport(IDirect3D3 *iface, IDirect3DViewport3 **viewport, IUnknown *outer_unknown)
Definition: ddraw.c:4085
static struct ddraw * impl_from_IDirect3D(IDirect3D *iface)
Definition: ddraw.c:108
#define TRACE(s)
Definition: solgame.cpp:4
IDirect3D3 IDirect3D3_iface
Definition: ddraw_private.h:84

◆ d3d1_EnumDevices()

static HRESULT WINAPI d3d1_EnumDevices ( IDirect3D *  iface,
LPD3DENUMDEVICESCALLBACK  callback,
void context 
)
static

Definition at line 3907 of file ddraw.c.

3908 {
3909  struct ddraw *ddraw = impl_from_IDirect3D(iface);
3910 
3911  TRACE("iface %p, callback %p, context %p.\n", iface, callback, context);
3912 
3914 }
Definition: http.c:7251
static struct ddraw * impl_from_IDirect3D(IDirect3D *iface)
Definition: ddraw.c:108
#define TRACE(s)
Definition: solgame.cpp:4
IDirect3D3 IDirect3D3_iface
Definition: ddraw_private.h:84
static IPrintDialogCallback callback
Definition: printdlg.c:326
static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBACK callback, void *context)
Definition: ddraw.c:3793

◆ d3d1_FindDevice()

static HRESULT WINAPI d3d1_FindDevice ( IDirect3D *  iface,
D3DFINDDEVICESEARCH fds,
D3DFINDDEVICERESULT fdr 
)
static

Definition at line 4219 of file ddraw.c.

4220 {
4221  struct ddraw *ddraw = impl_from_IDirect3D(iface);
4222 
4223  TRACE("iface %p, fds %p, fdr %p.\n", iface, fds, fdr);
4224 
4225  return d3d3_FindDevice(&ddraw->IDirect3D3_iface, fds, fdr);
4226 }
static struct ddraw * impl_from_IDirect3D(IDirect3D *iface)
Definition: ddraw.c:108
#define TRACE(s)
Definition: solgame.cpp:4
IDirect3D3 IDirect3D3_iface
Definition: ddraw_private.h:84
static HRESULT WINAPI d3d3_FindDevice(IDirect3D3 *iface, D3DFINDDEVICESEARCH *fds, D3DFINDDEVICERESULT *fdr)
Definition: ddraw.c:4145

◆ d3d1_Initialize()

static HRESULT WINAPI d3d1_Initialize ( IDirect3D *  iface,
REFIID  riid 
)
static

Definition at line 2073 of file ddraw.c.

2074 {
2075  TRACE("iface %p, riid %s.\n", iface, debugstr_guid(riid));
2076 
2077  return DDERR_ALREADYINITIALIZED;
2078 }
REFIID riid
Definition: precomp.h:44
#define debugstr_guid
Definition: kernel32.h:35
#define DDERR_ALREADYINITIALIZED
Definition: ddraw.h:67
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d1_QueryInterface()

static HRESULT WINAPI d3d1_QueryInterface ( IDirect3D *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 257 of file ddraw.c.

258 {
259  struct ddraw *ddraw = impl_from_IDirect3D(iface);
260 
261  TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
262 
264 }
REFIID riid
Definition: precomp.h:44
static struct ddraw * impl_from_IDirect3D(IDirect3D *iface)
Definition: ddraw.c:108
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT WINAPI ddraw7_QueryInterface(IDirectDraw7 *iface, REFIID riid, void **out)
Definition: ddraw.c:128
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ d3d1_Release()

static ULONG WINAPI d3d1_Release ( IDirect3D *  iface)
static

Definition at line 538 of file ddraw.c.

539 {
540  struct ddraw *This = impl_from_IDirect3D(iface);
541 
542  TRACE("iface %p.\n", iface);
543 
544  return ddraw1_Release(&This->IDirectDraw_iface);
545 }
static struct ddraw * impl_from_IDirect3D(IDirect3D *iface)
Definition: ddraw.c:108
static ULONG WINAPI ddraw1_Release(IDirectDraw *iface)
Definition: ddraw.c:498
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d2_AddRef()

static ULONG WINAPI d3d2_AddRef ( IDirect3D2 *  iface)
static

Definition at line 350 of file ddraw.c.

351 {
352  struct ddraw *This = impl_from_IDirect3D2(iface);
353 
354  TRACE("iface %p.\n", iface);
355 
356  return ddraw1_AddRef(&This->IDirectDraw_iface);
357 }
static struct ddraw * impl_from_IDirect3D2(IDirect3D2 *iface)
Definition: ddraw.c:113
#define TRACE(s)
Definition: solgame.cpp:4
static ULONG WINAPI ddraw1_AddRef(IDirectDraw *iface)
Definition: ddraw.c:320

◆ d3d2_CreateDevice()

static HRESULT WINAPI d3d2_CreateDevice ( IDirect3D2 *  iface,
REFCLSID  riid,
IDirectDrawSurface *  surface,
IDirect3DDevice2 **  device 
)
static

Definition at line 4303 of file ddraw.c.

4305 {
4306  struct ddraw_surface *surface_impl = unsafe_impl_from_IDirectDrawSurface(surface);
4307  struct ddraw *ddraw = impl_from_IDirect3D2(iface);
4308  struct d3d_device *device_impl;
4309  HRESULT hr;
4310 
4311  TRACE("iface %p, riid %s, surface %p, device %p.\n",
4312  iface, debugstr_guid(riid), surface, device);
4313 
4315  if (SUCCEEDED(hr = d3d_device_create(ddraw, riid, surface_impl, (IUnknown *)surface, 2, &device_impl, NULL)))
4316  {
4317  *device = &device_impl->IDirect3DDevice2_iface;
4318  }
4319  else
4320  {
4321  WARN("Failed to create device, hr %#x.\n", hr);
4322  *device = NULL;
4323  }
4325 
4326  return hr;
4327 }
static struct ddraw * impl_from_IDirect3D2(IDirect3D2 *iface)
Definition: ddraw.c:113
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface(IDirectDrawSurface *iface) DECLSPEC_HIDDEN
Definition: surface.c:5705
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:112
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: devices.h:37
if SUCCEEDED(hr)
HRESULT d3d_device_create(struct ddraw *ddraw, const GUID *guid, struct ddraw_surface *target, IUnknown *rt_iface, UINT version, struct d3d_device **device, IUnknown *outer_unknown) DECLSPEC_HIDDEN
Definition: device.c:6980
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
#define NULL
Definition: types.h:112
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
IDirect3DDevice2 IDirect3DDevice2_iface

◆ d3d2_CreateLight()

static HRESULT WINAPI d3d2_CreateLight ( IDirect3D2 *  iface,
IDirect3DLight **  light,
IUnknown outer_unknown 
)
static

Definition at line 3962 of file ddraw.c.

3963 {
3964  struct ddraw *ddraw = impl_from_IDirect3D2(iface);
3965 
3966  TRACE("iface %p, light %p, outer_unknown %p.\n", iface, light, outer_unknown);
3967 
3968  return d3d3_CreateLight(&ddraw->IDirect3D3_iface, light, outer_unknown);
3969 }
static struct ddraw * impl_from_IDirect3D2(IDirect3D2 *iface)
Definition: ddraw.c:113
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum light
Definition: glfuncs.h:170
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT WINAPI d3d3_CreateLight(IDirect3D3 *iface, IDirect3DLight **light, IUnknown *outer_unknown)
Definition: ddraw.c:3937
IDirect3D3 IDirect3D3_iface
Definition: ddraw_private.h:84

◆ d3d2_CreateMaterial()

static HRESULT WINAPI d3d2_CreateMaterial ( IDirect3D2 *  iface,
IDirect3DMaterial2 **  material,
IUnknown outer_unknown 
)
static

Definition at line 4023 of file ddraw.c.

4025 {
4026  struct ddraw *ddraw = impl_from_IDirect3D2(iface);
4027  struct d3d_material *object;
4028 
4029  TRACE("iface %p, material %p, outer_unknown %p.\n", iface, material, outer_unknown);
4030 
4031  object = d3d_material_create(ddraw);
4032  if (!object)
4033  {
4034  ERR("Failed to allocate material memory.\n");
4035  return DDERR_OUTOFMEMORY;
4036  }
4037 
4038  TRACE("Created material %p.\n", object);
4039  *material = &object->IDirect3DMaterial2_iface;
4040 
4041  return D3D_OK;
4042 }
static struct ddraw * impl_from_IDirect3D2(IDirect3D2 *iface)
Definition: ddraw.c:113
coclass MSXML2::XSLTemplate40 object
#define DDERR_OUTOFMEMORY
Definition: ddraw.h:111
#define TRACE(s)
Definition: solgame.cpp:4
#define ERR(fmt,...)
Definition: debug.h:110
#define D3D_OK
Definition: d3d.h:106
struct d3d_material * d3d_material_create(struct ddraw *ddraw) DECLSPEC_HIDDEN
Definition: material.c:501

◆ d3d2_CreateViewport()

static HRESULT WINAPI d3d2_CreateViewport ( IDirect3D2 *  iface,
IDirect3DViewport2 **  viewport,
IUnknown outer_unknown 
)
static

Definition at line 4109 of file ddraw.c.

4110 {
4111  struct ddraw *ddraw = impl_from_IDirect3D2(iface);
4112 
4113  TRACE("iface %p, viewport %p, outer_unknown %p.\n", iface, viewport, outer_unknown);
4114 
4115  return d3d3_CreateViewport(&ddraw->IDirect3D3_iface, (IDirect3DViewport3 **)viewport,
4116  outer_unknown);
4117 }
static struct ddraw * impl_from_IDirect3D2(IDirect3D2 *iface)
Definition: ddraw.c:113
static HRESULT WINAPI d3d3_CreateViewport(IDirect3D3 *iface, IDirect3DViewport3 **viewport, IUnknown *outer_unknown)
Definition: ddraw.c:4085
#define TRACE(s)
Definition: solgame.cpp:4
IDirect3D3 IDirect3D3_iface
Definition: ddraw_private.h:84

◆ d3d2_EnumDevices()

static HRESULT WINAPI d3d2_EnumDevices ( IDirect3D2 *  iface,
LPD3DENUMDEVICESCALLBACK  callback,
void context 
)
static

Definition at line 3898 of file ddraw.c.

3899 {
3900  struct ddraw *ddraw = impl_from_IDirect3D2(iface);
3901 
3902  TRACE("iface %p, callback %p, context %p.\n", iface, callback, context);
3903 
3905 }
static struct ddraw * impl_from_IDirect3D2(IDirect3D2 *iface)
Definition: ddraw.c:113
Definition: http.c:7251
#define TRACE(s)
Definition: solgame.cpp:4
IDirect3D3 IDirect3D3_iface
Definition: ddraw_private.h:84
static IPrintDialogCallback callback
Definition: printdlg.c:326
static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBACK callback, void *context)
Definition: ddraw.c:3793

◆ d3d2_FindDevice()

static HRESULT WINAPI d3d2_FindDevice ( IDirect3D2 *  iface,
D3DFINDDEVICESEARCH fds,
D3DFINDDEVICERESULT fdr 
)
static

Definition at line 4210 of file ddraw.c.

4211 {
4212  struct ddraw *ddraw = impl_from_IDirect3D2(iface);
4213 
4214  TRACE("iface %p, fds %p, fdr %p.\n", iface, fds, fdr);
4215 
4216  return d3d3_FindDevice(&ddraw->IDirect3D3_iface, fds, fdr);
4217 }
static struct ddraw * impl_from_IDirect3D2(IDirect3D2 *iface)
Definition: ddraw.c:113
#define TRACE(s)
Definition: solgame.cpp:4
IDirect3D3 IDirect3D3_iface
Definition: ddraw_private.h:84
static HRESULT WINAPI d3d3_FindDevice(IDirect3D3 *iface, D3DFINDDEVICESEARCH *fds, D3DFINDDEVICERESULT *fdr)
Definition: ddraw.c:4145

◆ d3d2_QueryInterface()

static HRESULT WINAPI d3d2_QueryInterface ( IDirect3D2 *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 248 of file ddraw.c.

249 {
250  struct ddraw *ddraw = impl_from_IDirect3D2(iface);
251 
252  TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
253 
255 }
static struct ddraw * impl_from_IDirect3D2(IDirect3D2 *iface)
Definition: ddraw.c:113
REFIID riid
Definition: precomp.h:44
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT WINAPI ddraw7_QueryInterface(IDirectDraw7 *iface, REFIID riid, void **out)
Definition: ddraw.c:128
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ d3d2_Release()

static ULONG WINAPI d3d2_Release ( IDirect3D2 *  iface)
static

Definition at line 529 of file ddraw.c.

530 {
531  struct ddraw *This = impl_from_IDirect3D2(iface);
532 
533  TRACE("iface %p.\n", iface);
534 
535  return ddraw1_Release(&This->IDirectDraw_iface);
536 }
static struct ddraw * impl_from_IDirect3D2(IDirect3D2 *iface)
Definition: ddraw.c:113
static ULONG WINAPI ddraw1_Release(IDirectDraw *iface)
Definition: ddraw.c:498
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d3_AddRef()

static ULONG WINAPI d3d3_AddRef ( IDirect3D3 *  iface)
static

Definition at line 341 of file ddraw.c.

342 {
343  struct ddraw *This = impl_from_IDirect3D3(iface);
344 
345  TRACE("iface %p.\n", iface);
346 
347  return ddraw1_AddRef(&This->IDirectDraw_iface);
348 }
#define TRACE(s)
Definition: solgame.cpp:4
static ULONG WINAPI ddraw1_AddRef(IDirectDraw *iface)
Definition: ddraw.c:320
static struct ddraw * impl_from_IDirect3D3(IDirect3D3 *iface)
Definition: ddraw.c:118

◆ d3d3_CreateDevice()

static HRESULT WINAPI d3d3_CreateDevice ( IDirect3D3 *  iface,
REFCLSID  riid,
IDirectDrawSurface4 *  surface,
IDirect3DDevice3 **  device,
IUnknown outer_unknown 
)
static

Definition at line 4274 of file ddraw.c.

4276 {
4277  struct ddraw_surface *surface_impl = unsafe_impl_from_IDirectDrawSurface4(surface);
4278  struct ddraw *ddraw = impl_from_IDirect3D3(iface);
4279  struct d3d_device *device_impl;
4280  HRESULT hr;
4281 
4282  TRACE("iface %p, riid %s, surface %p, device %p, outer_unknown %p.\n",
4283  iface, debugstr_guid(riid), surface, device, outer_unknown);
4284 
4285  if (outer_unknown)
4286  return CLASS_E_NOAGGREGATION;
4287 
4289  if (SUCCEEDED(hr = d3d_device_create(ddraw, riid, surface_impl, (IUnknown *)surface, 3, &device_impl, NULL)))
4290  {
4291  *device = &device_impl->IDirect3DDevice3_iface;
4292  }
4293  else
4294  {
4295  WARN("Failed to create device, hr %#x.\n", hr);
4296  *device = NULL;
4297  }
4299 
4300  return hr;
4301 }
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:112
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface4(IDirectDrawSurface4 *iface) DECLSPEC_HIDDEN
Definition: surface.c:5657
Definition: devices.h:37
if SUCCEEDED(hr)
IDirect3DDevice3 IDirect3DDevice3_iface
HRESULT d3d_device_create(struct ddraw *ddraw, const GUID *guid, struct ddraw_surface *target, IUnknown *rt_iface, UINT version, struct d3d_device **device, IUnknown *outer_unknown) DECLSPEC_HIDDEN
Definition: device.c:6980
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
IUnknown * outer_unknown
#define NULL
Definition: types.h:112
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
static struct ddraw * impl_from_IDirect3D3(IDirect3D3 *iface)
Definition: ddraw.c:118

◆ d3d3_CreateLight()

static HRESULT WINAPI d3d3_CreateLight ( IDirect3D3 *  iface,
IDirect3DLight **  light,
IUnknown outer_unknown 
)
static

Definition at line 3937 of file ddraw.c.

3939 {
3940  struct ddraw *ddraw = impl_from_IDirect3D3(iface);
3941  struct d3d_light *object;
3942 
3943  TRACE("iface %p, light %p, outer_unknown %p.\n", iface, light, outer_unknown);
3944 
3945  if (outer_unknown)
3946  return CLASS_E_NOAGGREGATION;
3947 
3948  if (!(object = heap_alloc_zero(sizeof(*object))))
3949  {
3950  ERR("Failed to allocate light memory.\n");
3951  return DDERR_OUTOFMEMORY;
3952  }
3953 
3954  d3d_light_init(object, ddraw);
3955 
3956  TRACE("Created light %p.\n", object);
3957  *light = &object->IDirect3DLight_iface;
3958 
3959  return D3D_OK;
3960 }
coclass MSXML2::XSLTemplate40 object
#define DDERR_OUTOFMEMORY
Definition: ddraw.h:111
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum light
Definition: glfuncs.h:170
void d3d_light_init(struct d3d_light *light, struct ddraw *ddraw) DECLSPEC_HIDDEN
Definition: light.c:247
#define TRACE(s)
Definition: solgame.cpp:4
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define ERR(fmt,...)
Definition: debug.h:110
#define D3D_OK
Definition: d3d.h:106
static struct ddraw * impl_from_IDirect3D3(IDirect3D3 *iface)
Definition: ddraw.c:118

Referenced by d3d1_CreateLight(), and d3d2_CreateLight().

◆ d3d3_CreateMaterial()

static HRESULT WINAPI d3d3_CreateMaterial ( IDirect3D3 *  iface,
IDirect3DMaterial3 **  material,
IUnknown outer_unknown 
)
static

Definition at line 4000 of file ddraw.c.

4002 {
4003  struct ddraw *ddraw = impl_from_IDirect3D3(iface);
4004  struct d3d_material *object;
4005 
4006  TRACE("iface %p, material %p, outer_unknown %p.\n", iface, material, outer_unknown);
4007 
4008  if (outer_unknown) return CLASS_E_NOAGGREGATION;
4009 
4010  object = d3d_material_create(ddraw);
4011  if (!object)
4012  {
4013  ERR("Failed to allocate material memory.\n");
4014  return DDERR_OUTOFMEMORY;
4015  }
4016 
4017  TRACE("Created material %p.\n", object);
4018  *material = &object->IDirect3DMaterial3_iface;
4019 
4020  return D3D_OK;
4021 }
coclass MSXML2::XSLTemplate40 object
#define DDERR_OUTOFMEMORY
Definition: ddraw.h:111
#define TRACE(s)
Definition: solgame.cpp:4
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define ERR(fmt,...)
Definition: debug.h:110
#define D3D_OK
Definition: d3d.h:106
struct d3d_material * d3d_material_create(struct ddraw *ddraw) DECLSPEC_HIDDEN
Definition: material.c:501
static struct ddraw * impl_from_IDirect3D3(IDirect3D3 *iface)
Definition: ddraw.c:118

◆ d3d3_CreateVertexBuffer()

static HRESULT WINAPI d3d3_CreateVertexBuffer ( IDirect3D3 *  iface,
D3DVERTEXBUFFERDESC desc,
IDirect3DVertexBuffer **  vertex_buffer,
DWORD  flags,
IUnknown outer_unknown 
)
static

Definition at line 4372 of file ddraw.c.

4374 {
4375  struct ddraw *ddraw = impl_from_IDirect3D3(iface);
4376  struct d3d_vertex_buffer *object;
4377  HRESULT hr;
4378 
4379  TRACE("iface %p, desc %p, vertex_buffer %p, flags %#x, outer_unknown %p.\n",
4380  iface, desc, vertex_buffer, flags, outer_unknown);
4381 
4382  if (outer_unknown)
4383  return CLASS_E_NOAGGREGATION;
4384  if (!vertex_buffer || !desc)
4385  return DDERR_INVALIDPARAMS;
4386 
4387  hr = d3d_vertex_buffer_create(&object, ddraw, desc);
4388  if (hr == D3D_OK)
4389  {
4390  TRACE("Created vertex buffer %p.\n", object);
4391  *vertex_buffer = (IDirect3DVertexBuffer *)&object->IDirect3DVertexBuffer7_iface;
4392  }
4393  else
4394  WARN("Failed to create vertex buffer, hr %#x.\n", hr);
4395 
4396  return hr;
4397 }
coclass MSXML2::XSLTemplate40 object
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:112
static const WCHAR desc[]
Definition: protectdata.c:36
HRESULT d3d_vertex_buffer_create(struct d3d_vertex_buffer **buffer, struct ddraw *ddraw, D3DVERTEXBUFFERDESC *desc) DECLSPEC_HIDDEN
Definition: vertexbuffer.c:432
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
GLbitfield flags
Definition: glext.h:7161
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define D3D_OK
Definition: d3d.h:106
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79
static struct ddraw * impl_from_IDirect3D3(IDirect3D3 *iface)
Definition: ddraw.c:118

◆ d3d3_CreateViewport()

static HRESULT WINAPI d3d3_CreateViewport ( IDirect3D3 *  iface,
IDirect3DViewport3 **  viewport,
IUnknown outer_unknown 
)
static

Definition at line 4085 of file ddraw.c.

4087 {
4088  struct ddraw *ddraw = impl_from_IDirect3D3(iface);
4089  struct d3d_viewport *object;
4090 
4091  TRACE("iface %p, viewport %p, outer_unknown %p.\n", iface, viewport, outer_unknown);
4092 
4093  if (outer_unknown) return CLASS_E_NOAGGREGATION;
4094 
4095  if (!(object = heap_alloc_zero(sizeof(*object))))
4096  {
4097  ERR("Failed to allocate viewport memory.\n");
4098  return DDERR_OUTOFMEMORY;
4099  }
4100 
4101  d3d_viewport_init(object, ddraw);
4102 
4103  TRACE("Created viewport %p.\n", object);
4104  *viewport = &object->IDirect3DViewport3_iface;
4105 
4106  return D3D_OK;
4107 }
void d3d_viewport_init(struct d3d_viewport *viewport, struct ddraw *ddraw) DECLSPEC_HIDDEN
Definition: viewport.c:1146
coclass MSXML2::XSLTemplate40 object
#define DDERR_OUTOFMEMORY
Definition: ddraw.h:111
#define TRACE(s)
Definition: solgame.cpp:4
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662
#define ERR(fmt,...)
Definition: debug.h:110
#define D3D_OK
Definition: d3d.h:106
static struct ddraw * impl_from_IDirect3D3(IDirect3D3 *iface)
Definition: ddraw.c:118

Referenced by d3d1_CreateViewport(), and d3d2_CreateViewport().

◆ d3d3_EnumDevices()

static HRESULT WINAPI d3d3_EnumDevices ( IDirect3D3 *  iface,
LPD3DENUMDEVICESCALLBACK  callback,
void context 
)
static

Definition at line 3793 of file ddraw.c.

3794 {
3795  static CHAR wined3d_description[] = "Wine D3DDevice using WineD3D and OpenGL";
3796 
3797  struct ddraw *ddraw = impl_from_IDirect3D3(iface);
3798  D3DDEVICEDESC device_desc1, hal_desc, hel_desc;
3799  D3DDEVICEDESC7 device_desc7;
3800  HRESULT hr;
3801 
3802  /* Some games (Motoracer 2 demo) have the bad idea to modify the device
3803  * name string. Let's put the string in a sufficiently sized array in
3804  * writable memory. */
3805  char device_name[50];
3806  strcpy(device_name,"Direct3D HEL");
3807 
3808  TRACE("iface %p, callback %p, context %p.\n", iface, callback, context);
3809 
3810  if (!callback)
3811  return DDERR_INVALIDPARAMS;
3812 
3814 
3815  if (FAILED(hr = ddraw_get_d3dcaps(ddraw, &device_desc7)))
3816  {
3818  return hr;
3819  }
3820  ddraw_d3dcaps1_from_7(&device_desc1, &device_desc7);
3821 
3822  /* Do I have to enumerate the reference id? Note from old d3d7:
3823  * "It seems that enumerating the reference IID on Direct3D 1 games
3824  * (AvP / Motoracer2) breaks them". So do not enumerate this iid in V1
3825  *
3826  * There's a registry key HKLM\Software\Microsoft\Direct3D\Drivers,
3827  * EnumReference which enables / disables enumerating the reference
3828  * rasterizer. It's a DWORD, 0 means disabled, 2 means enabled. The
3829  * enablerefrast.reg and disablerefrast.reg files in the DirectX 7.0 sdk
3830  * demo directory suggest this.
3831  *
3832  * Some games(GTA 2) seem to use the second enumerated device, so I have
3833  * to enumerate at least 2 devices. So enumerate the reference device to
3834  * have 2 devices.
3835  *
3836  * Other games (Rollcage) tell emulation and hal device apart by certain
3837  * flags. Rollcage expects D3DPTEXTURECAPS_POW2 to be set (yeah, it is a
3838  * limitation flag), and it refuses all devices that have the perspective
3839  * flag set. This way it refuses the emulation device, and HAL devices
3840  * never have POW2 unset in d3d7 on windows. */
3841  if (ddraw->d3dversion != 1)
3842  {
3843  static CHAR reference_description[] = "RGB Direct3D emulation";
3844 
3845  TRACE("Enumerating WineD3D D3DDevice interface.\n");
3846  hal_desc = device_desc1;
3847  hel_desc = device_desc1;
3848  /* The rgb device has the pow2 flag set in the hel caps, but not in the hal caps. */
3853  /* RGB, RAMP and MMX devices have a HAL dcmColorModel of 0 */
3854  hal_desc.dcmColorModel = 0;
3855  /* RGB, RAMP and MMX devices cannot report HAL hardware flags */
3856  hal_desc.dwFlags = 0;
3857 
3858  hr = callback((GUID *)&IID_IDirect3DRGBDevice, reference_description,
3859  device_name, &hal_desc, &hel_desc, context);
3860  if (hr != D3DENUMRET_OK)
3861  {
3862  TRACE("Application cancelled the enumeration.\n");
3864  return D3D_OK;
3865  }
3866  }
3867 
3868  strcpy(device_name,"Direct3D HAL");
3869 
3870  TRACE("Enumerating HAL Direct3D device.\n");
3871  hal_desc = device_desc1;
3872  hel_desc = device_desc1;
3873 
3874  /* The hal device does not have the pow2 flag set in hel, but in hal. */
3879  /* HAL devices have a HEL dcmColorModel of 0 */
3880  hel_desc.dcmColorModel = 0;
3881 
3882  hr = callback((GUID *)&IID_IDirect3DHALDevice, wined3d_description,
3883  device_name, &hal_desc, &hel_desc, context);
3884  if (hr != D3DENUMRET_OK)
3885  {
3886  TRACE("Application cancelled the enumeration.\n");
3888  return D3D_OK;
3889  }
3890 
3891  TRACE("End of enumeration.\n");
3892 
3894 
3895  return D3D_OK;
3896 }
#define D3DPTEXTURECAPS_POW2
Definition: d3d8caps.h:114
HRESULT ddraw_get_d3dcaps(const struct ddraw *ddraw, D3DDEVICEDESC7 *caps)
Definition: ddraw.c:1248
HRESULT hr
Definition: shlfolder.c:183
Definition: http.c:7251
DWORD dwFlags
Definition: d3dcaps.h:319
char CHAR
Definition: xmlstorage.h:175
static const WCHAR device_name[]
Definition: btrfs.c:63
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define D3DPTEXTURECAPS_PERSPECTIVE
Definition: d3d8caps.h:113
int d3dversion
D3DCOLORMODEL dcmColorModel
Definition: d3dcaps.h:320
D3DPRIMCAPS dpcTriCaps
Definition: d3dcaps.h:326
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL
Definition: d3d8caps.h:119
#define D3DENUMRET_OK
Definition: d3dtypes.h:81
DWORD dwTextureCaps
Definition: d3dcaps.h:272
#define D3D_OK
Definition: d3d.h:106
D3DPRIMCAPS dpcLineCaps
Definition: d3dcaps.h:325
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
static IPrintDialogCallback callback
Definition: printdlg.c:326
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
void ddraw_d3dcaps1_from_7(D3DDEVICEDESC *caps1, D3DDEVICEDESC7 *caps7)
Definition: ddraw.c:1192
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79
static struct ddraw * impl_from_IDirect3D3(IDirect3D3 *iface)
Definition: ddraw.c:118

Referenced by d3d1_EnumDevices(), and d3d2_EnumDevices().

◆ d3d3_EnumZBufferFormats()

static HRESULT WINAPI d3d3_EnumZBufferFormats ( IDirect3D3 *  iface,
REFCLSID  device_iid,
LPD3DENUMPIXELFORMATSCALLBACK  callback,
void context 
)
static

Definition at line 4530 of file ddraw.c.

4532 {
4533  struct ddraw *ddraw = impl_from_IDirect3D3(iface);
4534 
4535  TRACE("iface %p, device_iid %s, callback %p, context %p.\n",
4536  iface, debugstr_guid(device_iid), callback, context);
4537 
4539 }
Definition: http.c:7251
IDirect3D7 IDirect3D7_iface
Definition: ddraw_private.h:83
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT WINAPI d3d7_EnumZBufferFormats(IDirect3D7 *iface, REFCLSID device_iid, LPD3DENUMPIXELFORMATSCALLBACK callback, void *context)
Definition: ddraw.c:4416
static IPrintDialogCallback callback
Definition: printdlg.c:326
static struct ddraw * impl_from_IDirect3D3(IDirect3D3 *iface)
Definition: ddraw.c:118

◆ d3d3_EvictManagedTextures()

static HRESULT WINAPI d3d3_EvictManagedTextures ( IDirect3D3 *  iface)
static

Definition at line 4567 of file ddraw.c.

4568 {
4569  struct ddraw *ddraw = impl_from_IDirect3D3(iface);
4570 
4571  TRACE("iface %p.\n", iface);
4572 
4574 }
IDirect3D7 IDirect3D7_iface
Definition: ddraw_private.h:83
static HRESULT WINAPI d3d7_EvictManagedTextures(IDirect3D7 *iface)
Definition: ddraw.c:4553
#define TRACE(s)
Definition: solgame.cpp:4
static struct ddraw * impl_from_IDirect3D3(IDirect3D3 *iface)
Definition: ddraw.c:118

◆ d3d3_FindDevice()

static HRESULT WINAPI d3d3_FindDevice ( IDirect3D3 *  iface,
D3DFINDDEVICESEARCH fds,
D3DFINDDEVICERESULT fdr 
)
static

Definition at line 4145 of file ddraw.c.

4146 {
4147  struct ddraw *ddraw = impl_from_IDirect3D3(iface);
4148  D3DDEVICEDESC7 desc7;
4149  D3DDEVICEDESC desc1;
4150  HRESULT hr;
4151 
4152  TRACE("iface %p, fds %p, fdr %p.\n", iface, fds, fdr);
4153 
4154  if (!fds || !fdr) return DDERR_INVALIDPARAMS;
4155 
4156  if (fds->dwSize != sizeof(D3DFINDDEVICESEARCH) || (fdr->dwSize != sizeof(D3DFINDDEVICERESULT1) &&
4157  fdr->dwSize != sizeof(D3DFINDDEVICERESULT2) && fdr->dwSize != sizeof(D3DFINDDEVICERESULT)))
4158  return DDERR_INVALIDPARAMS;
4159 
4160  if ((fds->dwFlags & D3DFDS_COLORMODEL)
4161  && fds->dcmColorModel != D3DCOLOR_RGB)
4162  {
4163  WARN("Trying to request a non-RGB D3D color model. Not supported.\n");
4164  return DDERR_INVALIDPARAMS; /* No real idea what to return here :-) */
4165  }
4166 
4167  if (fds->dwFlags & D3DFDS_GUID)
4168  {
4169  TRACE("Trying to match guid %s.\n", debugstr_guid(&(fds->guid)));
4170  if (!IsEqualGUID(&IID_D3DDEVICE_WineD3D, &fds->guid)
4171  && !IsEqualGUID(&IID_IDirect3DHALDevice, &fds->guid)
4172  && !IsEqualGUID(&IID_IDirect3DRGBDevice, &fds->guid))
4173  {
4174  WARN("No match for this GUID.\n");
4175  return DDERR_NOTFOUND;
4176  }
4177  }
4178 
4179  /* Get the caps */
4180  if (FAILED(hr = ddraw_get_d3dcaps(ddraw, &desc7)))
4181  return hr;
4182 
4183  /* Now return our own GUID */
4184  ddraw_d3dcaps1_from_7(&desc1, &desc7);
4185  fdr->guid = IID_D3DDEVICE_WineD3D;
4186 
4187  if (fdr->dwSize == sizeof(D3DFINDDEVICERESULT1))
4188  {
4190  memcpy(&fdr1->ddHwDesc, &desc1, sizeof(fdr1->ddHwDesc));
4191  memcpy(&fdr1->ddSwDesc, &desc1, sizeof(fdr1->ddSwDesc));
4192  }
4193  else if (fdr->dwSize == sizeof(D3DFINDDEVICERESULT2))
4194  {
4196  memcpy(&fdr2->ddHwDesc, &desc1, sizeof(fdr2->ddHwDesc));
4197  memcpy(&fdr2->ddSwDesc, &desc1, sizeof(fdr2->ddSwDesc));
4198  }
4199  else
4200  {
4201  fdr->ddHwDesc = desc1;
4202  fdr->ddSwDesc = desc1;
4203  }
4204 
4205  TRACE("Returning Wine's wined3d device with (undumped) capabilities.\n");
4206 
4207  return D3D_OK;
4208 }
HRESULT ddraw_get_d3dcaps(const struct ddraw *ddraw, D3DDEVICEDESC7 *caps)
Definition: ddraw.c:1248
HRESULT hr
Definition: shlfolder.c:183
D3DCOLORMODEL dcmColorModel
Definition: d3dcaps.h:398
#define WARN(fmt,...)
Definition: debug.h:112
const GUID IID_D3DDEVICE_WineD3D
Definition: device.c:39
#define D3DFDS_COLORMODEL
Definition: d3dcaps.h:126
D3DDEVICEDESC ddHwDesc
Definition: d3dcaps.h:422
D3DDEVICEDESC2 ddHwDesc
Definition: d3dcaps.h:414
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
#define DDERR_NOTFOUND
Definition: ddraw.h:97
LONG HRESULT
Definition: typedefs.h:79
D3DDEVICEDESC2 ddSwDesc
Definition: d3dcaps.h:415
D3DDEVICEDESC1 ddHwDesc
Definition: d3dcaps.h:407
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
D3DDEVICEDESC ddSwDesc
Definition: d3dcaps.h:423
#define D3DCOLOR_RGB
Definition: d3dtypes.h:627
#define D3D_OK
Definition: d3d.h:106
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
#define D3DFDS_GUID
Definition: d3dcaps.h:127
void ddraw_d3dcaps1_from_7(D3DDEVICEDESC *caps1, D3DDEVICEDESC7 *caps7)
Definition: ddraw.c:1192
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79
D3DDEVICEDESC1 ddSwDesc
Definition: d3dcaps.h:408
static struct ddraw * impl_from_IDirect3D3(IDirect3D3 *iface)
Definition: ddraw.c:118

Referenced by d3d1_FindDevice(), and d3d2_FindDevice().

◆ d3d3_QueryInterface()

static HRESULT WINAPI d3d3_QueryInterface ( IDirect3D3 *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 239 of file ddraw.c.

240 {
241  struct ddraw *ddraw = impl_from_IDirect3D3(iface);
242 
243  TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
244 
246 }
REFIID riid
Definition: precomp.h:44
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT WINAPI ddraw7_QueryInterface(IDirectDraw7 *iface, REFIID riid, void **out)
Definition: ddraw.c:128
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79
static struct ddraw * impl_from_IDirect3D3(IDirect3D3 *iface)
Definition: ddraw.c:118

◆ d3d3_Release()

static ULONG WINAPI d3d3_Release ( IDirect3D3 *  iface)
static

Definition at line 520 of file ddraw.c.

521 {
522  struct ddraw *This = impl_from_IDirect3D3(iface);
523 
524  TRACE("iface %p.\n", iface);
525 
526  return ddraw1_Release(&This->IDirectDraw_iface);
527 }
static ULONG WINAPI ddraw1_Release(IDirectDraw *iface)
Definition: ddraw.c:498
#define TRACE(s)
Definition: solgame.cpp:4
static struct ddraw * impl_from_IDirect3D3(IDirect3D3 *iface)
Definition: ddraw.c:118

◆ d3d7_AddRef()

static ULONG WINAPI d3d7_AddRef ( IDirect3D7 *  iface)
static

Definition at line 332 of file ddraw.c.

333 {
334  struct ddraw *This = impl_from_IDirect3D7(iface);
335 
336  TRACE("iface %p.\n", iface);
337 
338  return ddraw7_AddRef(&This->IDirectDraw7_iface);
339 }
#define TRACE(s)
Definition: solgame.cpp:4
static struct ddraw * impl_from_IDirect3D7(IDirect3D7 *iface)
Definition: ddraw.c:123
static ULONG WINAPI ddraw7_AddRef(IDirectDraw7 *iface)
Definition: ddraw.c:284

◆ d3d7_CreateDevice()

static HRESULT WINAPI d3d7_CreateDevice ( IDirect3D7 *  iface,
REFCLSID  riid,
IDirectDrawSurface7 surface,
IDirect3DDevice7 **  device 
)
static

Definition at line 4249 of file ddraw.c.

4251 {
4253  struct ddraw *ddraw = impl_from_IDirect3D7(iface);
4254  struct d3d_device *object;
4255  HRESULT hr;
4256 
4257  TRACE("iface %p, riid %s, surface %p, device %p.\n", iface, debugstr_guid(riid), surface, device);
4258 
4260  if (SUCCEEDED(hr = d3d_device_create(ddraw, riid, target, (IUnknown *)surface, 7, &object, NULL)))
4261  {
4262  *device = &object->IDirect3DDevice7_iface;
4263  }
4264  else
4265  {
4266  WARN("Failed to create device, hr %#x.\n", hr);
4267  *device = NULL;
4268  }
4270 
4271  return hr;
4272 }
coclass MSXML2::XSLTemplate40 object
HRESULT hr
Definition: shlfolder.c:183
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:112
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface) DECLSPEC_HIDDEN
Definition: surface.c:5641
Definition: devices.h:37
if SUCCEEDED(hr)
HRESULT d3d_device_create(struct ddraw *ddraw, const GUID *guid, struct ddraw_surface *target, IUnknown *rt_iface, UINT version, struct d3d_device **device, IUnknown *outer_unknown) DECLSPEC_HIDDEN
Definition: device.c:6980
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
static struct ddraw * impl_from_IDirect3D7(IDirect3D7 *iface)
Definition: ddraw.c:123
#define NULL
Definition: types.h:112
GLenum target
Definition: glext.h:7315
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

◆ d3d7_CreateVertexBuffer()

static HRESULT WINAPI d3d7_CreateVertexBuffer ( IDirect3D7 *  iface,
D3DVERTEXBUFFERDESC desc,
IDirect3DVertexBuffer7 **  vertex_buffer,
DWORD  flags 
)
static

Definition at line 4348 of file ddraw.c.

4350 {
4351  struct ddraw *ddraw = impl_from_IDirect3D7(iface);
4352  struct d3d_vertex_buffer *object;
4353  HRESULT hr;
4354 
4355  TRACE("iface %p, desc %p, vertex_buffer %p, flags %#x.\n",
4356  iface, desc, vertex_buffer, flags);
4357 
4358  if (!vertex_buffer || !desc) return DDERR_INVALIDPARAMS;
4359 
4360  hr = d3d_vertex_buffer_create(&object, ddraw, desc);
4361  if (hr == D3D_OK)
4362  {
4363  TRACE("Created vertex buffer %p.\n", object);
4364  *vertex_buffer = &object->IDirect3DVertexBuffer7_iface;
4365  }
4366  else
4367  WARN("Failed to create vertex buffer, hr %#x.\n", hr);
4368 
4369  return hr;
4370 }
coclass MSXML2::XSLTemplate40 object
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:112
static const WCHAR desc[]
Definition: protectdata.c:36
HRESULT d3d_vertex_buffer_create(struct d3d_vertex_buffer **buffer, struct ddraw *ddraw, D3DVERTEXBUFFERDESC *desc) DECLSPEC_HIDDEN
Definition: vertexbuffer.c:432
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
GLbitfield flags
Definition: glext.h:7161
static struct ddraw * impl_from_IDirect3D7(IDirect3D7 *iface)
Definition: ddraw.c:123
#define D3D_OK
Definition: d3d.h:106
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79

◆ d3d7_EnumDevices()

static HRESULT WINAPI d3d7_EnumDevices ( IDirect3D7 *  iface,
LPD3DENUMDEVICESCALLBACK7  callback,
void context 
)
static

Definition at line 3730 of file ddraw.c.

3731 {
3732  struct ddraw *ddraw = impl_from_IDirect3D7(iface);
3733  D3DDEVICEDESC7 device_desc7;
3734  DWORD dev_caps;
3735  HRESULT hr;
3736  size_t i;
3737 
3738  TRACE("iface %p, callback %p, context %p.\n", iface, callback, context);
3739 
3740  if (!callback)
3741  return DDERR_INVALIDPARAMS;
3742 
3744 
3745  if (FAILED(hr = ddraw_get_d3dcaps(ddraw, &device_desc7)))
3746  {
3748  return hr;
3749  }
3750 
3751  dev_caps = device_desc7.dwDevCaps;
3752 
3753  for (i = 0; i < ARRAY_SIZE(device_list7); i++)
3754  {
3755  HRESULT ret;
3756 
3757  device_desc7.deviceGUID = *device_list7[i].device_guid;
3758  device_desc7.dwDevCaps = dev_caps & ~device_list7[i].remove_caps;
3759 
3760  ret = callback(device_list7[i].interface_name, device_list7[i].device_name, &device_desc7, context);
3761  if (ret != DDENUMRET_OK)
3762  {
3763  TRACE("Application cancelled the enumeration.\n");
3765  return D3D_OK;
3766  }
3767  }
3768 
3769  TRACE("End of enumeration.\n");
3770 
3772 
3773  return D3D_OK;
3774 }
HRESULT ddraw_get_d3dcaps(const struct ddraw *ddraw, D3DDEVICEDESC7 *caps)
Definition: ddraw.c:1248
HRESULT hr
Definition: shlfolder.c:183
Definition: http.c:7251
static const WCHAR device_name[]
Definition: btrfs.c:63
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
unsigned long DWORD
Definition: ntddk_ex.h:95
GUID deviceGUID
Definition: d3dcaps.h:382
int ret
#define DDENUMRET_OK
Definition: ddraw.h:189
static struct enum_device_entry device_list7[]
static struct ddraw * impl_from_IDirect3D7(IDirect3D7 *iface)
Definition: ddraw.c:123
#define D3D_OK
Definition: d3d.h:106
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define ARRAY_SIZE(a)
Definition: main.h:24
static IPrintDialogCallback callback
Definition: printdlg.c:326
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79
DWORD dwDevCaps
Definition: d3dcaps.h:358

◆ d3d7_EnumZBufferFormats()

static HRESULT WINAPI d3d7_EnumZBufferFormats ( IDirect3D7 *  iface,
REFCLSID  device_iid,
LPD3DENUMPIXELFORMATSCALLBACK  callback,
void context 
)
static

Definition at line 4416 of file ddraw.c.

4418 {
4419  struct ddraw *ddraw = impl_from_IDirect3D7(iface);
4420  struct wined3d_display_mode mode;
4422  unsigned int i;
4423  HRESULT hr;
4424 
4425  /* Order matters. Specifically, BattleZone II (full version) expects the
4426  * 16-bit depth formats to be listed before the 24 and 32 ones. */
4427  static const enum wined3d_format_id formats[] =
4428  {
4435  };
4436 
4437  TRACE("iface %p, device_iid %s, callback %p, context %p.\n",
4438  iface, debugstr_guid(device_iid), callback, context);
4439 
4440  if (!callback) return DDERR_INVALIDPARAMS;
4441 
4442  if (IsEqualGUID(device_iid, &IID_IDirect3DHALDevice)
4443  || IsEqualGUID(device_iid, &IID_IDirect3DTnLHalDevice)
4444  || IsEqualGUID(device_iid, &IID_D3DDEVICE_WineD3D))
4445  {
4446  TRACE("Asked for HAL device.\n");
4448  }
4449  else if (IsEqualGUID(device_iid, &IID_IDirect3DRGBDevice)
4450  || IsEqualGUID(device_iid, &IID_IDirect3DMMXDevice))
4451  {
4452  TRACE("Asked for SW device.\n");
4454  }
4455  else if (IsEqualGUID(device_iid, &IID_IDirect3DRefDevice))
4456  {
4457  TRACE("Asked for REF device.\n");
4459  }
4460  else if (IsEqualGUID(device_iid, &IID_IDirect3DNullDevice))
4461  {
4462  TRACE("Asked for NULLREF device.\n");
4464  }
4465  else
4466  {
4467  FIXME("Unexpected device GUID %s.\n", debugstr_guid(device_iid));
4469  }
4470 
4472  /* We need an adapter format from somewhere to please wined3d and WGL.
4473  * Use the current display mode. So far all cards offer the same depth
4474  * stencil format for all modes, but if some do not and applications do
4475  * not like that we'll have to find some workaround, like iterating over
4476  * all imaginable formats and collecting all the depth stencil formats we
4477  * can get. */
4479  {
4480  ERR("Failed to get display mode, hr %#x.\n", hr);
4482  return hr;
4483  }
4484 
4485  for (i = 0; i < ARRAY_SIZE(formats); ++i)
4486  {
4489  {
4490  DDPIXELFORMAT pformat;
4491 
4492  memset(&pformat, 0, sizeof(pformat));
4493  pformat.dwSize = sizeof(pformat);
4495 
4496  TRACE("Enumerating wined3d format %#x.\n", formats[i]);
4497  hr = callback(&pformat, context);
4498  if (hr != DDENUMRET_OK)
4499  {
4500  TRACE("Format enumeration cancelled by application.\n");
4502  return D3D_OK;
4503  }
4504  }
4505  }
4506 
4507  /* Historically some windows drivers used dwZBufferBitDepth=24 for WINED3DFMT_X8D24_UNORM,
4508  * while others used dwZBufferBitDepth=32. In either case the pitch matches a 32 bits per
4509  * pixel format, so we use dwZBufferBitDepth=32. Some games expect 24. Windows Vista and
4510  * newer enumerate both versions, so we do the same(bug 22434) */
4513  {
4514  DDPIXELFORMAT x8d24 =
4515  {
4516  sizeof(x8d24), DDPF_ZBUFFER, 0,
4517  {24}, {0x00000000}, {0x00ffffff}, {0x00000000}
4518  };
4519  TRACE("Enumerating WINED3DFMT_X8D24_UNORM, dwZBufferBitDepth=24 version\n");
4520  callback(&x8d24, context);
4521  }
4522 
4523  TRACE("End of enumeration.\n");
4524 
4526 
4527  return D3D_OK;
4528 }
HRESULT CDECL wined3d_get_adapter_display_mode(const struct wined3d *wined3d, UINT adapter_idx, struct wined3d_display_mode *mode, enum wined3d_display_rotation *rotation)
Definition: directx.c:4767
HRESULT hr
Definition: shlfolder.c:183
Definition: http.c:7251
struct wined3d * wined3d
Definition: ddraw_private.h:92
static const struct pixel_format_desc formats[]
Definition: util.c:59
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_device_type device_type, enum wined3d_format_id adapter_format_id, DWORD usage, enum wined3d_resource_type resource_type, enum wined3d_format_id check_format_id)
Definition: directx.c:5334
#define WINED3DUSAGE_DEPTHSTENCIL
Definition: wined3d.h:900
const GUID IID_D3DDEVICE_WineD3D
Definition: device.c:39
if SUCCEEDED(hr)
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
#define WINED3DADAPTER_DEFAULT
Definition: wined3d.h:857
#define DDENUMRET_OK
Definition: ddraw.h:189
GLenum mode
Definition: glext.h:6217
static struct ddraw * impl_from_IDirect3D7(IDirect3D7 *iface)
Definition: ddraw.c:123
wined3d_format_id
Definition: wined3d.h:105
#define ERR(fmt,...)
Definition: debug.h:110
#define D3D_OK
Definition: d3d.h:106
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define ARRAY_SIZE(a)
Definition: main.h:24
wined3d_device_type
Definition: wined3d.h:85
#define NULL
Definition: types.h:112
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112
#define DDPF_ZBUFFER
Definition: ddraw.h:511
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
static IPrintDialogCallback callback
Definition: printdlg.c:326
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define memset(x, y, z)
Definition: compat.h:39
DWORD dwSize
Definition: ddraw.h:1070
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79
void ddrawformat_from_wined3dformat(DDPIXELFORMAT *ddraw_format, enum wined3d_format_id wined3d_format) DECLSPEC_HIDDEN
Definition: utils.c:33

Referenced by d3d3_EnumZBufferFormats().

◆ d3d7_EvictManagedTextures()

static HRESULT WINAPI d3d7_EvictManagedTextures ( IDirect3D7 *  iface)
static

Definition at line 4553 of file ddraw.c.

4554 {
4555  struct ddraw *ddraw = impl_from_IDirect3D7(iface);
4556 
4557  TRACE("iface %p!\n", iface);
4558 
4563 
4564  return D3D_OK;
4565 }
void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device)
Definition: device.c:4753
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define DDRAW_D3D_INITIALIZED
Definition: ddraw_private.h:55
#define TRACE(s)
Definition: solgame.cpp:4
static struct ddraw * impl_from_IDirect3D7(IDirect3D7 *iface)
Definition: ddraw.c:123
DWORD flags
Definition: ddraw_private.h:94
#define D3D_OK
Definition: d3d.h:106
struct wined3d_device * wined3d_device
Definition: ddraw_private.h:93
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373

Referenced by d3d3_EvictManagedTextures().

◆ d3d7_QueryInterface()

static HRESULT WINAPI d3d7_QueryInterface ( IDirect3D7 *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 230 of file ddraw.c.

231 {
232  struct ddraw *ddraw = impl_from_IDirect3D7(iface);
233 
234  TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
235 
237 }
REFIID riid
Definition: precomp.h:44
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT WINAPI ddraw7_QueryInterface(IDirectDraw7 *iface, REFIID riid, void **out)
Definition: ddraw.c:128
static struct ddraw * impl_from_IDirect3D7(IDirect3D7 *iface)
Definition: ddraw.c:123
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ d3d7_Release()

static ULONG WINAPI d3d7_Release ( IDirect3D7 *  iface)
static

Definition at line 511 of file ddraw.c.

512 {
513  struct ddraw *This = impl_from_IDirect3D7(iface);
514 
515  TRACE("iface %p.\n", iface);
516 
517  return ddraw7_Release(&This->IDirectDraw7_iface);
518 }
static ULONG WINAPI ddraw7_Release(IDirectDraw7 *iface)
Definition: ddraw.c:459
#define TRACE(s)
Definition: solgame.cpp:4
static struct ddraw * impl_from_IDirect3D7(IDirect3D7 *iface)
Definition: ddraw.c:123

◆ ddraw1_AddRef()

static ULONG WINAPI ddraw1_AddRef ( IDirectDraw *  iface)
static

Definition at line 320 of file ddraw.c.

321 {
322  struct ddraw *This = impl_from_IDirectDraw(iface);
324 
325  TRACE("%p increasing refcount to %u.\n", This, ref);
326 
327  if (ref == 1) InterlockedIncrement(&This->numIfaces);
328 
329  return ref;
330 }
Definition: send.c:48
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1

Referenced by d3d1_AddRef(), d3d2_AddRef(), and d3d3_AddRef().

◆ ddraw1_Compact()

static HRESULT WINAPI ddraw1_Compact ( IDirectDraw *  iface)
static

Definition at line 1632 of file ddraw.c.

1633 {
1634  struct ddraw *ddraw = impl_from_IDirectDraw(iface);
1635 
1636  TRACE("iface %p.\n", iface);
1637 
1639 }
#define TRACE(s)
Definition: solgame.cpp:4
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
static HRESULT WINAPI ddraw7_Compact(IDirectDraw7 *iface)
Definition: ddraw.c:1607
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw1_CreateClipper()

static HRESULT WINAPI ddraw1_CreateClipper ( IDirectDraw *  iface,
DWORD  flags,
IDirectDrawClipper **  clipper,
IUnknown outer_unknown 
)
static

Definition at line 3482 of file ddraw.c.

3484 {
3485  struct ddraw *ddraw = impl_from_IDirectDraw(iface);
3486 
3487  TRACE("iface %p, flags %#x, clipper %p, outer_unknown %p.\n",
3488  iface, flags, clipper, outer_unknown);
3489 
3490  return ddraw7_CreateClipper(&ddraw->IDirectDraw7_iface, flags, clipper, outer_unknown);
3491 }
static HRESULT WINAPI ddraw7_CreateClipper(IDirectDraw7 *iface, DWORD Flags, IDirectDrawClipper **Clipper, IUnknown *UnkOuter)
Definition: ddraw.c:3451
#define TRACE(s)
Definition: solgame.cpp:4
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
GLbitfield flags
Definition: glext.h:7161
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw1_CreatePalette()

static HRESULT WINAPI ddraw1_CreatePalette ( IDirectDraw *  iface,
DWORD  flags,
PALETTEENTRY entries,
IDirectDrawPalette **  palette,
IUnknown outer_unknown 
)
static

Definition at line 3596 of file ddraw.c.

3598 {
3599  struct ddraw *ddraw = impl_from_IDirectDraw(iface);
3600  HRESULT hr;
3601 
3602  TRACE("iface %p, flags %#x, entries %p, palette %p, outer_unknown %p.\n",
3603  iface, flags, entries, palette, outer_unknown);
3604 
3605  hr = ddraw7_CreatePalette(&ddraw->IDirectDraw7_iface, flags, entries, palette, outer_unknown);
3606  if (SUCCEEDED(hr) && *palette)
3607  {
3609  IDirectDraw7_Release(&ddraw->IDirectDraw7_iface);
3610  impl->ifaceToRelease = NULL;
3611  }
3612 
3613  return hr;
3614 }
IUnknown * ifaceToRelease
HRESULT hr
Definition: shlfolder.c:183
if SUCCEEDED(hr)
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
GLbitfield flags
Definition: glext.h:7161
static HPALETTE palette
Definition: clipboard.c:1345
#define NULL
Definition: types.h:112
static HRESULT WINAPI ddraw7_CreatePalette(IDirectDraw7 *iface, DWORD Flags, PALETTEENTRY *ColorTable, IDirectDrawPalette **Palette, IUnknown *pUnkOuter)
Definition: ddraw.c:3510
static struct ddraw_palette * impl_from_IDirectDrawPalette(IDirectDrawPalette *iface)
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw1_CreateSurface()

static HRESULT WINAPI ddraw1_CreateSurface ( IDirectDraw *  iface,
DDSURFACEDESC surface_desc,
IDirectDrawSurface **  surface,
IUnknown outer_unknown 
)
static

Definition at line 3019 of file ddraw.c.

3021 {
3022  struct ddraw *ddraw = impl_from_IDirectDraw(iface);
3023  struct ddraw_surface *impl;
3024  HRESULT hr;
3025  DDSURFACEDESC2 surface_desc2;
3026 
3027  TRACE("iface %p, surface_desc %p, surface %p, outer_unknown %p.\n",
3028  iface, surface_desc, surface, outer_unknown);
3029 
3031 
3033  {
3034  WARN("Cooperative level not set.\n");
3037  }
3038 
3039  if(surface_desc == NULL || surface_desc->dwSize != sizeof(DDSURFACEDESC))
3040  {
3041  WARN("Application supplied invalid surface descriptor\n");
3043  return DDERR_INVALIDPARAMS;
3044  }
3045 
3046  __TRY
3047  {
3048  *surface = NULL;
3049  }
3051  {
3052  WARN("Surface pointer %p is invalid.\n", surface);
3054  return DDERR_INVALIDPARAMS;
3055  }
3056  __ENDTRY;
3057 
3062  {
3063  WARN("Application tried to create an explicit front or back buffer.\n");
3065  return DDERR_INVALIDCAPS;
3066  }
3067 
3068  DDSD_to_DDSD2(surface_desc, &surface_desc2);
3069  hr = ddraw_surface_create(ddraw, &surface_desc2, &impl, outer_unknown, 1);
3071  if (FAILED(hr))
3072  return hr;
3073 
3074  *surface = &impl->IDirectDrawSurface_iface;
3075  impl->ifaceToRelease = NULL;
3076 
3077  return hr;
3078 }
void DDSD_to_DDSD2(const DDSURFACEDESC *in, DDSURFACEDESC2 *out) DECLSPEC_HIDDEN
Definition: utils.c:1218
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:112
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define DDERR_NOCOOPERATIVELEVELSET
Definition: ddraw.h:89
#define DDSCL_EXCLUSIVE
Definition: ddraw.h:536
#define DDSCAPS_FLIP
Definition: ddraw.h:253
HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_desc, struct ddraw_surface **surface, IUnknown *outer_unknown, unsigned int version) DECLSPEC_HIDDEN
Definition: surface.c:5791
DDSCAPS2 ddsCaps
Definition: ddraw.h:1188
DWORD dwCaps
Definition: ddraw.h:732
IDirectDrawSurface IDirectDrawSurface_iface
#define DDSCAPS_FRONTBUFFER
Definition: ddraw.h:254
#define __TRY
Definition: compat.h:80
#define TRACE(s)
Definition: solgame.cpp:4
DDSURFACEDESC2 surface_desc
LONG HRESULT
Definition: typedefs.h:79
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
#define __ENDTRY
Definition: compat.h:82
DWORD dwSize
Definition: ddraw.h:1152
#define DDSCAPS_BACKBUFFER
Definition: ddraw.h:251
#define DDSCAPS_PRIMARYSURFACE
Definition: ddraw.h:258
#define NULL
Definition: types.h:112
#define DDERR_INVALIDCAPS
Definition: ddraw.h:75
#define DDSCL_NORMAL
Definition: ddraw.h:535
DWORD cooperative_level
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79
IUnknown * ifaceToRelease
#define __EXCEPT_PAGE_FAULT
Definition: compat.h:81

◆ ddraw1_DuplicateSurface()

static HRESULT WINAPI ddraw1_DuplicateSurface ( IDirectDraw *  iface,
IDirectDrawSurface *  src,
IDirectDrawSurface **  dst 
)
static

Definition at line 3693 of file ddraw.c.

3695 {
3697  struct ddraw *ddraw = impl_from_IDirectDraw(iface);
3698  struct ddraw_surface *dst_impl;
3699  IDirectDrawSurface7 *dst7;
3700  HRESULT hr;
3701 
3702  TRACE("iface %p, src %p, dst %p.\n", iface, src, dst);
3703 
3705  src_impl ? &src_impl->IDirectDrawSurface7_iface : NULL, &dst7);
3706  if (FAILED(hr))
3707  return hr;
3708  dst_impl = impl_from_IDirectDrawSurface7(dst7);
3709  *dst = &dst_impl->IDirectDrawSurface_iface;
3710  IDirectDrawSurface_AddRef(*dst);
3711  IDirectDrawSurface7_Release(dst7);
3712 
3713  return hr;
3714 }
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface(IDirectDrawSurface *iface) DECLSPEC_HIDDEN
Definition: surface.c:5705
HRESULT hr
Definition: shlfolder.c:183
static HRESULT WINAPI ddraw7_DuplicateSurface(IDirectDraw7 *iface, IDirectDrawSurface7 *Src, IDirectDrawSurface7 **Dest)
Definition: ddraw.c:3633
static struct ddraw_surface * impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface)
IDirectDrawSurface IDirectDrawSurface_iface
DWORD IDirectDrawSurface7
Definition: vmrender.idl:20
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
GLenum src
Definition: glext.h:6340
IDirectDrawSurface7 IDirectDrawSurface7_iface
GLenum GLenum dst
Definition: glext.h:6340
#define NULL
Definition: types.h:112
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw1_EnumDisplayModes()

static HRESULT WINAPI ddraw1_EnumDisplayModes ( IDirectDraw *  iface,
DWORD  flags,
DDSURFACEDESC surface_desc,
void context,
LPDDENUMMODESCALLBACK  callback 
)
static

Definition at line 2569 of file ddraw.c.

2571 {
2572  struct ddraw *ddraw = impl_from_IDirectDraw(iface);
2573  struct displaymodescallback_context cbcontext;
2574  DDSURFACEDESC2 surface_desc2;
2575 
2576  TRACE("iface %p, flags %#x, surface_desc %p, context %p, callback %p.\n",
2577  iface, flags, surface_desc, context, callback);
2578 
2579  cbcontext.func = callback;
2580  cbcontext.context = context;
2581 
2582  if (surface_desc) DDSD_to_DDSD2(surface_desc, &surface_desc2);
2584  surface_desc ? &surface_desc2 : NULL, &cbcontext, EnumDisplayModesCallbackThunk);
2585 }
void DDSD_to_DDSD2(const DDSURFACEDESC *in, DDSURFACEDESC2 *out) DECLSPEC_HIDDEN
Definition: utils.c:1218
Definition: http.c:7251
#define TRACE(s)
Definition: solgame.cpp:4
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
_In_opt_ PVOID _In_ ULONG _In_ PVOID context
Definition: wdfdriver.h:113
GLbitfield flags
Definition: glext.h:7161
static HRESULT WINAPI ddraw7_EnumDisplayModes(IDirectDraw7 *iface, DWORD Flags, DDSURFACEDESC2 *DDSD, void *Context, LPDDENUMMODESCALLBACK2 cb)
Definition: ddraw.c:2421
#define NULL
Definition: types.h:112
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79
static IPrintDialogCallback callback
Definition: printdlg.c:326
static HRESULT CALLBACK EnumDisplayModesCallbackThunk(DDSURFACEDESC2 *surface_desc, void *context)
Definition: ddraw.c:2394

◆ ddraw1_EnumSurfaces()

static HRESULT WINAPI ddraw1_EnumSurfaces ( IDirectDraw *  iface,
DWORD  flags,
DDSURFACEDESC surface_desc,
void context,
LPDDENUMSURFACESCALLBACK  callback 
)
static

Definition at line 3377 of file ddraw.c.

3379 {
3380  struct ddraw *ddraw = impl_from_IDirectDraw(iface);
3381  struct surfacescallback_context cbcontext;
3382  DDSURFACEDESC2 surface_desc2;
3383 
3384  TRACE("iface %p, flags %#x, surface_desc %p, context %p, callback %p.\n",
3385  iface, flags, surface_desc, context, callback);
3386 
3387  cbcontext.func = callback;
3388  cbcontext.context = context;
3389 
3390  if (surface_desc) DDSD_to_DDSD2(surface_desc, &surface_desc2);
3392  surface_desc ? &surface_desc2 : NULL, &cbcontext, EnumSurfacesCallbackThunk);
3393 }
void DDSD_to_DDSD2(const DDSURFACEDESC *in, DDSURFACEDESC2 *out) DECLSPEC_HIDDEN
Definition: utils.c:1218
Definition: http.c:7251
static HRESULT WINAPI ddraw7_EnumSurfaces(IDirectDraw7 *iface, DWORD Flags, DDSURFACEDESC2 *DDSD, void *Context, LPDDENUMSURFACESCALLBACK7 Callback)
Definition: ddraw.c:3243
#define TRACE(s)
Definition: solgame.cpp:4
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
_In_opt_ PVOID _In_ ULONG _In_ PVOID context
Definition: wdfdriver.h:113
GLbitfield flags
Definition: glext.h:7161
static HRESULT CALLBACK EnumSurfacesCallbackThunk(IDirectDrawSurface7 *surface, DDSURFACEDESC2 *surface_desc, void *context)
Definition: ddraw.c:3211
#define NULL
Definition: types.h:112
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79
static IPrintDialogCallback callback
Definition: printdlg.c:326

◆ ddraw1_FlipToGDISurface()

static HRESULT WINAPI ddraw1_FlipToGDISurface ( IDirectDraw *  iface)
static

Definition at line 2141 of file ddraw.c.

2142 {
2143  struct ddraw *ddraw = impl_from_IDirectDraw(iface);
2144 
2145  TRACE("iface %p.\n", iface);
2146 
2148 }
static HRESULT WINAPI ddraw7_FlipToGDISurface(IDirectDraw7 *iface)
Definition: ddraw.c:2093
#define TRACE(s)
Definition: solgame.cpp:4
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw1_GetCaps()

static HRESULT WINAPI ddraw1_GetCaps ( IDirectDraw *  iface,
DDCAPS driver_caps,
DDCAPS hel_caps 
)
static

Definition at line 1589 of file ddraw.c.

1590 {
1591  struct ddraw *ddraw = impl_from_IDirectDraw(iface);
1592 
1593  TRACE("iface %p, driver_caps %p, hel_caps %p.\n", iface, driver_caps, hel_caps);
1594 
1595  return ddraw7_GetCaps(&ddraw->IDirectDraw7_iface, driver_caps, hel_caps);
1596 }
#define TRACE(s)
Definition: solgame.cpp:4
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79
static HRESULT WINAPI ddraw7_GetCaps(IDirectDraw7 *iface, DDCAPS *DriverCaps, DDCAPS *HELCaps)
Definition: ddraw.c:1479

◆ ddraw1_GetDisplayMode()

static HRESULT WINAPI ddraw1_GetDisplayMode ( IDirectDraw *  iface,
DDSURFACEDESC surface_desc 
)
static

Definition at line 1719 of file ddraw.c.

1720 {
1721  struct ddraw *ddraw = impl_from_IDirectDraw(iface);
1722  HRESULT hr;
1723 
1724  TRACE("iface %p, surface_desc %p.\n", iface, surface_desc);
1725 
1727  if (SUCCEEDED(hr)) surface_desc->dwSize = sizeof(*surface_desc);
1728  return hr;
1729 }
HRESULT hr
Definition: shlfolder.c:183
if SUCCEEDED(hr)
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79
static HRESULT WINAPI ddraw7_GetDisplayMode(IDirectDraw7 *iface, DDSURFACEDESC2 *DDSD)
Definition: ddraw.c:1655

◆ ddraw1_GetFourCCCodes()

static HRESULT WINAPI ddraw1_GetFourCCCodes ( IDirectDraw *  iface,
DWORD codes_count,
DWORD codes 
)
static

Definition at line 1807 of file ddraw.c.

1808 {
1809  struct ddraw *ddraw = impl_from_IDirectDraw(iface);
1810 
1811  TRACE("iface %p, codes_count %p, codes %p.\n", iface, codes_count, codes);
1812 
1813  return ddraw7_GetFourCCCodes(&ddraw->IDirectDraw7_iface, codes_count, codes);
1814 }
static HRESULT WINAPI ddraw7_GetFourCCCodes(IDirectDraw7 *iface, DWORD *NumCodes, DWORD *Codes)
Definition: ddraw.c:1748
#define TRACE(s)
Definition: solgame.cpp:4
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw1_GetGDISurface()

static HRESULT WINAPI ddraw1_GetGDISurface ( IDirectDraw *  iface,
IDirectDrawSurface **  surface 
)
static

Definition at line 2365 of file ddraw.c.

2366 {
2367  struct ddraw *ddraw = impl_from_IDirectDraw(iface);
2368  struct ddraw_surface *surface_impl;
2369  IDirectDrawSurface7 *surface7;
2370  HRESULT hr;
2371 
2372  TRACE("iface %p, surface %p.\n", iface, surface);
2373 
2375  if (FAILED(hr))
2376  {
2377  *surface = NULL;
2378  return hr;
2379  }
2380  surface_impl = impl_from_IDirectDrawSurface7(surface7);
2381  *surface = &surface_impl->IDirectDrawSurface_iface;
2382  IDirectDrawSurface_AddRef(*surface);
2383  IDirectDrawSurface7_Release(surface7);
2384 
2385  return hr;
2386 }
HRESULT hr
Definition: shlfolder.c:183
static struct ddraw_surface * impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface)
IDirectDrawSurface IDirectDrawSurface_iface
DWORD IDirectDrawSurface7
Definition: vmrender.idl:20
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
#define NULL
Definition: types.h:112
static HRESULT WINAPI ddraw7_GetGDISurface(IDirectDraw7 *iface, IDirectDrawSurface7 **GDISurface)
Definition: ddraw.c:2298
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw1_GetMonitorFrequency()

static HRESULT WINAPI ddraw1_GetMonitorFrequency ( IDirectDraw *  iface,
DWORD frequency 
)
static

Definition at line 1856 of file ddraw.c.

1857 {
1858  struct ddraw *ddraw = impl_from_IDirectDraw(iface);
1859 
1860  TRACE("iface %p, frequency %p.\n", iface, frequency);
1861 
1863 }
#define TRACE(s)
Definition: solgame.cpp:4
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
static LARGE_INTEGER * frequency
Definition: time.c:106
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79
static HRESULT WINAPI ddraw7_GetMonitorFrequency(IDirectDraw7 *iface, DWORD *frequency)
Definition: ddraw.c:1816

◆ ddraw1_GetScanLine()

static HRESULT WINAPI ddraw1_GetScanLine ( IDirectDraw *  iface,
DWORD line 
)
static

Definition at line 2257 of file ddraw.c.

2258 {
2259  struct ddraw *ddraw = impl_from_IDirectDraw(iface);
2260 
2261  TRACE("iface %p, line %p.\n", iface, line);
2262 
2264 }
Definition: parser.c:48
static HRESULT WINAPI ddraw7_GetScanLine(IDirectDraw7 *iface, DWORD *Scanline)
Definition: ddraw.c:2214
#define TRACE(s)
Definition: solgame.cpp:4
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw1_GetVerticalBlankStatus()

static HRESULT WINAPI ddraw1_GetVerticalBlankStatus ( IDirectDraw *  iface,
BOOL status 
)
static

Definition at line 1908 of file ddraw.c.

1909 {
1910  struct ddraw *ddraw = impl_from_IDirectDraw(iface);
1911 
1912  TRACE("iface %p, status %p.\n", iface, status);
1913 
1915 }
static HRESULT WINAPI ddraw7_GetVerticalBlankStatus(IDirectDraw7 *iface, BOOL *status)
Definition: ddraw.c:1865
#define TRACE(s)
Definition: solgame.cpp:4
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79
Definition: ps.c:97

◆ ddraw1_Initialize()

static HRESULT WINAPI ddraw1_Initialize ( IDirectDraw *  iface,
GUID guid 
)
static

Definition at line 2064 of file ddraw.c.

2065 {
2066  struct ddraw *ddraw = impl_from_IDirectDraw(iface);
2067 
2068  TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid));
2069 
2071 }
static HRESULT WINAPI ddraw7_Initialize(IDirectDraw7 *iface, GUID *guid)
Definition: ddraw.c:2028
const GUID * guid
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw1_QueryInterface()

static HRESULT WINAPI ddraw1_QueryInterface ( IDirectDraw *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 221 of file ddraw.c.

222 {
223  struct ddraw *ddraw = impl_from_IDirectDraw(iface);
224 
225  TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
226 
228 }
REFIID riid
Definition: precomp.h:44
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
static HRESULT WINAPI ddraw7_QueryInterface(IDirectDraw7 *iface, REFIID riid, void **out)
Definition: ddraw.c:128
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw1_Release()

static ULONG WINAPI ddraw1_Release ( IDirectDraw *  iface)
static

Definition at line 498 of file ddraw.c.

499 {
500  struct ddraw *This = impl_from_IDirectDraw(iface);
502 
503  TRACE("%p decreasing refcount to %u.\n", This, ref);
504 
505  if (!ref && !InterlockedDecrement(&This->numIfaces))
507 
508  return ref;
509 }
Definition: send.c:48
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
#define InterlockedDecrement
Definition: armddk.h:52
static void ddraw_destroy(struct ddraw *This)
Definition: ddraw.c:423
unsigned int ULONG
Definition: retypes.h:1

Referenced by d3d1_Release(), d3d2_Release(), and d3d3_Release().

◆ ddraw1_RestoreDisplayMode()

static HRESULT WINAPI ddraw1_RestoreDisplayMode ( IDirectDraw *  iface)
static

Definition at line 727 of file ddraw.c.

728 {
729  struct ddraw *ddraw = impl_from_IDirectDraw(iface);
730 
731  TRACE("iface %p.\n", iface);
732 
734 }
#define TRACE(s)
Definition: solgame.cpp:4
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
static HRESULT WINAPI ddraw7_RestoreDisplayMode(IDirectDraw7 *iface)
Definition: ddraw.c:678
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw1_SetCooperativeLevel()

static HRESULT WINAPI ddraw1_SetCooperativeLevel ( IDirectDraw *  iface,
HWND  window,
DWORD  flags 
)
static

Definition at line 1049 of file ddraw.c.

1050 {
1051  struct ddraw *ddraw = impl_from_IDirectDraw(iface);
1052  HRESULT hr;
1053 
1054  TRACE("iface %p, window %p, flags %#x.\n", iface, window, flags);
1055 
1057  if (SUCCEEDED(hr))
1059  return hr;
1060 }
HRESULT hr
Definition: shlfolder.c:183
static HRESULT ddraw_set_cooperative_level(struct ddraw *ddraw, HWND window, DWORD cooplevel, BOOL restore_mode_on_normal)
Definition: ddraw.c:778
#define FALSE
Definition: types.h:117
if SUCCEEDED(hr)
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
GLbitfield flags
Definition: glext.h:7161
static IHTMLWindow2 * window
Definition: events.c:77
DWORD flags
Definition: ddraw_private.h:94
#define DDRAW_SCL_DDRAW1
Definition: ddraw_private.h:58

◆ ddraw1_SetDisplayMode()

static HRESULT WINAPI ddraw1_SetDisplayMode ( IDirectDraw *  iface,
DWORD  width,
DWORD  height,
DWORD  bpp 
)
static

Definition at line 1183 of file ddraw.c.

1184 {
1185  struct ddraw *ddraw = impl_from_IDirectDraw(iface);
1186 
1187  TRACE("iface %p, width %u, height %u, bpp %u.\n", iface, width, height, bpp);
1188 
1190 }
GLint GLint GLsizei width
Definition: gl.h:1546
static HRESULT WINAPI ddraw7_SetDisplayMode(IDirectDraw7 *iface, DWORD width, DWORD height, DWORD bpp, DWORD refresh_rate, DWORD flags)
Definition: ddraw.c:1084
#define TRACE(s)
Definition: solgame.cpp:4
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79
DWORD bpp
Definition: surface.c:185

◆ ddraw1_WaitForVerticalBlank()

static HRESULT WINAPI ddraw1_WaitForVerticalBlank ( IDirectDraw *  iface,
DWORD  flags,
HANDLE  event 
)
static

Definition at line 2205 of file ddraw.c.

2206 {
2207  struct ddraw *ddraw = impl_from_IDirectDraw(iface);
2208 
2209  TRACE("iface %p, flags %#x, event %p.\n", iface, flags, event);
2210 
2212 }
#define TRACE(s)
Definition: solgame.cpp:4
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
GLbitfield flags
Definition: glext.h:7161
struct _cl_event * event
Definition: glext.h:7739
static HRESULT WINAPI ddraw7_WaitForVerticalBlank(IDirectDraw7 *iface, DWORD Flags, HANDLE event)
Definition: ddraw.c:2167
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw2_AddRef()

static ULONG WINAPI ddraw2_AddRef ( IDirectDraw2 *  iface)
static

Definition at line 308 of file ddraw.c.

309 {
310  struct ddraw *This = impl_from_IDirectDraw2(iface);
312 
313  TRACE("%p increasing refcount to %u.\n", This, ref);
314 
315  if (ref == 1) InterlockedIncrement(&This->numIfaces);
316 
317  return ref;
318 }
Definition: send.c:48
GLenum GLint ref
Definition: glext.h:6028
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1

◆ ddraw2_Compact()

static HRESULT WINAPI ddraw2_Compact ( IDirectDraw2 *  iface)
static

Definition at line 1623 of file ddraw.c.

1624 {
1625  struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
1626 
1627  TRACE("iface %p.\n", iface);
1628 
1630 }
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT WINAPI ddraw7_Compact(IDirectDraw7 *iface)
Definition: ddraw.c:1607
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw2_CreateClipper()

static HRESULT WINAPI ddraw2_CreateClipper ( IDirectDraw2 *  iface,
DWORD  flags,
IDirectDrawClipper **  clipper,
IUnknown outer_unknown 
)
static

Definition at line 3471 of file ddraw.c.

3473 {
3474  struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
3475 
3476  TRACE("iface %p, flags %#x, clipper %p, outer_unknown %p.\n",
3477  iface, flags, clipper, outer_unknown);
3478 
3479  return ddraw7_CreateClipper(&ddraw->IDirectDraw7_iface, flags, clipper, outer_unknown);
3480 }
static HRESULT WINAPI ddraw7_CreateClipper(IDirectDraw7 *iface, DWORD Flags, IDirectDrawClipper **Clipper, IUnknown *UnkOuter)
Definition: ddraw.c:3451
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93
#define TRACE(s)
Definition: solgame.cpp:4
GLbitfield flags
Definition: glext.h:7161
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw2_CreatePalette()

static HRESULT WINAPI ddraw2_CreatePalette ( IDirectDraw2 *  iface,
DWORD  flags,
PALETTEENTRY entries,
IDirectDrawPalette **  palette,
IUnknown outer_unknown 
)
static

Definition at line 3576 of file ddraw.c.

3578 {
3579  struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
3580  HRESULT hr;
3581 
3582  TRACE("iface %p, flags %#x, entries %p, palette %p, outer_unknown %p.\n",
3583  iface, flags, entries, palette, outer_unknown);
3584 
3585  hr = ddraw7_CreatePalette(&ddraw->IDirectDraw7_iface, flags, entries, palette, outer_unknown);
3586  if (SUCCEEDED(hr) && *palette)
3587  {
3589  IDirectDraw7_Release(&ddraw->IDirectDraw7_iface);
3590  impl->ifaceToRelease = NULL;
3591  }
3592 
3593  return hr;
3594 }
IUnknown * ifaceToRelease
HRESULT hr
Definition: shlfolder.c:183
if SUCCEEDED(hr)
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
GLbitfield flags
Definition: glext.h:7161
static HPALETTE palette
Definition: clipboard.c:1345
#define NULL
Definition: types.h:112
static HRESULT WINAPI ddraw7_CreatePalette(IDirectDraw7 *iface, DWORD Flags, PALETTEENTRY *ColorTable, IDirectDrawPalette **Palette, IUnknown *pUnkOuter)
Definition: ddraw.c:3510
static struct ddraw_palette * impl_from_IDirectDrawPalette(IDirectDrawPalette *iface)
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw2_CreateSurface()

static HRESULT WINAPI ddraw2_CreateSurface ( IDirectDraw2 *  iface,
DDSURFACEDESC surface_desc,
IDirectDrawSurface **  surface,
IUnknown outer_unknown 
)
static

Definition at line 2955 of file ddraw.c.

2957 {
2958  struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
2959  struct ddraw_surface *impl;
2960  HRESULT hr;
2961  DDSURFACEDESC2 surface_desc2;
2962 
2963  TRACE("iface %p, surface_desc %p, surface %p, outer_unknown %p.\n",
2964  iface, surface_desc, surface, outer_unknown);
2965 
2967 
2969  {
2970  WARN("Cooperative level not set.\n");
2973  }
2974 
2975  if(surface_desc == NULL || surface_desc->dwSize != sizeof(DDSURFACEDESC))
2976  {
2977  WARN("Application supplied invalid surface descriptor\n");
2979  return DDERR_INVALIDPARAMS;
2980  }
2981 
2982  __TRY
2983  {
2984  *surface = NULL;
2985  }
2987  {
2988  WARN("Surface pointer %p is invalid.\n", surface);
2990  return DDERR_INVALIDPARAMS;
2991  }
2992  __ENDTRY;
2993 
2994  DDSD_to_DDSD2(surface_desc, &surface_desc2);
2996  {
2997  if (TRACE_ON(ddraw))
2998  {
2999  TRACE(" (%p) Requesting surface desc :\n", iface);
3001  }
3002 
3003  WARN("Application tried to create an explicit front or back buffer\n");
3005  return DDERR_INVALIDCAPS;
3006  }
3007 
3008  hr = ddraw_surface_create(ddraw, &surface_desc2, &impl, outer_unknown, 2);
3010  if (FAILED(hr))
3011  return hr;
3012 
3013  *surface = &impl->IDirectDrawSurface_iface;
3014  impl->ifaceToRelease = NULL;
3015 
3016  return hr;
3017 }
void DDSD_to_DDSD2(const DDSURFACEDESC *in, DDSURFACEDESC2 *out) DECLSPEC_HIDDEN
Definition: utils.c:1218
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:112
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
#define DDERR_NOCOOPERATIVELEVELSET
Definition: ddraw.h:89
#define DDSCL_EXCLUSIVE
Definition: ddraw.h:536
HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_desc, struct ddraw_surface **surface, IUnknown *outer_unknown, unsigned int version) DECLSPEC_HIDDEN
Definition: surface.c:5791
DDSCAPS2 ddsCaps
Definition: ddraw.h:1188
DWORD dwCaps
Definition: ddraw.h:732
IDirectDrawSurface IDirectDrawSurface_iface
#define DDSCAPS_FRONTBUFFER
Definition: ddraw.h:254
#define __TRY
Definition: compat.h:80
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93
#define TRACE(s)
Definition: solgame.cpp:4
DDSURFACEDESC2 surface_desc
LONG HRESULT
Definition: typedefs.h:79
#define __ENDTRY
Definition: compat.h:82
DWORD dwSize
Definition: ddraw.h:1152
void DDRAW_dump_surface_desc(const DDSURFACEDESC2 *lpddsd) DECLSPEC_HIDDEN
Definition: utils.c:864
#define DDSCAPS_BACKBUFFER
Definition: ddraw.h:251
#define NULL
Definition: types.h:112
#define DDERR_INVALIDCAPS
Definition: ddraw.h:75
#define DDSCL_NORMAL
Definition: ddraw.h:535
DWORD cooperative_level
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define TRACE_ON(x)
Definition: compat.h:75
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79
IUnknown * ifaceToRelease
#define __EXCEPT_PAGE_FAULT
Definition: compat.h:81

◆ ddraw2_DuplicateSurface()

static HRESULT WINAPI ddraw2_DuplicateSurface ( IDirectDraw2 *  iface,
IDirectDrawSurface *  src,
IDirectDrawSurface **  dst 
)
static

Definition at line 3670 of file ddraw.c.

3672 {
3674  struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
3675  struct ddraw_surface *dst_impl;
3676  IDirectDrawSurface7 *dst7;
3677  HRESULT hr;
3678 
3679  TRACE("iface %p, src %p, dst %p.\n", iface, src, dst);
3680 
3682  src_impl ? &src_impl->IDirectDrawSurface7_iface : NULL, &dst7);
3683  if (FAILED(hr))
3684  return hr;
3685  dst_impl = impl_from_IDirectDrawSurface7(dst7);
3686  *dst = &dst_impl->IDirectDrawSurface_iface;
3687  IDirectDrawSurface_AddRef(*dst);
3688  IDirectDrawSurface7_Release(dst7);
3689 
3690  return hr;
3691 }
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface(IDirectDrawSurface *iface) DECLSPEC_HIDDEN
Definition: surface.c:5705
HRESULT hr
Definition: shlfolder.c:183
static HRESULT WINAPI ddraw7_DuplicateSurface(IDirectDraw7 *iface, IDirectDrawSurface7 *Src, IDirectDrawSurface7 **Dest)
Definition: ddraw.c:3633
static struct ddraw_surface * impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface)
IDirectDrawSurface IDirectDrawSurface_iface
DWORD IDirectDrawSurface7
Definition: vmrender.idl:20
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
GLenum src
Definition: glext.h:6340
IDirectDrawSurface7 IDirectDrawSurface7_iface
GLenum GLenum dst
Definition: glext.h:6340
#define NULL
Definition: types.h:112
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw2_EnumDisplayModes()

static HRESULT WINAPI ddraw2_EnumDisplayModes ( IDirectDraw2 *  iface,
DWORD  flags,
DDSURFACEDESC surface_desc,
void context,
LPDDENUMMODESCALLBACK  callback 
)
static

Definition at line 2551 of file ddraw.c.

2553 {
2554  struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
2555  struct displaymodescallback_context cbcontext;
2556  DDSURFACEDESC2 surface_desc2;
2557 
2558  TRACE("iface %p, flags %#x, surface_desc %p, context %p, callback %p.\n",
2559  iface, flags, surface_desc, context, callback);
2560 
2561  cbcontext.func = callback;
2562  cbcontext.context = context;
2563 
2564  if (surface_desc) DDSD_to_DDSD2(surface_desc, &surface_desc2);
2566  surface_desc ? &surface_desc2 : NULL, &cbcontext, EnumDisplayModesCallbackThunk);
2567 }
void DDSD_to_DDSD2(const DDSURFACEDESC *in, DDSURFACEDESC2 *out) DECLSPEC_HIDDEN
Definition: utils.c:1218
Definition: http.c:7251
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93
#define TRACE(s)
Definition: solgame.cpp:4
_In_opt_ PVOID _In_ ULONG _In_ PVOID context
Definition: wdfdriver.h:113
GLbitfield flags
Definition: glext.h:7161
static HRESULT WINAPI ddraw7_EnumDisplayModes(IDirectDraw7 *iface, DWORD Flags, DDSURFACEDESC2 *DDSD, void *Context, LPDDENUMMODESCALLBACK2 cb)
Definition: ddraw.c:2421
#define NULL
Definition: types.h:112
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79
static IPrintDialogCallback callback
Definition: printdlg.c:326
static HRESULT CALLBACK EnumDisplayModesCallbackThunk(DDSURFACEDESC2 *surface_desc, void *context)
Definition: ddraw.c:2394

◆ ddraw2_EnumSurfaces()

static HRESULT WINAPI ddraw2_EnumSurfaces ( IDirectDraw2 *  iface,
DWORD  flags,
DDSURFACEDESC surface_desc,
void context,
LPDDENUMSURFACESCALLBACK  callback 
)
static

Definition at line 3359 of file ddraw.c.

3361 {
3362  struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
3363  struct surfacescallback_context cbcontext;
3364  DDSURFACEDESC2 surface_desc2;
3365 
3366  TRACE("iface %p, flags %#x, surface_desc %p, context %p, callback %p.\n",
3367  iface, flags, surface_desc, context, callback);
3368 
3369  cbcontext.func = callback;
3370  cbcontext.context = context;
3371 
3372  if (surface_desc) DDSD_to_DDSD2(surface_desc, &surface_desc2);
3374  surface_desc ? &surface_desc2 : NULL, &cbcontext, EnumSurfacesCallbackThunk);
3375 }
void DDSD_to_DDSD2(const DDSURFACEDESC *in, DDSURFACEDESC2 *out) DECLSPEC_HIDDEN
Definition: utils.c:1218
Definition: http.c:7251
static HRESULT WINAPI ddraw7_EnumSurfaces(IDirectDraw7 *iface, DWORD Flags, DDSURFACEDESC2 *DDSD, void *Context, LPDDENUMSURFACESCALLBACK7 Callback)
Definition: ddraw.c:3243
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93
#define TRACE(s)
Definition: solgame.cpp:4
_In_opt_ PVOID _In_ ULONG _In_ PVOID context
Definition: wdfdriver.h:113
GLbitfield flags
Definition: glext.h:7161
static HRESULT CALLBACK EnumSurfacesCallbackThunk(IDirectDrawSurface7 *surface, DDSURFACEDESC2 *surface_desc, void *context)
Definition: ddraw.c:3211
#define NULL
Definition: types.h:112
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79
static IPrintDialogCallback callback
Definition: printdlg.c:326

◆ ddraw2_FlipToGDISurface()

static HRESULT WINAPI ddraw2_FlipToGDISurface ( IDirectDraw2 *  iface)
static

Definition at line 2132 of file ddraw.c.

2133 {
2134  struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
2135 
2136  TRACE("iface %p.\n", iface);
2137 
2139 }
static HRESULT WINAPI ddraw7_FlipToGDISurface(IDirectDraw7 *iface)
Definition: ddraw.c:2093
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93
#define TRACE(s)
Definition: solgame.cpp:4
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw2_GetAvailableVidMem()

static HRESULT WINAPI ddraw2_GetAvailableVidMem ( IDirectDraw2 *  iface,
DDSCAPS caps,
DWORD total,
DWORD free 
)
static

Definition at line 2002 of file ddraw.c.

2004 {
2005  struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
2006  DDSCAPS2 caps2;
2007 
2008  TRACE("iface %p, caps %p, total %p, free %p.\n", iface, caps, total, free);
2009 
2010  DDRAW_Convert_DDSCAPS_1_To_2(caps, &caps2);
2012 }
#define free
Definition: debug_ros.c:5
static HRESULT WINAPI ddraw7_GetAvailableVidMem(IDirectDraw7 *iface, DDSCAPS2 *caps, DWORD *total, DWORD *free)
Definition: ddraw.c:1932
void DDRAW_Convert_DDSCAPS_1_To_2(const DDSCAPS *pIn, DDSCAPS2 *pOut) DECLSPEC_HIDDEN
Definition: utils.c:951
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93
#define TRACE(s)
Definition: solgame.cpp:4
size_t total
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw2_GetCaps()

static HRESULT WINAPI ddraw2_GetCaps ( IDirectDraw2 *  iface,
DDCAPS driver_caps,
DDCAPS hel_caps 
)
static

Definition at line 1580 of file ddraw.c.

1581 {
1582  struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
1583 
1584  TRACE("iface %p, driver_caps %p, hel_caps %p.\n", iface, driver_caps, hel_caps);
1585 
1586  return ddraw7_GetCaps(&ddraw->IDirectDraw7_iface, driver_caps, hel_caps);
1587 }
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93
#define TRACE(s)
Definition: solgame.cpp:4
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79
static HRESULT WINAPI ddraw7_GetCaps(IDirectDraw7 *iface, DDCAPS *DriverCaps, DDCAPS *HELCaps)
Definition: ddraw.c:1479

◆ ddraw2_GetDisplayMode()

static HRESULT WINAPI ddraw2_GetDisplayMode ( IDirectDraw2 *  iface,
DDSURFACEDESC surface_desc 
)
static

Definition at line 1707 of file ddraw.c.

1708 {
1709  struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
1710  HRESULT hr;
1711 
1712  TRACE("iface %p, surface_desc %p.\n", iface, surface_desc);
1713 
1715  if (SUCCEEDED(hr)) surface_desc->dwSize = sizeof(*surface_desc);
1716  return hr;
1717 }
HRESULT hr
Definition: shlfolder.c:183
if SUCCEEDED(hr)
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79
static HRESULT WINAPI ddraw7_GetDisplayMode(IDirectDraw7 *iface, DDSURFACEDESC2 *DDSD)
Definition: ddraw.c:1655

◆ ddraw2_GetFourCCCodes()

static HRESULT WINAPI ddraw2_GetFourCCCodes ( IDirectDraw2 *  iface,
DWORD codes_count,
DWORD codes 
)
static

Definition at line 1798 of file ddraw.c.

1799 {
1800  struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
1801 
1802  TRACE("iface %p, codes_count %p, codes %p.\n", iface, codes_count, codes);
1803 
1804  return ddraw7_GetFourCCCodes(&ddraw->IDirectDraw7_iface, codes_count, codes);
1805 }
static HRESULT WINAPI ddraw7_GetFourCCCodes(IDirectDraw7 *iface, DWORD *NumCodes, DWORD *Codes)
Definition: ddraw.c:1748
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93
#define TRACE(s)
Definition: solgame.cpp:4
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw2_GetGDISurface()

static HRESULT WINAPI ddraw2_GetGDISurface ( IDirectDraw2 *  iface,
IDirectDrawSurface **  surface 
)
static

Definition at line 2342 of file ddraw.c.

2343 {
2344  struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
2345  struct ddraw_surface *surface_impl;
2346  IDirectDrawSurface7 *surface7;
2347  HRESULT hr;
2348 
2349  TRACE("iface %p, surface %p.\n", iface, surface);
2350 
2352  if (FAILED(hr))
2353  {
2354  *surface = NULL;
2355  return hr;
2356  }
2357  surface_impl = impl_from_IDirectDrawSurface7(surface7);
2358  *surface = &surface_impl->IDirectDrawSurface_iface;
2359  IDirectDrawSurface_AddRef(*surface);
2360  IDirectDrawSurface7_Release(surface7);
2361 
2362  return hr;
2363 }
HRESULT hr
Definition: shlfolder.c:183
static struct ddraw_surface * impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface)
IDirectDrawSurface IDirectDrawSurface_iface
DWORD IDirectDrawSurface7
Definition: vmrender.idl:20
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
#define NULL
Definition: types.h:112
static HRESULT WINAPI ddraw7_GetGDISurface(IDirectDraw7 *iface, IDirectDrawSurface7 **GDISurface)
Definition: ddraw.c:2298
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw2_GetMonitorFrequency()

static HRESULT WINAPI ddraw2_GetMonitorFrequency ( IDirectDraw2 *  iface,
DWORD frequency 
)
static

Definition at line 1847 of file ddraw.c.

1848 {
1849  struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
1850 
1851  TRACE("iface %p, frequency %p.\n", iface, frequency);
1852 
1854 }
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93
#define TRACE(s)
Definition: solgame.cpp:4
static LARGE_INTEGER * frequency
Definition: time.c:106
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79
static HRESULT WINAPI ddraw7_GetMonitorFrequency(IDirectDraw7 *iface, DWORD *frequency)
Definition: ddraw.c:1816

◆ ddraw2_GetScanLine()

static HRESULT WINAPI ddraw2_GetScanLine ( IDirectDraw2 *  iface,
DWORD line 
)
static

Definition at line 2248 of file ddraw.c.

2249 {
2250  struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
2251 
2252  TRACE("iface %p, line %p.\n", iface, line);
2253 
2255 }
Definition: parser.c:48
static HRESULT WINAPI ddraw7_GetScanLine(IDirectDraw7 *iface, DWORD *Scanline)
Definition: ddraw.c:2214
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93
#define TRACE(s)
Definition: solgame.cpp:4
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw2_GetVerticalBlankStatus()

static HRESULT WINAPI ddraw2_GetVerticalBlankStatus ( IDirectDraw2 *  iface,
BOOL status 
)
static

Definition at line 1899 of file ddraw.c.

1900 {
1901  struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
1902 
1903  TRACE("iface %p, status %p.\n", iface, status);
1904 
1906 }
static HRESULT WINAPI ddraw7_GetVerticalBlankStatus(IDirectDraw7 *iface, BOOL *status)
Definition: ddraw.c:1865
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93
#define TRACE(s)
Definition: solgame.cpp:4
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79
Definition: ps.c:97

◆ ddraw2_Initialize()

static HRESULT WINAPI ddraw2_Initialize ( IDirectDraw2 *  iface,
GUID guid 
)
static

Definition at line 2055 of file ddraw.c.

2056 {
2057  struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
2058 
2059  TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid));
2060 
2062 }
static HRESULT WINAPI ddraw7_Initialize(IDirectDraw7 *iface, GUID *guid)
Definition: ddraw.c:2028
const GUID * guid
#define debugstr_guid
Definition: kernel32.h:35
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93
#define TRACE(s)
Definition: solgame.cpp:4
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw2_QueryInterface()

static HRESULT WINAPI ddraw2_QueryInterface ( IDirectDraw2 *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 212 of file ddraw.c.

213 {
214  struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
215 
216  TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
217 
219 }
REFIID riid
Definition: precomp.h:44
#define debugstr_guid
Definition: kernel32.h:35
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT WINAPI ddraw7_QueryInterface(IDirectDraw7 *iface, REFIID riid, void **out)
Definition: ddraw.c:128
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw2_Release()

static ULONG WINAPI ddraw2_Release ( IDirectDraw2 *  iface)
static

Definition at line 485 of file ddraw.c.

486 {
487  struct ddraw *This = impl_from_IDirectDraw2(iface);
489 
490  TRACE("%p decreasing refcount to %u.\n", This, ref);
491 
492  if (!ref && !InterlockedDecrement(&This->numIfaces))
494 
495  return ref;
496 }
Definition: send.c:48
GLenum GLint ref
Definition: glext.h:6028
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedDecrement
Definition: armddk.h:52
static void ddraw_destroy(struct ddraw *This)
Definition: ddraw.c:423
unsigned int ULONG
Definition: retypes.h:1

◆ ddraw2_RestoreDisplayMode()

static HRESULT WINAPI ddraw2_RestoreDisplayMode ( IDirectDraw2 *  iface)
static

Definition at line 718 of file ddraw.c.

719 {
720  struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
721 
722  TRACE("iface %p.\n", iface);
723 
725 }
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT WINAPI ddraw7_RestoreDisplayMode(IDirectDraw7 *iface)
Definition: ddraw.c:678
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw2_SetCooperativeLevel()

static HRESULT WINAPI ddraw2_SetCooperativeLevel ( IDirectDraw2 *  iface,
HWND  window,
DWORD  flags 
)
static

Definition at line 1040 of file ddraw.c.

1041 {
1042  struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
1043 
1044  TRACE("iface %p, window %p, flags %#x.\n", iface, window, flags);
1045 
1047 }
static HRESULT ddraw_set_cooperative_level(struct ddraw *ddraw, HWND window, DWORD cooplevel, BOOL restore_mode_on_normal)
Definition: ddraw.c:778
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93
#define TRACE(s)
Definition: solgame.cpp:4
GLbitfield flags
Definition: glext.h:7161
static IHTMLWindow2 * window
Definition: events.c:77
DWORD flags
Definition: ddraw_private.h:94
#define DDRAW_SCL_DDRAW1
Definition: ddraw_private.h:58

◆ ddraw2_SetDisplayMode()

static HRESULT WINAPI ddraw2_SetDisplayMode ( IDirectDraw2 *  iface,
DWORD  width,
DWORD  height,
DWORD  bpp,
DWORD  refresh_rate,
DWORD  flags 
)
static

Definition at line 1172 of file ddraw.c.

1174 {
1175  struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
1176 
1177  TRACE("iface %p, width %u, height %u, bpp %u, refresh_rate %u, flags %#x.\n",
1178  iface, width, height, bpp, refresh_rate, flags);
1179 
1180  return ddraw7_SetDisplayMode(&ddraw->IDirectDraw7_iface, width, height, bpp, refresh_rate, flags);
1181 }
GLint GLint GLsizei width
Definition: gl.h:1546
static HRESULT WINAPI ddraw7_SetDisplayMode(IDirectDraw7 *iface, DWORD width, DWORD height, DWORD bpp, DWORD refresh_rate, DWORD flags)
Definition: ddraw.c:1084
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93
#define TRACE(s)
Definition: solgame.cpp:4
GLbitfield flags
Definition: glext.h:7161
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79
DWORD bpp
Definition: surface.c:185

◆ ddraw2_WaitForVerticalBlank()

static HRESULT WINAPI ddraw2_WaitForVerticalBlank ( IDirectDraw2 *  iface,
DWORD  flags,
HANDLE  event 
)
static

Definition at line 2196 of file ddraw.c.

2197 {
2198  struct ddraw *ddraw = impl_from_IDirectDraw2(iface);
2199 
2200  TRACE("iface %p, flags %#x, event %p.\n", iface, flags, event);
2201 
2203 }
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93
#define TRACE(s)
Definition: solgame.cpp:4
GLbitfield flags
Definition: glext.h:7161
struct _cl_event * event
Definition: glext.h:7739
static HRESULT WINAPI ddraw7_WaitForVerticalBlank(IDirectDraw7 *iface, DWORD Flags, HANDLE event)
Definition: ddraw.c:2167
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw4_AddRef()

static ULONG WINAPI ddraw4_AddRef ( IDirectDraw4 *  iface)
static

Definition at line 296 of file ddraw.c.

297 {
298  struct ddraw *This = impl_from_IDirectDraw4(iface);
300 
301  TRACE("%p increasing refcount to %u.\n", This, ref);
302 
303  if (ref == 1) InterlockedIncrement(&This->numIfaces);
304 
305  return ref;
306 }
static struct ddraw * impl_from_IDirectDraw4(IDirectDraw4 *iface)
Definition: ddraw.c:98
Definition: send.c:48
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1

◆ ddraw4_Compact()

static HRESULT WINAPI ddraw4_Compact ( IDirectDraw4 *  iface)
static

Definition at line 1614 of file ddraw.c.

1615 {
1616  struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
1617 
1618  TRACE("iface %p.\n", iface);
1619 
1621 }
static struct ddraw * impl_from_IDirectDraw4(IDirectDraw4 *iface)
Definition: ddraw.c:98
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT WINAPI ddraw7_Compact(IDirectDraw7 *iface)
Definition: ddraw.c:1607
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw4_CreateClipper()

static HRESULT WINAPI ddraw4_CreateClipper ( IDirectDraw4 *  iface,
DWORD  flags,
IDirectDrawClipper **  clipper,
IUnknown outer_unknown 
)
static

Definition at line 3460 of file ddraw.c.

3462 {
3463  struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
3464 
3465  TRACE("iface %p, flags %#x, clipper %p, outer_unknown %p.\n",
3466  iface, flags, clipper, outer_unknown);
3467 
3468  return ddraw7_CreateClipper(&ddraw->IDirectDraw7_iface, flags, clipper, outer_unknown);
3469 }
static HRESULT WINAPI ddraw7_CreateClipper(IDirectDraw7 *iface, DWORD Flags, IDirectDrawClipper **Clipper, IUnknown *UnkOuter)
Definition: ddraw.c:3451
static struct ddraw * impl_from_IDirectDraw4(IDirectDraw4 *iface)
Definition: ddraw.c:98
#define TRACE(s)
Definition: solgame.cpp:4
GLbitfield flags
Definition: glext.h:7161
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw4_CreatePalette()

static HRESULT WINAPI ddraw4_CreatePalette ( IDirectDraw4 *  iface,
DWORD  flags,
PALETTEENTRY entries,
IDirectDrawPalette **  palette,
IUnknown outer_unknown 
)
static

Definition at line 3556 of file ddraw.c.

3558 {
3559  struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
3560  HRESULT hr;
3561 
3562  TRACE("iface %p, flags %#x, entries %p, palette %p, outer_unknown %p.\n",
3563  iface, flags, entries, palette, outer_unknown);
3564 
3565  hr = ddraw7_CreatePalette(&ddraw->IDirectDraw7_iface, flags, entries, palette, outer_unknown);
3566  if (SUCCEEDED(hr) && *palette)
3567  {
3569  IDirectDraw7_Release(&ddraw->IDirectDraw7_iface);
3570  IDirectDraw4_AddRef(iface);
3571  impl->ifaceToRelease = (IUnknown *)iface;
3572  }
3573  return hr;
3574 }
IUnknown * ifaceToRelease
HRESULT hr
Definition: shlfolder.c:183
static struct ddraw * impl_from_IDirectDraw4(IDirectDraw4 *iface)
Definition: ddraw.c:98
if SUCCEEDED(hr)
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
GLbitfield flags
Definition: glext.h:7161
static HPALETTE palette
Definition: clipboard.c:1345
static HRESULT WINAPI ddraw7_CreatePalette(IDirectDraw7 *iface, DWORD Flags, PALETTEENTRY *ColorTable, IDirectDrawPalette **Palette, IUnknown *pUnkOuter)
Definition: ddraw.c:3510
static struct ddraw_palette * impl_from_IDirectDrawPalette(IDirectDrawPalette *iface)
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw4_CreateSurface()

static HRESULT WINAPI ddraw4_CreateSurface ( IDirectDraw4 *  iface,
DDSURFACEDESC2 surface_desc,
IDirectDrawSurface4 **  surface,
IUnknown outer_unknown 
)
static

Definition at line 2892 of file ddraw.c.

2894 {
2895  struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
2896  struct ddraw_surface *impl;
2897  HRESULT hr;
2898 
2899  TRACE("iface %p, surface_desc %p, surface %p, outer_unknown %p.\n",
2900  iface, surface_desc, surface, outer_unknown);
2901 
2903 
2905  {
2906  WARN("Cooperative level not set.\n");
2909  }
2910 
2911  if(surface_desc == NULL || surface_desc->dwSize != sizeof(DDSURFACEDESC2))
2912  {
2913  WARN("Application supplied invalid surface descriptor\n");
2915  return DDERR_INVALIDPARAMS;
2916  }
2917 
2918  __TRY
2919  {
2920  *surface = NULL;
2921  }
2923  {
2924  WARN("Surface pointer %p is invalid.\n", surface);
2926  return DDERR_INVALIDPARAMS;
2927  }
2928  __ENDTRY;
2929 
2931  {
2932  if (TRACE_ON(ddraw))
2933  {
2934  TRACE(" (%p) Requesting surface desc :\n", iface);
2936  }
2937 
2938  WARN("Application tried to create an explicit front or back buffer\n");
2940  return DDERR_INVALIDCAPS;
2941  }
2942 
2943  hr = ddraw_surface_create(ddraw, surface_desc, &impl, outer_unknown, 4);
2945  if (FAILED(hr))
2946  return hr;
2947 
2948  *surface = &impl->IDirectDrawSurface4_iface;
2949  IDirectDraw4_AddRef(iface);
2950  impl->ifaceToRelease = (IUnknown *)iface;
2951 
2952  return hr;
2953 }
HRESULT hr
Definition: shlfolder.c:183
#define WARN(fmt,...)
Definition: debug.h:112
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
static struct ddraw * impl_from_IDirectDraw4(IDirectDraw4 *iface)
Definition: ddraw.c:98
#define DDERR_NOCOOPERATIVELEVELSET
Definition: ddraw.h:89
#define DDSCL_EXCLUSIVE
Definition: ddraw.h:536
HRESULT ddraw_surface_create(struct ddraw *ddraw, const DDSURFACEDESC2 *surface_desc, struct ddraw_surface **surface, IUnknown *outer_unknown, unsigned int version) DECLSPEC_HIDDEN
Definition: surface.c:5791
DDSCAPS2 ddsCaps
Definition: ddraw.h:1188
DWORD dwCaps
Definition: ddraw.h:732
#define DDSCAPS_FRONTBUFFER
Definition: ddraw.h:254
IDirectDrawSurface4 IDirectDrawSurface4_iface
#define __TRY
Definition: compat.h:80
#define TRACE(s)
Definition: solgame.cpp:4
DDSURFACEDESC2 surface_desc
LONG HRESULT
Definition: typedefs.h:79
#define __ENDTRY
Definition: compat.h:82
DWORD dwSize
Definition: ddraw.h:1152
void DDRAW_dump_surface_desc(const DDSURFACEDESC2 *lpddsd) DECLSPEC_HIDDEN
Definition: utils.c:864
#define DDSCAPS_BACKBUFFER
Definition: ddraw.h:251
#define NULL
Definition: types.h:112
#define DDERR_INVALIDCAPS
Definition: ddraw.h:75
#define DDSCL_NORMAL
Definition: ddraw.h:535
DWORD cooperative_level
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define TRACE_ON(x)
Definition: compat.h:75
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79
IUnknown * ifaceToRelease
#define __EXCEPT_PAGE_FAULT
Definition: compat.h:81

◆ ddraw4_DuplicateSurface()

static HRESULT WINAPI ddraw4_DuplicateSurface ( IDirectDraw4 *  iface,
IDirectDrawSurface4 *  src,
IDirectDrawSurface4 **  dst 
)
static

Definition at line 3644 of file ddraw.c.

3646 {
3648  struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
3649  struct ddraw_surface *dst_impl;
3650  IDirectDrawSurface7 *dst7;
3651  HRESULT hr;
3652 
3653  TRACE("iface %p, src %p, dst %p.\n", iface, src, dst);
3654 
3656  src_impl ? &src_impl->IDirectDrawSurface7_iface : NULL, &dst7);
3657  if (FAILED(hr))
3658  {
3659  *dst = NULL;
3660  return hr;
3661  }
3662  dst_impl = impl_from_IDirectDrawSurface7(dst7);
3663  *dst = &dst_impl->IDirectDrawSurface4_iface;
3664  IDirectDrawSurface4_AddRef(*dst);
3665  IDirectDrawSurface7_Release(dst7);
3666 
3667  return hr;
3668 }
HRESULT hr
Definition: shlfolder.c:183
static HRESULT WINAPI ddraw7_DuplicateSurface(IDirectDraw7 *iface, IDirectDrawSurface7 *Src, IDirectDrawSurface7 **Dest)
Definition: ddraw.c:3633
static struct ddraw * impl_from_IDirectDraw4(IDirectDraw4 *iface)
Definition: ddraw.c:98
static struct ddraw_surface * impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface)
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface4(IDirectDrawSurface4 *iface) DECLSPEC_HIDDEN
Definition: surface.c:5657
IDirectDrawSurface4 IDirectDrawSurface4_iface
DWORD IDirectDrawSurface7
Definition: vmrender.idl:20
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:79
GLenum src
Definition: glext.h:6340
IDirectDrawSurface7 IDirectDrawSurface7_iface
GLenum GLenum dst
Definition: glext.h:6340
#define NULL
Definition: types.h:112
IDirectDraw7 IDirectDraw7_iface
Definition: ddraw_private.h:79

◆ ddraw4_EnumDisplayModes()

static HRESULT WINAPI ddraw4_EnumDisplayModes ( IDirectDraw4 *  iface,
DWORD  flags,
DDSURFACEDESC2 surface_desc,
void context,
LPDDENUMMODESCALLBACK2  callback 
)
static

Definition at line 2540 of file ddraw.c.

2542 {
2543  struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
2544 
2545  TRACE("iface %p, flags %#x, surface_desc %p, context %p, callback %p.\n",
2546  iface, flags, surface_desc, context, callback);
2547 
2549 }
Definition: http.c:7251