You have the built-in capability to turn it off via the network connections
panel. That seems like the way to go. You know that it will work, you know
that it will turn on correctly when you want it to, etc. I don't see any
disadvantages.
If you have a good reason to do it yourself (you're running on a device
where access to the shell is not available or something), I can tell you
what steps you have to follow, but it's not going to be a quick job by any
means:
1. Open the NDIS power manager driver and set up to send it a
IOCTL_NPW_SAVE_POWER_STATE message via DeviceIoControl. You want to set it
to power state D4 to shut it off.
2. If the adapter itself supports power management, you need to call
SetDevicePower to tell the device itself to transition to state D4. To
decide if it supports power management, you'd call GetDevicePower and see if
it returns something valid.
3. Next, you want to tell NDIS to unbind the adapter (release its IP
address, etc.), by sending it an DeviceIoControl, IOCTL_NDIS_UNBIND_ADAPTER.
Paul T.