forget commit Implement of GdiGetLocalBrush, GdiGetLocalDC, GdiGetLocalFont
authorMagnus Olsen <magnus@greatlord.com>
Tue, 25 Sep 2007 20:44:53 +0000 (20:44 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Tue, 25 Sep 2007 20:44:53 +0000 (20:44 +0000)
fix a smaller bug in GdiSetBatchLimit
fix GdiSetLastError to be simluare to windows xp

svn path=/trunk/; revision=29203

reactos/dll/win32/gdi32/gdi32.def
reactos/dll/win32/gdi32/misc/gdientry.c
reactos/dll/win32/gdi32/misc/historic.c
reactos/dll/win32/gdi32/misc/misc.c
reactos/dll/win32/gdi32/misc/stubs.c

index 5d1edfe..ada3b5d 100644 (file)
@@ -146,9 +146,6 @@ DdEntry6@4=NtGdiDdGetDriverState@4
 DdEntry7@12=NtGdiDdAddAttachedSurface@12
 DdEntry8@12=NtGdiDdAlphaBlt@12
 DdEntry9@8=NtGdiDdAttachSurface@8
-
-
-
 DeleteColorSpace@4=NtGdiDeleteColorSpace@4
 DeleteDC@4
 DeleteEnhMetaFile@4
@@ -273,6 +270,7 @@ GdiDeleteLocalDC@4
 GdiDeleteSpoolFileHandle@4
 GdiDescribePixelFormat@16=NtGdiDescribePixelFormat@16
 GdiDllInitialize@12
+GdiDrawStream@12
 GdiEndDocEMF@4
 GdiEndPageEMF@8
 GdiEntry10@8
@@ -338,6 +336,7 @@ GdiTransparentBlt@44
 GdiValidateHandle@4
 GetArcDirection@4
 GetAspectRatioFilterEx@8
+GetBitmapAttributes@4
 GetBitmapBits@12=NtGdiGetBitmapBits@12
 GetBitmapDimensionEx@8=NtGdiGetBitmapDimension@8
 GetBkColor@4
@@ -609,8 +608,8 @@ XFORMOBJ_iGetXform@8=NtGdiXFORMOBJ_iGetXform@8
 XLATEOBJ_cGetPalette@16=NtGdiXLATEOBJ_cGetPalette@16
 XLATEOBJ_hGetColorTransform@4=NtGdiXLATEOBJ_hGetColorTransform@4
 
-GdiDrawStream@12
-GetBitmapAttributes@4
+
+
 GetBrushAttributes@4
 GetGlyphIndicesA@20
 GetTextExtentExPointWPri@28
index f692297..a4c6037 100644 (file)
@@ -485,7 +485,7 @@ DdCreateDirectDrawObject(LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal,
         if (!ghDirectDraw)
         {
             /* Create the DC */
-            if ((hdc = CreateDC(L"Display", NULL, NULL, NULL)))
+            if ((hdc = CreateDCW(L"Display", NULL, NULL, NULL)))
             {
                 /* Create the DDraw Object */
                 ghDirectDraw = NtGdiDdCreateDirectDrawObject(hdc);
@@ -509,7 +509,7 @@ DdCreateDirectDrawObject(LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobal,
     else
     {
         /* Using the per-process object, so create it */
-    pDirectDrawGlobal->hDD = (ULONG_PTR)NtGdiDdCreateDirectDrawObject(hdc); 
+         pDirectDrawGlobal->hDD = (ULONG_PTR)NtGdiDdCreateDirectDrawObject(hdc); 
     
         /* Set the return value */
         Return = pDirectDrawGlobal->hDD ? TRUE : FALSE;
@@ -830,8 +830,7 @@ WINAPI
 DdCreateSurfaceObject( LPDDRAWI_DDRAWSURFACE_LCL pSurfaceLocal,
                        BOOL bPrimarySurface)
 {
-       return bDDCreateSurface(pSurfaceLocal, TRUE);
-    //return bDdCreateSurfaceObject(pSurfaceLocal, TRUE);
+    return bDDCreateSurface(pSurfaceLocal, TRUE);
 }
 
 
@@ -911,8 +910,8 @@ DdCreateDIBSection(HDC hdc,
                    HANDLE hSectionApp,
                    DWORD dwOffset)
 {
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
@@ -988,6 +987,7 @@ ULONG
 STDCALL 
 DdQueryDisplaySettingsUniqueness()
 {
+    /* FIXME share memory */
  return RemberDdQueryDisplaySettingsUniquenessID;
 }
 
index 44777a5..71c3c3d 100644 (file)
@@ -265,3 +265,34 @@ SelectFontLocal(HFONT Currenthfnt,
 {
     return newhfnt;
 }
+
+/*
+ * @implemented
+ */
+HBRUSH 
+STDCALL
+GdiGetLocalBrush(HBRUSH hbr)
+{
+    return hbr;
+}
+
+/*
+ * @implemented
+ */
+HDC 
+STDCALL
+GdiGetLocalDC(HDC hdc)
+{
+    return hdc;
+}
+
+/*
+ * @implemented
+ */
+HFONT 
+STDCALL
+GdiGetLocalFont(HFONT hfont)
+{
+    return hfont;
+}
+
index 99709e1..0f2612f 100644 (file)
@@ -75,10 +75,19 @@ HGDIOBJ
 STDCALL
 GdiFixUpHandle(HGDIOBJ hGdiObj)
 {
- if (((ULONG_PTR)(hGdiObj)) & GDI_HANDLE_UPPER_MASK ) return hGdiObj;
- PGDI_TABLE_ENTRY Entry = GdiHandleTable + GDI_HANDLE_GET_INDEX(hGdiObj);
- return hGdiObj = (HGDIOBJ)(((LONG_PTR)(hGdiObj)) |
-                     (Entry->Type << GDI_ENTRY_UPPER_SHIFT)); // Rebuild handle for Object
+    PGDI_TABLE_ENTRY Entry;
+
+    if (((ULONG_PTR)(hGdiObj)) & GDI_HANDLE_UPPER_MASK )
+    {
+        return hGdiObj;
+    }
+
+    /* FIXME is this right ?? */
+
+    Entry = GdiHandleTable + GDI_HANDLE_GET_INDEX(hGdiObj);
+
+   /* Rebuild handle for Object */
+    return hGdiObj = (HGDIOBJ)(((LONG_PTR)(hGdiObj)) | (Entry->Type << GDI_ENTRY_UPPER_SHIFT));
 }
 
 /*
@@ -138,8 +147,14 @@ DWORD
 STDCALL
 GdiSetBatchLimit(DWORD Limit)
 {
-  DWORD OldLimit = GDI_BatchLimit;
-    if ((!Limit) || (Limit > GDI_BATCH_LIMIT)) return Limit;
+    DWORD OldLimit = GDI_BatchLimit;
+
+    if ( (!Limit) ||
+         (Limit >= GDI_BATCH_LIMIT))
+    {
+        return Limit;
+    }
+
     GdiFlush();
     GDI_BatchLimit = Limit;
     return OldLimit;
@@ -166,17 +181,16 @@ GdiReleaseDC(HDC hdc)
     return 0;
 }
 
-INT STDCALL
-ExtEscape(
-       HDC hDC,
-       int nEscape,
-       int cbInput,
-       LPCSTR lpszInData,
-       int cbOutput,
-       LPSTR lpszOutData
-)
+INT
+STDCALL
+ExtEscape(HDC hDC,
+          int nEscape,
+          int cbInput,
+          LPCSTR lpszInData,
+          int cbOutput,
+          LPSTR lpszOutData)
 {
-       return NtGdiExtEscape(hDC, NULL, 0, nEscape, cbInput, (LPSTR)lpszInData, cbOutput, lpszOutData);
+    return NtGdiExtEscape(hDC, NULL, 0, nEscape, cbInput, (LPSTR)lpszInData, cbOutput, lpszOutData);
 }
 
 /*
@@ -186,5 +200,5 @@ VOID
 STDCALL
 GdiSetLastError(DWORD dwErrCode)
 {
-       SetLastError(dwErrCode);
+    NtCurrentTeb ()->LastErrorValue = (ULONG) dwErrCode;
 }
index fa11337..cfd221c 100644 (file)
@@ -1502,9 +1502,9 @@ HENHMETAFILE
 STDCALL
 GdiConvertEnhMetaFile(HENHMETAFILE hmf)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
@@ -1514,9 +1514,9 @@ BOOL
 STDCALL
 GdiDrawStream(HDC dc, ULONG l, VOID *v)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
@@ -1526,45 +1526,9 @@ DWORD
 STDCALL
 GdiGetCodePage(HDC hdc)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-HBRUSH 
-STDCALL
-GdiGetLocalBrush(HBRUSH hbr)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-HDC 
-STDCALL
-GdiGetLocalDC(HDC hdc)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-HFONT 
-STDCALL
-GdiGetLocalFont(HFONT hfont)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
@@ -1574,9 +1538,9 @@ BOOL
 STDCALL
 GdiIsMetaFileDC(HDC hdc)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*