Static SebWindowsServiceHandler with singleton pattern
예제 #1
0
 public static bool ResetRegistry()
 {
     Logger.AddInformation("resetting registry entries", (object)null, (Exception)null, (string)null);
     SebWindowsServiceHandler.Initialize();
     Logger.AddInformation("calling reset on wcf service", (object)null, (Exception)null, (string)null);
     SebWindowsServiceHandler.ResetInputParameters();
     return(SebWindowsServiceHandler._sebWindowsServicePipeProxy.Reset());
 }
예제 #2
0
 public static bool SetRegistryAccordingToConfiguration()
 {
     return(SebWindowsServiceHandler.SetRegistryAccordingToConfiguration(new Dictionary <RegistryIdentifiers, object>()
     {
         {
             RegistryIdentifiers.DisableLockWorkstation,
             (object)((bool)SEBClientInfo.getSebSetting("insideSebEnableLockThisComputer")["insideSebEnableLockThisComputer"] ? 0 : 1)
         },
         {
             RegistryIdentifiers.DisableChangePassword,
             (object)((bool)SEBClientInfo.getSebSetting("insideSebEnableChangeAPassword")["insideSebEnableChangeAPassword"] ? 0 : 1)
         },
         {
             RegistryIdentifiers.DisableTaskMgr,
             (object)((bool)SEBClientInfo.getSebSetting("insideSebEnableStartTaskManager")["insideSebEnableStartTaskManager"] ? 0 : 1)
         },
         {
             RegistryIdentifiers.HideFastUserSwitching,
             (object)((bool)SEBClientInfo.getSebSetting("insideSebEnableSwitchUser")["insideSebEnableSwitchUser"] ? 0 : 1)
         },
         {
             RegistryIdentifiers.NoLogoff,
             (object)((bool)SEBClientInfo.getSebSetting("insideSebEnableLogOff")["insideSebEnableLogOff"] ? 0 : 1)
         },
         {
             RegistryIdentifiers.NoClose,
             (object)((bool)SEBClientInfo.getSebSetting("insideSebEnableShutDown")["insideSebEnableShutDown"] ? 0 : 1)
         },
         {
             RegistryIdentifiers.EnableShade,
             (object)((bool)SEBClientInfo.getSebSetting("insideSebEnableVmWareClientShade")["insideSebEnableVmWareClientShade"] ? 1 : 0)
         },
         {
             RegistryIdentifiers.EnableShadeHorizon,
             (object)((bool)SEBClientInfo.getSebSetting("insideSebEnableVmWareClientShade")["insideSebEnableVmWareClientShade"] ? "True" : "False")
         },
         {
             RegistryIdentifiers.EaseOfAccess,
             (object)((bool)SEBClientInfo.getSebSetting("insideSebEnableEaseOfAccess")["insideSebEnableEaseOfAccess"] ? "" : "SebDummy.exe")
         },
         {
             RegistryIdentifiers.DontDisplayNetworkSelectionUI,
             (object)((bool)SEBClientInfo.getSebSetting("insideSebEnableEnableNetworkConnectionSelector")["insideSebEnableEnableNetworkConnectionSelector"] ? 0 : 1)
         }
     }));
 }
예제 #3
0
 private static void Initialize()
 {
     if (SebWindowsServiceHandler._initialized)
     {
         return;
     }
     Logger.AddInformation("initializing wcf service connection", (object)null, (Exception)null, (string)null);
     SebWindowsServiceHandler._sebWindowsServicePipeProxy = new ChannelFactory <IRegistryServiceContract>((Binding) new NetNamedPipeBinding(NetNamedPipeSecurityMode.Transport), new EndpointAddress("net.pipe://localhost/SebWindowsServiceWCF/service")).CreateChannel();
     if (string.IsNullOrEmpty(SebWindowsServiceHandler._username))
     {
         SebWindowsServiceHandler._username = SebWindowsServiceHandler.GetCurrentUsername();
     }
     if (string.IsNullOrEmpty(SebWindowsServiceHandler._sid))
     {
         SebWindowsServiceHandler._sid = SebWindowsServiceHandler.GetCurrentUserSID();
     }
     if (string.IsNullOrEmpty(SebWindowsServiceHandler._sid) && string.IsNullOrEmpty(SebWindowsServiceHandler._username))
     {
         throw new Exception("Unable to get SID & Username");
     }
     SebWindowsServiceHandler._initialized = true;
 }
예제 #4
0
 public static void Reconnect()
 {
     SebWindowsServiceHandler._initialized = false;
     SebWindowsServiceHandler.Initialize();
 }
예제 #5
0
 public static bool SetRegistryAccordingToConfiguration(Dictionary <RegistryIdentifiers, object> valuesToSet)
 {
     SebWindowsServiceHandler.Initialize();
     SebWindowsServiceHandler.SetInputParameters();
     return(SebWindowsServiceHandler._sebWindowsServicePipeProxy.SetRegistryEntries(valuesToSet, SebWindowsServiceHandler._sid, SebWindowsServiceHandler._username));
 }