drv2_dll_stub.c
上传用户:zhongxx05
上传日期:2007-06-06
资源大小:33641k
文件大小:1k
源码类别:

Symbian

开发平台:

C/C++

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