1. Home
  2. Explore
  3. Computer Science
  4. Microsoft’s Early Beginnings

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Microsoft’s Early Beginnings

  • 85Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Company Origins

What made the Altair 8800 significant to Paul Allen and Bill Gates in 1975?

85 questions

  1. 1

    What made the Altair 8800 significant to Paul Allen and Bill Gates in 1975?

    1. A

      It described a new computer designed only for large research laboratories.

    2. B

      It announced that IBM had released the first version of Windows.

    3. C

      It showed a personal computer priced within reach of the consumer market.

    4. D

      It showed that MITS had hired Microsoft to write the Altair's operating system.

    Correct answer
    C

    It showed a personal computer priced within reach of the consumer market.

    Explanation

    Allen saw the Altair 8800 featured in Popular Electronics and recognized that a computer priced for consumers could create an opportunity for a software company.

  2. 2

    What did Bill Gates tell Ed Roberts about the Altair software before the team had actually completed it?

    1. A

      They said they had already founded Microsoft and licensed BASIC to MITS.

    2. B

      They claimed to have already written the operating system for the IBM PC.

    3. C

      They claimed to have a working BASIC interpreter for the Altair.

    4. D

      They said they had built a new computer that competed with the Altair.

    Correct answer
    C

    They claimed to have a working BASIC interpreter for the Altair.

    Explanation

    Gates told MITS CEO Ed Roberts that the pair had a working BASIC interpreter, although they did not yet have one. Roberts challenged them to demonstrate working software in Albuquerque.

  3. 3

    What condition did Ed Roberts set for awarding MITS's software-development contract?

    1. A

      The first company to build an operating system for IBM would get the contract.

    2. B

      The first group to demonstrate working software on an Altair in Albuquerque would get the contract.

    3. C

      The first group to send MITS a written BASIC proposal would get the contract.

    4. D

      The first group to deliver a consumer computer to Harvard would get the contract.

    Correct answer
    B

    The first group to demonstrate working software on an Altair in Albuquerque would get the contract.

    Explanation

    Roberts offered the contract to the first group that could arrive in Albuquerque with a working Altair demonstration. Paul Allen went alone and demonstrated the completed software two months later.

  4. 4

    According to the account, when did Allen and Gates found Microsoft?

    1. A

      They founded Microsoft before they began developing BASIC.

    2. B

      They founded Microsoft before Allen bought the magazine.

    3. C

      They founded Microsoft immediately after Gates called Roberts.

    4. D

      They founded Microsoft about a month after Allen's successful demonstration.

    Correct answer
    D

    They founded Microsoft about a month after Allen's successful demonstration.

    Explanation

    Allen and Gates founded Microsoft after Allen successfully demonstrated their software to MITS. The account places the founding about a month after the successful demonstration.

  5. 5

    How did Microsoft meet IBM's request for an operating system for the IBM PC?

    1. A

      Microsoft licensed Windows to IBM as the operating system for the IBM PC.

    2. B

      Microsoft bought 86-DOS, modified it, and licensed it to IBM as MS-DOS.

    3. C

      IBM bought MS-DOS from MITS and renamed it 86-DOS.

    4. D

      Microsoft wrote a new system from scratch and licensed it as Windows.

    Correct answer
    B

    Microsoft bought 86-DOS, modified it, and licensed it to IBM as MS-DOS.

    Explanation

    Microsoft acquired the existing system 86-DOS, modified it, and licensed the result to IBM as MS-DOS. Windows was later released as a graphical interface running on DOS.

  6. 6

    Which set of sizes matches the units defined in the content?

    1. A

      A byte is 8 bits, a word is 16 bits, and double and quadruple words are 32 and 64 bits.

    2. B

      A byte is 16 bits, a word is 8 bits, and a double word is 32 bits.

    3. C

      A byte is 8 bits, a word is 32 bits, and a double word is 64 bits.

    4. D

      A byte is 4 bits, a word is 16 bits, and double and quadruple words are 24 and 48 bits.

    Correct answer
    A

    A byte is 8 bits, a word is 16 bits, and double and quadruple words are 32 and 64 bits.

    Explanation

    A byte is eight bits. The word size described here is 16 bits, and double and quadruple words are two and four times that size.

  7. 7

    What is a process, and what is one purpose it serves?

    1. A

      A loaded, executing program is a page, which combines all applications into one address space.

    2. B

      A loaded, executing program is a process, which helps isolate its resources from those of other applications.

    3. C

      A loaded, executing program is a section, which describes only its executable code.

    4. D

      A loaded, executing program is a thread, which guarantees that it has exclusive access to physical memory.

    Correct answer
    B

    A loaded, executing program is a process, which helps isolate its resources from those of other applications.

    Explanation

    Once loaded into memory, an executing program is called a process. The process abstraction helps the system isolate the resources used by each running application.

  8. 8

    Why do modern operating systems use virtual memory rather than let processes freely navigate physical memory?

    1. A

      It avoids the safety and management problems of letting processes freely access physical memory.

    2. B

      It makes every process use the same physical addresses and prevents memory sharing.

    3. C

      It prevents the CPU from executing application instructions and eliminates the need for memory tables.

    4. D

      It ensures that each process receives its own physical memory chips, simplifying hardware design.

    Correct answer
    A

    It avoids the safety and management problems of letting processes freely access physical memory.

    Explanation

    Allowing applications to access physical memory freely would be unsafe because one program could read or alter anything, and difficult to manage. Virtual memory gives processes separate address spaces.

  9. 9

    What role do virtual addresses play in the described memory system?

    1. A

      Virtual addresses index tables that describe pages associated with a process.

    2. B

      Virtual addresses directly identify physical bytes and eliminate the need for page tables.

    3. C

      Virtual addresses identify only files, while physical addresses identify processes.

    4. D

      Virtual addresses are used only by the kernel and cannot refer to application memory.

    Correct answer
    A

    Virtual addresses index tables that describe pages associated with a process.

    Explanation

    Virtual addresses index tables that describe memory chunks, called pages, associated with a process. This arrangement gives each process its own address space while allowing mappings to be managed by the system.

  10. 10

    Which description matches the page-table structure described for virtual-address translation?

    1. A

      There are three levels with 256 entries each, and every table is 2048 bytes.

    2. B

      There are five levels with 512 entries each, and every table is 4096 bytes.

    3. C

      There are four levels with 512 entries each, and every table is 4096 bytes.

    4. D

      There are four levels with 1024 entries each, and every table is 8192 bytes.

    Correct answer
    C

    There are four levels with 512 entries each, and every table is 4096 bytes.

    Explanation

    The described translation uses four levels of tables. Each table has 512 entries, and each entry is 64 bits, making a table 4096 bytes long.

  11. 11

    How are the address bits divided in the described four-level translation scheme?

    1. A

      Two groups of 9 bits index two table levels, and the final 46 bits identify a physical page.

    2. B

      Three groups of 12 bits index three table levels, and the final 16 bits offset within a page.

    3. C

      Four groups of 12 bits index the four table levels, and the final 9 bits offset within a page.

    4. D

      Four groups of 9 bits index the four table levels, and the final 12 bits offset within a page.

    Correct answer
    D

    Four groups of 9 bits index the four table levels, and the final 12 bits offset within a page.

    Explanation

    Nine bits select an entry at each of the four table levels, for 36 bits of indexing. The final 12 bits select a byte within a 4096-byte page.

  12. 12

    Why do the last 12 bits of a virtual address select the offset within a standard page?

    1. A

      Because a page is 2048 bytes, which requires 11 offset bits.

    2. B

      Because a page is 512 bytes, which requires 9 offset bits.

    3. C

      Because a page is 8192 bytes, which requires 13 offset bits.

    4. D

      Because a page is 4096 bytes, which requires 12 offset bits.

    Correct answer
    D

    Because a page is 4096 bytes, which requires 12 offset bits.

    Explanation

    A standard page is 4096 bytes, which is 2122^{12}212. Thus, 12 address bits provide the byte offset within that page.

  13. 13

    Which page sizes are described?

    1. A

      Standard pages are 4 KB, while huge and giant pages are 2 MB and 1 GB.

    2. B

      Standard pages are 1 GB, while huge and giant pages are 4 KB and 2 MB.

    3. C

      Standard pages are 2 MB, while huge and giant pages are 4 KB and 1 GB.

    4. D

      Standard pages are 4 KB, while huge and giant pages are 1 MB and 2 GB.

    Correct answer
    A

    Standard pages are 4 KB, while huge and giant pages are 2 MB and 1 GB.

    Explanation

    The standard page size is 4 KB. The system may also use huge pages of 2 MB or giant pages of 1 GB, although those are not the focus of the account.

  14. 14

    Why can page-table entries encode permissions as well as addresses?

    1. A

      They reserve all remaining bits to store the contents of the page itself.

    2. B

      They leave some bits available for information such as whether a page is writable or executable.

    3. C

      They use half their bits for a process ID and cannot describe access permissions.

    4. D

      They use all 64 bits for a physical address, so page permissions must be stored in the CPU cache.

    Correct answer
    B

    They leave some bits available for information such as whether a page is writable or executable.

    Explanation

    Although page-table entries are 64 bits, they do not use all those bits for an address. Remaining bits can encode properties such as whether a page is executable or writable.

  15. 15

    How can processes share a dynamic library while retaining separate virtual address spaces?

    1. A

      Different processes can map the same physical pages into their separate address spaces.

    2. B

      A library is shared by copying its bytes into each process whenever it is executed.

    3. C

      Processes share a single virtual address space, so their page tables are unnecessary.

    4. D

      Each process stores a separate physical copy, while the operating system shares only the library's name.

    Correct answer
    A

    Different processes can map the same physical pages into their separate address spaces.

    Explanation

    Separate virtual address spaces do not prevent sharing: page tables in different processes can point to the same physical page. This is used to share dynamic libraries and reduce physical-memory use.

  16. 16

    What happens when a process writes to a shared page marked copy-on-write?

    1. A

      The system rejects all writes to shared pages and terminates the writing process.

    2. B

      The system copies the shared page on a write and redirects the writing process to the copy.

    3. C

      The writing process changes the shared physical page, and other processes receive a new copy afterward.

    4. D

      The system immediately copies each shared page for every process when the library is loaded.

    Correct answer
    B

    The system copies the shared page on a write and redirects the writing process to the copy.

    Explanation

    With copy-on-write, a write to a shared page causes the system to copy the page to a fresh physical page and update the writing process's mapping. Other processes continue using the unmodified original page.

  17. 17

    How does Windows protect system code that is mapped into applications' virtual address spaces?

    1. A

      The system code is mapped into user memory with no restrictions so applications can call it directly.

    2. B

      The system code may be mapped into each process, but kernel-marked pages require privileged mode.

    3. C

      The system code is copied into each process's writable code section and runs in ring 3.

    4. D

      The system code is accessible only through physical addresses and never appears in a process mapping.

    Correct answer
    B

    The system code may be mapped into each process, but kernel-marked pages require privileged mode.

    Explanation

    Windows can map system code into the upper part of each application's virtual address space, but kernel-marked pages are accessible only in privileged mode. A user-mode access to them causes an exception.

  18. 18

    Which statement correctly describes the protection rings discussed?

    1. A

      All four rings are used equally, with ring 3 having the greatest privileges.

    2. B

      Ring 3 is user mode, ring 0 is kernel mode, and rings 1 and 2 are unused in modern systems.

    3. C

      Ring 2 is user mode and ring 1 is kernel mode, while rings 0 and 3 are reserved.

    4. D

      Ring 0 is user mode, ring 3 is kernel mode, and rings 1 and 2 run device drivers.

    Correct answer
    B

    Ring 3 is user mode, ring 0 is kernel mode, and rings 1 and 2 are unused in modern systems.

    Explanation

    Protection rings use privilege levels to restrict sensitive instructions and data. Ring 3 is user mode and ring 0 is kernel mode; rings 1 and 2 are not used in the described modern systems.

  19. 19

    How does a user-mode program request a privileged operation through a system call?

    1. A

      The program supplies a service number and invokes syscall, which transfers control to the kernel handler.

    2. B

      The program writes a function address into a page table, and the CPU calls it without changing privilege.

    3. C

      The program invokes CreateProcess directly in kernel mode, bypassing system-call dispatch.

    4. D

      The program places an operation in the RFLAGS register, and the scheduler chooses a handler.

    Correct answer
    A

    The program supplies a service number and invokes syscall, which transfers control to the kernel handler.

    Explanation

    A user-mode program specifies the requested operation using a service number and invokes the syscall instruction. The handler uses the number to select the appropriate function through the system service dispatch table.

  20. 20

    What is the service number used for in the described system-call mechanism?

    1. A

      The service number indexes the SSDT to select the function for the requested operation.

    2. B

      The service number is a return address stored in the current thread's stack frame.

    3. C

      The service number identifies a physical memory page in the process's working set.

    4. D

      The service number is an access token that grants permission to every kernel function.

    Correct answer
    A

    The service number indexes the SSDT to select the function for the requested operation.

    Explanation

    The system call handler uses the service number as an index into the system service dispatch table (SSDT) to find the function that handles the requested operation.

  21. 21

    Which statement best describes the cache hierarchy outlined in the content?

    1. A

      L2 and L3 are registers, while L1 stores only instructions for the control unit.

    2. B

      L1 is the largest shared cache, while L3 is the smallest cache dedicated to each core.

    3. C

      L3 is shared among cores, and each core has L2 and L1 caches; lower-numbered levels are smaller and faster.

    4. D

      Each core has a shared L3 cache, while L1 and L2 are shared among all cores.

    Correct answer
    C

    L3 is shared among cores, and each core has L2 and L1 caches; lower-numbered levels are smaller and faster.

    Explanation

    The L3 cache is shared among cores. Each core also has L2 and L1 caches; lower-numbered cache levels are smaller but faster, and caches hold frequently used data and instructions.

  22. 22

    What are the roles of the control unit and the ALU in the simplified CPU description?

    1. A

      The register file schedules threads, while the control unit performs all arithmetic.

    2. B

      The MMU directs arithmetic operations, while the ALU translates virtual addresses.

    3. C

      The control unit fetches and directs instructions, while the ALU performs arithmetic and logical operations.

    4. D

      The ALU fetches instructions, while the control unit stores frequently used data.

    Correct answer
    C

    The control unit fetches and directs instructions, while the ALU performs arithmetic and logical operations.

    Explanation

    The control unit fetches instructions and directs them to execution units. An ALU is an execution unit that performs arithmetic and logical operations.

  23. 23

    Which pairing of CPU component and role is accurate?

    1. A

      The MMU schedules processes, while registers store only executable instructions.

    2. B

      The MMU performs arithmetic operations, while registers manage physical memory pages.

    3. C

      The MMU handles memory, including virtual memory, while registers hold data for the current execution context.

    4. D

      The MMU stores function return values, while registers translate virtual addresses into files.

    Correct answer
    C

    The MMU handles memory, including virtual memory, while registers hold data for the current execution context.

    Explanation

    The MMU handles memory-related operations, including virtual memory. Registers are small, fast storage units that hold data needed in the current execution context.

  24. 24

    What does RIP indicate, and how does a two-core CPU relate to simultaneous execution?

    1. A

      RIP points to the current instruction, and separate cores can execute instructions simultaneously.

    2. B

      RIP points to the top of the thread stack, and only one core can execute at a time.

    3. C

      RIP stores the process ID, and its value is shared by all cores.

    4. D

      RIP stores a function's return value, and each core must execute the same instruction.

    Correct answer
    A

    RIP points to the current instruction, and separate cores can execute instructions simultaneously.

    Explanation

    RIP is the instruction pointer and identifies the instruction currently being executed by a core. With two cores, the hypothetical CPU can execute two instructions simultaneously.

  25. 25

    Which statement about RAX and EAX matches the described register conventions?

    1. A

      EAX is an independent 32-bit register, and RAX must hold the instruction pointer.

    2. B

      EAX accesses the low 16 bits of RAX, and RAX is reserved for virtual addresses.

    3. C

      EAX accesses the low 32 bits of RAX, and RAX is commonly used for a function's return value.

    4. D

      EAX accesses the high 32 bits of RAX, which is required to hold a function's first argument.

    Correct answer
    C

    EAX accesses the low 32 bits of RAX, and RAX is commonly used for a function's return value.

    Explanation

    EAX accesses the low 32 bits of RAX. Registers such as RAX and RCX have no mandatory special purpose, although conventions commonly use RAX for a function's return value.

  26. 26

    Which description of RFLAGS and its user-mode accessibility is correct?

    1. A

      RFLAGS stores thread identifiers, and every bit is freely writable in user mode.

    2. B

      RFLAGS encodes conditions and configuration; its zero flag indicates a tested zero value, and user mode can access EFLAGS.

    3. C

      RFLAGS stores stack frames, and its zero flag is set when the instruction pointer is zero.

    4. D

      RFLAGS stores the process's page tables, and the zero flag indicates kernel mode.

    Correct answer
    B

    RFLAGS encodes conditions and configuration; its zero flag indicates a tested zero value, and user mode can access EFLAGS.

    Explanation

    RFLAGS is a bitfield for CPU conditions and configuration. The zero flag is its sixth bit in the described account and is set when a tested register's value is zero; only the EFLAGS part is accessible in user mode.

  27. 27

    How are segment registers used in modern systems according to the content?

    1. A

      Segmentation replaced virtual memory, so segment registers now identify physical pages.

    2. B

      Segment registers schedule threads and store their return values.

    3. C

      Segment registers are exclusively used for application arithmetic and cannot hold pointers.

    4. D

      Virtual memory made segmentation obsolete, and operating systems use segment registers for useful system-related pointers and structures.

    Correct answer
    D

    Virtual memory made segmentation obsolete, and operating systems use segment registers for useful system-related pointers and structures.

    Explanation

    Segmentation became obsolete with virtual memory. Modern operating systems repurpose segment registers to hold useful pointers and system-related structures.

  28. 28

    Which choice correctly relates CR3 and a thread?

    1. A

      CR3 points to the current instruction, while a thread is a dynamically linked library.

    2. B

      CR3 identifies the first-level translation tables, while a thread represents an execution context with associated register values.

    3. C

      CR3 stores the system-call number, while a thread represents a process's access token.

    4. D

      CR3 stores the current stack frame, while a thread represents a physical memory page.

    Correct answer
    B

    CR3 identifies the first-level translation tables, while a thread represents an execution context with associated register values.

    Explanation

    CR3 stores the current program's first-level page-table address used for translating virtual addresses. A thread is an execution context associated with a particular CPU register state.

  29. 29

    Which description of thread stacks, stack frames, RSP, and RBP is accurate?

    1. A

      Each thread's stack stores only code, with RSP pointing to its base and RBP to the next instruction.

    2. B

      Each process has an unlimited stack for files, and RSP points to the frame base while RBP points to the stack top.

    3. C

      Each thread has a fixed-size stack for arguments and locals, with RSP pointing to its top and RBP to the current frame's base.

    4. D

      Each function shares one system-wide stack, with RSP holding its return value and RBP holding its arguments.

    Correct answer
    C

    Each thread has a fixed-size stack for arguments and locals, with RSP pointing to its top and RBP to the current frame's base.

    Explanation

    Each thread has a fixed-size, readable and writable stack for function arguments and local variables. A stack frame is the portion reserved for a particular function; RSP points to the stack top and RBP to the current frame's base.

  30. 30

    Which sequence best describes function-call stack behavior in the example?

    1. A

      A call saves a return address and sets up a frame; return restores the prior frame and returns via the saved address.

    2. B

      A call saves only local variables, and return copies the stack into the heap for later execution.

    3. C

      A call places all arguments in the heap, and return discards the thread's entire fixed-size stack.

    4. D

      A call saves the instruction pointer in RAX, and return restores it from the process's page table.

    Correct answer
    A

    A call saves a return address and sets up a frame; return restores the prior frame and returns via the saved address.

    Explanation

    A function call saves a return address and the previous base pointer, sets up a new frame, and reserves space for local data. On return, restoring the old base pointer leaves the return address to be popped into the instruction pointer; large data is better suited to the heap.

  31. 31

    Which statement captures the caveats about stacks, calling conventions, and heap allocation?

    1. A

      The heap is the fixed-size area for local variables, while the stack stores large images.

    2. B

      Modern stacks must be accessed last-in, first-out, and all functions use one calling convention.

    3. C

      The stack is commonly LIFO but need not be used strictly that way; conventions vary, and large data generally belongs on the heap.

    4. D

      Every function uses the same calling convention, and stack memory is appropriate for arbitrarily large data.

    Correct answer
    C

    The stack is commonly LIFO but need not be used strictly that way; conventions vary, and large data generally belongs on the heap.

    Explanation

    A stack is commonly described as last-in, first-out, but modern thread stacks need not be accessed strictly in that order. Calling conventions can also differ, and large data is typically stored on the heap rather than the fixed-size stack.

  32. 32

    What are the DOS header and DOS stub in a PE file?

    1. A

      The DOS header is the initial PE information, and the DOS stub is a small legacy program often displaying a DOS-mode message.

    2. B

      The DOS header stores only section permissions, and the DOS stub is a dynamically linked library.

    3. C

      The NT headers precede the DOS header, and the DOS stub contains the modern Windows entry point.

    4. D

      The DOS stub is the initial PE information, and the DOS header stores the program's imported functions.

    Correct answer
    A

    The DOS header is the initial PE information, and the DOS stub is a small legacy program often displaying a DOS-mode message.

    Explanation

    A PE executable begins with a DOS header. It provides information such as the location of the NT headers, while the DOS stub is a small 16-bit program commonly displaying a message that the program cannot run in DOS mode.

  33. 33

    Which statement correctly distinguishes the PE file header from the optional header?

    1. A

      The file header gives information such as architecture, while the important optional header includes information such as code location.

    2. B

      The NT headers contain only the DOS stub and a list of loaded DLLs.

    3. C

      The optional header identifies the system-call handler, while the file header contains the process ID.

    4. D

      The file header stores only permissions, while the optional header is unnecessary for loading.

    Correct answer
    A

    The file header gives information such as architecture, while the important optional header includes information such as code location.

    Explanation

    The NT headers include the file header and optional header. The file header contains information such as target architecture and creation time; despite its name, the optional header contains important details such as where code begins.

  34. 34

    What information does a PE section table provide?

    1. A

      The section table lists process threads and gives each thread a stack size.

    2. B

      The section table stores only the executable's creation date and target architecture.

    3. C

      The section table lists imported functions and specifies which system calls they invoke.

    4. D

      The section table describes sections by name, size, and attributes such as read, write, and execute permissions.

    Correct answer
    D

    The section table describes sections by name, size, and attributes such as read, write, and execute permissions.

    Explanation

    The section table lists sections and their names, sizes, and attributes. Attributes specify whether section data can be read, written, or executed, supporting protections such as keeping code non-writable.

  35. 35

    What are the typical purposes of the .text, .data, and .rdata sections?

    1. A

      .text stores executable code, .data stores writable data, and .rdata stores read-only data.

    2. B

      .text stores imported DLL names, .data stores kernel code, and .rdata stores thread stacks.

    3. C

      .text stores writable data, .data stores read-only data, and .rdata stores executable code.

    4. D

      .text stores read-only data, .data stores executable code, and .rdata stores writable data.

    Correct answer
    A

    .text stores executable code, .data stores writable data, and .rdata stores read-only data.

    Explanation

    The .text section holds executable code, .data holds writable data, and .rdata holds data intended to be read-only. Writing to a non-writable section can cause an access violation.

  36. 36

    What role does explorer.exe play when a user launches an application from the desktop?

    1. A

      Explorer.exe handles the desktop and invokes CreateProcess when a user launches an application.

    2. B

      NTDLL displays the taskbar and maps the executable's sections into memory.

    3. C

      The scheduler displays the desktop and invokes CreateFile to launch the application.

    4. D

      CSRSS displays the desktop and invokes NtCreateUserProcess directly for every double-click.

    Correct answer
    A

    Explorer.exe handles the desktop and invokes CreateProcess when a user launches an application.

    Explanation

    Explorer.exe handles actions such as displaying the desktop and launching a program selected by the user. It invokes the Windows API function CreateProcess to begin execution of an application such as Notepad.

  37. 37

    Why are Windows API libraries distributed across multiple files, and what is one advantage of dynamic linking?

    1. A

      The Windows API is the SSDT, and static linking gives applications kernel-mode privileges.

    2. B

      The Windows API is one kernel function, and static linking makes every program share that function in memory.

    3. C

      The Windows API is a PE section, and dynamic linking copies all DLL contents into each executable.

    4. D

      The Windows API consists of utilities distributed across libraries; dynamic linking helps avoid embedding the same library in multiple executables.

    Correct answer
    D

    The Windows API consists of utilities distributed across libraries; dynamic linking helps avoid embedding the same library in multiple executables.

    Explanation

    The Windows API is a collection of utilities for interacting with the operating system. It is split across libraries, which programs can link statically or dynamically; dynamic linking lets multiple programs use shared libraries instead of embedding each library's contents in every executable.

  38. 38

    What is the principal difference between Windows API function variants ending in A and W?

    1. A

      W functions use wide strings, while A functions use regular strings and generally convert them as needed.

    2. B

      A functions use wide strings, while W functions use regular strings and cannot perform conversions.

    3. C

      W functions open files, while A functions create only memory-backed sections.

    4. D

      A functions use system calls, while W functions are restricted to kernel-mode callers.

    Correct answer
    A

    W functions use wide strings, while A functions use regular strings and generally convert them as needed.

    Explanation

    The A and W variants are distinguished by string encoding: W functions use wide strings, while A functions handle regular strings and typically convert them to wide strings internally. The variants are maintained for compatibility and simplicity.

  39. 39

    What inconsistency in failure checks does the file-mapping example illustrate?

    1. A

      CreateFile returns nullptr on failure, while CreateFileMapping returns negative one.

    2. B

      Both functions indicate failure by returning the same invalid-handle value.

    3. C

      CreateFile is checked against INVALID_HANDLE_VALUE, while CreateFileMapping is checked against nullptr.

    4. D

      Both functions indicate failure only by returning the value zero.

    Correct answer
    C

    CreateFile is checked against INVALID_HANDLE_VALUE, while CreateFileMapping is checked against nullptr.

    Explanation

    In the example, CreateFile returns INVALID_HANDLE_VALUE on failure, whereas CreateFileMapping is checked against nullptr. The differing conventions illustrate why callers must check each function's documentation carefully.

  40. 40

    Which sequence describes the file-backed mapping example?

    1. A

      The code creates a page-backed section, maps it into the kernel, and copies its contents into the executable.

    2. B

      The code maps a DLL without a section object and uses FlushViewOfFile to resolve its imports.

    3. C

      The code opens the file, creates a file-backed section, maps it, and flushes modifications back to the file.

    4. D

      The code opens the file as a thread, creates a process object, and uses FlushViewOfFile to close its handle.

    Correct answer
    C

    The code opens the file, creates a file-backed section, maps it, and flushes modifications back to the file.

    Explanation

    CreateFile opens or creates a file and returns a handle. CreateFileMapping creates a file-backed section through NtCreateSection, MapViewOfFile maps its pages into the process, and FlushViewOfFile writes modified mapped pages back to the file.

  41. 41

    Which description of the Windows kernel-mode architecture is accurate?

    1. A

      The executive contains higher-level components, the kernel includes lower-level features such as scheduling, and the HAL is hardware-specific.

    2. B

      The HAL is the Windows API, while the executive and kernel both run exclusively in user mode.

    3. C

      The executive is the lowest hardware-specific layer, while the HAL contains the memory manager and object manager.

    4. D

      The kernel contains only user processes, while the executive consists of device drivers and the scheduler.

    Correct answer
    A

    The executive contains higher-level components, the kernel includes lower-level features such as scheduling, and the HAL is hardware-specific.

    Explanation

    Windows separates user-mode and kernel-mode components. The executive contains higher-level components such as the memory and object managers; the kernel includes lower-level features such as the scheduler; drivers support devices; and the HAL provides architecture-specific hardware abstraction.

  42. 42

    What is a subsystem DLL, and what kind of functionality does user32 provide?

    1. A

      Subsystem DLLs are kernel drivers, and user32 provides virtual-memory translation.

    2. B

      Subsystem DLLs contain the scheduler, and user32 provides access to the SSDT.

    3. C

      Subsystem DLLs are executable sections, and user32 stores the system working set.

    4. D

      Subsystem DLLs expose subsets of the Windows API, and user32 supports graphical interfaces and user input.

    Correct answer
    D

    Subsystem DLLs expose subsets of the Windows API, and user32 supports graphical interfaces and user input.

    Explanation

    Subsystem DLLs expose subsets of the Windows API: user32, for example, provides functions for graphical interfaces and user input. Many subsystem functions ultimately invoke NTDLL routines.

  43. 43

    How are kernel32.dll and kernelbase.dll related?

    1. A

      Kernel32 is retained for compatibility, while kernelbase is the modern replacement that many kernel32 functions forward to.

    2. B

      Kernel32 contains the scheduler, while kernelbase contains the device drivers.

    3. C

      Kernel32 and kernelbase are separate system-call dispatch tables with no forwarding.

    4. D

      Kernelbase is the legacy library, while kernel32 is its modern replacement.

    Correct answer
    A

    Kernel32 is retained for compatibility, while kernelbase is the modern replacement that many kernel32 functions forward to.

    Explanation

    Kernel32 is a legacy version retained for backward compatibility, while kernelbase is the intended modern replacement. Many kernel32 functions forward to kernelbase.

  44. 44

    Which pairing of NTDLL function prefixes and their roles is accurate?

    1. A

      NT functions are user-interface routines, Zw functions are device drivers, and Rtl functions are system processes.

    2. B

      NT functions wrap system calls, Zw functions serve certain kernel-code uses, and Rtl functions provide runtime helpers.

    3. C

      NT functions manage files only, Zw functions handle audits, and Rtl functions invoke every system call.

    4. D

      NT functions schedule threads, Zw functions load DLLs, and Rtl functions create page tables.

    Correct answer
    B

    NT functions wrap system calls, Zw functions serve certain kernel-code uses, and Rtl functions provide runtime helpers.

    Explanation

    NT routines in NTDLL are system-call wrappers. Zw routines implement equivalent system calls for kernel code in certain cases, and Rtl routines provide helper functions that may or may not make system calls.

  45. 45

    Why might a program use a subsystem DLL function rather than call an NTDLL routine directly?

    1. A

      NTDLL routines cannot make system calls, so wrappers are required to give them kernel privileges.

    2. B

      Programs often use subsystem wrappers because they provide conveniences such as argument validation and error handling.

    3. C

      Subsystem wrappers are necessary because DLLs cannot be dynamically linked.

    4. D

      Programs avoid NTDLL because it contains only graphical interface functions.

    Correct answer
    B

    Programs often use subsystem wrappers because they provide conveniences such as argument validation and error handling.

    Explanation

    Higher-level subsystem wrappers often provide argument parsing, validation, or error handling, so programs commonly use them instead of calling NTDLL routines directly for convenience and simplicity.

  46. 46

    What distinguishes service processes from system processes in the account?

    1. A

      Service processes are always stopped at the lock screen, while system processes are created only by applications.

    2. B

      Service processes manage user-interface windows, while system processes contain shared DLLs.

    3. C

      Service processes execute only kernel code, while system processes are ordinary desktop applications.

    4. D

      Service processes generally run outside a logged-in user's context, while system processes have defined system purposes.

    Correct answer
    D

    Service processes generally run outside a logged-in user's context, while system processes have defined system purposes.

    Explanation

    Service processes generally do not run in the context of a logged-in user; Windows Defender is an example. System processes have specific system-related purposes; the logon manager is an example.

  47. 47

    Which sequence connects CreateProcess to the NtCreateUserProcess system call?

    1. A

      CreateProcess directly allocates the EPROCESS, while CreateProcessInternalW only displays errors.

    2. B

      CreateProcess calls CreateProcessInternalW, which prepares arguments and invokes NtCreateUserProcess through NTDLL.

    3. C

      CreateProcessInternalW is the kernel system-call handler that calls CreateProcess in user32.

    4. D

      NtCreateUserProcess calls CreateProcessInternalW after the kernel has finished creating a process.

    Correct answer
    B

    CreateProcess calls CreateProcessInternalW, which prepares arguments and invokes NtCreateUserProcess through NTDLL.

    Explanation

    CreateProcess in kernelbase.dll initiates the process-launch path, but CreateProcessInternalW gathers and formats arguments before invoking NTDLL's NtCreateUserProcess system-call wrapper.

  48. 48

    Where does the described system-call dispatcher reside, and what is its name?

    1. A

      The dispatcher is in CSRSS, with the system-call functions stored in the PE section table.

    2. B

      The dispatcher is in explorer.exe, with the system-call functions stored in kernel32.dll.

    3. C

      The dispatcher is in the HAL, with the system-call functions stored in the process's PEB.

    4. D

      The dispatcher and system-call processing functions are in ntoskrnl.exe, with the dispatcher named KiSystemCall64.

    Correct answer
    D

    The dispatcher and system-call processing functions are in ntoskrnl.exe, with the dispatcher named KiSystemCall64.

    Explanation

    The system-call dispatcher and the functions that process system-call operations are in ntoskrnl.exe. The dispatcher is identified in the account as KiSystemCall64.

  49. 49

    What processor-specific structures are involved in the described swapgs step?

    1. A

      It uses swapgs to load CR3 from the user stack, which points to the process's PEB.

    2. B

      It uses syscall to exchange RFLAGS with the SSDT, which points to the session working set.

    3. C

      It uses swapgs to exchange GS with IA32_KERNEL_GS_BASE, which points to the per-processor KPCR.

    4. D

      It uses sysret to load the KPRCB from the executable's import directory.

    Correct answer
    C

    It uses swapgs to exchange GS with IA32_KERNEL_GS_BASE, which points to the per-processor KPCR.

    Explanation

    KiSystemCall64 executes swapgs to exchange the GS value with the IA32_KERNEL_GS_BASE model-specific register, which points to the per-processor KPCR. The KPCR contains processor-specific data and includes a KPRCB.

  50. 50

    Why and how does the system-call path switch stacks?

    1. A

      It switches to the executable's stack frame and uses RBP to identify the process's DLLs.

    2. B

      It saves the old stack pointer, switches to the processor's kernel stack, and sets up the base pointer.

    3. C

      It uses one shared stack for all processors and saves the old pointer in the SSDT.

    4. D

      It replaces the user stack with the process heap and stores the old stack pointer in the PEB.

    Correct answer
    B

    It saves the old stack pointer, switches to the processor's kernel stack, and sets up the base pointer.

    Explanation

    The handler saves the old stack pointer and switches to a kernel stack associated with the processor, preserving isolation between user-mode and kernel-mode execution. It also saves and sets up the base pointer for the handler's work.

  51. 51

    How does the handler select and finish a system-call operation?

    1. A

      It uses the process ID to find a DLL in the PEB, then returns with the syscall instruction.

    2. B

      It uses the thread stack pointer to search the section table, then returns with an access violation.

    3. C

      It uses the service number to select a PE section, then restores state by executing CreateProcess.

    4. D

      It uses the service number to select the system-call function through the SSDT, then restores state and returns with sysret.

    Correct answer
    D

    It uses the service number to select the system-call function through the SSDT, then restores state and returns with sysret.

    Explanation

    KiSystemServiceStart accesses the service descriptor information and uses the system-call number to index the SSDT, whose entries identify system-call functions. After the operation, the handler restores saved state, swaps GS back, and executes sysret.

  52. 52

    What is a Windows object, and what does the object manager do?

    1. A

      It represents a virtual address, and the scheduler removes it when its thread is preempted.

    2. B

      It represents an access control list, and the HAL removes it when a device is unplugged.

    3. C

      It represents a tracked resource, and the object manager uses its header and counts to manage its lifetime.

    4. D

      It represents a system-call number, and the SSDT manages its lifetime.

    Correct answer
    C

    It represents a tracked resource, and the object manager uses its header and counts to manage its lifetime.

    Explanation

    A Windows object represents a tracked resource such as a process, file, or thread. Objects share an object header, and the object manager controls their lifetimes; when relevant counts reach zero, it can remove a nonpermanent object.

  53. 53

    What role do object-header counts and the permanent flag play in object lifetime?

    1. A

      Object headers store the object's page contents, and objects are deleted when the process exits.

    2. B

      Object headers store only a process name, and objects are deleted when the working set reaches zero.

    3. C

      Object headers can contain reference and handle counts, and zero counts permit deletion unless the object is permanent.

    4. D

      Object headers contain only an access mask, and zero counts make an object permanent.

    Correct answer
    C

    Object headers can contain reference and handle counts, and zero counts permit deletion unless the object is permanent.

    Explanation

    Object headers contain values such as reference and handle counts. When the relevant counts reach zero, the object manager can remove the object unless it is marked permanent through its flags.

  54. 54

    What is a handle, and where are a process's open handles kept?

    1. A

      A handle is a system-call number stored in a shared global table for all processes.

    2. B

      A handle is a physical address that lets any process access an object without permissions.

    3. C

      A handle is a permission-bearing way for a process to interact with an object, and handles are kept in a process-associated table.

    4. D

      A handle is a copy of an object stored in the process's address space.

    Correct answer
    C

    A handle is a permission-bearing way for a process to interact with an object, and handles are kept in a process-associated table.

    Explanation

    User-mode processes interact with Windows objects through handles rather than direct access. A handle acts as a permission-bearing key, and a process's open handles are stored in a table associated with that process.

  55. 55

    How does object use differ between user-mode and kernel-mode code?

    1. A

      Both user and kernel mode use handles exclusively and never change reference counts.

    2. B

      User mode can access all objects directly, while kernel mode must open a handle to each object.

    3. C

      User mode uses ObDereferenceObject, while kernel mode must call CloseHandle for every object.

    4. D

      User mode closes finished handles with CloseHandle; kernel mode can adjust object references directly.

    Correct answer
    D

    User mode closes finished handles with CloseHandle; kernel mode can adjust object references directly.

    Explanation

    User-mode code should call CloseHandle when done with a handle so the object manager can account for the object's use. Kernel-mode code can directly access objects and instead use ObReferenceObject and ObDereferenceObject to adjust the reference count.

  56. 56

    What information do a security descriptor, SACL, and DACL provide?

    1. A

      A security descriptor stores object contents and points to two identical lists of handles.

    2. B

      A security descriptor stores page-table addresses and points to a SACL for permissions and a DACL for auditing.

    3. C

      A security descriptor is an access token and points to a SACL for process creation and a DACL for scheduling.

    4. D

      A security descriptor includes ownership information and points to a SACL for auditing and a DACL for permissions.

    Correct answer
    D

    A security descriptor includes ownership information and points to a SACL for auditing and a DACL for permissions.

    Explanation

    A security descriptor includes security information such as an object's owner and points to a SACL and a DACL. The SACL controls audit logging, while the DACL describes who has which permissions.

  57. 57

    What do ACE types and masks specify within an access control list?

    1. A

      An ACL contains page-table entries, and its mask specifies whether a page is executable.

    2. B

      An ACL contains ACEs that grant or deny access, with a mask specifying the affected permissions.

    3. C

      An ACL contains handles, and its mask specifies whether an object is permanent.

    4. D

      An ACL contains SIDs only, and its mask specifies the object's reference count.

    Correct answer
    B

    An ACL contains ACEs that grant or deny access, with a mask specifying the affected permissions.

    Explanation

    An ACL contains zero or more ACEs. Access-allowed ACEs grant access, access-denied ACEs deny access, and an ACE's mask specifies the permissions being granted or denied for its identified user or entity.

  58. 58

    How are the access-mask bits divided in the described ACE format?

    1. A

      The first 4 bits are object-specific, the next 4 standard, and all remaining bits store the object's name.

    2. B

      The first 8 bits are generic rights, the next 16 are standard rights, and the final 8 identify a SID.

    3. C

      The first 16 bits are object-specific, the next 8 standard, 4 can be ignored, and the final 4 generic rights.

    4. D

      The first 16 bits identify the object, the next 8 identify the owner, and the final 8 store audit results.

    Correct answer
    C

    The first 16 bits are object-specific, the next 8 standard, 4 can be ignored, and the final 4 generic rights.

    Explanation

    The first 16 bits of the mask are object-specific rights, the next 8 are standard rights, 4 following bits can be ignored in the account, and the final 4 represent generic rights such as read, write, execute, or all.

  59. 59

    What is a SID, and how should its displayed string format be understood?

    1. A

      A SID is a library name, and its S prefix indicates that it is a system process.

    2. B

      A SID uniquely identifies an authenticated entity, and its displayed S and hyphens are for readability.

    3. C

      A SID is a process's handle table, and its hyphens separate physical addresses.

    4. D

      A SID is an audit record, and its hyphens separate access-mask permissions.

    Correct answer
    B

    A SID uniquely identifies an authenticated entity, and its displayed S and hyphens are for readability.

    Explanation

    A SID uniquely identifies an entity the system can authenticate. Its string representation includes a readable S prefix and hyphens, but these characters are formatting rather than part of the stored SID representation.

  60. 60

    What are the purposes of the revision and authority fields in a SID?

    1. A

      The revision is the process ID, and authority 5 identifies the system-call number.

    2. B

      The revision identifies the domain, and authority 5 indicates the object is permanent.

    3. C

      The revision indicates the SID version, and authority 5 identifies the Windows security subsystem as issuer.

    4. D

      The revision identifies the user, and authority 5 indicates the SID is stored as a string.

    Correct answer
    C

    The revision indicates the SID version, and authority 5 identifies the Windows security subsystem as issuer.

    Explanation

    The SID revision identifies the SID version and is 1 in the described format. Its 48-bit authority identifies the issuing component; authority 5 indicates the Windows security subsystem, and the authority helps determine how to interpret the remaining values.

  61. 61

    What do the domain ID and RID identify in the described SID structure?

    1. A

      The subauthorities store the SID revision, and the RID identifies the authority that issued it.

    2. B

      The subauthorities carry identity details; a domain ID identifies a device or domain, and the RID identifies an entity within it.

    3. C

      The subauthorities specify object types, and the RID identifies the security descriptor's owner.

    4. D

      The subauthorities specify page permissions, and the RID identifies a physical memory page.

    Correct answer
    B

    The subauthorities carry identity details; a domain ID identifies a device or domain, and the RID identifies an entity within it.

    Explanation

    Subauthorities provide additional identity information. In the described example, a subauthority may be followed by a domain ID and RID; the domain ID identifies the standalone device or, in an Active Directory network, the domain, while the RID identifies the particular entity.

  62. 62

    What is the main difference between file-backed and page-backed section objects?

    1. A

      File-backed sections share only anonymous memory, while page-backed sections always map executable files.

    2. B

      File-backed sections map a file, while page-backed sections can provide shared memory without representing a file.

    3. C

      File-backed sections store access tokens, while page-backed sections store object headers.

    4. D

      Both section types require a file handle, but only page-backed sections can be read.

    Correct answer
    B

    File-backed sections map a file, while page-backed sections can provide shared memory without representing a file.

    Explanation

    File-backed section objects represent a file mapped into memory. Page-backed section objects do not represent a particular file and can be used to share memory between processes.

  63. 63

    How can a second process locate a named page-backed section?

    1. A

      A name lets another process find the section, and a separate name-information header precedes the object header.

    2. B

      A section's name is stored in the process's stack, and the object header always contains it.

    3. C

      A named section is found by its process ID, and its name is stored in the SSDT.

    4. D

      A section cannot be named, so processes must copy its contents through a file.

    Correct answer
    A

    A name lets another process find the section, and a separate name-information header precedes the object header.

    Explanation

    A named section can be found by another process using its name. Because the basic object header does not include a name field, an additional object-name information header is placed before it when a name is specified.

  64. 64

    How does the process-creation path prepare the executable for mapping?

    1. A

      It opens the executable and creates a section object that can be mapped into the process's address space.

    2. B

      It copies the executable into the process's stack and stores it as an access token.

    3. C

      It loads the executable only after the initial thread reaches its entry point.

    4. D

      It creates a section object only for the process's DLLs, not for the executable.

    Correct answer
    A

    It opens the executable and creates a section object that can be mapped into the process's address space.

    Explanation

    NtCreateUserProcess opens the executable file and creates a section object to map it into memory. The section is then mapped into the new process's address space during process-address-space setup.

  65. 65

    What do EPROCESS and its embedded KPROCESS represent?

    1. A

      The EPROCESS represents a section object, while KPROCESS stores the executable's import table.

    2. B

      The EPROCESS represents the system working set, while KPROCESS stores only access-control entries.

    3. C

      The EPROCESS represents a process and points to data such as its handle table and ID; KPROCESS separates kernel-specific data.

    4. D

      The EPROCESS represents a thread and contains its user stack, while KPROCESS stores DLL names.

    Correct answer
    C

    The EPROCESS represents a process and points to data such as its handle table and ID; KPROCESS separates kernel-specific data.

    Explanation

    The EPROCESS is the executive process object and represents a process. It points to information such as the handle table and process ID; its KPROCESS structure separates kernel-specific data from executive-level data.

  66. 66

    How are the EPROCESS object and its access token created in the described path?

    1. A

      PspAllocateProcess creates EPROCESS through ObCreateObjectEx and assigns it an access token.

    2. B

      MmCreateProcessAddressSpace creates EPROCESS through CreateFile and assigns it a page table.

    3. C

      PspAllocateThread creates EPROCESS through CloseHandle and assigns it a SID.

    4. D

      KiSystemCall64 creates EPROCESS through the SSDT and assigns it a stack frame.

    Correct answer
    A

    PspAllocateProcess creates EPROCESS through ObCreateObjectEx and assigns it an access token.

    Explanation

    PspAllocateProcess creates the executive process object through the object manager's ObCreateObjectEx function. It initializes the object and assigns an access token, which carries permissions.

  67. 67

    How do access tokens reach processes launched after a user logs in?

    1. A

      The scheduler creates an access token for each thread, and it contains a copy of the executable.

    2. B

      The object manager creates a token when a DLL is loaded, and the token stores its import table.

    3. C

      LSASS assigns a token at logon, and later-launched processes receive copies carrying the session's permissions.

    4. D

      The PE loader creates the token from the SID, and it contains the process's working set.

    Correct answer
    C

    LSASS assigns a token at logon, and later-launched processes receive copies carrying the session's permissions.

    Explanation

    A user's session receives an access token from LSASS when the user logs in, and subsequently launched processes receive copies of that token. The token acts like a key carrying permissions.

  68. 68

    What is a process working set, and what limits does Windows establish for it?

    1. A

      A working set contains every virtual page a process could ever use, with no size limits.

    2. B

      A working set is a list of open handles, and Windows defines a maximum but no minimum.

    3. C

      A working set contains a process's currently resident pages, and Windows defines minimum and maximum sizes.

    4. D

      A working set is the process's PE section table, shared with all other processes.

    Correct answer
    C

    A working set contains a process's currently resident pages, and Windows defines minimum and maximum sizes.

    Explanation

    A working set is the set of a process's pages currently loaded in physical memory. Windows guarantees a minimum working-set size and also sets a maximum; the kernel and each session have working sets as well.

  69. 69

    Which description correctly relates sessions, window stations, and desktops?

    1. A

      A session is a thread group, while window stations contain kernel stacks and desktops contain page tables.

    2. B

      A session contains only a user's access token, while desktops contain the system working set.

    3. C

      A session is associated with a logon; window stations contain desktops and clipboard state, and desktops contain windows, menus, and hooks.

    4. D

      A session contains the system call table, while window stations contain process address spaces and desktops contain DLLs.

    Correct answer
    C

    A session is associated with a logon; window stations contain desktops and clipboard state, and desktops contain windows, menus, and hooks.

    Explanation

    A session is associated with a desktop logon, including the lock-screen stage. Sessions contain window stations, which hold desktops and clipboard state; desktops contain windows, menus, and hooks. Session zero is maintained for system processes.

  70. 70

    What information do virtual address descriptors represent?

    1. A

      VADs are tables of imported DLL functions stored in the executable's PE headers.

    2. B

      VADs are trees whose nodes describe allocated regions of virtual memory.

    3. C

      VADs are access control lists that describe permissions on Windows objects.

    4. D

      VADs are lists of kernel handles stored in each thread's TEB.

    Correct answer
    B

    VADs are trees whose nodes describe allocated regions of virtual memory.

    Explanation

    Virtual address descriptors are organized as trees whose nodes describe allocated memory regions. They let the system track regions that an application has allocated in its address space.

  71. 71

    How do MEM_RESERVE and MEM_COMMIT differ when allocating virtual memory?

    1. A

      MEM_RESERVE reserves address space without committing it, while MEM_COMMIT charges the region; both may be combined.

    2. B

      MEM_RESERVE immediately creates every page-table entry, while MEM_COMMIT only records the region's size.

    3. C

      MEM_COMMIT reserves without charging memory, while MEM_RESERVE loads pages into physical memory.

    4. D

      MEM_RESERVE makes the region writable, while MEM_COMMIT makes it executable.

    Correct answer
    A

    MEM_RESERVE reserves address space without committing it, while MEM_COMMIT charges the region; both may be combined.

    Explanation

    MEM_RESERVE reserves a virtual region without charging the memory to the system; writing to it without committing causes an access violation. MEM_COMMIT charges the region, and the two flags can be used together.

  72. 72

    What can happen when an application first accesses a newly allocated virtual region?

    1. A

      A page fault removes the VAD and always rejects access to committed memory.

    2. B

      Every allocation creates physical pages immediately, so the VAD is used only for DLL names.

    3. C

      A VAD records the allocation; a later access may cause a page fault that leads to a page-table entry if the region is committed.

    4. D

      The VAD is created only after every page-table entry has been written by the application.

    Correct answer
    C

    A VAD records the allocation; a later access may cause a page fault that leads to a page-table entry if the region is committed.

    Explanation

    The system creates a VAD node for an allocation, but page-table entries need not be created immediately. On access, a page fault can prompt the system to consult the VAD and create an entry if the region is found and committed.

  73. 73

    What is the PEB used for, and what other user-mode component is mapped into the process?

    1. A

      The PEB stores only the process's handle table, while NTDLL is loaded into the kernel stack.

    2. B

      The PEB contains the system service dispatch table, while NTDLL is mapped only into CSRSS.

    3. C

      The PEB is a kernel-only object holding the scheduler state, while NTDLL remains unmapped.

    4. D

      The PEB holds user-mode process information such as loaded DLLs and image base, and NTDLL is mapped into the process.

    Correct answer
    D

    The PEB holds user-mode process information such as loaded DLLs and image base, and NTDLL is mapped into the process.

    Explanation

    The PEB is a user-mode structure created in the process's address space. It holds information such as loaded DLLs, the image base address, and whether the program is being debugged; NTDLL is also mapped into the process during address-space setup.

  74. 74

    Which sequence describes the creation and initialization of a new thread?

    1. A

      PspAllocateThread creates a KPROCESS, while KeInitThread builds the user-mode DLL database.

    2. B

      PspAllocateThread creates the ETHREAD, user stack, and TEB; KeInitThread sets up KTHREAD, kernel stack, and context.

    3. C

      PspAllocateThread creates the PEB, while KeInitThread maps the executable's sections.

    4. D

      PspAllocateThread creates the SSDT, while KeInitThread initializes the system working set.

    Correct answer
    B

    PspAllocateThread creates the ETHREAD, user stack, and TEB; KeInitThread sets up KTHREAD, kernel stack, and context.

    Explanation

    PspAllocateThread creates the ETHREAD object, sets up the user stack, and allocates a TEB for user-mode thread information. KeInitThread initializes the KTHREAD, kernel stack, and thread context.

  75. 75

    What is the relationship between KeStartThread and KeReadyThread in the described startup path?

    1. A

      KeReadyThread creates a new EPROCESS, while KeStartThread suspends all other threads.

    2. B

      KeStartThread resolves the DLL imports, while KeReadyThread creates the process's address space.

    3. C

      KeStartThread performs scheduling setup and records the thread in the process; KeReadyThread marks it ready but not yet running.

    4. D

      KeReadyThread runs the thread immediately, while KeStartThread decrements the process's thread count.

    Correct answer
    C

    KeStartThread performs scheduling setup and records the thread in the process; KeReadyThread marks it ready but not yet running.

    Explanation

    After process and thread insertion, KeStartThread performs scheduling initialization, increments the process's thread count, and adds the thread to its list. KeReadyThread then puts it in a deferred ready state, so it is ready for a core but not yet running.

  76. 76

    How does the newly created process get registered with CSRSS in the described sequence?

    1. A

      The image loader sends a message to the object manager containing only the executable's file name.

    2. B

      CreateProcessInternalW notifies CSRSS through ALPC, supplying handles and PEB information so CSRSS can register the process.

    3. C

      NtCreateUserProcess asks the scheduler to notify CSRSS through the SSDT after the application exits.

    4. D

      Explorer sends a window message to the kernel containing the process's access mask and SID.

    Correct answer
    B

    CreateProcessInternalW notifies CSRSS through ALPC, supplying handles and PEB information so CSRSS can register the process.

    Explanation

    Before the new process's initial thread runs, CreateProcessInternalW sends CSRSS a message using CsrClientCallServer and ALPC. The message includes process and thread handles, the PEB address, and the section-object handle; CSRSS tracks processes and threads within its session.

  77. 77

    How does the initial thread begin execution in user mode?

    1. A

      The thread starts immediately in user mode, and LdrInitializeThunk constructs the process's EPROCESS.

    2. B

      The thread waits for a DLL to call sysret, and the trap frame points to the system-call dispatcher.

    3. C

      The thread remains suspended until the application itself calls CreateProcess, then begins at the PE DOS stub.

    4. D

      The thread is resumed after creation, and KxStartUserThread builds a trap frame that starts execution at LdrInitializeThunk.

    Correct answer
    D

    The thread is resumed after creation, and KxStartUserThread builds a trap frame that starts execution at LdrInitializeThunk.

    Explanation

    The initial thread remains suspended until CreateProcessInternalW resumes it. KxStartUserThread then constructs a trap frame because the thread has not previously transitioned from user mode to kernel mode; the frame sets up execution at NTDLL's LdrInitializeThunk.

  78. 78

    What is one major task of LdrInitializeThunk?

    1. A

      It initializes the kernel working set and stores it in the thread's TEB.

    2. B

      It registers the process with CSRSS and fills the system service dispatch table.

    3. C

      It creates the process's access token and stores it in the PE file header.

    4. D

      It initializes the loader database referenced by the PEB's Ldr field and helps load required DLLs.

    Correct answer
    D

    It initializes the loader database referenced by the PEB's Ldr field and helps load required DLLs.

    Explanation

    LdrInitializeThunk initializes the loader database, pointed to by the PEB's Ldr field. The database tracks DLLs loaded into the process, and the loader uses the executable's import information to determine which modules are needed.

  79. 79

    How does a loader locate the PE import directory?

    1. A

      The import directory is found through the DOS stub, and its value is a physical address stored in the TEB.

    2. B

      The import directory is found in the file header, and its value is the process ID of the library.

    3. C

      The import directory is located through the optional header's data directories, using its value as an image-base-relative offset.

    4. D

      The import directory is found in the section table, and its value points directly to the export address table.

    Correct answer
    C

    The import directory is located through the optional header's data directories, using its value as an image-base-relative offset.

    Explanation

    The import directory is located through the optional header's data directories. Its value acts as an offset from the image base; the resulting location contains IMAGE_IMPORT_DESCRIPTOR records, with the descriptor count stored after the directory offset in the data directories.

  80. 80

    What are the key fields in an IMAGE_IMPORT_DESCRIPTOR, and what do they reference?

    1. A

      Each descriptor identifies a system call by Name and points to the SSDT through OriginalFirstThunk and the IDT through FirstThunk.

    2. B

      Each descriptor identifies a library by Name and points to the INT through OriginalFirstThunk and the IAT through FirstThunk.

    3. C

      Each descriptor identifies a thread by Name and points to the PEB through OriginalFirstThunk and the TEB through FirstThunk.

    4. D

      Each descriptor identifies a section by Name and points to its permissions through both thunk fields.

    Correct answer
    B

    Each descriptor identifies a library by Name and points to the INT through OriginalFirstThunk and the IAT through FirstThunk.

    Explanation

    The import directory contains IMAGE_IMPORT_DESCRIPTOR structures. Their Name field identifies the library; OriginalFirstThunk points to the Import Name Table (INT), and FirstThunk points to the Import Address Table (IAT).

  81. 81

    How do the Import Name Table and Import Address Table work during import resolution?

    1. A

      The INT stores process IDs, while the IAT stores system-call numbers for imported functions.

    2. B

      The INT supplies function names or ordinals, while the IAT is updated with resolved function addresses.

    3. C

      The INT and IAT contain PE section permissions and are never used to locate functions.

    4. D

      The INT stores resolved function addresses, while the IAT stores only DLL names and never changes.

    Correct answer
    B

    The INT supplies function names or ordinals, while the IAT is updated with resolved function addresses.

    Explanation

    The INT and IAT contain sequences of IMAGE_THUNK_DATA structures describing imported functions. Initially the tables are equivalent; the INT supplies function names or ordinals, and the loader resolves the functions and writes their addresses into the IAT's Function fields.

  82. 82

    How does a loader resolve an imported function by name?

    1. A

      An imported function is identified by its access mask, and its address is found in the PEB's handle table.

    2. B

      An imported function is identified by its process's SID, and its address is found in the system working set.

    3. C

      An imported function is identified by a name or ordinal, and a named function's address is resolved through the library's export table.

    4. D

      An imported function is identified by its page number, and its address is found in the file header.

    Correct answer
    C

    An imported function is identified by a name or ordinal, and a named function's address is resolved through the library's export table.

    Explanation

    An imported function can be identified by its name or ordinal. To find a named function's address, the loader examines the imported library's export table; a resolved address is then stored in the IAT.

  83. 83

    Why may the loader need to resolve imports for libraries that it has just loaded?

    1. A

      A DLL's imports are resolved by CSRSS, so the image loader does not need to inspect them.

    2. B

      A DLL's imports are ignored unless the process is running in kernel mode.

    3. C

      A loaded DLL cannot import other functions, so the loader resolves imports only once.

    4. D

      Loaded DLLs can themselves import functions, so their dependencies also need resolution.

    Correct answer
    D

    Loaded DLLs can themselves import functions, so their dependencies also need resolution.

    Explanation

    Loading a DLL can require resolving that DLL's own imports, since libraries may depend on other libraries. The described simplified example uses the image loader to load libraries and therefore bypasses many of the steps that a complete loader implementation handles.

  84. 84

    Which additional loader responsibilities and final action are described?

    1. A

      It can initialize the heap, handle shims, and relocate images, then call the application's entry point.

    2. B

      It can assign the user's access token, initialize CSRSS, and call the kernel's scheduler.

    3. C

      It can create the system service dispatch table, schedule every thread, and call the PE DOS stub.

    4. D

      It can create all page-table entries, terminate NTDLL, and call the process's DACL.

    Correct answer
    A

    It can initialize the heap, handle shims, and relocate images, then call the application's entry point.

    Explanation

    Beyond resolving imports and tracking loaded modules, the loader can initialize the heap, handle shims, and relocate images. Once it completes its work, it calls the application's entry point.

  85. 85

    Where may a PE import directory be stored?

    1. A

      The import directory is stored in the PEB and contains only the addresses of system calls.

    2. B

      The import directory is usually in .text or .data and contains the executable's stack frames.

    3. C

      The import directory is always in the DOS stub and contains the process's access token.

    4. D

      The import directory may be in a dedicated idata section or part of an rdata section.

    Correct answer
    D

    The import directory may be in a dedicated idata section or part of an rdata section.

    Explanation

    The executable's import directory is usually located in a dedicated idata section or within an rdata section. The loader parses the descriptors to identify libraries and imported functions.

Question 1 of 85
Question 1 of 85

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent