System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 60
Q1261:
The control signal sent when logging off is ______.
A. CTRL_SHUTDOWN_EVENT
B. CTRL_LOGOFF_EVENT
C. CTRL_C_EVENT
D. CTRL_CLOSE_EVENT
Correct Answer:
B
Chapter: 60
Q1262:
The handler uses a switch block to check ______.
A. exitFlag
B. handler result
C. cntrlEvent
D. loop iterations
Correct Answer:
C
Chapter: 61
Q1263:
What does VEH stand for in Windows programming?
A. Virtual Error Handler
B. Vector Extension Header
C. Vectored Exception Handler
D. Visual Exception Handler
Correct Answer:
C
Chapter: 61
Q1264:
What is the primary function of a Vectored Exception Handler?
A. Handle GUI events
B. Manage threads
C. Handle exceptions before SEH
D. Terminate processes
Correct Answer:
C
Chapter: 61
Q1265:
Which API is used to register a vectored exception handler?
A. AddExceptionHandler()
B. AddVectoredExceptionHandler()
C. RegisterExceptionHandler()
D. RegisterVEH()
Correct Answer:
B
Chapter: 61
Q1266:
In AddVectoredExceptionHandler(), what does a non-zero value of FirstHandler mean?
A. It disables the handler
B. It places the handler at the end
C. It places the handler first
D. It removes the handler
Correct Answer:
C
Chapter: 61
Q1267:
What will happen if there are multiple VEH handlers with FirstHandler set to zero?
A. They are ignored
B. They are executed in reverse order
C. They are executed in order added
D. Only the last one executes
Correct Answer:
C
Chapter: 61
Q1268:
Which function is used to remove a vectored exception handler?
A. DeleteExceptionHandler()
B. RemoveHandler()
C. RemoveVectoredExceptionHandler()
D. ClearExceptionHandler()
Correct Answer:
C
Chapter: 61
Q1269:
What type is the return value of a vectored exception handler function?
A. BOOL
B. VOID
C. INT
D. LONG
Correct Answer:
D
Chapter: 61
Q1270:
The parameter passed to a VEH function is a pointer to _______.
A. EXCEPTION_POINTERS
B. THREAD_INFORMATION
C. STACK_POINTER
D. CONTEXT_BLOCK
Correct Answer:
A
Chapter: 61
Q1271:
VEH functions are similar to which of the following?
A. Console control handlers
B. Thread procedures
C. Window procedures
D. SEH filters
Correct Answer:
A
Chapter: 61
Q1272:
VEH should not include blocking functions like _______.
A. Sleep()
B. GetTickCount()
C. QueryPerformanceCounter()
D. Beep()
Correct Answer:
A
Chapter: 61
Q1273:
Which return value of a VEH continues execution without stack unwinding?
A. EXCEPTION_ABORT
B. EXCEPTION_CONTINUE_EXECUTION
C. EXCEPTION_STACK_RESET
D. EXCEPTION_SKIP_HANDLER
Correct Answer:
B
Chapter: 61
Q1274:
If a VEH returns EXCEPTION_CONTINUE_SEARCH, what happens next?
A. Process is killed
B. Execution resumes
C. The next VEH is called
D. Console is restarted
Correct Answer:
C
Chapter: 61
Q1275:
AddVectoredExceptionHandler() returns ______ if the registration fails.
A. NULL
B. HANDLE
C. 1
D. EXCEPTION_POINTER
Correct Answer:
A
Chapter: 61
Q1276:
________ determines the execution order of a VEH.
A. Thread ID
B. Exception code
C. FirstHandler parameter
D. Stack pointer
Correct Answer:
C
Chapter: 61
Q1277:
The structure used in the VEH function parameter is called _______.
A. EXCEPTION_RECORD
B. EXCEPTION_POINTERS
C. THREAD_CONTEXT
D. EXCEPTION_FRAME
Correct Answer:
B
Chapter: 61
Q1278:
What kind of operations should VEH avoid?
A. Non-blocking
B. Pointer dereferencing
C. Floating point
D. Blocking
Correct Answer:
D
Chapter: 61
Q1279:
Which function provides the EXCEPTION_POINTERS structure?
A. GetContextInformation()
B. GetExceptionInformation()
C. GetSystemException()
D. GetFaultInfo()
Correct Answer:
B
Chapter: 61
Q1280:
The order of VEH handlers with FirstHandler = 0 is determined by the order of ______.
A. their return value
B. their registration
C. their exception type
D. their size
Correct Answer:
B