< Back to OSY 1.0 thread list

OSY 1.0 Thread Viewer

Thread #: 1526

I've just seen XP BSOD

AllYorBaseRBelong2Us

Fri Mar 8 02:12:38 2002

The screen froze and a moment later, the blue screen showed up.

The information that it gave was rather informative:  It said that "The File ATIDIV is stuck in an infinite loop" obviously this isn't XP's fault as the ATI driver clearly did something naughty (I'm surprised XP has this kind of error detection)

But it begs the question, could an OS concievable give the option to continue operation by loading a generic driver letting the user determin when the computer can be more conveniently shut down?

Oh, and ATI is teh Suck! :)

DrPizza

Fri Mar 8 03:02:41 2002

No, because it can't safely unload the problem driver.

The BSOD is a damage-limitation feature -- whenever the kernel (or a driver) detects that integrity has been compromised, it brings the system down in a semi-controlled way.  This is much better than letting the damage spread, where it could, for instance, start writing garbage to your hard disk.

pauli

Fri Mar 8 03:36:40 2002

damage strikes me as a very nefarious character.
DrPizza

Fri Mar 8 06:14:20 2002

Anyway.  I wrote a frigging program that'd crash XP.  Crashing XP is hardly momentous.
AllYorBaseRBelong2Us

Fri Mar 8 06:30:30 2002

What was the nature of this program?
HitScan

Fri Mar 8 13:40:00 2002

That backspacing over the cmd.exe buffer I should imagine, unless he's got a more interesting kernel killer lately.
DrPizza

Fri Mar 8 15:49:15 2002

No, it predates that, it exploits a flaw in GDI.
HitScan

Fri Mar 8 16:29:59 2002

No, it predates that, it exploits a flaw in GDI.

I remember hearing about that one. I don't remember if I ever really heard what it did though. How does it b0rk things?
DrPizza

Fri Mar 8 17:06:15 2002

It tries to make Windows draw a window before the window has been assembled, I think.
[code]
#include <windows.h>

LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
       switch(message)
       {
       case WM_NCCREATE:
               {
                       ShowWindow(hwnd, SW_SHOW);
               }
               return TRUE;
       }
       return DefWindowProc(hwnd, message, wParam, lParam);
}

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{
       HWINSTA ws = CreateWindowStation(NULL, 0, WINSTA_CREATEDESKTOP | GENERIC_ALL, NULL);
       SetProcessWindowStation(ws);
       HDESK dt = CreateDesktop("TEST", 0, 0, 0, DESKTOP_CREATEWINDOW | GENERIC_ALL | DESKTOP_CREATEMENU | DESKTOP_SWITCHDESKTOP | DESKTOP_WRITEOBJECTS | DESKTOP_READOBJECTS, NULL); // no idea what access I actually need, I think this is just about everything
       SetThreadDesktop(dt);
       WNDCLASS wndclass = {0};
       wndclass.style = CS_HREDRAW | CS_VREDRAW;
       wndclass.lpfnWndProc = WndProc;
       wndclass.hInstance = hInstance;
       wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION); // default icon
       wndclass.hCursor = LoadCursor(NULL, IDC_ARROW); // default cursor. One or other (or both?) of these seem to be necessary.
       wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
       wndclass.lpszMenuName = NULL;
       wndclass.lpszClassName = TEXT("Crash");
       RegisterClass(&wndclass);
       HWND hwnd = CreateWindowEx(WS_EX_TOOLWINDOW, TEXT("Crash"), TEXT("Crash"), WS_POPUP, 300, 300, 300, 445, NULL, NULL, hInstance, NULL);
       // NEVER GETS HERE.
       ShowWindow(hwnd, iCmdShow);
       UpdateWindow(hwnd);
       MSG msg;
       while(GetMessage(&msg, NULL, 0, 0))
       {
               TranslateMessage(&msg);
               DispatchMessage(&msg);
       }
       return msg.wParam;
}
[/code]
Edit: stupid smilies!

(Edited by DrPizza at 5:06 pm on Mar. 8, 2002)

HitScan

Fri Mar 8 17:19:47 2002

Ah. trying to show a window (with a valid handle no less!) before it's created (I don't like the name of that message. it's slightly misleading, as the window obviously hasn't been created if you're playing with the CREATESTRUCT..)
Seems like a (somewhat) easy fix in the ShowWindow() func. I wonder why they never bothered? (I'm thinking you said you submitted it some time ago, right?)

Also, why create a WindowStation and Desktop? are they required for it to crash (utterly bizzare) or do you just like to be rather thorough? ;)

(Edited by HitScan at 9:39 am on Mar. 8, 2002)

DrPizza

Fri Mar 8 17:29:01 2002

from HitScan posted at 5:19 pm on Mar. 8, 2002

Ah. trying to show a window (with a valid handle no less!) before it's created (I don't like the name of that message. it's slightly misleading, as the window obviously hasn't been created if you're playing with the create_sturct..)

I don't know what "NC" stands for; the NCCREATE message is sent immediately prior to the actual creation of the window.  Thus, I shouldn't attempt to display the thing then (it might cause an infinite loop or something, I'm not entirely sure).

Seems like a (somewhat) easy fix in the ShowWindow() func. I wonder why they never bothered? (I'm thinking you said you submitted it some time ago, right?)

Yes, it should be fixed in SP3 or 4 for 2K and SP1 for XP.

Also, why create a WindowStation and Desktop? are they required for it to crash (utterly bizzare) or do you just like to be rather thorough? ;)

No, they're needed.  If you do things on the Interactive windowstation, the window creates properly, without crashing.
HitScan

Fri Mar 8 17:38:01 2002

From MSDN:
Window-Creation Messages
When creating any window, the system sends messages to the window procedure for the window. The system sends the WM_NCCREATE message after creating the window's nonclient area and the WM_CREATE message after creating the client area. The window procedure receives both messages before the system displays the window. Both messages include a pointer to a CREATESTRUCT structure that contains all the information specified in the CreateWindowEx function. Typically, the window procedure performs initialization tasks upon receiving these messages.

I thought it was Non-Client, but that seems an odd message to send, especially since it sends the regular WM_CREATE message shortly after. Maybe it makes skinning easier or something.

As for it needing to be a non-interactive WS, I suppose it will require more work than I originally thought. Glad I don't have to track it down. :biggrin:

Riso

Fri Mar 8 21:28:35 2002

I crash XP all the time.