You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/c-runtime-library/reference/mbbtype-mbbtype-l.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -50,9 +50,9 @@ The locale to use.
50
50
|---|---|---|---|
51
51
| Any value except 1 | Valid single byte or lead byte |`_MBC_SINGLE` (0) | Single byte (0x20 - 0x7E, 0xA1 - 0xDF) |
52
52
| Any value except 1 | Valid single byte or lead byte |`_MBC_LEAD` (1) | Lead byte of multibyte character (0x81 - 0x9F, 0xE0 - 0xFC) |
53
-
| Any value except 1 | Valid single-byte or lead byte |`_MBC_ILLEGAL`<br /><br /> (-1) | Invalid character (any value except 0x20 - 0x7E, 0xA1 - 0xDF, 0x81 - 0x9F, 0xE0 - 0xFC|
53
+
| Any value except 1 | Valid single-byte or lead byte |`_MBC_ILLEGAL`(-1) | Invalid character: not single or lead (0x00 - 0x1F, 0x7F, 0x80, 0xA0, 0xFD, 0xFE, 0xFF)|
n_except != STATUS_FLOAT_OVERFLOW ) // Pass on most exceptions
33
-
return EXCEPTION_CONTINUE_SEARCH;
34
-
35
-
// Execute some code to clean up problem
36
-
ResetVars( 0 ); // initializes data to 0
37
-
return EXCEPTION_CONTINUE_EXECUTION;
31
+
int Eval_Exception(int n_except) {
32
+
if (
33
+
n_except != STATUS_INTEGER_OVERFLOW &&
34
+
n_except != STATUS_FLOAT_OVERFLOW
35
+
) {
36
+
// Pass on most exceptions
37
+
return EXCEPTION_CONTINUE_SEARCH;
38
+
}
39
+
// Execute some code to clean up problem
40
+
HandleOverflow();
41
+
return EXCEPTION_CONTINUE_EXECUTION;
38
42
}
39
43
```
40
44
41
45
It's a good idea to use a function call in the *filter* expression whenever *filter* needs to do anything complex. Evaluating the expression causes execution of the function, in this case, `Eval_Exception`.
42
46
43
47
Note the use of [`GetExceptionCode`](/windows/win32/Debug/getexceptioncode) to determine the exception. This function must be called inside the filter expression of the **`__except`** statement. `Eval_Exception` can't call `GetExceptionCode`, but it must have the exception code passed to it.
44
48
45
-
This handler passes control to another handler unless the exception is an integer or floating-point overflow. If it is, the handler calls a function (`ResetVars` is only an example, not an API function) to reset some global variables. The **`__except`** statement block, which in this example is empty, can never be executed because `Eval_Exception` never returns `EXCEPTION_EXECUTE_HANDLER` (1).
49
+
This handler passes control to another handler unless the exception is an integer or floating-point overflow. If it is, the handler calls a function (`HandleOverflow` is only an example, not an API function) to appropriately try to recover from the exception. The **`__except`** statement block, which in this example is empty, can never be executed because `Eval_Exception` never returns `EXCEPTION_EXECUTE_HANDLER` (1).
46
50
47
51
Using a function call is a good general-purpose technique for dealing with complex filter expressions. Two other C language features that are useful are:
48
52
@@ -53,21 +57,21 @@ Using a function call is a good general-purpose technique for dealing with compl
53
57
The conditional operator is frequently useful here. It can be used to check for a specific return code and then return one of two different values. For example, the filter in the following code recognizes the exception only if the exception is `STATUS_INTEGER_OVERFLOW`:
The conditional operator is more useful in situations where you might want the filter to evaluate to -1, `EXCEPTION_CONTINUE_EXECUTION`.
66
70
67
71
The comma operator lets you execute multiple expressions in sequence. It then returns the value of the last expression. For example, the following code stores the exception code in a variable and then tests it:
0 commit comments