DeviceIoControl( IOCTL_NDIS_UNBIND_ADAPTER )

Last post 11-28-2008 11:49 by ctacke. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 11-28-2008 3:28

    DeviceIoControl( IOCTL_NDIS_UNBIND_ADAPTER )

    I am getting an OpenNETCF.Net.AdapterException with a message of: DeviceIoControl( IOCTL_NDIS_UNBIND_ADAPTER ), when executing the following code:

            private void button1_Click(object sender, EventArgs e)
            {
                AdapterCollection adapters = Networking.GetAdapters();
                foreach (Adapter adapter in adapters)
                {
                    if (adapter.Name.StartsWith("FMAC"))
                    {
                        adapter.UnbindAdapter();
                    }
                }
            }

     This same is true for RebindAdapter() and BindAdapter()

    Am I doing something wrong?  

    I am using:

    - SDF 2.3  (also tried it on 2.2)
    - .NETCF 2.0
    - WinCE 4.0

    Thank you,
    Philip Fourie

     

    Filed under:
  • 11-28-2008 11:11 In reply to

    • ctacke
    • OpenNETCF Staff
    • Top 10 Contributor
    • Joined on 07-27-2007
    • Indiana
    • Posts 2,254

    Re: DeviceIoControl( IOCTL_NDIS_UNBIND_ADAPTER )

     What kind of adapter is this?  Are you certain it supports unbind/rebind (things like USB don't)?

  • 11-28-2008 11:27 In reply to

    Re: DeviceIoControl( IOCTL_NDIS_UNBIND_ADAPTER )

    Hi ctacke,

    This is a network (LAN) adapter that is built into the device. Stepping into the code it seems that the native method DeviceIoControl fails with a last error win error of 87 (I think it means invalid parameter from searching the MSDN but I might be mistaken).

     Thanks for the help,

    Philip


  • 11-28-2008 11:49 In reply to

    • ctacke
    • OpenNETCF Staff
    • Top 10 Contributor
    • Joined on 07-27-2007
    • Indiana
    • Posts 2,254

    Re: DeviceIoControl( IOCTL_NDIS_UNBIND_ADAPTER )

     Yes, an 87 is "Invalid Parameter", though with IOCTL's it usually really ambiguous as to what it thought was invalid.  Unbind is really simple, it's just a handle going in no in or out buffers. We definitely test unbind and rebind in our integration tests, so it's certainly a method that's been tested and known good at least on some hardware.  What exact hardware are you using?

Page 1 of 1 (4 items)