ReactOS 0.4.15-dev-8241-g63935f8
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 FLAG
Definition: main.h:130
#define NULL
Definition: types.h:112
#define offsetof(TYPE, MEMBER)

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
static ULONG WINAPI ddraw1_AddRef(IDirectDraw *iface)
Definition: ddraw.c:320
#define TRACE(s)
Definition: solgame.cpp:4

◆ 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 HRESULT WINAPI d3d3_CreateLight(IDirect3D3 *iface, IDirect3DLight **light, IUnknown *outer_unknown)
Definition: ddraw.c:3937
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
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}
#define ERR(fmt,...)
Definition: debug.h:113
#define D3D_OK
Definition: d3d.h:106
struct d3d_material * d3d_material_create(struct ddraw *ddraw) DECLSPEC_HIDDEN
Definition: material.c:501
#define DDERR_OUTOFMEMORY
Definition: ddraw.h:111

◆ 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

◆ 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}
static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBACK callback, void *context)
Definition: ddraw.c:3793
static IPrintDialogCallback callback
Definition: printdlg.c:326
Definition: http.c:7252

◆ 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 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
2078}
REFIID riid
Definition: atlbase.h:39
#define debugstr_guid
Definition: kernel32.h:35
#define DDERR_ALREADYINITIALIZED
Definition: ddraw.h:67

◆ 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}
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 ULONG WINAPI ddraw1_Release(IDirectDraw *iface)
Definition: ddraw.c:498

◆ 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

◆ 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}
#define WARN(fmt,...)
Definition: debug.h:115
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
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface(IDirectDrawSurface *iface) DECLSPEC_HIDDEN
Definition: surface.c:5705
#define SUCCEEDED(hr)
Definition: intsafe.h:50
HRESULT hr
Definition: shlfolder.c:183
IDirect3DDevice2 IDirect3DDevice2_iface
Definition: devices.h:37
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368

◆ 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}

◆ 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}

◆ 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}

◆ 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}

◆ 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}

◆ 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}

◆ 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}

◆ 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}
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}
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface4(IDirectDrawSurface4 *iface) DECLSPEC_HIDDEN
Definition: surface.c:5657
IUnknown * outer_unknown
IDirect3DDevice3 IDirect3DDevice3_iface
#define CLASS_E_NOAGGREGATION
Definition: winerror.h:2662

◆ 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}
void d3d_light_init(struct d3d_light *light, struct ddraw *ddraw) DECLSPEC_HIDDEN
Definition: light.c:247

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}

◆ 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
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}
HRESULT d3d_vertex_buffer_create(struct d3d_vertex_buffer **buffer, struct ddraw *ddraw, D3DVERTEXBUFFERDESC *desc) DECLSPEC_HIDDEN
Definition: vertexbuffer.c:432
GLbitfield flags
Definition: glext.h:7161
static const WCHAR desc[]
Definition: protectdata.c:36
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79

◆ 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

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}
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
#define D3DPTEXTURECAPS_NONPOW2CONDITIONAL
Definition: d3d8caps.h:119
#define D3DPTEXTURECAPS_PERSPECTIVE
Definition: d3d8caps.h:113
#define D3DPTEXTURECAPS_POW2
Definition: d3d8caps.h:114
#define D3DENUMRET_OK
Definition: d3dtypes.h:81
HRESULT ddraw_get_d3dcaps(const struct ddraw *ddraw, D3DDEVICEDESC7 *caps)
Definition: ddraw.c:1248
void ddraw_d3dcaps1_from_7(D3DDEVICEDESC *caps1, D3DDEVICEDESC7 *caps7)
Definition: ddraw.c:1192
static const WCHAR device_name[]
Definition: btrfs.c:60
#define FAILED(hr)
Definition: intsafe.h:51
D3DPRIMCAPS dpcTriCaps
Definition: d3dcaps.h:326
DWORD dwFlags
Definition: d3dcaps.h:319
D3DPRIMCAPS dpcLineCaps
Definition: d3dcaps.h:325
D3DCOLORMODEL dcmColorModel
Definition: d3dcaps.h:320
DWORD dwTextureCaps
Definition: d3dcaps.h:272
int d3dversion
char CHAR
Definition: xmlstorage.h:175

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}
static HRESULT WINAPI d3d7_EnumZBufferFormats(IDirect3D7 *iface, REFCLSID device_iid, LPD3DENUMPIXELFORMATSCALLBACK callback, void *context)
Definition: ddraw.c:4416
IDirect3D7 IDirect3D7_iface
Definition: ddraw_private.h:83

◆ 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}
static HRESULT WINAPI d3d7_EvictManagedTextures(IDirect3D7 *iface)
Definition: ddraw.c:4553

◆ 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)));
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);
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}
#define D3DFDS_COLORMODEL
Definition: d3dcaps.h:126
#define D3DFDS_GUID
Definition: d3dcaps.h:127
#define D3DCOLOR_RGB
Definition: d3dtypes.h:627
const GUID IID_D3DDEVICE_WineD3D
Definition: device.c:39
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define DDERR_NOTFOUND
Definition: ddraw.h:97
D3DDEVICEDESC1 ddSwDesc
Definition: d3dcaps.h:408
D3DDEVICEDESC1 ddHwDesc
Definition: d3dcaps.h:407
D3DDEVICEDESC2 ddSwDesc
Definition: d3dcaps.h:415
D3DDEVICEDESC2 ddHwDesc
Definition: d3dcaps.h:414
D3DDEVICEDESC ddSwDesc
Definition: d3dcaps.h:423
D3DDEVICEDESC ddHwDesc
Definition: d3dcaps.h:422
D3DCOLORMODEL dcmColorModel
Definition: d3dcaps.h:398

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}

◆ 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}

◆ 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}
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}
struct ddraw_surface * unsafe_impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface) DECLSPEC_HIDDEN
Definition: surface.c:5641
GLenum target
Definition: glext.h:7315

◆ 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
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}

◆ 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}
#define ARRAY_SIZE(A)
Definition: main.h:33
static struct enum_device_entry device_list7[]
unsigned long DWORD
Definition: ntddk_ex.h:95
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 DDENUMRET_OK
Definition: ddraw.h:189
GUID deviceGUID
Definition: d3dcaps.h:382
DWORD dwDevCaps
Definition: d3dcaps.h:358
int ret

◆ 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);
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}
#define FIXME(fmt,...)
Definition: debug.h:114
void ddrawformat_from_wined3dformat(DDPIXELFORMAT *ddraw_format, enum wined3d_format_id wined3d_format) DECLSPEC_HIDDEN
Definition: utils.c:33
static const struct pixel_format_desc formats[]
Definition: util.c:59
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLenum mode
Definition: glext.h:6217
#define DDPF_ZBUFFER
Definition: ddraw.h:511
#define memset(x, y, z)
Definition: compat.h:39
DWORD dwSize
Definition: ddraw.h:1070
struct wined3d * wined3d
Definition: ddraw_private.h:92
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
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
#define WINED3DADAPTER_DEFAULT
Definition: wined3d.h:857
@ WINED3D_RTYPE_TEXTURE_2D
Definition: wined3d.h:700
wined3d_format_id
Definition: wined3d.h:106
@ WINED3DFMT_X8D24_UNORM
Definition: wined3d.h:130
@ WINED3DFMT_S1_UINT_D15_UNORM
Definition: wined3d.h:129
@ WINED3DFMT_D16_UNORM
Definition: wined3d.h:191
@ WINED3DFMT_D32_UNORM
Definition: wined3d.h:128
@ WINED3DFMT_S4X4_UINT_D24_UNORM
Definition: wined3d.h:131
@ WINED3DFMT_D24_UNORM_S8_UINT
Definition: wined3d.h:181
wined3d_device_type
Definition: wined3d.h:86
@ WINED3D_DEVICE_TYPE_NULLREF
Definition: wined3d.h:90
@ WINED3D_DEVICE_TYPE_SW
Definition: wined3d.h:89
@ WINED3D_DEVICE_TYPE_HAL
Definition: wined3d.h:87
@ WINED3D_DEVICE_TYPE_REF
Definition: wined3d.h:88
#define WINED3DUSAGE_DEPTHSTENCIL
Definition: wined3d.h:900

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}
#define DDRAW_D3D_INITIALIZED
Definition: ddraw_private.h:55
void CDECL wined3d_device_evict_managed_resources(struct wined3d_device *device)
Definition: device.c:4753
DWORD flags
Definition: ddraw_private.h:94
struct wined3d_device * wined3d_device
Definition: ddraw_private.h:93

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}

◆ 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

◆ 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}
#define InterlockedIncrement
Definition: armddk.h:53
static struct ddraw * impl_from_IDirectDraw(IDirectDraw *iface)
Definition: ddraw.c:88
Definition: send.c:48
uint32_t ULONG
Definition: typedefs.h:59

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}
static HRESULT WINAPI ddraw7_Compact(IDirectDraw7 *iface)
Definition: ddraw.c:1607

◆ 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

◆ 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}
static struct ddraw_palette * impl_from_IDirectDrawPalette(IDirectDrawPalette *iface)
static HRESULT WINAPI ddraw7_CreatePalette(IDirectDraw7 *iface, DWORD Flags, PALETTEENTRY *ColorTable, IDirectDrawPalette **Palette, IUnknown *pUnkOuter)
Definition: ddraw.c:3510
static HPALETTE palette
Definition: clipboard.c:1345
IUnknown * ifaceToRelease

◆ 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 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
#define __TRY
Definition: compat.h:80
#define __ENDTRY
Definition: compat.h:82
#define __EXCEPT_PAGE_FAULT
Definition: compat.h:81
#define DDSCAPS_FRONTBUFFER
Definition: ddraw.h:254
#define DDSCL_NORMAL
Definition: ddraw.h:535
#define DDSCAPS_PRIMARYSURFACE
Definition: ddraw.h:258
#define DDERR_INVALIDCAPS
Definition: ddraw.h:75
#define DDSCL_EXCLUSIVE
Definition: ddraw.h:536
#define DDERR_NOCOOPERATIVELEVELSET
Definition: ddraw.h:89
#define DDSCAPS_FLIP
Definition: ddraw.h:253
#define DDSCAPS_BACKBUFFER
Definition: ddraw.h:251
DWORD dwCaps
Definition: ddraw.h:732
DDSCAPS2 ddsCaps
Definition: ddraw.h:1188
DWORD dwSize
Definition: ddraw.h:1152
IDirectDrawSurface IDirectDrawSurface_iface
DDSURFACEDESC2 surface_desc
IUnknown * ifaceToRelease
DWORD cooperative_level

◆ 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}
static struct ddraw_surface * impl_from_IDirectDrawSurface7(IDirectDrawSurface7 *iface)
static HRESULT WINAPI ddraw7_DuplicateSurface(IDirectDraw7 *iface, IDirectDrawSurface7 *Src, IDirectDrawSurface7 **Dest)
Definition: ddraw.c:3633
GLenum src
Definition: glext.h:6340
GLenum GLenum dst
Definition: glext.h:6340
DWORD IDirectDrawSurface7
Definition: vmrender.idl:20
IDirectDrawSurface7 IDirectDrawSurface7_iface

◆ 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}
static HRESULT CALLBACK EnumDisplayModesCallbackThunk(DDSURFACEDESC2 *surface_desc, void *context)
Definition: ddraw.c:2394
static HRESULT WINAPI ddraw7_EnumDisplayModes(IDirectDraw7 *iface, DWORD Flags, DDSURFACEDESC2 *DDSD, void *Context, LPDDENUMMODESCALLBACK2 cb)
Definition: ddraw.c:2421

◆ 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}
static HRESULT WINAPI ddraw7_EnumSurfaces(IDirectDraw7 *iface, DWORD Flags, DDSURFACEDESC2 *DDSD, void *Context, LPDDENUMSURFACESCALLBACK7 Callback)
Definition: ddraw.c:3243
static HRESULT CALLBACK EnumSurfacesCallbackThunk(IDirectDrawSurface7 *surface, DDSURFACEDESC2 *surface_desc, void *context)
Definition: ddraw.c:3211

◆ 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

◆ 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}
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}
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

◆ 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}
static HRESULT WINAPI ddraw7_GetGDISurface(IDirectDraw7 *iface, IDirectDrawSurface7 **GDISurface)
Definition: ddraw.c:2298

◆ 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}
static HRESULT WINAPI ddraw7_GetMonitorFrequency(IDirectDraw7 *iface, DWORD *frequency)
Definition: ddraw.c:1816
static LARGE_INTEGER * frequency
Definition: time.c:106

◆ 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}
static HRESULT WINAPI ddraw7_GetScanLine(IDirectDraw7 *iface, DWORD *Scanline)
Definition: ddraw.c:2214
Definition: parser.c:49

◆ 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
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

◆ 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}

◆ 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}
#define InterlockedDecrement
Definition: armddk.h:52
static void ddraw_destroy(struct ddraw *This)
Definition: ddraw.c:423

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}
static HRESULT WINAPI ddraw7_RestoreDisplayMode(IDirectDraw7 *iface)
Definition: ddraw.c:678

◆ 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}
#define DDRAW_SCL_DDRAW1
Definition: ddraw_private.h:58
#define FALSE
Definition: types.h:117
static HRESULT ddraw_set_cooperative_level(struct ddraw *ddraw, HWND window, DWORD cooplevel, BOOL restore_mode_on_normal)
Definition: ddraw.c:778
static IHTMLWindow2 * window
Definition: events.c:77

◆ 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}
DWORD bpp
Definition: surface.c:185
static HRESULT WINAPI ddraw7_SetDisplayMode(IDirectDraw7 *iface, DWORD width, DWORD height, DWORD bpp, DWORD refresh_rate, DWORD flags)
Definition: ddraw.c:1084
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546

◆ 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}
static HRESULT WINAPI ddraw7_WaitForVerticalBlank(IDirectDraw7 *iface, DWORD Flags, HANDLE event)
Definition: ddraw.c:2167
struct _cl_event * event
Definition: glext.h:7739

◆ 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}
static struct ddraw * impl_from_IDirectDraw2(IDirectDraw2 *iface)
Definition: ddraw.c:93

◆ 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}

◆ 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}

◆ 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}

◆ 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 DDRAW_dump_surface_desc(const DDSURFACEDESC2 *lpddsd) DECLSPEC_HIDDEN
Definition: utils.c:864
#define TRACE_ON(x)
Definition: compat.h:75

◆ 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}

◆ 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}

◆ 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}

◆ 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}

◆ 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}
void DDRAW_Convert_DDSCAPS_1_To_2(const DDSCAPS *pIn, DDSCAPS2 *pOut) DECLSPEC_HIDDEN
Definition: utils.c:951
#define free
Definition: debug_ros.c:5
static HRESULT WINAPI ddraw7_GetAvailableVidMem(IDirectDraw7 *iface, DDSCAPS2 *caps, DWORD *total, DWORD *free)
Definition: ddraw.c:1932
size_t total

◆ 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}

◆ 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}

◆ 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}

◆ 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}

◆ 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}

◆ 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}

◆ 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}

◆ 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}

◆ 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}

◆ 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}

◆ 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}

◆ 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}

◆ 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
1181}

◆ 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}

◆ 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

◆ 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}

◆ 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}

◆ 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}

◆ 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}
IDirectDrawSurface4 IDirectDrawSurface4_iface

◆ 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}

◆ 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}

◆ ddraw4_EnumSurfaces()

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

Definition at line 3343 of file ddraw.c.

3345{
3346 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
3347 struct surfacescallback2_context cbcontext;
3348
3349 TRACE("iface %p, flags %#x, surface_desc %p, context %p, callback %p.\n",
3350 iface, flags, surface_desc, context, callback);
3351
3352 cbcontext.func = callback;
3353 cbcontext.context = context;
3354
3355 return ddraw7_EnumSurfaces(&ddraw->IDirectDraw7_iface, flags, surface_desc,
3356 &cbcontext, EnumSurfacesCallback2Thunk);
3357}
static HRESULT CALLBACK EnumSurfacesCallback2Thunk(IDirectDrawSurface7 *surface, DDSURFACEDESC2 *surface_desc, void *context)
Definition: ddraw.c:3198

◆ ddraw4_FlipToGDISurface()

static HRESULT WINAPI ddraw4_FlipToGDISurface ( IDirectDraw4 *  iface)
static

Definition at line 2123 of file ddraw.c.

2124{
2125 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
2126
2127 TRACE("iface %p.\n", iface);
2128
2130}

◆ ddraw4_GetAvailableVidMem()

static HRESULT WINAPI ddraw4_GetAvailableVidMem ( IDirectDraw4 *  iface,
DDSCAPS2 caps,
DWORD total,
DWORD free 
)
static

Definition at line 1992 of file ddraw.c.

1994{
1995 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
1996
1997 TRACE("iface %p, caps %p, total %p, free %p.\n", iface, caps, total, free);
1998
2000}

◆ ddraw4_GetCaps()

static HRESULT WINAPI ddraw4_GetCaps ( IDirectDraw4 *  iface,
DDCAPS driver_caps,
DDCAPS hel_caps 
)
static

Definition at line 1571 of file ddraw.c.

1572{
1573 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
1574
1575 TRACE("iface %p, driver_caps %p, hel_caps %p.\n", iface, driver_caps, hel_caps);
1576
1577 return ddraw7_GetCaps(&ddraw->IDirectDraw7_iface, driver_caps, hel_caps);
1578}

◆ ddraw4_GetDeviceIdentifier()

static HRESULT WINAPI ddraw4_GetDeviceIdentifier ( IDirectDraw4 *  iface,
DDDEVICEIDENTIFIER identifier,
DWORD  flags 
)
static

Definition at line 2673 of file ddraw.c.

2675{
2676 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
2677 DDDEVICEIDENTIFIER2 identifier2;
2678 HRESULT hr;
2679
2680 TRACE("iface %p, identifier %p, flags %#x.\n", iface, identifier, flags);
2681
2683 DDRAW_Convert_DDDEVICEIDENTIFIER_2_To_1(&identifier2, identifier);
2684
2685 return hr;
2686}
void DDRAW_Convert_DDDEVICEIDENTIFIER_2_To_1(const DDDEVICEIDENTIFIER2 *pIn, DDDEVICEIDENTIFIER *pOut) DECLSPEC_HIDDEN
Definition: utils.c:961
static HRESULT WINAPI ddraw7_GetDeviceIdentifier(IDirectDraw7 *iface, DDDEVICEIDENTIFIER2 *DDDI, DWORD Flags)
Definition: ddraw.c:2627

◆ ddraw4_GetDisplayMode()

static HRESULT WINAPI ddraw4_GetDisplayMode ( IDirectDraw4 *  iface,
DDSURFACEDESC2 surface_desc 
)
static

Definition at line 1698 of file ddraw.c.

1699{
1700 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
1701
1702 TRACE("iface %p, surface_desc %p.\n", iface, surface_desc);
1703
1704 return ddraw7_GetDisplayMode(&ddraw->IDirectDraw7_iface, surface_desc);
1705}

◆ ddraw4_GetFourCCCodes()

static HRESULT WINAPI ddraw4_GetFourCCCodes ( IDirectDraw4 *  iface,
DWORD codes_count,
DWORD codes 
)
static

Definition at line 1789 of file ddraw.c.

1790{
1791 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
1792
1793 TRACE("iface %p, codes_count %p, codes %p.\n", iface, codes_count, codes);
1794
1795 return ddraw7_GetFourCCCodes(&ddraw->IDirectDraw7_iface, codes_count, codes);
1796}

◆ ddraw4_GetGDISurface()

static HRESULT WINAPI ddraw4_GetGDISurface ( IDirectDraw4 *  iface,
IDirectDrawSurface4 **  surface 
)
static

Definition at line 2319 of file ddraw.c.

2320{
2321 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
2322 struct ddraw_surface *surface_impl;
2323 IDirectDrawSurface7 *surface7;
2324 HRESULT hr;
2325
2326 TRACE("iface %p, surface %p.\n", iface, surface);
2327
2329 if (FAILED(hr))
2330 {
2331 *surface = NULL;
2332 return hr;
2333 }
2334 surface_impl = impl_from_IDirectDrawSurface7(surface7);
2335 *surface = &surface_impl->IDirectDrawSurface4_iface;
2336 IDirectDrawSurface4_AddRef(*surface);
2337 IDirectDrawSurface7_Release(surface7);
2338
2339 return hr;
2340}

◆ ddraw4_GetMonitorFrequency()

static HRESULT WINAPI ddraw4_GetMonitorFrequency ( IDirectDraw4 *  iface,
DWORD frequency 
)
static

Definition at line 1838 of file ddraw.c.

1839{
1840 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
1841
1842 TRACE("iface %p, frequency %p.\n", iface, frequency);
1843
1845}

◆ ddraw4_GetScanLine()

static HRESULT WINAPI ddraw4_GetScanLine ( IDirectDraw4 *  iface,
DWORD line 
)
static

Definition at line 2239 of file ddraw.c.

2240{
2241 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
2242
2243 TRACE("iface %p, line %p.\n", iface, line);
2244
2246}

◆ ddraw4_GetSurfaceFromDC()

static HRESULT WINAPI ddraw4_GetSurfaceFromDC ( IDirectDraw4 *  iface,
HDC  dc,
IDirectDrawSurface4 **  surface 
)
static

Definition at line 2736 of file ddraw.c.

2738{
2739 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
2740 struct ddraw_surface *surface_impl;
2741 IDirectDrawSurface7 *surface7;
2742 HRESULT hr;
2743
2744 TRACE("iface %p, dc %p, surface %p.\n", iface, dc, surface);
2745
2746 if (!surface) return E_INVALIDARG;
2747
2749 if (FAILED(hr))
2750 {
2751 *surface = NULL;
2752 return hr;
2753 }
2754 surface_impl = impl_from_IDirectDrawSurface7(surface7);
2755 /* Tests say this is true */
2756 *surface = (IDirectDrawSurface4 *)&surface_impl->IDirectDrawSurface_iface;
2757 IDirectDrawSurface_AddRef(&surface_impl->IDirectDrawSurface_iface);
2758 IDirectDrawSurface7_Release(surface7);
2759
2760 return hr;
2761}
#define E_INVALIDARG
Definition: ddrawi.h:101
static HRESULT WINAPI ddraw7_GetSurfaceFromDC(IDirectDraw7 *iface, HDC dc, IDirectDrawSurface7 **surface)
Definition: ddraw.c:2702
static const WCHAR dc[]

◆ ddraw4_GetVerticalBlankStatus()

static HRESULT WINAPI ddraw4_GetVerticalBlankStatus ( IDirectDraw4 *  iface,
BOOL status 
)
static

Definition at line 1890 of file ddraw.c.

1891{
1892 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
1893
1894 TRACE("iface %p, status %p.\n", iface, status);
1895
1897}

◆ ddraw4_Initialize()

static HRESULT WINAPI ddraw4_Initialize ( IDirectDraw4 *  iface,
GUID guid 
)
static

Definition at line 2046 of file ddraw.c.

2047{
2048 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
2049
2050 TRACE("iface %p, guid %s.\n", iface, debugstr_guid(guid));
2051
2053}

◆ ddraw4_QueryInterface()

static HRESULT WINAPI ddraw4_QueryInterface ( IDirectDraw4 *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 203 of file ddraw.c.

204{
205 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
206
207 TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
208
210}

◆ ddraw4_Release()

static ULONG WINAPI ddraw4_Release ( IDirectDraw4 *  iface)
static

Definition at line 472 of file ddraw.c.

473{
474 struct ddraw *This = impl_from_IDirectDraw4(iface);
476
477 TRACE("%p decreasing refcount to %u.\n", This, ref);
478
479 if (!ref && !InterlockedDecrement(&This->numIfaces))
481
482 return ref;
483}

◆ ddraw4_RestoreAllSurfaces()

static HRESULT WINAPI ddraw4_RestoreAllSurfaces ( IDirectDraw4 *  iface)
static

Definition at line 2779 of file ddraw.c.

2780{
2781 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
2782
2783 TRACE("iface %p.\n", iface);
2784
2786}
static HRESULT WINAPI ddraw7_RestoreAllSurfaces(IDirectDraw7 *iface)
Definition: ddraw.c:2771

◆ ddraw4_RestoreDisplayMode()

static HRESULT WINAPI ddraw4_RestoreDisplayMode ( IDirectDraw4 *  iface)
static

Definition at line 709 of file ddraw.c.

710{
711 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
712
713 TRACE("iface %p.\n", iface);
714
716}

◆ ddraw4_SetCooperativeLevel()

static HRESULT WINAPI ddraw4_SetCooperativeLevel ( IDirectDraw4 *  iface,
HWND  window,
DWORD  flags 
)
static

Definition at line 1031 of file ddraw.c.

1032{
1033 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
1034
1035 TRACE("iface %p, window %p, flags %#x.\n", iface, window, flags);
1036
1038}

◆ ddraw4_SetDisplayMode()

static HRESULT WINAPI ddraw4_SetDisplayMode ( IDirectDraw4 *  iface,
DWORD  width,
DWORD  height,
DWORD  bpp,
DWORD  refresh_rate,
DWORD  flags 
)
static

Definition at line 1161 of file ddraw.c.

1163{
1164 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
1165
1166 TRACE("iface %p, width %u, height %u, bpp %u, refresh_rate %u, flags %#x.\n",
1167 iface, width, height, bpp, refresh_rate, flags);
1168
1170}

◆ ddraw4_TestCooperativeLevel()

static HRESULT WINAPI ddraw4_TestCooperativeLevel ( IDirectDraw4 *  iface)
static

Definition at line 2275 of file ddraw.c.

2276{
2277 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
2278
2279 TRACE("iface %p.\n", iface);
2280
2282}
static HRESULT WINAPI ddraw7_TestCooperativeLevel(IDirectDraw7 *iface)
Definition: ddraw.c:2266

◆ ddraw4_WaitForVerticalBlank()

static HRESULT WINAPI ddraw4_WaitForVerticalBlank ( IDirectDraw4 *  iface,
DWORD  flags,
HANDLE  event 
)
static

Definition at line 2187 of file ddraw.c.

2188{
2189 struct ddraw *ddraw = impl_from_IDirectDraw4(iface);
2190
2191 TRACE("iface %p, flags %#x, event %p.\n", iface, flags, event);
2192
2194}

◆ ddraw7_AddRef()

static ULONG WINAPI ddraw7_AddRef ( IDirectDraw7 iface)
static

Definition at line 284 of file ddraw.c.

285{
286 struct ddraw *This = impl_from_IDirectDraw7(iface);
288
289 TRACE("%p increasing refcount to %u.\n", This, ref);
290
291 if(ref == 1) InterlockedIncrement(&This->numIfaces);
292
293 return ref;
294}
static struct ddraw * impl_from_IDirectDraw7(IDirectDraw7 *iface)
Definition: ddraw.c:103

Referenced by d3d7_AddRef().

◆ ddraw7_Compact()

static HRESULT WINAPI ddraw7_Compact ( IDirectDraw7 iface)
static

Definition at line 1607 of file ddraw.c.

1608{
1609 TRACE("iface %p.\n", iface);
1610
1611 return DD_OK;
1612}
#define DD_OK
Definition: ddraw.h:186

Referenced by ddraw1_Compact(), ddraw2_Compact(), and ddraw4_Compact().

◆ ddraw7_CreateClipper()

static HRESULT WINAPI ddraw7_CreateClipper ( IDirectDraw7 iface,
DWORD  Flags,
IDirectDrawClipper **  Clipper,
IUnknown UnkOuter 
)
static

Definition at line 3451 of file ddraw.c.

3453{
3454 TRACE("iface %p, flags %#x, clipper %p, outer_unknown %p.\n",
3455 iface, Flags, Clipper, UnkOuter);
3456
3457 return DirectDrawCreateClipper(Flags, Clipper, UnkOuter);
3458}
HRESULT WINAPI DirectDrawCreateClipper(DWORD flags, IDirectDrawClipper **clipper, IUnknown *outer_unknown)
Definition: ddraw.c:3410
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170

Referenced by ddraw1_CreateClipper(), ddraw2_CreateClipper(), and ddraw4_CreateClipper().

◆ ddraw7_CreatePalette()

static HRESULT WINAPI ddraw7_CreatePalette ( IDirectDraw7 iface,
DWORD  Flags,
PALETTEENTRY ColorTable,
IDirectDrawPalette **  Palette,
IUnknown pUnkOuter 
)
static

Definition at line 3510 of file ddraw.c.

3512{
3513 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
3514 struct ddraw_palette *object;
3515 HRESULT hr;
3516
3517 TRACE("iface %p, flags %#x, color_table %p, palette %p, outer_unknown %p.\n",
3518 iface, Flags, ColorTable, Palette, pUnkOuter);
3519
3520 if (pUnkOuter)
3521 return CLASS_E_NOAGGREGATION;
3522
3524
3525 /* The refcount test shows that a cooplevel is required for this */
3527 {
3528 WARN("No cooperative level set, returning DDERR_NOCOOPERATIVELEVELSET\n");
3531 }
3532
3533 if (!(object = heap_alloc(sizeof(*object))))
3534 {
3535 ERR("Out of memory when allocating memory for a palette implementation\n");
3537 return E_OUTOFMEMORY;
3538 }
3539
3540 hr = ddraw_palette_init(object, ddraw, Flags, ColorTable);
3541 if (FAILED(hr))
3542 {
3543 WARN("Failed to initialize palette, hr %#x.\n", hr);
3544 heap_free(object);
3546 return hr;
3547 }
3548
3549 TRACE("Created palette %p.\n", object);
3550 *Palette = &object->IDirectDrawPalette_iface;
3552
3553 return DD_OK;
3554}
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
HRESULT ddraw_palette_init(struct ddraw_palette *palette, struct ddraw *ddraw, DWORD flags, PALETTEENTRY *entries) DECLSPEC_HIDDEN
Definition: palette.c:258
#define E_OUTOFMEMORY
Definition: ddrawi.h:100

Referenced by ddraw1_CreatePalette(), ddraw2_CreatePalette(), and ddraw4_CreatePalette().

◆ ddraw7_CreateSurface()

static HRESULT WINAPI ddraw7_CreateSurface ( IDirectDraw7 iface,
DDSURFACEDESC2 surface_desc,
IDirectDrawSurface7 **  surface,
IUnknown outer_unknown 
)
static

Definition at line 2829 of file ddraw.c.

2831{
2832 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
2833 struct ddraw_surface *impl;
2834 HRESULT hr;
2835
2836 TRACE("iface %p, surface_desc %p, surface %p, outer_unknown %p.\n",
2837 iface, surface_desc, surface, outer_unknown);
2838
2840
2842 {
2843 WARN("Cooperative level not set.\n");
2846 }
2847
2848 if(surface_desc == NULL || surface_desc->dwSize != sizeof(DDSURFACEDESC2))
2849 {
2850 WARN("Application supplied invalid surface descriptor\n");
2852 return DDERR_INVALIDPARAMS;
2853 }
2854
2855 __TRY
2856 {
2857 *surface = NULL;
2858 }
2860 {
2861 WARN("Surface pointer %p is invalid.\n", surface);
2863 return DDERR_INVALIDPARAMS;
2864 }
2865 __ENDTRY;
2866
2868 {
2869 if (TRACE_ON(ddraw))
2870 {
2871 TRACE(" (%p) Requesting surface desc :\n", iface);
2873 }
2874
2875 WARN("Application tried to create an explicit front or back buffer\n");
2877 return DDERR_INVALIDCAPS;
2878 }
2879
2880 hr = ddraw_surface_create(ddraw, surface_desc, &impl, outer_unknown, 7);
2882 if (FAILED(hr))
2883 return hr;
2884
2885 *surface = &impl->IDirectDrawSurface7_iface;
2886 IDirectDraw7_AddRef(iface);
2887 impl->ifaceToRelease = (IUnknown *)iface;
2888
2889 return hr;
2890}

◆ ddraw7_DuplicateSurface()

static HRESULT WINAPI ddraw7_DuplicateSurface ( IDirectDraw7 iface,
IDirectDrawSurface7 Src,
IDirectDrawSurface7 **  Dest 
)
static

Definition at line 3633 of file ddraw.c.

3635{
3636 struct ddraw_surface *src_surface = unsafe_impl_from_IDirectDrawSurface7(Src);
3637
3638 FIXME("iface %p, src %p, dst %p partial stub!\n", iface, Src, Dest);
3639
3640 /* For now, simply create a new, independent surface */
3641 return IDirectDraw7_CreateSurface(iface, &src_surface->surface_desc, Dest, NULL);
3642}

Referenced by ddraw1_DuplicateSurface(), ddraw2_DuplicateSurface(), and ddraw4_DuplicateSurface().

◆ ddraw7_EnumDisplayModes()

static HRESULT WINAPI ddraw7_EnumDisplayModes ( IDirectDraw7 iface,
DWORD  Flags,
DDSURFACEDESC2 DDSD,
void Context,
LPDDENUMMODESCALLBACK2  cb 
)
static

Definition at line 2421 of file ddraw.c.

2423{
2424 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
2425 struct wined3d_display_mode *enum_modes = NULL;
2427 unsigned int modenum, fmt;
2428 DDSURFACEDESC2 callback_sd;
2429 unsigned enum_mode_count = 0, enum_mode_array_size = 16;
2431
2432 static const enum wined3d_format_id checkFormatList[] =
2433 {
2437 };
2438
2439 TRACE("iface %p, flags %#x, surface_desc %p, context %p, callback %p.\n",
2440 iface, Flags, DDSD, Context, cb);
2441
2442 if (!cb)
2443 return DDERR_INVALIDPARAMS;
2444
2445 if (!(enum_modes = heap_alloc(enum_mode_array_size * sizeof(*enum_modes))))
2446 return DDERR_OUTOFMEMORY;
2447
2449
2450 pixelformat.dwSize = sizeof(pixelformat);
2451 for(fmt = 0; fmt < ARRAY_SIZE(checkFormatList); fmt++)
2452 {
2453 modenum = 0;
2456 {
2457 BOOL found = FALSE;
2458 unsigned i;
2459
2461 if (DDSD)
2462 {
2463 if (DDSD->dwFlags & DDSD_WIDTH && mode.width != DDSD->dwWidth)
2464 continue;
2465 if (DDSD->dwFlags & DDSD_HEIGHT && mode.height != DDSD->dwHeight)
2466 continue;
2467 if (DDSD->dwFlags & DDSD_REFRESHRATE && mode.refresh_rate != DDSD->u2.dwRefreshRate)
2468 continue;
2469 if (DDSD->dwFlags & DDSD_PIXELFORMAT
2470 && pixelformat.u1.dwRGBBitCount != DDSD->u4.ddpfPixelFormat.u1.dwRGBBitCount)
2471 continue;
2472 }
2473
2474 /* DX docs state EnumDisplayMode should return only unique modes */
2475 for (i = 0; i < enum_mode_count; i++)
2476 {
2477 if (enum_modes[i].width == mode.width && enum_modes[i].height == mode.height
2478 && enum_modes[i].format_id == mode.format_id
2479 && (enum_modes[i].refresh_rate == mode.refresh_rate || !(Flags & DDEDM_REFRESHRATES)))
2480 {
2481 found = TRUE;
2482 break;
2483 }
2484 }
2485 if(found) continue;
2486
2487 memset(&callback_sd, 0, sizeof(callback_sd));
2488 callback_sd.dwSize = sizeof(callback_sd);
2489 callback_sd.u4.ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT);
2490
2493 callback_sd.u2.dwRefreshRate = mode.refresh_rate;
2494
2495 callback_sd.dwWidth = mode.width;
2496 callback_sd.dwHeight = mode.height;
2497
2498 callback_sd.u4.ddpfPixelFormat=pixelformat;
2499
2500 /* Calc pitch and DWORD align like MSDN says */
2501 callback_sd.u1.lPitch = (callback_sd.u4.ddpfPixelFormat.u1.dwRGBBitCount / 8) * mode.width;
2502 callback_sd.u1.lPitch = (callback_sd.u1.lPitch + 3) & ~3;
2503
2504 TRACE("Enumerating %dx%dx%d @%d\n", callback_sd.dwWidth, callback_sd.dwHeight, callback_sd.u4.ddpfPixelFormat.u1.dwRGBBitCount,
2505 callback_sd.u2.dwRefreshRate);
2506
2507 if(cb(&callback_sd, Context) == DDENUMRET_CANCEL)
2508 {
2509 TRACE("Application asked to terminate the enumeration\n");
2510 heap_free(enum_modes);
2512 return DD_OK;
2513 }
2514
2515 if (enum_mode_count == enum_mode_array_size)
2516 {
2517 struct wined3d_display_mode *new_enum_modes;
2518
2519 enum_mode_array_size *= 2;
2520 if (!(new_enum_modes = heap_realloc(enum_modes, enum_mode_array_size * sizeof(*new_enum_modes))))
2521 {
2522 heap_free(enum_modes);
2524 return DDERR_OUTOFMEMORY;
2525 }
2526
2527 enum_modes = new_enum_modes;
2528 }
2529 enum_modes[enum_mode_count++] = mode;
2530 }
2531 }
2532
2533 TRACE("End of enumeration\n");
2534 heap_free(enum_modes);
2536
2537 return DD_OK;
2538}
static void * heap_realloc(void *mem, size_t len)
Definition: appwiz.h:71
#define TRUE
Definition: types.h:120
pixelformat
Definition: converter.c:40
unsigned int BOOL
Definition: ntddk_ex.h:94
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
#define DDSD_WIDTH
Definition: ddraw.h:210
#define DDSD_PIXELFORMAT
Definition: ddraw.h:216
#define DDSD_PITCH
Definition: ddraw.h:211
#define DDEDM_REFRESHRATES
Definition: ddraw.h:529
#define DDSD_REFRESHRATE
Definition: ddraw.h:222
#define DDSD_HEIGHT
Definition: ddraw.h:209
struct _DDPIXELFORMAT DDPIXELFORMAT
#define DDENUMRET_CANCEL
Definition: ddraw.h:188
DWORD dwRGBBitCount
Definition: ddraw.h:1075
DWORD dwWidth
Definition: ddraw.h:1155
DWORD dwHeight
Definition: ddraw.h:1154
DWORD dwRefreshRate
Definition: ddraw.h:1169
DDPIXELFORMAT ddpfPixelFormat
Definition: ddraw.h:1185
DWORD dwFlags
Definition: ddraw.h:1153
Definition: dsound.c:943
HRESULT CDECL wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_format_id format_id, enum wined3d_scanline_ordering scanline_ordering, UINT mode_idx, struct wined3d_display_mode *mode)
Definition: directx.c:4589
#define WINED3D_OK
Definition: wined3d.h:37
@ WINED3DFMT_B8G8R8X8_UNORM
Definition: wined3d.h:224
@ WINED3DFMT_B5G6R5_UNORM
Definition: wined3d.h:221
@ WINED3DFMT_P8_UINT
Definition: wined3d.h:117
@ WINED3D_SCANLINE_ORDERING_UNKNOWN
Definition: wined3d.h:832

Referenced by ddraw1_EnumDisplayModes(), ddraw2_EnumDisplayModes(), and ddraw4_EnumDisplayModes().

◆ ddraw7_EnumSurfaces()

static HRESULT WINAPI ddraw7_EnumSurfaces ( IDirectDraw7 iface,
DWORD  Flags,
DDSURFACEDESC2 DDSD,
void Context,
LPDDENUMSURFACESCALLBACK7  Callback 
)
static

Definition at line 3243 of file ddraw.c.

3245{
3246 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
3247 struct ddraw_surface *surf;
3249
3250 TRACE("iface %p, flags %#x, surface_desc %p, context %p, callback %p.\n",
3251 iface, Flags, DDSD, Context, Callback);
3252
3253 if (!Callback)
3254 return DDERR_INVALIDPARAMS;
3255
3257 {
3258 IDirectDrawSurface7 *surface;
3259 DDSURFACEDESC2 testdesc;
3260 HRESULT hr;
3261
3262 if (match_flags != DDENUMSURFACES_MATCH)
3263 return DDERR_INVALIDPARAMS;
3264
3265 if (!DDSD)
3266 return DDERR_INVALIDPARAMS;
3267
3268 memcpy(&testdesc, DDSD, sizeof(testdesc));
3269 if (!(testdesc.dwFlags & DDSD_WIDTH))
3270 {
3271 testdesc.dwFlags |= DDSD_WIDTH;
3272 testdesc.dwWidth = 512;
3273 }
3274 if (!(testdesc.dwFlags & DDSD_HEIGHT))
3275 {
3276 testdesc.dwFlags |= DDSD_HEIGHT;
3277 testdesc.dwHeight = 512;
3278 }
3279
3280 hr = IDirectDraw7_CreateSurface(iface, &testdesc, &surface, NULL);
3281 if (SUCCEEDED(hr))
3282 {
3285 IDirectDrawSurface7_Release(surface);
3286 }
3287 else
3288 ERR("Failed to create surface, hr %#x.\n", hr);
3289 }
3291 {
3292 BOOL all, nomatch;
3294 struct list *entry, *entry2;
3295
3296 /* a combination of match flags is not allowed */
3297 if (match_flags != 0 &&
3298 match_flags != DDENUMSURFACES_ALL &&
3299 match_flags != DDENUMSURFACES_MATCH &&
3300 match_flags != DDENUMSURFACES_NOMATCH)
3301 return DDERR_INVALIDPARAMS;
3302
3303 all = (Flags & DDENUMSURFACES_ALL) != 0;
3304 nomatch = (Flags & DDENUMSURFACES_NOMATCH) != 0;
3305
3306 if (!all && !DDSD)
3307 return DDERR_INVALIDPARAMS;
3308
3310
3311 /* Use the _SAFE enumeration, the app may destroy enumerated surfaces */
3313 {
3314 surf = LIST_ENTRY(entry, struct ddraw_surface, surface_list_entry);
3315
3316 if (!surf->iface_count)
3317 {
3318 WARN("Not enumerating surface %p because it doesn't have any references.\n", surf);
3319 continue;
3320 }
3321
3322 if (all || (nomatch != ddraw_match_surface_desc(DDSD, &surf->surface_desc)))
3323 {
3324 TRACE("Enumerating surface %p.\n", surf);
3325 desc = surf->surface_desc;
3326 IDirectDrawSurface7_AddRef(&surf->IDirectDrawSurface7_iface);
3328 {
3330 return DD_OK;
3331 }
3332 }
3333 }
3334
3336 }
3337 else
3338 return DDERR_INVALIDPARAMS;
3339
3340 return DD_OK;
3341}
Definition: list.h:37
static BOOL ddraw_match_surface_desc(const DDSURFACEDESC2 *requested, const DDSURFACEDESC2 *provided)
Definition: ddraw.c:3126
uint32_t entry
Definition: isohybrid.c:63
#define DDENUMSURFACES_CANBECREATED
Definition: ddraw.h:524
#define DDENUMSURFACES_ALL
Definition: ddraw.h:521
#define DDENUMSURFACES_NOMATCH
Definition: ddraw.h:523
#define DDENUMSURFACES_MATCH
Definition: ddraw.h:522
#define DDENUMSURFACES_DOESEXIST
Definition: ddraw.h:525
#define LIST_FOR_EACH_SAFE(cursor, cursor2, list)
Definition: list.h:192
struct list surface_list
#define LIST_ENTRY(type)
Definition: queue.h:175
_In_ WDFINTERRUPT _In_ PFN_WDF_INTERRUPT_SYNCHRONIZE Callback
Definition: wdfinterrupt.h:458

Referenced by ddraw1_EnumSurfaces(), ddraw2_EnumSurfaces(), and ddraw4_EnumSurfaces().

◆ ddraw7_EvaluateMode()

static HRESULT WINAPI ddraw7_EvaluateMode ( IDirectDraw7 iface,
DWORD  Flags,
DWORD Timeout 
)
static

Definition at line 2603 of file ddraw.c.

2604{
2605 FIXME("iface %p, flags %#x, timeout %p stub!\n", iface, Flags, Timeout);
2606
2607 /* When implementing this, implement it in WineD3D */
2608
2609 return DD_OK;
2610}
static ULONG Timeout
Definition: ping.c:61

◆ ddraw7_FlipToGDISurface()

static HRESULT WINAPI ddraw7_FlipToGDISurface ( IDirectDraw7 iface)
static

Definition at line 2093 of file ddraw.c.

2094{
2095 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
2096 IDirectDrawSurface7 *gdi_surface;
2097 struct ddraw_surface *gdi_impl;
2098 HRESULT hr;
2099
2100 TRACE("iface %p.\n", iface);
2101
2103
2104 if (FAILED(hr = IDirectDraw7_GetGDISurface(iface, &gdi_surface)))
2105 {
2106 WARN("Failed to retrieve GDI surface, hr %#x.\n", hr);
2108 return hr;
2109 }
2110
2111 gdi_impl = impl_from_IDirectDrawSurface7(gdi_surface);
2113 hr = DD_OK;
2114 else
2115 hr = IDirectDrawSurface7_Flip(&ddraw->primary->IDirectDrawSurface7_iface, gdi_surface, DDFLIP_WAIT);
2116 IDirectDrawSurface7_Release(gdi_surface);
2117
2119
2120 return hr;
2121}
#define DDFLIP_WAIT
Definition: ddraw.h:583
struct ddraw_surface * primary
Definition: ddraw_private.h:97

Referenced by ddraw1_FlipToGDISurface(), ddraw2_FlipToGDISurface(), and ddraw4_FlipToGDISurface().

◆ ddraw7_GetAvailableVidMem()

static HRESULT WINAPI ddraw7_GetAvailableVidMem ( IDirectDraw7 iface,
DDSCAPS2 caps,
DWORD total,
DWORD free 
)
static

Definition at line 1932 of file ddraw.c.

1934{
1935 unsigned int framebuffer_size, total_vidmem, free_vidmem;
1936 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
1938 HRESULT hr = DD_OK;
1939
1940 TRACE("iface %p, caps %p, total %p, free %p.\n", iface, caps, total, free);
1941
1942 if (!total && !free)
1943 return DDERR_INVALIDPARAMS;
1944
1945 if (TRACE_ON(ddraw))
1946 {
1947 TRACE("Asked for memory with description: ");
1948 DDRAW_dump_DDSCAPS2(caps);
1949 }
1951
1952 /* Todo: System memory vs local video memory vs non-local video memory
1953 * The MSDN also mentions differences between texture memory and other
1954 * resources, but that's not important
1955 */
1956
1957 /* Some applications (e.g. 3DMark 2000) assume that the reported amount of
1958 * video memory doesn't include the memory used by the default framebuffer.
1959 */
1961 {
1962 WARN("Failed to get display mode, hr %#x.\n", hr);
1964 return hr;
1965 }
1967 mode.format_id, mode.width);
1968 framebuffer_size *= mode.height;
1969
1970 if (free)
1971 {
1973 *free = framebuffer_size > free_vidmem ? 0 : free_vidmem - framebuffer_size;
1974 TRACE("Free video memory %#x.\n", *free);
1975 }
1976
1977 if (total)
1978 {
1979 struct wined3d_adapter_identifier desc = {0};
1980
1982 total_vidmem = min(UINT_MAX, desc.video_memory);
1983 *total = framebuffer_size > total_vidmem ? 0 : total_vidmem - framebuffer_size;
1984 TRACE("Total video memory %#x.\n", *total);
1985 }
1986
1988
1989 return hr;
1990}
void DDRAW_dump_DDSCAPS2(const DDSCAPS2 *in) DECLSPEC_HIDDEN
Definition: utils.c:713
UINT CDECL wined3d_device_get_available_texture_mem(const struct wined3d_device *device)
Definition: device.c:1298
#define UINT_MAX
Definition: limits.h:41
#define min(a, b)
Definition: monoChain.cc:55
UINT CDECL wined3d_calculate_format_pitch(const struct wined3d *wined3d, UINT adapter_idx, enum wined3d_format_id format_id, UINT width)
Definition: directx.c:5517
HRESULT CDECL wined3d_get_adapter_identifier(const struct wined3d *wined3d, UINT adapter_idx, DWORD flags, struct wined3d_adapter_identifier *identifier)
Definition: directx.c:4939

Referenced by ddraw2_GetAvailableVidMem(), and ddraw4_GetAvailableVidMem().

◆ ddraw7_GetCaps()

static HRESULT WINAPI ddraw7_GetCaps ( IDirectDraw7 iface,
DDCAPS DriverCaps,
DDCAPS HELCaps 
)
static

Definition at line 1479 of file ddraw.c.

1480{
1481 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
1482 DDCAPS caps;
1483 WINED3DCAPS winecaps;
1484 HRESULT hr;
1485 DDSCAPS2 ddscaps = {0, 0, 0, {0}};
1486
1487 TRACE("iface %p, driver_caps %p, hel_caps %p.\n", iface, DriverCaps, HELCaps);
1488
1489 /* One structure must be != NULL */
1490 if (!DriverCaps && !HELCaps)
1491 {
1492 WARN("Invalid parameters.\n");
1493 return DDERR_INVALIDPARAMS;
1494 }
1495
1496 memset(&caps, 0, sizeof(caps));
1497 memset(&winecaps, 0, sizeof(winecaps));
1498 caps.dwSize = sizeof(caps);
1499
1502 if (FAILED(hr))
1503 {
1504 WARN("Failed to get device caps, %#x.\n", hr);
1506 return hr;
1507 }
1508
1509 hr = IDirectDraw7_GetAvailableVidMem(iface, &ddscaps, &caps.dwVidMemTotal, &caps.dwVidMemFree);
1510 if (FAILED(hr))
1511 {
1512 WARN("IDirectDraw7::GetAvailableVidMem failed\n");
1514 return hr;
1515 }
1516
1517 hr = IDirectDraw7_GetFourCCCodes(iface, &caps.dwNumFourCCCodes, NULL);
1519 if (FAILED(hr))
1520 {
1521 WARN("IDirectDraw7::GetFourCCCodes failed\n");
1522 return hr;
1523 }
1524
1525 caps.dwCaps = winecaps.ddraw_caps.caps;
1526 caps.dwCaps2 = winecaps.ddraw_caps.caps2;
1527 caps.dwCKeyCaps = winecaps.ddraw_caps.color_key_caps;
1528 caps.dwFXCaps = winecaps.ddraw_caps.fx_caps;
1529 caps.dwPalCaps = DDPCAPS_8BIT | DDPCAPS_PRIMARYSURFACE;
1530 caps.ddsCaps.dwCaps = winecaps.ddraw_caps.dds_caps;
1531 caps.dwSVBCaps = winecaps.ddraw_caps.svb_caps;
1532 caps.dwSVBCKeyCaps = winecaps.ddraw_caps.svb_color_key_caps;
1533 caps.dwSVBFXCaps = winecaps.ddraw_caps.svb_fx_caps;
1534 caps.dwVSBCaps = winecaps.ddraw_caps.vsb_caps;
1535 caps.dwVSBCKeyCaps = winecaps.ddraw_caps.vsb_color_key_caps;
1536 caps.dwVSBFXCaps = winecaps.ddraw_caps.vsb_fx_caps;
1537 caps.dwSSBCaps = winecaps.ddraw_caps.ssb_caps;
1538 caps.dwSSBCKeyCaps = winecaps.ddraw_caps.ssb_color_key_caps;
1539 caps.dwSSBFXCaps = winecaps.ddraw_caps.ssb_fx_caps;
1540
1541 caps.dwCaps |= DDCAPS_ALIGNSTRIDE;
1542 caps.dwAlignStrideAlign = DDRAW_STRIDE_ALIGNMENT;
1543
1544 caps.ddsOldCaps.dwCaps = caps.ddsCaps.dwCaps;
1545
1546 IDirect3D7_EnumZBufferFormats(&ddraw->IDirect3D7_iface, &IID_IDirect3DHALDevice, enum_zbuffer, &caps);
1547
1548 if(DriverCaps)
1549 {
1550 DD_STRUCT_COPY_BYSIZE(DriverCaps, &caps);
1551 if (TRACE_ON(ddraw))
1552 {
1553 TRACE("Driver Caps :\n");
1554 DDRAW_dump_DDCAPS(DriverCaps);
1555 }
1556
1557 }
1558 if(HELCaps)
1559 {
1560 DD_STRUCT_COPY_BYSIZE(HELCaps, &caps);
1561 if (TRACE_ON(ddraw))
1562 {
1563 TRACE("HEL Caps :\n");
1564 DDRAW_dump_DDCAPS(HELCaps);
1565 }
1566 }
1567
1568 return DD_OK;
1569}
#define IDirect3D7_EnumZBufferFormats(p, a, b, c)
Definition: d3d.h:386
void DDRAW_dump_DDCAPS(const DDCAPS *lpcaps) DECLSPEC_HIDDEN
Definition: utils.c:990
#define DDRAW_STRIDE_ALIGNMENT
Definition: ddraw_private.h:62
#define DD_STRUCT_COPY_BYSIZE(to, from)
HRESULT CALLBACK enum_zbuffer(DDPIXELFORMAT *format, void *ctx)
Definition: ddraw.c:1442
HRESULT CDECL wined3d_device_get_device_caps(const struct wined3d_device *device, WINED3DCAPS *caps)
Definition: device.c:3526
#define DDPCAPS_PRIMARYSURFACE
Definition: ddraw.h:456
#define DDCAPS_ALIGNSTRIDE
Definition: ddraw.h:334
#define DDPCAPS_8BIT
Definition: ddraw.h:455
struct wined3d_ddraw_caps ddraw_caps
Definition: wined3d.h:1973

Referenced by ddraw1_GetCaps(), ddraw2_GetCaps(), and ddraw4_GetCaps().

◆ ddraw7_GetDeviceIdentifier()

static HRESULT WINAPI ddraw7_GetDeviceIdentifier ( IDirectDraw7 iface,
DDDEVICEIDENTIFIER2 DDDI,
DWORD  Flags 
)
static

Definition at line 2627 of file ddraw.c.

2629{
2630 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
2631 struct wined3d_adapter_identifier adapter_id;
2632 HRESULT hr = S_OK;
2633
2634 TRACE("iface %p, device_identifier %p, flags %#x.\n", iface, DDDI, Flags);
2635
2636 if (!DDDI)
2637 return DDERR_INVALIDPARAMS;
2638
2640 {
2641 /* The DDGDI_GETHOSTIDENTIFIER returns the information about the 2D
2642 * host adapter, if there's a secondary 3D adapter. This doesn't apply
2643 * to any modern hardware, nor is it interesting for Wine, so ignore it.
2644 * Size of DDDEVICEIDENTIFIER2 may be aligned to 8 bytes and thus 4
2645 * bytes too long. So only copy the relevant part of the structure
2646 */
2647
2649 return DD_OK;
2650 }
2651
2652 /* Drakan: Order of the Flame expects accurate D3D device information from ddraw */
2653 adapter_id.driver = DDDI->szDriver;
2654 adapter_id.driver_size = sizeof(DDDI->szDriver);
2655 adapter_id.description = DDDI->szDescription;
2656 adapter_id.description_size = sizeof(DDDI->szDescription);
2657 adapter_id.device_name_size = 0;
2661 if (FAILED(hr)) return hr;
2662
2663 DDDI->liDriverVersion = adapter_id.driver_version;
2664 DDDI->dwVendorId = adapter_id.vendor_id;
2665 DDDI->dwDeviceId = adapter_id.device_id;
2666 DDDI->dwSubSysId = adapter_id.subsystem_id;
2667 DDDI->dwRevision = adapter_id.revision;
2668 DDDI->guidDeviceIdentifier = adapter_id.device_identifier;
2669 DDDI->dwWHQLLevel = adapter_id.whql_level;
2670 return DD_OK;
2671}
static const DDDEVICEIDENTIFIER2 deviceidentifier
Definition: ddraw.c:37
static const WCHAR dwWHQLLevel[]
Definition: provider.c:101
#define S_OK
Definition: intsafe.h:52
#define DDGDI_GETHOSTIDENTIFIER
Definition: ddraw.h:202
char szDescription[MAX_DDDEVICEID_STRING]
Definition: ddraw.h:1346
char szDriver[MAX_DDDEVICEID_STRING]
Definition: ddraw.h:1345
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255

Referenced by ddraw4_GetDeviceIdentifier().

◆ ddraw7_GetDisplayMode()

static HRESULT WINAPI ddraw7_GetDisplayMode ( IDirectDraw7 iface,
DDSURFACEDESC2 DDSD 
)
static

Definition at line 1655 of file ddraw.c.

1656{
1657 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
1659 HRESULT hr;
1660
1661 TRACE("iface %p, surface_desc %p.\n", iface, DDSD);
1662
1663 /* This seems sane */
1664 if (!DDSD || (DDSD->dwSize != sizeof(DDSURFACEDESC) && DDSD->dwSize != sizeof(DDSURFACEDESC2)))
1665 return DDERR_INVALIDPARAMS;
1666
1668
1670 {
1671 ERR("Failed to get display mode, hr %#x.\n", hr);
1673 return hr;
1674 }
1675
1676 memset(DDSD, 0, DDSD->dwSize);
1677 DDSD->dwSize = sizeof(*DDSD);
1679 DDSD->dwWidth = mode.width;
1680 DDSD->dwHeight = mode.height;
1681 DDSD->u2.dwRefreshRate = 60;
1682 DDSD->ddsCaps.dwCaps = 0;
1683 DDSD->u4.ddpfPixelFormat.dwSize = sizeof(DDSD->u4.ddpfPixelFormat);
1685 DDSD->u1.lPitch = mode.width * DDSD->u4.ddpfPixelFormat.u1.dwRGBBitCount / 8;
1686
1687 if(TRACE_ON(ddraw))
1688 {
1689 TRACE("Returning surface desc :\n");
1691 }
1692
1694
1695 return DD_OK;
1696}

Referenced by ddraw1_GetDisplayMode(), ddraw2_GetDisplayMode(), and ddraw4_GetDisplayMode().

◆ ddraw7_GetFourCCCodes()

static HRESULT WINAPI ddraw7_GetFourCCCodes ( IDirectDraw7 iface,
DWORD NumCodes,
DWORD Codes 
)
static

Definition at line 1748 of file ddraw.c.

1749{
1750 struct ddraw *ddraw = impl_from_IDirectDraw7(iface);
1751 static const enum wined3d_format_id formats[] =
1752 {
1756 };
1758 DWORD count = 0, i, outsize;
1759 HRESULT hr;
1760
1761 TRACE("iface %p, codes_count %p, codes %p.\n", iface, NumCodes, Codes);
1762
1764 {
1765 ERR("Failed to get display mode, hr %#x.\n", hr);
1766 return hr;
1767 }
1768
1769 outsize = NumCodes && Codes ? *NumCodes : 0;
1770
1771 for (i = 0; i < ARRAY_SIZE(formats); ++i)
1772 {
1774 mode.format_id, 0, WINED3D_RTYPE_TEXTURE_2D, formats[i])))
1775 {
1776 if (count < outsize)
1777 Codes[count] = formats[i];
1778 ++count;
1779 }
1780 }
1781 if(NumCodes) {
1782 TRACE("Returning %u FourCC codes\n", count);
1783 *NumCodes = count;
1784 }
1785
1786 return DD_OK;
1787}
GLuint GLuint GLsizei count
Definition: gl.h:1545
unsigned char size_t * outsize
Definition: jpeglib.h:981
@ WINED3DFMT_DXT2
Definition: wined3d.h:240
@ WINED3DFMT_NVHS
Definition: wined3d.h:252
@ WINED3DFMT_DXT1
Definition: wined3d.h:239
@ WINED3DFMT_DXT3
Definition: wined3d.h:241
@ WINED3DFMT_DXT4
Definition: wined3d.h:242
@ WINED3DFMT_NVHU
Definition: wined3d.h:251
@ WINED3DFMT_YV12
Definition: wined3d.h:238
@ WINED3DFMT_DXT5
Definition: wined3d.h:243
@ WINED3DFMT_YUY2
Definition: wined3d.h:237
@ WINED3DFMT_UYVY
Definition: wined3d.h:236
@ WINED3DFMT_ATI2N
Definition: wined3d.h:248

Referenced by ddraw1_GetFourCCCodes(), ddraw2_GetFourCCCodes(), and ddraw4_GetFourCCCodes().

◆ ddraw7_GetGDISurface()