Why GlobalAlloc() after all?
You can just use standard C++ memory allocation.
Preferably using some kind of RAII object like std::vector.
So, instead of GlobalAlloc(), create std::vector of the required size, and pass the address of the first element to ReadFile() to fill the vector with the data.
All memory will be cleaned up automatically.