mirror of
https://github.com/pbatard/rufus.git
synced 2025-06-04 16:53:54 -04:00
[misc] move I/O functions into their own source
This commit is contained in:
parent
08d68301cd
commit
bc252400a1
9 changed files with 148 additions and 112 deletions
29
stdlg.c
29
stdlg.c
|
@ -75,35 +75,6 @@ static HWND hBrowseEdit;
|
|||
static WNDPROC pOrgBrowseWndproc;
|
||||
HFONT hBoldFont = NULL;
|
||||
|
||||
/*
|
||||
* Convert a windows error to human readable string
|
||||
* uses retval as errorcode, or, if 0, use GetLastError()
|
||||
*/
|
||||
char *WindowsErrorString(void)
|
||||
{
|
||||
static char err_string[256];
|
||||
|
||||
DWORD size;
|
||||
DWORD error_code, format_error;
|
||||
|
||||
error_code = GetLastError();
|
||||
|
||||
safe_sprintf(err_string, sizeof(err_string), "[%d] ", error_code);
|
||||
|
||||
size = FormatMessageU(FORMAT_MESSAGE_FROM_SYSTEM, NULL, error_code,
|
||||
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), &err_string[strlen(err_string)],
|
||||
sizeof(err_string)-(DWORD)strlen(err_string), NULL);
|
||||
if (size == 0) {
|
||||
format_error = GetLastError();
|
||||
if (format_error)
|
||||
safe_sprintf(err_string, sizeof(err_string),
|
||||
"Windows error code %u (FormatMessage error code %u)", error_code, format_error);
|
||||
else
|
||||
safe_sprintf(err_string, sizeof(err_string), "Unknown error code %u", error_code);
|
||||
}
|
||||
return err_string;
|
||||
}
|
||||
|
||||
/*
|
||||
* Detect Windows version
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue