CS609 arranged by Amna. Handouts.pdf

Verified academic study resource for CS609 (System Programming) under the Computer Science at Virtual University of Pakistan. This PDF document (Official Lecture Handouts & Highlighted Notes) covers Complete Course Handouts (Lectures 1 to 45) spanning approximately 450 pages across 8 curriculum modules, and is indexed for student examination review with instant in-browser preview and 100% free direct download.

Course
CS609 – System Programming
Faculty
Computer Science
Format
PDF
Type
Handout
Coverage
Complete Course Handouts (Lectures 1 to 45)
Tags
HANDOUT

Virtual University examiners construct 100% of objective MCQs and subjective marking schemes directly from the official CS609 handouts.

What this file covers — CS609 syllabus roadmap

  1. Core Architecture, Syntax & Primitive Data Structures — Lectures 1 to 6 (Pages 1 to 65). 15% Objective Marks (8–10 MCQs)
  2. Conditional Branching, Loops & Logical Control Flow — Lectures 7 to 12 (Pages 66 to 140). 18% Exam Marks (MCQs + 2-Mark Short Questions)
  3. Memory Management, Pointers, Arrays & Functions — Lectures 13 to 18 (Pages 141 to 215). 22% Exam Marks (High Yield for Midterms)
  4. Midterm Consolidation, Strings & Algorithm Synthesis — Lectures 19 to 22 (Pages 216 to 280). Midterm Exam Culmination (Lectures 1–22 Scope)
  5. Object-Oriented Paradigms: Classes & Data Abstraction — Lectures 23 to 29 (Pages 281 to 360). 16% Final-Term Marks (Core OO Concepts)
  6. Inheritance Hierarchies & Dynamic Polymorphism — Lectures 30 to 36 (Pages 361 to 435). 20% Final-Term Marks (Virtual Functions & V-Tables)
  7. Templates, Standard Library & Persistent File I/O — Lectures 37 to 41 (Pages 436 to 510). 14% Final-Term Marks (Generic Code & Streams)
  8. Final-Term Examination Dossier & Capstone Synthesis — Lectures 42 to 45 (Pages 511 to 585). Final-Term Exam Synthesis (Lectures 23–45 Scope)

Frequently asked questions

Where can I download CS609 arranged by Amna. Handouts.pdf for free?

You can preview and download "CS609 arranged by Amna. Handouts.pdf" (CS609 PDF, ~450 pages) directly from the MIHORA VU Study Library (https://study.mihora.tech/doc/cs609-arranged-by-amna-handouts-pdf) with 100% free high-speed downloads and zero registration requirements.

What syllabus chapters and lectures are covered in this CS609 file?

This document covers Complete Course Handouts (Lectures 1 to 45) across 8 distinct lecture units (Lectures 1 to 6, Lectures 7 to 12, Lectures 13 to 18, Lectures 19 to 22, Lectures 23 to 29, Lectures 30 to 36, Lectures 37 to 41, Lectures 42 to 45), featuring comprehensive definitions, solved objective questions, and examiner marking rubrics.

What is the passing criteria for CS609 under the VU 20% Two-Half Rule?

Under official Virtual University regulations, students must score at least 20% in the First Half (Quizzes, Assignments, GDBs, and Midterm combined) AND independently at least 20% in the Final-Term examination paper. Scoring under 20% in the final exam results in an automatic F grade regardless of earlier marks.

Are CS609 solved past papers and handouts verified for 2026 exams?

Yes. All CS609 materials on MIHORA VU—including Moaaz, Waqar Siddhu, and team archives—are reviewed against the current VU syllabus to help students prepare for 2026 Midterm, Final-Term, and online quiz examinations.

Inside this file

                                                CS609
                            SYSTEM PROGRAMMING
                                            93 T0 165
                                  Arranged By Amna

Topic 93: Process Identities

Process identity can be obtained from the PROCESS_INFORMATION structure. The CreateProcess() API
returns the process information in its last parameter. This structure contains the child process handle
and id as well as the primary thread handle and id. Closing the child process handle does not destroys
the process. It only closes the access of the parent process to the child.

Let’s consider these pair of functions for this purpose:

HANDLE GetCurrentProcess (VOID)

DWORD GetCurrentProcessId(VOID)

GetCurrentProcess() is used to create a psuedohandle. It’s not inheritable and desired access attributes
are undefined. The actual handle can be obtained using Process Id. The OpenProcess() function is used
to obtain the process handle using the process ID obtained by GetCurrentProcessId() or otherwise.

HANDLE OpenProcess( DWORD dwDesiredAccess,

dwDesiredAccess provides the desired access attributes for the handle. Some of the commonly required
values can be

SYCHRONIZE : Allows process synchronization using wait()

PROCESS_ALL_ACCESS : All access flags are set.

PROCESS_TERMINATE: It’s possible to terminate the process with TerminateProcess

PROCESS_QUERY_INFORMATION: The handle can be used to query process information

bInheritHandle is used to specify whether the new process handle can be inherited.

The full pathname of the executable file used to run the process can be determined from

GetModuleFileName()

GetModuleFileNameEx()

Topic 94: Duplicating Handles

Parent and Child processes may require different access to an inheritable handle of resources. Parent
Process may also require real handle rather than a pseudohandle. Parent process usually creates a
duplicate handle to take care of this problem. Duplicate handles are created using

API DuplicateHandle()

BOOL DuplicateHandle( HANDLE hSourceProcessHandle,

HANDLE hSourceHandle,

HANDLE hTargetProcessHandle,

LPHANDLE lpTargetHandle,

DWORD dwDesiredAccess,

BOOL bInheritHandle,

DWORD dwOptions );

hSourceProcessHandle is the source process handle. lpTargetHandle receives a pointer to a copy of the
original handle indicated by hSourceHandle. The parent process duplicating the handle must have
PROCESS_DUP_HANDLE access. If the hSourceHandle does not exist in the source process then the
function will fail. The target handle received will only be valid in the process whose handle is specified in
hTargetProcessHandle.

Usually the handle is duplicated by the source or target process. In case it is duplicated by some other
process than a mechanism is required to communicate with the target process DuplicateHandle() can be
used to duplicate any sort of handle. dwOption can be combination of two flags.

DUPLICATE_CLOSE_SOURCE : causes the source handle to be closed

DUPLICATE_SAME_ACCESS: Uses the access rights of the source handle.

dwDesiredAccess is ignored, Reference Count. Windows keep track of all the handles created for a
resource. This count is not accessible to the application. A resource cannot be released unless the last
reference to the resource has been closed. Inherited and duplicated handles reflect on reference count.

Topic 95: Exiting and Terminating 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. However, a detach call is sent to
DllMain().

VOID ExitProcess(UINT uExitCode) ;

Exit Code

The exit code of the process can be determined using the API GetExitCodeProcess()

BOOL GetExitCodeProcess( HANDLE hProcess, LPDWORD lpExitCode );

The process identified by hProcess must have PROCESS_QUERY_INFORMATION flag set.

lpExitCode points to the dword that will receive the exit code of the given process.

One possible value of Exit code can be STILL_ACTIVE

Terminate Process

One process can terminate another process using the function TerminateProcess()

BOOL TerminateProcess( HANDLE hProcess, UINT uExitCode );

hProcess is the handle to the process to be terminated

uExitCode is the code returned by the process on termination.

Exiting and Terminating Process

Process must be exited and terminated carefully. All the handles need to be closed before exiting the
process. It’s not a good idea to use ExitProcess() within the program as it will not give it chance to
release resources. Use is with Exception handling. TerminateProcess() does not all the process to
execute SHE or DllMain().

Topic No.96

The synchronization can be attained easily by the wait process. Windows provides a general-
purpose wait function. Which can be used to wait for a single object and also multiple objects in
a group. Windows send a signal to the waiting process when the process terminates

We have two API's

  i.       DWORD waitForSingleObject(HANDLE hHandle, DWORD dwMilliseconds);
 ii.       DWORD waitForMultipleObjects(DWORD nCount, const HANDLE*lpHandles, BOOL
           bWaitAll,DWORD dwMilliseconds);

          hHandle is the single object for which the process waits.
          lpHandle is the array of handles for which the process waits.
          nCount is the number of objects in an array. Should not exceed MAXIMUM WAIT
           OBJECTS
          dwMilliseconds is the timeout period for wait. 0 for no wait and INFINITE for indefinite
           wait.
          bWaitAll describes if it's necessary to wait for all the objects to get free.

The possible return values are:

          WAIT_OBJECT_0
          WAIT_OBJECT_0+n
          WAIT_TIMEDOUT
          WAIT_FAILED
          WAIT_ABANDONED_0

Topic No.97

          Environment Block string
          An Environment Block is associated with each process.
          The EB contains string regarding the environment of the process of the form Name = Value
          Each string is NULL-terminated

More CS609 files

All CS609 files · Midterm Prep 2026 · MCQs Bank