DXGL r464 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r463
|
r464
|
r465
>
Date:
23:58, 13 July 2014
Author:
admin
Status:
new
Tags:
Comment:
Fix Blt ROP test.
Add dwSize validation to IDirectDrawSurface::GetCaps.
Modified paths:
/ddraw/glDirectDraw.cpp
(modified) (
history
)
/dxgltest/Tests2D.cpp
(modified) (
history
)
/dxgltest/surfacegen.cpp
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/glDirectDraw.cpp
—
—
@@ -948,6 +948,7 @@
949
949
else if(lpDDHELCaps) ddCaps.dwSize = lpDDHELCaps->dwSize;
950
950
else TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
951
951
if(ddCaps.dwSize > sizeof(DDCAPS_DX7)) ddCaps.dwSize = sizeof(DDCAPS_DX7);
952
+ if (ddCaps.dwSize < sizeof(DDCAPS_DX3)) TRACE_RET(HRESULT, 23, DDERR_INVALIDPARAMS);
952
953
ddCaps.dwCaps = DDCAPS_BLT | DDCAPS_BLTCOLORFILL | DDCAPS_BLTSTRETCH |
953
954
DDCAPS_COLORKEY | DDCAPS_GDI | DDCAPS_PALETTE | DDCAPS_CANBLTSYSMEM |
954
955
DDCAPS_3D;
Index: dxgltest/Tests2D.cpp
—
—
@@ -661,6 +661,7 @@
662
662
ddinterface->CreateSurface(&sprites[4].ddsd, &sprites[4].surface, NULL);
663
663
ddinterface->CreateSurface(&sprites[5].ddsd, &sprites[5].surface, NULL);
664
664
DDCAPS ddcaps;
665
+ ddcaps.dwSize = sizeof(DDCAPS);
665
666
ddinterface->GetCaps(&ddcaps, NULL);
666
667
DrawROPPatterns(ddsrender, sprites, backbuffers, ddver, bpp, ddcaps.dwRops,hWnd,palette);
667
668
}
Index: dxgltest/surfacegen.cpp
—
—
@@ -1013,6 +1013,7 @@
1014
1014
{
1015
1015
if (rop_texture_usage[i] & 4) bltfx.lpDDSPattern = (LPDIRECTDRAWSURFACE)sprites[5].surface->GetSurface();
1016
1016
else bltfx.lpDDSPattern = NULL;
1017
+ bltfx.dwROP = rop_codes[i];
1017
1018
sprites[0].surface->Blt(&bltrect, sprites[2].surface, NULL, DDBLT_ROP | DDBLT_WAIT, &bltfx);
1018
1019
}
1019
1020
else
—
—
@@ -1115,4 +1116,5 @@
1116
1117
back->BltFast(0, 16, sprites[1].surface, NULL, DDBLTFAST_WAIT);
1117
1118
back->Release();
1118
1119
}
1120
+ free(bmi);
1119
1121
}
\ No newline at end of file
Navigation menu
Personal tools
Log in
Namespaces
Special page
English
expanded
collapsed
Views
More
expanded
collapsed
Search
Navigation
Home
Main page
Recent changes
Random page
MediaWiki help
Introduction
Progress
Downloads
Source code
Build from source
AppDB
Bug reports
Forums
Tools
Special pages
Printable version