Module: wine Branch: master Commit: 01b083c5758b25a1ba7d495033f9abac2633d273 URL: http://source.winehq.org/git/wine.git/?a=commit;h=01b083c5758b25a1ba7d495033...
Author: Juan Lang juan.lang@gmail.com Date: Mon Aug 27 16:32:29 2007 -0700
imagehlp: Move WIN_CERTIFICATE types to wintrust.h, and rename a type, to match PSDK.
---
dlls/imagehlp/integrity.c | 6 +++--- include/imagehlp.h | 20 +++----------------- include/wintrust.h | 19 +++++++++++++++++++ 3 files changed, 25 insertions(+), 20 deletions(-)
diff --git a/dlls/imagehlp/integrity.c b/dlls/imagehlp/integrity.c index fb228f4..df6de0f 100644 --- a/dlls/imagehlp/integrity.c +++ b/dlls/imagehlp/integrity.c @@ -144,7 +144,7 @@ static BOOL IMAGEHLP_GetCertificateOffset( HANDLE handle, DWORD num, */
BOOL WINAPI ImageAddCertificate( - HANDLE FileHandle, PWIN_CERTIFICATE Certificate, PDWORD Index) + HANDLE FileHandle, LPWIN_CERTIFICATE Certificate, PDWORD Index) { FIXME("(%p, %p, %p): stub\n", FileHandle, Certificate, Index @@ -220,7 +220,7 @@ BOOL WINAPI ImageEnumerateCertificates( */ BOOL WINAPI ImageGetCertificateData( HANDLE handle, DWORD Index, - PWIN_CERTIFICATE Certificate, PDWORD RequiredLength) + LPWIN_CERTIFICATE Certificate, PDWORD RequiredLength) { DWORD r, offset, ofs, size, count;
@@ -263,7 +263,7 @@ BOOL WINAPI ImageGetCertificateData( * ImageGetCertificateHeader (IMAGEHLP.@) */ BOOL WINAPI ImageGetCertificateHeader( - HANDLE handle, DWORD index, PWIN_CERTIFICATE pCert) + HANDLE handle, DWORD index, LPWIN_CERTIFICATE pCert) { DWORD r, offset, ofs, size, count; const size_t cert_hdr_size = sizeof *pCert - sizeof pCert->bCertificate; diff --git a/include/imagehlp.h b/include/imagehlp.h index 6e9ac51..93bbaee 100644 --- a/include/imagehlp.h +++ b/include/imagehlp.h @@ -71,13 +71,6 @@ typedef enum _IMAGEHLP_STATUS_REASON {
#define CERT_SECTION_TYPE_ANY 0xFF
-#define WIN_CERT_REVISION_1_0 0x0100 -#define WIN_CERT_REVISION_2_0 0x0200 - -#define WIN_CERT_TYPE_X509 0x0001 /* X.509 Certificate */ -#define WIN_CERT_TYPE_PKCS_SIGNED_DATA 0x0002 /* PKCS SignedData */ -#define WIN_CERT_TYPE_RESERVED_1 0x0003 /* Reserved */ - #define SPLITSYM_REMOVE_PRIVATE 0x00000001 #define SPLITSYM_EXTRACT_ALL 0x00000002 #define SPLITSYM_SYMBOLPATH_IS_SRC 0x00000004 @@ -179,13 +172,6 @@ typedef struct _LOADED_IMAGE ULONG SizeOfImage; } LOADED_IMAGE, *PLOADED_IMAGE;
-typedef struct _WIN_CERTIFICATE { - DWORD dwLength; - WORD wRevision; /* WIN_CERT_REVISON_xxx */ - WORD wCertificateType; /* WIN_CERT_TYPE_xxx */ - BYTE bCertificate[ANYSIZE_ARRAY]; -} WIN_CERTIFICATE, *PWIN_CERTIFICATE; - typedef struct _API_VERSION { USHORT MajorVersion; USHORT MinorVersion; @@ -841,7 +827,7 @@ DWORD WINAPI GetTimestampForLoadedLibrary( HMODULE Module ); BOOL WINAPI ImageAddCertificate( - HANDLE FileHandle, PWIN_CERTIFICATE Certificate, PDWORD Index + HANDLE FileHandle, LPWIN_CERTIFICATE Certificate, PDWORD Index ); PVOID WINAPI ImageDirectoryEntryToData( PVOID Base, BOOLEAN MappedAsImage, USHORT DirectoryEntry, PULONG Size @@ -852,11 +838,11 @@ BOOL WINAPI ImageEnumerateCertificates( ); BOOL WINAPI ImageGetCertificateData( HANDLE FileHandle, DWORD CertificateIndex, - PWIN_CERTIFICATE Certificate, PDWORD RequiredLength + LPWIN_CERTIFICATE Certificate, PDWORD RequiredLength ); BOOL WINAPI ImageGetCertificateHeader( HANDLE FileHandle, DWORD CertificateIndex, - PWIN_CERTIFICATE Certificateheader + LPWIN_CERTIFICATE Certificateheader ); BOOL WINAPI ImageGetDigestStream( HANDLE FileHandle, DWORD DigestLevel, diff --git a/include/wintrust.h b/include/wintrust.h index 0fb9838..3290e31 100644 --- a/include/wintrust.h +++ b/include/wintrust.h @@ -533,6 +533,25 @@ typedef struct _CAT_MEMBERINFO DWORD dwCertVersion; } CAT_MEMBERINFO, *PCAT_MEMBERINFO;
+/* PSDK protects the remaining defines with WT_DEFINE_ALL_APIS, but it's + * defined by default. No need to protect against bad headers from old PSDKs. + */ + +typedef struct _WIN_CERTIFICATE { + DWORD dwLength; + WORD wRevision; /* WIN_CERT_REVISON_xxx */ + WORD wCertificateType; /* WIN_CERT_TYPE_xxx */ + BYTE bCertificate[ANYSIZE_ARRAY]; +} WIN_CERTIFICATE, *LPWIN_CERTIFICATE; + +#define WIN_CERT_REVISION_1_0 0x0100 +#define WIN_CERT_REVISION_2_0 0x0200 + +#define WIN_CERT_TYPE_X509 0x0001 /* X.509 Certificate */ +#define WIN_CERT_TYPE_PKCS_SIGNED_DATA 0x0002 /* PKCS SignedData */ +#define WIN_CERT_TYPE_RESERVED_1 0x0003 /* Reserved */ +#define WIN_CERT_TYPE_TS_STACK_SIGNED 0x0004 + #define WIN_SPUB_ACTION_PUBLISHED_SOFTWARE \ { 0x64b9d180, 0x8da2, 0x11cf, { 0x87,0x36,0x00,0xaa,0x00,0xa4,0x85,0xeb }}