Enable/Disable DHCP on a network interface via Win32 api - windows

i'm looking for a way to enable or disable dhcp on a network interface via win32 api.
actually i solve this by using wmi but i would like to do this via win32 api because i would like to workaround corrupted wmi's.
i found a thread where they do this via registry api: On enabling Network adpater, Autoconfiguration IP address getting set but is this the only way to achieve?
cheers, ceth

i finally did it with wmi and shelling out netsh.exe as a backup if wmi is not working. the way over the win32 api is quite too unhandy..

Related

WDK : security consideration - can i prevent other applications to use a driver?

im doing a usb hook driver that will expose a set of functions that i will use from my application.
Problem is that these functions that i expose would basically enable someone else to use the same to create ex keyboard sniffer applications, so i have abit of a security concern here installing this on machines.
Is there any way you can set a relationsship so only my application are able to access this driver ?

Check on avaiable port using wmi win32 class?

I am using inno setup to make an installation file. It required to pull local ip address (which I able to do by querying Win32_NetworkAdapterConfiguration) and check if a specific port is open for the software to run on (which I am currently looking for an answer).
I realize that WMI Win32 classes contain so many useful information. So I wonder which Win32 class should I use to check on this port given that if it is possible to do that?
Thank you,
AFAIK the only WMI class to check if a given port is open is the NetDiagnostics WMI class and the ConnectToPort method, but this class only is present in Windows XP. So if you want an option which works in another Windows versions you can try to import (or write your own application and invoke from inno) something like the Winsock connect function, like is show on this question How to check if a TCP port is available with Delphi?
Just try to bind a socket to it. If it succeeds, it's available.

create pppoe connection in windows phone 7

I am writing an app that allows creation of pppoe in windows phone 7.goal is to be able to dial a connection with given username/password over wireless.
t what API I shall use?
I've not worked with PPPoE but, given the name, you'll probably need to use raw sockets.
Take a look at Network and Web Services Overview for Windows Phone to see what options are available to you. Then you'll probably need to look at Sockets for Windows Phone and the related System.Net.Sockets reference documentation.

How to discover local network resources on windows phone 7

I'm trying to find a way of automatically discovering and communicating with a local network service running on desktop/laptop. Much like the Zune's wifi sync feature.
iPhone can do this using Bonjour service. Is there anything like that on WP7 platform? Any other suggestions?
There is currently nothing like this available in the SDK.
Network operations are currently very limited and you're restricted to HTTP based connections. I'm not sure how useful that would be for the scenario you describe.

IP security policy on windows 2003

Does anyone know how I can:
create IP security policy
manage IP filters and IP filter actions
PROGRAMMATICALLY on windows 2003? Not use Microsoft GUI utility.
I tried to achieve this by programming with windows registry,
all data I need that is under HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\windows\IPSec\Policy\Local
but I have no idea with some data. e.g the value of IPsecData,
Thank you
This is not programmatically but not GUI either:
You can use command-line netsh ipsec...
http://technet.microsoft.com/en-us/library/cc739550(WS.10).aspx

Resources