Why does this script BSOD-ize windows ?

Baz via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jul 21 03:36:43 PDT 2015


On Tuesday, 21 July 2015 at 10:28:27 UTC, Rikki Cattermole wrote:
> On 21/07/2015 10:14 p.m., Baz wrote:
>> ---
>> import std.process;
>> import core.thread;
>> import std.random;
>>
>> void main(string[] args)
>> {
>>      string on = "netsh interface set interface \"Connexion au 
>> réseau
>> local\" Enable";
>>      string off = "netsh interface set interface \"Connexion 
>> au réseau
>> local\" Disable";
>>
>>      while(true)
>>      {
>>          executeShell(on);
>>          Thread.sleep(dur!("msecs")(uniform(2000, 5000)));
>>          executeShell(off);
>>          Thread.sleep(dur!("msecs")(2000));
>>      }
>> }
>> ---
>>
>> It's stable if i remove the random time after connecting, 
>> otherwise in
>> the current shape it crashes Windows. Don't know why. Any idea 
>> ?
>>
>> Note that you can test by replacing the name of my interface 
>> by yours
>> ('Connexion au réseau local').
>
> This shouldn't be a D bug, it's reasonable D code.
> Can you give us the BSOD text?
> Also OS version + platform would be nice.
>
> I've asked a friend who knows Windows better then anybody 
> should and basically relaying this to him FYI.

- Window 7 64 bit (up to date) but the program is running in 32 
bit, compiled with latest DMD 2.067.1.
- involved hardware is onboard REALTEK on Gigabyte H97-HD3, 
driver up to date.

I have not the BSOD error code because I ran this script while 
away.


More information about the Digitalmars-d-learn mailing list