/// <summary>
        /// 根据Gpt分区表项编辑Gpt分区项;
        /// </summary>
        /// <param name="gptDeviceInfo"></param>
        /// <param name="devieStoken"></param>
        private static void EditGptPartEntries(GPTDeviceInfo gptDeviceInfo, DeviceStoken deviceStoken)
        {
            if (gptDeviceInfo == null)
            {
                throw new ArgumentNullException(nameof(gptDeviceInfo));
            }
            if (deviceStoken == null)
            {
                throw new ArgumentNullException(nameof(deviceStoken));
            }

            gptDeviceInfo.GptPartInfos.ForEach(gptPartInfo => {
                //若EFIPTable为空,则非分区;
                if (gptPartInfo.EFIPTable == null)
                {
                    return;
                }

                var efiTable         = gptPartInfo.EFIPTable.StructInstance;
                var entry            = PartitionEntryFactory.CreatePartitionEntry(Constants.PartEntryKey_GPT);
                var entryStoken      = entry.GetStoken(Constants.PartEntryKey_GPT);
                entryStoken.TypeGUID = Constants.PartEntryType_GPT;

                entryStoken.Name = gptPartInfo.EFIPTable.StructInstance.PartTabName;

                entryStoken.StartLBA = (long)gptPartInfo.StGptPTable.nOffset;
                entryStoken.Size     = Marshal.SizeOf(typeof(StEFIPTable));

                entryStoken.PartStartLBA = (long)efiTable.PartTabStartLBA * deviceStoken.BlockSize;
                entryStoken.PartSize     = (long)(efiTable.PartTabEndLBA - efiTable.PartTabStartLBA) * deviceStoken.BlockSize;

                deviceStoken.PartitionEntries.Add(entry);
            });
        }
        /// <summary>
        /// 编辑GPT设备的Stoken;
        /// </summary>
        /// <param name="stream"></param>
        /// <param name="name"></param>
        /// <param name="xElem"></param>
        /// <param name="reporter"></param>
        /// <returns></returns>
        private static void EditStokenOnGpt(DeviceStoken deviceStoken, IUnmanagedBasicDeviceManager entity)
        {
            if (deviceStoken == null)
            {
                throw new ArgumentNullException(nameof(deviceStoken));
            }

            var gptDeviceInfo = new GPTDeviceInfo();

            try {
                deviceStoken.TypeGuid  = Constants.DeviceType_GPT;
                deviceStoken.PartsType = Constants.PartsType_GPT;

                //获取GPT链表;
                var partPtr        = Partition_Get_GptPTable(entity.BasicDevicePtr);
                var partNode       = partPtr;
                var infoDiskIndex  = 0;
                var efiInfoIndex   = 0;
                var efiPTableIndex = 0;

                while (partNode != IntPtr.Zero)
                {
                    var gptPTable   = partNode.GetStructure <StGptPTable>();
                    var gptPartInfo = new GPTPartInfo {
                        StGptPTable = gptPTable
                    };

                    if (gptPTable.InfoDisk != IntPtr.Zero)
                    {
                        var stInfoDisk = gptPTable.InfoDisk.GetStructure <StInFoDisk>();
                        gptPartInfo.InfoDisk = new InfoDisk(stInfoDisk)
                        {
                            InternalDisplayName = $"{LanguageService.FindResourceString(Constants.DisplayName_InfoDisk)}{++infoDiskIndex}"
                        };
                    }

                    if (gptPTable.EFIInfo != IntPtr.Zero)
                    {
                        var stEFIInfo = gptPTable.EFIInfo.GetStructure <StEFIInfo>();
                        gptPartInfo.EFIInfo = new EFIInfo(stEFIInfo)
                        {
                            InternalDisplayName = $"{LanguageService.FindResourceString(Constants.DisplayName_EFIInfo)}{++efiInfoIndex}"
                        };
                    }

                    if (gptPTable.EFIPTable != IntPtr.Zero)
                    {
                        var stEFITable = gptPTable.EFIPTable.GetStructure <StEFIPTable>();
                        gptPartInfo.EFIPTable = new EFIPTable(stEFITable)
                        {
                            InternalDisplayName = $"{LanguageService.FindResourceString(Constants.DisplayName_EFIPTable)}{++efiPTableIndex}"
                        };
                    }

                    gptDeviceInfo.GptPartInfos.Add(gptPartInfo);
                    partNode = gptPTable.next;
                }

                EditGptPartEntries(gptDeviceInfo, deviceStoken);

                //编辑拓展;
                deviceStoken.SetInstance(gptDeviceInfo, Constants.DeviceStokenTag_GPTDeviceInfo);
            }
            catch (Exception ex) {
                LoggerService.WriteCallerLine(ex.Message);
            }
        }