Commit 0c63012b authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

Implemented /etc/printcap based printing support.

Changed 'CUPS:printername' to 'LPR:printername'. Some fixes in AddPrinterW().
parent b7c2f2ff
......@@ -384,7 +384,7 @@ INT16 WINAPI InsertPQ16(HPQ16 hPQ, INT16 tag, INT16 key)
{
struct hpq *queueItem = HeapAlloc(GetProcessHeap(), 0, sizeof(struct hpq));
if(queueItem == NULL) {
ERR("Memory exausted!");
ERR("Memory exausted!\n");
return FALSE;
}
queueItem->next = hpqueue;
......@@ -456,8 +456,8 @@ static int CreateSpoolFile(LPCSTR pszOutput)
if (pszOutput == NULL || *pszOutput == '\0')
return -1;
if (!strncmp("CUPS:",pszOutput,5))
sprintf(psCmd,"|lpr -P%s",pszOutput+5);
if (!strncmp("LPR:",pszOutput,4))
sprintf(psCmd,"|lpr -P%s",pszOutput+4);
else
PROFILE_GetWineIniString("spooler",pszOutput,"",psCmd,sizeof(psCmd));
TRACE("Got printerSpoolCommand '%s' for output device '%s'\n",
......@@ -555,7 +555,7 @@ HPJOB16 WINAPI OpenJob16(LPCSTR lpOutput, LPCSTR lpTitle, HDC16 hDC)
{
pPrintJob = HeapAlloc(GetProcessHeap(), 0, sizeof(PRINTJOB));
if(pPrintJob == NULL) {
WARN("Memory exausted!");
WARN("Memory exausted!\n");
return hHandle;
}
......
......@@ -522,9 +522,9 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name)
strncpy(ppdFileName, ppd, sizeof(ppdFileName));
res = ERROR_SUCCESS;
/* we should unlink() that file later */
}
else {
ERR("Did not find ppd for %s\n",name);
} else {
res = ERROR_FILE_NOT_FOUND;
WARN("Did not find ppd for %s\n",name);
}
}
#endif
......@@ -533,7 +533,17 @@ PRINTERINFO *PSDRV_FindPrinterInfo(LPCSTR name)
res = GetPrinterDataA (hPrinter, "PPD File", NULL, ppdFileName,
sizeof(ppdFileName), &needed);
}
/* Look for a ppd file for this printer in the config file.
* First look for the names of the printer, then for 'generic'
*/
if ((res!=ERROR_SUCCESS) &&
!PROFILE_GetWineIniString("ppd",name,"",ppdFileName,sizeof(ppdFileName)) &&
!PROFILE_GetWineIniString("ppd","generic","",ppdFileName,sizeof(ppdFileName))
)
res = ERROR_FILE_NOT_FOUND;
else
res = ERROR_SUCCESS;
if (res != ERROR_SUCCESS) {
ERR ("Error %li getting PPD file name for printer '%s'\n", res, name);
goto closeprinter;
......
......@@ -26,10 +26,8 @@ BOOL WINAPI WINSPOOL_EntryPoint(HINSTANCE hInstance,
switch (reason)
{
case DLL_PROCESS_ATTACH: {
#ifdef HAVE_CUPS
extern void CUPS_LoadPrinters();
CUPS_LoadPrinters();
#endif
extern void WINSPOOL_LoadSystemPrinters();
WINSPOOL_LoadSystemPrinters();
break;
}
case DLL_PROCESS_DETACH:
......
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