ReactOS 0.4.15-dev-7705-g2320c37
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 );
25 (CONST RECT *)&lpBltData->rDest,
26 hbr);
27 DeleteObject(hbr);
28 lpBltData->ddRVal = DD_OK;
29 }
30 else if (lpBltData->dwFlags & DDBLT_ROP)
31 {
33 lpBltData->rDest.top,
34 lpBltData->rDest.left,
35 lpBltData->rDest.right,
36 lpBltData->rDest.bottom,
38 lpBltData->rSrc.top,
39 lpBltData->rSrc.right,
40 lpBltData->bltFX.dwROP);
41 lpBltData->ddRVal = DD_OK;
42 }
44}
#define DDHAL_DRIVER_HANDLED
Definition: ddrawi.h:321
static VOID NTAPI BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:49
pKey DeleteObject()
static HDC
Definition: imagelist.c:92
#define CONST
Definition: pedump.c:81
#define DX_WINDBG_trace()
Definition: rosdraw.h:262
#define DDBLT_COLORFILL
Definition: ddraw.h:555
#define DDBLT_ROP
Definition: ddraw.h:562
#define DD_OK
Definition: ddraw.h:186
long bottom
Definition: polytest.cpp:53
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
DWORD dwROP
Definition: ddraw.h:1274
DWORD dwFillColor
Definition: ddraw.h:1310
LPDDRAWI_DDRAWSURFACE_LCL lpDDSrcSurface
Definition: ddrawi.h:849
RECTL rSrc
Definition: ddrawi.h:850
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
LPDDRAWI_DDRAWSURFACE_MORE lpSurfMore
Definition: ddrawi.h:1467
LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl
Definition: ddrawi.h:1431
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)

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}

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}

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}

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}

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 */
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 */
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
162}
static HDC hDC
Definition: 3dtext.c:33
#define NULL
Definition: types.h:112
#define GetProcessHeap()
Definition: compat.h:736
#define HeapAlloc
Definition: compat.h:733
#define HeapFree(x, y, z)
Definition: compat.h:735
#define HEAP_ZERO_MEMORY
Definition: compat.h:134
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
Definition: gl.h:1546
static HBITMAP
Definition: button.c:44
DWORD * PDWORD
Definition: pedump.c:68
long LONG
Definition: pedump.c:60
Definition: bl.h:1331
RECTL rArea
Definition: ddrawi.h:831
DWORD bHasRect
Definition: ddrawi.h:830
HRESULT ddRVal
Definition: ddrawi.h:833
LPVOID lpSurfData
Definition: ddrawi.h:832
LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface
Definition: ddrawi.h:829
LPDDRAWI_DDRAWSURFACE_GBL lpGbl
Definition: ddrawi.h:1468
ULONG_PTR hFocusWnd
Definition: ddrawi.h:1184
uint32_t * LPDWORD
Definition: typedefs.h:59
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1539
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define SRCCOPY
Definition: wingdi.h:333
LONG WINAPI GetBitmapBits(_In_ HBITMAP hbit, _In_ LONG cb, _Out_writes_bytes_(cb) LPVOID lpvBits)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
#define GetObject
Definition: wingdi.h:4468
BOOL WINAPI DeleteDC(_In_ HDC)
HDC WINAPI GetDC(_In_opt_ HWND)

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}

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}

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}

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}

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}

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
200
201 /* Get our hdc for the active window */
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 {
247 }
248
250}
LPDDRAWI_DDRAWSURFACE_LCL lpDDSurface
Definition: ddrawi.h:840
HRESULT ddRVal
Definition: ddrawi.h:841
LONG WINAPI SetBitmapBits(_In_ HBITMAP hbm, _In_ DWORD cb, _In_reads_bytes_(cb) CONST VOID *pvBits)

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}

Referenced by StartDirectDrawHel().