mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-06 09:35:52 +00:00
localspl: Support Port handles in WritePrinter.
This commit is contained in:
parent
6bb5bb4486
commit
62e017c91b
|
@ -3223,23 +3223,38 @@ static DWORD WINAPI fpStartDocPrinter(HANDLE hprinter, DWORD level, BYTE *doc_in
|
|||
|
||||
static BOOL WINAPI fpWritePrinter(HANDLE hprinter, void *buf, DWORD size, DWORD *written)
|
||||
{
|
||||
printer_t *printer = (printer_t *)hprinter;
|
||||
handle_header_t *header = (handle_header_t *)hprinter;
|
||||
|
||||
TRACE("(%p, %p, %ld, %p)\n", hprinter, buf, size, written);
|
||||
|
||||
if(!printer || printer->header.type != HANDLE_PRINTER)
|
||||
if (!header)
|
||||
{
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if(!printer->doc)
|
||||
if (header->type == HANDLE_PORT)
|
||||
{
|
||||
SetLastError(ERROR_SPL_NO_STARTDOC);
|
||||
return FALSE;
|
||||
port_t *port = (port_t *)hprinter;
|
||||
|
||||
return port->mon->monitor.pfnWritePort(port->hport, buf, size, written);
|
||||
}
|
||||
|
||||
return WriteFile(printer->doc->hf, buf, size, written, NULL);
|
||||
if (header->type == HANDLE_PRINTER)
|
||||
{
|
||||
printer_t *printer = (printer_t *)hprinter;
|
||||
|
||||
if (!printer->doc)
|
||||
{
|
||||
SetLastError(ERROR_SPL_NO_STARTDOC);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return WriteFile(printer->doc->hf, buf, size, written, NULL);
|
||||
}
|
||||
|
||||
SetLastError(ERROR_INVALID_HANDLE);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static BOOL WINAPI fpSetJob(HANDLE hprinter, DWORD job_id,
|
||||
|
|
Loading…
Reference in a new issue