DosExitMustComplete: Difference between revisions
Appearance
m Martini moved page OS2 API:CPI:DosExitMustComplete to DosExitMustComplete |
No edit summary |
||
Line 1: | Line 1: | ||
Provides exit from a section of code in which asynchronous exceptions are held. | Provides exit from a section of code in which asynchronous exceptions are held. | ||
Line 13: | Line 12: | ||
</PRE> | </PRE> | ||
==Parameters== | ==Parameters== | ||
; | ;pulNesting (PULONG) - output : Pointer to the nesting level. | ||
:The nesting level is equal to the number of DosEnterMustComplete requests minus the number of DosExitMustComplete requests for the current thread. | |||
==Return Code== | ==Return Code== | ||
ulrc (APIRET) - returns | ulrc (APIRET) - returns | ||
DosExitMustComplete returns one of the following values: | DosExitMustComplete returns one of the following values: | ||
* 0 NO_ERROR | |||
* 300 ERROR_ALREADY_RESET | |||
==Remarks== | ==Remarks== | ||
Note: Do not make Presentation Manager calls from exception handlers. | Note: Do not make Presentation Manager calls from exception handlers. | ||
Line 31: | Line 30: | ||
==Example Code== | ==Example Code== | ||
This example shows how a thread can notify the system to hold asynchronous exceptions during a section of code. | This example shows how a thread can notify the system to hold asynchronous exceptions during a section of code. | ||
<PRE> | <PRE> | ||
#define INCL_DOSEXCEPTIONS /* Exception values */ | #define INCL_DOSEXCEPTIONS /* Exception values */ | ||
Line 68: | Line 66: | ||
</PRE> | </PRE> | ||
==Related Functions== | ==Related Functions== | ||
* [[ | *[[DosAcknowledgeSignalException]] | ||
* [[ | *[[DosEnterMustComplete]] | ||
* [[ | *[[DosRaiseException]] | ||
* [[ | *[[DosSendSignalException]] | ||
* [[ | *[[DosSetExceptionHandler]] | ||
* [[ | *[[DosSetSignalExceptionFocus]] | ||
* [[ | *[[DosUnsetExceptionHandler]] | ||
* [[ | *[[DosUnwindException]] | ||
[[Category: | [[Category:Dos]] |
Revision as of 06:37, 9 January 2017
Provides exit from a section of code in which asynchronous exceptions are held.
Syntax
#define INCL_DOSEXCEPTIONS #include <os2.h> PULONG pulNesting; /* Pointer to the nesting level. */ APIRET ulrc; /* Return Code. */ ulrc = DosExitMustComplete(pulNesting);
Parameters
- pulNesting (PULONG) - output
- Pointer to the nesting level.
- The nesting level is equal to the number of DosEnterMustComplete requests minus the number of DosExitMustComplete requests for the current thread.
Return Code
ulrc (APIRET) - returns
DosExitMustComplete returns one of the following values:
- 0 NO_ERROR
- 300 ERROR_ALREADY_RESET
Remarks
Note: Do not make Presentation Manager calls from exception handlers.
DosExitMustComplete notifies the system that the calling thread is leaving a section of code in which any asynchronous exceptions (signals and asynchronous process terminations) that may have occurred were held, rather than being immediately delivered to the thread.
Example Code
This example shows how a thread can notify the system to hold asynchronous exceptions during a section of code.
#define INCL_DOSEXCEPTIONS /* Exception values */ #define INCL_DOSERRORS /* Error values */ #include <os2.h> #include <stdio.h> int main(VOID) { ULONG ulNestLevel = 0; /* Global variable tracking nesting of DosEnterMustComplete calls */ APIRET rc = NO_ERROR; /* Return code */ rc = DosEnterMustComplete(&ulNestLevel); if (rc != NO_ERROR) { printf("DosEnterMustComplete error: return code = %u\n",rc); return 1; } else { printf("ulNestLevel = %u\n",ulNestLevel); } /* ADD BLOCK OF CODE THAT MUST COMPLETE HERE... */ rc = DosExitMustComplete(&ulNestLevel); if (rc != NO_ERROR) { printf("DosExitMustComplete error: return code = %u\n",rc); return 1; } else { printf("ulNestLevel = %u\n",ulNestLevel); } return NO_ERROR; }