sipr_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.     {"RAOpenCodec", 2},
  25.     {"RAOpenCodec2", 3},
  26.     {"RAGetNumberOfFlavors", 4},
  27.     {"RAGetFlavorProperty", 5},
  28.     {"RASetFlavor", 6},
  29.     {"RASetPwd", 7},
  30.     {"RACloseCodec", 8},
  31.     {"RAGetBackend", 9},
  32.     {"RASetComMode", 10},
  33.     {"RAGetDecoderBackendGUID", 11},
  34.     {"RAGetGUID", 12},
  35.     {"RAInitDecoder", 13},
  36.     {"RADecode", 14},
  37.     {"RAFlush", 15},
  38.     {"RAFreeDecoder", 16}
  39. };
  40. extern "C"
  41. int GetSymbolOrdinal(const char* pSymbolName)
  42. {
  43.     int ret = 0;
  44.     int numSymbols = sizeof(z_symbolTable) / sizeof(struct SymbolEntry);
  45.     int i;
  46.     if( NULL != pSymbolName )
  47.     {
  48.        for(i = 0; !ret && (i < numSymbols); i++)
  49.        {
  50.            if (!strcmp(pSymbolName, z_symbolTable[i].m_pSymbolName))
  51.            {
  52.                ret = z_symbolTable[i].m_ordinal;
  53.                break;
  54.            }
  55.        }
  56.     }
  57.     return ret;
  58. }