Detlef Riekenberg : winspool: Implement XcvDataW.
Alexandre Julliard
julliard at wine.codeweavers.com
Sat Jan 6 05:12:54 CST 2007
Module: wine
Branch: master
Commit: e82d2285f4ce62f17dceb84ede4af7c8802786a4
URL: http://source.winehq.org/git/wine.git/?a=commit;h=e82d2285f4ce62f17dceb84ede4af7c8802786a4
Author: Detlef Riekenberg <wine.dev at web.de>
Date: Fri Jan 5 01:11:21 2007 +0100
winspool: Implement XcvDataW.
---
dlls/winspool.drv/info.c | 50 +++++++++++++++++++++++++++++++++++++++++----
1 files changed, 45 insertions(+), 5 deletions(-)
diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c
index 8b16252..551e8fc 100644
--- a/dlls/winspool.drv/info.c
+++ b/dlls/winspool.drv/info.c
@@ -6,7 +6,7 @@
* Copyright 1999 Klaas van Gend
* Copyright 1999, 2000 Huw D M Davies
* Copyright 2001 Marcus Meissner
- * Copyright 2005, 2006 Detlef Riekenberg
+ * Copyright 2005, 2006, 2007 Detlef Riekenberg
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -6540,17 +6540,57 @@ emW_cleanup:
/******************************************************************************
* XcvDataW (WINSPOOL.@)
*
- * Notes:
- * There doesn't seem to be an A version...
+ * Execute commands in the Printmonitor DLL
+ *
+ * PARAMS
+ * hXcv [i] Handle from OpenPrinter (with XcvMonitor or XcvPort)
+ * pszDataName [i] Name of the command to execute
+ * pInputData [i] Buffer for extra Input Data (needed only for some commands)
+ * cbInputData [i] Size in Bytes of Buffer at pInputData
+ * pOutputData [o] Buffer to receive additional Data (needed only for some commands)
+ * cbOutputData [i] Size in Bytes of Buffer at pOutputData
+ * pcbOutputNeeded [o] PTR to receive the minimal Size in Bytes of the Buffer at pOutputData
+ * pdwStatus [o] PTR to receive the win32 error code from the Printmonitor DLL
+ *
+ * RETURNS
+ * Success: TRUE
+ * Failure: FALSE
+ *
+ * NOTES
+ * Returning "TRUE" does mean, that the Printmonitor DLL was called successful.
+ * The execution of the command can still fail (check pdwStatus for ERROR_SUCCESS).
+ *
+ * Minimal List of commands, that a Printmonitor DLL should support:
+ *
+ *| "MonitorUI" : Return the Name of the Userinterface-DLL as WSTR in pOutputData
+ *| "AddPort" : Add a Port
+ *| "DeletePort": Delete a Port
+ *
+ * Many Printmonitors support additional commands. Examples for localspl.dll:
+ * "GetDefaultCommConfig", "SetDefaultCommConfig",
+ * "GetTransmissionRetryTimeout", "ConfigureLPTPortCommandOK"
+ *
*/
BOOL WINAPI XcvDataW( HANDLE hXcv, LPCWSTR pszDataName, PBYTE pInputData,
DWORD cbInputData, PBYTE pOutputData, DWORD cbOutputData,
PDWORD pcbOutputNeeded, PDWORD pdwStatus)
{
- FIXME("%p %s %p %d %p %d %p %p\n", hXcv, debugstr_w(pszDataName),
+ opened_printer_t *printer;
+
+ TRACE("(%p, %s, %p, %d, %p, %d, %p, %p)\n", hXcv, debugstr_w(pszDataName),
pInputData, cbInputData, pOutputData,
cbOutputData, pcbOutputNeeded, pdwStatus);
- return FALSE;
+
+ printer = get_opened_printer(hXcv);
+ if (!printer || (!printer->hXcv)) {
+ SetLastError(ERROR_INVALID_HANDLE);
+ return FALSE;
+ }
+
+ *pdwStatus = printer->pm->monitor->pfnXcvDataPort(printer->hXcv, pszDataName,
+ pInputData, cbInputData, pOutputData, cbOutputData, pcbOutputNeeded);
+
+ return TRUE;
}
/*****************************************************************************
More information about the wine-cvs
mailing list