Esempio n. 1
0
 protected void ConfigureServiceSidType()
 {
     base.DoNativeServiceTask(this.Name, ServiceAccessFlags.AllAccess, delegate(IntPtr service)
     {
         ServiceSidActions serviceSidActions = default(ServiceSidActions);
         serviceSidActions.serviceSidType    = 0U;
         if (!NativeMethods.ChangeServiceConfig2(service, ServiceConfigInfoLevels.ServiceSid, ref serviceSidActions))
         {
             base.WriteError(TaskWin32Exception.FromErrorCodeAndVerbose(Marshal.GetLastWin32Error(), Strings.ErrorChangeServiceConfig2(this.Name)), ErrorCategory.WriteError, null);
         }
     });
 }
 public static extern bool ChangeServiceConfig2(IntPtr serviceController, ServiceConfigInfoLevels infoLevel, ref ServiceSidActions serviceSidActions);