//
//
//
//
//
//
//
//
//
//
软件Tags:
NT系统服务
系统结构:启动服务器,主处理程序,消息处理函数,启动线程,删除服务,安装服务,置服务状态,注册服务状态,创建线程,CloseServiceHandle,OpenService,OpenSCManager,CreateService,DeleteService,开始启动,
======Main
| |
| |------ _启动子程序
| |
| |------ 启动服务器
| |
| |------ 主处理程序
| |
| |------ 消息处理函数
| |
| |------ 启动线程
| |
| |------ 删除服务
| |
| |------ 安装服务
| |
| |
======调用的Dll
| |
| |---[dll]------ 置服务状态
| |
| |---[dll]------ 注册服务状态
| |
| |---[dll]------ 创建线程
| |
| |---[dll]------ CloseServiceHandle
| |
| |---[dll]------ OpenService
| |
| |---[dll]------ OpenSCManager
| |
| |---[dll]------ CreateService
| |
| |---[dll]------ DeleteService
| |
| |---[dll]------ 开始启动
调用的DLL命令:
.DLL命令 置服务状态, 整数型, "advapi32.dll", "SetServiceStatus"
.参数 状态, 整数型
.参数 服务状态, 服务状态
.DLL命令 注册服务状态, 整数型, "advapi32.dll", "RegisterServiceCtrlHandlerA"
.参数 服务名, 文本型
.参数 消息处理, 子程序指针
.DLL命令 创建线程, 整数型, , "CreateThread"
.参数 安全值, 整数型, , 0
.参数 堆栈大小, 整数型, , 0
.参数 线程子程序, 子程序指针
.参数 传递参数, 整数型
.参数 等待时间, 整数型, , 0
.参数 线程编号, 整数型, 传址
.DLL命令 CloseServiceHandle, 整数型, "advapi32.dll", "CloseServiceHandle"
.参数 hSCObject, 整数型
.DLL命令 OpenService, 整数型, "advapi32.dll", "OpenServiceA"
.参数 hSCManager, 整数型
.参数 lpServiceName, 文本型
.参数 dwDesiredAccess, 整数型
.DLL命令 OpenSCManager, 整数型, "advapi32.dll", "OpenSCManagerA"
.参数 lpMachineName, 文本型
.参数 lpDatabaseName, 文本型
.参数 dwDesiredAccess, 整数型
.DLL命令 CreateService, 整数型, "advapi32.dll", "CreateServiceA"
.参数 hSCManager, 整数型
.参数 lpServiceName, 文本型
.参数 lpDisplayName, 文本型
.参数 dwDesiredAccess, 整数型
.参数 dwServiceType, 整数型
.参数 dwStartType, 整数型
.参数 dwErrorControl, 整数型
.参数 lpBinaryPathName, 文本型
.参数 lpLoadOrderGroup, 文本型
.参数 lpdwTagId, 整数型
.参数 lpDependencies, 文本型
.参数 lpServiceStartName, 整数型
.参数 lpPassword, 文本型
.DLL命令 DeleteService, 整数型, "advapi32.dll", "DeleteService"
.参数 hService, 整数型
.DLL命令 开始启动, 整数型, "advapi32.dll", "StartServiceCtrlDispatcherA"
.参数 启动表, 服务表
