From 7109a359ec9e63c4e186ef9fcaf9d93897be8aa4 Mon Sep 17 00:00:00 2001 From: Ged Murphy Date: Sun, 22 Jan 2006 23:42:45 +0000 Subject: [PATCH] remove unneeded loop check svn path=/trunk/; revision=20996 --- reactos/subsys/system/servman/control.c | 7 +++---- reactos/subsys/system/servman/servman.h | 1 + reactos/subsys/system/servman/start.c | 7 +++---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/reactos/subsys/system/servman/control.c b/reactos/subsys/system/servman/control.c index a6faffa73cf..b1a17850acb 100644 --- a/reactos/subsys/system/servman/control.c +++ b/reactos/subsys/system/servman/control.c @@ -22,7 +22,6 @@ BOOL Control(HWND hProgDlg, DWORD Control) SERVICE_STATUS Status; LVITEM item; DWORD BytesNeeded = 0; - DWORD Loop = 5; //FIXME: testing value. needs better control DWORD dwStartTickCount, dwOldCheckPoint; item.mask = LVIF_PARAM; @@ -34,7 +33,7 @@ BOOL Control(HWND hProgDlg, DWORD Control) /* set the progress bar range and step */ hProgBar = GetDlgItem(hProgDlg, IDC_SERVCON_PROGRESS); - SendMessage(hProgBar, PBM_SETRANGE, 0, MAKELPARAM(0, Loop)); + SendMessage(hProgBar, PBM_SETRANGE, 0, MAKELPARAM(0, PROGRESSRANGE)); SendMessage(hProgBar, PBM_SETSTEP, (WPARAM)1, 0); /* open handle to the SCM */ @@ -79,7 +78,7 @@ BOOL Control(HWND hProgDlg, DWORD Control) /* loop whilst service is not running */ /* FIXME: needs more control adding. 'Loop' is temparary */ - while (ServiceStatus.dwCurrentState != Control || !Loop) + while (ServiceStatus.dwCurrentState != Control) { DWORD dwWaitTime; @@ -129,7 +128,7 @@ BOOL Control(HWND hProgDlg, DWORD Control) if (ServiceStatus.dwCurrentState == Control) { - SendMessage(hProgBar, PBM_DELTAPOS, Loop, 0); + SendMessage(hProgBar, PBM_DELTAPOS, PROGRESSRANGE, 0); Sleep(1000); return TRUE; } diff --git a/reactos/subsys/system/servman/servman.h b/reactos/subsys/system/servman/servman.h index a92846c0070..be22a04f1c3 100644 --- a/reactos/subsys/system/servman/servman.h +++ b/reactos/subsys/system/servman/servman.h @@ -11,6 +11,7 @@ #define MAX_KEY_LENGTH 256 #define NUM_BUTTONS 13 +#define PROGRESSRANGE 8 BOOL RefreshServiceList(VOID); diff --git a/reactos/subsys/system/servman/start.c b/reactos/subsys/system/servman/start.c index d3ab36d006b..25908fb8a7d 100644 --- a/reactos/subsys/system/servman/start.c +++ b/reactos/subsys/system/servman/start.c @@ -21,7 +21,6 @@ BOOL DoStartService(HWND hProgDlg) ENUM_SERVICE_STATUS_PROCESS *Service = NULL; DWORD BytesNeeded = 0; INT ArgCount = 0; - DWORD Loop = 5; //FIXME: testing value. needs better control DWORD dwStartTickCount, dwOldCheckPoint; /* copy pointer to selected service */ @@ -29,7 +28,7 @@ BOOL DoStartService(HWND hProgDlg) /* set the progress bar range and step */ hProgBar = GetDlgItem(hProgDlg, IDC_SERVCON_PROGRESS); - SendMessage(hProgBar, PBM_SETRANGE, 0, MAKELPARAM(0, Loop)); + SendMessage(hProgBar, PBM_SETRANGE, 0, MAKELPARAM(0, PROGRESSRANGE)); SendMessage(hProgBar, PBM_SETSTEP, (WPARAM)1, 0); /* open handle to the SCM */ @@ -72,7 +71,7 @@ BOOL DoStartService(HWND hProgDlg) /* loop whilst service is not running */ /* FIXME: needs more control adding. 'Loop' is temparary */ - while (ServiceStatus.dwCurrentState != SERVICE_RUNNING || !Loop) + while (ServiceStatus.dwCurrentState != SERVICE_RUNNING) { DWORD dwWaitTime; @@ -122,7 +121,7 @@ BOOL DoStartService(HWND hProgDlg) if (ServiceStatus.dwCurrentState == SERVICE_RUNNING) { - SendMessage(hProgBar, PBM_DELTAPOS, Loop, 0); + SendMessage(hProgBar, PBM_DELTAPOS, PROGRESSRANGE, 0); Sleep(1000); return TRUE; }