winspool.drv: return maximum possible size of the buffer when no buffer is specified

Vitaly Perov vitperov at etersoft.ru
Fri Feb 25 07:38:59 CST 2011


В сообщении от 23 февраля 2011 21:43:49 автор Alexandre Julliard написал:
> Vitaly Perov <vitperov at etersoft.ru> writes:
> > @@ -7247,7 +7247,7 @@ static BOOL get_job_info_2(job_t *job, JOB_INFO_2W
> > *ji2, LPBYTE buf, DWORD cbBuf
> > 
> >          else
> >          {
> >          
> >              /* align DEVMODE to a DWORD boundary */
> > 
> > -            shift= (4 - ( (DWORD_PTR) ptr & 3)) & 3;
> > +            shift= ptr ? (4 - ( (DWORD_PTR) ptr & 3)) & 3 : 3;
> 
> It should most likely align from the start of the data, not from the
> pointer value.

I use convert_printerinfo_W_to_A() function as an example. It aligns DEVMODE  
to a DWORD boundary from the pointer value.

-- 
Best regards,
Vitaly Perov



More information about the wine-devel mailing list