mirror of https://github.com/pbatard/rufus.git
[core] Fix for Get/SetThreadUILanguage() not being available on XP
* This addresses the issue reported in #274:
Unable to access kernel32 DLL: [0x0000007F] The specified procedure could not be found.
* Problem was introduced in 897becd290
which was added for #189.
This commit is contained in:
parent
52076d974d
commit
d887978192
12
src/format.c
12
src/format.c
|
@ -67,8 +67,6 @@ static void OutputUTF8Message(const char* src)
|
||||||
int len;
|
int len;
|
||||||
char *dst = NULL;
|
char *dst = NULL;
|
||||||
wchar_t* wdst = NULL;
|
wchar_t* wdst = NULL;
|
||||||
PF_DECL(GetThreadUILanguage);
|
|
||||||
PF_INIT_OR_OUT(GetThreadUILanguage, kernel32);
|
|
||||||
|
|
||||||
if (src == NULL)
|
if (src == NULL)
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -78,7 +76,6 @@ static void OutputUTF8Message(const char* src)
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (PRIMARYLANGID(pfGetThreadUILanguage()) != LANG_ENGLISH) {
|
|
||||||
len = MultiByteToWideChar(CP_OEMCP, 0, src, len, NULL, 0);
|
len = MultiByteToWideChar(CP_OEMCP, 0, src, len, NULL, 0);
|
||||||
if (len == 0)
|
if (len == 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
@ -89,9 +86,6 @@ static void OutputUTF8Message(const char* src)
|
||||||
if (dst == NULL)
|
if (dst == NULL)
|
||||||
goto out;
|
goto out;
|
||||||
uprintf("%s", dst);
|
uprintf("%s", dst);
|
||||||
} else {
|
|
||||||
uprintf("%s", src);
|
|
||||||
}
|
|
||||||
|
|
||||||
out:
|
out:
|
||||||
safe_free(dst);
|
safe_free(dst);
|
||||||
|
@ -1178,8 +1172,8 @@ DWORD WINAPI FormatThread(LPVOID param)
|
||||||
FILE* log_fd;
|
FILE* log_fd;
|
||||||
PF_DECL(GetThreadUILanguage);
|
PF_DECL(GetThreadUILanguage);
|
||||||
PF_DECL(SetThreadUILanguage);
|
PF_DECL(SetThreadUILanguage);
|
||||||
PF_INIT_OR_OUT(GetThreadUILanguage, kernel32);
|
PF_INIT(GetThreadUILanguage, kernel32);
|
||||||
PF_INIT_OR_OUT(SetThreadUILanguage, kernel32);
|
PF_INIT(SetThreadUILanguage, kernel32);
|
||||||
|
|
||||||
fs = (int)ComboBox_GetItemData(hFileSystem, ComboBox_GetCurSel(hFileSystem));
|
fs = (int)ComboBox_GetItemData(hFileSystem, ComboBox_GetCurSel(hFileSystem));
|
||||||
dt = (int)ComboBox_GetItemData(hBootType, ComboBox_GetCurSel(hBootType));
|
dt = (int)ComboBox_GetItemData(hBootType, ComboBox_GetCurSel(hBootType));
|
||||||
|
@ -1471,7 +1465,7 @@ DWORD WINAPI FormatThread(LPVOID param)
|
||||||
// NTFS fixup (WinPE/AIK images don't seem to boot without an extra checkdisk)
|
// NTFS fixup (WinPE/AIK images don't seem to boot without an extra checkdisk)
|
||||||
if ((dt == DT_ISO) && (fs == FS_NTFS)) {
|
if ((dt == DT_ISO) && (fs == FS_NTFS)) {
|
||||||
// Try to ensure that all messages from Checkdisk will be in English
|
// Try to ensure that all messages from Checkdisk will be in English
|
||||||
if (PRIMARYLANGID(pfGetThreadUILanguage()) != LANG_ENGLISH) {
|
if ((pfGetThreadUILanguage != NULL) && (PRIMARYLANGID(pfGetThreadUILanguage()) != LANG_ENGLISH)) {
|
||||||
pfSetThreadUILanguage(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
pfSetThreadUILanguage(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US));
|
||||||
if (PRIMARYLANGID(pfGetThreadUILanguage()) != LANG_ENGLISH)
|
if (PRIMARYLANGID(pfGetThreadUILanguage()) != LANG_ENGLISH)
|
||||||
uprintf("Note: CheckDisk messages may be localized");
|
uprintf("Note: CheckDisk messages may be localized");
|
||||||
|
|
10
src/rufus.rc
10
src/rufus.rc
|
@ -33,7 +33,7 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
|
||||||
IDD_DIALOG DIALOGEX 12, 12, 206, 329
|
IDD_DIALOG DIALOGEX 12, 12, 206, 329
|
||||||
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_CAPTION | WS_SYSMENU
|
||||||
EXSTYLE WS_EX_APPWINDOW
|
EXSTYLE WS_EX_APPWINDOW
|
||||||
CAPTION "Rufus v1.4.2.383"
|
CAPTION "Rufus v1.4.2.384"
|
||||||
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
FONT 8, "MS Shell Dlg", 400, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
|
DEFPUSHBUTTON "Start",IDC_START,94,291,50,14
|
||||||
|
@ -288,8 +288,8 @@ END
|
||||||
//
|
//
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
VS_VERSION_INFO VERSIONINFO
|
||||||
FILEVERSION 1,4,2,383
|
FILEVERSION 1,4,2,384
|
||||||
PRODUCTVERSION 1,4,2,383
|
PRODUCTVERSION 1,4,2,384
|
||||||
FILEFLAGSMASK 0x3fL
|
FILEFLAGSMASK 0x3fL
|
||||||
#ifdef _DEBUG
|
#ifdef _DEBUG
|
||||||
FILEFLAGS 0x1L
|
FILEFLAGS 0x1L
|
||||||
|
@ -306,13 +306,13 @@ BEGIN
|
||||||
BEGIN
|
BEGIN
|
||||||
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
|
VALUE "CompanyName", "Akeo Consulting (http://akeo.ie)"
|
||||||
VALUE "FileDescription", "Rufus"
|
VALUE "FileDescription", "Rufus"
|
||||||
VALUE "FileVersion", "1.4.2.383"
|
VALUE "FileVersion", "1.4.2.384"
|
||||||
VALUE "InternalName", "Rufus"
|
VALUE "InternalName", "Rufus"
|
||||||
VALUE "LegalCopyright", "© 2011-2014 Pete Batard (GPL v3)"
|
VALUE "LegalCopyright", "© 2011-2014 Pete Batard (GPL v3)"
|
||||||
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
|
VALUE "LegalTrademarks", "http://www.gnu.org/copyleft/gpl.html"
|
||||||
VALUE "OriginalFilename", "rufus.exe"
|
VALUE "OriginalFilename", "rufus.exe"
|
||||||
VALUE "ProductName", "Rufus"
|
VALUE "ProductName", "Rufus"
|
||||||
VALUE "ProductVersion", "1.4.2.383"
|
VALUE "ProductVersion", "1.4.2.384"
|
||||||
END
|
END
|
||||||
END
|
END
|
||||||
BLOCK "VarFileInfo"
|
BLOCK "VarFileInfo"
|
||||||
|
|
Loading…
Reference in New Issue