DXGL r534 - Code Review
For
DXGL
(
recent comments
|
status changes
|
tags
|
authors
|
states
|
release notes
|
statistics
)
Jump to navigation
Jump to search
Repository:
DXGL
Revision:
<
r533
|
r534
|
r535
>
Date:
22:51, 16 September 2014
Author:
admin
Status:
new
Tags:
Comment:
Set IDirectDrawSurface7::QueryInterface failure return based on version of interface it was created on.
Fix crash with QueryInterface on a D3D1 object.
Modified paths:
/ddraw/glDirectDrawSurface.cpp
(modified) (
history
)
/ddraw/glDirectDrawSurface.h
(modified) (
history
)
Diff
[
purge
]
Index: ddraw/glDirectDrawSurface.cpp
—
—
@@ -41,6 +41,7 @@
42
42
glDirectDrawPalette *palettein, TEXTURE *parenttex, DWORD miplevel, int version)
43
43
{
44
44
TRACE_ENTER(5,14,this,14,lpDD7,14,lpDDSurfaceDesc2,14,error,14,palettein);
45
+ this->version = version;
45
46
creator = NULL;
46
47
overlay = false;
47
48
hasstencil = false;
—
—
@@ -534,14 +535,22 @@
535
536
}
536
537
else
537
538
{
538
- HRESULT ret = device->QueryInterface(IID_IDirect3DDevice,ppvObj);
539
+ HRESULT ret = device1->QueryInterface(IID_IDirect3DDevice,ppvObj);
539
540
TRACE_VAR("*ppvObj",14,*ppvObj);
540
541
TRACE_EXIT(23,ret);
541
542
return ret;
542
543
}
543
544
}
544
- TRACE_EXIT(23,E_NOINTERFACE);
545
- return E_NOINTERFACE;
545
+ if (version == 7)
546
+ {
547
+ TRACE_EXIT(23, E_NOINTERFACE);
548
+ return E_NOINTERFACE;
549
+ }
550
+ else
551
+ {
552
+ TRACE_EXIT(23, DDERR_INVALIDPARAMS);
553
+ return DDERR_INVALIDPARAMS;
554
+ }
546
555
}
547
556
ULONG WINAPI glDirectDrawSurface7::AddRef()
548
557
{
Index: ddraw/glDirectDrawSurface.h
—
—
@@ -177,6 +177,7 @@
178
178
glDirect3DDevice7 *device;
179
179
bool overlay;
180
180
IUnknown *zbuffer_iface;
181
+ int version;
181
182
};
182
183
183
184
// Legacy DDRAW Interfaces
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