Commit ade15558 authored by Alexandre Julliard's avatar Alexandre Julliard

localspl: Use --prefer-native instead of DLL_WINE_PREATTACH.

parent ec9a3d99
MODULE = localspl.dll MODULE = localspl.dll
IMPORTS = spoolss user32 advapi32 IMPORTS = spoolss user32 advapi32
EXTRADLLFLAGS = -mno-cygwin EXTRADLLFLAGS = -mno-cygwin -Wb,--prefer-native
C_SRCS = \ C_SRCS = \
localmon.c \ localmon.c \
localspl_main.c \
provider.c provider.c
RC_SRCS = localspl.rc RC_SRCS = localspl.rc
...@@ -81,6 +81,24 @@ static struct list xcv_handles = LIST_INIT( xcv_handles ); ...@@ -81,6 +81,24 @@ static struct list xcv_handles = LIST_INIT( xcv_handles );
static const WCHAR WinNT_CV_PortsW[] = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Ports"; static const WCHAR WinNT_CV_PortsW[] = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Ports";
static const WCHAR WinNT_CV_WindowsW[] = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows"; static const WCHAR WinNT_CV_WindowsW[] = L"Software\\Microsoft\\Windows NT\\CurrentVersion\\Windows";
static HINSTANCE LOCALSPL_hInstance;
/*****************************************************
* DllMain
*/
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
TRACE("(%p, %d, %p)\n",hinstDLL, fdwReason, lpvReserved);
switch(fdwReason)
{
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls( hinstDLL );
LOCALSPL_hInstance = hinstDLL;
break;
}
return TRUE;
}
/****************************************************************** /******************************************************************
* does_port_exist (internal) * does_port_exist (internal)
......
/*
* Implementation of the Local Printprovider/ Printmonitor/ Prontprocessor
*
* Copyright 2006-2009 Detlef Riekenberg
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <stdarg.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "wine/debug.h"
#include "localspl_private.h"
WINE_DEFAULT_DEBUG_CHANNEL(localspl);
HINSTANCE LOCALSPL_hInstance = NULL;
/*****************************************************
* DllMain
*/
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
TRACE("(%p, %d, %p)\n",hinstDLL, fdwReason, lpvReserved);
switch(fdwReason)
{
case DLL_WINE_PREATTACH:
return FALSE; /* prefer native version */
case DLL_PROCESS_ATTACH:
DisableThreadLibraryCalls( hinstDLL );
LOCALSPL_hInstance = hinstDLL;
setup_provider();
break;
}
return TRUE;
}
...@@ -23,10 +23,6 @@ ...@@ -23,10 +23,6 @@
#include <windef.h> #include <windef.h>
/* ## DLL-wide Globals ## */
extern HINSTANCE LOCALSPL_hInstance DECLSPEC_HIDDEN;
void setup_provider(void) DECLSPEC_HIDDEN;
/* ## Resource-ID ## */ /* ## Resource-ID ## */
#define IDS_LOCALPORT 500 #define IDS_LOCALPORT 500
#define IDS_LOCALMONITOR 507 #define IDS_LOCALMONITOR 507
......
...@@ -99,8 +99,6 @@ typedef struct { ...@@ -99,8 +99,6 @@ typedef struct {
static struct list monitor_handles = LIST_INIT( monitor_handles ); static struct list monitor_handles = LIST_INIT( monitor_handles );
static monitor_t * pm_localport; static monitor_t * pm_localport;
static const PRINTPROVIDOR * pprovider = NULL;
static const WCHAR fmt_driversW[] = static const WCHAR fmt_driversW[] =
L"System\\CurrentControlSet\\control\\Print\\Environments\\%s\\Drivers%s"; L"System\\CurrentControlSet\\control\\Print\\Environments\\%s\\Drivers%s";
static const WCHAR fmt_printprocessorsW[] = static const WCHAR fmt_printprocessorsW[] =
...@@ -2508,12 +2506,7 @@ static BOOL WINAPI fpXcvData(HANDLE hXcv, LPCWSTR pszDataName, PBYTE pInputData, ...@@ -2508,12 +2506,7 @@ static BOOL WINAPI fpXcvData(HANDLE hXcv, LPCWSTR pszDataName, PBYTE pInputData,
return TRUE; return TRUE;
} }
/***************************************************** static const PRINTPROVIDOR backend = {
* setup_provider [internal]
*/
void setup_provider(void)
{
static const PRINTPROVIDOR backend = {
fpOpenPrinter, fpOpenPrinter,
NULL, /* fpSetJob */ NULL, /* fpSetJob */
NULL, /* fpGetJob */ NULL, /* fpGetJob */
...@@ -2600,10 +2593,7 @@ void setup_provider(void) ...@@ -2600,10 +2593,7 @@ void setup_provider(void)
NULL, /* fpFlushPrinter */ NULL, /* fpFlushPrinter */
NULL, /* fpSendRecvBidiData */ NULL, /* fpSendRecvBidiData */
NULL /* fpAddDriverCatalog */ NULL /* fpAddDriverCatalog */
}; };
pprovider = &backend;
}
/***************************************************** /*****************************************************
* InitializePrintProvidor (localspl.@) * InitializePrintProvidor (localspl.@)
...@@ -2631,7 +2621,7 @@ BOOL WINAPI InitializePrintProvidor(LPPRINTPROVIDOR pPrintProvidor, ...@@ -2631,7 +2621,7 @@ BOOL WINAPI InitializePrintProvidor(LPPRINTPROVIDOR pPrintProvidor,
{ {
TRACE("(%p, %u, %s)\n", pPrintProvidor, cbPrintProvidor, debugstr_w(pFullRegistryPath)); TRACE("(%p, %u, %s)\n", pPrintProvidor, cbPrintProvidor, debugstr_w(pFullRegistryPath));
memcpy(pPrintProvidor, pprovider, memcpy(pPrintProvidor, &backend,
(cbPrintProvidor < sizeof(PRINTPROVIDOR)) ? cbPrintProvidor : sizeof(PRINTPROVIDOR)); (cbPrintProvidor < sizeof(PRINTPROVIDOR)) ? cbPrintProvidor : sizeof(PRINTPROVIDOR));
return TRUE; return TRUE;
......
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