HEAD includes a 2-KB array called sReadBuffer that is needed only briefly, when the contents of the file are read and passed to DrawText. But this array remains in the program's data segment during the entire time this program is running. Wouldn't it make more sense to allocate that memory before the read call and free it up after DrawText?
Yes, it would. For that reason we can no longer avoid the subject of Windows memory management. It's not an easy subject, but let's begin.