diff options
author | jmarshallnz <jcmarsha@gmail.com> | 2012-08-22 01:23:03 -0700 |
---|---|---|
committer | jmarshallnz <jcmarsha@gmail.com> | 2012-08-22 01:23:03 -0700 |
commit | 0ea085ab57b9dd9f087bd4977fd8490bf005e5b6 (patch) | |
tree | d8ca3afd5b4139d6e4294dc79651f6cbadac41f5 | |
parent | f400bd328d9a6a4015609e20472142a01bd7f8d2 (diff) | |
parent | 5c9e524ba7ebe912892ff5eb10a52b8f8570d9ce (diff) |
Merge pull request #1322 from Karlson2k/Fixes_Win32_02
[win32] Some simple fixes
-rw-r--r-- | xbmc/rendering/dx/RenderSystemDX.cpp | 5 | ||||
-rw-r--r-- | xbmc/win32/WIN32Util.cpp | 2 | ||||
-rw-r--r-- | xbmc/windowing/windows/WinEventsWin32.cpp | 3 | ||||
-rw-r--r-- | xbmc/windowing/windows/WinSystemWin32.cpp | 12 |
4 files changed, 16 insertions, 6 deletions
diff --git a/xbmc/rendering/dx/RenderSystemDX.cpp b/xbmc/rendering/dx/RenderSystemDX.cpp index 24e7544ce3..d069e12048 100644 --- a/xbmc/rendering/dx/RenderSystemDX.cpp +++ b/xbmc/rendering/dx/RenderSystemDX.cpp @@ -55,7 +55,10 @@ static HMODULE g_D3D9ExHandle; static bool LoadD3D9Ex() { - g_Direct3DCreate9Ex = (LPDIRECT3DCREATE9EX)GetProcAddress( GetModuleHandle("d3d9.dll"), "Direct3DCreate9Ex" ); + HMODULE hD3d9Dll = GetModuleHandle("d3d9.dll"); + if (!hD3d9Dll) + return false; + g_Direct3DCreate9Ex = (LPDIRECT3DCREATE9EX)GetProcAddress(hD3d9Dll, "Direct3DCreate9Ex" ); if(g_Direct3DCreate9Ex == NULL) return false; return true; diff --git a/xbmc/win32/WIN32Util.cpp b/xbmc/win32/WIN32Util.cpp index 314376da62..6b06f2e0e5 100644 --- a/xbmc/win32/WIN32Util.cpp +++ b/xbmc/win32/WIN32Util.cpp @@ -501,7 +501,7 @@ void CWIN32Util::ExtendDllPath() HRESULT CWIN32Util::ToggleTray(const char cDriveLetter) { BOOL bRet= FALSE; - DWORD dwReq; + DWORD dwReq = 0; char cDL = cDriveLetter; if( !cDL ) { diff --git a/xbmc/windowing/windows/WinEventsWin32.cpp b/xbmc/windowing/windows/WinEventsWin32.cpp index f5e14cc321..05b9a7ef54 100644 --- a/xbmc/windowing/windows/WinEventsWin32.cpp +++ b/xbmc/windowing/windows/WinEventsWin32.cpp @@ -867,7 +867,8 @@ void CWinEventsWin32::OnGesture(HWND hWnd, LPARAM lParam) // You have encountered an unknown gesture break; } - g_Windowing.PtrCloseGestureInfoHandle((HGESTUREINFO)lParam); + if(g_Windowing.PtrCloseGestureInfoHandle) + g_Windowing.PtrCloseGestureInfoHandle((HGESTUREINFO)lParam); } #endif diff --git a/xbmc/windowing/windows/WinSystemWin32.cpp b/xbmc/windowing/windows/WinSystemWin32.cpp index 4d45086e1f..27ad90cab3 100644 --- a/xbmc/windowing/windows/WinSystemWin32.cpp +++ b/xbmc/windowing/windows/WinSystemWin32.cpp @@ -113,9 +113,13 @@ bool CWinSystemWin32::CreateNewWindow(const CStdString& name, bool fullScreen, R SetProp(hWnd, MICROSOFT_TABLETPENSERVICE_PROPERTY, reinterpret_cast<HANDLE>(dwHwndTabletProperty)); // setup our touch pointers - PtrGetGestureInfo = (pGetGestureInfo) GetProcAddress( GetModuleHandle( TEXT( "user32" ) ), "GetGestureInfo" ); - PtrSetGestureConfig = (pSetGestureConfig) GetProcAddress( GetModuleHandle( TEXT( "user32" ) ), "SetGestureConfig" ); - PtrCloseGestureInfoHandle = (pCloseGestureInfoHandle) GetProcAddress( GetModuleHandle( TEXT( "user32" ) ), "CloseGestureInfoHandle" ); + HMODULE hUser32 = GetModuleHandleA( "user32" ); + if (hUser32) + { + PtrGetGestureInfo = (pGetGestureInfo) GetProcAddress( hUser32, "GetGestureInfo" ); + PtrSetGestureConfig = (pSetGestureConfig) GetProcAddress( hUser32, "SetGestureConfig" ); + PtrCloseGestureInfoHandle = (pCloseGestureInfoHandle) GetProcAddress( hUser32, "CloseGestureInfoHandle" ); + } m_hWnd = hWnd; m_hDC = GetDC(m_hWnd); @@ -269,6 +273,7 @@ bool CWinSystemWin32::SetFullScreen(bool fullScreen, RESOLUTION_INFO& res, bool { // save position of windowed mode WINDOWINFO wi; + wi.cbSize = sizeof(WINDOWINFO); GetWindowInfo(m_hWnd, &wi); m_nLeft = wi.rcClient.left; m_nTop = wi.rcClient.top; @@ -385,6 +390,7 @@ bool CWinSystemWin32::ResizeInternal(bool forceRefresh) } WINDOWINFO wi; + wi.cbSize = sizeof (WINDOWINFO); GetWindowInfo(m_hWnd, &wi); RECT wr = wi.rcWindow; |