Let PSDRV_WriteSpool cope with strings longer than 0xffff bytes.

This commit is contained in:
Huw Davies 2003-12-04 20:54:05 +00:00 committed by Alexandre Julliard
parent ed224b3398
commit 40774be857
2 changed files with 14 additions and 3 deletions

View File

@ -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;
}

View File

@ -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);