diff options
| author | Barry Golden <[email protected]> | 2019-09-23 09:40:11 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2019-09-23 09:40:11 -0700 |
| commit | 7aa77ce9373bbe7eab4ab90890707c4d9ea526a2 (patch) | |
| tree | 8894486e959fe580e87c10acd0e7dfc6c5b90548 | |
| parent | 65a2384f555cf54601e3b9c29eb53075193a9af1 (diff) | |
| -rw-r--r-- | network/ndis/ndisprot/6x/README.md | 63 | ||||
| -rw-r--r-- | network/ndis/ndisprot_kmdf/README.md | 88 | ||||
| -rw-r--r-- | network/radio/RadioManagerSample/README.md | 76 | ||||
| -rw-r--r-- | network/trans/WFPSampler/README.md | 144 | ||||
| -rw-r--r-- | network/trans/ddproxy/README.md | 60 | ||||
| -rw-r--r-- | network/trans/inspect/README.md | 49 | ||||
| -rw-r--r-- | network/trans/msnmntr/README.md | 62 | ||||
| -rw-r--r-- | network/wsk/echosrv/README.md | 41 |
8 files changed, 296 insertions, 287 deletions
diff --git a/network/ndis/ndisprot/6x/README.md b/network/ndis/ndisprot/6x/README.md index 2ac81988..8c94783c 100644 --- a/network/ndis/ndisprot/6x/README.md +++ b/network/ndis/ndisprot/6x/README.md @@ -22,49 +22,50 @@ Select **Sample NDIS Protocol Driver** and click **OK**. After installing the pr ## Usage -To start the driver, type **Net start ndisprot**. +To start the driver, type `Net start ndisprot`. -To stop the driver, type **Net stop ndisprot**. +To stop the driver, type `Net stop ndisprot`. -To test the driver, run **prottest**. For help on usage, run **prottest -?** +To test the driver, run `prottest`. For help on usage, run `prottest -?` **usage: PROTTEST [options] \\*devicename*** -options | Description -----------|------------ --e | Enumerate devices --r | Read --w | Write (default) --l | <length>: length of each packet (default: 100) --n | <count>: number of packets (defaults to infinity) --m | <MAC address> (defaults to local MAC) +| Options | description | +| --- | --- | +| -e | Enumerate devices | +| -r | Read | +| -w | Write (default) | +| -l | <length>: length of each packet (default: 100) | +| -n | <count>: number of packets (defaults to infinity) | +| -m | <MAC address> (defaults to local MAC) | Prottest exercises the IOCTLs supported by NDISPROT, and sends and/or receives data on the selected device. In order to use prottest, the user must have administrative privilege. Users should pass down a big enough buffer in order to receive the entire received data. If the length of the buffer passed down is smaller than the length of the received data, NDISPROT will only copy part of the data and discard the rest when the given buffer is full. Use the **-e** option to enumerate all devices to which NDISPROT is bound: -**C:\\prot\>prottest -n 2 \\DEVICE\\{9273DA7D-5275-4B9A-AC56-68A49D121F1F}** +```cmd +C:\\prot\>prottest -n 2 \\DEVICE\\{9273DA7D-5275-4B9A-AC56-68A49D121F1F} +DoWriteProc: finished sending 2 packets of 100 bytes each +DoReadProc finished: read 2 packets +``` -**DoWriteProc: finished sending 2 packets of 100 bytes each** +> [!NOTE] +> With a checked version of ndisprot.sys, you can control the volume of debug information generated by changing the variable `ndisprotDebugLevel`. Refer to debug.h for more information. -**DoReadProc finished: read 2 packets** - -**Note** With a checked version of ndisprot.sys, you can control the volume of debug information generated by changing the variable `ndisprotDebugLevel`. Refer to debug.h for more information. - -For more information, see [NDIS Protocol Drivers](http://msdn.microsoft.com/en-us/library/windows/hardware/ff566821) in the network devices design guide. +For more information, see [NDIS Protocol Drivers](https://docs.microsoft.com/windows-hardware/drivers/network/ndis-protocol-drivers) in the network devices design guide. ## File Manifest -File | Description ------|------------ -prottest.c | User-mode test application -debug.c | Routines to aid debugging -debug.h | Debug macro definitions -macros.h | Spinlock, event, referencing macros -ndisbind.c | NDIS protocol entry points to handle binding/unbinding from adapters -ndisprot.h | Data structure definitions -ndisprot.inf | INF file for installing NDISPROT -ntdisp.c | NT Entry points and dispatch routines for NDISPROT -protuser.h | IOCTL and associated structure definitions -recv.c | NDIS protocol entry points for receiving data, and IRP_MJ_READ processing -send.c | NDIS protocol routines for sending data, and IRP_MJ_WRITE processing
\ No newline at end of file +| File | description | +| --- | --- | +| prottest.c | User-mode test application | +| debug.c | Routines to aid debugging | +| debug.h | Debug macro definitions | +| macros.h | Spinlock, event, referencing macros | +| ndisbind.c | NDIS protocol entry points to handle binding/unbinding from adapters | +| ndisprot.h | Data structure definitions | +| ndisprot.inf | INF file for installing NDISPROT | +| ntdisp.c | NT Entry points and dispatch routines for NDISPROT | +| protuser.h | IOCTL and associated structure definitions | +| recv.c | NDIS protocol entry points for receiving data, and IRP_MJ_READ processing | +| send.c | NDIS protocol routines for sending data, and IRP_MJ_WRITE processing | diff --git a/network/ndis/ndisprot_kmdf/README.md b/network/ndis/ndisprot_kmdf/README.md index cd1b9bfb..6f1c66e6 100644 --- a/network/ndis/ndisprot_kmdf/README.md +++ b/network/ndis/ndisprot_kmdf/README.md @@ -16,40 +16,38 @@ The driver supports sending and receiving raw Ethernet frames using ReadFile/Wri The sample also demonstrates how to write a Notify Object dll. The Notify Object is used for calling into the Wdf Coinstaller to install and load the framework library. -Related technologies --------------------- +## Related technologies -[Creating Framework-based Miniport Drivers](http://msdn.microsoft.com/en-us/library/windows/hardware/ff540778) +[Creating Framework-based Miniport Drivers](https://docs.microsoft.com/windows-hardware/drivers/wdf/creating-kmdf-miniport-drivers) -Build the sample ----------------- +## Build the sample -For information on how to build a driver solution using Microsoft Visual Studio, see [Building a Driver](http://msdn.microsoft.com/en-us/library/windows/hardware/ff554644). +For information on how to build a driver solution using Microsoft Visual Studio, see [Building a Driver with Visual Studio and the WDK](https://docs.microsoft.com/windows-hardware/drivers/develop/building-a-driver). The 60 subdirectory (\\ndisprot\_kmdf\\60) indicates that the built sample will be NDIS 6.0 compatible. -Installation ------------- +## Installation Use the following steps to install the sample. -1. When you build the sample, the build engine produces ndisprot.inf in the build target directory. Copy nprt6wdf.sys, protnotify.dll, and ndisprot.inf to a directory. -2. Copy the KMDF coinstaller (wdfcoinstaller*MMmmm*.dll) to the same directory. +1. When you build the sample, the build engine produces ndisprot.inf in the build target directory. Copy nprt6wdf.sys, protnotify.dll, and ndisprot.inf to a directory. - **Note** You can obtain redistributable framework updates by downloading the *wdfcoinstaller.msi* package from [WDK 8 Redistributable Components](http://go.microsoft.com/fwlink/p/?LinkID=226396). This package performs a silent install into the directory of your Windows Driver Kit (WDK) installation. You will see no confirmation that the installation has completed. You can verify that the redistributables have been installed on top of the WDK by ensuring there is a redist\\wdf directory under the root directory of the WDK, %ProgramFiles(x86)%\\Windows Kits\\8.0. +1. Copy the KMDF coinstaller (wdfcoinstaller*MMmmm*.dll) to the same directory. -3. In Control Panel, in the **Network and Internet** group, open **Network Connections**, select an adapter, and then open **Properties**. + > [!NOTE] + > You can obtain redistributable framework updates by downloading the *wdfcoinstaller.msi* package from [WDK 8 Redistributable Components](https://go.microsoft.com/fwlink/p/?LinkID=253170). This package performs a silent install into the directory of your Windows Driver Kit (WDK) installation. You will see no confirmation that the installation has completed. You can verify that the redistributables have been installed on top of the WDK by ensuring there is a redist\\wdf directory under the root directory of the WDK, %ProgramFiles(x86)%\\Windows Kits\\8.0. -4. Click **Install**, and then click **Protocol**. +1. In Control Panel, in the **Network and Internet** group, open **Network Connections**, select an adapter, and then open **Properties**. -5. Click **Add**, and then click **Have disk**. +1. Click **Install**, and then click **Protocol**. -6. Point to the location of the INF file and driver, click **Sample NDIS Protocol Driver**, and then click **OK**. +1. Click **Add**, and then click **Have disk**. -7. After installing the protocol, copy the test application Uiotest.exe to a convenient location. Note that the driver service has been set to manual start in the INF file. As a result, it doesn't get loaded automatically when you install the driver. +1. Point to the location of the INF file and driver, click **Sample NDIS Protocol Driver**, and then click **OK**. -Usage ------ +1. After installing the protocol, copy the test application Uiotest.exe to a convenient location. Note that the driver service has been set to manual start in the INF file. As a result, it doesn't get loaded automatically when you install the driver. + +## Usage From an administrator command prompt, to start the driver, type **Net start ndisprot**. @@ -59,7 +57,7 @@ You can build Prottest.exe from source code located in the \\ndisprot\\6x\\test To test the NDIS 6.0 driver, run prottest. For help on usage, run **prottest -?**. -``` +```cmd usage: PROTTEST [options] <devicename> options: -e: Enumerate devices @@ -71,12 +69,11 @@ options: -f Use a fake address to send out the packets. ``` - Prottest exercises the IOCTLs supported by NDISPROT, and sends and/or receives data on the selected device. In order to use Prottest, the user must have administrative privilege. Users should pass down a buffer that is large enough to contain the data returned. If the length of the buffer passed down is smaller than the length of the received data, NDISPROT will only copy part of the data and discard the rest when the given buffer is full. For an NDIS 6.0 driver, use the -e option on prottest to enumerate all devices to which NDISPROT is bound: -``` +```cmd C:\prot>prottest -e 0. \DEVICE\{9273DA7D-5275-4B9A-AC56-68A49D121F1F} - Intel-Based 10/100 Ethernet Card @@ -84,7 +81,7 @@ C:\prot>prottest -e The following command sends and receives 2 packets on a device. Since these packets are sent to the local MAC address (default), both packets are received. The device name parameter to prottest is picked up from the output of **prottest -e** (see above). -``` +```cmd C:\prot>prottest -n 2 \DEVICE\{9273DA7D-5275-4B9A-AC56-68A49D121F1F} DoWriteProc: finished sending 2 packets of 100 bytes each DoReadProc finished: read 2 packets @@ -94,31 +91,30 @@ For security reasons, this driver does not allow packets with fake MAC addresses With a checked version of ndisprot.sys, you can control the volume of debug information generated by changing the variable **ndisprotDebugLevel**. Refer to debug.h for more information. -File Manifest -------------- +## File Manifest -**Directory: 60** +### Directory: 60 -File | Description ------|------------ -debug.c | Routines to aid debugging -debug.h | Debug macro definitions -excallbk.c | Handles load order dependency between this sample and NDISWDM sample -macros.h | Spinlock, event, referencing macros -ndisbind.c | NDIS protocol entry points to handle binding/unbinding from adapters -ndisprot.h | Data structure definitions -precomp.h | Contains the precompiled headers -protuser.h | Has the definitions of ioctls issued by protuser.exe application used on NDIS 6.0 -nuiouser.h | Has the definitions of ioctls issued by nuiouser.exe application used on NDIS 5.0 -ndisprot.inf | INF file for installing NDISPROT -ntdisp.c | NT Entry points and dispatch routines for NDISPROT -recv.c | NDIS protocol entry points for receiving data, and IRP_MJ_READ processing +| File | description | +| --- | --- | +| debug.c | Routines to aid debugging | +| debug.h | Debug macro definitions | +| excallbk.c | Handles load order dependency between this sample and NDISWDM sample | +| macros.h | Spinlock, event, referencing macros | +| ndisbind.c | NDIS protocol entry points to handle binding/unbinding from adapters | +| ndisprot.h | Data structure definitions | +| precomp.h | Contains the precompiled headers | +| protuser.h | Has the definitions of ioctls issued by protuser.exe application used on NDIS 6.0 | +| nuiouser.h | Has the definitions of ioctls issued by nuiouser.exe application used on NDIS 5.0 | +| ndisprot.inf | INF file for installing NDISPROT | +| ntdisp.c | NT Entry points and dispatch routines for NDISPROT | +| recv.c | NDIS protocol entry points for receiving data, and IRP_MJ_READ processing | -**Directory: NotifyOb** +### Directory: NotifyOb -File | Description ------|------------ -Common.hpp | Header file containing the common include files for the project -dllmain.cpp | Handles loading/unloading of Wdf Coinstaller and the notify object dll -ProtNotify.idl | Defines the interfaces for the notify object dll -ProtNotify.rc | Resource file for the notify object dll +| File | description | +| --- | --- | +| Common.hpp | Header file containing the common include files for the project | +| dllmain.cpp | Handles loading/unloading of Wdf Coinstaller and the notify object dll | +| ProtNotify.idl | Defines the interfaces for the notify object dll | +| ProtNotify.rc | Resource file for the notify object dll | diff --git a/network/radio/RadioManagerSample/README.md b/network/radio/RadioManagerSample/README.md index 9a5f0e1e..26c36d42 100644 --- a/network/radio/RadioManagerSample/README.md +++ b/network/radio/RadioManagerSample/README.md @@ -16,64 +16,62 @@ The operating system contains a set of APIs which are used as a software mechani When the user turns the radio off (either by using the specific radio software switch or the airplane mode switch), radio transmission must be turned off. The device can be powered off as long as the radio switch does not disappear from the UI. It is very important that the radio manager developer ensures that when the device is powered off, the radio switch does not disappear from the UI. If the radio switch disappears from the UI when the radio is turned off by the user, then user has no way to turn the radio back on! If it is desired to conserve power by cutting power to the device when the radio is turned off, but the device cannot be completely powered off because it disappears from the UI, then the solution would be to put the device in a low power state (e.g. D3). -**Important** The radio manager must be given a name. This is the name of the radio switch that is displayed to the user in the Wireless page of PC Settings. The name must be simple, yet descriptive of what the radio is. For example, for NFC radios, the value of the name field should be "NFC", and for GPS radios, the value of the name field should be "GPS" or "GNSS", whichever is more appropriate. The name must not include the word "radio" or the manufacturer's name or some other word related to the functionality of the radio (e.g. "Location" OR "port"). +> [!IMPORTANT] +> The radio manager must be given a name. This is the name of the radio switch that is displayed to the user in the Wireless page of PC Settings. The name must be simple, yet descriptive of what the radio is. For example, for NFC radios, the value of the name field should be "NFC", and for GPS radios, the value of the name field should be "GPS" or "GNSS", whichever is more appropriate. The name must not include the word "radio" or the manufacturer's name or some other word related to the functionality of the radio (e.g. "Location" OR "port"). - -Installation ------------- +## Installation The sample contains a script, *install.cmd*, which copies the radio manager DLL to the system directory, registers as a COM component, and configures the registry. Copy the *install.cmd*, *SampleRM.reg* and *SampleRM.dll* files to a directory. Run *install.cmd*. -Code Tour ---------- +## Code Tour -File | Description ------|----- -install.cmd | Installation script. Copies and registers the dll and executes SampleRM.reg. -SampleRM.reg | Script to install the Sample Radio Manager into the registry, along with 2 radio instances. -SampleRM.sln | The Visual Studio solution file for building the Sample Radio Manager dll. -sampleRM.idl |The interface definition for the Sample Radio Manager. -RadioMgr.idl | The interface definition for a Windows Radio Manager. -SampleRadioManager.h | Header file for the functions required for a Radio Manager. -SampleRadioInstance.h | Header file for the functions required for a Radio Instance. -SampleInstanceCollection.h | Header file for the functions required for a Collection of Radio Instances. -precomp.h | Common header file. -InternalInterfaces.h | Header file for internal interface used for this sample. -dllmain.cpp | Standard dllmain. -SampleRadioManager.cpp | Implementation details for the Sample Radio Manager. Important concepts include utilizing [IMediaRadioManagerNotifySink](http://msdn.microsoft.com/en-us/library/windows/hardware/hh406534) for radio instance events, adding/Removing radio instances, and queuing and deploying worker jobs for system events. -SampleRadioInstance.cpp | Implementation details for the Sample Radio Instance. Important concepts include accessors and modifiers for radio information, and instance change functions. -SampleInstanceCollection.cpp | Implementation details for the Sample Instance Collection. Important concepts include radio instance discovery and retrieval. -RadioMgr\_interface.cpp | Helper source file to include the MIDL-generated files. +| File | description | +| --- | ---| +| install.cmd | Installation script. Copies and registers the dll and executes SampleRM.reg. | +| SampleRM.reg | Script to install the Sample Radio Manager into the registry, along with 2 radio instances. | +| SampleRM.sln | The Visual Studio solution file for building the Sample Radio Manager dll. | +| sampleRM.idl |The interface definition for the Sample Radio Manager. | +| RadioMgr.idl | The interface definition for a Windows Radio Manager. | +| SampleRadioManager.h | Header file for the functions required for a Radio Manager. | +| SampleRadioInstance.h | Header file for the functions required for a Radio Instance. | +| SampleInstanceCollection.h | Header file for the functions required for a Collection of Radio Instances. | +| precomp.h | Common header file | +| InternalInterfaces.h | Header file for internal interface used for this sample. | +| dllmain.cpp | Standard dllmain | +| Sample Radio Manager. Important concepts include utilizing [IMediaRadioManagerNotifySink](https://docs.microsoft.com/previous-versions/windows/hardware/radio/hh406534(v=vs.85)) for radio instance events, adding/Removing radio instances, and queuing and deploying worker jobs for system events. | +| SampleRadioInstance.cpp | Implementation details for the Sample Radio Instance. Important concepts include accessors and modifiers for radio information, and instance change functions. | +| SampleInstanceCollection.cpp | Implementation details for the Sample Instance Collection. Important concepts include radio instance discovery and retrieval. | +| RadioMgr\_interface.cpp | Helper source file to include the MIDL-generated files. | -Run the sample --------------- +## Run the sample -### Operation ### +### Operation This sample Radio Manager does not operate on an actual radio. Instead, it uses registry keys to act as virtual radios. Each "radio" instance can have the following values: -Name +- Name -RadioState +- RadioState -PreviousRadioState +- PreviousRadioState -IsMultiComm +- IsMultiComm -IsAssociatingDevice +- IsAssociatingDevice -**Note** It is required that the registry key has AT LEAST a Name value, otherwise the Sample Radio Manager will fail to initialize. +> [!NOTE] +> It is required that the registry key has AT LEAST a Name value, otherwise the Sample Radio Manager will fail to initialize. -**Important** The radio manager must be given a name and the registry key must have, as a minimum, a Name value. Otherwise, the Sample Radio Manager will fail to initialize. This is the name of the radio switch that is displayed to the user in the Wireless page of PC Settings. The name must be simple, yet descriptive of what the radio is. For example, for NFC radios, the value of the name field should be "NFC", and for GPS radios, the value of the name field should be "GPS" or "GNSS", whichever is more appropriate. The name must not include the word "radio" or the manufacturer's name or some other word related to the functionality of the radio (e.g. "Location" OR "port"). +> [!IMPORTANT] +> The radio manager must be given a name and the registry key must have, as a minimum, a Name value. Otherwise, the Sample Radio Manager will fail to initialize. This is the name of the radio switch that is displayed to the user in the Wireless page of PC Settings. The name must be simple, yet descriptive of what the radio is. For example, for NFC radios, the value of the name field should be "NFC", and for GPS radios, the value of the name field should be "GPS" or "GNSS", whichever is more appropriate. The name must not include the word "radio" or the manufacturer's name or some other word related to the functionality of the radio (e.g. "Location" OR "port"). When the Radio Manager is initialized, it uses these registry keys to retrieve the "radio" information. The radio state values can be any of the following enum values: - -```c_cpp +```cpp typedef enum _DEVICE_RADIO_STATE { DRS_RADIO_ON = 0, @@ -89,21 +87,21 @@ typedef enum _DEVICE_RADIO_STATE For IsMultiComm and IsAssociatingDevice, a value of 0 means 'no' and 1 means 'yes'. -### Adding and Setting a Radio Instance ### +### Adding and Setting a Radio Instance To add a new radio instance, add a new instance key to the registry key like the following entry: -``` +```inf [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\RadioManagement\Misc\SampleRadioManager\SampleRadioX] "RadioState"=dword:00000000 "Name"="SampleRadioX" "IsMultiComm"=dword:00000000 ``` -### Editing a Radio Instance ### +### Editing a Radio Instance Simply change the values in the registry. For example, change the radio state from DRS\_RADIO\_ON to DRS\_SW\_RADIO\_OFF by changing the 'RadioState' value from 0 to 1. -### Removing a Radio Instance ### +### Removing a Radio Instance Delete the corresponding registry key. diff --git a/network/trans/WFPSampler/README.md b/network/trans/WFPSampler/README.md index 68f86e87..1acc1490 100644 --- a/network/trans/WFPSampler/README.md +++ b/network/trans/WFPSampler/README.md @@ -30,34 +30,33 @@ WFPSamplerSys.Lib is a library of kernel mode helper functions used throughout t Once you have downloaded the sample, the .mht files in the sample's docs directory describe the various WFP filtering scenarios that you can try. -For more information about WFP callout drivers, see [Windows Filtering Platform Callout Drivers](http://msdn.microsoft.com/en-us/library/windows/hardware/ff571068). +For more information about WFP callout drivers, see [Windows Filtering Platform Callout Drivers](https://docs.microsoft.com/windows-hardware/drivers/network/windows-filtering-platform-callout-drivers2). - -Open the driver solution in Visual Studio ------------------------------------------ +## Open the driver solution in Visual Studio Navigate to the folder that contains the sample. Double click the solution file, WFPSampler.sln. In Visual Studio, locate Solution Explorer. (If this is not already open, choose **Solution Explorer** from the **View** menu.) In Solution Explorer, you can see one solution that has these projects: -- a user-mode application project named **WFPSampler** (under the **Exe** node) -- a user-mode library project named **WFPSampler** (under the **Lib** node) -- a user-mode service project named **WFPSamplerService** (under the **Svc** node) -- a driver project named **WFPSamplerCalloutDriver** (under the **Sys** node) -- a kernel-mode library project named **WFPSampler** (under the **Syslib** node) +- a user-mode application project named **WFPSampler** (under the **Exe** node) + +- a user-mode library project named **WFPSampler** (under the **Lib** node) + +- a user-mode service project named **WFPSamplerService** (under the **Svc** node) + +- a driver project named **WFPSamplerCalloutDriver** (under the **Sys** node) + +- a kernel-mode library project named **WFPSampler** (under the **Syslib** node) -Set the configuration and platform in Visual Studio ---------------------------------------------------- +## Set the configuration and platform in Visual Studio In Visual Studio, in Solution Explorer, right click **Solution 'WFPSampler' (5 projects)**, and choose **Configuration Manager**. Set the configuration and the platform. Make sure that the configuration and platform are the same for all projects. Do not check the **Deploy** boxes. -Set the runtime library for the user-mode application, library, and service ---------------------------------------------------------------------------- +## Set the runtime library for the user-mode application, library, and service In Solution Explorer, right-click the **WFPSampler** user-mode application project (under the **Exe** node), and choose **Properties.** Navigate to **Configuration Properties \> C/C++ \> Code Generation**. For **Runtime Library**, select **Multi-threaded Debug (/MTd)**. Click **OK**. Repeat this process for the **WFPSampler** user-mode library (under the **Lib** node) and the **WFPSampler** user-mode service (under the **Svc** node). -Edit the restart setting in the sample installation script ----------------------------------------------------------- +## Edit the restart setting in the sample installation script Open the WfpSamplerInstall.cmd file (in the scripts folder) in Visual Studio. @@ -69,98 +68,103 @@ to this: `RunDLL32.Exe syssetup,SetupInfObjectInstallAction DefaultInstall 132 %WinDir%\System32\Drivers\WFPSamplerCalloutDriver.Inf` -For more information about this setting, see the Remarks section for the [**InstallHinfSection**](http://msdn.microsoft.com/en-us/library/windows/hardware/aa376957) function. +For more information about this setting, see the Remarks section for the [**InstallHinfSection**](https://docs.microsoft.com/windows/win32/api/setupapi/nf-setupapi-installhinfsectiona) function. -Build the sample using Visual Studio ------------------------------------- +## Build the sample using Visual Studio In Visual Studio, on the **Build** menu, choose **Build Solution**. -For more information about using Microsoft Visual Studio to build a driver package, see [Building a Driver](http://msdn.microsoft.com/en-us/library/windows/hardware/ff554644). +For more information about using Microsoft Visual Studio to build a driver package, see [Building a Driver with Visual Studio and the WDK](https://docs.microsoft.com/windows-hardware/drivers/develop/building-a-driver). -Locate the built driver package -------------------------------- +## Locate the built driver package In File Explorer, navigate to the folder that contains your built driver package. The location of this folder varies depending on what you set for configuration and platform. For example, if your settings are Debug and x64, the driver is in your sample folder under **\\Debug**. The driver folder contains these files: -File | Description ------|------------ -wfpsamplercalloutdriver.cat | A signed catalog file, which serves as the signature for the entire package. -WFPSamplerCalloutDriver.inf | An information (INF) file that contains information needed to install the driver. -WFPSamplerCalloutDriver.sys | The WFPSampler driver. +| File | Description | +| --- | --- | +| wfpsamplercalloutdriver.cat | A signed catalog file, which serves as the signature for the entire package. | +| WFPSamplerCalloutDriver.inf | An information (INF) file that contains information needed to install the driver. | +| WFPSamplerCalloutDriver.sys | The WFPSampler driver. | -**Note** The build process might also put WdfCoinstaller010*xx*.dll in the driver folder, but this file is not really part of the driver package. The INF file does not reference any coinstallers. +> [!NOTE] +> The build process might also put WdfCoinstaller010*xx*.dll in the driver folder, but this file is not really part of the driver package. The INF file does not reference any coinstallers. Because the package does not contain a KMDF coinstaller, it is important that you set the KMDF minor version according to your target operating system when you built the driver. -Locate the symbol file (PDB) for the driver -------------------------------------------- +## Locate the symbol file (PDB) for the driver In **File Explorer**, locate the symbol file, WFPSamplerCalloutDriver.pdb. The location of this file varies depending on what you set for configuration and platform. For example, if your settings are Debug and Win32, the PDB file is in your sample folder under sys\\Debug. -Locate the user-mode application and its symbol file (PDB) ----------------------------------------------------------- +## Locate the user-mode application and its symbol file (PDB) In **File Explorer**, locate the user-mode application (WFPSampler.exe) and its symbol file (WFPSampler.pdb). The location of these files varies depending on what you set for configuration and platform. For example, if your settings are Debug and x64, WFPSampler.exe and WFPSampler.pdb are in your sample folder under exe\\Debug. -Locate the kernel-mode service and its symbol file (PDB) --------------------------------------------------------- +## Locate the kernel-mode service and its symbol file (PDB) In **File Explorer**, locate the kernel-mode library, WFPSamplerService.exe. The location of this file varies depending on what you set for configuration and platform. For example, if your settings are Debug and x64, WFPSamplerService.exe and WFPSamplerService.pdb are in your sample folder under svc\\Debug. -Run the sample --------------- +## Run the sample The computer where you install the driver is called the *target computer* or the *test computer*. Typically this is a separate computer from where you develop and build the driver package. The computer where you develop and build the driver is called the *host computer*. The process of moving the driver to the target computer and installing the driver is called *deploying the driver*. You can deploy the Windows Filtering Platform Sample driver automatically or manually. -Automatic deployment --------------------- +## Automatic deployment + +Before you automatically deploy a driver, you must provision the target computer. For instructions, see [Provision a computer for driver deployment and testing](https://docs.microsoft.com/windows-hardware/drivers/gettingstarted/provision-a-target-computer-wdk-8-1). + +After you have provisioned the target computer, continue with these steps: + +1. On the host computer, in Visual Studio, in Solution Explorer, right-click **package** (lower case), and choose **Properties**. Navigate to **Configuration Properties \> Driver Install \> Deployment**. + +1. Check **Enable deployment**, and check **Remove previous driver versions before deployment**. For **Target Computer Name**, select the name of a target computer that you provisioned previously. Select **Do not install**. Click **OK**. -Before you automatically deploy a driver, you must provision the target computer. For instructions, see [Configuring a Computer for Driver Deployment, Testing, and Debugging](http://msdn.microsoft.com/en-us/library/windows/hardware/). After you have provisioned the target computer, continue with these steps: +1. In the **Build** menu, choose **Build Solution**. -1. On the host computer, in Visual Studio, in Solution Explorer, right-click **package** (lower case), and choose **Properties**. Navigate to **Configuration Properties \> Driver Install \> Deployment**. -2. Check **Enable deployment**, and check **Remove previous driver versions before deployment**. For **Target Computer Name**, select the name of a target computer that you provisioned previously. Select **Do not install**. Click **OK**. -3. In the **Build** menu, choose **Build Solution**. -4. Copy the following files to the DriverTest\\Drivers folder on the target computer: - - The user-mode application (WFPSampler.exe) file - - The kernel-mode service (WFPSamplerService.exe) file +1. Copy the following files to the DriverTest\\Drivers folder on the target computer: -Manual deployment ------------------ + - The user-mode application (WFPSampler.exe) file -Before you manually deploy a driver, you must turn on test signing and install a certificate on the target computer. You also need to copy the [DevCon](http://msdn.microsoft.com/en-us/library/windows/hardware/ff544707) tool to the target computer. For instructions, see [Preparing a Computer for Manual Driver Deployment](https://docs.microsoft.com/en-us/windows-hardware/drivers/develop/preparing-a-computer-for-manual-driver-deployment). After you have prepared the target computer for manual deployment, copy the following files to a folder on the target computer (for example, c:\\WFPSamplerSamplePackage): + - The kernel-mode service (WFPSamplerService.exe) file -- The 4 files in your driver package folder -- The user-mode application (WFPSampler.exe) file -- The kernel-mode service (WFPSamplerService.exe) file +## Manual deployment -Copy additional files to the target computer --------------------------------------------- +Before you manually deploy a driver, you must turn on test signing and install a certificate on the target computer. You also need to copy the [DevCon](https://docs.microsoft.com/windows-hardware/drivers/devtest/devcon) tool to the target computer. For instructions, see [Preparing a Computer for Manual Driver Deployment](https://docs.microsoft.com/windows-hardware/drivers/develop/preparing-a-computer-for-manual-driver-deployment). + +After you have prepared the target computer for manual deployment, copy the following files to a folder on the target computer (for example, c:\\WFPSamplerSamplePackage): + +- The 4 files in your driver package folder + +- The user-mode application (WFPSampler.exe) file + +- The kernel-mode service (WFPSamplerService.exe) file + +## Copy additional files to the target computer Copy the driver's PDB file (WFPSamplerCalloutDriver.pdb), the user-mode service's PDB file (WFPSamplerService.pdb) and the user-mode application's PDB file (WFPSampler.pdb) to a folder on the target computer (for example, c:\\Symbols). -Copy the [**TraceView**](http://msdn.microsoft.com/en-us/library/windows/hardware/ff553872) and [**SignTool**](http://msdn.microsoft.com/en-us/library/windows/hardware/ff551778) tools to a folder on the target computer (for example c:\\Tools). +Copy the [**TraceView**](https://docs.microsoft.com/windows-hardware/drivers/devtest/traceview) and [**SignTool**](https://docs.microsoft.com/windows-hardware/drivers/devtest/signtool) tools to a folder on the target computer (for example c:\\Tools). -- [**TraceView**](http://msdn.microsoft.com/en-us/library/windows/hardware/ff553872) comes with the WDK. You can find it in your WDK installation folder under Tools (for example, c:\\Program Files (x86)\\Windows Kits\\10\\Tools\\x64\\TraceView.exe). -- [**SignTool**](http://msdn.microsoft.com/en-us/library/windows/hardware/ff551778) also comes with the WDK. You can find it in your WDK installation folder under bin (for example, c:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64\\SignTool.exe). +- [**TraceView**](https://docs.microsoft.com/windows-hardware/drivers/devtest/traceview) comes with the WDK. You can find it in your WDK installation folder under Tools (for example, c:\\Program Files (x86)\\Windows Kits\\10\\Tools\\x64\\TraceView.exe). -Installing the driver ---------------------- +- [**SignTool**](https://docs.microsoft.com/windows-hardware/drivers/devtest/signtool) also comes with the WDK. You can find it in your WDK installation folder under bin (for example, c:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64\\SignTool.exe). -1. On the target computer, open a Command Prompt window as Administrator. Navigate to the folder that contains the installation script: - - For manual deployment, this will be the folder that you copied the driver page files into (for example, c:\\WFPSamplerSamplePackage). - - For automatic deployment, this will be DriverTest\\Drivers. +## Installing the driver -2. Enter **WFPSamplerInstall.cmd** to run the installation script. +1. On the target computer, open a Command Prompt window as Administrator. Navigate to the folder that contains the installation script: - **Note** If you need to uninstall a previous version of the driver, enter **WFPSamplerInstall.cmd -r**. + - For manual deployment, this will be the folder that you copied the driver page files into (for example, c:\\WFPSamplerSamplePackage). -Running the user-mode application ---------------------------------- + - For automatic deployment, this will be DriverTest\\Drivers. + +1. Enter **WFPSamplerInstall.cmd** to run the installation script. + + > [!NOTE] + > If you need to uninstall a previous version of the driver, enter `WFPSamplerInstall.cmd -r`. + +## Running the user-mode application On the target computer, open a Command Prompt window as Administrator. @@ -170,20 +174,20 @@ The .mht files in the docs directory describe the various WFP filtering scenario For example, you can test the basic packet examination scenario by using the following command line: -**WFPSampler.exe -s BASIC\_PACKET\_EXAMINATION -l FWPM\_LAYER\_INBOUND\_IPPACKET\_V4 -v** +`WFPSampler.exe -s BASIC\_PACKET\_EXAMINATION -l FWPM\_LAYER\_INBOUND\_IPPACKET\_V4 -v` This command line adds a dynamic filter (-v) at the FWPM\_LAYER\_INBOUND\_IPPACKET\_V4 layer (-l) which references the appropriate callout driver function. This filter will have no conditions, so it will act on all traffic seen at this layer. -Start a logging session in TraceView ------------------------------------- +## Start a logging session in TraceView On the target computer, open TraceView.exe as Administrator. On the **File** menu, choose **Create New Log Session**. Click **Add Provider**. Select **PDB (Debug Information File)**, and enter the path to your PDB file, WFPSamplerCalloutDriver.pdb. Click **OK** and click **Next**. Click the **\>\>** button next to **Set Flags and Level**, double-click the **L** button next to **Level**, and set the **Level** to **Information**. Click **OK** and click **Finish**. If you want to test whether your TraceView.exe session is working, you can enter the following commands and see what the trace output looks like: -- **net stop WFPSamplerCallouts** -- **net start WFPSamplerCallouts** +- `net stop WFPSamplerCallouts` + +- `net start WFPSamplerCallouts` -For more information, see [Creating a Trace Session with a PDB File](http://msdn.microsoft.com/en-us/library/windows/hardware/ff543582). +For more information, see [Creating a Trace Session with a PDB File](https://docs.microsoft.com/windows-hardware/drivers/devtest/creating-a-trace-session-with-a-pdb-file). Tracing for the sample driver can be started at any time before the driver is started or while the driver is already running. diff --git a/network/trans/ddproxy/README.md b/network/trans/ddproxy/README.md index ee021020..036d21bc 100644 --- a/network/trans/ddproxy/README.md +++ b/network/trans/ddproxy/README.md @@ -16,55 +16,59 @@ The sample driver demonstrates the packet modification capabilities of the Windo This sample builds a Universal Windows Driver. It uses only APIs and DDIs that are included in OneCoreUAP. -Run the sample --------------- +## Run the sample The computer where you install the driver is called the *target computer* or the *test computer*. Typically this is a separate computer from where you develop and build the driver package. The computer where you develop and build the driver is called the *host computer*. The process of moving the driver package to the target computer and installing the driver is called *deploying the driver*. You can deploy the Windows Filtering Platform Packet Modification Sample driver automatically or manually. -Automatic deployment --------------------- +## Automatic deployment -Before you automatically deploy a driver, you must provision the target computer. For instructions, see [Configuring a Computer for Driver Deployment, Testing, and Debugging](http://msdn.microsoft.com/en-us/library/windows/hardware/). After you have provisioned the target computer, continue with these steps: +Before you automatically deploy a driver, you must provision the target computer. For instructions, see [Provision a computer for driver deployment and testing](https://docs.microsoft.com/windows-hardware/drivers/gettingstarted/provision-a-target-computer-wdk-8-1). -1. On the host computer, in Visual Studio, in Solution Explorer, right click **package** (lower case), and choose **Properties**. Navigate to **Configuration Properties \> Driver Install \> Deployment**. -2. Check **Enable deployment**, and check **Remove previous driver versions before deployment**. For **Target Computer Name**, select the name of a target computer that you provisioned previously. Select **Do not install**. Click **OK**. -3. On the **Build** menu, choose **Build Solution**. -4. On the target computer, navigate to DriverTest\\Drivers, and locate the file ddproxy.inf. Right click ddproxy.inf, and choose **Install**. +After you have provisioned the target computer, continue with these steps: -Manual deployment ------------------ +1. On the host computer, in Visual Studio, in Solution Explorer, right click **package** (lower case), and choose **Properties**. Navigate to **Configuration Properties \> Driver Install \> Deployment**. -Before you manually deploy a driver, you must turn on test signing and install a certificate on the target computer. You also need to copy the [DevCon](http://msdn.microsoft.com/en-us/library/windows/hardware/ff544707) tool to the target computer. For instructions, see [Preparing a Computer for Manual Driver Deployment](https://docs.microsoft.com/en-us/windows-hardware/drivers/develop/preparing-a-computer-for-manual-driver-deployment). After you have prepared the target computer for manual deployment, continue with these steps: +1. Check **Enable deployment**, and check **Remove previous driver versions before deployment**. For **Target Computer Name**, select the name of a target computer that you provisioned previously. Select **Do not install**. Click **OK**. -1. Copy all of the files in your driver package to a folder on the target computer (for example, c:\\WfpPacketModificationSamplePackage). -2. On the target computer, navigate to your driver package folder. Right click ddproxy.inf, and choose **Install** +1. On the **Build** menu, choose **Build Solution**. -Create Registry values ----------------------- +1. On the target computer, navigate to DriverTest\\Drivers, and locate the file ddproxy.inf. Right click ddproxy.inf, and choose **Install**. -1. On the target computer, open Regedit, and navigate to this key: +## Manual deployment + +Before you manually deploy a driver, you must turn on test signing and install a certificate on the target computer. You also need to copy the [DevCon](https://docs.microsoft.com/windows-hardware/drivers/devtest/devcon) tool to the target computer. For instructions, see [Preparing a Computer for Manual Driver Deployment](https://docs.microsoft.com/windows-hardware/drivers/develop/preparing-a-computer-for-manual-driver-deployment). + +After you have prepared the target computer for manual deployment, continue with these steps: + +1. Copy all of the files in your driver package to a folder on the target computer (for example, c:\\WfpPacketModificationSamplePackage). + +1. On the target computer, navigate to your driver package folder. Right click ddproxy.inf, and choose **Install** + +## Create Registry values + +1. On the target computer, open Regedit, and navigate to this key: **HKLM**\\**System**\\**CurrentControlSet**\\**Services**\\**ddproxy**\\**Parameters** -2. Create a REG\_SZ entry named **DestinationAddressToIntercept** and set it's value to an IPV4 or IPV6 address (example: 10.0.0.1). +1. Create a REG\_SZ entry named **DestinationAddressToIntercept** and set it's value to an IPV4 or IPV6 address (example: 10.0.0.1). -3. Create a REG\_SZ entry named **NewDestinationAddress**, and set it's value to an IPV4 or IPV6 address (example: 10.0.0.2). +1. Create a REG\_SZ entry named **NewDestinationAddress**, and set it's value to an IPV4 or IPV6 address (example: 10.0.0.2). You can also create and set values for the following registry entries. -- **InspectUdp** (REG\_DWORD type): 0 for ICMP and 1 for UDP (default) -- **DestinationPortToIntercept** (REG\_DWORD type): UDP port number (applicable if InspectUdp is set to 1) -- **NewDestinationPort** (REG\_DWORD type): UDP port number (applicable if InspectUdp is set to 1) +- **InspectUdp** (REG\_DWORD type): 0 for ICMP and 1 for UDP (default) + +- **DestinationPortToIntercept** (REG\_DWORD type): UDP port number (applicable if InspectUdp is set to 1) + +- **NewDestinationPort** (REG\_DWORD type): UDP port number (applicable if InspectUdp is set to 1) -Start the ddproxy service -------------------------- +## Start the ddproxy service -On the target computer, open a Command Prompt window as Administrator, and enter **net start ddproxy**. (To stop the driver, enter **net stop ddproxy**.) +On the target computer, open a Command Prompt window as Administrator, and enter `net start ddproxy`. (To stop the driver, enter `net stop ddproxy`.) -Remarks -------- +## Remarks This sample driver consists of a kernel-mode Windows Filtering Platform (WFP) callout driver (Ddproxy.sys) that intercepts User Datagram Protocol (UDP) and nonerror Internet Control Message Protocol (ICMP) traffic of interest and acts as a redirector. For outbound traffic, Ddproxy.sys redirects the traffic to a new destination address and, for UDP, a new UDP port. For inbound traffic, Ddproxy.sys redirects the traffic back to the original address and UDP port values. This redirection is transparent to the application. @@ -72,4 +76,4 @@ Packet modification is done out-of-band by a system worker thread by using the r Ddproxy.sys acts as a redirector for both Internet Protocol version 4 (IPv4) and Internet Protocol version 6 (IPv6) traffic. -For more information on creating a Windows Filtering Platform Callout Driver, see [Windows Filtering Platform Callout Drivers](http://msdn.microsoft.com/en-us/library/windows/hardware/ff571068). +For more information on creating a Windows Filtering Platform Callout Driver, see [Windows Filtering Platform Callout Drivers](https://docs.microsoft.com/windows-hardware/drivers/network/windows-filtering-platform-callout-drivers2). diff --git a/network/trans/inspect/README.md b/network/trans/inspect/README.md index cc294fb1..e590e930 100644 --- a/network/trans/inspect/README.md +++ b/network/trans/inspect/README.md @@ -24,41 +24,44 @@ Connect/Packet inspection is done out-of-band by a system worker thread by using This sample builds a Universal Windows Driver. It uses only APIs and DDIs that are included in OneCoreUAP. -Automatic deployment --------------------- +## Automatic deployment -Before you automatically deploy a driver, you must provision the target computer. For instructions, see [Configuring a Computer for Driver Deployment, Testing, and Debugging](http://msdn.microsoft.com/en-us/library/windows/hardware/). After you have provisioned the target computer, continue with these steps: +Before you automatically deploy a driver, you must provision the target computer. For instructions, see [Provision a computer for driver deployment and testing](https://docs.microsoft.com/windows-hardware/drivers/gettingstarted/provision-a-target-computer-wdk-8-1). -1. On the host computer, in Visual Studio, in Solution Explorer, right click **package** (lower case), and choose **Properties**. Navigate to **Configuration Properties \> Driver Install \> Deployment**. -2. Check **Enable deployment**, and check **Remove previous driver versions before deployment**. For **Target Computer Name**, select the name of a target computer that you provisioned previously. Select **Do not install**. Click **OK**. -3. On the **Build** menu, choose **Build Solution**. -4. On the target computer, navigate to DriverTest\\Drivers, and locate the file inspect.inf. Right click inspect.inf, and choose **Install**. +After you have provisioned the target computer, continue with these steps: -Manual deployment ------------------ +1. On the host computer, in Visual Studio, in Solution Explorer, right click **package** (lower case), and choose **Properties**. Navigate to **Configuration Properties \> Driver Install \> Deployment**. -Before you manually deploy a driver, you must turn on test signing and install a certificate on the target computer. You also need to copy the [DevCon](http://msdn.microsoft.com/en-us/library/windows/hardware/ff544707) tool to the target computer. For instructions, see [Preparing a Computer for Manual Driver Deployment](https://docs.microsoft.com/en-us/windows-hardware/drivers/develop/preparing-a-computer-for-manual-driver-deployment). After you have prepared the target computer for manual deployment, continue with these steps: +1. Check **Enable deployment**, and check **Remove previous driver versions before deployment**. For **Target Computer Name**, select the name of a target computer that you provisioned previously. Select **Do not install**. Click **OK**. -1. Copy all of the files in your driver package to a folder on the target computer (for example, c:\\WfpTrafficInspectionSamplePackage). -2. On the target computer, navigate to your driver package folder. Right click inspect.inf, and choose **Install** +1. On the **Build** menu, choose **Build Solution**. -Create Registry values ----------------------- +1. On the target computer, navigate to DriverTest\\Drivers, and locate the file inspect.inf. Right click inspect.inf, and choose **Install**. -1. On the target computer, open Regedit, and navigate to this key: +## Manual deployment + +Before you manually deploy a driver, you must turn on test signing and install a certificate on the target computer. You also need to copy the [DevCon](https://docs.microsoft.com/windows-hardware/drivers/devtest/devcon) tool to the target computer. For instructions, see [Preparing a Computer for Manual Driver Deployment](https://docs.microsoft.com/windows-hardware/drivers/develop/preparing-a-computer-for-manual-driver-deployment). + +After you have prepared the target computer for manual deployment, continue with these steps: + +1. Copy all of the files in your driver package to a folder on the target computer (for example, c:\\WfpTrafficInspectionSamplePackage). + +1. On the target computer, navigate to your driver package folder. Right click inspect.inf, and choose **Install** + +## Create Registry values + +1. On the target computer, open Regedit, and navigate to this key: **HKLM**\\**System**\\**CurrentControlSet**\\**Services**\\**inspect**\\**Parameters** -2. Create a REG\_DWORD entry named **BlockTraffic** and set it's value to 0 for permit or 1 to block. +1. Create a REG\_DWORD entry named **BlockTraffic** and set it's value to 0 for permit or 1 to block. -3. Create a REG\_SZ entry named **RemoteAddressToInspect**, and set it's value to an IPV4 or IPV6 address (example: 10.0.0.2). +1. Create a REG\_SZ entry named **RemoteAddressToInspect**, and set it's value to an IPV4 or IPV6 address (example: 10.0.0.2). -Start the inspect service -------------------------- +## Start the inspect service -On the target computer, open a Command Prompt window as Administrator, and enter **net start inspect**. (To stop the driver, enter **net stop inspect**.) +On the target computer, open a Command Prompt window as Administrator, and enter `net start inspect`. (To stop the driver, enter `net stop inspect`.) -Remarks -------- +## Remarks -For more information on creating a Windows Filtering Platform Callout Driver, see [Windows Filtering Platform Callout Drivers](http://msdn.microsoft.com/en-us/library/windows/hardware/ff571068). +For more information on creating a Windows Filtering Platform Callout Driver, see [Windows Filtering Platform Callout Drivers](https://docs.microsoft.com/windows-hardware/drivers/network/windows-filtering-platform-callout-drivers2). diff --git a/network/trans/msnmntr/README.md b/network/trans/msnmntr/README.md index ef3f073a..41846336 100644 --- a/network/trans/msnmntr/README.md +++ b/network/trans/msnmntr/README.md @@ -14,7 +14,8 @@ This sample application and driver demonstrate the stream inspection capabilitie The sample consists of a user mode application (Monitor.exe) that registers traffic of interest. In this case, all Transmission Control Protocol (TCP) data segments that are sent and received by an application of your choice. -**Note** Originally this sample was written to monitor the MSN Messenger application. Now it can monitor any application that you specify. +> [!NOTE] +> Originally this sample was written to monitor the MSN Messenger application. Now it can monitor any application that you specify. Monitor.exe adds filters and callouts to Windows through the Windows Filtering Platform (WFP) Win32 API. A kernel-mode WFP callout driver (Msnmntr.sys) intercepts TCP traffic and parses out communication patterns. Monitor.exe controls the operations of the callout driver through I/O controls (IOCTLs). @@ -24,26 +25,31 @@ Msnmntr.sys registers itself at two different WFP layers: FLOW-ESTABLISHED and S After the filters and callouts are in place and registered, WFP indicates TCP data segments to the Msnmntr.sys for inspection. As the data flows through Msnmntr.sys, it copies them (described by a chain of NET\_BUFFER\_LIST structures) to a flat buffer, parses out the communication patterns (such as client-to-server/client-to-client), and sends them to the Windows Software Trace Preprocessor (WPP) for tracing. -Automatic deployment --------------------- +## Automatic deployment -Before you automatically deploy a driver, you must provision the target computer. For instructions, see [Configuring a Computer for Driver Deployment, Testing, and Debugging](http://msdn.microsoft.com/en-us/library/windows/hardware/). After you have provisioned the target computer, continue with these steps: +Before you automatically deploy a driver, you must provision the target computer. For instructions, see [Provision a computer for driver deployment and testing](https://docs.microsoft.com/windows-hardware/drivers/gettingstarted/provision-a-target-computer-wdk-8-1). -1. On the host computer, in Visual Studio, in Solution Explorer, right click **package** (lower case), and choose **Properties**. Navigate to **Configuration Properties \> Driver Install \> Deployment**. -2. Check **Enable deployment**, and check **Remove previous driver versions before deployment**. For **Target Computer Name**, select the name of a target computer that you provisioned previously. Select **Do not install**. Click **OK**. -3. On the **Build** menu, choose **Build Solution**. -4. On the target computer, navigate to DriverTest\\Drivers, and locate the file msnmntr.inf. Right click msnmntr.inf, and choose **Install**. +After you have provisioned the target computer, continue with these steps: -Manual deployment ------------------ +1. On the host computer, in Visual Studio, in Solution Explorer, right click **package** (lower case), and choose **Properties**. Navigate to **Configuration Properties \> Driver Install \> Deployment**. -Before you manually deploy a driver, you must turn on test signing and install a certificate on the target computer. You also need to copy the [DevCon](http://msdn.microsoft.com/en-us/library/windows/hardware/ff544707) tool to the target computer. For instructions, see [Preparing a Computer for Manual Driver Deployment](https://docs.microsoft.com/en-us/windows-hardware/drivers/develop/preparing-a-computer-for-manual-driver-deployment). After you have prepared the target computer for manual deployment, continue with these steps: +1. Check **Enable deployment**, and check **Remove previous driver versions before deployment**. For **Target Computer Name**, select the name of a target computer that you provisioned previously. Select **Do not install**. Click **OK**. -1. Copy all of the files in your driver package to a folder on the target computer (for example, c:\\WfpMsnMessengerMonitorSamplePackage). -2. On the target computer, navigate to your driver package folder. Right click msnmntr.inf, and choose **Install** +1. On the **Build** menu, choose **Build Solution**. -Copy additional files to the target computer --------------------------------------------- +1. On the target computer, navigate to DriverTest\\Drivers, and locate the file msnmntr.inf. Right click msnmntr.inf, and choose **Install**. + +## Manual deployment + +Before you manually deploy a driver, you must turn on test signing and install a certificate on the target computer. You also need to copy the [DevCon](https://docs.microsoft.com/windows-hardware/drivers/devtest/devcon) tool to the target computer. For instructions, see [Preparing a Computer for Manual Driver Deployment](https://docs.microsoft.com/windows-hardware/drivers/develop/preparing-a-computer-for-manual-driver-deployment). + +After you have prepared the target computer for manual deployment, continue with these steps: + +1. Copy all of the files in your driver package to a folder on the target computer (for example, c:\\WfpMsnMessengerMonitorSamplePackage). + +1. On the target computer, navigate to your driver package folder. Right click msnmntr.inf, and choose **Install** + +## Copy additional files to the target computer Copy the user-mode application, monitor.exe to a folder on the target computer (for example, c:\\WfpMsnMessengerMonitorSampleApp). @@ -51,37 +57,33 @@ Copy the PDB file, msnmntr.pdb to a folder on the target computer (for example, Copy the tool TraceView.exe to a folder on the target computer (for example c:\\Tools). TraceView.exe comes with the WDK. You can find it in your WDK installation folder under Tools (for example, c:\\Program Files (x86)\\Windows Kits\\10\\Tools\\x64\\TraceView.exe). -Start the msnmntr service -------------------------- +## Start the msnmntr service -On the target computer, open a Command Prompt window as Administrator, and enter **net start msnmntr**. (To stop the driver, enter **net stop msnmntr**.) +On the target computer, open a Command Prompt window as Administrator, and enter `net start msnmntr`. (To stop the driver, enter `net stop msnmntr`.) -Running the user-mode application ---------------------------------- +## Running the user-mode application -On the target computer, open a Command Prompt window as Administrator, and navigate to the folder that contains monitor.exe. Enter **monitor.exe addcallouts**. Then enter **monitor.exe monitor** *TargetAppPath*, where *TargetAppPath* is the path to the application that you want to monitor. Here is an example that initiates monitoring of Internet Explorer. +On the target computer, open a Command Prompt window as Administrator, and navigate to the folder that contains monitor.exe. Enter `monitor.exe addcallouts`. Then enter `monitor.exe monitor` *TargetAppPath*, where *TargetAppPath* is the path to the application that you want to monitor. Here is an example that initiates monitoring of Internet Explorer. -``` +```cmd monitor.exe addcallouts monitor.exe monitor "C:\Program Files (x86)\Internet Explorer\iexplore.exe" ``` -Start a logging session in TraceView ------------------------------------- +## Start a logging session in TraceView On the target computer, open TraceView.exe as Administrator. On the **File** menu, choose **Create New Log Session**. Click **Add Provider**. Select **PDB (Debug Information File)**, and enter the path to your PDB file, msnmntr.pdb. Click **OK**, and finish working through the setup procedure. Open Internet Explorer, and watch the communication patterns being displayed in the Traceview.exe tool. Tracing for the sample driver can be started at any time before the driver is started or while the driver is already running. -For more information on creating a Windows Filtering Platform Callout Driver, see [Windows Filtering Platform Callout Drivers](http://msdn.microsoft.com/en-us/library/windows/hardware/ff571068). +For more information on creating a Windows Filtering Platform Callout Driver, see [Windows Filtering Platform Callout Drivers](https://docs.microsoft.com/windows-hardware/drivers/network/windows-filtering-platform-callout-drivers2). -Using MSBuild -------------- +## Using MSBuild As an alternative to building the WFP MSN Messenger Monitor Sample in Visual Studio, you can build it in a Visual Studio Command Prompt window. In Visual Studio, on the **Tools** menu, choose **Visual Studio Command Prompt**. In the Visual Studio Command Prompt window, navigate to the folder that has the solution file, msnmntr.sln. Use the [MSBuild](http://go.microsoft.com/fwlink/p/?linkID=262804) command to build the solution. Here are some examples: -**msbuild /p:configuration="Debug" /p:platform="x64" msnmntr.sln** +`msbuild /p:configuration="Debug" /p:platform="x64" msnmntr.sln` -**msbuild /p:configuration="Release" /p:platform="Win32" msnmntr.sln** +`msbuild /p:configuration="Release" /p:platform="Win32" msnmntr.sln` -For more information about using [MSBuild](http://go.microsoft.com/fwlink/p/?linkID=262804) to build a driver package, see [Building a Driver](http://msdn.microsoft.com/en-us/library/windows/hardware/ff554644). +For more information about using [MSBuild](https://docs.microsoft.com/visualstudio/msbuild/msbuild?view=vs-2019) to build a driver package, see [Building a Driver Using the Command Line (MSBuild)](https://docs.microsoft.com/en-us/windows-hardware/drivers/develop/building-a-driver#building-a-driver-using-the-command-line-msbuild). diff --git a/network/wsk/echosrv/README.md b/network/wsk/echosrv/README.md index fe1c4dcd..a7040f45 100644 --- a/network/wsk/echosrv/README.md +++ b/network/wsk/echosrv/README.md @@ -16,51 +16,52 @@ The sample implements a simple kernel-mode application by using the Winsock Kern This sample is not intended for use in a production environment. - -WPP SOFTWARE TRACING --------------------- +## WPP SOFTWARE TRACING This sample driver uses WPP Software Tracing in order to log its actions. You can find detailed information on WPP Software Tracing in the WDK documentation. Here is a quick overview of one way to collect trace logs from the sample driver by using the tracing tools that are available in the \\tools\\tracing directory in the WDK. All code for this sample is located in \\network\\WSK\\echosrv directory. -1. In a Command Prompt window, copy Echosrv.ctl and Echosrv.pdb into a directory and change to that directory (cd). -2. Start software tracing for the sample driver by typing the following command: +1. In a Command Prompt window, copy Echosrv.ctl and Echosrv.pdb into a directory and change to that directory (cd). + +1. Start software tracing for the sample driver by typing the following command: - **tracelog -start echosrvtrace -guid echosrv.ctl -f logfile.etl -flags 0x3** + `tracelog -start echosrvtrace -guid echosrv.ctl -f logfile.etl -flags 0x3` The value that is provided for the -flags option determines which events will be logged by the sample driver. The sample currently has two event types denoted by the TRCERROR and TRCINFO macros where TRCERROR is 0x1 and TRCINFO is 0x2. Thus, a flag value of 0x3 (0x1 combined in a bitwise OR with 0x2) in the previous tracelog command tells the sample driver to log both TRCERROR and TRCINFO events. -3. In order to stop tracing, type the following command: +1. In order to stop tracing, type the following command: tracelog -stop echosrvtrace -4. Convert the trace logs in Logfile.etl into a human-readable format by typing the following command: +1. Convert the trace logs in Logfile.etl into a human-readable format by typing the following command: - **tracefmt -o logfile.txt -f logfile.etl -r . -i \\***full-path***\\ echosrv.sys** + `tracefmt -o logfile.txt -f logfile.etl -r . -i \full-path\ echosrv.sys` -5. Open Logfile.txt to view the trace logs. + where \\*full-path*\\ is the directory that contains the Echosrv.sys file. + +1. Open Logfile.txt to view the trace logs. Be aware that tracing for the sample driver can be started at any time before the driver is started or while the driver is already running. -To run the sample ------------------ +## To run the sample Install and run this sample driver by using the following steps: -1. Copy the Echosrv.sys file to a directory on the test machine. -2. In a Command Prompt window, type the following command: +1. Copy the Echosrv.sys file to a directory on the test machine. + +1. In a Command Prompt window, type the following command: - **sc create echosrv type= kernel binpath= \\***full-path***\\ echosrv.sys** + `sc create echosrv type= kernel binpath= \full-path\ echosrv.sys` where \\*full-path*\\ is the directory that contains the Echosrv.sys file. -3. To start the driver, type: +1. To start the driver, type: - **sc start echosrv** + `sc start echosrv` -4. To stop the driver, type: +1. To stop the driver, type: - **sc stop echosrv** + `sc stop echosrv` After the driver is installed and started, it will listen for incoming TCP connection requests on port 40007 over both IPv4 and IPv6 protocols until the driver is stopped. On each connection, the driver will echo all the received data back to the peer until the connection is closed by the peer. -For more information on the usage of the Winsock Kernel (WSK) programming interface, see [Winsock Kernel](http://msdn.microsoft.com/en-us/library/windows/hardware/ff571084). +For more information on the usage of the Winsock Kernel (WSK) programming interface, see [Winsock Kernel](https://docs.microsoft.com/windows-hardware/drivers/network/winsock-kernel). |
