Author: fireball
Date: Fri Jul 17 21:13:14 2009
New Revision: 42013
URL:
http://svn.reactos.org/svn/reactos?rev=42013&view=rev
Log:
- Get gdi32.dll to compile. It doesn't link due to absence of atan2.
- EnhMetaFile stuff is stubbed.
- SysLevel stuff substituted by critical sections.
- 16 bit stuff ifdefed away.
- #include <ddrawgdi.h> in driver.c temporary commented out.
Added:
branches/arwinss/reactos/dll/win32/gdi32/enhmeta2.c (with props)
Modified:
branches/arwinss/reactos/dll/win32/gdi32/bitmap.c
branches/arwinss/reactos/dll/win32/gdi32/brush.c
branches/arwinss/reactos/dll/win32/gdi32/dc.c
branches/arwinss/reactos/dll/win32/gdi32/driver.c
branches/arwinss/reactos/dll/win32/gdi32/gdi32.rbuild
branches/arwinss/reactos/dll/win32/gdi32/gdi32.spec
branches/arwinss/reactos/dll/win32/gdi32/gdi_main.c
branches/arwinss/reactos/dll/win32/gdi32/gdi_private.h
branches/arwinss/reactos/dll/win32/gdi32/gdiobj.c
Modified: branches/arwinss/reactos/dll/win32/gdi32/bitmap.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/gdi32…
==============================================================================
--- branches/arwinss/reactos/dll/win32/gdi32/bitmap.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/gdi32/bitmap.c [iso-8859-1] Fri Jul 17 21:13:14
2009
@@ -658,6 +658,7 @@
}
HeapFree(GetProcessHeap(), 0, dib);
bmp->dib = NULL;
+#ifndef __REACTOS__
if (bmp->segptr_bits)
{ /* free its selector array */
WORD sel = SELECTOROF(bmp->segptr_bits);
@@ -666,6 +667,7 @@
for (i = 0; i < count; i++) FreeSelector16(sel + (i << __AHSHIFT));
}
+#endif
HeapFree(GetProcessHeap(), 0, bmp->color_table);
}
return HeapFree( GetProcessHeap(), 0, bmp );
Modified: branches/arwinss/reactos/dll/win32/gdi32/brush.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/gdi32…
==============================================================================
--- branches/arwinss/reactos/dll/win32/gdi32/brush.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/gdi32/brush.c [iso-8859-1] Fri Jul 17 21:13:14
2009
@@ -53,6 +53,7 @@
BRUSH_DeleteObject /* pDeleteObject */
};
+#ifndef __REACTOS__
static HGLOBAL16 dib_copy(const BITMAPINFO *info, UINT coloruse)
{
BITMAPINFO *newInfo;
@@ -76,6 +77,7 @@
GlobalUnlock16( hmem );
return hmem;
}
+#endif
/***********************************************************************
@@ -117,7 +119,7 @@
ptr->logbrush.lbHatch = (ULONG_PTR)BITMAP_CopyBitmap( (HBITMAP)
ptr->logbrush.lbHatch );
if (!ptr->logbrush.lbHatch) goto error;
break;
-
+#ifndef __REACTOS__
case BS_DIBPATTERNPT:
ptr->logbrush.lbStyle = BS_DIBPATTERN;
ptr->logbrush.lbHatch = (ULONG_PTR)dib_copy( (BITMAPINFO *)
ptr->logbrush.lbHatch,
@@ -138,7 +140,7 @@
if (!ptr->logbrush.lbHatch) goto error;
break;
}
-
+#endif
default:
if(ptr->logbrush.lbStyle > BS_MONOPATTERN) goto error;
break;
@@ -155,8 +157,10 @@
{
if (ptr->logbrush.lbStyle == BS_PATTERN)
DeleteObject( (HGDIOBJ)ptr->logbrush.lbHatch );
+#ifndef __REACTOS__
else if (ptr->logbrush.lbStyle == BS_DIBPATTERN)
GlobalFree16( (HGLOBAL16)ptr->logbrush.lbHatch );
+#endif
}
HeapFree( GetProcessHeap(), 0, ptr );
return 0;
@@ -423,7 +427,9 @@
DeleteObject( (HGDIOBJ)brush->logbrush.lbHatch );
break;
case BS_DIBPATTERN:
+#ifndef __REACTOS__
GlobalFree16( (HGLOBAL16)brush->logbrush.lbHatch );
+#endif
break;
}
return HeapFree( GetProcessHeap(), 0, brush );
Modified: branches/arwinss/reactos/dll/win32/gdi32/dc.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/gdi32…
==============================================================================
--- branches/arwinss/reactos/dll/win32/gdi32/dc.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/gdi32/dc.c [iso-8859-1] Fri Jul 17 21:13:14 2009
@@ -1415,6 +1415,7 @@
/* relay function to call the 16-bit DC hook proc */
+#ifndef __REACTOS__
static BOOL WINAPI call_dc_hook16( HDC hdc, WORD code, DWORD_PTR data, LPARAM lParam )
{
WORD args[6];
@@ -1470,6 +1471,7 @@
release_dc_ptr( dc );
return ret;
}
+#endif
/***********************************************************************
Modified: branches/arwinss/reactos/dll/win32/gdi32/driver.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/gdi32…
==============================================================================
--- branches/arwinss/reactos/dll/win32/gdi32/driver.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/gdi32/driver.c [iso-8859-1] Fri Jul 17 21:13:14
2009
@@ -28,7 +28,7 @@
#include "windef.h"
#include "winbase.h"
#include "winreg.h"
-#include "ddrawgdi.h"
+//#include "ddrawgdi.h"
#include "gdi_private.h"
#include "wine/unicode.h"
Added: branches/arwinss/reactos/dll/win32/gdi32/enhmeta2.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/gdi32…
==============================================================================
--- branches/arwinss/reactos/dll/win32/gdi32/enhmeta2.c (added)
+++ branches/arwinss/reactos/dll/win32/gdi32/enhmeta2.c [iso-8859-1] Fri Jul 17 21:13:14
2009
@@ -1,0 +1,100 @@
+#include "config.h"
+#include "wine/port.h"
+
+#include <stdarg.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include "windef.h"
+#include "winbase.h"
+#include "wingdi.h"
+#include "winnls.h"
+#include "winerror.h"
+#include "gdi_private.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(enhmetafile);
+
+/**********************************************************************
+ * CreateEnhMetaFileW (GDI32.@)
+ */
+HDC WINAPI CreateEnhMetaFileW(
+ HDC hdc, /* [in] optional reference DC */
+ LPCWSTR filename, /* [in] optional filename for disk metafiles */
+ const RECT* rect, /* [in] optional bounding rectangle */
+ LPCWSTR description /* [in] optional description */
+ )
+{
+ UNIMPLEMENTED;
+ return 0;
+}
+
+/**********************************************************************
+ * CreateEnhMetaFileA (GDI32.@)
+ */
+HDC WINAPI CreateEnhMetaFileA(
+ HDC hdc, /* [in] optional reference DC */
+ LPCSTR filename, /* [in] optional filename for disk metafiles */
+ const RECT *rect, /* [in] optional bounding rectangle */
+ LPCSTR description /* [in] optional description */
+ )
+{
+ UNIMPLEMENTED;
+ return 0;
+}
+
+/**********************************************************************
+ * CreateMetaFileA (GDI32.@)
+ *
+ * See CreateMetaFileW.
+ */
+HDC WINAPI CreateMetaFileA(LPCSTR filename)
+{
+ UNIMPLEMENTED;
+ return 0;
+}
+
+/**********************************************************************
+ * CreateMetaFileW (GDI32.@)
+ *
+ * Create a new DC and associate it with a metafile. Pass a filename
+ * to create a disk-based metafile, NULL to create a memory metafile.
+ *
+ * PARAMS
+ * filename [I] Filename of disk metafile
+ *
+ * RETURNS
+ * A handle to the metafile DC if successful, NULL on failure.
+ */
+HDC WINAPI CreateMetaFileW( LPCWSTR filename )
+{
+ UNIMPLEMENTED;
+ return 0;
+}
+
+/******************************************************************
+ * CloseEnhMetaFile (GDI32.@)
+ */
+HENHMETAFILE WINAPI CloseEnhMetaFile(HDC hdc) /* [in] metafile DC */
+{
+ UNIMPLEMENTED;
+ return NULL;
+}
+
+/******************************************************************
+ * CloseMetaFile (GDI32.@)
+ *
+ * Stop recording graphics operations in metafile associated with
+ * hdc and retrieve metafile.
+ *
+ * PARAMS
+ * hdc [I] Metafile DC to close
+ *
+ * RETURNS
+ * Handle of newly created metafile on success, NULL on failure.
+ */
+HMETAFILE WINAPI CloseMetaFile(HDC hdc)
+{
+ UNIMPLEMENTED;
+ return NULL;
+}
Propchange: branches/arwinss/reactos/dll/win32/gdi32/enhmeta2.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: branches/arwinss/reactos/dll/win32/gdi32/gdi32.rbuild
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/gdi32…
==============================================================================
--- branches/arwinss/reactos/dll/win32/gdi32/gdi32.rbuild [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/gdi32/gdi32.rbuild [iso-8859-1] Fri Jul 17 21:13:14
2009
@@ -1,14 +1,17 @@
-<module name="gdi32" type="win32dll"
baseaddress="${BASEADDRESS_GDI32}" installbase="system32"
installname="gdi32.dll" unicode="yes">
+<module name="gdi32" type="win32dll"
baseaddress="${BASEADDRESS_GDI32}" installbase="system32"
installname="gdi32.dll" unicode="yes"
allowwarnings="true">
<importlibrary definition="gdi32.spec" />
<include base="gdi32">include</include>
+ <include base="ReactOS">include/reactos/wine</include>
<define name="_DISABLE_TIDENTS" />
<define name="WINVER">0x0600</define>
<define name="_WIN32_WINNT">0x0501</define>
<define name="LANGPACK" />
+ <define name="__WINESRC__" />
+ <library>wine</library>
<library>ntdll</library>
<library>user32</library>
<library>kernel32</library>
- <!--library>advapi32</library-->
+ <library>advapi32</library>
<library>win32ksys</library>
<library>pseh</library>
<library>dxguid</library>
@@ -22,6 +25,7 @@
<file>dib.c</file>
<file>driver.c</file>
<file>enhmetafile.c</file>
+ <file>enhmeta2.c</file>
<file>font.c</file>
<file>freetype.c</file>
<file>gdi_main.c</file>
Modified: branches/arwinss/reactos/dll/win32/gdi32/gdi32.spec
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/gdi32…
==============================================================================
--- branches/arwinss/reactos/dll/win32/gdi32/gdi32.spec [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/gdi32/gdi32.spec [iso-8859-1] Fri Jul 17 21:13:14
2009
@@ -1,10 +1,3 @@
-# ordinal exports
-100 stdcall @(long long str str str) GDI_CallDevInstall16
-101 stdcall @(long str str ptr) GDI_CallExtDeviceModePropSheet16
-102 stdcall @(long ptr str str ptr str long) GDI_CallExtDeviceMode16
-103 stdcall @(long str ptr ptr) GDI_CallAdvancedSetupDialog16
-104 stdcall @(str str long ptr ptr) GDI_CallDeviceCapabilities16
-
@ stdcall AbortDoc(long)
@ stdcall AbortPath(long)
@ stdcall AddFontMemResourceEx(ptr long ptr ptr)
@@ -174,7 +167,6 @@
# @ stub GdiDrawStream
# @ stub GdiEndDocEMF
# @ stub GdiEndPageEMF
-@ stdcall GdiEntry13()
# @ stub GdiFixUpHandle
@ stdcall GdiFlush()
# @ stub GdiFullscreenControl
@@ -513,15 +505,10 @@
################################################################
# Wine extensions: Win16 functions that are needed by other dlls
#
-@ stdcall CloseJob16(long)
-@ stdcall DrvGetPrinterData16(str str ptr ptr long ptr)
-@ stdcall DrvSetPrinterData16(str str long ptr long)
@ stdcall GetDCHook(long ptr)
-@ stdcall OpenJob16(str str long)
@ stdcall SelectVisRgn(long long)
@ stdcall SetDCHook(long ptr long)
@ stdcall SetHookFlags(long long)
-@ stdcall WriteSpool16(long ptr long)
################################################################
# Wine internal extensions
Modified: branches/arwinss/reactos/dll/win32/gdi32/gdi_main.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/gdi32…
==============================================================================
--- branches/arwinss/reactos/dll/win32/gdi32/gdi_main.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/gdi32/gdi_main.c [iso-8859-1] Fri Jul 17 21:13:14
2009
@@ -32,6 +32,5 @@
{
if (reason != DLL_PROCESS_ATTACH) return TRUE;
DisableThreadLibraryCalls(hinstDLL);
- LoadLibrary16( "gdi.exe" );
return GDI_Init();
}
Modified: branches/arwinss/reactos/dll/win32/gdi32/gdi_private.h
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/gdi32…
==============================================================================
--- branches/arwinss/reactos/dll/win32/gdi32/gdi_private.h [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/gdi32/gdi_private.h [iso-8859-1] Fri Jul 17
21:13:14 2009
@@ -303,7 +303,9 @@
INT MapMode;
INT GraphicsMode; /* Graphics mode */
ABORTPROC pAbortProc; /* AbortProc for Printing */
+#ifndef __REACTOS__
ABORTPROC16 pAbortProc16;
+#endif
INT CursPosX; /* Current position */
INT CursPosY;
INT ArcDirection;
Modified: branches/arwinss/reactos/dll/win32/gdi32/gdiobj.c
URL:
http://svn.reactos.org/svn/reactos/branches/arwinss/reactos/dll/win32/gdi32…
==============================================================================
--- branches/arwinss/reactos/dll/win32/gdi32/gdiobj.c [iso-8859-1] (original)
+++ branches/arwinss/reactos/dll/win32/gdi32/gdiobj.c [iso-8859-1] Fri Jul 17 21:13:14
2009
@@ -66,14 +66,7 @@
static HGDIOBJ stock_objects[NB_STOCK_OBJECTS];
-static SYSLEVEL GDI_level;
-static CRITICAL_SECTION_DEBUG critsect_debug =
-{
- 0, 0, &GDI_level.crst,
- { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
- 0, 0, { (DWORD_PTR)(__FILE__ ": GDI_level") }
-};
-static SYSLEVEL GDI_level = { { &critsect_debug, -1, 0, 0, 0, 0 }, 3 };
+static CRITICAL_SECTION GDI_critsect;
/****************************************************************************
@@ -574,6 +567,9 @@
const struct DefaultFontInfo* deffonts;
int i;
+ /* Initialize GDI critical section */
+ InitializeCriticalSection(&GDI_critsect);
+
WineEngInit();
/* create stock objects */
@@ -648,18 +644,18 @@
obj->funcs = funcs;
obj->hdcs = NULL;
- _EnterSysLevel( &GDI_level );
+ EnterCriticalSection( &GDI_critsect );
for (i = next_large_handle + 1; i < MAX_LARGE_HANDLES; i++)
if (!large_handles[i]) goto found;
for (i = 0; i <= next_large_handle; i++)
if (!large_handles[i]) goto found;
- _LeaveSysLevel( &GDI_level );
+ LeaveCriticalSection( &GDI_critsect );
return 0;
found:
large_handles[i] = obj;
next_large_handle = i;
- _LeaveSysLevel( &GDI_level );
+ LeaveCriticalSection( &GDI_critsect );
return (HGDIOBJ)(ULONG_PTR)((i + FIRST_LARGE_HANDLE) << 2);
}
@@ -677,10 +673,10 @@
i = ((ULONG_PTR)handle >> 2) - FIRST_LARGE_HANDLE;
if (i >= 0 && i < MAX_LARGE_HANDLES)
{
- _EnterSysLevel( &GDI_level );
+ EnterCriticalSection( &GDI_critsect );
object = large_handles[i];
large_handles[i] = NULL;
- _LeaveSysLevel( &GDI_level );
+ LeaveCriticalSection( &GDI_critsect );
}
if (object)
{
@@ -703,7 +699,7 @@
GDIOBJHDR *ptr = NULL;
int i;
- _EnterSysLevel( &GDI_level );
+ EnterCriticalSection( &GDI_critsect );
i = ((UINT_PTR)handle >> 2) - FIRST_LARGE_HANDLE;
if (i >= 0 && i < MAX_LARGE_HANDLES)
@@ -714,10 +710,10 @@
if (!ptr)
{
- _LeaveSysLevel( &GDI_level );
+ LeaveCriticalSection( &GDI_critsect );
WARN( "Invalid handle %p\n", handle );
}
- else TRACE("(%p): enter %d\n", handle, GDI_level.crst.RecursionCount);
+ //else TRACE("(%p): enter %d\n", handle, GDI_level.crst.RecursionCount);
return ptr;
}
@@ -729,8 +725,8 @@
*/
void GDI_ReleaseObj( HGDIOBJ handle )
{
- TRACE("(%p): leave %d\n", handle, GDI_level.crst.RecursionCount);
- _LeaveSysLevel( &GDI_level );
+ //TRACE("(%p): leave %d\n", handle, GDI_level.crst.RecursionCount);
+ LeaveCriticalSection( &GDI_critsect );
}
@@ -739,7 +735,7 @@
*/
void GDI_CheckNotLock(void)
{
- _CheckNotSysLevel( &GDI_level );
+ //_CheckNotSysLevel( &GDI_level );
}