Index: ddraw/glClassFactory.cpp |
— | — | @@ -24,11 +24,13 @@ |
25 | 25 |
|
26 | 26 | ULONG WINAPI glClassFactory::AddRef()
|
27 | 27 | {
|
| 28 | + if(!this) return DDERR_INVALIDPARAMS;
|
28 | 29 | refcount++;
|
29 | 30 | return refcount;
|
30 | 31 | }
|
31 | 32 | ULONG WINAPI glClassFactory::Release()
|
32 | 33 | {
|
| 34 | + if(!this) return DDERR_INVALIDPARAMS;
|
33 | 35 | ULONG ret;
|
34 | 36 | refcount--;
|
35 | 37 | ret = refcount;
|
— | — | @@ -38,6 +40,7 @@ |
39 | 41 |
|
40 | 42 | HRESULT WINAPI glClassFactory::QueryInterface(REFIID riid, void** ppvObj)
|
41 | 43 | {
|
| 44 | + if(!this) return DDERR_INVALIDPARAMS;
|
42 | 45 | if((riid == IID_IUnknown) || (riid == IID_IClassFactory))
|
43 | 46 | {
|
44 | 47 | *ppvObj = this;
|
— | — | @@ -52,6 +55,7 @@ |
53 | 56 | }
|
54 | 57 | HRESULT WINAPI glClassFactory::CreateInstance(IUnknown *pUnkOuter, REFIID riid, void **ppvObject)
|
55 | 58 | {
|
| 59 | + if(!this) return DDERR_INVALIDPARAMS;
|
56 | 60 | glDirectDraw7 *glDD7;
|
57 | 61 | if(pUnkOuter != NULL) return CLASS_E_NOAGGREGATION;
|
58 | 62 | if(riid == IID_IDirectDraw)
|
— | — | @@ -86,6 +90,7 @@ |
87 | 91 | }
|
88 | 92 | HRESULT WINAPI glClassFactory::LockServer(BOOL fLock)
|
89 | 93 | {
|
| 94 | + if(!this) return DDERR_INVALIDPARAMS;
|
90 | 95 | if(fLock) InterlockedIncrement(&locks);
|
91 | 96 | else InterlockedDecrement(&locks);
|
92 | 97 | return S_OK;
|
Index: ddraw/glDirect3D.cpp |
— | — | @@ -35,11 +35,13 @@ |
36 | 36 |
|
37 | 37 | ULONG WINAPI glDirect3D7::AddRef()
|
38 | 38 | {
|
| 39 | + if(!this) return 0;
|
39 | 40 | refcount++;
|
40 | 41 | return refcount;
|
41 | 42 | }
|
42 | 43 | ULONG WINAPI glDirect3D7::Release()
|
43 | 44 | {
|
| 45 | + if(!this) return 0;
|
44 | 46 | ULONG ret;
|
45 | 47 | refcount--;
|
46 | 48 | ret = refcount;
|
— | — | @@ -49,6 +51,7 @@ |
50 | 52 |
|
51 | 53 | HRESULT WINAPI glDirect3D7::QueryInterface(REFIID riid, void** ppvObj)
|
52 | 54 | {
|
| 55 | + if(!this) return DDERR_INVALIDPARAMS;
|
53 | 56 | FIXME("glDirect3D7::QueryInterface: stub");
|
54 | 57 | return E_NOINTERFACE;
|
55 | 58 | }
|
— | — | @@ -56,6 +59,7 @@ |
57 | 60 |
|
58 | 61 | HRESULT WINAPI glDirect3D7::CreateDevice(REFCLSID rclsid, LPDIRECTDRAWSURFACE7 lpDDS, LPDIRECT3DDEVICE7 *lplpD3DDevice)
|
59 | 62 | {
|
| 63 | + if(!this) return DDERR_INVALIDPARAMS;
|
60 | 64 | glDirect3DDevice7 *glD3DDev7 = new glDirect3DDevice7(this,(glDirectDrawSurface7*)lpDDS);
|
61 | 65 | *lplpD3DDevice = (LPDIRECT3DDEVICE7) glD3DDev7;
|
62 | 66 | return D3D_OK;
|
— | — | @@ -62,16 +66,19 @@ |
63 | 67 | }
|
64 | 68 | HRESULT WINAPI glDirect3D7::CreateVertexBuffer(LPD3DVERTEXBUFFERDESC lpVBDesc, LPDIRECT3DVERTEXBUFFER7* lplpD3DVertexBuffer, DWORD dwFlags)
|
65 | 69 | {
|
| 70 | + if(!this) return DDERR_INVALIDPARAMS;
|
66 | 71 | FIXME("glDirect3D7::CreateVertexBuffer: stub");
|
67 | 72 | return DDERR_GENERIC;
|
68 | 73 | }
|
69 | 74 | HRESULT WINAPI glDirect3D7::EnumDevices(LPD3DENUMDEVICESCALLBACK7 lpEnumDevicesCallback, LPVOID lpUserArg)
|
70 | 75 | {
|
| 76 | + if(!this) return DDERR_INVALIDPARAMS;
|
71 | 77 | FIXME("glDirect3D7::EnumDevices: stub");
|
72 | 78 | return DDERR_GENERIC;
|
73 | 79 | }
|
74 | 80 | HRESULT WINAPI glDirect3D7::EnumZBufferFormats(REFCLSID riidDevice, LPD3DENUMPIXELFORMATSCALLBACK lpEnumCallback, LPVOID lpContext)
|
75 | 81 | {
|
| 82 | + if(!this) return DDERR_INVALIDPARAMS;
|
76 | 83 | DDPIXELFORMAT ddpf;
|
77 | 84 | ZeroMemory(&ddpf,sizeof(DDPIXELFORMAT));
|
78 | 85 | ddpf.dwSize = sizeof(DDPIXELFORMAT);
|
— | — | @@ -101,6 +108,7 @@ |
102 | 109 | }
|
103 | 110 | HRESULT WINAPI glDirect3D7::EvictManagedTextures()
|
104 | 111 | {
|
| 112 | + if(!this) return DDERR_INVALIDPARAMS;
|
105 | 113 | FIXME("glDirect3D7::EvictManagedTextures: stub");
|
106 | 114 | return DDERR_GENERIC;
|
107 | 115 | }
|
Index: ddraw/glDirect3DDevice.cpp |
— | — | @@ -179,16 +179,19 @@ |
180 | 180 |
|
181 | 181 | HRESULT WINAPI glDirect3DDevice7::QueryInterface(REFIID riid, void** ppvObj)
|
182 | 182 | {
|
| 183 | + if(!this) return DDERR_INVALIDPARAMS;
|
183 | 184 | ERR(E_NOINTERFACE);
|
184 | 185 | }
|
185 | 186 |
|
186 | 187 | ULONG WINAPI glDirect3DDevice7::AddRef()
|
187 | 188 | {
|
| 189 | + if(!this) return 0;
|
188 | 190 | refcount++;
|
189 | 191 | return refcount;
|
190 | 192 | }
|
191 | 193 | ULONG WINAPI glDirect3DDevice7::Release()
|
192 | 194 | {
|
| 195 | + if(!this) return 0;
|
193 | 196 | ULONG ret;
|
194 | 197 | refcount--;
|
195 | 198 | ret = refcount;
|
— | — | @@ -198,11 +201,13 @@ |
199 | 202 |
|
200 | 203 | HRESULT WINAPI glDirect3DDevice7::ApplyStateBlock(DWORD dwBlockHandle)
|
201 | 204 | {
|
| 205 | + if(!this) return DDERR_INVALIDPARAMS;
|
202 | 206 | FIXME("glDirect3DDevice7::ApplyStateBlock: stub");
|
203 | 207 | ERR(DDERR_GENERIC);
|
204 | 208 | }
|
205 | 209 | HRESULT WINAPI glDirect3DDevice7::BeginScene()
|
206 | 210 | {
|
| 211 | + if(!this) return DDERR_INVALIDPARAMS;
|
207 | 212 | if(inscene) return D3DERR_SCENE_IN_SCENE;
|
208 | 213 | inscene = true;
|
209 | 214 | return D3D_OK;
|
— | — | @@ -209,21 +214,25 @@ |
210 | 215 | }
|
211 | 216 | HRESULT WINAPI glDirect3DDevice7::BeginStateBlock()
|
212 | 217 | {
|
| 218 | + if(!this) return DDERR_INVALIDPARAMS;
|
213 | 219 | FIXME("glDirect3DDevice7::BeginStateBlock: stub");
|
214 | 220 | ERR(DDERR_GENERIC);
|
215 | 221 | }
|
216 | 222 | HRESULT WINAPI glDirect3DDevice7::CaptureStateBlock(DWORD dwBlockHandle)
|
217 | 223 | {
|
| 224 | + if(!this) return DDERR_INVALIDPARAMS;
|
218 | 225 | FIXME("glDirect3DDevice7::CaptureStateBlock: stub");
|
219 | 226 | ERR(DDERR_GENERIC);
|
220 | 227 | }
|
221 | 228 | HRESULT WINAPI glDirect3DDevice7::CreateStateBlock(D3DSTATEBLOCKTYPE d3dsbtype, LPDWORD lpdwBlockHandle)
|
222 | 229 | {
|
| 230 | + if(!this) return DDERR_INVALIDPARAMS;
|
223 | 231 | FIXME("glDirect3DDevice7::CreateStateBlock: stub");
|
224 | 232 | ERR(DDERR_GENERIC);
|
225 | 233 | }
|
226 | 234 | HRESULT WINAPI glDirect3DDevice7::Clear(DWORD dwCount, LPD3DRECT lpRects, DWORD dwFlags, DWORD dwColor, D3DVALUE dvZ, DWORD dwStencil)
|
227 | 235 | {
|
| 236 | + if(!this) return DDERR_INVALIDPARAMS;
|
228 | 237 | if(dwCount && !lpRects) return DDERR_INVALIDPARAMS;
|
229 | 238 | if(dwCount) ERR(DDERR_INVALIDPARAMS);
|
230 | 239 | GLfloat color[4];
|
— | — | @@ -251,11 +260,13 @@ |
252 | 261 | HRESULT WINAPI glDirect3DDevice7::ComputeSphereVisibility(LPD3DVECTOR lpCenters, LPD3DVALUE lpRadii, DWORD dwNumSpheres,
|
253 | 262 | DWORD dwFlags, LPDWORD lpdwReturnValues)
|
254 | 263 | {
|
| 264 | + if(!this) return DDERR_INVALIDPARAMS;
|
255 | 265 | FIXME("glDirect3DDevice7::ComputeSphereVisibility: stub");
|
256 | 266 | ERR(DDERR_GENERIC);
|
257 | 267 | }
|
258 | 268 | HRESULT WINAPI glDirect3DDevice7::DeleteStateBlock(DWORD dwBlockHandle)
|
259 | 269 | {
|
| 270 | + if(!this) return DDERR_INVALIDPARAMS;
|
260 | 271 | FIXME("glDirect3DDevice7::DeleteStateBlock: stub");
|
261 | 272 | ERR(DDERR_GENERIC);
|
262 | 273 | }
|
— | — | @@ -291,6 +302,7 @@ |
292 | 303 | HRESULT WINAPI glDirect3DDevice7::DrawIndexedPrimitive(D3DPRIMITIVETYPE d3dptPrimitiveType, DWORD dwVertexTypeDesc,
|
293 | 304 | LPVOID lpvVertices, DWORD dwVertexCount, LPWORD lpwIndices, DWORD dwIndexCount, DWORD dwFlags)
|
294 | 305 | {
|
| 306 | + if(!this) return DDERR_INVALIDPARAMS;
|
295 | 307 | if(!inscene) return D3DERR_SCENE_NOT_IN_SCENE;
|
296 | 308 | int drawmode = setdrawmode(d3dptPrimitiveType);
|
297 | 309 | if(drawmode == -1) return DDERR_INVALIDPARAMS;
|
— | — | @@ -303,6 +315,7 @@ |
304 | 316 | HRESULT WINAPI glDirect3DDevice7::DrawIndexedPrimitiveStrided(D3DPRIMITIVETYPE d3dptPrimitiveType, DWORD dwVertexTypeDesc,
|
305 | 317 | LPD3DDRAWPRIMITIVESTRIDEDDATA lpvVerticexArray, DWORD dwVertexCount, LPWORD lpwIndices, DWORD dwIndexCount, DWORD dwFlags)
|
306 | 318 | {
|
| 319 | + if(!this) return DDERR_INVALIDPARAMS;
|
307 | 320 | FIXME("glDirect3DDevice7::DrawIndexedPrimitiveStrided: stub");
|
308 | 321 | ERR(DDERR_GENERIC);
|
309 | 322 | }
|
— | — | @@ -309,6 +322,7 @@ |
310 | 323 | HRESULT WINAPI glDirect3DDevice7::DrawIndexedPrimitiveVB(D3DPRIMITIVETYPE d3dptPrimitiveType, LPDIRECT3DVERTEXBUFFER7 lpd3dVertexBuffer,
|
311 | 324 | DWORD dwStartVertex, DWORD dwNumVertices, LPWORD lpwIndices, DWORD dwIndexCount, DWORD dwFlags)
|
312 | 325 | {
|
| 326 | + if(!this) return DDERR_INVALIDPARAMS;
|
313 | 327 | FIXME("glDirect3DDevice7::DrawIndexedPrimitiveVB: stub");
|
314 | 328 | ERR(DDERR_GENERIC);
|
315 | 329 | }
|
— | — | @@ -315,6 +329,7 @@ |
316 | 330 | HRESULT WINAPI glDirect3DDevice7::DrawPrimitive(D3DPRIMITIVETYPE dptPrimitiveType, DWORD dwVertexTypeDesc, LPVOID lpVertices,
|
317 | 331 | DWORD dwVertexCount, DWORD dwFlags)
|
318 | 332 | {
|
| 333 | + if(!this) return DDERR_INVALIDPARAMS;
|
319 | 334 | FIXME("glDirect3DDevice7::DrawPrimitive: stub");
|
320 | 335 | ERR(DDERR_GENERIC);
|
321 | 336 | }
|
— | — | @@ -321,6 +336,7 @@ |
322 | 337 | HRESULT WINAPI glDirect3DDevice7::DrawPrimitiveStrided(D3DPRIMITIVETYPE dptPrimitiveType, DWORD dwVertexTypeDesc,
|
323 | 338 | LPD3DDRAWPRIMITIVESTRIDEDDATA lpVertexArray, DWORD dwVertexCount, DWORD dwFlags)
|
324 | 339 | {
|
| 340 | + if(!this) return DDERR_INVALIDPARAMS;
|
325 | 341 | FIXME("glDirect3DDevice7::DrawPrimitiveStrided: stub");
|
326 | 342 | ERR(DDERR_GENERIC);
|
327 | 343 | }
|
— | — | @@ -327,11 +343,13 @@ |
328 | 344 | HRESULT WINAPI glDirect3DDevice7::DrawPrimitiveVB(D3DPRIMITIVETYPE d3dptPrimitiveType, LPDIRECT3DVERTEXBUFFER7 lpd3dVertexBuffer,
|
329 | 345 | DWORD dwStartVertex, DWORD dwNumVertices, DWORD dwFlags)
|
330 | 346 | {
|
| 347 | + if(!this) return DDERR_INVALIDPARAMS;
|
331 | 348 | FIXME("glDirect3DDevice7::DrawPrimitiveVB: stub");
|
332 | 349 | ERR(DDERR_GENERIC);
|
333 | 350 | }
|
334 | 351 | HRESULT WINAPI glDirect3DDevice7::EndScene()
|
335 | 352 | {
|
| 353 | + if(!this) return DDERR_INVALIDPARAMS;
|
336 | 354 | if(!inscene) return D3DERR_SCENE_NOT_IN_SCENE;
|
337 | 355 | inscene = false;
|
338 | 356 | glFlush();
|
— | — | @@ -339,51 +357,61 @@ |
340 | 358 | }
|
341 | 359 | HRESULT WINAPI glDirect3DDevice7::EndStateBlock(LPDWORD lpdwBlockHandle)
|
342 | 360 | {
|
| 361 | + if(!this) return DDERR_INVALIDPARAMS;
|
343 | 362 | FIXME("glDirect3DDevice7::EndStateBlock: stub");
|
344 | 363 | ERR(DDERR_GENERIC);
|
345 | 364 | }
|
346 | 365 | HRESULT WINAPI glDirect3DDevice7::EnumTextureFormats(LPD3DENUMPIXELFORMATSCALLBACK lpd3dEnumPixelProc, LPVOID lpArg)
|
347 | 366 | {
|
| 367 | + if(!this) return DDERR_INVALIDPARAMS;
|
348 | 368 | FIXME("glDirect3DDevice7::EnumTextureFormats: stub");
|
349 | 369 | ERR(DDERR_GENERIC);
|
350 | 370 | }
|
351 | 371 | HRESULT WINAPI glDirect3DDevice7::GetCaps(LPD3DDEVICEDESC7 lpD3DDevDesc)
|
352 | 372 | {
|
| 373 | + if(!this) return DDERR_INVALIDPARAMS;
|
353 | 374 | FIXME("glDirect3DDevice7::GetCaps: stub");
|
354 | 375 | ERR(DDERR_GENERIC);
|
355 | 376 | }
|
356 | 377 | HRESULT WINAPI glDirect3DDevice7::GetClipPlane(DWORD dwIndex, D3DVALUE *pPlaneEquation)
|
357 | 378 | {
|
| 379 | + if(!this) return DDERR_INVALIDPARAMS;
|
358 | 380 | FIXME("glDirect3DDevice7::GetClipPlane: stub");
|
359 | 381 | ERR(DDERR_GENERIC);
|
360 | 382 | }
|
361 | 383 | HRESULT WINAPI glDirect3DDevice7::GetClipStatus(LPD3DCLIPSTATUS lpD3DClipStatus)
|
362 | 384 | {
|
| 385 | + if(!this) return DDERR_INVALIDPARAMS;
|
363 | 386 | FIXME("glDirect3DDevice7::GetClipStatus: stub");
|
364 | 387 | ERR(DDERR_GENERIC);
|
365 | 388 | }
|
366 | 389 | HRESULT WINAPI glDirect3DDevice7::GetDirect3D(LPDIRECT3D7 *lplpD3D)
|
367 | 390 | {
|
| 391 | + if(!this) return DDERR_INVALIDPARAMS;
|
368 | 392 | *lplpD3D = glD3D7;
|
369 | 393 | return D3D_OK;
|
370 | 394 | }
|
371 | 395 | HRESULT WINAPI glDirect3DDevice7::GetInfo(DWORD dwDevInfoID, LPVOID pDevInfoStruct, DWORD dwSize)
|
372 | 396 | {
|
| 397 | + if(!this) return DDERR_INVALIDPARAMS;
|
373 | 398 | FIXME("glDirect3DDevice7::GetInfo: stub");
|
374 | 399 | ERR(DDERR_GENERIC);
|
375 | 400 | }
|
376 | 401 | HRESULT WINAPI glDirect3DDevice7::GetLight(DWORD dwLightIndex, LPD3DLIGHT7 lpLight)
|
377 | 402 | {
|
| 403 | + if(!this) return DDERR_INVALIDPARAMS;
|
378 | 404 | FIXME("glDirect3DDevice7::GetLight: stub");
|
379 | 405 | ERR(DDERR_GENERIC);
|
380 | 406 | }
|
381 | 407 | HRESULT WINAPI glDirect3DDevice7::GetLightEnable(DWORD dwLightIndex, BOOL* pbEnable)
|
382 | 408 | {
|
| 409 | + if(!this) return DDERR_INVALIDPARAMS;
|
383 | 410 | FIXME("glDirect3DDevice7::GetLightEnalbe: stub");
|
384 | 411 | ERR(DDERR_GENERIC);
|
385 | 412 | }
|
386 | 413 | HRESULT WINAPI glDirect3DDevice7::GetMaterial(LPD3DMATERIAL7 lpMaterial)
|
387 | 414 | {
|
| 415 | + if(!this) return DDERR_INVALIDPARAMS;
|
388 | 416 | if(!lpMaterial) return DDERR_INVALIDPARAMS;
|
389 | 417 | memcpy(lpMaterial,&material,sizeof(D3DMATERIAL7));
|
390 | 418 | return D3D_OK;
|
— | — | @@ -390,6 +418,7 @@ |
391 | 419 | }
|
392 | 420 | HRESULT WINAPI glDirect3DDevice7::GetRenderState(D3DRENDERSTATETYPE dwRenderStateType, LPDWORD lpdwRenderState)
|
393 | 421 | {
|
| 422 | + if(!this) return DDERR_INVALIDPARAMS;
|
394 | 423 | if(dwRenderStateType <= 152)
|
395 | 424 | {
|
396 | 425 | *lpdwRenderState = renderstate[dwRenderStateType];
|
— | — | @@ -399,26 +428,31 @@ |
400 | 429 | }
|
401 | 430 | HRESULT WINAPI glDirect3DDevice7::GetRenderTarget(LPDIRECTDRAWSURFACE7 *lplpRenderTarget)
|
402 | 431 | {
|
| 432 | + if(!this) return DDERR_INVALIDPARAMS;
|
403 | 433 | FIXME("glDirect3DDevice7::GetRenderTarget: stub");
|
404 | 434 | ERR(DDERR_GENERIC);
|
405 | 435 | }
|
406 | 436 | HRESULT WINAPI glDirect3DDevice7::GetStateData(DWORD dwState, LPVOID* lplpStateData)
|
407 | 437 | {
|
| 438 | + if(!this) return DDERR_INVALIDPARAMS;
|
408 | 439 | FIXME("glDirect3DDevice7::GetStateData: stub");
|
409 | 440 | ERR(DDERR_GENERIC);
|
410 | 441 | }
|
411 | 442 | HRESULT WINAPI glDirect3DDevice7::GetTexture(DWORD dwStage, LPDIRECTDRAWSURFACE7 *lplpTexture)
|
412 | 443 | {
|
| 444 | + if(!this) return DDERR_INVALIDPARAMS;
|
413 | 445 | FIXME("glDirect3DDevice7::GetTexture: stub");
|
414 | 446 | ERR(DDERR_GENERIC);
|
415 | 447 | }
|
416 | 448 | HRESULT WINAPI glDirect3DDevice7::GetTextureStageState(DWORD dwStage, D3DTEXTURESTAGESTATETYPE dwState, LPDWORD lpdwValue)
|
417 | 449 | {
|
| 450 | + if(!this) return DDERR_INVALIDPARAMS;
|
418 | 451 | FIXME("glDirect3DDevice7::GetTextureStageState: stub");
|
419 | 452 | ERR(DDERR_GENERIC);
|
420 | 453 | }
|
421 | 454 | HRESULT WINAPI glDirect3DDevice7::GetTransform(D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix)
|
422 | 455 | {
|
| 456 | + if(!this) return DDERR_INVALIDPARAMS;
|
423 | 457 | switch(dtstTransformStateType)
|
424 | 458 | {
|
425 | 459 | case D3DTRANSFORMSTATE_WORLD:
|
— | — | @@ -436,11 +470,13 @@ |
437 | 471 | }
|
438 | 472 | HRESULT WINAPI glDirect3DDevice7::GetViewport(LPD3DVIEWPORT7 lpViewport)
|
439 | 473 | {
|
| 474 | + if(!this) return DDERR_INVALIDPARAMS;
|
440 | 475 | memcpy(lpViewport,&viewport,sizeof(D3DVIEWPORT7));
|
441 | 476 | return D3D_OK;
|
442 | 477 | }
|
443 | 478 | HRESULT WINAPI glDirect3DDevice7::LightEnable(DWORD dwLightIndex, BOOL bEnable)
|
444 | 479 | {
|
| 480 | + if(!this) return DDERR_INVALIDPARAMS;
|
445 | 481 | int i;
|
446 | 482 | D3DLIGHT7 light;
|
447 | 483 | bool foundlight = false;
|
— | — | @@ -482,31 +518,37 @@ |
483 | 519 | HRESULT WINAPI glDirect3DDevice7::Load(LPDIRECTDRAWSURFACE7 lpDestTex, LPPOINT lpDestPoint, LPDIRECTDRAWSURFACE7 lpSrcTex,
|
484 | 520 | LPRECT lprcSrcRect, DWORD dwFlags)
|
485 | 521 | {
|
| 522 | + if(!this) return DDERR_INVALIDPARAMS;
|
486 | 523 | FIXME("glDirect3DDevice7::Load: stub");
|
487 | 524 | ERR(DDERR_GENERIC);
|
488 | 525 | }
|
489 | 526 | HRESULT WINAPI glDirect3DDevice7::MultiplyTransform(D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix)
|
490 | 527 | {
|
| 528 | + if(!this) return DDERR_INVALIDPARAMS;
|
491 | 529 | FIXME("glDirect3DDevice7::MultiplyTransform: stub");
|
492 | 530 | ERR(DDERR_GENERIC);
|
493 | 531 | }
|
494 | 532 | HRESULT WINAPI glDirect3DDevice7::PreLoad(LPDIRECTDRAWSURFACE7 lpddsTexture)
|
495 | 533 | {
|
| 534 | + if(!this) return DDERR_INVALIDPARAMS;
|
496 | 535 | FIXME("glDirect3DDevice7::PreLoad: stub");
|
497 | 536 | ERR(DDERR_GENERIC);
|
498 | 537 | }
|
499 | 538 | HRESULT WINAPI glDirect3DDevice7::SetClipPlane(DWORD dwIndex, D3DVALUE* pPlaneEquation)
|
500 | 539 | {
|
| 540 | + if(!this) return DDERR_INVALIDPARAMS;
|
501 | 541 | FIXME("glDirect3DDevice7::SetClipPland: stub");
|
502 | 542 | ERR(DDERR_GENERIC);
|
503 | 543 | }
|
504 | 544 | HRESULT WINAPI glDirect3DDevice7::SetClipStatus(LPD3DCLIPSTATUS lpD3DClipStatus)
|
505 | 545 | {
|
| 546 | + if(!this) return DDERR_INVALIDPARAMS;
|
506 | 547 | FIXME("glDirect3DDevice7::SetClipStatus: stub");
|
507 | 548 | ERR(DDERR_GENERIC);
|
508 | 549 | }
|
509 | 550 | HRESULT WINAPI glDirect3DDevice7::SetLight(DWORD dwLightIndex, LPD3DLIGHT7 lpLight)
|
510 | 551 | {
|
| 552 | + if(!this) return DDERR_INVALIDPARAMS;
|
511 | 553 | bool foundlight = false;
|
512 | 554 | if(dwLightIndex >= lightsmax)
|
513 | 555 | {
|
— | — | @@ -518,6 +560,7 @@ |
519 | 561 | }
|
520 | 562 | HRESULT WINAPI glDirect3DDevice7::SetMaterial(LPD3DMATERIAL7 lpMaterial)
|
521 | 563 | {
|
| 564 | + if(!this) return DDERR_INVALIDPARAMS;
|
522 | 565 | if(!lpMaterial) return DDERR_INVALIDPARAMS;
|
523 | 566 | memcpy(&material,lpMaterial,sizeof(D3DMATERIAL7));
|
524 | 567 | return D3D_OK;
|
— | — | @@ -525,6 +568,7 @@ |
526 | 569 |
|
527 | 570 | HRESULT WINAPI glDirect3DDevice7::SetRenderState(D3DRENDERSTATETYPE dwRendStateType, DWORD dwRenderState)
|
528 | 571 | {
|
| 572 | + if(!this) return DDERR_INVALIDPARAMS;
|
529 | 573 | GLfloat floats[4];
|
530 | 574 | if(dwRendStateType > 152) return DDERR_INVALIDPARAMS;
|
531 | 575 | if(dwRendStateType < 0) return DDERR_INVALIDPARAMS;
|
— | — | @@ -565,26 +609,31 @@ |
566 | 610 | }
|
567 | 611 | HRESULT WINAPI glDirect3DDevice7::SetRenderTarget(LPDIRECTDRAWSURFACE7 lpNewRenderTarget, DWORD dwFlags)
|
568 | 612 | {
|
| 613 | + if(!this) return DDERR_INVALIDPARAMS;
|
569 | 614 | FIXME("glDirect3DDevice7::SetRenderTarget: stub");
|
570 | 615 | ERR(DDERR_GENERIC);
|
571 | 616 | }
|
572 | 617 | HRESULT WINAPI glDirect3DDevice7::SetStateData(DWORD dwState, LPVOID lpStateData)
|
573 | 618 | {
|
| 619 | + if(!this) return DDERR_INVALIDPARAMS;
|
574 | 620 | FIXME("glDirect3DDevice7::SetStateData: stub");
|
575 | 621 | ERR(DDERR_GENERIC);
|
576 | 622 | }
|
577 | 623 | HRESULT WINAPI glDirect3DDevice7::SetTexture(DWORD dwStage, LPDIRECTDRAWSURFACE7 lpTexture)
|
578 | 624 | {
|
| 625 | + if(!this) return DDERR_INVALIDPARAMS;
|
579 | 626 | FIXME("glDirect3DDevice7::SetTexture: stub");
|
580 | 627 | ERR(DDERR_GENERIC);
|
581 | 628 | }
|
582 | 629 | HRESULT WINAPI glDirect3DDevice7::SetTextureStageState(DWORD dwStage, D3DTEXTURESTAGESTATETYPE dwState, DWORD dwValue)
|
583 | 630 | {
|
| 631 | + if(!this) return DDERR_INVALIDPARAMS;
|
584 | 632 | FIXME("glDirect3DDevice7::SetTextureStageState: stub");
|
585 | 633 | ERR(DDERR_GENERIC);
|
586 | 634 | }
|
587 | 635 | HRESULT WINAPI glDirect3DDevice7::SetTransform(D3DTRANSFORMSTATETYPE dtstTransformStateType, LPD3DMATRIX lpD3DMatrix)
|
588 | 636 | {
|
| 637 | + if(!this) return DDERR_INVALIDPARAMS;
|
589 | 638 | switch(dtstTransformStateType)
|
590 | 639 | {
|
591 | 640 | case D3DTRANSFORMSTATE_WORLD:
|
— | — | @@ -602,11 +651,13 @@ |
603 | 652 | }
|
604 | 653 | HRESULT WINAPI glDirect3DDevice7::SetViewport(LPD3DVIEWPORT7 lpViewport)
|
605 | 654 | {
|
| 655 | + if(!this) return DDERR_INVALIDPARAMS;
|
606 | 656 | memcpy(&viewport,lpViewport,sizeof(D3DVIEWPORT7));
|
607 | 657 | return D3D_OK;
|
608 | 658 | }
|
609 | 659 | HRESULT WINAPI glDirect3DDevice7::ValidateDevice(LPDWORD lpdwPasses)
|
610 | 660 | {
|
| 661 | + if(!this) return DDERR_INVALIDPARAMS;
|
611 | 662 | FIXME("glDirect3DDevice7::ValidateDevice: stub");
|
612 | 663 | ERR(DDERR_GENERIC);
|
613 | 664 | } |
\ No newline at end of file |
Index: ddraw/glDirect3DLight.cpp |
— | — | @@ -46,11 +46,13 @@ |
47 | 47 |
|
48 | 48 | ULONG WINAPI glDirect3DLight::AddRef()
|
49 | 49 | {
|
| 50 | + if(!this) return 0;
|
50 | 51 | refcount++;
|
51 | 52 | return refcount;
|
52 | 53 | }
|
53 | 54 | ULONG WINAPI glDirect3DLight::Release()
|
54 | 55 | {
|
| 56 | + if(!this) return 0;
|
55 | 57 | ULONG ret;
|
56 | 58 | refcount--;
|
57 | 59 | ret = refcount;
|
— | — | @@ -60,11 +62,13 @@ |
61 | 63 |
|
62 | 64 | HRESULT WINAPI glDirect3DLight::Initialize(LPDIRECT3D lpDirect3D)
|
63 | 65 | {
|
| 66 | + if(!this) return DDERR_INVALIDPARAMS;
|
64 | 67 | return DDERR_ALREADYINITIALIZED;
|
65 | 68 | }
|
66 | 69 |
|
67 | 70 | HRESULT WINAPI glDirect3DLight::QueryInterface(REFIID riid, void** ppvObj)
|
68 | 71 | {
|
| 72 | + if(!this) return DDERR_INVALIDPARAMS;
|
69 | 73 | return E_NOINTERFACE;
|
70 | 74 | }
|
71 | 75 |
|
— | — | @@ -80,11 +84,13 @@ |
81 | 85 |
|
82 | 86 | HRESULT WINAPI glDirect3DLight::GetLight(LPD3DLIGHT lpLight)
|
83 | 87 | {
|
| 88 | + if(!this) return DDERR_INVALIDPARAMS;
|
84 | 89 | FIXME("glDirect3DLight::GetLight: stub");
|
85 | 90 | ERR(DDERR_GENERIC);
|
86 | 91 | }
|
87 | 92 | HRESULT WINAPI glDirect3DLight::SetLight(LPD3DLIGHT lpLight)
|
88 | 93 | {
|
| 94 | + if(!this) return DDERR_INVALIDPARAMS;
|
89 | 95 | FIXME("glDirect3DLight::SetLight: stub");
|
90 | 96 | ERR(DDERR_GENERIC);
|
91 | 97 | }
|
Index: ddraw/glDirectDraw.cpp |
— | — | @@ -596,6 +596,7 @@ |
597 | 597 |
|
598 | 598 | HRESULT WINAPI glDirectDraw7::QueryInterface(REFIID riid, void** ppvObj)
|
599 | 599 | {
|
| 600 | + if(!this) return DDERR_INVALIDPARAMS;
|
600 | 601 | if(riid == IID_IDirectDraw)
|
601 | 602 | {
|
602 | 603 | // Create an IDirectDraw1 interface
|
— | — | @@ -665,11 +666,13 @@ |
666 | 667 | }
|
667 | 668 | ULONG WINAPI glDirectDraw7::AddRef()
|
668 | 669 | {
|
| 670 | + if(!this) return 0;
|
669 | 671 | refcount++;
|
670 | 672 | return refcount;
|
671 | 673 | }
|
672 | 674 | ULONG WINAPI glDirectDraw7::Release()
|
673 | 675 | {
|
| 676 | + if(!this) return 0;
|
674 | 677 | ULONG ret;
|
675 | 678 | refcount--;
|
676 | 679 | ret = refcount;
|
— | — | @@ -679,10 +682,12 @@ |
680 | 683 | }
|
681 | 684 | HRESULT WINAPI glDirectDraw7::Compact()
|
682 | 685 | {
|
| 686 | + if(!this) return DDERR_INVALIDPARAMS;
|
683 | 687 | return DD_OK;
|
684 | 688 | }
|
685 | 689 | HRESULT WINAPI glDirectDraw7::CreateClipper(DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter)
|
686 | 690 | {
|
| 691 | + if(!this) return DDERR_INVALIDPARAMS;
|
687 | 692 | clippercount++;
|
688 | 693 | if(clippercount > clippercountmax)
|
689 | 694 | {
|
— | — | @@ -700,11 +705,13 @@ |
701 | 706 | }
|
702 | 707 | HRESULT WINAPI glDirectDraw7::CreatePalette(DWORD dwFlags, LPPALETTEENTRY lpDDColorArray, LPDIRECTDRAWPALETTE FAR *lplpDDPalette, IUnknown FAR *pUnkOuter)
|
703 | 708 | {
|
| 709 | + if(!this) return DDERR_INVALIDPARAMS;
|
704 | 710 | glDirectDrawPalette *pal = new glDirectDrawPalette(dwFlags,lpDDColorArray,lplpDDPalette);
|
705 | 711 | return DD_OK;
|
706 | 712 | }
|
707 | 713 | HRESULT WINAPI glDirectDraw7::CreateSurface(LPDDSURFACEDESC2 lpDDSurfaceDesc2, LPDIRECTDRAWSURFACE7 FAR *lplpDDSurface, IUnknown FAR *pUnkOuter)
|
708 | 714 | {
|
| 715 | + if(!this) return DDERR_INVALIDPARAMS;
|
709 | 716 | if(!lpDDSurfaceDesc2) return DDERR_INVALIDPARAMS;
|
710 | 717 | if(primary && (lpDDSurfaceDesc2->ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) && (renderer->hRC == primary->hRC) )
|
711 | 718 | {
|
— | — | @@ -740,20 +747,24 @@ |
741 | 748 | }
|
742 | 749 | HRESULT WINAPI glDirectDraw7::DuplicateSurface(LPDIRECTDRAWSURFACE7 lpDDSurface, LPDIRECTDRAWSURFACE7 FAR *lplpDupDDSurface)
|
743 | 750 | {
|
| 751 | + if(!this) return DDERR_INVALIDPARAMS;
|
744 | 752 | FIXME("IDirectDraw::DuplicateSurface: stub\n");
|
745 | 753 | ERR(DDERR_GENERIC);
|
746 | 754 | }
|
747 | 755 | HRESULT WINAPI glDirectDraw7::EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC2 lpDDSurfaceDesc2, LPVOID lpContext, LPDDENUMMODESCALLBACK2 lpEnumModesCallback)
|
748 | 756 | {
|
| 757 | + if(!this) return DDERR_INVALIDPARAMS;
|
749 | 758 | return ::EnumDisplayModes(dwFlags,lpDDSurfaceDesc2,lpContext,lpEnumModesCallback);
|
750 | 759 | }
|
751 | 760 | HRESULT WINAPI glDirectDraw7::EnumSurfaces(DWORD dwFlags, LPDDSURFACEDESC2 lpDDSD2, LPVOID lpContext, LPDDENUMSURFACESCALLBACK7 lpEnumSurfacesCallback)
|
752 | 761 | {
|
| 762 | + if(!this) return DDERR_INVALIDPARAMS;
|
753 | 763 | FIXME("IDirectDraw::EnumSurfaces: stub\n");
|
754 | 764 | ERR(DDERR_GENERIC);
|
755 | 765 | }
|
756 | 766 | HRESULT WINAPI glDirectDraw7::FlipToGDISurface()
|
757 | 767 | {
|
| 768 | + if(!this) return DDERR_INVALIDPARAMS;
|
758 | 769 | HRESULT error = DD_OK;
|
759 | 770 | if(primary)
|
760 | 771 | {
|
— | — | @@ -771,6 +782,7 @@ |
772 | 783 | }
|
773 | 784 | HRESULT WINAPI glDirectDraw7::GetCaps(LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps)
|
774 | 785 | {
|
| 786 | + if(!this) return DDERR_INVALIDPARAMS;
|
775 | 787 | //TODO: Fill in as implemented.
|
776 | 788 | DDCAPS_DX7 ddCaps;
|
777 | 789 | ZeroMemory(&ddCaps,sizeof(DDCAPS_DX7));
|
— | — | @@ -795,6 +807,7 @@ |
796 | 808 | }
|
797 | 809 | HRESULT WINAPI glDirectDraw7::GetDisplayMode(LPDDSURFACEDESC2 lpDDSurfaceDesc2)
|
798 | 810 | {
|
| 811 | + if(!this) return DDERR_INVALIDPARAMS;
|
799 | 812 | if(!lpDDSurfaceDesc2) ERR(DDERR_INVALIDPARAMS);
|
800 | 813 | DDSURFACEDESC2 ddsdMode;
|
801 | 814 | ZeroMemory(&ddsdMode, sizeof(DDSURFACEDESC2));
|
— | — | @@ -880,16 +893,19 @@ |
881 | 894 | }
|
882 | 895 | HRESULT WINAPI glDirectDraw7::GetFourCCCodes(LPDWORD lpNumCodes, LPDWORD lpCodes)
|
883 | 896 | {
|
| 897 | + if(!this) return DDERR_INVALIDPARAMS;
|
884 | 898 | FIXME("IDirectDraw::GetFourCCCodes: stub\n");
|
885 | 899 | ERR(DDERR_GENERIC);
|
886 | 900 | }
|
887 | 901 | HRESULT WINAPI glDirectDraw7::GetGDISurface(LPDIRECTDRAWSURFACE7 FAR *lplpGDIDDSurface)
|
888 | 902 | {
|
| 903 | + if(!this) return DDERR_INVALIDPARAMS;
|
889 | 904 | FIXME("IDirectDraw::GetGDISurface: stub\n");
|
890 | 905 | ERR(DDERR_GENERIC);
|
891 | 906 | }
|
892 | 907 | HRESULT WINAPI glDirectDraw7::GetMonitorFrequency(LPDWORD lpdwFrequency)
|
893 | 908 | {
|
| 909 | + if(!this) return DDERR_INVALIDPARAMS;
|
894 | 910 | DEBUG("IDirectDraw::GetMonitorFrequency: support multi-monitor\n");
|
895 | 911 | DEVMODE devmode;
|
896 | 912 | devmode.dmSize = sizeof(DEVMODE);
|
— | — | @@ -899,16 +915,19 @@ |
900 | 916 | }
|
901 | 917 | HRESULT WINAPI glDirectDraw7::GetScanLine(LPDWORD lpdwScanLine)
|
902 | 918 | {
|
| 919 | + if(!this) return DDERR_INVALIDPARAMS;
|
903 | 920 | FIXME("IDirectDraw::GetScanLine: stub\n");
|
904 | 921 | ERR(DDERR_GENERIC);
|
905 | 922 | }
|
906 | 923 | HRESULT WINAPI glDirectDraw7::GetVerticalBlankStatus(LPBOOL lpbIsInVB)
|
907 | 924 | {
|
| 925 | + if(!this) return DDERR_INVALIDPARAMS;
|
908 | 926 | FIXME("IDirectDraw::GetVerticalBlankStatus: stub\n");
|
909 | 927 | ERR(DDERR_GENERIC);
|
910 | 928 | }
|
911 | 929 | HRESULT WINAPI glDirectDraw7::Initialize(GUID FAR *lpGUID)
|
912 | 930 | {
|
| 931 | + if(!this) return DDERR_INVALIDPARAMS;
|
913 | 932 | if(initialized) return DDERR_ALREADYINITIALIZED;
|
914 | 933 | primarylost = true;
|
915 | 934 | glD3D7 = NULL;
|
— | — | @@ -953,6 +972,7 @@ |
954 | 973 | }
|
955 | 974 | HRESULT WINAPI glDirectDraw7::RestoreDisplayMode()
|
956 | 975 | {
|
| 976 | + if(!this) return DDERR_INVALIDPARAMS;
|
957 | 977 | if(oldmode.dmSize != 0)
|
958 | 978 | {
|
959 | 979 | ChangeDisplaySettingsEx(NULL,&oldmode,NULL,0,NULL);
|
— | — | @@ -961,6 +981,7 @@ |
962 | 982 | }
|
963 | 983 | HRESULT WINAPI glDirectDraw7::SetCooperativeLevel(HWND hWnd, DWORD dwFlags)
|
964 | 984 | {
|
| 985 | + if(!this) return DDERR_INVALIDPARAMS;
|
965 | 986 | this->hWnd = hWnd;
|
966 | 987 | if(renderer) DeleteGL();
|
967 | 988 | winstyle = GetWindowLongPtrA(hWnd,GWL_STYLE);
|
— | — | @@ -1090,6 +1111,7 @@ |
1091 | 1112 |
|
1092 | 1113 | HRESULT WINAPI glDirectDraw7::SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags)
|
1093 | 1114 | {
|
| 1115 | + if(!this) return DDERR_INVALIDPARAMS;
|
1094 | 1116 | DEBUG("IDirectDraw::SetDisplayMode: implement multiple monitors\n");
|
1095 | 1117 | DEVMODE newmode,newmode2;
|
1096 | 1118 | DEVMODE currmode;
|
— | — | @@ -1286,6 +1308,7 @@ |
1287 | 1309 | }
|
1288 | 1310 | HRESULT WINAPI glDirectDraw7::WaitForVerticalBlank(DWORD dwFlags, HANDLE hEvent)
|
1289 | 1311 | {
|
| 1312 | + if(!this) return DDERR_INVALIDPARAMS;
|
1290 | 1313 | if(dwFlags & DDWAITVB_BLOCKBEGINEVENT) return DDERR_UNSUPPORTED;
|
1291 | 1314 | swapinterval=1;
|
1292 | 1315 | primary->RenderScreen(primary->texture,primary);
|
— | — | @@ -1294,26 +1317,32 @@ |
1295 | 1318 | }
|
1296 | 1319 | HRESULT WINAPI glDirectDraw7::GetAvailableVidMem(LPDDSCAPS2 lpDDSCaps2, LPDWORD lpdwTotal, LPDWORD lpdwFree)
|
1297 | 1320 | {
|
| 1321 | + if(!this) return DDERR_INVALIDPARAMS;
|
1298 | 1322 | FIXME("IDirectDraw::GetAvailableVidMem: stub\n");
|
1299 | 1323 | ERR(DDERR_GENERIC);
|
1300 | 1324 | }
|
1301 | 1325 | HRESULT WINAPI glDirectDraw7::GetSurfaceFromDC(HDC hdc, LPDIRECTDRAWSURFACE7 *lpDDS)
|
1302 | 1326 | {
|
| 1327 | + if(!this) return DDERR_INVALIDPARAMS;
|
1303 | 1328 | FIXME("IDirectDraw::GetSurfaceFromDC: stub\n");
|
1304 | 1329 | ERR(DDERR_GENERIC);
|
1305 | 1330 | }
|
1306 | 1331 | HRESULT WINAPI glDirectDraw7::RestoreAllSurfaces()
|
1307 | 1332 | {
|
| 1333 | + if(!this) return DDERR_INVALIDPARAMS;
|
1308 | 1334 | FIXME("IDirectDraw::RestoreAllSurfaces: stub\n");
|
1309 | 1335 | ERR(DDERR_GENERIC);
|
1310 | 1336 | }
|
1311 | 1337 | HRESULT WINAPI glDirectDraw7::TestCooperativeLevel()
|
1312 | 1338 | {
|
| 1339 | + if(!this) return DDERR_INVALIDPARAMS;
|
1313 | 1340 | FIXME("IDirectDraw::TestCooperativeLevel: stub\n");
|
1314 | 1341 | ERR(DDERR_GENERIC);
|
1315 | 1342 | }
|
1316 | 1343 | HRESULT WINAPI glDirectDraw7::GetDeviceIdentifier(LPDDDEVICEIDENTIFIER2 lpdddi, DWORD dwFlags)
|
1317 | 1344 | {
|
| 1345 | + if(!this) return DDERR_INVALIDPARAMS;
|
| 1346 | + if(!lpdddi) return DDERR_INVALIDPARAMS;
|
1318 | 1347 | devid.guidDeviceIdentifier = device_template;
|
1319 | 1348 | memcpy(lpdddi,&devid,sizeof(DDDEVICEIDENTIFIER2));
|
1320 | 1349 | return DD_OK;
|
— | — | @@ -1320,11 +1349,13 @@ |
1321 | 1350 | }
|
1322 | 1351 | HRESULT WINAPI glDirectDraw7::StartModeTest(LPSIZE lpModesToTest, DWORD dwNumEntries, DWORD dwFlags)
|
1323 | 1352 | {
|
| 1353 | + if(!this) return DDERR_INVALIDPARAMS;
|
1324 | 1354 | FIXME("IDirectDraw::StartModeTest: stub\n");
|
1325 | 1355 | ERR(DDERR_GENERIC);
|
1326 | 1356 | }
|
1327 | 1357 | HRESULT WINAPI glDirectDraw7::EvaluateMode(DWORD dwFlags, DWORD *pSecondsUntilTimeout)
|
1328 | 1358 | {
|
| 1359 | + if(!this) return DDERR_INVALIDPARAMS;
|
1329 | 1360 | FIXME("IDirectDraw::EvaluateMode: stub\n");
|
1330 | 1361 | ERR(DDERR_GENERIC);
|
1331 | 1362 | }
|
— | — | @@ -1370,15 +1401,18 @@ |
1371 | 1402 | }
|
1372 | 1403 | HRESULT WINAPI glDirectDraw1::QueryInterface(REFIID riid, void** ppvObj)
|
1373 | 1404 | {
|
| 1405 | + if(!this) return DDERR_INVALIDPARAMS;
|
1374 | 1406 | return glDD7->QueryInterface(riid,ppvObj);
|
1375 | 1407 | }
|
1376 | 1408 | ULONG WINAPI glDirectDraw1::AddRef()
|
1377 | 1409 | {
|
| 1410 | + if(!this) return 0;
|
1378 | 1411 | refcount++;
|
1379 | 1412 | return refcount;
|
1380 | 1413 | }
|
1381 | 1414 | ULONG WINAPI glDirectDraw1::Release()
|
1382 | 1415 | {
|
| 1416 | + if(!this) return 0;
|
1383 | 1417 | ULONG ret;
|
1384 | 1418 | refcount--;
|
1385 | 1419 | ret = refcount;
|
— | — | @@ -1387,18 +1421,22 @@ |
1388 | 1422 | }
|
1389 | 1423 | HRESULT WINAPI glDirectDraw1::Compact()
|
1390 | 1424 | {
|
| 1425 | + if(!this) return DDERR_INVALIDPARAMS;
|
1391 | 1426 | return glDD7->Compact();
|
1392 | 1427 | }
|
1393 | 1428 | HRESULT WINAPI glDirectDraw1::CreateClipper(DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter)
|
1394 | 1429 | {
|
| 1430 | + if(!this) return DDERR_INVALIDPARAMS;
|
1395 | 1431 | return glDD7->CreateClipper(dwFlags,lplpDDClipper,pUnkOuter);
|
1396 | 1432 | }
|
1397 | 1433 | HRESULT WINAPI glDirectDraw1::CreatePalette(DWORD dwFlags, LPPALETTEENTRY lpDDColorArray, LPDIRECTDRAWPALETTE FAR *lplpDDPalette, IUnknown FAR *pUnkOuter)
|
1398 | 1434 | {
|
| 1435 | + if(!this) return DDERR_INVALIDPARAMS;
|
1399 | 1436 | return glDD7->CreatePalette(dwFlags,lpDDColorArray,lplpDDPalette,pUnkOuter);
|
1400 | 1437 | }
|
1401 | 1438 | HRESULT WINAPI glDirectDraw1::CreateSurface(LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE FAR *lplpDDSurface, IUnknown FAR *pUnkOuter)
|
1402 | 1439 | {
|
| 1440 | + if(!this) return DDERR_INVALIDPARAMS;
|
1403 | 1441 | LPDIRECTDRAWSURFACE7 lpDDS7;
|
1404 | 1442 | HRESULT err = glDD7->CreateSurface((LPDDSURFACEDESC2)lpDDSurfaceDesc,&lpDDS7,pUnkOuter);
|
1405 | 1443 | if(err == DD_OK)
|
— | — | @@ -1411,69 +1449,85 @@ |
1412 | 1450 | }
|
1413 | 1451 | HRESULT WINAPI glDirectDraw1::DuplicateSurface(LPDIRECTDRAWSURFACE lpDDSurface, LPDIRECTDRAWSURFACE FAR *lplpDupDDSurface)
|
1414 | 1452 | {
|
| 1453 | + if(!this) return DDERR_INVALIDPARAMS;
|
1415 | 1454 | FIXME("glDirectDraw1::DuplicateSurface: stub\n");
|
1416 | 1455 | ERR(DDERR_GENERIC);
|
1417 | 1456 | }
|
1418 | 1457 | HRESULT WINAPI glDirectDraw1::EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK lpEnumModesCallback)
|
1419 | 1458 | {
|
| 1459 | + if(!this) return DDERR_INVALIDPARAMS;
|
1420 | 1460 | return ::EnumDisplayModes(dwFlags,lpDDSurfaceDesc,lpContext,lpEnumModesCallback);
|
1421 | 1461 | }
|
1422 | 1462 | HRESULT WINAPI glDirectDraw1::EnumSurfaces(DWORD dwFlags, LPDDSURFACEDESC lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback)
|
1423 | 1463 | {
|
| 1464 | + if(!this) return DDERR_INVALIDPARAMS;
|
1424 | 1465 | FIXME("glDirectDraw1::EnumSurfaces: stub\n");
|
1425 | 1466 | ERR(DDERR_GENERIC);
|
1426 | 1467 | }
|
1427 | 1468 | HRESULT WINAPI glDirectDraw1::FlipToGDISurface()
|
1428 | 1469 | {
|
| 1470 | + if(!this) return DDERR_INVALIDPARAMS;
|
1429 | 1471 | return glDD7->FlipToGDISurface();
|
1430 | 1472 | }
|
1431 | 1473 | HRESULT WINAPI glDirectDraw1::GetCaps(LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps)
|
1432 | 1474 | {
|
| 1475 | + if(!this) return DDERR_INVALIDPARAMS;
|
1433 | 1476 | return glDD7->GetCaps(lpDDDriverCaps,lpDDHELCaps);
|
1434 | 1477 | }
|
1435 | 1478 | HRESULT WINAPI glDirectDraw1::GetDisplayMode(LPDDSURFACEDESC lpDDSurfaceDesc)
|
1436 | 1479 | {
|
| 1480 | + if(!this) return DDERR_INVALIDPARAMS;
|
1437 | 1481 | return glDD7->GetDisplayMode((LPDDSURFACEDESC2)lpDDSurfaceDesc);
|
1438 | 1482 | }
|
1439 | 1483 | HRESULT WINAPI glDirectDraw1::GetFourCCCodes(LPDWORD lpNumCodes, LPDWORD lpCodes)
|
1440 | 1484 | {
|
| 1485 | + if(!this) return DDERR_INVALIDPARAMS;
|
1441 | 1486 | return glDD7->GetFourCCCodes(lpNumCodes,lpCodes);
|
1442 | 1487 | }
|
1443 | 1488 | HRESULT WINAPI glDirectDraw1::GetGDISurface(LPDIRECTDRAWSURFACE FAR *lplpGDIDDSurface)
|
1444 | 1489 | {
|
| 1490 | + if(!this) return DDERR_INVALIDPARAMS;
|
1445 | 1491 | FIXME("glDirectDraw1::GetGDISurface: stub\n");
|
1446 | 1492 | ERR(DDERR_GENERIC);
|
1447 | 1493 | }
|
1448 | 1494 | HRESULT WINAPI glDirectDraw1::GetMonitorFrequency(LPDWORD lpdwFrequency)
|
1449 | 1495 | {
|
| 1496 | + if(!this) return DDERR_INVALIDPARAMS;
|
1450 | 1497 | return glDD7->GetMonitorFrequency(lpdwFrequency);
|
1451 | 1498 | }
|
1452 | 1499 | HRESULT WINAPI glDirectDraw1::GetScanLine(LPDWORD lpdwScanLine)
|
1453 | 1500 | {
|
| 1501 | + if(!this) return DDERR_INVALIDPARAMS;
|
1454 | 1502 | return glDD7->GetScanLine(lpdwScanLine);
|
1455 | 1503 | }
|
1456 | 1504 | HRESULT WINAPI glDirectDraw1::GetVerticalBlankStatus(LPBOOL lpbIsInVB)
|
1457 | 1505 | {
|
| 1506 | + if(!this) return DDERR_INVALIDPARAMS;
|
1458 | 1507 | return glDD7->GetVerticalBlankStatus(lpbIsInVB);
|
1459 | 1508 | }
|
1460 | 1509 | HRESULT WINAPI glDirectDraw1::Initialize(GUID FAR *lpGUID)
|
1461 | 1510 | {
|
| 1511 | + if(!this) return DDERR_INVALIDPARAMS;
|
1462 | 1512 | return glDD7->Initialize(lpGUID);
|
1463 | 1513 | }
|
1464 | 1514 | HRESULT WINAPI glDirectDraw1::RestoreDisplayMode()
|
1465 | 1515 | {
|
| 1516 | + if(!this) return DDERR_INVALIDPARAMS;
|
1466 | 1517 | return glDD7->RestoreDisplayMode();
|
1467 | 1518 | }
|
1468 | 1519 | HRESULT WINAPI glDirectDraw1::SetCooperativeLevel(HWND hWnd, DWORD dwFlags)
|
1469 | 1520 | {
|
| 1521 | + if(!this) return DDERR_INVALIDPARAMS;
|
1470 | 1522 | return glDD7->SetCooperativeLevel(hWnd,dwFlags);
|
1471 | 1523 | }
|
1472 | 1524 | HRESULT WINAPI glDirectDraw1::SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP)
|
1473 | 1525 | {
|
| 1526 | + if(!this) return DDERR_INVALIDPARAMS;
|
1474 | 1527 | return glDD7->SetDisplayMode(dwWidth,dwHeight,dwBPP,0,0);
|
1475 | 1528 | }
|
1476 | 1529 | HRESULT WINAPI glDirectDraw1::WaitForVerticalBlank(DWORD dwFlags, HANDLE hEvent)
|
1477 | 1530 | {
|
| 1531 | + if(!this) return DDERR_INVALIDPARAMS;
|
1478 | 1532 | return glDD7->WaitForVerticalBlank(dwFlags,hEvent);
|
1479 | 1533 | }
|
1480 | 1534 | // DDRAW2 wrapper
|
— | — | @@ -1489,15 +1543,18 @@ |
1490 | 1544 | }
|
1491 | 1545 | HRESULT WINAPI glDirectDraw2::QueryInterface(REFIID riid, void** ppvObj)
|
1492 | 1546 | {
|
| 1547 | + if(!this) return DDERR_INVALIDPARAMS;
|
1493 | 1548 | return glDD7->QueryInterface(riid,ppvObj);
|
1494 | 1549 | }
|
1495 | 1550 | ULONG WINAPI glDirectDraw2::AddRef()
|
1496 | 1551 | {
|
| 1552 | + if(!this) return 0;
|
1497 | 1553 | refcount++;
|
1498 | 1554 | return refcount;
|
1499 | 1555 | }
|
1500 | 1556 | ULONG WINAPI glDirectDraw2::Release()
|
1501 | 1557 | {
|
| 1558 | + if(!this) return 0;
|
1502 | 1559 | ULONG ret;
|
1503 | 1560 | refcount--;
|
1504 | 1561 | ret = refcount;
|
— | — | @@ -1506,18 +1563,22 @@ |
1507 | 1564 | }
|
1508 | 1565 | HRESULT WINAPI glDirectDraw2::Compact()
|
1509 | 1566 | {
|
| 1567 | + if(!this) return DDERR_INVALIDPARAMS;
|
1510 | 1568 | return glDD7->Compact();
|
1511 | 1569 | }
|
1512 | 1570 | HRESULT WINAPI glDirectDraw2::CreateClipper(DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter)
|
1513 | 1571 | {
|
| 1572 | + if(!this) return DDERR_INVALIDPARAMS;
|
1514 | 1573 | return glDD7->CreateClipper(dwFlags,lplpDDClipper,pUnkOuter);
|
1515 | 1574 | }
|
1516 | 1575 | HRESULT WINAPI glDirectDraw2::CreatePalette(DWORD dwFlags, LPPALETTEENTRY lpDDColorArray, LPDIRECTDRAWPALETTE FAR *lplpDDPalette, IUnknown FAR *pUnkOuter)
|
1517 | 1576 | {
|
| 1577 | + if(!this) return DDERR_INVALIDPARAMS;
|
1518 | 1578 | return glDD7->CreatePalette(dwFlags,lpDDColorArray,lplpDDPalette,pUnkOuter);
|
1519 | 1579 | }
|
1520 | 1580 | HRESULT WINAPI glDirectDraw2::CreateSurface(LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE FAR *lplpDDSurface, IUnknown FAR *pUnkOuter)
|
1521 | 1581 | {
|
| 1582 | + if(!this) return DDERR_INVALIDPARAMS;
|
1522 | 1583 | if(!lplpDDSurface) return DDERR_INVALIDPARAMS;
|
1523 | 1584 | LPDIRECTDRAWSURFACE7 lpDDS7;
|
1524 | 1585 | HRESULT err = glDD7->CreateSurface((LPDDSURFACEDESC2)lpDDSurfaceDesc,&lpDDS7,pUnkOuter);
|
— | — | @@ -1531,73 +1592,90 @@ |
1532 | 1593 | }
|
1533 | 1594 | HRESULT WINAPI glDirectDraw2::DuplicateSurface(LPDIRECTDRAWSURFACE lpDDSurface, LPDIRECTDRAWSURFACE FAR *lplpDupDDSurface)
|
1534 | 1595 | {
|
| 1596 | + if(!this) return DDERR_INVALIDPARAMS;
|
1535 | 1597 | FIXME("glDirectDraw2::DuplicateSurface: stub\n");
|
1536 | 1598 | ERR(DDERR_GENERIC);
|
1537 | 1599 | }
|
1538 | 1600 | HRESULT WINAPI glDirectDraw2::EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK lpEnumModesCallback)
|
1539 | 1601 | {
|
| 1602 | + if(!this) return DDERR_INVALIDPARAMS;
|
1540 | 1603 | return ::EnumDisplayModes(dwFlags,lpDDSurfaceDesc,lpContext,lpEnumModesCallback);
|
1541 | 1604 | }
|
1542 | 1605 | HRESULT WINAPI glDirectDraw2::EnumSurfaces(DWORD dwFlags, LPDDSURFACEDESC lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback)
|
1543 | 1606 | {
|
| 1607 | + if(!this) return DDERR_INVALIDPARAMS;
|
1544 | 1608 | FIXME("glDirectDraw2::EnumSurfaces: stub\n");
|
1545 | 1609 | ERR(DDERR_GENERIC);
|
1546 | 1610 | }
|
1547 | 1611 | HRESULT WINAPI glDirectDraw2::FlipToGDISurface()
|
1548 | 1612 | {
|
| 1613 | + if(!this) return DDERR_INVALIDPARAMS;
|
1549 | 1614 | return glDD7->FlipToGDISurface();
|
1550 | 1615 | }
|
1551 | 1616 | HRESULT WINAPI glDirectDraw2::GetCaps(LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps)
|
1552 | 1617 | {
|
| 1618 | + if(!this) return DDERR_INVALIDPARAMS;
|
1553 | 1619 | return glDD7->GetCaps(lpDDDriverCaps,lpDDHELCaps);
|
1554 | 1620 | }
|
1555 | 1621 | HRESULT WINAPI glDirectDraw2::GetDisplayMode(LPDDSURFACEDESC lpDDSurfaceDesc)
|
1556 | 1622 | {
|
| 1623 | + if(!this) return DDERR_INVALIDPARAMS;
|
1557 | 1624 | return glDD7->GetDisplayMode((LPDDSURFACEDESC2)lpDDSurfaceDesc);
|
1558 | 1625 | }
|
1559 | 1626 | HRESULT WINAPI glDirectDraw2::GetFourCCCodes(LPDWORD lpNumCodes, LPDWORD lpCodes)
|
1560 | 1627 | {
|
| 1628 | + if(!this) return DDERR_INVALIDPARAMS;
|
1561 | 1629 | return glDD7->GetFourCCCodes(lpNumCodes,lpCodes);
|
1562 | 1630 | }
|
1563 | 1631 | HRESULT WINAPI glDirectDraw2::GetGDISurface(LPDIRECTDRAWSURFACE FAR *lplpGDIDDSurface)
|
1564 | 1632 | {
|
| 1633 | + if(!this) return DDERR_INVALIDPARAMS;
|
1565 | 1634 | FIXME("glDirectDraw2::GetGDISurface: stub\n");
|
1566 | 1635 | ERR(DDERR_GENERIC);
|
1567 | 1636 | }
|
1568 | 1637 | HRESULT WINAPI glDirectDraw2::GetMonitorFrequency(LPDWORD lpdwFrequency)
|
1569 | 1638 | {
|
| 1639 | + if(!this) return DDERR_INVALIDPARAMS;
|
1570 | 1640 | return glDD7->GetMonitorFrequency(lpdwFrequency);
|
1571 | 1641 | }
|
1572 | 1642 | HRESULT WINAPI glDirectDraw2::GetScanLine(LPDWORD lpdwScanLine)
|
1573 | 1643 | {
|
| 1644 | + if(!this) return DDERR_INVALIDPARAMS;
|
1574 | 1645 | return glDD7->GetScanLine(lpdwScanLine);
|
1575 | 1646 | }
|
1576 | 1647 | HRESULT WINAPI glDirectDraw2::GetVerticalBlankStatus(LPBOOL lpbIsInVB)
|
1577 | 1648 | {
|
| 1649 | + if(!this) return DDERR_INVALIDPARAMS;
|
1578 | 1650 | return glDD7->GetVerticalBlankStatus(lpbIsInVB);
|
1579 | 1651 | }
|
1580 | 1652 | HRESULT WINAPI glDirectDraw2::Initialize(GUID FAR *lpGUID)
|
1581 | 1653 | {
|
| 1654 | + if(!this) return DDERR_INVALIDPARAMS;
|
1582 | 1655 | return glDD7->Initialize(lpGUID);
|
1583 | 1656 | }
|
1584 | 1657 | HRESULT WINAPI glDirectDraw2::RestoreDisplayMode()
|
1585 | 1658 | {
|
| 1659 | + if(!this) return DDERR_INVALIDPARAMS;
|
1586 | 1660 | return glDD7->RestoreDisplayMode();
|
1587 | 1661 | }
|
1588 | 1662 | HRESULT WINAPI glDirectDraw2::SetCooperativeLevel(HWND hWnd, DWORD dwFlags)
|
1589 | 1663 | {
|
| 1664 | + if(!this) return DDERR_INVALIDPARAMS;
|
1590 | 1665 | return glDD7->SetCooperativeLevel(hWnd,dwFlags);
|
1591 | 1666 | }
|
1592 | 1667 | HRESULT WINAPI glDirectDraw2::SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags)
|
1593 | 1668 | {
|
| 1669 | + if(!this) return DDERR_INVALIDPARAMS;
|
1594 | 1670 | return glDD7->SetDisplayMode(dwWidth,dwHeight,dwBPP,dwRefreshRate,dwFlags);
|
1595 | 1671 | }
|
1596 | 1672 | HRESULT WINAPI glDirectDraw2::WaitForVerticalBlank(DWORD dwFlags, HANDLE hEvent)
|
1597 | 1673 | {
|
| 1674 | + if(!this) return DDERR_INVALIDPARAMS;
|
1598 | 1675 | return glDD7->WaitForVerticalBlank(dwFlags,hEvent);
|
1599 | 1676 | }
|
1600 | 1677 | HRESULT WINAPI glDirectDraw2::GetAvailableVidMem(LPDDSCAPS lpDDSCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree)
|
1601 | 1678 | {
|
| 1679 | + if(!this) return DDERR_INVALIDPARAMS;
|
1602 | 1680 | MEMORYSTATUS memstatus;
|
1603 | 1681 | memstatus.dwLength = sizeof(MEMORYSTATUS);
|
1604 | 1682 | GlobalMemoryStatus(&memstatus);
|
— | — | @@ -1617,15 +1695,18 @@ |
1618 | 1696 | }
|
1619 | 1697 | HRESULT WINAPI glDirectDraw4::QueryInterface(REFIID riid, void** ppvObj)
|
1620 | 1698 | {
|
| 1699 | + if(!this) return DDERR_INVALIDPARAMS;
|
1621 | 1700 | return glDD7->QueryInterface(riid,ppvObj);
|
1622 | 1701 | }
|
1623 | 1702 | ULONG WINAPI glDirectDraw4::AddRef()
|
1624 | 1703 | {
|
| 1704 | + if(!this) return 0;
|
1625 | 1705 | refcount++;
|
1626 | 1706 | return refcount;
|
1627 | 1707 | }
|
1628 | 1708 | ULONG WINAPI glDirectDraw4::Release()
|
1629 | 1709 | {
|
| 1710 | + if(!this) return 0;
|
1630 | 1711 | ULONG ret;
|
1631 | 1712 | refcount--;
|
1632 | 1713 | ret = refcount;
|
— | — | @@ -1634,18 +1715,22 @@ |
1635 | 1716 | }
|
1636 | 1717 | HRESULT WINAPI glDirectDraw4::Compact()
|
1637 | 1718 | {
|
| 1719 | + if(!this) return DDERR_INVALIDPARAMS;
|
1638 | 1720 | return glDD7->Compact();
|
1639 | 1721 | }
|
1640 | 1722 | HRESULT WINAPI glDirectDraw4::CreateClipper(DWORD dwFlags, LPDIRECTDRAWCLIPPER FAR *lplpDDClipper, IUnknown FAR *pUnkOuter)
|
1641 | 1723 | {
|
| 1724 | + if(!this) return DDERR_INVALIDPARAMS;
|
1642 | 1725 | return glDD7->CreateClipper(dwFlags,lplpDDClipper,pUnkOuter);
|
1643 | 1726 | }
|
1644 | 1727 | HRESULT WINAPI glDirectDraw4::CreatePalette(DWORD dwFlags, LPPALETTEENTRY lpDDColorArray, LPDIRECTDRAWPALETTE FAR *lplpDDPalette, IUnknown FAR *pUnkOuter)
|
1645 | 1728 | {
|
| 1729 | + if(!this) return DDERR_INVALIDPARAMS;
|
1646 | 1730 | return glDD7->CreatePalette(dwFlags,lpDDColorArray,lplpDDPalette,pUnkOuter);
|
1647 | 1731 | }
|
1648 | 1732 | HRESULT WINAPI glDirectDraw4::CreateSurface(LPDDSURFACEDESC2 lpDDSurfaceDesc, LPDIRECTDRAWSURFACE4 FAR *lplpDDSurface, IUnknown FAR *pUnkOuter)
|
1649 | 1733 | {
|
| 1734 | + if(!this) return DDERR_INVALIDPARAMS;
|
1650 | 1735 | LPDIRECTDRAWSURFACE7 lpDDS7;
|
1651 | 1736 | HRESULT err = glDD7->CreateSurface((LPDDSURFACEDESC2)lpDDSurfaceDesc,&lpDDS7,pUnkOuter);
|
1652 | 1737 | if(err == DD_OK)
|
— | — | @@ -1657,91 +1742,113 @@ |
1658 | 1743 | return err;}
|
1659 | 1744 | HRESULT WINAPI glDirectDraw4::DuplicateSurface(LPDIRECTDRAWSURFACE4 lpDDSurface, LPDIRECTDRAWSURFACE4 FAR *lplpDupDDSurface)
|
1660 | 1745 | {
|
| 1746 | + if(!this) return DDERR_INVALIDPARAMS;
|
1661 | 1747 | FIXME("glDirectDraw4::DuplicateSurface: stub\n");
|
1662 | 1748 | ERR(DDERR_GENERIC);
|
1663 | 1749 | }
|
1664 | 1750 | HRESULT WINAPI glDirectDraw4::EnumDisplayModes(DWORD dwFlags, LPDDSURFACEDESC2 lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK2 lpEnumModesCallback)
|
1665 | 1751 | {
|
| 1752 | + if(!this) return DDERR_INVALIDPARAMS;
|
1666 | 1753 | return ::EnumDisplayModes(dwFlags,lpDDSurfaceDesc,lpContext,lpEnumModesCallback);
|
1667 | 1754 | }
|
1668 | 1755 | HRESULT WINAPI glDirectDraw4::EnumSurfaces(DWORD dwFlags, LPDDSURFACEDESC2 lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK2 lpEnumSurfacesCallback)
|
1669 | 1756 | {
|
| 1757 | + if(!this) return DDERR_INVALIDPARAMS;
|
1670 | 1758 | FIXME("glDirectDraw4::EnumSurfaces: stub\n");
|
1671 | 1759 | ERR(DDERR_GENERIC);
|
1672 | 1760 | }
|
1673 | 1761 | HRESULT WINAPI glDirectDraw4::FlipToGDISurface()
|
1674 | 1762 | {
|
| 1763 | + if(!this) return DDERR_INVALIDPARAMS;
|
1675 | 1764 | return glDD7->FlipToGDISurface();
|
1676 | 1765 | }
|
1677 | 1766 | HRESULT WINAPI glDirectDraw4::GetCaps(LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps)
|
1678 | 1767 | {
|
| 1768 | + if(!this) return DDERR_INVALIDPARAMS;
|
1679 | 1769 | return glDD7->GetCaps(lpDDDriverCaps,lpDDHELCaps);
|
1680 | 1770 | }
|
1681 | 1771 | HRESULT WINAPI glDirectDraw4::GetDisplayMode(LPDDSURFACEDESC2 lpDDSurfaceDesc2)
|
1682 | 1772 | {
|
| 1773 | + if(!this) return DDERR_INVALIDPARAMS;
|
1683 | 1774 | return glDD7->GetDisplayMode(lpDDSurfaceDesc2);
|
1684 | 1775 | }
|
1685 | 1776 | HRESULT WINAPI glDirectDraw4::GetFourCCCodes(LPDWORD lpNumCodes, LPDWORD lpCodes)
|
1686 | 1777 | {
|
| 1778 | + if(!this) return DDERR_INVALIDPARAMS;
|
1687 | 1779 | return glDD7->GetFourCCCodes(lpNumCodes,lpCodes);
|
1688 | 1780 | }
|
1689 | 1781 | HRESULT WINAPI glDirectDraw4::GetGDISurface(LPDIRECTDRAWSURFACE4 FAR *lplpGDIDDSurface)
|
1690 | 1782 | {
|
| 1783 | + if(!this) return DDERR_INVALIDPARAMS;
|
1691 | 1784 | FIXME("glDirectDraw4::GetGDISurface: stub\n");
|
1692 | 1785 | ERR(DDERR_GENERIC);
|
1693 | 1786 | }
|
1694 | 1787 | HRESULT WINAPI glDirectDraw4::GetMonitorFrequency(LPDWORD lpdwFrequency)
|
1695 | 1788 | {
|
| 1789 | + if(!this) return DDERR_INVALIDPARAMS;
|
1696 | 1790 | return glDD7->GetMonitorFrequency(lpdwFrequency);
|
1697 | 1791 | }
|
1698 | 1792 | HRESULT WINAPI glDirectDraw4::GetScanLine(LPDWORD lpdwScanLine)
|
1699 | 1793 | {
|
| 1794 | + if(!this) return DDERR_INVALIDPARAMS;
|
1700 | 1795 | return glDD7->GetScanLine(lpdwScanLine);
|
1701 | 1796 | }
|
1702 | 1797 | HRESULT WINAPI glDirectDraw4::GetVerticalBlankStatus(LPBOOL lpbIsInVB)
|
1703 | 1798 | {
|
| 1799 | + if(!this) return DDERR_INVALIDPARAMS;
|
1704 | 1800 | return glDD7->GetVerticalBlankStatus(lpbIsInVB);
|
1705 | 1801 | }
|
1706 | 1802 | HRESULT WINAPI glDirectDraw4::Initialize(GUID FAR *lpGUID)
|
1707 | 1803 | {
|
| 1804 | + if(!this) return DDERR_INVALIDPARAMS;
|
1708 | 1805 | return glDD7->Initialize(lpGUID);
|
1709 | 1806 | }
|
1710 | 1807 | HRESULT WINAPI glDirectDraw4::RestoreDisplayMode()
|
1711 | 1808 | {
|
| 1809 | + if(!this) return DDERR_INVALIDPARAMS;
|
1712 | 1810 | return glDD7->RestoreDisplayMode();
|
1713 | 1811 | }
|
1714 | 1812 | HRESULT WINAPI glDirectDraw4::SetCooperativeLevel(HWND hWnd, DWORD dwFlags)
|
1715 | 1813 | {
|
| 1814 | + if(!this) return DDERR_INVALIDPARAMS;
|
1716 | 1815 | return glDD7->SetCooperativeLevel(hWnd,dwFlags);
|
1717 | 1816 | }
|
1718 | 1817 | HRESULT WINAPI glDirectDraw4::SetDisplayMode(DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags)
|
1719 | 1818 | {
|
| 1819 | + if(!this) return DDERR_INVALIDPARAMS;
|
1720 | 1820 | return glDD7->SetDisplayMode(dwWidth,dwHeight,dwBPP,dwRefreshRate,dwFlags);
|
1721 | 1821 | }
|
1722 | 1822 | HRESULT WINAPI glDirectDraw4::WaitForVerticalBlank(DWORD dwFlags, HANDLE hEvent)
|
1723 | 1823 | {
|
| 1824 | + if(!this) return DDERR_INVALIDPARAMS;
|
1724 | 1825 | return glDD7->WaitForVerticalBlank(dwFlags,hEvent);
|
1725 | 1826 | }
|
1726 | 1827 | HRESULT WINAPI glDirectDraw4::GetAvailableVidMem(LPDDSCAPS2 lpDDSCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree)
|
1727 | 1828 | {
|
| 1829 | + if(!this) return DDERR_INVALIDPARAMS;
|
1728 | 1830 | FIXME("IDirectDraw4::GetAvailableVidMem: stub\n");
|
1729 | 1831 | ERR(DDERR_GENERIC);
|
1730 | 1832 | }
|
1731 | 1833 | HRESULT WINAPI glDirectDraw4::GetSurfaceFromDC(HDC hdc, LPDIRECTDRAWSURFACE4 *lpDDS)
|
1732 | 1834 | {
|
| 1835 | + if(!this) return DDERR_INVALIDPARAMS;
|
1733 | 1836 | FIXME("IDirectDraw4::GetSurfaceFromDC: stub\n");
|
1734 | 1837 | ERR(DDERR_GENERIC);
|
1735 | 1838 | }
|
1736 | 1839 | HRESULT WINAPI glDirectDraw4::RestoreAllSurfaces()
|
1737 | 1840 | {
|
| 1841 | + if(!this) return DDERR_INVALIDPARAMS;
|
1738 | 1842 | return glDD7->RestoreAllSurfaces();
|
1739 | 1843 | }
|
1740 | 1844 | HRESULT WINAPI glDirectDraw4::TestCooperativeLevel()
|
1741 | 1845 | {
|
| 1846 | + if(!this) return DDERR_INVALIDPARAMS;
|
1742 | 1847 | return glDD7->TestCooperativeLevel();
|
1743 | 1848 | }
|
1744 | 1849 | HRESULT WINAPI glDirectDraw4::GetDeviceIdentifier(LPDDDEVICEIDENTIFIER lpdddi, DWORD dwFlags)
|
1745 | 1850 | {
|
| 1851 | + if(!this) return DDERR_INVALIDPARAMS;
|
| 1852 | + if(!lpdddi) return DDERR_INVALIDPARAMS;
|
1746 | 1853 | devid.guidDeviceIdentifier = device_template;
|
1747 | 1854 | memcpy(lpdddi,&devid,sizeof(DDDEVICEIDENTIFIER));
|
1748 | 1855 | return DD_OK;
|
Index: ddraw/glDirectDrawClipper.cpp |
— | — | @@ -35,6 +35,7 @@ |
36 | 36 | }
|
37 | 37 | HRESULT WINAPI glDirectDrawClipper::QueryInterface(REFIID riid, LPVOID* obp)
|
38 | 38 | {
|
| 39 | + if(!this) return DDERR_INVALIDPARAMS;
|
39 | 40 | if(riid == IID_IDirectDrawClipper)
|
40 | 41 | {
|
41 | 42 | *obp = this;
|
— | — | @@ -45,11 +46,13 @@ |
46 | 47 | }
|
47 | 48 | ULONG WINAPI glDirectDrawClipper::AddRef()
|
48 | 49 | {
|
| 50 | + if(!this) return 0;
|
49 | 51 | refcount++;
|
50 | 52 | return refcount;
|
51 | 53 | }
|
52 | 54 | ULONG WINAPI glDirectDrawClipper::Release()
|
53 | 55 | {
|
| 56 | + if(!this) return 0;
|
54 | 57 | ULONG ret;
|
55 | 58 | refcount--;
|
56 | 59 | ret = refcount;
|
— | — | @@ -58,11 +61,13 @@ |
59 | 62 | }
|
60 | 63 | HRESULT WINAPI glDirectDrawClipper::GetClipList(LPRECT lpRect, LPRGNDATA lpClipList, LPDWORD lpdwSize)
|
61 | 64 | {
|
| 65 | + if(!this) return DDERR_INVALIDPARAMS;
|
62 | 66 | FIXME("IDirectDrawClipper::GetClipList: stub");
|
63 | 67 | ERR(DDERR_GENERIC);
|
64 | 68 | }
|
65 | 69 | HRESULT WINAPI glDirectDrawClipper::GetHWnd(HWND FAR *lphWnd)
|
66 | 70 | {
|
| 71 | + if(!this) return DDERR_INVALIDPARAMS;
|
67 | 72 | *lphWnd = hWnd;
|
68 | 73 | if(!hWnd) return DDERR_INVALIDOBJECT;
|
69 | 74 | return DD_OK;
|
— | — | @@ -69,6 +74,7 @@ |
70 | 75 | }
|
71 | 76 | HRESULT WINAPI glDirectDrawClipper::Initialize(LPDIRECTDRAW lpDD, DWORD dwFlags)
|
72 | 77 | {
|
| 78 | + if(!this) return DDERR_INVALIDPARAMS;
|
73 | 79 | if(initialized) return DDERR_ALREADYINITIALIZED;
|
74 | 80 | glDD7 = (glDirectDraw7*)lpDD;
|
75 | 81 | if(glDD7) hasparent = true;
|
— | — | @@ -80,16 +86,19 @@ |
81 | 87 | }
|
82 | 88 | HRESULT WINAPI glDirectDrawClipper::IsClipListChanged(BOOL FAR *lpbChanged)
|
83 | 89 | {
|
| 90 | + if(!this) return DDERR_INVALIDPARAMS;
|
84 | 91 | FIXME("IDirectDrawClipper::IsClipListChanged: stub");
|
85 | 92 | ERR(DDERR_GENERIC);
|
86 | 93 | }
|
87 | 94 | HRESULT WINAPI glDirectDrawClipper::SetClipList(LPRGNDATA lpClipList, DWORD dwFlags)
|
88 | 95 | {
|
| 96 | + if(!this) return DDERR_INVALIDPARAMS;
|
89 | 97 | FIXME("IDirectDrawClipper::SetClipList: stub");
|
90 | 98 | ERR(DDERR_GENERIC);
|
91 | 99 | }
|
92 | 100 | HRESULT WINAPI glDirectDrawClipper::SetHWnd(DWORD dwFlags, HWND hWnd)
|
93 | 101 | {
|
| 102 | + if(!this) return DDERR_INVALIDPARAMS;
|
94 | 103 | this->hWnd = hWnd;
|
95 | 104 | return DD_OK;
|
96 | 105 | }
|
Index: ddraw/glDirectDrawPalette.cpp |
— | — | @@ -115,11 +115,13 @@ |
116 | 116 |
|
117 | 117 | HRESULT WINAPI glDirectDrawPalette::QueryInterface(REFIID riid, void** ppvObj)
|
118 | 118 | {
|
| 119 | + if(!this) return DDERR_INVALIDPARAMS;
|
119 | 120 | ERR(E_NOINTERFACE);
|
120 | 121 | }
|
121 | 122 |
|
122 | 123 | ULONG WINAPI glDirectDrawPalette::AddRef()
|
123 | 124 | {
|
| 125 | + if(!this) return 0;
|
124 | 126 | refcount++;
|
125 | 127 | return refcount;
|
126 | 128 | }
|
— | — | @@ -126,6 +128,7 @@ |
127 | 129 |
|
128 | 130 | ULONG WINAPI glDirectDrawPalette::Release()
|
129 | 131 | {
|
| 132 | + if(!this) return 0;
|
130 | 133 | ULONG ret;
|
131 | 134 | refcount--;
|
132 | 135 | ret = refcount;
|
— | — | @@ -135,11 +138,13 @@ |
136 | 139 |
|
137 | 140 | HRESULT WINAPI glDirectDrawPalette::GetCaps(LPDWORD lpdwCaps)
|
138 | 141 | {
|
| 142 | + if(!this) return DDERR_INVALIDPARAMS;
|
139 | 143 | return flags;
|
140 | 144 | }
|
141 | 145 |
|
142 | 146 | HRESULT WINAPI glDirectDrawPalette::GetEntries(DWORD dwFlags, DWORD dwBase, DWORD dwNumEntries, LPPALETTEENTRY lpEntries)
|
143 | 147 | {
|
| 148 | + if(!this) return DDERR_INVALIDPARAMS;
|
144 | 149 | DWORD allentries = 256;
|
145 | 150 | DWORD entrysize;
|
146 | 151 | if(flags & DDPCAPS_1BIT) allentries=2;
|
— | — | @@ -154,10 +159,12 @@ |
155 | 160 | }
|
156 | 161 | HRESULT WINAPI glDirectDrawPalette::Initialize(LPDIRECTDRAW lpDD, DWORD dwFlags, LPPALETTEENTRY lpDDColorTable)
|
157 | 162 | {
|
| 163 | + if(!this) return DDERR_INVALIDPARAMS;
|
158 | 164 | ERR(DDERR_ALREADYINITIALIZED);
|
159 | 165 | }
|
160 | 166 | HRESULT WINAPI glDirectDrawPalette::SetEntries(DWORD dwFlags, DWORD dwStartingEntry, DWORD dwCount, LPPALETTEENTRY lpEntries)
|
161 | 167 | {
|
| 168 | + if(!this) return DDERR_INVALIDPARAMS;
|
162 | 169 | DWORD allentries = 256;
|
163 | 170 | DWORD entrysize;
|
164 | 171 | if(flags & DDPCAPS_1BIT) allentries=2;
|
Index: ddraw/glDirectDrawSurface.cpp |
— | — | @@ -447,6 +447,7 @@ |
448 | 448 | }
|
449 | 449 | HRESULT WINAPI glDirectDrawSurface7::QueryInterface(REFIID riid, void** ppvObj)
|
450 | 450 | {
|
| 451 | + if(!this) return DDERR_INVALIDPARAMS;
|
451 | 452 | if(riid == IID_IDirectDrawSurface7)
|
452 | 453 | {
|
453 | 454 | this->AddRef();
|
— | — | @@ -521,11 +522,13 @@ |
522 | 523 | }
|
523 | 524 | ULONG WINAPI glDirectDrawSurface7::AddRef()
|
524 | 525 | {
|
| 526 | + if(!this) return 0;
|
525 | 527 | refcount++;
|
526 | 528 | return refcount;
|
527 | 529 | }
|
528 | 530 | ULONG WINAPI glDirectDrawSurface7::Release()
|
529 | 531 | {
|
| 532 | + if(!this) return 0;
|
530 | 533 | ULONG ret;
|
531 | 534 | refcount--;
|
532 | 535 | ret = refcount;
|
— | — | @@ -534,6 +537,7 @@ |
535 | 538 | }
|
536 | 539 | HRESULT WINAPI glDirectDrawSurface7::AddAttachedSurface(LPDIRECTDRAWSURFACE7 lpDDSAttachedSurface)
|
537 | 540 | {
|
| 541 | + if(!this) return DDERR_INVALIDPARAMS;
|
538 | 542 | if(zbuffer) ERR(DDERR_SURFACEALREADYATTACHED);
|
539 | 543 | glDirectDrawSurface7 *attached = (glDirectDrawSurface7 *)lpDDSAttachedSurface;
|
540 | 544 | DDSURFACEDESC2 ddsd;
|
— | — | @@ -549,11 +553,13 @@ |
550 | 554 | }
|
551 | 555 | HRESULT WINAPI glDirectDrawSurface7::AddOverlayDirtyRect(LPRECT lpRect)
|
552 | 556 | {
|
| 557 | + if(!this) return DDERR_INVALIDPARAMS;
|
553 | 558 | FIXME("glDirectDrawSurface7::AddOverlayDirtyRect: stub\n");
|
554 | 559 | ERR(DDERR_GENERIC);
|
555 | 560 | }
|
556 | 561 | HRESULT WINAPI glDirectDrawSurface7::Blt(LPRECT lpDestRect, LPDIRECTDRAWSURFACE7 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
|
557 | 562 | {
|
| 563 | + if(!this) return DDERR_INVALIDPARAMS;
|
558 | 564 | if((dwFlags & DDBLT_COLORFILL) && !lpDDBltFx) return DDERR_INVALIDPARAMS;
|
559 | 565 | glDirectDrawSurface7 *src = (glDirectDrawSurface7 *)lpDDSrcSurface;
|
560 | 566 | if(dirty & 1)
|
— | — | @@ -575,11 +581,13 @@ |
576 | 582 | }
|
577 | 583 | HRESULT WINAPI glDirectDrawSurface7::BltBatch(LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags)
|
578 | 584 | {
|
| 585 | + if(!this) return DDERR_INVALIDPARAMS;
|
579 | 586 | FIXME("glDirectDrawSurface7::BltBatch: stub\n");
|
580 | 587 | ERR(DDERR_GENERIC);
|
581 | 588 | }
|
582 | 589 | HRESULT WINAPI glDirectDrawSurface7::BltFast(DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE7 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans)
|
583 | 590 | {
|
| 591 | + if(!this) return DDERR_INVALIDPARAMS;
|
584 | 592 | DDSURFACEDESC2 ddsd;
|
585 | 593 | ddsd.dwSize = sizeof(DDSURFACEDESC2);
|
586 | 594 | lpDDSrcSurface->GetSurfaceDesc(&ddsd);
|
— | — | @@ -604,6 +612,7 @@ |
605 | 613 | }
|
606 | 614 | HRESULT WINAPI glDirectDrawSurface7::DeleteAttachedSurface(DWORD dwFlags, LPDIRECTDRAWSURFACE7 lpDDSAttachedSurface)
|
607 | 615 | {
|
| 616 | + if(!this) return DDERR_INVALIDPARAMS;
|
608 | 617 | if(lpDDSAttachedSurface == (LPDIRECTDRAWSURFACE7)zbuffer)
|
609 | 618 | {
|
610 | 619 | zbuffer->Release();
|
— | — | @@ -614,16 +623,19 @@ |
615 | 624 | }
|
616 | 625 | HRESULT WINAPI glDirectDrawSurface7::EnumAttachedSurfaces(LPVOID lpContext, LPDDENUMSURFACESCALLBACK7 lpEnumSurfacesCallback)
|
617 | 626 | {
|
| 627 | + if(!this) return DDERR_INVALIDPARAMS;
|
618 | 628 | FIXME("glDirectDrawSurface7::EnumAttachedSurfaces: stub\n");
|
619 | 629 | ERR(DDERR_GENERIC);
|
620 | 630 | }
|
621 | 631 | HRESULT WINAPI glDirectDrawSurface7::EnumOverlayZOrders(DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK7 lpfnCallback)
|
622 | 632 | {
|
| 633 | + if(!this) return DDERR_INVALIDPARAMS;
|
623 | 634 | FIXME("glDirectDrawSurface7::EnumOverlayZOrders: stub\n");
|
624 | 635 | ERR(DDERR_GENERIC);
|
625 | 636 | }
|
626 | 637 | HRESULT WINAPI glDirectDrawSurface7::Flip(LPDIRECTDRAWSURFACE7 lpDDSurfaceTargetOverride, DWORD dwFlags)
|
627 | 638 | {
|
| 639 | + if(!this) return DDERR_INVALIDPARAMS;
|
628 | 640 | HRESULT ret = Flip2(lpDDSurfaceTargetOverride,dwFlags);
|
629 | 641 | if(ddsd.ddsCaps.dwCaps & DDSCAPS_PRIMARYSURFACE) RenderScreen(texture,this);
|
630 | 642 | return ret;
|
— | — | @@ -630,6 +642,7 @@ |
631 | 643 | }
|
632 | 644 | HRESULT glDirectDrawSurface7::Flip2(LPDIRECTDRAWSURFACE7 lpDDSurfaceTargetOverride, DWORD dwFlags)
|
633 | 645 | {
|
| 646 | + if(!this) return DDERR_INVALIDPARAMS;
|
634 | 647 | DWORD i;
|
635 | 648 | glDirectDrawSurface7 *tmp;
|
636 | 649 | if(dwFlags & DDFLIP_NOVSYNC) swapinterval=0;
|
— | — | @@ -709,6 +722,7 @@ |
710 | 723 | }
|
711 | 724 | HRESULT WINAPI glDirectDrawSurface7::GetAttachedSurface(LPDDSCAPS2 lpDDSCaps, LPDIRECTDRAWSURFACE7 FAR *lplpDDAttachedSurface)
|
712 | 725 | {
|
| 726 | + if(!this) return DDERR_INVALIDPARAMS;
|
713 | 727 | DDSCAPS2 ddsComp;
|
714 | 728 | backbuffer->GetCaps(&ddsComp);
|
715 | 729 | unsigned __int64 comp1,comp2;
|
— | — | @@ -736,21 +750,25 @@ |
737 | 751 | }
|
738 | 752 | HRESULT WINAPI glDirectDrawSurface7::GetBltStatus(DWORD dwFlags)
|
739 | 753 | {
|
| 754 | + if(!this) return DDERR_INVALIDPARAMS;
|
740 | 755 | FIXME("glDirectDrawSurface7::GetBltStatus: stub\n");
|
741 | 756 | ERR(DDERR_GENERIC);
|
742 | 757 | }
|
743 | 758 | HRESULT WINAPI glDirectDrawSurface7::GetCaps(LPDDSCAPS2 lpDDSCaps)
|
744 | 759 | {
|
| 760 | + if(!this) return DDERR_INVALIDPARAMS;
|
745 | 761 | memcpy(lpDDSCaps,&ddsd.ddsCaps,sizeof(DDSCAPS2));
|
746 | 762 | return DD_OK;
|
747 | 763 | }
|
748 | 764 | HRESULT WINAPI glDirectDrawSurface7::GetClipper(LPDIRECTDRAWCLIPPER FAR *lplpDDClipper)
|
749 | 765 | {
|
| 766 | + if(!this) return DDERR_INVALIDPARAMS;
|
750 | 767 | FIXME("glDirectDrawSurface7::GetClipper: stub\n");
|
751 | 768 | ERR(DDERR_GENERIC);
|
752 | 769 | }
|
753 | 770 | HRESULT WINAPI glDirectDrawSurface7::GetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
|
754 | 771 | {
|
| 772 | + if(!this) return DDERR_INVALIDPARAMS;
|
755 | 773 | if(dwFlags == DDCKEY_SRCBLT)
|
756 | 774 | {
|
757 | 775 | if(colorkey[0].enabled)
|
— | — | @@ -791,6 +809,7 @@ |
792 | 810 | }
|
793 | 811 | HRESULT WINAPI glDirectDrawSurface7::GetDC(HDC FAR *lphDC)
|
794 | 812 | {
|
| 813 | + if(!this) return DDERR_INVALIDPARAMS;
|
795 | 814 | if(hdc) ERR(DDERR_DCALREADYCREATED);
|
796 | 815 | DWORD colors[256];
|
797 | 816 | HRESULT error;
|
— | — | @@ -816,6 +835,7 @@ |
817 | 836 | }
|
818 | 837 | HRESULT WINAPI glDirectDrawSurface7::GetFlipStatus(DWORD dwFlags)
|
819 | 838 | {
|
| 839 | + if(!this) return DDERR_INVALIDPARAMS;
|
820 | 840 | return DD_OK;
|
821 | 841 | FIXME("glDirectDrawSurface7::GetFlipStatus: stub\n");
|
822 | 842 | ERR(DDERR_GENERIC);
|
— | — | @@ -822,11 +842,13 @@ |
823 | 843 | }
|
824 | 844 | HRESULT WINAPI glDirectDrawSurface7::GetOverlayPosition(LPLONG lplX, LPLONG lplY)
|
825 | 845 | {
|
| 846 | + if(!this) return DDERR_INVALIDPARAMS;
|
826 | 847 | FIXME("glDirectDrawSurface7::GetOverlayPosition: stub\n");
|
827 | 848 | ERR(DDERR_GENERIC);
|
828 | 849 | }
|
829 | 850 | HRESULT WINAPI glDirectDrawSurface7::GetPalette(LPDIRECTDRAWPALETTE FAR *lplpDDPalette)
|
830 | 851 | {
|
| 852 | + if(!this) return DDERR_INVALIDPARAMS;
|
831 | 853 | HRESULT err;
|
832 | 854 | if(palette)
|
833 | 855 | {
|
— | — | @@ -843,11 +865,13 @@ |
844 | 866 | }
|
845 | 867 | HRESULT WINAPI glDirectDrawSurface7::GetPixelFormat(LPDDPIXELFORMAT lpDDPixelFormat)
|
846 | 868 | {
|
| 869 | + if(!this) return DDERR_INVALIDPARAMS;
|
847 | 870 | *lpDDPixelFormat = ddsd.ddpfPixelFormat;
|
848 | 871 | return DD_OK;
|
849 | 872 | }
|
850 | 873 | HRESULT WINAPI glDirectDrawSurface7::GetSurfaceDesc(LPDDSURFACEDESC2 lpDDSurfaceDesc)
|
851 | 874 | {
|
| 875 | + if(!this) return DDERR_INVALIDPARAMS;
|
852 | 876 | if(!lpDDSurfaceDesc) ERR(DDERR_INVALIDPARAMS);
|
853 | 877 | memcpy(lpDDSurfaceDesc,&ddsd,lpDDSurfaceDesc->dwSize);
|
854 | 878 | return DD_OK;
|
— | — | @@ -854,10 +878,12 @@ |
855 | 879 | }
|
856 | 880 | HRESULT WINAPI glDirectDrawSurface7::Initialize(LPDIRECTDRAW lpDD, LPDDSURFACEDESC2 lpDDSurfaceDesc)
|
857 | 881 | {
|
| 882 | + if(!this) return DDERR_INVALIDPARAMS;
|
858 | 883 | return DDERR_ALREADYINITIALIZED;
|
859 | 884 | }
|
860 | 885 | HRESULT WINAPI glDirectDrawSurface7::IsLost()
|
861 | 886 | {
|
| 887 | + if(!this) return DDERR_INVALIDPARAMS;
|
862 | 888 | if(hRC == ddInterface->renderer->hRC) return DD_OK;
|
863 | 889 | else return DDERR_SURFACELOST;
|
864 | 890 | }
|
— | — | @@ -864,6 +890,7 @@ |
865 | 891 |
|
866 | 892 | HRESULT WINAPI glDirectDrawSurface7::Lock(LPRECT lpDestRect, LPDDSURFACEDESC2 lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent)
|
867 | 893 | {
|
| 894 | + if(!this) return DDERR_INVALIDPARAMS;
|
868 | 895 | if(locked) ERR(DDERR_SURFACEBUSY);
|
869 | 896 | dirty |= 1;
|
870 | 897 | retry:
|
— | — | @@ -899,6 +926,7 @@ |
900 | 927 | }
|
901 | 928 | HRESULT WINAPI glDirectDrawSurface7::ReleaseDC(HDC hDC)
|
902 | 929 | {
|
| 930 | + if(!this) return DDERR_INVALIDPARAMS;
|
903 | 931 | if(!hdc) return DDERR_INVALIDOBJECT;
|
904 | 932 | if(hDC != hdc) return DDERR_INVALIDOBJECT;
|
905 | 933 | GetDIBits(hDC,hbitmap,0,ddsd.dwHeight,ddsd.lpSurface,bitmapinfo,DIB_RGB_COLORS);
|
— | — | @@ -945,6 +973,7 @@ |
946 | 974 | }
|
947 | 975 | HRESULT WINAPI glDirectDrawSurface7::Restore()
|
948 | 976 | {
|
| 977 | + if(!this) return DDERR_INVALIDPARAMS;
|
949 | 978 | LONG sizes[6];
|
950 | 979 | if(!ddInterface->renderer) return DDERR_INVALIDOBJECT;
|
951 | 980 | if(hRC != ddInterface->renderer->hRC)
|
— | — | @@ -990,6 +1019,7 @@ |
991 | 1020 | }
|
992 | 1021 | HRESULT WINAPI glDirectDrawSurface7::SetClipper(LPDIRECTDRAWCLIPPER lpDDClipper)
|
993 | 1022 | {
|
| 1023 | + if(!this) return DDERR_INVALIDPARAMS;
|
994 | 1024 | if(clipper) clipper->Release();
|
995 | 1025 | clipper = (glDirectDrawClipper *)lpDDClipper;
|
996 | 1026 | if(clipper)clipper->AddRef();
|
— | — | @@ -997,6 +1027,7 @@ |
998 | 1028 | }
|
999 | 1029 | HRESULT WINAPI glDirectDrawSurface7::SetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
|
1000 | 1030 | {
|
| 1031 | + if(!this) return DDERR_INVALIDPARAMS;
|
1001 | 1032 | CKEY key;
|
1002 | 1033 | key.enabled = true;
|
1003 | 1034 | if(dwFlags & DDCKEY_COLORSPACE) key.colorspace = true;
|
— | — | @@ -1010,11 +1041,13 @@ |
1011 | 1042 | }
|
1012 | 1043 | HRESULT WINAPI glDirectDrawSurface7::SetOverlayPosition(LONG lX, LONG lY)
|
1013 | 1044 | {
|
| 1045 | + if(!this) return DDERR_INVALIDPARAMS;
|
1014 | 1046 | FIXME("glDirectDrawSurface7::SetOverlayPosition: stub\n");
|
1015 | 1047 | ERR(DDERR_GENERIC);
|
1016 | 1048 | }
|
1017 | 1049 | HRESULT WINAPI glDirectDrawSurface7::SetPalette(LPDIRECTDRAWPALETTE lpDDPalette)
|
1018 | 1050 | {
|
| 1051 | + if(!this) return DDERR_INVALIDPARAMS;
|
1019 | 1052 | if(palette)
|
1020 | 1053 | {
|
1021 | 1054 | palette->Release();
|
— | — | @@ -1030,6 +1063,7 @@ |
1031 | 1064 |
|
1032 | 1065 | HRESULT WINAPI glDirectDrawSurface7::Unlock(LPRECT lpRect)
|
1033 | 1066 | {
|
| 1067 | + if(!this) return DDERR_INVALIDPARAMS;
|
1034 | 1068 | if(!locked) return DDERR_NOTLOCKED;
|
1035 | 1069 | locked--;
|
1036 | 1070 | ddsd.lpSurface = NULL;
|
— | — | @@ -1041,16 +1075,19 @@ |
1042 | 1076 | }
|
1043 | 1077 | HRESULT WINAPI glDirectDrawSurface7::UpdateOverlay(LPRECT lpSrcRect, LPDIRECTDRAWSURFACE7 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx)
|
1044 | 1078 | {
|
| 1079 | + if(!this) return DDERR_INVALIDPARAMS;
|
1045 | 1080 | FIXME("glDirectDrawSurface7::UpdateOverlay: stub\n");
|
1046 | 1081 | ERR(DDERR_GENERIC);
|
1047 | 1082 | }
|
1048 | 1083 | HRESULT WINAPI glDirectDrawSurface7::UpdateOverlayDisplay(DWORD dwFlags)
|
1049 | 1084 | {
|
| 1085 | + if(!this) return DDERR_INVALIDPARAMS;
|
1050 | 1086 | FIXME("glDirectDrawSurface7::UpdateOverlayDisplay: stub\n");
|
1051 | 1087 | ERR(DDERR_GENERIC);
|
1052 | 1088 | }
|
1053 | 1089 | HRESULT WINAPI glDirectDrawSurface7::UpdateOverlayZOrder(DWORD dwFlags, LPDIRECTDRAWSURFACE7 lpDDSReference)
|
1054 | 1090 | {
|
| 1091 | + if(!this) return DDERR_INVALIDPARAMS;
|
1055 | 1092 | FIXME("glDirectDrawSurface7::UpdateOverlayZOrder: stub\n");
|
1056 | 1093 | ERR(DDERR_GENERIC);
|
1057 | 1094 | }
|
— | — | @@ -1062,6 +1099,7 @@ |
1063 | 1100 | // ddraw 2+ api
|
1064 | 1101 | HRESULT WINAPI glDirectDrawSurface7::GetDDInterface(LPVOID FAR *lplpDD)
|
1065 | 1102 | {
|
| 1103 | + if(!this) return DDERR_INVALIDPARAMS;
|
1066 | 1104 | *lplpDD = ddInterface;
|
1067 | 1105 | FIXME("glDirectDrawSurface7::GetDDInterface: stub\n");
|
1068 | 1106 | ERR(DDERR_GENERIC);
|
— | — | @@ -1068,11 +1106,13 @@ |
1069 | 1107 | }
|
1070 | 1108 | HRESULT WINAPI glDirectDrawSurface7::PageLock(DWORD dwFlags)
|
1071 | 1109 | {
|
| 1110 | + if(!this) return DDERR_INVALIDPARAMS;
|
1072 | 1111 | pagelocked++;
|
1073 | 1112 | return DD_OK;
|
1074 | 1113 | }
|
1075 | 1114 | HRESULT WINAPI glDirectDrawSurface7::PageUnlock(DWORD dwFlags)
|
1076 | 1115 | {
|
| 1116 | + if(!this) return DDERR_INVALIDPARAMS;
|
1077 | 1117 | if(!pagelocked) ERR(DDERR_NOTPAGELOCKED);
|
1078 | 1118 | pagelocked--;
|
1079 | 1119 | return DD_OK;
|
— | — | @@ -1080,6 +1120,7 @@ |
1081 | 1121 | // ddraw 3+ api
|
1082 | 1122 | HRESULT WINAPI glDirectDrawSurface7::SetSurfaceDesc(LPDDSURFACEDESC2 lpddsd2, DWORD dwFlags)
|
1083 | 1123 | {
|
| 1124 | + if(!this) return DDERR_INVALIDPARAMS;
|
1084 | 1125 | FIXME("glDirectDrawSurface7::SetSurfaceDesc: stub\n");
|
1085 | 1126 | ERR(DDERR_GENERIC);
|
1086 | 1127 | }
|
— | — | @@ -1086,26 +1127,31 @@ |
1087 | 1128 | // ddraw 4+ api
|
1088 | 1129 | HRESULT WINAPI glDirectDrawSurface7::SetPrivateData(REFGUID guidTag, LPVOID lpData, DWORD cbSize, DWORD dwFlags)
|
1089 | 1130 | {
|
| 1131 | + if(!this) return DDERR_INVALIDPARAMS;
|
1090 | 1132 | FIXME("glDirectDrawSurface7::SetPrivateData: stub\n");
|
1091 | 1133 | ERR(DDERR_GENERIC);
|
1092 | 1134 | }
|
1093 | 1135 | HRESULT WINAPI glDirectDrawSurface7::GetPrivateData(REFGUID guidTag, LPVOID lpBuffer, LPDWORD lpcbBufferSize)
|
1094 | 1136 | {
|
| 1137 | + if(!this) return DDERR_INVALIDPARAMS;
|
1095 | 1138 | FIXME("glDirectDrawSurface7::GetPrivateData: stub\n");
|
1096 | 1139 | ERR(DDERR_GENERIC);
|
1097 | 1140 | }
|
1098 | 1141 | HRESULT WINAPI glDirectDrawSurface7::FreePrivateData(REFGUID guidTag)
|
1099 | 1142 | {
|
| 1143 | + if(!this) return DDERR_INVALIDPARAMS;
|
1100 | 1144 | FIXME("glDirectDrawSurface7::FreePrivateData: stub\n");
|
1101 | 1145 | ERR(DDERR_GENERIC);
|
1102 | 1146 | }
|
1103 | 1147 | HRESULT WINAPI glDirectDrawSurface7::GetUniquenessValue(LPDWORD lpValue)
|
1104 | 1148 | {
|
| 1149 | + if(!this) return DDERR_INVALIDPARAMS;
|
1105 | 1150 | FIXME("glDirectDrawSurface7::GetUniquenessValue: stub\n");
|
1106 | 1151 | ERR(DDERR_GENERIC);
|
1107 | 1152 | }
|
1108 | 1153 | HRESULT WINAPI glDirectDrawSurface7::ChangeUniquenessValue()
|
1109 | 1154 | {
|
| 1155 | + if(!this) return DDERR_INVALIDPARAMS;
|
1110 | 1156 | FIXME("glDirectDrawSurface7::ChangeUniquenessValue: stub\n");
|
1111 | 1157 | ERR(DDERR_GENERIC);
|
1112 | 1158 | }
|
— | — | @@ -1112,26 +1158,31 @@ |
1113 | 1159 | // ddraw 7 api
|
1114 | 1160 | HRESULT WINAPI glDirectDrawSurface7::SetPriority(DWORD dwPriority)
|
1115 | 1161 | {
|
| 1162 | + if(!this) return DDERR_INVALIDPARAMS;
|
1116 | 1163 | FIXME("glDirectDrawSurface7::SetPriority: stub\n");
|
1117 | 1164 | ERR(DDERR_GENERIC);
|
1118 | 1165 | }
|
1119 | 1166 | HRESULT WINAPI glDirectDrawSurface7::GetPriority(LPDWORD lpdwPriority)
|
1120 | 1167 | {
|
| 1168 | + if(!this) return DDERR_INVALIDPARAMS;
|
1121 | 1169 | FIXME("glDirectDrawSurface7::GetPriority: stub\n");
|
1122 | 1170 | ERR(DDERR_GENERIC);
|
1123 | 1171 | }
|
1124 | 1172 | HRESULT WINAPI glDirectDrawSurface7::SetLOD(DWORD dwMaxLOD)
|
1125 | 1173 | {
|
| 1174 | + if(!this) return DDERR_INVALIDPARAMS;
|
1126 | 1175 | FIXME("glDirectDrawSurface7::SetLOD: stub\n");
|
1127 | 1176 | ERR(DDERR_GENERIC);
|
1128 | 1177 | }
|
1129 | 1178 | HRESULT WINAPI glDirectDrawSurface7::GetLOD(LPDWORD lpdwMaxLOD)
|
1130 | 1179 | {
|
| 1180 | + if(!this) return DDERR_INVALIDPARAMS;
|
1131 | 1181 | FIXME("glDirectDrawSurface7::GetLOD: stub\n");
|
1132 | 1182 | ERR(DDERR_GENERIC);
|
1133 | 1183 | }
|
1134 | 1184 | HRESULT WINAPI glDirectDrawSurface7::Unlock2(LPVOID lpSurfaceData)
|
1135 | 1185 | {
|
| 1186 | + if(!this) return DDERR_INVALIDPARAMS;
|
1136 | 1187 | return Unlock((LPRECT)lpSurfaceData);
|
1137 | 1188 | }
|
1138 | 1189 |
|
— | — | @@ -1148,15 +1199,18 @@ |
1149 | 1200 | }
|
1150 | 1201 | HRESULT WINAPI glDirectDrawSurface1::QueryInterface(REFIID riid, void** ppvObj)
|
1151 | 1202 | {
|
| 1203 | + if(!this) return DDERR_INVALIDPARAMS;
|
1152 | 1204 | return glDDS7->QueryInterface(riid,ppvObj);
|
1153 | 1205 | }
|
1154 | 1206 | ULONG WINAPI glDirectDrawSurface1::AddRef()
|
1155 | 1207 | {
|
| 1208 | + if(!this) return 0;
|
1156 | 1209 | refcount++;
|
1157 | 1210 | return refcount;
|
1158 | 1211 | }
|
1159 | 1212 | ULONG WINAPI glDirectDrawSurface1::Release()
|
1160 | 1213 | {
|
| 1214 | + if(!this) return 0;
|
1161 | 1215 | ULONG ret;
|
1162 | 1216 | refcount--;
|
1163 | 1217 | ret = refcount;
|
— | — | @@ -1165,39 +1219,48 @@ |
1166 | 1220 | }
|
1167 | 1221 | HRESULT WINAPI glDirectDrawSurface1::AddAttachedSurface(LPDIRECTDRAWSURFACE lpDDSAttachedSurface)
|
1168 | 1222 | {
|
| 1223 | + if(!this) return DDERR_INVALIDPARAMS;
|
1169 | 1224 | return glDDS7->AddAttachedSurface((LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface);
|
1170 | 1225 | }
|
1171 | 1226 | HRESULT WINAPI glDirectDrawSurface1::AddOverlayDirtyRect(LPRECT lpRect)
|
1172 | 1227 | {
|
| 1228 | + if(!this) return DDERR_INVALIDPARAMS;
|
1173 | 1229 | return glDDS7->AddOverlayDirtyRect(lpRect);
|
1174 | 1230 | }
|
1175 | 1231 | HRESULT WINAPI glDirectDrawSurface1::Blt(LPRECT lpDestRect, LPDIRECTDRAWSURFACE lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
|
1176 | 1232 | {
|
| 1233 | + if(!this) return DDERR_INVALIDPARAMS;
|
1177 | 1234 | if(lpDDSrcSurface) return glDDS7->Blt(lpDestRect,((glDirectDrawSurface1*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwFlags,lpDDBltFx);
|
1178 | 1235 | else return glDDS7->Blt(lpDestRect,NULL,lpSrcRect,dwFlags,lpDDBltFx);
|
1179 | 1236 | }
|
1180 | 1237 | HRESULT WINAPI glDirectDrawSurface1::BltBatch(LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags)
|
1181 | 1238 | {
|
| 1239 | + if(!this) return DDERR_INVALIDPARAMS;
|
1182 | 1240 | return glDDS7->BltBatch(lpDDBltBatch,dwCount,dwFlags);
|
1183 | 1241 | }
|
1184 | 1242 | HRESULT WINAPI glDirectDrawSurface1::BltFast(DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans)
|
1185 | 1243 | {
|
| 1244 | + if(!this) return DDERR_INVALIDPARAMS;
|
1186 | 1245 | return glDDS7->BltFast(dwX,dwY,((glDirectDrawSurface1*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwTrans);
|
1187 | 1246 | }
|
1188 | 1247 | HRESULT WINAPI glDirectDrawSurface1::DeleteAttachedSurface(DWORD dwFlags, LPDIRECTDRAWSURFACE lpDDSAttachedSurface)
|
1189 | 1248 | {
|
| 1249 | + if(!this) return DDERR_INVALIDPARAMS;
|
1190 | 1250 | return glDDS7->DeleteAttachedSurface(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface);
|
1191 | 1251 | }
|
1192 | 1252 | HRESULT WINAPI glDirectDrawSurface1::EnumAttachedSurfaces(LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback)
|
1193 | 1253 | {
|
| 1254 | + if(!this) return DDERR_INVALIDPARAMS;
|
1194 | 1255 | return glDDS7->EnumAttachedSurfaces(lpContext,(LPDDENUMSURFACESCALLBACK7)lpEnumSurfacesCallback);
|
1195 | 1256 | }
|
1196 | 1257 | HRESULT WINAPI glDirectDrawSurface1::EnumOverlayZOrders(DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback)
|
1197 | 1258 | {
|
| 1259 | + if(!this) return DDERR_INVALIDPARAMS;
|
1198 | 1260 | return glDDS7->EnumOverlayZOrders(dwFlags,lpContext,(LPDDENUMSURFACESCALLBACK7)lpfnCallback);
|
1199 | 1261 | }
|
1200 | 1262 | HRESULT WINAPI glDirectDrawSurface1::Flip(LPDIRECTDRAWSURFACE lpDDSurfaceTargetOverride, DWORD dwFlags)
|
1201 | 1263 | {
|
| 1264 | + if(!this) return DDERR_INVALIDPARAMS;
|
1202 | 1265 | if(lpDDSurfaceTargetOverride)
|
1203 | 1266 | return glDDS7->Flip(((glDirectDrawSurface1*)lpDDSurfaceTargetOverride)->GetDDS7(),dwFlags);
|
1204 | 1267 | else return glDDS7->Flip(NULL,dwFlags);
|
— | — | @@ -1204,6 +1267,7 @@ |
1205 | 1268 | }
|
1206 | 1269 | HRESULT WINAPI glDirectDrawSurface1::GetAttachedSurface(LPDDSCAPS lpDDSCaps, LPDIRECTDRAWSURFACE FAR *lplpDDAttachedSurface)
|
1207 | 1270 | {
|
| 1271 | + if(!this) return DDERR_INVALIDPARAMS;
|
1208 | 1272 | HRESULT error;
|
1209 | 1273 | glDirectDrawSurface7 *attachedsurface;
|
1210 | 1274 | glDirectDrawSurface1 *attached1;
|
— | — | @@ -1221,10 +1285,12 @@ |
1222 | 1286 | }
|
1223 | 1287 | HRESULT WINAPI glDirectDrawSurface1::GetBltStatus(DWORD dwFlags)
|
1224 | 1288 | {
|
| 1289 | + if(!this) return DDERR_INVALIDPARAMS;
|
1225 | 1290 | return glDDS7->GetBltStatus(dwFlags);
|
1226 | 1291 | }
|
1227 | 1292 | HRESULT WINAPI glDirectDrawSurface1::GetCaps(LPDDSCAPS lpDDSCaps)
|
1228 | 1293 | {
|
| 1294 | + if(!this) return DDERR_INVALIDPARAMS;
|
1229 | 1295 | HRESULT error;
|
1230 | 1296 | DDSCAPS2 ddsCaps1;
|
1231 | 1297 | error = glDDS7->GetCaps(&ddsCaps1);
|
— | — | @@ -1234,86 +1300,107 @@ |
1235 | 1301 | }
|
1236 | 1302 | HRESULT WINAPI glDirectDrawSurface1::GetClipper(LPDIRECTDRAWCLIPPER FAR *lplpDDClipper)
|
1237 | 1303 | {
|
| 1304 | + if(!this) return DDERR_INVALIDPARAMS;
|
1238 | 1305 | return glDDS7->GetClipper(lplpDDClipper);
|
1239 | 1306 | }
|
1240 | 1307 | HRESULT WINAPI glDirectDrawSurface1::GetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
|
1241 | 1308 | {
|
| 1309 | + if(!this) return DDERR_INVALIDPARAMS;
|
1242 | 1310 | return glDDS7->GetColorKey(dwFlags,lpDDColorKey);
|
1243 | 1311 | }
|
1244 | 1312 | HRESULT WINAPI glDirectDrawSurface1::GetDC(HDC FAR *lphDC)
|
1245 | 1313 | {
|
| 1314 | + if(!this) return DDERR_INVALIDPARAMS;
|
1246 | 1315 | return glDDS7->GetDC(lphDC);
|
1247 | 1316 | }
|
1248 | 1317 | HRESULT WINAPI glDirectDrawSurface1::GetFlipStatus(DWORD dwFlags)
|
1249 | 1318 | {
|
| 1319 | + if(!this) return DDERR_INVALIDPARAMS;
|
1250 | 1320 | return glDDS7->GetFlipStatus(dwFlags);
|
1251 | 1321 | }
|
1252 | 1322 | HRESULT WINAPI glDirectDrawSurface1::GetOverlayPosition(LPLONG lplX, LPLONG lplY)
|
1253 | 1323 | {
|
| 1324 | + if(!this) return DDERR_INVALIDPARAMS;
|
1254 | 1325 | return glDDS7->GetOverlayPosition(lplX,lplY);
|
1255 | 1326 | }
|
1256 | 1327 | HRESULT WINAPI glDirectDrawSurface1::GetPalette(LPDIRECTDRAWPALETTE FAR *lplpDDPalette)
|
1257 | 1328 | {
|
| 1329 | + if(!this) return DDERR_INVALIDPARAMS;
|
1258 | 1330 | return glDDS7->GetPalette(lplpDDPalette);
|
1259 | 1331 | }
|
1260 | 1332 | HRESULT WINAPI glDirectDrawSurface1::GetPixelFormat(LPDDPIXELFORMAT lpDDPixelFormat)
|
1261 | 1333 | {
|
| 1334 | + if(!this) return DDERR_INVALIDPARAMS;
|
1262 | 1335 | return glDDS7->GetPixelFormat(lpDDPixelFormat);
|
1263 | 1336 | }
|
1264 | 1337 | HRESULT WINAPI glDirectDrawSurface1::GetSurfaceDesc(LPDDSURFACEDESC lpDDSurfaceDesc)
|
1265 | 1338 | {
|
| 1339 | + if(!this) return DDERR_INVALIDPARAMS;
|
1266 | 1340 | return glDDS7->GetSurfaceDesc((LPDDSURFACEDESC2)lpDDSurfaceDesc);
|
1267 | 1341 | }
|
1268 | 1342 | HRESULT WINAPI glDirectDrawSurface1::Initialize(LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc)
|
1269 | 1343 | {
|
| 1344 | + if(!this) return DDERR_INVALIDPARAMS;
|
1270 | 1345 | return DDERR_ALREADYINITIALIZED;
|
1271 | 1346 | }
|
1272 | 1347 | HRESULT WINAPI glDirectDrawSurface1::IsLost()
|
1273 | 1348 | {
|
| 1349 | + if(!this) return DDERR_INVALIDPARAMS;
|
1274 | 1350 | return glDDS7->IsLost();
|
1275 | 1351 | }
|
1276 | 1352 | HRESULT WINAPI glDirectDrawSurface1::Lock(LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent)
|
1277 | 1353 | {
|
| 1354 | + if(!this) return DDERR_INVALIDPARAMS;
|
1278 | 1355 | return glDDS7->Lock(lpDestRect,(LPDDSURFACEDESC2)lpDDSurfaceDesc,dwFlags,hEvent);
|
1279 | 1356 | }
|
1280 | 1357 | HRESULT WINAPI glDirectDrawSurface1::ReleaseDC(HDC hDC)
|
1281 | 1358 | {
|
| 1359 | + if(!this) return DDERR_INVALIDPARAMS;
|
1282 | 1360 | return glDDS7->ReleaseDC(hDC);
|
1283 | 1361 | }
|
1284 | 1362 | HRESULT WINAPI glDirectDrawSurface1::Restore()
|
1285 | 1363 | {
|
| 1364 | + if(!this) return DDERR_INVALIDPARAMS;
|
1286 | 1365 | return glDDS7->Restore();
|
1287 | 1366 | }
|
1288 | 1367 | HRESULT WINAPI glDirectDrawSurface1::SetClipper(LPDIRECTDRAWCLIPPER lpDDClipper)
|
1289 | 1368 | {
|
| 1369 | + if(!this) return DDERR_INVALIDPARAMS;
|
1290 | 1370 | return glDDS7->SetClipper(lpDDClipper);
|
1291 | 1371 | }
|
1292 | 1372 | HRESULT WINAPI glDirectDrawSurface1::SetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
|
1293 | 1373 | {
|
| 1374 | + if(!this) return DDERR_INVALIDPARAMS;
|
1294 | 1375 | return glDDS7->SetColorKey(dwFlags,lpDDColorKey);
|
1295 | 1376 | }
|
1296 | 1377 | HRESULT WINAPI glDirectDrawSurface1::SetOverlayPosition(LONG lX, LONG lY)
|
1297 | 1378 | {
|
| 1379 | + if(!this) return DDERR_INVALIDPARAMS;
|
1298 | 1380 | return glDDS7->SetOverlayPosition(lX,lY);
|
1299 | 1381 | }
|
1300 | 1382 | HRESULT WINAPI glDirectDrawSurface1::SetPalette(LPDIRECTDRAWPALETTE lpDDPalette)
|
1301 | 1383 | {
|
| 1384 | + if(!this) return DDERR_INVALIDPARAMS;
|
1302 | 1385 | return glDDS7->SetPalette(lpDDPalette);
|
1303 | 1386 | }
|
1304 | 1387 | HRESULT WINAPI glDirectDrawSurface1::Unlock(LPVOID lpSurfaceData)
|
1305 | 1388 | {
|
| 1389 | + if(!this) return DDERR_INVALIDPARAMS;
|
1306 | 1390 | return glDDS7->Unlock2(lpSurfaceData);
|
1307 | 1391 | }
|
1308 | 1392 | HRESULT WINAPI glDirectDrawSurface1::UpdateOverlay(LPRECT lpSrcRect, LPDIRECTDRAWSURFACE lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx)
|
1309 | 1393 | {
|
| 1394 | + if(!this) return DDERR_INVALIDPARAMS;
|
1310 | 1395 | return glDDS7->UpdateOverlay(lpSrcRect,(LPDIRECTDRAWSURFACE7)lpDDDestSurface,lpDestRect,dwFlags,lpDDOverlayFx);
|
1311 | 1396 | }
|
1312 | 1397 | HRESULT WINAPI glDirectDrawSurface1::UpdateOverlayDisplay(DWORD dwFlags)
|
1313 | 1398 | {
|
| 1399 | + if(!this) return DDERR_INVALIDPARAMS;
|
1314 | 1400 | return glDDS7->UpdateOverlayDisplay(dwFlags);
|
1315 | 1401 | }
|
1316 | 1402 | HRESULT WINAPI glDirectDrawSurface1::UpdateOverlayZOrder(DWORD dwFlags, LPDIRECTDRAWSURFACE lpDDSReference)
|
1317 | 1403 | {
|
| 1404 | + if(!this) return DDERR_INVALIDPARAMS;
|
1318 | 1405 | return glDDS7->UpdateOverlayZOrder(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSReference);
|
1319 | 1406 | }
|
1320 | 1407 |
|
— | — | @@ -1330,15 +1417,18 @@ |
1331 | 1418 | }
|
1332 | 1419 | HRESULT WINAPI glDirectDrawSurface2::QueryInterface(REFIID riid, void** ppvObj)
|
1333 | 1420 | {
|
| 1421 | + if(!this) return DDERR_INVALIDPARAMS;
|
1334 | 1422 | return glDDS7->QueryInterface(riid,ppvObj);
|
1335 | 1423 | }
|
1336 | 1424 | ULONG WINAPI glDirectDrawSurface2::AddRef()
|
1337 | 1425 | {
|
| 1426 | + if(!this) return 0;
|
1338 | 1427 | refcount++;
|
1339 | 1428 | return refcount;
|
1340 | 1429 | }
|
1341 | 1430 | ULONG WINAPI glDirectDrawSurface2::Release()
|
1342 | 1431 | {
|
| 1432 | + if(!this) return 0;
|
1343 | 1433 | ULONG ret;
|
1344 | 1434 | refcount--;
|
1345 | 1435 | ret = refcount;
|
— | — | @@ -1347,39 +1437,48 @@ |
1348 | 1438 | }
|
1349 | 1439 | HRESULT WINAPI glDirectDrawSurface2::AddAttachedSurface(LPDIRECTDRAWSURFACE2 lpDDSAttachedSurface)
|
1350 | 1440 | {
|
| 1441 | + if(!this) return DDERR_INVALIDPARAMS;
|
1351 | 1442 | return glDDS7->AddAttachedSurface((LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface);
|
1352 | 1443 | }
|
1353 | 1444 | HRESULT WINAPI glDirectDrawSurface2::AddOverlayDirtyRect(LPRECT lpRect)
|
1354 | 1445 | {
|
| 1446 | + if(!this) return DDERR_INVALIDPARAMS;
|
1355 | 1447 | return glDDS7->AddOverlayDirtyRect(lpRect);
|
1356 | 1448 | }
|
1357 | 1449 | HRESULT WINAPI glDirectDrawSurface2::Blt(LPRECT lpDestRect, LPDIRECTDRAWSURFACE2 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
|
1358 | 1450 | {
|
| 1451 | + if(!this) return DDERR_INVALIDPARAMS;
|
1359 | 1452 | if(lpDDSrcSurface) return glDDS7->Blt(lpDestRect,((glDirectDrawSurface2*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwFlags,lpDDBltFx);
|
1360 | 1453 | else return glDDS7->Blt(lpDestRect,NULL,lpSrcRect,dwFlags,lpDDBltFx);
|
1361 | 1454 | }
|
1362 | 1455 | HRESULT WINAPI glDirectDrawSurface2::BltBatch(LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags)
|
1363 | 1456 | {
|
| 1457 | + if(!this) return DDERR_INVALIDPARAMS;
|
1364 | 1458 | return glDDS7->BltBatch(lpDDBltBatch,dwCount,dwFlags);
|
1365 | 1459 | }
|
1366 | 1460 | HRESULT WINAPI glDirectDrawSurface2::BltFast(DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE2 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans)
|
1367 | 1461 | {
|
| 1462 | + if(!this) return DDERR_INVALIDPARAMS;
|
1368 | 1463 | return glDDS7->BltFast(dwX,dwY,((glDirectDrawSurface2*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwTrans);
|
1369 | 1464 | }
|
1370 | 1465 | HRESULT WINAPI glDirectDrawSurface2::DeleteAttachedSurface(DWORD dwFlags, LPDIRECTDRAWSURFACE2 lpDDSAttachedSurface)
|
1371 | 1466 | {
|
| 1467 | + if(!this) return DDERR_INVALIDPARAMS;
|
1372 | 1468 | return glDDS7->DeleteAttachedSurface(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface);
|
1373 | 1469 | }
|
1374 | 1470 | HRESULT WINAPI glDirectDrawSurface2::EnumAttachedSurfaces(LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback)
|
1375 | 1471 | {
|
| 1472 | + if(!this) return DDERR_INVALIDPARAMS;
|
1376 | 1473 | return glDDS7->EnumAttachedSurfaces(lpContext,(LPDDENUMSURFACESCALLBACK7)lpEnumSurfacesCallback);
|
1377 | 1474 | }
|
1378 | 1475 | HRESULT WINAPI glDirectDrawSurface2::EnumOverlayZOrders(DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback)
|
1379 | 1476 | {
|
| 1477 | + if(!this) return DDERR_INVALIDPARAMS;
|
1380 | 1478 | return glDDS7->EnumOverlayZOrders(dwFlags,lpContext,(LPDDENUMSURFACESCALLBACK7)lpfnCallback);
|
1381 | 1479 | }
|
1382 | 1480 | HRESULT WINAPI glDirectDrawSurface2::Flip(LPDIRECTDRAWSURFACE2 lpDDSurfaceTargetOverride, DWORD dwFlags)
|
1383 | 1481 | {
|
| 1482 | + if(!this) return DDERR_INVALIDPARAMS;
|
1384 | 1483 | if(lpDDSurfaceTargetOverride)
|
1385 | 1484 | return glDDS7->Flip(((glDirectDrawSurface2*)lpDDSurfaceTargetOverride)->GetDDS7(),dwFlags);
|
1386 | 1485 | else return glDDS7->Flip(NULL,dwFlags);
|
— | — | @@ -1386,6 +1485,7 @@ |
1387 | 1486 | }
|
1388 | 1487 | HRESULT WINAPI glDirectDrawSurface2::GetAttachedSurface(LPDDSCAPS lpDDSCaps, LPDIRECTDRAWSURFACE2 FAR *lplpDDAttachedSurface)
|
1389 | 1488 | {
|
| 1489 | + if(!this) return DDERR_INVALIDPARAMS;
|
1390 | 1490 | HRESULT error;
|
1391 | 1491 | glDirectDrawSurface7 *attachedsurface;
|
1392 | 1492 | glDirectDrawSurface2 *attached1;
|
— | — | @@ -1403,10 +1503,12 @@ |
1404 | 1504 | }
|
1405 | 1505 | HRESULT WINAPI glDirectDrawSurface2::GetBltStatus(DWORD dwFlags)
|
1406 | 1506 | {
|
| 1507 | + if(!this) return DDERR_INVALIDPARAMS;
|
1407 | 1508 | return glDDS7->GetBltStatus(dwFlags);
|
1408 | 1509 | }
|
1409 | 1510 | HRESULT WINAPI glDirectDrawSurface2::GetCaps(LPDDSCAPS lpDDSCaps)
|
1410 | 1511 | {
|
| 1512 | + if(!this) return DDERR_INVALIDPARAMS;
|
1411 | 1513 | HRESULT error;
|
1412 | 1514 | DDSCAPS2 ddsCaps1;
|
1413 | 1515 | error = glDDS7->GetCaps(&ddsCaps1);
|
— | — | @@ -1416,98 +1518,122 @@ |
1417 | 1519 | }
|
1418 | 1520 | HRESULT WINAPI glDirectDrawSurface2::GetClipper(LPDIRECTDRAWCLIPPER FAR *lplpDDClipper)
|
1419 | 1521 | {
|
| 1522 | + if(!this) return DDERR_INVALIDPARAMS;
|
1420 | 1523 | return glDDS7->GetClipper(lplpDDClipper);
|
1421 | 1524 | }
|
1422 | 1525 | HRESULT WINAPI glDirectDrawSurface2::GetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
|
1423 | 1526 | {
|
| 1527 | + if(!this) return DDERR_INVALIDPARAMS;
|
1424 | 1528 | return glDDS7->GetColorKey(dwFlags,lpDDColorKey);
|
1425 | 1529 | }
|
1426 | 1530 | HRESULT WINAPI glDirectDrawSurface2::GetDC(HDC FAR *lphDC)
|
1427 | 1531 | {
|
| 1532 | + if(!this) return DDERR_INVALIDPARAMS;
|
1428 | 1533 | return glDDS7->GetDC(lphDC);
|
1429 | 1534 | }
|
1430 | 1535 | HRESULT WINAPI glDirectDrawSurface2::GetFlipStatus(DWORD dwFlags)
|
1431 | 1536 | {
|
| 1537 | + if(!this) return DDERR_INVALIDPARAMS;
|
1432 | 1538 | return glDDS7->GetFlipStatus(dwFlags);
|
1433 | 1539 | }
|
1434 | 1540 | HRESULT WINAPI glDirectDrawSurface2::GetOverlayPosition(LPLONG lplX, LPLONG lplY)
|
1435 | 1541 | {
|
| 1542 | + if(!this) return DDERR_INVALIDPARAMS;
|
1436 | 1543 | return glDDS7->GetOverlayPosition(lplX,lplY);
|
1437 | 1544 | }
|
1438 | 1545 | HRESULT WINAPI glDirectDrawSurface2::GetPalette(LPDIRECTDRAWPALETTE FAR *lplpDDPalette)
|
1439 | 1546 | {
|
| 1547 | + if(!this) return DDERR_INVALIDPARAMS;
|
1440 | 1548 | return glDDS7->GetPalette(lplpDDPalette);
|
1441 | 1549 | }
|
1442 | 1550 | HRESULT WINAPI glDirectDrawSurface2::GetPixelFormat(LPDDPIXELFORMAT lpDDPixelFormat)
|
1443 | 1551 | {
|
| 1552 | + if(!this) return DDERR_INVALIDPARAMS;
|
1444 | 1553 | return glDDS7->GetPixelFormat(lpDDPixelFormat);
|
1445 | 1554 | }
|
1446 | 1555 | HRESULT WINAPI glDirectDrawSurface2::GetSurfaceDesc(LPDDSURFACEDESC lpDDSurfaceDesc)
|
1447 | 1556 | {
|
| 1557 | + if(!this) return DDERR_INVALIDPARAMS;
|
1448 | 1558 | return glDDS7->GetSurfaceDesc((LPDDSURFACEDESC2)lpDDSurfaceDesc);
|
1449 | 1559 | }
|
1450 | 1560 | HRESULT WINAPI glDirectDrawSurface2::Initialize(LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc)
|
1451 | 1561 | {
|
| 1562 | + if(!this) return DDERR_INVALIDPARAMS;
|
1452 | 1563 | return DDERR_ALREADYINITIALIZED;
|
1453 | 1564 | }
|
1454 | 1565 | HRESULT WINAPI glDirectDrawSurface2::IsLost()
|
1455 | 1566 | {
|
| 1567 | + if(!this) return DDERR_INVALIDPARAMS;
|
1456 | 1568 | return glDDS7->IsLost();
|
1457 | 1569 | }
|
1458 | 1570 | HRESULT WINAPI glDirectDrawSurface2::Lock(LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent)
|
1459 | 1571 | {
|
| 1572 | + if(!this) return DDERR_INVALIDPARAMS;
|
1460 | 1573 | return glDDS7->Lock(lpDestRect,(LPDDSURFACEDESC2)lpDDSurfaceDesc,dwFlags,hEvent);
|
1461 | 1574 | }
|
1462 | 1575 | HRESULT WINAPI glDirectDrawSurface2::ReleaseDC(HDC hDC)
|
1463 | 1576 | {
|
| 1577 | + if(!this) return DDERR_INVALIDPARAMS;
|
1464 | 1578 | return glDDS7->ReleaseDC(hDC);
|
1465 | 1579 | }
|
1466 | 1580 | HRESULT WINAPI glDirectDrawSurface2::Restore()
|
1467 | 1581 | {
|
| 1582 | + if(!this) return DDERR_INVALIDPARAMS;
|
1468 | 1583 | return glDDS7->Restore();
|
1469 | 1584 | }
|
1470 | 1585 | HRESULT WINAPI glDirectDrawSurface2::SetClipper(LPDIRECTDRAWCLIPPER lpDDClipper)
|
1471 | 1586 | {
|
| 1587 | + if(!this) return DDERR_INVALIDPARAMS;
|
1472 | 1588 | return glDDS7->SetClipper(lpDDClipper);
|
1473 | 1589 | }
|
1474 | 1590 | HRESULT WINAPI glDirectDrawSurface2::SetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
|
1475 | 1591 | {
|
| 1592 | + if(!this) return DDERR_INVALIDPARAMS;
|
1476 | 1593 | return glDDS7->SetColorKey(dwFlags,lpDDColorKey);
|
1477 | 1594 | }
|
1478 | 1595 | HRESULT WINAPI glDirectDrawSurface2::SetOverlayPosition(LONG lX, LONG lY)
|
1479 | 1596 | {
|
| 1597 | + if(!this) return DDERR_INVALIDPARAMS;
|
1480 | 1598 | return glDDS7->SetOverlayPosition(lX,lY);
|
1481 | 1599 | }
|
1482 | 1600 | HRESULT WINAPI glDirectDrawSurface2::SetPalette(LPDIRECTDRAWPALETTE lpDDPalette)
|
1483 | 1601 | {
|
| 1602 | + if(!this) return DDERR_INVALIDPARAMS;
|
1484 | 1603 | return glDDS7->SetPalette(lpDDPalette);
|
1485 | 1604 | }
|
1486 | 1605 | HRESULT WINAPI glDirectDrawSurface2::Unlock(LPVOID lpSurfaceData)
|
1487 | 1606 | {
|
| 1607 | + if(!this) return DDERR_INVALIDPARAMS;
|
1488 | 1608 | return glDDS7->Unlock2(lpSurfaceData);
|
1489 | 1609 | }
|
1490 | 1610 | HRESULT WINAPI glDirectDrawSurface2::UpdateOverlay(LPRECT lpSrcRect, LPDIRECTDRAWSURFACE2 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx)
|
1491 | 1611 | {
|
| 1612 | + if(!this) return DDERR_INVALIDPARAMS;
|
1492 | 1613 | return glDDS7->UpdateOverlay(lpSrcRect,(LPDIRECTDRAWSURFACE7)lpDDDestSurface,lpDestRect,dwFlags,lpDDOverlayFx);
|
1493 | 1614 | }
|
1494 | 1615 | HRESULT WINAPI glDirectDrawSurface2::UpdateOverlayDisplay(DWORD dwFlags)
|
1495 | 1616 | {
|
| 1617 | + if(!this) return DDERR_INVALIDPARAMS;
|
1496 | 1618 | return glDDS7->UpdateOverlayDisplay(dwFlags);
|
1497 | 1619 | }
|
1498 | 1620 | HRESULT WINAPI glDirectDrawSurface2::UpdateOverlayZOrder(DWORD dwFlags, LPDIRECTDRAWSURFACE2 lpDDSReference)
|
1499 | 1621 | {
|
| 1622 | + if(!this) return DDERR_INVALIDPARAMS;
|
1500 | 1623 | return glDDS7->UpdateOverlayZOrder(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSReference);
|
1501 | 1624 | }
|
1502 | 1625 | HRESULT WINAPI glDirectDrawSurface2::GetDDInterface(LPVOID FAR *lplpDD)
|
1503 | 1626 | {
|
| 1627 | + if(!this) return DDERR_INVALIDPARAMS;
|
1504 | 1628 | return glDDS7->GetDDInterface(lplpDD);
|
1505 | 1629 | }
|
1506 | 1630 | HRESULT WINAPI glDirectDrawSurface2::PageLock(DWORD dwFlags)
|
1507 | 1631 | {
|
| 1632 | + if(!this) return DDERR_INVALIDPARAMS;
|
1508 | 1633 | return glDDS7->PageLock(dwFlags);
|
1509 | 1634 | }
|
1510 | 1635 | HRESULT WINAPI glDirectDrawSurface2::PageUnlock(DWORD dwFlags)
|
1511 | 1636 | {
|
| 1637 | + if(!this) return DDERR_INVALIDPARAMS;
|
1512 | 1638 | return glDDS7->PageUnlock(dwFlags);
|
1513 | 1639 | }
|
1514 | 1640 |
|
— | — | @@ -1524,15 +1650,18 @@ |
1525 | 1651 | }
|
1526 | 1652 | HRESULT WINAPI glDirectDrawSurface3::QueryInterface(REFIID riid, void** ppvObj)
|
1527 | 1653 | {
|
| 1654 | + if(!this) return DDERR_INVALIDPARAMS;
|
1528 | 1655 | return glDDS7->QueryInterface(riid,ppvObj);
|
1529 | 1656 | }
|
1530 | 1657 | ULONG WINAPI glDirectDrawSurface3::AddRef()
|
1531 | 1658 | {
|
| 1659 | + if(!this) return 0;
|
1532 | 1660 | refcount++;
|
1533 | 1661 | return refcount;
|
1534 | 1662 | }
|
1535 | 1663 | ULONG WINAPI glDirectDrawSurface3::Release()
|
1536 | 1664 | {
|
| 1665 | + if(!this) return 0;
|
1537 | 1666 | ULONG ret;
|
1538 | 1667 | refcount--;
|
1539 | 1668 | ret = refcount;
|
— | — | @@ -1541,39 +1670,48 @@ |
1542 | 1671 | }
|
1543 | 1672 | HRESULT WINAPI glDirectDrawSurface3::AddAttachedSurface(LPDIRECTDRAWSURFACE3 lpDDSAttachedSurface)
|
1544 | 1673 | {
|
| 1674 | + if(!this) return DDERR_INVALIDPARAMS;
|
1545 | 1675 | return glDDS7->AddAttachedSurface((LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface);
|
1546 | 1676 | }
|
1547 | 1677 | HRESULT WINAPI glDirectDrawSurface3::AddOverlayDirtyRect(LPRECT lpRect)
|
1548 | 1678 | {
|
| 1679 | + if(!this) return DDERR_INVALIDPARAMS;
|
1549 | 1680 | return glDDS7->AddOverlayDirtyRect(lpRect);
|
1550 | 1681 | }
|
1551 | 1682 | HRESULT WINAPI glDirectDrawSurface3::Blt(LPRECT lpDestRect, LPDIRECTDRAWSURFACE3 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
|
1552 | 1683 | {
|
| 1684 | + if(!this) return DDERR_INVALIDPARAMS;
|
1553 | 1685 | if(lpDDSrcSurface) return glDDS7->Blt(lpDestRect,((glDirectDrawSurface3*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwFlags,lpDDBltFx);
|
1554 | 1686 | else return glDDS7->Blt(lpDestRect,NULL,lpSrcRect,dwFlags,lpDDBltFx);
|
1555 | 1687 | }
|
1556 | 1688 | HRESULT WINAPI glDirectDrawSurface3::BltBatch(LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags)
|
1557 | 1689 | {
|
| 1690 | + if(!this) return DDERR_INVALIDPARAMS;
|
1558 | 1691 | return glDDS7->BltBatch(lpDDBltBatch,dwCount,dwFlags);
|
1559 | 1692 | }
|
1560 | 1693 | HRESULT WINAPI glDirectDrawSurface3::BltFast(DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE3 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans)
|
1561 | 1694 | {
|
| 1695 | + if(!this) return DDERR_INVALIDPARAMS;
|
1562 | 1696 | return glDDS7->BltFast(dwX,dwY,((glDirectDrawSurface3*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwTrans);
|
1563 | 1697 | }
|
1564 | 1698 | HRESULT WINAPI glDirectDrawSurface3::DeleteAttachedSurface(DWORD dwFlags, LPDIRECTDRAWSURFACE3 lpDDSAttachedSurface)
|
1565 | 1699 | {
|
| 1700 | + if(!this) return DDERR_INVALIDPARAMS;
|
1566 | 1701 | return glDDS7->DeleteAttachedSurface(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface);
|
1567 | 1702 | }
|
1568 | 1703 | HRESULT WINAPI glDirectDrawSurface3::EnumAttachedSurfaces(LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback)
|
1569 | 1704 | {
|
| 1705 | + if(!this) return DDERR_INVALIDPARAMS;
|
1570 | 1706 | return glDDS7->EnumAttachedSurfaces(lpContext,(LPDDENUMSURFACESCALLBACK7)lpEnumSurfacesCallback);
|
1571 | 1707 | }
|
1572 | 1708 | HRESULT WINAPI glDirectDrawSurface3::EnumOverlayZOrders(DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback)
|
1573 | 1709 | {
|
| 1710 | + if(!this) return DDERR_INVALIDPARAMS;
|
1574 | 1711 | return glDDS7->EnumOverlayZOrders(dwFlags,lpContext,(LPDDENUMSURFACESCALLBACK7)lpfnCallback);
|
1575 | 1712 | }
|
1576 | 1713 | HRESULT WINAPI glDirectDrawSurface3::Flip(LPDIRECTDRAWSURFACE3 lpDDSurfaceTargetOverride, DWORD dwFlags)
|
1577 | 1714 | {
|
| 1715 | + if(!this) return DDERR_INVALIDPARAMS;
|
1578 | 1716 | if(lpDDSurfaceTargetOverride)
|
1579 | 1717 | return glDDS7->Flip(((glDirectDrawSurface3*)lpDDSurfaceTargetOverride)->GetDDS7(),dwFlags);
|
1580 | 1718 | else return glDDS7->Flip(NULL,dwFlags);
|
— | — | @@ -1580,6 +1718,7 @@ |
1581 | 1719 | }
|
1582 | 1720 | HRESULT WINAPI glDirectDrawSurface3::GetAttachedSurface(LPDDSCAPS lpDDSCaps, LPDIRECTDRAWSURFACE3 FAR *lplpDDAttachedSurface)
|
1583 | 1721 | {
|
| 1722 | + if(!this) return DDERR_INVALIDPARAMS;
|
1584 | 1723 | HRESULT error;
|
1585 | 1724 | glDirectDrawSurface7 *attachedsurface;
|
1586 | 1725 | glDirectDrawSurface3 *attached1;
|
— | — | @@ -1597,10 +1736,12 @@ |
1598 | 1737 | }
|
1599 | 1738 | HRESULT WINAPI glDirectDrawSurface3::GetBltStatus(DWORD dwFlags)
|
1600 | 1739 | {
|
| 1740 | + if(!this) return DDERR_INVALIDPARAMS;
|
1601 | 1741 | return glDDS7->GetBltStatus(dwFlags);
|
1602 | 1742 | }
|
1603 | 1743 | HRESULT WINAPI glDirectDrawSurface3::GetCaps(LPDDSCAPS lpDDSCaps)
|
1604 | 1744 | {
|
| 1745 | + if(!this) return DDERR_INVALIDPARAMS;
|
1605 | 1746 | HRESULT error;
|
1606 | 1747 | DDSCAPS2 ddsCaps1;
|
1607 | 1748 | error = glDDS7->GetCaps(&ddsCaps1);
|
— | — | @@ -1610,102 +1751,127 @@ |
1611 | 1752 | }
|
1612 | 1753 | HRESULT WINAPI glDirectDrawSurface3::GetClipper(LPDIRECTDRAWCLIPPER FAR *lplpDDClipper)
|
1613 | 1754 | {
|
| 1755 | + if(!this) return DDERR_INVALIDPARAMS;
|
1614 | 1756 | return glDDS7->GetClipper(lplpDDClipper);
|
1615 | 1757 | }
|
1616 | 1758 | HRESULT WINAPI glDirectDrawSurface3::GetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
|
1617 | 1759 | {
|
| 1760 | + if(!this) return DDERR_INVALIDPARAMS;
|
1618 | 1761 | return glDDS7->GetColorKey(dwFlags,lpDDColorKey);
|
1619 | 1762 | }
|
1620 | 1763 | HRESULT WINAPI glDirectDrawSurface3::GetDC(HDC FAR *lphDC)
|
1621 | 1764 | {
|
| 1765 | + if(!this) return DDERR_INVALIDPARAMS;
|
1622 | 1766 | return glDDS7->GetDC(lphDC);
|
1623 | 1767 | }
|
1624 | 1768 | HRESULT WINAPI glDirectDrawSurface3::GetFlipStatus(DWORD dwFlags)
|
1625 | 1769 | {
|
| 1770 | + if(!this) return DDERR_INVALIDPARAMS;
|
1626 | 1771 | return glDDS7->GetFlipStatus(dwFlags);
|
1627 | 1772 | }
|
1628 | 1773 | HRESULT WINAPI glDirectDrawSurface3::GetOverlayPosition(LPLONG lplX, LPLONG lplY)
|
1629 | 1774 | {
|
| 1775 | + if(!this) return DDERR_INVALIDPARAMS;
|
1630 | 1776 | return glDDS7->GetOverlayPosition(lplX,lplY);
|
1631 | 1777 | }
|
1632 | 1778 | HRESULT WINAPI glDirectDrawSurface3::GetPalette(LPDIRECTDRAWPALETTE FAR *lplpDDPalette)
|
1633 | 1779 | {
|
| 1780 | + if(!this) return DDERR_INVALIDPARAMS;
|
1634 | 1781 | return glDDS7->GetPalette(lplpDDPalette);
|
1635 | 1782 | }
|
1636 | 1783 | HRESULT WINAPI glDirectDrawSurface3::GetPixelFormat(LPDDPIXELFORMAT lpDDPixelFormat)
|
1637 | 1784 | {
|
| 1785 | + if(!this) return DDERR_INVALIDPARAMS;
|
1638 | 1786 | return glDDS7->GetPixelFormat(lpDDPixelFormat);
|
1639 | 1787 | }
|
1640 | 1788 | HRESULT WINAPI glDirectDrawSurface3::GetSurfaceDesc(LPDDSURFACEDESC lpDDSurfaceDesc)
|
1641 | 1789 | {
|
| 1790 | + if(!this) return DDERR_INVALIDPARAMS;
|
1642 | 1791 | return glDDS7->GetSurfaceDesc((LPDDSURFACEDESC2)lpDDSurfaceDesc);
|
1643 | 1792 | }
|
1644 | 1793 | HRESULT WINAPI glDirectDrawSurface3::Initialize(LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc)
|
1645 | 1794 | {
|
| 1795 | + if(!this) return DDERR_INVALIDPARAMS;
|
1646 | 1796 | return DDERR_ALREADYINITIALIZED;
|
1647 | 1797 | }
|
1648 | 1798 | HRESULT WINAPI glDirectDrawSurface3::IsLost()
|
1649 | 1799 | {
|
| 1800 | + if(!this) return DDERR_INVALIDPARAMS;
|
1650 | 1801 | return glDDS7->IsLost();
|
1651 | 1802 | }
|
1652 | 1803 | HRESULT WINAPI glDirectDrawSurface3::Lock(LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent)
|
1653 | 1804 | {
|
| 1805 | + if(!this) return DDERR_INVALIDPARAMS;
|
1654 | 1806 | return glDDS7->Lock(lpDestRect,(LPDDSURFACEDESC2)lpDDSurfaceDesc,dwFlags,hEvent);
|
1655 | 1807 | }
|
1656 | 1808 | HRESULT WINAPI glDirectDrawSurface3::ReleaseDC(HDC hDC)
|
1657 | 1809 | {
|
| 1810 | + if(!this) return DDERR_INVALIDPARAMS;
|
1658 | 1811 | return glDDS7->ReleaseDC(hDC);
|
1659 | 1812 | }
|
1660 | 1813 | HRESULT WINAPI glDirectDrawSurface3::Restore()
|
1661 | 1814 | {
|
| 1815 | + if(!this) return DDERR_INVALIDPARAMS;
|
1662 | 1816 | return glDDS7->Restore();
|
1663 | 1817 | }
|
1664 | 1818 | HRESULT WINAPI glDirectDrawSurface3::SetClipper(LPDIRECTDRAWCLIPPER lpDDClipper)
|
1665 | 1819 | {
|
| 1820 | + if(!this) return DDERR_INVALIDPARAMS;
|
1666 | 1821 | return glDDS7->SetClipper(lpDDClipper);
|
1667 | 1822 | }
|
1668 | 1823 | HRESULT WINAPI glDirectDrawSurface3::SetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
|
1669 | 1824 | {
|
| 1825 | + if(!this) return DDERR_INVALIDPARAMS;
|
1670 | 1826 | return glDDS7->SetColorKey(dwFlags,lpDDColorKey);
|
1671 | 1827 | }
|
1672 | 1828 | HRESULT WINAPI glDirectDrawSurface3::SetOverlayPosition(LONG lX, LONG lY)
|
1673 | 1829 | {
|
| 1830 | + if(!this) return DDERR_INVALIDPARAMS;
|
1674 | 1831 | return glDDS7->SetOverlayPosition(lX,lY);
|
1675 | 1832 | }
|
1676 | 1833 | HRESULT WINAPI glDirectDrawSurface3::SetPalette(LPDIRECTDRAWPALETTE lpDDPalette)
|
1677 | 1834 | {
|
| 1835 | + if(!this) return DDERR_INVALIDPARAMS;
|
1678 | 1836 | return glDDS7->SetPalette(lpDDPalette);
|
1679 | 1837 | }
|
1680 | 1838 | HRESULT WINAPI glDirectDrawSurface3::Unlock(LPVOID lpSurfaceData)
|
1681 | 1839 | {
|
| 1840 | + if(!this) return DDERR_INVALIDPARAMS;
|
1682 | 1841 | return glDDS7->Unlock2(lpSurfaceData);
|
1683 | 1842 | }
|
1684 | 1843 | HRESULT WINAPI glDirectDrawSurface3::UpdateOverlay(LPRECT lpSrcRect, LPDIRECTDRAWSURFACE3 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx)
|
1685 | 1844 | {
|
| 1845 | + if(!this) return DDERR_INVALIDPARAMS;
|
1686 | 1846 | return glDDS7->UpdateOverlay(lpSrcRect,(LPDIRECTDRAWSURFACE7)lpDDDestSurface,lpDestRect,dwFlags,lpDDOverlayFx);
|
1687 | 1847 | }
|
1688 | 1848 | HRESULT WINAPI glDirectDrawSurface3::UpdateOverlayDisplay(DWORD dwFlags)
|
1689 | 1849 | {
|
| 1850 | + if(!this) return DDERR_INVALIDPARAMS;
|
1690 | 1851 | return glDDS7->UpdateOverlayDisplay(dwFlags);
|
1691 | 1852 | }
|
1692 | 1853 | HRESULT WINAPI glDirectDrawSurface3::UpdateOverlayZOrder(DWORD dwFlags, LPDIRECTDRAWSURFACE3 lpDDSReference)
|
1693 | 1854 | {
|
| 1855 | + if(!this) return DDERR_INVALIDPARAMS;
|
1694 | 1856 | return glDDS7->UpdateOverlayZOrder(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSReference);
|
1695 | 1857 | }
|
1696 | 1858 | HRESULT WINAPI glDirectDrawSurface3::GetDDInterface(LPVOID FAR *lplpDD)
|
1697 | 1859 | {
|
| 1860 | + if(!this) return DDERR_INVALIDPARAMS;
|
1698 | 1861 | return glDDS7->GetDDInterface(lplpDD);
|
1699 | 1862 | }
|
1700 | 1863 | HRESULT WINAPI glDirectDrawSurface3::PageLock(DWORD dwFlags)
|
1701 | 1864 | {
|
| 1865 | + if(!this) return DDERR_INVALIDPARAMS;
|
1702 | 1866 | return glDDS7->PageLock(dwFlags);
|
1703 | 1867 | }
|
1704 | 1868 | HRESULT WINAPI glDirectDrawSurface3::PageUnlock(DWORD dwFlags)
|
1705 | 1869 | {
|
| 1870 | + if(!this) return DDERR_INVALIDPARAMS;
|
1706 | 1871 | return glDDS7->PageUnlock(dwFlags);
|
1707 | 1872 | }
|
1708 | 1873 | HRESULT WINAPI glDirectDrawSurface3::SetSurfaceDesc(LPDDSURFACEDESC lpddsd, DWORD dwFlags)
|
1709 | 1874 | {
|
| 1875 | + if(!this) return DDERR_INVALIDPARAMS;
|
1710 | 1876 | return glDDS7->SetSurfaceDesc((LPDDSURFACEDESC2)lpddsd,dwFlags);
|
1711 | 1877 | }
|
1712 | 1878 |
|
— | — | @@ -1722,15 +1888,18 @@ |
1723 | 1889 | }
|
1724 | 1890 | HRESULT WINAPI glDirectDrawSurface4::QueryInterface(REFIID riid, void** ppvObj)
|
1725 | 1891 | {
|
| 1892 | + if(!this) return DDERR_INVALIDPARAMS;
|
1726 | 1893 | return glDDS7->QueryInterface(riid,ppvObj);
|
1727 | 1894 | }
|
1728 | 1895 | ULONG WINAPI glDirectDrawSurface4::AddRef()
|
1729 | 1896 | {
|
| 1897 | + if(!this) return 0;
|
1730 | 1898 | refcount++;
|
1731 | 1899 | return refcount;
|
1732 | 1900 | }
|
1733 | 1901 | ULONG WINAPI glDirectDrawSurface4::Release()
|
1734 | 1902 | {
|
| 1903 | + if(!this) return 0;
|
1735 | 1904 | ULONG ret;
|
1736 | 1905 | refcount--;
|
1737 | 1906 | ret = refcount;
|
— | — | @@ -1739,39 +1908,48 @@ |
1740 | 1909 | }
|
1741 | 1910 | HRESULT WINAPI glDirectDrawSurface4::AddAttachedSurface(LPDIRECTDRAWSURFACE4 lpDDSAttachedSurface)
|
1742 | 1911 | {
|
| 1912 | + if(!this) return DDERR_INVALIDPARAMS;
|
1743 | 1913 | return glDDS7->AddAttachedSurface((LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface);
|
1744 | 1914 | }
|
1745 | 1915 | HRESULT WINAPI glDirectDrawSurface4::AddOverlayDirtyRect(LPRECT lpRect)
|
1746 | 1916 | {
|
| 1917 | + if(!this) return DDERR_INVALIDPARAMS;
|
1747 | 1918 | return glDDS7->AddOverlayDirtyRect(lpRect);
|
1748 | 1919 | }
|
1749 | 1920 | HRESULT WINAPI glDirectDrawSurface4::Blt(LPRECT lpDestRect, LPDIRECTDRAWSURFACE4 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
|
1750 | 1921 | {
|
| 1922 | + if(!this) return DDERR_INVALIDPARAMS;
|
1751 | 1923 | if(lpDDSrcSurface) return glDDS7->Blt(lpDestRect,((glDirectDrawSurface4*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwFlags,lpDDBltFx);
|
1752 | 1924 | else return glDDS7->Blt(lpDestRect,NULL,lpSrcRect,dwFlags,lpDDBltFx);
|
1753 | 1925 | }
|
1754 | 1926 | HRESULT WINAPI glDirectDrawSurface4::BltBatch(LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags)
|
1755 | 1927 | {
|
| 1928 | + if(!this) return DDERR_INVALIDPARAMS;
|
1756 | 1929 | return glDDS7->BltBatch(lpDDBltBatch,dwCount,dwFlags);
|
1757 | 1930 | }
|
1758 | 1931 | HRESULT WINAPI glDirectDrawSurface4::BltFast(DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE4 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans)
|
1759 | 1932 | {
|
| 1933 | + if(!this) return DDERR_INVALIDPARAMS;
|
1760 | 1934 | return glDDS7->BltFast(dwX,dwY,((glDirectDrawSurface4*)lpDDSrcSurface)->GetDDS7(),lpSrcRect,dwTrans);
|
1761 | 1935 | }
|
1762 | 1936 | HRESULT WINAPI glDirectDrawSurface4::DeleteAttachedSurface(DWORD dwFlags, LPDIRECTDRAWSURFACE4 lpDDSAttachedSurface)
|
1763 | 1937 | {
|
| 1938 | + if(!this) return DDERR_INVALIDPARAMS;
|
1764 | 1939 | return glDDS7->DeleteAttachedSurface(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSAttachedSurface);
|
1765 | 1940 | }
|
1766 | 1941 | HRESULT WINAPI glDirectDrawSurface4::EnumAttachedSurfaces(LPVOID lpContext, LPDDENUMSURFACESCALLBACK2 lpEnumSurfacesCallback)
|
1767 | 1942 | {
|
| 1943 | + if(!this) return DDERR_INVALIDPARAMS;
|
1768 | 1944 | return glDDS7->EnumAttachedSurfaces(lpContext,(LPDDENUMSURFACESCALLBACK7)lpEnumSurfacesCallback);
|
1769 | 1945 | }
|
1770 | 1946 | HRESULT WINAPI glDirectDrawSurface4::EnumOverlayZOrders(DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK2 lpfnCallback)
|
1771 | 1947 | {
|
| 1948 | + if(!this) return DDERR_INVALIDPARAMS;
|
1772 | 1949 | return glDDS7->EnumOverlayZOrders(dwFlags,lpContext,(LPDDENUMSURFACESCALLBACK7)lpfnCallback);
|
1773 | 1950 | }
|
1774 | 1951 | HRESULT WINAPI glDirectDrawSurface4::Flip(LPDIRECTDRAWSURFACE4 lpDDSurfaceTargetOverride, DWORD dwFlags)
|
1775 | 1952 | {
|
| 1953 | + if(!this) return DDERR_INVALIDPARAMS;
|
1776 | 1954 | if(lpDDSurfaceTargetOverride)
|
1777 | 1955 | return glDDS7->Flip(((glDirectDrawSurface4*)lpDDSurfaceTargetOverride)->GetDDS7(),dwFlags);
|
1778 | 1956 | else return glDDS7->Flip(NULL,dwFlags);
|
— | — | @@ -1778,6 +1956,7 @@ |
1779 | 1957 | }
|
1780 | 1958 | HRESULT WINAPI glDirectDrawSurface4::GetAttachedSurface(LPDDSCAPS2 lpDDSCaps2, LPDIRECTDRAWSURFACE4 FAR *lplpDDAttachedSurface)
|
1781 | 1959 | {
|
| 1960 | + if(!this) return DDERR_INVALIDPARAMS;
|
1782 | 1961 | HRESULT error;
|
1783 | 1962 | glDirectDrawSurface7 *attachedsurface;
|
1784 | 1963 | glDirectDrawSurface4 *attached1;
|
— | — | @@ -1792,129 +1971,161 @@ |
1793 | 1972 | }
|
1794 | 1973 | HRESULT WINAPI glDirectDrawSurface4::GetBltStatus(DWORD dwFlags)
|
1795 | 1974 | {
|
| 1975 | + if(!this) return DDERR_INVALIDPARAMS;
|
1796 | 1976 | return glDDS7->GetBltStatus(dwFlags);
|
1797 | 1977 | }
|
1798 | 1978 | HRESULT WINAPI glDirectDrawSurface4::GetCaps(LPDDSCAPS2 lpDDSCaps)
|
1799 | 1979 | {
|
| 1980 | + if(!this) return DDERR_INVALIDPARAMS;
|
1800 | 1981 | return glDDS7->GetCaps(lpDDSCaps);
|
1801 | 1982 | }
|
1802 | 1983 | HRESULT WINAPI glDirectDrawSurface4::GetClipper(LPDIRECTDRAWCLIPPER FAR *lplpDDClipper)
|
1803 | 1984 | {
|
| 1985 | + if(!this) return DDERR_INVALIDPARAMS;
|
1804 | 1986 | return glDDS7->GetClipper(lplpDDClipper);
|
1805 | 1987 | }
|
1806 | 1988 | HRESULT WINAPI glDirectDrawSurface4::GetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
|
1807 | 1989 | {
|
| 1990 | + if(!this) return DDERR_INVALIDPARAMS;
|
1808 | 1991 | return glDDS7->GetColorKey(dwFlags,lpDDColorKey);
|
1809 | 1992 | }
|
1810 | 1993 | HRESULT WINAPI glDirectDrawSurface4::GetDC(HDC FAR *lphDC)
|
1811 | 1994 | {
|
| 1995 | + if(!this) return DDERR_INVALIDPARAMS;
|
1812 | 1996 | return glDDS7->GetDC(lphDC);
|
1813 | 1997 | }
|
1814 | 1998 | HRESULT WINAPI glDirectDrawSurface4::GetFlipStatus(DWORD dwFlags)
|
1815 | 1999 | {
|
| 2000 | + if(!this) return DDERR_INVALIDPARAMS;
|
1816 | 2001 | return glDDS7->GetFlipStatus(dwFlags);
|
1817 | 2002 | }
|
1818 | 2003 | HRESULT WINAPI glDirectDrawSurface4::GetOverlayPosition(LPLONG lplX, LPLONG lplY)
|
1819 | 2004 | {
|
| 2005 | + if(!this) return DDERR_INVALIDPARAMS;
|
1820 | 2006 | return glDDS7->GetOverlayPosition(lplX,lplY);
|
1821 | 2007 | }
|
1822 | 2008 | HRESULT WINAPI glDirectDrawSurface4::GetPalette(LPDIRECTDRAWPALETTE FAR *lplpDDPalette)
|
1823 | 2009 | {
|
| 2010 | + if(!this) return DDERR_INVALIDPARAMS;
|
1824 | 2011 | return glDDS7->GetPalette(lplpDDPalette);
|
1825 | 2012 | }
|
1826 | 2013 | HRESULT WINAPI glDirectDrawSurface4::GetPixelFormat(LPDDPIXELFORMAT lpDDPixelFormat)
|
1827 | 2014 | {
|
| 2015 | + if(!this) return DDERR_INVALIDPARAMS;
|
1828 | 2016 | return glDDS7->GetPixelFormat(lpDDPixelFormat);
|
1829 | 2017 | }
|
1830 | 2018 | HRESULT WINAPI glDirectDrawSurface4::GetSurfaceDesc(LPDDSURFACEDESC2 lpDDSurfaceDesc)
|
1831 | 2019 | {
|
| 2020 | + if(!this) return DDERR_INVALIDPARAMS;
|
1832 | 2021 | return glDDS7->GetSurfaceDesc(lpDDSurfaceDesc);
|
1833 | 2022 | }
|
1834 | 2023 | HRESULT WINAPI glDirectDrawSurface4::Initialize(LPDIRECTDRAW lpDD, LPDDSURFACEDESC2 lpDDSurfaceDesc)
|
1835 | 2024 | {
|
| 2025 | + if(!this) return DDERR_INVALIDPARAMS;
|
1836 | 2026 | return DDERR_ALREADYINITIALIZED;
|
1837 | 2027 | }
|
1838 | 2028 | HRESULT WINAPI glDirectDrawSurface4::IsLost()
|
1839 | 2029 | {
|
| 2030 | + if(!this) return DDERR_INVALIDPARAMS;
|
1840 | 2031 | return glDDS7->IsLost();
|
1841 | 2032 | }
|
1842 | 2033 | HRESULT WINAPI glDirectDrawSurface4::Lock(LPRECT lpDestRect, LPDDSURFACEDESC2 lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent)
|
1843 | 2034 | {
|
| 2035 | + if(!this) return DDERR_INVALIDPARAMS;
|
1844 | 2036 | return glDDS7->Lock(lpDestRect,lpDDSurfaceDesc,dwFlags,hEvent);
|
1845 | 2037 | }
|
1846 | 2038 | HRESULT WINAPI glDirectDrawSurface4::ReleaseDC(HDC hDC)
|
1847 | 2039 | {
|
| 2040 | + if(!this) return DDERR_INVALIDPARAMS;
|
1848 | 2041 | return glDDS7->ReleaseDC(hDC);
|
1849 | 2042 | }
|
1850 | 2043 | HRESULT WINAPI glDirectDrawSurface4::Restore()
|
1851 | 2044 | {
|
| 2045 | + if(!this) return DDERR_INVALIDPARAMS;
|
1852 | 2046 | return glDDS7->Restore();
|
1853 | 2047 | }
|
1854 | 2048 | HRESULT WINAPI glDirectDrawSurface4::SetClipper(LPDIRECTDRAWCLIPPER lpDDClipper)
|
1855 | 2049 | {
|
| 2050 | + if(!this) return DDERR_INVALIDPARAMS;
|
1856 | 2051 | return glDDS7->SetClipper(lpDDClipper);
|
1857 | 2052 | }
|
1858 | 2053 | HRESULT WINAPI glDirectDrawSurface4::SetColorKey(DWORD dwFlags, LPDDCOLORKEY lpDDColorKey)
|
1859 | 2054 | {
|
| 2055 | + if(!this) return DDERR_INVALIDPARAMS;
|
1860 | 2056 | return glDDS7->SetColorKey(dwFlags,lpDDColorKey);
|
1861 | 2057 | }
|
1862 | 2058 | HRESULT WINAPI glDirectDrawSurface4::SetOverlayPosition(LONG lX, LONG lY)
|
1863 | 2059 | {
|
| 2060 | + if(!this) return DDERR_INVALIDPARAMS;
|
1864 | 2061 | return glDDS7->SetOverlayPosition(lX,lY);
|
1865 | 2062 | }
|
1866 | 2063 | HRESULT WINAPI glDirectDrawSurface4::SetPalette(LPDIRECTDRAWPALETTE lpDDPalette)
|
1867 | 2064 | {
|
| 2065 | + if(!this) return DDERR_INVALIDPARAMS;
|
1868 | 2066 | return glDDS7->SetPalette(lpDDPalette);
|
1869 | 2067 | }
|
1870 | 2068 | HRESULT WINAPI glDirectDrawSurface4::Unlock(LPRECT lpRect)
|
1871 | 2069 | {
|
| 2070 | + if(!this) return DDERR_INVALIDPARAMS;
|
1872 | 2071 | return glDDS7->Unlock2(lpRect);
|
1873 | 2072 | }
|
1874 | 2073 | HRESULT WINAPI glDirectDrawSurface4::UpdateOverlay(LPRECT lpSrcRect, LPDIRECTDRAWSURFACE4 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx)
|
1875 | 2074 | {
|
| 2075 | + if(!this) return DDERR_INVALIDPARAMS;
|
1876 | 2076 | return glDDS7->UpdateOverlay(lpSrcRect,(LPDIRECTDRAWSURFACE7)lpDDDestSurface,lpDestRect,dwFlags,lpDDOverlayFx);
|
1877 | 2077 | }
|
1878 | 2078 | HRESULT WINAPI glDirectDrawSurface4::UpdateOverlayDisplay(DWORD dwFlags)
|
1879 | 2079 | {
|
| 2080 | + if(!this) return DDERR_INVALIDPARAMS;
|
1880 | 2081 | return glDDS7->UpdateOverlayDisplay(dwFlags);
|
1881 | 2082 | }
|
1882 | 2083 | HRESULT WINAPI glDirectDrawSurface4::UpdateOverlayZOrder(DWORD dwFlags, LPDIRECTDRAWSURFACE4 lpDDSReference)
|
1883 | 2084 | {
|
| 2085 | + if(!this) return DDERR_INVALIDPARAMS;
|
1884 | 2086 | return glDDS7->UpdateOverlayZOrder(dwFlags,(LPDIRECTDRAWSURFACE7)lpDDSReference);
|
1885 | 2087 | }
|
1886 | 2088 | HRESULT WINAPI glDirectDrawSurface4::GetDDInterface(LPVOID FAR *lplpDD)
|
1887 | 2089 | {
|
| 2090 | + if(!this) return DDERR_INVALIDPARAMS;
|
1888 | 2091 | return glDDS7->GetDDInterface(lplpDD);
|
1889 | 2092 | }
|
1890 | 2093 | HRESULT WINAPI glDirectDrawSurface4::PageLock(DWORD dwFlags)
|
1891 | 2094 | {
|
| 2095 | + if(!this) return DDERR_INVALIDPARAMS;
|
1892 | 2096 | return glDDS7->PageLock(dwFlags);
|
1893 | 2097 | }
|
1894 | 2098 | HRESULT WINAPI glDirectDrawSurface4::PageUnlock(DWORD dwFlags)
|
1895 | 2099 | {
|
| 2100 | + if(!this) return DDERR_INVALIDPARAMS;
|
1896 | 2101 | return glDDS7->PageUnlock(dwFlags);
|
1897 | 2102 | }
|
1898 | 2103 | HRESULT WINAPI glDirectDrawSurface4::SetSurfaceDesc(LPDDSURFACEDESC2 lpddsd, DWORD dwFlags)
|
1899 | 2104 | {
|
| 2105 | + if(!this) return DDERR_INVALIDPARAMS;
|
1900 | 2106 | return glDDS7->SetSurfaceDesc(lpddsd,dwFlags);
|
1901 | 2107 | }
|
1902 | 2108 | HRESULT WINAPI glDirectDrawSurface4::SetPrivateData(REFGUID guidTag, LPVOID lpData, DWORD cbSize, DWORD dwFlags)
|
1903 | 2109 | {
|
| 2110 | + if(!this) return DDERR_INVALIDPARAMS;
|
1904 | 2111 | return glDDS7->SetPrivateData(guidTag,lpData,cbSize,dwFlags);
|
1905 | 2112 | }
|
1906 | 2113 | HRESULT WINAPI glDirectDrawSurface4::GetPrivateData(REFGUID guidTag, LPVOID lpBuffer, LPDWORD lpcbBufferSize)
|
1907 | 2114 | {
|
| 2115 | + if(!this) return DDERR_INVALIDPARAMS;
|
1908 | 2116 | return glDDS7->GetPrivateData(guidTag,lpBuffer,lpcbBufferSize);
|
1909 | 2117 | }
|
1910 | 2118 | HRESULT WINAPI glDirectDrawSurface4::FreePrivateData(REFGUID guidTag)
|
1911 | 2119 | {
|
| 2120 | + if(!this) return DDERR_INVALIDPARAMS;
|
1912 | 2121 | return glDDS7->FreePrivateData(guidTag);
|
1913 | 2122 | }
|
1914 | 2123 | HRESULT WINAPI glDirectDrawSurface4::GetUniquenessValue(LPDWORD lpValue)
|
1915 | 2124 | {
|
| 2125 | + if(!this) return DDERR_INVALIDPARAMS;
|
1916 | 2126 | return glDDS7->GetUniquenessValue(lpValue);
|
1917 | 2127 | }
|
1918 | 2128 | HRESULT WINAPI glDirectDrawSurface4::ChangeUniquenessValue()
|
1919 | 2129 | {
|
| 2130 | + if(!this) return DDERR_INVALIDPARAMS;
|
1920 | 2131 | return glDDS7->ChangeUniquenessValue();
|
1921 | 2132 | }
|