pkiutilities/securitydialognotifiersrv/src/securitydialognotifierservermain.cpp
author hgs
Fri, 20 Aug 2010 11:27:50 +0300
changeset 48 6ed68423b759
permissions -rw-r--r--
201033_01
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
48
6ed68423b759 201033_01
hgs
parents:
diff changeset
     1
/*
6ed68423b759 201033_01
hgs
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
6ed68423b759 201033_01
hgs
parents:
diff changeset
     3
* All rights reserved.
6ed68423b759 201033_01
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
6ed68423b759 201033_01
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
6ed68423b759 201033_01
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
6ed68423b759 201033_01
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
6ed68423b759 201033_01
hgs
parents:
diff changeset
     8
*
6ed68423b759 201033_01
hgs
parents:
diff changeset
     9
* Initial Contributors:
6ed68423b759 201033_01
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
6ed68423b759 201033_01
hgs
parents:
diff changeset
    11
*
6ed68423b759 201033_01
hgs
parents:
diff changeset
    12
* Contributors:
6ed68423b759 201033_01
hgs
parents:
diff changeset
    13
*
6ed68423b759 201033_01
hgs
parents:
diff changeset
    14
* Description:  Security dialog notifier server
6ed68423b759 201033_01
hgs
parents:
diff changeset
    15
*
6ed68423b759 201033_01
hgs
parents:
diff changeset
    16
*/
6ed68423b759 201033_01
hgs
parents:
diff changeset
    17
6ed68423b759 201033_01
hgs
parents:
diff changeset
    18
#include "securitydialognotifierserver.h"   // CSecurityDialogNotifierServer
6ed68423b759 201033_01
hgs
parents:
diff changeset
    19
#include "securitydialognotifierservername.h" // KSecurityDialogNotifierServerName
6ed68423b759 201033_01
hgs
parents:
diff changeset
    20
#include "securitydialogstrace.h"           // TRACE macro
6ed68423b759 201033_01
hgs
parents:
diff changeset
    21
6ed68423b759 201033_01
hgs
parents:
diff changeset
    22
6ed68423b759 201033_01
hgs
parents:
diff changeset
    23
// ---------------------------------------------------------------------------
6ed68423b759 201033_01
hgs
parents:
diff changeset
    24
// MainL()
6ed68423b759 201033_01
hgs
parents:
diff changeset
    25
// ---------------------------------------------------------------------------
6ed68423b759 201033_01
hgs
parents:
diff changeset
    26
//
6ed68423b759 201033_01
hgs
parents:
diff changeset
    27
LOCAL_C void MainL()
6ed68423b759 201033_01
hgs
parents:
diff changeset
    28
    {
6ed68423b759 201033_01
hgs
parents:
diff changeset
    29
    TRACE( "SecurityDialogNotifierServer: MainL" );
6ed68423b759 201033_01
hgs
parents:
diff changeset
    30
    CActiveScheduler* scheduler = new( ELeave ) CActiveScheduler;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    31
    CleanupStack::PushL( scheduler );
6ed68423b759 201033_01
hgs
parents:
diff changeset
    32
    CActiveScheduler::Install( scheduler );
6ed68423b759 201033_01
hgs
parents:
diff changeset
    33
6ed68423b759 201033_01
hgs
parents:
diff changeset
    34
    CSecurityDialogNotifierServer* server = CSecurityDialogNotifierServer::NewLC();
6ed68423b759 201033_01
hgs
parents:
diff changeset
    35
    User::LeaveIfError( User::RenameThread( KSecurityDialogNotifierServerName ) );
6ed68423b759 201033_01
hgs
parents:
diff changeset
    36
    TRACE( "SecurityDialogNotifierServer: MainL, rendezvous" );
6ed68423b759 201033_01
hgs
parents:
diff changeset
    37
6ed68423b759 201033_01
hgs
parents:
diff changeset
    38
    RProcess::Rendezvous( KErrNone );
6ed68423b759 201033_01
hgs
parents:
diff changeset
    39
    TRACE( "SecurityDialogNotifierServer: MainL, activescheduler start" );
6ed68423b759 201033_01
hgs
parents:
diff changeset
    40
    CActiveScheduler::Start();
6ed68423b759 201033_01
hgs
parents:
diff changeset
    41
6ed68423b759 201033_01
hgs
parents:
diff changeset
    42
    TRACE( "SecurityDialogNotifierServer: MainL, cleanup" );
6ed68423b759 201033_01
hgs
parents:
diff changeset
    43
    CleanupStack::PopAndDestroy( server );
6ed68423b759 201033_01
hgs
parents:
diff changeset
    44
    CleanupStack::PopAndDestroy( scheduler );
6ed68423b759 201033_01
hgs
parents:
diff changeset
    45
    }
6ed68423b759 201033_01
hgs
parents:
diff changeset
    46
6ed68423b759 201033_01
hgs
parents:
diff changeset
    47
// ---------------------------------------------------------------------------
6ed68423b759 201033_01
hgs
parents:
diff changeset
    48
// E32Main()
6ed68423b759 201033_01
hgs
parents:
diff changeset
    49
// ---------------------------------------------------------------------------
6ed68423b759 201033_01
hgs
parents:
diff changeset
    50
//
6ed68423b759 201033_01
hgs
parents:
diff changeset
    51
GLDEF_C TInt E32Main()
6ed68423b759 201033_01
hgs
parents:
diff changeset
    52
    {
6ed68423b759 201033_01
hgs
parents:
diff changeset
    53
    CTrapCleanup* cleanup = CTrapCleanup::New();
6ed68423b759 201033_01
hgs
parents:
diff changeset
    54
6ed68423b759 201033_01
hgs
parents:
diff changeset
    55
    TRAPD( err, MainL() );
6ed68423b759 201033_01
hgs
parents:
diff changeset
    56
    __ASSERT_ALWAYS( !err, User::Panic( KSecurityDialogNotifierServerName, err ) );
6ed68423b759 201033_01
hgs
parents:
diff changeset
    57
6ed68423b759 201033_01
hgs
parents:
diff changeset
    58
    delete cleanup;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    59
    return err;
6ed68423b759 201033_01
hgs
parents:
diff changeset
    60
    }
6ed68423b759 201033_01
hgs
parents:
diff changeset
    61