omadrm/drmhelper/src/DRMHelperDownloadManager.cpp
branchRCL_3
changeset 13 a20e54f39dd4
parent 12 8a03a285ab14
equal deleted inserted replaced
12:8a03a285ab14 13:a20e54f39dd4
     1 /*
     1 /*
     2 * Copyright (c) 2004-2006 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    16 */
    16 */
    17 
    17 
    18 
    18 
    19 // INCLUDE FILES
    19 // INCLUDE FILES
    20 #include "DRMHelperDownloadManager.h"
    20 #include "DRMHelperDownloadManager.h"
    21 #include "DRMHelperDMgrWrapper.h"
    21 #include "DrmUtilityDmgrWrapper.h"
    22 
    22 
    23 // CONSTANTS
    23 // CONSTANTS
    24 _LIT( KDRMHelperDMgrHandlerName, "\\system\\libs\\drmhelperdmgrwrapper.dll" );
    24 _LIT( KDrmUtilityDmgrHandlerName, "DrmUtilityDmgrWrapper.dll" );
    25 
    25 
    26 typedef TAny* (*NewDMgrL)();
    26 typedef TAny* (*NewDMgrL)();
    27 
    27 
    28 const TInt KFirstFunction = 1;
    28 const TInt KFirstFunction = 1;
    29 
    29 
    33     {
    33     {
    34     }
    34     }
    35 
    35 
    36 void CDrmHelperDownloadManager::ConstructL()
    36 void CDrmHelperDownloadManager::ConstructL()
    37     {
    37     {
    38     User::LeaveIfError( iDMgrDll.Load( KDRMHelperDMgrHandlerName ) );
    38     User::LeaveIfError( iDMgrDll.Load( KDrmUtilityDmgrHandlerName ) );
    39     NewDMgrL createDMgr = (NewDMgrL) iDMgrDll.Lookup( KFirstFunction );
    39     NewDMgrL createDMgr = (NewDMgrL) iDMgrDll.Lookup( KFirstFunction );
    40     if ( !createDMgr )
    40     if ( !createDMgr )
    41         {
    41         {
    42         User::Leave( KErrGeneral );
    42         User::Leave( KErrGeneral );
    43         }
    43         }
    44     // Create the class, leaves in case of failure
    44     // Create the class, leaves in case of failure
    45     iDMgrHandler = (CDRMHelperDMgrWrapper*) (*createDMgr)();
    45     iDMgrHandler = reinterpret_cast<CDrmUtilityDmgrWrapper*>( (*createDMgr)() );
    46     }
    46     }
    47 
    47 
    48 CDrmHelperDownloadManager* CDrmHelperDownloadManager::NewL()
    48 CDrmHelperDownloadManager* CDrmHelperDownloadManager::NewL()
    49     {
    49     {
    50     CDrmHelperDownloadManager* self = new( ELeave ) CDrmHelperDownloadManager();
    50     CDrmHelperDownloadManager* self = new( ELeave ) CDrmHelperDownloadManager();