示例#1
0
 public void RemoveAsyncContext(SMB1AsyncContext context)
 {
     lock (m_pendingRequests)
     {
         int index = IndexOfAsyncContext(context.UID, context.TID, context.PID, context.MID);
         if (index >= 0)
         {
             m_pendingRequests.RemoveAt(index);
         }
     }
 }
示例#2
0
        private int IndexOfAsyncContext(ushort userID, ushort treeID, uint processID, ushort multiplexID)
        {
            for (int index = 0; index < m_pendingRequests.Count; index++)
            {
                SMB1AsyncContext context = m_pendingRequests[index];
                if (context.UID == userID &&
                    context.TID == treeID &&
                    context.PID == processID &&
                    context.MID == multiplexID)
                {
                    return(index);
                }
            }

            return(-1);
        }
示例#3
0
        public SMB1AsyncContext CreateAsyncContext(ushort userID, ushort treeID, uint processID, ushort multiplexID, ushort fileID, SMB1ConnectionState connection)
        {
            SMB1AsyncContext context = new SMB1AsyncContext();

            context.UID        = userID;
            context.TID        = treeID;
            context.MID        = multiplexID;
            context.PID        = processID;
            context.FileID     = fileID;
            context.Connection = connection;
            lock (m_pendingRequests)
            {
                m_pendingRequests.Add(context);
            }
            return(context);
        }