The functions you linked to aren't (directly) related to file mapping. They're used for regular file I/O.
To use traditional file I/O with a really large file, you could do as you described. You would open the file, create a buffer, and read a chunk of the file into the buffer. When you need to access a different part of the file, you read a different chunk into the buffer.
To use a file mapping, you use CreateFile, CreateFileMapping, and then MapViewOfFile. You don't (directly) create a buffer and read a part of the file into it. Instead, you tell the system that you want to access a range of the file as though it were a range of memory addresses. Reads and writes to those addresses are turned into file i/o operations behind the scenes. In this approach you might still have to work in chunks. If the part of the file you need to access is not in the range you currently have mapped, you can create another view (and possibly close the other one).
But note that I said address space, which is different than RAM. If you're building for 64-bit Windows, you can try to map the entire 40 GB file into your address space. The fact that you have only 16 GB of RAM won't stop you. There may be some other problems at that size, but it won't be because of your RAM. If there are other problems, you'll be back to managing the file in chunks as before.