mirror of
https://github.com/reactos/reactos.git
synced 2024-08-01 17:11:35 +00:00
ReImplement Surface_GetDC
Implement Surface_ReleaseDC svn path=/trunk/; revision=21517
This commit is contained in:
parent
988d7a9c98
commit
8c7d161f2a
|
@ -236,10 +236,16 @@ Main_DDrawSurface_GetDC(LPDIRECTDRAWSURFACE7 iface, HDC *phDC)
|
|||
}
|
||||
|
||||
This = (IDirectDrawSurfaceImpl*)iface;
|
||||
|
||||
/*
|
||||
FIXME check if the surface exists or not
|
||||
for now we aussme the surface exits and create the hDC for it
|
||||
*/
|
||||
|
||||
if ((HDC)This->Surf->mPrimaryLocal.hDC == NULL)
|
||||
{
|
||||
*phDC = (HDC)This->owner->mDDrawGlobal.lpExclusiveOwner->hDC;
|
||||
This->Surf->mPrimaryLocal.hDC = (ULONG_PTR)GetDC((HWND)This->owner->mDDrawGlobal.lpExclusiveOwner->hWnd);
|
||||
*phDC = (HDC)This->Surf->mPrimaryLocal.hDC;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -336,7 +342,30 @@ Main_DDrawSurface_PageUnlock(LPDIRECTDRAWSURFACE7 iface, DWORD dwFlags)
|
|||
HRESULT WINAPI
|
||||
Main_DDrawSurface_ReleaseDC(LPDIRECTDRAWSURFACE7 iface, HDC hDC)
|
||||
{
|
||||
DX_STUB;
|
||||
IDirectDrawSurfaceImpl* This;
|
||||
|
||||
if (iface == NULL)
|
||||
{
|
||||
return DDERR_INVALIDOBJECT;
|
||||
}
|
||||
|
||||
if (hDC == NULL)
|
||||
{
|
||||
return DDERR_INVALIDPARAMS;
|
||||
}
|
||||
|
||||
This = (IDirectDrawSurfaceImpl*)iface;
|
||||
|
||||
/* FIXME check if surface exits or not */
|
||||
|
||||
if ((HDC)This->Surf->mPrimaryLocal.hDC == NULL)
|
||||
{
|
||||
return DDERR_GENERIC;
|
||||
}
|
||||
|
||||
ReleaseDC((HWND)This->owner->mDDrawGlobal.lpExclusiveOwner->hWnd,hDC);
|
||||
|
||||
return DD_OK;
|
||||
}
|
||||
|
||||
HRESULT WINAPI
|
||||
|
|
Loading…
Reference in a new issue