【原创】驱动加载之CreateService
SC_HANDLE WINAPI CreateService(_In_ SC_HANDLE hSCManager,_In_ LPCTSTR lpServiceName,_In_opt_ LPCTSTR lpDisplayName,_In_ DWORD dwDesiredAccess,_In_ DWORD dwServiceType,_In_ DWORD dwStartType,_In_ DWORD dwErrorControl,_In_opt_ LPCTSTR lpBinaryPathName,_In_opt_ LPCTSTR lpLoadOrderGroup,_Out_opt_ LPDWORD lpdwTagId,_In_opt_ LPCTSTR lpDependencies,_In_opt_ LPCTSTR lpServiceStartName,_In_opt_ LPCTSTR lpPassword);
| Value | Meaning |
|---|---|
|
Reserved. |
|
File system driver service. |
|
Driver service. |
|
Reserved. |
|
Service that runs in its own process. |
|
Service that shares a process with one or more other services. For more information, see Service Programs. |
| Value | Meaning |
|---|---|
|
The service can interact with the desktop. For more information, see Interactive Services. |
| Value | Meaning |
|---|---|
|
A service started automatically by the service control manager during system startup. For more information, see Automatically Starting Services. (在系统启动的时候,由SCM自动运行服务) |
|
A device driver started by the system loader. This value is valid only for driver services. (系统引导程序自动运行服务,只对driver services有效) |
|
A service started by the service control manager when a process calls the StartService function. For more information, see Starting Services on Demand. (当一个程序调用StartService函数时,SCM启动服务) |
|
A service that cannot be started. Attempts to start the service result in the error code ERROR_SERVICE_DISABLED. (一个不能启动的服务,尝试启动它时,会产生ERROR_SERVICE_DISABLED) |
|
A device driver started by the IoInitSystem function. This value is valid only for driver services. (一个由 IoInitSystem函数启动的服务) |
| Value | Meaning |
|---|---|
|
The startup program logs the error in the event log, if possible. If the last-known-good configuration is being started, the startup operation fails. Otherwise, the system is restarted with the last-known good configuration. |
|
The startup program ignores the error and continues the startup operation. |
|
The startup program logs the error in the event log but continues the startup operation. |
|
The startup program logs the error in the event log. If the last-known-good configuration is being started, the startup operation continues. Otherwise, the system is restarted with the last-known-good configuration. |
|
返回值
|
描述
|
|
ERROR_ACCESS_DENIED
|
提供的hSCManager参数没有SC_MANAGER_CREATE_SERVICE权限。
|
|
ERROR_CIRCULAR_DEPENDENCY
|
存在循环嵌套的服务依赖关系。
|
|
ERROR_DUPLICATE_SERVICE_NAME
|
显示名称已在SCM中被其他服务注册为服务名称或显示名称。
|
|
ERROR_INVALID_HANDLE
|
提供的hSCManager参数无效。
|
|
ERROR_INVALID_NAME
|
提供的服务名称无效。
|
|
ERROR_INVALID_PARAMETER
|
其他参数无效。
|
|
ERROR_INVALID_SERVICE_ACCOUNT
|
由lpServiceStartName参数指定的用户名不存在。
|
|
ERROR_SERVICE_EXISTS
|
已存在完全相同的服务。
|
|
值
|
描述
|
|
DependOnGroup
|
由lpDependencies参数指定的依赖性服务群组,包含加载顺序。
|
|
DependOnService
|
由lpDependencies参数指定的依赖性服务。
|
|
Description
|
由ChangeServiceConfig2函数写入的描述信息。
|
|
DisplayName
|
由lpDisplayName参数指定的服务显示名称。
|
|
ErrorControl
|
由dwErrorControl参数指定的纠错方案。
|
|
FailureActions
|
由ChangeServiceConfig2函数写入的异常信息。
|
|
Group
|
由lpLoadOrderGroup参数指定的服务群组,包含加载顺序。
|
|
ImagePath
|
由lpBinaryPathName参数指定的服务程序文件位置。
|
|
ObjectName
|
由lpServiceStartName参数指定的名称。
|
|
Start
|
由dwStartType参数指定的服务启动时间。
|
|
Tag
|
由lpdwTagId参数指定的识别信息。
|
|
Type
|
由dwServiceType参数指定的服务类型。
|
本文链接:http://www.cnblogs.com/cposture/p/4717479.html
【原创】驱动加载之CreateService的更多相关文章
- 老调重弹:JDBC系列之<驱动加载原理全面解析) ----转
最近在研究Mybatis框架,由于该框架基于JDBC,想要很好地理解和学习Mybatis,必须要对JDBC有较深入的了解.所以便把JDBC 这个东东翻出来,好好总结一番,作为自己的笔记,也是给读者 ...
- (DT系列四)驱动加载中, 如何取得device tree中的属性
本文以At91rm9200平台为例,从源码实现的角度来分析驱动加载时,Device tree的属性是如何取得的.一:系统级初始化DT_MACHINE_START 主要是定义"struct m ...
- 【转】(DT系列四)驱动加载中, 如何取得device tree中的属性
原文网址:http://www.cnblogs.com/biglucky/p/4057488.html 本文以At91rm9200平台为例,从源码实现的角度来分析驱动加载时,Device tree的属 ...
- linux设备和驱动加载的先后顺序
点击打开链接 Linux驱动先注册总线,总线上可以先挂device,也可以先挂driver,那么究竟怎么控制先后的顺序呢. Linux系统使用两种方式去加载系统中的模块:动态和静态. 静态加载:将所有 ...
- 如何调整Linux内核启动中的驱动初始化顺序-驱动加载优先级
Linux内核为不同驱动的加载顺序对应不同的优先级,定义了一些宏: include\linux\init.h #define pure_initcall(fn) __define_initcall(& ...
- 关于Eclipse在servlet中连接数据库时出现驱动加载失败的解决
问题:在队友发来的项目中想将他获取到的数据通过数据库储存,出现驱动加载失败问题 解决:首先百度了下相关情况,大多数都是说下载mysql-connector-java-5.1.39-bin.jar包,然 ...
- 【ESXI6.0】 ESXI6.0安装时无法安装网卡驱动的解决方法及将网卡驱动加载进ISO
http://blog.163.com/xifanliang@yeah/blog/static/115078488201571584321787/ 若安装时提示如下图所示 之后安装无法完成,会提示没有 ...
- Windows 驱动加载程序代码
#include <windows.h> #include <winsvc.h> #include <conio.h> #include <stdio.h&g ...
- jdbc数据库连接过程及驱动加载与设计模式详解
首先要导入JDBC的jar包:接下来,代码:Class.forName(xxx.xx.xx)返回的是一个类 Class.forName(xxx.xx.xx)的作用是要求JVM查找并加载指定的类, 也就 ...
随机推荐
- JupyterLab绘制:柱状图,饼状图,直方图,散点图,折线图
JupyterLab绘图 喜欢python的同学,可以到 https://v3u.cn/(刘悦的技术博客) 里面去看看,爬虫,数据库,flask,Django,机器学习,前端知识点,JavaScrip ...
- 2019.03.28 bzoj3598: [Scoi2014]方伯伯的商场之旅(带权中位数+数位dp)
传送门 题意咕咕咕自己读吧挺简单的 思路: 由带权中位数的性质可以得到对于每个数放在每个二进制位的代价一定是个单调或者单峰函数,因此我们先把所有的数都挪到第一个位置,然后依次向右枚举峰点(极值点)把能 ...
- 排序算法(sorting algorithm)之 插入排序(insertion sort)
https://en.wikipedia.org/wiki/Insertion_sort loop1: 4,6,1,3,7 -> 4,6,1,3,7 loop2: 4,6,1,3,7 -> ...
- Note | 常用指令和教程
目录 Ubuntu操作系统 基础操作 SSH-ubuntu 登录退出 设置SSH秘钥以免密登录 设置别名以免IP登录 传输文件 设置短密码 驱动问题(循环自登陆,分辨率异常) boot空间不足 Win ...
- Servlet发送邮件遇到的问题SMTPSendFailedException 554
接到通知,一个接收用户请求的邮箱有段时间收不到邮件了.当时想着这么简单的功能,就没有加上日志记录.重写程序后,日志记下的报错是:SMTP的SMTPSendFailedException 554 co ...
- Asp.Net WebApi核心对象解析(二)
在接着写Asp.Net WebApi核心对象解析(下篇)之前,还是一如既往的扯扯淡,元旦刚过,整个人还是处于晕的状态,一大早就来处理系统BUG,简直是坑爹(好在没让我元旦赶过来该BUG),队友挖的坑, ...
- ZKWeb网页框架2.2正式发布
2.2.0更新的内容有 重构依赖注入容器 使用无锁算法 (可能导致不兼容) 使用 ContainerFactoryData 创建实例 (可能导致不兼容) 删除静态的 ContainerFactoryC ...
- Spring Boot 2 - 初识与新工程的创建
Spring Boot的由来 相信大家都听说过Spring框架. Spring从诞生到现在一直是流行的J2EE开发框架. 随着Spring的发展,它的功能越来越强大,随之而来的缺点也越来越明显,以至于 ...
- Numpy学习三:数组运算
1.转置 #reshape(shape)函数改变数组形状,shape是一个元组,表示数组的形状 创建一个包含15个元素的一维数组,通过reshape函数调整数组形状为3行5列的二维数组arr = np ...
- Docker学习笔记-简单运行.netcore
前言: 环境:centos7.5 64 位 正文: 拉取 microsoft/dotnet, 安装完毕后执行 docker images 可以看到本地已经包含 microsoft/dotnet #包含 ...