Windows API - GetLastError woes

Neil Mitchell ndmitchell at gmail.com
Mon Aug 28 09:16:17 EDT 2006


Hi

> If there is no better solution, would it be possible on failure to somehow
> enter a critical section and repeat the call that caused the failure and
> then call get last error and exit the critical section so that normal calls
> would be fast but only failed calls would be slow?

No. This isn't Haskell - this is the Windows API. Some functions i.e.
DeleteFile might fail differently different times round, plus you
could cause unimaginable damage by arbitrarily redoing certain
actions.

It might be safe for some subset of commands, but I'd be vary wary
about specifying that subset. Getting it wrong is going to cause a lot
of pain.

Thanks

Neil


More information about the Glasgow-haskell-users mailing list