wineps.drv: Don't use dynamic buffer when writing new page info.

This commit is contained in:
Piotr Caban 2024-06-04 15:11:54 +02:00 committed by Alexandre Julliard
parent 26dfb963f3
commit de9393c8b7

View file

@ -526,19 +526,11 @@ INT PSDRV_WriteEndPage( print_ctx *ctx )
INT PSDRV_WriteNewPage( print_ctx *ctx )
{
char *buf;
char name[100];
signed int xtrans, ytrans, rotation;
int ret = 1;
char buf[256], name[16];
sprintf(name, "%d", ctx->job.PageNo);
buf = HeapAlloc( GetProcessHeap(), 0, sizeof(psnewpage) + 200 );
if(!buf) {
WARN("HeapAlloc failed\n");
return 0;
}
if(ctx->Devmode->dmPublic.dmOrientation == DMORIENT_LANDSCAPE) {
if(ctx->pi->ppd->LandscapeOrientation == -90) {
xtrans = GetDeviceCaps(ctx->hdc, PHYSICALHEIGHT) -
@ -564,10 +556,9 @@ INT PSDRV_WriteNewPage( print_ctx *ctx )
if( write_spool( ctx, buf, strlen(buf) ) != strlen(buf) ) {
WARN("WriteSpool error\n");
ret = 0;
return 0;
}
HeapFree( GetProcessHeap(), 0, buf );
return ret;
return 1;
}