System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 84
Q1741:
In the sample code, the function `cci_f` likely performs _______.
A. file decryption
B. DLL validation
C. file conversion or encryption
D. argument parsing
Correct Answer:
C
Chapter: 84
Q1742:
Explicit linking is useful when the DLL to be used is not known until runtime.
A. A
B. B
Correct Answer:
A
Chapter: 85
Q1743:
When is the DLL entry point executed?
A. Only during build
B. When DLL is written
C. When a process or thread attaches to the DLL
D. Only during linking
Correct Answer:
C
Chapter: 85
Q1744:
Which function is used to attach a process to a DLL explicitly?
A. GetProcAddress()
B. FreeLibrary()
C. LoadLibrary()
D. CreateFile()
Correct Answer:
C
Chapter: 85
Q1745:
In implicit linking, the DLL attaches to the process when the process _______.
A. is compiled
B. starts
C. exits
D. calls main function
Correct Answer:
B
Chapter: 85
Q1746:
What function detaches the DLL from a process in explicit linking?
A. RemoveLibrary()
B. FreeLibrary()
C. UnloadLibrary()
D. ExitProcess()
Correct Answer:
B
Chapter: 85
Q1747:
Which function can suppress execution of the DLL entry point?
A. LoadLibraryEx()
B. FreeLibrary()
C. InitDLL()
D. DllDisable()
Correct Answer:
A
Chapter: 85
Q1748:
The DLL entry point function is named _______.
A. MainDll()
B. EntryPoint()
C. DllMain()
D. WinMain()
Correct Answer:
C
Chapter: 85
Q1749:
How many parameters does DllMain() take?
A. 1
B. 2
C. 3
D. 4
Correct Answer:
C
Chapter: 85
Q1750:
The first parameter of DllMain is _______.
A. DLL name
B. Function ID
C. HINSTANCE handle
D. Return code
Correct Answer:
C
Chapter: 85
Q1751:
Which parameter in DllMain indicates the reason for being called?
A. hDll
B. lpReserved
C. Reason
D. status
Correct Answer:
C
Chapter: 85
Q1752:
Which value indicates a thread has attached to the DLL?
A. DLL_PROCESS_ATTACH
B. DLL_THREAD_ATTACH
C. DLL_THREAD_DETACH
D. DLL_PROCESS_DETACH
Correct Answer:
B
Chapter: 85
Q1753:
What does lpReserved == NULL represent in DllMain?
A. Implicit attachment
B. Explicit attachment
C. Thread detachment
D. DLL error
Correct Answer:
B
Chapter: 85
Q1754:
Which of the following is NOT a valid value for the Reason parameter in DllMain?
A. DLL_PROCESS_ATTACH
B. DLL_THREAD_ATTACH
C. DLL_CALL_INIT
D. DLL_PROCESS_DETACH
Correct Answer:
C
Chapter: 85
Q1755:
What is the correct return type of DllMain()?
A. INT
B. BOOL
C. VOID
D. DWORD
Correct Answer:
B
Chapter: 85
Q1756:
All calls to DllMain() are _______ by the system.
A. ignored
B. logged
C. serialized
D. skipped
Correct Answer:
C
Chapter: 85
Q1757:
Serialization of DllMain is important to avoid _______.
A. race conditions
B. memory leaks
C. system shutdown
D. syntax errors
Correct Answer:
A
Chapter: 85
Q1758:
Calling LoadLibrary from inside DllMain() can lead to _______.
A. thread safety
B. memory optimization
C. multiple entry calls
D. security patches
Correct Answer:
C
Chapter: 85
Q1759:
A call to FreeLibrary() causes the DLL to _______.
A. initialize
B. load
C. attach
D. detach
Correct Answer:
D
Chapter: 85
Q1760:
The DllMain function must not perform _______.
A. arithmetic operations
B. thread initialization
C. blocking or IO calls
D. console printing
Correct Answer:
C