Hey there Game Devers! It''s been a while!

Anyhow, down to some business. It has taken me two long weeks of learning, implementing, coding a demo, and repeatting the process. I have learned a great deal about network programming, but now this comes up. Every time I call WSARecv it kicks the error WSAEFAULT.
From the SDK Docs:
The lpBuffers parameter is not completely contained in a valid part of the user address space.
From the MSDN:
Bad address.
The system detected an invalid pointer address in attempting to use a pointer argument of a call. This error occurs if an application passes an invalid pointer value, or if the length of the buffer is too small. For instance, if the length of an argument, which is a sockaddr structure, is smaller than the sizeof(sockaddr).
And the bit of relevant code:
WSABUF buf;
char cTemp[128];
buf.buf = cTemp;
buf.len = 128;
// Pass WSARecv &buf, number of buffers 1
If I understood what the error message was saying, it might help. I have tried fooling with size of the buffers, the length arguments, putting them in global scope, thread scope, function scope, and tried making an array of WSABUFs. Nothing works

Has anyone ever ran across this before? Or perhapse you could shed some more light on those error messages?
On a side note, recv works fine, but ReadFile does not. I am working under IOCP, but the those mechanisims are not yet in place ( as WSARecv has to suceed in order to push a completion packet ). Also, the socket that all of these operations are being preformed on is a UDP socket with the broadcast option on.
Thanks for your help,
Q