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

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