WDF VIOLATION Blue Screen after Upgrading Mac to Windows 10 May 2019 Update (1903) Edition UPDATE: I have tested the Windows 10 November 2019 Update (1909) Edition and so far this problem has not occurred. Also, after installing the Window Support Software, the Apple Software Update application provided a download of a "Boot Camp Update Version 6.1.9".


I did an upgrade on my iMac (21.5-inch, Mid 2011) from a previous version of Windows 10 to the current version. The Windows 10 May 2019 Update (1903) Edition ISO file was downloaded from the official Microsoft website. Afterwards, the Mac would get the following "Blue Screen of Death" error message.



The Windows Support Software was downloaded by using the BootCamp Assistant. I confirmed the files are the same as the files that can be downloaded from the Apple website Boot Camp Support Software 5.1.5621. I installed Windows 10 to legacy BIOS boot.


  Note: The Windows Support Software download by using the Boot Camp Assistant can vary depending on the Mac model.


Below is some information about my configuration.

iMac (21.5-inch, Mid 2011)
iMac12,1
High Sierra Version 10.13.6
BootCamp Version 5.1 (Build 5621)
Windows 10 May 2019 Update (1903) English Edition.
Win10_1903_V1_English_x64.iso  

I also tried a clean install of Windows 10 and this made no difference. The error still occurred. How can I avoid getting this error message?

After some investigation, I found the error occurs after installing the Windows Support Software. After some trial and error experiments, I determined the offending file in Windows Support Software is named BootCamp/Drivers/Apple/BootCamp.msi.
Note: I have tested the Windows 10 November 2019 Update (1909) Edition and so far this problem has not occurred. Also, after installing the Window Support Software, the Apple Software Update application provided a download of a "Boot Camp Update Version 6.1.9".


I found a solution which involves using a newer version of the BootCamp.msi file. I did this by downloading the Windows Support Software on a iMac (21.5-inch, Late 2013). Since not everyone reading this will have a newer model Mac, I have provided a alternate method for retrieving this file. This method was derived from Chris F Carroll's answer to the question: How to download Bootcamp drivers without Bootcamp assistant? The nice thing about this answer is the Window Support Software is downloaded directly from Apple without the use of any third part tools.

The Windows Support Software for the iMac (21.5-inch, Late 2013) can be downloaded by following the steps given below.


Click on this link to download the BootCampESD.pkg file directly from Apple.


  Note: If this link is broken, then post a comment and I will try to update the link.

Double click on the  BootCampESD.pkg file in the Finder application to start the "BootCampESD Installer".
Follow the instructions. This will save the WindowsSupport.dmg file to the /Library/Application Support/BootCamp folder.
Double click on the WindowsSupport.dmg file in the Finder application to mount the disk image. The volume label will be Boot Camp. 
Use to Finder application to locate the BootCamp.msi file in the BootCamp/Drivers/Apple folder of the device labeled Boot Camp. This is the Windows installer for Boot Camp Version 6.0 (Build 6136).


Below are two methods for solving the problem. I tried both and decided I preferred Method 2. Here a assume you have already used the Boot Camp Assistant on the iMac (21.5-inch, Mid 2011) to download the Windows Support Software to a flash drive. 

Method 1: Replace the existing BootCamp.msi file.

Replace BootCamp.msi file in the BootCamp/Drivers/Apple folder on the flash drive with the new file. After the Windows installation completes, install the Boot Support Software by executing the setup application in the BootCamp folder on the flash drive. In some cases, this application may start automatically.

I do not think this method resulted in all the drivers being installed. However the missing drivers where downloaded and installed after running "Windows Update" and "Apple Software Update".

Method 2: Upgrade Boot Camp immediately after installing the Windows Support Software.

Copy the new BootCamp.msi file to the root folder on the flash drive. After the Windows installation completes, install the Boot Support Software by executing the setup application in the BootCamp folder on the flash drive. In some cases, this application may start automatically. You should first first encounter the window shown below. Follow the instructions to install the software.



After the Windows Support Software finishing installing, you will get the window shown below. Click on the "Finish" button.



If you get the popup window shown below, click on the "No" button.



Next, open a "Administrator: Command Prompt" window and enter the command given below.  Here, the assumption is made that the flash drive has been assign the drive letter D. If your flash drive has been assigned a different drive letter, then make the appropriate substitution.

D:\BootCamp.msi


You should encounter the window shown below. Follow the instructions to install the software.



When the popup window below appears, click on the "OK" button.



After the Windows Boot Camp Installer finishes, you will get the window shown below. Click on the "Finish" button.



If you get the popup window shown below, click on the "Yes" button. Otherwise, manual restart the Mac.


  Note: If you are in audit mode, do not use the "System Preparation Tool" to restart.




Final Notes


When first executing "Apple Software Update" you may be asked to update "Apple Software Update" itself. If you happens, you should uncheck all other updates and just update "Apple Software Update". Otherwise, you may get an error message saying another update can not be installed. I my case, there were two updates of the "Apple Software Update" to download and install.
You may wonder why not use a more current Boot Camp Installer. I did
try the BootCamp.msi that comes with the Windows Support Software
for the iMac (21.5-inch, 2019). This is the Windows Boot Camp
installer for Version 6.1 (Build 7438). I found this version to be
missing the ability to adjust the screen brightness. If you want to
try this version, then click on this link to download the
BootCampESD.pkg file directly from Apple.


  Note: You can upgrade from Version 5.1 to either 6.0 or 6.1. However, you can not upgrade from 6.0 to 6.1.