- Type
- Final term past paper
- Course
- CS609 System Programming
- Size
- PDF 856 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from pages 2, 3, 4 of 18. Download the file for all 18 pages.
- How a DLL file is loaded inside a program during explicit linking? Mention the API that is used for this purpose.
- Write the names of functions that are used to determine the amount of time consumed by:
1. Process
2. Thread
GetProcessTime() GetThreadTime()
Q3. When a thread enters into the critical section and is not willing to leave the critical section, then what will its consequences?
Answer: If a thread enters into the critical section and is not willing to leave the critical section, the following consequences occurs.
- Deadlock
- Starvation
- Reduce System Performance
- Write the first two steps required for mapping a file to a region in virtual address space of a calling process.
- Open File with at least GENERIC_READ access.
- Map the file using CreateFileMapping() or OpenFileMapping ()
- What is the purpose of InitializeCriticalSection and Spin Count API? Also mention the names of its parameter.
Answer: The InitializeCriticalSectionAndSpinCount API is used to initialize a critical section object in Windows with a spin count, which allows for better performance by using spinning instead of waiting. Its parameters are the critical section object to initialize and the spin count.
The names of its parameter:
VOID InitializeCriticalSection(LPCRITICAL_SECTION lpCriticalSection)
Q6. What is Explicit Linking and which Windows API is used to load a DLL explicit inside a program?
ANSWER
The Windows API used to load a DLL explicitly inside a program is called " LoadLibrary".
- Name any Two Windows API That are used to return the Pseudo and real handle of a process.
- GetCurrentProress() GetCurrentProcess() is used to create a psuedohandle. It’s not inheritable and desired access attributes are undefined.
- GetCurrentProcessId() The OpenProcess() function is used to obtain the process handle using the process ID obtained by GetCurrentProcessId() or otherwise.
- Briefly Describe the two parameters associated with the following windows API. FARPROC GetProcessAddress(HMODULE hModule, LPCSTR lpProcName).
Answer: The Windows API " GetProcAddress" is used to retrieve the address of an exported function or variable from a specified dynamic-link library (DLL). It takes two parameters
- HMODULE hModule: is an instance produced by LoadLibrary
- LPCSTR lpProcName lpProcName cannot b UNICODE. It is the name of the function whose entry point is to be obtained. Its return type is FARPROC.
9. In what situation the termination handler is ignore by a process
A process can exit using the API ExitProcess(). The function does not return, in fact the process and all its associated threads terminate. Termination Handlers are ignored.
Q10. Which window function is used to convert thread into fiber?
Answer: ConvertThreadToFiber
11. Write the signature of InterlockedExchange() API with its return type and parameters
Answer: LONG InterlockedExchange( LONG volatile *Target, LONG Value
return type and parameters is Loong Integer
- Write the name of the API which is used to map the view of a file mapping into the address space of a process
Answer: LPVOID MapViewOfFile( HANDLE hFileMappingObject,
DWORD dwDesiredAccess,
DWORD dwFileOffsetHigh,
DWORD dwFileOffsetLow,
SIZE_T dwNumberOfBytesToMap );
Note: The name of the API is MapViewOfFile.
Q13. Write the name of the API which is used to open map the view of a file mapping into the address space of a process?
HANDLE OpenFileMapping(
DWORD dwDesiredAccess,
BOOL bInheritHandle,
LPCSTR lpMapName );
Related CS609 files
All CS609 files →- CS609 Final Term Solved File 3 by Team Hadi Final term PDF 3.3 MB
- CS609 Final Term Solved File 4 by Team Hadi Final term PDF 10.7 MB
- CS609 Final Term Solved MCQs Updated by Junaid Final term PDF 731 KB
- CS609 Final Term Solved MCQs by Junaid Final term PDF 1.2 MB
- CS609 Updated Handouts Handout PDF 6.5 MB
- CS609 Midterm Quiz Questions and Answers Quiz DOCX 15 KB
Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.