libraries/ltkutils/src/w32crack.cpp
changeset 69 849a0b46c767
parent 0 7f656887cf89
equal deleted inserted replaced
68:6a26ca985d90 69:849a0b46c767
     8 // 
     8 // 
     9 // Initial Contributors:
     9 // Initial Contributors:
    10 // Accenture - Initial contribution
    10 // Accenture - Initial contribution
    11 //
    11 //
    12 
    12 
       
    13 #include <e32base.h>
       
    14 #include <e32property.h>
    13 #include <fshell/common.mmh>
    15 #include <fshell/common.mmh>
    14 #include <fshell/ltkutils.h>
    16 #include <fshell/ltkutils.h>
    15 #include <e32base.h>
       
    16 #include <fshell/iocli.h>
    17 #include <fshell/iocli.h>
       
    18 
       
    19 #if !defined(FSHELL_WSERV_SUPPORT) || !defined(FSHELL_MEMORY_ACCESS_SUPPORT)
       
    20 
       
    21 EXPORT_C void LtkUtils::W32CrackL()
       
    22 	{
       
    23 	User::Leave(KErrNotSupported);
       
    24 	}
       
    25 
       
    26 #else
       
    27 
    17 #include <w32std.h>
    28 #include <w32std.h>
    18 #include <fshell/ioutils.h>
       
    19 #include <fshell/memoryaccess.h>
    29 #include <fshell/memoryaccess.h>
    20 
    30 
    21 //
    31 //
    22 // LtkUtils::W32CrackL
    32 // LtkUtils::W32CrackL
    23 // loads the autometric logging engine, dlogev.dll, into wserv
    33 // loads the autometric logging engine, dlogev.dll, into wserv
    24 // enabling Autometric to monitor events from within wserv - key/pointer events, text drawn to screen etc
    34 // enabling Autometric to monitor events from within wserv - key/pointer events, text drawn to screen etc
    25 //
    35 //
    26 EXPORT_C void LtkUtils::W32CrackL()
    36 EXPORT_C void LtkUtils::W32CrackL()
    27 	{
    37 	{
    28 #ifndef FSHELL_WSERV_SUPPORT
       
    29 	User::Leave(KErrNotSupported);
       
    30 #else
       
    31 
       
    32 	// Check if P&S says it's already enabled, if so no need to do anything
    38 	// Check if P&S says it's already enabled, if so no need to do anything
    33 	if (W32CrackIsEnabled()) return;
    39 	if (W32CrackIsEnabled()) return;
    34 
    40 
    35 	_LIT(KWsIniFile, "z:\\system\\data\\wsini.ini");
    41 	_LIT(KWsIniFile, "z:\\system\\data\\wsini.ini");
    36 	_LIT(KCWsIniFile,"c:\\system\\data\\wsini.ini");
    42 	_LIT(KCWsIniFile,"c:\\system\\data\\wsini.ini");
   109 	ws.Flush();
   115 	ws.Flush();
   110 	
   116 	
   111 	// cleanup
   117 	// cleanup
   112 	CleanupStack::PopAndDestroy(4, &fs);
   118 	CleanupStack::PopAndDestroy(4, &fs);
   113 
   119 
   114 #endif // FSHELL_WSERV_SUPPORT
       
   115 	}
   120 	}
       
   121 
       
   122 #endif // supported
   116 
   123 
   117 EXPORT_C TBool LtkUtils::W32CrackIsEnabled()
   124 EXPORT_C TBool LtkUtils::W32CrackIsEnabled()
   118 	{
   125 	{
   119 	TInt enabled = EFalse;
   126 	TInt enabled = EFalse;
   120 	TInt err = RProperty::Get(KW32CrackCategory, KW32CrackKey, enabled);
   127 	TInt err = RProperty::Get(KW32CrackCategory, KW32CrackKey, enabled);