Click here to Skip to main content
15,900,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm getting an error on this line...

C++
if (WSAIoctl(sniffer, SIO_RCVALL, &j, sizeof(j), 0, 0, &in, 0, 0) == SOCKET_ERROR)
{



the &in is in red squiggles.
Posted

Here is a good example using WSAIoctl Sniffing using Winsock[^]

Best regards
Espen Harlinn
 
Share this answer
 
It's because a DWORD is an unsigned long, not an int. The compiler will let you off when directly setting a DWORD to an int (by doing an implicit convesion) but it can't do the same for a pointer, so your either going to have to explicitly cast to LPDWORD (Bad, since your'e not guaranteed that they will be the same size) Or pass a pointer to an actual DWORD, even if you just copy your int into a temporary DWORD.
 
Share this answer
 
Comments
Member 7766180 17-Aug-11 20:12pm    
Thanks this is where the cide is from, cant get it to compile. Only 4 errors. Using win 7 and VS 2010

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900