Commit 08f677ca authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

win32u: Move ntgdi implementation from gdi32.

parent 7757f4ee
EXTRADEFS = -D_GDI32_
MODULE = gdi32.dll
UNIXLIB = gdi32.so
IMPORTLIB = gdi32
IMPORTS = advapi32
EXTRAINCL = $(FREETYPE_CFLAGS) $(FONTCONFIG_CFLAGS)
EXTRALIBS = $(CARBON_LIBS) $(APPKIT_LIBS) $(PTHREAD_LIBS) -lm
IMPORTS = advapi32 win32u
DELAYIMPORTS = setupapi
C_SRCS = \
bitblt.c \
bitmap.c \
brush.c \
clipping.c \
dc.c \
dib.c \
dibdrv/bitblt.c \
dibdrv/dc.c \
dibdrv/graphics.c \
dibdrv/objects.c \
dibdrv/opengl.c \
dibdrv/primitives.c \
driver.c \
emfdc.c \
emfdrv.c \
enhmetafile.c \
font.c \
freetype.c \
gdidc.c \
gdiobj.c \
icm.c \
mapping.c \
metadc.c \
metafile.c \
objects.c \
opengl.c \
opentype.c \
painting.c \
palette.c \
path.c \
pen.c \
printdrv.c \
region.c \
text.c \
uniscribe/bidi.c \
uniscribe/bracket.c \
......@@ -53,11 +25,7 @@ C_SRCS = \
uniscribe/opentype.c \
uniscribe/shape.c \
uniscribe/shaping.c \
uniscribe/usp10.c \
vertical.c \
vulkan.c \
wrappers.c
uniscribe/usp10.c
RC_SRCS = gdi32.rc
font_EXTRADEFS = -DWINE_FONT_DIR=\"`${MAKEDEP} -R ${datadir}/wine ${fontdir}`\"
RC_SRCS = gdi32.rc
......@@ -30,7 +30,6 @@
#include "initguid.h"
#include "devguid.h"
#include "setupapi.h"
#include "win32u_private.h"
#include "wine/rbtree.h"
#include "wine/debug.h"
......@@ -143,7 +142,6 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, LPVOID reserved )
DisableThreadLibraryCalls( inst );
gdi32_module = inst;
wrappers_init();
return TRUE;
}
......
MODULE = win32u.dll
UNIXLIB = win32u.so
IMPORTLIB = win32u
EXTRAINCL = $(FREETYPE_CFLAGS) $(FONTCONFIG_CFLAGS)
EXTRALIBS = $(CARBON_LIBS) $(APPKIT_LIBS) $(PTHREAD_LIBS) -lm
IMPORTS = ntdll winecrt0
EXTRADLLFLAGS = -nodefaultlibs -Wb,--syscall-table,1
C_SRCS = \
bitblt.c \
bitmap.c \
brush.c \
clipping.c \
dc.c \
dib.c \
dibdrv/bitblt.c \
dibdrv/dc.c \
dibdrv/graphics.c \
dibdrv/objects.c \
dibdrv/opengl.c \
dibdrv/primitives.c \
driver.c \
emfdrv.c \
font.c \
freetype.c \
gdiobj.c \
main.c \
syscall.c
mapping.c \
opentype.c \
painting.c \
palette.c \
path.c \
pen.c \
printdrv.c \
region.c \
syscall.c \
vertical.c \
vulkan.c \
wrappers.c
font_EXTRADEFS = -DWINE_FONT_DIR=\"`${MAKEDEP} -R ${datadir}/wine ${fontdir}`\"
......@@ -127,8 +127,6 @@
#include "wine/debug.h"
#include "wine/list.h"
#include "resource.h"
#ifdef HAVE_FREETYPE
WINE_DEFAULT_DEBUG_CHANNEL(font);
......
......@@ -1130,7 +1130,6 @@ static struct unix_funcs unix_funcs =
NtGdiFillRgn,
NtGdiFlattenPath,
NtGdiFontIsLinked,
NtGdiFlush,
NtGdiFrameRgn,
NtGdiGetAndSetDCDword,
NtGdiGetAppClipBox,
......@@ -1251,7 +1250,7 @@ static struct unix_funcs unix_funcs =
__wine_set_visible_region,
};
NTSTATUS initialize( void *args )
NTSTATUS gdi_init(void)
{
pthread_mutexattr_t attr;
unsigned int dpi;
......@@ -1267,12 +1266,12 @@ NTSTATUS initialize( void *args )
dpi = font_init();
init_stock_objects( dpi );
user_callbacks = *(const struct user_callbacks **)args;
*(const struct unix_funcs **)args = &unix_funcs;
return 0;
}
const unixlib_entry_t __wine_unix_call_funcs[] =
NTSTATUS callbacks_init( void *args )
{
initialize
};
user_callbacks = *(const struct user_callbacks **)args;
*(const struct unix_funcs **)args = &unix_funcs;
return 0;
}
......@@ -24,8 +24,8 @@
#define WIN32_NO_STATUS
#include "windef.h"
#include "winbase.h"
#include "winnt.h"
#include "winternl.h"
#include "ntgdi.h"
#include "win32u_private.h"
#include "wine/unixlib.h"
extern void *__wine_syscall_dispatcher DECLSPEC_HIDDEN;
......@@ -57,6 +57,7 @@ BOOL WINAPI DllMain( HINSTANCE inst, DWORD reason, void *reserved )
&win32u_handle, sizeof(win32u_handle), NULL ))
{
__wine_unix_call( win32u_handle, 0, &__wine_syscall_dispatcher );
wrappers_init( win32u_handle );
}
break;
}
......
......@@ -28,18 +28,10 @@
#define WIN32_NO_STATUS
#include "windef.h"
#include "winnt.h"
#include "winternl.h"
#include "ntgdi_private.h"
#include "wine/unixlib.h"
/***********************************************************************
* NtGdiFlush (win32u.@)
*/
BOOL WINAPI NtGdiFlush(void)
{
return TRUE;
}
static void * const syscalls[] =
{
NtGdiFlush,
......@@ -57,7 +49,13 @@ static SYSTEM_SERVICE_TABLE syscall_table =
static NTSTATUS init( void *dispatcher )
{
return ntdll_init_syscalls( 1, &syscall_table, dispatcher );
NTSTATUS status;
if ((status = ntdll_init_syscalls( 1, &syscall_table, dispatcher ))) return status;
return gdi_init();
}
unixlib_entry_t __wine_unix_call_funcs[] = { init };
unixlib_entry_t __wine_unix_call_funcs[] =
{
init,
callbacks_init,
};
......@@ -21,8 +21,9 @@
#ifndef __WINE_WIN32U_PRIVATE
#define __WINE_WIN32U_PRIVATE
#include "wine/gdi_driver.h"
#include "winuser.h"
#include "wine/gdi_driver.h"
#include "wine/unixlib.h"
struct user_callbacks
{
......@@ -129,7 +130,6 @@ struct unix_funcs
BOOL (WINAPI *pNtGdiFillRgn)( HDC hdc, HRGN hrgn, HBRUSH hbrush );
BOOL (WINAPI *pNtGdiFlattenPath)( HDC hdc );
BOOL (WINAPI *pNtGdiFontIsLinked)( HDC hdc );
BOOL (WINAPI *pNtGdiFlush)(void);
BOOL (WINAPI *pNtGdiFrameRgn)( HDC hdc, HRGN hrgn, HBRUSH brush, INT width, INT height );
BOOL (WINAPI *pNtGdiGetAndSetDCDword)( HDC hdc, UINT method, DWORD value, DWORD *result );
INT (WINAPI *pNtGdiGetAppClipBox)( HDC hdc, RECT *rect );
......@@ -296,7 +296,9 @@ struct unix_funcs
UINT WINAPI GDIRealizePalette( HDC hdc );
HPALETTE WINAPI GDISelectPalette( HDC hdc, HPALETTE hpal, WORD wBkg );
BOOL wrappers_init(void) DECLSPEC_HIDDEN;
extern void wrappers_init( unixlib_handle_t handle ) DECLSPEC_HIDDEN;
extern NTSTATUS gdi_init(void) DECLSPEC_HIDDEN;
extern NTSTATUS callbacks_init( void *args ) DECLSPEC_HIDDEN;
static inline WCHAR *win32u_wcsrchr( const WCHAR *str, WCHAR ch )
......
......@@ -18,7 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "gdi_private.h"
#include <stdarg.h>
#include "windef.h"
#include "winbase.h"
#include "ntgdi.h"
#include "win32u_private.h"
#include "wine/unixlib.h"
#include "wine/debug.h"
......@@ -314,11 +317,6 @@ BOOL WINAPI NtGdiFontIsLinked( HDC hdc )
return unix_funcs->pNtGdiFontIsLinked( hdc );
}
BOOL WINAPI NtGdiFlush(void)
{
return unix_funcs->pNtGdiFlush();
}
BOOL WINAPI NtGdiFrameRgn( HDC hdc, HRGN hrgn, HBRUSH brush, INT width, INT height )
{
return unix_funcs->pNtGdiFrameRgn( hdc, hrgn, brush, width, height );
......@@ -1022,10 +1020,12 @@ struct opengl_funcs * CDECL __wine_get_wgl_driver( HDC hdc, UINT version )
void CDECL __wine_set_display_driver( HMODULE module )
{
void *wine_get_gdi_driver;
ANSI_STRING name_str;
if (!module) return;
wine_get_gdi_driver = (void *)GetProcAddress( module, "wine_get_gdi_driver" );
RtlInitAnsiString( &name_str, "wine_get_gdi_driver" );
LdrGetProcedureAddress( module, &name_str, 0, &wine_get_gdi_driver );
if (!wine_get_gdi_driver)
{
ERR( "Could not create graphics driver %p\n", module );
......@@ -1150,16 +1150,8 @@ static const struct user_callbacks user_callbacks =
call_WindowFromDC,
};
BOOL wrappers_init(void)
extern void wrappers_init( unixlib_handle_t handle )
{
unixlib_handle_t handle;
const void *args = &user_callbacks;
if (NtQueryVirtualMemory( GetCurrentProcess(), gdi32_module, MemoryWineUnixFuncs,
&handle, sizeof(handle), NULL ))
return FALSE;
if (__wine_unix_call( handle, 0, &args )) return FALSE;
unix_funcs = args;
return TRUE;
if (!__wine_unix_call( handle, 1, &args )) unix_funcs = args;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment