@440bx, okay since you are not stopping to blame my code, you have my full working testcode, make it crash boom bang, can you?
If you managed to make it crash, show what you modified that it can crash.
You're missing the whole point. That definition of WriteFile is wrong and, as I stated in a previous post, the fact that it can be made to work does _not_ change that. It is still wrong.
I and, just about anyone, can make that incorrect definition work too, as a matter of fact, I have throw away code (that I haven't thrown away yet) that uses it. (guess how I noticed the definition is wrong)
What neither you nor anyone can do, is code a call to WriteFile that complies with MS' spec (the author of the function) using the Pascal definition and make it work. No one can. The reason: because the Pascal definition is _wrong_.
Lastly, it isn't about your code, it is about the Pascal definition being wrong/incorect. That's what it's about.
Programming seems to be the premier activity where errors are worshiped and perpetuated. We "cannot correct that" (whatever "that" may be) because it would break a lot of wrong code we have and we don't want to correct the code (too much work), if we did, we'd have to test again and we'd run the risk of missing a side effect brought about by the correction. Can't have that. Instead, we'll claim it's not wrong, just not "equivalent".
However, in spite of the definition because wrong/incorrect, all those who pretend it is not, are _absolutely right_.
I'm going to call that "binary diplomacy".