/** * New Win32 exception from HRESULT. * @param hr * HRESULT */ public Win32Exception(HRESULT hr) { super(Kernel32Util.formatMessageFromHR(hr)); _hr = hr; }
/** * Format a system message from an error code. * @param code * Error code, typically a result of GetLastError. * @return * Formatted message. */ public static String formatMessageFromLastErrorCode(int code) { return formatMessageFromHR(W32Errors.HRESULT_FROM_WIN32(code)); }