locked
Crashing Windows 7 on demand. RRS feed

  • Question

  • Last week while taking care of my ever growing backlog of Windows games, I intalled an old game from 2006 called Scratches. If the config file for this game engine doesn't have a specific refresh rate, Windows 7 crashes with a STOP error 0x0000007E. The solution to play the game is simple, to specify the refesh rate, However an Operating System reboot is something that should never happen, and can be triggered by an executable that doesn't install drivers or even require elevation. I copied the game engine to a flash drive and tested on different Windows 7 computers (32 and 64 bits, from starter to ultimate, with and without service pack 1, and with AMD, nvidia and Intel video cards.) It is always the same result. (However this problem doesn't affect Windows Vista)

    This is something that needs to be fixed. Every time I install Windows since N years ago, I'm always told that it is "the best and most reliable version of Windows ever", and that if an application fails or has an error it won't compromise the operating system. (Yet it seems it is still not true)

    I'm still unable to find an effective way to contact the Windows Team at Microsoft to let them know about this problem and have this fixed on the next Reliability update. (So far I have only get the response of an MVP telling me to contact the game manufacturer.)

    Is there somebody here that can forward me to the right persons to have this issue investigated?

    Thanks.

     EDIT:

    Link to the engine posted below.

    Here is the SCream Engine.

    http://cid-225c1f7e262a08bb.office.live.com/self.aspx/.Public/scream%5E_engine.zip

    Save all your documents, close all programs and enjoy the blue scene.

     

     

     

    Wednesday, March 2, 2011 6:40 PM

All replies

  • Do you get a BSOD or a simple reboot? Check the eventlog for details. If you get Kernel 41 issues, try this:

    http://support.microsoft.com/kb/2028504


    "A programmer is just a tool which converts caffeine into code" CLIP- Stellvertreter http://www.winvistaside.de/
    Wednesday, March 2, 2011 6:58 PM
  • Do you get a BSOD or a simple reboot?

    It is a BSOD

    "... Windows 7 crashes with a STOP error 0x0000007E."

    To be more precise: The computer has rebooted from a bugcheck. The bugcheck was: 0x0000007e (0xffffffffc0000094, 0xfffff96000755577, 0xfffff88007146778, 0xfffff88007145fe0).

    Wednesday, March 2, 2011 9:10 PM
  • //
    // MessageId: STATUS_INTEGER_DIVIDE_BY_ZERO
    //
    // MessageText:
    //
    // {EXCEPTION}
    // Integer division by zero.
    //
    #define STATUS_INTEGER_DIVIDE_BY_ZERO    ((NTSTATUS)0xC0000094 L)

    Bug Check 0x7E: SYSTEM_THREAD_EXCEPTION_NOT_HANDLED

    This bug check indicates that a system thread generated an exception that the error handler did not catch.


    To see some details I have to take a look at the dumps with the Debugging Tools for Windows.

    Please start the Windows Explorer and go to the folder C:\Windows\Minidump. Next, copy the dmp files to your desktop, zip all dmp into 1 zip file and upload the zip file to your public Skydrive [1] folder and post a link here.

    André

    [1] http://social.technet.microsoft.com/Forums/en-US/w7itproui/thread/4fc10639-02db-4665-993a-08d865088d65


    "A programmer is just a tool which converts caffeine into code"

    Want to install RSAT on Windows 7 Sp1? Check my HowTo: http://www.msfn.org/board/index.php?showtopic=150221
    Wednesday, March 2, 2011 10:22 PM
  • André

    I have several minidumps at home, but currently I only have one from a computer at work. (I will copy it and put it with the rest on my skydrive as soon as I get back home),

    Meanwhile, the one I have is from a PC doesn't have SP1 yet. And its version of cdd.dll is from KB2454826 (Cdd.dll 6.1.7600.16748     26-Jan-11) Which is actually newer than the one from SP1. (And for some reason windbg cannot download its symbols)

    Its details from windbg are:


    Windows 7 Kernel Version 7600 MP (2 procs) Free x64
    Product: WinNt, suite: TerminalServer SingleUserTS
    Built by: 7600.16695.amd64fre.win7_gdr.101026-1503
    Machine Name:
    Kernel base = 0xfffff800`02c58000 PsLoadedModuleList = 0xfffff800`02e95e50
    Debug session time: Tue Mar  1 08:20:07.100 2011 (UTC - 5:00)
    System Uptime: 12 days 21:12:08.802
    Loading Kernel Symbols
    ...............................................................
    ................................................................
    ..................................
    Loading User Symbols
    Loading unloaded module list
    ............................
    Unable to load image \SystemRoot\System32\cdd.dll, Win32 error 0n2
    *** WARNING: Unable to verify timestamp for cdd.dll
    *** ERROR: Module load completed but symbols could not be loaded for cdd.dll
    *******************************************************************************
    *                                                                             *
    *                        Bugcheck Analysis                                    *
    *                                                                             *
    *******************************************************************************

    Use !analyze -v to get detailed debugging information.

    BugCheck 1000007E, {ffffffffc0000094, fffff96000755577, fffff88007146778, fffff88007145fe0}

    Probably caused by : cdd.dll ( cdd+5577 )

    Followup: MachineOwner
    ---------

    1: kd> !analyze -v
    *******************************************************************************
    *                                                                             *
    *                        Bugcheck Analysis                                    *
    *                                                                             *
    *******************************************************************************

    SYSTEM_THREAD_EXCEPTION_NOT_HANDLED_M (1000007e)
    This is a very common bugcheck.  Usually the exception address pinpoints
    the driver/function that caused the problem.  Always note this address
    as well as the link date of the driver/image that contains this address.
    Some common problems are exception code 0x80000003.  This means a hard
    coded breakpoint or assertion was hit, but this system was booted
    /NODEBUG.  This is not supposed to happen as developers should never have
    hardcoded breakpoints in retail code, but ...
    If this happens, make sure a debugger gets connected, and the
    system is booted /DEBUG.  This will let us see why this breakpoint is
    happening.
    Arguments:
    Arg1: ffffffffc0000094, The exception code that was not handled
    Arg2: fffff96000755577, The address that the exception occurred at
    Arg3: fffff88007146778, Exception Record Address
    Arg4: fffff88007145fe0, Context Record Address

    Debugging Details:
    ------------------


    EXCEPTION_CODE: (NTSTATUS) 0xc0000094 - {EXCEPTION}  Integer division by zero.

    FAULTING_IP:
    cdd+5577
    fffff960`00755577 48f7f1          div     rax,rcx

    EXCEPTION_RECORD:  fffff88007146778 -- (.exr 0xfffff88007146778)
    ExceptionAddress: fffff96000755577 (cdd+0x0000000000005577)
       ExceptionCode: c0000094 (Integer divide-by-zero)
      ExceptionFlags: 00000000
    NumberParameters: 0

    CONTEXT:  fffff88007145fe0 -- (.cxr 0xfffff88007145fe0)
    rax=0000000000989680 rbx=fffffa8007059b60 rcx=0000000000000000
    rdx=0000000000000000 rsi=fffffa80038ebb30 rdi=fffff900c21a0020
    rip=fffff96000755577 rsp=fffff880071469b0 rbp=0000000000000080
     r8=0000000000026161  r9=fffff88007146a90 r10=0000000000000000
    r11=fffffa8007059b60 r12=0000000000000000 r13=0000000000000000
    r14=0000000000000001 r15=fffff880009f5ec0
    iopl=0         nv up ei pl zr na po nc
    cs=0010  ss=0018  ds=002b  es=002b  fs=0053  gs=002b             efl=00010246
    cdd+0x5577:
    fffff960`00755577 48f7f1          div     rax,rcx
    Resetting default scope

    CUSTOMER_CRASH_COUNT:  1

    DEFAULT_BUCKET_ID:  VISTA_DRIVER_FAULT

    BUGCHECK_STR:  0x7E

    PROCESS_NAME:  csrss.exe

    CURRENT_IRQL:  0

    ERROR_CODE: (NTSTATUS) 0xc0000094 - {EXCEPTION}  Integer division by zero.

    LAST_CONTROL_TRANSFER:  from fffffa8003800180 to fffff96000755577

    STACK_TEXT: 
    fffff880`071469b0 fffffa80`03800180 : fffffa80`01c93c40 fffff880`061436e0 fffff880`06140000 00000000`00000000 : cdd+0x5577
    fffff880`071469b8 fffffa80`01c93c40 : fffff880`061436e0 fffff880`06140000 00000000`00000000 fffff8a0`05cbcc70 : 0xfffffa80`03800180
    fffff880`071469c0 fffff880`061436e0 : fffff880`06140000 00000000`00000000 fffff8a0`05cbcc70 fffff8a0`051b9f80 : 0xfffffa80`01c93c40
    fffff880`071469c8 fffff880`06140000 : 00000000`00000000 fffff8a0`05cbcc70 fffff8a0`051b9f80 fffff8a0`05cbcb40 : 0xfffff880`061436e0
    fffff880`071469d0 00000000`00000000 : fffff8a0`05cbcc70 fffff8a0`051b9f80 fffff8a0`05cbcb40 fffff8a0`0022f140 : 0xfffff880`06140000


    FOLLOWUP_IP:
    cdd+5577
    fffff960`00755577 48f7f1          div     rax,rcx

    SYMBOL_STACK_INDEX:  0

    SYMBOL_NAME:  cdd+5577

    FOLLOWUP_NAME:  MachineOwner

    MODULE_NAME: cdd

    IMAGE_NAME:  cdd.dll

    DEBUG_FLR_IMAGE_TIMESTAMP:  0

    STACK_COMMAND:  .cxr 0xfffff88007145fe0 ; kb

    FAILURE_BUCKET_ID:  X64_0x7E_cdd+5577

    BUCKET_ID:  X64_0x7E_cdd+5577

    Followup: MachineOwner
    ---------

     

    Wednesday, March 2, 2011 10:51 PM
  • Ok, here are some minidumps.

    http://cid-225c1f7e262a08bb.office.live.com/self.aspx/.Public/minidumps.zip

    022611-43633-01.dmp and 022611-34413-01.dmp belong to the same desktop computer with 7 Ultimate x64 before and after SP1 was installed.

    022711-26520-01.dmp belongs to a notebook with 7 Home Premium x64 SP1 already installed

    030111-13556-01.dmp belongs to a netbook with 7 Starter. It was never patched so it has the x86 gold version of cdd.dll (6.1.7600.16385)

    030111-35802-01.dmp is the minidump I posted the windbg info on my previous post. It is another 7 Ultimate x64 without SP1

     

     

    Thursday, March 3, 2011 12:55 AM
  • 030111-13556-01.dmp:
    UNEXPECTED_KERNEL_MODE_TRAP (7f)
    Arguments:
    Arg1: 00000000, EXCEPTION_DIVIDED_BY_ZERO

    STACK_TEXT: 
    a1c7fa48 8e3e7884 badb0d00 00000000 badb0d00 nt!KiTrap00+0x8b
    a1c7fac0 8e3d4ac9 00989680 00000000 00000000 cdd!_aulldiv+0x14
    a1c7fd50 81a5e6d3 fe635010 8250ca69 00000000 cdd!PresentWorkerThread+0x195
    a1c7fd90 819100f9 8e3d4934 fe635010 00000000 nt!PspSystemThreadStartup+0x9e
    00000000 00000000 00000000 00000000 00000000 nt!KiThreadStartup+0x19

    030111-35802-01.dmp:
    022711-26520-01.dmp:
    022611-43633-01.dmp:
    022611-34413-01.dmp:

    SYSTEM_THREAD_EXCEPTION_NOT_HANDLED_M (1000007e)
    Arguments:
    Arg1: ffffffffc0000094, The exception code that was not handled

    EXCEPTION_CODE: (NTSTATUS) 0xc0000094 - DIVIDED_BY_ZERO

    Child-SP          RetAddr           Call Site
    fffff880`071469b0 fffff800`02f6b7c6 cdd!PresentWorkerThread+0x20b
    fffff880`07146d40 fffff800`02ca6c26 nt!PspSystemThreadStartup+0x5a
    fffff880`07146d80 00000000`00000000 nt!KxStartSystemThread+0x16


    What have all machines in common? When i go a bit deeper I can find this:

    Ntfs!NtfsFindStartingNode+0x5e6

    which tells me all have NTFS file system issues. Do you use the same software on all machines?


    Please start the command prompt (cmd.exe) with admin rights [1] and run chkdsk C: /r /f and sfc [2]:

    sfc.exe /scannow

    Is chkdsk able to detect and fix NTFS fiel system issues and is sfc able to find and repair broken files?


    best regards
    André

    [1] http://windows.microsoft.com/en-US/windows7/How-do-I-run-an-application-once-with-a-full-administrator-access-token
    [2] http://support.microsoft.com/kb/929833


    "A programmer is just a tool which converts caffeine into code"

    Want to install RSAT on Windows 7 Sp1? Check my HowTo: http://www.msfn.org/board/index.php?showtopic=150221
    Thursday, March 3, 2011 12:45 PM
  • So decided to try with the 32 bit netbook. It was almost recently out of the box and barely used with any software installed (except for what it was preloaded by Dell). After running the chkdsk I checked on the event log that indeed it found errors, but I can't be certain if those error where there before or if those were caused by the crash. I run sfc aferwards, everything was ok, and it the end run the Game Engine, and BSOD again.

    (I have a new minidump for you, http://cid-225c1f7e262a08bb.office.live.com/self.aspx/.Public/030411-12682-01.dmp)

    Well, yesterday I was able to track the original programer of this game engine. He is working on a new game for a new company where they have a forum in which he participates regularily, so I have posted there inviting him to participate in this discussion. Hopefully he can provide some insight on what is in his old code that triggers this bug in Windows 7.

    (BTW, I also found an old post from him, from the time when the game was release, where he is presenting his Engine as a free tool for creating Adventure Games.

    http://www.mymgn.com/board/showthread.php?12905-Introducing-The-SCream-Engine&p=103230&viewfull=1#post103230)

     

     Do you use the same software on all machines?

    I have also crashed machines that are not mine (from colleagues) installed by themselves. And well, usually most computers have the same software in common... Adobe Flash, Adobe Reader, Oracle Java, Microsoft Office, etc.

    Friday, March 4, 2011 6:35 PM

  • UNEXPECTED_KERNEL_MODE_TRAP (7f)
    This means a trap occurred in kernel mode, and it's a trap of a kind
    that the kernel isn't allowed to have/catch (bound trap) or that
    is always instant death (double fault).  The first number in the
    bugcheck params is the number of the trap (8 = double fault, etc)
    Consult an Intel x86 family manual to learn more about what these
    traps are.
    Arguments:
    Arg1: 00000000, EXCEPTION_DIVIDED_BY_ZERO

    ChildEBP RetAddr  Args to Child             
    nt!KiTrap00+0x8b (FPO: [0,0] TrapFrame @ a85cca48)
    WARNING: Stack unwind information not available. Following frames may be wrong.
    cdd+0x17884


    The minidumps are not useful for UNEXPECTED_KERNEL_MODE_TRAP bug checks.

    Configure your Windows to create a kernel dump [1] and upload the zipped dump (C:\Windows\memory.dmp) to your SkyDrive.

    André

    [1] http://www.brighthub.com/computing/windows-platform/articles/81867.aspx


    "A programmer is just a tool which converts caffeine into code"

    Want to install RSAT on Windows 7 Sp1? Check my HowTo: http://www.msfn.org/board/index.php?showtopic=150221
    Friday, March 4, 2011 7:42 PM
  • Actually, I already have the kernel dump from the crash I produced to the netbook this morning.

    The .zip is almost 60MB and my skydrive has a 50MB limit, so I have uploaded the dump to a personal hosting.

    http://www.paladinsama.com/memorydumps/MEMORY.zip

     

    Friday, March 4, 2011 11:16 PM
  • Hi!

    I'm guy that programmed Scratches. I can tell you where the exact problem is: in the ChangeDisplaySettings() function, I was using a zero to automatically detect the display refresh rate. More specifically, the dmDisplayFrequency in the dmSettings structure was a zero.

    As far as I know, this was definitely permitted in older versions of Windows (XP for sure), even in official documentation. The solution to fix this error in Windows 7 was simply to pass 60, or any other value than 0, as that parameter.

    So I guess that, yes, the actual problem with a divide by zero somewhere. Hope this helps!
    • Proposed as answer by Andre.Ziegler Tuesday, March 8, 2011 1:38 PM
    Saturday, March 5, 2011 2:40 PM
  • Interesting fact. The kernel dumps also shows nothing.

    "A programmer is just a tool which converts caffeine into code"

    Want to install RSAT on Windows 7 Sp1? Check my HowTo: http://www.msfn.org/board/index.php?showtopic=150221
    Saturday, March 5, 2011 3:24 PM
  • Andre, in that case probably you should get the old version of the game engine and crash a test machine yourself to get a complete memory dump. I'll upload the engine (without the game data) to my skydrive when I'm home.

    However as you should have read already, the programmer mentioned the value specified on which structure that will crash Windows 7. http://msdn.microsoft.com/en-us/library/dd183411(v=vs.85).aspx

    Even if the Windows team decided to change the API to make this no longer a good practice they should have prevented the division by zero condition.

    What surprises me is that this problem has been there since the beginning of Windows 7 and it has not been fixed for over 20 months. This could mean 2 things:

    a) Windows users are so used to blue screens, they just restart and think it is normal.

    b) For a user is so difficult to contact Microsoft to make a fix for an easily reproducible problem on Windows, that nobody cares anymore.

    This mentality needs to change.

    Monday, March 7, 2011 9:30 PM
  • Here is the SCream Engine.

    http://cid-225c1f7e262a08bb.office.live.com/self.aspx/.Public/scream%5E_engine.zip

    Save all your documents, close all programs and enjoy the blue scene.

     

    Tuesday, March 8, 2011 2:28 AM
  • Hi Fernando,

    I can reproduce this with Win7 Sp1. Can you contact the creator of this engine and tell what what Agustin Cordes wrote?

    André


    "A programmer is just a tool which converts caffeine into code"

    Want to install RSAT on Windows 7 Sp1? Check my HowTo: http://www.msfn.org/board/index.php?showtopic=150221
    Tuesday, March 8, 2011 1:38 PM
  • You mean the source code?

    When I checked his blog last week, he has telling of the little time he had to update his blog because of the new game he was working in. I'm not sure if he will have the time to find the original source and upload it somewhere but I will give it a try.

    However, even if you find the exact cause of the problem, do you know how to effectively report it to Microsoft so that they can start working on a solution? At this point I was wondering if I would get better attention if I could get a writer from CNet or Wired to write a story about this.

     

    Tuesday, March 8, 2011 3:34 PM
  • to notice MS about it, contact the Microsoft Support.

    "A programmer is just a tool which converts caffeine into code"

    Want to install RSAT on Windows 7 Sp1? Check my HowTo: http://www.msfn.org/board/index.php?showtopic=150221
    Tuesday, March 8, 2011 7:14 PM
  • Yes, but (as somebody already said on another thread I read last week) I would have to pay for the priviledge of reporting a bug.  (Do they still charge $99 for a support ticket?)

     

    Tuesday, March 8, 2011 7:20 PM
  • Hi,

    Here's the code that was causing the crash:

     

    void ChangeToFullScreen() {
     int  result;
     int  bpp = 32;
     DEVMODE dmSettings = {0};
    
     if (!EnumDisplaySettings(NULL, ENUM_CURRENT_SETTINGS, &dmSettings)) {
     	MessageBox(NULL, "Could Not Enum Display Settings", "Error", MB_OK);
      return;
     }
    
     dmSettings.dmPelsWidth 		= g_rRect.right;
     dmSettings.dmPelsHeight 		= g_rRect.bottom;
     dmSettings.dmDisplayFrequency 	= Settings.rate;
     dmSettings.dmFields  		= DM_BITSPERPEL | DM_PELSWIDTH | DM_PELSHEIGHT | DM_DISPLAYFREQUENCY;
    
     if (Settings.depth != -1) {
      if (Settings.depth > 0)
       dmSettings.dmBitsPerPel = Settings.depth;
      else
       do {
        dmSettings.dmBitsPerPel = bpp;
        result = ChangeDisplaySettings(&dmSettings, CDS_TEST);
        bpp = bpp - 8;
        if (bpp == 8)
         break;
       } while (result != DISP_CHANGE_SUCCESSFUL);
     }
    
     result = ChangeDisplaySettings(&dmSettings, CDS_FULLSCREEN);
    
     if (result != DISP_CHANGE_SUCCESSFUL)
     	MessageBox(NULL, "Could not switch to fullscreen mode", "WARNING", MB_OK);
    }

    When Settings.rate is 0, the blue screen is produced.

    Tuesday, March 8, 2011 10:25 PM
  • I'm sorry but I can't post more source code (I no longer maintain this engine). However, I'm fairly positive that this ChangeToFullScreen() function was very isolated as it only references that Settings structure.

    I any case, I thought the problem could be reproduced already. I managed to do it with a completely different code: just send a zero to dmDisplayFrequency and Windows 7 crashes. I'm afraid there's not much else to test here.

    Wednesday, March 9, 2011 1:54 AM
  • In other words, this problem won't get fixed.

    Allow me to recap: "dmSettings.dmDisplayFrequency = 0" crashes Windows. Andre.Ziegler managed to reproduce it. I also did it with a completely different code. What else do you need to know?

    Thursday, March 10, 2011 6:56 PM
  • In other words, this problem won't get fixed.

    If nobody tells the MS support about it, it won't get fixed.

    "A programmer is just a tool which converts caffeine into code"

    Want to install RSAT on Windows 7 Sp1? Check my HowTo: http://www.msfn.org/board/index.php?showtopic=150221
    Thursday, March 10, 2011 8:13 PM
  • set the values you want. I think you're the best at C++ ;)

    "A programmer is just a tool which converts caffeine into code"

    Want to install RSAT on Windows 7 Sp1? Check my HowTo: http://www.msfn.org/board/index.php?showtopic=150221
    Thursday, March 10, 2011 9:55 PM
  • there is nothing wrong. Create a new project, copy/paste the code, replace the values (with, height) with self defined values ;)

    "A programmer is just a tool which converts caffeine into code"

    Want to install RSAT on Windows 7 Sp1? Check my HowTo: http://www.msfn.org/board/index.php?showtopic=150221
    Thursday, March 10, 2011 10:06 PM
  • yes, L = Unicode

    and can you repro it, too?

    "A programmer is just a tool which converts caffeine into code"

    Want to install RSAT on Windows 7 Sp1? Check my HowTo: http://www.msfn.org/board/index.php?showtopic=150221
    Thursday, March 10, 2011 10:56 PM
  • run the code in a sample program. Do you get the crash, too?

    "A programmer is just a tool which converts caffeine into code"

    Want to install RSAT on Windows 7 Sp1? Check my HowTo: http://www.msfn.org/board/index.php?showtopic=150221
    Thursday, March 10, 2011 11:02 PM
  • compiling doesn't crash, Call the function in a sample project.

    "A programmer is just a tool which converts caffeine into code"

    Want to install RSAT on Windows 7 Sp1? Check my HowTo: http://www.msfn.org/board/index.php?showtopic=150221
    Thursday, March 10, 2011 11:04 PM
  • If nobody tells the MS support about it, it won't get fixed.

    But I don't feel like I should have to pay $49 to report a bug that affects every single edition of Windows 7, and should not have existed in first place. Which is why I originally post here, trying to caught the attention of people that works at Microsoft... even the subject of the thread was suggestive.

    Andre, you are the supermoderator of the forum in winvistaside.de, I don't know how many people read the forum, but if you spread the word over there, people will probably start talking, blogging, eventually Microsoft will notice.

     

    What I believe is that Technet forums needs to improve a lot. For example, if 3, 4 or 5 MVPs can agree that a problem is easily reproducible anywhere and that it should be fixed by Microsoft, then they should be able to nominate a thread directly to Microsoft Support, and get a case number.

     

    Thursday, March 10, 2011 11:08 PM
  • I gave it up. Run it and tell us the result.

    "A programmer is just a tool which converts caffeine into code"

    Want to install RSAT on Windows 7 Sp1? Check my HowTo: http://www.msfn.org/board/index.php?showtopic=150221
    Thursday, March 10, 2011 11:15 PM
  • You refuse to provide more code to review, so you have no standing

    I am not a programmer, I didn't create the code. I am just the user who bought the game.

    Agustín created the game, he was helpful enough to provide the code that causes the crash, even though he is busy working in his new project.

    Even if the code was written by a hacker in machine code it would be Microsoft responsability to fix Windows so it won't crash so easily with a single non elevated process.

     

    Thursday, March 10, 2011 11:25 PM
  • An entire thread of mostly complaining about this or that and no one's suggested that maybe, just maybe the problem is in a particular display driver? 

    Has it been reproduced on more than one kind of system?

    -Noel

    Friday, March 11, 2011 1:45 AM
  • @Noel

    A *vast* number of users reported this problem when trying the game on Windows 7. It can be reproduced very easily. To my knowledge, it doesn't depend on the display driver.

     

    @Vegan Fanatic

    I find it truly unbelievable that you keep blaming my code. You're basically saying "this is not the way I do it, so there". Let me repeat this again: the code was working perfectly fine on Windows XP/Vista. It stopped working on Windows 7.

    Even if I accepted that my code is badly designed (and it probably is) there is one fundamental issue here: badly designed code should *not* crash the system. It can cause an exception, it can have a negative impact on performance, but it simply can't crash the entire system. At least not when I'm solely relying on the official API and no strange libs.

     

    This is it for me, folks. I sincerely hope that I helped somehow, but until Microsoft takes this seriously, I won't bother again. And no, I'm definitely not paying those 50 bucks.

    Friday, March 11, 2011 2:34 AM
  • there is one fundamental issue here: badly designed code should *not* crash the system. It can cause an exception, it can have a negative impact on performance, but it simply can't crash the entire system.

    Absolutely, positively correct.  The worst you should be able to do is crash the app.

    Given that it's been seen on multiple systems, and once worked without failure, it probably represents code that was rewritten for Windows 7 without the proper defense against bad parameters.  After all, who would ever set the refresh rate to 0?  :)

    When Win7 first came out we discovered the use of a patterned pen would corrupt the GDI code.  I don't know whether Microsoft ultimately fixed it, but we worked around the problem by doing it another way.  And you're right, they're impossible to reach.  It's clear Microsoft put a lot of resources into walling themselves off from the world.  Maybe this is what you have to do when you have literally millions (billions?) of customers.

    -Noel

    Friday, March 11, 2011 5:16 AM
  • @Vegan Fanatic

    You have been unhelpful, disrespectful and anything but professional on this topic. I'm appalled to see that Microsoft considers you an MVP.

     

    @Noel

    You may have missed the part where I explained that, as far as I recall, sending a zero to dmDisplayFrequency would automatically detect the best refresh rate for the requested resolution. It's been a while since I coded that bit, but I'm fairly positive that I once read in official documentation that it was good practice.

    In any case, like we said: even if it's wrong, the kernel should handle these silly exceptions. And I think it's about time that Microsoft learned a bit from the competition: they also have millions of customers but they simply do better, and they definitely listen.

    Friday, March 11, 2011 1:28 PM
  • set the value to 0 Vegan. 60 and 75 works fine.
    "A programmer is just a tool which converts caffeine into code"

    Want to install RSAT on Windows 7 Sp1? Check my HowTo: http://www.msfn.org/board/index.php?showtopic=150221
    Friday, March 11, 2011 1:49 PM
  • Refresh rate of zero will not work as no display has a zero rate, use real rate and then problems go away.

    are not able to read? The value 0 is used to detect the correct rate. Try it out or no longer SPAM if you can't help.

    "A programmer is just a tool which converts caffeine into code"

    Want to install RSAT on Windows 7 Sp1? Check my HowTo: http://www.msfn.org/board/index.php?showtopic=150221
    Friday, March 11, 2011 2:08 PM
  • @Noel

    You may have missed the part

    I think perhaps you misread my comments.

    I'm agreeing with you 100% that your code is not at fault, and that a new hole has opened up in Windows.

    Sorry for any misunderstanding.

    -Noel

    Friday, March 11, 2011 3:40 PM
  • Noel, no problem at all! I definitely understood you. I simply wanted to stress the reasoning behind that zero, that's all.
    Friday, March 11, 2011 5:38 PM
  • I've been going over the MSDN documentation and have not seen anywhere that the values 1 or 0 are acceptable values for ChangeDisplaySettings, the only reference to these values are where the DEVMODE structure definition indicates that EnumDisplaySettings might return these values for the dmDisplayFrequency member to indicate that it is operating at the default frequency.

    When you call the EnumDisplaySettings function, the dmDisplayFrequency member may return with the value 0 or 1. These values represent the display hardware's default refresh rate. This default rate is typically set by switches on a display card or computer motherboard, or by a configuration program that does not use display functions such as ChangeDisplaySettings.

    The ChangeDisplaySettings documentation states the following.

    To ensure that the DEVMODE structure passed to ChangeDisplaySettings is valid and contains only values supported by the display driver, use the DEVMODE returned by the EnumDisplaySettings function.

    My interpretation is that you need to be assigning a valid frequency to DEVMODE if you're setting the dmField |= DM_DISPLAYFREQUENCY

    Friday, March 11, 2011 6:31 PM