forget commit Implement of GdiGetLocalBrush, GdiGetLocalDC, GdiGetLocalFont
[reactos.git] / reactos / dll / win32 / gdi32 / misc / stubs.c
index 7c61f7c..cfd221c 100644 (file)
 
 #define UNIMPLEMENTED DbgPrint("GDI32: %s is unimplemented, please try again later.\n", __FUNCTION__);
 
+
 /*
  * @unimplemented
  */
 BOOL
 STDCALL
-CancelDC(
-       HDC     a0
-       )
+TranslateCharsetInfo(DWORD * lpSrc,
+                     LPCHARSETINFO lpCs,
+                     DWORD dwFlags)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return FALSE;
+    /* FIXME share memory */
+    return NtGdiTranslateCharsetInfo(lpSrc, lpCs, dwFlags );
 }
-  
 
 /*
  * @unimplemented
  */
 int
 STDCALL
-DrawEscape(
-       HDC             a0,
-       int             a1,
-       int             a2,
-       LPCSTR          a3
-       )
+StretchDIBits(HDC hdc,
+              int XDest,
+              int YDest,
+              int nDestWidth,
+              int nDestHeight,
+              int XSrc,
+              int YSrc,
+              int nSrcWidth,
+              int nSrcHeight,
+              CONST VOID *lpBits,
+              CONST BITMAPINFO *lpBitsInfo,
+              UINT iUsage,
+              DWORD dwRop)
+
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    /* FIXME share memory */
+    return NtGdiStretchDIBits(hdc, XDest, YDest, nDestWidth, nDestHeight, XSrc, YSrc, 
+                              nSrcWidth, nSrcHeight, lpBits, lpBitsInfo, iUsage, dwRop);
 }
 
+/*
+ * @unimplemented
+ */
+int
+STDCALL
+SetDIBits(HDC hdc,
+          HBITMAP hbmp,
+          UINT uStartScan,
+          UINT cScanLines,
+          CONST VOID *lpvBits,
+          CONST BITMAPINFO *lpbmi,
+          UINT fuColorUse)
+{
+    /* FIXME share memory */
+    return NtGdiSetDIBits(hdc, hbmp, uStartScan, cScanLines, lpvBits, lpbmi, fuColorUse);
+}
 
 /*
  * @unimplemented
  */
 int
 STDCALL
-EnumObjects(
-       HDC             a0,
-       int             a1,
-       GOBJENUMPROC    a2,
-       LPARAM          a3
-       )
+SetGraphicsMode(HDC hdc,
+                int iMode)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    /* FIXME share memory */
+    return NtGdiSetGraphicsMode(hdc, iMode);
+}
+
+/*
+ * @unimplemented
+ */
+int
+STDCALL
+SetPolyFillMode(HDC hdc,
+                int iPolyFillMode)
+{
+    /* FIXME share memory */
+    return NtGdiSetPolyFillMode(hdc, iPolyFillMode);
+}
+
+/*
+ * @unimplemented
+ */
+int
+STDCALL
+SetROP2(HDC hdc,
+        int fnDrawMode)
+{
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
+}
+
+/*
+ * @unimplemented
+ */
+int
+STDCALL
+SetStretchBltMode(HDC hdc, int iStretchMode)
+{
+    /* FIXME share memory */
+    return NtGdiSetStretchBltMode(hdc, iStretchMode);
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+STDCALL
+SetRectRgn(HRGN hrgn,
+           int nLeftRect,
+           int nTopRect,
+           int nRightRect,
+           int nBottomRect)
+{
+    /* FIXME metadc stuff */
+    return NtGdiSetRectRgn(hrgn, nLeftRect, nTopRect, nRightRect, nBottomRect);
+}
+
+/*
+ * @unimplemented
+ */
+UINT
+STDCALL
+SetTextAlign(HDC hdc,
+             UINT fMode)
+{
+    /* FIXME share memory */
+    return NtGdiSetTextAlign(hdc, fMode);
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+STDCALL
+SetViewportExtEx(HDC hdc,
+                 int nXExtent,
+                 int nYExtent,
+                 LPSIZE lpSize)
+{
+    /* FIXME share memory */
+    return NtGdiSetViewportExtEx(hdc, nXExtent, nYExtent, lpSize);
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+STDCALL
+SetWindowOrgEx(HDC hdc,
+               int X,
+               int Y,
+               LPPOINT lpPoint)
+{
+    /* FIXME share memory */
+    return NtGdiSetWindowOrgEx(hdc,X,Y,lpPoint);
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+STDCALL
+SetWindowExtEx(HDC hdc,
+               int nXExtent,
+               int nYExtent,
+               LPSIZE lpSize)
+{
+    /* FIXME share memory */
+    return NtGdiSetWindowExtEx(hdc, nXExtent, nYExtent, lpSize);
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+STDCALL
+SetViewportOrgEx(HDC hdc,
+                 int X,
+                 int Y,
+                 LPPOINT lpPoint)
+{
+    /* FIXME share memory */
+    return NtGdiSetViewportOrgEx(hdc,X,Y,lpPoint);
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+STDCALL
+SetBrushOrgEx(HDC hdc,
+              int nXOrg,
+              int nYOrg,
+              LPPOINT lppt)
+{
+    /* FIXME share memory */
+    return NtGdiSetBrushOrg(hdc,nXOrg,nYOrg,lppt);
+}
+
+/*
+ * @unimplemented
+ */
+BOOL 
+STDCALL
+PtInRegion(IN HRGN hrgn,
+           int x,
+           int y)
+{
+    /* FIXME some stuff at user mode need be fixed */
+    return NtGdiPtInRegion(hrgn,x,y);
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+STDCALL
+RectInRegion(HRGN hrgn,
+             LPCRECT prcl)
+{
+    /* FIXME some stuff at user mode need be fixed */
+    return NtGdiRectInRegion(hrgn, (LPRECT) prcl);
+}
+
+/*
+ * @unimplemented
+ */
+BOOL
+STDCALL
+RestoreDC(IN HDC hdc,
+          IN INT iLevel)
+{
+    /* FIXME Sharememory */
+    return NtGdiRestoreDC(hdc, iLevel);
+}
+
+/*
+ * @unimplemented
+ */
+INT
+STDCALL
+SaveDC(IN HDC hdc)
+{
+    /* FIXME Sharememory */
+    return NtGdiSaveDC(hdc);
+}
+
+
+
+/*
+ * @unimplemented
+ */
+BOOL
+STDCALL
+CancelDC(HDC hdc)
+{
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return FALSE;
+}
+
+
+/*
+ * @unimplemented
+ */
+int
+STDCALL
+DrawEscape(HDC  hdc,
+           int a1,
+           int a2,
+           LPCSTR a3)
+{
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
+}
+
+
+/*
+ * @unimplemented
+ */
+int
+STDCALL
+EnumObjects(HDC hdc,
+            int a1,
+            GOBJENUMPROC a2,
+            LPARAM a3)
+{
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
@@ -115,18 +360,14 @@ GetBoundsRect(
 
 
 /*
- * @unimplemented
+ * @implemented
  */
 int
 STDCALL
-GetMetaRgn(
-       HDC     a0,
-       HRGN    a1
-       )
+GetMetaRgn(HDC hdc,
+           HRGN hrgn)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    return NtGdiGetRandomRgn(hdc,hrgn,2);
 }
 
 
@@ -147,31 +388,6 @@ GetMetaFileBitsEx(
 }
 
 
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-GetRasterizerCaps(
-       LPRASTERIZER_STATUS     a0,
-       UINT                    a1
-       )
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return FALSE;
-}
-
-/*
- * @unimplemented
- */
-UINT
-STDCALL
-GetSystemPaletteUse(HDC hDc)
-{
-    return NtGdiGetSystemPaletteUse(hDc);
-}
-
 
 /*
  * @unimplemented
@@ -187,7 +403,6 @@ GetFontLanguageInfo(
        return 0;
 }
 
-
 /*
  * @unimplemented
  */
@@ -203,7 +418,6 @@ PlayMetaFile(
        return FALSE;
 }
 
-
 /*
  * @unimplemented
  */
@@ -219,7 +433,6 @@ ResizePalette(
        return FALSE;
 }
 
-
 /*
  * @unimplemented
  */
@@ -234,21 +447,17 @@ SetMetaRgn(
        return 0;
 }
 
-
 /*
- * @unimplemented
+ * @implemented
  */
 UINT
 STDCALL
-SetBoundsRect(
-       HDC             a0,
-       CONST RECT      *a1,
-       UINT            a2
-       )
+SetBoundsRect(HDC hdc,
+              CONST RECT *prc,
+              UINT flags)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    /* FIXME add check for vaildate the flags */
+    return NtGdiSetBoundsRect(hdc, (LPRECT)prc, flags);
 }
 
 
@@ -267,7 +476,6 @@ SetMapperFlags(
        return 0;
 }
 
-
 /*
  * @unimplemented
  */
@@ -283,23 +491,6 @@ SetMetaFileBitsEx(
        return 0;
 }
 
-
-/*
- * @unimplemented
- */
-UINT
-STDCALL
-SetSystemPaletteUse(
-       HDC     a0,
-       UINT    a1
-       )
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-
 /*
  * @unimplemented
  */
@@ -316,7 +507,6 @@ SetTextJustification(
        return FALSE;
 }
 
-
 /*
  * @unimplemented
  */
@@ -367,10 +557,6 @@ EnumMetaFile(
        return FALSE;
 }
 
-
-
-
-
 /*
  * @unimplemented
  */
@@ -385,7 +571,6 @@ DeleteEnhMetaFile(
        return FALSE;
 }
 
-
 /*
  * @unimplemented
  */
@@ -404,7 +589,6 @@ EnumEnhMetaFile(
        return FALSE;
 }
 
-
 /*
  * @unimplemented
  */
@@ -438,7 +622,6 @@ GetEnhMetaFileHeader(
        return 0;
 }
 
-
 /*
  * @unimplemented
  */
@@ -455,7 +638,6 @@ GetEnhMetaFilePaletteEntries(
        return 0;
 }
 
-
 /*
  * @unimplemented
  */
@@ -608,10 +790,6 @@ SetColorAdjustment(
        return FALSE;
 }
 
-
-
-
-
 /*
  * @unimplemented
  */
@@ -733,11 +911,16 @@ ScaleWindowExtEx(
  */
 BOOL
 STDCALL
-UnrealizeObject(
-       HGDIOBJ a0
-       )
+UnrealizeObject(HGDIOBJ  hgdiobj)
 {
-       return NtGdiUnrealizeObject(a0);
+    BOOL retValue = TRUE;
+
+    if (GDI_HANDLE_GET_TYPE(hgdiobj) != GDI_OBJECT_TYPE_BRUSH)
+    {
+        retValue = NtGdiUnrealizeObject(hgdiobj);
+    }
+
+    return retValue;
 }
 
 
@@ -792,13 +975,11 @@ CheckColorsInGamut(
  */
 HCOLORSPACE
 STDCALL
-GetColorSpace(
-       HDC     hDc
-       )
+GetColorSpace(HDC hDc)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 
@@ -838,24 +1019,26 @@ GetDeviceGammaRamp( HDC hdc,
     return retValue;
 }
 
-
-    
-
-
-
 /*
- * @unimplemented
+ * @implemented
  */
 BOOL
 STDCALL
-SetDeviceGammaRamp(
-       HDC     a0,
-       LPVOID  a1
-       )
+SetDeviceGammaRamp(HDC hdc,
+                   LPVOID lpGammaRamp)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return FALSE;
+    BOOL retValue = FALSE;
+
+    if (lpGammaRamp)
+    {
+        retValue = NtGdiSetDeviceGammaRamp(hdc, lpGammaRamp);
+    }
+    else
+    {
+        SetLastError(ERROR_INVALID_PARAMETER);
+    }
+
+    return  retValue;
 }
 
 
@@ -1107,92 +1290,12 @@ wglSwapLayerBuffers(
  * === WHERE ARE THEY DEFINED? =============
  */
 
-
-/*
- * @implemented
- */
-BOOL
-STDCALL
-GdiPlayDCScript(
-       DWORD   a0,
-       DWORD   a1,
-       DWORD   a2,
-       DWORD   a3,
-       DWORD   a4,
-       DWORD   a5
-       )
-{
-    /* FIXME fix the prototype right */
-    return FALSE;
-}
-
-
-/*
- * @implemented
- */
-BOOL
-STDCALL
-GdiPlayJournal(
-       DWORD   a0,
-       DWORD   a1,
-       DWORD   a2,
-       DWORD   a3,
-       DWORD   a4
-       )
-{
-    /* FIXME fix the prototype right */
-    return FALSE;
-}
-
-
-/*
- * @implemented
- */
-BOOL
-STDCALL
-GdiPlayScript(
-       DWORD   a0,
-       DWORD   a1,
-       DWORD   a2,
-       DWORD   a3,
-       DWORD   a4,
-       DWORD   a5,
-       DWORD   a6)
-{
-    /* FIXME prototype */
-    return FALSE;
-}
-
-
-/*
- * @unimplemented
- */
-DWORD
-STDCALL
-GetGlyphOutlineWow(
-       DWORD   a0,
-       DWORD   a1,
-       DWORD   a2,
-       DWORD   a3,
-       DWORD   a4,
-       DWORD   a5,
-       DWORD   a6
-       )
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-
-
-
 /*
  * @unimplemented
  */
 DWORD
 STDCALL
-SelectBrushLocal(
+IsValidEnhMetaRecord(
        DWORD   a0,
        DWORD   a1
        )
@@ -1200,32 +1303,40 @@ SelectBrushLocal(
        UNIMPLEMENTED;
        SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
        return 0;
-}
 
+}
 
 /*
  * @unimplemented
  */
 DWORD
 STDCALL
-SelectFontLocal(
+IsValidEnhMetaRecordOffExt(
        DWORD   a0,
-       DWORD   a1
+       DWORD   a1,
+       DWORD   a2,
+       DWORD   a3
        )
 {
        UNIMPLEMENTED;
        SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
        return 0;
-}
 
+}
 
 /*
  * @unimplemented
  */
 DWORD
 STDCALL
-SetFontEnumeration(
-       DWORD   a0
+GetGlyphOutlineWow(
+       DWORD   a0,
+       DWORD   a1,
+       DWORD   a2,
+       DWORD   a3,
+       DWORD   a4,
+       DWORD   a5,
+       DWORD   a6
        )
 {
        UNIMPLEMENTED;
@@ -1233,7 +1344,6 @@ SetFontEnumeration(
        return 0;
 }
 
-
 /*
  * @unimplemented
  */
@@ -1386,241 +1496,292 @@ GdiConvertAndCheckDC(HDC hdc)
 }
 
 /*
- * @implemented
+ * @unimplemented
  */
-HBITMAP 
+HENHMETAFILE 
 STDCALL
-GdiConvertBitmap(HBITMAP hbm)
+GdiConvertEnhMetaFile(HENHMETAFILE hmf)
 {
-    return hbm;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
- * @implemented
+ * @unimplemented
  */
-HBRUSH
+BOOL
 STDCALL
-GdiConvertBrush(HBRUSH hbr)
+GdiDrawStream(HDC dc, ULONG l, VOID *v)
 {
-    return hbr;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
- * @implemented
+ * @unimplemented
  */
-HDC 
+DWORD 
 STDCALL
-GdiConvertDC(HDC hdc)
+GdiGetCodePage(HDC hdc)
 {
-    return hdc;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
- * @implemented
+ * @unimplemented
  */
-HFONT 
+BOOL
 STDCALL
-GdiConvertFont(HFONT hfont)
+GdiIsMetaFileDC(HDC hdc)
 {
-    return hfont;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
- * @implemented
+ * @unimplemented
  */
-HPALETTE 
+BOOL
 STDCALL
-GdiConvertPalette(HPALETTE hpal)
+GdiIsMetaPrintDC(HDC hdc)
 {
-    return hpal;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
- * @implemented
+ * @unimplemented
  */
-HRGN
+BOOL
 STDCALL
-GdiConvertRegion(HRGN hregion)
+GdiIsPlayMetafileDC(HDC hdc)
 {
-    return hregion;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
  * @unimplemented
  */
-HENHMETAFILE 
+BOOL
 STDCALL
-GdiConvertEnhMetaFile(HENHMETAFILE hmf)
+GdiValidateHandle(HGDIOBJ hobj)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
  * @unimplemented
  */
-BOOL
+DWORD 
 STDCALL
-GdiDeleteLocalDC(HDC hdc)
+GetBitmapAttributes(HBITMAP hbm)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
  * @unimplemented
  */
-BOOL
+DWORD 
 STDCALL
-GdiDrawStream(HDC dc, ULONG l, VOID *v)
+GetBrushAttributes(HBRUSH hbr)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
  * @unimplemented
  */
-DWORD 
+BOOL 
 STDCALL
-GdiGetCodePage(HDC hdc)
+GetCharABCWidthsI(HDC hdc,
+                  UINT giFirst,
+                  UINT cgi,
+                  LPWORD pgi,
+                  LPABC lpabc
+)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
  * @unimplemented
  */
-HBRUSH 
+BOOL 
 STDCALL
-GdiGetLocalBrush(HBRUSH hbr)
+GetCharWidthI(HDC hdc,
+              UINT giFirst,
+              UINT cgi,
+              LPWORD pgi,
+              LPINT lpBuffer
+)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
+
+
 /*
- * @unimplemented
+ * @implemented
  */
-HDC 
+ULONG 
 STDCALL
-GdiGetLocalDC(HDC hdc)
+GetEUDCTimeStamp(VOID)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    return NtGdiGetEudcTimeStampEx(NULL,0,TRUE);
 }
 
 /*
- * @unimplemented
+ * @implemented
  */
-HFONT 
+ULONG 
 STDCALL
-GdiGetLocalFont(HFONT hfont)
+GetFontAssocStatus(HDC hdc)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    ULONG retValue = 0;
+
+    if (hdc)
+    {
+        retValue = NtGdiQueryFontAssocInfo(hdc);
+    }
+
+    return retValue;
 }
 
 /*
  * @unimplemented
  */
-BOOL
+HFONT 
 STDCALL
-GdiIsMetaFileDC(HDC hdc)
+GetHFONT(HDC dc)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
  * @unimplemented
  */
-BOOL
+DWORD 
 STDCALL
-GdiIsMetaPrintDC(HDC hdc)
+GetLayout(HDC hdc
+)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
- * @unimplemented
+ * @implemented
  */
 BOOL
 STDCALL
-GdiIsPlayMetafileDC(HDC hdc)
+GetTextExtentExPointWPri(HDC hdc,
+                         LPWSTR lpwsz,
+                         ULONG cwc,
+                         ULONG dxMax,
+                         ULONG *pcCh,
+                         PULONG pdxOut,
+                         LPSIZE psize)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    return NtGdiGetTextExtentExW(hdc,lpwsz,cwc,dxMax,pcCh,pdxOut,psize,0);
 }
 
 /*
  * @implemented
  */
-BOOL
+INT 
 STDCALL
-GdiSetAttrs(HDC hdc)
+GetTextFaceAliasW(HDC hdc,
+                  int cChar,
+                  LPWSTR pszOut)
 {
-    return TRUE;
+    INT retValue = 0;
+    if ((!pszOut) || (cChar))
+    {
+        retValue = NtGdiGetTextFaceW(hdc,cChar,pszOut,TRUE);
+    }
+    else
+    {
+        SetLastError(ERROR_INVALID_PARAMETER);
+    }
+    return retValue;
 }
 
 
 
-
-
 /*
  * @unimplemented
  */
-BOOL
+BOOL 
 STDCALL
-GdiValidateHandle(HGDIOBJ hobj)
+MirrorRgn(HWND hwnd,HRGN hrgn)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 
 
 /*
- * @implemented
+ * @unimplemented
  */
-VOI
+DWOR
 STDCALL
-GdiSetServerAttr(HDC hdc,DWORD attr)
+QueryFontAssocStatus(VOID)
 {
-    /* it does do nothing */
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
- * @unimplemented
+ * @implemented
  */
-DWORD 
+BOOL 
 STDCALL
-GetBitmapAttributes(HBITMAP hbm)
+RemoveFontMemResourceEx(HANDLE fh)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    BOOL retValue=0;
+
+    if (fh)
+    {
+        retValue = NtGdiRemoveFontMemResourceEx(fh);
+    }
+    else
+    {
+        SetLastError(ERROR_INVALID_PARAMETER);
+    }
+    return retValue;
 }
 
 /*
  * @unimplemented
  */
-DWORD 
+int 
 STDCALL
-GetBrushAttributes(HBRUSH hbr)
+RemoveFontResourceTracking(LPCSTR lpString,int unknown)
 {
        UNIMPLEMENTED;
        SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
@@ -1630,15 +1791,9 @@ GetBrushAttributes(HBRUSH hbr)
 /*
  * @unimplemented
  */
-BOOL 
+HBITMAP 
 STDCALL
-GetCharABCWidthsI(
-       HDC hdc,
-       UINT giFirst,
-       UINT cgi,
-       LPWORD pgi,
-       LPABC lpabc
-)
+SetBitmapAttributes(HBITMAP hbm, DWORD dwFlags)
 {
        UNIMPLEMENTED;
        SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
@@ -1648,15 +1803,9 @@ GetCharABCWidthsI(
 /*
  * @unimplemented
  */
-BOOL 
+HBRUSH 
 STDCALL
-GetCharWidthI(
-       HDC hdc,
-       UINT giFirst,
-       UINT cgi,
-       LPWORD pgi,
-       LPINT lpBuffer
-)
+SetBrushAttributes(HBRUSH hbm, DWORD dwFlags)
 {
        UNIMPLEMENTED;
        SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
@@ -1668,211 +1817,12 @@ GetCharWidthI(
  */
 DWORD 
 STDCALL
-GetFontUnicodeRanges(
-       HDC hdc,
-       LPGLYPHSET lpgs
-)
+SetLayout(HDC hdc,
+          DWORD dwLayout)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @implemented
- */
-ULONG 
-STDCALL
-GetEUDCTimeStamp(VOID)
-{
-    return NtGdiGetEudcTimeStampEx(NULL,0,TRUE);
-}
-
-/*
- * @unimplemented
- */
-ULONG 
-STDCALL
-GetFontAssocStatus(HDC hdc)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-HFONT 
-STDCALL
-GetHFONT(HDC dc)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-DWORD 
-STDCALL
-GetLayout(
-       HDC hdc
-)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-GetTextExtentExPointWPri(HDC hdc,LPWSTR lpwsz,ULONG cwc,ULONG dxMax,ULONG *pcCh,PULONG pdxOut,LPSIZE psize)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-int 
-STDCALL
-GetTextFaceAliasW(HDC hdc,int cChar,LPWSTR pszOut)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-LONG 
-STDCALL
-HT_Get8BPPFormatPalette(LPPALETTEENTRY pPaletteEntry, USHORT RedGamma,USHORT GreenGamma, USHORT BlueGamma)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-LONG 
-STDCALL
-HT_Get8BPPMaskPalette(LPPALETTEENTRY pPaletteEntry, BOOL Use8BPPMaskPal,BYTE CMYMask, USHORT RedGamma, USHORT GreenGamma, USHORT BlueGamma)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL 
-STDCALL
-MirrorRgn(HWND hwnd,HRGN hrgn)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-int 
-STDCALL
-NamedEscape(HDC hdc,PWCHAR pDriver,int nDriver,int iEsc,int cjIn,LPSTR pjIn,int cjOut,LPSTR pjOut)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-DWORD 
-STDCALL
-QueryFontAssocStatus(VOID)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL 
-STDCALL
-RemoveFontMemResourceEx(
-       HANDLE fh
-)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-int 
-STDCALL
-RemoveFontResourceTracking(LPCSTR lpString,int unknown)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-HBITMAP 
-STDCALL
-SetBitmapAttributes(HBITMAP hbm, DWORD dwFlags)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-HBRUSH 
-STDCALL
-SetBrushAttributes(HBRUSH hbm, DWORD dwFlags)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-DWORD 
-STDCALL
-SetLayout(
-       HDC hdc,
-       DWORD dwLayout
-)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
@@ -1882,45 +1832,21 @@ DWORD
 STDCALL
 SetLayoutWidth(HDC hdc,LONG wox,DWORD dwLayout)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
-/*
- * @unimplemented
- */
-BOOL 
-STDCALL
-SetMagicColors(HDC hdc,PALETTEENTRY peMagic,ULONG Index)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
 
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-SetVirtualResolution(HDC hdc, int cxVirtualDevicePixel,int cyVirtualDevicePixel,int cxVirtualDeviceMm, int cyVirtualDeviceMm)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
 
 /*
- * @unimplemented
+ * @implemented
  */
 int 
 STDCALL
 StartFormPage(HDC hdc)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    return StartPage(hdc);
 }
 
 /*
@@ -1930,45 +1856,37 @@ VOID
 STDCALL
 UnloadNetworkFonts(DWORD unknown)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
 }
 
 /*
- * @unimplemented
+ * @implemented
  */
 BOOL 
 STDCALL
-GetTextExtentExPointI(
-       HDC hdc,
-       LPWORD pgiIn,
-       int cgi,
-       int nMaxExtent,
-       LPINT lpnFit,
-       LPINT alpDx,
-       LPSIZE lpSize
-)
+GetTextExtentExPointI(HDC hdc,
+                      LPWORD pgiIn,
+                      int cgi,
+                      int nMaxExtent,
+                      LPINT lpnFit,
+                      LPINT alpDx,
+                      LPSIZE lpSize)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    return NtGdiGetTextExtentExW(hdc,pgiIn,cgi,nMaxExtent,(ULONG *)lpnFit, (PULONG) alpDx,lpSize,1);
 }
 
 /*
- * @unimplemented
+ * @implemented
  */
 BOOL 
 STDCALL
-GetTextExtentPointI(
-       HDC hdc,
-       LPWORD pgiIn,
-       int cgi,
-       LPSIZE lpSize
-)
+GetTextExtentPointI(HDC hdc,
+                    LPWORD pgiIn,
+                    int cgi,
+                    LPSIZE lpSize)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    return NtGdiGetTextExtent(hdc,pgiIn,cgi,lpSize,2);
 }
 
 
@@ -1980,11 +1898,12 @@ GetTextExtentPointI(
  */
 BOOL 
 STDCALL
-GdiRealizationInfo(HDC hdc, PREALIZATION_INFO pri)
+GdiRealizationInfo(HDC hdc,
+                   PREALIZATION_INFO pri)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 
@@ -1994,11 +1913,12 @@ GdiRealizationInfo(HDC hdc, PREALIZATION_INFO pri)
  */
 BOOL 
 STDCALL
-GetETM(HDC hdc,EXTTEXTMETRIC *petm)
+GetETM(HDC hdc,
+       EXTTEXTMETRIC *petm)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
@@ -2006,564 +1926,335 @@ GetETM(HDC hdc,EXTTEXTMETRIC *petm)
  */
 BOOL
 STDCALL
-GdiAddGlsRecord(HDC hdc,DWORD unknown1,LPCSTR unknown2,LPRECT unknown3)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-HANDLE
-STDCALL
-GdiConvertMetaFilePict(HGLOBAL hMem)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @implemented
- */
-DEVMODEW *
-STDCALL
-GdiConvertToDevmodeW(DEVMODEA *dm)
-{
-  LPDEVMODEW dmw;
-  
-  dmw = HEAP_alloc(sizeof(DEVMODEW));
-#define COPYS(f,len) MultiByteToWideChar ( CP_THREAD_ACP, 0, (LPSTR)dm->f, len, dmw->f, len )
-#define COPYN(f) dmw->f = dm->f
-  COPYS(dmDeviceName, CCHDEVICENAME );
-  COPYN(dmSpecVersion);
-  COPYN(dmDriverVersion);
-  switch ( dm->dmSize )
-    {
-    case SIZEOF_DEVMODEA_300:
-      dmw->dmSize = SIZEOF_DEVMODEW_300;
-      break;
-    case SIZEOF_DEVMODEA_400:
-      dmw->dmSize = SIZEOF_DEVMODEW_400;
-      break;
-    case SIZEOF_DEVMODEA_500:
-    default: /* FIXME what to do??? */
-      dmw->dmSize = SIZEOF_DEVMODEW_500;
-      break;
-    }
-  COPYN(dmDriverExtra);
-  COPYN(dmFields);
-  COPYN(dmPosition.x);
-  COPYN(dmPosition.y);
-  COPYN(dmScale);
-  COPYN(dmCopies);
-  COPYN(dmDefaultSource);
-  COPYN(dmPrintQuality);
-  COPYN(dmColor);
-  COPYN(dmDuplex);
-  COPYN(dmYResolution);
-  COPYN(dmTTOption);
-  COPYN(dmCollate);
-  COPYS(dmFormName,CCHFORMNAME);
-  COPYN(dmLogPixels);
-  COPYN(dmBitsPerPel);
-  COPYN(dmPelsWidth);
-  COPYN(dmPelsHeight);
-  COPYN(dmDisplayFlags); // aka dmNup
-  COPYN(dmDisplayFrequency);
-
-  if ( dm->dmSize <= SIZEOF_DEVMODEA_300 )
-    return dmw; // we're done with 0x300 fields
-
-  COPYN(dmICMMethod);
-  COPYN(dmICMIntent);
-  COPYN(dmMediaType);
-  COPYN(dmDitherType);
-  COPYN(dmReserved1);
-  COPYN(dmReserved2);
-
-  if ( dm->dmSize <= SIZEOF_DEVMODEA_400 )
-    return dmw; // we're done with 0x400 fields
-
-  COPYN(dmPanningWidth);
-  COPYN(dmPanningHeight);
-
-  return dmw;
-
-#undef COPYN
-#undef COPYS
-}
-
-/*
- * @unimplemented
- */
-HENHMETAFILE
-STDCALL
-GdiCreateLocalEnhMetaFile(HENHMETAFILE hmo)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-METAFILEPICT *
-STDCALL
-GdiCreateLocalMetaFilePict(HENHMETAFILE hmo)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-
-/*
- * @unimplemented
- */
-HANDLE 
-STDCALL
-GdiGetSpoolFileHandle(
-       LPWSTR          pwszPrinterName,
-       LPDEVMODEW      pDevmode,
-       LPWSTR          pwszDocName)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-GdiDeleteSpoolFileHandle(
-       HANDLE  SpoolFileHandle)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-DWORD 
-STDCALL
-GdiGetPageCount(
-       HANDLE  SpoolFileHandle)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-HDC
-STDCALL
-GdiGetDC(
-       HANDLE  SpoolFileHandle)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-HANDLE 
-STDCALL
-GdiGetPageHandle(
-       HANDLE  SpoolFileHandle,
-       DWORD   Page,
-       LPDWORD pdwPageType)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-GdiStartDocEMF(
-       HANDLE          SpoolFileHandle,
-       DOCINFOW        *pDocInfo)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-GdiStartPageEMF(
-       HANDLE  SpoolFileHandle)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-GdiPlayPageEMF(
-       HANDLE  SpoolFileHandle,
-       HANDLE  hemf,
-       RECT    *prectDocument,
-       RECT    *prectBorder,
-       RECT    *prectClip)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-GdiEndPageEMF(
-       HANDLE  SpoolFileHandle,
-       DWORD   dwOptimization)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-GdiEndDocEMF(
-       HANDLE  SpoolFileHandle)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-GdiGetDevmodeForPage(
-       HANDLE          SpoolFileHandle,
-       DWORD           dwPageNumber,
-       PDEVMODEW       *pCurrDM,
-       PDEVMODEW       *pLastDM)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-/*
- * @unimplemented
- */
-BOOL
-STDCALL
-GdiResetDCEMF(
-       HANDLE          SpoolFileHandle,
-       PDEVMODEW       pCurrDM)
-{
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
-}
-
-
-HBITMAP 
-STDCALL 
-CreateDIBitmap(HDC
-       hDc, const BITMAPINFOHEADER *Header,
-       DWORD Init, LPCVOID Bits, const BITMAPINFO *Data,
-       UINT ColorUse)
-{
-       /* FIMXE we need do more thing in user mode */
-       return NtGdiCreateDIBitmap(hDc, Header, Init, Bits, Data,  ColorUse);
-}
-
-/*
- * @unimplemented
- */
-INT
-STDCALL
-CombineRgn(HRGN  hDest,
-                    HRGN  hSrc1,
-                    HRGN  hSrc2,
-                    INT  CombineMode)
-{
-    /* FIXME some part should be done in user mode */
-    return NtGdiCombineRgn(hDest, hSrc1, hSrc2, CombineMode); 
-}
-
-/*
- * @unimplemented
- */
-HBITMAP STDCALL
-CreateBitmap(
-    INT  Width,
-    INT  Height,
-    UINT  Planes,
-    UINT  BitsPixel,
-    PCVOID pUnsafeBits)
-{
-    /* FIXME some part should be done in user mode */
-    return NtGdiCreateBitmap(Width, Height, Planes, BitsPixel, (LPBYTE) pUnsafeBits);
-}
-
-
-
+GdiAddGlsRecord(HDC hdc,
+                DWORD unknown1,
+                LPCSTR unknown2,
+                LPRECT unknown3)
+{
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
+}
 
 /*
  * @unimplemented
  */
-LPWSTR STDCALL
-EngGetDriverName(HDEV hdev)
+HANDLE
+STDCALL
+GdiConvertMetaFilePict(HGLOBAL hMem)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
- * @unimplemented
- * wrong info it is not Obsolete GDI Function as http://www.osronline.com/DDKx/graphics/gdioview_20tj.htm say
+ * @implemented
  */
-BOOL STDCALL
-EngQueryEMFInfo(HDEV hdev,EMFINFO *pEMFInfo)
+DEVMODEW *
+STDCALL
+GdiConvertToDevmodeW(DEVMODEA *dm)
 {
-#if 0
-    BOOL retValue = FALSE;
-    DHPDEV Dhpdev;
+    LPDEVMODEW dmw;
 
-    if ((!hdev) && (!pEMFInfo))
+    dmw = HEAP_alloc(sizeof(DEVMODEW));
+    #define COPYS(f,len) MultiByteToWideChar ( CP_THREAD_ACP, 0, (LPSTR)dm->f, len, dmw->f, len )
+    #define COPYN(f) dmw->f = dm->f
+    COPYS(dmDeviceName, CCHDEVICENAME );
+    COPYN(dmSpecVersion);
+    COPYN(dmDriverVersion);
+    switch ( dm->dmSize )
     {
-        if ((Dhpdev = NtGdiGetDhpdev(hdev)))
-        {
-            /* FIXME check if it support or if it is pEMFInfo we got */
-            /* FIXME copy the data from Dhpdev to pEMFInfo           */
-        }
+        case SIZEOF_DEVMODEA_300:
+            dmw->dmSize = SIZEOF_DEVMODEW_300;
+            break;
+        case SIZEOF_DEVMODEA_400:
+            dmw->dmSize = SIZEOF_DEVMODEW_400;
+            break;
+        case SIZEOF_DEVMODEA_500:
+            default: /* FIXME what to do??? */
+                dmw->dmSize = SIZEOF_DEVMODEW_500;
+            break;
     }
-    return retValue;
-#else
-    return FALSE;
-#endif
-}
+    COPYN(dmDriverExtra);
+    COPYN(dmFields);
+    COPYN(dmPosition.x);
+    COPYN(dmPosition.y);
+    COPYN(dmScale);
+    COPYN(dmCopies);
+    COPYN(dmDefaultSource);
+    COPYN(dmPrintQuality);
+    COPYN(dmColor);
+    COPYN(dmDuplex);
+    COPYN(dmYResolution);
+    COPYN(dmTTOption);
+    COPYN(dmCollate);
+    COPYS(dmFormName,CCHFORMNAME);
+    COPYN(dmLogPixels);
+    COPYN(dmBitsPerPel);
+    COPYN(dmPelsWidth);
+    COPYN(dmPelsHeight);
+    COPYN(dmDisplayFlags); // aka dmNup
+    COPYN(dmDisplayFrequency);
+
+    if ( dm->dmSize <= SIZEOF_DEVMODEA_300 )
+    {
+        return dmw; // we're done with 0x300 fields
+    }
+
+    COPYN(dmICMMethod);
+    COPYN(dmICMIntent);
+    COPYN(dmMediaType);
+    COPYN(dmDitherType);
+    COPYN(dmReserved1);
+    COPYN(dmReserved2);
 
+    if ( dm->dmSize <= SIZEOF_DEVMODEA_400 )
+    {
+        return dmw; // we're done with 0x400 fields
+    }
 
+    COPYN(dmPanningWidth);
+    COPYN(dmPanningHeight);
 
+    return dmw;
+
+    #undef COPYN
+    #undef COPYS
+}
 
 /*
- * @implemented
+ * @unimplemented
  */
-BOOL 
+HENHMETAFILE
 STDCALL
-Ellipse(
-  HDC hdc,
-  int nLeftRect,
-  int nTopRect,
-  int nRightRect,
-  int nBottomRect)
+GdiCreateLocalEnhMetaFile(HENHMETAFILE hmo)
 {
-    /* FIXME some parts need be done in user mode */
-    return NtGdiEllipse(hdc,nLeftRect,nTopRect,nRightRect,nBottomRect);
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
-
 /*
  * @unimplemented
  */
-INT STDCALL 
-EngWideCharToMultiByte( UINT CodePage,
-                        LPWSTR WideCharString,
-                        INT BytesInWideCharString,
-                        LPSTR MultiByteString,
-                        INT BytesInMultiByteString)
+METAFILEPICT *
+STDCALL
+GdiCreateLocalMetaFilePict(HENHMETAFILE hmo)
 {
-  return WideCharToMultiByte(
-                         CodePage,
-                         0,
-                         WideCharString,
-                        (BytesInWideCharString/sizeof(WCHAR)), /* Bytes to (in WCHARs) */
-                         MultiByteString,
-                         BytesInMultiByteString,
-                         NULL,
-                         NULL);
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 
 /*
  * @unimplemented
  */
-BOOL STDCALL
-PATHOBJ_bEnum(PATHOBJ *ppo,PATHDATA *ppd)
+HANDLE 
+STDCALL
+GdiGetSpoolFileHandle(LPWSTR pwszPrinterName,
+                      LPDEVMODEW pDevmode,
+                      LPWSTR pwszDocName)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
  * @unimplemented
  */
-BOOL STDCALL 
-PATHOBJ_bEnumClipLines(PATHOBJ *ppo,ULONG cb,CLIPLINE *pcl)
+BOOL
+STDCALL
+GdiDeleteSpoolFileHandle(HANDLE SpoolFileHandle)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
  * @unimplemented
  */
-VOID STDCALL 
-PATHOBJ_vEnumStart(PATHOBJ *ppo)
+DWORD 
+STDCALL
+GdiGetPageCount(HANDLE SpoolFileHandle)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
  * @unimplemented
  */
-VOID STDCALL
-PATHOBJ_vEnumStartClipLines(PATHOBJ *ppo,CLIPOBJ *pco,SURFOBJ *pso,LINEATTRS *pla)
+HDC
+STDCALL
+GdiGetDC(HANDLE SpoolFileHandle)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
  * @unimplemented
  */
-VOID STDCALL
-PATHOBJ_vGetBounds(PATHOBJ *ppo,PRECTFX prectfx)
+HANDLE 
+STDCALL
+GdiGetPageHandle(HANDLE SpoolFileHandle,
+                 DWORD Page,
+                 LPDWORD pdwPageType)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
  * @unimplemented
  */
-BOOL STDCALL
-STROBJ_bEnum(STROBJ *pstro,ULONG *pc,PGLYPHPOS *ppgpos)
+BOOL
+STDCALL
+GdiStartDocEMF(HANDLE SpoolFileHandle,
+               DOCINFOW *pDocInfo)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
  * @unimplemented
  */
-BOOL STDCALL
-STROBJ_bEnumPositionsOnly(STROBJ *pstro,ULONG *pc,PGLYPHPOS *ppgpos)
+BOOL
+STDCALL
+GdiStartPageEMF(HANDLE SpoolFileHandle)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
  * @unimplemented
  */
-BOOL STDCALL
-STROBJ_bGetAdvanceWidths(STROBJ *pso,ULONG iFirst,ULONG c,POINTQF *pptqD)
+BOOL
+STDCALL
+GdiPlayPageEMF(HANDLE SpoolFileHandle,
+               HANDLE hemf,
+               RECT *prectDocument,
+               RECT *prectBorder,
+               RECT *prectClip)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
  * @unimplemented
  */
-DWORD STDCALL
-STROBJ_dwGetCodePage(STROBJ  *pstro)
+BOOL
+STDCALL
+GdiEndPageEMF(HANDLE SpoolFileHandle,
+              DWORD dwOptimization)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
  * @unimplemented
  */
-VOID STDCALL
-STROBJ_vEnumStart(STROBJ *pstro)
+BOOL
+STDCALL
+GdiEndDocEMF(HANDLE SpoolFileHandle)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
  * @unimplemented
  */
-BOOL STDCALL
-XFORMOBJ_bApplyXform(XFORMOBJ *pxo,ULONG iMode,ULONG cPoints,PVOID pvIn,PVOID pvOut)
+BOOL
+STDCALL
+GdiGetDevmodeForPage(HANDLE SpoolFileHandle,
+                     DWORD dwPageNumber,
+                     PDEVMODEW *pCurrDM,
+                     PDEVMODEW *pLastDM)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
  * @unimplemented
  */
-ULONG STDCALL
-XFORMOBJ_iGetXform(XFORMOBJ *pxo,XFORML *pxform)
+BOOL
+STDCALL
+GdiResetDCEMF(HANDLE SpoolFileHandle,
+              PDEVMODEW pCurrDM)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
+}
+
+
+HBITMAP 
+STDCALL 
+CreateDIBitmap(HDC hDc,
+               const BITMAPINFOHEADER *Header,
+               DWORD Init, LPCVOID Bits, const BITMAPINFO *Data,
+               UINT ColorUse)
+{
+    /* FIMXE we need do more thing in user mode */
+    return NtGdiCreateDIBitmap(hDc, Header, Init, Bits, Data,  ColorUse);
 }
 
 /*
  * @unimplemented
  */
-ULONG STDCALL
-XLATEOBJ_cGetPalette(XLATEOBJ *XlateObj,
-                    ULONG PalOutType,
-                    ULONG cPal,
-                    ULONG *OutPal)
+INT
+STDCALL
+CombineRgn(HRGN  hDest,
+           HRGN  hSrc1,
+           HRGN  hSrc2,
+           INT  CombineMode)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    /* FIXME some part should be done in user mode */
+    return NtGdiCombineRgn(hDest, hSrc1, hSrc2, CombineMode); 
 }
 
 /*
  * @unimplemented
  */
-HANDLE STDCALL
-XLATEOBJ_hGetColorTransform(XLATEOBJ *pxlo)
+HBITMAP STDCALL
+CreateBitmap(INT  Width,
+             INT  Height,
+             UINT  Planes,
+             UINT  BitsPixel,
+             PCVOID pUnsafeBits)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    /* FIXME some part should be done in user mode */
+    return NtGdiCreateBitmap(Width, Height, Planes, BitsPixel, (LPBYTE) pUnsafeBits);
+}
+
+/*
+ * @unimplemented
+ */
+LPWSTR STDCALL
+EngGetDriverName(HDEV hdev)
+{
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
@@ -2571,20 +2262,21 @@ XLATEOBJ_hGetColorTransform(XLATEOBJ *pxlo)
  */
 ULONG STDCALL
 XLATEOBJ_iXlate(XLATEOBJ *XlateObj,
-               ULONG Color)
+                ULONG Color)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
  * @unimplemented
  */
-ULONG * STDCALL
+ULONG *
+STDCALL
 XLATEOBJ_piVector(XLATEOBJ *XlateObj)
 {
-  return XlateObj->pulXlate;
+    return XlateObj->pulXlate;
 }
 
 /*
@@ -2592,18 +2284,16 @@ XLATEOBJ_piVector(XLATEOBJ *XlateObj)
  */
 BOOL 
 STDCALL
-GdiPlayEMF
-(
-       LPWSTR     pwszPrinterName,
-       LPDEVMODEW pDevmode,
-       LPWSTR     pwszDocName,
-       EMFPLAYPROC pfnEMFPlayFn,
-       HANDLE     hPageQuery
+GdiPlayEMF(LPWSTR pwszPrinterName,
+           LPDEVMODEW pDevmode,
+           LPWSTR pwszDocName,
+           EMFPLAYPROC pfnEMFPlayFn,
+           HANDLE hPageQuery
 )
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 
@@ -2613,16 +2303,13 @@ GdiPlayEMF
  */
 BOOL
 STDCALL
-GdiPlayPrivatePageEMF
-(
-       HANDLE  SpoolFileHandle,
-       DWORD   unknown,
-       RECT    *prectDocument
-)
+GdiPlayPrivatePageEMF(HANDLE SpoolFileHandle,
+                      DWORD unknown,
+                      RECT *prectDocument)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
-       return 0;
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    return 0;
 }
 
 /*
@@ -2630,8 +2317,8 @@ GdiPlayPrivatePageEMF
  */
 VOID STDCALL GdiInitializeLanguagePack(DWORD InitParam)
 {
-       UNIMPLEMENTED;
-       SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+    UNIMPLEMENTED;
+    SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
 }
 
 
@@ -2642,8 +2329,8 @@ INT
 STDCALL
 ExcludeClipRect(IN HDC hdc, IN INT xLeft, IN INT yTop, IN INT xRight, IN INT yBottom)
 {
-       /* FIXME some part need be done on user mode size */
-       return NtGdiExcludeClipRect(hdc, xLeft, yTop, xRight, yBottom);
+    /* FIXME some part need be done on user mode size */
+    return NtGdiExcludeClipRect(hdc, xLeft, yTop, xRight, yBottom);
 }
 
 /*
@@ -2653,19 +2340,8 @@ INT
 STDCALL
 ExtSelectClipRgn( IN HDC hdc, IN HRGN hrgn, IN INT iMode)
 {
-       /* FIXME some part need be done on user mode size */
-       return NtGdiExtSelectClipRgn(hdc,hrgn, iMode);
-}
-
-/*
- * @implemented
- */
-BOOL
-STDCALL
-FillRgn( IN HDC hdc, IN HRGN hrgn, IN HBRUSH hbrush)
-{
-       /* FIXME some part need be done on user mode size */
-       return NtGdiFillRgn( hdc, hrgn, hbrush);
+    /* FIXME some part need be done on user mode size */
+    return NtGdiExtSelectClipRgn(hdc,hrgn, iMode);
 }
 
 /*
@@ -2691,34 +2367,17 @@ GdiGradientFill(
  */
 BOOL
 STDCALL
-FrameRgn(
-    IN HDC hdc,
-    IN HRGN hrgn,
-    IN HBRUSH hbrush,
-    IN INT xWidth,
-    IN INT yHeight)
-{
-    /* FIXME some part need be done in user mode */
-    return NtGdiFrameRgn(hdc, hrgn, hbrush, xWidth, yHeight);
-}
-
-/*
- * @implemented
- */
-BOOL
-STDCALL
-GdiTransparentBlt(
-    IN HDC hdcDst,
-    IN INT xDst,
-    IN INT yDst,
-    IN INT cxDst,
-    IN INT cyDst,
-    IN HDC hdcSrc,
-    IN INT xSrc,
-    IN INT ySrc,
-    IN INT cxSrc,
-    IN INT cySrc,
-    IN COLORREF TransColor
+GdiTransparentBlt(IN HDC hdcDst,
+                  IN INT xDst,
+                  IN INT yDst,
+                  IN INT cxDst,
+                  IN INT cyDst,
+                  IN HDC hdcSrc,
+                  IN INT xSrc,
+                  IN INT ySrc,
+                  IN INT cxSrc,
+                  IN INT cySrc,
+                  IN COLORREF TransColor
 )
 {
     /* FIXME some part need be done in user mode */
@@ -2842,19 +2501,6 @@ GetCurrentPositionEx(HDC hdc,
     return  NtGdiGetCurrentPositionEx(hdc, lpPoint);
 }
 
-/*
- * @implemented
- *
- */
-HGDIOBJ 
-STDCALL
-GetCurrentObject(HDC hdc,
-                 UINT uObjectType)
-{
-    /* FIXME some part need be done in user mode */
-    return  NtGdiGetCurrentObject(hdc, uObjectType);
-}
-
 /*
  * @implemented
  *
@@ -2912,3 +2558,159 @@ GetCharABCWidths(HDC hdc,
     /* FIXME some part need be done in user mode */
     return NtGdiGetCharABCWidths(hdc, uFirstChar, uLastChar, lpabc);
 }
+
+
+/*
+ * @implemented
+ *
+ */
+DWORD 
+STDCALL
+GetFontData(HDC hdc,
+            DWORD dwTable,
+            DWORD dwOffset,
+            LPVOID lpvBuffer,
+            DWORD cbData)
+{
+    if (!lpvBuffer)
+    {
+       cbData = 0;
+    }
+    return NtGdiGetFontData(hdc, dwTable, dwOffset, lpvBuffer, cbData);
+}
+
+
+/*
+ * @implemented
+ *
+ */
+DWORD 
+STDCALL
+GetRegionData(HRGN hrgn,
+              DWORD nCount,
+              LPRGNDATA lpRgnData)
+{
+    if (!lpRgnData)
+    {
+        nCount = 0;
+    }
+
+    return NtGdiGetRegionData(hrgn,nCount,lpRgnData);
+}
+
+
+/*
+ * @implemented
+ *
+ */
+INT
+STDCALL
+GetRgnBox(HRGN hrgn,
+          LPRECT prcOut)
+{
+    /* FIXME some stuff need be done in user mode */
+    return NtGdiGetRgnBox(hrgn, prcOut);
+}
+
+
+/*
+ * @implemented
+ *
+ */
+INT
+STDCALL
+OffsetRgn( HRGN hrgn,
+          int nXOffset,
+          int nYOffset)
+{
+    /* FIXME some part are done in user mode */
+    return NtGdiOffsetRgn(hrgn,nXOffset,nYOffset);
+}
+
+
+INT
+STDCALL
+GetTextCharsetInfo(HDC hdc,
+                   LPFONTSIGNATURE lpSig,
+                   DWORD dwFlags)
+{
+    /* FIXME some part are done in user mode */
+    return NtGdiGetTextCharsetInfo(hdc, lpSig, dwFlags); 
+}
+
+
+
+INT 
+STDCALL
+IntersectClipRect(HDC hdc,
+                  int nLeftRect,
+                  int nTopRect,
+                  int nRightRect,
+                  int nBottomRect)
+{
+    /* FIXME some part are done in user mode */
+    return NtGdiIntersectClipRect(hdc, nLeftRect, nTopRect, nRightRect, nBottomRect);
+}
+
+INT 
+STDCALL
+OffsetClipRgn(HDC hdc,
+              int nXOffset,
+              int nYOffset)
+{
+    /* FIXME some part are done in user mode */
+    return NtGdiOffsetClipRgn( hdc,  nXOffset,  nYOffset);
+}
+
+
+INT
+STDCALL
+NamedEscape(HDC hdc,
+            PWCHAR pDriver,
+            INT iEsc, 
+            INT cjIn,
+            LPSTR pjIn,
+            INT cjOut,
+            LPSTR pjOut)
+{
+    /* FIXME metadc, metadc are done most in user mode, and we do not support it 
+     * Windows 2000/XP/Vista ignore the current hdc, that are being pass and always set hdc to NULL 
+     * when it calls to NtGdiExtEscape from NamedEscape
+     */
+    return NtGdiExtEscape(NULL,pDriver,wcslen(pDriver),iEsc,cjIn,pjIn,cjOut,pjOut);
+}
+
+
+BOOL
+STDCALL
+PatBlt(HDC hdc, 
+       int nXLeft, 
+       int nYLeft, 
+       int nWidth, 
+       int nHeight, 
+       DWORD dwRop)
+{
+    /* FIXME some part need be done in user mode */
+    return NtGdiPatBlt( hdc,  nXLeft,  nYLeft,  nWidth,  nHeight,  dwRop);
+}
+
+BOOL
+STDCALL
+PolyPatBlt(IN HDC hdc,
+           IN DWORD rop4,
+           IN PPOLYPATBLT pPoly,
+           IN DWORD Count,
+           IN DWORD Mode)
+{
+    /* FIXME some part need be done in user mode */
+    return NtGdiPolyPatBlt(hdc, rop4, pPoly,Count,Mode);
+}
+
+
+
+
+
+
+
+
+