drv2_dll_stub.c
上传用户:dangjiwu
上传日期:2013-07-19
资源大小:42019k
文件大小:1k
源码类别:

Symbian

开发平台:

Visual C++

  1. #include <e32std.h>
  2. #include <string.h>
  3. #include "hxglobalmgr.h"
  4. #ifndef HELIX_CONFIG_SYMBIAN_PLATFORM_SECURITY
  5. GLDEF_C TInt E32Dll(TDllReason reason)
  6. {
  7.     if (reason == EDllProcessDetach)
  8.     {
  9.         HXGlobalManager* pGM = HXGlobalManager::Instance();
  10.         if (pGM)
  11.         {
  12.             pGM->Shutdown();
  13.         }
  14.     }
  15.     return(KErrNone);
  16. }
  17. #endif /* HELIX_CONFIG_SYMBIAN_PLATFORM_SECURITY */
  18. struct SymbolEntry {
  19.     const char* m_pSymbolName;
  20.     int m_ordinal;
  21. };
  22. static const struct SymbolEntry z_symbolTable[] = {
  23.     {"GetSymbolOrdinal", 1},
  24.     {"RV20toYUV420Init", 2},
  25.     {"RV20toYUV420Free", 3},
  26.     {"RV20toYUV420Transform", 4},
  27.     {"RV20toYUV420CustomMessage", 5},
  28.     {"RV20toYUV420HiveMessage", 6},
  29.     {"RV20toYUV420_RN_FRU_Init", 7},
  30.     {"RV20toYUV420_RN_FRU_Setup", 8},
  31.     {"RV20toYUV420_RN_FRU_GetFrame", 9},
  32.     {"RV20toYUV420_RN_FRU_Free", 10},
  33.     {"GetGUID", 11}
  34. };
  35. extern "C"
  36. int GetSymbolOrdinal(const char* pSymbolName)
  37. {
  38.     int ret = 0;
  39.     int numSymbols = sizeof(z_symbolTable) / sizeof(struct SymbolEntry);
  40.     int i;
  41.     if( NULL != pSymbolName )
  42.     {
  43.        for(i = 0; !ret && (i < numSymbols); i++)
  44.        {
  45.            if (!strcmp(pSymbolName, z_symbolTable[i].m_pSymbolName))
  46.            {
  47.                ret = z_symbolTable[i].m_ordinal;
  48.                break;
  49.            }
  50.        }
  51.     }
  52.     return ret;
  53. }