Commit 40774be8 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

Let PSDRV_WriteSpool cope with strings longer than 0xffff bytes.

parent ed224b33
......@@ -193,8 +193,10 @@ static const char psarraydef[] =
"/%s %d array def\n";
int PSDRV_WriteSpool(PSDRV_PDEVICE *physDev, LPCSTR lpData, WORD cch)
DWORD PSDRV_WriteSpool(PSDRV_PDEVICE *physDev, LPCSTR lpData, DWORD cch)
{
int num, num_left = cch;
if(physDev->job.quiet) {
TRACE("ignoring output\n");
return 0;
......@@ -204,7 +206,16 @@ int PSDRV_WriteSpool(PSDRV_PDEVICE *physDev, LPCSTR lpData, WORD cch)
if( !PSDRV_StartPage(physDev) )
return 0;
}
return WriteSpool16( physDev->job.hJob, (LPSTR)lpData, cch );
do {
num = min(num_left, 0x8000);
if(WriteSpool16( physDev->job.hJob, (LPSTR)lpData, num ) != num)
return 0;
lpData += num;
num_left -= num;
} while(num_left);
return cch;
}
......
......@@ -450,7 +450,7 @@ extern BOOL PSDRV_WriteBytes(PSDRV_PDEVICE *physDev, const BYTE *bytes, int numb
extern BOOL PSDRV_WriteDIBits16(PSDRV_PDEVICE *physDev, const WORD *words, int number);
extern BOOL PSDRV_WriteDIBits24(PSDRV_PDEVICE *physDev, const BYTE *bits, int number);
extern BOOL PSDRV_WriteDIBits32(PSDRV_PDEVICE *physDev, const BYTE *bits, int number);
extern int PSDRV_WriteSpool(PSDRV_PDEVICE *physDev, LPCSTR lpData, WORD cch);
extern DWORD PSDRV_WriteSpool(PSDRV_PDEVICE *physDev, LPCSTR lpData, DWORD cch);
extern BOOL PSDRV_WritePatternDict(PSDRV_PDEVICE *physDev, BITMAP *bm, BYTE *bits);
extern BOOL PSDRV_WriteDIBPatternDict(PSDRV_PDEVICE *physDev, BITMAPINFO *bmi, UINT usage);
extern BOOL PSDRV_WriteArrayPut(PSDRV_PDEVICE *physDev, CHAR *pszArrayName, INT nIndex, LONG lCoord);
......
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