[pywin32-bugs] [ pywin32-Bugs-1208081 ] Fix: WaitForServiceStatus doesn't work for remote boxes
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
|
From: SourceForge.net <no...@so...> - 2005-05-24 19:48:16
|
Bugs item #1208081, was opened at 2005-05-24 14:48 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1208081&group_id=78018 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: win32 Group: None Status: Open Resolution: None Priority: 5 Submitted By: Michael Schall (schallm) Assigned to: Nobody/Anonymous (nobody) Summary: Fix: WaitForServiceStatus doesn't work for remote boxes Initial Comment: The machine name is not passed to QueryServiceStatus. Current code: now_status = QueryServiceStatus(serviceName)[1] Fixed code: now_status = QueryServiceStatus(serviceName, machine)[1] Full function: def WaitForServiceStatus(serviceName, status, waitSecs, machine=None): """Waits for the service to return the specified status. You should have already requested the service to enter that state""" hscm = win32service.OpenSCManager(machine,None,win32service.SC_MANAGER_ALL_ACCESS) for i in range(waitSecs*4): now_status = QueryServiceStatus(serviceName, machine)[1] if now_status == status: break win32api.Sleep(250) else: raise pywintypes.error, (winerror.ERROR_SERVICE_REQUEST_TIMEOUT, "QueryServiceStatus", win32api.FormatMessage(winerror.ERROR_SERVICE_REQUEST_TIMEOUT)[:-2]) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1208081&group_id=78018 |