ReactOS 0.4.16-dev-197-g92996da
surface.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

ULONG WINAPI Main_DDrawSurface_AddRef (LPDDRAWI_DDRAWSURFACE_INT)
 
ULONG WINAPI Main_DDrawSurface_Release (LPDDRAWI_DDRAWSURFACE_INT)
 
HRESULT WINAPI Main_DDrawSurface_QueryInterface (LPDDRAWI_DDRAWSURFACE_INT, REFIID, LPVOID *)
 
HRESULT WINAPI Main_DDrawSurface_Blt (LPDDRAWI_DDRAWSURFACE_INT, LPRECT, LPDDRAWI_DDRAWSURFACE_INT, LPRECT, DWORD, LPDDBLTFX)
 
HRESULT WINAPI Main_DDrawSurface_BltBatch (LPDDRAWI_DDRAWSURFACE_INT, LPDDBLTBATCH, DWORD, DWORD)
 
HRESULT WINAPI Main_DDrawSurface_BltFast (LPDDRAWI_DDRAWSURFACE_INT, DWORD, DWORD, LPDDRAWI_DDRAWSURFACE_INT, LPRECT, DWORD)
 
HRESULT WINAPI Main_DDrawSurface_DeleteAttachedSurface (LPDDRAWI_DDRAWSURFACE_INT, DWORD, LPDDRAWI_DDRAWSURFACE_INT)
 
HRESULT WINAPI Main_DDrawSurface_EnumAttachedSurfaces (LPDDRAWI_DDRAWSURFACE_INT, LPVOID, LPDDENUMSURFACESCALLBACK7)
 
HRESULT WINAPI Main_DDrawSurface_EnumOverlayZOrders (LPDDRAWI_DDRAWSURFACE_INT, DWORD, LPVOID, LPDDENUMSURFACESCALLBACK7)
 
HRESULT WINAPI Main_DDrawSurface_Flip (LPDDRAWI_DDRAWSURFACE_INT, LPDDRAWI_DDRAWSURFACE_INT, DWORD)
 
HRESULT WINAPI Main_DDrawSurface_FreePrivateData (LPDDRAWI_DDRAWSURFACE_INT, REFGUID)
 
HRESULT WINAPI Main_DDrawSurface_GetAttachedSurface (LPDDRAWI_DDRAWSURFACE_INT, LPDDSCAPS2, LPDDRAWI_DDRAWSURFACE_INT *)
 
HRESULT WINAPI Main_DDrawSurface_GetBltStatus (LPDDRAWI_DDRAWSURFACE_INT, DWORD dwFlags)
 
HRESULT WINAPI Main_DDrawSurface_GetCaps (LPDDRAWI_DDRAWSURFACE_INT, LPDDSCAPS2 pCaps)
 
HRESULT WINAPI Main_DDrawSurface_GetClipper (LPDDRAWI_DDRAWSURFACE_INT, LPDIRECTDRAWCLIPPER *)
 
HRESULT WINAPI Main_DDrawSurface_GetColorKey (LPDDRAWI_DDRAWSURFACE_INT, DWORD, LPDDCOLORKEY)
 
HRESULT WINAPI Main_DDrawSurface_GetDC (LPDDRAWI_DDRAWSURFACE_INT, HDC *)
 
HRESULT WINAPI Main_DDrawSurface_GetDDInterface (LPDDRAWI_DDRAWSURFACE_INT, LPVOID *)
 
HRESULT WINAPI Main_DDrawSurface_GetFlipStatus (LPDDRAWI_DDRAWSURFACE_INT, DWORD)
 
HRESULT WINAPI Main_DDrawSurface_GetLOD (LPDDRAWI_DDRAWSURFACE_INT, LPDWORD)
 
HRESULT WINAPI Main_DDrawSurface_GetOverlayPosition (LPDDRAWI_DDRAWSURFACE_INT, LPLONG, LPLONG)
 
HRESULT WINAPI Main_DDrawSurface_GetPalette (LPDDRAWI_DDRAWSURFACE_INT, LPDIRECTDRAWPALETTE *)
 
HRESULT WINAPI Main_DDrawSurface_GetPixelFormat (LPDDRAWI_DDRAWSURFACE_INT, LPDDPIXELFORMAT)
 
HRESULT WINAPI Main_DDrawSurface_GetPriority (LPDDRAWI_DDRAWSURFACE_INT, LPDWORD)
 
HRESULT WINAPI Main_DDrawSurface_GetPrivateData (LPDDRAWI_DDRAWSURFACE_INT, REFGUID, LPVOID, LPDWORD)
 
HRESULT WINAPI Main_DDrawSurface_GetSurfaceDesc (LPDDRAWI_DDRAWSURFACE_INT, LPDDSURFACEDESC2)
 
HRESULT WINAPI Main_DDrawSurface_GetUniquenessValue (LPDDRAWI_DDRAWSURFACE_INT, LPDWORD)
 
HRESULT WINAPI Main_DDrawSurface_IsLost (LPDDRAWI_DDRAWSURFACE_INT)
 
HRESULT WINAPI Main_DDrawSurface_PageLock (LPDDRAWI_DDRAWSURFACE_INT, DWORD)
 
HRESULT WINAPI Main_DDrawSurface_PageUnlock (LPDDRAWI_DDRAWSURFACE_INT, DWORD)
 
HRESULT WINAPI Main_DDrawSurface_ReleaseDC (LPDDRAWI_DDRAWSURFACE_INT, HDC)
 
HRESULT WINAPI Main_DDrawSurface_SetClipper (LPDDRAWI_DDRAWSURFACE_INT, LPDIRECTDRAWCLIPPER)
 
HRESULT WINAPI Main_DDrawSurface_SetColorKey (LPDDRAWI_DDRAWSURFACE_INT, DWORD, LPDDCOLORKEY)
 
HRESULT WINAPI Main_DDrawSurface_SetOverlayPosition (LPDDRAWI_DDRAWSURFACE_INT, LONG, LONG)
 
HRESULT WINAPI Main_DDrawSurface_SetPalette (LPDDRAWI_DDRAWSURFACE_INT, LPDIRECTDRAWPALETTE)
 
HRESULT WINAPI Main_DDrawSurface_SetPriority (LPDDRAWI_DDRAWSURFACE_INT, DWORD)
 
HRESULT WINAPI Main_DDrawSurface_SetPrivateData (LPDDRAWI_DDRAWSURFACE_INT, REFGUID, LPVOID, DWORD, DWORD)
 
HRESULT WINAPI Main_DDrawSurface_UpdateOverlayDisplay (LPDDRAWI_DDRAWSURFACE_INT, DWORD)
 
HRESULT WINAPI Main_DDrawSurface_UpdateOverlayZOrder (LPDDRAWI_DDRAWSURFACE_INT, DWORD, LPDDRAWI_DDRAWSURFACE_INT)
 
HRESULT WINAPI Main_DDrawSurface_SetSurfaceDesc (LPDDRAWI_DDRAWSURFACE_INT, DDSURFACEDESC2 *, DWORD)
 
HRESULT WINAPI Main_DDrawSurface_SetLOD (LPDDRAWI_DDRAWSURFACE_INT, DWORD)
 
HRESULT WINAPI Main_DDrawSurface_Unlock (LPDDRAWI_DDRAWSURFACE_INT, LPRECT)
 
HRESULT WINAPI Main_DDrawSurface_Initialize (LPDDRAWI_DDRAWSURFACE_INT, LPDIRECTDRAW, LPDDSURFACEDESC2)
 
HRESULT WINAPI Main_DDrawSurface_Lock (LPDDRAWI_DDRAWSURFACE_INT, LPRECT, LPDDSURFACEDESC2, DWORD, HANDLE)
 
HRESULT WINAPI Main_DDrawSurface_Restore (LPDDRAWI_DDRAWSURFACE_INT)
 
HRESULT WINAPI Main_DDrawSurface_UpdateOverlay (LPDDRAWI_DDRAWSURFACE_INT, LPRECT, LPDDRAWI_DDRAWSURFACE_INT, LPRECT, DWORD, LPDDOVERLAYFX)
 
HRESULT WINAPI Main_DDrawSurface_ChangeUniquenessValue (LPDDRAWI_DDRAWSURFACE_INT iface)
 
HRESULT WINAPI Main_DDrawSurface_AddAttachedSurface (LPDDRAWI_DDRAWSURFACE_INT iface, LPDDRAWI_DDRAWSURFACE_INT pAttach)
 
HRESULT WINAPI Main_DDrawSurface_AddOverlayDirtyRect (LPDDRAWI_DDRAWSURFACE_INT iface, LPRECT pRect)
 
DWORD CALLBACK HelDdDestroyDriver (LPDDHAL_DESTROYDRIVERDATA lpDestroyDriver)
 
DWORD CALLBACK HelDdCreateSurface (LPDDHAL_CREATESURFACEDATA lpCreateSurface)
 
DWORD CALLBACK HelDdSetColorKey (LPDDHAL_DRVSETCOLORKEYDATA lpSetColorKey)
 
DWORD CALLBACK HelDdSetMode (LPDDHAL_SETMODEDATA SetMode)
 
DWORD CALLBACK HelDdWaitForVerticalBlank (LPDDHAL_WAITFORVERTICALBLANKDATA lpWaitForVerticalBlank)
 
DWORD CALLBACK HelDdCanCreateSurface (LPDDHAL_CANCREATESURFACEDATA lpCanCreateSurface)
 
DWORD CALLBACK HelDdCreatePalette (LPDDHAL_CREATEPALETTEDATA lpCreatePalette)
 
DWORD CALLBACK HelDdGetScanLine (LPDDHAL_GETSCANLINEDATA lpGetScanLine)
 
DWORD CALLBACK HelDdSetExclusiveMode (LPDDHAL_SETEXCLUSIVEMODEDATA lpSetExclusiveMode)
 
DWORD CALLBACK HelDdFlipToGDISurface (LPDDHAL_FLIPTOGDISURFACEDATA lpFlipToGDISurface)
 

Function Documentation

◆ HelDdCanCreateSurface()

DWORD CALLBACK HelDdCanCreateSurface ( LPDDHAL_CANCREATESURFACEDATA  lpCanCreateSurface)

Definition at line 72 of file callbacks_dd_hel.c.

73{
74 DX_STUB;
75}
#define DX_STUB
Definition: rosdraw.h:224

Referenced by StartDirectDrawHel().

◆ HelDdCreatePalette()

DWORD CALLBACK HelDdCreatePalette ( LPDDHAL_CREATEPALETTEDATA  lpCreatePalette)

Definition at line 77 of file callbacks_dd_hel.c.

78{
79 DDRAWI_DDRAWPALETTE_GBL* ddPalGbl = lpCreatePalette->lpDDPalette;
80 LOGPALETTE* logPal ;
81 WORD size=1;
82
83 if(ddPalGbl->dwFlags & DDRAWIPAL_2)
84 size = 2;
85 else if(ddPalGbl->dwFlags & DDRAWIPAL_4)
86 size = 4;
87 else if(ddPalGbl->dwFlags & DDRAWIPAL_16)
88 size = 16;
89 else if(ddPalGbl->dwFlags & DDRAWIPAL_256)
90 size = 256;
91
92 DxHeapMemAlloc(logPal, sizeof(LOGPALETTE) + size*sizeof(PALETTEENTRY));
93 if(logPal == NULL)
94 {
95 lpCreatePalette->ddRVal = DDERR_OUTOFMEMORY;
97 }
98
99 logPal->palVersion = 0x300;
100 logPal->palNumEntries = size;
101 CopyMemory(&logPal->palPalEntry[0], lpCreatePalette->lpColorTable, size*sizeof(PALETTEENTRY));
102
103 ddPalGbl->hHELGDIPalette = CreatePalette(logPal);
104
105 if (ddPalGbl->hHELGDIPalette == NULL)
106 {
107 DxHeapMemFree(logPal);
108 lpCreatePalette->ddRVal = DDERR_INVALIDOBJECT;
110 }
111
112 DxHeapMemFree(logPal);
113 ddPalGbl->lpColorTable = lpCreatePalette->lpColorTable;
114 ddPalGbl->dwFlags |= DDRAWIPAL_INHEL | DDRAWIPAL_GDI ;
115 lpCreatePalette->ddRVal = DD_OK;
117}
#define DDHAL_DRIVER_HANDLED
Definition: ddrawi.h:321
#define DDRAWIPAL_GDI
Definition: ddrawi.h:1563
#define DDRAWIPAL_2
Definition: ddrawi.h:1572
#define DDRAWIPAL_16
Definition: ddrawi.h:1562
#define DDRAWIPAL_INHEL
Definition: ddrawi.h:1568
#define DDRAWIPAL_4
Definition: ddrawi.h:1571
#define DDRAWIPAL_256
Definition: ddrawi.h:1561
#define NULL
Definition: types.h:112
unsigned short WORD
Definition: ntddk_ex.h:93
GLsizeiptr size
Definition: glext.h:5919
#define DxHeapMemAlloc(p, m)
Definition: rosdraw.h:113
#define DxHeapMemFree(p)
Definition: rosdraw.h:120
#define DDERR_INVALIDOBJECT
Definition: ddraw.h:78
#define DDERR_OUTOFMEMORY
Definition: ddraw.h:111
#define DD_OK
Definition: ddraw.h:186
LPPALETTEENTRY lpColorTable
Definition: ddrawi.h:794
LPDDRAWI_DDRAWPALETTE_GBL lpDDPalette
Definition: ddrawi.h:793
LPPALETTEENTRY lpColorTable
Definition: ddrawi.h:1550
WORD palNumEntries
Definition: wingdi.h:1834
WORD palVersion
Definition: wingdi.h:1833
#define CopyMemory
Definition: winbase.h:1734
HPALETTE WINAPI CreatePalette(_In_reads_(_Inexpressible_(2 *sizeof(WORD)+plpal->palNumEntries *sizeof(PALETTEENTRY))) const LOGPALETTE *)

Referenced by StartDirectDrawHel().

◆ HelDdCreateSurface()

DWORD CALLBACK HelDdCreateSurface ( LPDDHAL_CREATESURFACEDATA  lpCreateSurface)

Definition at line 25 of file callbacks_dd_hel.c.

26{
27 DX_STUB;
28}

Referenced by StartDirectDrawHel().

◆ HelDdDestroyDriver()

DWORD CALLBACK HelDdDestroyDriver ( LPDDHAL_DESTROYDRIVERDATA  lpDestroyDriver)

Definition at line 20 of file callbacks_dd_hel.c.

21{
22 DX_STUB;
23}

Referenced by StartDirectDrawHel().

◆ HelDdFlipToGDISurface()

DWORD CALLBACK HelDdFlipToGDISurface ( LPDDHAL_FLIPTOGDISURFACEDATA  lpFlipToGDISurface)

Definition at line 133 of file callbacks_dd_hel.c.

134{
135 DX_STUB;
136}

Referenced by StartDirectDrawHel().

◆ HelDdGetScanLine()

DWORD CALLBACK HelDdGetScanLine ( LPDDHAL_GETSCANLINEDATA  lpGetScanLine)

Definition at line 119 of file callbacks_dd_hel.c.

120{
121 DX_STUB;
122}

Referenced by StartDirectDrawHel().

◆ HelDdSetColorKey()

DWORD CALLBACK HelDdSetColorKey ( LPDDHAL_DRVSETCOLORKEYDATA  lpSetColorKey)

Definition at line 31 of file callbacks_dd_hel.c.

32{
33 DX_STUB;
34}

Referenced by StartDirectDrawHel().

◆ HelDdSetExclusiveMode()

DWORD CALLBACK HelDdSetExclusiveMode ( LPDDHAL_SETEXCLUSIVEMODEDATA  lpSetExclusiveMode)

Definition at line 124 of file callbacks_dd_hel.c.

125{
127 DX_STUB_str("Not implement yet, return DD_OK for not bsod\n");
128 lpSetExclusiveMode->ddRVal = DD_OK;
129
131}
#define DX_STUB_str(x)
Definition: rosdraw.h:254
#define DX_WINDBG_trace()
Definition: rosdraw.h:262

Referenced by StartDirectDrawHel().

◆ HelDdSetMode()

DWORD CALLBACK HelDdSetMode ( LPDDHAL_SETMODEDATA  SetMode)

Definition at line 37 of file callbacks_dd_hel.c.

38{
39 DEVMODE DevMode;
40
41 DX_STUB_str("in hel");
42
43 DevMode.dmSize = (WORD)sizeof(DEVMODE);
44 DevMode.dmDriverExtra = 0;
45
47
48 if (EnumDisplaySettingsEx(NULL, SetMode->dwModeIndex, &DevMode, 0 ) != 0)
49 {
50
51
52 if (ChangeDisplaySettings(&DevMode, CDS_FULLSCREEN) != DISP_CHANGE_SUCCESSFUL)
53 {
54 DX_STUB_str("FAIL");
56 }
57 else
58 {
59 DX_STUB_str("OK");
60 SetMode->ddRVal = DD_OK;
61 }
62 }
63
65}
#define DDERR_UNSUPPORTEDMODE
Definition: ddraw.h:164
HRESULT ddRVal
Definition: ddrawi.h:768
DWORD dwModeIndex
Definition: ddrawi.h:767
WORD dmDriverExtra
Definition: wingdi.h:1569
WORD dmSize
Definition: wingdi.h:1568
#define DISP_CHANGE_SUCCESSFUL
Definition: winuser.h:190
#define CDS_FULLSCREEN
Definition: winuser.h:183

Referenced by StartDirectDrawHel().

◆ HelDdWaitForVerticalBlank()

DWORD CALLBACK HelDdWaitForVerticalBlank ( LPDDHAL_WAITFORVERTICALBLANKDATA  lpWaitForVerticalBlank)

Definition at line 67 of file callbacks_dd_hel.c.

68{
69 DX_STUB;
70}

Referenced by StartDirectDrawHel().

◆ Main_DDrawSurface_AddAttachedSurface()

HRESULT WINAPI Main_DDrawSurface_AddAttachedSurface ( LPDDRAWI_DDRAWSURFACE_INT  iface,
LPDDRAWI_DDRAWSURFACE_INT  pAttach 
)

Definition at line 571 of file surface_main.c.

573{
574
575 // LPDDRAWI_DDRAWSURFACE_INT This = (LPDDRAWI_DDRAWSURFACE_INT)iface;
576 // LPDDRAWI_DDRAWSURFACE_INT That = (LPDDRAWI_DDRAWSURFACE_INT)pAttach;
577
579
580 DX_STUB;
581}

Referenced by Thunk_DDrawSurface3_AddAttachedSurface().

◆ Main_DDrawSurface_AddOverlayDirtyRect()

HRESULT WINAPI Main_DDrawSurface_AddOverlayDirtyRect ( LPDDRAWI_DDRAWSURFACE_INT  iface,
LPRECT  pRect 
)

Definition at line 17 of file surface_stubs.c.

19{
21
22 DX_STUB;
23}

Referenced by Thunk_DDrawSurface3_AddOverlayDirtyRect().

◆ Main_DDrawSurface_AddRef()

ULONG WINAPI Main_DDrawSurface_AddRef ( LPDDRAWI_DDRAWSURFACE_INT  This)

Definition at line 40 of file surface_main.c.

41{
42
44
45 if (This!=NULL)
46 {
47 This->dwIntRefCnt++;
48 This->lpLcl->dwLocalRefCnt++;
49
50 if (This->lpLcl->lpGbl != NULL)
51 {
52 This->lpLcl->lpGbl->dwRefCnt++;
53 }
54 }
55 return This->dwIntRefCnt;
56
57}

Referenced by Internal_CreateSurface(), Main_DDrawSurface_QueryInterface(), and Thunk_DDrawSurface3_AddRef().

◆ Main_DDrawSurface_Blt()

HRESULT WINAPI Main_DDrawSurface_Blt ( LPDDRAWI_DDRAWSURFACE_INT  ThisDest,
LPRECT  rdst,
LPDDRAWI_DDRAWSURFACE_INT  ThisSrc,
LPRECT  rsrc,
DWORD  dwFlags,
LPDDBLTFX  lpbltfx 
)

Definition at line 289 of file surface_main.c.

291{
293
295
296 if (ThisDest == NULL)
297 {
298 return DDERR_INVALIDPARAMS;
299 }
300
301 /* Zero out members in DDHAL_BLTDATA */
303 ZeroMemory(&mDdBlt.bltFX, sizeof(DDBLTFX));
304
305 /* Check if we got HAL support for this api */
306 if (( ThisDest->lpLcl->lpGbl->lpDD->lpDDCBtmp->HALDDSurface.dwFlags &
308 {
310 }
311 /* Check if we got HEL support for this api */
312 else if (( ThisDest->lpLcl->lpGbl->lpDD->lpDDCBtmp->HELDDSurface.dwFlags &
314 {
316 }
317
318 if (mDdBlt.Blt == NULL)
319 {
320 /* This API is unsupported */
321 return DDERR_UNSUPPORTED;
322 }
323
324 /* Prepare for draw, if we do not reset the DdResetVisrgn some graphics card will not draw on the screen */
325 if (!DdResetVisrgn( ThisDest->lpLcl->lpSurfMore->slist[0], NULL))
326 {
327 DX_STUB_str("DdResetVisrgn failed");
328 }
329
330 mDdBlt.lpDD = ThisDest->lpLcl->lpSurfMore->lpDD_lcl->lpGbl;
332 ThisDest->lpLcl->lpSurfMore->slist[0]->hDC = ThisDest->lpLcl->lpSurfMore->lpDD_lcl->hDC;
333
334 /* Setup Src */
335 if (( ThisSrc != NULL ) )
336 {
337
339 ThisSrc->lpLcl->lpSurfMore->slist[0]->hDC = ThisSrc->lpLcl->lpSurfMore->lpDD_lcl->hDC;
340
341 if (rsrc != NULL)
342 {
343 memmove(&mDdBlt.rSrc, rsrc, sizeof (RECTL));
344 }
345 else
346 {
348 (RECT *)&mDdBlt.rSrc))
349 {
350 DX_STUB_str("GetWindowRect failed");
351 }
352 }
353
354 /* FIXME
355 * compare so we do not write too far
356 * ThisDest->lpLcl->lpGbl->wWidth; <- surface max width
357 * ThisDest->lpLcl->lpGbl->wHeight <- surface max height
358 * ThisDest->lpLcl->lpGbl->lPitch <- surface bpp
359 */
360
361 }
362
363 /* Setup dest */
364 if (rdst != NULL)
365 {
366 memmove(&mDdBlt.rDest, rdst, sizeof (RECTL));
367 }
368 else
369 {
370 if (!GetWindowRect((HWND)ThisDest->lpLcl->lpSurfMore->lpDD_lcl->hWnd,
371 (RECT *)&mDdBlt.rDest))
372 {
373 DX_STUB_str("GetWindowRect failed");
374 }
375 }
376
377 /* FIXME
378 * compare so we do not write too far
379 * ThisDest->lpLcl->lpGbl->wWidth; <- surface max width
380 * ThisDest->lpLcl->lpGbl->wHeight <- surface max height
381 * ThisDest->lpLcl->lpGbl->lPitch <- surface bpp
382 */
383
384
385 /* setup bltFX */
386 if (lpbltfx != NULL)
387 {
388 memmove(&mDdBlt.bltFX, lpbltfx, sizeof (DDBLTFX));
389 }
390
391 /* setup value that are not config yet */
394 mDdBlt.bltFX.dwSize = sizeof(DDBLTFX);
395
396
397 /* FIXME
398 BltData.dwRectCnt
399 BltData.dwROPFlags
400 BltData.IsClipped
401 BltData.prDestRects
402 BltData.rOrigDest
403 BltData.rOrigSrc
404 BltData.ddRVal
405 */
406
408 {
409 DX_STUB_str("mDdBlt DDHAL_DRIVER_HANDLED");
410 return DDERR_NOBLTHW;
411 }
412
413 return mDdBlt.ddRVal;
414}
#define DdResetVisrgn
Definition: ddrawgdi.h:29
#define DDHAL_SURFCB32_BLT
Definition: ddrawi.h:679
#define FALSE
Definition: types.h:117
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
DDHAL_BLTDATA mDdBlt
Definition: main.c:47
struct _DDBLTFX DDBLTFX
#define DDERR_UNSUPPORTED
Definition: ddraw.h:127
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79
#define DDERR_NOBLTHW
Definition: ddraw.h:149
DWORD dwSize
Definition: ddraw.h:1272
LPDDRAWI_DDRAWSURFACE_LCL lpDDSrcSurface
Definition: ddrawi.h:849
RECTL rSrc
Definition: ddrawi.h:850
LPDDRAWI_DIRECTDRAW_GBL lpDD
Definition: ddrawi.h:846
DDBLTFX bltFX
Definition: ddrawi.h:853
DWORD dwFlags
Definition: ddrawi.h:851
HRESULT ddRVal
Definition: ddrawi.h:854
LPDDRAWI_DDRAWSURFACE_LCL lpDDDestSurface
Definition: ddrawi.h:847
RECTL rDest
Definition: ddrawi.h:848
BOOL IsClipped
Definition: ddrawi.h:856
LPDDHALSURFCB_BLT Blt
Definition: ddrawi.h:855
DDHAL_DDSURFACECALLBACKS HALDDSurface
Definition: ddrawi.h:736
DDHAL_DDSURFACECALLBACKS HELDDSurface
Definition: ddrawi.h:739
LPDDHALSURFCB_BLT Blt
Definition: ddrawi.h:398
LPDDRAWI_DIRECTDRAW_GBL lpDD
Definition: ddrawi.h:1346
LPDDRAWI_DDRAWSURFACE_LCL lpLcl
Definition: ddrawi.h:1328
LPDDRAWI_DDRAWSURFACE_GBL lpGbl
Definition: ddrawi.h:1468
LPDDRAWI_DDRAWSURFACE_MORE lpSurfMore
Definition: ddrawi.h:1467
LPDDRAWI_DDRAWSURFACE_LCL * slist
Definition: ddrawi.h:1461
LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl
Definition: ddrawi.h:1431
LPDDHAL_CALLBACKS lpDDCBtmp
Definition: ddrawi.h:1224
LPDDRAWI_DIRECTDRAW_GBL lpGbl
Definition: ddrawi.h:1155
#define ZeroMemory
Definition: winbase.h:1736
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
ActualNumberDriverObjects * sizeof(PDRIVER_OBJECT)) PDRIVER_OBJECT *DriverObjectList

Referenced by Thunk_DDrawSurface3_Blt().

◆ Main_DDrawSurface_BltBatch()

HRESULT WINAPI Main_DDrawSurface_BltBatch ( LPDDRAWI_DDRAWSURFACE_INT  iface,
LPDDBLTBATCH  pBatch,
DWORD  dwCount,
DWORD  dwFlags 
)

Definition at line 45 of file surface_stubs.c.

48{
50
51 DX_STUB;
52}

Referenced by Thunk_DDrawSurface3_BltBatch().

◆ Main_DDrawSurface_BltFast()

HRESULT WINAPI Main_DDrawSurface_BltFast ( LPDDRAWI_DDRAWSURFACE_INT  iface,
DWORD  dstx,
DWORD  dsty,
LPDDRAWI_DDRAWSURFACE_INT  src,
LPRECT  rsrc,
DWORD  trans 
)

Definition at line 26 of file surface_stubs.c.

29{
31
32 DX_STUB;
33}

Referenced by Thunk_DDrawSurface3_BltFast().

◆ Main_DDrawSurface_ChangeUniquenessValue()

HRESULT WINAPI Main_DDrawSurface_ChangeUniquenessValue ( LPDDRAWI_DDRAWSURFACE_INT  iface)

Definition at line 55 of file surface_stubs.c.

56{
58
59 DX_STUB;
60}

◆ Main_DDrawSurface_DeleteAttachedSurface()

HRESULT WINAPI Main_DDrawSurface_DeleteAttachedSurface ( LPDDRAWI_DDRAWSURFACE_INT  iface,
DWORD  dwFlags,
LPDDRAWI_DDRAWSURFACE_INT  pAttach 
)

Definition at line 63 of file surface_stubs.c.

66{
68
69 DX_STUB;
70}

Referenced by Thunk_DDrawSurface3_DeleteAttachedSurface().

◆ Main_DDrawSurface_EnumAttachedSurfaces()

HRESULT WINAPI Main_DDrawSurface_EnumAttachedSurfaces ( LPDDRAWI_DDRAWSURFACE_INT  iface,
LPVOID  context,
LPDDENUMSURFACESCALLBACK7  cb 
)

Definition at line 73 of file surface_stubs.c.

76{
78
79 DX_STUB;
80}

Referenced by Thunk_DDrawSurface3_EnumAttachedSurfaces().

◆ Main_DDrawSurface_EnumOverlayZOrders()

HRESULT WINAPI Main_DDrawSurface_EnumOverlayZOrders ( LPDDRAWI_DDRAWSURFACE_INT  iface,
DWORD  dwFlags,
LPVOID  context,
LPDDENUMSURFACESCALLBACK7  cb 
)

Definition at line 83 of file surface_stubs.c.

86{
88
89 DX_STUB;
90}

Referenced by Thunk_DDrawSurface3_EnumOverlayZOrders().

◆ Main_DDrawSurface_Flip()

HRESULT WINAPI Main_DDrawSurface_Flip ( LPDDRAWI_DDRAWSURFACE_INT  iface,
LPDDRAWI_DDRAWSURFACE_INT  lpDDSurfaceTargetOverride,
DWORD  dwFlags 
)

Definition at line 93 of file surface_stubs.c.

95{
97
98 DX_STUB;
99}

Referenced by Thunk_DDrawSurface3_Flip().

◆ Main_DDrawSurface_FreePrivateData()

HRESULT WINAPI Main_DDrawSurface_FreePrivateData ( LPDDRAWI_DDRAWSURFACE_INT  iface,
REFGUID  tag 
)

Definition at line 102 of file surface_stubs.c.

103{
105
106 DX_STUB;
107}

◆ Main_DDrawSurface_GetAttachedSurface()

HRESULT WINAPI Main_DDrawSurface_GetAttachedSurface ( LPDDRAWI_DDRAWSURFACE_INT  This,
LPDDSCAPS2  pCaps,
LPDDRAWI_DDRAWSURFACE_INT ppSurface 
)

Definition at line 584 of file surface_main.c.

587{
588 /* FIXME hacked */
589
590
592
593 *ppSurface = This->lpLcl->lpGbl->lpDD->dsList;
594
595
596 return DD_OK;
597}

Referenced by Thunk_DDrawSurface3_GetAttachedSurface().

◆ Main_DDrawSurface_GetBltStatus()

HRESULT WINAPI Main_DDrawSurface_GetBltStatus ( LPDDRAWI_DDRAWSURFACE_INT  This,
DWORD  dwFlags 
)

Definition at line 600 of file surface_main.c.

601{
602
604
605 if (!(This->lpLcl->lpGbl->lpDD->lpDDCBtmp->cbDDSurfaceCallbacks.dwFlags & DDHAL_SURFCB32_FLIP))
606 {
607 return DDERR_GENERIC;
608 }
609
610 DX_STUB;
611}
#define DDHAL_SURFCB32_FLIP
Definition: ddrawi.h:675
#define DDERR_GENERIC
Definition: ddraw.h:72

Referenced by Thunk_DDrawSurface3_GetBltStatus().

◆ Main_DDrawSurface_GetCaps()

HRESULT WINAPI Main_DDrawSurface_GetCaps ( LPDDRAWI_DDRAWSURFACE_INT  This,
LPDDSCAPS2  pCaps 
)

Definition at line 614 of file surface_main.c.

615{
616
618
619 if (This == NULL)
620 {
621 return DDERR_INVALIDOBJECT;
622 }
623
624 if (pCaps == NULL)
625 {
626 return DDERR_INVALIDPARAMS;
627 }
628
629 RtlZeroMemory(pCaps,sizeof(DDSCAPS2));
630
631 pCaps->dwCaps = This->lpLcl->ddsCaps.dwCaps;
632
633 return DD_OK;
634}
DWORD dwCaps
Definition: ddraw.h:732
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262

Referenced by Thunk_DDrawSurface3_GetCaps().

◆ Main_DDrawSurface_GetClipper()

HRESULT WINAPI Main_DDrawSurface_GetClipper ( LPDDRAWI_DDRAWSURFACE_INT  This,
LPDIRECTDRAWCLIPPER ppClipper 
)

Definition at line 637 of file surface_main.c.

639{
640
642
643 if (This == NULL)
644 {
645 return DDERR_INVALIDOBJECT;
646 }
647
648 if (ppClipper == NULL)
649 {
650 return DDERR_INVALIDPARAMS;
651 }
652
653 if (This->lpLcl->lp16DDClipper == NULL)
654 {
656 }
657
658 *ppClipper = (LPDIRECTDRAWCLIPPER)This->lpLcl->lp16DDClipper;
659
660 return DD_OK;
661}
struct IDirectDrawClipper * LPDIRECTDRAWCLIPPER
Definition: ddraw.h:721
#define DDERR_NOCLIPPERATTACHED
Definition: ddraw.h:142

Referenced by Thunk_DDrawSurface3_GetClipper().

◆ Main_DDrawSurface_GetColorKey()

HRESULT WINAPI Main_DDrawSurface_GetColorKey ( LPDDRAWI_DDRAWSURFACE_INT  iface,
DWORD  dwFlags,
LPDDCOLORKEY  pCKey 
)

Definition at line 109 of file surface_stubs.c.

111{
112 //LPDDRAWI_DDRAWSURFACE_INT This = (LPDDRAWI_DDRAWSURFACE_INT)iface;
113
115
116 DX_STUB;
117}

Referenced by Thunk_DDrawSurface3_GetColorKey().

◆ Main_DDrawSurface_GetDC()

HRESULT WINAPI Main_DDrawSurface_GetDC ( LPDDRAWI_DDRAWSURFACE_INT  This,
HDC phDC 
)

Definition at line 694 of file surface_main.c.

695{
696
698
699 if (This == NULL)
700 {
701 return DDERR_INVALIDOBJECT;
702 }
703
704 if (phDC == NULL)
705 {
706 return DDERR_INVALIDPARAMS;
707 }
708
709
710 *phDC = (HDC)This->lpLcl->lpSurfMore->lpDD_lcl->hDC;
711
712 return DD_OK;
713}
static HDC
Definition: imagelist.c:88

Referenced by Thunk_DDrawSurface3_GetDC().

◆ Main_DDrawSurface_GetDDInterface()

HRESULT WINAPI Main_DDrawSurface_GetDDInterface ( LPDDRAWI_DDRAWSURFACE_INT  iface,
LPVOID pDD 
)

Definition at line 120 of file surface_stubs.c.

121{
123
124 DX_STUB;
125}

Referenced by Thunk_DDrawSurface3_GetDDInterface().

◆ Main_DDrawSurface_GetFlipStatus()

HRESULT WINAPI Main_DDrawSurface_GetFlipStatus ( LPDDRAWI_DDRAWSURFACE_INT  iface,
DWORD  dwFlags 
)

Definition at line 127 of file surface_stubs.c.

128{
130
131 DX_STUB;
132}

Referenced by Thunk_DDrawSurface3_GetFlipStatus().

◆ Main_DDrawSurface_GetLOD()

HRESULT WINAPI Main_DDrawSurface_GetLOD ( LPDDRAWI_DDRAWSURFACE_INT  iface,
LPDWORD  pdwMaxLOD 
)

Definition at line 135 of file surface_stubs.c.

136{
138
139 DX_STUB;
140}

◆ Main_DDrawSurface_GetOverlayPosition()

HRESULT WINAPI Main_DDrawSurface_GetOverlayPosition ( LPDDRAWI_DDRAWSURFACE_INT  iface,
LPLONG  pX,
LPLONG  pY 
)

Definition at line 143 of file surface_stubs.c.

145{
147
148 DX_STUB;
149}

Referenced by Thunk_DDrawSurface3_GetOverlayPosition().

◆ Main_DDrawSurface_GetPalette()

HRESULT WINAPI Main_DDrawSurface_GetPalette ( LPDDRAWI_DDRAWSURFACE_INT  iface,
LPDIRECTDRAWPALETTE ppPalette 
)

Definition at line 151 of file surface_stubs.c.

153{
155
156 DX_STUB;
157}

Referenced by Thunk_DDrawSurface3_GetPalette().

◆ Main_DDrawSurface_GetPixelFormat()

HRESULT WINAPI Main_DDrawSurface_GetPixelFormat ( LPDDRAWI_DDRAWSURFACE_INT  This,
LPDDPIXELFORMAT  pDDPixelFormat 
)

Definition at line 716 of file surface_main.c.

718{
720
722
723 if (pDDPixelFormat != NULL)
724 {
725 if (This->lpLcl->dwFlags & DDRAWISURF_HASPIXELFORMAT)
726 {
727 memcpy(pDDPixelFormat,&This->lpLcl->lpGbl->ddpfSurface,sizeof(DDPIXELFORMAT));
728 }
729 else
730 {
731 memcpy(pDDPixelFormat,&This->lpLcl->lpSurfMore->
732 lpDD_lcl->lpGbl->vmiData.ddpfDisplay,sizeof(DDPIXELFORMAT));
733 }
734 retVale = DD_OK;
735 }
736
737 return retVale;
738}
#define DDRAWISURF_HASPIXELFORMAT
Definition: ddrawi.h:1515
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878

Referenced by Thunk_DDrawSurface3_GetPixelFormat().

◆ Main_DDrawSurface_GetPriority()

HRESULT WINAPI Main_DDrawSurface_GetPriority ( LPDDRAWI_DDRAWSURFACE_INT  iface,
LPDWORD  pdwPriority 
)

Definition at line 160 of file surface_stubs.c.

162{
164
165 DX_STUB;
166}

◆ Main_DDrawSurface_GetPrivateData()

HRESULT WINAPI Main_DDrawSurface_GetPrivateData ( LPDDRAWI_DDRAWSURFACE_INT  iface,
REFGUID  tag,
LPVOID  pBuffer,
LPDWORD  pcbBufferSize 
)

Definition at line 169 of file surface_stubs.c.

172{
174
175 DX_STUB;
176}

◆ Main_DDrawSurface_GetSurfaceDesc()

HRESULT WINAPI Main_DDrawSurface_GetSurfaceDesc ( LPDDRAWI_DDRAWSURFACE_INT  iface,
LPDDSURFACEDESC2  pDDSD 
)

Definition at line 741 of file surface_main.c.

743{
745
747
748 dwSize = pDDSD->dwSize;
749
750 if ((dwSize != sizeof(DDSURFACEDESC)) &&
751 (dwSize != sizeof(DDSURFACEDESC2)))
752 {
753 return DDERR_GENERIC;
754 }
755
756 ZeroMemory(pDDSD,dwSize);
757
758 if (dwSize == sizeof(DDSURFACEDESC))
759 {
760 LPDDSURFACEDESC lpDS = (LPDDSURFACEDESC) pDDSD;
761 memcpy(&lpDS->ddckCKDestBlt, &This->lpLcl->ddckCKDestBlt, sizeof(DDCOLORKEY));
762 memcpy(&lpDS->ddckCKDestOverlay, &This->lpLcl->ddckCKDestOverlay, sizeof(DDCOLORKEY));
763 memcpy(&lpDS->ddckCKSrcBlt, &This->lpLcl->ddckCKSrcBlt, sizeof(DDCOLORKEY));
764 memcpy(&lpDS->ddckCKSrcOverlay, &This->lpLcl->ddckCKSrcOverlay, sizeof(DDCOLORKEY));
765 memcpy(&lpDS->ddpfPixelFormat, &This->lpLcl->lpGbl->ddpfSurface, sizeof(DDPIXELFORMAT));
766 memcpy(&lpDS->ddsCaps, &This->lpLcl->ddsCaps, sizeof(DDSCAPS));
767
768 lpDS->dwAlphaBitDepth = This->lpLcl->dwAlpha;
769 lpDS->dwBackBufferCount = This->lpLcl->dwBackBufferCount;
770
771 /* FIXME setting the flags right */
772 // lpDS->dwFlags = This->lpLcl->dwFlags;
773
774 lpDS->dwHeight = This->lpLcl->lpGbl->wHeight;
775 lpDS->dwWidth = This->lpLcl->lpGbl->wWidth;
776
777 /* This two are a union in lpDS and in This->lpLcl->lpGbl
778 so I comment out lPitch
779 lpDS->lPitch = This->lpLcl->lpGbl->lPitch;
780 */
781 lpDS->dwLinearSize = This->lpLcl->lpGbl->dwLinearSize;
782
783
784 /* This tree are a union */
785 //lpDS->dwMipMapCount
786 //lpDS->dwRefreshRate
787 //lpDS->dwZBufferBitDepth
788
789 /* Unknown */
790 // lpDS->dwReserved
791 // lpDS->lpSurface
792 }
793 else
794 {
795 memcpy(&pDDSD->ddckCKDestBlt, &This->lpLcl->ddckCKDestBlt, sizeof(DDCOLORKEY));
796
797 /*
798 pDDSD->dwEmptyFaceColor is a union to ddckCKDestOverlay
799 */
800 memcpy(&pDDSD->ddckCKDestOverlay, &This->lpLcl->ddckCKDestOverlay, sizeof(DDCOLORKEY));
801 memcpy(&pDDSD->ddckCKSrcBlt, &This->lpLcl->ddckCKSrcBlt, sizeof(DDCOLORKEY));
802 memcpy(&pDDSD->ddckCKSrcOverlay, &This->lpLcl->ddckCKSrcOverlay, sizeof(DDCOLORKEY));
803
804 /*
805 pDDSD->dwFVF is a union to ddpfPixelFormat
806 */
807 memcpy(&pDDSD->ddpfPixelFormat, &This->lpLcl->lpGbl->ddpfSurface, sizeof(DDPIXELFORMAT));
808 memcpy(&pDDSD->ddsCaps, &This->lpLcl->ddsCaps, sizeof(DDSCAPS));
809
810
811 pDDSD->dwAlphaBitDepth = This->lpLcl->dwAlpha;
812 pDDSD->dwBackBufferCount = This->lpLcl->dwBackBufferCount;
813
814 /* FIXME setting the flags right */
815 // lpDS->dwFlags = This->lpLcl->dwFlags;
816
817 pDDSD->dwHeight = This->lpLcl->lpGbl->wHeight;
818 pDDSD->dwWidth = This->lpLcl->lpGbl->wWidth;
819
820 /* This two are a union in lpDS and in This->lpLcl->lpGbl
821 so I comment out lPitch
822 lpDS->lPitch = This->lpLcl->lpGbl->lPitch;
823 */
824 pDDSD->dwLinearSize = This->lpLcl->lpGbl->dwLinearSize;
825
826 /* This tree are a union */
827 // pDDSD->dwMipMapCount
828 // pDDSD->dwRefreshRate
829 // pDDSD->dwSrcVBHandle
830
831 /* Unknown */
832 // lpDS->dwReserved
833 // lpDS->lpSurface
834 // pDDSD->dwTextureStage
835 }
836
837 return DD_OK;
838}
void * LPDDSURFACEDESC
Definition: ddstream.idl:23
unsigned long DWORD
Definition: ntddk_ex.h:95
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
DWORD dwWidth
Definition: ddraw.h:1155
DWORD dwHeight
Definition: ddraw.h:1154
DDSCAPS2 ddsCaps
Definition: ddraw.h:1188
DDPIXELFORMAT ddpfPixelFormat
Definition: ddraw.h:1185
DWORD dwBackBufferCount
Definition: ddraw.h:1163
DWORD dwLinearSize
Definition: ddraw.h:1159
DDCOLORKEY ddckCKDestOverlay
Definition: ddraw.h:1177
DWORD dwAlphaBitDepth
Definition: ddraw.h:1172
DDCOLORKEY ddckCKSrcOverlay
Definition: ddraw.h:1181
DDCOLORKEY ddckCKDestBlt
Definition: ddraw.h:1180
DDCOLORKEY ddckCKSrcBlt
Definition: ddraw.h:1182
DWORD dwSize
Definition: ddraw.h:1152

Referenced by Thunk_DDrawSurface3_GetSurfaceDesc().

◆ Main_DDrawSurface_GetUniquenessValue()

HRESULT WINAPI Main_DDrawSurface_GetUniquenessValue ( LPDDRAWI_DDRAWSURFACE_INT  iface,
LPDWORD  pValue 
)

Definition at line 179 of file surface_stubs.c.

181{
183
184 DX_STUB;
185}

◆ Main_DDrawSurface_Initialize()

HRESULT WINAPI Main_DDrawSurface_Initialize ( LPDDRAWI_DDRAWSURFACE_INT  iface,
LPDIRECTDRAW  pDD,
LPDDSURFACEDESC2  pDDSD2 
)

Definition at line 35 of file surface_main.c.

36{
38}
#define DDERR_ALREADYINITIALIZED
Definition: ddraw.h:67

Referenced by Thunk_DDrawSurface3_Initialize().

◆ Main_DDrawSurface_IsLost()

HRESULT WINAPI Main_DDrawSurface_IsLost ( LPDDRAWI_DDRAWSURFACE_INT  iface)

Definition at line 188 of file surface_stubs.c.

189{
191
192 //DX_STUB;
193 DX_STUB_str("not implement return not lost\n");
194 return DD_OK;
195}

Referenced by Thunk_DDrawSurface3_IsLost().

◆ Main_DDrawSurface_Lock()

HRESULT WINAPI Main_DDrawSurface_Lock ( LPDDRAWI_DDRAWSURFACE_INT  ThisDest,
LPRECT  prect,
LPDDSURFACEDESC2  pDDSD,
DWORD  flags,
HANDLE  events 
)

Definition at line 418 of file surface_main.c.

420{
421 DDHAL_LOCKDATA mdLock;
422
424
425 DX_WINDBG_trace_res( (DWORD)ThisDest->lpLcl->lpGbl->wWidth, (DWORD)ThisDest->lpLcl->lpGbl->wHeight, (DWORD)ThisDest->lpLcl->lpGbl->lPitch, (DWORD) 0);
426
427 /* Zero out members in DDHAL_LOCKDATA */
428 ZeroMemory(&mdLock, sizeof(DDHAL_LOCKDATA));
429
430 /* Check if we got HAL support for this api */
431 if (( ThisDest->lpLcl->lpGbl->lpDD->lpDDCBtmp->HALDDSurface.dwFlags &
433 {
435 }
436 /* Check if we got HEL support for this api */
437 else if (( ThisDest->lpLcl->lpGbl->lpDD->lpDDCBtmp->HELDDSurface.dwFlags &
439 {
441 }
442
443 if (mdLock.Lock == NULL)
444 {
445 /* This api are unsupported */
446 return DDERR_UNSUPPORTED;
447 }
448
449 if (events != NULL)
450 {
451 return DDERR_INVALIDPARAMS;
452 }
453
454 /* FIXME add a check see if lock support or not */
455
456 if (prect!=NULL)
457 {
458 mdLock.bHasRect = TRUE;
459 memcpy(&mdLock.rArea,prect,sizeof(RECTL));
460 }
461 else
462 {
463 mdLock.bHasRect = FALSE;
464 }
465
466 //FIXME check if it primary or not and use primary or pixelformat data, at moment it is hardcode to primary
467
469 mdLock.dwFlags = flags;
470 mdLock.lpDDSurface = ThisDest->lpLcl->lpSurfMore->slist[0];
471 mdLock.lpDD = ThisDest->lpLcl->lpSurfMore->lpDD_lcl->lpGbl;
472 mdLock.lpSurfData = NULL;
473
474
475 if (!DdResetVisrgn(ThisDest->lpLcl->lpSurfMore->slist[0], NULL))
476 {
477 DX_STUB_str("Here DdResetVisrgn lock");
478 // return DDERR_UNSUPPORTED;
479 }
480
481 if (mdLock.Lock(&mdLock)!= DDHAL_DRIVER_HANDLED)
482 {
483 DX_STUB_str("Here DDHAL_DRIVER_HANDLED lock");
484 return DDERR_UNSUPPORTED;
485 }
486
487 // FIXME ??? is this right ??
488
489 if (pDDSD != NULL)
490 {
491 ZeroMemory(pDDSD,sizeof(DDSURFACEDESC2));
492 pDDSD->dwSize = sizeof(DDSURFACEDESC2);
493
494 //if (pDDSD->dwSize == sizeof(DDSURFACEDESC2))
495 //{
496 // ZeroMemory(pDDSD,sizeof(DDSURFACEDESC2));
497 // // FIXME the internal mddsdPrimary shall be DDSURFACEDESC2
498 // memcpy(pDDSD,&This->Surf->mddsdPrimary,sizeof(DDSURFACEDESC));
499 // pDDSD->dwSize = sizeof(DDSURFACEDESC2);
500 //}
501 //if (pDDSD->dwSize == sizeof(DDSURFACEDESC))
502 //{
503 // RtlZeroMemory(pDDSD,sizeof(DDSURFACEDESC));
504 // memcpy(pDDSD,&This->Surf->mddsdPrimary,sizeof(DDSURFACEDESC));
505 // pDDSD->dwSize = sizeof(DDSURFACEDESC);
506 //}
507
508
509 pDDSD->lpSurface = (LPVOID) mdLock.lpSurfData;
510
511 pDDSD->dwHeight = ThisDest->lpLcl->lpGbl->wHeight;
512 pDDSD->dwWidth = ThisDest->lpLcl->lpGbl->wWidth;
513
514 pDDSD->ddpfPixelFormat.dwRGBBitCount = ThisDest->lpLcl->lpGbl->lpDD->lpModeInfo->dwBPP;// .lpModeInfo->dwBPP; //This->lpLcl->lpGbl->lPitch/ 8;
515 pDDSD->lPitch = ThisDest->lpLcl->lpGbl->lPitch;
517 }
518
519 return mdLock.ddRVal;
520}
#define DDHAL_SURFCB32_LOCK
Definition: ddrawi.h:677
#define TRUE
Definition: types.h:120
GLbitfield flags
Definition: glext.h:7161
HANDLE events[2]
Definition: event.c:4
#define LPVOID
Definition: nt_native.h:45
#define DX_WINDBG_trace_res(width, height, bpp, freq)
Definition: rosdraw.h:273
#define DDSD_WIDTH
Definition: ddraw.h:210
#define DDSD_PITCH
Definition: ddraw.h:211
struct _DDSURFACEDESC2 DDSURFACEDESC2
#define DDSD_HEIGHT
Definition: ddraw.h:209
#define DDERR_CANTLOCKSURFACE
Definition: ddraw.h:120
DWORD dwBPP
Definition: ddrawi.h:174
LPDDHALSURFCB_LOCK Lock
Definition: ddrawi.h:396
RECTL rArea
Definition: ddrawi.h:831
DWORD bHasRect
Definition: ddrawi.h:830
DWORD dwFlags
Definition: ddrawi.h:835
HRESULT ddRVal
Definition: ddrawi.h:833
LPDDRAWI_DIRECTDRAW_GBL lpDD
Definition: ddrawi.h:828
LPDDHALSURFCB_LOCK Lock
Definition: ddrawi.h:834
LPVOID lpSurfData
Definition: ddrawi.h:832
LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface
Definition: ddrawi.h:829
DWORD dwRGBBitCount
Definition: ddraw.h:1075
LPDDHALMODEINFO lpModeInfo
Definition: ddrawi.h:1244
DWORD dwFlags
Definition: ddraw.h:1153
LPVOID lpSurface
Definition: ddraw.h:1174

Referenced by Thunk_DDrawSurface3_Lock().

◆ Main_DDrawSurface_PageLock()

HRESULT WINAPI Main_DDrawSurface_PageLock ( LPDDRAWI_DDRAWSURFACE_INT  iface,
DWORD  dwFlags 
)

Definition at line 198 of file surface_stubs.c.

199{
201
202 DX_STUB;
203}

Referenced by Thunk_DDrawSurface3_PageLock().

◆ Main_DDrawSurface_PageUnlock()

HRESULT WINAPI Main_DDrawSurface_PageUnlock ( LPDDRAWI_DDRAWSURFACE_INT  iface,
DWORD  dwFlags 
)

Definition at line 206 of file surface_stubs.c.

207{
209
210 DX_STUB;
211}

Referenced by Thunk_DDrawSurface3_PageUnlock().

◆ Main_DDrawSurface_QueryInterface()

HRESULT WINAPI Main_DDrawSurface_QueryInterface ( LPDDRAWI_DDRAWSURFACE_INT  This,
REFIID  riid,
LPVOID ppObj 
)

Definition at line 60 of file surface_main.c.

61{
62 HRESULT retVal = DD_OK;
63 *ppObj = NULL;
64
66
68 {
69 if (IsEqualGUID(&IID_IDirectDrawSurface7, riid))
70 {
71 if (This->lpVtbl != &DirectDrawSurface7_Vtable)
72 {
74 if (!This)
75 {
78 }
79 }
81 *ppObj = This;
83 }
84 else if (IsEqualGUID(&IID_IDirectDrawSurface4, riid))
85 {
86 if (This->lpVtbl != &DirectDrawSurface4_Vtable)
87 {
89 if (!This)
90 {
93 }
94 }
96 *ppObj = This;
98 }
99 else if (IsEqualGUID(&IID_IDirectDrawSurface3, riid))
100 {
101 if (This->lpVtbl != &DirectDrawSurface3_Vtable)
102 {
104 if (!This)
105 {
106 retVal = DDERR_OUTOFVIDEOMEMORY;
108 }
109 }
111 *ppObj = This;
113 }
114 else if (IsEqualGUID(&IID_IDirectDrawSurface2, riid))
115 {
116 if (This->lpVtbl != &DirectDrawSurface2_Vtable)
117 {
119 if (!This)
120 {
121 retVal = DDERR_OUTOFVIDEOMEMORY;
123 }
124 }
126 *ppObj = This;
128 }
129 else if (IsEqualGUID(&IID_IDirectDrawSurface, riid))
130 {
131 if (This->lpVtbl != &DirectDrawSurface_Vtable)
132 {
134 if (!This)
135 {
136 retVal = DDERR_OUTOFVIDEOMEMORY;
138 }
139 }
141 *ppObj = This;
143 }
144 else if (IsEqualGUID(&IID_IDirectDrawColorControl, riid))
145 {
146 if (This->lpVtbl != &DirectDrawColorControl_Vtable)
147 {
149 if (!This)
150 {
151 retVal = DDERR_OUTOFVIDEOMEMORY;
153 }
154 }
156 *ppObj = This;
158 }
159 else if (IsEqualGUID(&IID_IDirectDrawGammaControl, riid))
160 {
161 if (This->lpVtbl != &DirectDrawGammaControl_Vtable)
162 {
164 if (!This)
165 {
166 retVal = DDERR_OUTOFVIDEOMEMORY;
168 }
169 }
171 *ppObj = This;
173 }
174 else if (IsEqualGUID(&IID_IDirectDrawSurfaceKernel, riid))
175 {
176 if (This->lpVtbl != &DirectDrawSurfaceKernel_Vtable)
177 {
179 if (!This)
180 {
181 retVal = DDERR_OUTOFVIDEOMEMORY;
183 }
184 }
186 *ppObj = This;
188 }
189 else if (IsEqualGUID(&IID_IDirect3D, riid))
190 {
191 if (This->lpVtbl != &IDirect3D_Vtbl)
192 {
194 if (!This)
195 {
196 retVal = DDERR_OUTOFVIDEOMEMORY;
198 }
199 }
200 This->lpVtbl = &IDirect3D_Vtbl;
201 *ppObj = This;
203 }
204 else if (IsEqualGUID(&IID_IDirect3D2, riid))
205 {
206 if (This->lpVtbl != &IDirect3D2_Vtbl)
207 {
209 if (!This)
210 {
211 retVal = DDERR_OUTOFVIDEOMEMORY;
213 }
214 }
215 This->lpVtbl = &IDirect3D2_Vtbl;
216 *ppObj = This;
218 }
219 else if (IsEqualGUID(&IID_IDirect3D3, riid))
220 {
221 if (This->lpVtbl != &IDirect3D3_Vtbl)
222 {
224 if (!This)
225 {
226 retVal = DDERR_OUTOFVIDEOMEMORY;
228 }
229 }
230 This->lpVtbl = &IDirect3D3_Vtbl;
231 *ppObj = This;
233 }
234 else if (IsEqualGUID(&IID_IDirect3D7, riid))
235 {
236 if (This->lpVtbl != &IDirect3D7_Vtbl)
237 {
239 if (!This)
240 {
241 retVal = DDERR_OUTOFVIDEOMEMORY;
243 }
244 }
245 This->lpVtbl = &IDirect3D7_Vtbl;
246 *ppObj = This;
248 }
249 else
250 {
251 DX_STUB_str("E_NOINTERFACE");
252 retVal = E_NOINTERFACE;
253 }
254 }
256 {
257 }
258 _SEH2_END;
259 return retVal;
260}
IDirectDrawColorControlVtbl DirectDrawColorControl_Vtable
Definition: color_stubs.c:58
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
#define _SEH2_LEAVE
Definition: filesup.c:20
IDirectDrawGammaControlVtbl DirectDrawGammaControl_Vtable
Definition: gamma_stubs.c:60
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
REFIID riid
Definition: atlbase.h:39
IDirectDrawSurfaceKernelVtbl DirectDrawSurfaceKernel_Vtable
Definition: kernel_stubs.c:123
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:66
IDirectDrawSurfaceVtbl DirectDrawSurface_Vtable
IDirect3DVtbl IDirect3D_Vtbl
IDirectDrawSurface3Vtbl DirectDrawSurface3_Vtable
IDirect3D7Vtbl IDirect3D7_Vtbl
IDirectDrawSurface4Vtbl DirectDrawSurface4_Vtable
IDirect3D3Vtbl IDirect3D3_Vtbl
IDirect3D2Vtbl IDirect3D2_Vtbl
IDirectDrawSurface2Vtbl DirectDrawSurface2_Vtable
IDirectDrawSurface7Vtbl DirectDrawSurface7_Vtable
#define DDERR_OUTOFVIDEOMEMORY
Definition: ddraw.h:112
LPDDRAWI_DDRAWSURFACE_INT internal_directdrawsurface_int_alloc(LPDDRAWI_DDRAWSURFACE_INT This)
Definition: surface_main.c:23
ULONG WINAPI Main_DDrawSurface_AddRef(LPDDRAWI_DDRAWSURFACE_INT This)
Definition: surface_main.c:40
#define E_NOINTERFACE
Definition: winerror.h:2364

Referenced by Thunk_DDrawSurface3_QueryInterface().

◆ Main_DDrawSurface_Release()

ULONG WINAPI Main_DDrawSurface_Release ( LPDDRAWI_DDRAWSURFACE_INT  This)

Definition at line 264 of file surface_main.c.

265{
266 /* FIXME
267 This is not right exiame how it should be done
268 */
269 ULONG ret = --This->dwIntRefCnt;
270 if(!ret)
271 {
272 DX_STUB_str("Release is a bit simplistic right now\n");
276 }
277 return ret;
278}
VOID WINAPI AcquireDDThreadLock()
Definition: main.c:412
VOID WINAPI ReleaseDDThreadLock()
Definition: main.c:421
uint32_t ULONG
Definition: typedefs.h:59
int ret

Referenced by Main_DDrawSurface_Release4(), and Thunk_DDrawSurface3_Release().

◆ Main_DDrawSurface_ReleaseDC()

HRESULT WINAPI Main_DDrawSurface_ReleaseDC ( LPDDRAWI_DDRAWSURFACE_INT  This,
HDC  hDC 
)

Definition at line 841 of file surface_main.c.

842{
844
845 if (This == NULL)
846 {
847 return DDERR_INVALIDOBJECT;
848 }
849
850 if (hDC == NULL)
851 {
852 return DDERR_INVALIDPARAMS;
853 }
854
855 /* FIXME check if surface exits or not */
856
857
858 if ((HDC)This->lpLcl->hDC == NULL)
859 {
860 return DDERR_GENERIC;
861 }
862
863 return DD_OK;
864}
static HDC hDC
Definition: 3dtext.c:33

Referenced by Thunk_DDrawSurface3_ReleaseDC().

◆ Main_DDrawSurface_Restore()

HRESULT WINAPI Main_DDrawSurface_Restore ( LPDDRAWI_DDRAWSURFACE_INT  iface)

Definition at line 36 of file surface_stubs.c.

37{
39
40 DX_STUB;
41}

Referenced by Thunk_DDrawSurface3_Restore().

◆ Main_DDrawSurface_SetClipper()

HRESULT WINAPI Main_DDrawSurface_SetClipper ( LPDDRAWI_DDRAWSURFACE_INT  This,
LPDIRECTDRAWCLIPPER  pDDClipper 
)

Definition at line 664 of file surface_main.c.

666{
667
669
670 if (This == NULL)
671 {
672 return DDERR_INVALIDOBJECT;
673 }
674
675 if(pDDClipper == NULL)
676 {
677 if(!This->lpLcl->lp16DDClipper)
679
680 DirectDrawClipper_Release((LPDIRECTDRAWCLIPPER)This->lpLcl->lp16DDClipper);
681 This->lpLcl->lp16DDClipper = NULL;
682 return DD_OK;
683 }
684
685 // FIXME: Check Surface type and return DDERR_INVALIDSURFACETYPE
686
688 This->lpLcl->lp16DDClipper = (LPDDRAWI_DDRAWCLIPPER_INT)pDDClipper;
689
690 return DD_OK;
691}
ULONG WINAPI DirectDrawClipper_AddRef(LPDIRECTDRAWCLIPPER)
Definition: clipper_main.c:75
ULONG WINAPI DirectDrawClipper_Release(LPDIRECTDRAWCLIPPER)
Definition: clipper_main.c:54
struct _DDRAWI_DDRAWCLIPPER_INT * LPDDRAWI_DDRAWCLIPPER_INT
Definition: ddrawi.h:145

Referenced by Thunk_DDrawSurface3_SetClipper().

◆ Main_DDrawSurface_SetColorKey()

HRESULT WINAPI Main_DDrawSurface_SetColorKey ( LPDDRAWI_DDRAWSURFACE_INT  This,
DWORD  dwFlags,
LPDDCOLORKEY  pCKey 
)

Definition at line 867 of file surface_main.c.

869{
870
871 DDHAL_SETCOLORKEYDATA ColorKeyData;
872
874
875 ColorKeyData.ddRVal = DDERR_COLORKEYNOTSET;
876
877 if (This->lpLcl->lpGbl->lpDD->lpDDCBtmp->cbDDSurfaceCallbacks.dwFlags & DDHAL_SURFCB32_SETCOLORKEY)
878 {
879
880 ColorKeyData.lpDD = This->lpLcl->lpGbl->lpDD;
881 ColorKeyData.SetColorKey = This->lpLcl->lpGbl->lpDD->lpDDCBtmp->cbDDSurfaceCallbacks.SetColorKey;
882
883 //ColorKeyData.lpDDSurface = &This->lpLcl->hDDSurface;
884 ColorKeyData.dwFlags = dwFlags;
885 /* FIXME
886 ColorKeyData.ckNew = ?
887 add / move dwFlags to This->lpLcl->dwFlags ??
888 */
889
890 if (ColorKeyData.SetColorKey(&ColorKeyData) == DDHAL_DRIVER_HANDLED )
891 {
892 return ColorKeyData.ddRVal;
893 }
894 }
896}
#define DDHAL_SURFCB32_SETCOLORKEY
Definition: ddrawi.h:680
#define DDERR_COLORKEYNOTSET
Definition: ddraw.h:116
LPDDHALSURFCB_SETCOLORKEY SetColorKey
Definition: ddrawi.h:1855
LPDDRAWI_DIRECTDRAW_GBL lpDD
Definition: ddrawi.h:1850

Referenced by Thunk_DDrawSurface3_SetColorKey().

◆ Main_DDrawSurface_SetLOD()

HRESULT WINAPI Main_DDrawSurface_SetLOD ( LPDDRAWI_DDRAWSURFACE_INT  iface,
DWORD  MaxLOD 
)

Definition at line 288 of file surface_stubs.c.

289{
291
292 DX_STUB;
293}

◆ Main_DDrawSurface_SetOverlayPosition()

HRESULT WINAPI Main_DDrawSurface_SetOverlayPosition ( LPDDRAWI_DDRAWSURFACE_INT  This,
LONG  X,
LONG  Y 
)

Definition at line 901 of file surface_main.c.

902{
903
904 DDHAL_SETOVERLAYPOSITIONDATA OverLayPositionData;
905
907
908 OverLayPositionData.ddRVal = DDERR_COLORKEYNOTSET;
909
910 if (This->lpLcl->lpGbl->lpDD->lpDDCBtmp->cbDDSurfaceCallbacks.dwFlags & DDHAL_SURFCB32_SETOVERLAYPOSITION)
911 {
912
913 OverLayPositionData.lpDD = This->lpLcl->lpGbl->lpDD;
914 OverLayPositionData.SetOverlayPosition = This->lpLcl->lpGbl->lpDD->lpDDCBtmp->cbDDSurfaceCallbacks.SetOverlayPosition;
915
916 //OverLayPositionData.lpDDSrcSurface = This->lpLcl->lpSurfaceOverlaying->lpLcl->hDDSurface;
917 //OverLayPositionData.lpDDDestSurface = This->lpLcl->hDDSurface;
918
919 OverLayPositionData.lXPos = X;
920 OverLayPositionData.lYPos = Y;
921
922
923 /* FIXME
924 Should X and Y be save ??
925 */
926
927 if (OverLayPositionData.SetOverlayPosition(&OverLayPositionData) == DDHAL_DRIVER_HANDLED )
928 {
929 return OverLayPositionData.ddRVal;
930 }
931 }
932
933 return DDERR_GENERIC;
934}
#define DDHAL_SURFCB32_SETOVERLAYPOSITION
Definition: ddrawi.h:685
#define Y(I)
#define X(b, s)
LPDDHALSURFCB_SETOVERLAYPOSITION SetOverlayPosition
Definition: ddrawi.h:1865
LPDDRAWI_DIRECTDRAW_GBL lpDD
Definition: ddrawi.h:1859

Referenced by Thunk_DDrawSurface3_SetOverlayPosition().

◆ Main_DDrawSurface_SetPalette()

HRESULT WINAPI Main_DDrawSurface_SetPalette ( LPDDRAWI_DDRAWSURFACE_INT  iface,
LPDIRECTDRAWPALETTE  pPalette 
)

Definition at line 214 of file surface_stubs.c.

216{
218
219 DX_STUB;
220}

Referenced by Thunk_DDrawSurface3_SetPalette().

◆ Main_DDrawSurface_SetPriority()

HRESULT WINAPI Main_DDrawSurface_SetPriority ( LPDDRAWI_DDRAWSURFACE_INT  iface,
DWORD  dwPriority 
)

Definition at line 223 of file surface_stubs.c.

225{
227
228 DX_STUB;
229}

◆ Main_DDrawSurface_SetPrivateData()

HRESULT WINAPI Main_DDrawSurface_SetPrivateData ( LPDDRAWI_DDRAWSURFACE_INT  iface,
REFGUID  tag,
LPVOID  pData,
DWORD  cbSize,
DWORD  dwFlags 
)

Definition at line 232 of file surface_stubs.c.

235{
237
238 DX_STUB;
239}

◆ Main_DDrawSurface_SetSurfaceDesc()

HRESULT WINAPI Main_DDrawSurface_SetSurfaceDesc ( LPDDRAWI_DDRAWSURFACE_INT  iface,
DDSURFACEDESC2 DDSD,
DWORD  Flags 
)

Definition at line 280 of file surface_stubs.c.

281{
283
284 DX_STUB;
285}

Referenced by Thunk_DDrawSurface3_SetSurfaceDesc().

◆ Main_DDrawSurface_Unlock()

HRESULT WINAPI Main_DDrawSurface_Unlock ( LPDDRAWI_DDRAWSURFACE_INT  This,
LPRECT  pRect 
)

Definition at line 523 of file surface_main.c.

524{
525 DDHAL_UNLOCKDATA mdUnLock;
526
528
529 /* Zero out members in DDHAL_UNLOCKDATA */
530 ZeroMemory(&mdUnLock, sizeof(DDHAL_UNLOCKDATA));
531
532 /* Check if we got HAL support for this api */
533 if (( This->lpLcl->lpGbl->lpDD->lpDDCBtmp->HALDDSurface.dwFlags &
535 {
536 mdUnLock.Unlock = This->lpLcl->lpSurfMore->lpDD_lcl->lpGbl->lpDDCBtmp->HALDDSurface.Unlock;
537 }
538 /* Check if we got HEL support for this api */
539 else if (( This->lpLcl->lpGbl->lpDD->lpDDCBtmp->HELDDSurface.dwFlags &
541 {
542 mdUnLock.Unlock = This->lpLcl->lpSurfMore->lpDD_lcl->lpGbl->lpDDCBtmp->HELDDSurface.Unlock;
543 }
544
545 if (mdUnLock.Unlock == NULL)
546 {
547 /* This api are unsupported */
548 return DDERR_UNSUPPORTED;
549 }
550
551 mdUnLock.ddRVal = DDERR_NOTPALETTIZED;
552 mdUnLock.lpDD = This->lpLcl->lpSurfMore->lpDD_lcl->lpGbl;
553 mdUnLock.lpDDSurface = This->lpLcl->lpSurfMore->slist[0];
554
555 if (!DdResetVisrgn( mdUnLock.lpDDSurface, NULL))
556 {
557 DX_STUB_str("DdResetVisrgn fail");
558 //return DDERR_UNSUPPORTED; /* this can fail */
559 }
560
561 if (mdUnLock.Unlock(&mdUnLock)!= DDHAL_DRIVER_HANDLED)
562 {
563 DX_STUB_str("unLock fail");
564 return DDERR_UNSUPPORTED;
565 }
566
567 return mdUnLock.ddRVal;
568}
#define DDHAL_SURFCB32_UNLOCK
Definition: ddrawi.h:678
#define DDERR_NOTPALETTIZED
Definition: ddraw.h:163
LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface
Definition: ddrawi.h:840
LPDDHALSURFCB_UNLOCK Unlock
Definition: ddrawi.h:842
HRESULT ddRVal
Definition: ddrawi.h:841
LPDDRAWI_DIRECTDRAW_GBL lpDD
Definition: ddrawi.h:839

◆ Main_DDrawSurface_UpdateOverlay()

HRESULT WINAPI Main_DDrawSurface_UpdateOverlay ( LPDDRAWI_DDRAWSURFACE_INT  iface,
LPRECT  pSrcRect,
LPDDRAWI_DDRAWSURFACE_INT  pDstSurface,
LPRECT  pDstRect,
DWORD  dwFlags,
LPDDOVERLAYFX  pFX 
)

Definition at line 242 of file surface_stubs.c.

247{
249
250 DX_STUB;
251}

Referenced by Thunk_DDrawSurface3_UpdateOverlay().

◆ Main_DDrawSurface_UpdateOverlayDisplay()

HRESULT WINAPI Main_DDrawSurface_UpdateOverlayDisplay ( LPDDRAWI_DDRAWSURFACE_INT  This,
DWORD  dwFlags 
)

Definition at line 256 of file surface_stubs.c.

258{
259
261
262 if (!(This->lpLcl->lpGbl->lpDD->lpDDCBtmp->cbDDSurfaceCallbacks.dwFlags & DDHAL_SURFCB32_UPDATEOVERLAY))
263 {
264 return DDERR_GENERIC;
265 }
266
267 DX_STUB;
268}
#define DDHAL_SURFCB32_UPDATEOVERLAY
Definition: ddrawi.h:684

Referenced by Thunk_DDrawSurface3_UpdateOverlayDisplay().

◆ Main_DDrawSurface_UpdateOverlayZOrder()

HRESULT WINAPI Main_DDrawSurface_UpdateOverlayZOrder ( LPDDRAWI_DDRAWSURFACE_INT  iface,
DWORD  dwFlags,
LPDDRAWI_DDRAWSURFACE_INT  pDDSRef 
)

Definition at line 271 of file surface_stubs.c.

273{
275
276 DX_STUB;
277}

Referenced by Thunk_DDrawSurface3_UpdateOverlayZOrder().