Index: trunk/src/ddraw/OS2CLIPPER.CPP
===================================================================
--- trunk/src/ddraw/OS2CLIPPER.CPP	(revision 4140)
+++ trunk/src/ddraw/OS2CLIPPER.CPP	(revision 4146)
@@ -1,3 +1,3 @@
-/* $Id: OS2CLIPPER.CPP,v 1.9 1999-12-21 01:28:15 hugh Exp $ */
+/* $Id: OS2CLIPPER.CPP,v 1.10 2000-09-02 08:27:05 sandervl Exp $ */
 
 /*
@@ -20,4 +20,5 @@
 #include <misc.h>
 #include <winerror.h>
+#include <winuser.h>
 
 //******************************************************************************
@@ -41,4 +42,5 @@
   lpDraw->Vtbl.AddRef(lpDraw);
   hDive                   = lpDirectDraw->GetDiveInstance();
+  windowRect.left = windowRect.right = windowRect.top = windowRect.bottom = 0;
 }
 //******************************************************************************
@@ -50,9 +52,7 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall ClipQueryInterface(THIS This, REFIID riid, LPVOID FAR * ppvObj)
+HRESULT WIN32API ClipQueryInterface(THIS This, REFIID riid, LPVOID FAR * ppvObj)
 {
-  #ifdef DEBUG
-    dprintf(("DDRAW: ClipQueryInterface\n"));
-  #endif
+  dprintf(("DDRAW: ClipQueryInterface\n"));
 
   *ppvObj = NULL;
@@ -70,11 +70,9 @@
 //******************************************************************************
 //******************************************************************************
-ULONG   __stdcall ClipAddRef(THIS This)
+ULONG   WIN32API ClipAddRef(THIS This)
 {
  OS2IDirectDrawClipper *me = (OS2IDirectDrawClipper *)This;
 
-  #ifdef DEBUG
-    dprintf(("DDRAW: OS2IDirectDrawClipper::AddRef %d\n", me->Referenced+1));
-  #endif
+  dprintf(("DDRAW: OS2IDirectDrawClipper::AddRef %d\n", me->Referenced+1));
 
   return ++me->Referenced;
@@ -82,11 +80,9 @@
 //******************************************************************************
 //******************************************************************************
-ULONG   __stdcall ClipRelease(THIS This)
+ULONG   WIN32API ClipRelease(THIS This)
 {
  OS2IDirectDrawClipper *me = (OS2IDirectDrawClipper *)This;
 
-  #ifdef DEBUG
-    dprintf(("DDRAW: OS2IDirectDrawClipper::Release %d\n", me->Referenced-1));
-  #endif
+  dprintf(("DDRAW: OS2IDirectDrawClipper::Release %d", me->Referenced-1));
 
   if(me->Referenced)
@@ -106,21 +102,51 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall ClipGetClipList(THIS, LPRECT, LPRGNDATA, LPDWORD)
+HRESULT WIN32API ClipGetClipList(THIS This, LPRECT lpRect, LPRGNDATA lpClipList, 
+                                 LPDWORD lpdwSize)
 {
-  #ifdef DEBUG
-    dprintf(("DDRAW: ClipGetClipList\n"));
-  #endif
+ OS2IDirectDrawClipper *me = (OS2IDirectDrawClipper *)This;
+ HRESULT rc = DD_OK;
 
-  return(DD_OK);
+  dprintf(("DDRAW: ClipGetClipList %x %x %x %x", This, lpRect, lpClipList, lpdwSize));
+
+  if(!lpdwSize) {
+	return DDERR_INVALIDPARAMS;
+  }
+  if(me->clipWindow) 
+  {
+      HRGN hRgn, hRgn1;
+      HDC  hdc;
+      int  bufneeded;
+
+	hRgn = CreateRectRgn(0, 0, 1, 1);
+	hdc = GetDC(me->clipWindow);
+	if(GetClipRgn(hdc, hRgn)) {
+		if(lpRect) {
+			hRgn1 = CreateRectRgnIndirect(lpRect);
+			CombineRgn(hRgn, hRgn, hRgn1, RGN_AND);
+			DeleteObject(hRgn1);
+		}
+		bufneeded = GetRegionData(hRgn, *lpdwSize, lpClipList);
+		if(bufneeded > *lpdwSize) {
+			rc = DDERR_REGIONTOOSMALL;
+		}
+	}
+	else	rc = DDERR_NOCLIPLIST;
+	DeleteObject(hRgn);
+	ReleaseDC(me->clipWindow, hdc);	
+  }
+  else { //todo!!
+	dprintf(("ClipGetClipList not complete if not associated with window!"));
+	rc = DDERR_NOCLIPLIST;
+  }
+  return rc;
 }
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall ClipGetHWnd(THIS This, HWND FAR *pHwnd)
+HRESULT WIN32API ClipGetHWnd(THIS This, HWND FAR *pHwnd)
 {
  OS2IDirectDrawClipper *me = (OS2IDirectDrawClipper *)This;
 
-  #ifdef DEBUG
-    dprintf(("DDRAW: ClipGetHWnd\n"));
-  #endif
+  dprintf(("DDRAW: ClipGetHWnd %x %x", This, me->clipWindow));
 
   *pHwnd = me->clipWindow;
@@ -129,9 +155,7 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall ClipInitialize(THIS, LPDIRECTDRAW, DWORD)
+HRESULT WIN32API ClipInitialize(THIS This, LPDIRECTDRAW lpDD, DWORD dwFlags)
 {
-  #ifdef DEBUG
-    dprintf(("DDRAW: ClipInitialize\n"));
-  #endif
+  dprintf(("DDRAW: ClipInitialize %x %x %x", This, lpDD, dwFlags));
 
   return(DDERR_ALREADYINITIALIZED); // Init is done during creation see M$ Doc
@@ -139,9 +163,7 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall ClipIsClipListChanged(THIS, BOOL FAR *)
+HRESULT WIN32API ClipIsClipListChanged(THIS This, BOOL *lpbChanged)
 {
-  #ifdef DEBUG
-    dprintf(("DDRAW: ClipIsClipListChanged\n"));
-  #endif
+  dprintf(("DDRAW: ClipIsClipListChanged %x %x", This, lpbChanged));
 
   return(DD_OK);
@@ -149,10 +171,13 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall ClipSetClipList(THIS, LPRGNDATA,DWORD)
+HRESULT WIN32API ClipSetClipList(THIS This, LPRGNDATA lpClipList, DWORD lpdwSize)
 {
-  #ifdef DEBUG
-    dprintf(("DDRAW: ClipSetClipList\n"));
-  #endif
+ OS2IDirectDrawClipper *me = (OS2IDirectDrawClipper *)This;
 
+  dprintf(("DDRAW: ClipSetClipList %x %x %x", This, lpClipList, lpdwSize));
+
+  if(me->clipWindow) {
+	return DDERR_CLIPPERISUSINGHWND;
+  }
   return(DD_OK);
 }
@@ -160,13 +185,13 @@
 //DWORD param not used in DirectX 3
 //******************************************************************************
-HRESULT __stdcall ClipSetHWnd(THIS This, DWORD reserved, HWND hwnd)
+HRESULT WIN32API ClipSetHWnd(THIS This, DWORD reserved, HWND hwnd)
 {
  OS2IDirectDrawClipper *me = (OS2IDirectDrawClipper *)This;
 
-  #ifdef DEBUG
-    dprintf(("DDRAW: ClipSetHWnd\n"));
-  #endif
+  dprintf(("DDRAW: ClipSetHWnd %x %x %x", This, reserved, hwnd));
 
   me->clipWindow = hwnd;
+  GetClientRect(hwnd, &me->windowRect);
+
   return(DD_OK);
 }
Index: trunk/src/ddraw/OS2CLIPPER.H
===================================================================
--- trunk/src/ddraw/OS2CLIPPER.H	(revision 4140)
+++ trunk/src/ddraw/OS2CLIPPER.H	(revision 4146)
@@ -1,3 +1,3 @@
-/* $Id: OS2CLIPPER.H,v 1.6 1999-12-21 01:28:19 hugh Exp $ */
+/* $Id: OS2CLIPPER.H,v 1.7 2000-09-02 08:27:05 sandervl Exp $ */
 
 /*
@@ -31,8 +31,9 @@
 
  protected:
-              HRESULT                lastError;
+        HRESULT                lastError;
         OS2IDirectDraw        *lpDraw;
         HDIVE                  hDive;
-        HWND         clipWindow;
+        HWND                   clipWindow;
+        RECT                   windowRect;
 
                               // Linked list management
Index: trunk/src/ddraw/OS2SURFACE.CPP
===================================================================
--- trunk/src/ddraw/OS2SURFACE.CPP	(revision 4140)
+++ trunk/src/ddraw/OS2SURFACE.CPP	(revision 4146)
@@ -1,3 +1,3 @@
-/* $Id: OS2SURFACE.CPP,v 1.26 2000-06-29 21:28:36 mike Exp $ */
+/* $Id: OS2SURFACE.CPP,v 1.27 2000-09-02 08:27:05 sandervl Exp $ */
 
 /*
@@ -1796,5 +1796,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfQueryInterface(THIS This, REFIID riid, LPVOID FAR * ppvObj)
+HRESULT WIN32API SurfQueryInterface(THIS This, REFIID riid, LPVOID FAR * ppvObj)
 {
   // ToDo: Add Interface handling for D3D Textures
@@ -1848,5 +1848,5 @@
 //******************************************************************************
 //******************************************************************************
-ULONG __stdcall SurfAddRef(THIS This)
+ULONG WIN32API SurfAddRef(THIS This)
 {
  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -1858,5 +1858,5 @@
 //******************************************************************************
 //******************************************************************************
-ULONG __stdcall SurfRelease(THIS This)
+ULONG WIN32API SurfRelease(THIS This)
 {
  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -1883,5 +1883,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfAddAttachedSurface(THIS This, LPDIRECTDRAWSURFACE2 lpDDSurface)
+HRESULT WIN32API SurfAddAttachedSurface(THIS This, LPDIRECTDRAWSURFACE2 lpDDSurface)
 {
 
@@ -1891,5 +1891,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfAddAttachedSurface3(THIS This, LPDIRECTDRAWSURFACE3 lpDDSurface)
+HRESULT WIN32API SurfAddAttachedSurface3(THIS This, LPDIRECTDRAWSURFACE3 lpDDSurface)
 {
 
@@ -1899,5 +1899,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfAddAttachedSurface4(THIS This, LPDIRECTDRAWSURFACE4 lpDDSurface)
+HRESULT WIN32API SurfAddAttachedSurface4(THIS This, LPDIRECTDRAWSURFACE4 lpDDSurface)
 {
   OS2IDirectDrawSurface *AttachedSurface;
@@ -2075,5 +2075,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfAddOverlayDirtyRect(THIS, LPRECT)
+HRESULT WIN32API SurfAddOverlayDirtyRect(THIS, LPRECT)
 {
   dprintf(("DDRAW: SurfAddOverlayDirtyRect Not implemented by M$ in DX 6.0!\n"));
@@ -2083,5 +2083,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfBlt(THIS This, LPRECT lpDestRect, LPDIRECTDRAWSURFACE2 lpDDSrcSurface,
+HRESULT WIN32API SurfBlt(THIS This, LPRECT lpDestRect, LPDIRECTDRAWSURFACE2 lpDDSrcSurface,
         LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
 {
@@ -2095,5 +2095,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfBlt3(THIS This, LPRECT lpDestRect, LPDIRECTDRAWSURFACE3 lpDDSrcSurface,
+HRESULT WIN32API SurfBlt3(THIS This, LPRECT lpDestRect, LPDIRECTDRAWSURFACE3 lpDDSrcSurface,
         LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
 {
@@ -2107,5 +2107,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfBlt4(THIS This, LPRECT lpDestRect, LPDIRECTDRAWSURFACE4 lpDDSrcSurface,
+HRESULT WIN32API SurfBlt4(THIS This, LPRECT lpDestRect, LPDIRECTDRAWSURFACE4 lpDDSrcSurface,
         LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx)
 {
@@ -3142,5 +3142,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfBltBatch(THIS, LPDDBLTBATCH, DWORD, DWORD )
+HRESULT WIN32API SurfBltBatch(THIS, LPDDBLTBATCH, DWORD, DWORD )
 {
   dprintf(("DDRAW: SurfBltBatch Not implemented by M$\n"));
@@ -3150,5 +3150,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfBltFast( THIS This ,
+HRESULT WIN32API SurfBltFast( THIS This ,
                                DWORD dwX,
                                DWORD dwY,
@@ -3167,5 +3167,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfBltFast3(THIS This ,
+HRESULT WIN32API SurfBltFast3(THIS This ,
                                DWORD dwX,
                                DWORD dwY,
@@ -3184,5 +3184,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfBltFast4( THIS This,
+HRESULT WIN32API SurfBltFast4( THIS This,
                                 DWORD dwX,
                                 DWORD dwY,
@@ -3527,5 +3527,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfDeleteAttachedSurface(THIS This, DWORD dwFlags, LPDIRECTDRAWSURFACE2 lpDDSurface)
+HRESULT WIN32API SurfDeleteAttachedSurface(THIS This, DWORD dwFlags, LPDIRECTDRAWSURFACE2 lpDDSurface)
 {
   OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -3536,5 +3536,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfDeleteAttachedSurface3(THIS This, DWORD dwFlags, LPDIRECTDRAWSURFACE3 lpDDSurface)
+HRESULT WIN32API SurfDeleteAttachedSurface3(THIS This, DWORD dwFlags, LPDIRECTDRAWSURFACE3 lpDDSurface)
 {
   OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -3545,5 +3545,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfDeleteAttachedSurface4(THIS This, DWORD dwFlags , LPDIRECTDRAWSURFACE4 lpDDSurface)
+HRESULT WIN32API SurfDeleteAttachedSurface4(THIS This, DWORD dwFlags , LPDIRECTDRAWSURFACE4 lpDDSurface)
 {
 
@@ -3691,5 +3691,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfEnumAttachedSurfaces(THIS This, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpCallBack)
+HRESULT WIN32API SurfEnumAttachedSurfaces(THIS This, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpCallBack)
 {
   OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -3700,5 +3700,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfEnumAttachedSurfaces4(THIS This, LPVOID lpContext ,LPDDENUMSURFACESCALLBACK2 lpCallBack)
+HRESULT WIN32API SurfEnumAttachedSurfaces4(THIS This, LPVOID lpContext ,LPDDENUMSURFACESCALLBACK2 lpCallBack)
 {
   OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -3758,5 +3758,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfEnumOverlayZOrders(THIS, DWORD,LPVOID,LPDDENUMSURFACESCALLBACK)
+HRESULT WIN32API SurfEnumOverlayZOrders(THIS, DWORD,LPVOID,LPDDENUMSURFACESCALLBACK)
 {
   dprintf(("DDRAW: SurfEnumOverlayZOrders\n"));
@@ -3766,5 +3766,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfEnumOverlayZOrders4(THIS, DWORD,LPVOID,LPDDENUMSURFACESCALLBACK2)
+HRESULT WIN32API SurfEnumOverlayZOrders4(THIS, DWORD,LPVOID,LPDDENUMSURFACESCALLBACK2)
 {
   dprintf(("DDRAW: SurfEnumOverlayZOrders\n"));
@@ -3774,5 +3774,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfFlip(THIS This, LPDIRECTDRAWSURFACE2 lpDDSurf, DWORD dwFlags)
+HRESULT WIN32API SurfFlip(THIS This, LPDIRECTDRAWSURFACE2 lpDDSurf, DWORD dwFlags)
 {
   OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -3784,5 +3784,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfFlip3(THIS This, LPDIRECTDRAWSURFACE3 lpDDSurf, DWORD dwFlags)
+HRESULT WIN32API SurfFlip3(THIS This, LPDIRECTDRAWSURFACE3 lpDDSurf, DWORD dwFlags)
 {
   OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -3794,5 +3794,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfFlip4(THIS This, LPDIRECTDRAWSURFACE4 lpDDSurf, DWORD dwFlags)
+HRESULT WIN32API SurfFlip4(THIS This, LPDIRECTDRAWSURFACE4 lpDDSurf, DWORD dwFlags)
 {
   OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -3923,5 +3923,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfGetAttachedSurface(THIS This, LPDDSCAPS lpDDCaps,
+HRESULT WIN32API SurfGetAttachedSurface(THIS This, LPDDSCAPS lpDDCaps,
                                          LPDIRECTDRAWSURFACE2 FAR * lpDDSurf)
 {
@@ -3933,5 +3933,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfGetAttachedSurface3(THIS This, LPDDSCAPS lpDDCaps,
+HRESULT WIN32API SurfGetAttachedSurface3(THIS This, LPDDSCAPS lpDDCaps,
                                          LPDIRECTDRAWSURFACE3 FAR * lpDDSurf)
 {
@@ -3943,5 +3943,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfGetAttachedSurface4(THIS This, LPDDSCAPS2 lpDDCaps,
+HRESULT WIN32API SurfGetAttachedSurface4(THIS This, LPDDSCAPS2 lpDDCaps,
                                           LPDIRECTDRAWSURFACE4 FAR * lpDDSurf)
 {
@@ -4030,5 +4030,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfGetBltStatus(THIS This, DWORD)
+HRESULT WIN32API SurfGetBltStatus(THIS This, DWORD)
 {
   dprintf(("DDRAW: SurfGetBltStatus\n"));
@@ -4038,5 +4038,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfGetCaps(THIS This, LPDDSCAPS lpDDCaps)
+HRESULT WIN32API SurfGetCaps(THIS This, LPDDSCAPS lpDDCaps)
 {
   OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -4055,5 +4055,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfGetCaps4(THIS This, LPDDSCAPS2 lpDDCaps)
+HRESULT WIN32API SurfGetCaps4(THIS This, LPDDSCAPS2 lpDDCaps)
 {
   OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -4073,5 +4073,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfGetClipper(THIS This, LPDIRECTDRAWCLIPPER FAR *lplpClipper)
+HRESULT WIN32API SurfGetClipper(THIS This, LPDIRECTDRAWCLIPPER FAR *lplpClipper)
 {
   OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -4089,5 +4089,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfGetColorKey(THIS This, DWORD dwFlags, LPDDCOLORKEY lpDDColKey)
+HRESULT WIN32API SurfGetColorKey(THIS This, DWORD dwFlags, LPDDCOLORKEY lpDDColKey)
 {
   OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -4117,5 +4117,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfGetDC(THIS This, HDC FAR *hdc)
+HRESULT WIN32API SurfGetDC(THIS This, HDC FAR *hdc)
 {
  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -4326,5 +4326,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfGetFlipStatus(THIS This, DWORD dwFlags)
+HRESULT WIN32API SurfGetFlipStatus(THIS This, DWORD dwFlags)
 {
   dprintf(("DDRAW: SurfGetFlipStatus\n"));
@@ -4337,5 +4337,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfGetOverlayPosition(THIS This, LPLONG lplX, LPLONG lplY)
+HRESULT WIN32API SurfGetOverlayPosition(THIS This, LPLONG lplX, LPLONG lplY)
 {
   OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -4363,5 +4363,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfGetPalette(THIS This, LPDIRECTDRAWPALETTE FAR *lplpPalette)
+HRESULT WIN32API SurfGetPalette(THIS This, LPDIRECTDRAWPALETTE FAR *lplpPalette)
 {
  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -4379,9 +4379,9 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfGetPixelFormat(THIS This, LPDDPIXELFORMAT lpPixelFormat)
+HRESULT WIN32API SurfGetPixelFormat(THIS This, LPDDPIXELFORMAT lpPixelFormat)
 {
   OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
 
-  dprintf(("DDRAW: SurfGetPixelFormat\n"));
+  dprintf(("DDRAW: SurfGetPixelFormat %x %x", This, lpPixelFormat));
 
   if(NULL==lpPixelFormat)
@@ -4396,5 +4396,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfGetSurfaceDesc(THIS This, LPDDSURFACEDESC lpSurface)
+HRESULT WIN32API SurfGetSurfaceDesc(THIS This, LPDDSURFACEDESC lpSurface)
 {
   OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -4413,5 +4413,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfGetSurfaceDesc4(THIS This, LPDDSURFACEDESC2 lpSurface)
+HRESULT WIN32API SurfGetSurfaceDesc4(THIS This, LPDDSURFACEDESC2 lpSurface)
 {
   OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -4430,5 +4430,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfInitialize(THIS, LPDIRECTDRAW, LPDDSURFACEDESC)
+HRESULT WIN32API SurfInitialize(THIS, LPDIRECTDRAW, LPDDSURFACEDESC)
 {
   dprintf(("DDRAW: SurfInitialize\n"));
@@ -4438,5 +4438,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfInitialize4(THIS, LPDIRECTDRAW, LPDDSURFACEDESC2)
+HRESULT WIN32API SurfInitialize4(THIS, LPDIRECTDRAW, LPDDSURFACEDESC2)
 {
   dprintf(("DDRAW: SurfInitialize\n"));
@@ -4446,5 +4446,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfIsLost(THIS)
+HRESULT WIN32API SurfIsLost(THIS)
 {
   // We don't loose any surface ;)
@@ -4458,5 +4458,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfLock( THIS This,
+HRESULT WIN32API SurfLock( THIS This,
                             LPRECT lpRect,
                             LPDDSURFACEDESC lpSurfaceDesc,
@@ -4493,5 +4493,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfLock4( THIS This,
+HRESULT WIN32API SurfLock4( THIS This,
                              LPRECT lpRect,
                              LPDDSURFACEDESC2 lpSurfaceDesc,
@@ -4611,5 +4611,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfReleaseDC(THIS This, HDC hdc)
+HRESULT WIN32API SurfReleaseDC(THIS This, HDC hdc)
 {
  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -4716,5 +4716,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfRestore(THIS)
+HRESULT WIN32API SurfRestore(THIS)
 {
   dprintf(("DDRAW: SurfRestore\n"));
@@ -4724,9 +4724,9 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfSetClipper(THIS This, LPDIRECTDRAWCLIPPER lpClipper)
+HRESULT WIN32API SurfSetClipper(THIS This, LPDIRECTDRAWCLIPPER lpClipper)
 {
  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
 
-  dprintf(("DDRAW: SurfSetClipper\n"));
+  dprintf(("DDRAW: SurfSetClipper %x %x", This, lpClipper));
 
   if(lpClipper == NULL)
@@ -4759,5 +4759,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfSetColorKey(THIS  This, DWORD dwFlags, LPDDCOLORKEY lpDDColKey)
+HRESULT WIN32API SurfSetColorKey(THIS  This, DWORD dwFlags, LPDDCOLORKEY lpDDColKey)
 {
   OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -4811,5 +4811,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfSetOverlayPosition(THIS This, LONG lX, LONG lY)
+HRESULT WIN32API SurfSetOverlayPosition(THIS This, LONG lX, LONG lY)
 {
   OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -4838,5 +4838,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfSetPalette(THIS This, LPDIRECTDRAWPALETTE lpPalette)
+HRESULT WIN32API SurfSetPalette(THIS This, LPDIRECTDRAWPALETTE lpPalette)
 {
   OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -4893,5 +4893,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfUnlock(THIS This, LPVOID lpSurfaceData)
+HRESULT WIN32API SurfUnlock(THIS This, LPVOID lpSurfaceData)
 {
 
@@ -5035,5 +5035,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfUnlock4(THIS This, LPRECT lpSurfaceRect)
+HRESULT WIN32API SurfUnlock4(THIS This, LPRECT lpSurfaceRect)
 {
   // MS changed the parameter from LPVOID to LPRECT with DX6
@@ -5144,5 +5144,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfUpdateOverlay(THIS This, LPRECT, LPDIRECTDRAWSURFACE2,LPRECT,DWORD, LPDDOVERLAYFX)
+HRESULT WIN32API SurfUpdateOverlay(THIS This, LPRECT, LPDIRECTDRAWSURFACE2,LPRECT,DWORD, LPDDOVERLAYFX)
 {
   dprintf(("DDRAW: SurfUpdateOverlay\n"));
@@ -5151,5 +5151,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfUpdateOverlay3(THIS This, LPRECT, LPDIRECTDRAWSURFACE3,LPRECT,DWORD, LPDDOVERLAYFX)
+HRESULT WIN32API SurfUpdateOverlay3(THIS This, LPRECT, LPDIRECTDRAWSURFACE3,LPRECT,DWORD, LPDDOVERLAYFX)
 {
   dprintf(("DDRAW: SurfUpdateOverlay\n"));
@@ -5158,5 +5158,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfUpdateOverlay4(THIS, LPRECT, LPDIRECTDRAWSURFACE4,LPRECT,DWORD, LPDDOVERLAYFX)
+HRESULT WIN32API SurfUpdateOverlay4(THIS, LPRECT, LPDIRECTDRAWSURFACE4,LPRECT,DWORD, LPDDOVERLAYFX)
 {
   dprintf(("DDRAW: SurfUpdateOverlay\n"));
@@ -5165,5 +5165,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfUpdateOverlayDisplay(THIS, DWORD)
+HRESULT WIN32API SurfUpdateOverlayDisplay(THIS, DWORD)
 {
   dprintf(("DDRAW: SurfUpdateOverlayDisplay\n"));
@@ -5172,5 +5172,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfUpdateOverlayZOrder(THIS, DWORD, LPDIRECTDRAWSURFACE2)
+HRESULT WIN32API SurfUpdateOverlayZOrder(THIS, DWORD, LPDIRECTDRAWSURFACE2)
 {
   dprintf(("DDRAW: SurfUpdateOverlayZOrder\n"));
@@ -5179,5 +5179,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfUpdateOverlayZOrder3(THIS, DWORD, LPDIRECTDRAWSURFACE3)
+HRESULT WIN32API SurfUpdateOverlayZOrder3(THIS, DWORD, LPDIRECTDRAWSURFACE3)
 {
   dprintf(("DDRAW: SurfUpdateOverlayZOrder\n"));
@@ -5186,5 +5186,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfUpdateOverlayZOrder4(THIS, DWORD, LPDIRECTDRAWSURFACE4)
+HRESULT WIN32API SurfUpdateOverlayZOrder4(THIS, DWORD, LPDIRECTDRAWSURFACE4)
 {
   dprintf(("DDRAW: SurfUpdateOverlayZOrder4\n"));
@@ -5193,5 +5193,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfGetDDInterface(THIS This, LPVOID FAR *lplpDirectDraw)
+HRESULT WIN32API SurfGetDDInterface(THIS This, LPVOID FAR *lplpDirectDraw)
 {
  OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -5203,5 +5203,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfPageLock(THIS, DWORD)
+HRESULT WIN32API SurfPageLock(THIS, DWORD)
 {
   // Only used for DMA memory access
@@ -5213,5 +5213,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfPageUnlock(THIS, DWORD)
+HRESULT WIN32API SurfPageUnlock(THIS, DWORD)
 {
   dprintf(("DDRAW: SurfPageUnlock\n"));
@@ -5222,5 +5222,5 @@
 // V3 Interface Functions
 
-HRESULT __stdcall SurfSetSurfaceDesc(THIS This, LPDDSURFACEDESC lpSurfDesc, DWORD dwFlags)
+HRESULT WIN32API SurfSetSurfaceDesc(THIS This, LPDDSURFACEDESC lpSurfDesc, DWORD dwFlags)
 {
   dprintf(("DDRAW: SurfSetSurfaceDesc\n"));
@@ -5267,5 +5267,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfSetSurfaceDesc4(THIS This, LPDDSURFACEDESC2 lpSurfDesc, DWORD dwFlags)
+HRESULT WIN32API SurfSetSurfaceDesc4(THIS This, LPDDSURFACEDESC2 lpSurfDesc, DWORD dwFlags)
 {
   dprintf(("DDRAW: SurfSetSurfaceDesc4\n"));
@@ -5315,5 +5315,5 @@
 // V4 Interface Functions
 
-HRESULT __stdcall SurfSetPrivateData(THIS This, REFGUID refGUID, LPVOID lpData,
+HRESULT WIN32API SurfSetPrivateData(THIS This, REFGUID refGUID, LPVOID lpData,
                                      DWORD dwDataSize, DWORD dwFlags)
 {
@@ -5498,5 +5498,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfGetPrivateData(THIS This, REFGUID refGUID, LPVOID lpData, LPDWORD lpDataSize)
+HRESULT WIN32API SurfGetPrivateData(THIS This, REFGUID refGUID, LPVOID lpData, LPDWORD lpDataSize)
 {
   OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -5557,5 +5557,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfFreePrivateData(THIS This, REFGUID refGUID)
+HRESULT WIN32API SurfFreePrivateData(THIS This, REFGUID refGUID)
 {
   OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
@@ -5605,5 +5605,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfGetUniquenessValue(THIS This, LPDWORD lpValue)
+HRESULT WIN32API SurfGetUniquenessValue(THIS This, LPDWORD lpValue)
 {
   dprintf(("DDRAW: SurfGetUniquenessValue\n"));
@@ -5617,5 +5617,5 @@
 //******************************************************************************
 //******************************************************************************
-HRESULT __stdcall SurfChangeUniquenessValue(THIS This)
+HRESULT WIN32API SurfChangeUniquenessValue(THIS This)
 {
   OS2IDirectDrawSurface *me = (OS2IDirectDrawSurface *)This;
