diff --git a/source/modules/water/common.hpp b/source/modules/water/common.hpp index bf449d42f..73eab7b45 100644 --- a/source/modules/water/common.hpp +++ b/source/modules/water/common.hpp @@ -41,9 +41,9 @@ namespace water static inline Result getResultForLastError() { - TCHAR messageBuffer [256] = { 0 }; + CHAR messageBuffer [256] = { 0 }; - FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + FormatMessageA (FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, nullptr, GetLastError(), MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), messageBuffer, (DWORD) numElementsInArray (messageBuffer) - 1, nullptr); diff --git a/source/modules/water/files/FileInputStream.cpp b/source/modules/water/files/FileInputStream.cpp index a8bfd67fe..04bd284d8 100644 --- a/source/modules/water/files/FileInputStream.cpp +++ b/source/modules/water/files/FileInputStream.cpp @@ -91,8 +91,8 @@ FileInputStream::~FileInputStream() void FileInputStream::openHandle() { - HANDLE h = CreateFile (file.getFullPathName().toUTF8(), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, - OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, 0); + HANDLE h = CreateFileA (file.getFullPathName().toUTF8(), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL | FILE_FLAG_SEQUENTIAL_SCAN, 0); if (h != INVALID_HANDLE_VALUE) fileHandle = (void*) h; diff --git a/source/modules/water/files/FileOutputStream.cpp b/source/modules/water/files/FileOutputStream.cpp index eb7d653e2..ead60c07d 100644 --- a/source/modules/water/files/FileOutputStream.cpp +++ b/source/modules/water/files/FileOutputStream.cpp @@ -139,8 +139,8 @@ bool FileOutputStream::writeRepeatedByte (uint8 byte, size_t numBytes) #ifdef CARLA_OS_WIN void FileOutputStream::openHandle() { - HANDLE h = CreateFile (file.getFullPathName().toUTF8(), GENERIC_WRITE, FILE_SHARE_READ, 0, - OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); + HANDLE h = CreateFileA (file.getFullPathName().toUTF8(), GENERIC_WRITE, FILE_SHARE_READ, 0, + OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); if (h != INVALID_HANDLE_VALUE) { diff --git a/source/modules/water/threads/ChildProcess.cpp b/source/modules/water/threads/ChildProcess.cpp index 54b0c4e5f..012366a2a 100644 --- a/source/modules/water/threads/ChildProcess.cpp +++ b/source/modules/water/threads/ChildProcess.cpp @@ -49,13 +49,13 @@ public: ActiveProcess (const String& command) : ok (false) { - STARTUPINFO startupInfo; + STARTUPINFOA startupInfo; carla_zeroStruct(startupInfo); startupInfo.cb = sizeof (startupInfo); - ok = CreateProcess (nullptr, const_cast(command.toRawUTF8()), - nullptr, nullptr, TRUE, CREATE_NO_WINDOW | CREATE_UNICODE_ENVIRONMENT, - nullptr, nullptr, &startupInfo, &processInfo) != FALSE; + ok = CreateProcessA (nullptr, const_cast(command.toRawUTF8()), + nullptr, nullptr, TRUE, CREATE_NO_WINDOW | CREATE_UNICODE_ENVIRONMENT, + nullptr, nullptr, &startupInfo, &processInfo) != FALSE; } ~ActiveProcess() @@ -164,7 +164,7 @@ public: // posix_spawnattr_setflags(&attr, POSIX_SPAWN_USEVFORK); CARLA_SAFE_ASSERT_RETURN(posix_spawnattr_setbinpref_np(&attr, 1, &pref, nullptr) == 0,); char*** const environptr = _NSGetEnviron(); - CARLA_SAFE_ASSERT_RETURN(posix_spawn(&result, exe.toRawUTF8(), nullptr, &attr, + CARLA_SAFE_ASSERT_RETURN(posix_spawn(&result, exe.toRawUTF8(), nullptr, &attr, argv.getRawDataPointer(), environptr != nullptr ? *environptr : nullptr) == 0,); posix_spawnattr_destroy(&attr); #else diff --git a/source/utils/CarlaPipeUtils.cpp b/source/utils/CarlaPipeUtils.cpp index bb9696223..f6954dcff 100644 --- a/source/utils/CarlaPipeUtils.cpp +++ b/source/utils/CarlaPipeUtils.cpp @@ -241,7 +241,7 @@ bool startProcess(const char* const argv[], PROCESS_INFORMATION* const processIn command = command.trim(); - STARTUPINFO startupInfo; + STARTUPINFOA startupInfo; carla_zeroStruct(startupInfo); startupInfo.cb = sizeof(startupInfo); diff --git a/source/utils/CarlaPluginUI.cpp b/source/utils/CarlaPluginUI.cpp index 50d63cfd4..497ee5216 100644 --- a/source/utils/CarlaPluginUI.cpp +++ b/source/utils/CarlaPluginUI.cpp @@ -904,7 +904,7 @@ public: fWindowClass.hCursor = LoadCursor(hInstance, IDC_ARROW); fWindowClass.lpszClassName = strdup(classNameBuf); - if (!RegisterClass(&fWindowClass)) { + if (!RegisterClassA(&fWindowClass)) { free((void*)fWindowClass.lpszClassName); return; } @@ -922,18 +922,18 @@ public: const HWND parent = (HWND)parentId; #endif - fWindow = CreateWindowEx(winType, - classNameBuf, "Carla Plugin UI", winFlags, - CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - parent, nullptr, - hInstance, nullptr); + fWindow = CreateWindowExA(winType, + classNameBuf, "Carla Plugin UI", winFlags, + CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, + parent, nullptr, + hInstance, nullptr); if (fWindow == nullptr) { const DWORD errorCode = ::GetLastError(); carla_stderr2("CreateWindowEx failed with error code 0x%x, class name was '%s'", errorCode, fWindowClass.lpszClassName); - UnregisterClass(fWindowClass.lpszClassName, nullptr); + UnregisterClassA(fWindowClass.lpszClassName, nullptr); free((void*)fWindowClass.lpszClassName); return; } @@ -964,7 +964,7 @@ public: } // FIXME - UnregisterClass(fWindowClass.lpszClassName, nullptr); + UnregisterClassA(fWindowClass.lpszClassName, nullptr); free((void*)fWindowClass.lpszClassName); } @@ -1125,7 +1125,7 @@ private: HWND fWindow; HWND fChildWindow; HWND fParentWindow; - WNDCLASS fWindowClass; + WNDCLASSA fWindowClass; bool fIsVisible; bool fFirstShow;