[ros-diffs] [greatlrd] 17164: Implement Gdintry4 (not tested, we can not test it yet in ros, until we got ddraw.dll and some api in win32k/ntdraw been implement)

greatlrd at svn.reactos.com greatlrd at svn.reactos.com
Sun Aug 7 14:54:53 CEST 2005


Implement Gdintry4 (not tested, we can not test it yet in ros, until we
got ddraw.dll and some api in win32k/ntdraw been implement)
Modified: trunk/reactos/lib/gdi32/include/precomp.h
Modified: trunk/reactos/lib/gdi32/misc/gdientry.c
Modified: trunk/reactos/lib/gdi32/misc/stubs.c
  _____  

Modified: trunk/reactos/lib/gdi32/include/precomp.h
--- trunk/reactos/lib/gdi32/include/precomp.h	2005-08-07 12:10:54 UTC
(rev 17163)
+++ trunk/reactos/lib/gdi32/include/precomp.h	2005-08-07 12:54:41 UTC
(rev 17164)
@@ -88,4 +88,8 @@

 VOID
 STDCALL
 LogFontW2A(LPLOGFONTA pA, CONST LOGFONTW *pW);
+
+/* == Directx FUNCTIONS
================================================== */
+BOOL
+intDDCreateSurface ( LPDDRAWI_DDRAWSURFACE_LCL pSurface, BOOL
bComplete);
 /* EOF */
  _____  

Modified: trunk/reactos/lib/gdi32/misc/gdientry.c
--- trunk/reactos/lib/gdi32/misc/gdientry.c	2005-08-07 12:10:54 UTC
(rev 17163)
+++ trunk/reactos/lib/gdi32/misc/gdientry.c	2005-08-07 12:54:41 UTC
(rev 17164)
@@ -118,9 +118,19 @@

   return NtGdiDdDeleteDirectDrawObject((HANDLE)pDirectDrawGlobal->hDD);
}
 
+/*
+ * @implemented
+ *
+ * GDIEntry 4
+ */
+BOOL STDCALL DdCreateSurfaceObject( 
+LPDDRAWI_DDRAWSURFACE_LCL pSurfaceLocal,
+BOOL bPrimarySurface
+)
+{
+	return intDDCreateSurface(pSurfaceLocal,1);	
+}
 
-
-
 /*
  * @implemented
  *
@@ -295,3 +305,68 @@
 	return TRUE;
 }
 
+
+/* interal create surface */
+BOOL
+intDDCreateSurface ( LPDDRAWI_DDRAWSURFACE_LCL pSurface, 
+				  BOOL bComplete)
+{
+  DD_SURFACE_LOCAL SurfaceLocal;
+  DD_SURFACE_GLOBAL SurfaceGlobal;
+  DD_SURFACE_MORE SurfaceMore;
+
+  /* Zero struct */
+  RtlZeroMemory(&SurfaceLocal, sizeof(DD_SURFACE_LOCAL));
+  RtlZeroMemory(&SurfaceGlobal, sizeof(DD_SURFACE_GLOBAL));
+  RtlZeroMemory(&SurfaceMore, sizeof(DD_SURFACE_MORE));
+
+  /* Set up SurfaceLocal struct */
+  SurfaceLocal.ddsCaps.dwCaps = pSurface->ddsCaps.dwCaps;
+  SurfaceLocal.dwFlags = pSurface->dwFlags;
+
+  /* Set up SurfaceMore struct */
+  /* copy  pSurface->ddckCKDestBlt and pSurface->ddckCKSrcBlt to
SurfaceMore.ddsCapsEx */  
+  memcpy(&SurfaceMore.ddsCapsEx, &pSurface->ddckCKDestBlt,
sizeof(DDSCAPSEX));   
+  SurfaceMore.dwSurfaceHandle =  (DWORD)
pSurface->dbnOverlayNode.object_int->lpVtbl; 
+
+
+  /* Set up SurfaceGlobal struct */
+  SurfaceGlobal.fpVidMem = pSurface->lpGbl->fpVidMem;
+  SurfaceGlobal.dwLinearSize = pSurface->lpGbl->dwLinearSize;
+  SurfaceGlobal.wHeight = pSurface->lpGbl->wHeight;
+  SurfaceGlobal.wWidth = pSurface->lpGbl->wWidth;
+
+  /* check which memory type should be use */
+  if ((pSurface->dwFlags & DDRAWISURFGBL_LOCKVRAMSTYLE) ==
DDRAWISURFGBL_LOCKVRAMSTYLE)
+  {	
+
memcpy(&SurfaceGlobal.ddpfSurface,&pSurface->lpGbl->lpDD->vmiData.ddpfDi
splay, sizeof(DDPIXELFORMAT));
+  }
+  else
+  {
+
memcpy(&SurfaceGlobal.ddpfSurface,&pSurface->lpGbl->ddpfSurface,
sizeof(DDPIXELFORMAT));
+  }
+
+  /* Determer if Gdi32 chace of directdraw handler or not */
+  if (pSurface->lpGbl->lpDD->hDD)
+  {
+     pSurface->hDDSurface = ((DWORD) NtGdiDdCreateSurfaceObject(
(HANDLE) pSurface->lpGbl->lpDD->hDD,
+	                                                (HANDLE)
pSurface->hDDSurface, &SurfaceLocal, 
+
&SurfaceMore, &SurfaceGlobal, bComplete));
+  }
+  else
+  {
+     pSurface->hDDSurface = ((DWORD) NtGdiDdCreateSurfaceObject(
(HANDLE) pDirectDrawGlobalInternal->hDD,
+	                                                (HANDLE)
pSurface->hDDSurface, &SurfaceLocal, 
+
&SurfaceMore, 
+
&SurfaceGlobal, 
+
bComplete));
+  }
+
+  /* return status */
+  if (pSurface->hDDSurface) 
+  {
+    return TRUE;
+  }
+
+  return FALSE;
+}
  _____  

Modified: trunk/reactos/lib/gdi32/misc/stubs.c
--- trunk/reactos/lib/gdi32/misc/stubs.c	2005-08-07 12:10:54 UTC
(rev 17163)
+++ trunk/reactos/lib/gdi32/misc/stubs.c	2005-08-07 12:54:41 UTC
(rev 17164)
@@ -3890,24 +3890,6 @@

 /*
  * @unimplemented
  */
-BOOL STDCALL DdCreateSurfaceObject( 
-LPDDRAWI_DDRAWSURFACE_LCL pSurfaceLocal,
-BOOL bPrimarySurface
-)
-{
-	UNIMPLEMENTED;
-	SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-	return 0;
-}
-
-
-
-
-
-
-/*
- * @unimplemented
- */
 HBITMAP STDCALL DdCreateDIBSection( 
 HDC hdc,
 CONST BITMAPINFO *pbmi,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.reactos.org/pipermail/ros-diffs/attachments/20050807/57c6af86/attachment.html


More information about the Ros-diffs mailing list