GetLastError. Note that some Win32 functions don't set the error code – see the MSDN documentation for details.
pdfClearWin32ErrorInfo first to clear any saved function name
and error code.
Each thread has its own, independent saved error function and code.
This function is only available on Windows.
Win32 error info is currently saved only for printing functions.