Re: winspool.drv: return maximum possible size of the buffer when no buffer is specified
Vitaly Perov <vitperov(a)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. -- Alexandre Julliard julliard(a)winehq.org
В сообщении от 23 февраля 2011 21:43:49 автор Alexandre Julliard написал:
Vitaly Perov <vitperov(a)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
participants (2)
-
Alexandre Julliard -
Vitaly Perov