mssip.h 5.36 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * Copyright (C) 2002 Patrik Stridvall
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
 */

#ifndef __WINE_MSSIP_H
#define __WINE_MSSIP_H

#ifdef __cplusplus
extern "C" {
#endif /* defined(__cplusplus) */

/**********************************************************************/

typedef CRYPT_HASH_BLOB CRYPT_DIGEST_DATA;

/**********************************************************************/

#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

#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

#define SIP_MAX_MAGIC_NUMBER 4

/**********************************************************************/

49
#include <pshpack8.h>
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
typedef struct SIP_SUBJECTINFO_ {
    DWORD cbSize;
    GUID *pgSubjectType;
    HANDLE hFile;
    LPCWSTR pwsFileName;
    LPCWSTR pwsDisplayName;

    DWORD dwReserved1;
    DWORD dwIntVersion;

    HCRYPTPROV hProv;
    CRYPT_ALGORITHM_IDENTIFIER DigestAlgorithm;
    DWORD dwFlags;
    DWORD dwEncodingType;
    DWORD dwReserved2;
    DWORD fdwCAPISettings;
    DWORD fdwSecuritySettings;
    DWORD dwIndex;

    DWORD dwUnionChoice;
    union {
      struct MS_ADDINFO_FLAT_          *psFlat;
      struct MS_ADDINFO_CATALOGMEMBER_ *psCatMember;
      struct MS_ADDINFO_BLOB_          *psBlob;
    } DUMMYUNIONNAME;

    LPVOID pClientData;
} SIP_SUBJECTINFO, *LPSIP_SUBJECTINFO;
78
#include <poppack.h>
79

80
#include <pshpack8.h>
81 82 83 84 85
typedef struct MS_ADDINFO_FLAT_ {
  DWORD cbStruct;

  struct SIP_INDIRECT_DATA_ *pIndirectData;
} MS_ADDINFO_FLAT, *PMS_ADDINFO_FLAT;
86
#include <poppack.h>
87

88
#include <pshpack8.h>
89 90 91 92 93 94
typedef struct MS_ADDINFO_CATALOGMEMBER_ {
  DWORD cbStruct;

  struct CRYPTCATSTORE_  *pStore;
  struct CRYPTCATMEMBER_ *pMember;
} MS_ADDINFO_CATALOGMEMBER, *PMS_ADDINFO_CATALOGMEMBER;
95
#include <poppack.h>
96

97
#include <pshpack8.h>
98 99 100 101 102 103 104 105 106
typedef struct MS_ADDINFO_BLOB_ {
  DWORD cbStruct;

  DWORD cbMemObject;
  BYTE *pbMemObject;

  DWORD cbMemSignedMsg;
  BYTE *pbMemSignedMsg;
} MS_ADDINFO_BLOB, *PMS_ADDINFO_BLOB;
107
#include <poppack.h>
108

109
#include <pshpack8.h>
110 111 112 113 114
typedef struct SIP_INDIRECT_DATA_ {
  CRYPT_ATTRIBUTE_TYPE_VALUE Data;
  CRYPT_ALGORITHM_IDENTIFIER DigestAlgorithm;
  CRYPT_HASH_BLOB            Digest;
} SIP_INDIRECT_DATA, *PSIP_INDIRECT_DATA;
115
#include <poppack.h>
116 117

typedef BOOL (WINAPI * pCryptSIPGetSignedDataMsg)(SIP_SUBJECTINFO *,DWORD *,DWORD,DWORD *,BYTE *);
118
typedef BOOL (WINAPI * pCryptSIPPutSignedDataMsg)(SIP_SUBJECTINFO *,DWORD,DWORD *,DWORD,BYTE *);
119 120 121 122
typedef BOOL (WINAPI * pCryptSIPCreateIndirectData)(SIP_SUBJECTINFO *,DWORD *,SIP_INDIRECT_DATA *);
typedef BOOL (WINAPI * pCryptSIPVerifyIndirectData)(SIP_SUBJECTINFO *,SIP_INDIRECT_DATA *);
typedef BOOL (WINAPI * pCryptSIPRemoveSignedDataMsg)(SIP_SUBJECTINFO *,DWORD);

123
#include <pshpack8.h>
124 125 126 127 128 129 130 131 132 133 134
typedef struct SIP_DISPATCH_INFO_ {
  DWORD cbSize;

  HANDLE hSIP;

  pCryptSIPGetSignedDataMsg    pfGet;
  pCryptSIPPutSignedDataMsg    pfPut;
  pCryptSIPCreateIndirectData  pfCreate;
  pCryptSIPVerifyIndirectData  pfVerify;
  pCryptSIPRemoveSignedDataMsg pfRemove;
} SIP_DISPATCH_INFO, *LPSIP_DISPATCH_INFO;
135
#include <poppack.h>
136 137 138 139

typedef BOOL (WINAPI *pfnIsFileSupported)(HANDLE,GUID *);
typedef BOOL (WINAPI *pfnIsFileSupportedName)(WCHAR *,GUID *);

140
#include <pshpack8.h>
141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159
typedef struct SIP_ADD_NEWPROVIDER_
{
  DWORD cbStruct;

  GUID  *pgSubject;

  WCHAR *pwszDLLFileName;
  WCHAR *pwszMagicNumber;

  WCHAR *pwszIsFunctionName;

  WCHAR *pwszGetFuncName;
  WCHAR *pwszPutFuncName;
  WCHAR *pwszCreateFuncName;
  WCHAR *pwszVerifyFuncName;
  WCHAR *pwszRemoveFuncName;

  WCHAR *pwszIsFunctionNameFmt2;
} SIP_ADD_NEWPROVIDER, *PSIP_ADD_NEWPROVIDER;
160
#include <poppack.h>
161 162 163 164

/**********************************************************************/

BOOL WINAPI CryptSIPGetSignedDataMsg(SIP_SUBJECTINFO *,DWORD *,DWORD,DWORD *,BYTE *);
165
BOOL WINAPI CryptSIPPutSignedDataMsg(SIP_SUBJECTINFO *,DWORD,DWORD *,DWORD,BYTE *);
166 167 168 169 170
BOOL WINAPI CryptSIPCreateIndirectData(SIP_SUBJECTINFO *,DWORD *,SIP_INDIRECT_DATA *);
BOOL WINAPI CryptSIPVerifyIndirectData(SIP_SUBJECTINFO *,SIP_INDIRECT_DATA *);
BOOL WINAPI CryptSIPRemoveSignedDataMsg(SIP_SUBJECTINFO *,DWORD);

BOOL WINAPI CryptSIPLoad(const GUID *,DWORD,SIP_DISPATCH_INFO *);
171
BOOL WINAPI CryptSIPRetrieveSubjectGuid(LPCWSTR,HANDLE,GUID *);
172 173 174 175 176 177 178 179 180
BOOL WINAPI CryptSIPRetrieveSubjectGuidForCatalogFile(LPCWSTR,HANDLE,GUID *);
BOOL WINAPI CryptSIPAddProvider(SIP_ADD_NEWPROVIDER *);
BOOL WINAPI CryptSIPRemoveProvider(GUID *);

#ifdef __cplusplus
} /* extern "C" */
#endif /* defined(__cplusplus) */

#endif  /* __WINE_MSSIP_H */