예제 #1
0
        internal unsafe void InitializeBaseInfoTablePointers(string fileName, bool fromAssembly)
        {
            if (fromAssembly)
            {
                this.m_pDataFileStart = GlobalizationAssembly.GetGlobalizationResourceBytePtr(typeof(BaseInfoTable).Assembly, fileName);
            }
            else
            {
                this.memoryMapFile = new AgileSafeNativeMemoryHandle(fileName);
                if (this.memoryMapFile.FileSize == 0L)
                {
                    this.m_valid = false;
                    return;
                }
                this.m_pDataFileStart = this.memoryMapFile.GetBytePtr();
            }
            EndianessHeader *pDataFileStart = (EndianessHeader *)this.m_pDataFileStart;

            this.m_pCultureHeader = (CultureTableHeader *)(this.m_pDataFileStart + pDataFileStart->leOffset);
            this.SetDataItemPointers();
        }
예제 #2
0
 internal unsafe void InitializeBaseInfoTablePointers(string fileName, bool fromAssembly)
 {
     if (fromAssembly)
     {
         this.m_pDataFileStart = GlobalizationAssembly.GetGlobalizationResourceBytePtr(typeof(BaseInfoTable).Assembly, fileName);
     }
     else
     {
         this.memoryMapFile = new AgileSafeNativeMemoryHandle(fileName);
         if (this.memoryMapFile.FileSize == 0L)
         {
             this.m_valid = false;
             return;
         }
         this.m_pDataFileStart = this.memoryMapFile.GetBytePtr();
     }
     EndianessHeader* pDataFileStart = (EndianessHeader*) this.m_pDataFileStart;
     this.m_pCultureHeader = (CultureTableHeader*) (this.m_pDataFileStart + pDataFileStart->leOffset);
     this.SetDataItemPointers();
 }