Posted by: Christian Wimmer in: JEDI Windows Security Code Lib
Because exceptions are more likely to be noticed.
Nearly all Windows API functions use boolean return values in combination with GetLastError. However a programmer is not binded to check for a return value or use GetLastError. In contrast to return values, exceptions are more shattering. You have to catch them or otherwise the following code will not be executed. Code which is executed but that also depends on a successful call may go crazy and do unpredictable stuff.
However if you are going to do this…
… it is your fault and you should pray that the following code works at all.