Blog
Danger Will Robinson: EnumDisplayDevices
1/12/2006
In the documentation for EnumDisplayDevices it tells you that you need to initialize the cb parameter of DISPLAY_DEVICE to sizeof(DISPLAY_DEVICE), fair enough. That part is obvious. In XP you can do that and then call EnumDisplayDevices multiple times with the same DISPLAY_DEVICE structure and it works as you'd expect. But in Win2k it overwrites the cb parameter with a new larger value with every call to EnumDisplayDevices, so the 2nd call overwrites the stack and your app goes kaboom!

So now you know.


From:
Email (optional): (Will be HTML encoded to evade harvesting)
Message:
 
Remember username and/or email in a cookie.
Notify me of new posts in this thread via email.
BBcode:
[q]text[/q]
[url=link]description[/url]
[img]url_to_image[/img]
[pre]some_code[/pre]
[b]bold_text[/b]
Post