diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/wasapi/audio_driver_wasapi.cpp | 2 | ||||
-rw-r--r-- | drivers/windows/dir_access_windows.cpp | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/drivers/wasapi/audio_driver_wasapi.cpp b/drivers/wasapi/audio_driver_wasapi.cpp index 276fda2a8f..24c9b69542 100644 --- a/drivers/wasapi/audio_driver_wasapi.cpp +++ b/drivers/wasapi/audio_driver_wasapi.cpp @@ -301,7 +301,7 @@ Error AudioDriverWASAPI::audio_device_init(AudioDeviceWASAPI *p_device, bool p_c } if (using_audio_client_3) { - AudioClientProperties audioProps; + AudioClientProperties audioProps{}; audioProps.cbSize = sizeof(AudioClientProperties); audioProps.bIsOffload = FALSE; audioProps.eCategory = AudioCategory_GameEffects; diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp index f7a5f7279e..ae781e9424 100644 --- a/drivers/windows/dir_access_windows.cpp +++ b/drivers/windows/dir_access_windows.cpp @@ -256,6 +256,11 @@ Error DirAccessWindows::rename(String p_path, String p_new_path) { // If we're only changing file name case we need to do a little juggling if (p_path.to_lower() == p_new_path.to_lower()) { + if (dir_exists(p_path)) { + // The path is a dir; just rename + return ::_wrename((LPCWSTR)(p_path.utf16().get_data()), (LPCWSTR)(p_new_path.utf16().get_data())) == 0 ? OK : FAILED; + } + // The path is a file; juggle WCHAR tmpfile[MAX_PATH]; if (!GetTempFileNameW((LPCWSTR)(fix_path(get_current_dir()).utf16().get_data()), nullptr, 0, tmpfile)) { |