/* * Copyright 1995, 2000 Perforce Software. All rights reserved. * * This file is part of Perforce - the FAST SCM System. */ /* * NtService - Class allows Perforce server to run as a service on NT. * * Public methods: * * NtService::NtService() * Constructor requires a name, and a pointer to the entry point for * the program which can not be main because main calls * StartServiceControlDispatcher() and never returns. * * NtService::Start() * This calls StartServiceControlDispatcher to connect the service to * the SCM. This should be called as soon as possible after the * program starts because the SCM will only wait 30 seconds for this * call. * * NtService::SetStatus() * Informx SCM of changes in the services status. Required to tell * SCM when service has successfully started. * */ #ifndef NTSERVICE_H__ #define NTSERVICE_H__ class Error; class NtService { public: enum states { stopped, running, start_pending, stop_pending, paused, pause_pending, continue_pending, no_change }; NtService(); virtual ~NtService(); // Our caller's interface virtual void Start( int (*entryPt)( DWORD, char ** ), char *svc, Error *e); virtual void SetStatus( states state = no_change, DWORD win32_exitcode = 0, DWORD specific_code = 0, DWORD wait_hint = 0 ); private: // SCM callbacks with Win32 interfaces. // Do not call them directly. // Because they are static, we have to remember // the (one) NtService in use. static NtService *global_this; static void WINAPI ControlHandler( DWORD opcode ); static void StaticRun( DWORD argc, char **argv ); // Called by ControlHanlder virtual void Run( DWORD argc, char **argv ); virtual void Stop(); SERVICE_STATUS status; SERVICE_STATUS_HANDLE statusHandle; int ( *entry_point )( DWORD, char ** ); char svcName[32]; }; #endif // NTSERVICE_H__
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 15071 | alan_petersen |
Populate -o //guest/perforce_software/piper/... //guest/alan_petersen/piper/.... |
||
//guest/perforce_software/piper/mac/main/Perforce/p4api/Headers/ntservice.h | |||||
#1 | 11252 | alan_petersen | Rename/move file(s) | ||
//guest/perforce_software/piper/mac/Perforce/p4api/Headers/ntservice.h | |||||
#1 | 10744 | alan_petersen | Rename/move file(s) | ||
//guest/perforce_software/piper/Perforce/p4api/Headers/ntservice.h | |||||
#1 | 8919 | Matt Attaway | Initial add of Piper, a lightweight Perforce client for artists and designers. |