Detlef Riekenberg : ntprint: Implement PSetupEnumMonitor.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Jun 22 07:35:41 CDT 2007


Module: wine
Branch: master
Commit: f6e1dbf77169c70a6bc994912c81845b00cd62b4
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f6e1dbf77169c70a6bc994912c81845b00cd62b4

Author: Detlef Riekenberg <wine.dev at web.de>
Date:   Fri Jun 22 00:31:29 2007 +0200

ntprint: Implement PSetupEnumMonitor.

---

 dlls/ntprint/ntprint.c    |   45 +++++++++++++++++++++++++++++++++++++++++++++
 dlls/ntprint/ntprint.spec |    2 +-
 2 files changed, 46 insertions(+), 1 deletions(-)

diff --git a/dlls/ntprint/ntprint.c b/dlls/ntprint/ntprint.c
index 7363b9c..ece26ef 100644
--- a/dlls/ntprint/ntprint.c
+++ b/dlls/ntprint/ntprint.c
@@ -120,3 +120,48 @@ VOID WINAPI PSetupDestroyMonitorInfo(HANDLE monitorinfo)
         HeapFree(GetProcessHeap(), 0, mi);
     }
 }
+
+/*****************************************************
+ *  PSetupEnumMonitor  [NTPRINT.@]
+ *
+ * Copy the selected Monitorname to a buffer
+ *
+ * PARAMS
+ *  monitorinfo [I]  HANDLE from PSetupCreateMonitorInfo
+ *  index       [I]  Nr. of the Monitorname to copy
+ *  buffer      [I]  Target, that receive the Monitorname
+ *  psize       [IO] PTR to a DWORD that hold the size of the buffer and receive
+ *                   the needed size, when the buffer is to small
+ *
+ * RETURNS
+ *  Success:  TRUE
+ *  Failure:  FALSE
+ *
+ * NOTES
+ *   size is in Bytes on w2k and WCHAR on XP
+ *
+ */
+
+BOOL WINAPI PSetupEnumMonitor(HANDLE monitorinfo, DWORD index, LPWSTR buffer, LPDWORD psize)
+{
+    monitorinfo_t * mi = (monitorinfo_t *) monitorinfo;
+    LPWSTR  nameW;
+    DWORD   len;
+
+    TRACE("(%p, %u, %p, %p) => %d\n", mi, index, buffer, psize, psize ? *psize : 0);
+
+    if (index < mi->installed) {
+        nameW = mi->mi2[index].pName;
+        len = lstrlenW(nameW) + 1;
+        if (len <= *psize) {
+            memcpy(buffer, nameW, len * sizeof(WCHAR));
+            TRACE("#%u: %s\n", index, debugstr_w(buffer));
+            return TRUE;
+        }
+        *psize = len;
+        SetLastError(ERROR_INSUFFICIENT_BUFFER);
+        return FALSE;
+    }
+    SetLastError(ERROR_NO_MORE_ITEMS);
+    return FALSE;
+}
diff --git a/dlls/ntprint/ntprint.spec b/dlls/ntprint/ntprint.spec
index 348ab69..8869776 100644
--- a/dlls/ntprint/ntprint.spec
+++ b/dlls/ntprint/ntprint.spec
@@ -9,7 +9,7 @@
 @ stub PSetupDestroyPrinterDeviceInfoList
 @ stub PSetupDestroySelectedDriverInfo
 @ stub PSetupDriverInfoFromName
-@ stub PSetupEnumMonitor
+@ stdcall PSetupEnumMonitor(long long ptr ptr)
 @ stub PSetupFreeDrvField
 @ stub PSetupGetDriverInfForPrinter
 @ stub PSetupGetDriverInfo3




More information about the wine-cvs mailing list