[PATCH 1/2] spoolss: Implement FreeOtherNames

Detlef Riekenberg wine.dev at web.de
Wed Jul 9 14:41:54 CDT 2008


---
 dlls/spoolss/spoolss.spec   |    2 +-
 dlls/spoolss/spoolss_main.c |   29 +++++++++++++++++++++++++++++
 2 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/dlls/spoolss/spoolss.spec b/dlls/spoolss/spoolss.spec
index da5ee04..1a99e21 100644
--- a/dlls/spoolss/spoolss.spec
+++ b/dlls/spoolss/spoolss.spec
@@ -59,7 +59,7 @@
 @ stub FlushPrinter
 @ stub FormatPrinterForRegistryKey
 @ stub FormatRegistryKeyForPrinter
-@ stub FreeOtherNames
+@ stdcall FreeOtherNames(ptr ptr)
 @ stub GetClientUserHandle
 @ stub GetFormW
 @ stub GetJobAttributes
diff --git a/dlls/spoolss/spoolss_main.c b/dlls/spoolss/spoolss_main.c
index cc4487c..d64b6f5 100644
--- a/dlls/spoolss/spoolss_main.c
+++ b/dlls/spoolss/spoolss_main.c
@@ -251,6 +251,35 @@ BOOL WINAPI DllFreeSplStr(LPWSTR pwstr)
     return HeapFree(GetProcessHeap(), 0, pwstr);
 }
 
+/******************************************************************
+ *  FreeOtherNames  [SPOOLSS.@]
+ *
+ * Free the allocated Strings and the Sringtable
+ *
+ * PARAMS
+ *  pTable      [I] PTR to the Stringtable, allocated by BuildOtherNamesFromMachineName
+ *  pNumentries [I] PTR to the Number of Strings in the Stringtable
+ *
+ * RETURNS
+ *  Failure: FALSE
+ *  Success: TRUE
+ *
+ */
+BOOL WINAPI FreeOtherNames(LPWSTR **pTable, LPDWORD pNumentries)
+{
+    LPWSTR  *buffers = *pTable;
+    DWORD   index = *pNumentries;    
+
+    TRACE("(%p, %p) => Table %p has %u entries\n", buffers, index);
+
+    while (index > 0) {
+        index--;
+        DllFreeSplStr(buffers[index]);
+    }
+
+    DllFreeSplMem(buffers);
+    return TRUE;
+}
 
 /******************************************************************
  *   ImpersonatePrinterClient   [SPOOLSS.@]
-- 
1.5.4.3


--=-uPLm3rAtzAXpKx1ktQmw--




More information about the wine-patches mailing list