d3d9 proxy loader hides console after success

This commit is contained in:
alexey.min 2012-02-04 11:48:16 +00:00
parent d17924595d
commit 878082322c
3 changed files with 17 additions and 5 deletions

View File

@ -93,22 +93,26 @@ void D3D9Proxy_Uninitialize()
}
void D3D9Proxy_LoadL2Detect()
bool D3D9Proxy_LoadL2Detect()
{
if( gl_hL2Detect != NULL )
return;
return true; // already loaded
gl_hL2Detect = LoadLibraryW( L"L2Detect_d.dll" );
if( gl_hL2Detect == NULL )
if( gl_hL2Detect == NULL ) // first try failed
{
gl_hL2Detect = LoadLibraryW( L"L2Detect.dll" );
if( gl_hL2Detect == NULL )
{
log_error( LOG_ERROR, "Failed to load radar DLL! Tried to find L2Detect_d / L2Detect dlls.\n" );
return false;
}
else
log_error( LOG_OK, "Loaded L2Detect.dll at 0x%08X\n", gl_hL2Detect );
}
else
log_error( LOG_OK, "Loaded L2Detect_d.dll (debug version) at 0x%08X\n", gl_hL2Detect );
return true;
}
@ -149,7 +153,8 @@ IDirect3D9* WINAPI Direct3DCreate9( UINT SDKVersion )
::ExitProcess(0); // exit the hard way
}
D3D9Proxy_LoadL2Detect();
if( D3D9Proxy_LoadL2Detect() )
ErrorLogger_EnableLoggingToConsole( false );
// Request pointer from Original Dll.
IDirect3D9 *pIDirect3D9_orig = D3DCreate9_fn( SDKVersion );

View File

@ -0,0 +1,7 @@
set out=..\..\out\dist_L2Detect
echo Copy d3d9.dll %2\%1.dll - %2\%out%
copy /y %2\%1.dll %2\%out%
echo Copy d3d9.pdb %2\%1.pdb - %2\%out%
rem copy /y %2\%1.pdb %2\%out%

View File

@ -5,4 +5,4 @@ extern HINSTANCE gl_hOriginalDll;
void D3D9Proxy_Initialize();
void D3D9Proxy_Uninitialize();
void D3D9Proxy_LoadL2Detect();
bool D3D9Proxy_LoadL2Detect();