Esempio n. 1
0
 public virtual int FilterGetMessage(IntPtr hPort,
                                     ref ACCESS_REQUEST lpMessageBuffer,
                                     int dwMessageBufferSize,
                                     IntPtr lpOverlapped)
 {
     return(_FilterGetMessage(hPort, ref lpMessageBuffer, dwMessageBufferSize, lpOverlapped));
 }
Esempio n. 2
0
        /// <summary>Gets request from the queue.</summary>
        public virtual ACCESS_REQUEST GetRequest()
        {
            if (!IsRunning)
            {
                throw new InvalidOperationException("FileWall is stopped.");
            }

            var AccessRequest = new ACCESS_REQUEST();
            var hr            = fltLib.FilterGetMessage(portHandle, ref AccessRequest, Marshal.SizeOf(AccessRequest), IntPtr.Zero);

            Marshal.ThrowExceptionForHR(hr);

            return(AccessRequest);
        }
Esempio n. 3
0
        /// <summary>Replies to the request.</summary>
        public virtual void ReplyRequest(ACCESS_REQUEST AccessRequest, Boolean Allow)
        {
            if (!IsRunning)
            {
                throw new InvalidOperationException("FileWall is stopped.");
            }

            var Permission = new PERMISSION
            {
                Status    = 0,                              // STATUS_SUCCESS
                MessageId = AccessRequest.MessageId,
                Allow     = (Allow ? 1 : 0)
            };

            var hr = fltLib.FilterReplyMessage(portHandle, ref Permission, Marshal.SizeOf(Permission));

            Marshal.ThrowExceptionForHR(hr);
        }
Esempio n. 4
0
 private static extern int _FilterGetMessage(IntPtr hPort,
                                             ref ACCESS_REQUEST lpMessageBuffer,
                                             int dwMessageBufferSize,
                                             IntPtr lpOverlapped);