I am using WriteFile(); with an OVERLAPPED structure but it returns ERROR_INVALID_PARAMETER, which I googled to find out it happens when the OVERLAPPED structure hasn't been initialised to zero. I use ZeroMemory on it before I work with it and I made sure it was zero with a small function to verify it was zero before the write. The variables ARE set to zero, but the fuction still fails with that error code. The page below is what I learned this from, and the OVERLAPPED structure page on MSDN mentions the same thing. I'm not sure what I have to do...
http://support.microsoft.com/kb/110148
Code:if(!WriteFile(hFile, pOutput, GetFileSize(hFile, NULL), &ulReadWrite, &ovl))