예제 #1
0
        public bool OpenPXEImageFromMemory(MemoryStream pxeFile)
        {
            byte[] pxeData = new byte[pxeFile.Length];

            using (BinaryReader r = new BinaryReader(pxeFile))
            {
                // Read data from Test.data.
                pxeData = r.ReadBytes((int)pxeFile.Length);
            }

            buffersAvailable.Clear();

            pxeHeader = OpenAndProcessPXEImageFromMemory(_InstanceId, pxeData, (int)pxeData.Length);

            if (pxeHeader.isValidFile != 1)
            {
                CloseActiveBag(_InstanceId);
                return(false);
            }

            LoadPXEData();

            pxeFile.Close();
            pxeFile.Dispose();

            return(true);
        }
예제 #2
0
파일: PXEAccess.cs 프로젝트: BdGL3/CXPortal
        public bool OpenPXEImageFromMemoryWithTIP(MemoryStream pxeFile, MemoryStream tipPXEFile, ref TIPStatus tipStatus)
        {
            byte[] pxeData = new byte[pxeFile.Length];

            using (BinaryReader r = new BinaryReader(pxeFile))
            {
                // Read data from Test.data.
                pxeData = r.ReadBytes((int)pxeFile.Length);
            }

            buffersAvailable.Clear();

            byte[] tipPXEData = new byte[tipPXEFile.Length];

            using (BinaryReader r = new BinaryReader(tipPXEFile))
            {
                // Read data from Test.data.
                tipPXEData = r.ReadBytes((int)tipPXEFile.Length);
            }

            buffersAvailable.Clear();

            pxeHeader = OpenAndProcessPXEImageFromMemoryWithTIP(_InstanceId, pxeData, (int)pxeData.Length, tipPXEData, (int)tipPXEData.Length, ref tipStatus);

            if (pxeHeader.isValidFile != 1)
            {
                CloseActiveBag(_InstanceId);
                return false;
            }

            LoadPXEData();

            tipPXEFile.Close();
            tipPXEFile.Dispose();

            pxeFile.Close();
            pxeFile.Dispose();

            return true;
        }