PWSTR pwszPrintProcessor = NULL;
WCHAR wszPrinterName[MAX_PRINTER_NAME + 1];
+ TRACE("InitializePrinterList()\n");
+
// Initialize an empty list for our printers.
InitializeSkiplist(&PrinterList, DllAllocSplMem, _PrinterListCompareRoutine, (PSKIPLIST_FREE_ROUTINE)DllFreeSplMem);
{
DWORD cchComputerName = 0;
DWORD dwErrorCode;
- DWORD i;
PBYTE pPrinterInfoEnd;
PSKIPLIST_NODE pNode;
WCHAR wszComputerName[2 + MAX_COMPUTERNAME_LENGTH + 1 + 1] = { 0 };
PLOCAL_PRINTER pPrinter;
+ TRACE("LocalEnumPrinters(%lu, %S, %lu, %p, %lu, %p, %p)\n", Flags, Name, Level, pPrinterEnum, cbBuf, pcbNeeded, pcReturned);
+
// Do no sanity checks or assertions for pcbNeeded and pcReturned here.
// This is verified and required by localspl_apitest!
goto Cleanup;
// Count the required buffer size and the number of printers.
- i = 0;
for (pNode = PrinterList.Head.Next[0]; pNode; pNode = pNode->Next[0])
{
pPrinter = (PLOCAL_PRINTER)pNode->Element;
}
pfnGetPrinterLevels[Level](pPrinter, NULL, NULL, pcbNeeded, cchComputerName, wszComputerName);
- i++;
}
// Check if the supplied buffer is large enough.
continue;
pfnGetPrinterLevels[Level](pPrinter, &pPrinterEnum, &pPrinterInfoEnd, NULL, cchComputerName, wszComputerName);
+ (*pcReturned)++;
}
- *pcReturned = i;
dwErrorCode = ERROR_SUCCESS;
Cleanup:
PLOCAL_HANDLE pHandle = (PLOCAL_HANDLE)hPrinter;
PLOCAL_PRINTER_HANDLE pPrinterHandle;
+ TRACE("LocalGetPrinter(%p, %lu, %p, %lu, %p)\n", hPrinter, Level, pPrinter, cbBuf, pcbNeeded);
+
// Sanity checks.
if (!pHandle)
{
}
// Count the required buffer size.
+ *pcbNeeded = 0;
pfnGetPrinterLevels[Level](pPrinterHandle->pPrinter, NULL, NULL, pcbNeeded, 0, NULL);
// Check if the supplied buffer is large enough.
PWSTR pwszSecondParameter;
WCHAR wszComputerName[MAX_COMPUTERNAME_LENGTH + 1];
+ TRACE("LocalOpenPrinter(%S, %p, %p)\n", lpPrinterName, phPrinter, pDefault);
+
ASSERT(phPrinter);
*phPrinter = NULL;
PLOCAL_PORT_HANDLE pPortHandle;
PLOCAL_PRINTER_HANDLE pPrinterHandle;
+ TRACE("LocalReadPrinter(%p, %p, %lu, %p)\n", hPrinter, pBuf, cbBuf, pNoBytesRead);
+
// Sanity checks.
if (!pHandle)
{
PLOCAL_PORT_HANDLE pPortHandle;
PLOCAL_PRINTER_HANDLE pPrinterHandle;
+ TRACE("LocalStartDocPrinter(%p, %lu, %p)\n", hPrinter, Level, pDocInfo);
+
// Sanity checks.
if (!pHandle)
{
PLOCAL_HANDLE pHandle = (PLOCAL_HANDLE)hPrinter;
PLOCAL_PRINTER_HANDLE pPrinterHandle;
+ TRACE("LocalStartPagePrinter(%p)\n", hPrinter);
+
// Sanity checks.
if (!pHandle || pHandle->HandleType != HandleType_Printer)
{
PLOCAL_PORT_HANDLE pPortHandle;
PLOCAL_PRINTER_HANDLE pPrinterHandle;
+ TRACE("LocalWritePrinter(%p, %p, %lu, %p)\n", hPrinter, pBuf, cbBuf, pcWritten);
+
// Sanity checks.
if (!pHandle)
{
DWORD dwErrorCode;
PLOCAL_HANDLE pHandle = (PLOCAL_HANDLE)hPrinter;
+ TRACE("LocalEndPagePrinter(%p)\n", hPrinter);
+
// Sanity checks.
if (!pHandle || pHandle->HandleType != HandleType_Printer)
{
PLOCAL_PORT_HANDLE pPortHandle;
PLOCAL_PRINTER_HANDLE pPrinterHandle;
+ TRACE("LocalEndDocPrinter(%p)\n", hPrinter);
+
// Sanity checks.
if (!pHandle)
{
{
PLOCAL_HANDLE pHandle = (PLOCAL_HANDLE)hPrinter;
+ TRACE("LocalClosePrinter(%p)\n", hPrinter);
+
if (!pHandle)
{
SetLastError(ERROR_INVALID_HANDLE);