softpub.h 10.5 KB
Newer Older
Mike McCormack's avatar
Mike McCormack committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
/*
 * Copyright (C) 2006 Mike McCormack
 *
 * 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
Mike McCormack's avatar
Mike McCormack committed
17 18 19 20 21 22 23 24 25 26
 */

#ifndef __WINE_SOFTPUB_H
#define __WINE_SOFTPUB_H

#include <wintrust.h>

#define WINTRUST_ACTION_GENERIC_CERT_VERIFY \
    { 0x189a3842, 0x3041, 0x11d1, { 0x85,0xe1,0x00,0xc0,0x4f,0xc2,0x95,0xee }}

27 28 29 30 31 32
#if defined(__GNUC__)
#define SP_GENERIC_CERT_INIT_FUNCTION (const WCHAR []) \
    {'S','o','f','t','p','u','b','D','e','f','C','e','r','t','I','n','i','t', 0}
#elif defined(_MSC_VER)
#define SP_GENERIC_CERT_INIT_FUNCTION L"SoftpubDefCertInit"
#else
33
static const WCHAR SP_GENERIC_CERT_INIT_FUNCTION[] =
34 35 36
    {'S','o','f','t','p','u','b','D','e','f','C','e','r','t','I','n','i','t', 0};
#endif

Mike McCormack's avatar
Mike McCormack committed
37 38 39
#define WINTRUST_ACTION_GENERIC_CHAIN_VERIFY \
    { 0xfc451c16, 0xac75, 0x11d1, { 0xb4,0xb8,0x00,0xc0,0x4f,0xb6,0x6e,0xa0 }}

40 41 42 43 44 45 46 47 48
#if defined(__GNUC__)
#define GENERIC_CHAIN_FINALPOLICY_FUNCTION (const WCHAR []) \
    {'G','e','n','e','r','i','c','C','h','a','i','n','F','i','n','a','l','P','r','o','v', 0}
#define GENERIC_CHAIN_CERTTRUST_FUNCTION (const WCHAR []) \
    {'G','e','n','e','r','i','c','C','h','a','i','n','C','e','r','t','i','f','i','c','a','t','e','T','r','u','s','t', 0}
#elif defined(_MSC_VER)
#define GENERIC_CHAIN_FINALPOLICY_FUNCTION L"GenericChainFinalProv"
#define GENERIC_CHAIN_CERTTRUST_FUNCTION   L"GenericChainCertificateTrust"
#else
49
static const WCHAR GENERIC_CHAIN_FINALPOLICY_FUNCTION[] =
50
    {'G','e','n','e','r','i','c','C','h','a','i','n','F','i','n','a','l','P','r','o','v', 0};
51
static const WCHAR GENERIC_CHAIN_CERTTRUST_FUNCTION[] =
52 53 54
    {'G','e','n','e','r','i','c','C','h','a','i','n','C','e','r','t','i','f','i','c','a','t','e','T','r','u','s','t', 0};
#endif

55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97
typedef struct _WTD_GENERIC_CHAIN_POLICY_SIGNER_INFO
{
    union {
        DWORD cbStruct;
        DWORD cbSize;
    } DUMMYUNIONNAME;
    PCCERT_CHAIN_CONTEXT pChainContext;
    DWORD                dwSignerType;
    PCMSG_SIGNER_INFO    pMsgSignerInfo;
    DWORD                dwError;
    DWORD                cCounterSigner;
    struct _WTD_GENERIC_CHAIN_POLICY_SIGNER_INFO *rgpCounterSigner;
} WTD_GENERIC_CHAIN_POLICY_SIGNER_INFO, *PWTD_GENERIC_CHAIN_POLICY_SIGNER_INFO;

typedef HRESULT (WINAPI *PFN_WTD_GENERIC_CHAIN_POLICY_CALLBACK)(
 PCRYPT_PROVIDER_DATA pProvData, DWORD dwStepError, DWORD dwRegPolicySettings,
 DWORD cSigner, PWTD_GENERIC_CHAIN_POLICY_SIGNER_INFO rgpSigner,
 void *pvPolicyArg);

typedef struct _WTD_GENERIC_CHAIN_POLICY_CREATE_INFO
{
    union {
        DWORD cbStruct;
        DWORD cbSize;
    } DUMMYUNIONNAME;
    HCERTCHAINENGINE hChainEngine;
    PCERT_CHAIN_PARA pChainPara;
    DWORD            dwFlags;
    void            *pvReserved;
} WTD_GENERIC_CHAIN_POLICY_CREATE_INFO, *PWTD_GENERIC_CHAIN_POLICY_CREATE_INFO;

typedef struct _WTD_GENERIC_CHAIN_POLICY_DATA
{
    union {
        DWORD cbStruct;
        DWORD cbSize;
    } DUMMYUNIONNAME;
    PWTD_GENERIC_CHAIN_POLICY_CREATE_INFO pSignerChainInfo;
    PWTD_GENERIC_CHAIN_POLICY_CREATE_INFO pCounterSignerChainInfo;
    PFN_WTD_GENERIC_CHAIN_POLICY_CALLBACK pfnPolicyCallback;
    void                                 *pvPolicyArg;
} WTD_GENERIC_CHAIN_POLICY_DATA, *PWTD_GENERIC_CHAIN_POLICY_DATA;

98 99 100 101 102 103
#if defined(__GNUC__)
#define SP_POLICY_PROVIDER_DLL_NAME (const WCHAR []) \
    {'W','I','N','T','R','U','S','T','.','D','L','L' ,0}
#elif defined(_MSC_VER)
#define SP_POLICY_PROVIDER_DLL_NAME L"WINTRUST.DLL"
#else
104
static const WCHAR SP_POLICY_PROVIDER_DLL_NAME[] =
105 106 107
    {'W','I','N','T','R','U','S','T','.','D','L','L', 0};
#endif

Mike McCormack's avatar
Mike McCormack committed
108 109
#define WINTRUST_ACTION_GENERIC_VERIFY_V2 \
    { 0xaac56b,   0xcd44, 0x11d0, { 0x8c,0xc2,0x00,0xc0,0x4f,0xc2,0x95,0xee }}
110

111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131
#if defined(__GNUC__)
#define SP_INIT_FUNCTION          (const WCHAR []) \
    {'S','o','f','t','p','u','b','I','n','i','t','i','a','l','i','z','e', 0}
#define SP_OBJTRUST_FUNCTION      (const WCHAR []) \
    {'S','o','f','t','p','u','b','L','o','a','d','M','e','s','s','a','g','e', 0}
#define SP_SIGTRUST_FUNCTION      (const WCHAR []) \
    {'S','o','f','t','p','u','b','L','o','a','d','S','i','g','n','a','t','u','r','e', 0}
#define SP_CHKCERT_FUNCTION       (const WCHAR []) \
    {'S','o','f','t','p','u','b','C','h','e','c','k','C','e','r','t', 0}
#define SP_FINALPOLICY_FUNCTION   (const WCHAR []) \
    {'S','o','f','t','p','u','b','A','u','t','h','e','n','t','i','c','o','d','e', 0}
#define SP_CLEANUPPOLICY_FUNCTION (const WCHAR []) \
    {'S','o','f','t','p','u','b','C','l','e','a','n','u','p', 0}
#elif defined(_MSC_VER)
#define SP_INIT_FUNCTION          L"SoftpubInitialize"
#define SP_OBJTRUST_FUNCTION      L"SoftpubLoadMessage"
#define SP_SIGTRUST_FUNCTION      L"SoftpubLoadSignature"
#define SP_CHKCERT_FUNCTION       L"SoftpubCheckCert"
#define SP_FINALPOLICY_FUNCTION   L"SoftpubAuthenticode"
#define SP_CLEANUPPOLICY_FUNCTION L"SoftpubCleanup"
#else
132
static const WCHAR SP_INIT_FUNCTION[]          =
133
    {'S','o','f','t','p','u','b','I','n','i','t','i','a','l','i','z','e', 0};
134
static const WCHAR SP_OBJTRUST_FUNCTION[]      =
135
    {'S','o','f','t','p','u','b','L','o','a','d','M','e','s','s','a','g','e', 0};
136
static const WCHAR SP_SIGTRUST_FUNCTION[]      =
137
    {'S','o','f','t','p','u','b','L','o','a','d','S','i','g','n','a','t','u','r','e', 0};
138
static const WCHAR SP_CHKCERT_FUNCTION[]       =
139
    {'S','o','f','t','p','u','b','C','h','e','c','k','C','e','r','t', 0};
140
static const WCHAR SP_FINALPOLICY_FUNCTION[]   =
141
    {'S','o','f','t','p','u','b','A','u','t','h','e','n','t','i','c','o','d','e', 0};
142
static const WCHAR SP_CLEANUPPOLICY_FUNCTION[] =
143 144 145
    {'S','o','f','t','p','u','b','C','l','e','a','n','u','p', 0};
#endif

Mike McCormack's avatar
Mike McCormack committed
146 147 148
#define WINTRUST_ACTION_TRUSTPROVIDER_TEST \
    { 0x573e31f8, 0xddba, 0x11d0, { 0x8c,0xcb,0x00,0xc0,0x4f,0xc2,0x95,0xee }}

149 150 151 152 153 154
#if defined(__GNUC__)
#define SP_TESTDUMPPOLICY_FUNCTION_TEST (const WCHAR []) \
    {'S','o','f','t','p','u','b','D','u','m','p','S','t','r','u','c','t','u','r','e', 0}
#elif defined(_MSC_VER)
#define SP_TESTDUMPPOLICY_FUNCTION_TEST L"SoftpubDumpStructure"
#else
155
static const WCHAR SP_TESTDUMPPOLICY_FUNCTION_TEST[] =
156 157 158
    {'S','o','f','t','p','u','b','D','u','m','p','S','t','r','u','c','t','u','r','e', 0};
#endif

Paul Vriens's avatar
Paul Vriens committed
159 160 161
#define HTTPSPROV_ACTION \
    { 0x573e31f8, 0xaaba, 0x11d0, { 0x8c,0xcb,0x00,0xc0,0x4f,0xc2,0x95,0xee }}

162 163 164 165 166 167 168 169 170
#if defined(__GNUC__)
#define HTTPS_CERTTRUST_FUNCTION (const WCHAR []) \
    {'H','T','T','P','S','C','e','r','t','i','f','i','c','a','t','e','T','r','u','s','t', 0}
#define HTTPS_FINALPOLICY_FUNCTION (const WCHAR []) \
    {'H','T','T','P','S','F','i','n','a','l','P','r','o','v', 0}
#elif defined(_MSC_VER)
#define HTTPS_FINALPOLICY_FUNCTION L"HTTPSFinalProv"
#define HTTPS_CERTTRUST_FUNCTION   L"HTTPSCertificateTrust"
#else
171
static const WCHAR HTTPS_CERTTRUST_FUNCTION[] =
172
    {'H','T','T','P','S','C','e','r','t','i','f','i','c','a','t','e','T','r','u','s','t', 0};
173
static const WCHAR HTTPS_FINALPOLICY_FUNCTION[] =
174 175 176
    {'H','T','T','P','S','F','i','n','a','l','P','r','o','v', 0};
#endif

177 178 179
#define OFFICESIGN_ACTION_VERIFY \
    { 0x5555c2cd, 0x17fb, 0x11d1, { 0x85,0xc4,0x00,0xc0,0x4f,0xc2,0x95,0xee }}

180 181 182 183 184 185 186 187 188 189 190 191
#if defined(__GNUC__)
#define OFFICE_POLICY_PROVIDER_DLL_NAME (const WCHAR []) \
    {'W','I','N','T','R','U','S','T','.','D','L','L' ,0}
#define OFFICE_INITPROV_FUNCTION (const WCHAR []) \
    {'O','f','f','i','c','e','I','n','i','t','i','a','l','i','z','e','P','o','l','i','c','y', 0}
#define OFFICE_CLEANUPPOLICY_FUNCTION (const WCHAR []) \
    {'O','f','f','i','c','e','C','l','e','a','n','u','p','P','o','l','i','c','y', 0}
#elif defined(_MSC_VER)
#define     OFFICE_POLICY_PROVIDER_DLL_NAME SP_POLICY_PROVIDER_DLL_NAME
#define     OFFICE_INITPROV_FUNCTION        L"OfficeInitializePolicy"
#define     OFFICE_CLEANUPPOLICY_FUNCTION   L"OfficeCleanupPolicy"
#else
192
static const WCHAR OFFICE_POLICY_PROVIDER_DLL_NAME[] =
193
    {'W','I','N','T','R','U','S','T','.','D','L','L', 0};
194
static const WCHAR OFFICE_INITPROV_FUNCTION[] =
195
    {'O','f','f','i','c','e','I','n','i','t','i','a','l','i','z','e','P','o','l','i','c','y', 0};
196
static const WCHAR OFFICE_CLEANUPPOLICY_FUNCTION[] =
197 198 199
    {'O','f','f','i','c','e','C','l','e','a','n','u','p','P','o','l','i','c','y', 0};
#endif

200 201 202
#define DRIVER_ACTION_VERIFY \
    { 0xf750e6c3, 0x38ee, 0x11d1, { 0x85,0xe5,0x00,0xc0,0x4f,0xc2,0x95,0xee }}

203 204 205 206 207 208 209 210 211 212 213 214
#if defined(__GNUC__)
#define DRIVER_INITPROV_FUNCTION (const WCHAR []) \
    {'D','r','i','v','e','r','I','n','i','t','i','a','l','i','z','e','P','o','l','i','c','y', 0}
#define DRIVER_FINALPOLPROV_FUNCTION (const WCHAR []) \
    {'D','r','i','v','e','r','F','i','n','a','l','P','o','l','i','c','y', 0}
#define DRIVER_CLEANUPPOLICY_FUNCTION (const WCHAR []) \
    {'D','r','i','v','e','r','C','l','e','a','n','u','p','P','o','l','i','c','y', 0}
#elif defined(_MSC_VER)
#define     DRIVER_INITPROV_FUNCTION      L"DriverInitializePolicy"
#define     DRIVER_FINALPOLPROV_FUNCTION  L"DriverFinalPolicy"
#define     DRIVER_CLEANUPPOLICY_FUNCTION L"DriverCleanupPolicy"
#else
215
static const WCHAR DRIVER_INITPROV_FUNCTION[] =
216
    {'D','r','i','v','e','r','I','n','i','t','i','a','l','i','z','e','P','o','l','i','c','y', 0};
217
static const WCHAR DRIVER_FINALPOLPROV_FUNCTION[] =
218
    {'D','r','i','v','e','r','F','i','n','a','l','P','o','l','i','c','y', 0};
219
static const WCHAR DRIVER_CLEANUPPOLICY_FUNCTION[] =
220 221 222
    {'D','r','i','v','e','r','C','l','e','a','n','u','p','P','o','l','i','c','y', 0};
#endif

223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244
typedef struct DRIVER_VER_MAJORMINOR_
{
    DWORD dwMajor;
    DWORD dwMinor;
} DRIVER_VER_MAJORMINOR;

typedef struct DRIVER_VER_INFO_
{
    DWORD                 cbStruct;
    ULONG_PTR             dwReserved1;
    ULONG_PTR             dwReserved2;
    DWORD                 dwPlatform;
    DWORD                 dwVersion;
    WCHAR                 wszVersion[MAX_PATH];
    WCHAR                 wszSignedBy[MAX_PATH];
    PCCERT_CONTEXT        pcSignerCertContext;
    DRIVER_VER_MAJORMINOR sOSVersionLow;
    DRIVER_VER_MAJORMINOR sOSVersionHigh;
    DWORD                 dwBuildNumberLow;
    DWORD                 dwBuildNumberHigh;
} DRIVER_VER_INFO, *PDRIVER_VER_INFO;

Mike McCormack's avatar
Mike McCormack committed
245
#endif /* __WINE_SOFTPUB_H */