diff -r 5d03bc08d59c -r 01a6848ebfd7 egl/eglswitch/src/eglswitch.cpp --- a/egl/eglswitch/src/eglswitch.cpp Tue Feb 02 01:47:50 2010 +0200 +++ b/egl/eglswitch/src/eglswitch.cpp Fri Apr 16 16:21:04 2010 +0300 @@ -44,10 +44,16 @@ FARPROC vector[MAX_ORDINAL+1]; // 1 additional entry: vector[0] to set the initialised state +#ifdef _DEBUG void Stop(char* aErrorMessage) +#else +void Stop(char* /*aErrorMessage*/) +#endif { int err = GetLastError(); +#ifdef _DEBUG RDebug::Printf("%S, (last error = %i)", aErrorMessage, err); +#endif _asm int 3; } @@ -71,14 +77,13 @@ { Stop("... has too few exported functions"); } - - // next position should be empty + + // next position should be empty address = GetProcAddress(aDll, (LPCSTR)(MAX_ORDINAL+2)); if (address != NULL) { Stop("... has too many exported functions"); } - // Set initialised vector[0] = (FARPROC)1; } @@ -102,8 +107,10 @@ library = "libegl_nongce.dll"; } +#ifdef _DEBUG RDebug::Printf("Redirecting libEGL.dll to \"%s\" ...\n", library); - +#endif + Emulator::Escape(); // prevent deadlock between EKA2 scheduler and MS kernel // try to load selected DLL HINSTANCE instance = LoadLibraryA(library); @@ -116,7 +123,9 @@ else { fill_vector(instance); +#ifdef _DEBUG RDebug::Printf("... DLL loaded successfully"); +#endif } }