2 * Copyright (C) 2005-2010 Team XBMC
5 * This Program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2, or (at your option)
10 * This Program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with XBMC; see the file COPYING. If not, write to
17 * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
18 * http://www.gnu.org/copyleft/gpl.html
23 #include "DllPaths_win32.h"
24 #include "filesystem/SpecialProtocol.h"
25 #include "Application.h"
26 #include "windowing/WindowingFactory.h"
28 FARPROC WINAPI delayHookNotifyFunc (unsigned dliNotify, PDelayLoadInfo pdli)
32 case dliNotePreLoadLibrary:
33 if (stricmp(pdli->szDll, "libmicrohttpd-5.dll") == 0)
35 CStdString strDll = CSpecialProtocol::TranslatePath(DLL_PATH_LIBMICROHTTP);
36 HMODULE hMod = LoadLibraryEx(strDll.c_str(), 0, LOAD_WITH_ALTERED_SEARCH_PATH);
39 if (stricmp(pdli->szDll, "ssh.dll") == 0)
41 CStdString strDll = CSpecialProtocol::TranslatePath("special://xbmcbin/system/ssh.dll");
42 HMODULE hMod = LoadLibraryEx(strDll.c_str(), 0, LOAD_WITH_ALTERED_SEARCH_PATH);
45 if (stricmp(pdli->szDll, "sqlite3.dll") == 0)
47 CStdString strDll = CSpecialProtocol::TranslatePath("special://xbmcbin/system/sqlite3.dll");
48 HMODULE hMod = LoadLibraryEx(strDll.c_str(), 0, LOAD_WITH_ALTERED_SEARCH_PATH);
51 if (stricmp(pdli->szDll, "libsamplerate-0.dll") == 0)
53 CStdString strDll = CSpecialProtocol::TranslatePath("special://xbmcbin/system/libsamplerate-0.dll");
54 HMODULE hMod = LoadLibraryEx(strDll.c_str(), 0, LOAD_WITH_ALTERED_SEARCH_PATH);
62 FARPROC WINAPI delayHookFailureFunc (unsigned dliNotify, PDelayLoadInfo pdli)
67 g_application.Stop(1);
69 strError.Format("Uh oh, can't load %s, exiting.", pdli->szDll);
70 MessageBox(NULL, strError.c_str(), "XBMC: Fatal Error", MB_OK|MB_ICONERROR);
77 // assign hook functions
78 PfnDliHook __pfnDliNotifyHook2 = delayHookNotifyFunc;
79 PfnDliHook __pfnDliFailureHook2 = delayHookFailureFunc;