Win32: mark all remaining functions as Unicode. NFC.
Some were missing the *W suffix.pull/528/head
parent
69baf52432
commit
64c0f62b92
|
@ -73,9 +73,9 @@ namespace Platform {
|
|||
void CheckLastError(const char *file, int line, const char *function, const char *expr) {
|
||||
if(GetLastError() != S_OK) {
|
||||
LPWSTR messageW;
|
||||
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
(LPWSTR)&messageW, 0, NULL);
|
||||
FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_SYSTEM,
|
||||
NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
|
||||
(LPWSTR)&messageW, 0, NULL);
|
||||
|
||||
std::string message;
|
||||
message += ssprintf("File %s, line %u, function %s:\n", file, line, function);
|
||||
|
@ -203,8 +203,8 @@ public:
|
|||
uint32_t ThawInt(const std::string &key, uint32_t defaultValue) {
|
||||
DWORD value;
|
||||
DWORD type, length = sizeof(value);
|
||||
LSTATUS result = RegQueryValueEx(GetKey(), &Widen(key)[0], 0,
|
||||
&type, (BYTE *)&value, &length);
|
||||
LSTATUS result = RegQueryValueExW(GetKey(), &Widen(key)[0], 0,
|
||||
&type, (BYTE *)&value, &length);
|
||||
if(result == ERROR_SUCCESS && type == REG_DWORD) {
|
||||
return value;
|
||||
}
|
||||
|
@ -219,8 +219,8 @@ public:
|
|||
double ThawFloat(const std::string &key, double defaultValue) {
|
||||
double value;
|
||||
DWORD type, length = sizeof(value);
|
||||
LSTATUS result = RegQueryValueEx(GetKey(), &Widen(key)[0], 0,
|
||||
&type, (BYTE *)&value, &length);
|
||||
LSTATUS result = RegQueryValueExW(GetKey(), &Widen(key)[0], 0,
|
||||
&type, (BYTE *)&value, &length);
|
||||
if(result == ERROR_SUCCESS && type == REG_QWORD) {
|
||||
return value;
|
||||
}
|
||||
|
@ -237,13 +237,13 @@ public:
|
|||
|
||||
std::string ThawString(const std::string &key, const std::string &defaultValue) {
|
||||
DWORD type, length = 0;
|
||||
LSTATUS result = RegQueryValueEx(GetKey(), &Widen(key)[0], 0,
|
||||
&type, NULL, &length);
|
||||
LSTATUS result = RegQueryValueExW(GetKey(), &Widen(key)[0], 0,
|
||||
&type, NULL, &length);
|
||||
if(result == ERROR_SUCCESS && type == REG_SZ) {
|
||||
std::wstring valueW;
|
||||
valueW.resize(length / 2 - 1);
|
||||
sscheck(RegQueryValueEx(GetKey(), &Widen(key)[0], 0,
|
||||
&type, (BYTE *)&valueW[0], &length));
|
||||
sscheck(RegQueryValueExW(GetKey(), &Widen(key)[0], 0,
|
||||
&type, (BYTE *)&valueW[0], &length));
|
||||
return Narrow(valueW);
|
||||
}
|
||||
return defaultValue;
|
||||
|
@ -538,7 +538,7 @@ public:
|
|||
static bool registered;
|
||||
if(registered) return;
|
||||
|
||||
WNDCLASSEX wc = {};
|
||||
WNDCLASSEXW wc = {};
|
||||
wc.cbSize = sizeof(wc);
|
||||
wc.style = CS_BYTEALIGNCLIENT|CS_BYTEALIGNWINDOW|CS_OWNDC|CS_DBLCLKS;
|
||||
wc.lpfnWndProc = WndProc;
|
||||
|
@ -549,7 +549,7 @@ public:
|
|||
IMAGE_ICON, 16, 16, 0);
|
||||
wc.hCursor = LoadCursorW(NULL, IDC_ARROW);
|
||||
wc.lpszClassName = L"SolveSpace";
|
||||
sscheck(RegisterClassEx(&wc));
|
||||
sscheck(RegisterClassExW(&wc));
|
||||
registered = true;
|
||||
}
|
||||
|
||||
|
@ -702,7 +702,7 @@ public:
|
|||
// The wndproc may be called from within CreateWindowEx, and before we've associated
|
||||
// the window with the WindowImplWin32. In that case, just defer to the default wndproc.
|
||||
if(window == NULL) {
|
||||
return DefWindowProc(h, msg, wParam, lParam);
|
||||
return DefWindowProcW(h, msg, wParam, lParam);
|
||||
}
|
||||
|
||||
#if defined(HAVE_SPACEWARE)
|
||||
|
@ -999,7 +999,7 @@ public:
|
|||
sscheck(SetForegroundWindow(hParent));
|
||||
break;
|
||||
} else {
|
||||
return DefWindowProc(h, msg, wParam, lParam);
|
||||
return DefWindowProcW(h, msg, wParam, lParam);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1042,7 +1042,7 @@ public:
|
|||
}
|
||||
|
||||
default:
|
||||
return DefWindowProc(h, msg, wParam, lParam);
|
||||
return DefWindowProcW(h, msg, wParam, lParam);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in New Issue