Stefan Leichter Stefan.Leichter@camLine.com writes:
Hello, i sent this patch one week ago, but it does not get commited. Anything wrong with it?
The handling of the buffer sizes looks very suspicious. For instance you check for namesize being NULL, but later on assign something to it anyway. Also allocations have to be in bytes but length arguments (for instance in the GetProfileStringW call) have to be in WCHARs, this isn't done correctly.
Am Freitag, 27. Februar 2004 01:23 schrieb Alexandre Julliard:
Stefan Leichter Stefan.Leichter@camLine.com writes:
Hello, i sent this patch one week ago, but it does not get commited. Anything wrong with it?
The handling of the buffer sizes looks very suspicious. For instance you check for namesize being NULL, but later on assign something to it anyway. Also allocations have to be in bytes but length arguments (for instance in the GetProfileStringW call) have to be in WCHARs, this isn't done correctly.
You are right with the last point, but i don't understand what you mean with the first one.
GetDefaultPrinterW breaks directly when namesize is a NULL pointer and GetDefaultPrinterA jumps to the end without. Where do is this pointer accessed when it is not vaild?
Bye Stefan
Stefan Leichter Stefan.Leichter@camLine.com writes:
GetDefaultPrinterW breaks directly when namesize is a NULL pointer and GetDefaultPrinterA jumps to the end without. Where do is this pointer accessed when it is not vaild?
You are right, I missed the fact that the W function would fail which would cause the A one to bail too. Still it is very confusing, because in the A function you compute the size and allocate a buffer even though it's not going to be used. You should restructure this to make it clear what is happening.