Module: wine Branch: master Commit: 1bbe86692cf119851a536405aab87ee98135db0c URL: https://gitlab.winehq.org/wine/wine/-/commit/1bbe86692cf119851a536405aab87ee...
Author: Piotr Caban piotr@codeweavers.com Date: Tue Dec 6 16:17:18 2022 +0100
wineps: Add EnumPrintProcessorDatatypesW implementation.
---
dlls/wineps.drv/printproc.c | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-)
diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index 287dac9a0cf..3b9f1404c3c 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -31,10 +31,38 @@ WINE_DEFAULT_DEBUG_CHANNEL(psdrv); BOOL WINAPI EnumPrintProcessorDatatypesW(WCHAR *server, WCHAR *name, DWORD level, BYTE *datatypes, DWORD size, DWORD *needed, DWORD *no) { - FIXME("%s, %s, %ld, %p, %ld, %p, %p\n", debugstr_w(server), debugstr_w(name), + static const WCHAR emf_1003[] = L"NT EMF 1.003"; + + DATATYPES_INFO_1W *info = (DATATYPES_INFO_1W *)datatypes; + + TRACE("%s, %s, %ld, %p, %ld, %p, %p\n", debugstr_w(server), debugstr_w(name), level, datatypes, size, needed, no); - SetLastError(ERROR_CALL_NOT_IMPLEMENTED); - return FALSE; + + if (!needed || !no) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + *no = 0; + *needed = sizeof(*info) + sizeof(emf_1003); + + if (level != 1 || (size && !datatypes)) + { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + if (size < *needed) + { + SetLastError(ERROR_INSUFFICIENT_BUFFER); + return FALSE; + } + + *no = 1; + info->pName = (WCHAR*)(info + 1); + memcpy(info + 1, emf_1003, sizeof(emf_1003)); + return TRUE; }
HANDLE WINAPI OpenPrintProcessor(WCHAR *port, PRINTPROCESSOROPENDATA *open_data)