This is not the definitive word, but it represents my experience of using this function to create JPEG and BMP files. This is just a heads up for anyone developing an application that creates or manipulates an image and uses PUT_DIB_BLOCK@.
Let me start off by saying that having the facility is absolutely awesome. It has save me a great deal of time and effort.
My application creates an 'image', a representation of the data as if it is an image. This image is then imported into other software for use. The image must be at least 100 DPI to accurately show the data for the user. The program I created was sized for a 300 DPI image. The resolution is under the user's control. The image could be up to 8.5' wide and 300' long.
For BMP, I was unwilling to have the file size so huge (with 24-bit color), so found a bit of code (qdbmp, written in 'C') that allowed writing of 256 color images. Works well, even at 300 DPI.
The JPEG image, not so well at 300 DPI. What I have found is that if the image is requested at higher than 150DPI and nearly fills the available image space, the PUT_DIB_BLOCK will crash. Unfortunately, it does not usually crash in a pretty way. Sometime, Windows 7 just says it is not working. No trace, nothing to let you know.
After playing around with the code for better than a day, I've discovered that the key is the resolution and the image size being requested for conversion (I limit the size to the actual area being filled, so I don't try to convert the entire 2552900003 image space). It would appear that once called, PUT_DIB_BLOCK will allocate an internal image that is of the proper size, then create the JPEG file from that. With the arrays as big as they need to be, this means that the 32-bit limit for program allocated memory will (sometimes) be exceeded. While I haven't caught it at the 4-GB memory limit using the Task Manager, it's clear image creation is asking for a LOT of memory, and that is what causes the 'crash'.
I mention this not as a need for help in solving a problem, but just as a heads-up to anyone else who might run into a similar problem using PUT_DIB_BLOCK@.