Take advantage of the __EXCEPT_PAGE_FAULT macro.

This commit is contained in:
Alexandre Julliard 2005-12-16 17:17:57 +01:00
parent 324d86a3af
commit ae964ac801
23 changed files with 92 additions and 261 deletions

View File

@ -313,14 +313,6 @@ static BOOL WINAPI CRYPT_SetCertificateContextProperty(
static const void * WINAPI CRYPT_ReadSerializedElement(const BYTE *pbElement,
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)
{
@ -2787,7 +2779,7 @@ static const void * WINAPI CRYPT_ReadSerializedElement(const BYTE *pbElement,
}
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
context = NULL;

View File

@ -172,14 +172,6 @@ static BOOL WINAPI CRYPT_AsnDecodeUnsignedIntegerInternal(
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;
}
BOOL WINAPI CryptEncodeObject(DWORD dwCertEncodingType, LPCSTR lpszStructType,
const void *pvStructInfo, BYTE *pbEncoded, DWORD *pcbEncoded)
{
@ -538,7 +530,7 @@ static BOOL WINAPI CRYPT_AsnEncodePubKeyInfo(DWORD dwCertEncodingType,
sizeof(items) / sizeof(items[0]), dwFlags, pEncodePara, pbEncoded,
pcbEncoded);
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -569,7 +561,7 @@ static BOOL WINAPI CRYPT_AsnEncodeCert(DWORD dwCertEncodingType,
sizeof(items) / sizeof(items[0]), dwFlags, pEncodePara, pbEncoded,
pcbEncoded);
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -638,7 +630,7 @@ static BOOL WINAPI CRYPT_AsnEncodeCertInfo(DWORD dwCertEncodingType,
ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items, cItem,
dwFlags, pEncodePara, pbEncoded, pcbEncoded);
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -782,7 +774,7 @@ static BOOL WINAPI CRYPT_AsnEncodeCRLInfo(DWORD dwCertEncodingType,
ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items, cItem,
dwFlags, pEncodePara, pbEncoded, pcbEncoded);
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -866,7 +858,7 @@ static BOOL WINAPI CRYPT_AsnEncodeExtensions(DWORD dwCertEncodingType,
}
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -1183,7 +1175,7 @@ static BOOL WINAPI CRYPT_AsnEncodeRdn(DWORD dwCertEncodingType, CERT_RDN *rdn,
CryptMemFree(blobs[i].pbData);
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -1245,7 +1237,7 @@ static BOOL WINAPI CRYPT_AsnEncodeName(DWORD dwCertEncodingType,
}
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -1441,7 +1433,7 @@ static BOOL WINAPI CRYPT_AsnEncodeAltName(DWORD dwCertEncodingType,
}
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -1478,7 +1470,7 @@ static BOOL WINAPI CRYPT_AsnEncodeBasicConstraints2(DWORD dwCertEncodingType,
ret = CRYPT_AsnEncodeSequence(dwCertEncodingType, items, cItem,
dwFlags, pEncodePara, pbEncoded, pcbEncoded);
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -1519,7 +1511,7 @@ static BOOL WINAPI CRYPT_AsnEncodeRsaPubKey(DWORD dwCertEncodingType,
pcbEncoded);
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -1564,7 +1556,7 @@ static BOOL WINAPI CRYPT_AsnEncodeOctets(DWORD dwCertEncodingType,
}
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -1635,7 +1627,7 @@ static BOOL WINAPI CRYPT_AsnEncodeBits(DWORD dwCertEncodingType,
}
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -1674,7 +1666,7 @@ static BOOL WINAPI CRYPT_AsnEncodeBitsSwapBytes(DWORD dwCertEncodingType,
&newBlob, dwFlags, pEncodePara, pbEncoded, pcbEncoded);
CryptMemFree(newBlob.pbData);
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -1773,7 +1765,7 @@ static BOOL WINAPI CRYPT_AsnEncodeInteger(DWORD dwCertEncodingType,
}
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -1844,7 +1836,7 @@ static BOOL WINAPI CRYPT_AsnEncodeUnsignedInteger(DWORD dwCertEncodingType,
}
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -1923,7 +1915,7 @@ static BOOL WINAPI CRYPT_AsnEncodeUtcTime(DWORD dwCertEncodingType,
}
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -1972,7 +1964,7 @@ static BOOL WINAPI CRYPT_AsnEncodeGeneralizedTime(DWORD dwCertEncodingType,
}
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -2002,7 +1994,7 @@ static BOOL WINAPI CRYPT_AsnEncodeChoiceOfTime(DWORD dwCertEncodingType,
lpszStructType, pvStructInfo, dwFlags, pEncodePara, pbEncoded,
pcbEncoded);
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -2051,7 +2043,7 @@ static BOOL WINAPI CRYPT_AsnEncodeSequenceOfAny(DWORD dwCertEncodingType,
}
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -2190,7 +2182,7 @@ static BOOL WINAPI CRYPT_AsnEncodeCRLDistPoints(DWORD dwCertEncodingType,
}
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -2976,7 +2968,7 @@ static BOOL WINAPI CRYPT_AsnDecodeCert(DWORD dwCertEncodingType,
sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags,
pDecodePara, pvStructInfo, pcbStructInfo, NULL);
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -3093,7 +3085,7 @@ static BOOL WINAPI CRYPT_AsnDecodeCertInfo(DWORD dwCertEncodingType,
sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags,
pDecodePara, pvStructInfo, pcbStructInfo, NULL);
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -3188,7 +3180,7 @@ static BOOL WINAPI CRYPT_AsnDecodeCRLInfo(DWORD dwCertEncodingType,
sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags,
pDecodePara, pvStructInfo, pcbStructInfo, NULL);
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -3307,7 +3299,7 @@ static BOOL WINAPI CRYPT_AsnDecodeExtensions(DWORD dwCertEncodingType,
}
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -3422,7 +3414,7 @@ static BOOL WINAPI CRYPT_AsnDecodeOid(const BYTE *pbEncoded, DWORD cbEncoded,
ret = FALSE;
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -3526,7 +3518,7 @@ static BOOL WINAPI CRYPT_AsnDecodeNameValue(DWORD dwCertEncodingType,
}
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -3566,7 +3558,7 @@ static BOOL WINAPI CRYPT_AsnDecodeRdnAttr(DWORD dwCertEncodingType,
debugstr_a(attr->pszObjId));
TRACE("returning %d (%08lx)\n", ret, GetLastError());
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -3590,7 +3582,7 @@ static BOOL WINAPI CRYPT_AsnDecodeRdn(DWORD dwCertEncodingType,
ret = CRYPT_AsnDecodeArray(&arrayDesc, pbEncoded, cbEncoded, dwFlags,
pDecodePara, pvStructInfo, pcbStructInfo, NULL);
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -3614,7 +3606,7 @@ static BOOL WINAPI CRYPT_AsnDecodeName(DWORD dwCertEncodingType,
ret = CRYPT_AsnDecodeArray(&arrayDesc, pbEncoded, cbEncoded, dwFlags,
pDecodePara, pvStructInfo, pcbStructInfo, NULL);
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -3712,7 +3704,7 @@ static BOOL WINAPI CRYPT_AsnDecodePubKeyInfo(DWORD dwCertEncodingType,
sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags,
pDecodePara, pvStructInfo, pcbStructInfo, NULL);
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -3903,7 +3895,7 @@ static BOOL WINAPI CRYPT_AsnDecodeAltName(DWORD dwCertEncodingType,
ret = CRYPT_AsnDecodeArray(&arrayDesc, pbEncoded, cbEncoded, dwFlags,
pDecodePara, pvStructInfo, pcbStructInfo, NULL);
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -3986,7 +3978,7 @@ static BOOL WINAPI CRYPT_AsnDecodeBasicConstraints2(DWORD dwCertEncodingType,
sizeof(items) / sizeof(items[0]), pbEncoded, cbEncoded, dwFlags,
pDecodePara, pvStructInfo, pcbStructInfo, NULL);
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -4060,7 +4052,7 @@ static BOOL WINAPI CRYPT_AsnDecodeRsaPubKey(DWORD dwCertEncodingType,
LocalFree(decodedKey);
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -4159,7 +4151,7 @@ static BOOL WINAPI CRYPT_AsnDecodeOctets(DWORD dwCertEncodingType,
}
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -4267,7 +4259,7 @@ static BOOL WINAPI CRYPT_AsnDecodeBits(DWORD dwCertEncodingType,
}
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -4324,7 +4316,7 @@ static BOOL WINAPI CRYPT_AsnDecodeInt(DWORD dwCertEncodingType,
else if (GetLastError() == ERROR_MORE_DATA)
SetLastError(CRYPT_E_ASN1_LARGE);
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -4416,7 +4408,7 @@ static BOOL WINAPI CRYPT_AsnDecodeInteger(DWORD dwCertEncodingType,
}
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -4515,7 +4507,7 @@ static BOOL WINAPI CRYPT_AsnDecodeUnsignedInteger(DWORD dwCertEncodingType,
}
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -4583,7 +4575,7 @@ static BOOL WINAPI CRYPT_AsnDecodeEnumerated(DWORD dwCertEncodingType,
ret = FALSE;
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -4671,7 +4663,7 @@ static BOOL CRYPT_AsnDecodeTimeZone(const BYTE *pbEncoded, DWORD len,
}
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -4762,7 +4754,7 @@ static BOOL WINAPI CRYPT_AsnDecodeUtcTime(DWORD dwCertEncodingType,
ret = FALSE;
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -4857,7 +4849,7 @@ static BOOL WINAPI CRYPT_AsnDecodeGeneralizedTime(DWORD dwCertEncodingType,
ret = FALSE;
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -4888,7 +4880,7 @@ static BOOL WINAPI CRYPT_AsnDecodeChoiceOfTime(DWORD dwCertEncodingType,
ret = FALSE;
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -4991,7 +4983,7 @@ static BOOL WINAPI CRYPT_AsnDecodeSequenceOfAny(DWORD dwCertEncodingType,
return FALSE;
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
@ -5042,7 +5034,7 @@ static BOOL WINAPI CRYPT_AsnDecodeCRLDistPoints(DWORD dwCertEncodingType,
ret = CRYPT_AsnDecodeArray(&arrayDesc, pbEncoded, cbEncoded, dwFlags,
pDecodePara, pvStructInfo, pcbStructInfo, NULL);
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;

View File

@ -66,13 +66,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(dbghelp_msc);
* Debug file access helper routines
*/
static WINE_EXCEPTION_FILTER(page_fault)
{
if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
return EXCEPTION_EXECUTE_HANDLER;
return EXCEPTION_CONTINUE_SEARCH;
}
static void dump(const void* ptr, unsigned len)
{
int i, j;
@ -2334,7 +2327,7 @@ typedef struct _FPO_DATA
#endif
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
ERR("Got a page fault while loading symbols\n");
ret = FALSE;

View File

@ -64,14 +64,6 @@ void (*wine_tsx11_unlock_ptr)(void) = NULL;
WINE_DEFAULT_DEBUG_CHANNEL(ddraw);
/* filter for page-fault exceptions */
static WINE_EXCEPTION_FILTER(page_fault)
{
if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
return EXCEPTION_EXECUTE_HANDLER;
return EXCEPTION_CONTINUE_SEARCH;
}
/**********************************************************************/
typedef struct {
@ -221,7 +213,7 @@ HRESULT WINAPI DirectDrawEnumerateExA(
lpContext, 0))
stop = TRUE;
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
return E_INVALIDARG;
}

View File

@ -45,14 +45,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(atom);
#define MAX_ATOM_LEN 255
/* filter for page-fault exceptions */
static WINE_EXCEPTION_FILTER(page_fault)
{
if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
return EXCEPTION_EXECUTE_HANDLER;
return EXCEPTION_CONTINUE_SEARCH;
}
/******************************************************************
* get_local_table
*
@ -143,7 +135,7 @@ ATOM WINAPI GlobalAddAtomA( LPCSTR str /* [in] String to add */ )
}
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError( ERROR_INVALID_PARAMETER );
atom = 0;

View File

@ -63,14 +63,6 @@ static const char default_ComputerName[] = "WINE";
#define IS_OPTION_TRUE(ch) ((ch) == 'y' || (ch) == 'Y' || (ch) == 't' || (ch) == 'T' || (ch) == '1')
/* filter for page-fault exceptions */
static WINE_EXCEPTION_FILTER(page_fault)
{
if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
return EXCEPTION_EXECUTE_HANDLER;
return EXCEPTION_CONTINUE_SEARCH;
}
/***********************************************************************
* dns_gethostbyname (INTERNAL)
*
@ -359,7 +351,7 @@ BOOL WINAPI GetComputerNameW(LPWSTR name,LPDWORD size)
st = STATUS_SUCCESS;
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
st = STATUS_INVALID_PARAMETER;
}
@ -410,7 +402,7 @@ BOOL WINAPI GetComputerNameA(LPSTR name, LPDWORD size)
ret = TRUE;
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError( ERROR_INVALID_PARAMETER );
ret = FALSE;
@ -471,7 +463,7 @@ BOOL WINAPI GetComputerNameExA(COMPUTER_NAME_FORMAT type, LPSTR name, LPDWORD si
ret = TRUE;
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
@ -536,7 +528,7 @@ BOOL WINAPI GetComputerNameExW( COMPUTER_NAME_FORMAT type, LPWSTR name, LPDWORD
ret = TRUE;
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;

View File

@ -72,13 +72,6 @@ typedef struct
static BOOL oem_file_apis;
static WINE_EXCEPTION_FILTER(page_fault)
{
if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
return EXCEPTION_EXECUTE_HANDLER;
return EXCEPTION_CONTINUE_SEARCH;
}
/***********************************************************************
* create_file_OF
@ -1724,7 +1717,7 @@ BOOL WINAPI FindClose( HANDLE handle )
}
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
WARN("Illegal handle %p\n", handle);
SetLastError( ERROR_INVALID_HANDLE );

View File

@ -70,18 +70,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(heap);
static HANDLE systemHeap; /* globally shared heap */
/* filter for page-fault exceptions */
static WINE_EXCEPTION_FILTER(page_fault)
{
switch (GetExceptionCode()) {
case (EXCEPTION_ACCESS_VIOLATION):
return EXCEPTION_EXECUTE_HANDLER;
default:
return EXCEPTION_CONTINUE_SEARCH;
}
}
/***********************************************************************
* HEAP_CreateSystemHeap
*
@ -436,7 +424,7 @@ LPVOID WINAPI GlobalLock(
SetLastError(ERROR_INVALID_HANDLE);
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
WARN("page fault on %p\n", hmem);
palloc = NULL;
@ -484,7 +472,7 @@ BOOL WINAPI GlobalUnlock(
locked=FALSE;
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
ERR("page fault occurred ! Caused by bug ?\n");
SetLastError( ERROR_INVALID_PARAMETER );
@ -546,7 +534,7 @@ HGLOBAL WINAPI GlobalHandle(
handle = 0;
SetLastError( ERROR_INVALID_HANDLE );
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError( ERROR_INVALID_HANDLE );
handle = 0;
@ -717,7 +705,7 @@ HGLOBAL WINAPI GlobalFree(
}
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
ERR("page fault occurred ! Caused by bug ?\n");
SetLastError( ERROR_INVALID_PARAMETER );

View File

@ -90,14 +90,6 @@ static HINSTANCE16 MODULE_LoadModule16( LPCSTR libname, BOOL implicit, BOOL lib_
static HMODULE16 NE_GetModuleByFilename( LPCSTR name );
static WINE_EXCEPTION_FILTER(page_fault)
{
if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
return EXCEPTION_EXECUTE_HANDLER;
return EXCEPTION_CONTINUE_SEARCH;
}
/* patch all the flat cs references of the code segment if necessary */
inline static void patch_code_segment( NE_MODULE *pModule )
{
@ -1373,7 +1365,7 @@ static BOOL16 MODULE_CallWEP( HMODULE16 hModule )
WOWCallback16Ex( (DWORD)WEP, WCB16_PASCAL, sizeof(args), args, &dwRet );
ret = LOWORD(dwRet);
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
WARN("Page fault\n");
ret = 0;

View File

@ -48,13 +48,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(resource);
#define HGLOBAL_16(h32) (LOWORD(h32))
#define HMODULE_16(h32) (LOWORD(h32))
static WINE_EXCEPTION_FILTER(page_fault)
{
if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
return EXCEPTION_EXECUTE_HANDLER;
return EXCEPTION_CONTINUE_SEARCH;
}
/* retrieve the resource name to pass to the ntdll functions */
static NTSTATUS get_res_nameA( LPCSTR name, UNICODE_STRING *str )
{
@ -121,7 +114,7 @@ static BOOL get_res_name_type_WtoA( LPCWSTR name, LPCWSTR type, LPSTR *nameA, LP
}
else *typeA = (LPSTR)type;
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
if (HIWORD(*nameA)) HeapFree( GetProcessHeap(), 0, *nameA );
if (HIWORD(*typeA)) HeapFree( GetProcessHeap(), 0, *typeA );
@ -151,7 +144,7 @@ static HRSRC find_resourceA( HMODULE hModule, LPCSTR type, LPCSTR name, WORD lan
done:
if (status != STATUS_SUCCESS) SetLastError( RtlNtStatusToDosError(status) );
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError( ERROR_INVALID_PARAMETER );
}
@ -184,7 +177,7 @@ static HRSRC find_resourceW( HMODULE hModule, LPCWSTR type, LPCWSTR name, WORD l
done:
if (status != STATUS_SUCCESS) SetLastError( RtlNtStatusToDosError(status) );
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError( ERROR_INVALID_PARAMETER );
}

View File

@ -39,14 +39,6 @@
static INT (WINAPI *pLoadStringA)(HINSTANCE, UINT, LPSTR, INT);
static INT (WINAPI *pwvsprintfA)(LPSTR, LPCSTR, va_list);
/* filter for page-fault exceptions */
static WINE_EXCEPTION_FILTER(page_fault)
{
if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
return EXCEPTION_EXECUTE_HANDLER;
return EXCEPTION_CONTINUE_SEARCH;
}
/***********************************************************************
* Helper for k32 family functions
@ -179,7 +171,7 @@ LPSTR WINAPI lstrcatA( LPSTR dst, LPCSTR src )
{
strcat( dst, src );
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError( ERROR_INVALID_PARAMETER );
return NULL;
@ -198,7 +190,7 @@ LPWSTR WINAPI lstrcatW( LPWSTR dst, LPCWSTR src )
{
strcatW( dst, src );
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError( ERROR_INVALID_PARAMETER );
return NULL;
@ -244,7 +236,7 @@ LPSTR WINAPI lstrcpyA( LPSTR dst, LPCSTR src )
/* this is how Windows does it */
memmove( dst, src, strlen(src)+1 );
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError( ERROR_INVALID_PARAMETER );
return NULL;
@ -263,7 +255,7 @@ LPWSTR WINAPI lstrcpyW( LPWSTR dst, LPCWSTR src )
{
strcpyW( dst, src );
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError( ERROR_INVALID_PARAMETER );
return NULL;
@ -308,7 +300,7 @@ LPSTR WINAPI lstrcpynA( LPSTR dst, LPCSTR src, INT n )
}
if (count) *d = 0;
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError( ERROR_INVALID_PARAMETER );
return 0;
@ -342,7 +334,7 @@ LPWSTR WINAPI lstrcpynW( LPWSTR dst, LPCWSTR src, INT n )
}
if (count) *d = 0;
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError( ERROR_INVALID_PARAMETER );
return 0;
@ -372,7 +364,7 @@ INT WINAPI lstrlenA( LPCSTR str )
{
ret = strlen(str);
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError( ERROR_INVALID_PARAMETER );
return 0;
@ -392,7 +384,7 @@ INT WINAPI lstrlenW( LPCWSTR str )
{
ret = strlenW(str);
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError( ERROR_INVALID_PARAMETER );
return 0;

View File

@ -50,14 +50,6 @@ WINE_DECLARE_DEBUG_CHANNEL(seh);
static unsigned int page_size;
/* filter for page-fault exceptions */
static WINE_EXCEPTION_FILTER(page_fault)
{
if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
return EXCEPTION_EXECUTE_HANDLER;
return EXCEPTION_CONTINUE_SEARCH;
}
/***********************************************************************
* VirtualAlloc (KERNEL32.@)
@ -557,7 +549,7 @@ BOOL WINAPI IsBadReadPtr(
dummy = p[0];
dummy = p[count - 1];
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
TRACE_(seh)("%p caused page fault during read\n", ptr);
return TRUE;
@ -598,7 +590,7 @@ BOOL WINAPI IsBadWritePtr(
p[0] |= 0;
p[count - 1] |= 0;
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
TRACE_(seh)("%p caused page fault during write\n", ptr);
return TRUE;
@ -677,7 +669,7 @@ BOOL WINAPI IsBadStringPtrA(
volatile const char *p = str;
while (p != str + max) if (!*p++) break;
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
TRACE_(seh)("%p caused page fault during read\n", str);
return TRUE;
@ -700,7 +692,7 @@ BOOL WINAPI IsBadStringPtrW( LPCWSTR str, UINT max )
volatile const WCHAR *p = str;
while (p != str + max) if (!*p++) break;
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
TRACE_(seh)("%p caused page fault during read\n", str);
return TRUE;

View File

@ -127,14 +127,6 @@ static void dump_obj_locator( const rtti_object_locator *ptr )
}
}
/* filter for page-fault exceptions */
static WINE_EXCEPTION_FILTER(page_fault)
{
if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
return EXCEPTION_EXECUTE_HANDLER;
return EXCEPTION_CONTINUE_SEARCH;
}
/* Internal common ctor for exception */
static void WINAPI EXCEPTION_ctor(exception *_this, const char** name)
{
@ -1065,7 +1057,7 @@ const type_info* MSVCRT___RTtypeid(void *cppobj)
const rtti_object_locator *obj_locator = get_obj_locator( cppobj );
ret = obj_locator->type_descriptor;
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
__non_rtti_object e;
MSVCRT___non_rtti_object_ctor( &e, "Bad read pointer - no RTTI data!" );
@ -1150,7 +1142,7 @@ void* MSVCRT___RTDynamicCast(void *cppobj, int unknown,
_CxxThrowException( &e, &bad_cast_exception_type );
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
__non_rtti_object e;
MSVCRT___non_rtti_object_ctor( &e, "Access violation - no RTTI data!" );
@ -1189,7 +1181,7 @@ void* MSVCRT___RTCastToVoid(void *cppobj)
const rtti_object_locator *obj_locator = get_obj_locator( cppobj );
ret = (char *)cppobj - obj_locator->base_class_offset;
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
__non_rtti_object e;
MSVCRT___non_rtti_object_ctor( &e, "Access violation - no RTTI data!" );

View File

@ -45,14 +45,6 @@ static struct __wine_debug_functions default_funcs;
/* ---------------------------------------------------------------------- */
/* filter for page-fault exceptions */
static WINE_EXCEPTION_FILTER(page_fault)
{
if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
return EXCEPTION_EXECUTE_HANDLER;
return EXCEPTION_CONTINUE_SEARCH;
}
/* get the debug info pointer for the current thread */
static inline struct debug_info *get_info(void)
{
@ -91,7 +83,7 @@ static const char *NTDLL_dbgstr_an( const char *src, int n )
{
res = default_funcs.dbgstr_an( src, n );
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
release_temp_buffer( old_pos, 0 );
return "(invalid)";
@ -114,7 +106,7 @@ static const char *NTDLL_dbgstr_wn( const WCHAR *src, int n )
{
res = default_funcs.dbgstr_wn( src, n );
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
release_temp_buffer( old_pos, 0 );
return "(invalid)";

View File

@ -54,14 +54,6 @@ typedef DWORD (CALLBACK *DLLENTRYPROC)(HMODULE,DWORD,LPVOID);
static int process_detaching = 0; /* set on process detach to avoid deadlocks with thread detach */
static int free_lib_count; /* recursion depth of LdrUnloadDll calls */
/* 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 const char * const reason_names[] =
{
"PROCESS_DETACH",
@ -1937,7 +1929,7 @@ PIMAGE_NT_HEADERS WINAPI RtlImageNtHeader(HMODULE hModule)
if (ret->Signature != IMAGE_NT_SIGNATURE) ret = NULL;
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
return NULL;
}

View File

@ -272,14 +272,6 @@ extern void WINAPI SNOOP_Return(void);
static SNOOP_DLL *firstdll;
static SNOOP_RETURNENTRIES *firstrets;
static WINE_EXCEPTION_FILTER(page_fault)
{
if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION ||
GetExceptionCode() == EXCEPTION_PRIV_INSTRUCTION)
return EXCEPTION_EXECUTE_HANDLER;
return EXCEPTION_CONTINUE_SEARCH;
}
/***********************************************************************
* check_list
*
@ -873,7 +865,7 @@ static void SNOOP_PrintArg(DWORD x)
if (!nostring && i > 5) DPRINTF(" %s",debugstr_wn((LPWSTR)x,i));
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
}
__ENDTRY

View File

@ -51,13 +51,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(resource);
static LCID user_lcid, system_lcid;
static LANGID user_ui_language, system_ui_language;
static WINE_EXCEPTION_FILTER(page_fault)
{
if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
return EXCEPTION_EXECUTE_HANDLER;
return EXCEPTION_CONTINUE_SEARCH;
}
/**********************************************************************
* is_data_file_module
*
@ -281,7 +274,7 @@ NTSTATUS WINAPI LdrFindResourceDirectory_U( HMODULE hmod, const LDR_RESOURCE_INF
status = find_entry( hmod, info, level, &res, TRUE );
if (status == STATUS_SUCCESS) *dir = res;
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
return GetExceptionCode();
}
@ -309,7 +302,7 @@ NTSTATUS WINAPI LdrFindResource_U( HMODULE hmod, const LDR_RESOURCE_INFO *info,
status = find_entry( hmod, info, level, &res, FALSE );
if (status == STATUS_SUCCESS) *entry = res;
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
return GetExceptionCode();
}
@ -350,7 +343,7 @@ static inline NTSTATUS access_resource( HMODULE hmod, const IMAGE_RESOURCE_DATA_
status = STATUS_SUCCESS;
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
return GetExceptionCode();
}

View File

@ -46,14 +46,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(ntdll);
#define NT_SUCCESS(status) (status == STATUS_SUCCESS)
/* filter for page-fault exceptions */
static WINE_EXCEPTION_FILTER(page_fault)
{
if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
return EXCEPTION_EXECUTE_HANDLER;
return EXCEPTION_CONTINUE_SEARCH;
}
/* helper function to copy an ACL */
static BOOLEAN copy_acl(DWORD nDestinationAclLength, PACL pDestinationAcl, PACL pSourceAcl)
{
@ -393,7 +385,7 @@ BOOLEAN WINAPI RtlValidSid( PSID pSid )
ret = FALSE;
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
WARN("(%p): invalid pointer!\n", pSid);
return FALSE;
@ -1268,7 +1260,7 @@ BOOLEAN WINAPI RtlValidAcl(PACL pAcl)
}
}
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
WARN("(%p): invalid pointer!\n", pAcl);
return 0;

View File

@ -110,13 +110,6 @@ struct dispatch_params
HRESULT hr; /* hresult (out) */
};
static WINE_EXCEPTION_FILTER(ole_filter)
{
if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
return EXCEPTION_CONTINUE_SEARCH;
return EXCEPTION_EXECUTE_HANDLER;
}
static HRESULT WINAPI RpcChannelBuffer_QueryInterface(LPRPCCHANNELBUFFER iface, REFIID riid, LPVOID *ppv)
{
*ppv = NULL;
@ -453,7 +446,7 @@ void RPC_ExecuteCall(struct dispatch_params *params)
{
params->hr = IRpcStubBuffer_Invoke(params->stub, params->msg, params->chan);
}
__EXCEPT(ole_filter)
__EXCEPT_PAGE_FAULT
{
params->hr = GetExceptionCode();
}

View File

@ -2202,17 +2202,6 @@ end:
*
* See LoadImageW.
*/
/* filter for page-fault exceptions */
static WINE_EXCEPTION_FILTER(page_fault)
{
if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
return EXCEPTION_EXECUTE_HANDLER;
return EXCEPTION_CONTINUE_SEARCH;
}
/*********************************************************************/
HANDLE WINAPI LoadImageA( HINSTANCE hinst, LPCSTR name, UINT type,
INT desiredx, INT desiredy, UINT loadflags)
{
@ -2227,7 +2216,7 @@ HANDLE WINAPI LoadImageA( HINSTANCE hinst, LPCSTR name, UINT type,
u_name = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, name, -1, u_name, len );
}
__EXCEPT(page_fault) {
__EXCEPT_PAGE_FAULT {
SetLastError( ERROR_INVALID_PARAMETER );
return 0;
}

View File

@ -42,13 +42,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(resource);
/* filter for page-fault exceptions */
static WINE_EXCEPTION_FILTER(page_fault)
{
if (GetExceptionCode() == EXCEPTION_ACCESS_VIOLATION)
return EXCEPTION_EXECUTE_HANDLER;
return EXCEPTION_CONTINUE_SEARCH;
}
/***********************************************************************
* CharNextA (USER32.@)
@ -253,7 +246,7 @@ LPSTR WINAPI CharLowerA(LPSTR str)
{
CharLowerBuffA( str, strlen(str) );
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError( ERROR_INVALID_PARAMETER );
return NULL;
@ -279,7 +272,7 @@ LPSTR WINAPI CharUpperA(LPSTR str)
{
CharUpperBuffA( str, strlen(str) );
}
__EXCEPT(page_fault)
__EXCEPT_PAGE_FAULT
{
SetLastError( ERROR_INVALID_PARAMETER );
return NULL;

View File

@ -82,7 +82,7 @@ LPWINE_DRIVER DRIVER_FindFromHDrvr(HDRVR hDrvr)
d = (LPWINE_DRIVER)hDrvr;
if (d && d->dwMagic != WINE_DI_MAGIC) d = NULL;
}
__EXCEPT(NULL)
__EXCEPT_PAGE_FAULT
{
return NULL;
}

View File

@ -447,7 +447,7 @@ LPWINE_MLD MMDRV_Get(HANDLE _hndl, UINT type, BOOL bCanBeID)
mld = MM_MLDrvs[idx];
if (mld && mld->type != type) mld = NULL;
}
__EXCEPT(NULL)
__EXCEPT_PAGE_FAULT
{
mld = NULL;
}