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

Sample for using Internet Sharing API

12 views
Skip to first unread message

yang-yang

unread,
Feb 15, 2007, 5:06:02 PM2/15/07
to
Hi,
I am working on an app which uses the Internet Sharing API , in Crossbow.
I am having issues with setting up the parameters in the function
InternetSharingEnable(...). How sould I configure the params 2 and 4 ?

Would someone point me to sample code ? or share their own ?
Here is my code , and the error I get is :ERROR_INVALID_PARAMETER.

int InternetSharingActivate()
{
InternetSharingConnectionType PublicType;
InternetSharingConnectionType PrivateType;
DWORD result;

PublicType= InternetSharing_Type_RNDIS;
PrivateType = InternetSharing_Type_CELLULAR_DATA;

result = InternetSharingEnable(
PrivateType,TEXT("RndisFn"), PublicType,TEXT("The Internet") );
if (result == ERROR_INVALID_PARAMETER)
{
printf(" ABCBridge :ConnMgr : InternetSharingActivate : result =
ERROR_INVALID_PARAMETER , %d",result );
MessageBox(NULL, TEXT("InternetSharingActivate :ERROR_INVALID_PARAMETER
"), NULL, MB_OK);
}
else if (result == ERROR_ALREADY_INITIALIZED)
{
printf(" ABCBridge :ConnMgr : InternetSharingActivate : result =
ERROR_ALREADY_INITIALIZED , %d",result );
MessageBox(NULL, TEXT("InternetSharingActivate :ERROR_ALREADY_INITIALIZED
"), NULL, MB_OK);
}
else
printf(" ABCBridge :ConnMgr : InternetSharingActivate : result =
%d",result );


return 0;
}


Greg Scott [MS]

unread,
Feb 20, 2007, 3:26:26 PM2/20/07
to
The "private" network is typically RNDIS or Bluetooth PAN. The "public"
network is the cellular. I think you have them backwards.

--
Greg Scott
Software Design Engineer, Windows CE
Microsoft Corporation
_____________________________________________________________
This posting is provided "AS IS" with no warranties, and confers no rights.
_____________________________________________________________

"yang-yang" <yang...@discussions.microsoft.com> wrote in message
news:4ABE0765-DE18-4AA5...@microsoft.com...

0 new messages