Home | History | Annotate | Download | only in include
      1 /*
      2  * Copyright (C) 2004 Francois Gouget
      3  *
      4  * This library is free software; you can redistribute it and/or
      5  * modify it under the terms of the GNU Lesser General Public
      6  * License as published by the Free Software Foundation; either
      7  * version 2.1 of the License, or (at your option) any later version.
      8  *
      9  * This library is distributed in the hope that it will be useful,
     10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     12  * Lesser General Public License for more details.
     13  *
     14  * You should have received a copy of the GNU Lesser General Public
     15  * 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 #ifndef __WINE_MSCAT_H
     20 #define __WINE_MSCAT_H
     21 
     22 #include <mssip.h>
     23 
     24 typedef HANDLE HCATADMIN;
     25 typedef HANDLE HCATINFO;
     26 
     27 #ifdef __cplusplus
     28 extern "C" {
     29 #endif
     30 
     31 #define CRYPTCAT_OPEN_CREATENEW             0x00000001
     32 #define CRYPTCAT_OPEN_ALWAYS                0x00000002
     33 #define CRYPTCAT_OPEN_EXISTING              0x00000004
     34 #define CRYPTCAT_OPEN_EXCLUDE_PAGE_HASHES   0x00010000
     35 #define CRYPTCAT_OPEN_INCLUDE_PAGE_HASHES   0x00020000
     36 #define CRYPTCAT_OPEN_VERIFYSIGHASH         0x10000000
     37 #define CRYPTCAT_OPEN_NO_CONTENT_HCRYPTMSG  0x20000000
     38 #define CRYPTCAT_OPEN_SORTED                0x40000000
     39 #define CRYPTCAT_OPEN_FLAGS_MASK            0xffff0000
     40 
     41 #define CRYPTCAT_E_AREA_HEADER              0x00000000
     42 #define CRYPTCAT_E_AREA_MEMBER              0x00010000
     43 #define CRYPTCAT_E_AREA_ATTRIBUTE           0x00020000
     44 
     45 #define CRYPTCAT_E_CDF_UNSUPPORTED          0x00000001
     46 #define CRYPTCAT_E_CDF_DUPLICATE            0x00000002
     47 #define CRYPTCAT_E_CDF_TAGNOTFOUND          0x00000004
     48 
     49 #define CRYPTCAT_E_CDF_MEMBER_FILE_PATH     0x00010001
     50 #define CRYPTCAT_E_CDF_MEMBER_INDIRECTDATA  0x00010002
     51 #define CRYPTCAT_E_CDF_MEMBER_FILENOTFOUND  0x00010004
     52 
     53 #define CRYPTCAT_E_CDF_BAD_GUID_CONV        0x00020001
     54 #define CRYPTCAT_E_CDF_ATTR_TOOFEWVALUES    0x00020002
     55 #define CRYPTCAT_E_CDF_ATTR_TYPECOMBO       0x00020004
     56 
     57 #include <pshpack8.h>
     58 
     59 typedef struct CRYPTCATATTRIBUTE_
     60 {
     61     DWORD cbStruct;
     62     LPWSTR pwszReferenceTag;
     63     DWORD dwAttrTypeAndAction;
     64     DWORD cbValue;
     65     BYTE *pbValue;
     66     DWORD dwReserved;
     67 } CRYPTCATATTRIBUTE;
     68 
     69 typedef struct CRYPTCATMEMBER_
     70 {
     71     DWORD cbStruct;
     72     LPWSTR pwszReferenceTag;
     73     LPWSTR pwszFileName;
     74     GUID gSubjectType;
     75     DWORD fdwMemberFlags;
     76     struct SIP_INDIRECT_DATA_* pIndirectData;
     77     DWORD dwCertVersion;
     78     DWORD dwReserved;
     79     HANDLE hReserved;
     80     CRYPT_ATTR_BLOB sEncodedIndirectData;
     81     CRYPT_ATTR_BLOB sEncodedMemberInfo;
     82 } CRYPTCATMEMBER;
     83 
     84 typedef struct CATALOG_INFO_
     85 {
     86     DWORD cbStruct;
     87     WCHAR wszCatalogFile[MAX_PATH];
     88 } CATALOG_INFO;
     89 
     90 typedef struct CRYPTCATCDF_
     91 {
     92     DWORD cbStruct;
     93     HANDLE hFile;
     94     DWORD dwCurFilePos;
     95     DWORD dwLastMemberOffset;
     96     WINBOOL fEOF;
     97     LPWSTR pwszResultDir;
     98     HANDLE hCATStore;
     99 } CRYPTCATCDF;
    100 
    101 #include <poppack.h>
    102 
    103 typedef void (WINAPI *PFN_CDF_PARSE_ERROR_CALLBACK)(DWORD, DWORD, WCHAR *);
    104 
    105 WINBOOL   WINAPI CryptCATAdminAcquireContext(HCATADMIN*,const GUID*,DWORD);
    106 HCATINFO  WINAPI CryptCATAdminAddCatalog(HCATADMIN,PWSTR,PWSTR,DWORD);
    107 WINBOOL   WINAPI CryptCATAdminCalcHashFromFileHandle(HANDLE,DWORD*,BYTE*,DWORD);
    108 HCATINFO  WINAPI CryptCATAdminEnumCatalogFromHash(HCATADMIN,BYTE*,DWORD,DWORD,HCATINFO*);
    109 WINBOOL   WINAPI CryptCATAdminReleaseCatalogContext(HCATADMIN,HCATINFO,DWORD);
    110 WINBOOL   WINAPI CryptCATAdminReleaseContext(HCATADMIN,DWORD);
    111 WINBOOL   WINAPI CryptCATAdminRemoveCatalog(HCATADMIN,LPCWSTR,DWORD);
    112 WINBOOL   WINAPI CryptCATAdminResolveCatalogPath(HCATADMIN, WCHAR *, CATALOG_INFO *, DWORD);
    113 WINBOOL   WINAPI CryptCATCatalogInfoFromContext(HCATINFO, CATALOG_INFO *, DWORD);
    114 WINBOOL   WINAPI CryptCATCDFClose(CRYPTCATCDF *);
    115 CRYPTCATATTRIBUTE * WINAPI CryptCATCDFEnumCatAttributes(CRYPTCATCDF *, CRYPTCATATTRIBUTE *,
    116                                                         PFN_CDF_PARSE_ERROR_CALLBACK);
    117 LPWSTR              WINAPI CryptCATCDFEnumMembersByCDFTagEx(CRYPTCATCDF *, LPWSTR,
    118                                                             PFN_CDF_PARSE_ERROR_CALLBACK,
    119                                                             CRYPTCATMEMBER **, WINBOOL, LPVOID);
    120 CRYPTCATCDF       * WINAPI CryptCATCDFOpen(LPWSTR, PFN_CDF_PARSE_ERROR_CALLBACK);
    121 WINBOOL             WINAPI CryptCATClose(HANDLE);
    122 CRYPTCATATTRIBUTE * WINAPI CryptCATEnumerateAttr(HANDLE, CRYPTCATMEMBER *, CRYPTCATATTRIBUTE *);
    123 CRYPTCATATTRIBUTE * WINAPI CryptCATEnumerateCatAttr(HANDLE, CRYPTCATATTRIBUTE *);
    124 CRYPTCATMEMBER    * WINAPI CryptCATEnumerateMember(HANDLE,CRYPTCATMEMBER *);
    125 CRYPTCATATTRIBUTE * WINAPI CryptCATGetAttrInfo(HANDLE, CRYPTCATMEMBER *, LPWSTR);
    126 CRYPTCATATTRIBUTE * WINAPI CryptCATGetCatAttrInfo(HANDLE, LPWSTR);
    127 CRYPTCATMEMBER    * WINAPI CryptCATGetMemberInfo(HANDLE, LPWSTR);
    128 HANDLE    WINAPI CryptCATOpen(LPWSTR,DWORD,HCRYPTPROV,DWORD,DWORD);
    129 
    130 #ifdef __cplusplus
    131 }
    132 #endif
    133 
    134 #endif
    135