Skip to content
Snippets Groups Projects
Commit 252cb50c authored by Oz Linden's avatar Oz Linden
Browse files

merge changes for storm-1088

parents 3f9a2dc4 d1ba34a8
Branches
No related tags found
No related merge requests found
...@@ -66,7 +66,9 @@ viewer-pre-release.viewer_channel = "Second Life Release" ...@@ -66,7 +66,9 @@ viewer-pre-release.viewer_channel = "Second Life Release"
viewer-pre-release.login_channel = "Second Life Release" viewer-pre-release.login_channel = "Second Life Release"
viewer-pre-release.build_debug_release_separately = true viewer-pre-release.build_debug_release_separately = true
viewer-pre-release.build_viewer_update_version_manager = true viewer-pre-release.build_viewer_update_version_manager = true
viewer-pre-release.release-viewer.jira = DRTVWR-42
#viewer-pre-release.release-viewer.jira = DRTVWR-13 #viewer-pre-release.release-viewer.jira = DRTVWR-13
viewer-pre-release.release-viewer.jira = DRTVWR-46
# ======================================= # =======================================
# brad # brad
......
...@@ -710,6 +710,7 @@ Shawn Kaufmat ...@@ -710,6 +710,7 @@ Shawn Kaufmat
SNOW-240 SNOW-240
Siana Gearz Siana Gearz
STORM-960 STORM-960
STORM-1088
SignpostMarv Martin SignpostMarv Martin
VWR-153 VWR-153
VWR-154 VWR-154
......
This diff is collapsed.
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include <mmsystem.h> #include <mmsystem.h>
void init_function_pointers(HMODULE winmm_handle); void init_function_pointers(HMODULE winmm_handle);
void ll_winmm_shim_initialize();
typedef VOID (*LPTASKCALLBACK)(DWORD_PTR dwInst); typedef VOID (*LPTASKCALLBACK)(DWORD_PTR dwInst);
......
...@@ -32,14 +32,21 @@ using std::wstring; ...@@ -32,14 +32,21 @@ using std::wstring;
static float sVolumeLevel = 1.f; static float sVolumeLevel = 1.f;
static bool sMute = false; static bool sMute = false;
static CRITICAL_SECTION sCriticalSection;
BOOL APIENTRY DllMain( HMODULE hModule, BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call, DWORD ul_reason_for_call,
LPVOID lpReserved LPVOID lpReserved
) )
{ {
InitializeCriticalSection(&sCriticalSection);
return TRUE;
}
void ll_winmm_shim_initialize(){
static bool initialized = false; static bool initialized = false;
// do this only once // do this only once
EnterCriticalSection(&sCriticalSection);
if (!initialized) if (!initialized)
{ // bind to original winmm.dll { // bind to original winmm.dll
TCHAR system_path[MAX_PATH]; TCHAR system_path[MAX_PATH];
...@@ -54,13 +61,15 @@ BOOL APIENTRY DllMain( HMODULE hModule, ...@@ -54,13 +61,15 @@ BOOL APIENTRY DllMain( HMODULE hModule,
{ // we have a dll, let's get out pointers! { // we have a dll, let's get out pointers!
initialized = true; initialized = true;
init_function_pointers(winmm_handle); init_function_pointers(winmm_handle);
return true; ::OutputDebugStringA("WINMM_SHIM.DLL: real winmm.dll initialized successfully\n");
} }
else
{
// failed to initialize real winmm.dll // failed to initialize real winmm.dll
return false; ::OutputDebugStringA("WINMM_SHIM.DLL: Failed to initialize real winmm.dll\n");
}
} }
return true; LeaveCriticalSection(&sCriticalSection);
} }
...@@ -79,6 +88,7 @@ extern "C" ...@@ -79,6 +88,7 @@ extern "C"
MMRESULT WINAPI waveOutOpen( LPHWAVEOUT phwo, UINT uDeviceID, LPCWAVEFORMATEX pwfx, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen) MMRESULT WINAPI waveOutOpen( LPHWAVEOUT phwo, UINT uDeviceID, LPCWAVEFORMATEX pwfx, DWORD_PTR dwCallback, DWORD_PTR dwInstance, DWORD fdwOpen)
{ {
ll_winmm_shim_initialize();
if (pwfx->wFormatTag != WAVE_FORMAT_PCM if (pwfx->wFormatTag != WAVE_FORMAT_PCM
|| (pwfx->wBitsPerSample != 8 && pwfx->wBitsPerSample != 16)) || (pwfx->wBitsPerSample != 8 && pwfx->wBitsPerSample != 16))
{ // uncompressed 8 and 16 bit sound are the only types we support { // uncompressed 8 and 16 bit sound are the only types we support
...@@ -97,6 +107,7 @@ extern "C" ...@@ -97,6 +107,7 @@ extern "C"
MMRESULT WINAPI waveOutClose( HWAVEOUT hwo) MMRESULT WINAPI waveOutClose( HWAVEOUT hwo)
{ {
ll_winmm_shim_initialize();
wave_out_map_t::iterator found_it = sWaveOuts.find(hwo); wave_out_map_t::iterator found_it = sWaveOuts.find(hwo);
if (found_it != sWaveOuts.end()) if (found_it != sWaveOuts.end())
{ // forget what we know about this handle { // forget what we know about this handle
...@@ -108,6 +119,7 @@ extern "C" ...@@ -108,6 +119,7 @@ extern "C"
MMRESULT WINAPI waveOutWrite( HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh) MMRESULT WINAPI waveOutWrite( HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh)
{ {
ll_winmm_shim_initialize();
MMRESULT result = MMSYSERR_NOERROR; MMRESULT result = MMSYSERR_NOERROR;
if (sMute) if (sMute)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment