From: Magnus Olsen Date: Fri, 6 Apr 2007 20:54:21 +0000 (+0000) Subject: remove a wrong behvoir in DdQueryDirectDrawObject aka GdiEntry2 X-Git-Tag: backups/ddk2003@36850~856 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=937e866fb2f0a26df9606ed26b187f79b3e22bda remove a wrong behvoir in DdQueryDirectDrawObject aka GdiEntry2 svn path=/trunk/; revision=26271 --- diff --git a/reactos/dll/win32/gdi32/misc/gdientry.c b/reactos/dll/win32/gdi32/misc/gdientry.c index 3471d86ee59..17f47eeba3c 100644 --- a/reactos/dll/win32/gdi32/misc/gdientry.c +++ b/reactos/dll/win32/gdi32/misc/gdientry.c @@ -554,14 +554,7 @@ DdQueryDirectDrawObject(LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal, RtlZeroMemory(&D3dBufferCallbacks, sizeof(DD_D3DBUFCALLBACKS)); RtlZeroMemory(CallbackFlags, sizeof(DWORD)*3); - /* Check if we got a list pointer */ - if (pvmList) - { - /* Allocate memory for it */ - VidMemList = LocalAlloc(LMEM_ZEROINIT, - sizeof(VIDEOMEMORY) * - pHalInfo->vmiData.dwNumHeaps); - } + pvmList = NULL; /* Do the query */ if (!NtGdiDdQueryDirectDrawObject(GetDdHandle(pDirectDrawGlobal->hDD), @@ -577,7 +570,6 @@ DdQueryDirectDrawObject(LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal, pdwFourCC)) { /* We failed, free the memory and return */ - if (VidMemList) LocalFree(VidMemList); return FALSE; } @@ -621,7 +613,7 @@ DdQueryDirectDrawObject(LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal, pHalInfo->vmiData.dwTextureAlign = HalInfo.vmiData.dwTextureAlign; pHalInfo->vmiData.dwZBufferAlign = HalInfo.vmiData.dwZBufferAlign; pHalInfo->vmiData.dwAlphaAlign = HalInfo.vmiData.dwAlphaAlign; - pHalInfo->vmiData.dwNumHeaps = dwNumHeaps; + pHalInfo->vmiData.dwNumHeaps = 0; pHalInfo->vmiData.pvmList = pvmList; RtlCopyMemory( &pHalInfo->ddCaps, &HalInfo.ddCaps,sizeof(DDCORECAPS )); @@ -783,33 +775,6 @@ DdQueryDirectDrawObject(LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal, /* FIXME: Check for D3D Buffer Callbacks */ - /* Check if we have a video memory list */ - if (VidMemList) - { - /* Start a loop here */ - PVIDEOMEMORY VidMem = VidMemList; - - /* Loop all the heaps we have */ - while (dwNumHeaps--) - { - /* Copy from one format to the other */ - pvmList->dwFlags = VidMem->dwFlags; - pvmList->fpStart = VidMem->fpStart; - pvmList->fpEnd = VidMem->fpEnd; - pvmList->ddsCaps = VidMem->ddsCaps; - pvmList->ddsCapsAlt = VidMem->ddsCapsAlt; - pvmList->dwHeight = VidMem->dwHeight; - - /* Advance in both structures */ - pvmList++; - VidMem++; - } - - /* Free our structure */ - LocalFree(VidMemList); - } - - return TRUE; }