ntprint: [1/2] Implement PSetupEnumMonitor
Detlef Riekenberg
wine.dev at web.de
Thu Jun 21 17:36:24 CDT 2007
ntprint: Implement PSetupEnumMonitor
--
By by ... Detlef
-------------- next part --------------
>From 945fbdce69210a57ae797c174309ed2f678cb614 Mon Sep 17 00:00:00 2001
From: Detlef Riekenberg <wine.dev at web.de>
Date: Fri, 22 Jun 2007 00:31:29 +0200
Subject: [PATCH] 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..ded4fd8 100644
--- a/dlls/ntprint/ntprint.c
+++ b/dlls/ntprint/ntprint.c
@@ -120,3 +120,48 @@ VOID WINAPI PSetupDestroyMonitorInfo(HAN
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
--
1.4.1
More information about the wine-patches
mailing list