<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Mar 31, 2013 at 7:21 PM, Lars T. Kyllingstad <span dir="ltr"><<a href="mailto:public@kyllingen.net" target="_blank">public@kyllingen.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><rant><br>
While working on std.process, I have developed a deep and intense loathing for Windows process handling in particular, and the Win32 API in general.<br>
<br>
On Windows XP, what do you think will happen when you run the following program?<br>
<br>
    int main()<br>
    {<br>
        if (TerminateProcess(INVALID_<u></u>HANDLE_VALUE, 123))<br>
        {<br>
            writeln("TerminateProcess succeeded, but it shouldn't have...");<br>
            return 1;<br>
        }<br>
        else<br>
        {<br>
            writeln("TerminateProcess failed, as it should.");<br>
            return 0;<br>
        }<br>
    }<br>
<br>
As you may already have guessed, it does *not* print "TerminateProcess failed" and exit with code 0.<br>
<br>
But does it print "TerminateProcess succeeded" and exit with code 1? NO! It prints NOTHING and exits with code 123, because TerminateProcess() terminates the CURRENT process when it is passed INVALID_HANDLE_VALUE.  Aaaaargh!<br>

</rant><br>
<br>
Sorry, just had to get that off my chest.  I just spent quite some time trying to figure out why the Win32 unittests were failing when there was no assert error or any other indication of what went wrong.<br>
</blockquote></div><br><agreement></div><div class="gmail_extra"><br></div><div class="gmail_extra" style>I used to hate Windows for similar reasons. I hated it with passion. I dreamed of devoting my life to the goal of putting Microsoft out of busyness to avenge the loss of countless hours of trying to get things to work as they say they should.</div>
<div class="gmail_extra" style><br></div><div class="gmail_extra" style>I ended my misery by buying an Apple MacBook Air and I couldn't be happier. The development environment is a bit unusual (needs some tweaking to become full-fledged posix development environment), but worth the time and money. OS X is the absolute best operating system I ever had to work with. It's system API (cocoa) makes so much more sense (despite being a bit hard to access via C ABI).</div>
<div class="gmail_extra" style><br></div><div class="gmail_extra" style>I really recommend you to ditch that excuse for an operating system and forget it like a bad dream.</div><div class="gmail_extra"><br></div><div class="gmail_extra">
</agreement><br clear="all"><div><br></div>-- <br>Bye,<br>Gor Gyolchanyan.
</div></div>