From 5104db3d82c410cec725143ddb11c8aaa3051417 Mon Sep 17 00:00:00 2001 From: Detlef Riekenberg Date: Sun, 1 Mar 2009 00:23:26 +0100 Subject: [PATCH] spoolss: Implement AddPrinterDriverExW. --- dlls/spoolss/router.c | 40 +++++++++++++++++++++++++++++++++++++++ dlls/spoolss/spoolss.spec | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/dlls/spoolss/router.c b/dlls/spoolss/router.c index 6fc7b5963c..479d23a6a7 100644 --- a/dlls/spoolss/router.c +++ b/dlls/spoolss/router.c @@ -354,6 +354,46 @@ BOOL WINAPI AddMonitorW(LPWSTR pName, DWORD Level, LPBYTE pMonitors) return (res == ROUTER_SUCCESS); } +/****************************************************************** + * AddPrinterDriverExW (spoolss.@) + * + * Install a Printer Driver with the Option to upgrade / downgrade the Files + * + * PARAMS + * pName [I] Servername or NULL (local Computer) + * level [I] Level for the supplied DRIVER_INFO_*W struct + * pDriverInfo [I] PTR to DRIVER_INFO_*W struct with the Driver Parameter + * dwFileCopyFlags [I] How to Copy / Upgrade / Downgrade the needed Files + * + * RESULTS + * Success: TRUE + * Failure: FALSE + * + */ +BOOL WINAPI AddPrinterDriverExW(LPWSTR pName, DWORD level, LPBYTE pDriverInfo, DWORD dwFileCopyFlags) +{ + backend_t * pb; + DWORD res = ROUTER_UNKNOWN; + + TRACE("(%s, %d, %p, 0x%x)\n", debugstr_w(pName), level, pDriverInfo, dwFileCopyFlags); + + if (!pDriverInfo) { + SetLastError(ERROR_INVALID_PARAMETER); + return FALSE; + } + + pb = backend_first(pName); + if (pb && pb->fpAddPrinterDriverEx) + res = pb->fpAddPrinterDriverEx(pName, level, pDriverInfo, dwFileCopyFlags); + else + { + SetLastError(ERROR_PROC_NOT_FOUND); + } + + TRACE("got %u with %u\n", res, GetLastError()); + return (res == ROUTER_SUCCESS); +} + /****************************************************************** * DeleteMonitorW (spoolss.@) * diff --git a/dlls/spoolss/spoolss.spec b/dlls/spoolss/spoolss.spec index ad1ea60809..68188ba390 100644 --- a/dlls/spoolss/spoolss.spec +++ b/dlls/spoolss/spoolss.spec @@ -8,7 +8,7 @@ @ stub AddPrintProcessorW @ stub AddPrintProvidorW @ stub AddPrinterConnectionW -@ stub AddPrinterDriverExW +@ stdcall AddPrinterDriverExW(wstr long ptr long) @ stub AddPrinterDriverW @ stub AddPrinterExW @ stub AddPrinterW