mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 19:03:00 +00:00
fixing one more bugs in QueryInterface
svn path=/trunk/; revision=27210
This commit is contained in:
parent
4d6cc7d9a6
commit
588314ccad
1 changed files with 76 additions and 44 deletions
|
@ -39,78 +39,110 @@ Main_DirectDraw_QueryInterface (LPDIRECTDRAW7 iface,
|
||||||
*/
|
*/
|
||||||
if (IsEqualGUID(&IID_IDirectDraw7, id))
|
if (IsEqualGUID(&IID_IDirectDraw7, id))
|
||||||
{
|
{
|
||||||
LPDDRAWI_DIRECTDRAW_INT newThis;
|
if (This->lpVtbl != &DirectDraw7_Vtable)
|
||||||
DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT));
|
|
||||||
|
|
||||||
if (newThis == NULL)
|
|
||||||
{
|
{
|
||||||
retVal = DDERR_OUTOFMEMORY;
|
LPDDRAWI_DIRECTDRAW_INT newThis;
|
||||||
|
DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT));
|
||||||
|
|
||||||
|
if (newThis == NULL)
|
||||||
|
{
|
||||||
|
retVal = DDERR_OUTOFMEMORY;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* DirectDraw7 Vtable */
|
||||||
|
newThis->lpVtbl = &DirectDraw7_Vtable;
|
||||||
|
newThis->lpLcl = This->lpLcl;
|
||||||
|
newThis->lpLink = This;
|
||||||
|
*obj = &newThis->lpVtbl;
|
||||||
|
Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* DirectDraw7 Vtable */
|
*obj = This;
|
||||||
newThis->lpVtbl = &DirectDraw7_Vtable;
|
Main_DirectDraw_AddRef((LPDIRECTDRAW7)This);
|
||||||
newThis->lpLcl = This->lpLcl;
|
|
||||||
newThis->lpLink = This;
|
|
||||||
*obj = &newThis->lpVtbl;
|
|
||||||
Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (IsEqualGUID(&IID_IDirectDraw4, id))
|
else if (IsEqualGUID(&IID_IDirectDraw4, id))
|
||||||
{
|
{
|
||||||
LPDDRAWI_DIRECTDRAW_INT newThis;
|
if (This->lpVtbl != &DirectDraw4_Vtable)
|
||||||
DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT));
|
|
||||||
|
|
||||||
if (newThis == NULL)
|
|
||||||
{
|
{
|
||||||
retVal = DDERR_OUTOFMEMORY;
|
LPDDRAWI_DIRECTDRAW_INT newThis;
|
||||||
|
DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT));
|
||||||
|
|
||||||
|
if (newThis == NULL)
|
||||||
|
{
|
||||||
|
retVal = DDERR_OUTOFMEMORY;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* DirectDraw4 Vtable */
|
||||||
|
newThis->lpVtbl = &DirectDraw4_Vtable;
|
||||||
|
newThis->lpLcl = This->lpLcl;
|
||||||
|
newThis->lpLink = This;
|
||||||
|
*obj = &newThis->lpVtbl;
|
||||||
|
Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* DirectDraw4 Vtable */
|
*obj = This;
|
||||||
newThis->lpVtbl = &DirectDraw4_Vtable;
|
Main_DirectDraw_AddRef((LPDIRECTDRAW7)This);
|
||||||
newThis->lpLcl = This->lpLcl;
|
|
||||||
newThis->lpLink = This;
|
|
||||||
*obj = &newThis->lpVtbl;
|
|
||||||
Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (IsEqualGUID(&IID_IDirectDraw2, id))
|
else if (IsEqualGUID(&IID_IDirectDraw2, id))
|
||||||
{
|
{
|
||||||
LPDDRAWI_DIRECTDRAW_INT newThis;
|
if (This->lpVtbl != &DirectDraw2_Vtable)
|
||||||
DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT));
|
|
||||||
|
|
||||||
if (newThis == NULL)
|
|
||||||
{
|
{
|
||||||
retVal = DDERR_OUTOFMEMORY;
|
LPDDRAWI_DIRECTDRAW_INT newThis;
|
||||||
|
DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT));
|
||||||
|
|
||||||
|
if (newThis == NULL)
|
||||||
|
{
|
||||||
|
retVal = DDERR_OUTOFMEMORY;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* DirectDraw4 Vtable */
|
||||||
|
newThis->lpVtbl = &DirectDraw2_Vtable;
|
||||||
|
newThis->lpLcl = This->lpLcl;
|
||||||
|
newThis->lpLink = This;
|
||||||
|
*obj = &newThis->lpVtbl;
|
||||||
|
Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* DirectDraw4 Vtable */
|
*obj = This;
|
||||||
newThis->lpVtbl = &DirectDraw2_Vtable;
|
Main_DirectDraw_AddRef((LPDIRECTDRAW7)This);
|
||||||
newThis->lpLcl = This->lpLcl;
|
|
||||||
newThis->lpLink = This;
|
|
||||||
*obj = &newThis->lpVtbl;
|
|
||||||
Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (IsEqualGUID(&IID_IDirectDraw, id))
|
else if (IsEqualGUID(&IID_IDirectDraw, id))
|
||||||
{
|
{
|
||||||
LPDDRAWI_DIRECTDRAW_INT newThis;
|
if (This->lpVtbl != &DirectDraw_Vtable)
|
||||||
DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT));
|
|
||||||
|
|
||||||
if (newThis == NULL)
|
|
||||||
{
|
{
|
||||||
retVal = DDERR_OUTOFMEMORY;
|
LPDDRAWI_DIRECTDRAW_INT newThis;
|
||||||
|
DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT));
|
||||||
|
|
||||||
|
if (newThis == NULL)
|
||||||
|
{
|
||||||
|
retVal = DDERR_OUTOFMEMORY;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* DirectDraw4 Vtable */
|
||||||
|
newThis->lpVtbl = &DirectDraw_Vtable;
|
||||||
|
newThis->lpLcl = This->lpLcl;
|
||||||
|
newThis->lpLink = This;
|
||||||
|
*obj = &newThis->lpVtbl;
|
||||||
|
Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* DirectDraw4 Vtable */
|
*obj = This;
|
||||||
newThis->lpVtbl = &DirectDraw_Vtable;
|
Main_DirectDraw_AddRef((LPDIRECTDRAW7)This);
|
||||||
newThis->lpLcl = This->lpLcl;
|
|
||||||
newThis->lpLink = This;
|
|
||||||
*obj = &newThis->lpVtbl;
|
|
||||||
Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue