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