Skip to content

Commit

Permalink
Merged PR 7854069: [Git2Git] Build fixes on top of 704458e
Browse files Browse the repository at this point in the history
Retrieved from https://microsoft.visualstudio.com os.2020 OS official/rs_we_adept_e4d2 4024b6933d446a359a35136053da8b4a8f598d9d

Related work items: MSFT-41327033
  • Loading branch information
DHowett committed Sep 14, 2022
1 parent d21036d commit fba4e22
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/audio/midi/MidiAudio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include <dsound.h>

#pragma comment(lib, "dxguid.lib")
#pragma comment(lib, "dsound.lib")

using Microsoft::WRL::ComPtr;
using namespace std::chrono_literals;
Expand All @@ -20,11 +19,16 @@ constexpr auto WAVE_DATA = std::array<byte, WAVE_SIZE>{ 128, 159, 191, 223, 255,

MidiAudio::MidiAudio(HWND windowHandle)
{
if (SUCCEEDED(DirectSoundCreate8(nullptr, &_directSound, nullptr)))
_directSoundModule.reset(LoadLibraryExW(L"dsound.dll", nullptr, LOAD_LIBRARY_SEARCH_SYSTEM32));
if (_directSoundModule)
{
if (SUCCEEDED(_directSound->SetCooperativeLevel(windowHandle, DSSCL_NORMAL)))
auto createFunction = GetProcAddressByFunctionDeclaration(_directSoundModule.get(), DirectSoundCreate8);
if (SUCCEEDED(createFunction(nullptr, &_directSound, nullptr)))
{
_createBuffers();
if (SUCCEEDED(_directSound->SetCooperativeLevel(windowHandle, DSSCL_NORMAL)))
{
_createBuffers();
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/audio/midi/MidiAudio.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class MidiAudio
private:
void _createBuffers() noexcept;

wil::unique_hmodule _directSoundModule;
Microsoft::WRL::ComPtr<IDirectSound8> _directSound;
std::array<Microsoft::WRL::ComPtr<IDirectSoundBuffer>, 2> _buffers;
size_t _activeBufferIndex = 0;
Expand Down
6 changes: 6 additions & 0 deletions src/interactivity/win32/ut_interactivity_win32/sources
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ DLLDEF =
UNIVERSAL_TEST = 1
TEST_CODE = 1

# -------------------------------------
# Compiler Settings
# -------------------------------------

USE_STD_CPP20 = 1

# -------------------------------------
# Preprocessor Settings
# -------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/interactivity/win32/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ void Window::_UpdateSystemMetrics() const
status = NTSTATUS_FROM_WIN32(HRESULT_CODE((pAtlasEngine->SetHwnd(hWnd))));
}
else
{
#endif
{
status = NTSTATUS_FROM_WIN32(HRESULT_CODE((pGdiEngine->SetHwnd(hWnd))));
}

Expand Down
1 change: 1 addition & 0 deletions src/terminal/parser/ft_fuzzer/sources
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ C_DEFINES = $(C_DEFINES) -DUNICODE -D_UNICODE
# Compiler Settings
# -------------------------------------

USE_STD_CPP20 = 1
MSC_WARNING_LEVEL = /W4 /WX

# -------------------------------------
Expand Down
6 changes: 6 additions & 0 deletions src/terminal/parser/ft_fuzzwrapper/sources
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ C_DEFINES = $(C_DEFINES) -DINLINE_TEST_METHOD_MARKUP -DUNIT_TESTIN

# Code in the OneCore depot automatically excludes default Win32 libraries.

# -------------------------------------
# Compiler Settings
# -------------------------------------

USE_STD_CPP20 = 1

# -------------------------------------
# Sources, Headers, and Libraries
# -------------------------------------
Expand Down

0 comments on commit fba4e22

Please sign in to comment.