System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 103
Q2281:
A handler in a process is used to _______ console control events.
A. catch
B. ignore
C. delete
D. duplicate
Correct Answer:
A
Chapter: 103
Q2282:
CreateProcess() with CREATE_NEW_PROCESS_GROUP flag creates a _______.
A. new thread
B. process group
C. console
D. session
Correct Answer:
C
Chapter: 103
Q2283:
A process group consists of the root process and _______.
A. all its child processes
B. only the root process
C. processes in other groups
D. threads
Correct Answer:
B
Chapter: 103
Q2284:
Which event can a process in a group generate to signal others?
A. CTRL_X_EVENT
B. CTRL_C_EVENT
C. CTRL_D_EVENT
D. CTRL_Z_EVENT
Correct Answer:
B
Chapter: 103
Q2285:
The function GenerateConsoleCtrlEvent() takes _______ as parameters.
A. dwCtrlEvent and dwProcessId
B. dwCtrlEvent and dwProcessGroupId
C. dwProcessId and dwThreadId
D. threadId and dwCtrlEvent
Correct Answer:
B
Chapter: 103
Q2286:
CTRL_BREAK_EVENT is a valid value for _______ parameter in GenerateConsoleCtrlEvent().
A. dwProcessGroupId
B. dwCtrlEvent
C. processId
D. threadId
Correct Answer:
B
Chapter: 103
Q2287:
The calling process cannot have its own console when generating an event if it uses _______ flag.
A. CREATE_NEW_PROCESS_GROUP
B. CREATE_NEW_CONSOLE
C. CREATE_NEW_THREAD
D. DETACHED_THREAD
Correct Answer:
B
Chapter: 103
Q2288:
The target process for GenerateConsoleCtrlEvent() must share the same _______ as the caller.
A. console
B. handle
C. process
D. id
Correct Answer:
A
Chapter: 103
Q2289:
GenerateConsoleCtrlEvent() can send which of the following events?
A. CTRL_C_EVENT and CTRL_BREAK_EVENT
B. CTRL_CLOSE_EVENT and CTRL_LOGOFF_EVENT
C. CTRL_LOGOFF_EVENT and CTRL_SHUTDOWN_EVENT
D. CTRL_SHUTDOWN_EVENT only
Correct Answer:
A
Chapter: 103
Q2290:
To terminate all processes in a process group, send a console control event to the _______.
A. root process group
B. individual processes
C. thread group
D. session group
Correct Answer:
A
Chapter: 103
Q2291:
The dwProcessGroupId parameter in GenerateConsoleCtrlEvent() represents the _______.
A. process group ID
B. thread ID
C. process ID
D. session ID
Correct Answer:
A
Chapter: 103
Q2292:
A console control event handler usually generates an _______.
A. exception
B. thread
C. handle
D. process
Correct Answer:
A
Chapter: 103
Q2293:
The flag CREATE_NEW_PROCESS_GROUP allows grouping processes under a _______.
A. root process
B. group leader
C. process manager
D. session leader
Correct Answer:
A
Chapter: 103
Q2294:
Sending CTRL_C_EVENT to a process group will signal _______.
A. all processes in the group
B. only the root process
C. only child processes
D. only the current process
Correct Answer:
A
Chapter: 103
Q2295:
The main use of GenerateConsoleCtrlEvent() is to _______.
A. send console signals
B. terminate threads
C. create new processes
D. log system events
Correct Answer:
A
Chapter: 103
Q2296:
The handler that catches console control events is usually set up in the _______.
A. process
B. console
C. session
D. thread
Correct Answer:
A
Chapter: 103
Q2297:
When a console control event is generated, the handler _______.
A. catches the event
B. generates a new process
C. ignores the event
D. terminates immediately
Correct Answer:
A
Chapter: 103
Q2298:
CTRL_C_EVENT is used to _______.
A. interrupt the process
B. terminate the process
C. wait for input
D. close the console
Correct Answer:
A
Chapter: 103
Q2299:
In the context of process management, SEH stands for _______.
A. Structured Exception Handling
B. Simple Event Handler
C. System Exception Handler
D. Special Event Handler
Correct Answer:
A
Chapter: 103
Q2300:
Processes in the same group communicate by sending _______.
A. console control events
B. signals
C. messages
D. interrupts
Correct Answer:
A