Ge van Geldorp wrote:
Let me be the first to say that I'd like to see
the code remain as close as
possible to the Wine code. The problem is that we don't handle the Wine SEH
macros correctly at the moment. I've run into this before, it is the reason
ole32.dll hasn't been synced since Wine-20050830. I know Filip worked on
defining the Wine SEH macros in terms of our PSEH macros, I think he hit a
blocker though.
I spent some time fixing the wine exception macros in ReactOS. See the
attached file ros-wineexcept.patch.
However, wine's crypt32 is not fully portable, they forgot to add some
headers and they re-defined ASN_OCTETSTRING which is supposed to be
defined in snmp.h. I'm sure they'd accept that patch. See
wine-crypt32.patch which is against wine HEAD.
Both patches enables our build system to build crypt32 unmodified. A
patch to convert the current modified version in our tree into wine's
HEAD version + wine-crypt32.patch is attached, see
ros-crypt32-to-winehead.patch.
However, the downside is that crypt32 still needs a hack in the
crypt32.xml file: <define name="sigsetjmp(a,b)">setjmp(a)</define>
We don't have sigsetjmp and I'm not really sure how to handle this properly.
Please commit and/or email the patch to wine-patches if appropriate, I'm
not sure if the patch is any good or just yet another bad hack. Comments
appreciated.
- Thomas
Index: dlls/crypt32/cert.c
===================================================================
RCS file: /home/wine/wine/dlls/crypt32/cert.c,v
retrieving revision 1.21
diff -u -r1.21 cert.c
--- dlls/crypt32/cert.c 31 Oct 2005 10:04:06 -0000 1.21
+++ dlls/crypt32/cert.c 18 Nov 2005 16:31:05 -0000
@@ -27,6 +27,7 @@
* registering and enumerating physical stores and locations.)
* - Many flags, options and whatnot are unimplemented.
*/
+#include "config.h"
#include <assert.h>
#include <stdarg.h>
#include "windef.h"
@@ -38,6 +39,8 @@
#include "wine/debug.h"
#include "wine/list.h"
#include "excpt.h"
+#include "ntstatus.h"
+#include "winternl.h"
#include "wine/exception.h"
#include "crypt32_private.h"
Index: dlls/crypt32/encode.c
===================================================================
RCS file: /home/wine/wine/dlls/crypt32/encode.c,v
retrieving revision 1.32
diff -u -r1.32 encode.c
--- dlls/crypt32/encode.c 28 Oct 2005 10:09:26 -0000 1.32
+++ dlls/crypt32/encode.c 18 Nov 2005 16:43:27 -0000
@@ -31,6 +31,7 @@
* MSDN, especially:
*
http://msdn.microsoft.com/library/en-us/seccrypto/security/constants_for_cr…
*/
+#include "config.h"
#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
@@ -44,6 +45,8 @@
#include "wincrypt.h"
#include "winreg.h"
#include "snmp.h"
+#include "winternl.h"
+#include "ntstatus.h"
#include "wine/debug.h"
#include "wine/exception.h"
@@ -53,7 +56,9 @@
/* a few asn.1 tags we need */
#define ASN_BOOL (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x01)
#define ASN_BITSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x03)
+#ifndef ASN_OCTETSTRING
#define ASN_OCTETSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x04)
+#endif
#define ASN_ENUMERATED (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x0a)
#define ASN_SETOF (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x11)
#define ASN_NUMERICSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x12)
Index: include/wine/exception.h
===================================================================
--- include/wine/exception.h (revision 19323)
+++ include/wine/exception.h (working copy)
@@ -65,8 +65,8 @@
typedef struct _EXCEPTION_REGISTRATION_RECORD
{
- struct _EXCEPTION_REGISTRATION_RECORD *prev;
- PEXCEPTION_HANDLER handler;
+ struct _EXCEPTION_REGISTRATION_RECORD *Prev;
+ PEXCEPTION_HANDLER Handler;
} EXCEPTION_REGISTRATION_RECORD, *PEXCEPTION_REGISTRATION_RECORD;
/* Define this if you want to use your compiler built-in __try/__except support.
@@ -130,8 +130,8 @@
typedef DWORD (CALLBACK *__WINE_FILTER)(PEXCEPTION_POINTERS);
typedef void (CALLBACK *__WINE_FINALLY)(BOOL);
-#define WINE_EXCEPTION_FILTER(func) DWORD WINAPI func( EXCEPTION_POINTERS *__eptr )
-#define WINE_FINALLY_FUNC(func) void WINAPI func( BOOL __normal )
+#define WINE_EXCEPTION_FILTER(func) DWORD CALLBACK func( PEXCEPTION_POINTERS __eptr )
+#define WINE_FINALLY_FUNC(func) void CALLBACK func( BOOL __normal )
#define GetExceptionInformation() (__eptr)
#define GetExceptionCode() (__eptr->ExceptionRecord->ExceptionCode)
@@ -155,11 +155,6 @@
const struct __tagWINE_FRAME *ExceptionRecord;
} __WINE_FRAME;
-extern DWORD __wine_exception_handler( PEXCEPTION_RECORD record,
EXCEPTION_REGISTRATION_RECORD *frame,
- CONTEXT *context, EXCEPTION_REGISTRATION_RECORD
**pdispatcher );
-extern DWORD __wine_finally_handler( PEXCEPTION_RECORD record,
EXCEPTION_REGISTRATION_RECORD *frame,
- CONTEXT *context, EXCEPTION_REGISTRATION_RECORD
**pdispatcher );
-
#endif /* USE_COMPILER_EXCEPTIONS */
static inline EXCEPTION_REGISTRATION_RECORD *__wine_push_frame(
EXCEPTION_REGISTRATION_RECORD *frame )
@@ -183,8 +178,8 @@
{
#if defined(__GNUC__) && defined(__i386__)
__asm__ __volatile__(".byte 0x64\n\tmovl %0,(0)"
- : : "r" (frame->prev) : "memory" );
- return frame->prev;
+ : : "r" (frame->Prev) : "memory" );
+ return frame->Prev;
#else
NT_TIB *teb = (NT_TIB *)NtCurrentTeb();
@@ -193,7 +188,60 @@
#endif
}
+#ifndef USE_COMPILER_EXCEPTIONS
+extern VOID NTAPI RtlUnwind(PVOID,PVOID,PEXCEPTION_RECORD,PVOID);
+
+static __inline EXCEPTION_DISPOSITION
+__wine_exception_handler( struct _EXCEPTION_RECORD *record, void *frame,
+ struct _CONTEXT *context, void *pdispatcher )
+{
+ __WINE_FRAME *wine_frame = (__WINE_FRAME *)frame;
+
+ if (record->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND |
EH_NESTED_CALL))
+ return ExceptionContinueSearch;
+ if (wine_frame->u.filter)
+ {
+ EXCEPTION_POINTERS ptrs;
+ ptrs.ExceptionRecord = record;
+ ptrs.ContextRecord = context;
+ switch(wine_frame->u.filter( &ptrs ))
+ {
+ case EXCEPTION_CONTINUE_SEARCH:
+ return ExceptionContinueSearch;
+ case EXCEPTION_CONTINUE_EXECUTION:
+ return ExceptionContinueExecution;
+ case EXCEPTION_EXECUTE_HANDLER:
+ break;
+ default:
+ break;
+ }
+ }
+ /* hack to make GetExceptionCode() work in handler */
+ wine_frame->ExceptionCode = record->ExceptionCode;
+ wine_frame->ExceptionRecord = wine_frame;
+
+ RtlUnwind( frame, 0, record, 0 );
+ __wine_pop_frame( frame );
+ longjmp( wine_frame->jmp, 1 );
+}
+
+
+static __inline EXCEPTION_DISPOSITION
+__wine_finally_handler( struct _EXCEPTION_RECORD *record, void *frame,
+ struct _CONTEXT *context, void *pdispatcher )
+{
+ if (record->ExceptionFlags & (EH_UNWINDING | EH_EXIT_UNWIND))
+ {
+ __WINE_FRAME *wine_frame = (__WINE_FRAME *)frame;
+ wine_frame->u.finally_func( FALSE );
+ }
+ return ExceptionContinueSearch;
+}
+
+#endif /* USE_COMPILER_EXCEPTIONS */
+
+
/* Wine-specific exceptions codes */
#define EXCEPTION_WINE_STUB 0x80000100 /* stub entry point called */
Index: lib/crt/wine/cppexcept.c
===================================================================
--- lib/crt/wine/cppexcept.c (revision 19323)
+++ lib/crt/wine/cppexcept.c (working copy)
@@ -303,7 +303,7 @@
/* setup an exception block for nested exceptions */
//nested_frame.frame.Handler = catch_function_nested_handler;
- nested_frame.frame.handler =
(PEXCEPTION_HANDLER)catch_function_nested_handler;
+ nested_frame.frame.Handler =
(PEXCEPTION_HANDLER)catch_function_nested_handler;
nested_frame.prev_rec = thread_data->exc_record;
nested_frame.cxx_frame = frame;
nested_frame.descr = descr;
Index: cert.c
===================================================================
--- cert.c (revision 19323)
+++ cert.c (working copy)
@@ -1,6 +1,5 @@
/*
- * Copyright 2002
- Mike McCormack for CodeWeavers
+ * Copyright 2002 Mike McCormack for CodeWeavers
* Copyright 2004,2005 Juan Lang
*
* This library is free software; you can redistribute it and/or
@@ -28,18 +27,23 @@
* registering and enumerating physical stores and locations.)
* - Many flags, options and whatnot are unimplemented.
*/
+#include "config.h"
+#include <assert.h>
+#include <stdarg.h>
+#include "windef.h"
+#include "winbase.h"
+#include "winnls.h"
+#include "winreg.h"
+#include "winuser.h"
+#include "wincrypt.h"
+#include "wine/debug.h"
+#include "wine/list.h"
+#include "excpt.h"
+#include "ntstatus.h"
+#include "winternl.h"
+#include "wine/exception.h"
+#include "crypt32_private.h"
-#include "precomp.h"
-
-#define NONAMELESSUNION
-
-static _SEH_FILTER(page_fault)
-{
- if (_SEH_GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
- return _SEH_EXECUTE_HANDLER;
- return _SEH_CONTINUE_SEARCH;
-}
-
WINE_DEFAULT_DEBUG_CHANNEL(crypt);
#define WINE_CRYPTCERTSTORE_MAGIC 0x74726563
@@ -313,14 +317,12 @@
DWORD cbElement, DWORD dwContextTypeFlags, DWORD *pdwContentType);
/* filter for page-fault exceptions */
-/*
static WINE_EXCEPTION_FILTER(page_fault)
{
if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
return EXCEPTION_EXECUTE_HANDLER;
return EXCEPTION_CONTINUE_SEARCH;
}
-*/
static void CRYPT_InitStore(WINECRYPT_CERTSTORE *store, HCRYPTPROV hCryptProv,
DWORD dwFlags, CertStoreType type)
@@ -341,7 +343,6 @@
* be a PWINE_CERT_CONTEXT, and increments pCertContext's reference count.
* Also sets the hCertStore member of the reference to store.
*/
-
static void CRYPT_InitCertRef(PWINE_CERT_CONTEXT_REF ref,
PWINE_CERT_CONTEXT context, HCERTSTORE store)
{
@@ -2664,7 +2665,7 @@
return NULL;
}
- _SEH_TRY
+ __TRY
{
const WINE_CONTEXT_INTERFACE *contextInterface = NULL;
const WINE_CERT_PROP_HEADER *hdr = NULL;
@@ -2821,12 +2822,12 @@
}
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
context = NULL;
}
- _SEH_END
+ __ENDTRY
return context;
}
@@ -3313,15 +3314,6 @@
return ret;
}
-BOOL WINAPI CryptEncryptMessage( PCRYPT_ENCRYPT_MESSAGE_PARA pEncryptMessagePara,
- DWORD dwCert, PCCERT_CONTEXT pccertCert[],
- const BYTE* pbEncrypted, DWORD dwEncrypted,
- BYTE* pbBlob, DWORD* dwEncryptedBlob)
-{
- UNIMPLEMENTED;
- return FALSE;
-}
-
HCRYPTOIDFUNCSET WINAPI CryptInitOIDFunctionSet(LPCSTR pszFuncName, DWORD dwFlags)
{
FIXME("stub: %s %lx\n", debugstr_a(pszFuncName), dwFlags);
@@ -3334,42 +3326,3 @@
FIXME("stub: %lx %s %s\n", dwEncodingType, debugstr_a(pszFuncName),
debugstr_w(pwszDll));
return FALSE;
}
-
-DWORD WINAPI CertGetNameStringW(PCCERT_CONTEXT pCertContext,
- DWORD dwType, DWORD dwFlags,
- LPVOID pvType, LPWSTR pszName,
- DWORD dwName)
-{
- UNIMPLEMENTED;
- return ERROR_CALL_NOT_IMPLEMENTED;
-}
-
-DWORD WINAPI CertGetNameStringA(PCCERT_CONTEXT pCertContext,
- DWORD dwType, DWORD dwFlags,
- LPVOID pvType, LPSTR pszName,
- DWORD dwName)
-{
- UNIMPLEMENTED;
- return ERROR_CALL_NOT_IMPLEMENTED;
-}
-
-
-DWORD WINAPI CertNameToStrA(DWORD dwCertEncoding,
- PCERT_NAME_BLOB pCertName,
- DWORD dwType, LPSTR psz,
- DWORD dwSZ)
-{
- UNIMPLEMENTED;
- return ERROR_CALL_NOT_IMPLEMENTED;
-}
-
-DWORD WINAPI CertNameToStrW(DWORD dwCertEncoding,
- PCERT_NAME_BLOB pCertName,
- DWORD dwType, LPWSTR psz,
- DWORD dwSZ)
-{
- UNIMPLEMENTED;
- return ERROR_CALL_NOT_IMPLEMENTED;
-}
-
-
Index: crypt32.def
===================================================================
--- crypt32.def (revision 19323)
+++ crypt32.def (working copy)
@@ -1,105 +0,0 @@
-LIBRARY CRYPT32.DLL
-EXPORTS
-
-CertAddEncodedCRLToStore@24 @1022
-
-CertAddSerializedElementToStore@32 @1028
-CertAddStoreToCollection@16 @1029
-CertAlgIdToOID@4 @1030
-CertCloseStore@8 @1031
-
-CertDeleteCRLFromStore@4 @1044
-
-CertDeleteCertificateFromStore@4 @1046
-
-CertFindAttribute@12 @1062
-
-CertFindCertificateInStore@24 @1066
-
-CertFindExtension@12 @1068
-CertFindRDNAttr@8 @1069
-
-CertFreeCRLContext@4 @1072
-CertFreeCTLContext@4 @1073
-
-CertFreeCertificateContext@4 @1076
-
-CertGetCTLContextProperty@16 @1079
-
-CertGetCertificateContextProperty@16 @1081
-
-CertGetNameStringA@24 @1085
-CertGetNameStringW@24 @1086
-
-CertNameToStrA@20 @1093
-CertNameToStrW@20 @1094
-CertOIDToAlgId@4 @1095
-
-CertOpenSystemStoreA@8 @1097
-CertOpenSystemStoreW@8 @1098
-
-CertRemoveStoreFromCollection@8 @1104
-
-CertSerializeCTLStoreElement@16 @1108
-CertSerializeCertificateStoreElement@16 @1109
-
-CertSetCTLContextProperty@16 @1111
-CertSetCertificateContextProperty@16 @1113
-
-CertVerifyTimeValidity@8 @1126
-
-CryptDecodeObjectEx@32 @1138
-
-CryptEncodeObject@20 @1141
-
-CryptEncryptMessage@28 @1143
-
-CryptExportPublicKeyInfo@20 @1149
-CryptExportPublicKeyInfoEx@32 @1150
-
-CryptGetOIDFunctionValue@28 @1163
-CryptHashCertificate@28 @1164
-
-CryptImportPublicKeyInfo@16 @1169
-CryptImportPublicKeyInfoEx@28 @1170
-
-CryptMemAlloc@4 @1175
-CryptMemFree@4 @1176
-CryptMemRealloc@8 @1177
-
-CryptProtectData@28 @1193
-
-CryptRegisterDefaultOIDFunction@16 @1195
-CryptRegisterOIDFunction@20 @1196
-
-CryptSIPAddProvider@4 @1198
-
-CryptSIPLoad@12 @1201
-CryptSIPRemoveProvider@4 @1203
-
-CryptSIPRetrieveSubjectGuid@12 @1205
-
-CryptSetOIDFunctionValue@28 @1210
-
-CryptSignCertificate@36 @1214
-
-CryptUnprotectData@28 @1221
-
-CryptUnregisterOIDFunction@12 @1223
-
-CryptVerifyCertificateSignature@20
-CryptVerifyCertificateSignatureEx@32 @1226
-
-I_CryptCreateLruCache@8 @1240
-
-I_CryptDetachTls@4 @1242
-
-I_CryptFindLruEntryData@4 @1247
-
-I_CryptFlushLruCache@4 @1249
-I_CryptFreeLruCache@4 @1250
-I_CryptFreeTls@8 @1251
-
-I_CryptGetTls@4 @1260
-
-I_CryptSetTls@8 @1268
\ No newline at end of file
Index: crypt32.xml
===================================================================
--- crypt32.xml (revision 19323)
+++ crypt32.xml (working copy)
@@ -1,17 +1,20 @@
<module name="crypt32" type="win32dll"
baseaddress="${BASEADDRESS_CRYPT32}" installbase="system32"
installname="crypt32.dll">
- <importlibrary definition="crypt32.def" />
+ <importlibrary definition="crypt32.spec.def" />
<include base="crypt32">.</include>
+ <include base="ReactOS">include/wine</include>
+ <define name="__REACTOS__" />
<define name="__USE_W32API" />
<define name="_WIN32_WINNT">0x501</define>
- <library>pseh</library>
+ <define name="WINVER">0x501</define>
+ <define name="sigsetjmp(a,b)">setjmp(a)</define>
+ <library>wine</library>
<library>ntdll</library>
<library>kernel32</library>
- <library>wine</library>
<library>advapi32</library>
<file>main.c</file>
<file>encode.c</file>
<file>cert.c</file>
<file>protectdata.c</file>
<file>crypt32.rc</file>
- <pch>precomp.h</pch>
+ <file>crypt32.spec</file>
</module>
Index: crypt32_private.h
===================================================================
--- crypt32_private.h (revision 19323)
+++ crypt32_private.h (working copy)
@@ -19,8 +19,6 @@
#ifndef __CRYPT32_PRIVATE_H__
#define __CRYPT32_PRIVATE_H__
-#define STATUS_ACCESS_VIOLATION 0xC0000005
-
/* Returns a handle to the default crypto provider; loads it if necessary.
* Returns NULL on failure.
*/
Index: encode.c
===================================================================
--- encode.c (revision 19323)
+++ encode.c (working copy)
@@ -31,15 +31,24 @@
* MSDN, especially:
*
http://msdn.microsoft.com/library/en-us/seccrypto/security/constants_for_cr…
*/
+#include "config.h"
+#include <assert.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
-#include "precomp.h"
+#define NONAMELESSUNION
-static _SEH_FILTER(page_fault)
-{
- if (_SEH_GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
- return _SEH_EXECUTE_HANDLER;
- return _SEH_CONTINUE_SEARCH;
-}
+#include "windef.h"
+#include "winbase.h"
+#include "excpt.h"
+#include "wincrypt.h"
+#include "winreg.h"
+#include "snmp.h"
+#include "winternl.h"
+#include "ntstatus.h"
+#include "wine/debug.h"
+#include "wine/exception.h"
/* This is a bit arbitrary, but to set some limit: */
#define MAX_ENCODED_LEN 0x02000000
@@ -47,7 +56,9 @@
/* a few asn.1 tags we need */
#define ASN_BOOL (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x01)
#define ASN_BITSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x03)
-//#define ASN_OCTETSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x04)
+#ifndef ASN_OCTETSTRING
+#define ASN_OCTETSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x04)
+#endif
#define ASN_ENUMERATED (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x0a)
#define ASN_SETOF (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x11)
#define ASN_NUMERICSTRING (ASN_UNIVERSAL | ASN_PRIMITIVE | 0x12)
@@ -168,6 +179,14 @@
DWORD cbEncoded, DWORD dwFlags, PCRYPT_DECODE_PARA pDecodePara,
void *pvStructInfo, DWORD *pcbStructInfo);
+/* filter for page-fault exceptions */
+static WINE_EXCEPTION_FILTER(page_fault)
+{
+ if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
+ return EXCEPTION_EXECUTE_HANDLER;
+ return EXCEPTION_CONTINUE_SEARCH;
+}
+
static char *CRYPT_GetKeyName(DWORD dwEncodingType, LPCSTR pszFuncName,
LPCSTR pszOID)
{
@@ -716,7 +735,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
const CERT_PUBLIC_KEY_INFO *info =
(const CERT_PUBLIC_KEY_INFO *)pvStructInfo;
@@ -731,12 +750,12 @@
sizeof(items) / sizeof(items[0]), dwFlags, pEncodePara, pbEncoded,
pcbEncoded);
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -746,7 +765,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
const CERT_SIGNED_CONTENT_INFO *info =
(const CERT_SIGNED_CONTENT_INFO *)pvStructInfo;
@@ -762,12 +781,12 @@
sizeof(items) / sizeof(items[0]), dwFlags, pEncodePara, pbEncoded,
pcbEncoded);
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -781,7 +800,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
const CERT_INFO *info = (const CERT_INFO *)pvStructInfo;
struct AsnEncodeSequenceItem items[10] = {
@@ -831,12 +850,12 @@
ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items, cItem,
dwFlags, pEncodePara, pbEncoded, pcbEncoded);
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -941,7 +960,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
const CRL_INFO *info = (const CRL_INFO *)pvStructInfo;
struct AsnEncodeSequenceItem items[7] = {
@@ -975,12 +994,12 @@
ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items, cItem,
dwFlags, pEncodePara, pbEncoded, pcbEncoded);
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -1019,7 +1038,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
DWORD bytesNeeded, dataLen, lenBytes, i;
const CERT_EXTENSIONS *exts = (const CERT_EXTENSIONS *)pvStructInfo;
@@ -1059,12 +1078,12 @@
}
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -1308,7 +1327,7 @@
BOOL ret;
CRYPT_DER_BLOB *blobs = NULL;
- _SEH_TRY
+ __TRY
{
DWORD bytesNeeded = 0, lenBytes, i;
@@ -1376,12 +1395,12 @@
CryptMemFree(blobs[i].pbData);
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
return FALSE;
}
- _SEH_END
+ __ENDTRY
CryptMemFree(blobs);
return ret;
}
@@ -1392,7 +1411,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
const CERT_NAME_INFO *info = (const CERT_NAME_INFO *)pvStructInfo;
DWORD bytesNeeded = 0, lenBytes, size, i;
@@ -1438,12 +1457,12 @@
}
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -1490,15 +1509,15 @@
case CERT_ALT_NAME_RFC822_NAME:
case CERT_ALT_NAME_DNS_NAME:
case CERT_ALT_NAME_URL:
- if (entry->pwszURL)
+ if (entry->u.pwszURL)
{
DWORD i;
/* Not + 1: don't encode the NULL-terminator */
- dataLen = lstrlenW(entry->pwszURL);
+ dataLen = lstrlenW(entry->u.pwszURL);
for (i = 0; ret && i < dataLen; i++)
{
- if (entry->pwszURL[i] > 0x7f)
+ if (entry->u.pwszURL[i] > 0x7f)
{
SetLastError(CRYPT_E_INVALID_IA5_STRING);
ret = FALSE;
@@ -1510,7 +1529,7 @@
dataLen = 0;
break;
case CERT_ALT_NAME_IP_ADDRESS:
- dataLen = entry->IPAddress.cbData;
+ dataLen = entry->u.IPAddress.cbData;
break;
case CERT_ALT_NAME_REGISTERED_ID:
/* FIXME: encode OID */
@@ -1550,11 +1569,11 @@
DWORD i;
for (i = 0; i < dataLen; i++)
- *pbEncoded++ = (BYTE)entry->pwszURL[i];
+ *pbEncoded++ = (BYTE)entry->u.pwszURL[i];
break;
}
case CERT_ALT_NAME_IP_ADDRESS:
- memcpy(pbEncoded, entry->IPAddress.pbData, dataLen);
+ memcpy(pbEncoded, entry->u.IPAddress.pbData, dataLen);
break;
}
if (ret)
@@ -1571,7 +1590,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
const CERT_ALT_NAME_INFO *info =
(const CERT_ALT_NAME_INFO *)pvStructInfo;
@@ -1635,12 +1654,12 @@
}
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -1650,7 +1669,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
const CERT_BASIC_CONSTRAINTS2_INFO *info =
(const CERT_BASIC_CONSTRAINTS2_INFO *)pvStructInfo;
@@ -1672,12 +1691,12 @@
ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items, cItem,
dwFlags, pEncodePara, pbEncoded, pcbEncoded);
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -1687,7 +1706,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
const BLOBHEADER *hdr =
(const BLOBHEADER *)pvStructInfo;
@@ -1713,12 +1732,12 @@
pcbEncoded);
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -1728,7 +1747,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
const CRYPT_DATA_BLOB *blob = (const CRYPT_DATA_BLOB *)pvStructInfo;
DWORD bytesNeeded, lenBytes;
@@ -1758,12 +1777,12 @@
}
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
TRACE("returning %d (%08lx)\n", ret, GetLastError());
return ret;
}
@@ -1774,7 +1793,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
const CRYPT_BIT_BLOB *blob = (const CRYPT_BIT_BLOB *)pvStructInfo;
DWORD bytesNeeded, lenBytes, dataBytes;
@@ -1829,12 +1848,12 @@
}
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -1844,7 +1863,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
const CRYPT_BIT_BLOB *blob = (const CRYPT_BIT_BLOB *)pvStructInfo;
CRYPT_BIT_BLOB newBlob = { blob->cbData, NULL, blob->cUnusedBits };
@@ -1868,12 +1887,12 @@
&newBlob, dwFlags, pEncodePara, pbEncoded, pcbEncoded);
CryptMemFree(newBlob.pbData);
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -1893,7 +1912,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
DWORD significantBytes, lenBytes;
BYTE padByte = 0, bytesNeeded;
@@ -1967,12 +1986,12 @@
}
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -1982,7 +2001,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
DWORD significantBytes, lenBytes;
BYTE bytesNeeded;
@@ -2038,12 +2057,12 @@
}
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -2074,7 +2093,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
SYSTEMTIME sysTime;
/* sorry, magic number: enough for tag, len, YYMMDDHHMMSSZ\0. I use a
@@ -2117,12 +2136,12 @@
}
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -2132,7 +2151,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
SYSTEMTIME sysTime;
/* sorry, magic number: enough for tag, len, YYYYMMDDHHMMSSZ\0. I use a
@@ -2166,12 +2185,12 @@
}
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -2181,7 +2200,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
SYSTEMTIME sysTime;
@@ -2196,12 +2215,12 @@
lpszStructType, pvStructInfo, dwFlags, pEncodePara, pbEncoded,
pcbEncoded);
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -2211,7 +2230,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
DWORD bytesNeeded, dataLen, lenBytes, i;
const CRYPT_SEQUENCE_OF_ANY *seq =
@@ -2245,12 +2264,12 @@
}
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -2823,7 +2842,7 @@
TRACE("%p, %ld, %08lx, %p, %p, %ld\n", pbEncoded, cbEncoded, dwFlags,
pDecodePara, pvStructInfo, *pcbStructInfo);
- _SEH_TRY
+ __TRY
{
struct AsnDecodeSequenceItem items[] = {
{ offsetof(CERT_SIGNED_CONTENT_INFO, ToBeSigned),
@@ -2844,12 +2863,12 @@
sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags,
pDecodePara, pvStructInfo, pcbStructInfo, NULL);
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -2935,7 +2954,7 @@
TRACE("%p, %ld, %08lx, %p, %p, %ld\n", pbEncoded, cbEncoded, dwFlags,
pDecodePara, pvStructInfo, *pcbStructInfo);
- _SEH_TRY
+ __TRY
{
struct AsnDecodeSequenceItem items[] = {
{ offsetof(CERT_INFO, dwVersion), CRYPT_AsnDecodeCertVersion,
@@ -2972,12 +2991,12 @@
sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags,
pDecodePara, pvStructInfo, pcbStructInfo, NULL);
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -3124,7 +3143,7 @@
TRACE("%p, %ld, %08lx, %p, %p, %ld\n", pbEncoded, cbEncoded, dwFlags,
pDecodePara, pvStructInfo, *pcbStructInfo);
- _SEH_TRY
+ __TRY
{
struct AsnDecodeSequenceItem items[] = {
{ offsetof(CRL_INFO, dwVersion), CRYPT_AsnDecodeCertVersion,
@@ -3152,12 +3171,12 @@
sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags,
pDecodePara, pvStructInfo, pcbStructInfo, NULL);
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
TRACE("Returning %d (%08lx)\n", ret, GetLastError());
return ret;
@@ -3323,7 +3342,7 @@
{
BOOL ret = TRUE;
- _SEH_TRY
+ __TRY
{
ret = CRYPT_AsnDecodeExtensionsInternal(dwCertEncodingType,
lpszStructType, pbEncoded, cbEncoded,
@@ -3348,12 +3367,12 @@
}
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -3366,7 +3385,7 @@
TRACE("%p, %ld, %08lx, %p, %ld\n", pbEncoded, cbEncoded, dwFlags,
pszObjId,
*pcbObjId);
- _SEH_TRY
+ __TRY
{
if (pbEncoded[0] == ASN_OBJECTIDENTIFIER)
{
@@ -3463,12 +3482,12 @@
ret = FALSE;
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -3481,7 +3500,7 @@
{
BOOL ret = TRUE;
- _SEH_TRY
+ __TRY
{
DWORD dataLen;
@@ -3565,12 +3584,12 @@
}
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -3582,7 +3601,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
if (pbEncoded[0] == (ASN_CONSTRUCTOR | ASN_SEQUENCE))
{
@@ -3694,12 +3713,12 @@
ret = FALSE;
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -3708,7 +3727,7 @@
{
BOOL ret = TRUE;
- _SEH_TRY
+ __TRY
{
if (pbEncoded[0] == (ASN_CONSTRUCTOR | ASN_SETOF))
{
@@ -3809,12 +3828,12 @@
ret = FALSE;
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -3824,7 +3843,7 @@
{
BOOL ret = TRUE;
- _SEH_TRY
+ __TRY
{
if (pbEncoded[0] == (ASN_CONSTRUCTOR | ASN_SEQUENCEOF))
{
@@ -3919,12 +3938,12 @@
ret = FALSE;
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -4001,7 +4020,7 @@
{
BOOL ret = TRUE;
- _SEH_TRY
+ __TRY
{
struct AsnDecodeSequenceItem items[] = {
{ offsetof(CERT_PUBLIC_KEY_INFO, Algorithm),
@@ -4017,12 +4036,12 @@
sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags,
pDecodePara, pvStructInfo, pcbStructInfo, NULL);
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -4145,18 +4164,18 @@
DWORD i;
for (i = 0; i < dataLen; i++)
- entry->pwszURL[i] =
+ entry->u.pwszURL[i] =
(WCHAR)pbEncoded[1 + lenBytes + i];
- entry->pwszURL[i] = 0;
+ entry->u.pwszURL[i] = 0;
break;
}
case 7: /* iPAddress */
/* The next data pointer is in the pwszURL spot, that is,
* the first 4 bytes. Need to move it to the next spot.
*/
- entry->IPAddress.pbData = (LPBYTE)entry->pwszURL;
- entry->IPAddress.cbData = dataLen;
- memcpy(entry->IPAddress.pbData, pbEncoded + 1 + lenBytes,
+ entry->u.IPAddress.pbData = (LPBYTE)entry->u.pwszURL;
+ entry->u.IPAddress.cbData = dataLen;
+ memcpy(entry->u.IPAddress.pbData, pbEncoded + 1 + lenBytes,
dataLen);
break;
}
@@ -4172,7 +4191,7 @@
{
BOOL ret = TRUE;
- _SEH_TRY
+ __TRY
{
if (pbEncoded[0] == ASN_SEQUENCEOF)
{
@@ -4238,7 +4257,7 @@
i < cEntry && ptr - pbEncoded - 1 - lenBytes
<
dataLen; i++)
{
- info->rgAltEntry[i].pwszURL =
+ info->rgAltEntry[i].u.pwszURL =
(LPWSTR)nextData;
size = bytesNeeded;
ret = CRYPT_AsnDecodeAltNameEntry(ptr,
@@ -4270,12 +4289,12 @@
ret = FALSE;
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -4336,7 +4355,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
struct AsnDecodeSequenceItem items[] = {
{ offsetof(CERT_BASIC_CONSTRAINTS2_INFO, fCA), CRYPT_AsnDecodeBool,
@@ -4350,12 +4369,12 @@
sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags,
pDecodePara, pvStructInfo, pcbStructInfo, NULL);
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -4373,7 +4392,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
struct AsnDecodeSequenceItem items[] = {
{ offsetof(struct DECODED_RSA_PUB_KEY, modulus),
@@ -4424,12 +4443,12 @@
LocalFree(decodedKey);
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -4496,7 +4515,7 @@
TRACE("%p, %ld, %08lx, %p, %p, %ld\n", pbEncoded, cbEncoded, dwFlags,
pDecodePara, pvStructInfo, *pcbStructInfo);
- _SEH_TRY
+ __TRY
{
DWORD bytesNeeded;
@@ -4527,12 +4546,12 @@
ret = FALSE;
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -4609,7 +4628,7 @@
TRACE("(%p, %ld, 0x%08lx, %p, %p, %p)\n", pbEncoded, cbEncoded, dwFlags,
pDecodePara, pvStructInfo, pcbStructInfo);
- _SEH_TRY
+ __TRY
{
DWORD bytesNeeded;
@@ -4635,12 +4654,12 @@
}
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
TRACE("returning %d (%08lx)\n", ret, GetLastError());
return ret;
}
@@ -4656,7 +4675,7 @@
*pcbStructInfo = sizeof(int);
return TRUE;
}
- _SEH_TRY
+ __TRY
{
BYTE buf[sizeof(CRYPT_INTEGER_BLOB) + sizeof(int)];
CRYPT_INTEGER_BLOB *blob = (CRYPT_INTEGER_BLOB *)buf;
@@ -4692,12 +4711,12 @@
else if (GetLastError() == ERROR_MORE_DATA)
SetLastError(CRYPT_E_ASN1_LARGE);
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -4757,7 +4776,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
DWORD bytesNeeded;
@@ -4784,12 +4803,12 @@
}
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -4856,7 +4875,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
DWORD bytesNeeded;
@@ -4883,12 +4902,12 @@
}
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -4903,7 +4922,7 @@
*pcbStructInfo = sizeof(int);
return TRUE;
}
- _SEH_TRY
+ __TRY
{
if (pbEncoded[0] == ASN_ENUMERATED)
{
@@ -4951,12 +4970,12 @@
ret = FALSE;
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -4988,7 +5007,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
ret = TRUE;
if (len >= 3 && (*pbEncoded == '+' || *pbEncoded ==
'-'))
@@ -5039,12 +5058,12 @@
}
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -5061,7 +5080,7 @@
*pcbStructInfo = sizeof(FILETIME);
return TRUE;
}
- _SEH_TRY
+ __TRY
{
ret = TRUE;
if (pbEncoded[0] == ASN_UTCTIME)
@@ -5130,12 +5149,12 @@
ret = FALSE;
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -5150,7 +5169,7 @@
*pcbStructInfo = sizeof(FILETIME);
return TRUE;
}
- _SEH_TRY
+ __TRY
{
ret = TRUE;
if (pbEncoded[0] == ASN_GENERALTIME)
@@ -5225,12 +5244,12 @@
ret = FALSE;
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -5240,7 +5259,7 @@
{
BOOL ret;
- _SEH_TRY
+ __TRY
{
if (pbEncoded[0] == ASN_UTCTIME)
ret = CRYPT_AsnDecodeUtcTime(dwCertEncodingType, lpszStructType,
@@ -5256,12 +5275,12 @@
ret = FALSE;
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
@@ -5271,7 +5290,7 @@
{
BOOL ret = TRUE;
- _SEH_TRY
+ __TRY
{
if (pbEncoded[0] == ASN_SEQUENCEOF)
{
@@ -5359,12 +5378,12 @@
return FALSE;
}
}
- _SEH_EXCEPT(page_fault)
+ __EXCEPT(page_fault)
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
- _SEH_END
+ __ENDTRY
return ret;
}
Index: main.c
===================================================================
--- main.c (revision 19323)
+++ main.c (working copy)
@@ -17,54 +17,23 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "precomp.h"
+#include "config.h"
+#include <stdarg.h>
+#include <stdio.h>
+#include "windef.h"
+#include "winbase.h"
+#include "wincrypt.h"
+#include "winreg.h"
+#include "winnls.h"
+#include "mssip.h"
+#include "crypt32_private.h"
+#include "wine/debug.h"
+
WINE_DEFAULT_DEBUG_CHANNEL(crypt);
static HCRYPTPROV hDefProv;
-struct OIDToAlgID
-{
- LPCSTR oid;
- DWORD algID;
-};
-
-static const struct OIDToAlgID oidToAlgID[] = {
- { szOID_RSA_RSA, CALG_RSA_KEYX },
- { szOID_RSA_MD2RSA, CALG_MD2 },
- { szOID_RSA_MD4RSA, CALG_MD4 },
- { szOID_RSA_MD5RSA, CALG_MD5 },
- { szOID_RSA_SHA1RSA, CALG_SHA },
- { szOID_RSA_DH, CALG_DH_SF },
- { szOID_RSA_SMIMEalgESDH, CALG_DH_EPHEM },
- { szOID_RSA_SMIMEalgCMS3DESwrap, CALG_3DES },
- { szOID_RSA_SMIMEalgCMSRC2wrap, CALG_RC2 },
- { szOID_RSA_MD2, CALG_MD2 },
- { szOID_RSA_MD4, CALG_MD4 },
- { szOID_RSA_MD5, CALG_MD5 },
- { szOID_RSA_RC2CBC, CALG_RC2 },
- { szOID_RSA_RC4, CALG_RC4 },
- { szOID_RSA_DES_EDE3_CBC, CALG_3DES },
- { szOID_ANSI_X942_DH, CALG_DH_SF },
- { szOID_X957_DSA, CALG_DSS_SIGN },
- { szOID_X957_SHA1DSA, CALG_SHA },
- { szOID_OIWSEC_md4RSA, CALG_MD4 },
- { szOID_OIWSEC_md5RSA, CALG_MD5 },
- { szOID_OIWSEC_md4RSA2, CALG_MD4 },
- { szOID_OIWSEC_desCBC, CALG_DES },
- { szOID_OIWSEC_dsa, CALG_DSS_SIGN },
- { szOID_OIWSEC_shaDSA, CALG_SHA },
- { szOID_OIWSEC_shaRSA, CALG_SHA },
- { szOID_OIWSEC_sha, CALG_SHA },
- { szOID_OIWSEC_rsaXchg, CALG_RSA_KEYX },
- { szOID_OIWSEC_sha1, CALG_SHA },
- { szOID_OIWSEC_dsaSHA1, CALG_SHA },
- { szOID_OIWSEC_sha1RSASign, CALG_SHA },
- { szOID_OIWDIR_md2RSA, CALG_MD2 },
- { szOID_INFOSEC_mosaicUpdatedSig, CALG_SHA },
- { szOID_INFOSEC_mosaicKMandUpdSig, CALG_DSS_SIGN },
-};
-
BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD fdwReason, PVOID pvReserved)
{
switch (fdwReason)
@@ -246,6 +215,48 @@
return FALSE;
}
+struct OIDToAlgID
+{
+ LPCSTR oid;
+ DWORD algID;
+};
+
+static const struct OIDToAlgID oidToAlgID[] = {
+ { szOID_RSA_RSA, CALG_RSA_KEYX },
+ { szOID_RSA_MD2RSA, CALG_MD2 },
+ { szOID_RSA_MD4RSA, CALG_MD4 },
+ { szOID_RSA_MD5RSA, CALG_MD5 },
+ { szOID_RSA_SHA1RSA, CALG_SHA },
+ { szOID_RSA_DH, CALG_DH_SF },
+ { szOID_RSA_SMIMEalgESDH, CALG_DH_EPHEM },
+ { szOID_RSA_SMIMEalgCMS3DESwrap, CALG_3DES },
+ { szOID_RSA_SMIMEalgCMSRC2wrap, CALG_RC2 },
+ { szOID_RSA_MD2, CALG_MD2 },
+ { szOID_RSA_MD4, CALG_MD4 },
+ { szOID_RSA_MD5, CALG_MD5 },
+ { szOID_RSA_RC2CBC, CALG_RC2 },
+ { szOID_RSA_RC4, CALG_RC4 },
+ { szOID_RSA_DES_EDE3_CBC, CALG_3DES },
+ { szOID_ANSI_X942_DH, CALG_DH_SF },
+ { szOID_X957_DSA, CALG_DSS_SIGN },
+ { szOID_X957_SHA1DSA, CALG_SHA },
+ { szOID_OIWSEC_md4RSA, CALG_MD4 },
+ { szOID_OIWSEC_md5RSA, CALG_MD5 },
+ { szOID_OIWSEC_md4RSA2, CALG_MD4 },
+ { szOID_OIWSEC_desCBC, CALG_DES },
+ { szOID_OIWSEC_dsa, CALG_DSS_SIGN },
+ { szOID_OIWSEC_shaDSA, CALG_SHA },
+ { szOID_OIWSEC_shaRSA, CALG_SHA },
+ { szOID_OIWSEC_sha, CALG_SHA },
+ { szOID_OIWSEC_rsaXchg, CALG_RSA_KEYX },
+ { szOID_OIWSEC_sha1, CALG_SHA },
+ { szOID_OIWSEC_dsaSHA1, CALG_SHA },
+ { szOID_OIWSEC_sha1RSASign, CALG_SHA },
+ { szOID_OIWDIR_md2RSA, CALG_MD2 },
+ { szOID_INFOSEC_mosaicUpdatedSig, CALG_SHA },
+ { szOID_INFOSEC_mosaicKMandUpdSig, CALG_DSS_SIGN },
+};
+
LPCSTR WINAPI CertAlgIdToOID(DWORD dwAlgId)
{
switch (dwAlgId)
@@ -319,8 +330,7 @@
LPVOID ret;
ret = TlsGetValue(dwTlsIndex);
-
- TlsSetValue(dwTlsIndex, NULL);
+ TlsSetValue(dwTlsIndex, NULL);
return ret;
}
Index: precomp.h
===================================================================
--- precomp.h (revision 19323)
+++ precomp.h (working copy)
@@ -1,21 +0,0 @@
-#include "config.h"
-
-#include <assert.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <libs/pseh/pseh.h>
-
-#include "windef.h"
-#include "winnt.h"
-#include "winbase.h"
-#include "wincrypt.h"
-#include "winreg.h"
-#include "snmp.h"
-#include "winnls.h"
-#include "mssip.h"
-#include "crypt32_private.h"
-#include "wine/debug.h"
-#include "wine/list.h"
-
Index: protectdata.c
===================================================================
--- protectdata.c (revision 19323)
+++ protectdata.c (working copy)
@@ -34,8 +34,17 @@
*
*/
-#include "precomp.h"
+#include <stdarg.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include "windef.h"
+#include "winbase.h"
+#include "wincrypt.h"
+#include "winreg.h"
+#include "wine/debug.h"
+
WINE_DEFAULT_DEBUG_CHANNEL(crypt);
#define CRYPT32_PROTECTDATA_PROV PROV_RSA_FULL