예제 #1
0
        public static void SetDesktopWinStaAccess()
        {
            using (var wsHandle = new WindowStationHandle("WinSta0", (WindowStationAccess)StandardRights.WriteDac))
                wsHandle.SetSecurity(SecurityInformation.Dacl, new SecurityDescriptor());

            using (var dhandle = new DesktopHandle("Default", false,
                                                   (DesktopAccess)StandardRights.WriteDac | DesktopAccess.ReadObjects | DesktopAccess.WriteObjects))
                dhandle.SetSecurity(SecurityInformation.Dacl, new SecurityDescriptor());
        }
예제 #2
0
        public static void SetDesktopWinStaAccess()
        {
            using (var wsHandle = new WindowStationHandle("WinSta0", (WindowStationAccess)StandardRights.WriteDac))
                wsHandle.SetSecurity(SecurityInformation.Dacl, new SecurityDescriptor());

            using (var dhandle = new DesktopHandle("Default", false,
                (DesktopAccess)StandardRights.WriteDac | DesktopAccess.ReadObjects | DesktopAccess.WriteObjects))
                dhandle.SetSecurity(SecurityInformation.Dacl, new SecurityDescriptor());
        }
        public IDesktop GetFromCurrentThread()
        {
            var handle = DesktopHandle.GetFromCurrentThread();

            return(new Desktop(handle));
        }
        public IDesktop Open(string name, DesktopOpenFlags flags, bool inherit, DesktopAccessRights desiredAccess)
        {
            var handle = DesktopHandle.Open(name, flags, inherit, desiredAccess);

            return(new Desktop(handle));
        }
예제 #5
0
 public Desktop(DesktopHandle handle)
 {
     _handle = handle;
 }
예제 #6
0
 public Desktop(DesktopHandle handle)
 {
     _handle = handle;
 }