I'm reviewing the example at http://www.codeproject.com/threads/winspy.asp#section_2
(the third code example within the second section of that webpage). The purpose of the example is to allocate memory in another process' VM space, which can then have a string written to it.
pLibRemote = ::VirtualAllocEx( hProcess, NULL, sizeof(szLibPath),
MEM_COMMIT, PAGE_READWRITE );
::WriteProcessMemory( hProcess, pLibRemote, (void*)szLibPath,
sizeof(szLibPath), NULL );
Specifically, I'm wondering why the example works without having to specify MEM_COMMIT | MEM_RESERVE. The VirtualAllocEx documentation states that calling MEM_COMMIT without having reserved first will cause problems. But the code in the example doesn't seem to reserve first.
I'm probably missing something simple.