На главную

On-line справка по Win32 API

Написать письмо
БЕСПЛАТНАЯ ежедневная online лотерея! Выигрывай каждый день БЕСПЛАТНО!
Список всех статей A-B-C-D-E-F-G-H-I-J-K-L-M-N-O-P-Q-R-S-T-U-V-W-X-Y-Z | Скачать Вниз

RaiseException



The RaiseException function raises an exception in the calling thread.

VOID RaiseException(

DWORD dwExceptionCode, // exception code
DWORD dwExceptionFlags, // continuable exception flag
DWORD nNumberOfArguments, // number of arguments in array
CONST DWORD *lpArguments // address of array of arguments
);


Parameters

dwExceptionCode

Specifies the application-defined exception code of the exception being raised. The filter expression and exception-handler block of an exception handler can use the GetExceptionCode function to retrieve this value.
Note that the system will clear bit 28 of dwExceptionCode. This bit is a reserved exception bit, used by the system for its own purposes. For example, after calling the RaiseException function with a dwExceptionCode value of 0xEFFFFFFF Windows displays a message indicating that the exception number is 0xEFFFFFFF.

dwExceptionFlags

Specifies the exception flags. This can be either zero to indicate a continuable exception, or EXCEPTION_NONCONTINUABLE to indicate a noncontinuable exception. Any attempt to continue execution after a noncontinuable exception causes the EXCEPTION_NONCONTINUABLE_EXCEPTION exception.

nNumberOfArguments

Specifies the number of arguments in the lpArguments array. This value must not exceed EXCEPTION_MAXIMUM_PARAMETERS. This parameter is ignored if lpArguments is NULL.

lpArguments

Points to an array of 32-bit arguments. This parameter can be NULL. These arguments can contain any application-defined data that needs to be passed to the filter expression of the exception handler.



Return Values

This function does not return a value.

Remarks

The RaiseException function enables a process to use structured exception handling to handle private, software-generated, application-defined exceptions.
Raising an exception causes the exception dispatcher to go through the following search for an exception handler:

1. The system first attempts to notify the process's debugger, if any.
2. If the process is not being debugged, or if the associated debugger does not handle the exception, the system attempts to locate a frame-based exception handler by searching the stack frames of the thread in which the exception occurred. The system searches the current stack frame first, then proceeds backward through preceding stack frames.
3. If no frame-based handler can be found, or no frame-based handler handles the exception, the system makes a second attempt to notify the process's debugger.

4. If the process is not being debugged, or if the associated debugger does not handle the exception, the system provides default handling based on the exception type. For most exceptions, the default action is to call the ExitProcess function.



The values specified in the dwExceptionCode, dwExceptionFlags, nNumberOfArguments, and lpArguments parameters can be retrieved in the filter expression of a try-except frame-based exception handler by calling the GetExceptionInformation function. A debugger can retrieve these values by calling the WaitForDebugEvent function.

See Also

ExitProcess, GetExceptionCode, GetExceptionInformation, WaitForDebugEvent


Пригласи друзей и счет твоего мобильника всегда будет положительным!
Предыдущая статья
 
Сайт Народ.Ру Интернет
Следующая статья
Пригласи друзей и счет твоего мобильника всегда будет положительным!

RaiseException



Функция RaiseException поднимает исключение на вызове резьбы.

ПУСТОТА RaiseException(

DWORD dwExceptionCode, // ИСКЛЮЧИТЕЛЬНЫЙ код DWORD dwExceptionFlags, // continuable исключительный флаг DWORD nNumberOfArguments, // количество аргументов в массиве CONST DWORD *адрес lpArguments // массива аргументов
);


Параметры

dwExceptionCode

Определяет определенный прикладной исключительный код исключения, подниманного. Выражение фильтра и блока исключительного вручителя исключительного вручителя могут использовать функцию GetExceptionCode, чтобы извлекать эту величину.
Отметьте, что система очистит биту 28 dwExceptionCode. Этот бит является резервным исключительным битом, использованным системой для своих собственных целей. Например, после разговора функции RaiseException с величиной dwExceptionCode Окна 0xEFFFFFFF отображает сообщение, указывающее, что исключительное число - 0xEFFFFFFF.

dwExceptionFlags

Определяет исключительные флаги. Это может быть любым нулем, чтобы указывать continuable исключение, или EXCEPTION_NONCONTINUABLE, чтобы указывать noncontinuable исключение. Любая попытка, чтобы продолжать выполнение после того, как noncontinuable исключение вызовет исключение EXCEPTION_NONCONTINUABLE_EXCEPTION.

nNumberOfArguments

Определяет количество аргументов в массиве lpArguments. Эта величина не должна превышать EXCEPTION_MAXIMUM_PARAMETERS. Этот параметр проигнорирован если lpArguments НЕДЕЙСТВИТЕЛЕН.

lpArguments

Точки на массив 32- битовых аргументов. Этот параметр может быть НЕДЕЙСТВИТЕЛЕН. Эти аргументы могут содержать любые определенные прикладные данные, которые должны быть пройдены в выражение фильтра исключительного вручителя.



Обратные Величины

Эта функция не возвращает величину.

Замечания

Функция RaiseException позволяет процесс, чтобы использовать структурное исключение, обрабатывающее, чтобы оперировать частные, сгенерированные программные, определенные прикладные исключения.
Поднимающее исключение заставляет исключительного диспетчера, чтобы проходить через следующее поиска исключительного вручителя:

1. Системные первые попытки, чтобы уведомлять отладчика процесса, если имеется.
2. Если процесс не отлаживается, или если связанный отладчик не оперирует исключение, системные попытки, чтобы располагать фреймового исключительного вручителя ища фреймы стека резьбы в которых исключение происходило. Система ищет текущий фрейм стека сначала затем приступает назад через предыдущие фреймы стека.
3. Если никакой фреймовый вручитель не может быть обнаружен, или никакой фреймовый вручитель не оперирует исключение, система делает, секунда пытается уведомлять отладчика процесса.

4. Если процесс не отлаживается, или если связанный отладчик не оперирует исключение, система обеспечивает по умолчанию обрабатывая основанное в исключительном типе. Для большинства исключений, по умолчанию действие должно вызывать функцию ExitProcess.



Величины определялись в dwExceptionCode, dwExceptionFlags, nNumberOfArguments, и параметры lpArguments могут быть извлечены в выражение фильтра попытки-кроме фреймового исключительного вручителя вызывая функцию GetExceptionInformation. Отладчик может извлечь эти величины вызывая функцию WaitForDebugEvent.

Смотри Также

ExitProcess, GetExceptionCode, GetExceptionInformation, WaitForDebugEvent


Вверх Version 1.3, Oct 26 2010 © 2007, 2010, mrhx Вверх
 mrhx software  Русский перевод OpenGL  Русский перевод Win32 API
 
Используются технологии uCoz