Author: greatlrd
Date: Sat Jun 23 00:03:04 2007
New Revision: 27265
URL:
http://svn.reactos.org/svn/reactos?rev=27265&view=rev
Log:
small redesgin do not type cast DirectDraw COM to LPDDRAWI_DIRECTDRAW_INT, use
LPDDRAWI_DIRECTDRAW_INT as prototype in all directdraw functions.
Modified:
trunk/reactos/dll/directx/ddraw/Ddraw/GetCaps.c
trunk/reactos/dll/directx/ddraw/Ddraw/GetDeviceIdentifier.c
trunk/reactos/dll/directx/ddraw/Ddraw/ddraw.h
trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c
trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c
trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_setcooperativelevel.c
trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_stubs.c
trunk/reactos/dll/directx/ddraw/Surface/surface.h
trunk/reactos/dll/directx/ddraw/cleanup.c
trunk/reactos/dll/directx/ddraw/rosdraw.h
trunk/reactos/dll/directx/ddraw/startup.c
Modified: trunk/reactos/dll/directx/ddraw/Ddraw/GetCaps.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/Ge…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Ddraw/GetCaps.c (original)
+++ trunk/reactos/dll/directx/ddraw/Ddraw/GetCaps.c Sat Jun 23 00:03:04 2007
@@ -25,11 +25,10 @@
HRESULT WINAPI
-Main_DirectDraw_GetCaps( LPDIRECTDRAW7 iface, LPDDCAPS pDriverCaps,
+Main_DirectDraw_GetCaps( LPDDRAWI_DIRECTDRAW_INT This, LPDDCAPS pDriverCaps,
LPDDCAPS pHELCaps)
{
HRESULT retVal = DDERR_INVALIDPARAMS;
- LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
DX_WINDBG_trace();
@@ -50,7 +49,7 @@
DWORD dwTotal = 0;
DWORD dwFree = 0;
- Main_DirectDraw_GetAvailableVidMem4(iface, &ddscaps, &dwTotal,
&dwFree);
+ Main_DirectDraw_GetAvailableVidMem4(This, &ddscaps, &dwTotal,
&dwFree);
switch (pDriverCaps->dwSize)
{
@@ -158,7 +157,7 @@
DWORD dwTotal = 0;
DWORD dwFree = 0;
- Main_DirectDraw_GetAvailableVidMem4(iface, &ddscaps, &dwTotal,
&dwFree);
+ Main_DirectDraw_GetAvailableVidMem4(This, &ddscaps, &dwTotal,
&dwFree);
switch (pHELCaps->dwSize)
{
Modified: trunk/reactos/dll/directx/ddraw/Ddraw/GetDeviceIdentifier.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/Ge…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Ddraw/GetDeviceIdentifier.c (original)
+++ trunk/reactos/dll/directx/ddraw/Ddraw/GetDeviceIdentifier.c Sat Jun 23 00:03:04 2007
@@ -25,7 +25,7 @@
#include <pseh/pseh.h>
/* For DirectDraw 4 - 6 */
HRESULT WINAPI
-Main_DirectDraw_GetDeviceIdentifier(LPDIRECTDRAW4 iface,
+Main_DirectDraw_GetDeviceIdentifier(LPDDRAWI_DIRECTDRAW_INT This,
LPDDDEVICEIDENTIFIER pDDDI, DWORD dwFlags)
{
HRESULT retVal = DD_OK;
@@ -37,7 +37,7 @@
{
memcpy(&pDDDI2 , pDDDI, sizeof(DDDEVICEIDENTIFIER));
- retVal = Main_DirectDraw_GetDeviceIdentifier7((LPDIRECTDRAW7)iface, &pDDDI2,
dwFlags);
+ retVal = Main_DirectDraw_GetDeviceIdentifier7(This, &pDDDI2, dwFlags);
if (IsBadWritePtr(pDDDI, sizeof(DDDEVICEIDENTIFIER)))
{
@@ -58,7 +58,7 @@
}
HRESULT WINAPI
-Main_DirectDraw_GetDeviceIdentifier7(LPDIRECTDRAW7 iface,
+Main_DirectDraw_GetDeviceIdentifier7(LPDDRAWI_DIRECTDRAW_INT This,
LPDDDEVICEIDENTIFIER2 pDDDI, DWORD dwFlags)
{
HRESULT retVal = DDERR_INVALIDPARAMS;
@@ -72,8 +72,6 @@
char *pdest;
char* pcCnvEnd;
long *lpdata;
-
- LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT) iface;
DX_WINDBG_trace();
Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/dd…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw.h (original)
+++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw.h Sat Jun 23 00:03:04 2007
@@ -1,68 +1,175 @@
-// public interfaces
-HRESULT WINAPI Main_DirectDraw_QueryInterface (LPDIRECTDRAW7 , REFIID , LPVOID *);
-ULONG WINAPI Main_DirectDraw_AddRef(LPDIRECTDRAW7 );
-ULONG WINAPI Main_DirectDraw_Release(LPDIRECTDRAW7 );
-HRESULT WINAPI Main_DirectDraw_Compact(LPDIRECTDRAW7 );
-HRESULT WINAPI Main_DirectDraw_CreateClipper(LPDIRECTDRAW7, DWORD, LPDIRECTDRAWCLIPPER *,
IUnknown *);
-HRESULT WINAPI Main_DirectDraw_CreatePalette(LPDIRECTDRAW7, DWORD, LPPALETTEENTRY,
LPDIRECTDRAWPALETTE*, LPUNKNOWN);
-HRESULT WINAPI Main_DirectDraw_DuplicateSurface(LPDIRECTDRAW7, LPDIRECTDRAWSURFACE7,
LPDIRECTDRAWSURFACE7*);
-HRESULT WINAPI Main_DirectDraw_GetDeviceIdentifier(LPDIRECTDRAW4, LPDDDEVICEIDENTIFIER,
DWORD);
-HRESULT WINAPI Main_DirectDraw_GetDeviceIdentifier7(LPDIRECTDRAW7, LPDDDEVICEIDENTIFIER2,
DWORD);
+/* public interfaces we doing pur type cast here instead in the code, it will make more
cleaner code */
-HRESULT WINAPI Main_DirectDraw_EnumSurfaces(LPDIRECTDRAW7, DWORD, LPDDSURFACEDESC2,
LPVOID,
- LPDDENUMSURFACESCALLBACK7);
+HRESULT WINAPI
+Main_DirectDraw_QueryInterface (
+ LPDDRAWI_DIRECTDRAW_INT This,
+ REFIID id,
+ LPVOID *obj);
-HRESULT WINAPI Main_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7);
-HRESULT WINAPI Main_DirectDraw_GetDisplayMode(LPDIRECTDRAW7, LPDDSURFACEDESC2);
-HRESULT WINAPI Main_DirectDraw_GetSurfaceFromDC(LPDIRECTDRAW7, HDC, LPDIRECTDRAWSURFACE7
*);
-HRESULT WINAPI Main_DirectDraw_GetCaps(LPDIRECTDRAW7, LPDDCAPS pDriverCaps, LPDDCAPS);
-HRESULT WINAPI Main_DirectDraw_GetFourCCCodes(LPDIRECTDRAW7, LPDWORD pNumCodes,
LPDWORD);
-HRESULT WINAPI Main_DirectDraw_GetGDISurface(LPDIRECTDRAW7, LPDIRECTDRAWSURFACE7 *);
-HRESULT WINAPI Main_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7, DWORD dwFlags,
HANDLE);
-HRESULT WINAPI Main_DirectDraw_GetMonitorFrequency(LPDIRECTDRAW7, LPDWORD);
-HRESULT WINAPI Main_DirectDraw_GetScanLine(LPDIRECTDRAW7, LPDWORD);
-HRESULT WINAPI Main_DirectDraw_GetVerticalBlankStatus(LPDIRECTDRAW7, LPBOOL);
-HRESULT WINAPI Main_DirectDraw_RestoreDisplayMode(LPDIRECTDRAW7);
-HRESULT WINAPI Main_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7, HWND, DWORD);
-HRESULT WINAPI Main_DirectDraw_SetDisplayMode (LPDIRECTDRAW7, DWORD, DWORD, DWORD, DWORD,
DWORD);
-HRESULT WINAPI Main_DirectDraw_RestoreAllSurfaces(LPDIRECTDRAW7 iface);
-HRESULT WINAPI Main_DirectDraw_TestCooperativeLevel(LPDIRECTDRAW7 iface);
-HRESULT WINAPI Main_DirectDraw_Initialize (LPDIRECTDRAW7 iface, LPGUID lpGUID);
-HRESULT WINAPI Main_DirectDraw_StartModeTest(LPDIRECTDRAW7 iface, LPSIZE pModes, DWORD
dwNumModes, DWORD dwFlags);
-HRESULT WINAPI Main_DirectDraw_EvaluateMode(LPDIRECTDRAW7 iface,DWORD a,DWORD* b);
+ULONG WINAPI
+Main_DirectDraw_AddRef (LPDDRAWI_DIRECTDRAW_INT This);
-HRESULT WINAPI Main_DirectDraw_QueryInterface (LPDIRECTDRAW7 , REFIID , LPVOID *);
-ULONG WINAPI Main_DirectDraw_AddRef(LPDIRECTDRAW7 );
-ULONG WINAPI Main_DirectDraw_Release(LPDIRECTDRAW7 );
-HRESULT WINAPI Main_DirectDraw_Compact(LPDIRECTDRAW7 );
-HRESULT WINAPI Main_DirectDraw_CreateClipper(LPDIRECTDRAW7, DWORD, LPDIRECTDRAWCLIPPER *,
IUnknown *);
-HRESULT WINAPI Main_DirectDraw_CreatePalette(LPDIRECTDRAW7, DWORD, LPPALETTEENTRY,
LPDIRECTDRAWPALETTE*, LPUNKNOWN);
-HRESULT WINAPI Main_DirectDraw_CreateSurface(LPDIRECTDRAW, LPDDSURFACEDESC,
LPDIRECTDRAWSURFACE *, IUnknown *);
-HRESULT WINAPI Main_DirectDraw_CreateSurface4(LPDIRECTDRAW7, LPDDSURFACEDESC2,
LPDIRECTDRAWSURFACE7 *, IUnknown *);
-HRESULT WINAPI Main_DirectDraw_DuplicateSurface(LPDIRECTDRAW7, LPDIRECTDRAWSURFACE7,
LPDIRECTDRAWSURFACE7*);
+ULONG WINAPI
+Main_DirectDraw_Release (LPDDRAWI_DIRECTDRAW_INT This);
+
+HRESULT WINAPI
+Main_DirectDraw_Compact(LPDDRAWI_DIRECTDRAW_INT This);
+
+HRESULT WINAPI
+Main_DirectDraw_CreateClipper(
+ LPDDRAWI_DIRECTDRAW_INT This,
+ DWORD dwFlags,
+ LPDIRECTDRAWCLIPPER *ppClipper,
+ IUnknown *pUnkOuter);
+
+HRESULT WINAPI
+Main_DirectDraw_CreatePalette(
+ LPDDRAWI_DIRECTDRAW_INT This,
+ DWORD dwFlags,
+ LPPALETTEENTRY palent,
+ LPDIRECTDRAWPALETTE* ppPalette,
+ LPUNKNOWN pUnkOuter);
+
+HRESULT WINAPI
+Main_DirectDraw_CreateSurface4(
+ LPDDRAWI_DIRECTDRAW_INT This,
+ LPDDSURFACEDESC2 pDDSD,
+ LPDIRECTDRAWSURFACE7 *ppSurf,
+ IUnknown *pUnkOuter);
+
+HRESULT WINAPI
+Main_DirectDraw_DuplicateSurface(
+ LPDDRAWI_DIRECTDRAW_INT This,
+ LPDIRECTDRAWSURFACE7 src,
+ LPDIRECTDRAWSURFACE7* dst);
+
+HRESULT WINAPI
+Main_DirectDraw_EnumDisplayModes(
+ LPDDRAWI_DIRECTDRAW_INT This,
+ DWORD dwFlags,
+ LPDDSURFACEDESC2 pDDSD,
+ LPVOID pContext,
+ LPDDENUMMODESCALLBACK2 pCallback);
+
+HRESULT WINAPI
+Main_DirectDraw_EnumSurfaces(
+ LPDDRAWI_DIRECTDRAW_INT This,
+ DWORD dwFlags,
+ LPDDSURFACEDESC2 lpDDSD2,
+ LPVOID context,
+ LPDDENUMSURFACESCALLBACK7 callback);
+
+HRESULT WINAPI
+Main_DirectDraw_FlipToGDISurface(LPDDRAWI_DIRECTDRAW_INT This);
+
+HRESULT WINAPI
+Main_DirectDraw_GetCaps(
+ LPDDRAWI_DIRECTDRAW_INT This,
+ LPDDCAPS pDriverCaps,
+ LPDDCAPS pHELCaps);
+
+HRESULT WINAPI
+Main_DirectDraw_GetDisplayMode (
+ LPDDRAWI_DIRECTDRAW_INT This,
+ LPDDSURFACEDESC2 pDDSD);
+
+HRESULT WINAPI
+Main_DirectDraw_GetFourCCCodes(
+ LPDDRAWI_DIRECTDRAW_INT This,
+ LPDWORD lpNumCodes,
+ LPDWORD lpCodes);
+
+HRESULT WINAPI
+Main_DirectDraw_GetGDISurface(
+ LPDDRAWI_DIRECTDRAW_INT This,
+ LPDIRECTDRAWSURFACE7 *lplpGDIDDSSurface);
+
+HRESULT WINAPI
+Main_DirectDraw_GetMonitorFrequency (
+ LPDDRAWI_DIRECTDRAW_INT This,
+ LPDWORD lpFreq);
-HRESULT WINAPI Main_DirectDraw_EnumSurfaces(LPDIRECTDRAW7, DWORD, LPDDSURFACEDESC2,
LPVOID,
- LPDDENUMSURFACESCALLBACK7);
+HRESULT WINAPI
+Main_DirectDraw_GetScanLine(LPDDRAWI_DIRECTDRAW_INT This,
+ LPDWORD lpdwScanLine);
-HRESULT WINAPI Main_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7);
-HRESULT WINAPI Main_DirectDraw_GetDisplayMode(LPDIRECTDRAW7, LPDDSURFACEDESC2);
-HRESULT WINAPI Main_DirectDraw_GetSurfaceFromDC(LPDIRECTDRAW7, HDC, LPDIRECTDRAWSURFACE7
*);
-HRESULT WINAPI Main_DirectDraw_GetCaps(LPDIRECTDRAW7, LPDDCAPS pDriverCaps, LPDDCAPS);
-HRESULT WINAPI Main_DirectDraw_GetFourCCCodes(LPDIRECTDRAW7, LPDWORD pNumCodes,
LPDWORD);
-HRESULT WINAPI Main_DirectDraw_GetGDISurface(LPDIRECTDRAW7, LPDIRECTDRAWSURFACE7 *);
-HRESULT WINAPI Main_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7, DWORD dwFlags,
HANDLE);
-HRESULT WINAPI Main_DirectDraw_GetMonitorFrequency(LPDIRECTDRAW7, LPDWORD);
-HRESULT WINAPI Main_DirectDraw_GetScanLine(LPDIRECTDRAW7, LPDWORD);
-HRESULT WINAPI Main_DirectDraw_GetVerticalBlankStatus(LPDIRECTDRAW7, LPBOOL);
-HRESULT WINAPI Main_DirectDraw_RestoreDisplayMode(LPDIRECTDRAW7);
-HRESULT WINAPI Main_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7, HWND, DWORD);
-HRESULT WINAPI Main_DirectDraw_SetDisplayMode (LPDIRECTDRAW7, DWORD, DWORD, DWORD, DWORD,
DWORD);
-HRESULT WINAPI Main_DirectDraw_RestoreAllSurfaces(LPDIRECTDRAW7 iface);
-HRESULT WINAPI Main_DirectDraw_TestCooperativeLevel(LPDIRECTDRAW7 iface);
-HRESULT WINAPI Main_DirectDraw_Initialize (LPDIRECTDRAW7 iface, LPGUID lpGUID);
-HRESULT WINAPI Main_DirectDraw_StartModeTest(LPDIRECTDRAW7 iface, LPSIZE pModes, DWORD
dwNumModes, DWORD dwFlags);
-HRESULT WINAPI Main_DirectDraw_EvaluateMode(LPDIRECTDRAW7 iface,DWORD a,DWORD* b);
+HRESULT WINAPI
+Main_DirectDraw_GetVerticalBlankStatus(
+ LPDDRAWI_DIRECTDRAW_INT This,
+ LPBOOL lpbIsInVB);
+
+HRESULT WINAPI
+Main_DirectDraw_Initialize (
+ LPDDRAWI_DIRECTDRAW_INT This,
+ LPGUID lpGUID);
+
+
+HRESULT WINAPI
+Main_DirectDraw_RestoreDisplayMode (LPDDRAWI_DIRECTDRAW_INT This);
+
+HRESULT WINAPI
+Main_DirectDraw_SetCooperativeLevel (
+ LPDDRAWI_DIRECTDRAW_INT This,
+ HWND hwnd,
+ DWORD cooplevel);
+
+HRESULT WINAPI
+Main_DirectDraw_SetDisplayMode(
+ LPDDRAWI_DIRECTDRAW_INT This,
+ DWORD dwWidth,
+ DWORD dwHeight,
+ DWORD dwBPP,
+ DWORD dwRefreshRate,
+ DWORD dwFlags);
+
+HRESULT WINAPI
+Main_DirectDraw_WaitForVerticalBlank(
+ LPDDRAWI_DIRECTDRAW_INT This,
+ DWORD dwFlags,
+ HANDLE h);
+
+
+HRESULT WINAPI
+Main_DirectDraw_GetAvailableVidMem4(
+ LPDDRAWI_DIRECTDRAW_INT This,
+ LPDDSCAPS2 ddscaps,
+ LPDWORD dwTotal,
+ LPDWORD dwFree);
+
+HRESULT WINAPI
+Main_DirectDraw_GetSurfaceFromDC(
+ LPDDRAWI_DIRECTDRAW_INT This,
+ HDC hdc,
+ LPDIRECTDRAWSURFACE7 *lpDDS);
+
+HRESULT WINAPI
+Main_DirectDraw_RestoreAllSurfaces(LPDDRAWI_DIRECTDRAW_INT This);
+
+HRESULT WINAPI
+Main_DirectDraw_TestCooperativeLevel(LPDDRAWI_DIRECTDRAW_INT This);
+
+HRESULT WINAPI
+Main_DirectDraw_GetDeviceIdentifier7(
+ LPDDRAWI_DIRECTDRAW_INT This,
+ LPDDDEVICEIDENTIFIER2 pDDDI,
+ DWORD dwFlags);
+
+HRESULT WINAPI
+Main_DirectDraw_StartModeTest(
+ LPDDRAWI_DIRECTDRAW_INT This,
+ LPSIZE pModes,
+ DWORD dwNumModes,
+ DWORD dwFlags);
+
+HRESULT WINAPI
+Main_DirectDraw_EvaluateMode(
+ LPDDRAWI_DIRECTDRAW_INT This,
+ DWORD a,
+ DWORD* b);
+
+
+
// hel callbacks
Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/dd…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c (original)
+++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_displaymode.c Sat Jun 23 00:03:04 2007
@@ -15,11 +15,10 @@
#include <pseh/pseh.h>
HRESULT WINAPI
-Main_DirectDraw_EnumDisplayModes(LPDIRECTDRAW7 iface, DWORD dwFlags,
+Main_DirectDraw_EnumDisplayModes(LPDDRAWI_DIRECTDRAW_INT This, DWORD dwFlags,
LPDDSURFACEDESC2 pDDSD, LPVOID pContext,
LPDDENUMMODESCALLBACK2 pCallback)
{
HRESULT ret = DD_OK;
- LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
INT iMode = 0;
DEVMODE DevMode;
@@ -117,10 +116,9 @@
}
HRESULT WINAPI
-Main_DirectDraw_SetDisplayMode (LPDIRECTDRAW7 iface, DWORD dwWidth, DWORD dwHeight,
+Main_DirectDraw_SetDisplayMode (LPDDRAWI_DIRECTDRAW_INT This, DWORD dwWidth, DWORD
dwHeight,
DWORD dwBPP, DWORD
dwRefreshRate, DWORD dwFlags)
{
- LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
HRESULT ret = DD_OK;
DX_STUB_str("here\n");
@@ -181,7 +179,7 @@
BOOL ModeChanged;
This->lpLcl->lpGbl->hDD = This->lpLcl->hDD;
DdReenableDirectDrawObject(This->lpLcl->lpGbl,
&ModeChanged);
- StartDirectDraw((LPDIRECTDRAW)iface, 0, TRUE);
+ StartDirectDraw((LPDIRECTDRAW)This, 0, TRUE);
}
}
}
@@ -195,9 +193,8 @@
}
HRESULT WINAPI
-Main_DirectDraw_RestoreDisplayMode (LPDIRECTDRAW7 iface)
-{
- LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
+Main_DirectDraw_RestoreDisplayMode (LPDDRAWI_DIRECTDRAW_INT This)
+{
DX_WINDBG_trace();
_SEH_TRY
@@ -211,7 +208,7 @@
This->lpLcl->lpGbl->hDD = This->lpLcl->hDD;
DdReenableDirectDrawObject(This->lpLcl->lpGbl, &ModeChanged);
- StartDirectDraw((LPDIRECTDRAW)iface, 0, TRUE);
+ StartDirectDraw((LPDIRECTDRAW)This, 0, TRUE);
}
_SEH_HANDLE
{
@@ -223,10 +220,9 @@
}
HRESULT WINAPI
-Main_DirectDraw_GetMonitorFrequency (LPDIRECTDRAW7 iface, LPDWORD lpFreq)
+Main_DirectDraw_GetMonitorFrequency (LPDDRAWI_DIRECTDRAW_INT This, LPDWORD lpFreq)
{
HRESULT retVal = DD_OK;
- LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
DX_WINDBG_trace();
_SEH_TRY
@@ -257,10 +253,9 @@
}
HRESULT WINAPI
-Main_DirectDraw_GetDisplayMode (LPDIRECTDRAW7 iface, LPDDSURFACEDESC2 pDDSD)
+Main_DirectDraw_GetDisplayMode (LPDDRAWI_DIRECTDRAW_INT This, LPDDSURFACEDESC2 pDDSD)
{
HRESULT retVal = DD_OK;
- LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
DX_WINDBG_trace();
_SEH_TRY
Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/dd…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c (original)
+++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_main.c Sat Jun 23 00:03:04 2007
@@ -22,12 +22,11 @@
#include <pseh/pseh.h>
HRESULT WINAPI
-Main_DirectDraw_QueryInterface (LPDIRECTDRAW7 iface,
+Main_DirectDraw_QueryInterface (LPDDRAWI_DIRECTDRAW_INT This,
REFIID id,
LPVOID *obj)
{
HRESULT retVal = DD_OK;
- LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
DX_WINDBG_trace();
@@ -55,13 +54,13 @@
newThis->lpLcl = This->lpLcl;
newThis->lpLink = This;
*obj = &newThis->lpVtbl;
- Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis);
+ Main_DirectDraw_AddRef(newThis);
}
}
else
{
*obj = This;
- Main_DirectDraw_AddRef((LPDIRECTDRAW7)This);
+ Main_DirectDraw_AddRef(This);
}
}
else if (IsEqualGUID(&IID_IDirectDraw4, id))
@@ -82,13 +81,13 @@
newThis->lpLcl = This->lpLcl;
newThis->lpLink = This;
*obj = &newThis->lpVtbl;
- Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis);
+ Main_DirectDraw_AddRef(newThis);
}
}
else
{
*obj = This;
- Main_DirectDraw_AddRef((LPDIRECTDRAW7)This);
+ Main_DirectDraw_AddRef(This);
}
}
else if (IsEqualGUID(&IID_IDirectDraw2, id))
@@ -109,13 +108,13 @@
newThis->lpLcl = This->lpLcl;
newThis->lpLink = This;
*obj = &newThis->lpVtbl;
- Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis);
+ Main_DirectDraw_AddRef(newThis);
}
}
else
{
*obj = This;
- Main_DirectDraw_AddRef((LPDIRECTDRAW7)This);
+ Main_DirectDraw_AddRef(This);
}
}
else if (IsEqualGUID(&IID_IDirectDraw, id))
@@ -136,13 +135,13 @@
newThis->lpLcl = This->lpLcl;
newThis->lpLink = This;
*obj = &newThis->lpVtbl;
- Main_DirectDraw_AddRef((LPDIRECTDRAW7)newThis);
+ Main_DirectDraw_AddRef(newThis);
}
}
else
{
*obj = This;
- Main_DirectDraw_AddRef((LPDIRECTDRAW7)This);
+ Main_DirectDraw_AddRef(This);
}
}
else
@@ -161,10 +160,9 @@
}
ULONG WINAPI
-Main_DirectDraw_AddRef (LPDIRECTDRAW7 iface)
+Main_DirectDraw_AddRef (LPDDRAWI_DIRECTDRAW_INT This)
{
ULONG retValue = 0;
- LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
DX_WINDBG_trace();
@@ -200,15 +198,14 @@
ULONG WINAPI
-Main_DirectDraw_Release (LPDIRECTDRAW7 iface)
+Main_DirectDraw_Release (LPDDRAWI_DIRECTDRAW_INT This)
{
ULONG Counter = 0;
- LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
-
- DX_WINDBG_trace();
- _SEH_TRY
- {
- if (iface!=NULL)
+
+ DX_WINDBG_trace();
+ _SEH_TRY
+ {
+ if (This!=NULL)
{
This->lpLcl->dwLocalRefCnt--;
This->dwIntRefCnt--;
@@ -226,7 +223,7 @@
ChangeDisplaySettings(NULL, 0);
}*/
- Cleanup(iface);
+ Cleanup(This);
}
/* FIXME cleanup being not call why ?? */
@@ -245,7 +242,7 @@
}
HRESULT WINAPI
-Main_DirectDraw_Initialize (LPDIRECTDRAW7 iface, LPGUID lpGUID)
+Main_DirectDraw_Initialize (LPDDRAWI_DIRECTDRAW_INT This, LPGUID lpGUID)
{
return DDERR_ALREADYINITIALIZED;
}
@@ -256,10 +253,9 @@
* when no exclusive owner are set in corpativelevel
*/
HRESULT WINAPI
-Main_DirectDraw_Compact(LPDIRECTDRAW7 iface)
+Main_DirectDraw_Compact(LPDDRAWI_DIRECTDRAW_INT This)
{
HRESULT retVal = DD_OK;
- LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT) iface;
DX_WINDBG_trace();
// EnterCriticalSection(&ddcs);
@@ -280,7 +276,7 @@
}
HRESULT WINAPI
-Main_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW2 iface, LPDDSCAPS ddscaps, LPDWORD
dwTotal, LPDWORD dwFree)
+Main_DirectDraw_GetAvailableVidMem(LPDDRAWI_DIRECTDRAW_INT This, LPDDSCAPS ddscaps,
LPDWORD dwTotal, LPDWORD dwFree)
{
DDSCAPS2 myddscaps;
HRESULT retValue = DD_OK;
@@ -290,7 +286,7 @@
_SEH_TRY
{
myddscaps.dwCaps = ddscaps->dwCaps;
- retValue = Main_DirectDraw_GetAvailableVidMem4((LPDIRECTDRAW7)iface,
&myddscaps, dwTotal, dwFree);
+ retValue = Main_DirectDraw_GetAvailableVidMem4(This, &myddscaps, dwTotal,
dwFree);
}
_SEH_HANDLE
{
@@ -302,12 +298,12 @@
}
HRESULT WINAPI
-Main_DirectDraw_GetAvailableVidMem4(LPDIRECTDRAW7 iface, LPDDSCAPS2 ddscaps,
+Main_DirectDraw_GetAvailableVidMem4(LPDDRAWI_DIRECTDRAW_INT This, LPDDSCAPS2 ddscaps,
LPDWORD dwTotal, LPDWORD dwFree)
{
HRESULT retVal = DD_OK;
DDHAL_GETAVAILDRIVERMEMORYDATA memdata;
- LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
+
DX_WINDBG_trace();
_SEH_TRY
@@ -402,9 +398,8 @@
}
HRESULT WINAPI
-Main_DirectDraw_GetFourCCCodes(LPDIRECTDRAW7 iface, LPDWORD lpNumCodes, LPDWORD lpCodes)
-{
- LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
+Main_DirectDraw_GetFourCCCodes(LPDDRAWI_DIRECTDRAW_INT This, LPDWORD lpNumCodes, LPDWORD
lpCodes)
+{
HRESULT retVal = DD_OK;
DX_WINDBG_trace();
@@ -463,7 +458,7 @@
/* For DirectDraw 1 - 3 */
HRESULT WINAPI
-Main_DirectDraw_CreateSurface (LPDIRECTDRAW iface, LPDDSURFACEDESC pDDSD,
+Main_DirectDraw_CreateSurface (LPDDRAWI_DIRECTDRAW_INT This, LPDDSURFACEDESC pDDSD,
LPDIRECTDRAWSURFACE *ppSurf, IUnknown *pUnkOuter)
{
HRESULT ret = DDERR_GENERIC;
@@ -477,7 +472,7 @@
if (pDDSD->dwSize == sizeof(DDSURFACEDESC))
{
CopyDDSurfDescToDDSurfDesc2(&dd_desc_v2, (LPDDSURFACEDESC)pDDSD);
- ret = Internal_CreateSurface((LPDDRAWI_DIRECTDRAW_INT)iface,
+ ret = Internal_CreateSurface(This,
&dd_desc_v2,
(LPDIRECTDRAWSURFACE7 *)ppSurf,
pUnkOuter);
@@ -499,7 +494,7 @@
/* For DirectDraw 4 - 7 */
HRESULT WINAPI
-Main_DirectDraw_CreateSurface4(LPDIRECTDRAW7 iface, LPDDSURFACEDESC2 pDDSD,
+Main_DirectDraw_CreateSurface4(LPDDRAWI_DIRECTDRAW_INT This, LPDDSURFACEDESC2 pDDSD,
LPDIRECTDRAWSURFACE7 *ppSurf, IUnknown *pUnkOuter)
{
HRESULT ret;
@@ -507,7 +502,7 @@
// EnterCriticalSection(&ddcs);
_SEH_TRY
{
- ret = Internal_CreateSurface( (LPDDRAWI_DIRECTDRAW_INT)iface,pDDSD,
ppSurf,pUnkOuter);
+ ret = Internal_CreateSurface(This, pDDSD, ppSurf,pUnkOuter);
}
_SEH_HANDLE
{
Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_setcooperativelevel.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/dd…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_setcooperativelevel.c (original)
+++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_setcooperativelevel.c Sat Jun 23 00:03:04
2007
@@ -14,13 +14,10 @@
#include <pseh/pseh.h>
HRESULT WINAPI
-Main_DirectDraw_SetCooperativeLevel (LPDIRECTDRAW7 iface, HWND hwnd, DWORD cooplevel)
+Main_DirectDraw_SetCooperativeLevel (LPDDRAWI_DIRECTDRAW_INT This, HWND hwnd, DWORD
cooplevel)
{
-
-
- HRESULT retVal = DD_OK;
- HWND window;
- LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
+ HRESULT retVal = DD_OK;
+
DX_WINDBG_trace();
Modified: trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_stubs.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Ddraw/dd…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_stubs.c (original)
+++ trunk/reactos/dll/directx/ddraw/Ddraw/ddraw_stubs.c Sat Jun 23 00:03:04 2007
@@ -15,7 +15,7 @@
*/
HRESULT
WINAPI
-Main_DirectDraw_CreateClipper(LPDIRECTDRAW7 iface,
+Main_DirectDraw_CreateClipper(LPDDRAWI_DIRECTDRAW_INT This,
DWORD dwFlags,
LPDIRECTDRAWCLIPPER *ppClipper,
IUnknown *pUnkOuter)
@@ -24,14 +24,14 @@
DX_STUB;
}
-HRESULT WINAPI Main_DirectDraw_CreatePalette(LPDIRECTDRAW7 iface, DWORD dwFlags,
+HRESULT WINAPI Main_DirectDraw_CreatePalette(LPDDRAWI_DIRECTDRAW_INT This, DWORD
dwFlags,
LPPALETTEENTRY palent, LPDIRECTDRAWPALETTE* ppPalette, LPUNKNOWN
pUnkOuter)
{
DX_WINDBG_trace();
DX_STUB;
}
-HRESULT WINAPI Main_DirectDraw_DuplicateSurface(LPDIRECTDRAW7 iface, LPDIRECTDRAWSURFACE7
src,
+HRESULT WINAPI Main_DirectDraw_DuplicateSurface(LPDDRAWI_DIRECTDRAW_INT This,
LPDIRECTDRAWSURFACE7 src,
LPDIRECTDRAWSURFACE7* dst)
{
DX_WINDBG_trace();
@@ -39,7 +39,7 @@
}
HRESULT WINAPI
-Main_DirectDraw_EnumSurfaces(LPDIRECTDRAW7 iface, DWORD dwFlags,
+Main_DirectDraw_EnumSurfaces(LPDDRAWI_DIRECTDRAW_INT This, DWORD dwFlags,
LPDDSURFACEDESC2 lpDDSD2, LPVOID context,
LPDDENUMSURFACESCALLBACK7 callback)
{
@@ -51,7 +51,7 @@
* Status: Implentation removed due to rewrite
*/
HRESULT WINAPI
-Main_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 iface)
+Main_DirectDraw_FlipToGDISurface(LPDDRAWI_DIRECTDRAW_INT This)
{
DX_WINDBG_trace();
DX_STUB;
@@ -59,7 +59,7 @@
HRESULT WINAPI
-Main_DirectDraw_GetGDISurface(LPDIRECTDRAW7 iface,
+Main_DirectDraw_GetGDISurface(LPDDRAWI_DIRECTDRAW_INT This,
LPDIRECTDRAWSURFACE7 *lplpGDIDDSSurface)
{
DX_WINDBG_trace();
@@ -67,14 +67,14 @@
}
HRESULT WINAPI
-Main_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface, LPDWORD lpdwScanLine)
+Main_DirectDraw_GetScanLine(LPDDRAWI_DIRECTDRAW_INT This, LPDWORD lpdwScanLine)
{
DX_WINDBG_trace();
DX_STUB;
}
HRESULT WINAPI
-Main_DirectDraw_GetVerticalBlankStatus(LPDIRECTDRAW7 iface, LPBOOL lpbIsInVB)
+Main_DirectDraw_GetVerticalBlankStatus(LPDDRAWI_DIRECTDRAW_INT This, LPBOOL lpbIsInVB)
{
DX_WINDBG_trace();
DX_STUB;
@@ -84,41 +84,41 @@
* Status: Implentation removed due to rewrite
*/
HRESULT WINAPI
-Main_DirectDraw_WaitForVerticalBlank(LPDIRECTDRAW7 iface, DWORD dwFlags,
+Main_DirectDraw_WaitForVerticalBlank(LPDDRAWI_DIRECTDRAW_INT This, DWORD dwFlags,
HANDLE h)
{
DX_WINDBG_trace();
DX_STUB;
}
-HRESULT WINAPI Main_DirectDraw_GetSurfaceFromDC(LPDIRECTDRAW7 iface, HDC hdc,
+HRESULT WINAPI Main_DirectDraw_GetSurfaceFromDC(LPDDRAWI_DIRECTDRAW_INT This, HDC hdc,
LPDIRECTDRAWSURFACE7 *lpDDS)
{
DX_WINDBG_trace();
DX_STUB;
}
-HRESULT WINAPI Main_DirectDraw_RestoreAllSurfaces(LPDIRECTDRAW7 iface)
+HRESULT WINAPI Main_DirectDraw_RestoreAllSurfaces(LPDDRAWI_DIRECTDRAW_INT This)
{
DX_WINDBG_trace();
DX_STUB;
}
-HRESULT WINAPI Main_DirectDraw_TestCooperativeLevel(LPDIRECTDRAW7 iface)
+HRESULT WINAPI Main_DirectDraw_TestCooperativeLevel(LPDDRAWI_DIRECTDRAW_INT This)
{
DX_WINDBG_trace();
DX_STUB;
}
-HRESULT WINAPI Main_DirectDraw_StartModeTest(LPDIRECTDRAW7 iface, LPSIZE pModes,
+HRESULT WINAPI Main_DirectDraw_StartModeTest(LPDDRAWI_DIRECTDRAW_INT This, LPSIZE
pModes,
DWORD dwNumModes, DWORD dwFlags)
{
DX_WINDBG_trace();
DX_STUB;
}
-HRESULT WINAPI Main_DirectDraw_EvaluateMode(LPDIRECTDRAW7 iface,DWORD a,DWORD* b)
+HRESULT WINAPI Main_DirectDraw_EvaluateMode(LPDDRAWI_DIRECTDRAW_INT This,DWORD a,DWORD*
b)
{
DX_WINDBG_trace();
DX_STUB;
Modified: trunk/reactos/dll/directx/ddraw/Surface/surface.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/Surface/…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/Surface/surface.h (original)
+++ trunk/reactos/dll/directx/ddraw/Surface/surface.h Sat Jun 23 00:03:04 2007
@@ -51,10 +51,9 @@
HRESULT WINAPI Main_DDrawSurface_AddAttachedSurface(LPDIRECTDRAWSURFACE7 iface,
LPDIRECTDRAWSURFACE7 pAttach);
HRESULT WINAPI Main_DDrawSurface_AddOverlayDirtyRect(LPDIRECTDRAWSURFACE7 iface, LPRECT
pRect);
HRESULT WINAPI Main_DDrawSurface_GetSurfaceDesc(LPDIRECTDRAWSURFACE7 iface,
LPDDSURFACEDESC2 pDDSD);
-HRESULT WINAPI Main_DirectDraw_EnumDisplayModes(LPDIRECTDRAW7 iface, DWORD dwFlags,
LPDDSURFACEDESC2 pDDSD, LPVOID context, LPDDENUMMODESCALLBACK2 callback);
HRESULT WINAPI Main_DDrawSurface_SetSurfaceDesc(LPDIRECTDRAWSURFACE7 iface,
DDSURFACEDESC2 *DDSD, DWORD Flags);
-HRESULT WINAPI Main_DirectDraw_GetAvailableVidMem(LPDIRECTDRAW2 iface, LPDDSCAPS ddscaps,
LPDWORD total, LPDWORD free);
-HRESULT WINAPI Main_DirectDraw_GetAvailableVidMem4(LPDIRECTDRAW7 iface, LPDDSCAPS2
ddscaps, LPDWORD total, LPDWORD free);
+
+
// hel callbacks
DWORD CALLBACK HelDdDestroyDriver(LPDDHAL_DESTROYDRIVERDATA lpDestroyDriver);
@@ -68,9 +67,4 @@
DWORD CALLBACK HelDdSetExclusiveMode(LPDDHAL_SETEXCLUSIVEMODEDATA lpSetExclusiveMode);
DWORD CALLBACK HelDdFlipToGDISurface(LPDDHAL_FLIPTOGDISURFACEDATA lpFlipToGDISurface);
-// internal functions
-HRESULT CreateOverlaySurface(LPDDRAWI_DIRECTDRAW_INT This, LPDDRAWI_DDRAWSURFACE_INT
*That, LPDDSURFACEDESC2 pDDSD);
-HRESULT CreateBackBufferSurface(LPDDRAWI_DIRECTDRAW_INT This, LPDDRAWI_DDRAWSURFACE_INT
*That, LPDDRAWI_DDRAWSURFACE_LCL *lpLcl, LPDDSURFACEDESC2 pDDSD);
-HRESULT CreatePrimarySurface(LPDDRAWI_DIRECTDRAW_INT This, LPDDRAWI_DDRAWSURFACE_INT
That,LPDDRAWI_DDRAWSURFACE_LCL lpLcl, LPDDSURFACEDESC2 pDDSD);
-
Modified: trunk/reactos/dll/directx/ddraw/cleanup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/cleanup.…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/cleanup.c (original)
+++ trunk/reactos/dll/directx/ddraw/cleanup.c Sat Jun 23 00:03:04 2007
@@ -13,10 +13,8 @@
#include "d3dhal.h"
VOID
-Cleanup(LPDIRECTDRAW7 iface)
+Cleanup(LPDDRAWI_DIRECTDRAW_INT This)
{
- LPDDRAWI_DIRECTDRAW_INT This = (LPDDRAWI_DIRECTDRAW_INT)iface;
-
DX_WINDBG_trace();
if (ddgbl.lpDDCBtmp != NULL)
Modified: trunk/reactos/dll/directx/ddraw/rosdraw.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/rosdraw.…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/rosdraw.h (original)
+++ trunk/reactos/dll/directx/ddraw/rosdraw.h Sat Jun 23 00:03:04 2007
@@ -85,7 +85,7 @@
void CopyDDSurfDescToDDSurfDesc2(LPDDSURFACEDESC2 dst_pDesc, LPDDSURFACEDESC src_pDesc);
/* DirectDraw Cleanup code only internal use */
-VOID Cleanup(LPDIRECTDRAW7 iface);
+VOID Cleanup(LPDDRAWI_DIRECTDRAW_INT iface);
/* own macro to alloc memmory */
Modified: trunk/reactos/dll/directx/ddraw/startup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/startup.…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/startup.c (original)
+++ trunk/reactos/dll/directx/ddraw/startup.c Sat Jun 23 00:03:04 2007
@@ -109,28 +109,28 @@
This->lpVtbl = &DirectDraw7_Vtable;
This->lpLcl->dwLocalFlags = This->lpLcl->dwLocalFlags +
DDRAWILCL_DIRECTDRAW7;
*pIface = (LPDIRECTDRAW)&This->lpVtbl;
- Main_DirectDraw_AddRef((LPDIRECTDRAW7)This);
+ Main_DirectDraw_AddRef(This);
}
else if (IsEqualGUID(&IID_IDirectDraw4, id))
{
/* DirectDraw4 Vtable */
This->lpVtbl = &DirectDraw4_Vtable;
*pIface = (LPDIRECTDRAW)&This->lpVtbl;
- Main_DirectDraw_AddRef((LPDIRECTDRAW7)This);
+ Main_DirectDraw_AddRef(This);
}
else if (IsEqualGUID(&IID_IDirectDraw2, id))
{
/* DirectDraw2 Vtable */
This->lpVtbl = &DirectDraw2_Vtable;
*pIface = (LPDIRECTDRAW)&This->lpVtbl;
- Main_DirectDraw_AddRef((LPDIRECTDRAW7)This);
+ Main_DirectDraw_AddRef(This);
}
else if (IsEqualGUID(&IID_IDirectDraw, id))
{
/* DirectDraw Vtable */
This->lpVtbl = &DirectDraw_Vtable;
*pIface = (LPDIRECTDRAW)&This->lpVtbl;
- Main_DirectDraw_AddRef((LPDIRECTDRAW7)This);
+ Main_DirectDraw_AddRef(This);
}
if ( This->lpVtbl != 0)