请问怎么取消"数字签名"对话框.

rockally 2005-07-08 11:59:36
我想实现驱动程序的自动安装,所以将响应的文件拷贝到目录中,可是我不知道把.CAT数字签名文件放置到系统盘的什么位置,所以老弹出没有数字签名对话框,请问.CAT文件放置什么位置呢,或者怎么在程序中取消数字签名验证,强制安装驱动呢?谢谢!
...全文
666 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
afc 2005-09-03
  • 打赏
  • 举报
回复
已经有CAT文件了就不用改数字签名设置了,用SetupCopyOEMInf
Platform SDK: Setup API
SetupCopyOEMInf

The SetupCopyOEMInf function copies a specified INF file to the %windir%/Inf directory.

A caller of this function is required have administrative privileges, otherwise the function fails.

BOOL WINAPI SetupCopyOEMInf(
PCTSTR SourceInfFileName,
PCTSTR OEMSourceMediaLocation,
DWORD OEMSourceMediaType,
DWORD CopyStyle,
PTSTR DestinationInfFileName,
DWORD DestinationInfFileNameSize,
PDWORD RequiredSize,
PTSTR DestinationInfFileNameComponent
);

Parameters

SourceInfFileName
[in] Full path to the source INF file. You should use a null-terminated string. This path should not exceed MAX_PATH in size, including the terminating NULL.
OEMSourceMediaLocation
[in] Source location information to be stored in the precompiled INF (.pnf). This location information is specific to the source media type specified. You should use a null-terminated string. This path should not exceed MAX_PATH in size, including the terminating NULL.
OEMSourceMediaType
[in] Source media type referenced by the location information. This parameter may be one of the following values.
Value Meaning
SPOST_NONE No source media information is stored in the PNF file. The value of OEMSourceMediaLocation is ignored in this case.
SPOST_PATH OEMSourceMediaLocation contains a path to the source media. For example, if the media is on a floppy, this path might be "A:\". If OEMSourceMediaLocation is NULL, the path is assumed to be the path where the INF is located. If the INF has a corresponding PNF in that location, the PNF file's source media information will be transferred to the destination PNF file.
SPOST_URL OEMSourceMediaLocation contains a universal resource locator (URL) specifying the Internet location from where the INF/driver files were retrieved. If OEMSourceMediaLocation is NULL, it is assumed that the default Code Download Manager location was used.
CopyStyle
[in] Specifies how the INF file is copied into the INF directory. The following flags can be combined.
Value Meaning
SP_COPY_DELETESOURCE Delete source file on successful copy.
SP_COPY_REPLACEONLY Copy only if this file already exists in the INF directory. This flag could be used to update the source location information for an existing INF.
SP_COPY_NOOVERWRITE Copy only if the specified files don't currently exist in the INF directory. If the INF does currently exist, this API will fail and GetLastError returns ERROR_FILE_EXISTS. In this case, the existing INF file's filename will be placed into the appropriate field in the destination INF file's information output buffers.
SP_COPY_OEMINF_CATALOG_ONLY The specified INF file's corresponding catalog files is copied to %windir%\Inf. If this flag is specified, the destination filename information is entered upon successful return if the specified INF file already exists in the Inf directory.
DestinationInfFileName
[out, optional] Pointer to a buffer to receive the INF file name assigned to it at the time it was copied to the INF directory. The buffer, if specified, should typically be MAX_PATH in length. If the SP_COPY_NOOVERWRITE flag is specified and the SetupCopyOEMInf function fails with a return code of ERROR_FILE_EXISTS, this buffer will contain the name of the existing INF file. If the SP_COPY_OEMINF_CATALOG_ONLY flag is specified, this buffer will contain the destination INF filename if the INF file is already present in the INF directory. Otherwise, this buffer will be set to the empty string. This parameter can be NULL.
DestinationInfFileNameSize
[in] Size of the DestinationInfFileName buffer, in characters, or zero if the buffer is not specified. If DestinationInfFileName is specified and this buffer size is less than the size required to return the destination INF filename (including full path), this function will fail. In this case GetLastError will return ERROR_INSUFFICIENT_BUFFER.
RequiredSize
[out, optional] Pointer to a variable that receives the size (in characters) required to store the destination INF file name including a terminating NULL. If the SP_COPY_OEMINF_CATALOG_ONLY flag is specified, this variable will receive a string length only if the INF file already exists in the INF directory. Otherwise, this variable will be set to zero. This parameter can be NULL.
DestinationInfFileNameComponent
[out, optional] Pointer to a string that is set upon successful return (or ERROR_FILE_EXISTS) to point to the beginning of the filename component of the path stored in the DestinationInfFileName parameter. If the SP_COPY_OEMINF_CATALOG_ONLY flag is specified, the DestinationInfFileName parameter may be an empty string. In this case, the character pointer will be set to NULL upon successful return. This parameter can be NULL.

Return Values

TRUE
The SetupCopyOEMInf function succeeded.
FALSE
The SetupCopyOEMInf function failed. For extended error information, call GetLastError.

Remarks

The SetupCopyOEMInf function copies a specified INF file into the %windir%\Inf directory. SetupCopyOEMInf does not recopy the file if it finds that a binary image of the specified INF file already exists in the INF directory with the same name or a name of the form OEM*.INF. When SetupCopyOEMInf copies a file, it renames the copied file to OEM*.INF. Name provided is unique and cannot be predicted.

SetupCopyOEMInf uses the following procedure to determine if the INF file already exists in the INF directory:

All INF files with names of the form OEM*.INF are enumerated and any files that have the same file size as the specified INF file are binary compared.

The INF directory is searched for the source filename of the INF file. If an INF file of the same name exists and is the same size as that of the specified INF file, the two files are binary compared to determine if they are identical.

If the specified INF file already exists a further check is performed to determine if the specified INF file contains a CatalogFile= entry in its [Version] section. If it does, the INF files's %windir%\Inf primary filename with a ".CAT" extension is used to determine if the catalog is already installed. If there is a catalog installed, but it isn't the same as the catalog associated with the source INF, this is not considered to be a match and enumerations continue. It is possible to have multiple identical INF files with unique catalogs contained in %windir%\Inf directory. If an existing match is not found, the INF and CAT files are installed under a new and unique name.

OEM INFs that don't specify a CatalogFile= entry are considered invalid with respect to digital signature verification.

In cases where the INF file must be copied to the %windir%\Inf directory, any digital signature verification failures are reported

If the INF and CAT files already exist, these existing filenames are used and the file replacement behavior is based on the specified CopyStyle flags. Replacement behavior refers only to the source media information stored in the PNF. Existing INF, PNF, and CAT files are not modified.
Requirements
Client Requires Windows XP or Windows 2000 Professional.
Server Requires Windows Server 2003 or Windows 2000 Server.
Header

Declared in Setupapi.h.
Library

Link to Setupapi.lib.
DLL Requires Setupapi.dll.
Unicode

Implemented as SetupCopyOEMInfW (Unicode) and SetupCopyOEMInfA (ANSI).
See Also

Overview, Functions

Last updated: June 2005 | What did you think of this topic? | Order a Platform SDK CD
© Microsoft Corporation. All rights reserved. Terms of use.
rockally 2005-08-28
  • 打赏
  • 举报
回复
注册表该怎么操作,即怎么将HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Driver Signing
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\no Driver Signing中的值改变为0,谢谢!
flyelf 2005-07-15
  • 打赏
  • 举报
回复
注册表的修改在xp下没有作用,因此xp下的数字签名想要取消,就用oyljerry(【勇敢的心】→ ㊣X-Monsieur㊣) 和bager(柏哥) 说的方法了
还有的方法就是启动监控线程来监控数字签名对话框
lonelyeagle 2005-07-14
  • 打赏
  • 举报
回复
数字签名可以将HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Driver Signing
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\no Driver Signing
中的值改变后取消。值可以取0 1 2
bager 2005-07-14
  • 打赏
  • 举报
回复
-〉我就是需要编程实现,请问怎么调用secedit.exe的导入导出功能?

1、首先导出一个[“未签名驱动程序的安装操作”设置为默认安装]的配置文件。
2、创建调用secedit的进程,传入相应参数,保存当前安全设置至某临时文件。
3、创建调用secedit的进程,传入相应参数,配合步骤1中创建的文件,导入修改后的安全设置。
4、创建调用secedit的进程,传入相应参数,配合步骤2中生成的临时文件,恢复安全设置。
5、删除临时文件。

在步骤2与步骤4之间可以加入你的驱动程序的自动安装处理

稍微复杂了点,但绝对能满足你的需求。




oyljerry 2005-07-09
  • 打赏
  • 举报
回复
使用 secedit.exe 命令行工具

1.
打开命令提示符(例如,单击“开始”,然后单击“运行”,键入 cmd.exe 并按 Enter 键)。

2.
要应用模板 W2KHG_baseline.inf,您可以使用下面的命令:

secedit /configure /DB W2KHG_baseline.sdb /CFG W2KHG_baseline.inf /overwrite
/LOG HGW2K_baseline.log



有关如何使用 secedit 命令行工具的更完整信息,请在命令行键入 secedit /?。

rockally 2005-07-09
  • 打赏
  • 举报
回复
我就是需要编程实现,请问怎么调用secedit.exe的导入导出功能?
bager 2005-07-09
  • 打赏
  • 举报
回复
安装之前,先修改系统的安全设置,
将“未签名驱动程序的安装操作”设置为默认安装。
安装完成后,再恢复系统的安全设置。

此过程可编程实现(调用secedit.exe的导入导出功能)
rockally 2005-07-09
  • 打赏
  • 举报
回复
请说明白点,自己建立?
JOSENHUANG 2005-07-08
  • 打赏
  • 举报
回复
只有你自己建立一个class,不要安装到系统已经有的class下面,好像就不会提示了
WORD2003签名签章插件 1.前言 这是我学习ATL的成果,学习过程及程序的编写,前前后后共用了一个多月的时间,花了不少的心血。其间遇到了不少困难,终于都一一解决了。这要感谢www.csdn.net上的热心朋友,从他们的BLOG文章中,我获得了不少灵感。现在这个软件基本完成了,全部实现了我自己定的设计需求,自己觉得这个软件还有一定的用处,就把它的测试版发布一下,希望使用者多提宝贵意见。 注:测试版没有任何的功能限制,只是“关于”对话框中显示测试版字样。 2.功能 可以完成手写签名及插入签章的功能。插入签名或签章后,可以监控WORD文档是否被修改。软件的使用界面很简单,只是在WORD里插入了一个工具栏,上面有三个按钮。其它的功能在插入的签名或签章上按右键根据弹出菜单选择执行。 印章支持多种格式图片,如BMP,JPG,GIF(静止的)等,使用时用印章管理工具把这些导入到印章库即可。 印章库管理密码:12345   几个内置的印章使用密码:111111 3.软件的使用:   使用windows系统带的控件注册工具regsvr32.exe,注册一下XXHSignature.dll即可;或者直接运行当前目录下的Register.exe,也可完成注册。这样打开word就可以看到签名工具栏。 软件包含以下几个文件: steal.mdb 印章库。 xxhsignature.ini 配制文件,如果没有会自动生成。 XXHSignature.dll WORD2003的COM加载项。程序的主体。 Register.exe 注册/卸载XXHSignature.dll用,可以不使用,直接使用regsvr32。 register.bat 注册的快捷方式,调用register.exe。纯属辅助,方便使用。 unregister.bat 卸载的快捷方式,带命令行参数调用register.exe。纯属辅助,方便使用。 StealManager.exe 印章管理工具。 说明文档.txt 说明文档。 软件使用VC6、ATL开发,没有使用MFC,所以每个软件都很小巧。 我在开发时使用的环境为XP、WORD2003,对软件在其它环境下没有进行过测试,不知道存不存在兼容问题。期待大家的反馈,可以给我发EMAIL,或者到我的博客留言。 如果程序运行有问题,可以使用Unregister.bat或regsvr32 /u将其卸载即可。也可以使用WORD的加载项管理菜单(该菜单默认时不显示,可以点击工具->自定义中找到使之显示),禁止插插件启动时运行。 另外:软件编译为UNICODE,对WIN98肯定是不支持。 欢迎转载,转载时请不要删除这些信息。谢谢。 2006-04-25 作者:wallimn email:wallimn@sohu.com QQ:54871876 博客:http://blog.csdn.net/wallimn 1.1版更新   新版的进行了以下几项改进:     a.签名及签字对文档内容、文档字体颜色以及文档字体大小敏感,也就是说:修改文档内容、文档中任意字的字体颜色或大小,都会导致文档签名失效。这是个很重要的功能,不知大家有没有意识到。试想一下,如果对合同签字,合同金额为100000,在WORD里将数字的后几个0改成白色,如果签名不对字体颜色敏感,那么签名仍然有效,而合同金额看起来就锐减了。所以说,对字体颜色及大小不敏感,是个很严重的漏洞。市场上的几款其它签名软件基本都有这个漏洞。     b.修改了WORD中签名工具栏有时不显示的BUG。     c.当文档签名失效时,重新打开文档的时候,会显示个红叉,直观的显示签名失效。 2008-02-23 1.2版更新   添加了读取网络图章功能,可以通过HTTP协议读取放在远程网络上的图章。不需要专门的图章服务器,可以使用任意的WEB服务提供程序,如IIS,tomcat等,将软件包中的web目录部署(白话:拷贝)到WEB的某个目录(tomcat中,考到某个上下文)就可以了。   然后在“网络图章”对话框中,输入对应的地址,如:http://127.0.0.1/web,点刷新就可以了。 2008-10-17

2,640

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 硬件/系统
社区管理员
  • 硬件/系统社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧