Exemplo n.º 1
0
        void CreateOverlappedEvent(out NativeMethods.SECURITY_ATTRIBUTES security, out NativeMethods.OVERLAPPED overlappedEvent)
        {
            security = new NativeMethods.SECURITY_ATTRIBUTES
            {
                lpSecurityDescriptor = IntPtr.Zero,
                bInheritHandle       = true,
                nLength = Marshal.SizeOf(cancelEventSecurity)
            };

            overlappedEvent = new NativeMethods.OVERLAPPED
            {
                Offset     = 0,
                OffsetHigh = 0,
                hEvent     = NativeMethods.CreateEvent(ref cancelEventSecurity, Convert.ToInt32(true), Convert.ToInt32(false), string.Empty)
            };
        }
Exemplo n.º 2
0
        void CreateOverlappedEvent(out NativeMethods.SECURITY_ATTRIBUTES security, out NativeMethods.OVERLAPPED overlappedEvent)
        {
            security = new NativeMethods.SECURITY_ATTRIBUTES
            {
                lpSecurityDescriptor = IntPtr.Zero,
                bInheritHandle = true,
                nLength = Marshal.SizeOf(cancelEventSecurity)
            };

            overlappedEvent = new NativeMethods.OVERLAPPED
            {
                Offset = 0,
                OffsetHigh = 0,
                hEvent = NativeMethods.CreateEvent(ref cancelEventSecurity, Convert.ToInt32(true), Convert.ToInt32(false), string.Empty)
            };
        }