Re: ErrnoException in Windows

2015-03-01 Thread novice2 via Digitalmars-d-learn
Ha, i found std.windows.syserror: WindowsException, wenforce;

Re: ErrnoException in Windows

2015-03-01 Thread novice2 via Digitalmars-d-learn
Thans guys! wenforce not sutable - error code is lost. may be, i will use modified wenforce, wich throws ErrnoException.

Re: ErrnoException in Windows

2015-03-01 Thread Vladimir Panteleev via Digitalmars-d-learn
On Sunday, 1 March 2015 at 16:39:29 UTC, novice2 wrote: I wanted it will be: ex.errno=2, ex.msg=CreateFileA (File not found), lasterror=2 Here's the right way to do this: // test.d // import std.c.windows.windows; import std.string : toStringz; i

Re: ErrnoException in Windows

2015-03-01 Thread ketmar via Digitalmars-d-learn
On Sun, 01 Mar 2015 16:39:27 +, novice2 wrote: > Could you, please, help me to understand, why code: 'cause winapi functions never sets `errno`. `errno` is a libc feature, and winapi knows nothing about libc. besides, `GetLastError()` is not required to return correct errno codes. so you h

ErrnoException in Windows

2015-03-01 Thread novice2 via Digitalmars-d-learn
Could you, please, help me to understand, why code: import std.c.windows.windows; import std.exception: ErrnoException; import std.stdio: writefln; import std.string: toStringz; void main () { CreateFileA(toStringz("nonexisting file name"), GENERIC_READ, FILE_SHARE_READ, null