Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Raw Sockets in WinCE 5.0

5 views
Skip to first unread message

am

unread,
Jul 31, 2009, 4:33:01 PM7/31/09
to

Is there support for Raw Sockets in WinCE 5.0?

am

unread,
Jul 31, 2009, 4:40:01 PM7/31/09
to
To add a little more to that...
Below is some test code.
When it runs, I get an "Invalid System Services" exception at run-time, when
the socket() call is made.

int err = 0;
WORD wVersion;
WSADATA wsaData;

wVersion = MAKEWORD( 2, 2);
err = WSAStartup(wVersion, &wsaData);

if ( err != 0 )
{
DEBUGMSG(TRUE,(TEXT ("ERROR! WSAStartup()!!\r\n")));
}

/* Confirm that the WinSock DLL supports 2.2.*/ if ( LOBYTE(
wsaData.wVersion ) != 2 ||
HIBYTE( wsaData.wVersion ) != 2 ) {
DEBUGMSG(TRUE,(TEXT ("ERROR! No usable Winsock2 DLL found\r\n")));
WSACleanup( );
}
else
{
if ((sockFd = socket(AF_INET, SOCK_RAW, htons(97))) < 0)
{
DEBUGMSG(TRUE,(TEXT ("ERROR! socket() call failed!!\r\n")));
WSACleanup( );
}
else
{
/* OK to send packet */

Bruce Eitman [eMVP]

unread,
Jul 31, 2009, 4:57:53 PM7/31/09
to
Windows CE, yes. Windows CE on your device, maybe not. Are you building
against an SDK for your device? If not, you should be.

--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT EuroTech DOT com
My BLOG http://geekswithblogs.net/bruceeitman

EuroTech Inc.
www.EuroTech.com

"am" <a...@discussions.microsoft.com> wrote in message
news:987CE8AE-A454-419C...@microsoft.com...

am

unread,
Jul 31, 2009, 5:06:00 PM7/31/09
to
I am implementing this in OS level code, running on a target embedded device.

So, id the answer a sure no? There seems to be "architectural support" at
least, going by the APIs in winsock2.h

Bruce Eitman [eMVP]

unread,
Jul 31, 2009, 7:34:53 PM7/31/09
to
Without knowing anything about how you are doing this, I can't say.

--
Bruce Eitman (eMVP)
Senior Engineer
Bruce.Eitman AT EuroTech DOT com
My BLOG http://geekswithblogs.net/bruceeitman

EuroTech Inc.
www.EuroTech.com

"am" <a...@discussions.microsoft.com> wrote in message
news:73771EAE-D622-46AE...@microsoft.com...

0 new messages