mirror of
https://github.com/reactos/reactos.git
synced 2024-08-02 17:40:58 +00:00
fixing thread safe in GetFourCCCodes
svn path=/trunk/; revision=26853
This commit is contained in:
parent
1c247edcf4
commit
327cd7852d
|
@ -131,7 +131,7 @@ Main_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
|
||||||
memcpy(&memdata.DDSCaps, ddscaps, sizeof(DDSCAPS2));
|
memcpy(&memdata.DDSCaps, ddscaps, sizeof(DDSCAPS2));
|
||||||
|
|
||||||
if (This->lpLcl->lpDDCB->cbDDMiscellaneousCallbacks.GetAvailDriverMemory(&memdata) == DDHAL_DRIVER_NOTHANDLED)
|
if (This->lpLcl->lpDDCB->cbDDMiscellaneousCallbacks.GetAvailDriverMemory(&memdata) == DDHAL_DRIVER_NOTHANDLED)
|
||||||
return DDERR_NODIRECTDRAWHW;
|
return DDERR_NODIRECTDRAWHW;
|
||||||
|
|
||||||
if (dwTotal)
|
if (dwTotal)
|
||||||
*dwTotal = memdata.dwTotal;
|
*dwTotal = memdata.dwTotal;
|
||||||
|
@ -148,15 +148,20 @@ Main_DirectDraw_GetFourCCCodes(LPDIRECTDRAW7 iface, LPDWORD lpNumCodes, LPDWORD
|
||||||
LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
|
LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
|
||||||
DX_WINDBG_trace();
|
DX_WINDBG_trace();
|
||||||
|
|
||||||
if(!lpNumCodes)
|
/* FIXME protect with SEH or something else if lpCodes or lpNumCodes for bad user pointers */
|
||||||
return DDERR_INVALIDPARAMS;
|
EnterCriticalSection(&ddcs);
|
||||||
|
|
||||||
if(lpCodes)
|
if(!lpNumCodes)
|
||||||
memcpy(lpCodes, This->lpLcl->lpGbl->lpdwFourCC, sizeof(DWORD)*(*lpNumCodes));
|
return DDERR_INVALIDPARAMS;
|
||||||
else
|
|
||||||
*lpNumCodes = This->lpLcl->lpGbl->dwNumFourCC;
|
|
||||||
|
|
||||||
return DD_OK;
|
if(lpCodes)
|
||||||
|
memcpy(lpCodes, This->lpLcl->lpGbl->lpdwFourCC, sizeof(DWORD)*(*lpNumCodes));
|
||||||
|
else
|
||||||
|
*lpNumCodes = This->lpLcl->lpGbl->dwNumFourCC;
|
||||||
|
|
||||||
|
|
||||||
|
LeaveCriticalSection(&ddcs);
|
||||||
|
return DD_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT WINAPI
|
HRESULT WINAPI
|
||||||
|
|
Loading…
Reference in a new issue