ReactOS  0.4.14-dev-317-g96040ec
callbacks_surf_hel.c File Reference
#include "rosdraw.h"
Include dependency graph for callbacks_surf_hel.c:

Go to the source code of this file.

Functions

DWORD CALLBACK HelDdSurfAddAttachedSurface (LPDDHAL_ADDATTACHEDSURFACEDATA lpDestroySurface)
 
DWORD CALLBACK HelDdSurfBlt (LPDDHAL_BLTDATA lpBltData)
 
DWORD CALLBACK HelDdSurfDestroySurface (LPDDHAL_DESTROYSURFACEDATA lpDestroySurfaceData)
 
DWORD CALLBACK HelDdSurfFlip (LPDDHAL_FLIPDATA lpFlipData)
 
DWORD CALLBACK HelDdSurfGetBltStatus (LPDDHAL_GETBLTSTATUSDATA lpGetBltStatusData)
 
DWORD CALLBACK HelDdSurfGetFlipStatus (LPDDHAL_GETFLIPSTATUSDATA lpGetFlipStatusData)
 
DWORD CALLBACK HelDdSurfLock (LPDDHAL_LOCKDATA lpLockData)
 
DWORD CALLBACK HelDdSurfreserved4 (DWORD *lpPtr)
 
DWORD CALLBACK HelDdSurfSetClipList (LPDDHAL_SETCLIPLISTDATA lpSetClipListData)
 
DWORD CALLBACK HelDdSurfSetColorKey (LPDDHAL_SETCOLORKEYDATA lpSetColorKeyData)
 
DWORD CALLBACK HelDdSurfSetOverlayPosition (LPDDHAL_SETOVERLAYPOSITIONDATA lpSetOverlayPositionData)
 
DWORD CALLBACK HelDdSurfSetPalette (LPDDHAL_SETPALETTEDATA lpSetPaletteData)
 
DWORD CALLBACK HelDdSurfUnlock (LPDDHAL_UNLOCKDATA lpUnLockData)
 
DWORD CALLBACK HelDdSurfUpdateOverlay (LPDDHAL_UPDATEOVERLAYDATA lpUpDateOverLayData)
 

Function Documentation

◆ HelDdSurfAddAttachedSurface()

DWORD CALLBACK HelDdSurfAddAttachedSurface ( LPDDHAL_ADDATTACHEDSURFACEDATA  lpDestroySurface)

Definition at line 12 of file callbacks_surf_hel.c.

13 {
14  DX_STUB;
15 }
#define DX_STUB
Definition: rosdraw.h:224

Referenced by StartDirectDrawHel().

◆ HelDdSurfBlt()

DWORD CALLBACK HelDdSurfBlt ( LPDDHAL_BLTDATA  lpBltData)

Definition at line 17 of file callbacks_surf_hel.c.

18 {
20 
21  if (lpBltData->dwFlags & DDBLT_COLORFILL)
22  {
23  HBRUSH hbr = CreateSolidBrush(lpBltData->bltFX.dwFillColor );
24  FillRect( (HDC)lpBltData->lpDDDestSurface->lpSurfMore->lpDD_lcl->hDC,
25  (CONST RECT *)&lpBltData->rDest,
26  hbr);
27  DeleteObject(hbr);
28  lpBltData->ddRVal = DD_OK;
29  }
30  else if (lpBltData->dwFlags & DDBLT_ROP)
31  {
32  BitBlt( (HDC)lpBltData->lpDDDestSurface->lpSurfMore->lpDD_lcl->hDC,
33  lpBltData->rDest.top,
34  lpBltData->rDest.left,
35  lpBltData->rDest.right,
36  lpBltData->rDest.bottom,
37  (HDC)lpBltData->lpDDSrcSurface->lpSurfMore->lpDD_lcl->hDC,
38  lpBltData->rSrc.top,
39  lpBltData->rSrc.right,
40  lpBltData->bltFX.dwROP);
41  lpBltData->ddRVal = DD_OK;
42  }
43  return DDHAL_DRIVER_HANDLED;
44 }
#define DX_WINDBG_trace()
Definition: rosdraw.h:262
DWORD dwFillColor
Definition: ddraw.h:1310
RECTL rDest
Definition: ddrawi.h:848
LPDDRAWI_DDRAWSURFACE_LCL lpDDSrcSurface
Definition: ddrawi.h:849
static HDC
Definition: imagelist.c:92
long bottom
Definition: polytest.cpp:53
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
static VOID NTAPI BitBlt(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height, IN PUCHAR Buffer, IN ULONG BitsPerPixel, IN ULONG Delta)
Definition: vga.c:410
long right
Definition: polytest.cpp:53
#define DDHAL_DRIVER_HANDLED
Definition: ddrawi.h:321
#define DD_OK
Definition: ddraw.h:186
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
DWORD dwFlags
Definition: ddrawi.h:851
#define DDBLT_COLORFILL
Definition: ddraw.h:555
HRESULT ddRVal
Definition: ddrawi.h:854
LPDDRAWI_DDRAWSURFACE_LCL lpDDDestSurface
Definition: ddrawi.h:847
RECTL rSrc
Definition: ddrawi.h:850
DWORD dwROP
Definition: ddraw.h:1274
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
DDBLTFX bltFX
Definition: ddrawi.h:853
#define DDBLT_ROP
Definition: ddraw.h:562
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
#define CONST
Definition: pedump.c:81

Referenced by StartDirectDrawHel().

◆ HelDdSurfDestroySurface()

DWORD CALLBACK HelDdSurfDestroySurface ( LPDDHAL_DESTROYSURFACEDATA  lpDestroySurfaceData)

Definition at line 46 of file callbacks_surf_hel.c.

47 {
48  DX_STUB;
49 }
#define DX_STUB
Definition: rosdraw.h:224

Referenced by StartDirectDrawHel().

◆ HelDdSurfFlip()

DWORD CALLBACK HelDdSurfFlip ( LPDDHAL_FLIPDATA  lpFlipData)

Definition at line 51 of file callbacks_surf_hel.c.

52 {
53  DX_STUB;
54 }
#define DX_STUB
Definition: rosdraw.h:224

Referenced by StartDirectDrawHel().

◆ HelDdSurfGetBltStatus()

DWORD CALLBACK HelDdSurfGetBltStatus ( LPDDHAL_GETBLTSTATUSDATA  lpGetBltStatusData)

Definition at line 56 of file callbacks_surf_hel.c.

57 {
58  DX_STUB;
59 }
#define DX_STUB
Definition: rosdraw.h:224

Referenced by StartDirectDrawHel().

◆ HelDdSurfGetFlipStatus()

DWORD CALLBACK HelDdSurfGetFlipStatus ( LPDDHAL_GETFLIPSTATUSDATA  lpGetFlipStatusData)

Definition at line 61 of file callbacks_surf_hel.c.

62 {
63  DX_STUB;
64 }
#define DX_STUB
Definition: rosdraw.h:224

Referenced by StartDirectDrawHel().

◆ HelDdSurfLock()

DWORD CALLBACK HelDdSurfLock ( LPDDHAL_LOCKDATA  lpLockData)

Definition at line 66 of file callbacks_surf_hel.c.

67 {
68 
69  HDC hDC;
70  HBITMAP hImage = NULL;
71 
72  LONG cbBuffer = 0;
74 
75  HDC hMemDC = NULL;
76  HBITMAP hDCBmp = NULL;
77  BITMAP bm = {0};
78 
80 
81  /* ToDo tell ddraw internal this surface is locked */
82  /* ToDo add support for dwFlags */
83 
84 
85  /* Get our hdc for the active window */
86  hDC = GetDC((HWND)lpLockData->lpDDSurface->lpSurfMore->lpDD_lcl->hFocusWnd);
87 
88  if (hDC != NULL)
89  {
90  /* Create a memory bitmap to store a copy of current hdc surface */
91 
92  if (!lpLockData->bHasRect)
93  {
94  hImage = CreateCompatibleBitmap (hDC, lpLockData->lpDDSurface->lpGbl->wWidth, lpLockData->lpDDSurface->lpGbl->wHeight);
95  }
96  else
97  {
98  hImage = CreateCompatibleBitmap (hDC, lpLockData->rArea.right, lpLockData->rArea.bottom);
99  }
100 
101  /* Create a memory hdc so we can draw on our current memory bitmap */
102  hMemDC = CreateCompatibleDC(hDC);
103 
104  if (hMemDC != NULL)
105  {
106  /* Select our memory bitmap to our memory hdc */
107  hDCBmp = (HBITMAP) SelectObject (hMemDC, hImage);
108 
109  /* Get our memory bitmap information */
110  GetObject(hImage, sizeof(BITMAP), &bm);
111 
112  if (!lpLockData->bHasRect)
113  {
114  BitBlt (hMemDC, 0, 0, bm.bmWidth, bm.bmHeight, hDC, 0, 0, SRCCOPY);
115  }
116  else
117  {
118  BitBlt (hMemDC, lpLockData->rArea.top, lpLockData->rArea.left, lpLockData->rArea.right, lpLockData->rArea.bottom, hDC, 0, 0, SRCCOPY);
119  }
120 
121  SelectObject (hMemDC, hDCBmp);
122 
123  /* Allocate memory buffer for the bitmap pixel data */
124  cbBuffer = bm.bmWidthBytes * bm.bmHeight ;
126 
127  if (pixels != NULL)
128  {
129  /* Get the bitmap bits */
130  GetBitmapBits(hImage,cbBuffer,pixels);
131 
132  /* Fixme HACK - check which member stores the HEL bitmap buffer */
133  lpLockData->lpDDSurface->lpSurfMore->lpDDRAWReserved2 = pixels;
134 
135  /* Setup return value */
136  lpLockData->ddRVal = DD_OK;
137  lpLockData->lpSurfData = pixels;
138  }
139  }
140  }
141 
142 
143  /* Free the pixels buffer if we fail */
144  if ( (pixels != NULL) &&
145  (lpLockData->ddRVal != DD_OK) )
146  {
148  }
149 
150  /* Cleanup after us */
151  if (hImage != NULL)
152  {
153  DeleteObject (hImage);
154  }
155 
156  if (hMemDC != NULL)
157  {
158  DeleteDC (hMemDC);
159  }
160 
161  return DDHAL_DRIVER_HANDLED;
162 }
HRESULT ddRVal
Definition: ddrawi.h:833
#define DX_WINDBG_trace()
Definition: rosdraw.h:262
HDC WINAPI GetDC(_In_opt_ HWND)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface
Definition: ddrawi.h:829
static HDC
Definition: imagelist.c:92
long bottom
Definition: polytest.cpp:53
RECTL rArea
Definition: ddrawi.h:831
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
static VOID NTAPI BitBlt(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height, IN PUCHAR Buffer, IN ULONG BitsPerPixel, IN ULONG Delta)
Definition: vga.c:410
long right
Definition: polytest.cpp:53
#define DDHAL_DRIVER_HANDLED
Definition: ddrawi.h:321
#define DD_OK
Definition: ddraw.h:186
DWORD bHasRect
Definition: ddrawi.h:830
long LONG
Definition: pedump.c:60
long top
Definition: polytest.cpp:53
smooth NULL
Definition: ftsmooth.c:416
long left
Definition: polytest.cpp:53
#define GetProcessHeap()
Definition: compat.h:395
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
LONG WINAPI GetBitmapBits(_In_ HBITMAP hbit, _In_ LONG cb, _Out_writes_bytes_(cb) LPVOID lpvBits)
#define GetObject
Definition: wingdi.h:4463
static HDC hDC
Definition: 3dtext.c:33
BOOL WINAPI DeleteDC(_In_ HDC)
Definition: bl.h:1331
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
Definition: gl.h:1546
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
DWORD * PDWORD
Definition: pedump.c:68
uint32_t * LPDWORD
Definition: typedefs.h:57
static HBITMAP
Definition: button.c:44
#define HeapFree(x, y, z)
Definition: compat.h:394
#define SRCCOPY
Definition: wingdi.h:332
LPVOID lpSurfData
Definition: ddrawi.h:832

Referenced by StartDirectDrawHel().

◆ HelDdSurfreserved4()

DWORD CALLBACK HelDdSurfreserved4 ( DWORD lpPtr)

Definition at line 164 of file callbacks_surf_hel.c.

165 {
166  /* This api is not documented by MS, keep it stubbed */
167  DX_STUB;
168 }
#define DX_STUB
Definition: rosdraw.h:224

Referenced by StartDirectDrawHel().

◆ HelDdSurfSetClipList()

DWORD CALLBACK HelDdSurfSetClipList ( LPDDHAL_SETCLIPLISTDATA  lpSetClipListData)

Definition at line 170 of file callbacks_surf_hel.c.

171 {
172  DX_STUB;
173 }
#define DX_STUB
Definition: rosdraw.h:224

Referenced by StartDirectDrawHel().

◆ HelDdSurfSetColorKey()

DWORD CALLBACK HelDdSurfSetColorKey ( LPDDHAL_SETCOLORKEYDATA  lpSetColorKeyData)

Definition at line 175 of file callbacks_surf_hel.c.

176 {
177  DX_STUB;
178 }
#define DX_STUB
Definition: rosdraw.h:224

Referenced by StartDirectDrawHel().

◆ HelDdSurfSetOverlayPosition()

DWORD CALLBACK HelDdSurfSetOverlayPosition ( LPDDHAL_SETOVERLAYPOSITIONDATA  lpSetOverlayPositionData)

Definition at line 180 of file callbacks_surf_hel.c.

181 {
182  DX_STUB;
183 }
#define DX_STUB
Definition: rosdraw.h:224

Referenced by StartDirectDrawHel().

◆ HelDdSurfSetPalette()

DWORD CALLBACK HelDdSurfSetPalette ( LPDDHAL_SETPALETTEDATA  lpSetPaletteData)

Definition at line 185 of file callbacks_surf_hel.c.

186 {
187  DX_STUB;
188 }
#define DX_STUB
Definition: rosdraw.h:224

Referenced by StartDirectDrawHel().

◆ HelDdSurfUnlock()

DWORD CALLBACK HelDdSurfUnlock ( LPDDHAL_UNLOCKDATA  lpUnLockData)

Definition at line 190 of file callbacks_surf_hel.c.

191 {
192  HDC hDC;
193  HBITMAP hImage = NULL;
194 
195  HDC hMemDC = NULL;
196  HBITMAP hDCBmp = NULL;
197  BITMAP bm = {0};
198 
199  DX_WINDBG_trace();
200 
201  /* Get our hdc for the active window */
202  hDC = GetDC((HWND)lpUnLockData->lpDDSurface->lpSurfMore->lpDD_lcl->hFocusWnd);
203 
204  if (hDC != NULL)
205  {
206  /* Create a memory bitmap to store a copy of current hdc surface */
207 
208  /* fixme the rcarea are not store in the struct yet so the data will look corrupted */
209  hImage = CreateCompatibleBitmap (hDC, lpUnLockData->lpDDSurface->lpGbl->wWidth, lpUnLockData->lpDDSurface->lpGbl->wHeight);
210 
211  /* Create a memory hdc so we can draw on our current memory bitmap */
212  hMemDC = CreateCompatibleDC(hDC);
213 
214  if (hMemDC != NULL)
215  {
216  /* Select our memory bitmap to our memory hdc */
217  hDCBmp = (HBITMAP) SelectObject (hMemDC, hImage);
218 
219  /* Get our memory bitmap information */
220  GetObject(hImage, sizeof(BITMAP), &bm);
221 
222  SetBitmapBits(hImage,bm.bmWidthBytes * bm.bmHeight, lpUnLockData->lpDDSurface->lpSurfMore->lpDDRAWReserved2);
223 
224  BitBlt (hDC, 0, 0, bm.bmWidth, bm.bmHeight, hMemDC, 0, 0, SRCCOPY);
225 
226  SelectObject (hMemDC, hDCBmp);
227 
228  /* Setup return value */
229  lpUnLockData->ddRVal = DD_OK;
230  }
231  }
232 
233  /* Cleanup after us */
234  if (hImage != NULL)
235  {
236  DeleteObject (hImage);
237  }
238 
239  if (hMemDC != NULL)
240  {
241  DeleteDC (hMemDC);
242  }
243 
244  if (lpUnLockData->lpDDSurface->lpSurfMore->lpDDRAWReserved2 != NULL)
245  {
246  HeapFree(GetProcessHeap(), 0, lpUnLockData->lpDDSurface->lpSurfMore->lpDDRAWReserved2 );
247  }
248 
249  return DDHAL_DRIVER_HANDLED;
250 }
#define DX_WINDBG_trace()
Definition: rosdraw.h:262
HDC WINAPI GetDC(_In_opt_ HWND)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
static HDC
Definition: imagelist.c:92
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface
Definition: ddrawi.h:840
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
static VOID NTAPI BitBlt(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height, IN PUCHAR Buffer, IN ULONG BitsPerPixel, IN ULONG Delta)
Definition: vga.c:410
#define DDHAL_DRIVER_HANDLED
Definition: ddrawi.h:321
#define DD_OK
Definition: ddraw.h:186
smooth NULL
Definition: ftsmooth.c:416
#define GetProcessHeap()
Definition: compat.h:395
HRESULT ddRVal
Definition: ddrawi.h:841
#define GetObject
Definition: wingdi.h:4463
LONG WINAPI SetBitmapBits(_In_ HBITMAP hbm, _In_ DWORD cb, _In_reads_bytes_(cb) CONST VOID *pvBits)
static HDC hDC
Definition: 3dtext.c:33
BOOL WINAPI DeleteDC(_In_ HDC)
Definition: bl.h:1331
static HBITMAP
Definition: button.c:44
#define HeapFree(x, y, z)
Definition: compat.h:394
#define SRCCOPY
Definition: wingdi.h:332

Referenced by StartDirectDrawHel().

◆ HelDdSurfUpdateOverlay()

DWORD CALLBACK HelDdSurfUpdateOverlay ( LPDDHAL_UPDATEOVERLAYDATA  lpUpDateOverLayData)

Definition at line 252 of file callbacks_surf_hel.c.

253 {
254  DX_STUB;
255 }
#define DX_STUB
Definition: rosdraw.h:224

Referenced by StartDirectDrawHel().