Exemplo n.º 1
0
        /// <summary>
        /// Initialises a new instance of an outpoint.
        /// </summary>
        /// <param name="OwnerProcessId">The Id of the process which owns the outpoint.</param>
        /// <param name="pipeClass">The class of pipe which can connect to the outpoint.</param>
        /// <param name="pipeSubclass">The subclass of pipe which can connect to the outpoint.</param>
        /// <param name="MaximumConnections">The maximum number of connections allowed to the outpoint. Also see <see cref="PipeConstants.UnlimitedConnections"/>.</param>
        /// <seealso cref="PipeConstants.UnlimitedConnections"/>
        public PipeOutpoint(uint OwnerProcessId, PipeClasses pipeClass, PipeSubclasses pipeSubclass, int MaximumConnections)
        {
            ProcessId      = OwnerProcessId;
            Class          = pipeClass;
            Subclass       = pipeSubclass;
            MaxConnections = MaximumConnections;

            WaitingThreads = new UInt64List();
        }
Exemplo n.º 2
0
        private void ParseDatFile(Stream inStream)
        {
            Dat = new DatContainer(inStream, datName);

            try
            {
                var containerData = DataEntries.ToList();

                foreach (var keyValuePair in containerData)
                {
                    if (keyValuePair.Value is UnicodeString)
                    {
                        Strings.Add((UnicodeString)keyValuePair.Value);
                    }
                    else if (keyValuePair.Value is UInt64List)
                    {
                        UInt64List ul = (UInt64List)keyValuePair.Value;
                        Strings.Add((UnicodeString) new UnicodeString(ul.Offset, ul.dataTableOffset, ul.ToString()));
                    }
                    else if (keyValuePair.Value is UInt32List)
                    {
                        UInt32List ul = (UInt32List)keyValuePair.Value;
                        Strings.Add((UnicodeString) new UnicodeString(ul.Offset, ul.dataTableOffset, ul.ToString()));
                    }
                    else if (keyValuePair.Value is Int32List)
                    {
                        Int32List ul = (Int32List)keyValuePair.Value;
                        Strings.Add((UnicodeString) new UnicodeString(ul.Offset, ul.dataTableOffset, ul.ToString()));
                    }
                }
            }
            catch (Exception ex)
            {
                throw new Exception(string.Format(Settings.Strings["DatWrapper_ParseDatFile_Failed"], ex.Message), ex);
            }
        }