System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 93
Q2001:
SYCHRONIZE access right enables thread suspension.
A. A
B. B
Correct Answer:
B
Chapter: 93
Q2002:
PROCESS_QUERY_INFORMATION allows inspection of process attributes.
A. A
B. B
Correct Answer:
A
Chapter: 93
Q2003:
bInheritHandle in OpenProcess() determines handle inheritance by child processes.
A. A
B. B
Correct Answer:
A
Chapter: 93
Q2004:
The CreateProcess() function initializes PROCESS_INFORMATION as its last parameter.
A. A
B. B
Correct Answer:
A
Chapter: 93
Q2005:
The process ID can be retrieved using ______.
A. GetThreadId()
B. GetCurrentProcessId()
C. GetParentProcessId()
D. GetStartupInfo()
Correct Answer:
B
Chapter: 93
Q2006:
The function ______ allows retrieving the executable path of the running process.
A. GetModuleFileName()
B. GetParentHandle()
C. OpenProcessId()
D. GetFileAttributes()
Correct Answer:
A
Chapter: 93
Q2007:
PROCESS_TERMINATE grants permission to ______.
A. change thread priority
B. query file path
C. terminate the process
D. read memory
Correct Answer:
C
Chapter: 93
Q2008:
A handle with PROCESS_QUERY_INFORMATION can be used to ______.
A. write to memory
B. terminate process
C. create threads
D. query process details
Correct Answer:
D
Chapter: 94
Q2009:
What function is used to create duplicate handles in Windows?
A. CreateHandle()
B. DuplicateHandle()
C. CopyHandle()
D. ReplicateHandle()
Correct Answer:
B
Chapter: 94
Q2010:
Which parameter in DuplicateHandle() is used to specify the source process?
A. hSourceHandle
B. hSourceProcessHandle
C. hTargetProcessHandle
D. lpTargetHandle
Correct Answer:
B
Chapter: 94
Q2011:
What does lpTargetHandle receive?
A. New thread handle
B. Copy of source process
C. Pointer to the new duplicated handle
D. Source file descriptor
Correct Answer:
C
Chapter: 94
Q2012:
If hSourceHandle does not exist in the source process, DuplicateHandle() ______.
A. fails
B. returns default handle
C. returns pseudohandle
D. succeeds silently
Correct Answer:
A
Chapter: 94
Q2013:
What access must the duplicating process have to duplicate a handle?
A. PROCESS_ALL_ACCESS
B. PROCESS_QUERY_INFORMATION
C. PROCESS_DUP_HANDLE
D. PROCESS_TERMINATE
Correct Answer:
C
Chapter: 94
Q2014:
Which flag ensures the access rights of the duplicated handle match the source?
A. DUPLICATE_CLOSE_SOURCE
B. DUPLICATE_SAME_ACCESS
C. ACCESS_SAME_DUPLICATE
D. SAME_ACCESS_ONLY
Correct Answer:
B
Chapter: 94
Q2015:
DUPLICATE_CLOSE_SOURCE is used to ______.
A. copy handle with restricted access
B. inherit from parent process
C. close the source handle after duplication
D. terminate the parent process
Correct Answer:
C
Chapter: 94
Q2016:
What is the purpose of dwDesiredAccess in DuplicateHandle()?
A. Defines access rights
B. Ignored completely
C. Checks memory space
D. Assigns process ID
Correct Answer:
A
Chapter: 94
Q2017:
What does Windows use to keep track of all handles for a resource?
A. Handle counter
B. Handle limit
C. Reference count
D. Access rights tracker
Correct Answer:
C
Chapter: 94
Q2018:
What happens when all references to a resource are closed?
A. Resource is locked
B. Resource is released
C. Resource is inherited
D. No effect
Correct Answer:
B
Chapter: 94
Q2019:
Handles that are duplicated or inherited affect the ______.
A. system memory
B. access permissions
C. reference count
D. resource path
Correct Answer:
C
Chapter: 94
Q2020:
To duplicate a handle to another process, you must specify ______.
A. thread ID
B. source process path
C. target process handle
D. source file name
Correct Answer:
C