summaryrefslogtreecommitdiff
path: root/general/toaster
diff options
context:
space:
mode:
Diffstat (limited to 'general/toaster')
-rw-r--r--general/toaster/toastpkg/README.md92
-rw-r--r--general/toaster/umdf2/README.md26
2 files changed, 62 insertions, 56 deletions
diff --git a/general/toaster/toastpkg/README.md b/general/toaster/toastpkg/README.md
index 91ffaf8d..7aceb704 100644
--- a/general/toaster/toastpkg/README.md
+++ b/general/toaster/toastpkg/README.md
@@ -8,17 +8,6 @@ products:
- windows-wdk
---
-
-
-<!---
- name: Toaster Package Sample Driver
- platform: WDM
- language: cpp
- category: General
- description: Simulates hardware-first and software-first installation of the toaster sample driver.
- samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=617723
---->
-
# Toaster Package Sample Driver
The Toaster collection is an iterative series of samples that demonstrate fundamental aspects of Windows driver development for both Kernel-Mode Driver Framework (KMDF) and User-Mode Driver Framework (UMDF) version 1.
@@ -29,9 +18,9 @@ The Toaster sample collection comprises driver projects (.vcxproj files) that ar
## Related technologies
-[Windows Driver Frameworks](http://msdn.microsoft.com/en-us/library/windows/hardware/ff557565)
+[Windows Driver Frameworks](https://docs.microsoft.com/windows-hardware/drivers/wdf/)
-For detailed descriptions and code walkthroughs of each project, see [Sample Toaster Driver Programming Tour](http://msdn.microsoft.com/en-us/library/windows/hardware/dn569312). To learn how to build and run the samples, read on.
+For detailed descriptions and code walkthroughs of each project, see [Sample Toaster Driver Programming Tour](https://docs.microsoft.com/windows-hardware/drivers/wdf/sample-toaster-driver-programming-tour). To learn how to build and run the samples, read on.
## Run the sample
@@ -44,23 +33,29 @@ The process of moving the driver package to the target computer and installing t
Before doing this, you should back up your package.vcxproj file, located in your sample directory, for example C:\\Toaster\\C++\\Package.
1. In the Properties for the package project, navigate to **Common Properties \> References**.
+
1. Remove all references except WdfSimple. (Use the **Remove Reference** button at the bottom.)
### Automatic deployment (root enumerated)
-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/).
+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 the **package** project (within the package folder), 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**, use the drop down to select the name of a target computer that you provisioned previously. Select **Hardware ID Driver Update**, and enter **{b85b7c50-6a01-11d2-b841-00c04fad5171}\\MsToaster** for the hardware ID. (You can find this value in the WdfSimple.inx file.) Click **Apply** and **OK**.
+
1. Because this solution contains many projects, you may find it easier to remove some of them before you build and deploy a driver package. To do so, right click **package** (lower case), and choose **Properties**. Navigate to **Common Properties-\>References** and click **Remove Reference** to remove projects you don't want. (You can add them back later by using **Add New Reference**.) Click **OK**.
+
1. On the **Build** menu, choose **Build Solution** or **Rebuild Solution** (if you removed references).
+
1. If you removed references and deployment does not succeed, try deleting the contents of the c:\\DriverTest\\Drivers folder on the target machine, and then retry deployment.
### Manual deployment (root enumerated)
-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).
+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).
1. Copy all of the files in your driver package to a folder on the target computer (for example, c:\\WdfSimplePackage).
+
1. On the target computer, open a Command Prompt window as Administrator. Navigate to your driver package folder, and enter the following command:
**devcon install WdfSimple.inf {b85b7c50-6a01-11d2-b841-00c04fad5171}\\MsToaster**
@@ -75,78 +70,95 @@ In Device Manager, on the **View** menu, choose **Devices by connection**. Locat
As an alternative to building the Toaster 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, Toaster.sln. Use the MSBuild command to build the solution. Here are some examples:
-**msbuild /p:configuration="Debug" /p:platform="x64" Toaster.sln**
+`msbuild /p:configuration="Debug" /p:platform="x64" Toaster.sln`
-**msbuild /p:configuration="Release" /p:platform="Win32" Toaster.sln**
+`msbuild /p:configuration="Release" /p:platform="Win32" Toaster.sln`
-For more information about using MSBuild 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 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).
## UMDF Toaster File Manifest
-#### WUDFToaster.idl
+### WUDFToaster.idl
+
Component Interface file
-#### WUDFToaster.cpp
+### WUDFToaster.cpp
+
DLL Support code - provides the DLL's entry point as well as the DllGetClassObject export.
-#### WUDFToaster.def
+### WUDFToaster.def
+
This file lists the functions that the driver DLL exports.
-#### stdafx.h
+### stdafx.h
+
This is the main header file for the sample driver.
-#### driver.cpp & driver.h
+### driver.cpp and driver.h (WUDFToaster)
+
Definition and implementation of the IDriverEntry callbacks in CDriver class.
-#### device.cpp & device.h
+### device.cpp and device.h (WUDFToaster)
+
Definition and implementation of various interfaces and their callbacks in CDevice class. Add your PnP and Power interfaces specific for your hardware.
-#### queue.cpp & queue.h
+### queue.cpp and queue.h
+
Definition and implementation of the base queue callback class (CQueue). IQueueCallbackDevicekIoControl, IQueueCallbackRead and IQueueCallBackWrite callbacks are implemented to handle I/O control requests.
-#### WUDFToaster.rc
+### WUDFToaster.rc
+
This file defines resource information for the WUDF Toaster sample driver.
-#### WUDFToaster.inf
+### WUDFToaster.inf
+
Sample INF for installing the sample WUDF Toaster driver under the Toaster class of devices.
-#### WUDFtoaster.ctl, internal.h
+### WUDFtoaster.ctl, internal.h
+
This file lists the WPP trace control GUID(s) for the sample driver. This file can be used with the tracelog command's -guid flag to enable the collection of these trace events within an established trace session.
These GUIDs must remain in sync with the trace control guids defined in internal.h.
## Toastmon File Manifest
-#### comsup.cpp & comsup.h
+### comsup.cpp and comsup.h
+
Boilerplate COM Support code - specifically base classes which provide implementations for the standard COM interfaces IUnknown and IClassFactory which are used throughout the sample.
The implementation of IClassFactory is designed to create instances of the CMyDriver class. If you should change the name of your base driver class, you would also need to modify this file.
-#### dllsup.cpp
+### dllsup.cpp
+
Boilerplate DLL Support code - provides the DLL's entry point as well as the single required export (DllGetClassObject).
These depend on comsup.cpp to perform the necessary class creation.
-#### exports.def
+### exports.def
+
This file lists the functions that the driver DLL exports.
-#### makefile
-This file redirects to the real makefile, which is shared by all the driver components of the Windows Driver Kit.
+### internal.h
-#### internal.h
This is the main header file for the ToastMon driver
-#### driver.cpp & driver.h
+### driver.cpp and driver.h (Toastmon)
+
Definition and implementation of the driver callback class for the ToastMon sample.
-#### device.cpp & device.h
+### device.cpp and device.h (Toastmon)
+
Definition and implementation of the device callback class for the ToastMon sample. This is mostly boilerplate, but also registers for RemoteInterface Arrival notifications. When a RemoteInterface arrival callback occurs, it calls CreateRemoteInterface and creates a CMyRemoteTarget callback object to handle I/O on that RemoteInterface.
-#### RemoteTarget.cpp & RemoteTarget.h
+### RemoteTarget.cpp and RemoteTarget.h
+
Definition and implementation of the remote target callback class for the ToastMon sample.
-#### list.h
+### list.h
+
Doubly-linked-list code
-#### ToastMon.rc
+### ToastMon.rc
+
This file defines resource information for the ToastMon sample driver.
-#### UMDFToastMon.inf
+### UMDFToastMon.inf
+
Sample INF for installing the Skeleton driver to control a root enumerated device with a hardware ID of UMDFSamples\\ToastMon
diff --git a/general/toaster/umdf2/README.md b/general/toaster/umdf2/README.md
index b4c88918..fbc282a3 100644
--- a/general/toaster/umdf2/README.md
+++ b/general/toaster/umdf2/README.md
@@ -8,17 +8,6 @@ products:
- windows-wdk
---
-
-
-<!---
- name: Toaster Sample (UMDF version 2)
- platform: UMDF2
- language: cpp
- category: General WDF
- description: An iterative series of samples that demonstrate driver development using UMDF version 2.
- samplefwlink: http://go.microsoft.com/fwlink/p/?LinkId=620310
---->
-
# Toaster Sample (UMDF Version 2)
The Toaster (UMDF version 2) sample is an iterative series of samples that demonstrate fundamental aspects of Windows driver development.
@@ -27,7 +16,7 @@ The Toaster sample collection is comprised of driver projects (.vcxproj files) t
## Related technologies
-[User-Mode Driver Framework](http://msdn.microsoft.com/en-us/library/windows/hardware/ff560456)
+[Windows Driver Frameworks](https://docs.microsoft.com/windows-hardware/drivers/wdf/)
## Run the sample
@@ -40,19 +29,24 @@ The process of moving the driver package to the target computer and installing t
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/).
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 **Hardware ID Driver Update**, and enter **root\\toaster** for the hardware ID. Click **OK**.
+
1. Because this solution contains many projects, you may find it easier to remove some of them before you build and deploy a driver package. To do so, right click **package** (lower case), and choose **Properties**. Navigate to **Common Properties-\>References** and click **Remove Reference** to remove projects you don't want. (You can add them back later by using **Add New Reference**.) Click **OK**.
+
1. On the **Build** menu, choose **Build Solution** or **Rebuild Solution** (if you removed references).
+
1. If you removed references and deployment does not succeed, try deleting the contents of the c:\\DriverTest\\Drivers folder on the target machine, and then retry deployment.
### Manual deployment (root enumerated)
-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).
+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).
1. Copy all of the files in your driver package to a folder on the target computer (for example, c:\\Umdf2toaster).
+
1. On the target computer, open a Command Prompt window as Administrator. Navigate to your driver package folder, and enter a command such as:
- **devcon install wdfsimpleum.inf root\\toaster**
+ `devcon install wdfsimpleum.inf root\\toaster`
### View the root enumerated driver in Device Manager
@@ -64,6 +58,6 @@ In Device Manager, on the **View** menu, choose **Devices by connection**. Locat
As an alternative to building the driver 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, Umdf2toaster.sln. Use the MSBuild command to build the solution. Here is an example:
-**msbuild /p:configuration="Release" /p:platform="Win32" Umdf2toaster.sln**
+`msbuild /p:configuration="Release" /p:platform="Win32" Umdf2toaster.sln`
-For more information about using MSBuild 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 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).