Lnk.ShellItems.ShellBag0X00.ProcessMtpType2 C# (CSharp) Méthode

ProcessMtpType2() private méthode

private ProcessMtpType2 ( byte rawBytes ) : void
rawBytes byte
Résultat void
        private void ProcessMtpType2(byte[] rawBytes)
        {
            FriendlyName = "Variable: MTP type 2";

            var index = 4;

            var dataSize = BitConverter.ToUInt16(rawBytes, index);
            index += 2;

            index += 4; //skip signature

            index += 4; //skip unknown

            index += 2; //skip unknown

            index += 2; //skip unknown

            index += 4; //skip unknown

            index += 12; //skip unknown empty

            index += 4; //skip unknown size

            var storageStringNameLen = BitConverter.ToInt32(rawBytes, index);

            index += 4;

            var storageIdStringLen = BitConverter.ToInt32(rawBytes, index);

            index += 4;

            var fileSystemNameLen = BitConverter.ToInt32(rawBytes, index);

            index += 4;

            var numGuiDs = BitConverter.ToInt32(rawBytes, index);

            index += 4; // skip unknown

            var storageName = Encoding.Unicode.GetString(rawBytes, index, storageStringNameLen*2 - 2);

            index += storageStringNameLen*2;

            _storageIdName = Encoding.Unicode.GetString(rawBytes, index, storageIdStringLen*2 - 2);

            index += storageIdStringLen*2;

            _fileSystemName = Encoding.Unicode.GetString(rawBytes, index, fileSystemNameLen*2 - 2);

            index += fileSystemNameLen*2;

            //index += 6; //get to beginning of GUIDs


            _guids = new List<string>();
            for (var i = 0; i < numGuiDs; i++)
            {
                var rawGuid = rawBytes.Skip(index).Take(78).ToArray();
                index += 78;
                var guid = Encoding.Unicode.GetString(rawGuid).Replace("\0", "");
                _guids.Add(guid);
            }

            index += 4; //unknown

            var classIdRaw = rawBytes.Skip(index).Take(16).ToArray();

            var clasIdguid = Utils.ExtractGuidFromShellItem(classIdRaw);
            _classId = Utils.GetFolderNameFromGuid(clasIdguid);

            index += 16;

            var numProps = BitConverter.ToInt32(rawBytes, index);
            index += 4;

            //at property array, but what is it?


            Value = storageName;
        }