windowing/windowserver/wins_switching/wsgraphicdrawerswitch.cpp
branchRCL_3
changeset 18 5e30ef2e26cb
parent 0 5d03bc08d59c
equal deleted inserted replaced
11:fed1595b188e 18:5e30ef2e26cb
    38 #include "wsgraphicdrawer_stubs.h"
    38 #include "wsgraphicdrawer_stubs.h"
    39 
    39 
    40 FARPROC vector[MAX_ORDINAL+1];
    40 FARPROC vector[MAX_ORDINAL+1];
    41 
    41 
    42 
    42 
       
    43 #ifdef _DEBUG
    43 void Stop(char* aErrorMessage)
    44 void Stop(char* aErrorMessage)
       
    45 #else
       
    46 void Stop(char* /*aErrorMessage*/)
       
    47 #endif
    44 	{
    48 	{
    45 	int err = GetLastError();
    49 	int err = GetLastError();
       
    50 #ifdef _DEBUG
    46 	RDebug::Printf("%S, (last error = %i)", aErrorMessage, err);
    51 	RDebug::Printf("%S, (last error = %i)", aErrorMessage, err);
       
    52 #endif
    47 	_asm int 3;
    53 	_asm int 3;
    48 	}
    54 	}
    49 
    55 
    50 void fill_vector(HINSTANCE aDll)
    56 void fill_vector(HINSTANCE aDll)
    51 	{
    57 	{
    75 	// ask HAL which configuration to use
    81 	// ask HAL which configuration to use
    76 	TBool nga = EFalse;
    82 	TBool nga = EFalse;
    77 	UserSvr::HalFunction(EHalGroupEmulator, EEmulatorHalBoolProperty,  (TAny*)"symbian_graphics_use_gce",  &nga);
    83 	UserSvr::HalFunction(EHalGroupEmulator, EEmulatorHalBoolProperty,  (TAny*)"symbian_graphics_use_gce",  &nga);
    78 	const char* library = nga ? "wsgraphicdrawer_nga.dll" : "wsgraphicdrawer_nonnga.dll";
    84 	const char* library = nga ? "wsgraphicdrawer_nga.dll" : "wsgraphicdrawer_nonnga.dll";
    79 
    85 
       
    86 #ifdef _DEBUG
    80 	RDebug::Printf("Redirecting wsgraphicdrawer.dll to \"%s\" ...\n", library);
    87 	RDebug::Printf("Redirecting wsgraphicdrawer.dll to \"%s\" ...\n", library);
       
    88 #endif
    81 	
    89 	
    82 	Emulator::Escape();		// prevent deadlock between EKA2 scheduler and MS kernel
    90 	Emulator::Escape();		// prevent deadlock between EKA2 scheduler and MS kernel
    83 	// try to load selected DLL
    91 	// try to load selected DLL
    84 	HINSTANCE instance = LoadLibraryA(library);
    92 	HINSTANCE instance = LoadLibraryA(library);
    85 	Emulator::Reenter();
    93 	Emulator::Reenter();
    89 		Stop("... unable to load");
    97 		Stop("... unable to load");
    90 		}
    98 		}
    91 	else
    99 	else
    92 		{
   100 		{
    93 		fill_vector(instance);
   101 		fill_vector(instance);
       
   102 #ifdef _DEBUG
    94 		RDebug::Printf("... DLL loaded successfully");
   103 		RDebug::Printf("... DLL loaded successfully");
       
   104 #endif
    95 		}
   105 		}
    96 	}
   106 	}
    97 
   107 
    98 __declspec(naked) void common_dispatch()
   108 __declspec(naked) void common_dispatch()
    99 	{
   109 	{