"Carl Daniel [VC++ MVP]" <
[email protected]>
wrote in message | | > Hello,
| >
| > I need a program what generates me a blue screen in Windows XP with
..net!
| > This should be simple, but how?
|
| To reliably produce a "blue screen", you need only write a device driver
| that deliberately crashes the OS. There's no reliable way to do it from a
| user-mode app, managed or otherwise (there no doubt are ways, but they're
| due to bugs and quirks and cannot be considered reliable).
|
| -cd
|
|
Try this or it's C equivalent, but do it at your own risk:
[ DllImport("kernel32") ]
public static extern IntPtr CreateFileMapping (
IntPtr hFile, IntPtr lpAttributes, int flProtect,
int dwMaximumSizeLow, int dwMaximumSizeHigh,
String lpName );
static void Main()
{
CreateFileMapping(new IntPtr(-1), IntPtr.Zero, 0x00000004, 10, 0,
"Whatever");
}
Make sure the size of the filemapping object is larger than the size paging
file (or the sum of all paging files), in above the value 10 means 10 GB.
Running this will BSOD (on XP all SP's), this bug is known for years and
still not solved, quite a "reliable" way to force a BSOD I would say.
Willy.