📄 mssip.h
字号:
//+-------------------------------------------------------------------------
//
// Microsoft Windows - Internet Security
//
// Copyright 1996 - 1998 Microsoft Corporation
//
// File: mssip.h
//
// Contents: Microsoft SIP Provider Main Include File
//
// History: 19-Feb-1997 pberkman Created
//
//--------------------------------------------------------------------------
#ifndef MSSIP_H
#define MSSIP_H
#ifdef __cplusplus
extern "C"
{
#endif
#pragma pack (8)
typedef CRYPT_HASH_BLOB CRYPT_DIGEST_DATA;
//
// dwflags
//
#define MSSIP_FLAGS_PROHIBIT_RESIZE_ON_CREATE 0x00010000
#define MSSIP_FLAGS_USE_CATALOG 0x00020000
#define SPC_INC_PE_RESOURCES_FLAG 0x80
#define SPC_INC_PE_DEBUG_INFO_FLAG 0x40
#define SPC_INC_PE_IMPORT_ADDR_TABLE_FLAG 0x20
//////////////////////////////////////////////////////////////////////////////
//
// SIP_SUBJECTINFO
//----------------------------------------------------------------------------
// pass this structure to all defined SIPs. Make sure to initialize
// the ENTIRE structure to binary zero before the FIRST call is made. Do
// not initialize it BETWEEN calls!
//
typedef struct SIP_SUBJECTINFO_
{
DWORD cbSize; // set to sizeof(SIP_SUBJECTINFO)
GUID *pgSubjectType; // subject type
HANDLE hFile; // set to File handle that represents the subject
// set to INVALID_HANDLE VALUE to allow
// SIP to use pwsFileName for persistent
// storage types (will handle open/close)
LPCWSTR pwsFileName; // set to file name
LPCWSTR pwsDisplayName; // optional: set to display name of
// subject.
DWORD dwReserved1; // do not use!
DWORD dwIntVersion; // DO NOT SET OR CLEAR THIS.
// This member is used by the sip for
// passing the internal version number
// between the ..get and verify... functions.
HCRYPTPROV hProv;
CRYPT_ALGORITHM_IDENTIFIER DigestAlgorithm;
DWORD dwFlags;
DWORD dwEncodingType;
DWORD dwReserved2; // do not use!
DWORD fdwCAPISettings; // setreg settings
DWORD fdwSecuritySettings; // IE security settings
DWORD dwIndex; // message index of last "Get"
DWORD dwUnionChoice;
# define MSSIP_ADDINFO_NONE 0
# define MSSIP_ADDINFO_FLAT 1
# define MSSIP_ADDINFO_CATMEMBER 2
# define MSSIP_ADDINFO_BLOB 3
# define MSSIP_ADDINFO_NONMSSIP 500 // everything < is reserved by MS.
union
{
struct MS_ADDINFO_FLAT_ *psFlat;
struct MS_ADDINFO_CATALOGMEMBER_ *psCatMember;
struct MS_ADDINFO_BLOB_ *psBlob;
};
LPVOID pClientData; // data pased in from client to SIP
} SIP_SUBJECTINFO, *LPSIP_SUBJECTINFO;
//////////////////////////////////////////////////////////////////////////////
//
// MS_ADDINFO_FLAT
//----------------------------------------------------------------------------
// Flat or End-To-End types
// needed for flat type files during indirect calls
// "Digest" of file.
//
typedef struct MS_ADDINFO_FLAT_
{
DWORD cbStruct;
struct SIP_INDIRECT_DATA_ *pIndirectData;
} MS_ADDINFO_FLAT, *PMS_ADDINFO_FLAT;
//////////////////////////////////////////////////////////////////////////////
//
// MS_ADDINFO_CATALOGMEMBER
//----------------------------------------------------------------------------
// Catalog Member verification.
//
typedef struct MS_ADDINFO_CATALOGMEMBER_
{
DWORD cbStruct; // = sizeof(MS_ADDINFO_CATALOGMEMBER)
struct CRYPTCATSTORE_ *pStore; // defined in mscat.h
struct CRYPTCATMEMBER_ *pMember; // defined in mscat.h
} MS_ADDINFO_CATALOGMEMBER, *PMS_ADDINFO_CATALOGMEMBER;
//////////////////////////////////////////////////////////////////////////////
//
// MS_ADDINFO_BLOB
//----------------------------------------------------------------------------
// Memory "blob" verification.
//
typedef struct MS_ADDINFO_BLOB_
{
DWORD cbStruct;
DWORD cbMemObject;
BYTE *pbMemObject;
DWORD cbMemSignedMsg;
BYTE *pbMemSignedMsg;
} MS_ADDINFO_BLOB, *PMS_ADDINFO_BLOB;
//////////////////////////////////////////////////////////////////////////////
//
// SIP_INDIRECT_DATA
//----------------------------------------------------------------------------
// Indirect data structure is used to store the hash of the subject
// along with data that is relevant to the subject. This can include
// names etc.
//
typedef struct SIP_INDIRECT_DATA_
{
CRYPT_ATTRIBUTE_TYPE_VALUE Data; // Encoded attribute
CRYPT_ALGORITHM_IDENTIFIER DigestAlgorithm; // Digest algorithm used to hash
CRYPT_HASH_BLOB Digest; // Hash of subject
} SIP_INDIRECT_DATA, *PSIP_INDIRECT_DATA;
#pragma pack()
//////////////////////////////////////////////////////////////////////////////
//
// Q & A: Functions
//----------------------------------------------------------------------------
// Q: why are there both typdef'd and extern'd prototyped functions in this
// include file?
//
// A: this include file is used by Trust Providers, SIP Providers, and
// Application developers. The Trust Providers and Application
// developers will utilize the typdef'd prototypes and SIP
// Providers will utilize the extern'd prototyped functions.
//
//////////////////////////////////////////////////////////////////////////////
//
// CryptSIPGetSignedDataMsg
//----------------------------------------------------------------------------
// Returns the message specified by the index count. Data, specific to
// the subject is passed in through pSubjectInfo. To retrieve the
// size of the signature, set pbData to NULL.
//
// Returns:
// TRUE: No fatal errors
// FALSE: Errors occured. See GetLastError()
//
// Last Errors:
// ERROR_NOT_ENOUGH_MEMORY: error allocating memory
// TRUST_E_SUBJECT_FORM_UNKNOWN: unknown subject type.
// ERROR_INVALID_PARAMETER: bad argument passed in
// ERROR_BAD_FORMAT: file/data format is not correct
// for the requested SIP.
// CRYPT_E_NO_MATCH: the signature could not be found
// based on the dwIndex provided.
// ERROR_INSUFFICIENT_BUFFER: the pbSignedDataMsg was not big
// enough to hold the data. pcbSignedDataMsg
// contains the required size.
//
extern BOOL WINAPI CryptSIPGetSignedDataMsg(
IN SIP_SUBJECTINFO *pSubjectInfo,
OUT DWORD *pdwEncodingType,
IN DWORD dwIndex,
IN OUT DWORD *pcbSignedDataMsg,
OUT BYTE *pbSignedDataMsg);
typedef BOOL (* pCryptSIPGetSignedDataMsg)(
IN SIP_SUBJECTINFO *pSubjectInfo,
OUT DWORD *pdwEncodingType,
IN DWORD dwIndex,
IN OUT DWORD *pcbSignedDataMsg,
OUT BYTE *pbSignedDataMsg);
//////////////////////////////////////////////////////////////////////////////
//
// CryptSIPPuttSignedDataMsg
//----------------------------------------------------------------------------
// Adds a signature to the subject. The index that it was
// stored with is returned for future reference.
//
// Returns:
// TRUE: No fatal errors
// FALSE: Errors occured. See GetLastError()
//
// Last Errors:
// ERROR_NOT_ENOUGH_MEMORY: error allocating memory
// TRUST_E_SUBJECT_FORM_UNKNOWN: unknown subject type.
// CRYPT_E_BAD_LEN: the length specified in
// psData->dwSignature was
// insufficient.
// CRYPT_E_NO_MATCH: could not find the specified index
// ERROR_INVALID_PARAMETER: bad argument passed in
// ERROR_BAD_FORMAT: file/data format is not correct
// for the requested SIP.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -