this is the code snippet:
http://ideone.com/arIAm
on MinGW 4.6.1 the output is : "dwLastError 0"
on MinGW 4.5.0 and 4.5.2 its : "dwLastError 1337" which is the desired
output.
if i write the foobar function like this :
http://ideone.com/5XX80
then it also works on 4.6.1 with "dwLastError 1337".
I dont know what exactly is going on, but i think it could be a MinGW bug. What do you think?
greetings
Well not, MinGW, particularly but maybe GCC. Does it work if you change
throw Win32Exception(GetLastError());
to
throw Win32Exception((DWORD)GetLastError());
--
Earnie
-- https://sites.google.com/site/earnieboyd
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
MinGW-users mailing list
MinGW...@lists.sourceforge.net
This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same. Disregard for the list etiquette may cause your account to be moderated.
_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-use...@lists.sourceforge.net?subject=unsubscribe
No it doesnt help. I only can assume about possible reasons for this
behaviour. Maybe someone has a explanation for it, or its simply a bug.
greetings
Can this be fixed please ? I have just run into it, and I think it is a
bug because it breaks functionality in Windows API (from the user's
perspective).
I used an API monitoring application, that would list all WinAPI
functions that are being called by my program, and so I find that on the
first throw statement (before the first Win32Exception is constructed)
there are several several other system calls before my call to
GetLastError(): malloc() which calls HeapAlloc(),
InterlockedIncrement(), InterlockedDecrement(), CreateSemaphore(),
TlsAlloc() and GetLastError().
Of these, CreateSempahore() was the first to reset the value of
GetLastError().
The calls are listed as originating from that libgcc_s_dw2-1.dll file,
except for malloc which was originating from libstdc++.
I can understand that exceptions may need additional maintenance from
the support libraries, but I think such libraries should save and
restore the value of GetLastError() if they need to change it.
I can post the example program and the list of API and .dll calls if
anyone is interested.
Thank you,
Timothy Madden
------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here
http://p.sf.net/sfu/sfd2d-msazure
Not, here. You'll have to take it up with GCC and LIBSTDC++ lists.
We use the sources as distributed by GCC.
--
Earnie
-- https://sites.google.com/site/earnieboyd
------------------------------------------------------------------------------