Commit 604e7b4e authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

localspl: Add printer port redirection extension.

parent 6be2138d
...@@ -3240,6 +3240,7 @@ static BOOL WINAPI fpScheduleJob(HANDLE hprinter, DWORD job_id) ...@@ -3240,6 +3240,7 @@ static BOOL WINAPI fpScheduleJob(HANDLE hprinter, DWORD job_id)
BOOL ret_startdoc = FALSE, ret_open = FALSE, ret = TRUE; BOOL ret_startdoc = FALSE, ret_open = FALSE, ret = TRUE;
printer_t *printer = (printer_t *)hprinter; printer_t *printer = (printer_t *)hprinter;
const WCHAR *port_name, *port; const WCHAR *port_name, *port;
WCHAR output[1024];
DOC_INFO_1W info; DOC_INFO_1W info;
monitor_t *mon; monitor_t *mon;
BYTE buf[4096]; BYTE buf[4096];
...@@ -3247,6 +3248,7 @@ static BOOL WINAPI fpScheduleJob(HANDLE hprinter, DWORD job_id) ...@@ -3247,6 +3248,7 @@ static BOOL WINAPI fpScheduleJob(HANDLE hprinter, DWORD job_id)
DWORD r, w; DWORD r, w;
job_t *job; job_t *job;
HANDLE hf; HANDLE hf;
HKEY hkey;
TRACE("%p %ld\n", hprinter, job_id); TRACE("%p %ld\n", hprinter, job_id);
...@@ -3280,10 +3282,22 @@ static BOOL WINAPI fpScheduleJob(HANDLE hprinter, DWORD job_id) ...@@ -3280,10 +3282,22 @@ static BOOL WINAPI fpScheduleJob(HANDLE hprinter, DWORD job_id)
} }
/* TODO: use print processor */ /* TODO: use print processor */
if (isalpha(port[0]) && port[1] == ':') port_name = port;
if ((isalpha(port[0]) && port[1] == ':') ||
!wcsncmp(port, L"FILE:", ARRAY_SIZE(L"FILE:") - 1))
{
port_name = L"FILE:"; port_name = L"FILE:";
else }
port_name = port; else if (!RegOpenKeyW(HKEY_CURRENT_USER, L"Software\\Wine\\Printing\\Spooler", &hkey))
{
DWORD type, count = sizeof(output);
if (!RegQueryValueExW(hkey, port, NULL, &type, (BYTE *)output, &count))
{
TRACE("overriding port %s -> %s\n", debugstr_w(port), debugstr_w(output));
port_name = output;
}
RegCloseKey(hkey);
}
if (!(mon = monitor_load_by_port(port_name)) || !mon->monitor.pfnOpenPort || if (!(mon = monitor_load_by_port(port_name)) || !mon->monitor.pfnOpenPort ||
!mon->monitor.pfnStartDocPort || !mon->monitor.pfnWritePort || !mon->monitor.pfnStartDocPort || !mon->monitor.pfnWritePort ||
......
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