return (dwErrorCode == ERROR_SUCCESS);
}
+VOID
+BroadcastChange(PLOCAL_HANDLE pHandle)
+{
+ PLOCAL_PRINTER pPrinter;
+ PSKIPLIST_NODE pNode;
+ DWORD cchMachineName = 0;
+ WCHAR wszMachineName[MAX_PATH] = {0}; // if not local, use Machine Name then Printer Name... pPrinter->pJob->pwszMachineName?
+
+ for (pNode = PrinterList.Head.Next[0]; pNode; pNode = pNode->Next[0])
+ {
+ pPrinter = (PLOCAL_PRINTER)pNode->Element;
+
+ StringCchCopyW( &wszMachineName[cchMachineName], sizeof(wszMachineName), pPrinter->pwszPrinterName );
+
+ PostMessageW( HWND_BROADCAST, WM_DEVMODECHANGE, 0, (LPARAM)&wszMachineName );
+ }
+}
+
/**
* @name _LocalEnumPrintersCheckName
*
size_t cbParameters;
PWSTR p, Allocation;
PCWSTR pwszStrings[10];
-
+ FIXME("LocalGetPrinterLevel2\n");
// Calculate the string lengths.
cbDevMode = pPrinter->pDefaultDevMode->dmSize + pPrinter->pDefaultDevMode->dmDriverExtra;
cbPrinterName = (cchComputerName + wcslen(pPrinter->pwszPrinterName) + 1) * sizeof(WCHAR);
cbParameters = sizeof(wszEmpty);
*pcbNeeded += sizeof(PRINTER_INFO_2W) + cbDevMode + cbPrinterName + cbShareName + cbPortName + cbDriverName + cbComment + cbLocation + cbSepFile + cbPrintProcessor + cbDatatype + cbParameters;
+ FIXME("LocalGetPrinterLevel2 Needed %d\n",*pcbNeeded);
return;
}
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);
+ FIXME("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!
{
// The caller supplied a non-existing Monitor name.
dwErrorCode = ERROR_INVALID_NAME;
+ ERR("OpenXcvHandle failed on Monitor name! %lu\n", dwErrorCode);
goto Failure;
}
}
{
// The supplied port is unknown to all our Print Monitors.
dwErrorCode = ERROR_INVALID_NAME;
+ ERR("OpenXcvHandle failed on Port name! %lu\n", dwErrorCode);
goto Failure;
}
else
{
dwErrorCode = ERROR_INVALID_NAME;
+ ERR("OpenXcvHandle failed on bad name! %lu\n", dwErrorCode);
goto Failure;
}
{
// The XcvOpenPort function failed. Return its last error.
dwErrorCode = GetLastError();
+ ERR("XcvOpenPort function failed! %lu\n", dwErrorCode);
goto Failure;
}
// Return it.
*phPrinter = (HANDLE)pHandle;
+ ERR("OpenXcvHandle Success! %p\n", pXcvHandle);
return ERROR_SUCCESS;
Failure:
return dwErrorCode;
}
+//
+// Dead API
+//
+DWORD WINAPI
+LocalPrinterMessageBox(HANDLE hPrinter, DWORD Error, HWND hWnd, LPWSTR pText, LPWSTR pCaption, DWORD dwType)
+{
+ SetLastError(ERROR_INVALID_HANDLE); // Yes....
+ return 0;
+}
+
BOOL WINAPI
LocalOpenPrinter(PWSTR lpPrinterName, HANDLE* phPrinter, PPRINTER_DEFAULTSW pDefault)
{
// "\\COMPUTERNAME\, XcvMonitor Local Port"
// ", XcvPort LPT1:"
// "\\COMPUTERNAME\, XcvPort LPT1:"
+ FIXME("OpenXcvHandle : %S\n",pwszSecondParameter);
dwErrorCode = _LocalOpenXcvHandle(pwszSecondParameter, phPrinter);
}
else
static void
_LocalClosePortHandle(PLOCAL_PORT_HANDLE pPortHandle)
{
+ FIXME("LocalClosePortHandle\n");
// Call the monitor's ClosePort function.
if (pPortHandle->pPort->pPrintMonitor->bIsLevel2)
((PMONITOR2)pPortHandle->pPort->pPrintMonitor->pMonitor)->pfnClosePort(pPortHandle->hPort);
static void
_LocalClosePrinterHandle(PLOCAL_PRINTER_HANDLE pPrinterHandle)
{
+ FIXME("LocalClosePrinterHandle\n");
// Terminate any started job.
if (pPrinterHandle->pJob)
FreeJob(pPrinterHandle->pJob);
{
PLOCAL_HANDLE pHandle = (PLOCAL_HANDLE)hPrinter;
- TRACE("LocalClosePrinter(%p)\n", hPrinter);
+ FIXME("LocalClosePrinter(%p)\n", hPrinter);
if (!pHandle)
{
{
_LocalCloseXcvHandle(pHandle->pSpecificHandle);
}
-
+ FIXME("LocalClosePrinter 1\n");
// Free memory for the handle and the specific handle (if any).
if (pHandle->pSpecificHandle)
DllFreeSplMem(pHandle->pSpecificHandle);
-
+ FIXME("LocalClosePrinter 2\n");
DllFreeSplMem(pHandle);
-
+ FIXME("LocalClosePrinter 3\n");
return TRUE;
}