aboutsummaryrefslogtreecommitdiffstats
path: root/LibOVR/Src/Displays/OVR_Win32_RenderShim.cpp
diff options
context:
space:
mode:
authorBrad Davis <[email protected]>2014-10-24 12:56:30 -0700
committerBrad Davis <[email protected]>2014-10-24 12:56:30 -0700
commit496894ecced1b0a4ae5ab176902bbd0f43a31ed1 (patch)
tree8b7d4be1fc8508253d399d98da6143212ceb8f3c /LibOVR/Src/Displays/OVR_Win32_RenderShim.cpp
parent911239601768bacf9420ab9cfeffed7e861844ac (diff)
Updating to 0.4.3 SDK0.4.3-official
Diffstat (limited to 'LibOVR/Src/Displays/OVR_Win32_RenderShim.cpp')
-rw-r--r--LibOVR/Src/Displays/OVR_Win32_RenderShim.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/LibOVR/Src/Displays/OVR_Win32_RenderShim.cpp b/LibOVR/Src/Displays/OVR_Win32_RenderShim.cpp
index 80b33a2..ed04804 100644
--- a/LibOVR/Src/Displays/OVR_Win32_RenderShim.cpp
+++ b/LibOVR/Src/Displays/OVR_Win32_RenderShim.cpp
@@ -6,7 +6,7 @@ Content : Shared static functions for inclusion that allow for an applicat
Created : March 21, 2014
Authors : Dean Beeler
-Copyright : Copyright 2014 Oculus VR, Inc. All Rights reserved.
+Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
Use of this software is subject to the terms of the Oculus Inc license
agreement provided at the time of installation or download, or which
@@ -14,6 +14,10 @@ otherwise accompanies this software in either electronic or hard copy form.
************************************************************************************/
+#ifndef AVOID_LIB_OVR
+#include "../Kernel/OVR_Types.h" // Without this we can get warnings (due to VC++ bugs) about _malloca being redefined, and miss LibOVR overrides.
+#endif
+
#include <windows.h>
#include <DbgHelp.h>
#include <malloc.h>
@@ -641,7 +645,12 @@ static PROC SetProcAddressA(
__in PROC newFunction
)
{
- PROC pfnHookAPIAddr = GetProcAddress( LoadLibraryA( lpLibFileName ), lpProcName );
+ HMODULE hModule = LoadLibraryA( lpLibFileName );
+ if(hModule == NULL)
+ return NULL;
+
+ // To do: call FreeLibrary(hModule) at the appropriate time.
+ PROC pfnHookAPIAddr = GetProcAddress(hModule, lpProcName );
HINSTANCE hInstance = targetModule;
@@ -795,7 +804,7 @@ void checkUMDriverOverrides(void* context)
}
}
- rtFilterModule = (*oldProcA)( RTFilter );
+ rtFilterModule = oldProcA ? (*oldProcA)(RTFilter) : NULL;
IsCreatingBackBuffer backBufferFunc = NULL;
ShouldVSync shouldVSyncFunc = NULL;