Networking Forums

Networking Forums > Wireless Networking > Wireless Networks > how to rebind network adapter?

Reply
Thread Tools Display Modes

how to rebind network adapter?

 
 
Oscar
Guest
Posts: n/a

 
      09-24-2004, 08:02 PM
hi guys,

I want to update network IP address to 169.254.xx.xx (which means the
machine cannot connect to a DHCP server). I used to
IOCTL_NDIS_REBIND_ADAPTER to update it:


//---------------Code--------------------------------
TCHAR szReg1[]=L"VNETUSBA1\0\0"; //VNETUSBA1 is the Wi-fi adapter name

HANDLE g_hNdisUio = CreateFile( NDISUIO_DEVICE_NAME,GENERIC_READ |
GENERIC_WRITE,FILE_SHARE_READ | FILE_SHARE_WRITE,NULL, OPEN_ALWAYS, 0,
NULL);

DeviceIoControl(g_hNdisUio,IOCTL_NDIS_REBIND_ADAPT ER,szReg1,sizeof(szReg1),NULL,NULL,NULL,NULL);


//---------------End of Code-------------------------


Fuction DeviceIoControl always return Error 50: The network request is not
supported.

I tried IOCTL_NDIS_UNBIND_ADAPTER, same error.

Does anybody know the problem?

Thanks




 
Reply With Quote
 
 
 
 
Pavel A.
Guest
Posts: n/a

 
      09-25-2004, 05:35 PM
Use IP Helper functions (iphlp...)
NDISUIO is not for what you're trying to do.

--PA

"Oscar" <(E-Mail Removed)> wrote in message news:#(E-Mail Removed)...
> hi guys,
>
> I want to update network IP address to 169.254.xx.xx (which means the
> machine cannot connect to a DHCP server). I used to
> IOCTL_NDIS_REBIND_ADAPTER to update it:
>
>
> //---------------Code--------------------------------
> TCHAR szReg1[]=L"VNETUSBA1\0\0"; //VNETUSBA1 is the Wi-fi adapter name
>
> HANDLE g_hNdisUio = CreateFile( NDISUIO_DEVICE_NAME,GENERIC_READ |
> GENERIC_WRITE,FILE_SHARE_READ | FILE_SHARE_WRITE,NULL, OPEN_ALWAYS, 0,
> NULL);
>
> DeviceIoControl(g_hNdisUio,IOCTL_NDIS_REBIND_ADAPT ER,szReg1,sizeof(szReg1),NULL,NULL,NULL,NULL);
>
>
> //---------------End of Code-------------------------
>
>
> Fuction DeviceIoControl always return Error 50: The network request is not
> supported.
>
> I tried IOCTL_NDIS_UNBIND_ADAPTER, same error.
>
> Does anybody know the problem?
>
> Thanks
>
>
>
>



 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Wireless network adapter only works on home network chiefjay Wireless Networks 4 08-11-2007 07:02 PM
network adapter leolady Wireless Networks 1 03-13-2007 12:10 AM
Network adapter visible twice in network setup Simon Elliott Windows Networking 3 06-11-2004 06:45 PM
USB network adapter Bill Windows Networking 1 11-13-2003 05:01 AM
Network adapter craig Windows Networking 0 09-26-2003 06:08 PM



1 2 3 4 5 6 7 8 9 10 11