merge back fixes for STORM-1088 and (possibly) STORM-1141

master
Oz Linden 2011-04-21 14:30:58 -04:00
commit 49ecf8efbc
6 changed files with 200 additions and 10 deletions

View File

@ -156,11 +156,12 @@ media.build_viewer_update_version_manager = false
# ================
oz_viewer-devreview.build_debug_release_separately = true
oz-project-1.build_debug_release_separately = true
oz-project-2.build_debug_release_separately = true
oz_project-1.build_debug_release_separately = true
oz_project-2.build_debug_release_separately = true
oz-project-3.build_debug_release_separately = true
oz_viewer-beta-review.build_debug_release_separately = true
# ========================================
# enus
# ========================================

View File

@ -710,6 +710,7 @@ Shawn Kaufmat
SNOW-240
Siana Gearz
STORM-960
STORM-1088
SignpostMarv Martin
VWR-153
VWR-154

File diff suppressed because it is too large Load Diff

View File

@ -30,6 +30,7 @@
#include <mmsystem.h>
void init_function_pointers(HMODULE winmm_handle);
void ll_winmm_shim_initialize();
typedef VOID (*LPTASKCALLBACK)(DWORD_PTR dwInst);

View File

@ -32,14 +32,21 @@ using std::wstring;
static float sVolumeLevel = 1.f;
static bool sMute = false;
static CRITICAL_SECTION sCriticalSection;
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
InitializeCriticalSection(&sCriticalSection);
return TRUE;
}
void ll_winmm_shim_initialize(){
static bool initialized = false;
// do this only once
EnterCriticalSection(&sCriticalSection);
if (!initialized)
{ // bind to original winmm.dll
TCHAR system_path[MAX_PATH];
@ -54,13 +61,15 @@ BOOL APIENTRY DllMain( HMODULE hModule,
{ // we have a dll, let's get out pointers!
initialized = true;
init_function_pointers(winmm_handle);
return true;
::OutputDebugStringA("WINMM_SHIM.DLL: real winmm.dll initialized successfully\n");
}
else
{
// failed to initialize real winmm.dll
::OutputDebugStringA("WINMM_SHIM.DLL: Failed to initialize real winmm.dll\n");
}
// failed to initialize real winmm.dll
return false;
}
return true;
LeaveCriticalSection(&sCriticalSection);
}
@ -79,6 +88,7 @@ extern "C"
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
|| (pwfx->wBitsPerSample != 8 && pwfx->wBitsPerSample != 16))
{ // uncompressed 8 and 16 bit sound are the only types we support
@ -97,6 +107,7 @@ extern "C"
MMRESULT WINAPI waveOutClose( HWAVEOUT hwo)
{
ll_winmm_shim_initialize();
wave_out_map_t::iterator found_it = sWaveOuts.find(hwo);
if (found_it != sWaveOuts.end())
{ // forget what we know about this handle
@ -108,6 +119,7 @@ extern "C"
MMRESULT WINAPI waveOutWrite( HWAVEOUT hwo, LPWAVEHDR pwh, UINT cbwh)
{
ll_winmm_shim_initialize();
MMRESULT result = MMSYSERR_NOERROR;
if (sMute)

View File

@ -3531,10 +3531,10 @@ bool LLAppViewer::initCache()
LLAppViewer::getTextureCache()->setReadOnly(read_only) ;
LLVOCache::getInstance()->setReadOnly(read_only);
BOOL texture_cache_mismatch = FALSE ;
bool texture_cache_mismatch = false;
if (gSavedSettings.getS32("LocalCacheVersion") != LLAppViewer::getTextureCacheVersion())
{
texture_cache_mismatch = TRUE ;
texture_cache_mismatch = true;
if(!read_only)
{
gSavedSettings.setS32("LocalCacheVersion", LLAppViewer::getTextureCacheVersion());
@ -3548,7 +3548,9 @@ bool LLAppViewer::initCache()
gSavedSettings.getBOOL("PurgeCacheOnNextStartup"))
{
gSavedSettings.setBOOL("PurgeCacheOnNextStartup", false);
mPurgeCache = true;
mPurgeCache = true;
// STORM-1141 force purgeAllTextures to get called to prevent a crash here. -brad
texture_cache_mismatch = true;
}
// We have moved the location of the cache directory over time.