Re: imagehlp: improve last error handling in ImageGetCertificateData

2007-12-11 Thread Aric Stewart
Indeed testing with my test app i see that if the Len is sufficient but the buffer is null i get a return of FALSE and a last error of ERROR_INVALID_PARAMETER. I will update my patch. -aric Juan Lang wrote: >> Humm, I wrote a test program mimicking the calls in the application I >> am working

Re: imagehlp: improve last error handling in ImageGetCertificateData

2007-12-11 Thread Juan Lang
> Humm, I wrote a test program mimicking the calls in the application I > am working on and found this behavior. The app was passing in a NULL > buffer and a pointer for the size set to 0, We where exiting with TRUE > and not setting the last error correctly which was confusing the app. In that

Re: imagehlp: improve last error handling in ImageGetCertificateData

2007-12-11 Thread Aric Stewart
Humm, I wrote a test program mimicking the calls in the application I am working on and found this behavior. The app was passing in a NULL buffer and a pointer for the size set to 0, We where exiting with TRUE and not setting the last error correctly which was confusing the app. Testing on wi

Re: imagehlp: improve last error handling in ImageGetCertificateData

2007-12-11 Thread Juan Lang
Hi Aric, -if( !Certificate ) +if( *RequiredLength < size ) { *RequiredLength = size; -return TRUE; +SetLastError( ERROR_INSUFFICIENT_BUFFER ); +return FALSE; } -if( *RequiredLength < size ) +if( !Certificate ) { *RequiredLen