Protect some DIB functions from bad inputs.

Rolf Kalbermatter r.kalbermatter at
Wed Apr 12 06:19:39 CDT 2006

Mike Hearn [mailto:mike at] wrote:

> IsBad*Ptr has historically been used throughout Win32 to verify arguments,
> but this was never a good idea and in Vista it has been "banned", which I
> guess means Microsoft have gone through and removed the tests. Or at least
> are not using them anymore for new APIs.

>From what I have seen I got the feeling that MS didn't use that function in
newer APIs for quite some time already. Having only dealt with a few DLLs I
can't be authoritive, but for instance I never came across it in shell32.dll
or urlmon.dll but it's all over the place in avicap32.dll, which seems to be
mostly a port from the original avicap.dll written for Win 3.1. Also some of
the VfW "device drivers" seem to make extensive use of this API.
It would make sense since in Win 3.1 you hadn't the same issues about functions
needing to be thread safe so there this function had some use and it was just
ported to Win32 to make existing software still load despite the fact that it
can't really provide the parameter checking it makes one believe to do.

Rolf Kalbermatter

More information about the wine-devel mailing list