Commit 0e57af88 authored by Detlef Riekenberg's avatar Detlef Riekenberg Committed by Alexandre Julliard

spoolss: Implement AllocSplStr + DllFreeSplStr.

parent 8e8e8f07
......@@ -12,7 +12,7 @@
@ stub AddPrinterDriverW
@ stub AddPrinterExW
@ stub AddPrinterW
@ stub AllocSplStr
@ stdcall AllocSplStr(wstr)
@ stub AppendPrinterNotifyInfoData
@ stub BuildOtherNamesFromMachineName
@ stub CallDrvDevModeConversion
......@@ -40,7 +40,7 @@
@ stub DeletePrinterKeyW
@ stdcall DllAllocSplMem(long)
@ stdcall DllFreeSplMem(ptr)
@ stub DllFreeSplStr
@ stdcall DllFreeSplStr(wstr)
@ stub EndDocPrinter
@ stub EndPagePrinter
@ stub EnumFormsW
......
......@@ -47,6 +47,35 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
}
/******************************************************************
* AllocSplStr [SPOOLSS.@]
*
* Create a copy from the String on the Spooler-Heap
*
* PARAMS
* pwstr [I] PTR to the String to copy
*
* RETURNS
* Failure: NULL
* Success: PTR to the copied String
*
*/
LPWSTR WINAPI AllocSplStr(LPCWSTR pwstr)
{
LPWSTR res = NULL;
DWORD len;
TRACE("(%s)\n", debugstr_w(pwstr));
if (!pwstr) return NULL;
len = (lstrlenW(pwstr) + 1) * sizeof(WCHAR);
res = HeapAlloc(GetProcessHeap(), 0, len);
if (res) lstrcpyW(res, pwstr);
TRACE("returning %p\n", res);
return res;
}
/******************************************************************
* DllAllocSplMem [SPOOLSS.@]
*
* Allocate cleared memory from the spooler heap
......@@ -93,3 +122,23 @@ BOOL WINAPI DllFreeSplMem(LPBYTE memory)
TRACE("(%p)\n", memory);
return HeapFree(GetProcessHeap(), 0, memory);
}
/******************************************************************
* DllFreeSplStr [SPOOLSS.@]
*
* Free the allocated Spooler-String
*
* PARAMS
* pwstr [I] PTR to the WSTR, allocated by AllocSplStr
*
* RETURNS
* Failure: FALSE
* Success: TRUE
*
*/
BOOL WINAPI DllFreeSplStr(LPWSTR pwstr)
{
TRACE("(%s) PTR: %p\n", debugstr_w(pwstr), pwstr);
return HeapFree(GetProcessHeap(), 0, pwstr);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment