This is the second in a series of posts that describe new and updated samples in the Windows 7 SDK. The following table lists samples that pertain to networking and related services, and are new to Windows 7 or updated to support Windows 7, including the Active Directory Service Interfaces (ADSI), Dynamic Host Configuration Protocol (DHCP), EAP, HTTP, IPHelp, Mobile Broadband, Network Access Protection (NAP), Distributed Routing, Quality of Service (QOS), Remote Access Server (RAS), Remote Procedure Call (RPC), Universal Plug and Play (UPNP), Windows File Protection (WFP), Winsock, and Wireless LAN (WLAN).
Over 1,200 samples were changed since the release of the Windows SDK for Windows 7 RC release. Many “new to Win 7” samples were added, simplified, or extended, and many older samples were updated to support Windows 7 as well as older operating systems.
For build instructions and additional information about the samples, see the Readme.txt files and other documents in the SDK sample folders. For general sample building instructions, refer to the Samples Reference page that installs with the Windows SDK, and the SDK Release Notes (under the Start menu, in All Programs > Microsoft Windows SDK v7.0). By default, Win32 samples are installed under the following path: C:\Program Files\Microsoft SDKs\Windows\v7.0\Samples.
Send your thoughts to the Windows SDK Feedback alias. Tell us how you use the SDK and what we can do to improve your development experience. The MSDN Windows SDK Developer Center is the place to find resources and links to Windows SDK products, release notes, technical articles, and more.
New/updated Networking and related services samples in the Windows SDK for Windows 7
Location (under Samples)
The AddGroup sample adds a group object to a specified container in Active Directory.
Demonstrates an Active Directory administrative notification handler.
Uses ADSI to bind to the Active Directory schema container and enumerate some types of its attributes.
The BindtoParent sample uses ADSI to bind to the local domain partition in Active Directory. It then searches for a specified user object. When it finds the object, the sample binds to the parent of that object, which is the container of the user object in the Active Directory hierarchy.
The CreateUser sample uses ADSI with the LDAP provider to create a domain account for a user.
Active Dir Credentials
The Credentials sample uses ADSI and the LDAP provider to bind to Active Directory using specified credentials rather than using the default credentials of the logged-on user.
The GCallUsers sample searches the global catalog to enumerate users in an Active Directory forest.
The GetDomainmode sample binds to an Active Directory domain partition and reads the ntMixedDomain property to determine the operation mode of the domain.
The GetSchemaInfo sample uses ADSI to bind to the Active Directory schema container and search for classSchema and/or attributeSchema objects that match a specified query.
The PropertyList sample uses ADSI to bind to Active Directory and enumerate its attributes. The sample Demonstrates use of the IADs, IADsPropertyList, IADsPropertyEntry, and IADsPropertyValue interfaces.
The PropSheetHost Demonstrates how to host the Active Directory Users and Computers MMC snap-in property sheet for an Active Directory object.
ActiveDir QueryUsers Sample
The QueryUsers sample queries an Active Directory domain partition for user objects that match a specified filter.
The RootDSE sample binds to rootDSE of an Active Directory server using the IADs interface and retrieves the defaultNamingContext property, which contains the distinguished name of the domain partition, as well as other naming contexts for the domain.
The SID sample uses ADSI to bind to the local domain partition in Active Directory. It then searches for a specified user object. When it finds the object, the sample retrieves the user’s SID and converts the binary SID to a SID string format.
ADSI ActiveDir User
The User sample binds to a user object in Active Directory and uses the IADsUser interface to retrieve information about the user.
ActiveDir WkGuid Sample
The WkGuid sample uses the well-known GUID of the Users container to bind to the Users container in the default naming context.
ADSI General ADQI
Lists all supported ADSI interfaces for a given ADsPath. For selected supported interfaces, the sample allows you to run some of the object methods.
ADSI General ADsCmd
Demonstrates dumping all properties from an ADSI object.
ADSI General ADSIDump
Traverses the Active Directory tree and dumps a listing of all objects and their attributes for the specified ADsPath to a file.
ADSI General DsSrch
Demonstrates searching using IID_IDirectorySearch and ADSI.
ADSI Start Binding
Demonstrates how to bind to a domain using the credentials of the currently logged-on user and with credentials of a specified user.
ADSI Start Child
Demonstrates binding to a child object from a container
ADSI Start Create
The Create sample creates a new local user account. It includes a function that uses the IADsContainer interface with the WinNT provider to create a local user account. It also has an optional function that uses the IDirectoryObject interface with the LDAP provider to create a domain user account in Active Directory.
ADSI Start Delete
Uses the WinNT: provider and the IADsContainer interface to delete a local user object. It also uses the LDAP provider and the IDirectoryObject interface to delete a user account from Active Directory.
ADSI Start Enum
Enumerates the objects in a container, printing the name and class of every object in a specified WinNT domain.
ADSI Start Filter
Enumerates selected objects in a container, printing the name and class of the filtered objects in a specified WinNT domain.
ADSI Start Move
Moves an object from one container to another by moving a user from one organizational unit to another.
ADSI Start Parent
Binds to an object and then uses the IADs interface to retrieve a binding string for the object’s parent.
ADSI Start Read
Reads various single-valued and multi-valued properties of an Active Directory object.
ADSI Start Rename
Renames an Active Directory Object.
ADSI Start Schema
Enumerates the objects in the schema using the WinNT provider.
ADSI Start Search
Uses the IDirectorySearch interface to search Active Directory for objects that match a specified filter.
ADSI Start Write
How to set single-valued and multi-valued attributes of an Active Directory object.
Demonstrates obtaining notification of parameters when they change. This example monitors the change of the Gateway address (OPTION_ROUTER_ADDRESS = 3) in a DHCP Client. The DHCP Client Options API will signal an application via an Event handle whenever this value changes. This change can occur during the renew or release state of a DHCP Client.
Demonstrates how to request an option to be made persistent; i.e. the option is retrieved during every DHCP Client boot.
Demonstrates requesting parameters from the DHCP Client. The parameters requested will either come from the DHCP Client cache or the DHCP Client will request them from the DHCP Server via a DHCP_INFORM packet. Please note that not all DHCP Servers support the DHCP_INFORM packet so if no data is received either the server does not support it or the client timed out waiting for a response.
DHCPv4 Compare Scopes
Compares scope-level options for V4 scopes with the same scope address on 2 DHCP servers (e.g. when configured in an 80:20 configuration) and highlights the differences.
DHCPv4 Server Scope Stats
Dump statistics across all the V4 scopes on a DHCP server.
DHCPv4 Server Show Leases
Dump IPv4 leases across all the scopes configured on a DHCP server
DHCPv6 Server Show Leases
Dump IPv6 leases across all the scopes configured on a DHCP server.
EAPHost Method Sample
Demonstrates a working EAPHost EAP method – both peer and authenticator implementation. Also demonstrates how one would author an EAPHost supplicant.
Asynchronous HTTP server sample
Demonstrates how to create a simple HTTP server using the HTTP API, v2. It does this using the system thread pool.
Demonstrates a simple server app that receives a request and sends back a response. Demonstrates the use of V2 http.sys Api’s for writing a server application. This program creates a server seesion, Url group and request Queue and starts a listener on the URL specified by the user. The listener receives a request and sends the response.
Demonstrates how to use IPHLPAPI EnableRouter
Demonstrates the use of IP Helper APIs to manipulate ARP cache.
Demonstrates how to programmatically change an IP address for a specific network adapter on your machine. This program also demonstrates how to retrieve existing network adapter IP configuration information.
Demonstrates how to programmatically release and renew IPv4 addresses obtained through DHCP. Also demonstrates how to retrieve existing network adapter configuration information.
Demonstrates how to manipulate network routing tables.
Demonstrates the use of IP Helper APIs to get IP statistics.
Mobile Broadband APIs sample
Demonstrates how to use Mobile Broadband APIs such as how to enumerate mobile broadband interfaces or how to get radio state of specific interface
Network Access Protection Sample
Demonstrates NAP System Health Agent, NAP System Health Validator, NAP SHV Configuration UI, and a NAP Enforcement Client.
Distributed Routing Table (DRT)
The DRT Sample Demonstrates the use of a subset of the Peer to Peer APIs centered on the Distributed Routing Table (DRT) protocol.
Demonstrates the use of the QOS2 API. This program implements a simple traffic generator which uses the QOS2 API to not overload the network path between the source and its destination.
Traffic Control API sample
Demonstrates how to use the Traffic Control API.
RRAS Agile VPN
Demonstrates how to use the RasUpdateConnection and RasGetProjectionInfoEx APIs to get the IKEv2 projection information and to perform a MOBIKE switch. First it makes a VPN connection using RasDial on the interface specified by argument “interface_index”. Once the connection is setup it tries to perform a MOBIKE switch to the “new_interface_index” and if the switch is successful the local tunnel end point will be changed as seen on the console in program output.
Demonstrates Asynchronous RPC functionalities
Demonstrates how to supply multiple implementations of the remote procedure specified in the interface.
RPC Data DUnion
Demonstrates discriminated unions
RPC Data InOut
Demonstrates the use of [in,out] parameters
RPC User Marshal
Demonstrates the use of User Marshal attributes and functionalities instead of the obsolete Represent_As functionality in the original sample.
RPC Data Xmit
Demonstrates the type-conversion attribute transmit_as. Older sample was rewritten to use Wire Marshal instead of less-efficient transmit as.
Demonstrates a client application managing its connection to the server through dynamic endpoints.
RPC Handles cxhndl
Demonstrates the use of the context_handle attribute.
RPC Handles usrdef
Demonstrates the use of user-defined handles
Demonstrates a client/server implementation of the classic “Hello world” program.
Demonstrates how to implement an NT system service that uses RPC.
Demonstrates how to allocate memory at a server for a two-dimensional object (an array of pointers) and pass it back to the client as an [out]-only parameter.
Implements the dimmer device and dimmer service functionality of the RegDevice sample. This is implemented as COM server object.
GenericUCP is a C++ sample UPnP application that discovers and controls UPnP devices found on the network. This sample was developed using Visual C++. The sample application uses the UPnP Control Point API provided by upnp.dll. More description about the application can be found in the documentation. The application first starts by discovering devices on the network through one of the three types of searches available, FindByType, FindByUDN and AsyncFind. The devices found are instantiated in the device list. One of the devices can be selected and the service objects for the selected device are listed in the service list. One of the services can be selected and controlled by invoking actions against it. The events relevant to the service are displayed in the events field.
Implements dimmer device functionality as a COM server object and demonstrates how to register/unregister this device with the Microsoft UPnP framework’s Device Host. The device specific functionality is implemented in the ..\DCO_DimmerService directory.
MsnFilter_s bulk submission.
Sample program that uses WFP API’s to block all incoming traffic except traffic destined to windows live messenger.
Windows Connect Now sample
Demonstrates the basic usage of the WCNAPI’s to configure a WCN enabled device. This includes devices such as a wireless router or printer. Also, this demonstrates getting a wireless profile from a configured WCN enabled router via the devices’ push button.
Bluetooth Connection Sample
Demonstrates how to establish a connection using Bluetooth
Winsock Ideal Send Backlog sample
Demonstrates simple implementation of ideal send backlog feature of winsock.
Wireless Autconfig API Sample
Demonstrates the use of APIs provided by the Wireless Autoconfig Service. Profile Management and Connection Control is shown.
Wireless Hosted Network Sample
Demonstrates how to use the wireless Hostednetwork feature available on Windows 7. The operating system installs a virtual device if a Hosted Network capable wireless adapter is present on the machine. This virtual device is used exclusively for performing software access point (SoftAP) connections.
Program Manager for Samples
Windows SDK Team