Showing preview only (550K chars total). Download the full file or copy to clipboard to get everything.
Repository: jloehr/HID-Wiimote
Branch: master
Commit: 9161c0922b25
Files: 122
Total size: 515.3 KB
Directory structure:
gitextract_3ar40yv7/
├── .gitignore
├── BuildAndZip/
│ ├── BuildAndZip.vcxproj
│ └── BuildAndZip.vcxproj.filters
├── BuildTools/
│ └── 7za/
│ ├── 7-zip.chm
│ ├── license.txt
│ └── readme.txt
├── HID Miniport/
│ ├── HID Miniport.rc
│ ├── HID Miniport.vcxproj
│ ├── HID Miniport.vcxproj.backup
│ ├── HID Miniport.vcxproj.filters
│ ├── Hidminiport.c
│ ├── Hidminiport.h
│ ├── Trace.c
│ ├── Trace.h
│ └── resource.h
├── HID Wiimote/
│ ├── Bluetooth.c
│ ├── Bluetooth.h
│ ├── Device.c
│ ├── Device.h
│ ├── DeviceInterface.c
│ ├── DeviceInterface.h
│ ├── DeviceInterfacePublic.h
│ ├── Driver.c
│ ├── Driver.h
│ ├── HID Wiimote.rc
│ ├── HID Wiimote.vcxproj
│ ├── HID Wiimote.vcxproj.backup
│ ├── HID Wiimote.vcxproj.filters
│ ├── HID.c
│ ├── HID.h
│ ├── HIDDescriptors.c
│ ├── HIDDescriptors.h
│ ├── HIDWiimote.h
│ ├── HIDWiimote.inf
│ ├── ReadIoControlBuffer.c
│ ├── ReadIoControlBuffer.h
│ ├── Trace.c
│ ├── Trace.h
│ ├── Wiimote.c
│ ├── Wiimote.h
│ ├── WiimoteSettings.c
│ ├── WiimoteSettings.h
│ ├── WiimoteState.c
│ ├── WiimoteState.h
│ ├── WiimoteToHIDParser.c
│ ├── WiimoteToHIDParser.h
│ └── resource.h
├── HID Wiimote Control Center/
│ ├── App.config
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── Control Center/
│ │ ├── DummyDeviceInterface.cs
│ │ └── WiimoteDevice.cs
│ ├── HID Wiimote Control Center.csproj
│ ├── Main Windows/
│ │ ├── ControlCenterWindow.xaml
│ │ ├── ControlCenterWindow.xaml.cs
│ │ ├── InstallerWindow.xaml
│ │ ├── InstallerWindow.xaml.cs
│ │ ├── UpdaterWindow.xaml
│ │ └── UpdaterWindow.xaml.cs
│ ├── Properties/
│ │ ├── App.Designer.cs
│ │ ├── App.resx
│ │ ├── AssemblyInfo.cs
│ │ ├── ControlCenter.Designer.cs
│ │ ├── ControlCenter.resx
│ │ ├── Installer.Designer.cs
│ │ ├── Installer.resx
│ │ ├── Settings.Designer.cs
│ │ ├── Settings.settings
│ │ └── app.manifest
│ ├── Resources/
│ │ ├── JulianLoehrCA.cer
│ │ └── UninstallerContent.txt
│ ├── Secondary Windows/
│ │ ├── About.xaml
│ │ └── About.xaml.cs
│ ├── Setup/
│ │ ├── DeviceDriver.cs
│ │ ├── DeviceDriverUninstallerRegistry.cs
│ │ ├── InstallStepAction/
│ │ │ ├── CopyFile.cs
│ │ │ ├── CreateRegistryUninstallKey.cs
│ │ │ ├── IInstallAction.cs
│ │ │ ├── RunDPInstall.cs
│ │ │ └── TextResourceToFile.cs
│ │ └── SetupAction/
│ │ ├── Certificate.cs
│ │ ├── DeviceDriver.cs
│ │ ├── ISetupAction.cs
│ │ └── TestMode.cs
│ ├── UserControls/
│ │ ├── LEDDisplay.xaml
│ │ ├── LEDDisplay.xaml.cs
│ │ ├── TaskList.xaml
│ │ └── TaskList.xaml.cs
│ └── Utility/
│ └── SingleInstanceProtector.cs
├── HID Wiimote Package/
│ ├── DPInst.xml
│ ├── EULA.txt
│ ├── HID Wiimote Package.vcxproj
│ ├── HID Wiimote Package.vcxproj.backup
│ ├── HID Wiimote Package.vcxproj.filters
│ └── Readme.txt
├── HID Wiimote User Mode/
│ ├── AssemblyInfo.cpp
│ ├── HID Wiimote User Mode.rc
│ ├── HID Wiimote User Mode.vcxproj
│ ├── HID Wiimote User Mode.vcxproj.filters
│ ├── IWiimoteDeviceInterface.h
│ ├── Log.cpp
│ ├── Log.h
│ ├── State.cpp
│ ├── State.h
│ ├── Status.cpp
│ ├── Status.h
│ ├── Stdafx.cpp
│ ├── Stdafx.h
│ ├── WiimoteDeviceInterface.cpp
│ ├── WiimoteDeviceInterface.h
│ ├── WiimoteDeviceInterfaceDiscoverer.cpp
│ ├── WiimoteDeviceInterfaceDiscoverer.h
│ ├── WiimoteDeviceInterfaceEnumerator.cpp
│ ├── WiimoteDeviceInterfaceEnumerator.h
│ └── resource.h
├── HID Wiimote.sln
├── LICENSE.md
├── README.md
└── ReleaseVersioning/
├── ReleaseVersioning.vcxproj
├── ReleaseVersioning.vcxproj.filters
├── Version.js
└── Version.wsf
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific folders
Certificates/
Zip/
# Autogenerated files
ReleaseVersioning/Version.props
ReleaseVersioning/VersionStrings.h
ReleaseVersioning/VersionStrings.cs
HID Wiimote Control Center/Properties/VersionStrings.cs
# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
# Visual Studio 2015 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUNIT
*.VisualState.xml
TestResult.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json
*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
*.snk
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# JustCode is a .NET coding add-in
.JustCode
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Typescript v1 declaration files
typings/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# JetBrains Rider
.idea/
*.sln.iml
# CodeRush
.cr/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
================================================
FILE: BuildAndZip/BuildAndZip.vcxproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Windows 10 Universal Release|Win32">
<Configuration>Windows 10 Universal Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Windows 10 Universal Release|x64">
<Configuration>Windows 10 Universal Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Windows 10 Release|Win32">
<Configuration>Windows 10 Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Windows 10 Release|x64">
<Configuration>Windows 10 Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{0C56BAEE-4F6C-4590-9E48-EFBF80099FEB}</ProjectGuid>
<RootNamespace>BuildAndZip</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Windows 10 Release|Win32'">
<PlatformToolset>v143</PlatformToolset>
<ConfigurationType>Utility</ConfigurationType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Release|Win32'" Label="Configuration">
<PlatformToolset>v143</PlatformToolset>
<ConfigurationType>Utility</ConfigurationType>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Windows 10 Release|x64'">
<PlatformToolset>v143</PlatformToolset>
<ConfigurationType>Utility</ConfigurationType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Release|x64'" Label="Configuration">
<PlatformToolset>v143</PlatformToolset>
<ConfigurationType>Utility</ConfigurationType>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="..\ReleaseVersioning\Version.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros">
<ZipTool>$(SolutionDir)BuildTools\7za\7za.exe</ZipTool>
<ZipDir>$(SolutionDir)Zip</ZipDir>
<ZipName>$(SolutionName.replace(' ','-'))-$(ControlCenterVersion)_$(PlatformArchitecture)Bit.zip</ZipName>
<ZipPath>$(ZipDir)\$(ZipName)</ZipPath>
<PackageDir>$(SolutionDir)$(PlatformShortName)\$(Configuration.replace(" ",""))\HID Wiimote Package</PackageDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Release|x64'">
<OutDir>$(PlatformShortName)\$(Configuration)\</OutDir>
<IntDir>$(PlatformShortName)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Release|x64'">
<OutDir>$(PlatformShortName)\$(Configuration)\</OutDir>
<IntDir>$(PlatformShortName)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Release|Win32'">
<OutDir>$(PlatformShortName)\$(Configuration)\</OutDir>
<IntDir>$(PlatformShortName)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Release|Win32'">
<OutDir>$(PlatformShortName)\$(Configuration)\</OutDir>
<IntDir>$(PlatformShortName)\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Release|x64'">
<PostBuildEvent>
<Command>if not exist "$(ZipDir)" mkdir "$(ZipDir)"
"$(ZipTool)" d "$(ZipPath)"
"$(ZipTool)" a "$(ZipPath)" "$(PackageDir)\*"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Release|x64'">
<PostBuildEvent>
<Command>if not exist "$(ZipDir)" mkdir "$(ZipDir)"
"$(ZipTool)" d "$(ZipPath)"
"$(ZipTool)" a "$(ZipPath)" "$(PackageDir)\*"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Release|Win32'">
<PostBuildEvent>
<Command>if not exist "$(ZipDir)" mkdir "$(ZipDir)"
"$(ZipTool)" d "$(ZipPath)"
"$(ZipTool)" a "$(ZipPath)" "$(PackageDir)\*"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Release|Win32'">
<PostBuildEvent>
<Command>if not exist "$(ZipDir)" mkdir "$(ZipDir)"
"$(ZipTool)" d "$(ZipPath)"
"$(ZipTool)" a "$(ZipPath)" "$(PackageDir)\*"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
================================================
FILE: BuildAndZip/BuildAndZip.vcxproj.filters
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
================================================
FILE: BuildTools/7za/license.txt
================================================
7-Zip Command line version
~~~~~~~~~~~~~~~~~~~~~~~~~~
License for use and distribution
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7-Zip Copyright (C) 1999-2010 Igor Pavlov.
7za.exe is distributed under the GNU LGPL license
Notes:
You can use 7-Zip on any computer, including a computer in a commercial
organization. You don't need to register or pay for 7-Zip.
GNU LGPL information
--------------------
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You can receive a copy of the GNU Lesser General Public License from
http://www.gnu.org/
================================================
FILE: BuildTools/7za/readme.txt
================================================
7-Zip Command line version 9.20
-------------------------------
7-Zip is a file archiver with high compression ratio.
7za.exe is a standalone command line version of 7-Zip.
7-Zip Copyright (C) 1999-2010 Igor Pavlov.
Features of 7za.exe:
- High compression ratio in new 7z format
- Supported formats:
- Packing / unpacking: 7z, xz, ZIP, GZIP, BZIP2 and TAR
- Unpacking only: Z, lzma
- Highest compression ratio for ZIP and GZIP formats.
- Fast compression and decompression
- Strong AES-256 encryption in 7z and ZIP formats.
7za.exe is a free software distributed under the GNU LGPL.
Read license.txt for more information.
Source code of 7za.exe and 7-Zip can be found at
http://www.7-zip.org/
7za.exe can work in Windows 95/98/ME/NT/2000/2003/2008/XP/Vista/7.
There is also port of 7za.exe for POSIX systems like Unix (Linux, Solaris, OpenBSD,
FreeBSD, Cygwin, AIX, ...), MacOS X and BeOS:
http://p7zip.sourceforge.net/
This distributive packet contains the following files:
7za.exe - 7-Zip standalone command line version.
readme.txt - This file.
license.txt - License information.
7-zip.chm - User's Manual in HTML Help format.
---
End of document
================================================
FILE: HID Miniport/HID Miniport.vcxproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Windows 10 Universal Debug|Win32">
<Configuration>Windows 10 Universal Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Windows 10 Universal Debug|x64">
<Configuration>Windows 10 Universal Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Windows 10 Universal Release|Win32">
<Configuration>Windows 10 Universal Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Windows 10 Universal Release|x64">
<Configuration>Windows 10 Universal Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Windows 10 Debug|Win32">
<Configuration>Windows 10 Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Windows 10 Release|Win32">
<Configuration>Windows 10 Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Windows 10 Debug|x64">
<Configuration>Windows 10 Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Windows 10 Release|x64">
<Configuration>Windows 10 Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{3BAFF0EB-1B25-4E8E-8189-267B6686D7BC}</ProjectGuid>
<TemplateGuid>{dd38f7fc-d7bd-488b-9242-7d8754cde80d}</TemplateGuid>
<Configuration>Win8 Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Label="Globals">
<RootNamespace>HID_Miniport</RootNamespace>
</PropertyGroup>
<PropertyGroup Label="PropertySheets">
<ConfigurationType>Driver</ConfigurationType>
<DriverType>WDM</DriverType>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Windows 10 Debug|Win32'">
<TargetVersion>Windows10</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<SupportsPackaging>false</SupportsPackaging>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Debug|Win32'" Label="Configuration">
<TargetVersion>
</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<SupportsPackaging>false</SupportsPackaging>
<DriverTargetPlatform>Universal</DriverTargetPlatform>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Windows 10 Release|Win32'">
<TargetVersion>Windows10</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<SupportsPackaging>false</SupportsPackaging>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Release|Win32'" Label="Configuration">
<TargetVersion>
</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<SupportsPackaging>false</SupportsPackaging>
<DriverTargetPlatform>Universal</DriverTargetPlatform>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Windows 10 Debug|x64'">
<TargetVersion>Windows10</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<SupportsPackaging>false</SupportsPackaging>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Debug|x64'" Label="Configuration">
<TargetVersion>
</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<SupportsPackaging>false</SupportsPackaging>
<DriverTargetPlatform>Universal</DriverTargetPlatform>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Windows 10 Release|x64'">
<TargetVersion>Windows10</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<SupportsPackaging>false</SupportsPackaging>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Release|x64'" Label="Configuration">
<TargetVersion>
</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<SupportsPackaging>false</SupportsPackaging>
<DriverTargetPlatform>Universal</DriverTargetPlatform>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Debug|Win32'">
<OutDir>$(SolutionDir)$(PlatformShortName)\$(ConfigurationName)\</OutDir>
<IntDir>$(PlatformShortName)\$(ConfigurationName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Debug|Win32'">
<OutDir>$(SolutionDir)$(PlatformShortName)\$(ConfigurationName)\</OutDir>
<IntDir>$(PlatformShortName)\$(ConfigurationName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Release|Win32'">
<OutDir>$(SolutionDir)$(PlatformShortName)\$(ConfigurationName)\</OutDir>
<IntDir>$(PlatformShortName)\$(ConfigurationName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Release|Win32'">
<OutDir>$(SolutionDir)$(PlatformShortName)\$(ConfigurationName)\</OutDir>
<IntDir>$(PlatformShortName)\$(ConfigurationName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Debug|x64'">
<Link>
<AdditionalDependencies>$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<DriverSign>
<FileDigestAlgorithm>SHA256</FileDigestAlgorithm>
</DriverSign>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Debug|x64'">
<Link>
<AdditionalDependencies>$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Release|x64'">
<Link>
<AdditionalDependencies>$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<DriverSign>
<FileDigestAlgorithm>SHA256</FileDigestAlgorithm>
</DriverSign>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Release|x64'">
<Link>
<AdditionalDependencies>$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Debug|Win32'">
<Link>
<AdditionalDependencies>$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<DriverSign>
<FileDigestAlgorithm>SHA256</FileDigestAlgorithm>
</DriverSign>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Debug|Win32'">
<Link>
<AdditionalDependencies>$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Release|Win32'">
<Link>
<AdditionalDependencies>$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<DriverSign>
<FileDigestAlgorithm>SHA256</FileDigestAlgorithm>
</DriverSign>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Release|Win32'">
<Link>
<AdditionalDependencies>$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<FilesToPackage Include="$(TargetPath)" />
<FilesToPackage Include="@(Inf->'%(CopyOutput)')" Condition="'@(Inf)'!=''" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Hidminiport.c" />
<ClCompile Include="Trace.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Hidminiport.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="Trace.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="HID Miniport.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
================================================
FILE: HID Miniport/HID Miniport.vcxproj.backup
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Win8 Debug|Win32">
<Configuration>Win8 Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win8 Release|Win32">
<Configuration>Win8 Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win7 Debug|Win32">
<Configuration>Win7 Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win7 Release|Win32">
<Configuration>Win7 Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Vista Debug|Win32">
<Configuration>Vista Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Vista Release|Win32">
<Configuration>Vista Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win8 Debug|x64">
<Configuration>Win8 Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win8 Release|x64">
<Configuration>Win8 Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win7 Debug|x64">
<Configuration>Win7 Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win7 Release|x64">
<Configuration>Win7 Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Vista Debug|x64">
<Configuration>Vista Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Vista Release|x64">
<Configuration>Vista Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{3BAFF0EB-1B25-4E8E-8189-267B6686D7BC}</ProjectGuid>
<TemplateGuid>{dd38f7fc-d7bd-488b-9242-7d8754cde80d}</TemplateGuid>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
<Configuration>Win8 Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Label="Globals">
<RootNamespace>HID_Miniport</RootNamespace>
<VCTargetsPath Condition="'$(VCTargetsPath11)' != '' and '$(VisualStudioVersion)' == '11.0'">$(VCTargetsPath11)</VCTargetsPath>
</PropertyGroup>
<PropertyGroup Label="PropertySheets">
<PlatformToolset>WindowsKernelModeDriver8.0</PlatformToolset>
<ConfigurationType>Driver</ConfigurationType>
<DriverType>WDM</DriverType>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|Win32'" Label="Configuration">
<TargetVersion>Windows8</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Release|Win32'" Label="Configuration">
<TargetVersion>Windows8</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Debug|Win32'" Label="Configuration">
<TargetVersion>Windows7</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Release|Win32'" Label="Configuration">
<TargetVersion>Windows7</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Vista Debug|Win32'" Label="Configuration">
<TargetVersion>Vista</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Vista Release|Win32'" Label="Configuration">
<TargetVersion>Vista</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|x64'" Label="Configuration">
<TargetVersion>Windows8</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Release|x64'" Label="Configuration">
<TargetVersion>Windows8</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Debug|x64'" Label="Configuration">
<TargetVersion>Windows7</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Release|x64'" Label="Configuration">
<TargetVersion>Windows7</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Vista Debug|x64'" Label="Configuration">
<TargetVersion>Vista</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Vista Release|x64'" Label="Configuration">
<TargetVersion>Vista</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Vista Debug|Win32'">
<OutDir>$(SolutionDir)$(PlatformShortName)\$(ConfigurationName)\</OutDir>
<IntDir>$(PlatformShortName)\$(ConfigurationName)\</IntDir>
</PropertyGroup>
<PropertyGroup>
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|Win32'">
<OutDir>$(SolutionDir)$(PlatformShortName)\$(ConfigurationName)\</OutDir>
<IntDir>$(PlatformShortName)\$(ConfigurationName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Vista Release|Win32'">
<OutDir>$(SolutionDir)$(PlatformShortName)\$(ConfigurationName)\</OutDir>
<IntDir>$(PlatformShortName)\$(ConfigurationName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Debug|Win32'">
<OutDir>$(SolutionDir)$(PlatformShortName)\$(ConfigurationName)\</OutDir>
<IntDir>$(PlatformShortName)\$(ConfigurationName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Release|Win32'">
<OutDir>$(SolutionDir)$(PlatformShortName)\$(ConfigurationName)\</OutDir>
<IntDir>$(PlatformShortName)\$(ConfigurationName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Release|Win32'">
<OutDir>$(SolutionDir)$(PlatformShortName)\$(ConfigurationName)\</OutDir>
<IntDir>$(PlatformShortName)\$(ConfigurationName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|x64'">
<Link>
<AdditionalDependencies>$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Vista Debug|x64'">
<Link>
<AdditionalDependencies>$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Vista Release|x64'">
<Link>
<AdditionalDependencies>$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Debug|x64'">
<Link>
<AdditionalDependencies>$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Release|x64'">
<Link>
<AdditionalDependencies>$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Release|x64'">
<Link>
<AdditionalDependencies>$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Vista Debug|Win32'">
<Link>
<AdditionalDependencies>$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|Win32'">
<Link>
<AdditionalDependencies>$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Vista Release|Win32'">
<Link>
<AdditionalDependencies>$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Debug|Win32'">
<Link>
<AdditionalDependencies>$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Release|Win32'">
<Link>
<AdditionalDependencies>$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Release|Win32'">
<Link>
<AdditionalDependencies>$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<FilesToPackage Include="$(TargetPath)" />
<FilesToPackage Include="@(Inf->'%(CopyOutput)')" Condition="'@(Inf)'!=''" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Hidminiport.c" />
<ClCompile Include="Trace.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Hidminiport.h" />
<ClInclude Include="Trace.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
================================================
FILE: HID Miniport/HID Miniport.vcxproj.filters
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Driver Files">
<UniqueIdentifier>{8E41214B-6785-4CFE-B992-037D68949A14}</UniqueIdentifier>
<Extensions>inf;inv;inx;mof;mc;</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Hidminiport.c">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Trace.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Hidminiport.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Trace.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="resource.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="HID Miniport.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>
================================================
FILE: HID Miniport/Hidminiport.c
================================================
/*
Copyright (C) 2014 Julian Lhr
All rights reserved.
Filename:
hidminiport.c
Abstract:
Actual miniport driver for HIDClass. Passes through all IRPs. Additonally sends down a custiom IOCTL, with the actual FDO and HidNotifyPrcense address.
*/
#include "hidminiport.h"
NTSTATUS
DriverEntry (
_In_ PDRIVER_OBJECT DriverObject,
_In_ PUNICODE_STRING RegistryPath
)
{
NTSTATUS Status;
HID_MINIDRIVER_REGISTRATION HIDMinidriverRegistration;
ULONG i;
//Trace("Driver Entry");
//Set Function Pointers for IRPs
for (i = 0; i <= IRP_MJ_MAXIMUM_FUNCTION; i++) {
DriverObject->MajorFunction[i] = PassThrough;
}
//Special for PnP
DriverObject->MajorFunction[IRP_MJ_PNP] = PnPPassThrough;
DriverObject->DriverExtension->AddDevice = AddDevice;
DriverObject->DriverUnload = Unload;
//Register as HID Minidriver
RtlZeroMemory(&HIDMinidriverRegistration, sizeof(HIDMinidriverRegistration));
HIDMinidriverRegistration.Revision = HID_REVISION;
HIDMinidriverRegistration.DriverObject = DriverObject;
HIDMinidriverRegistration.RegistryPath = RegistryPath;
HIDMinidriverRegistration.DeviceExtensionSize = 0;
HIDMinidriverRegistration.DevicesArePolled = FALSE;
Status = HidRegisterMinidriver(&HIDMinidriverRegistration);
if (!NT_SUCCESS(Status) ){
return Status;
}
return Status;
}
NTSTATUS
AddDevice(
_In_ PDRIVER_OBJECT DriverObject,
_In_ PDEVICE_OBJECT FunctionalDeviceObject
)
{
UNREFERENCED_PARAMETER(DriverObject);
//Trace("Add Device");
FunctionalDeviceObject->Flags &= ~DO_DEVICE_INITIALIZING;
return STATUS_SUCCESS;
}
NTSTATUS
PassThrough(
_In_ PDEVICE_OBJECT DeviceObject,
_Inout_ PIRP Irp
)
{
//Trace("Pass Through");
IoCopyCurrentIrpStackLocationToNext(Irp);
return IoCallDriver(GET_NEXT_DEVICE_OBJECT(DeviceObject), Irp);
}
/*
NTSTATUS SendAddressesCompeted(
_In_ PDEVICE_OBJECT DeviceObject,
_In_ PIRP Irp,
_In_opt_ PVOID Context
)
{
UNREFERENCED_PARAMETER(DeviceObject);
Trace("Send Addresses Completed");
if(Context != NULL)
{
ExFreePoolWithTag(Context, IOCTL_POOL_TAG);
}
IoFreeIrp(Irp);
return STATUS_SUCCESS;
}
*/
NTSTATUS
SendAddresses(
_In_ PDEVICE_OBJECT DeviceObject
)
{
NTSTATUS Status = STATUS_SUCCESS;
PIRP NewIrp;
IO_STATUS_BLOCK StatusBlock;
HID_MINIPORT_ADDRESSES AddressesBuffer;
UNREFERENCED_PARAMETER(DeviceObject);
Trace("Sending Addresses!");
/*AddressesBuffer = (PHID_MINIPORT_ADDRESSES)ExAllocatePoolWithTag(NonPagedPool, sizeof(HID_MINIPORT_ADDRESSES), IOCTL_POOL_TAG);
if(AddressesBuffer == NULL)
{
Trace("Couldn't allocate Addresses Buffer");
return STATUS_SUCCESS;
}
RtlSecureZeroMemory(AddressesBuffer, sizeof(HID_MINIPORT_ADDRESSES));
*/
AddressesBuffer.FDO = DeviceObject;
AddressesBuffer.HidNotifyPresence = HidNotifyPresence;
NewIrp = IoBuildDeviceIoControlRequest(IOCTL_WIIMOTE_ADDRESSES, GET_NEXT_DEVICE_OBJECT(DeviceObject), &AddressesBuffer, sizeof(HID_MINIPORT_ADDRESSES), NULL, 0, TRUE, NULL, &StatusBlock);
if(NewIrp == NULL)
{
Trace("Couldn't Build IRP");
return Status;
}
//IoSetCompletionRoutine(NewIrp, SendAddressesCompeted, AddressesBuffer, TRUE, TRUE, TRUE);
Status = IoCallDriver(GET_NEXT_DEVICE_OBJECT(DeviceObject), NewIrp);
if(!NT_SUCCESS(Status))
{
if(Status == STATUS_PENDING)
{
Trace("SendAddress IoCallDriver is Pending!");
}
else
{
Trace("SendAddress IoCallDriver: 0x%x", Status);
}
return Status;
}
Trace("Sending Addresses returned!");
return Status;
}
NTSTATUS
PnPPassThrough(
_In_ PDEVICE_OBJECT DeviceObject,
_Inout_ PIRP Irp
)
{
NTSTATUS Status = STATUS_SUCCESS;
PIO_STACK_LOCATION StackLocation = IoGetCurrentIrpStackLocation(Irp);
UCHAR MinorFunction = StackLocation->MinorFunction;
//Trace("MinorFunction: %x", MinorFunction);
IoCopyCurrentIrpStackLocationToNext(Irp);
Status = IoCallDriver(GET_NEXT_DEVICE_OBJECT(DeviceObject), Irp);
if(!NT_SUCCESS(Status))
{
return Status;
}
if(MinorFunction == IRP_MN_START_DEVICE)
{
Trace("Device Start");
Status = SendAddresses(DeviceObject);
if(!NT_SUCCESS(Status))
{
return Status;
}
}
return Status;
}
VOID
Unload(
_In_ PDRIVER_OBJECT DriverObject
)
{
UNREFERENCED_PARAMETER(DriverObject);
return;
}
================================================
FILE: HID Miniport/Hidminiport.h
================================================
/*
Copyright (C) 2014 Julian Lhr
All rights reserved.
Filename:
hidminiport.c
Abstract:
Header file for hidminiport.c
*/
#ifndef _HIDMINIPORT_H_
#define _HIDMINIPORT_H_
#include <wdm.h>
#include <hidport.h>
#include "Trace.h"
DRIVER_INITIALIZE DriverEntry;
DRIVER_ADD_DEVICE AddDevice;
_Dispatch_type_(IRP_MJ_OTHER)
DRIVER_DISPATCH PassThrough;
//IO_COMPLETION_ROUTINE SendAddressesCompeted;
_Dispatch_type_(IRP_MJ_POWER)
DRIVER_DISPATCH PowerPassThrough;
_Dispatch_type_(IRP_MJ_PNP)
DRIVER_DISPATCH PnPPassThrough;
DRIVER_UNLOAD Unload;
#define GET_NEXT_DEVICE_OBJECT(DO) (((PHID_DEVICE_EXTENSION)(DO)->DeviceExtension)->NextDeviceObject)
#define IOCTL_WIIMOTE_ADDRESSES CTL_CODE(FILE_DEVICE_KEYBOARD, 0x800, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_POOL_TAG '_WOI'
typedef NTSTATUS (*PNOTIFY_PRESENCE)(PDEVICE_OBJECT, BOOLEAN);
typedef struct _HID_MINIPORT_ADDRESSES
{
PDEVICE_OBJECT FDO;
PNOTIFY_PRESENCE HidNotifyPresence;
} HID_MINIPORT_ADDRESSES, * PHID_MINIPORT_ADDRESSES;
#endif
================================================
FILE: HID Miniport/Trace.c
================================================
/*
Copyright (C) 2013 Julian Lhr
All rights reserved.
Filename:
Trace.c
Abstract:
Contains the code for Tracing.
*/
#include "Trace.h"
VOID
Trace(
_In_ PCCHAR DebugMessage,
...
)
{
#ifndef DBG
UNREFERENCED_PARAMETER(DebugMessage);
#else
NTSTATUS Status;
va_list ParameterList;
CHAR DebugMessageBuffer[512];
va_start(ParameterList, DebugMessage);
if(DebugMessage != NULL)
{
Status = RtlStringCbVPrintfA(DebugMessageBuffer, sizeof(DebugMessageBuffer), DebugMessage, ParameterList);
if(NT_SUCCESS(Status))
{
DbgPrint("Trace Miniport: %s\n", DebugMessageBuffer);
}
}
va_end(ParameterList);
#endif
}
================================================
FILE: HID Miniport/Trace.h
================================================
/*
Copyright (C) 2013 Julian Lhr
All rights reserved.
Filename:
Trace.h
Abstract:
Header file for Trace.c
Contains declarations and configuration for Tracing.
*/
#ifndef _TRACE_H_
#define _TRACE_H_
#include <ntddk.h>
#define NTSTRSAFE_LIB
#include <ntstrsafe.h>
VOID
Trace(
_In_ PCCHAR DebugMessage,
...
);
#endif
================================================
FILE: HID Miniport/resource.h
================================================
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by HID Miniport.rc
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 101
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
================================================
FILE: HID Wiimote/Bluetooth.c
================================================
/*
Copyright (C) 2017 Julian Lhr
All rights reserved.
Filename:
Bluetooth.c
Abstract:
Contains all Bluetooth relevant functions.
Like establishing the connection, reading and writing,
closing the connection to the device and Bluetooth error handling.
*/
#include "Bluetooth.h"
#include "Device.h"
EVT_WDF_REQUEST_COMPLETION_ROUTINE ControlChannelCompletion;
EVT_WDF_REQUEST_COMPLETION_ROUTINE InterruptChannelCompletion;
VOID L2CAPCallback(_In_ PVOID Context, _In_ INDICATION_CODE Indication, _In_ PINDICATION_PARAMETERS Parameters);
EVT_WDF_REQUEST_COMPLETION_ROUTINE TransferToDeviceCompletion;
EVT_WDF_REQUEST_COMPLETION_ROUTINE ReadFromDeviceCompletion;
NTSTATUS
GetVendorAndProductID(
_In_ WDFIOTARGET IoTarget,
_Out_ USHORT * VendorID,
_Out_ USHORT * ProductID
)
{
NTSTATUS Status = STATUS_SUCCESS;
WDF_MEMORY_DESCRIPTOR EnumInfoMemDescriptor;
BTH_ENUMERATOR_INFO EnumInfo;
RtlZeroMemory(&EnumInfo, sizeof(EnumInfo));
WDF_MEMORY_DESCRIPTOR_INIT_BUFFER(&EnumInfoMemDescriptor, &EnumInfo, sizeof(EnumInfo));
Status = WdfIoTargetSendInternalIoctlSynchronously(
IoTarget,
NULL,
IOCTL_INTERNAL_BTHENUM_GET_ENUMINFO,
NULL,
&EnumInfoMemDescriptor,
NULL,
NULL);
if (!NT_SUCCESS(Status))
{
return Status;
}
(*ProductID) = EnumInfo.Pid;
(*VendorID) = EnumInfo.Vid;
return Status;
}
NTSTATUS
BluetoothPrepare(
_In_ PDEVICE_CONTEXT DeviceContext
)
{
NTSTATUS Status = STATUS_SUCCESS;
PBLUETOOTH_DEVICE_CONTEXT BluetoothContext = &(DeviceContext->BluetoothContext);
WDF_MEMORY_DESCRIPTOR DeviceInfoMemDescriptor;
BTH_DEVICE_INFO DeviceInfo;
BluetoothContext->ControlChannelHandle = NULL;
BluetoothContext->InterruptChannelHandle = NULL;
// Get Interfaces
Status = WdfFdoQueryForInterface(
DeviceContext->Device,
&GUID_BTHDDI_PROFILE_DRIVER_INTERFACE,
(PINTERFACE)(&(BluetoothContext->ProfileDriverInterface)),
sizeof(BluetoothContext->ProfileDriverInterface),
BTHDDI_PROFILE_DRIVER_INTERFACE_VERSION_FOR_QI,
NULL);
if (!NT_SUCCESS(Status))
{
return Status;
}
// Get BluetoothAdress
RtlZeroMemory(&DeviceInfo, sizeof(DeviceInfo));
WDF_MEMORY_DESCRIPTOR_INIT_BUFFER(&DeviceInfoMemDescriptor, &DeviceInfo, sizeof(DeviceInfo));
Status = WdfIoTargetSendInternalIoctlSynchronously(
DeviceContext->IoTarget,
NULL,
IOCTL_INTERNAL_BTHENUM_GET_DEVINFO,
NULL,
&DeviceInfoMemDescriptor,
NULL,
NULL);
if (!NT_SUCCESS(Status))
{
return Status;
}
BluetoothContext->DeviceAddress = DeviceInfo.address;
Status = RtlStringCchPrintfW(BluetoothContext->DeviceAddressStringBuffer, BLUETOOTH_ADDRESS_STRING_SIZE, L"%012I64x", DeviceInfo.address);
if (!NT_SUCCESS(Status))
{
return Status;
}
Status = RtlUnicodeStringInit(&BluetoothContext->DeviceAddressString, BluetoothContext->DeviceAddressStringBuffer);
if (!NT_SUCCESS(Status))
{
return Status;
}
size_t NameLength;
Status = RtlStringCbLengthA(DeviceInfo.name, BTH_MAX_NAME_SIZE, &NameLength);
if (!NT_SUCCESS(Status))
{
return Status;
}
Status = RtlUTF8ToUnicodeN(BluetoothContext->DeviceNameStringBuffer, BTH_MAX_NAME_SIZE * sizeof(WCHAR), NULL, DeviceInfo.name, (ULONG)NameLength);
if (!NT_SUCCESS(Status))
{
return Status;
}
Status = RtlUnicodeStringInit(&BluetoothContext->DeviceNameString, BluetoothContext->DeviceNameStringBuffer);
if (!NT_SUCCESS(Status))
{
return Status;
}
return Status;
}
NTSTATUS
CreateRequest(
_In_ WDFDEVICE Device,
_In_ WDFIOTARGET IoTarget,
_Outptr_ WDFREQUEST * Request
)
{
NTSTATUS Status = STATUS_SUCCESS;
WDF_OBJECT_ATTRIBUTES Attributes;
WDF_OBJECT_ATTRIBUTES_INIT(&Attributes);
Attributes.ParentObject = Device;
Status = WdfRequestCreate(&Attributes, IoTarget, Request);
if(!NT_SUCCESS(Status))
{
return Status;
}
return Status;
}
NTSTATUS
CreateBuffer(
_In_ WDFREQUEST Request,
_In_ SIZE_T BufferSize,
_Outptr_ WDFMEMORY * Memory,
_Outptr_opt_result_buffer_(BufferSize) PVOID * Buffer
)
{
NTSTATUS Status = STATUS_SUCCESS;
WDF_OBJECT_ATTRIBUTES Attributes;
WDF_OBJECT_ATTRIBUTES_INIT(&Attributes);
Attributes.ParentObject = Request;
Status = WdfMemoryCreate(&Attributes, NonPagedPool, BUFFER_POOL_TAG, BufferSize, Memory, Buffer);
if(!NT_SUCCESS(Status))
{
return Status;
}
return Status;
}
NTSTATUS
BluetoothCreateRequestAndBuffer(
_In_ WDFDEVICE Device,
_In_ WDFIOTARGET IoTarget,
_In_ SIZE_T BufferSize,
_Outptr_ WDFREQUEST * Request,
_Outptr_ WDFMEMORY * Memory,
_Outptr_opt_result_buffer_(BufferSize) PVOID * Buffer
)
{
NTSTATUS Status = STATUS_SUCCESS;
Status = CreateRequest(Device, IoTarget, Request);
if(!NT_SUCCESS(Status))
{
return Status;
}
Status = CreateBuffer((*Request), BufferSize, Memory, Buffer);
if(!NT_SUCCESS(Status))
{
WdfObjectDelete(*Request);
(*Request) = NULL;
return Status;
}
return Status;
}
NTSTATUS
PrepareRequest(
_In_ WDFIOTARGET IoTarget,
_In_ PBRB BRB,
_In_ WDFREQUEST Request
)
{
NTSTATUS Status = STATUS_SUCCESS;
WDF_OBJECT_ATTRIBUTES MemoryAttributes;
WDFMEMORY Memory = NULL;
WDF_OBJECT_ATTRIBUTES_INIT(&MemoryAttributes);
MemoryAttributes.ParentObject = Request;
Status = WdfMemoryCreatePreallocated(
&MemoryAttributes,
BRB,
sizeof(*BRB),
&Memory
);
if(!NT_SUCCESS(Status))
{
return Status;
}
Status = WdfIoTargetFormatRequestForInternalIoctlOthers(
IoTarget,
Request,
IOCTL_INTERNAL_BTH_SUBMIT_BRB,
Memory, //OtherArg1
NULL, //OtherArg1Offset
NULL, //OtherArg2
NULL, //OtherArg2Offset
NULL, //OtherArg4
NULL //OtherArg4Offset
);
if(!NT_SUCCESS(Status))
{
return Status;
}
return Status;
}
NTSTATUS
SendBRB(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_opt_ WDFREQUEST OptRequest,
_In_ PBRB BRB,
_In_ PFN_WDF_REQUEST_COMPLETION_ROUTINE CompletionRoutine
)
{
NTSTATUS Status = STATUS_SUCCESS;
WDFREQUEST Request;
if(OptRequest == NULL)
{
Status = CreateRequest(DeviceContext->Device, DeviceContext->IoTarget, &Request);
if(!NT_SUCCESS(Status))
{
return Status;
}
}
else
{
Request = OptRequest;
}
Status = PrepareRequest(DeviceContext->IoTarget, BRB, Request);
if(!NT_SUCCESS(Status))
{
WdfObjectDelete(Request);
return Status;
}
WdfRequestSetCompletionRoutine(
Request,
CompletionRoutine,
BRB
);
if(!WdfRequestSend(
Request,
DeviceContext->IoTarget,
WDF_NO_SEND_OPTIONS
))
{
Status = WdfRequestGetStatus(Request);
WdfObjectDelete(Request);
return Status;
}
return Status;
}
NTSTATUS
SendBRBSynchronous(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_opt_ WDFREQUEST OptRequest,
_In_ PBRB BRB
)
{
NTSTATUS Status = STATUS_SUCCESS;
WDF_REQUEST_SEND_OPTIONS SendOptions;
WDFREQUEST Request;
if(OptRequest == NULL)
{
Status = CreateRequest(DeviceContext->Device, DeviceContext->IoTarget, &Request);
if(!NT_SUCCESS(Status))
{
return Status;
}
}
else
{
Request = OptRequest;
}
Status = PrepareRequest(DeviceContext->IoTarget, BRB, Request);
if(!NT_SUCCESS(Status))
{
WdfObjectDelete(Request);
return Status;
}
Status = WdfRequestAllocateTimer(Request);
if(!NT_SUCCESS(Status))
{
WdfObjectDelete(Request);
return Status;
}
WDF_REQUEST_SEND_OPTIONS_INIT(&SendOptions, WDF_REQUEST_SEND_OPTION_SYNCHRONOUS | WDF_REQUEST_SEND_OPTION_TIMEOUT);
WDF_REQUEST_SEND_OPTIONS_SET_TIMEOUT(&SendOptions, SYNCHRONOUS_CALL_TIMEOUT);
WdfRequestSend(
Request,
DeviceContext->IoTarget,
&SendOptions
);
Status = WdfRequestGetStatus(Request);
if(!NT_SUCCESS(Status))
{
WdfObjectDelete(Request);
return Status;
}
return Status;
}
VOID
CleanUpCompletedRequest(
_In_ WDFREQUEST Request,
_In_ WDFIOTARGET IoTarget,
_In_ WDFCONTEXT Context
)
{
PDEVICE_CONTEXT DeviceContext;
PBLUETOOTH_DEVICE_CONTEXT BluetoothContext;
PBRB UsedBRB;
DeviceContext = GetDeviceContext(WdfIoTargetGetDevice(IoTarget));
BluetoothContext = &(DeviceContext->BluetoothContext);
UsedBRB = (PBRB)Context;
WdfObjectDelete(Request);
BluetoothContext->ProfileDriverInterface.BthFreeBrb(UsedBRB);
}
VOID
L2CAPCallback(
_In_ PVOID Context,
_In_ INDICATION_CODE Indication,
_In_ PINDICATION_PARAMETERS Parameters
)
{
//WDF_DEVICE_STATE NewDeviceState;
PDEVICE_CONTEXT DeviceContext = (PDEVICE_CONTEXT)Context;
//UNREFERENCED_PARAMETER(Context);
UNREFERENCED_PARAMETER(Parameters);
Trace("L2CAP Channel Callback");
Trace("Indication: %u", Indication);
if(Indication == IndicationRemoteDisconnect)
{
//Wiimote has disconnected.
//Code has to be added to signal the PnP-Manager that the device is gone.
Trace("Disconnect");
Trace("Parameter: %u; %u", Parameters->Parameters.Disconnect.Reason, Parameters->Parameters.Disconnect.CloseNow);
WiimoteReset(DeviceContext);
SignalDeviceIsGone(DeviceContext);
//WDF_DEVICE_STATE_INIT (&NewDeviceState);
//HidNotifyPresence(WdfDeviceWdmGetDeviceObject(DeviceContext->Device), FALSE);
//WdfDeviceGetDeviceState(DeviceContext->Device, &NewDeviceState);
//NewDeviceState.Removed = WdfTrue;
//WdfDeviceSetDeviceState(DeviceContext->Device, &NewDeviceState);
//WdfPdoMarkMissing(DeviceContext->Device);
}
}
NTSTATUS
OpenChannel(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_opt_ PBRB PreAllocatedBRB,
_In_ BYTE PSM,
_In_opt_ PFNBTHPORT_INDICATION_CALLBACK ChannelCallback,
_In_ PFN_WDF_REQUEST_COMPLETION_ROUTINE ChannelCompletion
)
{
NTSTATUS Status = STATUS_SUCCESS;
PBLUETOOTH_DEVICE_CONTEXT BluetoothContext = &(DeviceContext->BluetoothContext);
PBRB_L2CA_OPEN_CHANNEL BRBOpenChannel;
//Create or reuse BRB
if(PreAllocatedBRB == NULL)
{
BRBOpenChannel = (PBRB_L2CA_OPEN_CHANNEL)BluetoothContext->ProfileDriverInterface.BthAllocateBrb(BRB_L2CA_OPEN_CHANNEL, BLUETOOTH_POOL_TAG);
if (BRBOpenChannel == NULL)
{
return STATUS_INSUFFICIENT_RESOURCES;
}
}
else
{
BluetoothContext->ProfileDriverInterface.BthReuseBrb(PreAllocatedBRB, BRB_L2CA_OPEN_CHANNEL);
BRBOpenChannel = (PBRB_L2CA_OPEN_CHANNEL)PreAllocatedBRB;
}
//Fill BRB
BRBOpenChannel->BtAddress = BluetoothContext->DeviceAddress;
BRBOpenChannel->Psm = PSM; //0x13
BRBOpenChannel->ChannelFlags = 0;
BRBOpenChannel->ConfigOut.Flags = 0;
BRBOpenChannel->ConfigOut.Mtu.Max = L2CAP_DEFAULT_MTU;
BRBOpenChannel->ConfigOut.Mtu.Min = L2CAP_MIN_MTU;
BRBOpenChannel->ConfigOut.Mtu.Preferred = L2CAP_DEFAULT_MTU;
BRBOpenChannel->ConfigOut.FlushTO.Max = L2CAP_DEFAULT_FLUSHTO;
BRBOpenChannel->ConfigOut.FlushTO.Min = L2CAP_MIN_FLUSHTO;
BRBOpenChannel->ConfigOut.FlushTO.Preferred = L2CAP_DEFAULT_FLUSHTO;
BRBOpenChannel->ConfigOut.ExtraOptions = 0;
BRBOpenChannel->ConfigOut.NumExtraOptions = 0;
BRBOpenChannel->ConfigOut.LinkTO = 0;
BRBOpenChannel->IncomingQueueDepth = 50;
BRBOpenChannel->ReferenceObject = (PVOID) WdfDeviceWdmGetDeviceObject(DeviceContext->Device);
if(ChannelCallback != NULL)
{
BRBOpenChannel->CallbackFlags = CALLBACK_DISCONNECT;
BRBOpenChannel->Callback = ChannelCallback; //L2CAPCallback;
BRBOpenChannel->CallbackContext = (PVOID)DeviceContext;
}
//SendBRB
Status = SendBRB(DeviceContext, NULL, (PBRB)BRBOpenChannel, ChannelCompletion);
if(!NT_SUCCESS(Status))
{
BluetoothContext->ProfileDriverInterface.BthFreeBrb((PBRB)BRBOpenChannel);
return Status;
}
return Status;
}
VOID
ControlChannelCompletion(
_In_ WDFREQUEST Request,
_In_ WDFIOTARGET IoTarget,
_In_ PWDF_REQUEST_COMPLETION_PARAMS Params,
_In_ WDFCONTEXT Context
)
{
NTSTATUS Status = STATUS_SUCCESS;
PDEVICE_CONTEXT DeviceContext;
PBLUETOOTH_DEVICE_CONTEXT BluetoothContext;
PBRB_L2CA_OPEN_CHANNEL UsedBRBOpenChannel;
DeviceContext = GetDeviceContext(WdfIoTargetGetDevice(IoTarget));
BluetoothContext = &(DeviceContext->BluetoothContext);
UsedBRBOpenChannel = (PBRB_L2CA_OPEN_CHANNEL)Context;
Status = Params->IoStatus.Status;
TraceStatus("Control Channel Result", Status);
if(!NT_SUCCESS(Status))
{
CleanUpCompletedRequest(Request, IoTarget, Context);
if(Status == STATUS_IO_TIMEOUT)
{
SignalDeviceIsGone(DeviceContext);
}
else
{
WdfDeviceSetFailed(DeviceContext->Device, WdfDeviceFailedNoRestart);
}
return;
}
BluetoothContext->ControlChannelHandle = UsedBRBOpenChannel->ChannelHandle;
CleanUpCompletedRequest(Request, IoTarget, Context);
// Open Interrupt Channel
OpenChannel(DeviceContext, NULL, 0x13, L2CAPCallback, InterruptChannelCompletion);
}
VOID
InterruptChannelCompletion(
_In_ WDFREQUEST Request,
_In_ WDFIOTARGET IoTarget,
_In_ PWDF_REQUEST_COMPLETION_PARAMS Params,
_In_ WDFCONTEXT Context
)
{
NTSTATUS Status = STATUS_SUCCESS;
PDEVICE_CONTEXT DeviceContext;
PBLUETOOTH_DEVICE_CONTEXT BluetoothContext;
PBRB_L2CA_OPEN_CHANNEL UsedBRBOpenChannel;
DeviceContext = GetDeviceContext(WdfIoTargetGetDevice(IoTarget));
BluetoothContext = &(DeviceContext->BluetoothContext);
UsedBRBOpenChannel = (PBRB_L2CA_OPEN_CHANNEL)Context;
Status = Params->IoStatus.Status;
TraceStatus("Interrupt Channel Result", Status);
if(!NT_SUCCESS(Status))
{
CleanUpCompletedRequest(Request, IoTarget, Context);
if(Status == STATUS_IO_TIMEOUT)
{
SignalDeviceIsGone(DeviceContext);
}
else
{
WdfDeviceSetFailed(DeviceContext->Device, WdfDeviceFailedNoRestart);
}
return;
}
BluetoothContext->InterruptChannelHandle = UsedBRBOpenChannel->ChannelHandle;
CleanUpCompletedRequest(Request, IoTarget, Context);
// Start Wiimote functionality
WiimoteStart(DeviceContext);
}
NTSTATUS
BluetoothOpenChannels(
_In_ PDEVICE_CONTEXT DeviceContext
)
{
return OpenChannel(DeviceContext, NULL, 0x11, NULL, ControlChannelCompletion);
}
NTSTATUS
CloseChannel(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ L2CAP_CHANNEL_HANDLE ChannelHandle
)
{
NTSTATUS Status = STATUS_SUCCESS;
PBLUETOOTH_DEVICE_CONTEXT BluetoothContext = &(DeviceContext->BluetoothContext);
PBRB_L2CA_CLOSE_CHANNEL BRBCloseChannel;
if(ChannelHandle == NULL)
{
Trace("Close Channel: Handle is NULL");
return Status;
}
BRBCloseChannel = (PBRB_L2CA_CLOSE_CHANNEL)BluetoothContext->ProfileDriverInterface.BthAllocateBrb(BRB_L2CA_CLOSE_CHANNEL, BLUETOOTH_POOL_TAG);
if (BRBCloseChannel == NULL)
{
return STATUS_INSUFFICIENT_RESOURCES;
}
BRBCloseChannel->BtAddress = BluetoothContext->DeviceAddress;
BRBCloseChannel->ChannelHandle = ChannelHandle;
Status = SendBRBSynchronous(DeviceContext, NULL, (PBRB)BRBCloseChannel);
BluetoothContext->ProfileDriverInterface.BthFreeBrb((PBRB)BRBCloseChannel);
return Status;
}
NTSTATUS
BluetoothCloseChannels(
_In_ PDEVICE_CONTEXT DeviceContext
)
{
PBLUETOOTH_DEVICE_CONTEXT BluetoothContext = &(DeviceContext->BluetoothContext);
CloseChannel(DeviceContext, BluetoothContext->InterruptChannelHandle);
BluetoothContext->InterruptChannelHandle = NULL;
CloseChannel(DeviceContext, BluetoothContext->ControlChannelHandle);
BluetoothContext->ControlChannelHandle = NULL;
return STATUS_SUCCESS;
}
NTSTATUS
BluetoothTransferToDevice(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ WDFREQUEST Request,
_In_ WDFMEMORY Memory,
_In_ BOOLEAN Synchronous
)
{
NTSTATUS Status = STATUS_SUCCESS;
PBLUETOOTH_DEVICE_CONTEXT BluetoothContext = &(DeviceContext->BluetoothContext);
PBRB_L2CA_ACL_TRANSFER BRBTransfer;
size_t BufferSize;
if(BluetoothContext->InterruptChannelHandle == NULL)
{
return STATUS_INVALID_HANDLE;
}
// Now get an BRB and fill it
BRBTransfer = (PBRB_L2CA_ACL_TRANSFER)BluetoothContext->ProfileDriverInterface.BthAllocateBrb(BRB_L2CA_ACL_TRANSFER, BLUETOOTH_POOL_TAG);
if (BRBTransfer == NULL)
{
return STATUS_INSUFFICIENT_RESOURCES;
}
BRBTransfer->BtAddress = BluetoothContext->DeviceAddress;
BRBTransfer->ChannelHandle = BluetoothContext->InterruptChannelHandle;
BRBTransfer->TransferFlags = ACL_TRANSFER_DIRECTION_OUT;
BRBTransfer->BufferMDL = NULL;
BRBTransfer->Buffer = WdfMemoryGetBuffer(Memory, &BufferSize);
BRBTransfer->BufferSize = (ULONG)BufferSize;
//Send
if(Synchronous)
{
Status = SendBRBSynchronous(DeviceContext, Request, (PBRB)BRBTransfer);
BluetoothContext->ProfileDriverInterface.BthFreeBrb((PBRB)BRBTransfer);
if(!NT_SUCCESS(Status))
{
return Status;
}
}
else
{
Status = SendBRB(DeviceContext, Request, (PBRB)BRBTransfer, TransferToDeviceCompletion);
if(!NT_SUCCESS(Status))
{
BluetoothContext->ProfileDriverInterface.BthFreeBrb((PBRB)BRBTransfer);
return Status;
}
}
return Status;
}
VOID
TransferToDeviceCompletion(
_In_ WDFREQUEST Request,
_In_ WDFIOTARGET IoTarget,
_In_ PWDF_REQUEST_COMPLETION_PARAMS Params,
_In_ WDFCONTEXT Context
)
{
UNREFERENCED_PARAMETER(Params);
CleanUpCompletedRequest(Request, IoTarget, Context);
}
NTSTATUS
ReadFromDevice(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ WDFREQUEST Request,
_In_ PBRB_L2CA_ACL_TRANSFER BRB,
_In_reads_(ReadBufferSize) PVOID ReadBuffer,
_In_ SIZE_T ReadBufferSize
)
{
NTSTATUS Status = STATUS_SUCCESS;
PBLUETOOTH_DEVICE_CONTEXT BluetoothContext = &(DeviceContext->BluetoothContext);
if(BluetoothContext->InterruptChannelHandle == NULL)
{
return STATUS_INVALID_HANDLE;
}
BRB->BtAddress = BluetoothContext->DeviceAddress;
BRB->ChannelHandle = BluetoothContext->InterruptChannelHandle;
BRB->TransferFlags = ACL_TRANSFER_DIRECTION_IN | ACL_SHORT_TRANSFER_OK;
BRB->BufferMDL = NULL;
BRB->Buffer = ReadBuffer;
BRB->BufferSize = (ULONG)ReadBufferSize;
Status = SendBRB(DeviceContext, Request, (PBRB)BRB, ReadFromDeviceCompletion);
if(!NT_SUCCESS(Status))
{
TraceStatus("SendBRB Failed", Status);
return Status;
}
return Status;
}
VOID
ReadFromDeviceCompletion(
_In_ WDFREQUEST Request,
_In_ WDFIOTARGET IoTarget,
_In_ PWDF_REQUEST_COMPLETION_PARAMS Params,
_In_ WDFCONTEXT Context
)
{
NTSTATUS Status = STATUS_SUCCESS;
PDEVICE_CONTEXT DeviceContext;
PBLUETOOTH_DEVICE_CONTEXT BluetoothContext;
PVOID ReadBuffer;
size_t ReadBufferSize;
PBRB_L2CA_ACL_TRANSFER BRB;
WDF_REQUEST_REUSE_PARAMS RequestReuseParams;
DeviceContext = GetDeviceContext(WdfIoTargetGetDevice(IoTarget));
BluetoothContext = &(DeviceContext->BluetoothContext);
BRB = (PBRB_L2CA_ACL_TRANSFER)Context;
Status = Params->IoStatus.Status;
//TraceStatus("ReadFromDeviceCompletion Result", Status);
if(!NT_SUCCESS(Status))
{
WdfObjectDelete(Request);
return;
}
ReadBuffer = BRB->Buffer;
ReadBufferSize = BRB->BufferSize;
//Trace("RawBuffer: %08x", (*(UINT64 * )ReadBuffer));
//Trace("BufferSize: %d - RemainingBufferSize: %d", BRB->BufferSize, BRB->RemainingBufferSize);
//Call Wiimote Read Callback
Status = WiimoteProcessReport(DeviceContext, ReadBuffer, (ReadBufferSize - BRB->RemainingBufferSize));
if(!NT_SUCCESS(Status))
{
WdfObjectDelete(Request);
return;
}
//Reset all Object for reuse
BluetoothContext->ProfileDriverInterface.BthReuseBrb((PBRB)BRB, BRB_L2CA_ACL_TRANSFER);
WDF_REQUEST_REUSE_PARAMS_INIT(&RequestReuseParams, WDF_REQUEST_REUSE_NO_FLAGS, STATUS_SUCCESS);
Status = WdfRequestReuse(Request, &RequestReuseParams);
if(!NT_SUCCESS(Status))
{
WdfObjectDelete(Request);
return;
}
RtlSecureZeroMemory(ReadBuffer, ReadBufferSize);
//Send out new Read
Status = ReadFromDevice(DeviceContext, Request, BRB, ReadBuffer, BluetoothContext->ReadBufferSize);
if(!NT_SUCCESS(Status))
{
return;
}
}
NTSTATUS
BluetoothStartContiniousReader(
_In_ PDEVICE_CONTEXT DeviceContext
)
{
CONST size_t ReadBufferSize = 50;
NTSTATUS Status = STATUS_SUCCESS;
WDFREQUEST Request;
WDFMEMORY Memory;
PBRB BRB;
PBLUETOOTH_DEVICE_CONTEXT BluetoothContext = &(DeviceContext->BluetoothContext);
PVOID ReadBuffer = NULL;
Trace("StartContiniousReader");
//Create Report And Buffer
Status = BluetoothCreateRequestAndBuffer(DeviceContext->Device, DeviceContext->IoTarget, ReadBufferSize, &Request, &Memory, &ReadBuffer);
if(!NT_SUCCESS(Status))
{
TraceStatus("CreateRequestAndBuffer Failed", Status);
return Status;
}
// Safe the Buffer Size
BluetoothContext->ReadBufferSize = ReadBufferSize;
// Create BRB
BRB = BluetoothContext->ProfileDriverInterface.BthAllocateBrb(BRB_L2CA_ACL_TRANSFER, BLUETOOTH_POOL_TAG);
if (BRB == NULL)
{
WdfObjectDelete(Request);
return STATUS_INSUFFICIENT_RESOURCES;
}
//Start the Reader
Status = ReadFromDevice(DeviceContext, Request, (PBRB_L2CA_ACL_TRANSFER)BRB, ReadBuffer, ReadBufferSize);
if(!NT_SUCCESS(Status))
{
return Status;
}
return Status;
}
================================================
FILE: HID Wiimote/Bluetooth.h
================================================
/*
Copyright (C) 2017 Julian Lhr
All rights reserved.
Filename:
Bluetooth.h
Abstract:
Header file for Bluetooth.c
*/
#pragma once
#include "HIDWiimote.h"
#include <bthdef.h>
#include <bthguid.h>
#include <bthioctl.h>
#include <sdpnode.h>
#include <bthddi.h>
#include <bthsdpddi.h>
#include <bthsdpdef.h>
#define BLUETOOTH_POOL_TAG '_htB'
#define BUFFER_POOL_TAG '_fuB'
#define SYNCHRONOUS_CALL_TIMEOUT (-1000000000) // 1 Second
#define BLUETOOTH_ADDRESS_STRING_SIZE 17
typedef struct _BLUETOOTH_DEVICE_CONTEXT
{
BTH_PROFILE_DRIVER_INTERFACE ProfileDriverInterface;
BTH_ADDR DeviceAddress;
UNICODE_STRING DeviceAddressString;
WCHAR DeviceAddressStringBuffer[BLUETOOTH_ADDRESS_STRING_SIZE];
UNICODE_STRING DeviceNameString;
WCHAR DeviceNameStringBuffer[BTH_MAX_NAME_SIZE];
L2CAP_CHANNEL_HANDLE ControlChannelHandle;
L2CAP_CHANNEL_HANDLE InterruptChannelHandle;
size_t ReadBufferSize;
} BLUETOOTH_DEVICE_CONTEXT, * PBLUETOOTH_DEVICE_CONTEXT;
typedef struct _BRB_L2CA_OPEN_CHANNEL * PBRB_L2CA_OPEN_CHANNEL;
typedef struct _BRB_L2CA_CLOSE_CHANNEL * PBRB_L2CA_CLOSE_CHANNEL;
typedef struct _BRB_L2CA_ACL_TRANSFER * PBRB_L2CA_ACL_TRANSFER;
NTSTATUS GetVendorAndProductID(_In_ WDFIOTARGET IoTarget, _Out_ USHORT * VendorID, _Out_ USHORT * ProductID);
NTSTATUS BluetoothPrepare(_In_ PDEVICE_CONTEXT DeviceContext);
NTSTATUS BluetoothOpenChannels(_In_ PDEVICE_CONTEXT DeviceContext);
NTSTATUS BluetoothCloseChannels(_In_ PDEVICE_CONTEXT DeviceContext);
NTSTATUS BluetoothCreateRequestAndBuffer(_In_ WDFDEVICE Device, _In_ WDFIOTARGET IoTarget, _In_ SIZE_T BufferSize, _Outptr_ WDFREQUEST * Request, _Outptr_ WDFMEMORY * Memory, _Outptr_opt_result_buffer_(BufferSize) PVOID * Buffer);
NTSTATUS BluetoothTransferToDevice(_In_ PDEVICE_CONTEXT DeviceContext, _In_ WDFREQUEST Request, _In_ WDFMEMORY Memory, _In_ BOOLEAN Synchronous);
NTSTATUS BluetoothStartContiniousReader(_In_ PDEVICE_CONTEXT DeviceContext);
================================================
FILE: HID Wiimote/Device.c
================================================
/*
Copyright (C) 2017 Julian Lhr
All rights reserved.
Filename:
Device.c
Abstract:
Contains all system callbacks regarding a devices pnp and power states.
*/
#include "Device.h"
NTSTATUS
DeviceAdd(
_In_ WDFDRIVER Driver,
_Inout_ PWDFDEVICE_INIT DeviceInit
)
{
NTSTATUS Status = STATUS_SUCCESS;
WDF_OBJECT_ATTRIBUTES Attributes;
WDF_PNPPOWER_EVENT_CALLBACKS PnpPowerCallbacks;
WDFDEVICE Device;
PDEVICE_CONTEXT DevContext;
UNREFERENCED_PARAMETER(Driver);
Trace("Device Added");
// Driver is filter
WdfFdoInitSetFilter(DeviceInit);
// Configure PnP Functions
WDF_PNPPOWER_EVENT_CALLBACKS_INIT(&PnpPowerCallbacks);
PnpPowerCallbacks.EvtDevicePrepareHardware = PrepareHardware;
PnpPowerCallbacks.EvtDeviceReleaseHardware = ReleaseHardware;
PnpPowerCallbacks.EvtDeviceD0Entry = DeviceD0Entry;
PnpPowerCallbacks.EvtDeviceD0Exit = DeviceD0Exit;
WdfDeviceInitSetPnpPowerEventCallbacks(DeviceInit, &PnpPowerCallbacks);
// Configure Device Context
WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&Attributes, DEVICE_CONTEXT);
//Create Device Object
Status = WdfDeviceCreate(&DeviceInit, &Attributes, &Device);
if(!NT_SUCCESS(Status))
{
return Status;
}
//Initialize DeviceContext
DevContext = GetDeviceContext(Device);
DevContext->Device = Device;
// Create IO Queue
Status = HIDCreateQueues(Device, DevContext);
if(!NT_SUCCESS(Status))
{
Trace("Device Added Error On CreateQueues Result: 0x%x", Status);
return Status;
}
// Create Settings Device Interface
Status = DeviceInterfaceCreate(DevContext);
if (!NT_SUCCESS(Status))
{
TraceStatus("Error Creating Device Interface", Status);
return Status;
}
TraceStatus("Device Added Result", Status);
return Status;
}
NTSTATUS
PrepareHardware(
_In_ WDFDEVICE Device,
_In_ WDFCMRESLIST ResourcesRaw,
_In_ WDFCMRESLIST ResourcesTranslated
)
{
NTSTATUS Status = STATUS_SUCCESS;
PDEVICE_CONTEXT DeviceContext;
UNREFERENCED_PARAMETER(ResourcesRaw);
UNREFERENCED_PARAMETER(ResourcesTranslated);
Trace("PrepareHardware");
DeviceContext = GetDeviceContext(Device);
DeviceContext->IoTarget = WdfDeviceGetIoTarget(Device);
//Initialize Bluetooth
Status = BluetoothPrepare(DeviceContext);
if(!NT_SUCCESS(Status))
{
return Status;
}
//Initialize HID
Status = HIDPrepare(DeviceContext);
if(!NT_SUCCESS(Status))
{
return Status;
}
//Initialize Wiimote
Status = WiimotePrepare(DeviceContext);
if(!NT_SUCCESS(Status))
{
return Status;
}
TraceStatus("PrepareHardware Result", Status);
return Status;
}
NTSTATUS
DeviceD0Entry(
_In_ WDFDEVICE Device,
_In_ WDF_POWER_DEVICE_STATE PreviousState
)
{
NTSTATUS Status = STATUS_SUCCESS;
PDEVICE_CONTEXT DeviceContext;
UNREFERENCED_PARAMETER(PreviousState);
Trace("Device D0 Entry");
DeviceContext = GetDeviceContext(Device);
RtlSecureZeroMemory(&(DeviceContext->HIDMiniportAddresses), sizeof(HID_MINIPORT_ADDRESSES));
Status = BluetoothOpenChannels(DeviceContext);
if(!NT_SUCCESS(Status))
{
return Status;
}
TraceStatus("Device D0 Entry Result", Status);
return Status;
}
NTSTATUS
DeviceD0Exit(
_In_ WDFDEVICE Device,
_In_ WDF_POWER_DEVICE_STATE TargetState
)
{
NTSTATUS Status = STATUS_SUCCESS;
PDEVICE_CONTEXT DeviceContext;
UNREFERENCED_PARAMETER(TargetState);
Trace("Exit D0; Target: %x", TargetState);
DeviceContext = GetDeviceContext(Device);
//Suspend Wiimote
Status = WiimoteStop(DeviceContext);
if (!NT_SUCCESS(Status))
{
TraceStatus("Error Stopping Wiimote", Status);
}
//Close BluetoothConnection
Status = BluetoothCloseChannels(DeviceContext);
if (!NT_SUCCESS(Status))
{
TraceStatus("Error Closing Bluetooth Connections", Status);
}
TraceStatus("Exit D0 Result", Status);
return Status;
}
NTSTATUS
ReleaseHardware(
_In_ WDFDEVICE Device,
_In_ WDFCMRESLIST ResourcesTranslated
)
{
NTSTATUS Status = STATUS_SUCCESS;
PDEVICE_CONTEXT DeviceContext;
UNREFERENCED_PARAMETER(ResourcesTranslated);
Trace("Releasee Hardware");
DeviceContext = GetDeviceContext(Device);
Status = DeviceInterfaceRelease(DeviceContext->SettingsInterfaceContext);
if (!NT_SUCCESS(Status))
{
TraceStatus("Error Releaseing Device Interface", Status);
}
Status = HIDRelease(DeviceContext);
if (!NT_SUCCESS(Status))
{
TraceStatus("Error Releaseing HID", Status);
}
TraceStatus("Releasee Hardware Result", Status);
return Status;
}
VOID
SetHIDMiniportAddresses(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ PHID_MINIPORT_ADDRESSES Addresses
)
{
DeviceContext->HIDMiniportAddresses.FDO = Addresses->FDO;
DeviceContext->HIDMiniportAddresses.HidNotifyPresence = Addresses->HidNotifyPresence;
}
NTSTATUS
SignalDeviceIsGone(
_In_ PDEVICE_CONTEXT DeviceContext
)
{
NTSTATUS Status = STATUS_SUCCESS;
if((DeviceContext->HIDMiniportAddresses.FDO != NULL) && (DeviceContext->HIDMiniportAddresses.HidNotifyPresence != NULL))
{
Status = (DeviceContext->HIDMiniportAddresses.HidNotifyPresence)((DeviceContext->HIDMiniportAddresses.FDO), FALSE);
TraceStatus("Signaling Device is Gone", Status);
}
return Status;
}
================================================
FILE: HID Wiimote/Device.h
================================================
/*
Copyright (C) 2017 Julian Lhr
All rights reserved.
Filename:
Device.h
Abstract:
Header file for Device.c
*/
#pragma once
#include "HIDWiimote.h"
#include "DeviceInterface.h"
#include "Wiimote.h"
#include "Bluetooth.h"
#include "HID.h"
typedef struct _DEVICE_CONTEXT
{
WDFDEVICE Device;
WDFIOTARGET IoTarget;
PDEVICE_INTERFACE_CONTEXT SettingsInterfaceContext;
BLUETOOTH_DEVICE_CONTEXT BluetoothContext;
HID_DEVICE_CONTEXT HIDContext;
WIIMOTE_DEVICE_CONTEXT WiimoteContext;
HID_MINIPORT_ADDRESSES HIDMiniportAddresses;
} DEVICE_CONTEXT, * PDEVICE_CONTEXT;
WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(DEVICE_CONTEXT, GetDeviceContext)
EVT_WDF_DRIVER_DEVICE_ADD DeviceAdd;
EVT_WDF_DEVICE_PREPARE_HARDWARE PrepareHardware;
EVT_WDF_DEVICE_D0_ENTRY DeviceD0Entry;
EVT_WDF_DEVICE_D0_EXIT DeviceD0Exit;
EVT_WDF_DEVICE_RELEASE_HARDWARE ReleaseHardware;
VOID SetHIDMiniportAddresses(_In_ PDEVICE_CONTEXT DeviceContext, _In_ PHID_MINIPORT_ADDRESSES Addresses);
NTSTATUS SignalDeviceIsGone(_In_ PDEVICE_CONTEXT DeviceContext);
================================================
FILE: HID Wiimote/DeviceInterface.c
================================================
/*
Copyright (C) 2017 Julian Lhr
All rights reserved.
Filename:
DeviceInterface.c
Abstract:
Contains code for the RawPDO used as Device Interface.
Handles all incomming IOCTLs.
*/
#include "DeviceInterface.h"
#include "Device.h"
#include "DeviceInterfacePublic.h"
typedef VOID DRIVER_MODE_SETTING_SETTER(_In_ PDEVICE_CONTEXT DeviceContext, _In_ WIIMOTE_DRIVER_MODE Value);
typedef VOID BOOLEAN_SETTING_SETTER(_In_ PDEVICE_CONTEXT DeviceContext, _In_ BOOLEAN Value);
// {7D180E63-2CAC-4112-B3D4-C42275CA497E}
DEFINE_GUID(GUID_DEVCLASS_HIDWIIMOTE,
0x7d180e63, 0x2cac, 0x4112, 0xb3, 0xd4, 0xc4, 0x22, 0x75, 0xca, 0x49, 0x7e);
WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(DEVICE_INTERFACE_CONTEXT, GetDeviceInterfaceContext);
NTSTATUS CreateSettingsInterfaceQueues(_In_ PDEVICE_INTERFACE_CONTEXT DeviceInterfaceContext);
EVT_WDF_IO_QUEUE_IO_DEVICE_CONTROL DeviceInterfaceDeviceControlCallback;
EVT_READ_IO_CONTROL_BUFFER_FILL_BUFFER DeviceInterfaceFillReadBufferCallback;
VOID ProcessGetState(_In_ WDFREQUEST Request, _In_ PDEVICE_INTERFACE_CONTEXT DeviceInterfaceContext);
VOID ForwardReadStatusRequest(_In_ WDFREQUEST Request, _In_ PDEVICE_INTERFACE_CONTEXT DeviceInterfaceContext);
VOID ProcessSetDriverModeSetting(_In_ WDFREQUEST Request, _In_ PDEVICE_INTERFACE_CONTEXT DeviceInterfaceContext, _In_ DRIVER_MODE_SETTING_SETTER DriverModeSettingSetter);
VOID ProcessSetBooleanSetting(_In_ WDFREQUEST Request, _In_ PDEVICE_INTERFACE_CONTEXT DeviceInterfaceContext, _In_ BOOLEAN_SETTING_SETTER BooleanSettingSetter);
VOID FillStateIoControlData(_In_ PWIIMOTE_STATE_IOCTL_DATA StateData, _In_ PWIIMOTE_DEVICE_CONTEXT WiimoteContext);
VOID FillStatusIoControlData(_In_ PWIIMOTE_STATUS_IOCTL_DATA StatusData, _In_ PWIIMOTE_DEVICE_CONTEXT WiimoteContext);
NTSTATUS DeviceInterfaceCreate(_In_ PDEVICE_CONTEXT ParentDeviceContext)
{
NTSTATUS Status = STATUS_SUCCESS;
PWDFDEVICE_INIT DeviceInit;
WDF_OBJECT_ATTRIBUTES Attributes;
WDFDEVICE InterfaceDevice;
PDEVICE_INTERFACE_CONTEXT DeviceInterfaceContext;
WDF_DEVICE_PNP_CAPABILITIES PnpCapabilities;
WDF_DEVICE_STATE DeviceState;
DECLARE_CONST_UNICODE_STRING(DeviceID, L"{398128C0-7830-4B53-BA84-1E02F05EFFB0}\\HIDWiimoteInterface");
DECLARE_CONST_UNICODE_STRING(InstanceID, L"0");
DECLARE_CONST_UNICODE_STRING(DeviceText, L"HID Wiimote Settings Interface");
DECLARE_CONST_UNICODE_STRING(DeviceLocation, L"Somewhere in Kernel Space");
// Allocate and setup DeviceInit
DeviceInit = WdfPdoInitAllocate(ParentDeviceContext->Device);
if (DeviceInit == NULL)
{
return STATUS_INSUFFICIENT_RESOURCES;
}
// Assing custom Device Class
Status = WdfPdoInitAssignRawDevice(DeviceInit, &GUID_DEVCLASS_HIDWIIMOTE);
if (!NT_SUCCESS(Status))
{
WdfDeviceInitFree(DeviceInit);
return Status;
}
// Device ID
Status = WdfPdoInitAssignDeviceID(DeviceInit, &DeviceID);
if (!NT_SUCCESS(Status))
{
WdfDeviceInitFree(DeviceInit);
return Status;
}
// Instance ID (unique to its parent)
Status = WdfPdoInitAssignInstanceID(DeviceInit, &InstanceID);
if (!NT_SUCCESS(Status))
{
WdfDeviceInitFree(DeviceInit);
return Status;
}
// Default Device Name and Location shown in Device Manager
Status = WdfPdoInitAddDeviceText(DeviceInit, &DeviceText, &DeviceLocation, 0x409);
if (!NT_SUCCESS(Status))
{
WdfDeviceInitFree(DeviceInit);
return Status;
}
WdfPdoInitSetDefaultLocale(DeviceInit, 0x409);
// Set our Device Interface Context
WDF_OBJECT_ATTRIBUTES_INIT_CONTEXT_TYPE(&Attributes, DEVICE_INTERFACE_CONTEXT);
// Create the raw PDO
Status = WdfDeviceCreate(&DeviceInit, &Attributes, &InterfaceDevice);
if (!NT_SUCCESS(Status))
{
TraceStatus("Error creating raw PDO for Settings Interface", Status);
WdfDeviceInitFree(DeviceInit);
return Status;
}
// Initialize Raw Context
DeviceInterfaceContext = GetDeviceInterfaceContext(InterfaceDevice);
DeviceInterfaceContext->InterfaceDevice = InterfaceDevice;
DeviceInterfaceContext->Parent = ParentDeviceContext;
// Plug'n'Play Settings
WDF_DEVICE_PNP_CAPABILITIES_INIT(&PnpCapabilities);
PnpCapabilities.Removable = WdfTrue;
PnpCapabilities.SurpriseRemovalOK = WdfTrue;
PnpCapabilities.NoDisplayInUI = WdfTrue;
WdfDeviceSetPnpCapabilities(InterfaceDevice, &PnpCapabilities);
//Hide it in Device Manager
WDF_DEVICE_STATE_INIT(&DeviceState);
DeviceState.DontDisplayInUI = WdfTrue;
WdfDeviceSetDeviceState(InterfaceDevice, &DeviceState);
// Create Device Interface
Status = WdfDeviceCreateDeviceInterface(InterfaceDevice, &GUID_DEVINTERFACE_HIDWIIMOTE, NULL);
if (!NT_SUCCESS(Status))
{
TraceStatus("Error creating raw PDO for Settings Interface", Status);
WdfObjectDelete(InterfaceDevice);
return Status;
}
// Make Static Child
Status = WdfFdoAddStaticChild(ParentDeviceContext->Device, InterfaceDevice);
if (!NT_SUCCESS(Status))
{
WdfObjectDelete(InterfaceDevice);
return Status;
}
// Everything is fine, so save the Interface Context in our parent/main context
ParentDeviceContext->SettingsInterfaceContext = DeviceInterfaceContext;
// Create Queues
Status = CreateSettingsInterfaceQueues(DeviceInterfaceContext);
if (!NT_SUCCESS(Status))
{
TraceStatus("Error Creating Settings Interface Queues", Status);
return Status;
}
return STATUS_SUCCESS;
}
NTSTATUS CreateSettingsInterfaceQueues(_In_ PDEVICE_INTERFACE_CONTEXT DeviceInterfaceContext)
{
NTSTATUS Status = STATUS_SUCCESS;
WDF_IO_QUEUE_CONFIG DefaultQueueConfig;
// Default IO Queue
WDF_IO_QUEUE_CONFIG_INIT_DEFAULT_QUEUE(&DefaultQueueConfig, WdfIoQueueDispatchSequential);
DefaultQueueConfig.EvtIoDeviceControl = DeviceInterfaceDeviceControlCallback;
Status = WdfIoQueueCreate(DeviceInterfaceContext->InterfaceDevice, &DefaultQueueConfig, WDF_NO_OBJECT_ATTRIBUTES, &DeviceInterfaceContext->DefaultIOQueue);
if (!NT_SUCCESS(Status))
{
TraceStatus("Failed to create Default IO Queue for Settings Interface Device", Status);
return Status;
}
// Read Buffer Queue
Status = ReadIoControlBufferCreate(
&DeviceInterfaceContext->ReadBuffer,
DeviceInterfaceContext->InterfaceDevice,
DeviceInterfaceContext->Parent,
DeviceInterfaceFillReadBufferCallback,
sizeof(WIIMOTE_STATUS_IOCTL_DATA));
if (!NT_SUCCESS(Status))
{
TraceStatus("Creating Device Interface Read Buffer failed", Status);
return Status;
}
return STATUS_SUCCESS;
}
NTSTATUS
DeviceInterfaceRelease(
_In_ PDEVICE_INTERFACE_CONTEXT DeviceInterfaceContext
)
{
NTSTATUS Status = STATUS_SUCCESS;
ReadIoControlBufferFlush(&DeviceInterfaceContext->ReadBuffer);
return Status;
}
VOID DeviceInterfaceWiimoteStateUpdated(_In_ PDEVICE_CONTEXT DeviceContext)
{
ReadIoControlBufferDispatchRequest(&DeviceContext->SettingsInterfaceContext->ReadBuffer);
}
VOID
DeviceInterfaceDeviceControlCallback(
IN WDFQUEUE Queue,
IN WDFREQUEST Request,
IN size_t OutputBufferLength,
IN size_t InputBufferLength,
IN ULONG IoControlCode
)
{
UNREFERENCED_PARAMETER(OutputBufferLength);
UNREFERENCED_PARAMETER(InputBufferLength);
PDEVICE_INTERFACE_CONTEXT DeviceInterfaceContext = GetDeviceInterfaceContext(WdfIoQueueGetDevice(Queue));
switch (IoControlCode)
{
case IOCTL_WIIMOTE_GET_STATE:
ProcessGetState(Request, DeviceInterfaceContext);
break;
case IOCTL_WIIMOTE_READ_STATUS:
ForwardReadStatusRequest(Request, DeviceInterfaceContext);
break;
case IOCTL_WIIMOTE_SET_MODE:
ProcessSetDriverModeSetting(Request, DeviceInterfaceContext, WiimoteSettingsSetDriverMode);
break;
case IOCTL_WIIMOTE_SET_ENABLE_WIIMOTE_XAXIS_ACCELEROMETER:
ProcessSetBooleanSetting(Request, DeviceInterfaceContext, WiimoteSettingsSetEnableWiimoteXAxisAccelerometer);
break;
case IOCTL_WIIMOTE_SET_ENABLE_WIIMOTE_YAXIS_ACCELEROMETER:
ProcessSetBooleanSetting(Request, DeviceInterfaceContext, WiimoteSettingsSetEnableWiimoteYAxisAccelerometer);
break;
case IOCTL_WIIMOTE_SET_SWITCH_MOUSEBUTTONS:
ProcessSetBooleanSetting(Request, DeviceInterfaceContext, WiimoteSettingsSetSwapMouseButtons);
break;
case IOCTL_WIIMOTE_SET_SWITCH_TRIGGERANDSHOULDER:
ProcessSetBooleanSetting(Request, DeviceInterfaceContext, WiimoteSettingsSetSwapTriggerAndShoulder);
break;
case IOCTL_WIIMOTE_SET_SPLIT_TRIGGERAXIS:
ProcessSetBooleanSetting(Request, DeviceInterfaceContext, WiimoteSettingsSetSplitTriggerAxis);
break;
case IOCTL_WIIMOTE_SET_MAP_TRIGGER_AS_AXIS:
ProcessSetBooleanSetting(Request, DeviceInterfaceContext, WiimoteSettingsSetMapTriggerAsAxis);
break;
case IOCTL_WIIMOTE_SET_MAP_TRIGGER_AS_BUTTONS:
ProcessSetBooleanSetting(Request, DeviceInterfaceContext, WiimoteSettingsSetMapTriggerAsButtons);
break;
default:
Trace("Devcice Interface recieved unknown IOCTL: %#010x", IoControlCode);
WdfRequestComplete(Request, STATUS_NOT_IMPLEMENTED);
}
}
VOID
ProcessGetState(
_In_ WDFREQUEST Request,
_In_ PDEVICE_INTERFACE_CONTEXT DeviceInterfaceContext
)
{
NTSTATUS Status = STATUS_SUCCESS;
PWIIMOTE_STATE_IOCTL_DATA StateData = NULL;
PWIIMOTE_DEVICE_CONTEXT WiimoteContext = &(DeviceInterfaceContext->Parent->WiimoteContext);
Trace("Processing IOCTL_WIIMOTE_GET_STATE");
Status = WdfRequestRetrieveOutputBuffer(Request, sizeof(WIIMOTE_STATE_IOCTL_DATA), &StateData, NULL);
if (!NT_SUCCESS(Status))
{
TraceStatus("Error retrieving State Buffer", Status);
WdfRequestComplete(Request, Status);
return;
}
FillStateIoControlData(StateData, WiimoteContext);
WdfRequestCompleteWithInformation(Request, STATUS_SUCCESS, sizeof(WIIMOTE_STATE_IOCTL_DATA));
}
VOID
ForwardReadStatusRequest(
_In_ WDFREQUEST Request,
_In_ PDEVICE_INTERFACE_CONTEXT DeviceInterfaceContext
)
{
ReadIoControlBufferForwardRequest(&DeviceInterfaceContext->ReadBuffer, Request);
}
VOID
DeviceInterfaceFillReadBufferCallback(
_In_ PDEVICE_CONTEXT DeviceContext,
_Inout_updates_all_(BufferSize) PVOID Buffer,
_In_ size_t BufferSize,
_Out_ PSIZE_T BytesWritten)
{
UNREFERENCED_PARAMETER(BufferSize);
FillStatusIoControlData((PWIIMOTE_STATUS_IOCTL_DATA)Buffer, &DeviceContext->WiimoteContext);
(*BytesWritten) = sizeof(WIIMOTE_STATUS_IOCTL_DATA);
}
VOID
FillStateIoControlData(
_In_ PWIIMOTE_STATE_IOCTL_DATA StateData,
_In_ PWIIMOTE_DEVICE_CONTEXT WiimoteContext
)
{
RtlZeroMemory(StateData, sizeof(WIIMOTE_STATE_IOCTL_DATA));
StateData->Settings = WiimoteContext->Settings;
FillStatusIoControlData(&(StateData->Status), WiimoteContext);
}
VOID
FillStatusIoControlData(
_In_ PWIIMOTE_STATUS_IOCTL_DATA StatusData,
_In_ PWIIMOTE_DEVICE_CONTEXT WiimoteContext
)
{
RtlZeroMemory(StatusData, sizeof(WIIMOTE_STATUS_IOCTL_DATA));
StatusData->Extension = WiimoteContext->Extension;
StatusData->BatteryLevel = WiimoteContext->BatteryLevel;
StatusData->LEDs = WiimoteContext->LEDState;
}
VOID ProcessSetDriverModeSetting(
_In_ WDFREQUEST Request,
_In_ PDEVICE_INTERFACE_CONTEXT DeviceInterfaceContext,
_In_ DRIVER_MODE_SETTING_SETTER DriverModeSettingSetter
)
{
NTSTATUS Status;
PWIIMOTE_DRIVER_MODE RequestedMode;
Status = WdfRequestRetrieveInputBuffer(Request, sizeof(WIIMOTE_DRIVER_MODE), &RequestedMode, NULL);
if (!NT_SUCCESS(Status))
{
TraceStatus("Error retrieving Driver Mode Io Control Mode Input Buffer", Status);
WdfRequestComplete(Request, Status);
return;
}
DriverModeSettingSetter(DeviceInterfaceContext->Parent, *RequestedMode);
WdfRequestCompleteWithInformation(Request, STATUS_SUCCESS, sizeof(WIIMOTE_DRIVER_MODE));
}
VOID ProcessSetBooleanSetting(
_In_ WDFREQUEST Request,
_In_ PDEVICE_INTERFACE_CONTEXT DeviceInterfaceContext,
_In_ BOOLEAN_SETTING_SETTER BooleanSettingSetter
)
{
NTSTATUS Status;
PBOOLEAN RequestedValue;
Status = WdfRequestRetrieveInputBuffer(Request, sizeof(BOOLEAN), &RequestedValue, NULL);
if (!NT_SUCCESS(Status))
{
TraceStatus("Error retrieving Driver Mode Io Control Mode Input Buffer", Status);
WdfRequestComplete(Request, Status);
return;
}
BooleanSettingSetter(DeviceInterfaceContext->Parent, *RequestedValue);
WdfRequestCompleteWithInformation(Request, STATUS_SUCCESS, sizeof(BOOLEAN));
}
================================================
FILE: HID Wiimote/DeviceInterface.h
================================================
/*
Copyright (C) 2017 Julian Lhr
All rights reserved.
Filename:
DeviceInterface.h
Abstract:
Header file for DeviceInterface.c
*/
#pragma once
#include "HIDWiimote.h"
#include "ReadIoControlBuffer.h"
typedef struct _DEVICE_INTERFACE_CONTEXT
{
WDFDEVICE InterfaceDevice;
PDEVICE_CONTEXT Parent;
WDFQUEUE DefaultIOQueue;
READ_IO_CONTROL_BUFFER ReadBuffer;
} DEVICE_INTERFACE_CONTEXT, * PDEVICE_INTERFACE_CONTEXT;
NTSTATUS DeviceInterfaceCreate(_In_ PDEVICE_CONTEXT ParentDeviceContext);
NTSTATUS DeviceInterfaceRelease(_In_ PDEVICE_INTERFACE_CONTEXT DeviceInterfaceContext);
VOID DeviceInterfaceWiimoteStateUpdated(_In_ PDEVICE_CONTEXT DeviceContext);
================================================
FILE: HID Wiimote/DeviceInterfacePublic.h
================================================
/*
Copyright (C) 2017 Julian Lhr
All rights reserved.
Filename:
DeviceInterfacePublic.h
Abstract:
Shared types and values for the Device Interface, provided by the driver and used by the user mode dll.
*/
#pragma once
#include <initguid.h>
// {8259315A-7B87-4D02-83A3-20CBCDAD7647}
DEFINE_GUID(GUID_DEVINTERFACE_HIDWIIMOTE,
0x8259315a, 0x7b87, 0x4d02, 0x83, 0xa3, 0x20, 0xcb, 0xcd, 0xad, 0x76, 0x47);
// IOCTLs
// 0x00-0x7FF (0-2047) reserved, 0x800-0xFFF (2048-4095) for custom use
#define FUNCTION_CODE(base, id) (0x800 | base | id)
#define HID_WIIMOTE_CTL_CODE(base, id) CTL_CODE(FILE_DEVICE_KEYBOARD, FUNCTION_CODE(base, id), METHOD_NEITHER, FILE_ANY_ACCESS)
#define HID_WIIMOTE_BUFFERED_CTL_CODE(base, id) CTL_CODE(FILE_DEVICE_KEYBOARD, FUNCTION_CODE(base, id), METHOD_BUFFERED, FILE_ANY_ACCESS)
// Device
#define DEVICE_IOCTL_BASE 0x000
#define IOCTL_WIIMOTE_GET_STATE HID_WIIMOTE_BUFFERED_CTL_CODE(DEVICE_IOCTL_BASE, 0x01)
#define IOCTL_WIIMOTE_READ_STATUS HID_WIIMOTE_BUFFERED_CTL_CODE(DEVICE_IOCTL_BASE, 0x02)
// Settings
#define SETTINGS_IOCTL_BASE 0x100
#define IOCTL_WIIMOTE_SET_MODE HID_WIIMOTE_BUFFERED_CTL_CODE(SETTINGS_IOCTL_BASE, 0x01)
#define IOCTL_WIIMOTE_SET_ENABLE_WIIMOTE_XAXIS_ACCELEROMETER HID_WIIMOTE_BUFFERED_CTL_CODE(SETTINGS_IOCTL_BASE, 0x02)
#define IOCTL_WIIMOTE_SET_ENABLE_WIIMOTE_YAXIS_ACCELEROMETER HID_WIIMOTE_BUFFERED_CTL_CODE(SETTINGS_IOCTL_BASE, 0x03)
#define IOCTL_WIIMOTE_SET_SWITCH_MOUSEBUTTONS HID_WIIMOTE_BUFFERED_CTL_CODE(SETTINGS_IOCTL_BASE, 0x04)
#define IOCTL_WIIMOTE_SET_SWITCH_TRIGGERANDSHOULDER HID_WIIMOTE_BUFFERED_CTL_CODE(SETTINGS_IOCTL_BASE, 0x10)
#define IOCTL_WIIMOTE_SET_SPLIT_TRIGGERAXIS HID_WIIMOTE_BUFFERED_CTL_CODE(SETTINGS_IOCTL_BASE, 0x11)
#define IOCTL_WIIMOTE_SET_MAP_TRIGGER_AS_AXIS HID_WIIMOTE_BUFFERED_CTL_CODE(SETTINGS_IOCTL_BASE, 0x12)
#define IOCTL_WIIMOTE_SET_MAP_TRIGGER_AS_BUTTONS HID_WIIMOTE_BUFFERED_CTL_CODE(SETTINGS_IOCTL_BASE, 0x13)
// LEDs
#define WIIMOTE_LEDS_ONE (0x10)
#define WIIMOTE_LEDS_TWO (0x20)
#define WIIMOTE_LEDS_THREE (0x40)
#define WIIMOTE_LEDS_FOUR (0x80)
#define WIIMOTE_LEDS_ALL (WIIMOTE_LEDS_FOUR | WIIMOTE_LEDS_THREE | WIIMOTE_LEDS_TWO | WIIMOTE_LEDS_ONE)
// Enumerations
typedef enum _WIIMOTE_EXTENSION { None, Nunchuck, BalanceBoard, ClassicController, ClassicControllerPro, WiiUProController, Guitar } WIIMOTE_EXTENSION, *PWIIMOTE_EXTENSION;
typedef enum _WIIMOTE_DRIVER_MODE { Gamepad, PassThrough, IRMouse, DPadMouse, GamepadAndIRMouse } WIIMOTE_DRIVER_MODE, *PWIIMOTE_DRIVER_MODE;
// IOCTL data structs
typedef struct _WIIMOTE_SETTINGS
{
WIIMOTE_DRIVER_MODE Mode;
BOOLEAN EnableWiimoteXAxisAccelerometer;
BOOLEAN EnableWiimoteYAxisAcceleromenter;
BOOLEAN SwapMouseButtons;
BOOLEAN SwapTriggerAndShoulder;
BOOLEAN SplitTriggerAxis;
BOOLEAN MapTriggerAsAxis;
BOOLEAN MapTriggerAsButtons;
} WIIMOTE_SETTINGS, *PWIIMOTE_SETTINGS;
typedef struct _WIIMOTE_STATUS_IOCTL_DATA
{
UCHAR LEDs;
UCHAR BatteryLevel;
WIIMOTE_EXTENSION Extension;
} WIIMOTE_STATUS_IOCTL_DATA, *PWIIMOTE_STATUS_IOCTL_DATA;
typedef struct _WIIMOTE_STATE_IOCTL_DATA
{
WIIMOTE_SETTINGS Settings;
WIIMOTE_STATUS_IOCTL_DATA Status;
} WIIMOTE_STATE_IOCTL_DATA, *PWIIMOTE_STATE_IOCTL_DATA;
================================================
FILE: HID Wiimote/Driver.c
================================================
/*
Copyright (C) 2017 Julian Lhr
All rights reserved.
Filename:
Driver.c
Abstract:
Contains the entry code for the Kernel Mode driver.
*/
#include "Driver.h"
NTSTATUS
DriverEntry (
_In_ PDRIVER_OBJECT DriverObject,
_In_ PUNICODE_STRING RegistryPath
)
{
NTSTATUS Status = STATUS_SUCCESS;
WDF_DRIVER_CONFIG Config;
// Initialize Config
WDF_DRIVER_CONFIG_INIT(&Config, DeviceAdd);
// Create Driver Object
Status = WdfDriverCreate(DriverObject, RegistryPath, WDF_NO_OBJECT_ATTRIBUTES, &Config, WDF_NO_HANDLE);
return Status;
}
================================================
FILE: HID Wiimote/Driver.h
================================================
/*
Copyright (C) 2017 Julian Lhr
All rights reserved.
Filename:
Driver.h
Abstract:
Header file for Driver.c
*/
#pragma once
#include "HIDWiimote.h"
#include "Device.h"
DRIVER_INITIALIZE DriverEntry;
================================================
FILE: HID Wiimote/HID Wiimote.vcxproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Windows 10 Universal Debug|Win32">
<Configuration>Windows 10 Universal Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Windows 10 Universal Debug|x64">
<Configuration>Windows 10 Universal Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Windows 10 Universal Release|Win32">
<Configuration>Windows 10 Universal Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Windows 10 Universal Release|x64">
<Configuration>Windows 10 Universal Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Windows 10 Debug|Win32">
<Configuration>Windows 10 Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Windows 10 Release|Win32">
<Configuration>Windows 10 Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Windows 10 Debug|x64">
<Configuration>Windows 10 Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Windows 10 Release|x64">
<Configuration>Windows 10 Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{785D88E1-E758-4966-80FA-AEF74681FEF1}</ProjectGuid>
<TemplateGuid>{1bc93793-694f-48fe-9372-81e2b05556fd}</TemplateGuid>
<Configuration>Win8 Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Label="Globals">
<RootNamespace>HID_Wiimote</RootNamespace>
</PropertyGroup>
<PropertyGroup Label="PropertySheets">
<ConfigurationType>Driver</ConfigurationType>
<DriverType>KMDF</DriverType>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Windows 10 Debug|Win32'">
<TargetVersion>Windows10</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<SupportsPackaging>false</SupportsPackaging>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Debug|Win32'" Label="Configuration">
<TargetVersion>
</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<SupportsPackaging>false</SupportsPackaging>
<DriverTargetPlatform>Universal</DriverTargetPlatform>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Windows 10 Release|Win32'">
<TargetVersion>Windows10</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<SupportsPackaging>false</SupportsPackaging>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Release|Win32'" Label="Configuration">
<TargetVersion>
</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<SupportsPackaging>false</SupportsPackaging>
<DriverTargetPlatform>Universal</DriverTargetPlatform>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Windows 10 Debug|x64'">
<TargetVersion>Windows10</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<SupportsPackaging>false</SupportsPackaging>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Debug|x64'" Label="Configuration">
<TargetVersion>
</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<SupportsPackaging>false</SupportsPackaging>
<DriverTargetPlatform>Universal</DriverTargetPlatform>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Windows 10 Release|x64'">
<TargetVersion>Windows10</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<SupportsPackaging>false</SupportsPackaging>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Release|x64'" Label="Configuration">
<TargetVersion>
</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>WindowsKernelModeDriver10.0</PlatformToolset>
<SupportsPackaging>false</SupportsPackaging>
<DriverTargetPlatform>Universal</DriverTargetPlatform>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Windows 10 Release|x64'">
<Import Project="..\ReleaseVersioning\Version.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Windows 10 Release|Win32'">
<Import Project="..\ReleaseVersioning\Version.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Release|x64'">
<Import Project="..\ReleaseVersioning\Version.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Release|Win32'">
<Import Project="..\ReleaseVersioning\Version.props" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Debug|Win32'">
<OutDir>$(SolutionDir)$(PlatformShortName)\$(ConfigurationName)\</OutDir>
<IntDir>$(PlatformShortName)\$(ConfigurationName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Debug|Win32'">
<OutDir>$(SolutionDir)$(PlatformShortName)\$(ConfigurationName)\</OutDir>
<IntDir>$(PlatformShortName)\$(ConfigurationName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Release|Win32'">
<OutDir>$(SolutionDir)$(PlatformShortName)\$(ConfigurationName)\</OutDir>
<IntDir>$(PlatformShortName)\$(ConfigurationName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Release|Win32'">
<OutDir>$(SolutionDir)$(PlatformShortName)\$(ConfigurationName)\</OutDir>
<IntDir>$(PlatformShortName)\$(ConfigurationName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Windows 10 Debug|Win32'">%(AdditionalDependencies);$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Debug|Win32'">%(AdditionalDependencies);$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Windows 10 Release|Win32'">%(AdditionalDependencies);$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Release|Win32'">%(AdditionalDependencies);$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Windows 10 Debug|x64'">%(AdditionalDependencies);$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Debug|x64'">%(AdditionalDependencies);$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Windows 10 Release|x64'">%(AdditionalDependencies);$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib</AdditionalDependencies>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Release|x64'">%(AdditionalDependencies);$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib</AdditionalDependencies>
</Link>
<Inf>
<TimeStamp Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Release|x64'">$(DeviceDriverVersion)</TimeStamp>
</Inf>
<Inf>
<TimeStamp Condition="'$(Configuration)|$(Platform)'=='Windows 10 Universal Release|Win32'">$(DeviceDriverVersion)</TimeStamp>
</Inf>
<Inf>
<TimeStamp Condition="'$(Configuration)|$(Platform)'=='Windows 10 Release|x64'">$(DeviceDriverVersion)</TimeStamp>
</Inf>
<Inf>
<TimeStamp Condition="'$(Configuration)|$(Platform)'=='Windows 10 Release|Win32'">$(DeviceDriverVersion)</TimeStamp>
</Inf>
<DriverSign>
<FileDigestAlgorithm Condition="'$(Configuration)|$(Platform)'=='Windows 10 Debug|Win32'">SHA256</FileDigestAlgorithm>
</DriverSign>
<DriverSign>
<FileDigestAlgorithm Condition="'$(Configuration)|$(Platform)'=='Windows 10 Release|Win32'">SHA256</FileDigestAlgorithm>
</DriverSign>
<DriverSign>
<FileDigestAlgorithm Condition="'$(Configuration)|$(Platform)'=='Windows 10 Debug|x64'">SHA256</FileDigestAlgorithm>
</DriverSign>
<DriverSign>
<FileDigestAlgorithm Condition="'$(Configuration)|$(Platform)'=='Windows 10 Release|x64'">SHA256</FileDigestAlgorithm>
</DriverSign>
</ItemDefinitionGroup>
<ItemGroup>
<Inf Include="HIDWiimote.inf" />
</ItemGroup>
<ItemGroup>
<FilesToPackage Include="$(TargetPath)" />
<FilesToPackage Include="@(Inf->'%(CopyOutput)')" Condition="'@(Inf)'!=''" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Bluetooth.c" />
<ClCompile Include="Device.c" />
<ClCompile Include="DeviceInterface.c" />
<ClCompile Include="Driver.c" />
<ClCompile Include="HID.c" />
<ClCompile Include="HIDDescriptors.c" />
<ClCompile Include="ReadIoControlBuffer.c" />
<ClCompile Include="Trace.c" />
<ClCompile Include="Wiimote.c" />
<ClCompile Include="WiimoteSettings.c" />
<ClCompile Include="WiimoteState.c" />
<ClCompile Include="WiimoteToHIDParser.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Bluetooth.h" />
<ClInclude Include="Device.h" />
<ClInclude Include="DeviceInterface.h" />
<ClInclude Include="DeviceInterfacePublic.h" />
<ClInclude Include="Driver.h" />
<ClInclude Include="HID.h" />
<ClInclude Include="HIDDescriptors.h" />
<ClInclude Include="HIDWiimote.h" />
<ClInclude Include="ReadIoControlBuffer.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="Trace.h" />
<ClInclude Include="Wiimote.h" />
<ClInclude Include="WiimoteSettings.h" />
<ClInclude Include="WiimoteState.h" />
<ClInclude Include="WiimoteToHIDParser.h" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="HID Wiimote.rc" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
================================================
FILE: HID Wiimote/HID Wiimote.vcxproj.backup
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Win8 Debug|Win32">
<Configuration>Win8 Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win8 Release|Win32">
<Configuration>Win8 Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win7 Debug|Win32">
<Configuration>Win7 Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win7 Release|Win32">
<Configuration>Win7 Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Vista Debug|Win32">
<Configuration>Vista Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Vista Release|Win32">
<Configuration>Vista Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win8 Debug|x64">
<Configuration>Win8 Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win8 Release|x64">
<Configuration>Win8 Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win7 Debug|x64">
<Configuration>Win7 Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Win7 Release|x64">
<Configuration>Win7 Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Vista Debug|x64">
<Configuration>Vista Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Vista Release|x64">
<Configuration>Vista Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{785D88E1-E758-4966-80FA-AEF74681FEF1}</ProjectGuid>
<TemplateGuid>{1bc93793-694f-48fe-9372-81e2b05556fd}</TemplateGuid>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
<Configuration>Win8 Debug</Configuration>
<Platform Condition="'$(Platform)' == ''">Win32</Platform>
</PropertyGroup>
<PropertyGroup Label="Globals">
<RootNamespace>HID_Wiimote</RootNamespace>
<VCTargetsPath Condition="'$(VCTargetsPath11)' != '' and '$(VisualStudioVersion)' == '11.0'">$(VCTargetsPath11)</VCTargetsPath>
</PropertyGroup>
<PropertyGroup Label="PropertySheets">
<PlatformToolset>WindowsKernelModeDriver8.0</PlatformToolset>
<ConfigurationType>Driver</ConfigurationType>
<DriverType>KMDF</DriverType>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|Win32'" Label="Configuration">
<TargetVersion>Windows8</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Release|Win32'" Label="Configuration">
<TargetVersion>Windows8</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Debug|Win32'" Label="Configuration">
<TargetVersion>Windows7</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Release|Win32'" Label="Configuration">
<TargetVersion>Windows7</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Vista Debug|Win32'" Label="Configuration">
<TargetVersion>Vista</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Vista Release|Win32'" Label="Configuration">
<TargetVersion>Vista</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|x64'" Label="Configuration">
<TargetVersion>Windows8</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Release|x64'" Label="Configuration">
<TargetVersion>Windows8</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Debug|x64'" Label="Configuration">
<TargetVersion>Windows7</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Release|x64'" Label="Configuration">
<TargetVersion>Windows7</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Vista Debug|x64'" Label="Configuration">
<TargetVersion>Vista</TargetVersion>
<UseDebugLibraries>true</UseDebugLibraries>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Vista Release|x64'" Label="Configuration">
<TargetVersion>Vista</TargetVersion>
<UseDebugLibraries>false</UseDebugLibraries>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Vista Debug|Win32'">
<OutDir>$(SolutionDir)$(PlatformShortName)\$(ConfigurationName)\</OutDir>
<IntDir>$(PlatformShortName)\$(ConfigurationName)\</IntDir>
</PropertyGroup>
<PropertyGroup>
<DebuggerFlavor>DbgengKernelDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|Win32'">
<OutDir>$(SolutionDir)$(PlatformShortName)\$(ConfigurationName)\</OutDir>
<IntDir>$(PlatformShortName)\$(ConfigurationName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Vista Release|Win32'">
<OutDir>$(SolutionDir)$(PlatformShortName)\$(ConfigurationName)\</OutDir>
<IntDir>$(PlatformShortName)\$(ConfigurationName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Debug|Win32'">
<OutDir>$(SolutionDir)$(PlatformShortName)\$(ConfigurationName)\</OutDir>
<IntDir>$(PlatformShortName)\$(ConfigurationName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win7 Release|Win32'">
<OutDir>$(SolutionDir)$(PlatformShortName)\$(ConfigurationName)\</OutDir>
<IntDir>$(PlatformShortName)\$(ConfigurationName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Win8 Release|Win32'">
<OutDir>$(SolutionDir)$(PlatformShortName)\$(ConfigurationName)\</OutDir>
<IntDir>$(PlatformShortName)\$(ConfigurationName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
<WppEnabled>true</WppEnabled>
<WppScanConfigurationData Condition="'%(ClCompile. ScanConfigurationData)' == ''">trace.h</WppScanConfigurationData>
<WppKernelMode>true</WppKernelMode>
</ClCompile>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|Win32'">%(AdditionalDependencies);$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Vista Debug|Win32'">%(AdditionalDependencies);$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Vista Release|Win32'">%(AdditionalDependencies);$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Win7 Debug|Win32'">%(AdditionalDependencies);$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Win7 Release|Win32'">%(AdditionalDependencies);$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Win8 Release|Win32'">%(AdditionalDependencies);$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Vista Debug|x64'">%(AdditionalDependencies);$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Win8 Debug|x64'">%(AdditionalDependencies);$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Vista Release|x64'">%(AdditionalDependencies);$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Win7 Debug|x64'">%(AdditionalDependencies);$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Win7 Release|x64'">%(AdditionalDependencies);$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib</AdditionalDependencies>
</Link>
<Link>
<AdditionalDependencies Condition="'$(Configuration)|$(Platform)'=='Win8 Release|x64'">%(AdditionalDependencies);$(DDK_LIB_PATH)\hidclass.lib;$(DDK_LIB_PATH)\ntstrsafe.lib</AdditionalDependencies>
<ShowProgress Condition="'$(Configuration)|$(Platform)'=='Win8 Release|x64'">NotSet</ShowProgress>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Inf Include="HIDWiimote.inf" />
</ItemGroup>
<ItemGroup>
<FilesToPackage Include="$(TargetPath)" />
<FilesToPackage Include="@(Inf->'%(CopyOutput)')" Condition="'@(Inf)'!=''" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="Bluetooth.c" />
<ClCompile Include="Device.c" />
<ClCompile Include="Driver.c" />
<ClCompile Include="HID.c" />
<ClCompile Include="HIDDescriptors.c" />
<ClCompile Include="Trace.c" />
<ClCompile Include="Wiimote.c" />
<ClCompile Include="WiimoteToHIDParser.c" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Bluetooth.h" />
<ClInclude Include="Device.h" />
<ClInclude Include="Driver.h" />
<ClInclude Include="HID.h" />
<ClInclude Include="HIDDescriptors.h" />
<ClInclude Include="HIDWiimote.h" />
<ClInclude Include="Trace.h" />
<ClInclude Include="Wiimote.h" />
<ClInclude Include="WiimoteToHIDParser.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
================================================
FILE: HID Wiimote/HID Wiimote.vcxproj.filters
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
<Filter Include="Driver Files">
<UniqueIdentifier>{8E41214B-6785-4CFE-B992-037D68949A14}</UniqueIdentifier>
<Extensions>inf;inv;inx;mof;mc;</Extensions>
</Filter>
<Filter Include="Device">
<UniqueIdentifier>{5159a567-d541-480d-953f-e3c93dffcaa2}</UniqueIdentifier>
</Filter>
<Filter Include="Bluetooth">
<UniqueIdentifier>{c20eef7d-9f93-4c18-9f99-bfb2145ed4a5}</UniqueIdentifier>
</Filter>
<Filter Include="Wiimote">
<UniqueIdentifier>{ec536e52-2b68-45dd-a902-0321278a5e69}</UniqueIdentifier>
</Filter>
<Filter Include="HID">
<UniqueIdentifier>{90c8726a-976d-46bc-ac3c-1b98dbd789d8}</UniqueIdentifier>
</Filter>
<Filter Include="Driver">
<UniqueIdentifier>{5a23eaec-7eab-4ec8-a970-9d4d31de22de}</UniqueIdentifier>
</Filter>
<Filter Include="Utilities">
<UniqueIdentifier>{a11a5e1a-29a3-478a-a65f-6a59c0e0acf7}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<Inf Include="HIDWiimote.inf">
<Filter>Driver Files</Filter>
</Inf>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Device.c">
<Filter>Device</Filter>
</ClCompile>
<ClCompile Include="Bluetooth.c">
<Filter>Bluetooth</Filter>
</ClCompile>
<ClCompile Include="Wiimote.c">
<Filter>Wiimote</Filter>
</ClCompile>
<ClCompile Include="HID.c">
<Filter>HID</Filter>
</ClCompile>
<ClCompile Include="HIDDescriptors.c">
<Filter>HID</Filter>
</ClCompile>
<ClCompile Include="WiimoteToHIDParser.c">
<Filter>HID</Filter>
</ClCompile>
<ClCompile Include="Driver.c">
<Filter>Driver</Filter>
</ClCompile>
<ClCompile Include="Trace.c">
<Filter>Utilities</Filter>
</ClCompile>
<ClCompile Include="DeviceInterface.c">
<Filter>Device</Filter>
</ClCompile>
<ClCompile Include="ReadIoControlBuffer.c">
<Filter>Utilities</Filter>
</ClCompile>
<ClCompile Include="WiimoteSettings.c">
<Filter>Wiimote</Filter>
</ClCompile>
<ClCompile Include="WiimoteState.c">
<Filter>Wiimote</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="Device.h">
<Filter>Device</Filter>
</ClInclude>
<ClInclude Include="Bluetooth.h">
<Filter>Bluetooth</Filter>
</ClInclude>
<ClInclude Include="Wiimote.h">
<Filter>Wiimote</Filter>
</ClInclude>
<ClInclude Include="HIDDescriptors.h">
<Filter>HID</Filter>
</ClInclude>
<ClInclude Include="HID.h">
<Filter>HID</Filter>
</ClInclude>
<ClInclude Include="WiimoteToHIDParser.h">
<Filter>HID</Filter>
</ClInclude>
<ClInclude Include="Driver.h">
<Filter>Driver</Filter>
</ClInclude>
<ClInclude Include="HIDWiimote.h">
<Filter>Driver</Filter>
</ClInclude>
<ClInclude Include="Trace.h">
<Filter>Utilities</Filter>
</ClInclude>
<ClInclude Include="resource.h">
<Filter>Utilities</Filter>
</ClInclude>
<ClInclude Include="DeviceInterface.h">
<Filter>Device</Filter>
</ClInclude>
<ClInclude Include="ReadIoControlBuffer.h">
<Filter>Utilities</Filter>
</ClInclude>
<ClInclude Include="WiimoteSettings.h">
<Filter>Wiimote</Filter>
</ClInclude>
<ClInclude Include="WiimoteState.h">
<Filter>Wiimote</Filter>
</ClInclude>
<ClInclude Include="DeviceInterfacePublic.h">
<Filter>Device</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="HID Wiimote.rc">
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>
================================================
FILE: HID Wiimote/HID.c
================================================
/*
Copyright (C) 2017 Julian Lhr
All rights reserved.
Filename:
HID.c
Abstract:
Contains IOQueues and HID specific functions.
Handles all HID Requests and translates the Wiimote State into HID reports.
*/
#include "HID.h"
#include "Device.h"
#include "Bluetooth.h"
#include "HIDDescriptors.h"
#include "WiimoteToHIDParser.h"
EVT_WDF_IO_QUEUE_IO_INTERNAL_DEVICE_CONTROL HIDInternalDeviceControlCallback;
EVT_READ_IO_CONTROL_BUFFER_FILL_BUFFER HIDFillReadBufferCallback;
VOID ProcessGetDeviceDescriptor(_In_ WDFREQUEST Request);
VOID ProcessGetReportDescriptor(_In_ WDFREQUEST Request);
VOID ProcessGetDeviceAttributes(_In_ WDFREQUEST Request,_In_ PHID_DEVICE_CONTEXT HIDContext);
VOID ProcessGetString(_In_ WDFREQUEST Request, _In_ PDEVICE_CONTEXT DeviceContext);
VOID ForwardReadReportRequest(_In_ WDFREQUEST Request, _In_ PDEVICE_CONTEXT DeviceContext);
VOID ProcessAddresses(_In_ WDFREQUEST Request, _In_ PDEVICE_CONTEXT DeviceContext);
NTSTATUS HIDPrepare(
_In_ PDEVICE_CONTEXT DeviceContext
)
{
NTSTATUS Status = STATUS_SUCCESS;
Status = GetVendorAndProductID(DeviceContext->IoTarget, &(DeviceContext->HIDContext.VendorID), &(DeviceContext->HIDContext.ProductID));
if(!NT_SUCCESS(Status))
{
return Status;
}
return Status;
}
NTSTATUS
HIDCreateQueues(
_In_ WDFDEVICE Device,
_In_ PDEVICE_CONTEXT DeviceContext
)
{
NTSTATUS Status;
WDF_IO_QUEUE_CONFIG QueueConfig;
PHID_DEVICE_CONTEXT HIDContext = &DeviceContext->HIDContext;
// Create Default Queue
WDF_IO_QUEUE_CONFIG_INIT_DEFAULT_QUEUE(&QueueConfig, WdfIoQueueDispatchParallel);
QueueConfig.EvtIoInternalDeviceControl = HIDInternalDeviceControlCallback;
Status = WdfIoQueueCreate(Device, &QueueConfig, WDF_NO_OBJECT_ATTRIBUTES, &(HIDContext->DefaultIOQueue));
if(!NT_SUCCESS(Status))
{
TraceStatus("Creating DefaultIOQueue failed", Status);
return Status;
}
// Create Read Buffer Queue
Status = ReadIoControlBufferCreate(&HIDContext->ReadBuffer, DeviceContext->Device, DeviceContext, HIDFillReadBufferCallback, sizeof(HID_GAMEPAD_REPORT));
if (!NT_SUCCESS(Status))
{
TraceStatus("Creating HID Read Buffer failed", Status);
return Status;
}
return Status;
}
PHID_DEVICE_CONTEXT
GetHIDContext(
_In_ WDFQUEUE Queue
)
{
return &(GetDeviceContext(WdfIoQueueGetDevice(Queue))->HIDContext);
}
VOID
HIDInternalDeviceControlCallback(
_In_ WDFQUEUE Queue,
_In_ WDFREQUEST Request,
_In_ size_t OutputBufferLength,
_In_ size_t InputBufferLength,
_In_ ULONG IoControlCode
)
{
UNREFERENCED_PARAMETER(Queue);
UNREFERENCED_PARAMETER(OutputBufferLength);
UNREFERENCED_PARAMETER(InputBufferLength);
switch(IoControlCode)
{
case IOCTL_HID_GET_DEVICE_DESCRIPTOR:
ProcessGetDeviceDescriptor(Request);
break;
case IOCTL_HID_GET_DEVICE_ATTRIBUTES:
ProcessGetDeviceAttributes(Request, GetHIDContext(Queue));
break;
case IOCTL_HID_GET_REPORT_DESCRIPTOR:
ProcessGetReportDescriptor(Request);
break;
case IOCTL_HID_GET_STRING:
ProcessGetString(Request, GetDeviceContext(WdfIoQueueGetDevice(Queue)));
break;
case IOCTL_HID_READ_REPORT:
ForwardReadReportRequest(Request, GetDeviceContext(WdfIoQueueGetDevice(Queue)));
break;
case IOCTL_WIIMOTE_ADDRESSES:
ProcessAddresses(Request, GetDeviceContext(WdfIoQueueGetDevice(Queue)));
break;
default:
Trace("Unknown IOCTL: %x", IoControlCode);
WdfRequestComplete(Request, STATUS_NOT_SUPPORTED);
}
}
VOID
ProcessGetDeviceDescriptor(
_In_ WDFREQUEST Request
)
{
NTSTATUS Status;
WDFMEMORY Memory;
// Get Memory
Status = WdfRequestRetrieveOutputMemory(Request, &Memory);
if(!NT_SUCCESS(Status))
{
WdfRequestComplete(Request, Status);
return;
}
// Copy
Status = WdfMemoryCopyFromBuffer(Memory, 0, (PVOID)&HIDDescriptor, HIDDescriptor.bLength);
if(!NT_SUCCESS(Status))
{
WdfRequestComplete(Request, Status);
return;
}
// Complete Request
WdfRequestCompleteWithInformation(Request, Status, HIDDescriptor.bLength);
}
VOID
ProcessGetDeviceAttributes(
_In_ WDFREQUEST Request,
_In_ PHID_DEVICE_CONTEXT HIDContext
)
{
NTSTATUS Status;
PHID_DEVICE_ATTRIBUTES DeviceAttributes = NULL;
size_t DeviceAttributesSize = sizeof(HID_DEVICE_ATTRIBUTES);
// Get Buffer
Status = WdfRequestRetrieveOutputBuffer(Request, DeviceAttributesSize, (PVOID *)&DeviceAttributes, NULL);
if(!NT_SUCCESS(Status))
{
WdfRequestComplete(Request, Status);
return;
}
// Fill out
DeviceAttributes->Size = (ULONG)DeviceAttributesSize;
DeviceAttributes->VendorID = HIDContext->VendorID;
DeviceAttributes->ProductID = HIDContext->ProductID;
DeviceAttributes->VersionNumber = 0x0000;
// Complete Request
WdfRequestCompleteWithInformation(Request, Status, DeviceAttributesSize);
}
VOID
ProcessGetReportDescriptor(
_In_ WDFREQUEST Request
)
{
NTSTATUS Status;
WDFMEMORY Memory;
size_t ReportDescriptorSize = HIDReportDescriptorSize;
// Get Memory
Status = WdfRequestRetrieveOutputMemory(Request, &Memory);
if(!NT_SUCCESS(Status))
{
WdfRequestComplete(Request, Status);
return;
}
// Copy
Status = WdfMemoryCopyFromBuffer(Memory, 0, (PVOID)&HIDReportDescriptor, ReportDescriptorSize);
if(!NT_SUCCESS(Status))
{
WdfRequestComplete(Request, Status);
return;
}
// Complete Request
WdfRequestCompleteWithInformation(Request, Status, ReportDescriptorSize);
}
VOID ProcessGetString(
_In_ WDFREQUEST Request,
_In_ PDEVICE_CONTEXT DeviceContext
)
{
NTSTATUS Status;
WDF_REQUEST_PARAMETERS Parameters;
WDFMEMORY Memory;
PUNICODE_STRING String = NULL;
WDF_REQUEST_PARAMETERS_INIT(&Parameters);
WdfRequestGetParameters(Request, &Parameters);
Status = WdfRequestRetrieveOutputMemory(Request, &Memory);
if (!NT_SUCCESS(Status))
{
WdfRequestComplete(Request, Status);
return;
}
switch (((UINT_PTR)Parameters.Parameters.DeviceIoControl.Type3InputBuffer) & 0xFF)
{
case HID_STRING_ID_IPRODUCT:
String = &DeviceContext->BluetoothContext.DeviceNameString;
break;
case HID_STRING_ID_IMANUFACTURER:
WdfRequestComplete(Request, STATUS_NOT_SUPPORTED);
return;
case HID_STRING_ID_ISERIALNUMBER:
String = &DeviceContext->BluetoothContext.DeviceAddressString;
break;
}
Status = WdfMemoryCopyFromBuffer(Memory, 0, (PVOID)String->Buffer, String->MaximumLength);
if (!NT_SUCCESS(Status))
{
WdfRequestComplete(Request, Status);
return;
}
// Complete Request
WdfRequestCompleteWithInformation(Request, Status, String->MaximumLength);
}
VOID
ForwardReadReportRequest(
_In_ WDFREQUEST Request,
_In_ PDEVICE_CONTEXT DeviceContext
)
{
ReadIoControlBufferForwardRequest(&DeviceContext->HIDContext.ReadBuffer, Request);
}
NTSTATUS
HIDRelease(
_In_ PDEVICE_CONTEXT DeviceContext
)
{
NTSTATUS Status = STATUS_SUCCESS;
PHID_DEVICE_CONTEXT HIDContext = &(DeviceContext->HIDContext);
ReadIoControlBufferFlush(&HIDContext->ReadBuffer);
return Status;
}
VOID
HIDFillReadBufferCallback(
_In_ PDEVICE_CONTEXT DeviceContext,
_Inout_updates_all_(BufferSize) PVOID Buffer,
_In_ size_t BufferSize,
_Out_ PSIZE_T BytesWritten)
{
PWIIMOTE_DEVICE_CONTEXT WiimoteContext = &(DeviceContext->WiimoteContext);
(*BytesWritten) = 0;
switch (WiimoteContext->Settings.Mode)
{
case Gamepad:
ParseWiimoteStateAsGamepad(WiimoteContext, Buffer, BufferSize, BytesWritten);
break;
case PassThrough:
break;
case IRMouse:
ParseWiimoteStateAsIRMouse(&(WiimoteContext->State), Buffer, BufferSize, BytesWritten);
break;
case DPadMouse:
ParseWiimoteStateAsDPadMouse(&(WiimoteContext->State), Buffer, BufferSize, BytesWritten);
break;
case GamepadAndIRMouse:
if (!DeviceContext->HIDContext.GamepadAndIRMouseReportToggleFlag)
{
ParseWiimoteStateAsIRMouse(&(WiimoteContext->State), Buffer, BufferSize, BytesWritten);
DeviceContext->HIDContext.GamepadAndIRMouseReportToggleFlag = !DeviceContext->HIDContext.GamepadAndIRMouseReportToggleFlag;
ReadIoControlBufferDispatchRequest(&(DeviceContext->HIDContext.ReadBuffer));
}
else
{
ParseWiimoteStateAsGamepad(WiimoteContext, Buffer, BufferSize, BytesWritten);
DeviceContext->HIDContext.GamepadAndIRMouseReportToggleFlag = !DeviceContext->HIDContext.GamepadAndIRMouseReportToggleFlag;
}
break;
}
}
VOID
HIDWiimoteStateUpdated(
_In_ PDEVICE_CONTEXT DeviceContext
)
{
ReadIoControlBufferDispatchRequest(&(DeviceContext->HIDContext.ReadBuffer));
}
VOID
ProcessAddresses(
_In_ WDFREQUEST Request,
_In_ PDEVICE_CONTEXT DeviceContext
)
{
NTSTATUS Status = STATUS_SUCCESS;
PHID_MINIPORT_ADDRESSES Addresses = NULL;
Trace("Adresses recieved");
Status = WdfRequestRetrieveInputBuffer(Request, sizeof(HID_MINIPORT_ADDRESSES), (PVOID *)&Addresses, NULL);
if(!NT_SUCCESS(Status))
{
TraceStatus("Couldn't retrieve Input Buffer", Status);
WdfRequestComplete(Request, STATUS_SUCCESS);
return;
}
SetHIDMiniportAddresses(DeviceContext, Addresses);
WdfRequestComplete(Request, STATUS_SUCCESS);
}
================================================
FILE: HID Wiimote/HID.h
================================================
/*
Copyright (C) 2017 Julian Lhr
All rights reserved.
Filename:
HID.h
Abstract:
Header file for HID.c
*/
#pragma once
#include "HIDWiimote.h"
#include <hidport.h>
#include "ReadIoControlBuffer.h"
typedef struct _HID_DEVICE_CONTEXT
{
WDFQUEUE DefaultIOQueue;
READ_IO_CONTROL_BUFFER ReadBuffer;
USHORT VendorID;
USHORT ProductID;
BOOLEAN GamepadAndIRMouseReportToggleFlag;
} HID_DEVICE_CONTEXT, * PHID_DEVICE_CONTEXT;
typedef UCHAR HID_REPORT_DESCRIPTOR, *PHID_REPORT_DESCRIPTOR;
NTSTATUS HIDPrepare(_In_ PDEVICE_CONTEXT DeviceContext);
NTSTATUS HIDCreateQueues(_In_ WDFDEVICE Device, _In_ PDEVICE_CONTEXT DeviceContext);
NTSTATUS HIDRelease(_In_ PDEVICE_CONTEXT DeviceContext);
VOID HIDWiimoteStateUpdated(_In_ PDEVICE_CONTEXT DeviceContext);
#define IOCTL_WIIMOTE_ADDRESSES CTL_CODE(FILE_DEVICE_KEYBOARD, 0x800, METHOD_BUFFERED, FILE_ANY_ACCESS)
================================================
FILE: HID Wiimote/HIDDescriptors.c
================================================
/*
Copyright (C) 2017 Julian Lhr
All rights reserved.
Filename:
HIDDescriptor.c
Abstract:
Contains the definition of several HID Descriptors
*/
#include "HIDDescriptors.h"
CONST HID_REPORT_DESCRIPTOR HIDReportDescriptor[] = {
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x05, // USAGE (Game Pad)
0xa1, 0x01, // COLLECTION (Application)
/*
|-----------------------------|
| Gamepad |
|-----------------------------|
|--------|-------|--------|-------|--------|-------|--------|-------|
| Report ID |
|--------|-------|--------|-------|--------|-------|--------|-------|
| X-Axis |
|--------|-------|--------|-------|--------|-------|--------|-------|
| Y-Axis |
|--------|-------|--------|-------|--------|-------|--------|-------|
| Button 1-8 |
|--------|-------|--------|-------|--------|-------|--------|-------|
| Button 9-13 |xxxxxxx Padding xxxxxxxx|
|--------|-------|--------|-------|--------|-------|--------|-------|
| Z-Axis |
|--------|-------|--------|-------|--------|-------|--------|-------|
| RX-Axis |
|--------|-------|--------|-------|--------|-------|--------|-------|
| RY-Axis |
|--------|-------|--------|-------|--------|-------|--------|-------|
| RZ-Axis |
|--------|-------|--------|-------|--------|-------|--------|-------|
| Hat Switch |
|--------|-------|--------|-------|--------|-------|--------|-------|
*/
0x85, GAMEPAD_REPORT_ID, // REPORT_ID (GAMEPAD_REPORT_ID)
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x30, // USAGE (X)
0x09, 0x31, // USAGE (Y)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x02, // REPORT_COUNT (2)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x05, 0x09, // USAGE_PAGE (Button)
0x19, 0x01, // USAGE_MINIMUM (Button 1)
0x29, 0x0D, // USAGE_MAXIMUM (Button 13)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x95, 0x0D, // REPORT_COUNT (13)
0x75, 0x01, // REPORT_SIZE (1)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x95, 0x01, // REPORT_COUNT (1)
0x75, 0x03, // REPORT_SIZE (3)
0x81, 0x03, // INPUT (Cnst,Var,Abs)
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x32, // USAGE (Z)
0x09, 0x33, // USAGE (RX)
0x09, 0x34, // USAGE (RY)
0x09, 0x35, // USAGE (RZ)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x26, 0xFF, 0x00, // LOGICAL_MAXIMUM (255)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x04, // REPORT_COUNT (4)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x39, // USAGE (Hat Swtich)
0x15, 0x01, // LOGICAL_MINIMUM (1)
0x25, 0x08, // LOGICAL_MAXIMUM (8)
0x35, 0x00, // PHYSICAL_MINIMUM (0)
0x46, 0x3b, 0x01, // PHYSICAL_MAXIMUM (315)
0x55, 0x00, // UNIT_EXPONENT (0)
0x65, 0x14, // UNIT (English Rotation: Angular Position)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x01, // REPORT_COUNT (1)
0x81, 0x4a, // INPUT (Data,Var,Abs,Wrap,Null)
/*
|-----------------------------|
| Wiimote |
|-----------------------------|
*/
0xc0 // END_COLLECTION
/*
0x06, 0x00, 0xff, // USAGE_PAGE (Vendor Defined)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x91, 0x00, // OUTPUT (Data,Ary,Abs)
0x85, 0x11, // REPORT_ID (11)
0x95, 0x01, // REPORT_COUNT (1)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x91, 0x00, // OUTPUT (Data,Ary,Abs)
0x85, 0x12, // REPORT_ID (12)
0x95, 0x02, // REPORT_COUNT (2)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x91, 0x00, // OUTPUT (Data,Ary,Abs)
0x85, 0x13, // REPORT_ID (13)
0x95, 0x01, // REPORT_COUNT (1)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x91, 0x00, // OUTPUT (Data,Ary,Abs)
0x85, 0x14, // REPORT_ID (14)
0x95, 0x01, // REPORT_COUNT (1)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x91, 0x00, // OUTPUT (Data,Ary,Abs)
0x85, 0x15, // REPORT_ID (15)
0x95, 0x01, // REPORT_COUNT (1)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x91, 0x00, // OUTPUT (Data,Ary,Abs)
0x85, 0x16, // REPORT_ID (16)
0x95, 0x15, // REPORT_COUNT (21)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x91, 0x00, // OUTPUT (Data,Ary,Abs)
0x85, 0x17, // REPORT_ID (17)
0x95, 0x06, // REPORT_COUNT (6)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x91, 0x00, // OUTPUT (Data,Ary,Abs)
0x85, 0x18, // REPORT_ID (18)
0x95, 0x15, // REPORT_COUNT (21)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x91, 0x00, // OUTPUT (Data,Ary,Abs)
0x85, 0x19, // REPORT_ID (19)
0x95, 0x01, // REPORT_COUNT (1)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x91, 0x00, // OUTPUT (Data,Ary,Abs)
0x85, 0x1a, // REPORT_ID (1A)
0x95, 0x01, // REPORT_COUNT (1)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x91, 0x00, // OUTPUT (Data,Ary,Abs)
0x85, 0x20, // REPORT_ID (20)
0x95, 0x06, // REPORT_COUNT (6)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x81, 0x00, // INPUT (Data,Ary,Abs)
0x85, 0x21, // REPORT_ID (21)
0x95, 0x15, // REPORT_COUNT (21)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x81, 0x00, // INPUT (Data,Ary,Abs)
0x85, 0x22, // REPORT_ID (22)
0x95, 0x04, // REPORT_COUNT (4)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x81, 0x00, // INPUT (Data,Ary,Abs)
0x85, 0x30, // REPORT_ID (30)
0x95, 0x02, // REPORT_COUNT (2)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x81, 0x00, // INPUT (Data,Ary,Abs)
0x85, 0x31, // REPORT_ID (31)
0x95, 0x05, // REPORT_COUNT (5)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x81, 0x00, // INPUT (Data,Ary,Abs)
0x85, 0x32, // REPORT_ID (32)
0x95, 0x0a, // REPORT_COUNT (10)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x81, 0x00, // INPUT (Data,Ary,Abs)
0x85, 0x33, // REPORT_ID (33)
0x95, 0x11, // REPORT_COUNT (17)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x81, 0x00, // INPUT (Data,Ary,Abs)
0x85, 0x34, // REPORT_ID (34)
0x95, 0x15, // REPORT_COUNT (21)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x81, 0x00, // INPUT (Data,Ary,Abs)
0x85, 0x35, // REPORT_ID (35)
0x95, 0x15, // REPORT_COUNT (21)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x81, 0x00, // INPUT (Data,Ary,Abs)
0x85, 0x36, // REPORT_ID (36)
0x95, 0x15, // REPORT_COUNT (21)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x81, 0x00, // INPUT (Data,Ary,Abs)
0x85, 0x37, // REPORT_ID (37)
0x95, 0x15, // REPORT_COUNT (21)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x81, 0x00, // INPUT (Data,Ary,Abs)
0x85, 0x3d, // REPORT_ID (3D)
0x95, 0x15, // REPORT_COUNT (21)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x81, 0x00, // INPUT (Data,Ary,Abs)
0x85, 0x3e, // REPORT_ID (3E)
0x95, 0x15, // REPORT_COUNT (21)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x81, 0x00, // INPUT (Data,Ary,Abs)
0x85, 0x3f, // REPORT_ID (3F)
0x95, 0x15, // REPORT_COUNT (21)
0x09, 0x01, // USAGE (Vendor Ussage 1)
0x81, 0x00, // INPUT (Data,Ary,Abs)
0xc0, // END_COLLECTION
/*
|-----------------------------|
| IR-Mouse |
|-----------------------------|
|--------|-------|--------|-------|--------|-------|--------|-------|
| Report ID |
|--------|-------|--------|-------|--------|-------|--------|-------|
| Button 1-3 |xxxxxxxxxxxxxxxx Padding xxxxxxxxxxxxxxxx|
|--------|-------|--------|-------|--------|-------|--------|-------|
| X-Axis |
|--------|-------|--------|-------|--------|-------|--------|-------|
| X-Axis |
|--------|-------|--------|-------|--------|-------|--------|-------|
| Y-Axis |
|--------|-------|--------|-------|--------|-------|--------|-------|
| Y-Axis |
|--------|-------|--------|-------|--------|-------|--------|-------|
*/
/*
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x02, // USAGE (Mouse)
0xa1, 0x01, // COLLECTION (Application)
0x09, 0x01, // USAGE (Pointer)
0x85, IRMOUSE_REPORT_ID, // REPORT_ID (IRMOUSE_REPORT_ID)
0x05, 0x09, // USAGE_PAGE (Button)
0x19, 0x01, // USAGE_MINIMUM (Button 1)
0x29, 0x03, // USAGE_MAXIMUM (Button 3)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x95, 0x03, // REPORT_COUNT (3)
0x75, 0x01, // REPORT_SIZE (1)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x95, 0x01, // REPORT_COUNT (1)
0x75, 0x05, // REPORT_SIZE (5)
0x81, 0x03, // INPUT (Cnst,Var,Abs)
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x30, // USAGE (X)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x26, 0xFF, 0x03, // LOGICAL_MAXIMUM (1023)
0x75, 0x0B, // REPORT_SIZE (11)
0x95, 0x01, // REPORT_COUNT (1)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x95, 0x01, // REPORT_COUNT (1)
0x75, 0x05, // REPORT_SIZE (5)
0x81, 0x03, // INPUT (Cnst,Var,Abs)
0x09, 0x31, // USAGE (Y)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x26, 0xFF, 0x03, // LOGICAL_MAXIMUM (1023)
0x75, 0x0B, // REPORT_SIZE (11)
0x95, 0x01, // REPORT_COUNT (1)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x95, 0x01, // REPORT_COUNT (1)
0x75, 0x05, // REPORT_SIZE (5)
0x81, 0x03, // INPUT (Cnst,Var,Abs)
0xc0, // END_COLLECTION
/*
|-----------------------------|
| DPad-Mouse |
|-----------------------------|
|--------|-------|--------|-------|--------|-------|--------|-------|
| Report ID |
|--------|-------|--------|-------|--------|-------|--------|-------|
| Button 1-3 |xxxxxxxxxxxxxxxx Padding xxxxxxxxxxxxxxxx|
|--------|-------|--------|-------|--------|-------|--------|-------|
| X-Axis |
|--------|-------|--------|-------|--------|-------|--------|-------|
| Y-Axis |
|--------|-------|--------|-------|--------|-------|--------|-------|
|xxxxxxxxxxxxxxxxxxxxxxxxxxxxx Padding xxxxxxxxxxxxxxxxxxxxxxxxxxxx|
|--------|-------|--------|-------|--------|-------|--------|-------|
*/
/*
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x02, // USAGE (Mouse)
0xa1, 0x01, // COLLECTION (Application)
0x09, 0x01, // USAGE (Pointer)
0x85, DPADMOUSE_REPORT_ID, // REPORT_ID (DPADMOUSE_REPORT_ID)
0x05, 0x09, // USAGE_PAGE (Button)
0x19, 0x01, // USAGE_MINIMUM (Button 1)
0x29, 0x03, // USAGE_MAXIMUM (Button 3)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x95, 0x03, // REPORT_COUNT (3)
0x75, 0x01, // REPORT_SIZE (1)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x95, 0x01, // REPORT_COUNT (1)
0x75, 0x05, // REPORT_SIZE (5)
0x81, 0x03, // INPUT (Cnst,Var,Abs)
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x30, // USAGE (X)
0x09, 0x31, // USAGE (Y)
0x15, 0x81, // LOGICAL_MINIMUM (-127)
0x25, 0x7f, // LOGICAL_MAXIMUM (127)
0x75, 0x08, // REPORT_SIZE (8)
0x95, 0x02, // REPORT_COUNT (2)
0x81, 0x06, // INPUT (Data,Var,Rel)
0x95, 0x01, // REPORT_COUNT (1)
0x75, 0x08, // REPORT_SIZE (8)
0x81, 0x03, // INPUT (Cnst,Var,Abs)
0xc0 // END_COLLECTION
*/
};
CONST HID_DESCRIPTOR HIDDescriptor = {
0x09, // length of HID descriptor
0x21, // descriptor type == HID 0x21
0x0111, // hid spec release
0x00, // country code == Not Specified
0x01, // number of HID class descriptors
{
0x22, // descriptor type
sizeof(HIDReportDescriptor) // total length of report descriptor
}
};
CONST size_t HIDReportDescriptorSize = sizeof(HIDReportDescriptor);
================================================
FILE: HID Wiimote/HIDDescriptors.h
================================================
/*
Copyright (C) 2017 Julian Lhr
All rights reserved.
Filename:
HIDDescriptor.h
Abstract:
Common Header file.
Contains common includes and declarations.
*/
#pragma once
#include "HID.h"
#define GAMEPAD_REPORT_ID 0x01
#define IRMOUSE_REPORT_ID 0x02
#define DPADMOUSE_REPORT_ID 0x03
extern CONST HID_REPORT_DESCRIPTOR HIDReportDescriptor[];
extern CONST HID_DESCRIPTOR HIDDescriptor;
extern CONST size_t HIDReportDescriptorSize;
#pragma pack(push, 1)
typedef struct _HID_GAMEPAD_REPORT {
UCHAR ReportID;
UCHAR XAxis;
UCHAR YAxis;
UCHAR Buttons[2];
UCHAR ZAxis;
UCHAR RXAxis;
UCHAR RYAxis;
UCHAR RZAxis;
UCHAR Hatswitch;
} HID_GAMEPAD_REPORT, * PHID_GAMEPAD_REPORT;
VOID
FORCEINLINE
HID_GAMEPAD_REPORT_INIT(
_Out_ PHID_GAMEPAD_REPORT Report)
{
RtlZeroMemory(Report, sizeof(HID_GAMEPAD_REPORT));
Report->ReportID = GAMEPAD_REPORT_ID;
Report->XAxis = 0x7F;
Report->YAxis = 0x7F;
Report->ZAxis = 0x7F;
Report->RXAxis = 0x7F;
Report->RYAxis = 0x7F;
Report->RZAxis = 0x7F;
}
typedef struct _HID_IRMOUSE_REPORT
{
UCHAR ReportID;
UCHAR Buttons;
USHORT X;
USHORT Y;
} HID_IRMOUSE_REPORT, * PHID_IRMOUSE_REPORT;
VOID
FORCEINLINE
HID_IRMOUSE_REPORT_INIT(
_Out_ PHID_IRMOUSE_REPORT Report)
{
RtlZeroMemory(Report, sizeof(HID_IRMOUSE_REPORT));
Report->ReportID = IRMOUSE_REPORT_ID;
}
typedef struct _HID_DPADMOUSE_REPORT
{
UCHAR ReportID;
UCHAR Buttons;
UCHAR X;
UCHAR Y;
} HID_DPADMOUSE_REPORT, *PHID_DPADMOUSE_REPORT;
VOID
FORCEINLINE
HID_DPADMOUSE_REPORT_INIT(
_Out_ PHID_DPADMOUSE_REPORT Report)
{
RtlZeroMemory(Report, sizeof(HID_DPADMOUSE_REPORT));
Report->ReportID = DPADMOUSE_REPORT_ID;
}
#pragma pack(pop)
================================================
FILE: HID Wiimote/HIDWiimote.h
================================================
/*
Copyright (C) 2017 Julian Lhr
All rights reserved.
Filename:
HIDWiimote.h
Abstract:
Common Header file.
Contains common includes and declarations.
*/
#pragma once
#include <initguid.h>
#include <ntddk.h>
#include <wdf.h>
#include "Trace.h"
//#define MOUSE_DPAD
//#define MOUSE_IR
//Forward Declarations
typedef struct _DEVICE_CONTEXT DEVICE_CONTEXT, * PDEVICE_CONTEXT;
typedef struct _DEVICE_INTERFACE_CONTEXT DEVICE_INTERFACE_CONTEXT, *PDEVICE_INTERFACE_CONTEXT;
typedef struct _WIIMOTE_DEVICE_CONTEXT WIIMOTE_DEVICE_CONTEXT, * PWIIMOTE_DEVICE_CONTEXT;
typedef struct _BLUETOOTH_DEVICE_CONTEXT BLUETOOTH_DEVICE_CONTEXT, * PBLUETOOTH_DEVICE_CONTEXT;
typedef struct _HID_DEVICE_CONTEXT HID_DEVICE_CONTEXT, * PHID_DEVICE_CONTEXT;
// Used by HID Layer and Device Part
typedef NTSTATUS (*PNOTIFY_PRESENCE)(PDEVICE_OBJECT, BOOLEAN);
typedef struct _HID_MINIPORT_ADDRESSES
{
PDEVICE_OBJECT FDO;
PNOTIFY_PRESENCE HidNotifyPresence;
} HID_MINIPORT_ADDRESSES, * PHID_MINIPORT_ADDRESSES;
================================================
FILE: HID Wiimote/ReadIoControlBuffer.c
================================================
/*
Copyright (C) 2017 Julian Lhr
All rights reserved.
Filename:
ReadIoControlBuffer.c
Abstract:
A manual dispatch Queue to buffer read requests
*/
#include "ReadIoControlBuffer.h"
VOID
ReadIoControlBufferCompleteRequest(
_In_ PREAD_IO_CONTROL_BUFFER ReadIoControlBuffer,
_In_ WDFREQUEST Request
);
NTSTATUS
ReadIoControlBufferCreate(
_Inout_ PREAD_IO_CONTROL_BUFFER ReadIoControlBuffer,
_In_ WDFDEVICE ParentDevice,
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ PFN_READ_IO_CONTROL_BUFFER_FILL_BUFFER Callback,
_In_ size_t MinOutputBufferSize
)
{
NTSTATUS Status = STATUS_SUCCESS;
WDF_IO_QUEUE_CONFIG QueueConfig;
// Set up the Object
ReadIoControlBuffer->DeviceContext = DeviceContext;
ReadIoControlBuffer->Callback = Callback;
ReadIoControlBuffer->InstantCompletion = FALSE;
ReadIoControlBuffer->MinOutputBufferSize = MinOutputBufferSize;
// Create the WDF Queue
WDF_IO_QUEUE_CONFIG_INIT(&QueueConfig, WdfIoQueueDispatchManual);
QueueConfig.PowerManaged = WdfFalse;
Status = WdfIoQueueCreate(ParentDevice, &QueueConfig, WDF_NO_OBJECT_ATTRIBUTES, &(ReadIoControlBuffer->BufferQueue));
if (!NT_SUCCESS(Status))
{
TraceStatus("Failed to create Read IO Control Buffer Queue", Status);
return Status;
}
return Status;
}
VOID
ReadIoControlBufferFlush(
_In_ PREAD_IO_CONTROL_BUFFER ReadIoControlBuffer
)
{
NTSTATUS Status = STATUS_SUCCESS;
WDFREQUEST TmpRequest;
if (ReadIoControlBuffer->BufferQueue == NULL)
{
return;
}
while (NT_SUCCESS(Status = (WdfIoQueueRetrieveNextRequest(ReadIoControlBuffer->BufferQueue, &TmpRequest))))
{
WdfRequestComplete(TmpRequest, STATUS_DEVICE_REMOVED);
}
if (Status != STATUS_NO_MORE_ENTRIES)
{
TraceStatus("Something went wring while flushing a Read IO Control Buffer", Status);
}
}
VOID
ReadIoControlBufferForwardRequest(
_In_ PREAD_IO_CONTROL_BUFFER ReadIoControlBuffer,
_In_ WDFREQUEST Request
)
{
NTSTATUS Status = STATUS_SUCCESS;
if (ReadIoControlBuffer->InstantCompletion)
{
ReadIoControlBufferCompleteRequest(ReadIoControlBuffer, Request);
}
else
{
Status = WdfRequestForwardToIoQueue(Request, ReadIoControlBuffer->BufferQueue);
if (!NT_SUCCESS(Status))
{
WdfRequestComplete(Request, Status);
return;
}
}
}
VOID
ReadIoControlBufferCompleteRequest(
_In_ PREAD_IO_CONTROL_BUFFER ReadIoControlBuffer,
_In_ WDFREQUEST Request
)
{
NTSTATUS Status = STATUS_SUCCESS;
PVOID OutputBuffer;
size_t OutputBufferSize;
SIZE_T BytesWritten = 0;
ReadIoControlBuffer->InstantCompletion = FALSE;
Status = WdfRequestRetrieveOutputBuffer(Request, ReadIoControlBuffer->MinOutputBufferSize, &OutputBuffer, &OutputBufferSize);
if (!NT_SUCCESS(Status))
{
TraceStatus("Error retrieving Output Buffer from Read IO Control", Status);
WdfRequestComplete(Request, Status);
return;
}
ReadIoControlBuffer->Callback(ReadIoControlBuffer->DeviceContext, OutputBuffer, OutputBufferSize, &BytesWritten);
WdfRequestCompleteWithInformation(Request, Status, BytesWritten);
}
VOID
ReadIoControlBufferDispatchRequest(
_In_ PREAD_IO_CONTROL_BUFFER ReadIoControlBuffer
)
{
NTSTATUS Status = STATUS_SUCCESS;
WDFREQUEST Request;
Status = WdfIoQueueRetrieveNextRequest(ReadIoControlBuffer->BufferQueue, &Request);
if (NT_SUCCESS(Status))
{
ReadIoControlBufferCompleteRequest(ReadIoControlBuffer, Request);
}
else if (Status == STATUS_NO_MORE_ENTRIES)
{
ReadIoControlBuffer->InstantCompletion = TRUE;
}
}
================================================
FILE: HID Wiimote/ReadIoControlBuffer.h
================================================
/*
Copyright (C) 2017 Julian Lhr
All rights reserved.
Filename:
ReadIoControlBuffer.h
Abstract:
Header file for ReadIoControlBuffer.c
*/
#pragma once
#include "HIDWiimote.h"
typedef VOID EVT_READ_IO_CONTROL_BUFFER_FILL_BUFFER(_In_ PDEVICE_CONTEXT DeviceContext, _Inout_updates_all_(BufferSize) PVOID Buffer, _In_ size_t BufferSize, _Out_ PSIZE_T BytesWritten);
typedef EVT_READ_IO_CONTROL_BUFFER_FILL_BUFFER *PFN_READ_IO_CONTROL_BUFFER_FILL_BUFFER;
typedef struct _READ_IO_CONTROL_BUFFER
{
WDFQUEUE BufferQueue;
PDEVICE_CONTEXT DeviceContext;
PFN_READ_IO_CONTROL_BUFFER_FILL_BUFFER Callback;
size_t MinOutputBufferSize;
BOOLEAN InstantCompletion;
} READ_IO_CONTROL_BUFFER, * PREAD_IO_CONTROL_BUFFER;
NTSTATUS
ReadIoControlBufferCreate(
_Inout_ PREAD_IO_CONTROL_BUFFER ReadIoControlBuffer,
_In_ WDFDEVICE ParentDevice,
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ PFN_READ_IO_CONTROL_BUFFER_FILL_BUFFER Callback,
_In_ size_t MinOutputBufferSize
);
VOID
ReadIoControlBufferFlush(
_In_ PREAD_IO_CONTROL_BUFFER ReadIoControlBuffer
);
VOID
ReadIoControlBufferForwardRequest(
_In_ PREAD_IO_CONTROL_BUFFER ReadIoControlBuffer,
_In_ WDFREQUEST Request);
VOID
ReadIoControlBufferDispatchRequest(
_In_ PREAD_IO_CONTROL_BUFFER ReadIoControlBuffer
);
================================================
FILE: HID Wiimote/Trace.c
================================================
/*
Copyright (C) 2017 Julian Lhr
All rights reserved.
Filename:
Trace.c
Abstract:
Contains the code for Tracing.
*/
#include "Trace.h"
VOID
Trace(
_In_ PCCHAR DebugMessage,
...
)
{
#ifndef DBG
UNREFERENCED_PARAMETER(DebugMessage);
#else
NTSTATUS Status;
va_list ParameterList;
CHAR DebugMessageBuffer[512];
va_start(ParameterList, DebugMessage);
if(DebugMessage != NULL)
{
Status = RtlStringCbVPrintfA(DebugMessageBuffer, sizeof(DebugMessageBuffer), DebugMessage, ParameterList);
if(NT_SUCCESS(Status))
{
DbgPrint("Trace Wiimote: %s\n", DebugMessageBuffer);
}
}
va_end(ParameterList);
#endif
}
VOID
TraceStatus(
_In_ PCCHAR DebugMessage,
_In_ NTSTATUS Status
)
{
#ifndef DBG
UNREFERENCED_PARAMETER(DebugMessage);
UNREFERENCED_PARAMETER(Status);
#else
Trace("%s: " NTSTATUS_FORMAT_IDENTIFIER, DebugMessage, Status);
#endif
}
VOID
PrintBytes(
_In_reads_(Size) PCUCHAR Data,
_In_ SIZE_T Size
)
{
#ifndef DBG
UNREFERENCED_PARAMETER(Data);
UNREFERENCED_PARAMETER(Size);
#else
NTSTATUS Result = STATUS_SUCCESS;
PCHAR Message;
PCHAR WritePointer;
PCUCHAR ReadPointer;
const size_t BytesPerElement = 5;
size_t StringBufferSize = (Size * BytesPerElement) + 1;
Message = (PCHAR)ExAllocatePoolWithTag(NonPagedPool, StringBufferSize, PRINTBYTE_POOL_TAG);
if (Message == NULL)
{
Trace("Error printing Bytes: Out of Memory");
return;
}
WritePointer = Message;
ReadPointer = Data;
for (SIZE_T i = 0; (i < Size) && (NT_SUCCESS(Result)); ++i)
{
Result = RtlStringCbPrintfA(WritePointer, StringBufferSize, "%#04x ", *ReadPointer);
WritePointer += BytesPerElement;
StringBufferSize -= BytesPerElement;
ReadPointer++;
}
(*WritePointer) = 0;
Trace("Byte Print: %s", Message);
ExFreePool(Message);
#endif
}
================================================
FILE: HID Wiimote/Trace.h
================================================
/*
Copyright (C) 2017 Julian Lhr
All rights reserved.
Filename:
Trace.h
Abstract:
Header file for Trace.c
Contains declarations and configuration for Tracing.
*/
#pragma once
#include <ntddk.h>
#define NTSTRSAFE_LIB
#include <ntstrsafe.h>
#define PRINTBYTE_POOL_TAG '_BrP'
#define NTSTATUS_FORMAT_IDENTIFIER "%#010x"
VOID
Trace(
_In_ PCCHAR DebugMessage,
...
);
VOID
TraceStatus(
_In_ PCCHAR DebugMessage,
_In_ NTSTATUS Status
);
VOID
PrintBytes(
_In_reads_(Size) PCUCHAR Data,
_In_ SIZE_T Size
);
================================================
FILE: HID Wiimote/Wiimote.c
================================================
/*
Copyright (C) 2017 Julian Lhr
All rights reserved.
Filename:
Wiimote.c
Abstract:
Manages the Wiimote states and is the layer between HID and Bluetooth.
*/
#include "Wiimote.h"
#include "Device.h"
#include "Bluetooth.h"
#include "WiimoteSettings.h"
EVT_WDF_TIMER BatteryLevelLEDUpdateTimerExpired;
NTSTATUS
WiimotePrepare(
_In_ PDEVICE_CONTEXT DeviceContext
)
{
NTSTATUS Status = STATUS_SUCCESS;
WDF_TIMER_CONFIG TimerConfig;
WDF_OBJECT_ATTRIBUTES TimerAttributes;
// Reset Device
WiimoteReset(DeviceContext);
// Load Settings from Registry
WiimoteSettingsLoad(DeviceContext);
// Create Timer to request StatusInformation
WDF_TIMER_CONFIG_INIT_PERIODIC(&TimerConfig, BatteryLevelLEDUpdateTimerExpired, WIIMOTE_STATUSINFORMATION_INTERVAL);
WDF_OBJECT_ATTRIBUTES_INIT(&TimerAttributes);
TimerAttributes.ParentObject = DeviceContext->Device;
Status = WdfTimerCreate(&TimerConfig, &TimerAttributes, &(DeviceContext->WiimoteContext.BatteryLevelLEDUpdateTimer));
if(!NT_SUCCESS(Status))
{
return Status;
}
return Status;
}
NTSTATUS
SetLEDs(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ BYTE LEDFlag
)
{
CONST size_t BufferSize = 3;
NTSTATUS Status = STATUS_SUCCESS;
WDFREQUEST Request;
WDFMEMORY Memory;
BYTE * Data;
// Save new LED State
DeviceContext->WiimoteContext.LEDState = LEDFlag;
// Get Resources
Status = BluetoothCreateRequestAndBuffer(DeviceContext->Device, DeviceContext->IoTarget, BufferSize, &Request, &Memory, (PVOID *)&Data);
if(!NT_SUCCESS(Status))
{
return Status;
}
// Fill Buffer
Data[0] = 0xA2; //HID Output Report
Data[1] = 0x11; //Player LED
Data[2] = LEDFlag;
Status = BluetoothTransferToDevice(DeviceContext, Request, Memory, FALSE);
if(!NT_SUCCESS(Status))
{
return Status;
}
return Status;
}
NTSTATUS
SetReportMode(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ BYTE ReportMode
)
{
CONST size_t BufferSize = 4;
NTSTATUS Status = STATUS_SUCCESS;
WDFREQUEST Request;
WDFMEMORY Memory;
BYTE * Data;
// Get Resources
Status = BluetoothCreateRequestAndBuffer(DeviceContext->Device, DeviceContext->IoTarget, BufferSize, &Request, &Memory, (PVOID *)&Data);
if(!NT_SUCCESS(Status))
{
return Status;
}
// Fill Buffer
Data[0] = 0xA2; //HID Output Report
Data[1] = 0x12; //Set ReportMode
Data[2] = 0x00; //Only On Change
Data[3] = ReportMode; //Mode
Status = BluetoothTransferToDevice(DeviceContext, Request, Memory, FALSE);
if(!NT_SUCCESS(Status))
{
return Status;
}
DeviceContext->WiimoteContext.CurrentReportMode = ReportMode;
return Status;
}
NTSTATUS
RequestStatusInformation(
_In_ PDEVICE_CONTEXT DeviceContext
)
{
CONST size_t BufferSize = 3;
NTSTATUS Status = STATUS_SUCCESS;
WDFREQUEST Request;
WDFMEMORY Memory;
BYTE * Data;
// Get Resources
Status = BluetoothCreateRequestAndBuffer(DeviceContext->Device, DeviceContext->IoTarget, BufferSize, &Request, &Memory, (PVOID *)&Data);
if(!NT_SUCCESS(Status))
{
return Status;
}
// Fill Buffer
Data[0] = 0xA2; //HID Output Report
Data[1] = 0x15; //Status Information Request
Data[2] = 0x00; //Rumble Off
Status = BluetoothTransferToDevice(DeviceContext, Request, Memory, FALSE);
if(!NT_SUCCESS(Status))
{
return Status;
}
return Status;
}
NTSTATUS
ReadFromRegister(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ INT32 Address,
_In_ BYTE Size
)
{
CONST size_t BufferSize = 8;
NTSTATUS Status = STATUS_SUCCESS;
WDFREQUEST Request;
WDFMEMORY Memory;
BYTE * Data;
// Get Resources
Status = BluetoothCreateRequestAndBuffer(DeviceContext->Device, DeviceContext->IoTarget, BufferSize, &Request, &Memory, (PVOID *)&Data);
if (!NT_SUCCESS(Status))
{
return Status;
}
// Fill Buffer
Data[0] = 0xA2; //HID Output Report
Data[1] = 0x17; //Status Information Request
Data[2] = 0x04; //Rumble Off but write to Registers
//Offset
Data[3] = 0xFF & (Address >> 16);
Data[4] = 0xFF & (Address >> 8);
Data[5] = 0xFF & (Address);
Data[6] = 0x00; //Size
Data[7] = Size; //Size
Status = BluetoothTransferToDevice(DeviceContext, Request, Memory, FALSE);
if (!NT_SUCCESS(Status))
{
return Status;
}
return Status;
}
NTSTATUS
WriteToRegister(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ INT32 Address,
_In_reads_(DataSize) PCUCHAR Data,
_In_ BYTE DataSize
)
{
CONST size_t BufferSize = 23;
NTSTATUS Status = STATUS_SUCCESS;
WDFREQUEST Request;
WDFMEMORY Memory;
BYTE * Report;
// Get Resources
Status = BluetoothCreateRequestAndBuffer(DeviceContext->Device, DeviceContext->IoTarget, BufferSize, &Request, &Memory, (PVOID *)&Report);
if (!NT_SUCCESS(Status))
{
return Status;
}
// Fill Buffer
Report[0] = 0xA2; //HID Output Report
Report[1] = 0x16; //Status Information Request
Report[2] = 0x04; //Rumble Off but write to Registers
//Offset
Report[3] = 0xFF & (Address >> 16);
Report[4] = 0xFF & (Address >> 8);
Report[5] = 0xFF & (Address);
Report[6] = DataSize; //Size
RtlSecureZeroMemory(Report + 7, 16);
RtlCopyBytes(Report + 7, Data, DataSize);
Status = BluetoothTransferToDevice(DeviceContext, Request, Memory, FALSE);
if (!NT_SUCCESS(Status))
{
return Status;
}
return Status;
}
NTSTATUS
WriteSingeByteToRegister(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ INT32 Address,
_In_ BYTE Data
)
{
return WriteToRegister(DeviceContext, Address, &Data, 1);
}
NTSTATUS
SendSingleByteReport(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ BYTE ReportID,
_In_ BYTE Byte
)
{
CONST size_t BufferSize = 3;
NTSTATUS Status = STATUS_SUCCESS;
WDFREQUEST Request;
WDFMEMORY Memory;
BYTE * Data;
// Get Resources
Status = BluetoothCreateRequestAndBuffer(DeviceContext->Device, DeviceContext->IoTarget, BufferSize, &Request, &Memory, (PVOID *)&Data);
if (!NT_SUCCESS(Status))
{
return Status;
}
// Fill Buffer
Data[0] = 0xA2; //HID Output Report
Data[1] = ReportID; // Enable IR
Data[2] = Byte; // Get acknowledgement
Status = BluetoothTransferToDevice(DeviceContext, Request, Memory, FALSE);
if (!NT_SUCCESS(Status))
{
return Status;
}
return Status;
}
NTSTATUS
WiimoteStart(
_In_ PDEVICE_CONTEXT DeviceContext
)
{
NTSTATUS Status = STATUS_SUCCESS;
//Set LEDs
Status = SetLEDs(DeviceContext, WIIMOTE_LEDS_ALL);
if(!NT_SUCCESS(Status))
{
return Status;
}
#ifdef MOUSE_IR
//Enable IR
Status = SendSingleByteReport(DeviceContext, 0x13, 0x06);
if(!NT_SUCCESS(Status))
{
TraceStatus("EnableIR Failed", Status);
return Status;
}
#else
//Set Report Mode
Status = SetReportMode(DeviceContext, 0x31);
if(!NT_SUCCESS(Status))
{
TraceStatus("SetReportMode Failed", Status);
return Status;
}
#endif
//Start Continious Reader
Status = BluetoothStartContiniousReader(DeviceContext);
if(!NT_SUCCESS(Status))
{
TraceStatus("StartContiniousReader Failed", Status);
return Status;
}
//Start Timer
WdfTimerStart(DeviceContext->WiimoteContext.BatteryLevelLEDUpdateTimer, WDF_REL_TIMEOUT_IN_SEC(1));
return Status;
}
NTSTATUS
EnableIR(
_In_ PDEVICE_CONTEXT DeviceContext
)
{
NTSTATUS Status = STATUS_SUCCESS;
const BYTE SensivityBlock1[] = { 0x02, 0x00, 0x00, 0x71, 0x01, 0x00, 0xaa, 0x00, 0x64 };
const BYTE SensivityBlock2[] = { 0x63, 0x03 };
//Write 0x08 to register 0xb00030
Status = WriteSingeByteToRegister(DeviceContext, 0xb00030, 0x08);
if (!NT_SUCCESS(Status))
{
return Status;
}
//Write Sensitivity Block 1 to registers at 0xb00000
Status = WriteToRegister(DeviceContext, 0xb00000, SensivityBlock1, sizeof(SensivityBlock1));
if (!NT_SUCCESS(Status))
{
return Status;
}
//Write Sensitivity Block 2 to registers at 0xb0001a
Status = WriteToRegister(DeviceContext, 0xb0001a, SensivityBlock2, sizeof(SensivityBlock2));
if (!NT_SUCCESS(Status))
{
return Status;
}
//Write Mode Number to register 0xb00033
//0x01 Basic Mode 10 Byte
Status = WriteSingeByteToRegister(DeviceContext, 0xb00030, 0x01);
if (!NT_SUCCESS(Status))
{
return Status;
}
//Write 0x08 to register 0xb00030 (again)
Status = WriteSingeByteToRegister(DeviceContext, 0xb00030, 0x08);
if (!NT_SUCCESS(Status))
{
return Status;
}
//Set Report Mode
Status = SetReportMode(DeviceContext, 0x36);
if (!NT_SUCCESS(Status))
{
return Status;
}
return Status;
}
NTSTATUS
SuspendWiimote(
_In_ PDEVICE_CONTEXT DeviceContext
)
{
CONST size_t BufferSize = 1;
NTSTATUS Status = STATUS_SUCCESS;
WDFREQUEST Request;
WDFMEMORY Memory;
BYTE * Data;
// Get Resources
Status = BluetoothCreateRequestAndBuffer(DeviceContext->Device, DeviceContext->IoTarget, BufferSize, &Request, &Memory, (PVOID *)&Data);
if(!NT_SUCCESS(Status))
{
return Status;
}
// Fill Buffer
Data[0] = 0x13; //HID Control with Suspend: 0x10 = HID_Control - 0x03 = SUSPEND
Status = BluetoothTransferToDevice(DeviceContext, Request, Memory, TRUE);
if(!NT_SUCCESS(Status))
{
return Status;
}
WdfObjectDelete(Request);
return Status;
}
NTSTATUS
WiimoteStop(
_In_ PDEVICE_CONTEXT DeviceContext
)
{
NTSTATUS Status = STATUS_SUCCESS;
//Stop Timer
WdfTimerStop(DeviceContext->WiimoteContext.BatteryLevelLEDUpdateTimer, TRUE);
//Shut down Wiimote
Status = SuspendWiimote(DeviceContext);
if(!NT_SUCCESS(Status))
{
return Status;
}
return Status;
}
VOID
WiimoteReset(
_In_ PDEVICE_CONTEXT DeviceContext
)
{
DeviceContext->WiimoteContext.Extension = None;
WiimoteStateResetToNullState(DeviceContext);
}
NTSTATUS
UpdateBatteryLEDs(
_In_ PDEVICE_CONTEXT DeviceContext
)
{
NTSTATUS Status = STATUS_SUCCESS;
PWIIMOTE_DEVICE_CONTEXT WiimoteContext = &(DeviceContext->WiimoteContext);
if (WiimoteContext->Extension == BalanceBoard)
{
return Status;
}
Status = SetLEDs(DeviceContext, ((0xF0 << (3 - (DeviceContext->WiimoteContext.BatteryLevel / 64))) & 0xF0));
if (!NT_SUCCESS(Status))
{
return Status;
}
if (DeviceContext->WiimoteContext.LEDState == WIIMOTE_LEDS_FOUR)
{
WdfTimerStop(WiimoteContext->BatteryLevelLEDUpdateTimer, FALSE);
}
return Status;
}
NTSTATUS
InitializeExtension(
_In_ PDEVICE_CONTEXT DeviceContext
)
{
NTSTATUS Status = STATUS_SUCCESS;
Status = WriteSingeByteToRegister(DeviceContext, 0xA400F0, 0x55);
if (!NT_SUCCESS(Status))
{
return Status;
}
Status = WriteSingeByteToRegister(DeviceContext, 0xA400FB, 0x00);
if (!NT_SUCCESS(Status))
{
return Status;
}
Status = ReadFromRegister(DeviceContext, 0xA400FA, 0x06);
if (!NT_SUCCESS(Status))
{
return Status;
}
return Status;
}
NTSTATUS
ProcessWiimoteBatteryLevel(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ BYTE BatteryLevel
)
{
NTSTATUS Status = STATUS_SUCCESS;
Trace("BatteryLevel: 0x%x", BatteryLevel);
DeviceContext->WiimoteContext.BatteryLevel = BatteryLevel;
Status = UpdateBatteryLEDs(DeviceContext);
if (!NT_SUCCESS(Status))
{
return Status;
}
return STATUS_SUCCESS;
}
NTSTATUS
ProcessStatusInformation(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_reads_bytes_(ReadBufferSize) BYTE * ReadBuffer,
_In_ size_t ReadBufferSize
)
{
NTSTATUS Status = STATUS_SUCCESS;
UNREFERENCED_PARAMETER(ReadBufferSize);
Trace("ProcessStatusInformation");
#ifndef MOUSE_IR
BOOLEAN Extension = (ReadBuffer[3] & 0x02);
Trace("Extension Flag: %d", (ReadBuffer[3] & 0x02));
if (Extension)
{
if (DeviceContext->WiimoteContext.Extension == None)
{
Status = InitializeExtension(DeviceContext);
if (!NT_SUCCESS(Status))
{
return Status;
}
}
}
else
{
DeviceContext->WiimoteContext.Extension = None;
DeviceContext->WiimoteContext.CurrentReportMode = 0x31;
}
#endif
//Process the Battery Level to set the LEDS; Wii U Pro Controller reports its Battery Level in its Input Report
switch (DeviceContext->WiimoteContext.Extension)
{
case WiiUProController:
break;
default:
Status = ProcessWiimoteBatteryLevel(DeviceContext, ReadBuffer[6]);
if (!NT_SUCCESS(Status))
{
return Status;
}
}
//Set Report Mode, if extension changed
Status = SetReportMode(DeviceContext, DeviceContext->WiimoteContext.CurrentReportMode);
if(!NT_SUCCESS(Status))
{
return Status;
}
// Notify Device Interface about Status Update
DeviceInterfaceWiimoteStateUpdated(DeviceContext);
return Status;
}
NTSTATUS
ProcessExtensionRegister(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_reads_bytes_(ReadBufferSize) BYTE * ReadBuffer,
_In_ size_t ReadBufferSize,
_In_ BYTE ErrorFlag,
_In_ USHORT ReadAddress)
{
NTSTATUS Status = STATUS_SUCCESS;
UNREFERENCED_PARAMETER(ReadBufferSize);
UNREFERENCED_PARAMETER(ErrorFlag);
UNREFERENCED_PARAMETER(ReadAddress);
USHORT ExtensionType = ReadBuffer[4] << 8 | ReadBuffer[5];
USHORT SubType = ReadBuffer[0] << 8 | ReadBuffer[1];
Trace("Extension Type: %#010x", ExtensionType);
Trace("Sub Type: %#010x", SubType);
switch (ExtensionType)
{
case 0x0000: // Nunchuck
Trace("Nunchuck Extension");
DeviceContext->WiimoteContext.Extension = Nunchuck;
DeviceContext->WiimoteContext.CurrentReportMode = 0x35;
break;
case 0x0402: // Balance Board
Trace("Balance Board");
DeviceContext->WiimoteContext.Extension = BalanceBoard;
DeviceContext->WiimoteContext.CurrentReportMode = 0x32;
SetLEDs(DeviceContext, WIIMOTE_LEDS_ALL);
// Get Calibration Data
ReadFromRegister(DeviceContext, 0xA40024, 24);
break;
case 0x0101:
switch (SubType)
{
default:
case 0x0000: // Classic Controler
Trace("Classic Controller Extension");
DeviceContext->WiimoteContext.Extension = ClassicController;
DeviceContext->WiimoteContext.CurrentReportMode = 0x32;
break;
case 0x0100: // Classic Controler Pro
Trace("Classic Controller Pro Extension");
DeviceContext->WiimoteContext.Extension = ClassicControllerPro;
DeviceContext->WiimoteContext.CurrentReportMode = 0x32;
break;
}
break;
case 0x0120: // Wii U Pro Controller
Trace("Wii U Pro Controller");
DeviceContext->WiimoteContext.Extension = WiiUProController;
DeviceContext->WiimoteContext.CurrentReportMode = 0x34;
break;
case 0x0103:
// 0x0000: Guitar Hero Guitar
// 0x0100: Guitar Hero Drum Kit
// 0x0300: DJ Hero Turntables
Trace("Guitar Hero Guitar");
DeviceContext->WiimoteContext.Extension = Guitar;
DeviceContext->WiimoteContext.CurrentReportMode = 0x32;
break;
case 0xFFFF: // Error
Trace("Error");
DeviceContext->WiimoteContext.Extension = None;
DeviceContext->WiimoteContext.CurrentReportMode = 0x31;
Status = InitializeExtension(DeviceContext);
if (!NT_SUCCESS(Status))
{
return Status;
}
break;
default:
Trace("Unsupported Extension!");
return Status;
}
Status = SetReportMode(DeviceContext, DeviceContext->WiimoteContext.CurrentReportMode);
if (!NT_SUCCESS(Status))
{
return Status;
}
// Signal Device Interface to report the new Extension Type
DeviceInterfaceWiimoteStateUpdated(DeviceContext);
return Status;
}
NTSTATUS
ProcessBalanceBoardCalibrationRegister(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_reads_bytes_(ReadBufferSize) PUCHAR ReadBuffer,
_In_ size_t ReadBufferSize,
_In_ BYTE ErrorFlag,
_In_ USHORT ReadAddress)
{
NTSTATUS Status = STATUS_SUCCESS;
UNREFERENCED_PARAMETER(ErrorFlag);
PUSHORT Data = (PUSHORT)ReadBuffer;
size_t CalibrationIndexStart = (ReadAddress == 0x0024) ? 0 : 2;
size_t CalibrationIndexEnd = CalibrationIndexStart + (ReadBufferSize / 8);
for (size_t CalibrationDataIndex = CalibrationIndexStart; CalibrationDataIndex < CalibrationIndexEnd; ++CalibrationDataIndex)
{
for (size_t SensorIndex = 0; SensorIndex < 4; ++SensorIndex)
{
DeviceContext->WiimoteContext.State.BalanceBoardState.Calibration[SensorIndex][CalibrationDataIndex] = RtlUshortByteSwap(Data[4 * (CalibrationDataIndex - CalibrationIndexStart) + SensorIndex]);
}
}
return Status;
}
NTSTATUS
ProcessRegisterReadReport(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_reads_bytes_(ReadBufferSize) BYTE * ReadBuffer,
_In_ size_t ReadBufferSize
)
{
NTSTATUS Status = STATUS_SUCCESS;
UNREFERENCED_PARAMETER(ReadBufferSize);
Trace("ProcessRegisterReadReport");
WiimoteStateUpdate(DeviceContext, ReadBuffer, ReadBufferSize);
BYTE Error = 0x0F & (ReadBuffer[3]);
Trace("Error Flag: %#04x", Error);
BYTE Size = ((0xF0 & (ReadBuffer[3])) >> 4) + 1;
Trace("Size: %#04x", Size);
USHORT Address = RtlUshortByteSwap(*((USHORT *)(ReadBuffer + 4)));
Trace("Address: %#06x", Address);
switch(Address)
{
case 0x00FA: // Extension Type
Status = ProcessExtensionRegister(DeviceContext, ReadBuffer + 6, Size, Error, Address);
break;
case 0x0024: // BalanceBoard Calibration
case 0x0034:
Status = ProcessBalanceBoardCalibrationRegister(DeviceContext, ReadBuffer + 6, Size, Error, Address);
break;
}
return Status;
}
NTSTATUS
ProcessAcknowledgementReport(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_reads_bytes_(ReadBufferSize) BYTE * ReadBuffer,
_In_ size_t ReadBufferSize
)
{
NTSTATUS Status = STATUS_SUCCESS;
UNREFERENCED_PARAMETER(ReadBufferSize);
Trace("ProcessAcknowledgementReport");
WiimoteStateUpdate(DeviceContext, ReadBuffer, ReadBufferSize);
BYTE Report = ReadBuffer[3];
BYTE Result = ReadBuffer[4];
Trace("Report: %#04x", Report);
Trace("Error Flag: %#04x", Result);
if (Result == 0x03)
{
return STATUS_SUCCESS;
}
switch (Report)
{
case 0x13:
Status = SendSingleByteReport(DeviceContext, 0x1A, 0x06);
break;
case 0x1A:
Status = EnableIR(DeviceContext);
break;
}
if (!NT_SUCCESS(Status))
{
return Status;
}
return Status;
}
NTSTATUS
WiimoteProcessReport(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_reads_bytes_(ReadBufferSize) PVOID ReadBuffer,
_In_ SIZE_T ReadBufferSize
)
{
NTSTATUS Status = STATUS_SUCCESS;
BYTE ReportID = 0x00;
if(ReadBufferSize >= 2)
{
ReportID = ((BYTE *)ReadBuffer)[1];
}
//PrintBytes(ReadBuffer, ReadBufferSize);
switch(ReportID)
{
// Status Information
case 0x20:
Status = ProcessStatusInformation(DeviceContext,(((BYTE *)ReadBuffer) + 1), (ReadBufferSize - 1));
break;
case 0x21:
Status = ProcessRegisterReadReport(DeviceContext, (((BYTE *)ReadBuffer) + 1), (ReadBufferSize - 1));
break;
case 0x22:
Status = ProcessAcknowledgementReport(DeviceContext, (((BYTE *)ReadBuffer) + 1), (ReadBufferSize - 1));
break;
case 0x30:
case 0x31:
case 0x32:
case 0x34:
case 0x35:
case 0x36:
case 0x3D:
Status = WiimoteStateUpdate(DeviceContext,(((PUCHAR)ReadBuffer) + 1), (ReadBufferSize - 1));
break;
default:
Trace("Unkown Report Recieved");
break;
}
if(!NT_SUCCESS(Status))
{
return Status;
}
return Status;
}
VOID
BatteryLevelLEDUpdateTimerExpired(
WDFTIMER Timer
)
{
NTSTATUS Status;
PDEVICE_CONTEXT DeviceContext = GetDeviceContext(WdfTimerGetParentObject(Timer));
Trace("BatteryLevelLEDUpdate Timer!");
if (DeviceContext->WiimoteContext.Extension == WiiUProController)
{
Status = UpdateBatteryLEDs(DeviceContext);
if (!NT_SUCCESS(Status))
{
return;
}
}
else
{
Status = RequestStatusInformation(DeviceContext);
TraceStatus("Request Status Information Result", Status);
if (!NT_SUCCESS(Status))
{
return;
}
}
}
================================================
FILE: HID Wiimote/Wiimote.h
================================================
/*
Copyright (C) 2017 Julian Lhr
All rights reserved.
Filename:
Wiimote.h
Abstract:
Header file for Wiimote.c
*/
#pragma once
#include "HIDWiimote.h"
#include "DeviceInterfacePublic.h"
#include "WiimoteState.h"
#include "WiimoteSettings.h"
#define WIIMOTE_STATUSINFORMATION_INTERVAL (60000) // 60 Second
typedef struct _WIIMOTE_DEVICE_CONTEXT
{
BYTE CurrentReportMode;
BYTE BatteryLevel;
BYTE LEDState;
WIIMOTE_SETTINGS Settings;
WIIMOTE_EXTENSION Extension;
WIIMOTE_STATE State;
WDFTIMER BatteryLevelLEDUpdateTimer;
} WIIMOTE_DEVICE_CONTEXT, * PWIIMOTE_DEVICE_CONTEXT;
NTSTATUS WiimotePrepare(_In_ PDEVICE_CONTEXT DeviceContext);
NTSTATUS WiimoteStart(_In_ PDEVICE_CONTEXT DeviceContext);
NTSTATUS WiimoteStop(_In_ PDEVICE_CONTEXT DeviceContext);
VOID WiimoteReset(_In_ PDEVICE_CONTEXT DeviceContext);
NTSTATUS WiimoteProcessReport(_In_ PDEVICE_CONTEXT DeviceContext, _In_reads_bytes_(ReadBufferSize) PVOID ReadBuffer, _In_ SIZE_T ReadBufferSize);
================================================
FILE: HID Wiimote/WiimoteSettings.c
================================================
/*
Copyright (C) 2017 Julian Lhr
All rights reserved.
Filename:
WiimoteSettings.c
Abstract:
Loads and saves the Wiimote Settings from and to the Registry.
*/
#include "WiimoteToHIDParser.h"
#include "Device.h"
DECLARE_CONST_UNICODE_STRING(DriverModeValueName, L"DriverMode");
DECLARE_CONST_UNICODE_STRING(EnableWiimoteXAxisAccelerometerValueName, L"EnableWiimoteXAxisAccelerometer");
DECLARE_CONST_UNICODE_STRING(EnableWiimoteYAxisAccelerometerValueName, L"EnableWiimoteYAxisAccelerometer");
DECLARE_CONST_UNICODE_STRING(SwapMouseButtonsValueName, L"SwapMouseButtons");
DECLARE_CONST_UNICODE_STRING(SwapTriggerAndShoulderValueName, L"SwapTriggerAndShoulder");
DECLARE_CONST_UNICODE_STRING(SplitTriggerAxisValueName, L"SplitTriggerAxis");
DECLARE_CONST_UNICODE_STRING(MapTriggerAsAxisValueName, L"MapTriggerAsAxis");
DECLARE_CONST_UNICODE_STRING(MapTriggerAsButtonsValueName, L"MapTriggerAsButtons");
NTSTATUS
OpenRegistryKey(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ ACCESS_MASK Access,
_Out_ WDFKEY * DeviceKey,
_Out_opt_ BOOLEAN * NewlyCreated
);
VOID
LoadWiimoteDriverModeValue(
_In_ WDFKEY Key,
_In_ PCUNICODE_STRING ValueName,
_In_ WIIMOTE_DRIVER_MODE DefaultValue,
_Out_ PWIIMOTE_DRIVER_MODE Value
);
VOID
LoadBooleanValue(
_In_ WDFKEY Key,
_In_ PCUNICODE_STRING ValueName,
_In_ BOOLEAN DefaultValue,
_Out_ PBOOLEAN Value
);
VOID
SaveULONGValue(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ PCUNICODE_STRING ValueName,
_In_ ULONG Value
);
VOID
WiimoteSettingsLoad(
_In_ PDEVICE_CONTEXT DeviceContext
)
{
NTSTATUS Status;
WDFKEY Key;
Status = OpenRegistryKey(DeviceContext, KEY_READ, &Key, NULL);
if (!NT_SUCCESS(Status))
{
Trace("Failed to open Reg Key to load settings.");
return;
}
// Load each Setting
DeviceContext->WiimoteContext.Settings.Mode = Gamepad;
//LoadWiimoteDriverModeValue(Key, &DriverModeValueName, Gamepad, &DeviceContext->WiimoteContext.Settings.Mode);
LoadBooleanValue(Key, &EnableWiimoteXAxisAccelerometerValueName, TRUE, &DeviceContext->WiimoteContext.Settings.EnableWiimoteXAxisAccelerometer);
LoadBooleanValue(Key, &EnableWiimoteYAxisAccelerometerValueName, TRUE, &DeviceContext->WiimoteContext.Settings.EnableWiimoteYAxisAcceleromenter);
LoadBooleanValue(Key, &SwapMouseButtonsValueName, FALSE, &DeviceContext->WiimoteContext.Settings.SwapMouseButtons);
LoadBooleanValue(Key, &SwapTriggerAndShoulderValueName, FALSE, &DeviceContext->WiimoteContext.Settings.SwapTriggerAndShoulder);
LoadBooleanValue(Key, &SplitTriggerAxisValueName, TRUE, &DeviceContext->WiimoteContext.Settings.SplitTriggerAxis);
LoadBooleanValue(Key, &MapTriggerAsAxisValueName, TRUE, &DeviceContext->WiimoteContext.Settings.MapTriggerAsAxis);
LoadBooleanValue(Key, &MapTriggerAsButtonsValueName, TRUE, &DeviceContext->WiimoteContext.Settings.MapTriggerAsButtons);
// Close Key
WdfRegistryClose(Key);
}
VOID
WiimoteSettingsSetDriverMode(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ WIIMOTE_DRIVER_MODE DriverMode
)
{
//DeviceContext->WiimoteContext.Settings.Mode = DriverMode;
SaveULONGValue(DeviceContext, &DriverModeValueName, (ULONG)DriverMode);
// Check for IR Activation/Deactivation
}
VOID
WiimoteSettingsSetEnableWiimoteXAxisAccelerometer(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ BOOLEAN Enabled
)
{
DeviceContext->WiimoteContext.Settings.EnableWiimoteXAxisAccelerometer = Enabled;
HIDWiimoteStateUpdated(DeviceContext);
SaveULONGValue(DeviceContext, &EnableWiimoteXAxisAccelerometerValueName, (ULONG)Enabled);
}
VOID
WiimoteSettingsSetEnableWiimoteYAxisAccelerometer(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ BOOLEAN Enabled
)
{
DeviceContext->WiimoteContext.Settings.EnableWiimoteYAxisAcceleromenter = Enabled;
HIDWiimoteStateUpdated(DeviceContext);
SaveULONGValue(DeviceContext, &EnableWiimoteYAxisAccelerometerValueName, (ULONG)Enabled);
}
VOID
WiimoteSettingsSetSwapMouseButtons(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ BOOLEAN Enabled
)
{
DeviceContext->WiimoteContext.Settings.SwapMouseButtons = Enabled;
HIDWiimoteStateUpdated(DeviceContext);
SaveULONGValue(DeviceContext, &SwapMouseButtonsValueName, (ULONG)Enabled);
}
VOID
WiimoteSettingsSetSwapTriggerAndShoulder(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ BOOLEAN Enabled
)
{
DeviceContext->WiimoteContext.Settings.SwapTriggerAndShoulder = Enabled;
HIDWiimoteStateUpdated(DeviceContext);
SaveULONGValue(DeviceContext, &SwapTriggerAndShoulderValueName, (ULONG)Enabled);
}
VOID
WiimoteSettingsSetSplitTriggerAxis(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ BOOLEAN Enabled
)
{
DeviceContext->WiimoteContext.Settings.SplitTriggerAxis = Enabled;
HIDWiimoteStateUpdated(DeviceContext);
SaveULONGValue(DeviceContext, &SplitTriggerAxisValueName, (ULONG)Enabled);
}
VOID
WiimoteSettingsSetMapTriggerAsAxis(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ BOOLEAN Enabled
)
{
DeviceContext->WiimoteContext.Settings.MapTriggerAsAxis = Enabled;
HIDWiimoteStateUpdated(DeviceContext);
SaveULONGValue(DeviceContext, &MapTriggerAsAxisValueName, (ULONG)Enabled);
}
VOID
WiimoteSettingsSetMapTriggerAsButtons(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ BOOLEAN Enabled
)
{
DeviceContext->WiimoteContext.Settings.MapTriggerAsButtons = Enabled;
HIDWiimoteStateUpdated(DeviceContext);
SaveULONGValue(DeviceContext, &MapTriggerAsButtonsValueName, (ULONG)Enabled);
}
/*
Currently the hardware/device key as well as the driver software key is not persistent accross disconnecting Wiimotes.
Therefore we need to use the driver/service parameters key, that seems to be persistent, even when the driver is uninstalled.
An "DeviceSettings" subkey is used so the parameters key remains clear.
For each device the Bluetooth address is used as unique identifier and device key.
*/
NTSTATUS
OpenRegistryKey(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ ACCESS_MASK Access,
_Out_ WDFKEY * DeviceKey,
_Out_opt_ BOOLEAN * NewlyCreated
)
{
NTSTATUS Status;
WDFKEY ServiceKey;
WDFKEY DeviceSettingsSubkey;
ULONG CreateDisposition;
DECLARE_CONST_UNICODE_STRING(DeviceSettingsSubkeyName, L"DeviceSettings");
// Open the driver/service parameters key "../Services/HIDWiimote/Parameters"
Status = WdfDriverOpenParametersRegistryKey(WdfGetDriver(), Access, WDF_NO_OBJECT_ATTRIBUTES, &ServiceKey);
if (!NT_SUCCESS(Status))
{
TraceStatus("Error opening Service Key", Status);
return Status;
}
// Open/create a subkey for all devices "../Services/HIDWiimote/Parameters/DeviceSettings"
Status = WdfRegistryCreateKey(ServiceKey, &DeviceSettingsSubkeyName, Access, REG_OPTION_NON_VOLATILE, &CreateDisposition, WDF_NO_OBJECT_ATTRIBUTES, &DeviceSettingsSubkey);
if (!NT_SUCCESS(Status))
{
TraceStatus("Error opening Device Settings Subkey", Status);
WdfRegistryClose(ServiceKey);
return Status;
}
// Open/create the device "../Services/HIDWiimote/Parameters/DeviceSettings/XXXXXXXXXXX"
Status = WdfRegistryCreateKey(DeviceSettingsSubkey, &DeviceContext->BluetoothContext.DeviceAddressString, Access, REG_OPTION_NON_VOLATILE, &CreateDisposition, WDF_NO_OBJECT_ATTRIBUTES, DeviceKey);
if (!NT_SUCCESS(Status))
{
TraceStatus("Error opening Device Subkey", Status);
WdfRegistryClose(ServiceKey);
WdfRegistryClose(DeviceSettingsSubkey);
return Status;
}
if (NewlyCreated != NULL)
{
(*NewlyCreated) = (CreateDisposition == REG_CREATED_NEW_KEY) ? TRUE : FALSE;
}
WdfRegistryClose(ServiceKey);
WdfRegistryClose(DeviceSettingsSubkey);
return STATUS_SUCCESS;
}
VOID
LoadWiimoteDriverModeValue(
_In_ WDFKEY Key,
_In_ PCUNICODE_STRING ValueName,
_In_ WIIMOTE_DRIVER_MODE DefaultValue,
_Out_ PWIIMOTE_DRIVER_MODE Value
)
{
NTSTATUS Status;
ULONG ValueBuffer;
Status = WdfRegistryQueryULong(Key, ValueName, &ValueBuffer);
(*Value) = NT_SUCCESS(Status) ? (WIIMOTE_DRIVER_MODE)ValueBuffer : DefaultValue;
}
VOID
LoadBooleanValue(
_In_ WDFKEY Key,
_In_ PCUNICODE_STRING ValueName,
_In_ BOOLEAN DefaultValue,
_Out_ PBOOLEAN Value
)
{
NTSTATUS Status;
ULONG ValueBuffer;
Status = WdfRegistryQueryULong(Key, ValueName, &ValueBuffer);
(*Value) = NT_SUCCESS(Status) ? (BOOLEAN)ValueBuffer : DefaultValue;
}
VOID
SaveULONGValue(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ PCUNICODE_STRING ValueName,
_In_ ULONG Value
)
{
NTSTATUS Status;
WDFKEY Key;
Status = OpenRegistryKey(DeviceContext, KEY_WRITE, &Key, NULL);
if (!NT_SUCCESS(Status))
{
TraceStatus("Error opening Subkey for writing", Status);
return;
}
Status = WdfRegistryAssignULong(Key, ValueName, Value);
if (!NT_SUCCESS(Status))
{
TraceStatus("Error writing Value", Status);
WdfRegistryClose(Key);
return;
}
WdfRegistryClose(Key);
}
================================================
FILE: HID Wiimote/WiimoteSettings.h
================================================
/*
Copyright (C) 2017 Julian Lhr
All rights reserved.
Filename:
WiimoteSettings.h
Abstract:
Header file for WiimoteSettings.c
*/
#pragma once
#include "HIDWiimote.h"
#include "DeviceInterfacePublic.h"
VOID
WiimoteSettingsLoad(
_In_ PDEVICE_CONTEXT DeviceContext
);
VOID
WiimoteSettingsSetDriverMode(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ WIIMOTE_DRIVER_MODE DriverMode
);
VOID
WiimoteSettingsSetEnableWiimoteXAxisAccelerometer(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ BOOLEAN Enabled
);
VOID
WiimoteSettingsSetEnableWiimoteYAxisAccelerometer(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ BOOLEAN Enabled
);
VOID
WiimoteSettingsSetSwapMouseButtons(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ BOOLEAN Enabled
);
VOID
WiimoteSettingsSetSwapTriggerAndShoulder(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ BOOLEAN Enabled
);
VOID
WiimoteSettingsSetSplitTriggerAxis(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ BOOLEAN Enabled
);
VOID
WiimoteSettingsSetMapTriggerAsAxis(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ BOOLEAN Enabled
);
VOID
WiimoteSettingsSetMapTriggerAsButtons(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_ BOOLEAN Enabled
);
================================================
FILE: HID Wiimote/WiimoteState.c
================================================
/*
Copyright (C) 2017 Julian Lhr
All rights reserved.
Filename:
WiimoteState.c
Abstract:
Parses Wiimote Reports into State Buffers
*/
#include "WiimoteState.h"
#include "Device.h"
NTSTATUS UpdateCoreButtons(_Inout_ PWIIMOTE_WII_REMOTE_STATE WiiRemoteState, _In_reads_bytes_(2) PUCHAR ButtonData, _In_ size_t ButtonDataSize);
NTSTATUS UpdateAccelerometer(_Inout_ PWIIMOTE_WII_REMOTE_STATE WiiRemoteState, _In_reads_bytes_(3) PUCHAR AccelerometerData, _In_ size_t AccelerometerDataSize);
NTSTATUS UpdateExtension(_Inout_ PWIIMOTE_DEVICE_CONTEXT WiimoteContext, _In_reads_bytes_(DataSize) PUCHAR Data, _In_ size_t DataSize);
NTSTATUS UpdateNunchuck(_Inout_ PWIIMOTE_NUNCHUCK_STATE NunchuckState, _In_reads_bytes_(6) PUCHAR NunchuckData, _In_ size_t NunchuckDataSize);
NTSTATUS UpdateBalanceBoard(_Inout_ PWIIMOTE_BALANCE_BOARD_STATE BalanceBoardState, _In_reads_bytes_(8) PUCHAR BalanceBoardData, _In_ size_t BalanceBoardDataSize);
NTSTATUS UpdateClassicController(_Inout_ PWIIMOTE_CLASSIC_CONTROLLER_STATE ClassicControllerState, _In_reads_bytes_(6) PUCHAR ClassicControllerData, _In_ size_t ClassicControllerDataSize);
NTSTATUS UpdateClassicControllerPro(_Inout_ PWIIMOTE_CLASSIC_CONTROLLER_STATE ClassicControllerState, _In_reads_bytes_(6) PUCHAR ClassicControllerProData, _In_ size_t ClassicControllerProDataSize);
NTSTATUS UpdateWiiUProController(_Inout_ PWIIMOTE_DEVICE_CONTEXT WiimoteContext, _Inout_ PWIIMOTE_CLASSIC_CONTROLLER_STATE ClassicControllerState, _In_reads_bytes_(11) PUCHAR WiiUProControllerData, _In_ size_t WiiUProControllerDataSize);
NTSTATUS UpdateGuitar(_Inout_ PWIIMOTE_GUITAR_STATE GuitarState, _In_reads_bytes_(6) PUCHAR GuitarData, _In_ size_t GuitarDataSize);
NTSTATUS UpdateIRCamera(_In_ PWIIMOTE_IR_STATE IRState, _In_reads_bytes_(10) PUCHAR IRData, _In_ size_t IRDataSize, _Out_ PBOOLEAN IRDataIsValid);
VOID UpdateClassicControllerButtons(_Inout_ PWIIMOTE_CLASSIC_CONTROLLER_STATE ClassicControllerState, _In_reads_bytes_(2) PUCHAR ButtonData);
VOID UpdateClassicControllerAxes(_Inout_ PWIIMOTE_CLASSIC_CONTROLLER_STATE ClassicControllerState, _In_reads_bytes_(2) PUCHAR ButtoInputDatanData);
BOOLEAN UpdateIRCameraPoint(_In_ PWIIMOTE_IR_POINT IRPointData1, _In_ PWIIMOTE_IR_POINT IRPointData2, _In_reads_bytes_(5) PUCHAR IRData);
VOID WiimoteStateResetToNullState(
_In_ PDEVICE_CONTEXT DeviceContext
)
{
PWIIMOTE_STATE WiimoteState = &DeviceContext->WiimoteContext.State;
// Reset all to zero => No buttons pressed
RtlSecureZeroMemory(WiimoteState, sizeof(WIIMOTE_STATE));
// Reset Accelerometers to null state
WiimoteState->WiiRemoteState.Accelerometer.X = 0x80;
WiimoteState->WiiRemoteState.Accelerometer.Y = 0x80;
WiimoteState->WiiRemoteState.Accelerometer.Z = 0x80;
// Reset IR data to "invalid data"
for (size_t i = 0; i < WIIMOTE_IR_POINTS_BUFFER_SIZE; ++i)
for (size_t j = 0; j < WIIMOTE_IR_POINTS; j++)
{
DeviceContext->WiimoteContext.State.IRState.Points[i][j].X = 0x3FF;
DeviceContext->WiimoteContext.State.IRState.Points[i][j].Y = 0x3FF;
}
HIDWiimoteStateUpdated(DeviceContext);
}
NTSTATUS WiimoteStateUpdate(
_In_ PDEVICE_CONTEXT DeviceContext,
_In_reads_bytes_(DataSize) PUCHAR Data,
_In_ _In_range_(1, SIZE_MAX) size_t DataSize
)
{
NTSTATUS Status = STATUS_SUCCESS;
BOOLEAN ForwardUpdateToHID = TRUE;
PWIIMOTE_DEVICE_CONTEXT WiimoteContext = &(DeviceContext->WiimoteContext);
PWIIMOTE_WII_REMOTE_STATE WiiRemoteState = &(WiimoteContext->State.WiiRemoteState);
BYTE ReportID = Data[0];
//Every Report but 0x3D has Core Buttons
if (ReportID != 0x3D)
{
Status = UpdateCoreButtons(WiiRemoteState, Data + 1, DataSize - 1);
if (!NT_SUCCESS(Status))
{
return Status;
}
}
// Process additional payload
switch (ReportID)
{
case 0x31: // Accelerometer
Status = UpdateAccelerometer(WiiRemoteState, Data + 3, DataSize - 3);
if (!NT_SUCCESS(Status))
{
return Status;
}
break;
case 0x32: // 8 Byte Extension
case 0x34: // 19 Byte Extension
Status = UpdateExtension(WiimoteContext, Data + 3, DataSize - 3);
if (!NT_SUCCESS(Status))
{
return Status;
}
break;
case 0x35: // Accelerometer & 16 Byte Extension
Status = UpdateAccelerometer(WiiRemoteState, Data + 3, DataSize - 3);
if (!NT_SUCCESS(Status))
{
return Status;
}
Status = UpdateExtension(WiimoteContext, Data + 6, DataSize - 6);
if (!NT_SUCCESS(Status))
{
return Status;
}
break;
case 0x36: // 10 Byte IR & 9 Byte Extension
Status = UpdateIRCamera(&(WiimoteContext->State.IRState), Data + 3, DataSize - 3, &ForwardUpdateToHID);
if (!NT_SUCCESS(Status))
{
return Status;
}
break;
}
if (ForwardUpdateToHID)
{
HIDWiimoteStateUpdated(DeviceContext);
}
return Status;
}
NTSTATUS
UpdateCoreButtons(
_Inout_ PWIIMOTE_WII_REMOTE_STATE WiiRemoteState,
_In_reads_bytes_(2) PUCHAR ButtonData,
_In_ size_t ButtonDataSize
)
{
if (ButtonDataSize < 2)
{
Trace("Data Buffer too small to read Core Buttons");
return STATUS_INVALID_BUFFER_SIZE;
}
WiiRemoteState->CoreButtons.A = (ButtonData[1] & 0x08);
WiiRemoteState->CoreButtons.B = (ButtonData[1] & 0x04);
WiiRemoteState->CoreButtons.One = (ButtonData[1] & 0x02);
WiiRemoteState->CoreButtons.Two = (ButtonData[1] & 0x01);
WiiRemoteState->CoreButtons.Minus = (ButtonData[1] & 0x10);
WiiRemoteState->CoreButtons.Plus = (ButtonData[0] & 0x10);
WiiRemoteState->CoreButtons.Home = (ButtonData[1] & 0x80);
WiiRemoteState->CoreButtons.DPad.Left = (ButtonData[0] & 0x01);
WiiRemoteState->CoreButtons.DPad.Right = (ButtonData[0] & 0x02);
WiiRemoteState->CoreButtons.DPad.Down = (ButtonData[0] & 0x04);
WiiRemoteState->CoreButtons.DPad.Up = (ButtonData[0] & 0x08);
return STATUS_SUCCESS;
}
NTSTATUS
UpdateAccelerometer(
_Inout_ PWIIMOTE_WII_REMOTE_STATE WiiRemoteState,
_In_reads_bytes_(3) PUCHAR AccelerometerData,
_In_ size_t AccelerometerDataSize
)
{
if (AccelerometerDataSize < 3)
{
Trace("Data Buffer too small to Update Accelerometer Data");
return STATUS_INVALID_BUFFER_SIZE;
}
/*
Accelerometer data is originally 10 Bits wide. 8 MSBs are carried in the Accelermoter bytes.
The 2 LSBs are packed into the Core Button bytes. (Only for X are actually 2 bits packed; for Y and Z only the second LSB is provided)
For further processing only the 8 MSB are used.
*/
WiiRemoteState->Accelerometer.X = AccelerometerData[0];
WiiRemoteState->Accelerometer.Y = AccelerometerData[1];
WiiRemoteState->Accelerometer.Z = AccelerometerData[2];
return STATUS_SUCCESS;
}
NTSTATUS UpdateExtension(
_Inout_ PWIIMOTE_DEVICE_CONTEXT WiimoteContext,
_In_reads_bytes_(DataSize) PUCHAR Data,
_In_ size_t DataSize
)
{
switch (WiimoteContext->Extension)
{
case Nunchuck:
return UpdateNunchuck(&(WiimoteContext->State.NunchuckState), Data, DataSize);
case BalanceBoard:
return UpdateBalanceBoard(&(WiimoteContext->State.BalanceBoardState), Data, DataSize);
case ClassicController:
return UpdateClassicController(&(WiimoteContext->State.ClassicControllerState), Data, DataSize);
case ClassicControllerPro:
return UpdateClassicControllerPro(&(WiimoteContext->State.ClassicControllerState), Data, DataSize);
case WiiUProController:
return UpdateWiiUProController(WiimoteContext, &(WiimoteContext->State.ClassicControllerState), Data, DataSize);
case Guitar:
return UpdateGuitar(&(WiimoteContext->State.GuitarState), Data, DataSize);
default:
return STATUS_SUCCESS;
}
}
NTSTATUS
UpdateNunchuck(
_Inout_ PWIIMOTE_NUNCHUCK_STATE NunchuckState,
_In_reads_bytes_(6) PUCHAR NunchuckData,
_In_ size_t NunchuckDataSize
)
{
if (NunchuckDataSize < 6)
{
Trace("Data Buffer too small to read Nunchuck Data");
return STATUS_INVALID_BUFFER_SIZE;
}
BYTE ButtonData = ~NunchuckData[5];
//Buttons
NunchuckState->Buttons.Z = ButtonData & 0x01;
NunchuckState->Buttons.C = ButtonData & 0x02;
//Analog Stick
NunchuckState->AnalogStick.X = NunchuckData[0];
NunchuckState->AnalogStick.Y = NunchuckData[1];
//Accelerometer
NunchuckState->Accelerometer.X = NunchuckData[2];
NunchuckState->Accelerometer.Y = NunchuckData[3];
NunchuckState->Accelerometer.Z = NunchuckData[4];
return STATUS_SUCCESS;
}
NTSTATUS
UpdateBalanceBoard(
_Inout_ PWIIMOTE_BALANCE_BOARD_STATE BalanceBoardState,
_In_reads_bytes_(8) PUCHAR BalanceBoardData,
_In_ size_t BalanceBoardDataSize
)
{
if (BalanceBoardDataSize < 8)
{
Trace("Data Buffer too small to read Balance Board Data");
return STATUS_INVALID_BUFFER_SIZE;
}
// Sensor Data is Big-Endian, Windows is always Little-Endian
BalanceBoardState->Sensor[WIIMOTE_BALANCE_BOARD_TOP_RIGHT] = RtlUshortByteSwap(*((PUSHORT)(BalanceBoardData + 0)));
BalanceBoardState->Sensor[WIIMOTE_BALANCE_BOARD_BOTTOM_RIGHT] = RtlUshortByteSwap(*((PUSHORT)(BalanceBoardData + 2)));
BalanceBoardState->Sensor[WIIMOTE_BALANCE_BOARD_TOP_LEFT] = RtlUshortByteSwap(*((PUSHORT)(BalanceBoardData + 4)));
BalanceBoardState->Sensor[WIIMOTE_BALANCE_BOARD_BOTTOM_LEFT] = RtlUshortByteSwap(*((PUSHORT)(BalanceBoardData + 6)));
return STATUS_SUCCESS;
}
NTSTATUS
UpdateClassicController(
_Inout_ PWIIMOTE_CLASSIC_CONTROLLER_STATE ClassicControllerState,
_In_reads_bytes_(6) PUCHAR ClassicControllerData,
_In_ size_t ClassicControllerDataSize
)
{
if (ClassicControllerDataSize < 6)
{
Trace("Data Buffer too small to read Classic Controller Data");
return STATUS_INVALID_BUFFER_SIZE;
}
// Buttons
UpdateClassicControllerButtons(ClassicControllerState, ClassicControllerData + 4);
// Axes
UpdateClassicControllerAxes(ClassicControllerState, ClassicControllerData);
// Trigger
ClassicControllerState->LeftTrigger = 0xFF & ((0x60 & ClassicControllerData[2]) >> 2);
ClassicControllerState->LeftTrigger |= 0xFF & ((0xE0 & ClassicControllerData[3]) >> 5);
ClassicControllerState->RightTrigger = 0xFF & (0x1F &
gitextract_3ar40yv7/
├── .gitignore
├── BuildAndZip/
│ ├── BuildAndZip.vcxproj
│ └── BuildAndZip.vcxproj.filters
├── BuildTools/
│ └── 7za/
│ ├── 7-zip.chm
│ ├── license.txt
│ └── readme.txt
├── HID Miniport/
│ ├── HID Miniport.rc
│ ├── HID Miniport.vcxproj
│ ├── HID Miniport.vcxproj.backup
│ ├── HID Miniport.vcxproj.filters
│ ├── Hidminiport.c
│ ├── Hidminiport.h
│ ├── Trace.c
│ ├── Trace.h
│ └── resource.h
├── HID Wiimote/
│ ├── Bluetooth.c
│ ├── Bluetooth.h
│ ├── Device.c
│ ├── Device.h
│ ├── DeviceInterface.c
│ ├── DeviceInterface.h
│ ├── DeviceInterfacePublic.h
│ ├── Driver.c
│ ├── Driver.h
│ ├── HID Wiimote.rc
│ ├── HID Wiimote.vcxproj
│ ├── HID Wiimote.vcxproj.backup
│ ├── HID Wiimote.vcxproj.filters
│ ├── HID.c
│ ├── HID.h
│ ├── HIDDescriptors.c
│ ├── HIDDescriptors.h
│ ├── HIDWiimote.h
│ ├── HIDWiimote.inf
│ ├── ReadIoControlBuffer.c
│ ├── ReadIoControlBuffer.h
│ ├── Trace.c
│ ├── Trace.h
│ ├── Wiimote.c
│ ├── Wiimote.h
│ ├── WiimoteSettings.c
│ ├── WiimoteSettings.h
│ ├── WiimoteState.c
│ ├── WiimoteState.h
│ ├── WiimoteToHIDParser.c
│ ├── WiimoteToHIDParser.h
│ └── resource.h
├── HID Wiimote Control Center/
│ ├── App.config
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── Control Center/
│ │ ├── DummyDeviceInterface.cs
│ │ └── WiimoteDevice.cs
│ ├── HID Wiimote Control Center.csproj
│ ├── Main Windows/
│ │ ├── ControlCenterWindow.xaml
│ │ ├── ControlCenterWindow.xaml.cs
│ │ ├── InstallerWindow.xaml
│ │ ├── InstallerWindow.xaml.cs
│ │ ├── UpdaterWindow.xaml
│ │ └── UpdaterWindow.xaml.cs
│ ├── Properties/
│ │ ├── App.Designer.cs
│ │ ├── App.resx
│ │ ├── AssemblyInfo.cs
│ │ ├── ControlCenter.Designer.cs
│ │ ├── ControlCenter.resx
│ │ ├── Installer.Designer.cs
│ │ ├── Installer.resx
│ │ ├── Settings.Designer.cs
│ │ ├── Settings.settings
│ │ └── app.manifest
│ ├── Resources/
│ │ ├── JulianLoehrCA.cer
│ │ └── UninstallerContent.txt
│ ├── Secondary Windows/
│ │ ├── About.xaml
│ │ └── About.xaml.cs
│ ├── Setup/
│ │ ├── DeviceDriver.cs
│ │ ├── DeviceDriverUninstallerRegistry.cs
│ │ ├── InstallStepAction/
│ │ │ ├── CopyFile.cs
│ │ │ ├── CreateRegistryUninstallKey.cs
│ │ │ ├── IInstallAction.cs
│ │ │ ├── RunDPInstall.cs
│ │ │ └── TextResourceToFile.cs
│ │ └── SetupAction/
│ │ ├── Certificate.cs
│ │ ├── DeviceDriver.cs
│ │ ├── ISetupAction.cs
│ │ └── TestMode.cs
│ ├── UserControls/
│ │ ├── LEDDisplay.xaml
│ │ ├── LEDDisplay.xaml.cs
│ │ ├── TaskList.xaml
│ │ └── TaskList.xaml.cs
│ └── Utility/
│ └── SingleInstanceProtector.cs
├── HID Wiimote Package/
│ ├── DPInst.xml
│ ├── EULA.txt
│ ├── HID Wiimote Package.vcxproj
│ ├── HID Wiimote Package.vcxproj.backup
│ ├── HID Wiimote Package.vcxproj.filters
│ └── Readme.txt
├── HID Wiimote User Mode/
│ ├── AssemblyInfo.cpp
│ ├── HID Wiimote User Mode.rc
│ ├── HID Wiimote User Mode.vcxproj
│ ├── HID Wiimote User Mode.vcxproj.filters
│ ├── IWiimoteDeviceInterface.h
│ ├── Log.cpp
│ ├── Log.h
│ ├── State.cpp
│ ├── State.h
│ ├── Status.cpp
│ ├── Status.h
│ ├── Stdafx.cpp
│ ├── Stdafx.h
│ ├── WiimoteDeviceInterface.cpp
│ ├── WiimoteDeviceInterface.h
│ ├── WiimoteDeviceInterfaceDiscoverer.cpp
│ ├── WiimoteDeviceInterfaceDiscoverer.h
│ ├── WiimoteDeviceInterfaceEnumerator.cpp
│ ├── WiimoteDeviceInterfaceEnumerator.h
│ └── resource.h
├── HID Wiimote.sln
├── LICENSE.md
├── README.md
└── ReleaseVersioning/
├── ReleaseVersioning.vcxproj
├── ReleaseVersioning.vcxproj.filters
├── Version.js
└── Version.wsf
SYMBOL INDEX (375 symbols across 63 files)
FILE: HID Miniport/Hidminiport.c
function NTSTATUS (line 16) | NTSTATUS
function NTSTATUS (line 57) | NTSTATUS
function NTSTATUS (line 72) | NTSTATUS
function NTSTATUS (line 106) | NTSTATUS
function NTSTATUS (line 162) | NTSTATUS
function VOID (line 196) | VOID
FILE: HID Miniport/Hidminiport.h
type NTSTATUS (line 39) | typedef NTSTATUS (*PNOTIFY_PRESENCE)(PDEVICE_OBJECT, BOOLEAN);
type HID_MINIPORT_ADDRESSES (line 41) | typedef struct _HID_MINIPORT_ADDRESSES
FILE: HID Miniport/Trace.c
function VOID (line 17) | VOID
FILE: HID Wiimote Control Center/App.xaml.cs
class App (line 21) | public partial class App : Application
method App (line 25) | public App()
method OnStartup (line 30) | private void OnStartup(object sender, StartupEventArgs e)
method ChangeMainWindow (line 65) | public static void ChangeMainWindow(Window NewWindow, Window CallingWi...
method CurrentDomain_UnhandledException (line 72) | private void CurrentDomain_UnhandledException(object sender, Unhandled...
FILE: HID Wiimote Control Center/Control Center/DummyDeviceInterface.cs
class DummyDeviceInterface (line 19) | class DummyDeviceInterface : UserModeLib.IWiimoteDeviceInterface
method Disconnect (line 36) | public void Disconnect()
method Initialize (line 40) | public State Initialize()
method SetDriverMode (line 45) | public bool SetDriverMode(DriverMode NewMode)
method SetEnableWiimoteXAxisAccelerometer (line 51) | public bool SetEnableWiimoteXAxisAccelerometer(bool Enabled)
method SetEnableWiimoteYAxisAccelerometer (line 57) | public bool SetEnableWiimoteYAxisAccelerometer(bool Enabled)
method SetSwapMouseButtons (line 63) | public bool SetSwapMouseButtons(bool Enabled)
method SetSwapTriggerAndShoulder (line 69) | public bool SetSwapTriggerAndShoulder(bool Enabled)
method SetSplitTrigger (line 75) | public bool SetSplitTrigger(bool Enabled)
method SetMapTriggerAsAxis (line 81) | public bool SetMapTriggerAsAxis(bool Enabled)
method SetMapTriggerAsButtons (line 87) | public bool SetMapTriggerAsButtons(bool Enabled)
FILE: HID Wiimote Control Center/Control Center/WiimoteDevice.cs
class WiimoteDevice (line 19) | public class WiimoteDevice : INotifyPropertyChanged
class Option (line 21) | public class Option<Type> : INotifyPropertyChanged
method Option (line 29) | public Option(Func<Type, bool> InterfaceDelegate)
method SetValue (line 46) | public void SetValue(Type Value)
method ChangeValue (line 52) | protected void ChangeValue(Type RequestedValue)
method OnPropertyChanged (line 66) | protected void OnPropertyChanged(string PropertyName)
method WiimoteDevice (line 91) | public WiimoteDevice(UserModeLib.IWiimoteDeviceInterface DeviceInterface)
method OnEnableAccelerometerAxisChanged (line 153) | private void OnEnableAccelerometerAxisChanged(object sender, PropertyC...
method OnPropertyChanged (line 171) | protected void OnPropertyChanged(string PropertyName)
method Disconnect (line 176) | public void Disconnect()
method Initilize (line 181) | public void Initilize()
method InitilizeAction (line 186) | protected void InitilizeAction()
method OnDeviceRemoved (line 200) | private void OnDeviceRemoved(object sender, System.EventArgs e)
method OnStatusUpdate (line 208) | private void OnStatusUpdate(object sender, UserModeLib.Status StatusUp...
method ApplyState (line 213) | protected void ApplyState(UserModeLib.State State)
method ApplyStatus (line 228) | protected void ApplyStatus(UserModeLib.Status Status)
FILE: HID Wiimote Control Center/Main Windows/ControlCenterWindow.xaml.cs
class ControlCenterWindow (line 25) | public partial class ControlCenterWindow : Window
method ControlCenterWindow (line 30) | public ControlCenterWindow()
method OnInitialized (line 35) | private void OnInitialized(object sender, System.EventArgs e)
method OnNewWiimoteDeviceInterfaceFound (line 48) | private void OnNewWiimoteDeviceInterfaceFound(object sender, UserModeL...
method OnWiimoteDeviceDisconneted (line 66) | private void OnWiimoteDeviceDisconneted(object sender, EventArgs e)
method OnInstallerClick (line 82) | private void OnInstallerClick(object sender, RoutedEventArgs e)
method OnAboutClick (line 87) | private void OnAboutClick(object sender, RoutedEventArgs e)
method OnClosing (line 112) | private void OnClosing(object sender, System.ComponentModel.CancelEven...
class ExtensionToStringConverter (line 130) | public class ExtensionToStringConverter : IValueConverter
method Convert (line 140) | public object Convert(object value, Type targetType, object parameter,...
method ConvertBack (line 165) | public object ConvertBack(object value, Type targetType, object parame...
class ModeToStringConverter (line 171) | public class ModeToStringConverter : IValueConverter
method Convert (line 180) | public object Convert(object value, Type targetType, object parameter,...
method ConvertBack (line 201) | public object ConvertBack(object value, Type targetType, object parame...
FILE: HID Wiimote Control Center/Main Windows/InstallerWindow.xaml.cs
class InstallerWindow (line 28) | public partial class InstallerWindow : Window
method InstallerWindow (line 32) | public InstallerWindow()
method OnInitialized (line 70) | private void OnInitialized(object sender, EventArgs e)
method InstallerActionButtonClick (line 75) | private void InstallerActionButtonClick(object sender, RoutedEventArgs e)
method CloseButtonClick (line 90) | private void CloseButtonClick(object sender, RoutedEventArgs e)
method AllRequirementsFulfilled (line 103) | private bool AllRequirementsFulfilled()
class InstallerAction (line 120) | public class InstallerAction : INotifyPropertyChanged
method InstallerAction (line 139) | public InstallerAction(string Title, bool Required, string Description...
method OnPropertyChanged (line 273) | protected void OnPropertyChanged(string PropertyName)
method StartTask (line 282) | private void StartTask(Action TaskAction)
method TaskCompletion (line 295) | private void TaskCompletion(Task CompletedTask)
method CheckIsGood (line 300) | private void CheckIsGood()
method ButtonAction (line 305) | private void ButtonAction()
method ButtonClicked (line 329) | public void ButtonClicked()
class BooleanToColorConverter (line 335) | public class BooleanToColorConverter : IValueConverter
method Convert (line 340) | public object Convert(object value, Type targetType, object parameter,...
method ConvertBack (line 347) | public object ConvertBack(object value, Type targetType, object parame...
FILE: HID Wiimote Control Center/Main Windows/UpdaterWindow.xaml.cs
class UpdaterWindow (line 29) | public partial class UpdaterWindow : Window
method UpdaterWindow (line 35) | public UpdaterWindow()
method AskForUpdate (line 49) | private bool AskForUpdate()
method OnInitialized (line 57) | private void OnInitialized(object sender, EventArgs e)
method OnLoaded (line 62) | private void OnLoaded(object sender, RoutedEventArgs e)
method StartTaskQueue (line 71) | private void StartTaskQueue()
method UpdaterTaskComplete (line 76) | private void UpdaterTaskComplete(Task<bool> CompletedTask, Object State)
method RemoveOldDeviceDriver (line 108) | private bool RemoveOldDeviceDriver()
method InstallNewDeviceDriver (line 130) | private bool InstallNewDeviceDriver()
method CloseButtonClick (line 152) | private void CloseButtonClick(object sender, RoutedEventArgs e)
FILE: HID Wiimote Control Center/Properties/App.Designer.cs
class App (line 22) | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resource...
method App (line 31) | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Mic...
FILE: HID Wiimote Control Center/Properties/ControlCenter.Designer.cs
class ControlCenter (line 22) | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resource...
method ControlCenter (line 31) | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Mic...
FILE: HID Wiimote Control Center/Properties/Installer.Designer.cs
class Installer (line 22) | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resource...
method Installer (line 31) | [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Mic...
FILE: HID Wiimote Control Center/Properties/Settings.Designer.cs
class Settings (line 14) | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
FILE: HID Wiimote Control Center/Secondary Windows/About.xaml.cs
class About (line 21) | public partial class About : Window
method About (line 23) | public About()
method OnInitialized (line 27) | private void OnInitialized(object sender, System.EventArgs e)
method HyperlinkRequestNavigate (line 33) | private void HyperlinkRequestNavigate(object sender, System.Windows.Na...
method OnCloseClick (line 38) | private void OnCloseClick(object sender, RoutedEventArgs e)
FILE: HID Wiimote Control Center/Setup/DeviceDriver.cs
class DeviceDriver (line 20) | static class DeviceDriver
method IsInstalled (line 29) | public static bool IsInstalled()
method Install (line 36) | public static void Install()
method Uninstall (line 77) | public static void Uninstall()
FILE: HID Wiimote Control Center/Setup/DeviceDriverUninstallerRegistry.cs
class DeviceDriverUninstallerRegistry (line 17) | static class DeviceDriverUninstallerRegistry
type Version (line 21) | private struct Version
method Version (line 28) | public Version(string VersionString)
method IsNewer (line 38) | public bool IsNewer(Version Other)
method ParseStringPart (line 63) | private static ushort ParseStringPart(string[] StringParts, int index)
type DeviceDriverState (line 76) | public enum DeviceDriverState { NoneInstalled, OlderInstalled, Current...
method GetDeviceDriverState (line 78) | public static DeviceDriverState GetDeviceDriverState(string AppVersion...
method GetDeviceDriverState (line 83) | public static DeviceDriverState GetDeviceDriverState(string AppVersion...
method GetInstalledVersionString (line 115) | public static string GetInstalledVersionString()
method GetUninstallString (line 121) | public static string GetUninstallString()
method CreateHIDWiimoteUninstallKey (line 133) | public static bool CreateHIDWiimoteUninstallKey(string UninstallCommna...
method GetHIDWiimoteUninstallKey (line 151) | private static RegistryKey GetHIDWiimoteUninstallKey()
FILE: HID Wiimote Control Center/Setup/InstallStepAction/CopyFile.cs
class CopyFile (line 15) | class CopyFile : IInstallStepAction
method CopyFile (line 21) | public CopyFile(string FileName, string InstallDir)
method Do (line 29) | public bool Do()
method Undo (line 40) | public void Undo()
method GetExceptionMessage (line 45) | public string GetExceptionMessage()
FILE: HID Wiimote Control Center/Setup/InstallStepAction/CreateRegistryUninstallKey.cs
class CreateRegistryUninstallKey (line 15) | class CreateRegistryUninstallKey : IInstallStepAction
method CreateRegistryUninstallKey (line 20) | public CreateRegistryUninstallKey(string UninstallString, string DPIns...
method Do (line 26) | public bool Do()
method Undo (line 31) | public void Undo()
method GetExceptionMessage (line 35) | public string GetExceptionMessage()
FILE: HID Wiimote Control Center/Setup/InstallStepAction/IInstallAction.cs
type IInstallStepAction (line 15) | interface IInstallStepAction
method Do (line 17) | bool Do();
method Undo (line 18) | void Undo();
method GetExceptionMessage (line 19) | string GetExceptionMessage();
FILE: HID Wiimote Control Center/Setup/InstallStepAction/RunDPInstall.cs
class RunDPInstall (line 17) | class RunDPInstall : IInstallStepAction
method RunDPInstall (line 22) | public RunDPInstall(string DPInstPath, string InfFilePath)
method Do (line 28) | public bool Do()
method Undo (line 36) | public void Undo()
method GetExceptionMessage (line 42) | public string GetExceptionMessage()
FILE: HID Wiimote Control Center/Setup/InstallStepAction/TextResourceToFile.cs
class TextResourceToFile (line 15) | class TextResourceToFile : IInstallStepAction
method TextResourceToFile (line 20) | public TextResourceToFile(string OutputPath, string FileContent)
method Do (line 26) | public bool Do()
method Undo (line 41) | public void Undo()
method GetExceptionMessage (line 46) | public string GetExceptionMessage()
FILE: HID Wiimote Control Center/Setup/SetupAction/Certificate.cs
class Certificate (line 17) | class Certificate : ISetupAction
method IsSetUp (line 22) | public bool IsSetUp()
method TrySetUp (line 44) | public void TrySetUp()
method TryRevert (line 60) | public void TryRevert()
FILE: HID Wiimote Control Center/Setup/SetupAction/DeviceDriver.cs
class DeviceDriver (line 16) | class DeviceDriver : ISetupAction
method IsSetUp (line 18) | public bool IsSetUp()
method TrySetUp (line 23) | public void TrySetUp()
method TryRevert (line 28) | public void TryRevert()
FILE: HID Wiimote Control Center/Setup/SetupAction/ISetupAction.cs
type ISetupAction (line 15) | public interface ISetupAction
method IsSetUp (line 17) | bool IsSetUp();
method TrySetUp (line 18) | void TrySetUp();
method TryRevert (line 19) | void TryRevert();
FILE: HID Wiimote Control Center/Setup/SetupAction/TestMode.cs
class TestMode (line 18) | class TestMode : ISetupAction
method IsSetUp (line 27) | public bool IsSetUp()
method TrySetUp (line 37) | public void TrySetUp()
method TryRevert (line 42) | public void TryRevert()
method RunBCDEdit (line 47) | private string RunBCDEdit(string Argument)
FILE: HID Wiimote Control Center/UserControls/LEDDisplay.xaml.cs
class LEDDisplay (line 24) | public partial class LEDDisplay : UserControl
method LEDDisplay (line 26) | public LEDDisplay()
class LEDStateToColorConverter (line 32) | public class LEDStateToColorConverter : IValueConverter
method Convert (line 37) | public object Convert(object value, Type targetType, object parameter,...
method ConvertBack (line 55) | public object ConvertBack(object value, Type targetType, object parame...
FILE: HID Wiimote Control Center/UserControls/TaskList.xaml.cs
class TaskList (line 25) | public partial class TaskList : UserControl
method TaskList (line 27) | public TaskList()
class Item (line 32) | public class Item : INotifyPropertyChanged
type TaskStatus (line 34) | public enum TaskStatus { Waiting, Running, Finished, Error };
method Item (line 43) | public Item(string DisplayMessage, Func<bool> QueuedTask)
method Item (line 50) | public Item(string DisplayMessage, TaskStatus Status)
method StartTask (line 76) | public void StartTask(Action<Task<bool>, Object> CompleteCallback)
method OnPropertyChanged (line 84) | protected void OnPropertyChanged(string PropertyName)
class StatusToBulletPointValueConverter (line 91) | public class StatusToBulletPointValueConverter : IValueConverter
method Convert (line 98) | public object Convert(object value, Type targetType, object parameter,...
method ConvertBack (line 117) | public object ConvertBack(object value, Type targetType, object parame...
FILE: HID Wiimote Control Center/Utility/SingleInstanceProtector.cs
class SingleInstanceProtector (line 21) | class SingleInstanceProtector
method SetForegroundWindow (line 24) | [DllImport("user32.dll")]
method ShowWindowAsync (line 26) | [DllImport("user32.dll")]
method IsIconic (line 28) | [DllImport("user32.dll")]
method SingleInstanceProtector (line 37) | public SingleInstanceProtector()
method IsFirstInstance (line 46) | public bool IsFirstInstance()
method OnAppExit (line 51) | private void OnAppExit(object sender, System.Windows.ExitEventArgs e)
method ShowOtherAppInstance (line 56) | public void ShowOtherAppInstance()
FILE: HID Wiimote User Mode/IWiimoteDeviceInterface.h
function namespace (line 18) | namespace HIDWiimote
FILE: HID Wiimote User Mode/Log.cpp
type HIDWiimote (line 17) | namespace HIDWiimote
type UserModeLib (line 19) | namespace UserModeLib
FILE: HID Wiimote User Mode/Log.h
function namespace (line 15) | namespace HIDWiimote
FILE: HID Wiimote User Mode/State.cpp
type HIDWiimote (line 20) | namespace HIDWiimote
type UserModeLib (line 22) | namespace UserModeLib
FILE: HID Wiimote User Mode/State.h
function namespace (line 19) | namespace HIDWiimote
FILE: HID Wiimote User Mode/Status.cpp
type HIDWiimote (line 20) | namespace HIDWiimote
type UserModeLib (line 22) | namespace UserModeLib
FILE: HID Wiimote User Mode/Status.h
function namespace (line 17) | namespace HIDWiimote
FILE: HID Wiimote User Mode/WiimoteDeviceInterface.cpp
type HIDWiimote (line 20) | namespace HIDWiimote
type UserModeLib (line 22) | namespace UserModeLib
FILE: HID Wiimote User Mode/WiimoteDeviceInterface.h
function namespace (line 17) | namespace HIDWiimote
FILE: HID Wiimote User Mode/WiimoteDeviceInterfaceDiscoverer.cpp
type HIDWiimote (line 18) | namespace HIDWiimote
type UserModeLib (line 20) | namespace UserModeLib
FILE: HID Wiimote User Mode/WiimoteDeviceInterfaceDiscoverer.h
function namespace (line 19) | namespace HIDWiimote
FILE: HID Wiimote User Mode/WiimoteDeviceInterfaceEnumerator.cpp
type HIDWiimote (line 22) | namespace HIDWiimote
type UserModeLib (line 24) | namespace UserModeLib
FILE: HID Wiimote User Mode/WiimoteDeviceInterfaceEnumerator.h
function namespace (line 15) | namespace HIDWiimote
FILE: HID Wiimote/Bluetooth.c
function NTSTATUS (line 25) | NTSTATUS
function NTSTATUS (line 59) | NTSTATUS
function NTSTATUS (line 140) | NTSTATUS
function NTSTATUS (line 162) | NTSTATUS
function NTSTATUS (line 185) | NTSTATUS
function NTSTATUS (line 215) | NTSTATUS
function NTSTATUS (line 261) | NTSTATUS
function NTSTATUS (line 312) | NTSTATUS
function VOID (line 370) | VOID
function VOID (line 390) | VOID
function NTSTATUS (line 429) | NTSTATUS
function VOID (line 493) | VOID
function VOID (line 536) | VOID
function NTSTATUS (line 579) | NTSTATUS
function NTSTATUS (line 587) | NTSTATUS
function NTSTATUS (line 619) | NTSTATUS
function NTSTATUS (line 635) | NTSTATUS
function VOID (line 690) | VOID
function NTSTATUS (line 703) | NTSTATUS
function VOID (line 737) | VOID
function NTSTATUS (line 802) | NTSTATUS
FILE: HID Wiimote/Bluetooth.h
type BLUETOOTH_DEVICE_CONTEXT (line 31) | typedef struct _BLUETOOTH_DEVICE_CONTEXT
type _BRB_L2CA_OPEN_CHANNEL (line 48) | struct _BRB_L2CA_OPEN_CHANNEL
type _BRB_L2CA_CLOSE_CHANNEL (line 49) | struct _BRB_L2CA_CLOSE_CHANNEL
type _BRB_L2CA_ACL_TRANSFER (line 50) | struct _BRB_L2CA_ACL_TRANSFER
FILE: HID Wiimote/Device.c
function NTSTATUS (line 14) | NTSTATUS
function NTSTATUS (line 79) | NTSTATUS
function NTSTATUS (line 122) | NTSTATUS
function NTSTATUS (line 149) | NTSTATUS
function NTSTATUS (line 182) | NTSTATUS
function VOID (line 215) | VOID
function NTSTATUS (line 225) | NTSTATUS
FILE: HID Wiimote/Device.h
type DEVICE_CONTEXT (line 22) | typedef struct _DEVICE_CONTEXT
FILE: HID Wiimote/DeviceInterface.c
type VOID (line 19) | typedef VOID DRIVER_MODE_SETTING_SETTER(_In_ PDEVICE_CONTEXT DeviceConte...
type VOID (line 20) | typedef VOID BOOLEAN_SETTING_SETTER(_In_ PDEVICE_CONTEXT DeviceContext, ...
function NTSTATUS (line 41) | NTSTATUS DeviceInterfaceCreate(_In_ PDEVICE_CONTEXT ParentDeviceContext)
function NTSTATUS (line 159) | NTSTATUS CreateSettingsInterfaceQueues(_In_ PDEVICE_INTERFACE_CONTEXT De...
function NTSTATUS (line 192) | NTSTATUS
function VOID (line 204) | VOID DeviceInterfaceWiimoteStateUpdated(_In_ PDEVICE_CONTEXT DeviceContext)
function VOID (line 209) | VOID
function VOID (line 261) | VOID
function VOID (line 286) | VOID
function VOID (line 295) | VOID
function VOID (line 309) | VOID
function VOID (line 322) | VOID
function VOID (line 334) | VOID ProcessSetDriverModeSetting(
function VOID (line 356) | VOID ProcessSetBooleanSetting(
FILE: HID Wiimote/DeviceInterface.h
type DEVICE_INTERFACE_CONTEXT (line 19) | typedef struct _DEVICE_INTERFACE_CONTEXT
FILE: HID Wiimote/DeviceInterfacePublic.h
type WIIMOTE_EXTENSION (line 54) | typedef enum _WIIMOTE_EXTENSION { None, Nunchuck, BalanceBoard, ClassicC...
type WIIMOTE_DRIVER_MODE (line 55) | typedef enum _WIIMOTE_DRIVER_MODE { Gamepad, PassThrough, IRMouse, DPadM...
type WIIMOTE_SETTINGS (line 58) | typedef struct _WIIMOTE_SETTINGS
type WIIMOTE_STATUS_IOCTL_DATA (line 72) | typedef struct _WIIMOTE_STATUS_IOCTL_DATA
type WIIMOTE_STATE_IOCTL_DATA (line 80) | typedef struct _WIIMOTE_STATE_IOCTL_DATA
FILE: HID Wiimote/Driver.c
function NTSTATUS (line 15) | NTSTATUS
FILE: HID Wiimote/HID.c
function NTSTATUS (line 30) | NTSTATUS HIDPrepare(
function NTSTATUS (line 45) | NTSTATUS
function PHID_DEVICE_CONTEXT (line 77) | PHID_DEVICE_CONTEXT
function VOID (line 85) | VOID
function VOID (line 124) | VOID
function VOID (line 152) | VOID
function VOID (line 180) | VOID
function VOID (line 209) | VOID ProcessGetString(
function VOID (line 253) | VOID
function NTSTATUS (line 263) | NTSTATUS
function VOID (line 276) | VOID
function VOID (line 316) | VOID
function VOID (line 324) | VOID
FILE: HID Wiimote/HID.h
type HID_DEVICE_CONTEXT (line 20) | typedef struct _HID_DEVICE_CONTEXT
type UCHAR (line 32) | typedef UCHAR HID_REPORT_DESCRIPTOR, *PHID_REPORT_DESCRIPTOR;
FILE: HID Wiimote/HIDDescriptors.h
type HID_GAMEPAD_REPORT (line 27) | typedef struct _HID_GAMEPAD_REPORT {
function VOID (line 39) | VOID
type HID_IRMOUSE_REPORT (line 54) | typedef struct _HID_IRMOUSE_REPORT
function VOID (line 62) | VOID
type HID_DPADMOUSE_REPORT (line 71) | typedef struct _HID_DPADMOUSE_REPORT
function VOID (line 79) | VOID
FILE: HID Wiimote/HIDWiimote.h
type DEVICE_CONTEXT (line 26) | typedef struct _DEVICE_CONTEXT DEVICE_CONTEXT, * PDEVICE_CONTEXT;
type DEVICE_INTERFACE_CONTEXT (line 27) | typedef struct _DEVICE_INTERFACE_CONTEXT DEVICE_INTERFACE_CONTEXT, *PDEV...
type WIIMOTE_DEVICE_CONTEXT (line 28) | typedef struct _WIIMOTE_DEVICE_CONTEXT WIIMOTE_DEVICE_CONTEXT, * PWIIMOT...
type BLUETOOTH_DEVICE_CONTEXT (line 29) | typedef struct _BLUETOOTH_DEVICE_CONTEXT BLUETOOTH_DEVICE_CONTEXT, * PBL...
type HID_DEVICE_CONTEXT (line 30) | typedef struct _HID_DEVICE_CONTEXT HID_DEVICE_CONTEXT, * PHID_DEVICE_CON...
type NTSTATUS (line 33) | typedef NTSTATUS (*PNOTIFY_PRESENCE)(PDEVICE_OBJECT, BOOLEAN);
type HID_MINIPORT_ADDRESSES (line 35) | typedef struct _HID_MINIPORT_ADDRESSES
FILE: HID Wiimote/ReadIoControlBuffer.c
function NTSTATUS (line 21) | NTSTATUS
function VOID (line 53) | VOID
function VOID (line 77) | VOID
function VOID (line 100) | VOID
function VOID (line 126) | VOID
FILE: HID Wiimote/ReadIoControlBuffer.h
type VOID (line 17) | typedef VOID EVT_READ_IO_CONTROL_BUFFER_FILL_BUFFER(_In_ PDEVICE_CONTEXT...
type EVT_READ_IO_CONTROL_BUFFER_FILL_BUFFER (line 18) | typedef EVT_READ_IO_CONTROL_BUFFER_FILL_BUFFER *PFN_READ_IO_CONTROL_BUFF...
type READ_IO_CONTROL_BUFFER (line 20) | typedef struct _READ_IO_CONTROL_BUFFER
FILE: HID Wiimote/Trace.c
function VOID (line 15) | VOID
function VOID (line 45) | VOID
function VOID (line 59) | VOID
FILE: HID Wiimote/Wiimote.c
function NTSTATUS (line 20) | NTSTATUS
function NTSTATUS (line 49) | NTSTATUS
function NTSTATUS (line 85) | NTSTATUS
function NTSTATUS (line 121) | NTSTATUS
function NTSTATUS (line 153) | NTSTATUS
function NTSTATUS (line 195) | NTSTATUS
function NTSTATUS (line 240) | NTSTATUS
function NTSTATUS (line 250) | NTSTATUS
function NTSTATUS (line 285) | NTSTATUS
function NTSTATUS (line 331) | NTSTATUS
function NTSTATUS (line 386) | NTSTATUS
function NTSTATUS (line 418) | NTSTATUS
function VOID (line 439) | VOID
function NTSTATUS (line 448) | NTSTATUS
function NTSTATUS (line 475) | NTSTATUS
function NTSTATUS (line 503) | NTSTATUS
function NTSTATUS (line 524) | NTSTATUS
function NTSTATUS (line 585) | NTSTATUS
function NTSTATUS (line 676) | NTSTATUS
function NTSTATUS (line 703) | NTSTATUS
function NTSTATUS (line 740) | NTSTATUS
function NTSTATUS (line 784) | NTSTATUS
function VOID (line 838) | VOID
FILE: HID Wiimote/Wiimote.h
type WIIMOTE_DEVICE_CONTEXT (line 22) | typedef struct _WIIMOTE_DEVICE_CONTEXT
FILE: HID Wiimote/WiimoteSettings.c
function VOID (line 57) | VOID
function VOID (line 87) | VOID
function VOID (line 101) | VOID
function VOID (line 113) | VOID
function VOID (line 125) | VOID
function VOID (line 137) | VOID
function VOID (line 149) | VOID
function VOID (line 161) | VOID
function VOID (line 173) | VOID
function NTSTATUS (line 191) | NTSTATUS
function VOID (line 244) | VOID
function VOID (line 259) | VOID
function VOID (line 274) | VOID
FILE: HID Wiimote/WiimoteState.c
function VOID (line 31) | VOID WiimoteStateResetToNullState(
function NTSTATUS (line 57) | NTSTATUS WiimoteStateUpdate(
function NTSTATUS (line 126) | NTSTATUS
function NTSTATUS (line 155) | NTSTATUS
function NTSTATUS (line 180) | NTSTATUS UpdateExtension(
function NTSTATUS (line 205) | NTSTATUS
function NTSTATUS (line 236) | NTSTATUS
function NTSTATUS (line 258) | NTSTATUS
function NTSTATUS (line 285) | NTSTATUS
function NTSTATUS (line 311) | NTSTATUS
function VOID (line 370) | VOID
function VOID (line 402) | VOID
function NTSTATUS (line 418) | NTSTATUS
function BOOLEAN (line 482) | BOOLEAN
FILE: HID Wiimote/WiimoteState.h
type WIIMOTE_WII_REMOTE_STATE (line 17) | typedef struct _WIIMOTE_WII_REMOTE_STATE
type WIIMOTE_IR_POINT (line 53) | typedef struct _WIIMOTE_IR_POINT
type WIIMOTE_IR_STATE (line 61) | typedef struct _WIIMOTE_IR_STATE
type WIIMOTE_NUNCHUCK_STATE (line 69) | typedef struct _WIIMOTE_NUNCHUCK_STATE
type WIIMOTE_BALANCE_BOARD_STATE (line 101) | typedef struct _WIIMOTE_BALANCE_BOARD_STATE
type WIIMOTE_CLASSIC_CONTROLLER_STATE (line 109) | typedef struct _WIIMOTE_CLASSIC_CONTROLLER_STATE
type WIIMOTE_GUITAR_STATE (line 155) | typedef struct _WIIMOTE_GUITAR_STATE
type WIIMOTE_STATE (line 184) | typedef struct _WIIMOTE_STATE
FILE: HID Wiimote/WiimoteToHIDParser.c
function VOID (line 17) | VOID
function VOID (line 33) | VOID
function VOID (line 49) | VOID
function VOID (line 62) | VOID
function VOID (line 83) | VOID
function BYTE (line 108) | BYTE
function VOID (line 124) | VOID
function VOID (line 152) | VOID
function UCHAR (line 195) | UCHAR
function BYTE (line 205) | BYTE
function UCHAR (line 221) | UCHAR
function BOOLEAN (line 260) | BOOLEAN AccumulateIRPoint(
function BOOLEAN (line 277) | BOOLEAN ParseIRPoints(
function VOID (line 306) | VOID ParseIRCamera(
function VOID (line 355) | VOID
function VOID (line 384) | VOID
function VOID (line 421) | VOID
function VOID (line 439) | VOID
function VOID (line 502) | VOID
function VOID (line 542) | VOID
function VOID (line 585) | VOID ParseWiimoteStateAsDPadMouse(
function VOID (line 612) | VOID ParseWiimoteStateAsIRMouse(
FILE: ReleaseVersioning/Version.js
function ParseVersionStringPart (line 18) | function ParseVersionStringPart(VersionString, Index)
function ParseVersionString (line 29) | function ParseVersionString(VersionString)
function GetVersionsFromReadme (line 43) | function GetVersionsFromReadme(ReadmePath)
function UpdateFile (line 89) | function UpdateFile(FilePath, NewContent)
function GenerateVersionPropsSheet (line 104) | function GenerateVersionPropsSheet(Versions, OutputPath)
function GenerateVersionStringClass (line 118) | function GenerateVersionStringClass(Versions, OutputPath)
function GenerateVersionStringHeaderFile (line 134) | function GenerateVersionStringHeaderFile(Versions, OutputPath)
Condensed preview — 122 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (571K chars).
[
{
"path": ".gitignore",
"chars": 5446,
"preview": "## Ignore Visual Studio temporary files, build results, and\r\n## files generated by popular Visual Studio add-ons.\r\n##\r\n#"
},
{
"path": "BuildAndZip/BuildAndZip.vcxproj",
"chars": 5271,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/ms"
},
{
"path": "BuildAndZip/BuildAndZip.vcxproj.filters",
"chars": 130,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
},
{
"path": "BuildTools/7za/license.txt",
"chars": 1133,
"preview": " 7-Zip Command line version\n ~~~~~~~~~~~~~~~~~~~~~~~~~~\n License for use and distribution\n ~~~~~~~~~"
},
{
"path": "BuildTools/7za/readme.txt",
"chars": 1213,
"preview": "7-Zip Command line version 9.20\n-------------------------------\n\n7-Zip is a file archiver with high compression ratio.\n7"
},
{
"path": "HID Miniport/HID Miniport.vcxproj",
"chars": 10228,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/m"
},
{
"path": "HID Miniport/HID Miniport.vcxproj.backup",
"chars": 11661,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.micros"
},
{
"path": "HID Miniport/HID Miniport.vcxproj.filters",
"chars": 1686,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbui"
},
{
"path": "HID Miniport/Hidminiport.c",
"chars": 4605,
"preview": "/*\r\n\r\nCopyright (C) 2014 Julian Lhr\r\nAll rights reserved.\r\n\r\nFilename:\r\n\thidminiport.c\r\n\r\nAbstract:\r\n\tActual miniport dr"
},
{
"path": "HID Miniport/Hidminiport.h",
"chars": 1061,
"preview": "/*\r\n\r\nCopyright (C) 2014 Julian Lhr\r\nAll rights reserved.\r\n\r\nFilename:\r\n\thidminiport.c\r\n\r\nAbstract:\r\n\tHeader file for hi"
},
{
"path": "HID Miniport/Trace.c",
"chars": 690,
"preview": "/*\r\n\r\nCopyright (C) 2013 Julian Lhr\r\nAll rights reserved.\r\n\r\nFilename:\r\n\tTrace.c\r\n\r\nAbstract:\r\n\tContains the code for Tr"
},
{
"path": "HID Miniport/Trace.h",
"chars": 364,
"preview": "/*\r\n\r\nCopyright (C) 2013 Julian Lhr\r\nAll rights reserved.\r\n\r\nFilename:\r\n\tTrace.h\r\n\r\nAbstract:\r\n\tHeader file for Trace.c\r"
},
{
"path": "HID Miniport/resource.h",
"chars": 392,
"preview": "//{{NO_DEPENDENCIES}}\n// Microsoft Visual C++ generated include file.\n// Used by HID Miniport.rc\n\n// Next default values"
},
{
"path": "HID Wiimote/Bluetooth.c",
"chars": 21305,
"preview": "/*\r\n\r\nCopyright (C) 2017 Julian Lhr\r\nAll rights reserved.\r\n\r\nFilename:\r\n\tBluetooth.c\r\n\r\nAbstract:\r\n\tContains all Bluetoo"
},
{
"path": "HID Wiimote/Bluetooth.h",
"chars": 1994,
"preview": "/*\r\n\r\nCopyright (C) 2017 Julian Lhr\r\nAll rights reserved.\r\n\r\nFilename:\r\n\tBluetooth.h\r\n\r\nAbstract:\r\n\tHeader file for Blue"
},
{
"path": "HID Wiimote/Device.c",
"chars": 5311,
"preview": "/*\r\n\r\nCopyright (C) 2017 Julian Lhr\r\nAll rights reserved.\r\n\r\nFilename:\r\n\tDevice.c\r\n\r\nAbstract:\r\n\tContains all system cal"
},
{
"path": "HID Wiimote/Device.h",
"chars": 1084,
"preview": "/*\r\n\r\nCopyright (C) 2017 Julian Lhr\r\nAll rights reserved.\r\n\r\nFilename:\r\n\tDevice.h\r\n\r\nAbstract:\r\n\tHeader file for Device."
},
{
"path": "HID Wiimote/DeviceInterface.c",
"chars": 11981,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\nAll rights reserved.\n\nFilename:\n\tDeviceInterface.c\n\nAbstract:\n\tContains code for the R"
},
{
"path": "HID Wiimote/DeviceInterface.h",
"chars": 666,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\nAll rights reserved.\n\nFilename:\n\tDeviceInterface.h\n\nAbstract:\n\tHeader file for DeviceI"
},
{
"path": "HID Wiimote/DeviceInterfacePublic.h",
"chars": 3223,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\nAll rights reserved.\n\nFilename:\n\tDeviceInterfacePublic.h\n\nAbstract:\n\tShared types and "
},
{
"path": "HID Wiimote/Driver.c",
"chars": 584,
"preview": "/*\r\n\r\nCopyright (C) 2017 Julian Lhr\r\nAll rights reserved.\r\n\r\nFilename:\r\n\tDriver.c\r\n\r\nAbstract:\r\n\tContains the entry code"
},
{
"path": "HID Wiimote/Driver.h",
"chars": 227,
"preview": "/*\r\n\r\nCopyright (C) 2017 Julian Lhr\r\nAll rights reserved.\r\n\r\nFilename:\r\n\tDriver.h\r\n\r\nAbstract:\r\n\tHeader file for Driver."
},
{
"path": "HID Wiimote/HID Wiimote.vcxproj",
"chars": 12456,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/m"
},
{
"path": "HID Wiimote/HID Wiimote.vcxproj.backup",
"chars": 12045,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.micros"
},
{
"path": "HID Wiimote/HID Wiimote.vcxproj.filters",
"chars": 4152,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbui"
},
{
"path": "HID Wiimote/HID.c",
"chars": 9188,
"preview": "/*\r\n\r\nCopyright (C) 2017 Julian Lhr\r\nAll rights reserved.\r\n\r\nFilename:\r\n\tHID.c\r\n\r\nAbstract:\r\n\tContains IOQueues and HID "
},
{
"path": "HID Wiimote/HID.h",
"chars": 910,
"preview": "/*\r\n\r\nCopyright (C) 2017 Julian Lhr\r\nAll rights reserved.\r\n\r\nFilename:\r\n\tHID.h\r\n\r\nAbstract:\r\n\tHeader file for HID.c\r\n*/\r"
},
{
"path": "HID Wiimote/HIDDescriptors.c",
"chars": 15605,
"preview": "/*\r\n\r\nCopyright (C) 2017 Julian Lhr\r\nAll rights reserved.\r\n\r\nFilename:\r\n\tHIDDescriptor.c\r\n\r\nAbstract:\r\n\tContains the def"
},
{
"path": "HID Wiimote/HIDDescriptors.h",
"chars": 1735,
"preview": "/*\r\n\r\nCopyright (C) 2017 Julian Lhr\r\nAll rights reserved.\r\n\r\nFilename:\r\n\tHIDDescriptor.h\r\n\r\nAbstract:\r\n\tCommon Header fi"
},
{
"path": "HID Wiimote/HIDWiimote.h",
"chars": 1038,
"preview": "/*\r\n\r\nCopyright (C) 2017 Julian Lhr\r\nAll rights reserved.\r\n\r\nFilename:\r\n\tHIDWiimote.h\r\n\r\nAbstract:\r\n\tCommon Header file."
},
{
"path": "HID Wiimote/ReadIoControlBuffer.c",
"chars": 3421,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\nAll rights reserved.\n\nFilename:\n\tReadIoControlBuffer.c\n\nAbstract:\n\tA manual dispatch Q"
},
{
"path": "HID Wiimote/ReadIoControlBuffer.h",
"chars": 1266,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\nAll rights reserved.\n\nFilename:\n\tReadIoControlBuffer.h\n\nAbstract:\n\tHeader file for Rea"
},
{
"path": "HID Wiimote/Trace.c",
"chars": 1885,
"preview": "/*\r\n\r\nCopyright (C) 2017 Julian Lhr\r\nAll rights reserved.\r\n\r\nFilename:\r\n\tTrace.c\r\n\r\nAbstract:\r\n\tContains the code for Tr"
},
{
"path": "HID Wiimote/Trace.h",
"chars": 571,
"preview": "/*\r\n\r\nCopyright (C) 2017 Julian Lhr\r\nAll rights reserved.\r\n\r\nFilename:\r\n\tTrace.h\r\n\r\nAbstract:\r\n\tHeader file for Trace.c\r"
},
{
"path": "HID Wiimote/Wiimote.c",
"chars": 19737,
"preview": "/*\r\n\r\nCopyright (C) 2017 Julian Lhr\r\nAll rights reserved.\r\n\r\nFilename:\r\n\tWiimote.c\r\n\r\nAbstract:\r\n\tManages the Wiimote st"
},
{
"path": "HID Wiimote/Wiimote.h",
"chars": 1013,
"preview": "/*\r\n\r\nCopyright (C) 2017 Julian Lhr\r\nAll rights reserved.\r\n\r\nFilename:\r\n\tWiimote.h\r\n\r\nAbstract:\r\n\tHeader file for Wiimot"
},
{
"path": "HID Wiimote/WiimoteSettings.c",
"chars": 8599,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\nAll rights reserved.\n\nFilename:\n\tWiimoteSettings.c\n\nAbstract:\n\tLoads and saves the Wii"
},
{
"path": "HID Wiimote/WiimoteSettings.h",
"chars": 1161,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\nAll rights reserved.\n\nFilename:\n\tWiimoteSettings.h\n\nAbstract:\n\tHeader file for Wiimote"
},
{
"path": "HID Wiimote/WiimoteState.c",
"chars": 16636,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\nAll rights reserved.\n\nFilename:\n\tWiimoteState.c\n\nAbstract:\n\tParses Wiimote Reports int"
},
{
"path": "HID Wiimote/WiimoteState.h",
"chars": 3472,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\nAll rights reserved.\n\nFilename:\n\tWiimoteState.h\n\nAbstract:\n\tHeader file for WiimoteSta"
},
{
"path": "HID Wiimote/WiimoteToHIDParser.c",
"chars": 21370,
"preview": "/*\r\n\r\nCopyright (C) 2017 Julian Lhr\r\nAll rights reserved.\r\n\r\nFilename:\r\n\tWiimoteToHIDParser.c\r\n\r\nAbstract:\r\n\tParses the "
},
{
"path": "HID Wiimote/WiimoteToHIDParser.h",
"chars": 761,
"preview": "/*\r\n\r\nCopyright (C) 2017 Julian Lhr\r\nAll rights reserved.\r\n\r\nFilename:\r\n\tWiimoteToHIDParser.h\r\n\r\nAbstract:\r\n\tHeader file"
},
{
"path": "HID Wiimote/resource.h",
"chars": 391,
"preview": "//{{NO_DEPENDENCIES}}\n// Microsoft Visual C++ generated include file.\n// Used by HID Wiimote.rc\n\n// Next default values "
},
{
"path": "HID Wiimote Control Center/App.config",
"chars": 176,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<configuration>\r\n\t<startup>\r\n <supportedRuntime version=\"v4.0\" sku=\".NETFrame"
},
{
"path": "HID Wiimote Control Center/App.xaml",
"chars": 383,
"preview": "<Application x:Class=\"HIDWiimote.ControlCenter.App\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/pr"
},
{
"path": "HID Wiimote Control Center/App.xaml.cs",
"chars": 3246,
"preview": "/*\n\nCopyright (C) 2017 Julian Löhr\nAll rights reserved.\n\nFilename:\n\tApp.cs\n\nAbstract:\n\tApp class\n\n*/\nusing System;\nusin"
},
{
"path": "HID Wiimote Control Center/Control Center/DummyDeviceInterface.cs",
"chars": 1941,
"preview": "/*\n\nCopyright (C) 2017 Julian Löhr\nAll rights reserved.\n\nFilename:\n\tDummyDeviceInterface.cs\n\nAbstract:\n\tDummy Implement"
},
{
"path": "HID Wiimote Control Center/Control Center/WiimoteDevice.cs",
"chars": 7638,
"preview": "/*\n\nCopyright (C) 2017 Julian Löhr\nAll rights reserved.\n\nFilename:\n\tWiimoteDevice.cs\n\nAbstract:\n\tInstance of a single W"
},
{
"path": "HID Wiimote Control Center/HID Wiimote Control Center.csproj",
"chars": 11326,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/m"
},
{
"path": "HID Wiimote Control Center/Main Windows/ControlCenterWindow.xaml",
"chars": 12389,
"preview": "<Window x:Class=\"HIDWiimote.ControlCenter.Main_Windows.ControlCenterWindow\"\n xmlns=\"http://schemas.microsoft.com"
},
{
"path": "HID Wiimote Control Center/Main Windows/ControlCenterWindow.xaml.cs",
"chars": 7698,
"preview": "/*\n\nCopyright (C) 2017 Julian Löhr\nAll rights reserved.\n\nFilename:\n\tControlCenterWindow.xaml.cs\n\nAbstract:\n\tMain Window"
},
{
"path": "HID Wiimote Control Center/Main Windows/InstallerWindow.xaml",
"chars": 2935,
"preview": "<Window x:Class=\"HIDWiimote.ControlCenter.Main_Windows.InstallerWindow\"\n xmlns=\"http://schemas.microsoft.com/win"
},
{
"path": "HID Wiimote Control Center/Main Windows/InstallerWindow.xaml.cs",
"chars": 9881,
"preview": "/*\n\nCopyright (C) 2017 Julian Löhr\nAll rights reserved.\n\nFilename:\n\tInstallerWindow.xaml.cs\n\nAbstract:\n\tInstaller Windo"
},
{
"path": "HID Wiimote Control Center/Main Windows/UpdaterWindow.xaml",
"chars": 1071,
"preview": "<Window x:Class=\"HIDWiimote.ControlCenter.Main_Windows.UpdaterWindow\"\n xmlns=\"http://schemas.microsoft.com/winfx"
},
{
"path": "HID Wiimote Control Center/Main Windows/UpdaterWindow.xaml.cs",
"chars": 5349,
"preview": "/*\n\nCopyright (C) 2018 Julian Löhr\nAll rights reserved.\n\nFilename:\n\tInstallerWindow.xaml.cs\n\nAbstract:\n\tWindow for the u"
},
{
"path": "HID Wiimote Control Center/Properties/App.Designer.cs",
"chars": 6739,
"preview": "//------------------------------------------------------------------------------\r\n// <auto-generated>\r\n// This code"
},
{
"path": "HID Wiimote Control Center/Properties/App.resx",
"chars": 7378,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!-- \n Microsoft ResX Schema \n \n Version 2.0\n \n The prim"
},
{
"path": "HID Wiimote Control Center/Properties/AssemblyInfo.cs",
"chars": 2591,
"preview": "using System.Reflection;\nusing System.Resources;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropSer"
},
{
"path": "HID Wiimote Control Center/Properties/ControlCenter.Designer.cs",
"chars": 6823,
"preview": "//------------------------------------------------------------------------------\r\n// <auto-generated>\r\n// This code"
},
{
"path": "HID Wiimote Control Center/Properties/ControlCenter.resx",
"chars": 6985,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!-- \n Microsoft ResX Schema \n \n Version 2.0\n \n The prim"
},
{
"path": "HID Wiimote Control Center/Properties/Installer.Designer.cs",
"chars": 10003,
"preview": "//------------------------------------------------------------------------------\r\n// <auto-generated>\r\n// This code"
},
{
"path": "HID Wiimote Control Center/Properties/Installer.resx",
"chars": 8515,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<root>\n <!-- \n Microsoft ResX Schema \n \n Version 2.0\n \n The prim"
},
{
"path": "HID Wiimote Control Center/Properties/Settings.Designer.cs",
"chars": 1105,
"preview": "//------------------------------------------------------------------------------\r\n// <auto-generated>\r\n// This code"
},
{
"path": "HID Wiimote Control Center/Properties/Settings.settings",
"chars": 193,
"preview": "<?xml version='1.0' encoding='utf-8'?>\n<SettingsFile xmlns=\"uri:settings\" CurrentProfile=\"(Default)\">\n <Profiles>\n "
},
{
"path": "HID Wiimote Control Center/Properties/app.manifest",
"chars": 3326,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<assembly manifestVersion=\"1.0\" xmlns=\"urn:schemas-microsoft-com:asm.v1\">\n <ass"
},
{
"path": "HID Wiimote Control Center/Resources/UninstallerContent.txt",
"chars": 270,
"preview": "cd \"{{InstallDir}}\"\nSTART /WAIT dpinst.exe /q /u \"{{InfFileName}}\"\nIF ERRORLEVEL 1 (\n\tECHO dpinst.exe failed: %ERRORLEVE"
},
{
"path": "HID Wiimote Control Center/Secondary Windows/About.xaml",
"chars": 2748,
"preview": "<Window x:Class=\"HIDWiimote.ControlCenter.Secondary_Windows.About\"\n xmlns=\"http://schemas.microsoft.com/winfx/20"
},
{
"path": "HID Wiimote Control Center/Secondary Windows/About.xaml.cs",
"chars": 990,
"preview": "/*\n\nCopyright (C) 2017 Julian Löhr\nAll rights reserved.\n\nFilename:\n\tAbout.xaml.cs\n\nAbstract:\n\tWindow with some addition"
},
{
"path": "HID Wiimote Control Center/Setup/DeviceDriver.cs",
"chars": 3124,
"preview": "/*\n\nCopyright (C) 2017 Julian Löhr\nAll rights reserved.\n\nFilename:\n\tDeviceDriver.cs\n\nAbstract:\n\tLet's one install and u"
},
{
"path": "HID Wiimote Control Center/Setup/DeviceDriverUninstallerRegistry.cs",
"chars": 5079,
"preview": "/*\n\nCopyright (C) 2017 Julian Löhr\nAll rights reserved.\n\nFilename:\n\tDeviceDriverUninstallerRegistry.cs\n\nAbstract:\n\tLet'"
},
{
"path": "HID Wiimote Control Center/Setup/InstallStepAction/CopyFile.cs",
"chars": 1042,
"preview": "/*\n\nCopyright (C) 2017 Julian Löhr\nAll rights reserved.\n\nFilename:\n\tCopyFile.cs\n\nAbstract:\n\tInstall Task to copy some f"
},
{
"path": "HID Wiimote Control Center/Setup/InstallStepAction/CreateRegistryUninstallKey.cs",
"chars": 919,
"preview": "/*\n\nCopyright (C) 2017 Julian Löhr\nAll rights reserved.\n\nFilename:\n\tCreateRegistryUninstallKey.cs\n\nAbstract:\n\tInstall T"
},
{
"path": "HID Wiimote Control Center/Setup/InstallStepAction/IInstallAction.cs",
"chars": 323,
"preview": "/*\n\nCopyright (C) 2017 Julian Löhr\nAll rights reserved.\n\nFilename:\n\tIInstallStepAction.cs\n\nAbstract:\n\tInterface for Ins"
},
{
"path": "HID Wiimote Control Center/Setup/InstallStepAction/RunDPInstall.cs",
"chars": 1000,
"preview": "/*\n\nCopyright (C) 2017 Julian Löhr\nAll rights reserved.\n\nFilename:\n\tRunDPInstall.cs\n\nAbstract:\n\tInstall Task to run dpi"
},
{
"path": "HID Wiimote Control Center/Setup/InstallStepAction/TextResourceToFile.cs",
"chars": 1120,
"preview": "/*\n\nCopyright (C) 2017 Julian Löhr\nAll rights reserved.\n\nFilename:\n\tTextResourceToFile.cs\n\nAbstract:\n\tInstall Task to w"
},
{
"path": "HID Wiimote Control Center/Setup/SetupAction/Certificate.cs",
"chars": 1726,
"preview": "/*\n\nCopyright (C) 2017 Julian Löhr\nAll rights reserved.\n\nFilename:\n\tCertificate.cs\n\nAbstract:\n\tSetup Action to install "
},
{
"path": "HID Wiimote Control Center/Setup/SetupAction/DeviceDriver.cs",
"chars": 559,
"preview": "/*\n\nCopyright (C) 2017 Julian Löhr\nAll rights reserved.\n\nFilename:\n\tDeviceDriver.cs\n\nAbstract:\n\tSetup Action to install"
},
{
"path": "HID Wiimote Control Center/Setup/SetupAction/ISetupAction.cs",
"chars": 302,
"preview": "/*\n\nCopyright (C) 2017 Julian Löhr\nAll rights reserved.\n\nFilename:\n\tISetupAction.cs\n\nAbstract:\n\tSetup Action Interface\n"
},
{
"path": "HID Wiimote Control Center/Setup/SetupAction/TestMode.cs",
"chars": 1785,
"preview": "/*\n\nCopyright (C) 2017 Julian Löhr\nAll rights reserved.\n\nFilename:\n\tTestMode.cs\n\nAbstract:\n\tSetup Action to enable and "
},
{
"path": "HID Wiimote Control Center/UserControls/LEDDisplay.xaml",
"chars": 1620,
"preview": "<UserControl x:Class=\"HIDWiimote.ControlCenter.UserControls.LEDDisplay\"\n xmlns=\"http://schemas.microsoft.co"
},
{
"path": "HID Wiimote Control Center/UserControls/LEDDisplay.xaml.cs",
"chars": 1453,
"preview": "/*\n\nCopyright (C) 2017 Julian Löhr\nAll rights reserved.\n\nFilename:\n\tLEDDisplay.cs\n\nAbstract:\n\tUser Control for displayi"
},
{
"path": "HID Wiimote Control Center/UserControls/TaskList.xaml",
"chars": 8386,
"preview": "<UserControl x:Name=\"userControl\" x:Class=\"HIDWiimote.ControlCenter.UserControls.TaskList\"\r\n xmlns=\"http://"
},
{
"path": "HID Wiimote Control Center/UserControls/TaskList.xaml.cs",
"chars": 3774,
"preview": "/*\n\nCopyright (C) 2018 Julian Löhr\nAll rights reserved.\n\nFilename:\n\tTaskList.xaml.cs\n\nAbstract:\n\tUser Control for displ"
},
{
"path": "HID Wiimote Control Center/Utility/SingleInstanceProtector.cs",
"chars": 2012,
"preview": "/*\n\nCopyright (C) 2017 Julian Löhr\nAll rights reserved.\n\nFilename:\n\tSingleInstanceProtector.cs\n\nAbstract:\n Single pr"
},
{
"path": "HID Wiimote Package/DPInst.xml",
"chars": 2058,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\" ?>\n<dpinst>\n <legacyMode />\n <suppressAddRemovePrograms />\n <enableNotListedLang"
},
{
"path": "HID Wiimote Package/EULA.txt",
"chars": 1885,
"preview": "TLDR: You don't need to pay for it. Don't use this software to harm or kill anybody. Use on your own risk. Don't sue me "
},
{
"path": "HID Wiimote Package/HID Wiimote Package.vcxproj",
"chars": 15094,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/m"
},
{
"path": "HID Wiimote Package/HID Wiimote Package.vcxproj.backup",
"chars": 28358,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" ToolsVersion=\"4.0\" xmlns=\"http://schemas.micros"
},
{
"path": "HID Wiimote Package/HID Wiimote Package.vcxproj.filters",
"chars": 666,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbui"
},
{
"path": "HID Wiimote Package/Readme.txt",
"chars": 2630,
"preview": "HID Wiimote 0.4.0.0\n\nHID Wiimote is a Windows Device Driver for the Nintendo Wii Remote.\n\nProject Homepage: https://www."
},
{
"path": "HID Wiimote User Mode/AssemblyInfo.cpp",
"chars": 1424,
"preview": "#include \"stdafx.h\"\n#include \"..\\ReleaseVersioning\\VersionStrings.h\"\n\nusing namespace System;\nusing namespace System::Re"
},
{
"path": "HID Wiimote User Mode/HID Wiimote User Mode.vcxproj",
"chars": 8514,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/m"
},
{
"path": "HID Wiimote User Mode/HID Wiimote User Mode.vcxproj.filters",
"chars": 2568,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
},
{
"path": "HID Wiimote User Mode/IWiimoteDeviceInterface.h",
"chars": 1039,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\n\tAll rights reserved.\n\nFilename:\n\tIWiimoteDeviceInterface.h\n\nAbstract:\n\tPublic managed"
},
{
"path": "HID Wiimote User Mode/Log.cpp",
"chars": 541,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\nAll rights reserved.\n\nFilename:\n\tLog.cpp\n\nAbstract:\n\tImplementation of Logging\n\n*/\n#in"
},
{
"path": "HID Wiimote User Mode/Log.h",
"chars": 431,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\nAll rights reserved.\n\nFilename:\n\tLog.h\n\nAbstract:\n\tStatic methods for Logging\n\n*/\n#pra"
},
{
"path": "HID Wiimote User Mode/State.cpp",
"chars": 1145,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\nAll rights reserved.\n\nFilename:\n\tState.cpp\n\nAbstract:\n\tImplementation of the Status Cl"
},
{
"path": "HID Wiimote User Mode/State.h",
"chars": 954,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\nAll rights reserved.\n\nFilename:\n\tState.h\n\nAbstract:\n\tPublic managed class that represe"
},
{
"path": "HID Wiimote User Mode/Status.cpp",
"chars": 826,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\nAll rights reserved.\n\nFilename:\n\tStatus.cpp\n\nAbstract:\n\tImplementation of the Status C"
},
{
"path": "HID Wiimote User Mode/Status.h",
"chars": 714,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\nAll rights reserved.\n\nFilename:\n\tStatus.h\n\nAbstract:\n\tPublic managed class that contai"
},
{
"path": "HID Wiimote User Mode/Stdafx.cpp",
"chars": 298,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\nAll rights reserved.\n\nFilename:\n\tStdafx.cpp\n\nAbstract:\n\tstdafx.cpp : source file that "
},
{
"path": "HID Wiimote User Mode/Stdafx.h",
"chars": 337,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\nAll rights reserved.\n\nFilename:\n\tStdafx.h\n\nAbstract:\n\tstdafx.h : include file for stan"
},
{
"path": "HID Wiimote User Mode/WiimoteDeviceInterface.cpp",
"chars": 7369,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\nAll rights reserved.\n\nFilename:\n\tWiimoteDeviceInterface.cpp\n\nAbstract:\n\tImplementation"
},
{
"path": "HID Wiimote User Mode/WiimoteDeviceInterface.h",
"chars": 2003,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\nAll rights reserved.\n\nFilename:\n\tWiimoteDeviceInterface.h\n\nAbstract:\n\tInternal managed"
},
{
"path": "HID Wiimote User Mode/WiimoteDeviceInterfaceDiscoverer.cpp",
"chars": 3301,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\nAll rights reserved.\n\nFilename:\n\tWiimoteDeviceInterfaceDiscoverer.cpp\n\nAbstract:\n\tImpl"
},
{
"path": "HID Wiimote User Mode/WiimoteDeviceInterfaceDiscoverer.h",
"chars": 983,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\nAll rights reserved.\n\nFilename:\n\tWiimoteDeviceInterfaceDiscoverer.h\n\nAbstract:\n\tPublic"
},
{
"path": "HID Wiimote User Mode/WiimoteDeviceInterfaceEnumerator.cpp",
"chars": 2269,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\nAll rights reserved.\n\nFilename:\n\tWiimoteDeviceInterfaceEnumerator.cpp\n\nAbstract:\n\tImpl"
},
{
"path": "HID Wiimote User Mode/WiimoteDeviceInterfaceEnumerator.h",
"chars": 744,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\nAll rights reserved.\n\nFilename:\n\tWiimoteDeviceInterfaceEnumerator.h\n\nAbstract:\n\tNative"
},
{
"path": "HID Wiimote User Mode/resource.h",
"chars": 401,
"preview": "//{{NO_DEPENDENCIES}}\n// Microsoft Visual C++ generated include file.\n// Used by HID Wiimote User Mode.rc\n\n// Next defau"
},
{
"path": "HID Wiimote.sln",
"chars": 11980,
"preview": "Microsoft Visual Studio Solution File, Format Version 12.00\r\n# Visual Studio 15\r\nVisualStudioVersion = 15.0.27130.2036\r\n"
},
{
"path": "LICENSE.md",
"chars": 35146,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
},
{
"path": "README.md",
"chars": 2175,
"preview": "# HID Wiimote - A Windows Device Driver for the Nintendo Wii Remote\n\n⚠ This project and repository has been archived, as"
},
{
"path": "ReleaseVersioning/ReleaseVersioning.vcxproj",
"chars": 2353,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/m"
},
{
"path": "ReleaseVersioning/ReleaseVersioning.vcxproj.filters",
"chars": 669,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
},
{
"path": "ReleaseVersioning/Version.js",
"chars": 4626,
"preview": "/*\n\nCopyright (C) 2017 Julian Lhr\nAll rights reserved.\n\nFilename:\n\tVersion.js\n\nAbstract:\n\tSmall script to generate vario"
},
{
"path": "ReleaseVersioning/Version.wsf",
"chars": 572,
"preview": "<package>\n <job id=\"GenerateVersionStringFiles\" >\n <script language=\"JScript\" src=\"Version.js\" />\n <scr"
}
]
// ... and 6 more files (download for full content)
About this extraction
This page contains the full source code of the jloehr/HID-Wiimote GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 122 files (515.3 KB), approximately 135.8k tokens, and a symbol index with 375 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.