亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? ntservice.h

?? 遠程服務端控制
?? H
字號:
/////////////////////////////////////////////////////////////////////////////
// Copyright (C) 1997 by Joerg Koenig
// All rights reserved
//
// Distribute freely, except: don't remove my name from the source or
// documentation (don't take credit for my work), mark your changes (don't
// get me blamed for your possible bugs), don't alter or remove this
// notice.
// No warrantee of any kind, express or implied, is included with this
// software; use at your own risk, responsibility for damages (if any) to
// anyone resulting from the use of this software rests entirely with the
// user.
//
// Send bug reports, bug fixes, enhancements, requests, flames, etc., and
// I'll try to keep a version up to date.  I can be reached as follows:
//    J.Koenig@adg.de                 (company site)
//    Joerg.Koenig@rhein-neckar.de    (private site)
/////////////////////////////////////////////////////////////////////////////
//
// MODIFIED BY TODD C. WILSON FOR THE ROAD RUNNER NT LOGIN SERVICE.
// HOWEVER, THESE MODIFICATIONS ARE BROADER IN SCOPE AND USAGE AND CAN BE USED
// IN OTHER PROJECTS WITH NO CHANGES.
// MODIFIED LINES FLAGGED/BRACKETED BY "//!! TCW MOD"
//
/////////////////////////////////////////////////////////////////////////////


// last revised: $Date: 5.05.98 21:22 $, $Revision: 2 $


#ifndef NTService_h
#define NTService_h


class CNTService {
	static BOOL				m_bInstance;			// only one CNTService object per application
	
	protected:	// data members
		LPCTSTR					m_lpServiceName;
		LPCTSTR					m_lpDisplayName;
		DWORD					m_dwCheckPoint;
		DWORD					m_dwErr;
		BOOL					m_bDebug;			// TRUE if -d was passed to the program
		SERVICE_STATUS			m_ssStatus;			// current status of the service
		SERVICE_STATUS_HANDLE	m_sshStatusHandle;
		DWORD					m_dwControlsAccepted;	// bit-field of what control requests the
														// service will accept
														// (dflt: SERVICE_ACCEPT_STOP)
		PSID					m_pUserSID;			// the current user's security identifier
		BOOL					m_bWinNT;			// TRUE, if this is running on WinNT FALSE on Win95
		BOOL					m_fConsoleReady;

		// parameters to the "CreateService()" function:
		DWORD			m_dwDesiredAccess;		// default: SERVICE_ALL_ACCESS
		DWORD			m_dwServiceType;		// default: SERVICE_WIN32_OWN_PROCESS
		DWORD			m_dwStartType;			// default: SERVICE_AUTO_START
		DWORD			m_dwErrorControl;		// default: SERVICE_ERROR_NORMAL
		LPCTSTR			m_pszLoadOrderGroup;	// default: NULL
		DWORD			m_dwTagID;				// retrieves the tag identifier
		LPCTSTR			m_pszDependencies;		// default: NULL
		LPCTSTR			m_pszStartName;			// default: NULL
		LPCTSTR			m_pszPassword;			// default: NULL


	public:		// construction/destruction
			// If <DisplayName> is not set, then it defaults to <ServiceName>.
		CNTService(LPCTSTR ServiceName, LPCTSTR DisplayName = 0);
		~CNTService();

	private:	// forbidden functions
		CNTService( const CNTService & );
		CNTService & operator=( const CNTService & );

	public:		// overridables
			// You have to override the following two functions.
			// "Run()" will be called to start the real
			// service's activity. You must call
			//		ReportStatus(SERVICE_RUNNING);
			// before you enter your main-loop !
			// "Stop()" will be called to stop the work of
			// the service. You should break out of the mainloop
			// and return control to the CNTService class.
			//
			// In most cases these functions look like these:
			//
			//		void CMyService :: Run(DWORD argc, LPTSTR * argv) {
			//			ReportStatus(SERVICE_START_PENDING);
			//			// do some parameter processing ...
			//			ReportStatus(SERVICE_START_PENDING);
			//			// do first part of initialisation ...
			//			ReportStatus(SERVICE_START_PENDING);
			//			// do next part of initialisation
			//			// ...
			//			m_hStop = CreateEvent(0, TRUE, FALSE, 0);
			//			ReportStatus(SERVICE_RUNNING);
			//			while( WaitForSingleObject(m_hStop, 10) != WAIT_OBJECT_0 ) {
			//				// do something
			//			}
			//			if( m_hStop )
			//				CloseHandle(m_hStop);
			//		}
			//
			//		void CMyService :: Stop() {
			//			if( m_hStop )
			//				SetEvent(m_hStop);
			//			ReportStatus(SERVICE_STOP_PENDING);
			//		}
		virtual void	Run(DWORD argc, LPTSTR * argv) = 0;
		virtual void	Stop() = 0;

			// Pause() and Continue() do nothing by default.
			// You can override them to handle a control request.
			// Pause() should report the status SERVICE_PAUSED
			// and Continue() should report the status SERVICE_RUNNING
			// (see ReportStatus() below).
			// Note that normally these functions will never be called. If
			// you want a service, that accepts PAUSE and CONTINUE control
			// requests, you have to to add SERVICE_ACCEPT_PAUSE_CONTINUE
			// to the m_dwControlsAccepted data member.
		virtual void	Pause();
		virtual void	Continue();

			// Shutdown() will be called, if the service manager
			// requests for the SERVICE_CONTROL_SHUTDOWN control.
			// This control type occurs, when the system shuts down.
			// If you want to process this notification, you have to
			// add SERVICE_ACCEPT_SHUTDOWN to the m_dwControlsAccepted
			// data member (and to override this function). The default
			// implementation of Shutdown() does nothing.
		virtual void	Shutdown();

			// Call "RegisterService()" after you have constructed
			// a CNTService object:
			// A typical "main()" function of a service looks like this:
			//
			//		int main( int argc, char ** argv ) {
			//			CMyService serv;
			//			exit(serv.RegisterService(argc, argv));
			//		}
			//
			// Where "CMyService" is a CNTService derived class.
			// RegisterService() checks the parameterlist. The
			// following parameters will be detected:
			//		-i			install the service (calls
			//					"InstallService()" - see below)
			//
			//			-l <account>
			//					<account> is the name of a user,
			//					under which the service shall run.
			//					This option is useful with -i only.
			//					<account> needs to have the advanced
			//					user-right "Log on as a service"
			//					(see User-Manager)
			//					<account> should have the following
			//					format: "<Domain>\<user>"
			//					"EuroS2Team\jko" for instance.
			//					The domain "." is predefined as the
			//					local machine. So one might use
			//					".\jko" too.
			//
			//			-p <password>
			//					The password of the user, under which
			//					the service shall run. Only useful
			//					with -i and -l together.
			//
			//		-u			uninstall the service (calls
			//					"RemoveService()" - see below)
			//
			//		-d			debug the service (run as console
			//					process; calls "DebugService()"
			//					see below)
			//
			//		-e			end the service (if it is running)
			//
			//		-s			start the service (if it is not running)
			//					(Note that *you* normally cannot start
			//					an NT-service from the command-line.
			//					The SCM can.)
			//
			// Do not use -l and -p, if your service is of type
			// SERVICE_KERNEL_DRIVER or SERVICE_FILE_SYSTEM_DRIVER.
			// Furthermore you canot use -i and -s together. Instead
			// you have to start the command twice, first you install
			// the service, then you start it.
			// If none of the flags -i, -u, -e, -s and -d is set, then the
			// program starts as an NT service (only the SCM can start it
			// this way!).
			// NOTE: If UNICODE is #define'd, then <argc> and <argv>
			//		will be ignored and the original commandline
			//		of the program will be used to parse the
			//		arguments !
		virtual BOOL	RegisterService(int argc, char ** argv);
		
			// "StartDispatcher()" registers one service-procedure
			// to the service control dispatcher (using the predefined
			// "ServiceMain()" function below).
			// Override this funtion, if you want to develop a
			// multithreaded NT-Service.
		virtual BOOL	StartDispatcher();

			// Override "InstallService()" to manipulate the
			// installation behavior.
			// This function will only be called, if the
			// "-i" flag was passed to "RegisterService()"
			// (see above)
			// After "InstallService()" has completed, you
			// should be able to see the service in the
			// "services" control-panel-applet.
		virtual BOOL	InstallService();
		
			// RemoveService() removes a service from the system's
			// service-table.
			// It first tries to stop the service.
			// This function will be called only if the -u
			// flag was passed to the program. (see "RegisterService()"
			// above)
			// After removal of the service, it should no longer
			// appear in the "services" control-panel-applet.
		virtual BOOL	RemoveService();
		

			// EndService() stops a running service (if the service
			// is running as a service! Does not end a service
			// running as a console program (see DebugService()
			// below))
		virtual BOOL	EndService();

			// Start the service. Does the same as if the
			// SCM launches the program. Note that this method
			// will create a new instance of the program.
		virtual BOOL	StartupService();
		
			// Run a service as a console application. This makes it
			// easier to debug the service.
			// This function will be called only if the -d flag
			// was passed to the program(see "RegisterService()" above).
			// It transparently calls "Run()". You can simulate a
			// stop-request by pressing either Ctrl-C or Ctrl-Break (that
			// will call the "Stop()" method).
		virtual BOOL	DebugService(int argc, char **argv,BOOL faceless=FALSE);	//!! TCW MOD - added FACELESS parm to allow Win95 usage.

	protected:	// implementation
			// Override "RegisterApplicationLog()", if you want to register
			// a different message file and/or differend supported types
			// than the default.
			// The proposed message file is the application itself.
			// The proposed types are:
			// EVENTLOG_ERROR_TYPE | EVENTLOG_WARNING_TYPE | EVENTLOG_INFORMATION_TYPE
			// This method will be called from inside "InstallService()" (see above)
			// Thus if you support errors only (for instance):
			//		void CMyService :: RegisterApplicationLog(LPCTSTR filename, DWORD ) {
			//			CNTService::RegisterApplicationLog(filename, EVENTLOG_ERROR_TYPE);
			//		}
			// This method will never be called on Win95.
		virtual void	RegisterApplicationLog(
							LPCTSTR lpszProposedMessageFile,
							DWORD dwProposedTypes
						);

			// "DeregisterApplicationLog()" is called from inside "RemoveService()"
			// (see above) to clear the registry-entries made by
			// "RegisterApplicationLog()"
		virtual void	DeregisterApplicationLog();

	public:	// helpers
			// Retrieve a human-readable error message. The message
			// will be stored in <Buf> which is of size <Size>.
			// Returns a pointer to <Buf>.
		LPTSTR			GetLastErrorText(LPTSTR Buf, DWORD Size);

			// report status to the service-control-manager.
			// <CurState> can be one of:
			//		SERVICE_START_PENDING		-	the service is starting
			//		SERVICE_RUNNING				-	the service is running
			//		SERVICE_STOP_PENDING		-	the service is stopping
			//		SERVICE_STOPPED				-	the service is not running
			//		SERVICE_PAUSE_PENDING		-	the service pause is pending
			//		SERVICE_PAUSE				-	the service is paused
			//		SERVICE_CONTINUE_PENDING	-	the service is about to continue
		BOOL			ReportStatus(
							DWORD CurState,				// service's state
							DWORD WaitHint = 3000,		// expected time of operation in milliseconds
							DWORD ErrExit = 0			//!! TCW MOD - set to nonzero to flag *FATAL* error
						);

			// AddToMessageLog() writes a message to the application event-log.
			// (use EventViewer from the menu "Administrative Tools" to watch the log).
			// The <EventType> parameter can be set to one of the following values:
			//		EVENTLOG_ERROR_TYPE			Error event
			//		EVENTLOG_WARNING_TYPE		Warning event
			//		EVENTLOG_INFORMATION_TYPE	Information event
			//		EVENTLOG_AUDIT_SUCCESS		Success Audit event
			//		EVENTLOG_AUDIT_FAILURE		Failure Audit event
			// See "ReportEvent()" in the help-topics for further information.
		virtual void	AddToMessageLog(
							LPTSTR	Message,
							WORD	EventType = EVENTLOG_ERROR_TYPE,
							DWORD	dwEventID = DWORD(-1)
						);

	public:		// default handlers
			// The following functions will be used by default.
			// You can provide other handlers. If so, you have to
			// overload several of the "virtual"s above.
		static void WINAPI	ServiceCtrl(DWORD CtrlCode);
		static void WINAPI	ServiceMain(DWORD argc, LPTSTR * argv);
		static BOOL WINAPI	ControlHandler(DWORD CtrlType);

	//!! TCW MOD - added console support for Faceless Apps. Needed sometimes when something goes wrong.
	public:
		BOOL OsIsWin95() const { return ! m_bWinNT; }
		void SetupConsole();

};


// Retrieve the one and only CNTService object:
CNTService * AfxGetService();


#endif	// NTService_h

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩av中文字幕一区二区| 首页欧美精品中文字幕| 精品福利在线导航| 91精品国产全国免费观看| 欧美性受xxxx黑人xyx| www.亚洲在线| 91社区在线播放| 色综合久久中文综合久久97| 日韩福利视频导航| 日本女人一区二区三区| 日本伊人精品一区二区三区观看方式| 亚洲bt欧美bt精品777| 午夜视频一区二区三区| 天天综合色天天综合色h| 亚洲国产综合视频在线观看| 午夜成人免费视频| 男男gaygay亚洲| 国产一区二区三区四| 国产成人亚洲精品狼色在线| www.亚洲在线| 4hu四虎永久在线影院成人| 欧美一区二区日韩| 国产亚洲综合av| 中文字幕一区三区| 亚洲成人手机在线| 国产精品白丝jk黑袜喷水| 成人激情免费网站| 欧美日韩你懂得| wwww国产精品欧美| 亚洲欧美日本韩国| 久久er99精品| 91免费国产在线观看| 91精品国产全国免费观看| 国产欧美精品日韩区二区麻豆天美| 国产精品久久久久久久久免费桃花| 亚洲自拍偷拍av| 国产在线视频精品一区| 欧美色综合影院| 久久综合久久综合久久| 亚洲综合激情另类小说区| 久久91精品国产91久久小草| 94色蜜桃网一区二区三区| 日韩欧美一级片| 一区二区在线免费| 国产成人在线视频免费播放| 欧美日韩久久一区| 国产精品天美传媒沈樵| 日本aⅴ亚洲精品中文乱码| 91网站视频在线观看| 久久综合九色综合97婷婷女人| 亚洲人成在线观看一区二区| 卡一卡二国产精品| 在线欧美小视频| 国产精品网站在线播放| 久久国产生活片100| 欧美日韩国产天堂| 中文字幕综合网| 国产成人综合视频| 欧美大片免费久久精品三p| 亚洲一区二区美女| 91偷拍与自偷拍精品| 国产精品嫩草影院av蜜臀| 国产资源精品在线观看| 欧美www视频| 日本在线不卡视频| 欧美日韩dvd在线观看| 亚洲精品水蜜桃| 99re视频精品| 亚洲日本中文字幕区| 99精品国产热久久91蜜凸| 国产精品嫩草影院av蜜臀| 成人免费高清视频在线观看| 26uuu欧美| 国产一区二区在线观看免费| 精品不卡在线视频| 国产一区二区三区久久悠悠色av| 精品国内二区三区| 伦理电影国产精品| 精品1区2区在线观看| 狠狠网亚洲精品| 国产日韩欧美亚洲| av不卡一区二区三区| 亚洲人成小说网站色在线| 色悠悠久久综合| 亚洲va中文字幕| 7878成人国产在线观看| 蜜臀久久久久久久| 欧美成人官网二区| 成人一区二区三区视频在线观看| 欧美国产激情二区三区 | 99精品视频在线播放观看| 中文字幕一区二区三区精华液| 91视频观看视频| 日韩精品一区第一页| 精品久久久久久最新网址| 国产盗摄女厕一区二区三区| 国产精品乱子久久久久| 91传媒视频在线播放| 午夜av一区二区| 久久嫩草精品久久久精品一| 波多野结衣中文一区| 亚洲第一福利视频在线| 欧美一区二区播放| 成人一区在线观看| 夜夜嗨av一区二区三区四季av| 欧美日韩国产首页| 国产成人综合视频| 亚洲第一福利一区| 日本一区二区综合亚洲| 欧美午夜影院一区| 国产一本一道久久香蕉| 亚洲综合色丁香婷婷六月图片| 91精品国产综合久久久蜜臀粉嫩| 国产91高潮流白浆在线麻豆 | 精品影视av免费| 中文字幕精品综合| 欧美精品色综合| 国产毛片一区二区| 亚洲成人免费观看| 国产精品午夜免费| 欧美精品一区二区三区在线播放 | 国产精品 日产精品 欧美精品| 亚洲色大成网站www久久九九| 制服丝袜一区二区三区| 91在线观看地址| 国产麻豆精品theporn| 午夜视频一区在线观看| 亚洲激情一二三区| 国产精品入口麻豆原神| 日韩精品在线一区| 欧美亚洲一区二区在线| 成人美女视频在线观看18| 蜜桃在线一区二区三区| 亚洲综合色在线| 日韩伦理av电影| 国产亚洲精品精华液| 日韩亚洲欧美成人一区| 欧美日韩视频一区二区| 在线免费av一区| 91尤物视频在线观看| 国产精品一区在线| 经典一区二区三区| 蜜桃久久久久久久| 亚洲香蕉伊在人在线观| 一区二区三区日韩| 中文字幕免费观看一区| 久久综合狠狠综合| 精品三级在线观看| 日韩女优av电影| 亚洲精品在线观看网站| 日韩亚洲欧美在线| 欧美电影免费观看高清完整版在线| 欧美精选在线播放| 欧美网站大全在线观看| 欧美三电影在线| 欧美久久久久久蜜桃| 91精品国产欧美一区二区18| 欧美一区二区三区在线观看视频 | 国产欧美日韩综合精品一区二区| 精品久久一区二区三区| 久久青草欧美一区二区三区| 久久夜色精品一区| 国产精品欧美经典| 亚洲激情一二三区| 亚洲第一搞黄网站| 美女一区二区三区在线观看| 国产一区二区三区免费看| 成人少妇影院yyyy| 色婷婷av久久久久久久| 欧美精品一卡两卡| 久久久精品日韩欧美| 一区在线中文字幕| 亚洲午夜一区二区| 美女一区二区在线观看| 国产大片一区二区| 欧美视频自拍偷拍| xf在线a精品一区二区视频网站| 日本一区二区高清| 亚洲一二三专区| 久久电影网电视剧免费观看| 懂色一区二区三区免费观看| 色综合婷婷久久| 538在线一区二区精品国产| 欧美精品一区二区三| 亚洲欧美日韩人成在线播放| 三级一区在线视频先锋| 激情综合色综合久久| 91在线免费视频观看| 91精品国产一区二区人妖| 国产免费观看久久| 日韩不卡在线观看日韩不卡视频| 国产毛片精品视频| 欧美日韩亚洲综合| 国产偷国产偷亚洲高清人白洁| 一二三区精品视频| 国产精品一区二区在线播放| 欧美色视频在线观看| 亚洲国产精品二十页| 奇米色777欧美一区二区| 97精品国产露脸对白|