Esempio n. 1
0
        private int ServiceCommandCallbackEx(int command, int eventType, IntPtr eventData, IntPtr eventContext)
        {
            int num = 0;

            switch (command)
            {
            case 13:
                new MyServiceBase.DeferredHandlerDelegateAdvanced(this.DeferredPowerEvent).BeginInvoke(eventType, eventData, (AsyncCallback)null, (object)null);
                break;

            case 14:
                MyServiceBase.DeferredHandlerDelegateAdvancedSession delegateAdvancedSession = new MyServiceBase.DeferredHandlerDelegateAdvancedSession(this.DeferredSessionChange);
                NativeMethods.WTSSESSION_NOTIFICATION wtssessionNotification = new NativeMethods.WTSSESSION_NOTIFICATION();
                Marshal.PtrToStructure(eventData, (object)wtssessionNotification);
                delegateAdvancedSession.BeginInvoke(eventType, wtssessionNotification.sessionId, (AsyncCallback)null, (object)null);
                break;

            default:
                this.ServiceCommandCallback(command);
                break;
            }
            return(num);
        }
Esempio n. 2
0
 private int ServiceCommandCallbackEx(int command, int eventType, IntPtr eventData, IntPtr eventContext)
 {
     int num = 0;
     switch (command)
     {
         case 13:
             new MyServiceBase.DeferredHandlerDelegateAdvanced(this.DeferredPowerEvent).BeginInvoke(eventType, eventData, (AsyncCallback)null, (object)null);
             break;
         case 14:
             MyServiceBase.DeferredHandlerDelegateAdvancedSession delegateAdvancedSession = new MyServiceBase.DeferredHandlerDelegateAdvancedSession(this.DeferredSessionChange);
             NativeMethods.WTSSESSION_NOTIFICATION wtssessionNotification = new NativeMethods.WTSSESSION_NOTIFICATION();
             Marshal.PtrToStructure(eventData, (object)wtssessionNotification);
             delegateAdvancedSession.BeginInvoke(eventType, wtssessionNotification.sessionId, (AsyncCallback)null, (object)null);
             break;
         default:
             this.ServiceCommandCallback(command);
             break;
     }
     return num;
 }