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

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.     {"PNCodec_Open", 2},
  25.     {"PNCodec_Close", 3},
  26.     {"PNCodec_GetUIName", 4},
  27.     {"PNCodec_GetVersion", 5},
  28.     {"PNCodec_QueryMediaFormat", 6},
  29.     {"PNCodec_PreferredMediaFormat", 7},
  30.     {"PNCodec_GetMediaFormats", 8},
  31.     {"PNCodec_StreamOpen", 9},
  32.     {"PNCodec_Input", 10},
  33.     {"PNStream_Close", 11},
  34.     {"PNStream_SetDataCallback", 12},
  35.     {"PNStream_GetStreamHeaderSize", 13},
  36.     {"PNStream_GetStreamHeader", 14},
  37.     {"PNStream_Input", 15},
  38.     {"PNStream_SetOutputPacketSize", 16},
  39.     {"PNStream_GetInputBufferSize", 17},
  40.     {"PNStream_GetProperty", 18},
  41.     {"PNStream_SetProperty", 19},
  42.     {"PNStream_OpenSettingsBox", 20},
  43.     {"PNStream_GetIPNUnknown", 21},
  44.     {"SetDLLAccessPath", 22}
  45. };
  46. extern "C"
  47. int GetSymbolOrdinal(const char* pSymbolName)
  48. {
  49.     int ret = 0;
  50.     int numSymbols = sizeof(z_symbolTable) / sizeof(struct SymbolEntry);
  51.     int i;
  52.     if( NULL != pSymbolName )
  53.     {
  54.        for(i = 0; !ret && (i < numSymbols); i++)
  55.        {
  56.            if (!strcmp(pSymbolName, z_symbolTable[i].m_pSymbolName))
  57.            {
  58.                ret = z_symbolTable[i].m_ordinal;
  59.                break;
  60.            }
  61.        }
  62.     }
  63.     return ret;
  64. }