Commit e879b9db authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

wineps: Create fake PSDRV_PDEVICE OpenPrintProcessor.

parent e5c7e364
...@@ -338,7 +338,7 @@ static void PSDRV_UpdateDevCaps( PSDRV_PDEVICE *physDev ) ...@@ -338,7 +338,7 @@ static void PSDRV_UpdateDevCaps( PSDRV_PDEVICE *physDev )
physDev->horzRes, physDev->vertRes); physDev->horzRes, physDev->vertRes);
} }
static PSDRV_PDEVICE *create_psdrv_physdev( HDC hdc, const WCHAR *device, PSDRV_PDEVICE *create_psdrv_physdev( HDC hdc, const WCHAR *device,
const PSDRV_DEVMODE *devmode ) const PSDRV_DEVMODE *devmode )
{ {
PRINTERINFO *pi = PSDRV_FindPrinterInfo( device ); PRINTERINFO *pi = PSDRV_FindPrinterInfo( device );
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#include <winspool.h> #include <winspool.h>
#include <ddk/winsplp.h> #include <ddk/winsplp.h>
#include "psdrv.h"
#include "wine/debug.h" #include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(psdrv); WINE_DEFAULT_DEBUG_CHANNEL(psdrv);
...@@ -37,6 +39,7 @@ struct pp_data ...@@ -37,6 +39,7 @@ struct pp_data
HANDLE hport; HANDLE hport;
WCHAR *doc_name; WCHAR *doc_name;
WCHAR *out_file; WCHAR *out_file;
PSDRV_PDEVICE *pdev;
}; };
typedef enum typedef enum
...@@ -215,6 +218,7 @@ HANDLE WINAPI OpenPrintProcessor(WCHAR *port, PRINTPROCESSOROPENDATA *open_data) ...@@ -215,6 +218,7 @@ HANDLE WINAPI OpenPrintProcessor(WCHAR *port, PRINTPROCESSOROPENDATA *open_data)
{ {
struct pp_data *data; struct pp_data *data;
HANDLE hport; HANDLE hport;
HDC hdc;
TRACE("%s, %p\n", debugstr_w(port), open_data); TRACE("%s, %p\n", debugstr_w(port), open_data);
...@@ -239,6 +243,23 @@ HANDLE WINAPI OpenPrintProcessor(WCHAR *port, PRINTPROCESSOROPENDATA *open_data) ...@@ -239,6 +243,23 @@ HANDLE WINAPI OpenPrintProcessor(WCHAR *port, PRINTPROCESSOROPENDATA *open_data)
data->hport = hport; data->hport = hport;
data->doc_name = wcsdup(open_data->pDocumentName); data->doc_name = wcsdup(open_data->pDocumentName);
data->out_file = wcsdup(open_data->pOutputFile); data->out_file = wcsdup(open_data->pOutputFile);
hdc = CreateCompatibleDC(NULL);
if (!hdc)
{
LocalFree(data);
return NULL;
}
SetGraphicsMode(hdc, GM_ADVANCED);
data->pdev = create_psdrv_physdev(hdc, open_data->pPrinterName,
(const PSDRV_DEVMODE *)open_data->pDevMode);
if (!data->pdev)
{
DeleteDC(hdc);
LocalFree(data);
return NULL;
}
data->pdev->dev.hdc = hdc;
return (HANDLE)data; return (HANDLE)data;
} }
...@@ -368,6 +389,9 @@ BOOL WINAPI ClosePrintProcessor(HANDLE pp) ...@@ -368,6 +389,9 @@ BOOL WINAPI ClosePrintProcessor(HANDLE pp)
ClosePrinter(data->hport); ClosePrinter(data->hport);
free(data->doc_name); free(data->doc_name);
free(data->out_file); free(data->out_file);
DeleteDC(data->pdev->dev.hdc);
HeapFree(GetProcessHeap(), 0, data->pdev->Devmode);
HeapFree(GetProcessHeap(), 0, data->pdev);
memset(data, 0, sizeof(*data)); memset(data, 0, sizeof(*data));
LocalFree(data); LocalFree(data);
......
...@@ -393,6 +393,9 @@ static inline PSDRV_PDEVICE *get_psdrv_dev( PHYSDEV dev ) ...@@ -393,6 +393,9 @@ static inline PSDRV_PDEVICE *get_psdrv_dev( PHYSDEV dev )
return (PSDRV_PDEVICE *)dev; return (PSDRV_PDEVICE *)dev;
} }
extern PSDRV_PDEVICE *create_psdrv_physdev( HDC hdc, const WCHAR *device,
const PSDRV_DEVMODE *devmode ) DECLSPEC_HIDDEN;
/* /*
* Every glyph name in the Adobe Glyph List and the 35 core PostScript fonts * Every glyph name in the Adobe Glyph List and the 35 core PostScript fonts
*/ */
......
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