Commit da0db2eb authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

winspool: Build with msvcrt.

parent 8ecd220c
...@@ -16881,7 +16881,6 @@ ac_save_CFLAGS="$CFLAGS" ...@@ -16881,7 +16881,6 @@ ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $BUILTINFLAG" CFLAGS="$CFLAGS $BUILTINFLAG"
for ac_func in \ for ac_func in \
epoll_create \ epoll_create \
fork \
fstatfs \ fstatfs \
futimens \ futimens \
futimes \ futimes \
......
...@@ -1941,7 +1941,6 @@ ac_save_CFLAGS="$CFLAGS" ...@@ -1941,7 +1941,6 @@ ac_save_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $BUILTINFLAG" CFLAGS="$CFLAGS $BUILTINFLAG"
AC_CHECK_FUNCS(\ AC_CHECK_FUNCS(\
epoll_create \ epoll_create \
fork \
fstatfs \ fstatfs \
futimens \ futimens \
futimes \ futimes \
......
EXTRADEFS = -D_SPOOL32_ EXTRADEFS = -D_SPOOL32_
MODULE = winspool.drv MODULE = winspool.drv
UNIXLIB = winspool.so
IMPORTLIB = winspool IMPORTLIB = winspool
IMPORTS = user32 gdi32 advapi32 IMPORTS = user32 gdi32 advapi32
EXTRAINCL = $(CUPS_CFLAGS) EXTRAINCL = $(CUPS_CFLAGS)
EXTRALIBS = $(APPLICATIONSERVICES_LIBS) EXTRALIBS = $(APPLICATIONSERVICES_LIBS)
EXTRADLLFLAGS = -mcygwin
C_SRCS = \ C_SRCS = \
cups.c \ cups.c \
info.c \ info.c \
......
...@@ -17,8 +17,11 @@ ...@@ -17,8 +17,11 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#if 0
#pragma makedep unix
#endif
#include "config.h" #include "config.h"
#include "wine/port.h"
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>
...@@ -26,12 +29,11 @@ ...@@ -26,12 +29,11 @@
#include <stdlib.h> #include <stdlib.h>
#include <sys/types.h> #include <sys/types.h>
#include <unistd.h> #include <unistd.h>
#include <dlfcn.h>
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#include <signal.h> #include <signal.h>
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h> #include <sys/wait.h>
#endif
#ifdef HAVE_CUPS_CUPS_H #ifdef HAVE_CUPS_CUPS_H
#include <cups/cups.h> #include <cups/cups.h>
#endif #endif
...@@ -108,6 +110,7 @@ ...@@ -108,6 +110,7 @@
#include "ddk/winsplp.h" #include "ddk/winsplp.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unicode.h" #include "wine/unicode.h"
#include "wine/unixlib.h"
#include "wspool.h" #include "wspool.h"
...@@ -116,21 +119,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(winspool); ...@@ -116,21 +119,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(winspool);
static const WCHAR CUPS_Port[] = { 'C','U','P','S',':',0 }; static const WCHAR CUPS_Port[] = { 'C','U','P','S',':',0 };
static const WCHAR LPR_Port[] = { 'L','P','R',':',0 }; static const WCHAR LPR_Port[] = { 'L','P','R',':',0 };
/* Temporary helpers until switch to unixlib */
#include "winnls.h"
#include "wine/heap.h"
#define malloc( sz ) heap_alloc( sz )
#define free( ptr ) heap_free( ptr )
static DWORD ntdll_umbstowcs( const char *src, DWORD srclen, WCHAR *dst, DWORD dstlen )
{
return MultiByteToWideChar( CP_UNIXCP, 0, src, srclen, dst, dstlen );
}
static int ntdll_wcstoumbs( const WCHAR *src, DWORD srclen, char *dst, DWORD dstlen, BOOL strict )
{
/* FIXME: strict */
return WideCharToMultiByte( CP_UNIXCP, 0, src, srclen, dst, dstlen, NULL, NULL );
}
#ifdef SONAME_LIBCUPS #ifdef SONAME_LIBCUPS
static void *libcups_handle; static void *libcups_handle;
...@@ -159,7 +147,7 @@ static const char * (*pcupsLastErrorString)(void); ...@@ -159,7 +147,7 @@ static const char * (*pcupsLastErrorString)(void);
#endif /* SONAME_LIBCUPS */ #endif /* SONAME_LIBCUPS */
NTSTATUS unix_process_attach( void *arg ) static NTSTATUS process_attach( void *args )
{ {
#ifdef SONAME_LIBCUPS #ifdef SONAME_LIBCUPS
libcups_handle = dlopen( SONAME_LIBCUPS, RTLD_NOW ); libcups_handle = dlopen( SONAME_LIBCUPS, RTLD_NOW );
...@@ -347,7 +335,7 @@ static int get_cups_default_options( const char *printer, int num_options, cups_ ...@@ -347,7 +335,7 @@ static int get_cups_default_options( const char *printer, int num_options, cups_
} }
#endif /* SONAME_LIBCUPS */ #endif /* SONAME_LIBCUPS */
NTSTATUS unix_enum_printers( void *args ) static NTSTATUS enum_printers( void *args )
{ {
struct enum_printers_params *params = args; struct enum_printers_params *params = args;
#ifdef SONAME_LIBCUPS #ifdef SONAME_LIBCUPS
...@@ -417,7 +405,7 @@ NTSTATUS unix_enum_printers( void *args ) ...@@ -417,7 +405,7 @@ NTSTATUS unix_enum_printers( void *args )
#endif /* SONAME_LIBCUPS */ #endif /* SONAME_LIBCUPS */
} }
NTSTATUS unix_get_ppd( void *args ) static NTSTATUS get_ppd( void *args )
{ {
struct get_ppd_params *params = args; struct get_ppd_params *params = args;
char *unix_ppd = get_unix_file_name( params->ppd ); char *unix_ppd = get_unix_file_name( params->ppd );
...@@ -458,7 +446,7 @@ NTSTATUS unix_get_ppd( void *args ) ...@@ -458,7 +446,7 @@ NTSTATUS unix_get_ppd( void *args )
return status; return status;
} }
NTSTATUS unix_get_default_page_size( void *args ) static NTSTATUS get_default_page_size( void *args )
{ {
#ifdef HAVE_APPLICATIONSERVICES_APPLICATIONSERVICES_H #ifdef HAVE_APPLICATIONSERVICES_APPLICATIONSERVICES_H
struct get_default_page_size_params *params = args; struct get_default_page_size_params *params = args;
...@@ -504,7 +492,6 @@ end: ...@@ -504,7 +492,6 @@ end:
*/ */
static BOOL schedule_pipe( const WCHAR *cmd, const WCHAR *filename ) static BOOL schedule_pipe( const WCHAR *cmd, const WCHAR *filename )
{ {
#ifdef HAVE_FORK
char *unixname, *cmdA; char *unixname, *cmdA;
DWORD len; DWORD len;
int fds[2] = { -1, -1 }, file_fd = -1, no_read; int fds[2] = { -1, -1 }, file_fd = -1, no_read;
...@@ -580,9 +567,6 @@ end: ...@@ -580,9 +567,6 @@ end:
free( cmdA ); free( cmdA );
free( unixname ); free( unixname );
return ret; return ret;
#else
return FALSE;
#endif
} }
/***************************************************************************** /*****************************************************************************
...@@ -677,7 +661,7 @@ static BOOL schedule_cups( const WCHAR *printer_name, const WCHAR *filename, con ...@@ -677,7 +661,7 @@ static BOOL schedule_cups( const WCHAR *printer_name, const WCHAR *filename, con
} }
} }
BOOL unix_schedule_job( void *args ) static NTSTATUS schedule_job( void *args )
{ {
struct schedule_job_params *params = args; struct schedule_job_params *params = args;
...@@ -695,3 +679,12 @@ BOOL unix_schedule_job( void *args ) ...@@ -695,3 +679,12 @@ BOOL unix_schedule_job( void *args )
return FALSE; return FALSE;
} }
unixlib_entry_t __wine_unix_call_funcs[] =
{
process_attach,
enum_printers,
get_default_page_size,
get_ppd,
schedule_job,
};
...@@ -18,19 +18,17 @@ ...@@ -18,19 +18,17 @@
* License along with this library; if not, write to the Free Software * License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/ */
#include "config.h"
#include <stdarg.h> #include <stdarg.h>
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
#include "wingdi.h" #include "wingdi.h"
#include "winspool.h" #include "winspool.h"
#include "winreg.h" #include "winreg.h"
#include "winternl.h"
#include "ddk/winsplp.h" #include "ddk/winsplp.h"
#include "wine/debug.h" #include "wine/debug.h"
#include "wine/unixlib.h"
#include "wspool.h" #include "wspool.h"
...@@ -50,11 +48,11 @@ static CRITICAL_SECTION backend_cs = { &backend_cs_debug, -1, 0, 0, 0, 0 }; ...@@ -50,11 +48,11 @@ static CRITICAL_SECTION backend_cs = { &backend_cs_debug, -1, 0, 0, 0, 0 };
/* ############################### */ /* ############################### */
HINSTANCE WINSPOOL_hInstance = NULL; HINSTANCE WINSPOOL_hInstance = NULL;
unixlib_handle_t winspool_handle = 0;
static HMODULE hlocalspl = NULL; static HMODULE hlocalspl;
static BOOL (WINAPI *pInitializePrintProvidor)(LPPRINTPROVIDOR, DWORD, LPWSTR); static BOOL (WINAPI *pInitializePrintProvidor)(LPPRINTPROVIDOR, DWORD, LPWSTR);
PRINTPROVIDOR *backend = NULL;
PRINTPROVIDOR * backend = NULL;
/****************************************************************************** /******************************************************************************
* load_backend [internal] * load_backend [internal]
...@@ -117,7 +115,9 @@ BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, void *reserved ) ...@@ -117,7 +115,9 @@ BOOL WINAPI DllMain( HINSTANCE instance, DWORD reason, void *reserved )
case DLL_PROCESS_ATTACH: case DLL_PROCESS_ATTACH:
WINSPOOL_hInstance = instance; WINSPOOL_hInstance = instance;
DisableThreadLibraryCalls( instance ); DisableThreadLibraryCalls( instance );
UNIX_CALL( process_attach, NULL ); if (!NtQueryVirtualMemory( GetCurrentProcess(), instance, MemoryWineUnixFuncs,
&winspool_handle, sizeof(winspool_handle), NULL ))
UNIX_CALL( process_attach, NULL );
WINSPOOL_LoadSystemPrinters(); WINSPOOL_LoadSystemPrinters();
break; break;
......
...@@ -72,10 +72,15 @@ struct schedule_job_params ...@@ -72,10 +72,15 @@ struct schedule_job_params
const WCHAR *wine_port; const WCHAR *wine_port;
}; };
#define UNIX_CALL( func, params ) unix_ ## func( params ) extern unixlib_handle_t winspool_handle DECLSPEC_HIDDEN;
NTSTATUS unix_process_attach( void * ) DECLSPEC_HIDDEN; #define UNIX_CALL( func, params ) __wine_unix_call( winspool_handle, unix_ ## func, params )
NTSTATUS unix_enum_printers( void * ) DECLSPEC_HIDDEN;
NTSTATUS unix_get_default_page_size( void * ) DECLSPEC_HIDDEN; enum cups_funcs
NTSTATUS unix_get_ppd( void * ) DECLSPEC_HIDDEN; {
NTSTATUS unix_schedule_job( void * ) DECLSPEC_HIDDEN; unix_process_attach,
unix_enum_printers,
unix_get_default_page_size,
unix_get_ppd,
unix_schedule_job,
};
...@@ -74,9 +74,6 @@ ...@@ -74,9 +74,6 @@
/* Define to 1 if you have the <fontconfig/fontconfig.h> header file. */ /* Define to 1 if you have the <fontconfig/fontconfig.h> header file. */
#undef HAVE_FONTCONFIG_FONTCONFIG_H #undef HAVE_FONTCONFIG_FONTCONFIG_H
/* Define to 1 if you have the `fork' function. */
#undef HAVE_FORK
/* Define if FreeType 2 is installed */ /* Define if FreeType 2 is installed */
#undef HAVE_FREETYPE #undef HAVE_FREETYPE
......
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