System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 93
Q1981:
Which access right allows termination of a process?
A. PROCESS_QUERY_INFORMATION
B. PROCESS_ALL_ACCESS
C. PROCESS_TERMINATE
D. SYNCHRONIZE
Correct Answer:
C
Chapter: 93
Q1982:
Which function returns a pseudohandle to the current process?
A. GetProcessId()
B. OpenProcess()
C. GetCurrentProcessId()
D. GetCurrentProcess()
Correct Answer:
D
Chapter: 93
Q1983:
Which of the following is TRUE about a pseudohandle?
A. It can be passed to a child process
B. It represents any process
C. It is not inheritable
D. It is always invalid
Correct Answer:
C
Chapter: 93
Q1984:
The process handle obtained using OpenProcess() can be used to ______.
A. restart OS
B. allocate memory
C. send signals
D. terminate the process
Correct Answer:
D
Chapter: 93
Q1985:
PROCESS_QUERY_INFORMATION is used to ______.
A. create new processes
B. query process info
C. delete process memory
D. access kernel modules
Correct Answer:
B
Chapter: 93
Q1986:
The last parameter of CreateProcess() stores ______.
A. Thread info
B. Command line args
C. Process information
D. Executable file path
Correct Answer:
C
Chapter: 93
Q1987:
What is required to get the executable file path of a process?
A. GetCurrentProcessId()
B. GetModuleFileName()
C. GetHandle()
D. TerminateProcess()
Correct Answer:
B
Chapter: 93
Q1988:
To retrieve the path of a module in another process, we use ______.
A. GetModuleFileName()
B. GetModuleFileNameEx()
C. GetPath()
D. GetCurrentDirectory()
Correct Answer:
B
Chapter: 93
Q1989:
Closing the process handle in PROCESS_INFORMATION ______.
A. destroys the process
B. prevents memory leaks
C. closes parent’s access to child process
D. prevents thread access
Correct Answer:
C
Chapter: 93
Q1990:
GetCurrentProcessId() returns a ______.
A. handle to the process
B. thread pointer
C. current process ID
D. function address
Correct Answer:
C
Chapter: 93
Q1991:
Which function is used to retrieve the full path of an executable?
A. GetCommandLine()
B. GetProcessPath()
C. GetModuleFileName()
D. SetModuleName()
Correct Answer:
C
Chapter: 93
Q1992:
OpenProcess() requires the following parameters except:
A. Access rights
B. Process ID
C. bInheritHandle
D. Thread name
Correct Answer:
D
Chapter: 93
Q1993:
Which of the following flags gives full access to a process?
A. PROCESS_ALL_ACCESS
B. PROCESS_LIMITED_ACCESS
C. SYNCHRONIZE
D. PROCESS_READONLY
Correct Answer:
A
Chapter: 93
Q1994:
GetCurrentProcess() returns an actual handle object.
A. A
B. B
Correct Answer:
B
Chapter: 93
Q1995:
GetModuleFileNameEx() can be used to get the module path of another process.
A. A
B. B
Correct Answer:
A
Chapter: 93
Q1996:
The PROCESS_INFORMATION structure contains thread and process IDs.
A. A
B. B
Correct Answer:
A
Chapter: 93
Q1997:
TerminateProcess() can only be used if PROCESS_TERMINATE flag was specified.
A. A
B. B
Correct Answer:
A
Chapter: 93
Q1998:
A pseudohandle is always inheritable by child processes.
A. A
B. B
Correct Answer:
B
Chapter: 93
Q1999:
OpenProcess() does not require a valid process ID.
A. A
B. B
Correct Answer:
B
Chapter: 93
Q2000:
GetCurrentProcessId() is used to obtain a unique identifier for the current process.
A. A
B. B
Correct Answer:
A