System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Multiple Choice Questions
Q2051: What does the API GetExitCodeProcess() retrieve?
- A: Thread ID
- B: Exit code of a process
- C: Process name
- D: Handle permissions
View Answer
B
Q2052: To use GetExitCodeProcess(), the handle must have ______ access.
- A: PROCESS_DUP_HANDLE
- B: PROCESS_VM_READ
- C: PROCESS_QUERY_INFORMATION
- D: PROCESS_TERMINATE
View Answer
C
Q2053: What type is the lpExitCode parameter in GetExitCodeProcess()?
- A: char pointer
- B: string
- C: pointer to DWORD
- D: int pointer
View Answer
C
Q2054: Which of the following is a possible value for an exit code?
- A: EXIT_FAILED
- B: PROCESS_EXITED
- C: THREAD_TERMINATED
- D: STILL_ACTIVE
View Answer
D
Q2055: Which function is used to terminate another process forcibly?
- A: CloseHandle()
- B: ExitProcess()
- C: KillThread()
- D: TerminateProcess()
View Answer
D
Q2056: What is passed as the first parameter to TerminateProcess()?
- A: Process ID
- B: Process name
- C: Thread ID
- D: Process handle
View Answer
D
Q2057: Which parameter in TerminateProcess() is returned by the terminated process?
- A: Thread ID
- B: Error message
- C: Exit code
- D: Process name
View Answer
C
Q2058: Calling ExitProcess() from within a program is discouraged because ______.
- A: it blocks threads
- B: it restarts the program
- C: it prevents resource cleanup
- D: it runs slower
View Answer
C
Q2059: Proper way to exit a process involves ______.
- A: only closing file descriptors
- B: only closing handles
- C: waiting for I/O
- D: releasing all handles first
View Answer
D
Q2060: TerminateProcess() does not allow the process to execute ______.
- A: Exit handlers
- B: SHE or DllMain()
- C: Thread closure
- D: Exit codes
View Answer
B