mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-15 05:14:46 +00:00
localspl: Return error if cups port handle is used from different threads.
This commit is contained in:
parent
b09f8714ae
commit
e687ebd363
|
@ -66,6 +66,7 @@ typedef struct {
|
||||||
struct list entry;
|
struct list entry;
|
||||||
DWORD type;
|
DWORD type;
|
||||||
HANDLE hfile;
|
HANDLE hfile;
|
||||||
|
DWORD thread_id;
|
||||||
INT64 doc_handle;
|
INT64 doc_handle;
|
||||||
WCHAR nameW[1];
|
WCHAR nameW[1];
|
||||||
} port_t;
|
} port_t;
|
||||||
|
@ -516,6 +517,8 @@ static BOOL WINAPI localmon_StartDocPort(HANDLE hport, WCHAR *printer_name,
|
||||||
if (port->doc_handle)
|
if (port->doc_handle)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
port->thread_id = GetCurrentThreadId();
|
||||||
|
|
||||||
params.type = port->type;
|
params.type = port->type;
|
||||||
params.port = port->nameW;
|
params.port = port->nameW;
|
||||||
params.document_title = doc_info ? doc_info->pDocName : NULL;
|
params.document_title = doc_info ? doc_info->pDocName : NULL;
|
||||||
|
@ -561,6 +564,13 @@ static BOOL WINAPI localmon_WritePort(HANDLE hport, BYTE *buf, DWORD size,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (port->type == PORT_IS_CUPS && port->thread_id != GetCurrentThreadId())
|
||||||
|
{
|
||||||
|
FIXME("used from other thread\n");
|
||||||
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
params.doc = port->doc_handle;
|
params.doc = port->doc_handle;
|
||||||
params.buf = buf;
|
params.buf = buf;
|
||||||
params.size = size;
|
params.size = size;
|
||||||
|
@ -585,6 +595,13 @@ static BOOL WINAPI localmon_EndDocPort(HANDLE hport)
|
||||||
if (!port->doc_handle)
|
if (!port->doc_handle)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
if (port->type == PORT_IS_CUPS && port->thread_id != GetCurrentThreadId())
|
||||||
|
{
|
||||||
|
FIXME("used from other thread\n");
|
||||||
|
SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
params.doc = port->doc_handle;
|
params.doc = port->doc_handle;
|
||||||
port->doc_handle = 0;
|
port->doc_handle = 0;
|
||||||
return UNIX_CALL(end_doc, ¶ms);
|
return UNIX_CALL(end_doc, ¶ms);
|
||||||
|
|
Loading…
Reference in a new issue