当前位置:网站首页>WinVerifyTrust调用返回80096005错误,时间戳签名或证书无法验证或已损坏
WinVerifyTrust调用返回80096005错误,时间戳签名或证书无法验证或已损坏
2022-07-24 00:53:00 【宇龍_】
前言:
本人在Windows 7或者Windows Server 2008等系统上调用WinVerifyTrust函数,会得到与Windows10上不同的结果,这有点离谱,不过好在找到了解决办法。
正文:
相关代码如下,以下的代码来自微软官方文档,后根据说明做了些调整,呵呵:
// ConsoleApplication5.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//
#include <iostream>
#include <Windows.h>
#include <WinTrust.h>
#include <atlstr.h>
#include <wincrypt.h>
#include <mscat.h>
#include <SoftPub.h>
#pragma comment(lib,"crypt32.lib")
#pragma comment(lib,"Wintrust.lib")
BOOL Test(LPWSTR lpFileName)
{
GUID action = WINTRUST_ACTION_GENERIC_VERIFY_V2;
WINTRUST_DATA wd = { 0 };
WINTRUST_FILE_INFO wfi = { 0 };
WINTRUST_CATALOG_INFO wci = { 0 };
CATALOG_INFO ci = { 0 };
wfi.cbStruct = sizeof(WINTRUST_FILE_INFO);
wfi.pcwszFilePath = lpFileName;
wfi.hFile = NULL;
wfi.pgKnownSubject =边栏推荐
- Classic example of C language - print the input two digits in reverse order
- Programmeur de cheval noir - test d'interface - test d'interface d'apprentissage de quatre jours - jour 4 - Postman lit des fichiers de données externes, lit des données de fichiers de données, IHRM P
- Okaleido tiger NFT is about to log in to the binance NFT platform. Are you looking forward to it?
- Flutter | specifies the type of page return value
- VIM common commands
- The postman test interface has 404 or 500 errors when the URL is configured correctly
- Generic mechanism and enhanced for loop
- Robot dog back submachine gun shooting video fire, netizens shivering: stoooooooopppp!
- How to realize 485 wireless communication between multiple sensors and Siemens PLC?
- Tutorial on the principle and application of database system (044) -- MySQL query (VI): using the limit option to realize paging query
猜你喜欢

Installation and use of appscan

Centernet target detection model and centerfusion fusion target detection model

Classic example of C language - loan balance

Project scenario: NVIDIA SMI unable to datemine the device handle for GPU 0000:01:00.0: unknown error

Testers who have been employed for 3 months are facing employment confirmation. Leaders: 1 year of work experience is packaged into 5 years, and the probation period is eliminated

T-seda code

Starfish OS: create a new paradigm of the meta universe with reality as the link

win10下基于anaconda的detectron2安装

This is a big problem

Classic example of C language - find the minimum number of banknotes
随机推荐
Development of main applet for business card traffic near the map
CA digital certificate
Flutter | specifies the type of page return value
Implementation of singleton mode and prevention of reflection and serialization
C language: deep analysis of const keyword
[low code] limitations of low code development
How to use SAP intelligent robotic process automation to automate Excel
Implementation of singleton mode in C #
C language writing specification
Difference between data index and label system of data warehouse
Summary of the fourth week of summer vacation
IDEA 热部署(热加载)
Comparison of image preprocessing between pytorch opencv pil
Selection method of geometric objects in Creo 9.0
Tutorial on principles and applications of database system (043) -- MySQL query (V): Sorting Query Results
Bean Validation自定义容器验证篇----06
How to use mitmproxy to get data return in automated testing?
SAP 实施项目中涉及到编程方式操作 Excel 的几种场景介绍
The way to access global variables in multi-source file mode (extern usage)
AWS Part 4 one machine and one secret