rv40_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. };
  45. extern "C"
  46. int GetSymbolOrdinal(const char* pSymbolName)
  47. {
  48.     int ret = 0;
  49.     int numSymbols = sizeof(z_symbolTable) / sizeof(struct SymbolEntry);
  50.     int i;
  51.     if( NULL != pSymbolName )
  52.     {
  53.        for(i = 0; !ret && (i < numSymbols); i++)
  54.        {
  55.            if (!strcmp(pSymbolName, z_symbolTable[i].m_pSymbolName))
  56.            {
  57.                ret = z_symbolTable[i].m_ordinal;
  58.                break;
  59.            }
  60.        }
  61.     }
  62.     return ret;
  63. }