Blue screen program in C#

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

I need a program what generates me a blue screen in Windows XP with .net!
This should be simple, but how?

Please help me.

Mario
 
Explain further, are you referring to emulating the blue screen of death? Or
you just want a winform, covered in blue?
 
Mario said:
Hello,

I need a program what generates me a blue screen in Windows XP with .net!
This should be simple, but how?

Please help me.

Mario

If you are trying for an actual BSOD I don't think you can do it in
managed code. That's what is mannaged, memory access and such. It's
written and executed in such a way that it doesn't blue-screen, it just
crashes and gets wiped. That's the point of running in it's own memory
space.

Tom P.
 
Hey, thanks for answering so quick. I want to emulate the blue screen of
death, so that nothing works anymore. (sry for my english)

Mario
 
Thanks, wath you wrote here makes sense. So I won't be able to program a blue
screen in C#. How can I do it in another languages? Do I have to use C?

Greetings Mario
 
Are you trying to create a virus?

I can't imagine why you would want a intentional BSOD!!!
 
No, I am not trying to create a virus, the reason why I need this, is to
test a WindowsXPembedded system...
 
Mario said:
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
 
I thought virus too. I still dont see why you would need to intentionally
recreate it for a windows xp embedded system.

Are you trying to recreate it to see the effect on the system if the BSOD
were to happen while it is running? I am baffled.
 
Yes, that is what I am trying to do. I use a WindowsXPembedded system
with a Windows CE realtime Kernel. Now I need to test the acting of the
kernel of Windows CE cashes.
 
Just write an unmanaged application that overwrites some system memory.
Using C, this is easily done using pointers. I know, because it happened to
me once or twice many years ago.

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Shooter
http://unclechutney.blogspot.com

A man, a plan, a canal, a palindrome that has.. oh, never mind.
 
Kevin Spencer said:
Just write an unmanaged application that overwrites some system memory.
Using C, this is easily done using pointers. I know, because it happened to
me once or twice many years ago.

This *shouldn't* result in the BSOD - the OS should protect itself
against malicious programs running in user mode. As another poster
mentioned, writing a dodgy driver is more likely to get results.

Mind you, on CE it may be easier to provoke a BSOD.
 
"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.
 
| > Just write an unmanaged application that overwrites some system memory.
| > Using C, this is easily done using pointers. I know, because it happened
to
| > me once or twice many years ago.
|
| This *shouldn't* result in the BSOD - the OS should protect itself
| against malicious programs running in user mode. As another poster
| mentioned, writing a dodgy driver is more likely to get results.
|
| Mind you, on CE it may be easier to provoke a BSOD.
|
| --
| Jon Skeet - <[email protected]>
| http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
| If replying to the group, please do not mail me too

Not really, see my reply to Carl.

Willy.
 
Well, Jon, like I said, it was a LONG time ago! I believe I was running
Windows 3.1 at the time...

--
HTH,

Kevin Spencer
Microsoft MVP
Chicken Salad Shooter
http://unclechutney.blogspot.com

A man, a plan, a canal, a palindrome that has.. oh, never mind.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top