Unit SvcObj

to do: make VCL aware replace Write/WriteLn either with Raise() or Log() calls merge TThread and TCriticalThread for VCL/console capabilities polish InvokeDebugger (eventually use NT's JIT debugging setting) add "Usage trick" suggestion from Mark Wade or aequivalent { Unit: SvcObj Version: 1.10 Purpose: Components around winsvc.pas Author: Peter Sawatzki (ps) Buchenhof 3, 58091 Hagen, Germany CompuServe: 100031,3002 E-Mail: Peter@Sawatzki.de web: http://www.sawatzki.de Date: Author: 03/01/96 ps first version for Delphi 2.0 04/02/96 ps use wrapper to make multiple service instances possible 04/10/96 ps add proper event logging 05/01/96 ps add pause/continue, add watchdog to terminate non-responding service 05/03/96 ps add Interactive, Account, Password 07/10/96 sgp/ps enable automatic startup for SERVICE_AUTO_START services 01/02/97 ps add support for service arguments, care for system shutdown 02/11/97 ps/bdb fix range check glitch 03/03/97 ps take care of using WinSvc20.Pas for Delphi2 05/12/97 ps add service detection code 08/28/97 ps move GetLastErrorText to ntobj.pas Copyright © 1996,1997 Peter Sawatzki. All Rights Reserved. Contributing: Steve Pritchard (sgp) 2/7/96 Berend De Boer (bdb) 2/11/97

Classes

TService -

Functions

CmdLine -
InvokeDebugger - -the following routine invokes the debugger in the security context of the service (thus td32 is allowed to access the service)
WaitForServiceCompletion -

Types

TCharArray
TServiceThread
TServiceType

Constants

WhereIsTD32

Variables

SCMCaller
ServiceList


Functions


Procedure CmdLine;


Procedure InvokeDebugger;

-the following routine invokes the debugger in the security context of the service (thus td32 is allowed to access the service)

Procedure WaitForServiceCompletion;


Types


TCharArray = Array[0..29] Of PChar;
TServiceThread = TCriticalThread; ======================================= notice: we need to merge TThread and TCriticalThread later! TCriticalThread should be used for console only services while TThread must be used for everything where VCL is involved (read message loops) =======================================
TServiceThread = TThread
hard-wired for this prelimiary release
TServiceType = (stWin32, stKernel, stFileSystem);

Constants

WhereIsTD32 = 'd:\Delphi3\bin\td32.exe'


Variables

SCMCaller : TServiceThread

ServiceList : TList