Skip to main content

System Programming MCQs with Answers

Practice important System Programming MCQs with answers and explanations.

Chapter: 73
Q1501:
What parameter in OpenFileMapping() specifies the desired access?
A. dwDesiredAccess
B. bInheritHandle
C. lpMapName
D. hFile
Correct Answer: A
Chapter: 73
Q1502:
The bInheritHandle parameter in OpenFileMapping() determines if the handle is _______.
A. Inheritable
B. Non-inheritable
C. Read-only
D. Read-write
Correct Answer: A
Chapter: 73
Q1503:
What is lpMapName used for in OpenFileMapping()?
A. Name of mapping
B. Size of mapping
C. Security attributes
D. File handle
Correct Answer: A
Chapter: 73
Q1504:
If the specified map name does not exist, the OpenFileMapping() call will _______.
A. Succeed
B. Fail
C. Wait
D. Ignore
Correct Answer: B
Chapter: 73
Q1505:
A file map created by one process can be used by other processes by referring to its _______.
A. Handle
B. File path
C. Name
D. Size
Correct Answer: C
Chapter: 73
Q1506:
The dwDesiredAccess parameter is checked against the access assigned by _______.
A. OpenFileMapping()
B. CreateFileMapping()
C. CloseHandle()
D. ReadFile()
Correct Answer: B
Chapter: 73
Q1507:
OpenFileMapping() is primarily used to access _______.
A. Open files
B. Existing file mappings
C. New file mappings
D. Temporary files
Correct Answer: B
Chapter: 73
Q1508:
The handle returned by OpenFileMapping() can be used for further _______.
A. File operations
B. File deletion
C. File copying
D. File renaming
Correct Answer: A
Chapter: 73
Q1509:
OpenFileMapping() allows processes to share memory by opening a file map by its _______.
A. Size
B. Name
C. Creation time
D. Access rights
Correct Answer: B
Chapter: 73
Q1510:
If bInheritHandle is TRUE, the handle can be inherited by _______.
A. Child processes
B. Parent processes
C. All processes
D. No process
Correct Answer: A
Chapter: 73
Q1511:
OpenFileMapping() fails if lpMapName is set to _______.
A. NULL
B. An empty string
C. Valid map name
D. A invalid name
Correct Answer: D
Chapter: 73
Q1512:
The OpenFileMapping() function requires the map name to be previously _______.
A. Deleted
B. Created
C. Closed
D. Encrypted
Correct Answer: B
Chapter: 74
Q1513:
Which API is used to map a file mapping object into the process address space?
A. MapViewOfFile()
B. CreateFileMapping()
C. OpenFileMapping()
D. HeapAlloc()
Correct Answer: A
Chapter: 74
Q1514:
How many arguments does the MapViewOfFile() function take?
A. 4
B. 5
C. 6
D. 3
Correct Answer: B
Chapter: 74
Q1515:
What does MapViewOfFile() return on success?
A. Pointer to file mapping
B. NULL
C. Handle
D. Integer
Correct Answer: A
Chapter: 74
Q1516:
If MapViewOfFile() fails, it returns _______.
A. NULL
B. -1
D. 1
Correct Answer: A
Chapter: 74
Q1517:
The parameter hFileMappingObject in MapViewOfFile() is obtained from _______.
A. CreateFileMapping()
B. OpenFileMapping()
C. HeapAlloc()
D. FlushViewOfFile()
Correct Answer: A
Chapter: 74
Q1518:
Which flag is NOT a valid dwDesiredAccess option for MapViewOfFile()?
A. FILE_MAP_WRITE
B. FILE_MAP_READ
C. FILE_MAP_EXECUTE
D. FILE_MAP_ALL_ACCESS
Correct Answer: C
Chapter: 74
Q1519:
dwFileOffsetHigh and dwFileOffsetLow parameters specify the starting address of the mapping in multiples of _______.
A. 4K
B. 64K
C. 1MB
D. 512 bytes
Correct Answer: B
Chapter: 74
Q1520:
Which API is used to unmap a mapped file view?
A. HeapFree()
B. UnmapViewOfFile()
C. CloseHandle()
D. FlushViewOfFile()
Correct Answer: B

Test Your Knowledge

Take a timed quiz on System Programming

🚀 Start Quiz Now