delay load lua51.dll

This commit is contained in:
zeromus 2010-10-26 20:48:24 +00:00
parent a1bd1e4872
commit f841376e58
6 changed files with 34 additions and 11 deletions

View File

@ -85,6 +85,7 @@
OutputFile="$(OutDir)\$(ProjectName)_debug.exe"
AdditionalLibraryDirectories=".\zlib123;agg;.libs"
IgnoreDefaultLibraryNames="LIBCPMT"
DelayLoadDLLs="lua51.dll"
GenerateDebugInformation="true"
GenerateMapFile="true"
OptimizeReferences="2"
@ -177,6 +178,7 @@
AdditionalDependencies="directx-x64-ddraw-dinput8-dsound-dxerr8-dxguid.lib lua51.lib glib-vc8-x64.lib 7z-vc8-x64.lib zlib-vc8-x64.lib agg-2.5-x64.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib shlwapi.lib"
OutputFile="$(OutDir)\$(ProjectName)_x64_debug.exe"
AdditionalLibraryDirectories=".\zlib123;agg;.libs"
DelayLoadDLLs="lua51.dll"
GenerateDebugInformation="true"
GenerateMapFile="true"
OptimizeReferences="2"
@ -275,6 +277,7 @@
AdditionalDependencies="directx-win32-ddraw-dinput8-dsound-dxerr8-dxguid.lib libelf_libdwarf-vc8-Win32.lib lua51.lib glib-vc8-Win32.lib 7z-vc8-Win32.lib zlib-vc8-Win32.lib agg-2.5.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib shlwapi.lib Rpcrt4.lib"
OutputFile="$(OutDir)\$(ProjectName)_release.exe"
AdditionalLibraryDirectories=".\zlib123;agg;.libs"
DelayLoadDLLs="lua51.dll"
GenerateDebugInformation="true"
GenerateMapFile="true"
EnableCOMDATFolding="0"
@ -373,6 +376,7 @@
AdditionalDependencies="directx-x64-ddraw-dinput8-dsound-dxerr8-dxguid.lib lua51.lib glib-vc8-x64.lib 7z-vc8-x64.lib zlib-vc8-x64.lib agg-2.5-x64.lib lua-5.1.4-x64.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib shlwapi.lib"
OutputFile="$(OutDir)\$(ProjectName)_x64_release.exe"
AdditionalLibraryDirectories=".\zlib123;agg;.libs"
DelayLoadDLLs="lua51.dll"
GenerateDebugInformation="true"
GenerateMapFile="true"
EnableCOMDATFolding="0"
@ -473,6 +477,7 @@
AdditionalDependencies="directx-win32-ddraw-dinput8-dsound-dxerr8-dxguid.lib libelf_libdwarf-vc8-Win32.lib lua51.lib glib-vc8-Win32.lib 7z-vc8-Win32.lib zlib-vc8-Win32.lib agg-2.5.lib vfw32.lib winmm.lib comctl32.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib shlwapi.lib Rpcrt4.lib"
OutputFile="$(OutDir)\$(ProjectName)_releaseFastBuild.exe"
AdditionalLibraryDirectories=".\zlib123;agg;.libs"
DelayLoadDLLs="lua51.dll"
GenerateDebugInformation="true"
GenerateMapFile="true"
OptimizeReferences="2"
@ -574,6 +579,7 @@
AdditionalDependencies="directx-x64-ddraw-dinput8-dsound-dxerr8-dxguid.lib lua51.lib glib-vc8-x64.lib 7z-vc8-x64.lib zlib-vc8-x64.lib agg-2.5-x64.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib shlwapi.lib"
OutputFile="$(OutDir)\$(ProjectName)_x64_releaseFastBuild.exe"
AdditionalLibraryDirectories=".\zlib123;agg;.libs"
DelayLoadDLLs="lua51.dll"
GenerateDebugInformation="true"
GenerateMapFile="true"
OptimizeReferences="2"

View File

@ -81,7 +81,7 @@
AdditionalDependencies="directx-win32-ddraw-dinput8-dsound-dxerr8-dxguid.lib libelf_libdwarf-vc8-Win32.lib lua51.lib glib-vc8-Win32.lib 7z-vc8-Win32.lib zlib-vc8-Win32.lib agg-2.5.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib shlwapi.lib comctl32.lib"
OutputFile="$(OutDir)\$(ProjectName)_debug.exe"
AdditionalLibraryDirectories=".\zlib123;agg;.libs"
DelayLoadDLLs=""
DelayLoadDLLs="lua51.dll"
GenerateDebugInformation="true"
GenerateMapFile="true"
RandomizedBaseAddress="1"
@ -170,6 +170,7 @@
AdditionalDependencies="directx-x64-ddraw-dinput8-dsound-dxerr8-dxguid.lib libelf_libdwarf-vc8-x64.lib lua51.lib glib-vc8-x64.lib 7z-vc8-x64.lib zlib-vc8-x64.lib agg-2.5-x64.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib shlwapi.lib"
OutputFile="$(OutDir)\$(ProjectName)_x64_debug.exe"
AdditionalLibraryDirectories=".\zlib123;agg;.libs"
DelayLoadDLLs="lua51.dll"
GenerateDebugInformation="true"
GenerateMapFile="true"
RandomizedBaseAddress="1"
@ -263,7 +264,7 @@
AdditionalDependencies="directx-win32-ddraw-dinput8-dsound-dxerr8-dxguid.lib libelf_libdwarf-vc8-Win32.lib lua51.lib glib-vc8-Win32.lib 7z-vc8-Win32.lib zlib-vc8-Win32.lib agg-2.5.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib shlwapi.lib comctl32.lib"
OutputFile="$(OutDir)\$(ProjectName)_release.exe"
AdditionalLibraryDirectories=".\zlib123;agg;.libs"
DelayLoadDLLs=""
DelayLoadDLLs="lua51.dll"
GenerateDebugInformation="true"
OptimizeReferences="2"
RandomizedBaseAddress="1"
@ -357,6 +358,7 @@
AdditionalDependencies="directx-x64-ddraw-dinput8-dsound-dxerr8-dxguid.lib libelf_libdwarf-vc8-x64.lib lua51.lib glib-vc8-x64.lib 7z-vc8-x64.lib zlib-vc8-x64.lib agg-2.5-x64.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib shlwapi.lib"
OutputFile="$(OutDir)\$(ProjectName)_x64_release.exe"
AdditionalLibraryDirectories=".\zlib123;agg;.libs"
DelayLoadDLLs="lua51.dll"
GenerateDebugInformation="true"
OptimizeReferences="2"
RandomizedBaseAddress="1"
@ -450,7 +452,7 @@
AdditionalDependencies="directx-win32-ddraw-dinput8-dsound-dxerr8-dxguid.lib libelf_libdwarf-vc8-Win32.lib lua51.lib glib-vc8-Win32.lib 7z-vc8-Win32.lib zlib-vc8-Win32.lib agg-2.5.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib shlwapi.lib comctl32.lib"
OutputFile="$(OutDir)\$(ProjectName)_dev+.exe"
AdditionalLibraryDirectories=".\zlib123;agg;.libs"
DelayLoadDLLs=""
DelayLoadDLLs="lua51.dll"
GenerateDebugInformation="true"
OptimizeReferences="2"
LinkTimeCodeGeneration="0"
@ -545,6 +547,7 @@
AdditionalDependencies="directx-x64-ddraw-dinput8-dsound-dxerr8-dxguid.lib libelf_libdwarf-vc8-x64.lib lua51.lib glib-vc8-x64.lib 7z-vc8-x64.lib zlib-vc8-x64.lib agg-2.5-x64.lib vfw32.lib winmm.lib opengl32.lib glu32.lib ws2_32.lib user32.lib gdi32.lib shell32.lib comdlg32.lib shlwapi.lib"
OutputFile="$(OutDir)\$(ProjectName)_x64_dev+.exe"
AdditionalLibraryDirectories=".\zlib123;agg;.libs"
DelayLoadDLLs="lua51.dll"
GenerateDebugInformation="true"
OptimizeReferences="2"
LinkTimeCodeGeneration="0"

View File

@ -184,7 +184,7 @@
<AdditionalDependencies>directx-win32-ddraw-dinput8-dsound-dxerr8-dxguid.lib;lua51.lib;glib-vc8-Win32.lib;7z-vc8-Win32.lib;zlib-vc8-Win32.lib;agg-2.5.lib;vfw32.lib;winmm.lib;opengl32.lib;glu32.lib;ws2_32.lib;user32.lib;gdi32.lib;shell32.lib;comdlg32.lib;shlwapi.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName)_debug.exe</OutputFile>
<AdditionalLibraryDirectories>.\zlib123;agg;.libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>lua51.dll</DelayLoadDLLs>
<GenerateDebugInformation>true</GenerateDebugInformation>
<GenerateMapFile>true</GenerateMapFile>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@ -229,7 +229,7 @@
<AdditionalDependencies>directx-win32-ddraw-dinput8-dsound-dxerr8-dxguid.lib;lua51.lib;glib-vc8-Win32.lib;7z-vc8-Win32.lib;zlib-vc8-Win32.lib;agg-2.5.lib;vfw32.lib;winmm.lib;opengl32.lib;glu32.lib;ws2_32.lib;user32.lib;gdi32.lib;shell32.lib;comdlg32.lib;shlwapi.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName)_release.exe</OutputFile>
<AdditionalLibraryDirectories>.\zlib123;agg;.libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>lua51.dll</DelayLoadDLLs>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@ -274,7 +274,7 @@
<AdditionalDependencies>directx-win32-ddraw-dinput8-dsound-dxerr8-dxguid.lib;lua51.lib;glib-vc8-Win32.lib;7z-vc8-Win32.lib;zlib-vc8-Win32.lib;agg-2.5.lib;vfw32.lib;winmm.lib;opengl32.lib;glu32.lib;ws2_32.lib;user32.lib;gdi32.lib;shell32.lib;comdlg32.lib;shlwapi.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName)_dev+.exe</OutputFile>
<AdditionalLibraryDirectories>.\zlib123;agg;.libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>lua51.dll</DelayLoadDLLs>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<LinkTimeCodeGeneration>
@ -318,7 +318,7 @@
<AdditionalDependencies>directx-x64-ddraw-dinput8-dsound-dxerr8-dxguid.lib;lua51.lib;glib-vc8-x64.lib;7z-vc8-x64.lib;zlib-vc8-x64.lib;agg-2.5-x64.lib;vfw32.lib;winmm.lib;opengl32.lib;glu32.lib;ws2_32.lib;user32.lib;gdi32.lib;shell32.lib;comdlg32.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName)_x64_debug.exe</OutputFile>
<AdditionalLibraryDirectories>.\zlib123;agg;.libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<DelayLoadDLLs>wpcap.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>wpcap.dll;lua51.dll</DelayLoadDLLs>
<GenerateDebugInformation>true</GenerateDebugInformation>
<GenerateMapFile>true</GenerateMapFile>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@ -363,7 +363,7 @@
<AdditionalDependencies>directx-x64-ddraw-dinput8-dsound-dxerr8-dxguid.lib;lua51.lib;glib-vc8-x64.lib;7z-vc8-x64.lib;zlib-vc8-x64.lib;agg-2.5-x64.lib;vfw32.lib;winmm.lib;opengl32.lib;glu32.lib;ws2_32.lib;user32.lib;gdi32.lib;shell32.lib;comdlg32.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName)_x64_release.exe</OutputFile>
<AdditionalLibraryDirectories>.\zlib123;agg;.libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<DelayLoadDLLs>wpcap.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>lua51.dll</DelayLoadDLLs>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<RandomizedBaseAddress>false</RandomizedBaseAddress>
@ -409,7 +409,7 @@
<AdditionalDependencies>directx-x64-ddraw-dinput8-dsound-dxerr8-dxguid.lib;lua51.lib;glib-vc8-x64.lib;7z-vc8-x64.lib;zlib-vc8-x64.lib;agg-2.5-x64.lib;vfw32.lib;winmm.lib;opengl32.lib;glu32.lib;ws2_32.lib;user32.lib;gdi32.lib;shell32.lib;comdlg32.lib;shlwapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ProjectName)_x64_dev+.exe</OutputFile>
<AdditionalLibraryDirectories>.\zlib123;agg;.libs;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<DelayLoadDLLs>wpcap.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
<DelayLoadDLLs>wpcap.dll;lua51.dll</DelayLoadDLLs>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OptimizeReferences>true</OptimizeReferences>
<LinkTimeCodeGeneration>

View File

@ -631,13 +631,14 @@ LRESULT CALLBACK LuaScriptProc(HWND hDlg, UINT uMsg, WPARAM wParam, LPARAM lPara
char LogicalName[1024], PhysicalName[1024];
bool exists = ObtainFile(Str_Tmp, LogicalName, PhysicalName, "luarun", s_nonLuaExtensions, sizeof(s_nonLuaExtensions)/sizeof(*s_nonLuaExtensions));
Update_Recent_Script(LogicalName, info.subservient);
RunLuaScriptFile((int)hDlg, PhysicalName);
if(DemandLua())
RunLuaScriptFile((int)hDlg, PhysicalName);
} break;
case IDC_BUTTON_LUASTOP:
{
PrintToWindowConsole((int)hDlg, "user clicked stop button\r\n");
SetActiveWindow(MainWindow->getHWnd());
StopLuaScript((int)hDlg);
if(DemandLua()) StopLuaScript((int)hDlg);
} break;
case IDC_NOTIFY_SUBSERVIENT:
{

View File

@ -2128,6 +2128,18 @@ void
joinThread_gdb( void *thread_handle) {
}
bool DemandLua()
{
HMODULE mod = LoadLibrary("lua51.dll");
if(!mod)
{
MessageBox(NULL, "lua51.dll was not found. Please get it into your PATH or in the same directory as desmume.exe", "DeSmuME", MB_OK | MB_ICONERROR);
return false;
}
FreeLibrary(mod);
return true;
}
int MenuInit()
{

View File

@ -22,6 +22,7 @@ void AviEnd();
void WavRecordTo(int wavmode);
void WavEnd();
void UpdateToolWindows();
bool DemandLua();
extern bool frameCounterDisplay;
extern bool FpsDisplay;