prntvpt: Implement PTCloseProvider.

Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Dmitry Timoshkov 2020-06-10 13:31:42 +08:00 committed by Alexandre Julliard
parent 83eb1e1535
commit f8d3b8e58f
2 changed files with 22 additions and 1 deletions

View File

@ -57,6 +57,27 @@ HRESULT WINAPI PTQuerySchemaVersionSupport(PCWSTR printer, DWORD *version)
return E_NOTIMPL; return E_NOTIMPL;
} }
static BOOL is_valid_provider(struct prn_provider *prov)
{
return prov && prov->owner == GetCurrentThreadId();
}
HRESULT WINAPI PTCloseProvider(HPTPROVIDER provider)
{
struct prn_provider *prov = (struct prn_provider *)provider;
TRACE("%p\n", provider);
if (!is_valid_provider(prov))
return E_HANDLE;
prov->owner = 0;
ClosePrinter(prov->hprn);
heap_free(prov);
return S_OK;
}
HRESULT WINAPI PTOpenProvider(PCWSTR printer, DWORD version, HPTPROVIDER *provider) HRESULT WINAPI PTOpenProvider(PCWSTR printer, DWORD version, HPTPROVIDER *provider)
{ {
DWORD used_version; DWORD used_version;

View File

@ -1,7 +1,7 @@
@ stdcall PTQuerySchemaVersionSupport(wstr ptr) @ stdcall PTQuerySchemaVersionSupport(wstr ptr)
@ stdcall PTOpenProvider(wstr long ptr) @ stdcall PTOpenProvider(wstr long ptr)
@ stdcall PTOpenProviderEx(wstr long long ptr ptr) @ stdcall PTOpenProviderEx(wstr long long ptr ptr)
@ stub PTCloseProvider @ stdcall PTCloseProvider(ptr)
@ stub BindPTProviderThunk @ stub BindPTProviderThunk
@ stub PTGetPrintCapabilities @ stub PTGetPrintCapabilities
@ stub PTMergeAndValidatePrintTicket @ stub PTMergeAndValidatePrintTicket