mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 13:35:47 +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))
|
||||
{
|
||||
LPDDRAWI_DIRECTDRAW_INT newThis;
|
||||
DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT));
|
||||
|
||||
if (newThis == NULL)
|
||||
if (This->lpVtbl != &DirectDraw7_Vtable)
|
||||
{
|
||||
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
|
||||
{
|
||||
/* DirectDraw7 Vtable */
|
||||
newThis->lpVtbl = &DirectDraw7_Vtable;
|
||||
newThis->lpLcl = This->lpLcl;
|
||||
newThis->lpLink = This;
|
||||
*obj = &newThis->lpVtbl;
|
||||
Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis);
|
||||
*obj = This;
|
||||
Main_DirectDraw_AddRef((LPDIRECTDRAW7)This);
|
||||
}
|
||||
}
|
||||
else if (IsEqualGUID(&IID_IDirectDraw4, id))
|
||||
{
|
||||
LPDDRAWI_DIRECTDRAW_INT newThis;
|
||||
DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT));
|
||||
|
||||
if (newThis == NULL)
|
||||
if (This->lpVtbl != &DirectDraw4_Vtable)
|
||||
{
|
||||
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
|
||||
{
|
||||
/* DirectDraw4 Vtable */
|
||||
newThis->lpVtbl = &DirectDraw4_Vtable;
|
||||
newThis->lpLcl = This->lpLcl;
|
||||
newThis->lpLink = This;
|
||||
*obj = &newThis->lpVtbl;
|
||||
Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis);
|
||||
*obj = This;
|
||||
Main_DirectDraw_AddRef((LPDIRECTDRAW7)This);
|
||||
}
|
||||
}
|
||||
else if (IsEqualGUID(&IID_IDirectDraw2, id))
|
||||
{
|
||||
LPDDRAWI_DIRECTDRAW_INT newThis;
|
||||
DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT));
|
||||
|
||||
if (newThis == NULL)
|
||||
if (This->lpVtbl != &DirectDraw2_Vtable)
|
||||
{
|
||||
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
|
||||
{
|
||||
/* DirectDraw4 Vtable */
|
||||
newThis->lpVtbl = &DirectDraw2_Vtable;
|
||||
newThis->lpLcl = This->lpLcl;
|
||||
newThis->lpLink = This;
|
||||
*obj = &newThis->lpVtbl;
|
||||
Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis);
|
||||
*obj = This;
|
||||
Main_DirectDraw_AddRef((LPDIRECTDRAW7)This);
|
||||
}
|
||||
}
|
||||
else if (IsEqualGUID(&IID_IDirectDraw, id))
|
||||
{
|
||||
LPDDRAWI_DIRECTDRAW_INT newThis;
|
||||
DxHeapMemAlloc(newThis, sizeof(DDRAWI_DIRECTDRAW_INT));
|
||||
|
||||
if (newThis == NULL)
|
||||
if (This->lpVtbl != &DirectDraw_Vtable)
|
||||
{
|
||||
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
|
||||
{
|
||||
/* DirectDraw4 Vtable */
|
||||
newThis->lpVtbl = &DirectDraw_Vtable;
|
||||
newThis->lpLcl = This->lpLcl;
|
||||
newThis->lpLink = This;
|
||||
*obj = &newThis->lpVtbl;
|
||||
Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis);
|
||||
*obj = This;
|
||||
Main_DirectDraw_AddRef((LPDIRECTDRAW7)This);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue