Author: jimtabor
Date: Mon Aug 24 08:06:05 2009
New Revision: 42901
URL:
http://svn.reactos.org/svn/reactos?rev=42901&view=rev
Log:
- Gdi32: Update metafile structure.
Modified:
trunk/reactos/dll/win32/gdi32/include/gdi32p.h
trunk/reactos/dll/win32/gdi32/objects/font.c
trunk/reactos/dll/win32/gdi32/objects/metafile.c
Modified: trunk/reactos/dll/win32/gdi32/include/gdi32p.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/include/gd…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/include/gdi32p.h [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdi32/include/gdi32p.h [iso-8859-1] Mon Aug 24 08:06:05 2009
@@ -42,32 +42,42 @@
/* TYPES *********************************************************************/
// Based on wmfapi.h and Wine.
-typedef struct tagMETAFILEDC {
- PVOID pvMetaBuffer;
- HANDLE hFile;
- DWORD Size;
- METAHEADER mh;
- UINT handles_size, cur_handles;
- HGDIOBJ *handles;
-
- // more DC object stuff.
- HGDIOBJ Pen;
- HGDIOBJ Brush;
- HGDIOBJ Palette;
- HGDIOBJ Font;
-
- WCHAR Filename[MAX_PATH+2];
- // Add more later.
+typedef struct tagMETAFILEDC
+{
+ PVOID pvMetaBuffer;
+ HANDLE hFile;
+ DWORD Size;
+ DWORD dwWritten;
+ METAHEADER mh;
+ WORD reserved;
+ HLOCAL MFObjList;
+ HPEN hPen;
+ HBRUSH hBrush;
+ HDC hDc;
+ HGDIOBJ hMetaDc;
+ HPALETTE hPalette;
+ HFONT hFont;
+ HBITMAP hBitmap;
+ HRGN hRegion;
+ HGDIOBJ hMetafile;
+ HGDIOBJ hMemDc;
+ HPEN hExtPen;
+ HGDIOBJ hEnhMetaDc;
+ HGDIOBJ hEnhMetaFile;
+ HCOLORSPACE hColorSpace;
+ WCHAR Filename[MAX_PATH+2];
} METAFILEDC,*PMETAFILEDC;
// Metafile Entry handle
-typedef struct tagMF_ENTRY {
+typedef struct tagMF_ENTRY
+{
LIST_ENTRY List;
HGDIOBJ hmDC; // Handle return from NtGdiCreateClientObj.
PMETAFILEDC pmfDC;
} MF_ENTRY, *PMF_ENTRY;
-typedef struct tagENHMETAFILE {
+typedef struct tagENHMETAFILE
+{
PVOID pvMetaBuffer;
HANDLE hFile; /* Handle for disk based MetaFile */
DWORD Size;
Modified: trunk/reactos/dll/win32/gdi32/objects/font.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/fo…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/font.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdi32/objects/font.c [iso-8859-1] Mon Aug 24 08:06:05 2009
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/gdi32/object/font.c
Modified: trunk/reactos/dll/win32/gdi32/objects/metafile.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/me…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/metafile.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/gdi32/objects/metafile.c [iso-8859-1] Mon Aug 24 08:06:05
2009
@@ -143,13 +143,18 @@
{
HANDLE hFile;
HDC hmDC;
- DWORD dwWritten;
PMETAFILEDC pmfDC = LocalAlloc(LMEM_ZEROINIT, sizeof(METAFILEDC));
if (!pmfDC) return NULL;
pmfDC->mh.mtHeaderSize = sizeof(METAHEADER) / sizeof(WORD);
pmfDC->mh.mtVersion = 0x0300;
pmfDC->mh.mtSize = pmfDC->mh.mtHeaderSize;
+
+ pmfDC->hPen = GetStockObject(BLACK_PEN);
+ pmfDC->hBrush = GetStockObject(WHITE_BRUSH);
+ pmfDC->hFont = GetStockObject(DEVICE_DEFAULT_FONT);
+ pmfDC->hBitmap = GetStockObject(DEFAULT_BITMAP);
+ pmfDC->hPalette = GetStockObject(DEFAULT_PALETTE);
if (lpszFile) /* disk based metafile */
{
@@ -160,7 +165,6 @@
(LPTSTR) &pmfDC->Filename,
(LPTSTR*) &lpszFile))
{
-// MFDRV_DeleteDC( dc->physDev );
LocalFree(pmfDC);
return NULL;
}
@@ -168,14 +172,12 @@
if ((hFile = CreateFileW(pmfDC->Filename, GENERIC_WRITE, 0, NULL,
CREATE_ALWAYS, 0, 0)) == INVALID_HANDLE_VALUE)
{
-// MFDRV_DeleteDC( dc->physDev );
LocalFree(pmfDC);
return NULL;
}
- if (!WriteFile( hFile, &pmfDC->mh, sizeof(pmfDC->mh), &dwWritten, NULL
))
- {
-// MFDRV_DeleteDC( dc->physDev );
+ if (!WriteFile( hFile, &pmfDC->mh, sizeof(pmfDC->mh),
&pmfDC->dwWritten, NULL ))
+ {
LocalFree(pmfDC);
return NULL;
}