예제 #1
0
 private void Initialize(bool multipleServices)
 {
     if (!this.initialized)
     {
         if (this.disposed)
         {
             throw new ObjectDisposedException(base.GetType().Name);
         }
         if (!multipleServices)
         {
             this.status.serviceType = 0x10;
         }
         else
         {
             this.status.serviceType = 0x20;
         }
         this.status.currentState            = 2;
         this.status.controlsAccepted        = 0;
         this.status.win32ExitCode           = 0;
         this.status.serviceSpecificExitCode = 0;
         this.status.checkPoint = 0;
         this.status.waitHint   = 0;
         this.mainCallback      = this.ServiceMainCallback;
         this.commandCallback   = this.ServiceCommandCallback;
         this.commandCallbackEx = this.ServiceCommandCallbackEx;
         this.handleName        = Marshal.StringToHGlobalUni(this.ServiceName);
         this.initialized       = true;
     }
 }
예제 #2
0
 private void Initialize(bool multipleServices)
 {
     if (!this.initialized)
         {
         if (this.disposed)
             {
             throw new ObjectDisposedException(base.GetType().Name);
             }
         if (!multipleServices)
             {
             this.status.serviceType = 0x10;
             }
         else
             {
             this.status.serviceType = 0x20;
             }
         this.status.currentState = 2;
         this.status.controlsAccepted = 0;
         this.status.win32ExitCode = 0;
         this.status.serviceSpecificExitCode = 0;
         this.status.checkPoint = 0;
         this.status.waitHint = 0;
         this.mainCallback       = this.ServiceMainCallback;
         this.commandCallback    = this.ServiceCommandCallback;
         this.commandCallbackEx  = this.ServiceCommandCallbackEx;
         this.handleName = Marshal.StringToHGlobalUni(this.ServiceName);
         this.initialized = true;
         }
 }