X-Recipient: archive-cygwin AT delorie DOT com DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:from:date:message-id:subject:to :content-type; q=dns; s=default; b=m0+UdCeVY30XloG24FJcSa6LrplT+ GqoTBaCDQYY+6u3XgZAKdMLWXa+XXaiUyPAZ2s0ye/3SWbDz8QpfETRVv5ItP9yi LLwXiPbaMJ80VqOgFKH1+7z4kx+a47hApev+ydiXvRuA2BX6ZhDZQqTclxPXtpAN nncgIDBm8vhdY8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:mime-version:from:date:message-id:subject:to :content-type; s=default; bh=53F+xY/OVyBHT5LJN8dRTipKzvM=; b=c+c mekgtv90dZuLb79H1BqQuNsDPsGZfs5q5GgS0rHYsMRo81DhRh1WUFuRxWraeiKf A/gBe8phtgticpEWZiCqluLqu4+kg0NNMYCJl9ayVVb2vnhvGKhqqRzPsmNRSlJe uFBKBCPEu5sxvlx7ee7UUGGPbnkPP71h9G/w4U1s= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=sessions, Manager, services, day X-HELO: mout.gmx.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mail.com; s=dbd5af2cbaf7; t=1579801490; bh=wzxgOPHdK2/p9D/S+zUJHoYWFyTL4Vgs7uvLtsA2PFo=; h=X-UI-Sender-Class:From:Date:Subject:To; b=Ob9zIviEMfAXC6DevX3SlWD6tT8FduBZyFX8KsothdSl2Hz9qw/H7DNAUTSJ1BHPC T3EWOnXWcWc0QV0H+gatUzj6oD4Vw7UC5xY5ay0fK5e2L5JEf9iInq6aChGFpLPIHD A+/vr7jHdu9fkfPv+5GQqDnO8YjAE/90F/IKvfX4= X-UI-Sender-Class: 214d933f-fd2f-45c7-a636-f5d79ae31a79 MIME-Version: 1.0 From: Bill Stewart Date: Thu, 23 Jan 2020 10:44:21 -0700 Message-ID: Subject: Windows Restart Manager and cygrunsrv services To: cygwin AT cygwin DOT com Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes Good day, Application installers (such as Windows Installer or Inno Setup) can use the Windows Restart Manager APIs[1] it to determine if a program or service is running, and automatically stop/restart as appropriate. This is useful when reinstalling or upgrading a service from an installer, as the installer itself can stop the service, replace the binary/binaries, and restart the service automatically. However it seems that when running a service using cygrunsrv, the Restart Manager RmGetList API[2] returns RmRebootReasonSessionMismatch (2) for the lpdwRebootReasons output parameter. This parameter return value is one of the RM_REBOOT_REASON enumeration values[3]. The description for the RmRebootReasonSessionMismatch value on MSDN is as follows: "One or more processes are running in another Terminal Services session." I ran into this building an Inno Setup installer. I reproduced on Windows 10 x64 and Windows Server 2008 R2 x64. The error description is interesting, because in neither repro case were there other users logged on using TS sessions. (I'm not sure if that error description is completely accurate in describing all cases where that value gets returned, though...) Unexpected behavior: Restart Manager returns 2 (RmRebootReasonSessionMismatch) in the lpdwRebootReasons output parameter when calling the RmGetList API to detect a cygrunsrv service. Expected behavior: Restart Manager should return 0 (RmRebootReasonNone) in the lpdwRebootReasons output parameter when calling the RmGetList API to detect a cygrunsrv service. Further details (regarding Inno Setup and this problem): https://groups.google.com/d/msg/innosetup/9dAT3wB9RTQ/99Py-ZgLCgAJ Any ideas why Restart Manager doesn't work for cygrunsrv services? Thanks! Bill ____________________ [1] https://docs.microsoft.com/en-us/windows/win32/rstmgr/about-restart-manager [2] https://docs.microsoft.com/en-us/windows/win32/api/restartmanager/nf-restartmanager-rmgetlist [3] https://docs.microsoft.com/en-us/windows/win32/api/restartmanager/ne-restartmanager-rm_reboot_reason -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple