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