drvc_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.     {"RV40toYUV420Init", 2},
  23.     {"RV40toYUV420Free", 3},
  24.     {"RV40toYUV420Transform", 4},
  25.     {"RV40toYUV420CustomMessage", 5},
  26.     {"RV40toYUV420HiveMessage", 6}
  27. };
  28. extern "C"
  29. int GetSymbolOrdinal(const char* pSymbolName)
  30. {
  31.     int ret = 0;
  32.     int numSymbols = sizeof(z_symbolTable) / sizeof(struct SymbolEntry);
  33.     int i;
  34.     if( NULL != pSymbolName )
  35.     {
  36.        for(i = 0; !ret && (i < numSymbols); i++)
  37.        {
  38.            if (!strcmp(pSymbolName, z_symbolTable[i].m_pSymbolName))
  39.            {
  40.                ret = z_symbolTable[i].m_ordinal;
  41.                break;
  42.            }
  43.        }
  44.     }
  45.     return ret;
  46. }