mirror of
https://github.com/reactos/reactos.git
synced 2025-07-01 06:01:22 +00:00
fixed partly linking with other directdraw interface, but we still overwrite some member and crash it, when we doing a link.
svn path=/trunk/; revision=25016
This commit is contained in:
parent
1c4a115ec0
commit
a709c01ca8
1 changed files with 24 additions and 7 deletions
|
@ -880,7 +880,7 @@ Create_DirectDraw (LPGUID pGUID,
|
||||||
REFIID id,
|
REFIID id,
|
||||||
BOOL ex)
|
BOOL ex)
|
||||||
{
|
{
|
||||||
LPDDRAWI_DIRECTDRAW_INT This;
|
LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)*pIface;
|
||||||
|
|
||||||
DX_WINDBG_trace();
|
DX_WINDBG_trace();
|
||||||
|
|
||||||
|
@ -889,10 +889,27 @@ Create_DirectDraw (LPGUID pGUID,
|
||||||
return DDERR_INVALIDDIRECTDRAWGUID;
|
return DDERR_INVALIDDIRECTDRAWGUID;
|
||||||
}
|
}
|
||||||
|
|
||||||
This = DxHeapMemAlloc(sizeof(DDRAWI_DIRECTDRAW_INT));
|
|
||||||
if (This == NULL)
|
if (This == NULL)
|
||||||
{
|
{
|
||||||
return DDERR_OUTOFMEMORY;
|
/* We do not have any DirectDraw interface alloc */
|
||||||
|
This = DxHeapMemAlloc(sizeof(DDRAWI_DIRECTDRAW_INT));
|
||||||
|
if (This == NULL)
|
||||||
|
{
|
||||||
|
return DDERR_OUTOFMEMORY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* We got the DirectDraw interface alloc and we need create the link */
|
||||||
|
LPDDRAWI_DIRECTDRAW_INT newThis;
|
||||||
|
newThis = DxHeapMemAlloc(sizeof(DDRAWI_DIRECTDRAW_INT));
|
||||||
|
if (newThis == NULL)
|
||||||
|
{
|
||||||
|
return DDERR_OUTOFMEMORY;
|
||||||
|
}
|
||||||
|
newThis->lpLink = This;
|
||||||
|
This = newThis;
|
||||||
}
|
}
|
||||||
|
|
||||||
This->lpLcl = DxHeapMemAlloc(sizeof(DDRAWI_DIRECTDRAW_INT));
|
This->lpLcl = DxHeapMemAlloc(sizeof(DDRAWI_DIRECTDRAW_INT));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue