System Programming MCQs with Answers
Practice important System Programming MCQs with answers and explanations.
Chapter: 74
Q1521:
The parameter lpBaseAddress in UnmapViewOfFile() is a pointer to the _______.
A. Base address of the mapped view
B. File handle
C. Heap block
D. Mapping object
Correct Answer:
A
Chapter: 74
Q1522:
Which API forces the OS to write back dirty pages of the file to disk?
A. FlushViewOfFile()
B. UnmapViewOfFile()
C. MapViewOfFile()
D. HeapFree()
Correct Answer:
A
Chapter: 74
Q1523:
If one process uses file mapping and another uses ReadFile()/WriteFile(), their views of the file may be _______.
A. Identical
B. Different
C. Encrypted
D. Unavailable
Correct Answer:
B
Chapter: 74
Q1524:
To maintain uniform file views across processes, all processes should use _______.
A. File mapping
B. ReadFile()
C. WriteFile()
D. Memory allocation
Correct Answer:
A
Chapter: 74
Q1525:
dwDesiredAccess in MapViewOfFile() must be compatible with _______.
A. HeapAlloc()
B. CreateFileMapping()
C. File permissions
D. File mapping object access rights
Correct Answer:
D
Chapter: 75
Q1526:
In Win32, the maximum size of a file that can be mapped is approximately _______.
A. 1-2 GB
B. 2-3 GB
C. 4-5 GB
D. 5-6 GB
Correct Answer:
B
Chapter: 75
Q1527:
Which Windows version alleviates the file mapping size limitation of Win32?
A. Win98
B. WinXP
C. Win64
D. WinNT
Correct Answer:
C
Chapter: 75
Q1528:
Before mapping a new file, you should set its length using _______ and SetEndOfFile().
A. SetFilePointerEx()
B. CreateFileMapping()
C. OpenFileMapping()
D. MapViewOfFile()
Correct Answer:
A
Chapter: 75
Q1529:
To map a file, which API functions can be used?
A. CreateFileMapping() or OpenFileMapping()
B. CloseHandle() or UnmapViewOfFile()
C. MapViewOfFile() or HeapAlloc()
D. SetFilePointerEx() or SetEndOfFile()
Correct Answer:
A
Chapter: 75
Q1530:
After mapping a file, access to file data is performed through _______.
A. File descriptors
B. File pointers
C. Memory references
D. File streams
Correct Answer:
C
Chapter: 75
Q1531:
To change mapped regions, you should _______ the current view and map a new one.
A. Unmap
B. Map
C. Close
D. Flush
Correct Answer:
A
Chapter: 75
Q1532:
Which exception should be caught when working with file mapping to handle page faults?
A. EXCEPTION_ACCESS_VIOLATION
B. EXCEPTIO_IN_PAGE_ERROR
C. EXCEPTION_ARRAY_BOUNDS_EXCEEDED
D. EXCEPTION_STACK_OVERFLOW
Correct Answer:
B
Chapter: 75
Q1533:
The last step in file mapping cleanup is to _______ file and map handles.
A. CloseHandle()
B. UnmapViewOfFile()
C. MapViewOfFile()
D. FlushViewOfFile()
Correct Answer:
A
Chapter: 75
Q1534:
File mapping requires the file to be opened with at least _______ access.
A. GENERIC_WRITE
B. GENERIC_EXECUTE
C. GENERIC_READ
D. GENERIC_ALL
Correct Answer:
C
Chapter: 75
Q1535:
Mapping a file involves creating one or more _______ to access parts of the file.
A. Map views
B. File descriptors
C. File handles
D. Heap blocks
Correct Answer:
A
Chapter: 75
Q1536:
Memory allocation inside a mapped region requires _______ functions.
A. Standard memory allocation
B. Customized
C. Automatic
D. None
Correct Answer:
B
Chapter: 75
Q1537:
After setting file length for a new file, which function finalizes the new file size?
A. SetFilePointerEx()
B. SetEndOfFile()
C. FlushViewOfFile()
D. UnmapViewOfFile()
Correct Answer:
B
Chapter: 76
Q1538:
Accessing a file through file mapping generally reduces processing time by about ______ times compared to conventional file operations.
A. 2
B. 3
C. 4
D. 5
Correct Answer:
B
Chapter: 76
Q1539:
Sequential file access through file mapping is especially useful for processing ______ files.
A. Small
B. Sequential
C. Large
D. Random
Correct Answer:
A
Chapter: 76
Q1540:
File mapping setup might be programmatically ______ compared to conventional file operations.
A. simple
B. complex
C. unnecessary
D. automatic
Correct Answer:
B