Showing preview only (412K chars total). Download the full file or copy to clipboard to get everything.
Repository: BnuuySolutions/PSVR2Toolkit
Branch: main
Commit: 6f057a1b1b04
Files: 67
Total size: 388.6 KB
Directory structure:
gitextract_hh_yerca/
├── .github/
│ └── workflows/
│ └── msbuild.yml
├── .gitignore
├── LICENSE
├── PSVR2Toolkit.sln
├── README.md
├── assets/
│ └── Icons.pdn
├── include/
│ └── psvr2_toolkit_capi.h
└── projects/
├── PSVR2Toolkit.App/
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── AssemblyInfo.cs
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── PSVR2Toolkit.App.csproj
│ └── Resources/
│ └── .gitkeep
├── PSVR2Toolkit.IPC/
│ ├── IpcClient.cs
│ ├── IpcProtocol.cs
│ └── PSVR2Toolkit.IPC.csproj
├── UnifiedTelemetry.Client_stub/
│ ├── UnifiedTelemetry.Client_stub.vcxproj
│ ├── UnifiedTelemetry.Client_stub.vcxproj.filters
│ └── dllmain.cpp
├── UnifiedTelemetry.Model_stub/
│ ├── UnifiedTelemetry.Model_stub.vcxproj
│ ├── UnifiedTelemetry.Model_stub.vcxproj.filters
│ └── dllmain.cpp
├── UnifiedTelemetry.Service_stub/
│ ├── UnifiedTelemetry.Service_stub.vcxproj
│ ├── UnifiedTelemetry.Service_stub.vcxproj.filters
│ └── dllmain.cpp
├── libcustomshare/
│ ├── custom_share_manager.cpp
│ ├── custom_share_manager.h
│ ├── libcustomshare.vcxproj
│ └── libcustomshare.vcxproj.filters
├── psvr2_openvr_driver_ex/
│ ├── caesar_manager_hooks.cpp
│ ├── caesar_manager_hooks.h
│ ├── config.h
│ ├── device_provider_proxy.cpp
│ ├── device_provider_proxy.h
│ ├── driver_context_proxy.cpp
│ ├── driver_context_proxy.h
│ ├── driver_host_proxy.cpp
│ ├── driver_host_proxy.h
│ ├── eyelid_estimator.cpp
│ ├── eyelid_estimator.h
│ ├── hmd2_gaze.h
│ ├── hmd_device_hooks.cpp
│ ├── hmd_device_hooks.h
│ ├── hmd_driver_factory.cpp
│ ├── hmd_driver_loader.cpp
│ ├── hmd_driver_loader.h
│ ├── hmd_math.h
│ ├── hook_lib.h
│ ├── ipc_server.cpp
│ ├── ipc_server.h
│ ├── minhook/
│ │ ├── LICENSE.txt
│ │ └── include/
│ │ └── MinHook.h
│ ├── pad_trigger_effect.h
│ ├── psvr2_openvr_driver/
│ │ └── openvr/
│ │ ├── LICENSE
│ │ └── headers/
│ │ └── openvr_driver.h
│ ├── psvr2_openvr_driver_ex.vcxproj
│ ├── psvr2_openvr_driver_ex.vcxproj.filters
│ ├── trigger_effect_manager.cpp
│ ├── trigger_effect_manager.h
│ ├── usb_thread_gaze.cpp
│ ├── usb_thread_gaze.h
│ ├── usb_thread_hooks.cpp
│ ├── usb_thread_hooks.h
│ ├── util.h
│ └── vr_settings.h
└── shared/
└── ipc_protocol.h
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/workflows/msbuild.yml
================================================
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: MSBuild
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: .
# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: ReleaseCI
# Directory for build artifacts
ARTIFACTS_DIR: ${{github.workspace}}/artifacts
permissions:
contents: read
jobs:
build:
runs-on: windows-2025-vs2026
steps:
- uses: actions/checkout@v4
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1.0.2
- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} /p:OutDir=${{env.ARTIFACTS_DIR}} ${{env.SOLUTION_FILE_PATH}}
- name: Upload artifacts
id: upload-artifacts
uses: actions/upload-artifact@v4
with:
name: psvr2-toolkit-build
path: ${{env.ARTIFACTS_DIR}}
- id: optional_step_id
uses: signpath/github-action-submit-signing-request@v2
with:
api-token: ${{ secrets.SIGNPATH_API_TOKEN }}
organization-id: e5b00777-6877-43dd-8f53-89ac106cb9be
project-slug: PSVR2Toolkit
signing-policy-slug: test-signing
github-artifact-id: ${{ steps.upload-artifacts.outputs.artifact-id }}
wait-for-completion: true
output-artifact-directory: ${{env.ARTIFACTS_DIR}}
================================================
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/main/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.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/
# ASP.NET Scaffolding
ScaffoldingReadMe.txt
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
# but not Directory.Build.rsp, as it configures directory-level build defaults
!Directory.Build.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# 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
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*.json
coverage*.xml
coverage*.info
# 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
# Note: 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
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/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
*.appxbundle
*.appxupload
# 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
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# 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
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# 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 6 auto-generated project file (contains which files were open etc.)
*.vbp
# Visual Studio 6 workspace and project file (working project files containing files to include in project)
*.dsw
*.dsp
# Visual Studio 6 technical files
*.ncb
*.aps
# 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/
# CodeRush personal settings
.cr/personal
# 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
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# Visual Studio History (VSHistory) files
.vshistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# Fody - auto-generated XML schema
FodyWeavers.xsd
# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# Windows Installer files from build outputs
*.cab
*.msi
*.msix
*.msm
*.msp
# JetBrains Rider
*.sln.iml
# MinHook
!projects/psvr2_openvr_driver_ex/minhook/lib/*
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2026 Bnuuy Solutions
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: PSVR2Toolkit.sln
================================================
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.12.35506.116
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "psvr2_openvr_driver_ex", "projects\psvr2_openvr_driver_ex\psvr2_openvr_driver_ex.vcxproj", "{B2A22051-5E4F-4471-A6B6-73DD9BE4AC49}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnifiedTelemetry.Client_stub", "projects\UnifiedTelemetry.Client_stub\UnifiedTelemetry.Client_stub.vcxproj", "{A17F69A1-4CBD-4B92-BEAD-D331A378533A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnifiedTelemetry.Model_stub", "projects\UnifiedTelemetry.Model_stub\UnifiedTelemetry.Model_stub.vcxproj", "{479C51AE-D86B-433F-ADAA-DCDD1646300A}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnifiedTelemetry.Service_stub", "projects\UnifiedTelemetry.Service_stub\UnifiedTelemetry.Service_stub.vcxproj", "{40ADD18D-A928-4ABF-BE63-4591F53A4801}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PSVR2Toolkit.IPC", "projects\PSVR2Toolkit.IPC\PSVR2Toolkit.IPC.csproj", "{48FCC06F-F55F-F3B4-0563-5CD83BA2FC85}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PSVR2Toolkit.App", "projects\PSVR2Toolkit.App\PSVR2Toolkit.App.csproj", "{8E6661D1-6A40-4949-93CC-2280909E2DB3}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libcustomshare", "projects\libcustomshare\libcustomshare.vcxproj", "{EABC1D23-54F9-455F-9FB4-C0A7A01CA592}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
DebugCI|x64 = DebugCI|x64
Release|x64 = Release|x64
ReleaseCI|x64 = ReleaseCI|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B2A22051-5E4F-4471-A6B6-73DD9BE4AC49}.Debug|x64.ActiveCfg = Debug|x64
{B2A22051-5E4F-4471-A6B6-73DD9BE4AC49}.Debug|x64.Build.0 = Debug|x64
{B2A22051-5E4F-4471-A6B6-73DD9BE4AC49}.DebugCI|x64.ActiveCfg = DebugCI|x64
{B2A22051-5E4F-4471-A6B6-73DD9BE4AC49}.DebugCI|x64.Build.0 = DebugCI|x64
{B2A22051-5E4F-4471-A6B6-73DD9BE4AC49}.Release|x64.ActiveCfg = Release|x64
{B2A22051-5E4F-4471-A6B6-73DD9BE4AC49}.Release|x64.Build.0 = Release|x64
{B2A22051-5E4F-4471-A6B6-73DD9BE4AC49}.ReleaseCI|x64.ActiveCfg = ReleaseCI|x64
{B2A22051-5E4F-4471-A6B6-73DD9BE4AC49}.ReleaseCI|x64.Build.0 = ReleaseCI|x64
{A17F69A1-4CBD-4B92-BEAD-D331A378533A}.Debug|x64.ActiveCfg = Debug|x64
{A17F69A1-4CBD-4B92-BEAD-D331A378533A}.Debug|x64.Build.0 = Debug|x64
{A17F69A1-4CBD-4B92-BEAD-D331A378533A}.DebugCI|x64.ActiveCfg = DebugCI|x64
{A17F69A1-4CBD-4B92-BEAD-D331A378533A}.DebugCI|x64.Build.0 = DebugCI|x64
{A17F69A1-4CBD-4B92-BEAD-D331A378533A}.Release|x64.ActiveCfg = Release|x64
{A17F69A1-4CBD-4B92-BEAD-D331A378533A}.Release|x64.Build.0 = Release|x64
{A17F69A1-4CBD-4B92-BEAD-D331A378533A}.ReleaseCI|x64.ActiveCfg = ReleaseCI|x64
{A17F69A1-4CBD-4B92-BEAD-D331A378533A}.ReleaseCI|x64.Build.0 = ReleaseCI|x64
{479C51AE-D86B-433F-ADAA-DCDD1646300A}.Debug|x64.ActiveCfg = Debug|x64
{479C51AE-D86B-433F-ADAA-DCDD1646300A}.Debug|x64.Build.0 = Debug|x64
{479C51AE-D86B-433F-ADAA-DCDD1646300A}.DebugCI|x64.ActiveCfg = DebugCI|x64
{479C51AE-D86B-433F-ADAA-DCDD1646300A}.DebugCI|x64.Build.0 = DebugCI|x64
{479C51AE-D86B-433F-ADAA-DCDD1646300A}.Release|x64.ActiveCfg = Release|x64
{479C51AE-D86B-433F-ADAA-DCDD1646300A}.Release|x64.Build.0 = Release|x64
{479C51AE-D86B-433F-ADAA-DCDD1646300A}.ReleaseCI|x64.ActiveCfg = ReleaseCI|x64
{479C51AE-D86B-433F-ADAA-DCDD1646300A}.ReleaseCI|x64.Build.0 = ReleaseCI|x64
{40ADD18D-A928-4ABF-BE63-4591F53A4801}.Debug|x64.ActiveCfg = Debug|x64
{40ADD18D-A928-4ABF-BE63-4591F53A4801}.Debug|x64.Build.0 = Debug|x64
{40ADD18D-A928-4ABF-BE63-4591F53A4801}.DebugCI|x64.ActiveCfg = DebugCI|x64
{40ADD18D-A928-4ABF-BE63-4591F53A4801}.DebugCI|x64.Build.0 = DebugCI|x64
{40ADD18D-A928-4ABF-BE63-4591F53A4801}.Release|x64.ActiveCfg = Release|x64
{40ADD18D-A928-4ABF-BE63-4591F53A4801}.Release|x64.Build.0 = Release|x64
{40ADD18D-A928-4ABF-BE63-4591F53A4801}.ReleaseCI|x64.ActiveCfg = ReleaseCI|x64
{40ADD18D-A928-4ABF-BE63-4591F53A4801}.ReleaseCI|x64.Build.0 = ReleaseCI|x64
{48FCC06F-F55F-F3B4-0563-5CD83BA2FC85}.Debug|x64.ActiveCfg = Debug|Any CPU
{48FCC06F-F55F-F3B4-0563-5CD83BA2FC85}.Debug|x64.Build.0 = Debug|Any CPU
{48FCC06F-F55F-F3B4-0563-5CD83BA2FC85}.DebugCI|x64.ActiveCfg = DebugCI|Any CPU
{48FCC06F-F55F-F3B4-0563-5CD83BA2FC85}.DebugCI|x64.Build.0 = DebugCI|Any CPU
{48FCC06F-F55F-F3B4-0563-5CD83BA2FC85}.Release|x64.ActiveCfg = Release|Any CPU
{48FCC06F-F55F-F3B4-0563-5CD83BA2FC85}.Release|x64.Build.0 = Release|Any CPU
{48FCC06F-F55F-F3B4-0563-5CD83BA2FC85}.ReleaseCI|x64.ActiveCfg = ReleaseCI|Any CPU
{48FCC06F-F55F-F3B4-0563-5CD83BA2FC85}.ReleaseCI|x64.Build.0 = ReleaseCI|Any CPU
{8E6661D1-6A40-4949-93CC-2280909E2DB3}.Debug|x64.ActiveCfg = Debug|Any CPU
{8E6661D1-6A40-4949-93CC-2280909E2DB3}.Debug|x64.Build.0 = Debug|Any CPU
{8E6661D1-6A40-4949-93CC-2280909E2DB3}.DebugCI|x64.ActiveCfg = DebugCI|Any CPU
{8E6661D1-6A40-4949-93CC-2280909E2DB3}.DebugCI|x64.Build.0 = DebugCI|Any CPU
{8E6661D1-6A40-4949-93CC-2280909E2DB3}.Release|x64.ActiveCfg = Release|Any CPU
{8E6661D1-6A40-4949-93CC-2280909E2DB3}.Release|x64.Build.0 = Release|Any CPU
{8E6661D1-6A40-4949-93CC-2280909E2DB3}.ReleaseCI|x64.ActiveCfg = ReleaseCI|Any CPU
{8E6661D1-6A40-4949-93CC-2280909E2DB3}.ReleaseCI|x64.Build.0 = ReleaseCI|Any CPU
{EABC1D23-54F9-455F-9FB4-C0A7A01CA592}.Debug|x64.ActiveCfg = Debug|x64
{EABC1D23-54F9-455F-9FB4-C0A7A01CA592}.Debug|x64.Build.0 = Debug|x64
{EABC1D23-54F9-455F-9FB4-C0A7A01CA592}.DebugCI|x64.ActiveCfg = Debug|x64
{EABC1D23-54F9-455F-9FB4-C0A7A01CA592}.DebugCI|x64.Build.0 = Debug|x64
{EABC1D23-54F9-455F-9FB4-C0A7A01CA592}.Release|x64.ActiveCfg = Release|x64
{EABC1D23-54F9-455F-9FB4-C0A7A01CA592}.Release|x64.Build.0 = Release|x64
{EABC1D23-54F9-455F-9FB4-C0A7A01CA592}.ReleaseCI|x64.ActiveCfg = Release|x64
{EABC1D23-54F9-455F-9FB4-C0A7A01CA592}.ReleaseCI|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4519F772-725B-47BF-BD00-0EA336012E8C}
EndGlobalSection
EndGlobal
================================================
FILE: README.md
================================================
> [!WARNING]
> If you have paid for PlayStation VR2 Toolkit, you have been scammed and you should immediately request a refund. PlayStation VR2 Toolkit is entirely free and **is intended for NON-COMMERCIAL use only**, we do not attempt to profit off of it. Additionally, eye tracking data from PlayStation VR2 Toolkit **must not** be used in commercial environments and/or for commercial purposes. \
> \
> PlayStation VR2 Toolkit is provided "as is", without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose and noninfringement. In no event shall the authors or copyright holders be liable for any claim, damages or other liability, whether in an action of contract, tort or otherwise, arising from, out of or in connection with the software or the use or other dealings in the software.
> [!NOTE]
> Bnuuy Solutions and PlayStation VR2 Toolkit is not affiliated with Sony Interactive Entertainment, our project is not official or endorsed by Sony Interactive Entertainment in any way. \
> \
> Sony, Sony Interactive Entertainment and PS VR2/PlayStation VR2 are trademarks or registered trademarks of Sony Interactive Entertainment LLC in the United States of America and elsewhere.
<p align="center"><img src="https://github.com/BnuuySolutions/PSVR2Toolkit/blob/main/assets/Icon.png?raw=true" width="128" height="128"></p>
<h1 align="center">PlayStation VR2 Toolkit</h1>
[](https://opensource.org/licenses/MIT) [](https://discord.gg/jym8CgJPF3)
Unofficial modification for the official PlayStation VR2 driver/app, which aims to improve your PlayStation VR2 experience on PC.
## Features
- Eye tracking\*
- Improved controller prediction
- Improved controller haptics (w/ PCM haptics) (coming soon, see `custom-controller-sync` branch and [Custom Controller LED Sync and Enhanced Haptics
#24](https://github.com/BnuuySolutions/PSVR2Toolkit/pull/24))
- Adaptive triggers
For developers, we also have our own API library, which allows you to take full advantage of these features.
\* Eye tracking calibration is currently not available yet, we have a few things to work out before we are ready to ship this feature!
## Installation Guide
1.) Open Steam, go to the PS VR2 app, click on the cog wheel, and go to "Manage -> Browse local files". (If you are using a copy of the PS VR2 app not installed by Steam, go to that instead.)
2.) Inside the newly opened file explorer, go into "SteamVR_Plug-In", then "bin" and finally "win64".
3.) Rename "driver_playstation_vr2.dll" to "driver_playstation_vr2_orig.dll" (**IT MUST BE CALLED "driver_playstation_vr2_orig.dll", DO NOT RENAME IT TO ANYTHING ELSE, IT MUST BE EXACTLY THAT**)
4.) Download the "driver_playstation_vr2.dll" attached in a release, and copy/move it into the same folder where "driver_playstation_vr2_orig.dll" is at.
5.) Your "win64" directory should now have 2 DLL files inside it, "driver_playstation_vr2.dll" and "driver_playstation_vr2_orig.dll". If you do not have both of those files, you fucked something up.
6.) Enjoy your new features, please give us feedback in our [Discord](https://discord.gg/jym8CgJPF3).
# Contact
Have any legal complaints or questions?
- Email: `wdh at bnuuy.solutions`
- Discord: `notahopper`
================================================
FILE: include/psvr2_toolkit_capi.h
================================================
#pragma once
#include <windows.h>
#include <inttypes.h>
#define TRIGGER_EFFECT_CONTROL_POINT_NUM 10
enum EResultType {
Result_None = 0,
Result_NotInitialized = 1,
Result_AlreadyInitialized = 2,
};
enum EVRControllerType {
VRController_Left = 0,
VRController_Right = 1,
VRController_Both = 2,
};
#ifdef __cplusplus
extern "C" {
#endif
// Initialize the PS VR2 Toolkit CAPI library. You must call this function EXACTLY ONCE
// at the beginning of your program.
EResultType WINAPI psvr2_toolkit_init();
EResultType WINAPI psvr2_toolkit_set_trigger_effect_off(EVRControllerType controllerType);
EResultType WINAPI psvr2_toolkit_set_trigger_effect_feedback(EVRControllerType controllerType, uint8_t position, uint8_t strength);
EResultType WINAPI psvr2_toolkit_set_trigger_effect_weapon(EVRControllerType controllerType, uint8_t startPosition, uint8_t endPosition, uint8_t strength);
EResultType WINAPI psvr2_toolkit_set_trigger_effect_vibration(EVRControllerType controllerType, uint8_t position, uint8_t amplitude, uint8_t frequency);
EResultType WINAPI psvr2_toolkit_set_trigger_effect_multiple_position_feedback(EVRControllerType controllerType, uint8_t strength[TRIGGER_EFFECT_CONTROL_POINT_NUM]);
EResultType WINAPI psvr2_toolkit_set_trigger_effect_slope_feedback(EVRControllerType controllerType, uint8_t startPosition, uint8_t endPosition, uint8_t startStrength, uint8_t endStrength);
EResultType WINAPI psvr2_toolkit_set_trigger_effect_multiple_position_vibration(EVRControllerType controllerType, uint8_t frequency, uint8_t amplitude[TRIGGER_EFFECT_CONTROL_POINT_NUM]);
EResultType WINAPI psvr2_toolkit_get_gaze_state();
/* Private functions */
EResultType WINAPI psvr2_toolkit_private_set_gaze_enabled_eye();
EResultType WINAPI psvr2_toolkit_private_start_gaze_calibration();
EResultType WINAPI psvr2_toolkit_private_stop_gaze_calibration();
EResultType WINAPI psvr2_toolkit_private_set_gaze_calibration_point();
/* Unknown gaze functions */
EResultType WINAPI psvr2_toolkit_private_gaze_0x08a964bcd9e0a1f4();
EResultType WINAPI psvr2_toolkit_private_gaze_0x913203ac32f332fd();
#ifdef __cplusplus
}
#endif
================================================
FILE: projects/PSVR2Toolkit.App/App.xaml
================================================
<Application x:Class="PSVR2Toolkit.App.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:PSVR2Toolkit.App"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>
================================================
FILE: projects/PSVR2Toolkit.App/App.xaml.cs
================================================
using System.Windows;
namespace PSVR2Toolkit.App;
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
================================================
FILE: projects/PSVR2Toolkit.App/AssemblyInfo.cs
================================================
using System.Windows;
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
================================================
FILE: projects/PSVR2Toolkit.App/MainWindow.xaml
================================================
<Window x:Class="PSVR2Toolkit.App.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:PSVR2Toolkit.App"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid>
</Grid>
</Window>
================================================
FILE: projects/PSVR2Toolkit.App/MainWindow.xaml.cs
================================================
using System.Windows;
namespace PSVR2Toolkit.App;
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
================================================
FILE: projects/PSVR2Toolkit.App/PSVR2Toolkit.App.csproj
================================================
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net472</TargetFramework>
<LangVersion>11</LangVersion>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<Configurations>Debug;Release;ReleaseCI;DebugCI</Configurations>
</PropertyGroup>
<ItemGroup>
<Folder Include="Resources\" />
</ItemGroup>
</Project>
================================================
FILE: projects/PSVR2Toolkit.App/Resources/.gitkeep
================================================
================================================
FILE: projects/PSVR2Toolkit.IPC/IpcClient.cs
================================================
using System;
using System.Diagnostics;
using System.Net.Sockets;
using System.Runtime.InteropServices;
using System.Threading;
using System.Threading.Tasks;
namespace PSVR2Toolkit.CAPI {
public class IpcClient {
private const ushort IPC_SERVER_PORT = 3364;
private const ushort k_unIpcVersion = 2;
private static IpcClient m_pInstance;
private bool m_running = false;
private TcpClient? m_client;
private NetworkStream? m_stream;
private Thread? m_receiveThread;
private readonly object m_gazeStateLock = new object();
private TaskCompletionSource<CommandDataServerGazeDataResult>? m_gazeTask;
private CancellationTokenSource m_forceShutdownToken;
private ushort m_serverIpcVersion = k_unIpcVersion;
private int m_gazePumpPeriodMs = 8; // 120Hz
private CommandDataServerGazeDataResult2? m_lastGazeState = null;
public static IpcClient Instance() {
if ( m_pInstance == null ) {
m_pInstance = new IpcClient();
}
return m_pInstance;
}
public bool Start() {
if ( m_running ) {
return false;
}
try {
m_client = new TcpClient();
m_client.Connect("127.0.0.1", IPC_SERVER_PORT);
if ( m_client.Connected ) {
m_stream = m_client.GetStream();
m_running = true;
m_forceShutdownToken = new CancellationTokenSource();
m_receiveThread = new Thread(() => ReceiveLoop(m_forceShutdownToken.Token));
m_receiveThread.Start();
return true;
}
return false;
} catch ( SocketException ex ) {
Console.WriteLine($"[IPC_CLIENT] Connection failed. LastError = {ex.SocketErrorCode}");
return false;
}
}
public void Stop() {
if ( !m_running ) {
return;
}
m_running = false;
m_forceShutdownToken.Cancel();
lock ( m_gazeStateLock ) {
m_gazeTask?.TrySetCanceled();
m_gazeTask = null;
}
try {
m_stream?.Close();
m_client?.Close();
} catch { }
if ( m_receiveThread != null && m_receiveThread.IsAlive ) {
if ( !m_receiveThread.Join(2000) ) {
m_receiveThread.Interrupt();
}
}
m_stream?.Dispose();
m_client?.Dispose();
m_forceShutdownToken.Dispose();
}
private void ReceiveLoop(CancellationToken token) {
byte[] buffer = new byte[1024];
try {
var clientSocket = m_client!.Client;
m_stream!.ReadTimeout = 1; // make the underlying stream non-blocking
CommandDataClientRequestHandshake clientHandshakeRequest = new CommandDataClientRequestHandshake() {
ipcVersion = k_unIpcVersion,
processId = ( uint ) Process.GetCurrentProcess().Id
};
SendIpcCommand(ECommandType.ClientRequestHandshake, clientHandshakeRequest);
var sw = Stopwatch.StartNew();
long nextPumpMs = sw.ElapsedMilliseconds;
while ( m_running && !token.IsCancellationRequested ) {
// query gaze state every so often
var now = sw.ElapsedMilliseconds;
if ( now >= nextPumpMs ) {
SendIpcCommand(ECommandType.ClientRequestGazeData);
nextPumpMs = now + m_gazePumpPeriodMs;
}
bool readable = clientSocket.Poll(1000 /* 1ms */, SelectMode.SelectRead);
if ( readable && clientSocket.Available > 0 ) {
int available = clientSocket.Available;
if ( available > buffer.Length ) {
buffer = new byte[Math.Max(available, buffer.Length * 2)];
}
int bytesRead = m_stream.Read(buffer, 0, Math.Min(buffer.Length, available));
if ( bytesRead <= 0 ) {
Console.WriteLine("[IPC_CLIENT] Disconnected from server.");
break;
}
if ( bytesRead < Marshal.SizeOf<CommandHeader>() ) {
Console.WriteLine("[IPC_CLIENT] Received invalid command header size.");
continue;
}
HandleIpcCommand(buffer, bytesRead);
continue;
}
Thread.Sleep(1);
}
} catch ( OperationCanceledException ) {
// nothing special, this is from shutdown most likely
} catch ( Exception ex ) {
if ( m_running ) {
Console.WriteLine($"[IPC_CLIENT] Error in receive loop: {ex.Message}");
}
}
}
private GazeEyeResult2 UpgradeGazeEyeResult(GazeEyeResult eye)
{
return new GazeEyeResult2
{
isGazeOriginValid = eye.isGazeOriginValid,
gazeOriginMm = eye.gazeOriginMm,
isGazeDirValid = eye.isGazeDirValid,
gazeDirNorm = eye.gazeDirNorm,
isPupilDiaValid = eye.isPupilDiaValid,
pupilDiaMm = eye.pupilDiaMm,
isBlinkValid = eye.isBlinkValid,
blink = eye.blink,
isOpenEnabled = false,
open = 0f
};
}
private CommandDataServerGazeDataResult2 UpgradeGazeDataResult(CommandDataServerGazeDataResult result)
{
return new CommandDataServerGazeDataResult2
{
leftEye = UpgradeGazeEyeResult(result.leftEye),
rightEye = UpgradeGazeEyeResult(result.rightEye)
};
}
private void HandleIpcCommand(byte[] pBuffer, int bytesReceived) {
CommandHeader header = ByteArrayToStructure<CommandHeader>(pBuffer, 0);
switch ( header.type ) {
case ECommandType.ServerPong: {
Console.WriteLine("[IPC_CLIENT] Received Pong from server.");
break;
}
case ECommandType.ServerHandshakeResult: {
if ( header.dataLen == Marshal.SizeOf<CommandDataServerHandshakeResult>() ) {
CommandDataServerHandshakeResult response = ByteArrayToStructure<CommandDataServerHandshakeResult>(pBuffer, Marshal.SizeOf<CommandHeader>());
m_serverIpcVersion = response.ipcVersion;
switch ( response.result ) {
case EHandshakeResult.Success: {
Console.WriteLine("[IPC_CLIENT] Handshake successful!");
break;
}
case EHandshakeResult.Failed: {
Console.WriteLine("[IPC_CLIENT] Handshake failed!");
break;
}
case EHandshakeResult.Outdated: {
Console.WriteLine($"[IPC_CLIENT] Handshake failed with reason: Outdated client. Please upgrade to an IPC version of {response.ipcVersion}");
break;
}
}
}
break;
}
case ECommandType.ServerGazeDataResult: {
if ( m_serverIpcVersion == 1 ) {
if ( header.dataLen == Marshal.SizeOf<CommandDataServerGazeDataResult>() ) {
CommandDataServerGazeDataResult response = ByteArrayToStructure<CommandDataServerGazeDataResult>(pBuffer, Marshal.SizeOf<CommandHeader>());
m_lastGazeState = UpgradeGazeDataResult(response);
}
} else {
if ( header.dataLen == Marshal.SizeOf<CommandDataServerGazeDataResult2>() ) {
CommandDataServerGazeDataResult2 response = ByteArrayToStructure<CommandDataServerGazeDataResult2>(pBuffer, Marshal.SizeOf<CommandHeader>());
m_lastGazeState = response;
}
}
break;
}
}
}
private void SendIpcCommand<T>(ECommandType type, T data = default) where T : struct {
if ( !m_running )
return;
int dataLen = data.Equals(default(T)) ? 0 : Marshal.SizeOf<T>();
int bufferLen = Marshal.SizeOf<CommandHeader>() + dataLen;
byte[] buffer = new byte[bufferLen];
CommandHeader header = new CommandHeader
{
type = type,
dataLen = dataLen
};
IntPtr headerPtr = Marshal.AllocHGlobal(Marshal.SizeOf<CommandHeader>());
Marshal.StructureToPtr(header, headerPtr, false);
Marshal.Copy(headerPtr, buffer, 0, Marshal.SizeOf<CommandHeader>());
Marshal.FreeHGlobal(headerPtr);
if ( dataLen > 0 ) {
IntPtr dataPtr = Marshal.AllocHGlobal(dataLen);
Marshal.StructureToPtr(data, dataPtr, false);
Marshal.Copy(dataPtr, buffer, Marshal.SizeOf<CommandHeader>(), dataLen);
Marshal.FreeHGlobal(dataPtr);
}
m_stream.Write(buffer, 0, buffer.Length);
}
// no data
private void SendIpcCommand(ECommandType type) {
if ( !m_running )
return;
int bufferLen = Marshal.SizeOf<CommandHeader>();
byte[] buffer = new byte[bufferLen];
CommandHeader header = new CommandHeader
{
type = type,
dataLen = 0
};
IntPtr headerPtr = Marshal.AllocHGlobal(Marshal.SizeOf<CommandHeader>());
Marshal.StructureToPtr(header, headerPtr, false);
Marshal.Copy(headerPtr, buffer, 0, Marshal.SizeOf<CommandHeader>());
Marshal.FreeHGlobal(headerPtr);
m_stream.Write(buffer, 0, buffer.Length);
}
private T ByteArrayToStructure<T>(byte[] bytes, int offset) where T : struct {
int size = Marshal.SizeOf<T>();
if ( size > bytes.Length - offset ) {
throw new ArgumentException("Byte array is too small to contain the structure.");
}
IntPtr ptr = Marshal.AllocHGlobal(size);
Marshal.Copy(bytes, offset, ptr, size);
T structure = (T)Marshal.PtrToStructure(ptr, typeof(T));
Marshal.FreeHGlobal(ptr);
return structure;
}
public CommandDataServerGazeDataResult2 RequestEyeTrackingData() {
if ( !m_running ) {
return new CommandDataServerGazeDataResult2();
}
return m_lastGazeState ?? new CommandDataServerGazeDataResult2();
}
public void TriggerEffectDisable(EVRControllerType controllerType) {
if ( !m_running ) {
return;
}
CommandDataClientTriggerEffectOff effectOff = new CommandDataClientTriggerEffectOff() {
controllerType = controllerType
};
SendIpcCommand(ECommandType.ClientTriggerEffectOff, effectOff);
}
public void TriggerEffectFeedback(EVRControllerType controllerType, byte position, byte strength) {
if ( !m_running ) {
return;
}
CommandDataClientTriggerEffectFeedback effectFeedback = new CommandDataClientTriggerEffectFeedback() {
controllerType = controllerType,
position = position,
strength = strength,
};
SendIpcCommand(ECommandType.ClientTriggerEffectFeedback, effectFeedback);
}
public void TriggerEffectWeapon(EVRControllerType controllerType, byte startPosition, byte endPosition, byte strength) {
if ( !m_running ) {
return;
}
CommandDataClientTriggerEffectWeapon effectWeapon = new CommandDataClientTriggerEffectWeapon() {
controllerType = controllerType,
startPosition = startPosition,
endPosition = endPosition,
strength = strength,
};
SendIpcCommand(ECommandType.ClientTriggerEffectWeapon, effectWeapon);
}
public void TriggerEffectVibration(EVRControllerType controllerType, byte position, byte amplitude, byte frequency) {
if ( !m_running ) {
return;
}
CommandDataClientTriggerEffectVibration effectVibration = new CommandDataClientTriggerEffectVibration() {
controllerType = controllerType,
position = position,
amplitude = amplitude,
frequency = frequency,
};
SendIpcCommand(ECommandType.ClientTriggerEffectVibration, effectVibration);
}
public void TriggerEffectMultiplePositionFeedback(EVRControllerType controllerType, byte[] strength) {
if ( !m_running ) {
return;
}
CommandDataClientTriggerEffectMultiplePositionFeedback effectVibration = new CommandDataClientTriggerEffectMultiplePositionFeedback() {
controllerType = controllerType,
strength = strength,
};
SendIpcCommand(ECommandType.ClientTriggerEffectMultiplePositionFeedback, effectVibration);
}
public void TriggerEffectSlopeFeedback(EVRControllerType controllerType, byte startPosition, byte endPosition, byte startStrength, byte endStrength) {
if ( !m_running ) {
return;
}
CommandDataClientTriggerEffectSlopeFeedback effectVibration = new CommandDataClientTriggerEffectSlopeFeedback() {
controllerType = controllerType,
startPosition = startPosition,
endPosition = endPosition,
startStrength = startStrength,
endStrength = endStrength,
};
SendIpcCommand(ECommandType.ClientTriggerEffectSlopeFeedback, effectVibration);
}
public void TriggerEffectMultiplePositionVibration(EVRControllerType controllerType, byte frequency, byte[] amplitude) {
if ( !m_running ) {
return;
}
CommandDataClientTriggerEffectMultiplePositionVibration effectVibration = new CommandDataClientTriggerEffectMultiplePositionVibration() {
controllerType = controllerType,
frequency = frequency,
amplitude = amplitude,
};
SendIpcCommand(ECommandType.ClientTriggerEffectMultiplePositionVibration, effectVibration);
}
}
}
================================================
FILE: projects/PSVR2Toolkit.IPC/IpcProtocol.cs
================================================
using System.Runtime.InteropServices;
namespace PSVR2Toolkit.CAPI {
public enum ECommandType : ushort {
ClientPing, // No command data.
ServerPong, // No command data.
ClientRequestHandshake, // CommandDataClientRequestHandshake
ServerHandshakeResult, // CommandDataServerHandshakeResult
ClientRequestGazeData, // No command data.
ServerGazeDataResult, // CommandDataServerGazeDataResult
ClientTriggerEffectOff, // CommandDataClientTriggerEffectOff
ClientTriggerEffectFeedback, // CommandDataClientTriggerEffectFeedback
ClientTriggerEffectWeapon, // CommandDataClientTriggerEffectWeapon
ClientTriggerEffectVibration, // CommandDataClientTriggerEffectVibration
ClientTriggerEffectMultiplePositionFeedback, // CommandDataClientTriggerEffectMultiplePositionFeedback
ClientTriggerEffectSlopeFeedback, // CommandDataClientTriggerEffectSlopeFeedback
ClientTriggerEffectMultiplePositionVibration, // CommandDataClientTriggerEffectMultiplePositionVibration
};
public enum EHandshakeResult : byte {
Failed,
Success,
Outdated,
};
public enum EVRControllerType : byte {
Left,
Right,
Both,
};
[StructLayout(LayoutKind.Sequential)]
public struct CommandDataClientRequestHandshake {
public ushort ipcVersion; // The IPC version this client is using.
public uint processId;
};
[StructLayout(LayoutKind.Sequential)]
public struct CommandDataServerHandshakeResult {
public EHandshakeResult result;
public ushort ipcVersion; // The IPC version the server is using.
};
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct GazeVector3 {
public float x, y, z;
};
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct GazeEyeResult {
[MarshalAs(UnmanagedType.I1)]
public bool isGazeOriginValid;
public GazeVector3 gazeOriginMm;
[MarshalAs(UnmanagedType.I1)]
public bool isGazeDirValid;
public GazeVector3 gazeDirNorm;
[MarshalAs(UnmanagedType.I1)]
public bool isPupilDiaValid;
public float pupilDiaMm;
[MarshalAs(UnmanagedType.I1)]
public bool isBlinkValid;
[MarshalAs(UnmanagedType.I1)]
public bool blink;
};
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct GazeEyeResult2 {
[MarshalAs(UnmanagedType.I1)]
public bool isGazeOriginValid;
public GazeVector3 gazeOriginMm;
[MarshalAs(UnmanagedType.I1)]
public bool isGazeDirValid;
public GazeVector3 gazeDirNorm;
[MarshalAs(UnmanagedType.I1)]
public bool isPupilDiaValid;
public float pupilDiaMm;
[MarshalAs(UnmanagedType.I1)]
public bool isBlinkValid;
[MarshalAs(UnmanagedType.I1)]
public bool blink;
[MarshalAs(UnmanagedType.I1)]
public bool isOpenEnabled;
public float open;
};
[StructLayout(LayoutKind.Sequential)]
public struct CommandDataServerGazeDataResult {
public GazeEyeResult leftEye;
public GazeEyeResult rightEye;
};
[StructLayout(LayoutKind.Sequential)]
public struct CommandDataServerGazeDataResult2 {
public GazeEyeResult2 leftEye;
public GazeEyeResult2 rightEye;
};
[StructLayout(LayoutKind.Sequential)]
public struct CommandHeader {
public ECommandType type;
public int dataLen;
};
[StructLayout(LayoutKind.Sequential)]
public struct CommandDataClientTriggerEffectOff {
public EVRControllerType controllerType;
};
[StructLayout(LayoutKind.Sequential)]
public struct CommandDataClientTriggerEffectFeedback {
public EVRControllerType controllerType;
public byte position;
public byte strength;
};
[StructLayout(LayoutKind.Sequential)]
public struct CommandDataClientTriggerEffectWeapon {
public EVRControllerType controllerType;
public byte startPosition;
public byte endPosition;
public byte strength;
};
[StructLayout(LayoutKind.Sequential)]
public struct CommandDataClientTriggerEffectVibration {
public EVRControllerType controllerType;
public byte position;
public byte amplitude;
public byte frequency;
};
[StructLayout(LayoutKind.Sequential)]
public struct CommandDataClientTriggerEffectMultiplePositionFeedback {
public EVRControllerType controllerType;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
public byte[] strength;
};
[StructLayout(LayoutKind.Sequential)]
public struct CommandDataClientTriggerEffectSlopeFeedback {
public EVRControllerType controllerType;
public byte startPosition;
public byte endPosition;
public byte startStrength;
public byte endStrength;
};
[StructLayout(LayoutKind.Sequential)]
public struct CommandDataClientTriggerEffectMultiplePositionVibration {
public EVRControllerType controllerType;
public byte frequency;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
public byte[] amplitude;
};
}
================================================
FILE: projects/PSVR2Toolkit.IPC/PSVR2Toolkit.IPC.csproj
================================================
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>11</LangVersion>
<Configurations>Debug;Release;ReleaseCI;DebugCI</Configurations>
</PropertyGroup>
</Project>
================================================
FILE: projects/UnifiedTelemetry.Client_stub/UnifiedTelemetry.Client_stub.vcxproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="DebugCI|x64">
<Configuration>DebugCI</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseCI|x64">
<Configuration>ReleaseCI</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{a17f69a1-4cbd-4b92-bead-d331a378533a}</ProjectGuid>
<RootNamespace>UnifiedTelemetryClient</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugCI|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseCI|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugCI|x64'" 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)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseCI|x64'" 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)'=='Debug|x64'">
<TargetName>UnifiedTelemetry.Client</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugCI|x64'">
<TargetName>UnifiedTelemetry.Client</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<TargetName>UnifiedTelemetry.Client</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseCI|x64'">
<TargetName>UnifiedTelemetry.Client</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;UNIFIEDTELEMETRYCLIENT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugCI|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;UNIFIEDTELEMETRYCLIENT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;UNIFIEDTELEMETRYCLIENT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalOptions>/pdbaltpath:%_PDB% %(AdditionalOptions)</AdditionalOptions>
</Link>
<PostBuildEvent>
<Command>copy /Y "$(TargetPath)" "$(SolutionDir)projects\PSVR2Toolkit.App\Resources\$(TargetFileName)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseCI|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;UNIFIEDTELEMETRYCLIENT_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalOptions>/pdbaltpath:%_PDB% %(AdditionalOptions)</AdditionalOptions>
</Link>
<PostBuildEvent>
<Command>copy /Y "$(TargetPath)" "$(SolutionDir)projects\PSVR2Toolkit.App\Resources\$(TargetFileName)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
================================================
FILE: projects/UnifiedTelemetry.Client_stub/UnifiedTelemetry.Client_stub.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;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
================================================
FILE: projects/UnifiedTelemetry.Client_stub/dllmain.cpp
================================================
extern "C" __declspec(dllexport) void utCreateClient() {}
extern "C" __declspec(dllexport) void utDestroyClient() {}
extern "C" __declspec(dllexport) void utInitClient() {}
extern "C" __declspec(dllexport) void utGetUserClockTimestamp() {}
extern "C" __declspec(dllexport) void utDispatch() {}
extern "C" __declspec(dllexport) void utUserDispatch() {}
extern "C" __declspec(dllexport) void utDispatchRecord() {}
extern "C" __declspec(dllexport) void utGetCommonPropertiesObject() {}
extern "C" __declspec(dllexport) void utCreateObject() {}
extern "C" __declspec(dllexport) void utApplyObjectToEvent() {}
extern "C" __declspec(dllexport) void utSetClientTransport() {}
================================================
FILE: projects/UnifiedTelemetry.Model_stub/UnifiedTelemetry.Model_stub.vcxproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="DebugCI|x64">
<Configuration>DebugCI</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseCI|x64">
<Configuration>ReleaseCI</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{479C51AE-D86B-433F-ADAA-DCDD1646300A}</ProjectGuid>
<RootNamespace>UnifiedTelemetryModel</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugCI|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseCI|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugCI|x64'" 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)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseCI|x64'" 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)'=='Debug|x64'">
<TargetName>UnifiedTelemetry.Model</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugCI|x64'">
<TargetName>UnifiedTelemetry.Model</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<TargetName>UnifiedTelemetry.Model</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseCI|x64'">
<TargetName>UnifiedTelemetry.Model</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;UNIFIEDTELEMETRYMODEL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugCI|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;UNIFIEDTELEMETRYMODEL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;UNIFIEDTELEMETRYMODEL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalOptions>/pdbaltpath:%_PDB% %(AdditionalOptions)</AdditionalOptions>
</Link>
<PostBuildEvent>
<Command>copy /Y "$(TargetPath)" "$(SolutionDir)projects\PSVR2Toolkit.App\Resources\$(TargetFileName)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseCI|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;UNIFIEDTELEMETRYMODEL_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalOptions>/pdbaltpath:%_PDB% %(AdditionalOptions)</AdditionalOptions>
</Link>
<PostBuildEvent>
<Command>copy /Y "$(TargetPath)" "$(SolutionDir)projects\PSVR2Toolkit.App\Resources\$(TargetFileName)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
================================================
FILE: projects/UnifiedTelemetry.Model_stub/UnifiedTelemetry.Model_stub.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;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
================================================
FILE: projects/UnifiedTelemetry.Model_stub/dllmain.cpp
================================================
extern "C" __declspec(dllexport) void utSetString() {}
extern "C" __declspec(dllexport) void utSetNumber() {}
extern "C" __declspec(dllexport) void utSetFloat() {}
extern "C" __declspec(dllexport) void utSetBoolean() {}
extern "C" __declspec(dllexport) void utSetDate() {}
extern "C" __declspec(dllexport) void utSetCurrentDate() {}
extern "C" __declspec(dllexport) void utSetObject() {}
extern "C" __declspec(dllexport) void utRemoveProperty() {}
extern "C" __declspec(dllexport) void utCreateEvent() {}
extern "C" __declspec(dllexport) void utGetEventJson() {}
extern "C" __declspec(dllexport) void utDestroyEvent() {}
extern "C" __declspec(dllexport) void utCreateEventObject() {}
extern "C" __declspec(dllexport) void utCreateEventArray() {}
extern "C" __declspec(dllexport) void utPushString() {}
extern "C" __declspec(dllexport) void utPushInt() {}
extern "C" __declspec(dllexport) void utPushFloat() {}
extern "C" __declspec(dllexport) void utPushObject() {}
extern "C" __declspec(dllexport) void utCreateSchemaFilter() {}
extern "C" __declspec(dllexport) void utDestroySchemaFilter() {}
extern "C" __declspec(dllexport) void utFilterEvent() {}
extern "C" __declspec(dllexport) void utGetJsTime() {}
extern "C" __declspec(dllexport) void utGetTracingId() {}
extern "C" __declspec(dllexport) void utCreateEventFromJson() {}
extern "C" __declspec(dllexport) void utGetSbahnDispatchUrl() {}
================================================
FILE: projects/UnifiedTelemetry.Service_stub/UnifiedTelemetry.Service_stub.vcxproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="DebugCI|x64">
<Configuration>DebugCI</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="ReleaseCI|x64">
<Configuration>ReleaseCI</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{40ADD18D-A928-4ABF-BE63-4591F53A4801}</ProjectGuid>
<RootNamespace>UnifiedTelemetryService</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugCI|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseCI|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='DebugCI|x64'" 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)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseCI|x64'" 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)'=='Debug|x64'">
<TargetName>UnifiedTelemetry.Service</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='DebugCI|x64'">
<TargetName>UnifiedTelemetry.Service</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<TargetName>UnifiedTelemetry.Service</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseCI|x64'">
<TargetName>UnifiedTelemetry.Service</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;UNIFIEDTELEMETRYSERVICE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='DebugCI|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;UNIFIEDTELEMETRYSERVICE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;UNIFIEDTELEMETRYSERVICE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalOptions>/pdbaltpath:%_PDB% %(AdditionalOptions)</AdditionalOptions>
</Link>
<PostBuildEvent>
<Command>copy /Y "$(TargetPath)" "$(SolutionDir)projects\PSVR2Toolkit.App\Resources\$(TargetFileName)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='ReleaseCI|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;UNIFIEDTELEMETRYSERVICE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp20</LanguageStandard>
<LanguageStandard_C>stdc17</LanguageStandard_C>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
<AdditionalOptions>/pdbaltpath:%_PDB% %(AdditionalOptions)</AdditionalOptions>
</Link>
<PostBuildEvent>
<Command>copy /Y "$(TargetPath)" "$(SolutionDir)projects\PSVR2Toolkit.App\Resources\$(TargetFileName)"</Command>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
================================================
FILE: projects/UnifiedTelemetry.Service_stub/UnifiedTelemetry.Service_stub.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;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="dllmain.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>
================================================
FILE: projects/UnifiedTelemetry.Service_stub/dllmain.cpp
================================================
extern "C" __declspec(dllexport) void utCreateService() {}
extern "C" __declspec(dllexport) void utDestroyService() {}
extern "C" __declspec(dllexport) void utServiceInit() {}
extern "C" __declspec(dllexport) void utGetTestConfig() {}
extern "C" __declspec(dllexport) void utSetTestConfig() {}
extern "C" __declspec(dllexport) void utServiceGetEventsInQueueLength() {}
extern "C" __declspec(dllexport) void utServiceSetDeviceWs1Setting() {}
extern "C" __declspec(dllexport) void utServiceSetUserInt() {}
extern "C" __declspec(dllexport) void utServiceSetUserString() {}
extern "C" __declspec(dllexport) void utServiceSetUserBoolean() {}
extern "C" __declspec(dllexport) void utServiceRemoveUser() {}
extern "C" __declspec(dllexport) void utGetServiceState() {}
extern "C" __declspec(dllexport) void utServiceStart() {}
extern "C" __declspec(dllexport) void utServiceStop() {}
extern "C" __declspec(dllexport) void utCreateStaticServiceTransport() {}
extern "C" __declspec(dllexport) void utApplyServiceConfigEventSchema() {}
extern "C" __declspec(dllexport) void utGetServiceConfig() {}
extern "C" __declspec(dllexport) void utSetServiceConfig() {}
extern "C" __declspec(dllexport) void utServiceSetLogCallback() {}
extern "C" __declspec(dllexport) void utServiceDispatchRecord() {}
extern "C" __declspec(dllexport) void utSetAuthToken() {}
extern "C" __declspec(dllexport) void utServicePushAdobeReportSuite() {}
extern "C" __declspec(dllexport) void utServiceGetCommonPropertiesObject() {}
================================================
FILE: projects/libcustomshare/custom_share_manager.cpp
================================================
#include "custom_share_manager.h"
CustomShareManager *CustomShareManager::m_pInstance = nullptr;
void CustomShareManager::createSingleton() {
m_initialized = true;
CustomShareManager *pInstance = m_pInstance;
if (!m_pInstance) {
pInstance = new CustomShareManager;
m_pInstance = pInstance;
}
pInstance->initialize();
}
CustomShareManager *CustomShareManager::getSingleton() {
CustomShareManager *pInstance = m_pInstance;
if (!m_pInstance) {
pInstance = new CustomShareManager;
m_pInstance = pInstance;
}
return pInstance;
}
void CustomShareManager::initialize() {
const char *shareNames[2][2] = {
{"CUSTOM_SHARE_VRT2_WIN_GAZE_EVT", "CUSTOM_SHARE_VRT2_WIN_GAZE_MTX"}
};
}
================================================
FILE: projects/libcustomshare/custom_share_manager.h
================================================
#pragma once
class CustomShareManager {
public:
static void createSingleton();
static CustomShareManager *getSingleton();
private:
static CustomShareManager *m_pInstance;
static bool m_initialized;
void initialize();
};
================================================
FILE: projects/libcustomshare/libcustomshare.vcxproj
================================================
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>17.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{eabc1d23-54f9-455f-9fb4-c0a7a01ca592}</ProjectGuid>
<RootNamespace>libcustomshare</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v145</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<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)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="custom_share_manager.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="custom_share_manager.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
================================================
FILE: projects/libcustomshare/libcustomshare.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;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="custom_share_manager.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="custom_share_manager.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>
================================================
FILE: projects/psvr2_openvr_driver_ex/caesar_manager_hooks.cpp
================================================
#include "caesar_manager_hooks.h"
#include "hmd_driver_loader.h"
#include "hook_lib.h"
#include "usb_thread_gaze.h"
#include "vr_settings.h"
#include "util.h"
namespace psvr2_toolkit {
void *(*Framework__Thread__start)(void *thisptr) = nullptr;
void *(*CaesarManager__initialize)(void *, void *, void *) = nullptr;
void *CaesarManager__initializeHook(void *thisptr, void *arg1, void *arg2) {
static CaesarUsbThreadGaze* pCaesarUsbThreadGaze = CaesarUsbThreadGaze::Instance();
void* result = CaesarManager__initialize(thisptr, arg1, arg2);
(*(void (__fastcall **)(__int64, __int64))(*(__int64 *)pCaesarUsbThreadGaze + 24LL))((__int64)pCaesarUsbThreadGaze, 0);
Framework__Thread__start(pCaesarUsbThreadGaze);
return result;
}
void (*CaesarManager__shutdown)(void *) = nullptr;
void CaesarManager__shutdownHook(void *thisptr) {
static CaesarUsbThreadGaze *pCaesarUsbThreadGaze = CaesarUsbThreadGaze::Instance();
(*(void(__fastcall **)(__int64))(*(__int64 *)pCaesarUsbThreadGaze + 16LL))((__int64)pCaesarUsbThreadGaze);
CaesarManager__shutdown(thisptr);
}
void CaesarManagerHooks::InstallHooks() {
static HmdDriverLoader *pHmdDriverLoader = HmdDriverLoader::Instance();
Framework__Thread__start = decltype(Framework__Thread__start)(pHmdDriverLoader->GetBaseAddress() + 0x16B660);
if (!VRSettings::GetBool(STEAMVR_SETTINGS_DISABLE_GAZE, SETTING_DISABLE_GAZE_DEFAULT_VALUE)) {
Util::DriverLog("Enabling PSVR2 gaze tracking...");
// CaesarManager::initialize
HookLib::InstallHook(reinterpret_cast<void *>(pHmdDriverLoader->GetBaseAddress() + 0x123130),
reinterpret_cast<void *>(CaesarManager__initializeHook),
reinterpret_cast<void **>(&CaesarManager__initialize));
// CaesarManager::shutdown
HookLib::InstallHook(reinterpret_cast<void *>(pHmdDriverLoader->GetBaseAddress() + 0x128320),
reinterpret_cast<void *>(CaesarManager__shutdownHook),
reinterpret_cast<void **>(&CaesarManager__shutdown));
}
}
} // psvr2_toolkit
================================================
FILE: projects/psvr2_openvr_driver_ex/caesar_manager_hooks.h
================================================
#pragma once
namespace psvr2_toolkit {
class CaesarManagerHooks {
public:
static void InstallHooks();
};
} // psvr2_toolkit
================================================
FILE: projects/psvr2_openvr_driver_ex/config.h
================================================
#pragma once
#define DRIVER_IS_STABLE false
#define DRIVER_IS_PRERELEASE true
#define DRIVER_IS_EXPERIMENTAL false
#define DRIVER_VERSION_MAJOR 0
#define DRIVER_VERSION_MINOR 2
#define DRIVER_VERSION_PATCH 1
#if DRIVER_IS_STABLE
#define DRIVER_VERSION_BRANCH "stable"
#elif DRIVER_IS_PRERELEASE
#define DRIVER_VERSION_BRANCH "prerelease"
#elif DRIVER_IS_EXPERIMENTAL
#define DRIVER_VERSION_BRANCH "experimental"
#else
#define DRIVER_VERSION_BRANCH "development"
#endif
// Whether or not we should mock/fake running the driver on Wine.
#define MOCK_IS_RUNNING_ON_WINE false
================================================
FILE: projects/psvr2_openvr_driver_ex/device_provider_proxy.cpp
================================================
#include "device_provider_proxy.h"
#include "config.h"
#include "caesar_manager_hooks.h"
#include "driver_context_proxy.h"
#include "hmd_device_hooks.h"
#include "hmd_driver_loader.h"
#include "hook_lib.h"
#include "ipc_server.h"
#include "trigger_effect_manager.h"
#include "usb_thread_hooks.h"
#include "util.h"
#include "vr_settings.h"
#include <windows.h>
using namespace psvr2_toolkit::ipc;
namespace psvr2_toolkit {
DeviceProviderProxy *DeviceProviderProxy::m_pInstance = nullptr;
DeviceProviderProxy::DeviceProviderProxy()
: m_initOnce(false)
, m_pDeviceProvider(nullptr)
{}
DeviceProviderProxy *DeviceProviderProxy::Instance() {
if (!m_pInstance) {
m_pInstance = new DeviceProviderProxy;
}
return m_pInstance;
}
void DeviceProviderProxy::SetDeviceProvider(vr::IServerTrackedDeviceProvider *pDeviceProvider) {
m_pDeviceProvider = pDeviceProvider;
}
vr::EVRInitError DeviceProviderProxy::Init(vr::IVRDriverContext *pDriverContext) {
#if _DEBUG
Sleep(8000);
#endif
VR_INIT_SERVER_DRIVER_CONTEXT(pDriverContext);
if (!m_initOnce) {
InitOnce();
m_initOnce = true;
}
IpcServer::Instance()->Start();
static DriverContextProxy *pDriverContextProxy = DriverContextProxy::Instance();
pDriverContextProxy->SetDriverContext(pDriverContext);
return m_pDeviceProvider->Init(pDriverContextProxy);
}
void DeviceProviderProxy::Cleanup() {
IpcServer::Instance()->Stop();
m_pDeviceProvider->Cleanup();
VR_CLEANUP_SERVER_DRIVER_CONTEXT();
}
const char *const *DeviceProviderProxy::GetInterfaceVersions() {
return m_pDeviceProvider->GetInterfaceVersions();
}
void DeviceProviderProxy::RunFrame() {
m_pDeviceProvider->RunFrame();
}
bool DeviceProviderProxy::ShouldBlockStandbyMode() {
return m_pDeviceProvider->ShouldBlockStandbyMode();
}
void DeviceProviderProxy::EnterStandby() {
m_pDeviceProvider->EnterStandby();
}
void DeviceProviderProxy::LeaveStandby() {
m_pDeviceProvider->LeaveStandby();
}
void DeviceProviderProxy::InitOnce() {
static bool isRunningOnWine = Util::IsRunningOnWine();
// Log ourselves here to show that we're proxied.
Util::DriverLog("PlayStation VR2 Toolkit - v{}.{}.{} [{}]", DRIVER_VERSION_MAJOR, DRIVER_VERSION_MINOR, DRIVER_VERSION_PATCH, DRIVER_VERSION_BRANCH);
#if DRIVER_IS_PRERELEASE
Util::DriverLog("You are using a pre-release build of PlayStation VR2 Toolkit, please report any issues that may occur to the developers!");
#elif DRIVER_IS_EXPERIMENTAL
Util::DriverLog("You are using an experimental build of PlayStation VR2 Toolkit, please report any issues that may occur to the developers!");
#endif
if (!HookLib::Initialize()) {
MessageBoxW(nullptr, L"MinHook initialization failed, please report this to the developers!", L"PlayStation VR2 Toolkit (DriverEx)", MB_ICONERROR | MB_OK);
}
if (isRunningOnWine) {
Util::DriverLog("PlayStation VR2 Toolkit has detected itself running on Wine, compatibility patches will be applied.");
}
InitPatches();
InitSystems();
}
void DeviceProviderProxy::InitPatches() {
static HmdDriverLoader *pHmdDriverLoader = HmdDriverLoader::Instance();
static bool isRunningOnWine = Util::IsRunningOnWine();
// Remove signature checks.
INSTALL_STUB_RET0(reinterpret_cast<void *>(pHmdDriverLoader->GetBaseAddress() + 0x134FF0)); // VrDialogManager::VerifyLibrary
INSTALL_STUB(reinterpret_cast<void*>(pHmdDriverLoader->GetBaseAddress() + 0x12F830)); // VrDialogManager::CreateDashboardProcess
INSTALL_STUB(reinterpret_cast<void*>(pHmdDriverLoader->GetBaseAddress() + 0x130020)); // VrDialogManager::CreateDialogProcess
CaesarManagerHooks::InstallHooks();
HmdDeviceHooks::InstallHooks();
UsbThreadHooks::InstallHooks();
}
void DeviceProviderProxy::InitSystems() {
IpcServer::Instance()->Initialize();
TriggerEffectManager::Instance()->Initialize();
}
} // psvr2_toolkit
================================================
FILE: projects/psvr2_openvr_driver_ex/device_provider_proxy.h
================================================
#pragma once
#include <openvr_driver.h>
namespace psvr2_toolkit {
class DeviceProviderProxy : public vr::IServerTrackedDeviceProvider {
public:
DeviceProviderProxy();
static DeviceProviderProxy *Instance();
void SetDeviceProvider(vr::IServerTrackedDeviceProvider *pDeviceProvider);
/** IServerTrackedDeviceProvider **/
vr::EVRInitError Init(vr::IVRDriverContext *pDriverContext) override;
void Cleanup() override;
const char *const *GetInterfaceVersions() override;
void RunFrame() override;
bool ShouldBlockStandbyMode() override;
void EnterStandby() override;
void LeaveStandby() override;
private:
static DeviceProviderProxy *m_pInstance;
bool m_initOnce;
vr::IServerTrackedDeviceProvider *m_pDeviceProvider;
void InitOnce();
void InitPatches();
void InitSystems();
};
} // psvr2_toolkit
================================================
FILE: projects/psvr2_openvr_driver_ex/driver_context_proxy.cpp
================================================
#include "driver_context_proxy.h"
#include "driver_host_proxy.h"
namespace psvr2_toolkit {
DriverContextProxy *DriverContextProxy::m_pInstance = nullptr;
DriverContextProxy::DriverContextProxy()
: m_pDriverContext(nullptr)
{}
DriverContextProxy *DriverContextProxy::Instance() {
if (!m_pInstance) {
m_pInstance = new DriverContextProxy;
}
return m_pInstance;
}
void DriverContextProxy::SetDriverContext(vr::IVRDriverContext *pDriverContext) {
m_pDriverContext = pDriverContext;
}
void *DriverContextProxy::GetGenericInterface(const char *pchInterfaceVersion, vr::EVRInitError *peError) {
void *result = m_pDriverContext->GetGenericInterface(pchInterfaceVersion, peError);
// Depends on our OpenVR driver SDK version matching the one inside the PS VR2 driver.
if (strcmp(vr::IVRServerDriverHost_Version, pchInterfaceVersion) == 0) {
static DriverHostProxy *pDriverHostProxy = DriverHostProxy::Instance();
pDriverHostProxy->SetDriverHost(static_cast<vr::IVRServerDriverHost *>(result));
return pDriverHostProxy;
}
return result;
}
vr::DriverHandle_t DriverContextProxy::GetDriverHandle() {
return m_pDriverContext->GetDriverHandle();
}
} // psvr2_toolkit
================================================
FILE: projects/psvr2_openvr_driver_ex/driver_context_proxy.h
================================================
#pragma once
#include <openvr_driver.h>
namespace psvr2_toolkit {
class DriverContextProxy : public vr::IVRDriverContext {
public:
DriverContextProxy();
static DriverContextProxy *Instance();
void SetDriverContext(vr::IVRDriverContext *pDriverContext);
/** IVRDriverContext **/
void *GetGenericInterface(const char *pchInterfaceVersion, vr::EVRInitError *peError = nullptr) override;
vr::DriverHandle_t GetDriverHandle() override;
private:
static DriverContextProxy *m_pInstance;
vr::IVRDriverContext *m_pDriverContext;
};
} // psvr2_toolkit
================================================
FILE: projects/psvr2_openvr_driver_ex/driver_host_proxy.cpp
================================================
#include "driver_host_proxy.h"
#include "hmd_math.h"
#include "util.h"
#include "vr_settings.h"
#include <cstdint>
namespace psvr2_toolkit {
/* Hardcoded device indexes, in order of when they are registered inside the driver. */
static constexpr uint32_t k_unDeviceIndexHeadset = 0; // Currently not used.
static constexpr uint32_t k_unDeviceIndexSenseControllerLeft = 1;
static constexpr uint32_t k_unDeviceIndexSenseControllerRight = 2;
DriverHostProxy *DriverHostProxy::m_pInstance = nullptr;
DriverHostProxy::DriverHostProxy()
: m_pDriverHost(nullptr)
, m_pfnEventHandlers()
{}
DriverHostProxy *DriverHostProxy::Instance() {
if (!m_pInstance) {
m_pInstance = new DriverHostProxy;
}
return m_pInstance;
}
void DriverHostProxy::SetDriverHost(vr::IVRServerDriverHost *pDriverHost) {
m_pDriverHost = pDriverHost;
}
void DriverHostProxy::AddEventHandler(void (*pfnEventHandler)(vr::VREvent_t *)) {
m_pfnEventHandlers.push_back(pfnEventHandler);
}
bool DriverHostProxy::TrackedDeviceAdded(const char *pchDeviceSerialNumber, vr::ETrackedDeviceClass eDeviceClass, vr::ITrackedDeviceServerDriver *pDriver) {
if (Util::StartsWith(pchDeviceSerialNumber, "playstation_vr2_sense_controller_") &&
VRSettings::GetBool(STEAMVR_SETTINGS_DISABLE_SENSE, SETTING_DISABLE_SENSE_DEFAULT_VALUE))
{
return false;
}
return m_pDriverHost->TrackedDeviceAdded(pchDeviceSerialNumber, eDeviceClass, pDriver);
}
void DriverHostProxy::TrackedDevicePoseUpdated(uint32_t unWhichDevice, const vr::DriverPose_t &newPose, uint32_t unPoseStructSize) {
if (unWhichDevice != k_unDeviceIndexSenseControllerLeft && unWhichDevice != k_unDeviceIndexSenseControllerRight) {
return m_pDriverHost->TrackedDevicePoseUpdated(unWhichDevice, newPose, unPoseStructSize);
}
return m_pDriverHost->TrackedDevicePoseUpdated(unWhichDevice, GetPose(unWhichDevice, newPose), unPoseStructSize);
}
void DriverHostProxy::VsyncEvent(double vsyncTimeOffsetSeconds) {
m_pDriverHost->VsyncEvent(vsyncTimeOffsetSeconds);
}
void DriverHostProxy::VendorSpecificEvent(uint32_t unWhichDevice, vr::EVREventType eventType, const vr::VREvent_Data_t &eventData, double eventTimeOffset) {
m_pDriverHost->VendorSpecificEvent(unWhichDevice, eventType, eventData, eventTimeOffset);
}
bool DriverHostProxy::IsExiting() {
return m_pDriverHost->IsExiting();
}
bool DriverHostProxy::PollNextEvent(vr::VREvent_t *pEvent, uint32_t uncbVREvent) {
if (m_pDriverHost->PollNextEvent(pEvent, uncbVREvent)) {
for (auto& m_pfnEventHandler : m_pfnEventHandlers) {
m_pfnEventHandler(pEvent);
}
return true;
}
return false;
}
void DriverHostProxy::GetRawTrackedDevicePoses(float fPredictedSecondsFromNow, vr::TrackedDevicePose_t *pTrackedDevicePoseArray, uint32_t unTrackedDevicePoseArrayCount) {
m_pDriverHost->GetRawTrackedDevicePoses(fPredictedSecondsFromNow, pTrackedDevicePoseArray, unTrackedDevicePoseArrayCount);
}
void DriverHostProxy::RequestRestart(const char *pchLocalizedReason, const char *pchExecutableToStart, const char *pchArguments, const char *pchWorkingDirectory) {
m_pDriverHost->RequestRestart(pchLocalizedReason, pchExecutableToStart, pchArguments, pchWorkingDirectory);
}
uint32_t DriverHostProxy::GetFrameTimings(vr::Compositor_FrameTiming *pTiming, uint32_t nFrames) {
return m_pDriverHost->GetFrameTimings(pTiming, nFrames);
}
void DriverHostProxy::SetDisplayEyeToHead(uint32_t unWhichDevice, const vr::HmdMatrix34_t &eyeToHeadLeft, const vr::HmdMatrix34_t &eyeToHeadRight) {
m_pDriverHost->SetDisplayEyeToHead(unWhichDevice, eyeToHeadLeft, eyeToHeadRight);
}
void DriverHostProxy::SetDisplayProjectionRaw(uint32_t unWhichDevice, const vr::HmdRect2_t &eyeLeft, const vr::HmdRect2_t &eyeRight) {
m_pDriverHost->SetDisplayProjectionRaw(unWhichDevice, eyeLeft, eyeRight);
}
void DriverHostProxy::SetRecommendedRenderTargetSize(uint32_t unWhichDevice, uint32_t nWidth, uint32_t nHeight) {
m_pDriverHost->SetRecommendedRenderTargetSize(unWhichDevice, nWidth, nHeight);
}
vr::DriverPose_t DriverHostProxy::GetPose(uint32_t unWhichDevice, const vr::DriverPose_t &originalPose) {
static vr::HmdQuaternion_t imuRotationOffset = HmdMath::EulerToQuaternion(0, 0, 0.680678427219391);
static vr::HmdQuaternion_t imuRotationOffsetInverse = HmdMath::QuaternionInverse(imuRotationOffset);
// Whether this is the left controller or not.
bool isLeft = unWhichDevice == k_unDeviceIndexSenseControllerLeft;
// Our new pose is a copy of the original pose.
vr::DriverPose_t newPose = originalPose;
// Apply inverse of imuRotationOffset to qRotation.
newPose.qRotation = HmdMath::QuaternionMultiply(newPose.qRotation, imuRotationOffsetInverse);
// PS VR2 driver pose offset.
vr::HmdVector3d_t poseOffset = {isLeft ? 0.03439270332455635 : -0.03439270332455635, 0.05370872840285301, -0.09804324805736542};
// Rotate the offset by the new rotation.
vr::HmdVector3d_t rotationOffset = HmdMath::RotateVectorByQuaternion(poseOffset, newPose.qRotation);
// Adjust position (negate the offset from the driver).
newPose.vecPosition[0] -= rotationOffset.v[0];
newPose.vecPosition[1] -= rotationOffset.v[1];
newPose.vecPosition[2] -= rotationOffset.v[2];
// Offset from the driver's root to the IMU. Given by the PS VR2 driver.
// We'll also have to factor it to make the result pose identical to the one from the driver.
vr::HmdVector3d_t imuOffset = {isLeft ? -0.00937270000576973 : 0.020072702318429947, 0.012248100712895393, 0.006003900431096554};
// Rotate IMU offset to counteract the rotation we did on qRotation. See next comment.
imuOffset = HmdMath::RotateVectorByQuaternion(imuOffset, imuRotationOffset);
poseOffset.v[0] += imuOffset.v[0];
poseOffset.v[1] += imuOffset.v[1];
poseOffset.v[2] += imuOffset.v[2];
newPose.vecDriverFromHeadTranslation[0] = poseOffset.v[0];
newPose.vecDriverFromHeadTranslation[1] = poseOffset.v[1];
newPose.vecDriverFromHeadTranslation[2] = poseOffset.v[2];
// Since qRotation was rotated by the inverse of imuRotationOffset, we'll have to counteract it.
newPose.qDriverFromHeadRotation = imuRotationOffset;
return newPose;
}
} // psvr2_toolkit
================================================
FILE: projects/psvr2_openvr_driver_ex/driver_host_proxy.h
================================================
#pragma once
#include <openvr_driver.h>
#include <list>
namespace psvr2_toolkit {
class DriverHostProxy : public vr::IVRServerDriverHost {
public:
DriverHostProxy();
static DriverHostProxy *Instance();
void SetDriverHost(vr::IVRServerDriverHost *pDriverHost);
void AddEventHandler(void (*pfnEventHandler)(vr::VREvent_t *)); // Required for intercepting polled events from the PS VR2 driver.
/** IVRServerDriverHost **/
bool TrackedDeviceAdded(const char *pchDeviceSerialNumber, vr::ETrackedDeviceClass eDeviceClass, vr::ITrackedDeviceServerDriver *pDriver) override;
void TrackedDevicePoseUpdated(uint32_t unWhichDevice, const vr::DriverPose_t &newPose, uint32_t unPoseStructSize) override;
void VsyncEvent(double vsyncTimeOffsetSeconds) override;
void VendorSpecificEvent(uint32_t unWhichDevice, vr::EVREventType eventType, const vr::VREvent_Data_t &eventData, double eventTimeOffset) override;
bool IsExiting() override;
bool PollNextEvent(vr::VREvent_t *pEvent, uint32_t uncbVREvent) override;
void GetRawTrackedDevicePoses(float fPredictedSecondsFromNow, vr::TrackedDevicePose_t *pTrackedDevicePoseArray, uint32_t unTrackedDevicePoseArrayCount) override;
void RequestRestart(const char *pchLocalizedReason, const char *pchExecutableToStart, const char *pchArguments, const char *pchWorkingDirectory) override;
uint32_t GetFrameTimings(vr::Compositor_FrameTiming *pTiming, uint32_t nFrames) override;
void SetDisplayEyeToHead(uint32_t unWhichDevice, const vr::HmdMatrix34_t &eyeToHeadLeft, const vr::HmdMatrix34_t &eyeToHeadRight) override;
void SetDisplayProjectionRaw(uint32_t unWhichDevice, const vr::HmdRect2_t &eyeLeft, const vr::HmdRect2_t &eyeRight) override;
void SetRecommendedRenderTargetSize(uint32_t unWhichDevice, uint32_t nWidth, uint32_t nHeight) override;
private:
static DriverHostProxy *m_pInstance;
vr::IVRServerDriverHost *m_pDriverHost;
std::list<void (*)(vr::VREvent_t *)> m_pfnEventHandlers;
// Used internally for controller pose correction.
vr::DriverPose_t GetPose(uint32_t unWhichDevice, const vr::DriverPose_t &originalPose);
};
} // psvr2_toolkit
================================================
FILE: projects/psvr2_openvr_driver_ex/eyelid_estimator.cpp
================================================
#include "eyelid_estimator.h"
#include <algorithm>
#include <cmath>
namespace psvr2_toolkit {
// parameters
static constexpr float openLR = 0.001f; // slow open adaptation
static constexpr float closedLR = 0.01f; // faster closed adaptation
static constexpr float smoothAlpha = 0.2f; // EMA smoothing
EyelidEstimator::EyelidEstimator()
: m_openDia(4.0f)
, m_closedDia(2.0f)
, m_sensorYOpen(0.55f)
, m_sensorYClosed(0.45f)
, m_lastOpenness(1.0f)
{}
bool EyelidEstimator::IsNeutral(const Hmd2GazeEye &eye) const {
if (eye.isGazeDirValid == HMD2_BOOL_FALSE) {
return false;
}
// Forward assumed to be (0,0,1). Require within ~20deg of forward.
return eye.gazeDirNorm.z > 0.94f;
}
float EyelidEstimator::Estimate(const Hmd2GazeEye &eye) {
if (eye.isBlinkValid && eye.blink == HMD2_BOOL_TRUE) {
// Update CLOSED reference on blink
if (eye.isPupilDiaValid) {
m_closedDia = m_closedDia * (1.0f - closedLR) +
eye.pupilDiaMm * closedLR;
}
if (eye.isPupilPosInSensorValid) {
m_sensorYClosed = m_sensorYClosed * (1.0f - closedLR) +
eye.pupilPosInSensor.y * closedLR;
}
} else if (eye.isPupilDiaValid && eye.isPupilPosInSensorValid && IsNeutral(eye)) {
// Update OPEN reference only if gaze is neutral
bool stable = std::fabs(eye.pupilDiaMm - m_openDia) < 1.0f;
if (stable) {
m_openDia = m_openDia * (1.0f - openLR) +
eye.pupilDiaMm * openLR;
m_sensorYOpen = m_sensorYOpen * (1.0f - openLR) +
eye.pupilPosInSensor.y * openLR;
}
}
float opennessRaw = m_lastOpenness;
if (eye.isBlinkValid && eye.blink == HMD2_BOOL_TRUE) {
opennessRaw = 0.0f; // explicit blink
} else if (eye.isPupilDiaValid && eye.isPupilPosInSensorValid) {
float denomDia = std::max(1e-6f, m_openDia - m_closedDia);
float normDia = (eye.pupilDiaMm - m_closedDia) / denomDia;
normDia = std::clamp(normDia, 0.0f, 1.0f);
float denomPos = std::max(1e-6f, m_sensorYOpen - m_sensorYClosed);
float normPos = (eye.pupilPosInSensor.y - m_sensorYClosed) / denomPos;
normPos = std::clamp(normPos, 0.0f, 1.0f);
// Weight cues based on gaze vertical angle
float gazeWeight = 1.0f;
if (eye.isGazeDirValid) {
float vertical = eye.gazeDirNorm.y; // +up, -down
gazeWeight = std::clamp(1.0f - std::fabs(vertical) * 1.5f, 0.2f, 1.0f);
}
opennessRaw = gazeWeight * (0.65f * normDia + 0.35f * normPos)
+ (1.0f - gazeWeight) * normDia; // fallback to diameter when gaze extreme
} else {
// Missing data ? decay toward closed
opennessRaw = m_lastOpenness * 0.9f;
}
float openness = m_lastOpenness * (1.0f - smoothAlpha) +
opennessRaw * smoothAlpha;
m_lastOpenness = openness;
return openness; // 0 = closed, 1 = open
}
}
================================================
FILE: projects/psvr2_openvr_driver_ex/eyelid_estimator.h
================================================
#pragma once
#include "hmd2_gaze.h"
namespace psvr2_toolkit {
class EyelidEstimator {
public:
EyelidEstimator();
float Estimate(const Hmd2GazeEye &eye);
private:
float m_openDia;
float m_closedDia;
float m_sensorYOpen;
float m_sensorYClosed;
float m_lastOpenness;
bool IsNeutral(const Hmd2GazeEye &eye) const;
};
}
================================================
FILE: projects/psvr2_openvr_driver_ex/hmd2_gaze.h
================================================
#pragma once
#include <cstdint>
typedef enum {
HMD2_BOOL_FALSE = 0,
HMD2_BOOL_TRUE = 1
} Hmd2Bool;
typedef struct {
float x, y;
} Hmd2Vector2;
typedef struct {
float x, y, z;
} Hmd2Vector3;
typedef struct {
Hmd2Bool isGazeOriginValid;
Hmd2Vector3 gazeOriginMm;
Hmd2Bool isGazeDirValid;
Hmd2Vector3 gazeDirNorm;
Hmd2Bool isPupilDiaValid;
float pupilDiaMm;
Hmd2Bool isPupilPosInSensorValid;
Hmd2Vector2 pupilPosInSensor;
Hmd2Bool isPosGuideValid;
Hmd2Vector2 posGuide;
Hmd2Bool isBlinkValid;
Hmd2Bool blink;
} Hmd2GazeEye;
struct Hmd2GazeCombined {
Hmd2Bool isGazeOriginValid;
Hmd2Vector3 gazeOriginMm;
Hmd2Bool isGazeDirValid;
Hmd2Vector3 gazeDirNorm;
Hmd2Bool isValid;
uint32_t timestamp;
Hmd2Bool unk06;
float unk07;
Hmd2Bool unk08;
// All gazes seem to be repeated here?
// No obvious differences here.
Hmd2Vector3 leftGazeDirNormal;
Hmd2Vector3 rightGazeDirNormal;
Hmd2Vector3 combinedGazeDirNormal;
float unk09;
};
struct Hmd2GazeState {
char magic[2];
uint16_t version;
uint32_t size;
float unk03; // 0.700
float unk04; // 0.700
uint32_t unk05; // 0xFFFFF
// Appears to be related to some sort of timestamp?
uint32_t timestamp06;
uint32_t timestamp07;
uint32_t timestamp08;
uint32_t unk09;
float leftEyeXPosMm; // Example: -32.000 (64mm IPD)
uint32_t unk11;
uint32_t unk12;
float rightEyeXPosMm; // Example: 32.000 (64mm IPD)
uint32_t unk14;
uint32_t unk15;
uint32_t unk16;
uint32_t unk17;
uint32_t unk18;
float eyeZPosMm; // -27.000
// More unknown garbage.
uint32_t unk20;
uint32_t timestamp21;
uint32_t unk22;
uint32_t timestamp23;
Hmd2GazeEye leftEye;
Hmd2GazeEye rightEye;
Hmd2GazeCombined combined;
};
================================================
FILE: projects/psvr2_openvr_driver_ex/hmd_device_hooks.cpp
================================================
#ifdef OPENVR_EXTENSIONS_AVAILABLE
#include "psvr2_openvr_driver/openvr_ex/openvr_ex.h"
#endif
#include "driver_host_proxy.h"
#include "hmd2_gaze.h"
#include "hmd_device_hooks.h"
#include "hmd_driver_loader.h"
#include "hook_lib.h"
#include "vr_settings.h"
#include "util.h"
#include <cmath>
#include <cstdint>
namespace psvr2_toolkit {
void* (*CaesarManager__getInstance)();
uint64_t (*CaesarManager__getIMUTimestampOffset)(void* thisptr, int64_t* hmdToHostOffset);
void* (*ShareManager__getInstance)();
void (*ShareManager__getIntConfig)(void* thisPtr, uint32_t configId, int64_t* outValue);
void (*ShareManager__setIntConfig)(void* thisPtr, uint32_t configId, int64_t* value);
#ifdef OPENVR_EXTENSIONS_AVAILABLE
void* g_pOpenVRExHandle = nullptr;
#endif
vr::VRInputComponentHandle_t eyeTrackingComponent = vr::k_ulInvalidInputComponentHandle;
int64_t currentBrightness;
vr::EVRInitError (*sie__psvr2__HmdDevice__Activate)(void *, uint32_t) = nullptr;
vr::EVRInitError sie__psvr2__HmdDevice__ActivateHook(void *thisptr, uint32_t unObjectId) {
vr::EVRInitError result = sie__psvr2__HmdDevice__Activate(thisptr, unObjectId);
vr::PropertyContainerHandle_t ulPropertyContainer = vr::VRProperties()->TrackedDeviceToPropertyContainer(unObjectId);
// Tell SteamVR we want the chaperone visibility disabled if we're actually disabling the chaperone.
if (VRSettings::GetBool(STEAMVR_SETTINGS_DISABLE_CHAPERONE, SETTING_DISABLE_CHAPERONE_DEFAULT_VALUE)) {
vr::VRProperties()->SetBoolProperty(ulPropertyContainer, vr::Prop_DriverProvidedChaperoneVisibility_Bool, false);
}
// Tell SteamVR to allow runtime framerate changes.
// SteamVR does not allow this feature on AMD GPUs, so this is NVIDIA-only currently.
vr::VRProperties()->SetBoolProperty(ulPropertyContainer, vr::Prop_DisplaySupportsRuntimeFramerateChange_Bool, true);
// Tell SteamVR to allow night mode setting.
vr::VRProperties()->SetBoolProperty(ulPropertyContainer, vr::Prop_DisplayAllowNightMode_Bool, true);
// Tell SteamVR we support brightness controls.
vr::VRProperties()->SetBoolProperty(ulPropertyContainer, vr::Prop_DisplaySupportsAnalogGain_Bool, true);
vr::VRProperties()->SetFloatProperty(ulPropertyContainer, vr::Prop_DisplayMinAnalogGain_Float, 0.0f);
vr::VRProperties()->SetFloatProperty(ulPropertyContainer, vr::Prop_DisplayMaxAnalogGain_Float, 1.0f);
// Fill in brightness from PSVR2 config to SteamVR settings key.
// Also, "analogGain" is stored as a gamma corrected value.
ShareManager__getIntConfig(ShareManager__getInstance(), 2, ¤tBrightness);
vr::VRSettings()->SetFloat(vr::k_pch_SteamVR_Section, "analogGain", powf(static_cast<float>(currentBrightness) / 31.0f, 2.2f));
// Set event handler for when brightness ("analogGain") changes.
DriverHostProxy::Instance()->AddEventHandler([](vr::VREvent_t* event) {
if (event->eventType == vr::EVREventType::VREvent_SteamVRSectionSettingChanged) {
float currentFloatBrightness = powf(vr::VRSettings()->GetFloat(vr::k_pch_SteamVR_Section, "analogGain"), 1 / 2.2f);
if (static_cast<int64_t>(ceilf(currentFloatBrightness * 31.0f)) != currentBrightness)
{
currentBrightness = static_cast<int64_t>(ceilf(currentFloatBrightness * 31.0f));
ShareManager__setIntConfig(ShareManager__getInstance(), 2, ¤tBrightness);
}
}
});
// Tell SteamVR our dashboard scale.
vr::VRProperties()->SetFloatProperty(ulPropertyContainer, vr::Prop_DashboardScale_Float, .9f);
vr::VRProperties()->SetBoolProperty(ulPropertyContainer, vr::Prop_SupportsXrEyeGazeInteraction_Bool, true);
if (vr::VRDriverInput())
{
vr::EVRInputError result = (vr::VRDriverInput())->CreateEyeTrackingComponent(ulPropertyContainer, "/eyetracking", &eyeTrackingComponent);
if (result != vr::VRInputError_None) {
vr::VRDriverLog()->Log("Failed to create eye tracking component.");
}
}
else
{
vr::VRDriverLog()->Log("Failed to get driver input interface. Are you on the latest version of SteamVR?");
}
#ifdef OPENVR_EXTENSIONS_AVAILABLE
psvr2_toolkit::openvr_ex::OnHmdActivate(ulPropertyContainer, &g_pOpenVRExHandle);
#endif
return result;
}
void (*sie__psvr2__HmdDevice__Deactivate)(void *) = nullptr;
void sie__psvr2__HmdDevice__DeactivateHook(void *thisptr) {
sie__psvr2__HmdDevice__Deactivate(thisptr);
#ifdef OPENVR_EXTENSIONS_AVAILABLE
if (g_pOpenVRExHandle) {
psvr2_toolkit::openvr_ex::OnHmdDeactivate(&g_pOpenVRExHandle);
}
#endif
}
inline const int64_t GetHostTimestamp()
{
static LARGE_INTEGER frequency{};
if (frequency.QuadPart == 0)
{
QueryPerformanceFrequency(&frequency);
}
LARGE_INTEGER now;
QueryPerformanceCounter(&now);
return static_cast<int64_t>((static_cast<double>(now.QuadPart) /
static_cast<double>(frequency.QuadPart)) * 1e6);
}
void HmdDeviceHooks::UpdateGaze(void* pData, size_t dwSize)
{
if (eyeTrackingComponent == vr::k_ulInvalidInputComponentHandle)
{
return;
}
Hmd2GazeState* pGazeState = reinterpret_cast<Hmd2GazeState*>(pData);
vr::VREyeTrackingData_t eyeTrackingData {};
bool valid = pGazeState->combined.isGazeDirValid;
eyeTrackingData.bActive = valid;
eyeTrackingData.bTracked = valid;
eyeTrackingData.bValid = valid;
auto& origin = pGazeState->combined.gazeOriginMm;
auto& direction = pGazeState->combined.gazeDirNorm;
eyeTrackingData.vGazeOrigin = vr::HmdVector3_t { -origin.x / 1000.0f, origin.y / 1000.0f, -origin.z / 1000.0f };
eyeTrackingData.vGazeTarget = vr::HmdVector3_t { -direction.x, direction.y, -direction.z };
int64_t hmdToHostOffset;
CaesarManager__getIMUTimestampOffset(CaesarManager__getInstance(), &hmdToHostOffset);
double timeOffset = ((static_cast<int64_t>(pGazeState->combined.timestamp) + hmdToHostOffset) - GetHostTimestamp()) / 1e6;
(vr::VRDriverInput())->UpdateEyeTrackingComponent(eyeTrackingComponent, &eyeTrackingData, timeOffset);
#ifdef OPENVR_EXTENSIONS_AVAILABLE
if (g_pOpenVRExHandle) {
psvr2_toolkit::openvr_ex::OnHmdUpdate(&g_pOpenVRExHandle, pData, dwSize);
}
#endif
}
void HmdDeviceHooks::InstallHooks() {
static HmdDriverLoader *pHmdDriverLoader = HmdDriverLoader::Instance();
// sie::psvr2::HmdDevice::Activate
HookLib::InstallHook(reinterpret_cast<void *>(pHmdDriverLoader->GetBaseAddress() + 0x19D1B0),
reinterpret_cast<void *>(sie__psvr2__HmdDevice__ActivateHook),
reinterpret_cast<void **>(&sie__psvr2__HmdDevice__Activate));
// sie::psvr2::HmdDevice::Deactivate
HookLib::InstallHook(reinterpret_cast<void *>(pHmdDriverLoader->GetBaseAddress() + 0x19EBF0),
reinterpret_cast<void *>(sie__psvr2__HmdDevice__DeactivateHook),
reinterpret_cast<void **>(&sie__psvr2__HmdDevice__Deactivate));
CaesarManager__getInstance = decltype(CaesarManager__getInstance)(pHmdDriverLoader->GetBaseAddress() + 0x124c90);
CaesarManager__getIMUTimestampOffset = decltype(CaesarManager__getIMUTimestampOffset)(pHmdDriverLoader->GetBaseAddress() + 0x1252e0);
ShareManager__getInstance = decltype(ShareManager__getInstance)(pHmdDriverLoader->GetBaseAddress() + 0x15bbd0);
ShareManager__getIntConfig = decltype(ShareManager__getIntConfig)(pHmdDriverLoader->GetBaseAddress() + 0x15d270);
ShareManager__setIntConfig = decltype(ShareManager__setIntConfig)(pHmdDriverLoader->GetBaseAddress() + 0x15f3d0);
}
} // psvr2_toolkit
================================================
FILE: projects/psvr2_openvr_driver_ex/hmd_device_hooks.h
================================================
#pragma once
#include <openvr_driver.h>
namespace psvr2_toolkit {
class HmdDeviceHooks {
public:
static void InstallHooks();
static void UpdateGaze(void* pData, size_t dwSize);
};
} // psvr2_toolkit
================================================
FILE: projects/psvr2_openvr_driver_ex/hmd_driver_factory.cpp
================================================
#include "device_provider_proxy.h"
#include "hmd_driver_loader.h"
#include <openvr_driver.h>
#include <windows.h>
using namespace psvr2_toolkit;
extern "C" __declspec(dllexport) void *HmdDriverFactory(const char *pInterfaceName, int *pReturnCode) {
static HmdDriverLoader *pHmdDriverLoader = HmdDriverLoader::Instance();
// Check if the HMD driver DLL is actually loaded.
if (pHmdDriverLoader->GetBaseAddress()) {
void *result = pHmdDriverLoader->pfnHmdDriverFactory(pInterfaceName, pReturnCode);
if (strcmp(vr::IServerTrackedDeviceProvider_Version, pInterfaceName) == 0 &&
*pReturnCode == vr::VRInitError_None /* no point injecting if the original driver failed to initialise */) {
static DeviceProviderProxy *pDeviceProviderProxy = DeviceProviderProxy::Instance();
pDeviceProviderProxy->SetDeviceProvider(static_cast<vr::IServerTrackedDeviceProvider *>(result));
return pDeviceProviderProxy;
}
return result;
}
MessageBoxW(nullptr, L"Loading original HMD driver failed, please report this to the developers!", L"PlayStation VR2 Toolkit (DriverEx)", MB_ICONERROR | MB_OK);
if (pReturnCode) {
*pReturnCode = vr::VRInitError_Init_InterfaceNotFound;
}
return nullptr;
}
================================================
FILE: projects/psvr2_openvr_driver_ex/hmd_driver_loader.cpp
================================================
#include "hmd_driver_loader.h"
#include <shlwapi.h>
#define HMD_DLL_NAME L"driver_playstation_vr2_orig.dll"
extern "C" IMAGE_DOS_HEADER __ImageBase;
namespace psvr2_toolkit {
// Allows the C++ standard library load the original HMD driver automatically for us.
class HmdDriverLoaderInitializer {
public:
HmdDriverLoaderInitializer() {
HmdDriverLoader::Instance();
}
};
HmdDriverLoaderInitializer __initializer;
HmdDriverLoader *HmdDriverLoader::m_pInstance = nullptr;
HmdDriverLoader::HmdDriverLoader()
: pfnHmdDriverFactory(nullptr)
, m_hModule(nullptr)
{
wchar_t pszHmdDllPath[MAX_PATH] = { 0 };
if (GetHmdDllPath(pszHmdDllPath)) {
m_hModule = LoadLibraryW(pszHmdDllPath);
if (m_hModule) {
pfnHmdDriverFactory = decltype(pfnHmdDriverFactory)(GetProcAddress(m_hModule, "HmdDriverFactory"));
}
}
}
HmdDriverLoader *HmdDriverLoader::Instance() {
if (!m_pInstance) {
m_pInstance = new HmdDriverLoader;
}
return m_pInstance;
}
uintptr_t HmdDriverLoader::GetBaseAddress() {
return reinterpret_cast<uintptr_t>(m_hModule);
}
bool HmdDriverLoader::GetHmdDllPath(wchar_t *pszHmdDllPath) {
if (!pszHmdDllPath) {
return false;
}
wchar_t pszPath[MAX_PATH] = {0};
DWORD dwLength = GetModuleFileNameW(reinterpret_cast<HINSTANCE>(&__ImageBase), pszPath, MAX_PATH);
if (dwLength > 0 && dwLength < MAX_PATH) {
if (PathRemoveFileSpecW(pszPath)) {
if (PathCombineW(pszHmdDllPath, pszPath, HMD_DLL_NAME)) {
return true;
}
}
}
return false;
}
} // psvr2_toolkit
================================================
FILE: projects/psvr2_openvr_driver_ex/hmd_driver_loader.h
================================================
#pragma once
#include <windows.h>
#include <cstdint>
namespace psvr2_toolkit {
// Provides a thin interface between our proxy library and the original HMD driver.
class HmdDriverLoader {
public:
HmdDriverLoader();
static HmdDriverLoader *Instance();
uintptr_t GetBaseAddress();
void *(*pfnHmdDriverFactory)(const char *pInterfaceName, int *pReturnCode);
private:
static HmdDriverLoader *m_pInstance;
HMODULE m_hModule;
bool GetHmdDllPath(wchar_t *pszHmdDllPath);
};
} // psvr2_toolkit
================================================
FILE: projects/psvr2_openvr_driver_ex/hmd_math.h
================================================
#pragma once
#include <openvr_driver.h>
namespace psvr2_toolkit {
class HmdMath {
public:
static vr::HmdQuaternion_t EulerToQuaternion(double yaw, double pitch, double roll) {
double cy = cos(yaw * 0.5);
double sy = sin(yaw * 0.5);
double cp = cos(pitch * 0.5);
double sp = sin(pitch * 0.5);
double cr = cos(roll * 0.5);
double sr = sin(roll * 0.5);
return {
cr * cp * cy + sr * sp * sy,
sr * cp * cy - cr * sp * sy,
cr * sp * cy + sr * cp * sy,
cr * cp * sy - sr * sp * cy
};
}
static vr::HmdQuaternion_t QuaternionMultiply(const vr::HmdQuaternion_t &a, const vr::HmdQuaternion_t &b) {
return {
a.w * b.w - a.x * b.x - a.y * b.y - a.z * b.z,
a.w * b.x + a.x * b.w + a.y * b.z - a.z * b.y,
a.w * b.y - a.x * b.z + a.y * b.w + a.z * b.x,
a.w * b.z + a.x * b.y - a.y * b.x + a.z * b.w
};
}
static vr::HmdQuaternion_t QuaternionInverse(const vr::HmdQuaternion_t &q) {
double normSq = q.w * q.w + q.x * q.x + q.y * q.y + q.z * q.z;
return { q.w / normSq, -q.x / normSq, -q.y / normSq, -q.z / normSq };
}
static vr::HmdVector3d_t RotateVectorByQuaternion(const vr::HmdVector3d_t &v, const vr::HmdQuaternion_t &q) {
vr::HmdQuaternion_t vQuat = { 0.0, v.v[0], v.v[1], v.v[2] };
vr::HmdQuaternion_t qv = QuaternionMultiply(q, vQuat);
vr::HmdQuaternion_t qInv = QuaternionInverse(q);
vr::HmdQuaternion_t result = QuaternionMultiply(qv, qInv);
return { result.x, result.y, result.z };
}
};
}
================================================
FILE: projects/psvr2_openvr_driver_ex/hook_lib.h
================================================
#pragma once
#include <minhook.h>
#define INSTALL_STUB(pTarget) psvr2_toolkit::HookLib::InstallStub(pTarget)
#define INSTALL_STUB_ORIGINAL(pTarget, ppOriginal) psvr2_toolkit::HookLib::InstallStub(pTarget, ppOriginal)
#define INSTALL_STUB_RET0(pTarget) psvr2_toolkit::HookLib::InstallStubRet0(pTarget)
#define INSTALL_STUB_RET0_ORIGINAL(pTarget, ppOriginal) psvr2_toolkit::HookLib::InstallStubRet0(pTarget, ppOriginal)
namespace psvr2_toolkit {
// Provides a thin wrapper around MinHook.
class HookLib {
private:
static void Stub() {}
static __int64 StubRet0() { return 0; }
public:
static bool Initialize() {
return MH_Initialize() == MH_OK;
}
static void InstallHook(void *pTarget, void* pDetour, void **ppOriginal = nullptr) {
MH_CreateHook(pTarget, pDetour, ppOriginal);
MH_EnableHook(pTarget);
}
static void InstallStub(void* pTarget, void** ppOriginal = nullptr) {
InstallHook(pTarget, reinterpret_cast<void *>(Stub), ppOriginal);
}
static void InstallStubRet0(void *pTarget, void **ppOriginal = nullptr) {
InstallHook(pTarget, reinterpret_cast<void *>(StubRet0), ppOriginal);
}
};
} // psvr2_toolkit
================================================
FILE: projects/psvr2_openvr_driver_ex/ipc_server.cpp
================================================
#include "ipc_server.h"
#include "trigger_effect_manager.h"
#include "util.h"
#include "vr_settings.h"
#include <cstdio>
namespace psvr2_toolkit {
namespace ipc {
IpcServer *IpcServer::m_pInstance = nullptr;
IpcServer::IpcServer()
: m_initialized(false)
, m_running(false)
, m_doGaze(false)
, m_socket{}
, m_serverAddr{}
, m_pGazeState(nullptr)
{}
IpcServer *IpcServer::Instance() {
if (!m_pInstance) {
m_pInstance = new IpcServer;
}
return m_pInstance;
}
bool IpcServer::Initialized() {
return m_initialized;
}
void IpcServer::Initialize() {
if (m_initialized) {
return;
}
WSADATA wsaData = {};
int result = WSAStartup(MAKEWORD(2, 2), &wsaData);
if (result != 0) {
Util::DriverLog("[IPC_SERVER] WSAStartup failed. Result = {}", result);
return;
}
m_initialized = true;
m_doGaze = !VRSettings::GetBool(STEAMVR_SETTINGS_DISABLE_GAZE, SETTING_DISABLE_GAZE_DEFAULT_VALUE);
m_doOpenness = VRSettings::GetBool(STEAMVR_SETTINGS_ENABLE_EYELID_ESTIMATION, SETTING_ENABLE_EYELID_ESTIMATION_DEFAULT_VALUE);
}
void IpcServer::Start() {
if (!m_initialized && m_running) {
return;
}
m_socket = socket(AF_INET, SOCK_STREAM, 0);
if (m_socket == INVALID_SOCKET) {
Util::DriverLog("[IPC_SERVER] Creating socket failed. LastError = {}", WSAGetLastError());
return;
}
m_serverAddr.sin_family = AF_INET;
m_serverAddr.sin_addr.s_addr = htonl(INADDR_ANY);
m_serverAddr.sin_port = htons(IPC_SERVER_PORT);
if (bind(m_socket, reinterpret_cast<SOCKADDR * >(&m_serverAddr), sizeof(m_serverAddr)) == SOCKET_ERROR) {
Util::DriverLog("[IPC_SERVER] Bind failed. LastError = {}", WSAGetLastError());
closesocket(m_socket);
return;
}
if (listen(m_socket, SOMAXCONN) == SOCKET_ERROR) {
Util::DriverLog("[IPC_SERVER] Listen failed. LastError = {}", WSAGetLastError());
closesocket(m_socket);
return;
}
m_running = true;
m_receiveThread = std::thread(&IpcServer::ReceiveLoop, this);
}
void IpcServer::Stop() {
if (!m_running) {
return;
}
m_running = false;
closesocket(m_socket);
m_receiveThread.join();
}
void IpcServer::UpdateGazeState(Hmd2GazeState *pGazeState, float leftEyelidOpenness, float rightEyelidOpenness) {
if (!m_pGazeState) {
m_pGazeState = reinterpret_cast<Hmd2GazeState *>(malloc(sizeof(Hmd2GazeState)));
}
if (m_pGazeState) {
memcpy(m_pGazeState, pGazeState, sizeof(Hmd2GazeState)); // Realistically, we should have a mutex here. Sadly, we do not have the time.
}
m_leftEyelidOpenness = leftEyelidOpenness;
m_rightEyelidOpenness = rightEyelidOpenness;
}
void IpcServer::ReceiveLoop() {
char pBuffer[1024] = {}; // This does not need to be static.
sockaddr_in clientAddr = {};
int clientAddrLen = sizeof(clientAddr);
while (m_running) {
SOCKADDR_IN clientAddr = {};
int clientAddrLen = sizeof(clientAddr);
SOCKET clientSocket = accept(m_socket, reinterpret_cast<SOCKADDR*>(&clientAddr), &clientAddrLen);
if (clientSocket == INVALID_SOCKET) {
int error = WSAGetLastError();
if (m_running) {
Util::DriverLog("[IPC_SERVER] Accept failed. LastError = {}", error);
}
else {
Util::DriverLog("[IPC_SERVER] Server socket closed. Exiting receive loop.");
}
break;
}
std::thread clientThread(&IpcServer::HandleClient, this, clientSocket, clientAddr);
clientThread.detach(); // client thread shouldnt block receive thread
}
}
void IpcServer::HandleClient(SOCKET clientSocket, SOCKADDR_IN clientAddr) {
char pBuffer[1024] = {};
int clientPort = ntohs(clientAddr.sin_port);
while (m_running) {
int dwBufferSize = recv(clientSocket, pBuffer, sizeof(pBuffer), 0);
if (dwBufferSize <= 0) {
if (dwBufferSize == 0) {
Util::DriverLog("[IPC_SERVER] Client on port {} disconnected.", clientPort);
} else {
Util::DriverLog("[IPC_SERVER] Receive failed for client on port {}. LastError = {}", clientPort, WSAGetLastError());
}
break;
}
if (dwBufferSize < sizeof(CommandHeader_t)) {
Util::DriverLog("[IPC_SERVER] Received invalid command header size from client on port {}.", clientPort);
continue;
}
HandleIpcCommand(clientSocket, clientAddr, pBuffer);
}
closesocket(clientSocket);
}
void IpcServer::HandleIpcCommand(SOCKET clientSocket, const sockaddr_in &clientAddr, char *pBuffer) {
static TriggerEffectManager *pTriggerEffectManager = TriggerEffectManager::Instance();
uint16_t clientPort = ntohs(clientAddr.sin_port);
CommandHeader_t *pHeader = reinterpret_cast<CommandHeader_t *>(pBuffer);
void *pData = pBuffer + sizeof(CommandHeader_t);
switch (pHeader->type) {
case Command_ClientPing: {
if (pHeader->dataLen == 0 && m_connections.contains(clientPort)) {
SendIpcCommand(clientSocket, Command_ServerPong); // TODO
}
break;
}
case Command_ClientRequestHandshake: {
CommandDataServerHandshakeResult_t response;
response.result = HandshakeResult_Failed;
response.ipcVersion = k_unIpcVersion; // Communicate the IPC version the server supports.
if (pHeader->dataLen == sizeof(CommandDataClientRequestHandshake_t) && !m_connections.contains(clientPort)) {
CommandDataClientRequestHandshake_t *pRequest = reinterpret_cast<CommandDataClientRequestHandshake_t *>(pData);
// We only want real running processes to handshake with us.
if (Util::IsProcessRunning(pRequest->processId)) {
m_connections[clientPort] = {
.clientAddr = clientAddr,
.ipcVersion = pRequest->ipcVersion,
.processId = pRequest->processId
};
response.result = HandshakeResult_Success;
}
}
SendIpcCommand(clientSocket, Command_ServerHandshakeResult, &response, sizeof(response));
break;
}
case Command_ClientRequestGazeData: {
if (pHeader->dataLen == 0 && m_connections.contains(clientPort)) {
if (m_doGaze && m_pGazeState) {
// Handle old client IPC version requests here.
if (m_connections[clientPort].ipcVersion == 1) {
CommandDataServerGazeDataResult_t response = {
.leftEye = {
.isGazeOriginValid = m_pGazeState->leftEye.isGazeOriginValid == Hmd2Bool::HMD2_BOOL_TRUE,
.gazeOriginMm = {
.x = m_pGazeState->leftEye.gazeOriginMm.x,
.y = m_pGazeState->leftEye.gazeOriginMm.y,
.z = m_pGazeState->leftEye.gazeOriginMm.z,
},
.isGazeDirValid = m_pGazeState->leftEye.isGazeDirValid == Hmd2Bool::HMD2_BOOL_TRUE,
.gazeDirNorm {
.x = m_pGazeState->leftEye.gazeDirNorm.x,
.y = m_pGazeState->leftEye.gazeDirNorm.y,
.z = m_pGazeState->leftEye.gazeDirNorm.z,
},
.isPupilDiaValid = m_pGazeState->leftEye.isPupilDiaValid == Hmd2Bool::HMD2_BOOL_TRUE,
.pupilDiaMm = m_pGazeState->leftEye.pupilDiaMm,
.isBlinkValid = m_pGazeState->leftEye.isBlinkValid == Hmd2Bool::HMD2_BOOL_TRUE,
.blink = m_pGazeState->leftEye.blink == Hmd2Bool::HMD2_BOOL_TRUE,
},
.rightEye = {
.isGazeOriginValid = m_pGazeState->rightEye.isGazeOriginValid == Hmd2Bool::HMD2_BOOL_TRUE,
.gazeOriginMm = {
.x = m_pGazeState->rightEye.gazeOriginMm.x,
.y = m_pGazeState->rightEye.gazeOriginMm.y,
.z = m_pGazeState->rightEye.gazeOriginMm.z,
},
.isGazeDirValid = m_pGazeState->rightEye.isGazeDirValid == Hmd2Bool::HMD2_BOOL_TRUE,
.gazeDirNorm {
.x = m_pGazeState->rightEye.gazeDirNorm.x,
.y = m_pGazeState->rightEye.gazeDirNorm.y,
.z = m_pGazeState->rightEye.gazeDirNorm.z,
},
.isPupilDiaValid = m_pGazeState->rightEye.isPupilDiaValid == Hmd2Bool::HMD2_BOOL_TRUE,
.pupilDiaMm = m_pGazeState->rightEye.pupilDiaMm,
.isBlinkValid = m_pGazeState->rightEye.isBlinkValid == Hmd2Bool::HMD2_BOOL_TRUE,
.blink = m_pGazeState->rightEye.blink == Hmd2Bool::HMD2_BOOL_TRUE,
}
};
SendIpcCommand(clientSocket, Command_ServerGazeDataResult, &response, sizeof(response));
} else if (m_connections[clientPort].ipcVersion == 2) {
CommandDataServerGazeDataResult2_t response = {
.leftEye = {
.isGazeOriginValid = m_pGazeState->leftEye.isGazeOriginValid == Hmd2Bool::HMD2_BOOL_TRUE,
.gazeOriginMm = {
.x = m_pGazeState->leftEye.gazeOriginMm.x,
.y = m_pGazeState->leftEye.gazeOriginMm.y,
.z = m_pGazeState->leftEye.gazeOriginMm.z,
},
.isGazeDirValid = m_pGazeState->leftEye.isGazeDirValid == Hmd2Bool::HMD2_BOOL_TRUE,
.gazeDirNorm {
.x = m_pGazeState->leftEye.gazeDirNorm.x,
.y = m_pGazeState->leftEye.gazeDirNorm.y,
.z = m_pGazeState->leftEye.gazeDirNorm.z,
},
.isPupilDiaValid = m_pGazeState->leftEye.isPupilDiaValid == Hmd2Bool::HMD2_BOOL_TRUE,
.pupilDiaMm = m_pGazeState->leftEye.pupilDiaMm,
.isBlinkValid = m_pGazeState->leftEye.isBlinkValid == Hmd2Bool::HMD2_BOOL_TRUE,
.blink = m_pGazeState->leftEye.blink == Hmd2Bool::HMD2_BOOL_TRUE,
.isOpenEnabled = m_doOpenness,
.open = m_doOpenness ? m_leftEyelidOpenness : 0.0f,
},
.rightEye = {
.isGazeOriginValid = m_pGazeState->rightEye.isGazeOriginValid == Hmd2Bool::HMD2_BOOL_TRUE,
.gazeOriginMm = {
.x = m_pGazeState->rightEye.gazeOriginMm.x,
.y = m_pGazeState->rightEye.gazeOriginMm.y,
.z = m_pGazeState->rightEye.gazeOriginMm.z,
},
.isGazeDirValid = m_pGazeState->rightEye.isGazeDirValid == Hmd2Bool::HMD2_BOOL_TRUE,
.gazeDirNorm {
.x = m_pGazeState->rightEye.gazeDirNorm.x,
.y = m_pGazeState->rightEye.gazeDirNorm.y,
.z = m_pGazeState->rightEye.gazeDirNorm.z,
},
.isPupilDiaValid = m_pGazeState->rightEye.isPupilDiaValid == Hmd2Bool::HMD2_BOOL_TRUE,
.pupilDiaMm = m_pGazeState->rightEye.pupilDiaMm,
.isBlinkValid = m_pGazeState->rightEye.isBlinkValid == Hmd2Bool::HMD2_BOOL_TRUE,
.blink = m_pGazeState->rightEye.blink == Hmd2Bool::HMD2_BOOL_TRUE,
.isOpenEnabled = m_doOpenness,
.open = m_doOpenness ? m_rightEyelidOpenness : 0.0f,
}
};
SendIpcCommand(clientSocket, Command_ServerGazeDataResult, &response, sizeof(response));
} else {
CommandDataServerGazeDataResult3_t response = {
.leftEye = {
.isGazeOriginValid = m_pGazeState->leftEye.isGazeOriginValid == Hmd2Bool::HMD2_BOOL_TRUE,
.gazeOriginMm = {
.x = m_pGazeState->leftEye.gazeOriginMm.x,
.y = m_pGazeState->leftEye.gazeOriginMm.y,
.z = m_pGazeState->leftEye.gazeOriginMm.z,
},
.isGazeDirValid = m_pGazeState->leftEye.isGazeDirValid == Hmd2Bool::HMD2_BOOL_TRUE,
.gazeDirNorm {
.x = m_pGazeState->leftEye.gazeDirNorm.x,
.y = m_pGazeState->leftEye.gazeDirNorm.y,
.z = m_pGazeState->leftEye.gazeDirNorm.z,
},
.isPupilDiaValid = m_pGazeState->leftEye.isPupilDiaValid == Hmd2Bool::HMD2_BOOL_TRUE,
.pupilDiaMm = m_pGazeState->leftEye.pupilDiaMm,
.isPupilPosInSensorValid = m_pGazeState->leftEye.isPupilPosInSensorValid == Hmd2Bool::HMD2_BOOL_TRUE,
.pupilPosInSensor = {
.x = m_pGazeState->leftEye.pupilPosInSensor.x,
.y = m_pGazeState->leftEye.pupilPosInSensor.y,
},
.isPosGuideValid = m_pGazeState->leftEye.isPosGuideValid == Hmd2Bool::HMD2_BOOL_TRUE,
.posGuide = {
.x = m_pGazeState->leftEye.posGuide.x,
.y = m_pGazeState->leftEye.posGuide.y,
},
.isBlinkValid = m_pGazeState->leftEye.isBlinkValid == Hmd2Bool::HMD2_BOOL_TRUE,
.blink = m_pGazeState->leftEye.blink == Hmd2Bool::HMD2_BOOL_TRUE,
.isOpenEnabled = m_doOpenness,
.open = m_doOpenness ? m_leftEyelidOpenness : 0.0f,
},
.rightEye = {
.isGazeOriginValid = m_pGazeState->rightEye.isGazeOriginValid == Hmd2Bool::HMD2_BOOL_TRUE,
.gazeOriginMm = {
.x = m_pGazeState->rightEye.gazeOriginMm.x,
.y = m_pGazeState->rightEye.gazeOriginMm.y,
.z = m_pGazeState->rightEye.gazeOriginMm.z,
},
.isGazeDirValid = m_pGazeState->rightEye.isGazeDirValid == Hmd2Bool::HMD2_BOOL_TRUE,
.gazeDirNorm {
.x = m_pGazeState->rightEye.gazeDirNorm.x,
.y = m_pGazeState->rightEye.gazeDirNorm.y,
.z = m_pGazeState->rightEye.gazeDirNorm.z,
},
.isPupilDiaValid = m_pGazeState->rightEye.isPupilDiaValid == Hmd2Bool::HMD2_BOOL_TRUE,
.pupilDiaMm = m_pGazeState->rightEye.pupilDiaMm,
.isPupilPosInSensorValid = m_pGazeState->rightEye.isPupilPosInSensorValid == Hmd2Bool::HMD2_BOOL_TRUE,
.pupilPosInSensor = {
.x = m_pGazeState->rightEye.pupilPosInSensor.x,
.y = m_pGazeState->rightEye.pupilPosInSensor.y,
},
.isPosGuideValid = m_pGazeState->rightEye.isPosGuideValid == Hmd2Bool::HMD2_BOOL_TRUE,
.posGuide = {
.x = m_pGazeState->rightEye.posGuide.x,
.y = m_pGazeState->rightEye.posGuide.y,
},
.isBlinkValid = m_pGazeState->rightEye.isBlinkValid == Hmd2Bool::HMD2_BOOL_TRUE,
.blink = m_pGazeState->rightEye.blink == Hmd2Bool::HMD2_BOOL_TRUE,
.isOpenEnabled = m_doOpenness,
.open = m_doOpenness ? m_rightEyelidOpenness : 0.0f,
}
};
SendIpcCommand(clientSocket, Command_ServerGazeDataResult, &response, sizeof(response));
}
} else {
// Handle old client IPC version requests here, as well.
if (m_connections[clientPort].ipcVersion == 1) {
CommandDataServerGazeDataResult_t response = {};
SendIpcCommand(clientSocket, Command_ServerGazeDataResult, &response, sizeof(response));
} else if (m_connections[clientPort].ipcVersion == 2) {
CommandDataServerGazeDataResult2_t response = {};
SendIpcCommand(clientSocket, Command_ServerGazeDataResult, &response, sizeof(response));
} else {
CommandDataServerGazeDataResult3_t response = {};
SendIpcCommand(clientSocket, Command_ServerGazeDataResult, &response, sizeof(response));
}
}
}
break;
}
case Command_ClientTriggerEffectOff:
case Command_ClientTriggerEffectFeedback:
case Command_ClientTriggerEffectWeapon:
case Command_ClientTriggerEffectVibration:
case Command_ClientTriggerEffectMultiplePositionFeedback:
case Command_ClientTriggerEffectSlopeFeedback:
case Command_ClientTriggerEffectMultiplePositionVibration: {
if (m_connections.contains(clientPort)) {
pTriggerEffectManager->HandleIpcCommand(m_connections[clientPort].processId, pHeader, pData);
}
break;
}
}
}
void IpcServer::SendIpcCommand(SOCKET clientSocket, ECommandType type, void *pData, int dataLen) {
// Reduce the allocations by making the buffer static.
// I'm sure this isn't thread-safe, but we only have one receive thread anyways.
static char pBuffer[1024] = {};
int actualDataLen = pData ? dataLen : 0;
int actualBufferLen = sizeof(CommandHeader_t) + actualDataLen;
CommandHeader_t *pHeader = reinterpret_cast<CommandHeader_t *>(pBuffer);
pHeader->type = type;
pHeader->dataLen = actualDataLen;
memcpy(pBuffer + sizeof(CommandHeader_t), pData, actualDataLen);
send(clientSocket, pBuffer, actualBufferLen, 0);
}
} // ipc
} // psvr2_toolkit
================================================
FILE: projects/psvr2_openvr_driver_ex/ipc_server.h
================================================
#pragma once
#include "hmd2_gaze.h"
#include "../shared/ipc_protocol.h"
#include <windows.h>
#include <cstdint>
#include <map>
#include <thread>
namespace psvr2_toolkit {
namespace ipc {
class IpcServer {
public:
IpcServer();
static IpcServer *Instance();
bool Initialized();
void Initialize();
void Start();
void Stop();
void UpdateGazeState(Hmd2GazeState *pGazeState, float leftEyelidOpenness, float rightEyelidOpenness);
private:
struct ConnectionInfo_t {
sockaddr_in clientAddr;
uint16_t ipcVersion;
uint32_t processId;
};
static IpcServer *m_pInstance;
bool m_initialized;
bool m_running;
bool m_doGaze;
bool m_doOpenness;
SOCKET m_socket;
sockaddr_in m_serverAddr;
std::thread m_receiveThread;
std::map<uint16_t, ConnectionInfo_t> m_connections;
Hmd2GazeState *m_pGazeState;
float m_leftEyelidOpenness;
float m_rightEyelidOpenness;
void ReceiveLoop();
void HandleClient(SOCKET clientSocket, SOCKADDR_IN clientAddr);
void HandleIpcCommand(SOCKET clientSocket, const sockaddr_in &clientAddr, char *pBuffer);
void SendIpcCommand(SOCKET clientSocket, ECommandType type, void *pData = nullptr, int dataSize = 0);
};
} // ipc
} // psvr2_toolkit
================================================
FILE: projects/psvr2_openvr_driver_ex/minhook/LICENSE.txt
================================================
MinHook - The Minimalistic API Hooking Library for x64/x86
Copyright (C) 2009-2017 Tsuda Kageyu.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
================================================================================
Portions of this software are Copyright (c) 2008-2009, Vyacheslav Patkov.
================================================================================
Hacker Disassembler Engine 32 C
Copyright (c) 2008-2009, Vyacheslav Patkov.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-------------------------------------------------------------------------------
Hacker Disassembler Engine 64 C
Copyright (c) 2008-2009, Vyacheslav Patkov.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
================================================
FILE: projects/psvr2_openvr_driver_ex/minhook/include/MinHook.h
================================================
/*
* MinHook - The Minimalistic API Hooking Library for x64/x86
* Copyright (C) 2009-2017 Tsuda Kageyu.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER
* OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#pragma once
#if !(defined _M_IX86) && !(defined _M_X64) && !(defined __i386__) && !(defined __x86_64__)
#error MinHook supports only x86 and x64 systems.
#endif
#include <windows.h>
// MinHook Error Codes.
typedef enum MH_STATUS
{
// Unknown error. Should not be returned.
MH_UNKNOWN = -1,
// Successful.
MH_OK = 0,
// MinHook is already initialized.
MH_ERROR_ALREADY_INITIALIZED,
// MinHook is not initialized yet, or already uninitialized.
MH_ERROR_NOT_INITIALIZED,
// The hook for the specified target function is already created.
MH_ERROR_ALREADY_CREATED,
// The hook for the specified target function is not created yet.
MH_ERROR_NOT_CREATED,
// The hook for the specified target function is already enabled.
MH_ERROR_ENABLED,
// The hook for the specified target function is not enabled yet, or already
// disabled.
MH_ERROR_DISABLED,
// The specified pointer is invalid. It points the address of non-allocated
// and/or non-executable region.
MH_ERROR_NOT_EXECUTABLE,
// The specified target function cannot be hooked.
MH_ERROR_UNSUPPORTED_FUNCTION,
// Failed to allocate memory.
MH_ERROR_MEMORY_ALLOC,
// Failed to change the memory protection.
MH_ERROR_MEMORY_PROTECT,
// The specified module is not loaded.
MH_ERROR_MODULE_NOT_FOUND,
// The specified function is not found.
MH_ERROR_FUNCTION_NOT_FOUND
}
MH_STATUS;
// Can be passed as a parameter to MH_EnableHook, MH_DisableHook,
// MH_QueueEnableHook or MH_QueueDisableHook.
#define MH_ALL_HOOKS NULL
#ifdef __cplusplus
extern "C" {
#endif
// Initialize the MinHook library. You must call this function EXACTLY ONCE
// at the beginning of your program.
MH_STATUS WINAPI MH_Initialize(VOID);
// Uninitialize the MinHook library. You must call this function EXACTLY
// ONCE at the end of your program.
MH_STATUS WINAPI MH_Uninitialize(VOID);
// Creates a hook for the specified target function, in disabled state.
// Parameters:
// pTarget [in] A pointer to the target function, which will be
// overridden by the detour function.
// pDetour [in] A pointer to the detour function, which will override
// the target function.
// ppOriginal [out] A pointer to the trampoline function, which will be
// used to call the original target function.
// This parameter can be NULL.
MH_STATUS WINAPI MH_CreateHook(LPVOID pTarget, LPVOID pDetour, LPVOID *ppOriginal);
// Creates a hook for the specified API function, in disabled state.
// Parameters:
// pszModule [in] A pointer to the loaded module name which contains the
// target function.
// pszProcName [in] A pointer to the target function name, which will be
// overridden by the detour function.
// pDetour [in] A pointer to the detour function, which will override
// the target function.
// ppOriginal [out] A pointer to the trampoline function, which will be
// used to call the original target function.
// This parameter can be NULL.
MH_STATUS WINAPI MH_CreateHookApi(
LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID *ppOriginal);
// Creates a hook for the specified API function, in disabled state.
// Parameters:
// pszModule [in] A pointer to the loaded module name which contains the
// target function.
// pszProcName [in] A pointer to the target function name, which will be
// overridden by the detour function.
// pDetour [in] A pointer to the detour function, which will override
// the target function.
// ppOriginal [out] A pointer to the trampoline function, which will be
// used to call the original target function.
// This parameter can be NULL.
// ppTarget [out] A pointer to the target function, which will be used
// with other functions.
// This parameter can be NULL.
MH_STATUS WINAPI MH_CreateHookApiEx(
LPCWSTR pszModule, LPCSTR pszProcName, LPVOID pDetour, LPVOID *ppOriginal, LPVOID *ppTarget);
// Removes an already created hook.
// Parameters:
// pTarget [in] A pointer to the target function.
MH_STATUS WINAPI MH_RemoveHook(LPVOID pTarget);
// Enables an already created hook.
// Parameters:
// pTarget [in] A pointer to the target function.
// If this parameter is MH_ALL_HOOKS, all created hooks are
// enabled in one go.
MH_STATUS WINAPI MH_EnableHook(LPVOID pTarget);
// Disables an already created hook.
// Parameters:
// pTarget [in] A pointer to the target function.
// If this parameter is MH_ALL_HOOKS, all created hooks are
// disabled in one go.
MH_STATUS WINAPI MH_DisableHook(LPVOID pTarget);
// Queues to enable an already created hook.
// Parameters:
// pTarget [in] A pointer to the target function.
// If this parameter is MH_ALL_HOOKS, all created hooks are
// queued to be enabled.
MH_STATUS WINAPI MH_QueueEnableHook(LPVOID pTarget);
// Queues to disable an already created hook.
// Parameters:
// pTarget [in] A pointer to the target function.
// If this parameter is MH_ALL_HOOKS, all created hooks are
// queued to be disabled.
MH_STATUS WINAPI MH_QueueDisableHook(LPVOID pTarget);
// Applies all queued changes in one go.
MH_STATUS WINAPI MH_ApplyQueued(VOID);
// Translates the MH_STATUS to its name as a string.
const char *WINAPI MH_StatusToString(MH_STATUS status);
#ifdef __cplusplus
}
#endif
================================================
FILE: projects/psvr2_openvr_driver_ex/pad_trigger_effect.h
================================================
/* SIE CONFIDENTIAL
* $PSLibId$
* Copyright (C) 2019 Sony Interactive Entertainment Inc.
* All Rights Reserved.
*/
#ifndef _SCE_PAD_TRIGGER_EFFECT_H
#define _SCE_PAD_TRIGGER_EFFECT_H
#include <stdint.h>
#define SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_L2 0x01
#define SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_R2 0x02
#define SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_L2 0
#define SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2 1
#define SCE_PAD_TRIGGER_EFFECT_TRIGGER_NUM 2
/* Definition of control point num */
#define SCE_PAD_TRIGGER_EFFECT_CONTROL_POINT_NUM 10
typedef enum ScePadTriggerEffectMode{
SCE_PAD_TRIGGER_EFFECT_MODE_OFF,
SCE_PAD_TRIGGER_EFFECT_MODE_FEEDBACK,
SCE_PAD_TRIGGER_EFFECT_MODE_WEAPON,
SCE_PAD_TRIGGER_EFFECT_MODE_VIBRATION,
SCE_PAD_TRIGGER_EFFECT_MODE_MULTIPLE_POSITION_FEEDBACK,
SCE_PAD_TRIGGER_EFFECT_MODE_SLOPE_FEEDBACK,
SCE_PAD_TRIGGER_EFFECT_MODE_MULTIPLE_POSITION_VIBRATION,
} ScePadTriggerEffectMode;
/**
*E
* @brief parameter for setting the trigger effect to off mode.
* Off Mode: Stop trigger effect.
**/
typedef struct ScePadTriggerEffectOffParam{
uint8_t padding[48];
} ScePadTriggerEffectOffParam;
/**
*E
* @brief parameter for setting the trigger effect to Feedback mode.
* Feedback Mode: The motor arm pushes back trigger.
* Trigger obtains stiffness at specified position.
**/
typedef struct ScePadTriggerEffectFeedbackParam{
uint8_t position; /*E position where the strength of target trigger start changing(0~9). */
uint8_t strength; /*E strength that the motor arm pushes back target trigger(0~8 (0: Same as Off mode)). */
uint8_t padding[46];
} ScePadTriggerEffectFeedbackParam;
/**
*E
* @brief parameter for setting the trigger effect to Weapon mode.
* Weapon Mode: Emulate weapon like gun trigger.
**/
typedef struct ScePadTriggerEffectWeaponParam{
uint8_t startPosition; /*E position where the stiffness of trigger start changing(2~7). */
uint8_t endPosition; /*E position where the stiffness of trigger finish changing(startPosition+1~8). */
uint8_t strength; /*E strength of gun trigger(0~8 (0: Same as Off mode)). */
uint8_t padding[45];
} ScePadTriggerEffectWeaponParam;
/**
*E
* @brief parameter for setting the trigger effect to Vibration mode.
* Vibration Mode: Vibrates motor arm around specified position.
**/
typedef struct ScePadTriggerEffectVibrationParam{
uint8_t position; /*E position where the motor arm start vibrating(0~9). */
uint8_t amplitude; /*E vibration amplitude(0~8 (0: Same as Off mode)). */
uint8_t frequency; /*E vibration frequency(0~255[Hz] (0: Same as Off mode)). */
uint8_t padding[45];
} ScePadTriggerEffectVibrationParam;
/**
*E
* @brief parameter for setting the trigger effect to ScePadTriggerEffectMultiplePositionFeedbackParam mode.
* Multi Position Feedback Mode: The motor arm pushes back trigger.
* Trigger obtains specified stiffness at each control point.
**/
typedef struct ScePadTriggerEffectMultiplePositionFeedbackParam{
uint8_t strength[SCE_PAD_TRIGGER_EFFECT_CONTROL_POINT_NUM]; /*E strength that the motor arm pushes back target trigger at position(0~8 (0: Same as Off mode)).
* strength[0] means strength of motor arm at position0.
* strength[1] means strength of motor arm at position1.
* ...
* */
uint8_t padding[38];
} ScePadTriggerEffectMultiplePositionFeedbackParam;
/**
*E
* @brief parameter for setting the trigger effect to Feedback3 mode.
* Slope Feedback Mode: The motor arm pushes back trigger between two spedified control points.
* Stiffness of the trigger is changing depending on the set place.
**/
typedef struct ScePadTriggerEffectSlopeFeedbackParam{
uint8_t startPosition; /*E position where the strength of target trigger start changing(0~endPosition). */
uint8_t endPosition; /*E position where the strength of target trigger finish changing(startPosition+1~9). */
uint8_t startStrength; /*E strength when trigger's position is startPosition(1~8) */
uint8_t endStrength; /*E strength when trigger's position is endPosition(1~8) */
uint8_t padding[44];
} ScePadTriggerEffectSlopeFeedbackParam;
/**
*E
* @brief parameter for setting the trigger effect to Vibration2 mode.
* Multi Position Vibration Mode: Vibrates motor arm around specified control point.
* Trigger vibrates specified amplitude at each control point.
**/
typedef struct ScePadTriggerEffectMultiplePositionVibrationParam{
uint8_t frequency; /*E vibration frequency(0~255 (0: Same as Off mode)) */
uint8_t amplitude[SCE_PAD_TRIGGER_EFFECT_CONTROL_POINT_NUM]; /*E vibration amplitude at position(0~8 (0: Same as Off mode)).
* amplitude[0] means amplitude of vibration at position0.
* amplitude[1] means amplitude of vibration at position1.
* ...
* */
uint8_t padding[37];
} ScePadTriggerEffectMultiplePositionVibrationParam;
/**
*E
* @brief parameter for setting the trigger effect mode.
**/
typedef union ScePadTriggerEffectCommandData{
ScePadTriggerEffectOffParam offParam;
ScePadTriggerEffectFeedbackParam feedbackParam;
ScePadTriggerEffectWeaponParam weaponParam;
ScePadTriggerEffectVibrationParam vibrationParam;
ScePadTriggerEffectMultiplePositionFeedbackParam multiplePositionFeedbackParam;
ScePadTriggerEffectSlopeFeedbackParam slopeFeedbackParam;
ScePadTriggerEffectMultiplePositionVibrationParam multiplePositionVibrationParam;
} ScePadTriggerEffectCommandData;
/**
*E
* @brief parameter for setting the trigger effect.
**/
typedef struct ScePadTriggerEffectCommand{
ScePadTriggerEffectMode mode;
uint8_t padding[4];
ScePadTriggerEffectCommandData commandData;
} ScePadTriggerEffectCommand;
/**
*E
* @brief parameter for the scePadSetTriggerEffect function.
**/
typedef struct ScePadTriggerEffectParam{
uint8_t triggerMask; /*E Set trigger mask to activate trigger effect commands.
* SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_L2 : 0x01
* SCE_PAD_TRIGGER_EFFECT_TRIGGER_MASK_R2 : 0x02
* */
uint8_t padding[7];
ScePadTriggerEffectCommand command[SCE_PAD_TRIGGER_EFFECT_TRIGGER_NUM]; /*E command[SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_L2] is for L2 trigger setting
* and param[SCE_PAD_TRIGGER_EFFECT_PARAM_INDEX_FOR_R2] is for R2 trgger setting.
* */
} ScePadTriggerEffectParam;
#if defined(__cplusplus) && __cplusplus >= 201103L
static_assert( sizeof( ScePadTriggerEffectParam ) == 120, "ScePadTriggerEffectParam has incorrect size" );
#endif
#endif /* _SCE_PAD_TRIGGER_EFFECT_H */
================================================
FILE: projects/psvr2_openvr_driver_ex/psvr2_openvr_driver/openvr/LICENSE
================================================
Copyright (c) 2015, Valve Corporation
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
================================================
FILE: projects/psvr2_openvr_driver_ex/psvr2_openvr_driver/openvr/headers/openvr_driver.h
================================================
#pragma once
// openvr_driver.h
//========= Copyright Valve Corporation ============//
// Dynamically generated file. Do not modify this file directly.
#ifndef _OPENVR_DRIVER_API
#define _OPENVR_DRIVER_API
#include <stdint.h>
// version.h
namespace vr
{
static const uint32_t k_nSteamVRVersionMajor = 2;
static const uint32_t k_nSteamVRVersionMinor = 12;
static const uint32_t k_nSteamVRVersionBuild = 14;
} // namespace vr
// public_vrtypes.h
#ifndef _INCLUDE_CORE_VRTYPES_PUBLIC_H
#define _INCLUDE_CORE_VRTYPES_PUBLIC_H
namespace vr
{
#pragma pack( push, 8 )
typedef uint32_t PropertyTypeTag_t;
// right-handed system
// +y is up
// +x is to the right
// -z is forward
// Distance unit is meters
struct HmdMatrix34_t
{
float m[3][4];
};
struct HmdMatrix33_t
{
float m[3][3];
};
struct HmdMatrix44_t
{
float m[4][4];
};
struct HmdVector3_t
{
float v[3];
};
struct HmdVector4_t
{
float v[4];
};
struct HmdVector3d_t
{
double v[3];
};
struct HmdVector2_t
{
float v[2];
};
struct HmdQuaternion_t
{
double w, x, y, z;
};
struct HmdQuaternionf_t
{
float w, x, y, z;
};
struct HmdColor_t
{
float r, g, b, a;
};
struct HmdQuad_t
{
HmdVector3_t vCorners[ 4 ];
};
struct HmdRect2_t
{
HmdVector2_t vTopLeft;
HmdVector2_t vBottomRight;
};
/** Holds the transform for a single bone */
struct VRBoneTransform_t
{
HmdVector4_t position;
HmdQuaternionf_t orientation;
};
struct VREyeTrackingData_t
{
bool bActive;
bool bValid;
bool bTracked;
vr::HmdVector3_t vGazeOrigin; // Ray origin
vr::HmdVector3_t vGazeTarget; // Gaze target (fixation point)
};
/** Used to return the post-distortion UVs for each color channel.
* UVs range from 0 to 1 with 0,0 in the upper left corner of the
* source render target. The 0,0 to 1,1 range covers a single eye. */
struct DistortionCoordinates_t
{
float rfRed[2];
float rfGreen[2];
float rfBlue[2];
};
enum EVREye
{
Eye_Left = 0,
Eye_Right = 1
};
enum ETextureType
{
TextureType_Invalid = -1, // Handle has been invalidated
TextureType_DirectX = 0, // Handle is an ID3D11Texture
TextureType_OpenGL = 1, // Handle is an OpenGL texture name or an OpenGL render buffer name, depending on submit flags
TextureType_Vulkan = 2, // Handle is a pointer to a VRVulkanTextureData_t structure
TextureType_IOSurface = 3, // Handle is a macOS cross-process-sharable IOSurfaceRef, deprecated in favor of TextureType_Metal on supported platforms
TextureType_DirectX12 = 4, // Handle is a pointer to a D3D12TextureData_t structure
TextureType_DXGISharedHandle = 5, // Handle is a HANDLE DXGI share handle, only supported for Overlay render targets.
// this texture is used directly by our renderer, so only perform atomic (copyresource or resolve) on it
TextureType_Metal = 6, // Handle is a MTLTexture conforming to the MTLSharedTexture protocol. Textures submitted to IVRCompositor::Submit which
// are of type MTLTextureType2DArray assume layer 0 is the left eye texture (vr::EVREye::Eye_left), layer 1 is the right
// eye texture (vr::EVREye::Eye_Right)
TextureType_Reserved = 7,
TextureType_SharedTextureHandle = 8, // A pointer to a vr::SharedTextureHandle_t that was imported via, eg. ImportDmabuf.
};
enum EColorSpace
{
ColorSpace_Auto = 0, // Assumes 'gamma' for 8-bit per component formats, otherwise 'linear'. This mirrors the DXGI formats which have _SRGB variants.
ColorSpace_Gamma = 1, // Texture data can be displayed directly on the display without any conversion (a.k.a. display native format).
ColorSpace_Linear = 2, // Same as gamma but has been converted to a linear representation using DXGI's sRGB conversion algorithm.
};
struct Texture_t
{
void* handle; // See ETextureType definition above
ETextureType eType;
EColorSpace eColorSpace;
};
/** Allows the application to control what part of the provided texture will be used in the
* frame buffer. */
struct VRTextureBounds_t
{
float uMin, vMin;
float uMax, vMax;
};
/** Allows specifying pose used to render provided scene texture (if different from value returned by WaitGetPoses). */
struct VRTextureWithPose_t : public Texture_t
{
HmdMatrix34_t mDeviceToAbsoluteTracking; // Actual pose used to render scene textures.
};
struct VRTextureDepthInfo_t
{
void* handle; // See ETextureType definition above
HmdMatrix44_t mProjection;
HmdVector2_t vRange; // 0..1
};
struct VRTextureWithDepth_t : public Texture_t
{
VRTextureDepthInfo_t depth;
};
struct VRTextureWithPoseAndDepth_t : public VRTextureWithPose_t
{
VRTextureDepthInfo_t depth;
};
// 64-bit types that are part of public structures
// that are replicated in shared memory.
#if defined(__linux__) || defined(__APPLE__)
typedef uint64_t vrshared_uint64_t __attribute__ ((aligned(8)));
typedef double vrshared_double __attribute__ ((aligned(8)));
#else
typedef uint64_t vrshared_uint64_t;
typedef double vrshared_double;
#endif
static const uint32_t MaxDmabufPlaneCount = 4;
struct DmabufPlane_t
{
uint32_t unOffset;
uint32_t unStride;
int32_t nFd;
};
struct DmabufAttributes_t
{
void *pNext; // MUST be NULL. Unused right now, but could be used to extend this structure in the future.
uint32_t unWidth;
uint32_t unHeight;
uint32_t unDepth;
uint32_t unMipLevels;
uint32_t unArrayLayers;
uint32_t unSampleCount;
uint32_t unFormat; // DRM_FORMAT_
uint64_t ulModifier; // DRM_FORMAT_MOD_
uint32_t unPlaneCount;
DmabufPlane_t plane[MaxDmabufPlaneCount];
};
#pragma pack( pop )
} // namespace vr
#endif
// vrtypes.h
#ifndef _INCLUDE_VRTYPES_H
#define _INCLUDE_VRTYPES_H
// Forward declarations to avoid requiring vulkan.h
struct VkDevice_T;
struct VkPhysicalDevice_T;
struct VkInstance_T;
struct VkQueue_T;
// Forward declarations to avoid requiring d3d12.h
struct ID3D12Resource;
struct ID3D12CommandQueue;
namespace vr
{
#pragma pack( push, 8 )
/** A handle for a spatial anchor. This handle is only valid during the session it was created in.
* Anchors that live beyond one session should be saved by their string descriptors. */
typedef uint32_t SpatialAnchorHandle_t;
typedef void* glSharedTextureHandle_t;
typedef int32_t glInt_t;
typedef uint32_t glUInt_t;
// Handle to a shared texture (HANDLE on Windows obtained using OpenSharedResource).
typedef uint64_t SharedTextureHandle_t;
#define INVALID_SHARED_TEXTURE_HANDLE ((vr::SharedTextureHandle_t)0)
enum ETrackingResult
{
TrackingResult_Uninitialized = 1,
TrackingResult_Calibrating_InProgress = 100,
TrackingResult_Calibrating_OutOfRange = 101,
TrackingResult_Running_OK = 200,
TrackingResult_Running_OutOfRange = 201,
TrackingResult_Fallback_RotationOnly = 300,
};
typedef uint32_t DriverId_t;
static const uint32_t k_nDriverNone = 0xFFFFFFFF;
static const uint32_t k_unMaxDriverDebugResponseSize = 32768;
/** Used to pass device IDs to API calls */
typedef uint32_t TrackedDeviceIndex_t;
static const uint32_t k_unTrackedDeviceIndex_Hmd = 0;
static const uint32_t k_unMaxTrackedDeviceCount = 64;
static const uint32_t k_unTrackedDeviceIndexOther = 0xFFFFFFFE;
static const uint32_t k_unTrackedDeviceIndexInvalid = 0xFFFFFFFF;
/** Describes what kind of object is being tracked at a given ID */
enum ETrackedDeviceClass
{
TrackedDeviceClass_Invalid = 0, // the ID was not valid.
TrackedDeviceClass_HMD = 1, // Head-Mounted Displays
TrackedDeviceClass_Controller = 2, // Tracked controllers
TrackedDeviceClass_GenericTracker = 3, // Generic trackers, similar to controllers
TrackedDeviceClass_TrackingReference = 4, // Camera and base stations that serve as tracking reference points
TrackedDeviceClass_DisplayRedirect = 5, // Accessories that aren't necessarily tracked themselves, but may redirect video output from other tracked devices
TrackedDeviceClass_Max
};
/** Describes what specific role associated with a tracked device */
enum ETrackedControllerRole
{
TrackedControllerRole_Invalid = 0, // Invalid value for controller type
TrackedControllerRole_LeftHand = 1, // Tracked device associated with the left hand
TrackedControllerRole_RightHand = 2, // Tracked device associated with the right hand
TrackedControllerRole_OptOut = 3, // Tracked device is opting out of left/right hand selection
TrackedControllerRole_Treadmill = 4, // Tracked device is a treadmill or other locomotion device
TrackedControllerRole_Stylus = 5, // Tracked device is a stylus
TrackedControllerRole_Max = 5
};
/** Returns true if the tracked controller role is allowed to be a hand */
inline bool IsRoleAllowedAsHand( ETrackedControllerRole eRole )
{
switch ( eRole )
{
case TrackedControllerRole_Invalid:
case TrackedControllerRole_LeftHand:
case TrackedControllerRole_RightHand:
return true;
default:
return false;
}
}
/** describes a single pose for a tracked object */
struct TrackedDevicePose_t
{
HmdMatrix34_t mDeviceToAbsoluteTracking;
HmdVector3_t vVelocity; // velocity in tracker space in m/s
HmdVector3_t vAngularVelocity; // angular velocity in radians/s (?)
ETrackingResult eTrackingResult;
bool bPoseIsValid;
// This indicates that there is a device connected for this spot in the pose array.
// It could go from true to false if the user unplugs the device.
bool bDeviceIsConnected;
};
/** Identifies which style of tracking origin the application wants to use
* for the poses it is requesting */
enum ETrackingUniverseOrigin
{
TrackingUniverseSeated = 0, // Poses are provided relative to the seated zero pose
TrackingUniverseStanding = 1, // Poses are provided relative to the safe bounds configured by the user
TrackingUniverseRawAndUncalibrated = 2, // Poses are provided in the coordinate system defined by the driver. It has Y up and is unified for devices of the same driver. You usually don't want this one.
};
enum EAdditionalRadioFeatures
{
AdditionalRadioFeatures_None = 0x00000000,
AdditionalRadioFeatures_HTCLinkBox = 0x00000001,
AdditionalRadioFeatures_InternalDongle = 0x00000002,
AdditionalRadioFeatures_ExternalDongle = 0x00000004,
};
typedef uint64_t WebConsoleHandle_t;
#define INVALID_WEB_CONSOLE_HANDLE ((vr::WebConsoleHandle_t)0)
// Refers to a single container of properties
typedef uint64_t PropertyContainerHandle_t;
typedef uint32_t PropertyTypeTag_t;
static const PropertyContainerHandle_t k_ulInvalidPropertyContainer = 0;
static const PropertyTypeTag_t k_unInvalidPropertyTag = 0;
typedef PropertyContainerHandle_t DriverHandle_t;
static const PropertyContainerHandle_t k_ulInvalidDriverHandle = 0;
// Use these tags to set/get common types as struct properties
static const PropertyTypeTag_t k_unFloatPropertyTag = 1;
static const PropertyTypeTag_t k_unInt32PropertyTag = 2;
static const PropertyTypeTag_t k_unUint64PropertyTag = 3;
static const PropertyTypeTag_t k_unBoolPropertyTag = 4;
static const PropertyTypeTag_t k_unStringPropertyTag = 5;
static const PropertyTypeTag_t k_unErrorPropertyTag = 6;
static const PropertyTypeTag_t k_unDoublePropertyTag = 7;
static const PropertyTypeTag_t k_unHmdMatrix34PropertyTag = 20;
static const PropertyTypeTag_t k_unHmdMatrix44PropertyTag = 21;
static const PropertyTypeTag_t k_unHmdVector3PropertyTag = 22;
static const PropertyTypeTag_t k_unHmdVector4PropertyTag = 23;
static const PropertyTypeTag_t k_unHmdVector2PropertyTag = 24;
static const PropertyTypeTag_t k_unHmdQuadPropertyTag = 25;
static const PropertyTypeTag_t k_unHiddenAreaPropertyTag = 30;
static const PropertyTypeTag_t k_unPathHandleInfoTag = 31;
static const PropertyTypeTag_t k_unActionPropertyTag = 32;
static const PropertyTypeTag_t k_unInputValuePropertyTag = 33;
static const PropertyTypeTag_t k_unWildcardPropertyTag = 34;
static const PropertyTypeTag_t k_unHapticVibrationPropertyTag = 35;
static const PropertyTypeTag_t k_unSkeletonPropertyTag = 36;
static const PropertyTypeTag_t k_unSpatialAnchorPosePropertyTag = 40;
static const PropertyTypeTag_t k_unJsonPropertyTag = 41;
static const PropertyTypeTag_t k_unActiveActionSetPropertyTag = 42;
static const PropertyTypeTag_t k_unOpenVRInternalReserved_Start = 1000;
static const PropertyTypeTag_t k_unOpenVRInternalReserved_End = 10000;
/** Each entry in this enum represents a property that can be retrieved about a
* tracked device. Many fields are only valid for one ETrackedDeviceClass. */
enum ETrackedDeviceProperty
{
Prop_Invalid = 0,
// general properties that apply to all device classes
Prop_TrackingSystemName_String = 1000,
Prop_ModelNumber_String = 1001,
Prop_SerialNumber_String = 1002,
Prop_RenderModelName_String = 1003,
Prop_WillDriftInYaw_Bool = 1004,
Prop_ManufacturerName_String = 1005,
Prop_TrackingFirmwareVersion_String = 1006,
Prop_HardwareRevision_String = 1007,
Prop_AllWirelessDongleDescriptions_String = 1008,
Prop_ConnectedWirelessDongle_String = 1009,
Prop_DeviceIsWireless_Bool = 1010,
Prop_DeviceIsCharging_Bool = 1011,
Prop_DeviceBatteryPercentage_Float = 1012, // 0 is empty, 1 is full
Prop_StatusDisplayTransform_Matrix34 = 1013,
Prop_Firmware_UpdateAvailable_Bool = 1014,
Prop_Firmware_ManualUpdate_Bool = 1015,
Prop_Firmware_ManualUpdateURL_String = 1016,
Prop_HardwareRevision_Uint64 = 1017,
Prop_FirmwareVersion_Uint64 = 1018,
Prop_FPGAVersion_Uint64 = 1019,
Prop_VRCVersion_Uint64 = 1020,
Prop_RadioVersion_Uint64 = 1021,
Prop_DongleVersion_Uint64 = 1022,
Prop_BlockServerShutdown_Bool = 1023,
Prop_CanUnifyCoordinateSystemWithHmd_Bool = 1024,
Prop_ContainsProximitySensor_Bool = 1025,
Prop_DeviceProvidesBatteryStatus_Bool = 1026,
Prop_DeviceCanPowerOff_Bool = 1027,
Prop_Firmware_ProgrammingTarget_String = 1028,
Prop_DeviceClass_Int32 = 1029,
Prop_HasCamera_Bool = 1030,
Prop_DriverVersion_String = 1031,
Prop_Firmware_ForceUpdateRequired_Bool = 1032,
Prop_ViveSystemButtonFixRequired_Bool = 1033,
Prop_ParentDriver_Uint64 = 1034,
Prop_ResourceRoot_String = 1035,
Prop_RegisteredDeviceType_String = 1036,
Prop_InputProfilePath_String = 1037, // input profile to use for this device in the input system. Will default to tracking system name if this isn't provided
Prop_NeverTracked_Bool = 1038, // Used for devices that will never have a valid pose by design
Prop_NumCameras_Int32 = 1039,
Prop_CameraFrameLayout_Int32 = 1040, // EVRTrackedCameraFrameLayout value
Prop_CameraStreamFormat_Int32 = 1041, // ECameraVideoStreamFormat value
Prop_AdditionalDeviceSettingsPath_String = 1042, // driver-relative path to additional device and global configuration settings
Prop_Identifiable_Bool = 1043, // Whether device supports being identified from vrmonitor (e.g. blink LED, vibrate haptics, etc)
Prop_BootloaderVersion_Uint64 = 1044,
Prop_AdditionalSystemReportData_String = 1045, // additional string to include in system reports about a tracked device
Prop_CompositeFirmwareVersion_String = 1046, // additional FW components from a device that gets propagated into reports
Prop_Firmware_RemindUpdate_Bool = 1047,
Prop_PeripheralApplicationVersion_Uint64 = 1048,
Prop_ManufacturerSerialNumber_String = 1049,
Prop_ComputedSerialNumber_String = 1050,
Prop_EstimatedDeviceFirstUseTime_Int32 = 1051,
Prop_DevicePowerUsage_Float = 1052,
Prop_IgnoreMotionForStandby_Bool = 1053,
Prop_ActualTrackingSystemName_String = 1054, // the literal local driver name in case someone is playing games with prop 1000
Prop_AllowCameraToggle_Bool = 1055, // Shows the Enable/Disable camera option. Hide this for certain headsets if they have the camera tracking (since it's always on)
Prop_AllowLightSourceFrequency_Bool = 1056, // Shows the Anti-Flicker option in camera settings.
Prop_SteamRemoteClientID_Uint64 = 1057, // For vrlink
Prop_Reserved_1058 = 1058,
// Properties that are unique to TrackedDeviceClass_HMD
Prop_ReportsTimeSinceVSync_Bool = 2000,
Prop_SecondsFromVsyncToPhotons_Float = 2001,
Prop_DisplayFrequency_Float = 2002,
Prop_UserIpdMeters_Float = 2003,
Prop_CurrentUniverseId_Uint64 = 2004,
Prop_PreviousUniverseId_Uint64 = 2005,
Prop_DisplayFirmwareVersion_Uint64 = 2006,
Prop_IsOnDesktop_Bool = 2007,
Prop_DisplayMCType_Int32 = 2008,
Prop_DisplayMCOffset_Float = 2009,
Prop_DisplayMCScale_Float = 2010,
Prop_EdidVendorID_Int32 = 2011,
Prop_DisplayMCImageLeft_String = 2012,
Prop_DisplayMCImageRight_String = 2013,
Prop_DisplayGCBlackClamp_Float = 2014,
Prop_EdidProductID_Int32 = 2015,
Prop_CameraToHeadTransform_Matrix34 = 2016,
Prop_DisplayGCType_Int32 = 2017,
Prop_DisplayGCOffset_Float = 2018,
Prop_DisplayGCScale_Float = 2019,
Prop_DisplayGCPrescale_Float = 2020,
Prop_DisplayGCImage_String = 2021,
Prop_LensCenterLeftU_Float = 2022,
Prop_LensCenterLeftV_Float = 2023,
Prop_LensCenterRightU_Float = 2024,
Prop_LensCenterRightV_Float = 2025,
Prop_UserHeadToEyeDepthMeters_Float = 2026,
Prop_CameraFirmwareVersion_Uint64 = 2027,
Prop_CameraFirmwareDescription_String = 2028,
Prop_DisplayFPGAVersion_Uint64 = 2029,
Prop_DisplayBootloaderVersion_Uint64 = 2030,
Prop_DisplayHardwareVersion_Uint64 = 2031,
Prop_AudioFirmwareVersion_Uint64 = 2032,
Prop_CameraCompatibilityMode_Int32 = 2033,
Prop_ScreenshotHorizontalFieldOfViewDegrees_Float = 2034,
Prop_ScreenshotVerticalFieldOfViewDegrees_Float = 2035,
Prop_DisplaySuppressed_Bool = 2036,
Prop_DisplayAllowNightMode_Bool = 2037,
Prop_DisplayMCImageWidth_Int32 = 2038,
Prop_DisplayMCImageHeight_Int32 = 2039,
Prop_DisplayMCImageNumChannels_Int32 = 2040,
Prop_DisplayMCImageData_Binary = 2041,
Prop_SecondsFromPhotonsToVblank_Float = 2042,
Prop_DriverDirectModeSendsVsyncEvents_Bool = 2043,
Prop_DisplayDebugMode_Bool = 2044,
Prop_GraphicsAdapterLuid_Uint64 = 2045,
Prop_DriverProvidedChaperonePath_String = 2048,
Prop_ExpectedTrackingReferenceCount_Int32 = 2049, // expected number of sensors or basestations to reserve UI space for
Prop_ExpectedControllerCount_Int32 = 2050, // expected number of tracked controllers to reserve UI space for
Prop_NamedIconPathControllerLeftDeviceOff_String = 2051, // placeholder icon for "left" controller if not yet detected/loaded
Prop_NamedIconPathControllerRightDeviceOff_String = 2052, // placeholder icon for "right" controller if not yet detected/loaded
Prop_NamedIconPathTrackingReferenceDeviceOff_String = 2053, // placeholder icon for sensor/base if not yet detected/loaded
Prop_DoNotApplyPrediction_Bool = 2054, // currently no effect. was used to disable HMD pose prediction on MR, which is now done by MR driver setting velocity=0
Prop_CameraToHeadTransforms_Matrix34_Array = 2055,
Prop_DistortionMeshResolution_Int32 = 2056, // custom resolution of compositor calls to IVRSystem::ComputeDistortion
Prop_DriverIsDrawingControllers_Bool = 2057,
Prop_DriverRequestsApplicationPause_Bool = 2058,
Prop_DriverRequestsReducedRendering_Bool = 2059,
Prop_MinimumIpdStepMeters_Float = 2060,
Prop_AudioBridgeFirmwareVersion_Uint64 = 2061,
Prop_ImageBridgeFirmwareVersion_Uint64 = 2062,
Prop_ImuToHeadTransform_Matrix34 = 2063,
Prop_ImuFactoryGyroBias_Vector3 = 2064,
Prop_ImuFactoryGyroScale_Vector3 = 2065,
Prop_ImuFactoryAccelerometerBias_Vector3 = 2066,
Prop_ImuFactoryAccelerometerScale_Vector3 = 2067,
// reserved 2068
Prop_ConfigurationIncludesLighthouse20Features_Bool = 2069,
Prop_AdditionalRadioFeatures_Uint64 = 2070,
Prop_CameraWhiteBalance_Vector4_Array = 2071, // Prop_NumCameras_Int32-sized array of float[4] RGBG white balance calibration data (max size is vr::k_unMaxCameras)
Prop_CameraDistortionFunction_Int32_Array = 2072, // Prop_NumCameras_Int32-sized array of vr::EVRDistortionFunctionType values (max size is vr::k_unMaxCameras)
Prop_CameraDistortionCoefficients_Float_Array = 2073, // Prop_NumCameras_Int32-sized array of double[vr::k_unMaxDistortionFunctionParameters] (max size is vr::k_unMaxCameras)
Prop_ExpectedControllerType_String = 2074,
Prop_HmdTrackingStyle_Int32 = 2075, // one of EHmdTrackingStyle
Prop_DriverProvidedChaperoneVisibility_Bool = 2076,
Prop_HmdColumnCorrectionSettingPrefix_String = 2077,
Prop_CameraSupportsCompatibilityModes_Bool = 2078,
Prop_SupportsRoomViewDepthProjection_Bool = 2079,
Prop_DisplayAvailableFrameRates_Float_Array = 2080, // populated by compositor from actual EDID list when available from GPU driver
Prop_DisplaySupportsMultipleFramerates_Bool = 2081, // if this is true but Prop_DisplayAvailableFrameRates_Float_Array is empty, explain to user
Prop_DisplayColorMultLeft_Vector3 = 2082,
Prop_DisplayColorMultRight_Vector3 = 2083,
Prop_DisplaySupportsRuntimeFramerateChange_Bool = 2084,
Prop_DisplaySupportsAnalogGain_Bool = 2085,
Prop_DisplayMinAnalogGain_Float = 2086,
Prop_DisplayMaxAnalogGain_Float = 2087,
Prop_CameraExposureTime_Float = 2088,
Prop_CameraGlobalGain_Float = 2089,
// Prop_DashboardLayoutPathName_String = 2090, // DELETED
Prop_DashboardScale_Float = 2091,
// Prop_PeerButtonInfo_String = 2092, // DELETED
Prop_Hmd_SupportsHDR10_Bool = 2093,
Prop_Hmd_EnableParallelRenderCameras_Bool = 2094,
Prop_DriverProvidedChaperoneJson_String = 2095, // higher priority than Prop_DriverProvidedChaperonePath_String
Prop_ForceSystemLayerUseAppPoses_Bool = 2096,
Prop_DashboardLinkSupport_Int32 = 2097,
Prop_DisplayMinUIAnalogGain_Float = 2098,
Prop_IpdUIRangeMinMeters_Float = 2100,
Prop_IpdUIRangeMaxMeters_Float = 2101,
Prop_Hmd_SupportsHDCP14LegacyCompat_Bool = 2102,
Prop_Hmd_SupportsMicMonitoring_Bool = 2103,
Prop_Hmd_SupportsDisplayPortTrainingMode_Bool = 2104,
Prop_Hmd_SupportsRoomViewDirect_Bool = 2105,
Prop_Hmd_SupportsAppThrottling_Bool = 2106,
Prop_Hmd_SupportsGpuBusMonitoring_Bool = 2107,
Prop_DriverDisplaysIPDChanges_Bool = 2108,
// Prop_Driver_RecenterSupport_Int32 = 2109, // DELETED
Prop_Reserved_2110 = 2110,
Prop_Reserved_2111 = 2111,
Prop_Reserved_2112 = 2112,
Prop_Hmd_MaxDistortedTextureWidth_Int32 = 2113,
Prop_Hmd_MaxDistortedTextureHeight_Int32 = 2114,
Prop_Hmd_AllowSupersampleFiltering_Bool = 2115,
Prop_Hmd_AllowsClientToControlTextureIndex = 2116,
Prop_Reserved_2117 = 2117,
// Driver requested mura correction properties
Prop_DriverRequestedMuraCorrectionMode_Int32 = 2200,
Prop_DriverRequestedMuraFeather_InnerLeft_Int32 = 2201,
Prop_DriverRequestedMuraFeather_InnerRight_Int32 = 2202,
Prop_DriverRequestedMuraFeather_InnerTop_Int32 = 2203,
Prop_DriverRequestedMuraFeather_InnerBottom_Int32 = 2204,
Prop_DriverRequestedMuraFeather_OuterLeft_Int32 = 2205,
Prop_DriverRequestedMuraFeather_OuterRight_Int32 = 2206,
Prop_DriverRequestedMuraFeather_OuterTop_Int32 = 2207,
Prop_DriverRequestedMuraFeather_OuterBottom_Int32 = 2208,
Prop_Audio_DefaultPlaybackDeviceId_String = 2300,
Prop_Audio_DefaultRecordingDeviceId_String = 2301,
Prop_Audio_DefaultPlaybackDeviceVolume_Float = 2302,
Prop_Audio_SupportsDualSpeakerAndJackOutput_Bool = 2303,
Prop_Audio_DriverManagesPlaybackVolumeControl_Bool = 2304,
Prop_Audio_DriverPlaybackVolume_Float = 2305,
Prop_Audio_DriverPlaybackMute_Bool = 2306,
Prop_Audio_DriverManagesRecordingVolumeControl_Bool = 2307,
Prop_Audio_DriverRecordingVolume_Float = 2308,
Prop_Audio_DriverRecordingMute_Bool = 2309,
// Pipewire Audio Stuff
Prop_Audio_PipewirePlaybackNode_Int32 = 2400,
Prop_Audio_PipewireRecordingNode_Int32 = 2401,
// Properties that are unique to TrackedDeviceClass_Controller
Prop_AttachedDeviceId_String = 3000,
Prop_SupportedButtons_Uint64 = 3001,
Prop_Axis0Type_Int32 = 3002, // Return value is of type EVRControllerAxisType
Prop_Axis1Type_Int32 = 3003, // Return value is of type EVRControllerAxisType
Prop_Axis2Type_Int32 = 3004, // Return value is of type EVRControllerAxisType
Prop_Axis3Type_Int32 = 3005, // Return value is of type EVRControllerAxisType
Prop_Axis4Type_Int32 = 3006, // Return value is of type EVRControllerAxisType
Prop_ControllerRoleHint_Int32 = 3007, // Return value is of type ETrackedControllerRole
// Properties that are unique to TrackedDeviceClass_TrackingReference
Prop_FieldOfViewLeftDegrees_Float = 4000,
Prop_FieldOfViewRightDegrees_Float = 4001,
Prop_FieldOfViewTopDegrees_Float = 4002,
Prop_FieldOfViewBottomDegrees_Float = 4003,
Prop_TrackingRangeMinimumMeters_Float = 4004,
Prop_TrackingRangeMaximumMeters_Float = 4005,
Prop_ModeLabel_String = 4006,
Prop_CanWirelessIdentify_Bool = 4007, // volatile, based on radio presence and fw discovery
Prop_Nonce_Int32 = 4008,
// Properties that are used for user interface like icons names
Prop_IconPathName_String = 5000, // DEPRECATED. Value not referenced. Now expected to be part of icon path properties.
Prop_NamedIconPathDeviceOff_String = 5001, // {driver}/icons/icon_filename - PNG for static icon, or GIF for animation, 50x32 for headsets and 32x32 for others
Prop_NamedIconPathDeviceSearching_String = 5002, // {driver}/icons/icon_filename - PNG for static icon, or GIF for animation, 50x32 for headsets and 32x32 for others
Prop_NamedIconPathDeviceSearchingAlert_String = 5003, // {driver}/icons/icon_filename - PNG for static icon, or GIF for animation, 50x32 for headsets and 32x32 for others
Prop_NamedIconPathDeviceReady_String = 5004, // {driver}/icons/icon_filename - PNG for static icon, or GIF for animation, 50x32 for headsets and 32x32 for others
Prop_NamedIconPathDeviceReadyAlert_String = 5005, // {driver}/icons/icon_filename - PNG for static icon, or GIF for animation, 50x32 for headsets and 32x32 for others
Prop_NamedIconPathDeviceNotReady_String = 5006, // {driver}/icons/icon_filename - PNG for static icon, or GIF for animation, 50x32 for headsets and 32x32 for others
Prop_NamedIconPathDeviceStandby_String = 5007, // {driver}/icons/icon_filename - PNG for static icon, or GIF for animation, 50x32 for headsets and 32x32 for others
Prop_NamedIconPathDeviceAlertLow_String = 5008, // {driver}/icons/icon_filename - PNG for static icon, or GIF for animation, 50x32 for headsets and 32x32 for others
Prop_NamedIconPathDeviceStandbyAlert_String = 5009, // {driver}/icons/icon_filename - PNG for static icon, or GIF for animation, 50x32 for headsets and 32x32 for others
// Properties that are used by helpers, but are opaque to applications
Prop_DisplayHiddenArea_Binary_Start = 5100,
Prop_DisplayHiddenArea_Binary_End = 5150,
Prop_ParentContainer = 5151,
Prop_OverrideContainer_Uint64 = 5152,
// Properties that are unique to drivers
Prop_UserConfigPath_String = 6000,
Prop_InstallPath_String = 6001,
Prop_HasDisplayComponent_Bool = 6002,
Prop_HasControllerComponent_Bool = 6003,
Prop_HasCameraComponent_Bool = 6004,
Prop_HasDriverDirectModeComponent_Bool = 6005,
Prop_HasVirtualDisplayComponent_Bool = 6006,
Prop_HasSpatialAnchorsSupport_Bool = 6007,
Prop_SupportsXrTextureSets_Bool = 6008,
Prop_SupportsXrEyeGazeInteraction_Bool = 6009,
Prop_DeviceHasNoIMU_Bool = 6010,
Prop_UseAdvancedPrediction_Bool = 6011,
// Properties that are set internally based on other information provided by drivers
Prop_ControllerType_String = 7000,
//Prop_LegacyInputProfile_String = 7001, // This is no longer used. See "legacy_binding" in the input profile instead.
Prop_ControllerHandSelectionPriority_Int32 = 7002, // Allows hand assignments to prefer some controllers over others. High numbers are selected over low numbers
// Vendors are free to expose private debug data in this reserved region
Prop_VendorSpecific_Reserved_Start = 10000,
Prop_VendorSpecific_Reserved_End = 10999,
// Addl SteamVR Reserved Space
Prop_Reserved_11000 = 11000,
Prop_Reserved_11001 = 11001,
Prop_Reserved_11002 = 11002,
Prop_Reserved_11003 = 11003,
Prop_Reserved_11004 = 11004,
Prop_TrackedDeviceProperty_Max = 1000000,
};
/** No string property will ever be longer than this length */
static const uint32_t k_unMaxPropertyStringSize = 32 * 1024;
/** Used to return errors that occur when reading properties. */
enum ETrackedPropertyError
{
TrackedProp_Success = 0,
TrackedProp_WrongDataType = 1,
TrackedProp_WrongDeviceClass = 2,
TrackedProp_BufferTooSmall = 3,
TrackedProp_UnknownProperty = 4, // Driver has not set the property (and may not ever).
TrackedProp_InvalidDevice = 5,
TrackedProp_CouldNotContactServer = 6,
TrackedProp_ValueNotProvidedByDevice = 7,
TrackedProp_StringExceedsMaximumLength = 8,
TrackedProp_NotYetAvailable = 9, // The property value isn't known yet, but is expected soon. Call again later.
TrackedProp_PermissionDenied = 10,
TrackedProp_InvalidOperation = 11,
TrackedProp_CannotWriteToWildcards = 12,
TrackedProp_IPCReadFailure = 13,
TrackedProp_OutOfMemory = 14,
TrackedProp_InvalidContainer = 15,
};
/** Used to drive certain text in the UI when talking about the tracking system for the HMD */
enum EHmdTrackingStyle
{
HmdTrackingStyle_Unknown = 0,
HmdTrackingStyle_Lighthouse = 1, // base stations and lasers
HmdTrackingStyle_OutsideInCameras = 2, // Cameras and LED, Rift 1 style
HmdTrackingStyle_InsideOutCameras = 3, // Cameras on HMD looking at the world
};
typedef uint64_t VRActionHandle_t;
typedef uint64_t VRActionSetHandle_t;
typedef uint64_t VRInputValueHandle_t;
typedef uint64_t VRInputComponentHandle_t;
static const VRActionHandle_t k_ulInvalidActionHandle = 0;
static const VRActionSetHandle_t k_ulInvalidActionSetHandle = 0;
static const VRInputValueHandle_t k_ulInvalidInputValueHandle = 0;
static const VRInputComponentHandle_t k_ulInvalidInputComponentHandle = 0;
/** Allows the application to control how scene textures are used by the compositor when calling Submit. */
enum EVRSubmitFlags
{
// Simple render path. App submits rendered left and right eye images with no lens distortion correction applied.
Submit_Default = 0x00,
// App submits final left and right eye images with lens distortion already applied (lens distortion makes the images appear
// barrel distorted with chromatic aberration correction applied). The app would have used the data returned by
// vr::IVRSystem::ComputeDistortion() to apply the correct distortion to the rendered images before calling Submit().
Submit_LensDistortionAlreadyApplied = 0x01,
// If the texture pointer passed in is actually a renderbuffer (e.g. for MSAA in OpenGL) then set this flag.
Submit_GlRenderBuffer = 0x02,
// Do not use
Submit_Reserved = 0x04,
// Set to indicate that pTexture is a pointer to a VRTextureWithPose_t.
// This flag can be combined with Submit_TextureWithDepth to pass a V
gitextract_hh_yerca/
├── .github/
│ └── workflows/
│ └── msbuild.yml
├── .gitignore
├── LICENSE
├── PSVR2Toolkit.sln
├── README.md
├── assets/
│ └── Icons.pdn
├── include/
│ └── psvr2_toolkit_capi.h
└── projects/
├── PSVR2Toolkit.App/
│ ├── App.xaml
│ ├── App.xaml.cs
│ ├── AssemblyInfo.cs
│ ├── MainWindow.xaml
│ ├── MainWindow.xaml.cs
│ ├── PSVR2Toolkit.App.csproj
│ └── Resources/
│ └── .gitkeep
├── PSVR2Toolkit.IPC/
│ ├── IpcClient.cs
│ ├── IpcProtocol.cs
│ └── PSVR2Toolkit.IPC.csproj
├── UnifiedTelemetry.Client_stub/
│ ├── UnifiedTelemetry.Client_stub.vcxproj
│ ├── UnifiedTelemetry.Client_stub.vcxproj.filters
│ └── dllmain.cpp
├── UnifiedTelemetry.Model_stub/
│ ├── UnifiedTelemetry.Model_stub.vcxproj
│ ├── UnifiedTelemetry.Model_stub.vcxproj.filters
│ └── dllmain.cpp
├── UnifiedTelemetry.Service_stub/
│ ├── UnifiedTelemetry.Service_stub.vcxproj
│ ├── UnifiedTelemetry.Service_stub.vcxproj.filters
│ └── dllmain.cpp
├── libcustomshare/
│ ├── custom_share_manager.cpp
│ ├── custom_share_manager.h
│ ├── libcustomshare.vcxproj
│ └── libcustomshare.vcxproj.filters
├── psvr2_openvr_driver_ex/
│ ├── caesar_manager_hooks.cpp
│ ├── caesar_manager_hooks.h
│ ├── config.h
│ ├── device_provider_proxy.cpp
│ ├── device_provider_proxy.h
│ ├── driver_context_proxy.cpp
│ ├── driver_context_proxy.h
│ ├── driver_host_proxy.cpp
│ ├── driver_host_proxy.h
│ ├── eyelid_estimator.cpp
│ ├── eyelid_estimator.h
│ ├── hmd2_gaze.h
│ ├── hmd_device_hooks.cpp
│ ├── hmd_device_hooks.h
│ ├── hmd_driver_factory.cpp
│ ├── hmd_driver_loader.cpp
│ ├── hmd_driver_loader.h
│ ├── hmd_math.h
│ ├── hook_lib.h
│ ├── ipc_server.cpp
│ ├── ipc_server.h
│ ├── minhook/
│ │ ├── LICENSE.txt
│ │ └── include/
│ │ └── MinHook.h
│ ├── pad_trigger_effect.h
│ ├── psvr2_openvr_driver/
│ │ └── openvr/
│ │ ├── LICENSE
│ │ └── headers/
│ │ └── openvr_driver.h
│ ├── psvr2_openvr_driver_ex.vcxproj
│ ├── psvr2_openvr_driver_ex.vcxproj.filters
│ ├── trigger_effect_manager.cpp
│ ├── trigger_effect_manager.h
│ ├── usb_thread_gaze.cpp
│ ├── usb_thread_gaze.h
│ ├── usb_thread_hooks.cpp
│ ├── usb_thread_hooks.h
│ ├── util.h
│ └── vr_settings.h
└── shared/
└── ipc_protocol.h
SYMBOL INDEX (198 symbols across 41 files)
FILE: include/psvr2_toolkit_capi.h
type EResultType (line 8) | enum EResultType {
type EVRControllerType (line 14) | enum EVRControllerType {
FILE: projects/PSVR2Toolkit.App/App.xaml.cs
class App (line 8) | public partial class App : Application
FILE: projects/PSVR2Toolkit.App/MainWindow.xaml.cs
class MainWindow (line 8) | public partial class MainWindow : Window
method MainWindow (line 10) | public MainWindow()
FILE: projects/PSVR2Toolkit.IPC/IpcClient.cs
class IpcClient (line 9) | public class IpcClient {
method Instance (line 27) | public static IpcClient Instance() {
method Start (line 33) | public bool Start() {
method Stop (line 57) | public void Stop() {
method ReceiveLoop (line 86) | private void ReceiveLoop(CancellationToken token) {
method UpgradeGazeEyeResult (line 143) | private GazeEyeResult2 UpgradeGazeEyeResult(GazeEyeResult eye)
method UpgradeGazeDataResult (line 160) | private CommandDataServerGazeDataResult2 UpgradeGazeDataResult(Command...
method HandleIpcCommand (line 169) | private void HandleIpcCommand(byte[] pBuffer, int bytesReceived) {
method SendIpcCommand (line 218) | private void SendIpcCommand<T>(ECommandType type, T data = default) wh...
method SendIpcCommand (line 248) | private void SendIpcCommand(ECommandType type) {
method ByteArrayToStructure (line 269) | private T ByteArrayToStructure<T>(byte[] bytes, int offset) where T : ...
method RequestEyeTrackingData (line 283) | public CommandDataServerGazeDataResult2 RequestEyeTrackingData() {
method TriggerEffectDisable (line 292) | public void TriggerEffectDisable(EVRControllerType controllerType) {
method TriggerEffectFeedback (line 303) | public void TriggerEffectFeedback(EVRControllerType controllerType, by...
method TriggerEffectWeapon (line 315) | public void TriggerEffectWeapon(EVRControllerType controllerType, byte...
method TriggerEffectVibration (line 328) | public void TriggerEffectVibration(EVRControllerType controllerType, b...
method TriggerEffectMultiplePositionFeedback (line 341) | public void TriggerEffectMultiplePositionFeedback(EVRControllerType co...
method TriggerEffectSlopeFeedback (line 352) | public void TriggerEffectSlopeFeedback(EVRControllerType controllerTyp...
method TriggerEffectMultiplePositionVibration (line 366) | public void TriggerEffectMultiplePositionVibration(EVRControllerType c...
FILE: projects/PSVR2Toolkit.IPC/IpcProtocol.cs
type ECommandType (line 4) | public enum ECommandType : ushort {
type EHandshakeResult (line 23) | public enum EHandshakeResult : byte {
type EVRControllerType (line 29) | public enum EVRControllerType : byte {
type CommandDataClientRequestHandshake (line 35) | [StructLayout(LayoutKind.Sequential)]
type CommandDataServerHandshakeResult (line 41) | [StructLayout(LayoutKind.Sequential)]
type GazeVector3 (line 47) | [StructLayout(LayoutKind.Sequential, Pack = 1)]
type GazeEyeResult (line 52) | [StructLayout(LayoutKind.Sequential, Pack = 1)]
type GazeEyeResult2 (line 72) | [StructLayout(LayoutKind.Sequential, Pack = 1)]
type CommandDataServerGazeDataResult (line 96) | [StructLayout(LayoutKind.Sequential)]
type CommandDataServerGazeDataResult2 (line 102) | [StructLayout(LayoutKind.Sequential)]
type CommandHeader (line 108) | [StructLayout(LayoutKind.Sequential)]
type CommandDataClientTriggerEffectOff (line 114) | [StructLayout(LayoutKind.Sequential)]
type CommandDataClientTriggerEffectFeedback (line 119) | [StructLayout(LayoutKind.Sequential)]
type CommandDataClientTriggerEffectWeapon (line 126) | [StructLayout(LayoutKind.Sequential)]
type CommandDataClientTriggerEffectVibration (line 134) | [StructLayout(LayoutKind.Sequential)]
type CommandDataClientTriggerEffectMultiplePositionFeedback (line 142) | [StructLayout(LayoutKind.Sequential)]
type CommandDataClientTriggerEffectSlopeFeedback (line 149) | [StructLayout(LayoutKind.Sequential)]
type CommandDataClientTriggerEffectMultiplePositionVibration (line 158) | [StructLayout(LayoutKind.Sequential)]
FILE: projects/UnifiedTelemetry.Client_stub/dllmain.cpp
function utCreateClient (line 1) | __declspec(dllexport) void utCreateClient() {}
function utDestroyClient (line 2) | __declspec(dllexport) void utDestroyClient() {}
function utInitClient (line 3) | __declspec(dllexport) void utInitClient() {}
function utGetUserClockTimestamp (line 4) | __declspec(dllexport) void utGetUserClockTimestamp() {}
function utDispatch (line 5) | __declspec(dllexport) void utDispatch() {}
function utUserDispatch (line 6) | __declspec(dllexport) void utUserDispatch() {}
function utDispatchRecord (line 7) | __declspec(dllexport) void utDispatchRecord() {}
function utGetCommonPropertiesObject (line 8) | __declspec(dllexport) void utGetCommonPropertiesObject() {}
function utCreateObject (line 9) | __declspec(dllexport) void utCreateObject() {}
function utApplyObjectToEvent (line 10) | __declspec(dllexport) void utApplyObjectToEvent() {}
function utSetClientTransport (line 11) | __declspec(dllexport) void utSetClientTransport() {}
FILE: projects/UnifiedTelemetry.Model_stub/dllmain.cpp
function utSetString (line 1) | __declspec(dllexport) void utSetString() {}
function utSetNumber (line 2) | __declspec(dllexport) void utSetNumber() {}
function utSetFloat (line 3) | __declspec(dllexport) void utSetFloat() {}
function utSetBoolean (line 4) | __declspec(dllexport) void utSetBoolean() {}
function utSetDate (line 5) | __declspec(dllexport) void utSetDate() {}
function utSetCurrentDate (line 6) | __declspec(dllexport) void utSetCurrentDate() {}
function utSetObject (line 7) | __declspec(dllexport) void utSetObject() {}
function utRemoveProperty (line 8) | __declspec(dllexport) void utRemoveProperty() {}
function utCreateEvent (line 9) | __declspec(dllexport) void utCreateEvent() {}
function utGetEventJson (line 10) | __declspec(dllexport) void utGetEventJson() {}
function utDestroyEvent (line 11) | __declspec(dllexport) void utDestroyEvent() {}
function utCreateEventObject (line 12) | __declspec(dllexport) void utCreateEventObject() {}
function utCreateEventArray (line 13) | __declspec(dllexport) void utCreateEventArray() {}
function utPushString (line 14) | __declspec(dllexport) void utPushString() {}
function utPushInt (line 15) | __declspec(dllexport) void utPushInt() {}
function utPushFloat (line 16) | __declspec(dllexport) void utPushFloat() {}
function utPushObject (line 17) | __declspec(dllexport) void utPushObject() {}
function utCreateSchemaFilter (line 18) | __declspec(dllexport) void utCreateSchemaFilter() {}
function utDestroySchemaFilter (line 19) | __declspec(dllexport) void utDestroySchemaFilter() {}
function utFilterEvent (line 20) | __declspec(dllexport) void utFilterEvent() {}
function utGetJsTime (line 21) | __declspec(dllexport) void utGetJsTime() {}
function utGetTracingId (line 22) | __declspec(dllexport) void utGetTracingId() {}
function utCreateEventFromJson (line 23) | __declspec(dllexport) void utCreateEventFromJson() {}
function utGetSbahnDispatchUrl (line 24) | __declspec(dllexport) void utGetSbahnDispatchUrl() {}
FILE: projects/UnifiedTelemetry.Service_stub/dllmain.cpp
function utCreateService (line 1) | __declspec(dllexport) void utCreateService() {}
function utDestroyService (line 2) | __declspec(dllexport) void utDestroyService() {}
function utServiceInit (line 3) | __declspec(dllexport) void utServiceInit() {}
function utGetTestConfig (line 4) | __declspec(dllexport) void utGetTestConfig() {}
function utSetTestConfig (line 5) | __declspec(dllexport) void utSetTestConfig() {}
function utServiceGetEventsInQueueLength (line 6) | __declspec(dllexport) void utServiceGetEventsInQueueLength() {}
function utServiceSetDeviceWs1Setting (line 7) | __declspec(dllexport) void utServiceSetDeviceWs1Setting() {}
function utServiceSetUserInt (line 8) | __declspec(dllexport) void utServiceSetUserInt() {}
function utServiceSetUserString (line 9) | __declspec(dllexport) void utServiceSetUserString() {}
function utServiceSetUserBoolean (line 10) | __declspec(dllexport) void utServiceSetUserBoolean() {}
function utServiceRemoveUser (line 11) | __declspec(dllexport) void utServiceRemoveUser() {}
function utGetServiceState (line 12) | __declspec(dllexport) void utGetServiceState() {}
function utServiceStart (line 13) | __declspec(dllexport) void utServiceStart() {}
function utServiceStop (line 14) | __declspec(dllexport) void utServiceStop() {}
function utCreateStaticServiceTransport (line 15) | __declspec(dllexport) void utCreateStaticServiceTransport() {}
function utApplyServiceConfigEventSchema (line 16) | __declspec(dllexport) void utApplyServiceConfigEventSchema() {}
function utGetServiceConfig (line 17) | __declspec(dllexport) void utGetServiceConfig() {}
function utSetServiceConfig (line 18) | __declspec(dllexport) void utSetServiceConfig() {}
function utServiceSetLogCallback (line 19) | __declspec(dllexport) void utServiceSetLogCallback() {}
function utServiceDispatchRecord (line 20) | __declspec(dllexport) void utServiceDispatchRecord() {}
function utSetAuthToken (line 21) | __declspec(dllexport) void utSetAuthToken() {}
function utServicePushAdobeReportSuite (line 22) | __declspec(dllexport) void utServicePushAdobeReportSuite() {}
function utServiceGetCommonPropertiesObject (line 23) | __declspec(dllexport) void utServiceGetCommonPropertiesObject() {}
FILE: projects/libcustomshare/custom_share_manager.cpp
function CustomShareManager (line 17) | CustomShareManager *CustomShareManager::getSingleton() {
FILE: projects/libcustomshare/custom_share_manager.h
function class (line 3) | class CustomShareManager {
FILE: projects/psvr2_openvr_driver_ex/caesar_manager_hooks.cpp
type psvr2_toolkit (line 9) | namespace psvr2_toolkit {
function CaesarManager__shutdownHook (line 24) | void CaesarManager__shutdownHook(void *thisptr) {
FILE: projects/psvr2_openvr_driver_ex/caesar_manager_hooks.h
function namespace (line 3) | namespace psvr2_toolkit {
FILE: projects/psvr2_openvr_driver_ex/device_provider_proxy.cpp
type psvr2_toolkit (line 19) | namespace psvr2_toolkit {
function DeviceProviderProxy (line 28) | DeviceProviderProxy *DeviceProviderProxy::Instance() {
FILE: projects/psvr2_openvr_driver_ex/device_provider_proxy.h
function namespace (line 5) | namespace psvr2_toolkit {
FILE: projects/psvr2_openvr_driver_ex/driver_context_proxy.cpp
type psvr2_toolkit (line 5) | namespace psvr2_toolkit {
function DriverContextProxy (line 13) | DriverContextProxy *DriverContextProxy::Instance() {
FILE: projects/psvr2_openvr_driver_ex/driver_context_proxy.h
function namespace (line 5) | namespace psvr2_toolkit {
FILE: projects/psvr2_openvr_driver_ex/driver_host_proxy.cpp
type psvr2_toolkit (line 9) | namespace psvr2_toolkit {
function DriverHostProxy (line 24) | DriverHostProxy *DriverHostProxy::Instance() {
FILE: projects/psvr2_openvr_driver_ex/driver_host_proxy.h
function namespace (line 7) | namespace psvr2_toolkit {
FILE: projects/psvr2_openvr_driver_ex/eyelid_estimator.cpp
type psvr2_toolkit (line 6) | namespace psvr2_toolkit {
FILE: projects/psvr2_openvr_driver_ex/eyelid_estimator.h
function namespace (line 5) | namespace psvr2_toolkit {
FILE: projects/psvr2_openvr_driver_ex/hmd2_gaze.h
type Hmd2Bool (line 5) | typedef enum {
type Hmd2Vector2 (line 10) | typedef struct {
type Hmd2Vector3 (line 14) | typedef struct {
type Hmd2GazeEye (line 18) | typedef struct {
type Hmd2GazeCombined (line 38) | struct Hmd2GazeCombined {
type Hmd2GazeState (line 62) | struct Hmd2GazeState {
FILE: projects/psvr2_openvr_driver_ex/hmd_device_hooks.cpp
type psvr2_toolkit (line 16) | namespace psvr2_toolkit {
function sie__psvr2__HmdDevice__ActivateHook (line 30) | vr::EVRInitError sie__psvr2__HmdDevice__ActivateHook(void *thisptr, ui...
function sie__psvr2__HmdDevice__DeactivateHook (line 93) | void sie__psvr2__HmdDevice__DeactivateHook(void *thisptr) {
function GetHostTimestamp (line 103) | inline const int64_t GetHostTimestamp()
FILE: projects/psvr2_openvr_driver_ex/hmd_device_hooks.h
function namespace (line 5) | namespace psvr2_toolkit {
FILE: projects/psvr2_openvr_driver_ex/hmd_driver_loader.cpp
type psvr2_toolkit (line 9) | namespace psvr2_toolkit {
class HmdDriverLoaderInitializer (line 12) | class HmdDriverLoaderInitializer {
method HmdDriverLoaderInitializer (line 14) | HmdDriverLoaderInitializer() {
function HmdDriverLoader (line 35) | HmdDriverLoader *HmdDriverLoader::Instance() {
FILE: projects/psvr2_openvr_driver_ex/hmd_driver_loader.h
function namespace (line 7) | namespace psvr2_toolkit {
FILE: projects/psvr2_openvr_driver_ex/hmd_math.h
function namespace (line 5) | namespace psvr2_toolkit {
FILE: projects/psvr2_openvr_driver_ex/hook_lib.h
function namespace (line 11) | namespace psvr2_toolkit {
FILE: projects/psvr2_openvr_driver_ex/ipc_server.cpp
type psvr2_toolkit (line 9) | namespace psvr2_toolkit {
type ipc (line 10) | namespace ipc {
function IpcServer (line 23) | IpcServer *IpcServer::Instance() {
FILE: projects/psvr2_openvr_driver_ex/ipc_server.h
function namespace (line 12) | namespace psvr2_toolkit {
FILE: projects/psvr2_openvr_driver_ex/minhook/include/MinHook.h
type MH_STATUS (line 38) | typedef enum MH_STATUS
FILE: projects/psvr2_openvr_driver_ex/pad_trigger_effect.h
type ScePadTriggerEffectMode (line 24) | typedef enum ScePadTriggerEffectMode{
type ScePadTriggerEffectOffParam (line 39) | typedef struct ScePadTriggerEffectOffParam{
type ScePadTriggerEffectFeedbackParam (line 49) | typedef struct ScePadTriggerEffectFeedbackParam{
type ScePadTriggerEffectWeaponParam (line 60) | typedef struct ScePadTriggerEffectWeaponParam{
type ScePadTriggerEffectVibrationParam (line 72) | typedef struct ScePadTriggerEffectVibrationParam{
type ScePadTriggerEffectMultiplePositionFeedbackParam (line 85) | typedef struct ScePadTriggerEffectMultiplePositionFeedbackParam{
type ScePadTriggerEffectSlopeFeedbackParam (line 100) | typedef struct ScePadTriggerEffectSlopeFeedbackParam{
type ScePadTriggerEffectMultiplePositionVibrationParam (line 115) | typedef struct ScePadTriggerEffectMultiplePositionVibrationParam{
type ScePadTriggerEffectCommandData (line 129) | typedef union ScePadTriggerEffectCommandData{
type ScePadTriggerEffectCommand (line 143) | typedef struct ScePadTriggerEffectCommand{
type ScePadTriggerEffectParam (line 153) | typedef struct ScePadTriggerEffectParam{
FILE: projects/psvr2_openvr_driver_ex/psvr2_openvr_driver/openvr/headers/openvr_driver.h
function namespace (line 16) | namespace vr
function namespace (line 28) | namespace vr
type VkDevice_T (line 244) | struct VkDevice_T
type VkPhysicalDevice_T (line 245) | struct VkPhysicalDevice_T
type VkInstance_T (line 246) | struct VkInstance_T
type VkQueue_T (line 247) | struct VkQueue_T
type ID3D12Resource (line 250) | struct ID3D12Resource
type ID3D12CommandQueue (line 251) | struct ID3D12CommandQueue
function namespace (line 253) | namespace vr
function namespace (line 2286) | namespace vr
function namespace (line 2395) | namespace vr
function namespace (line 2840) | namespace vr
function namespace (line 2962) | namespace vr
function namespace (line 3011) | namespace vr
function namespace (line 3105) | namespace vr
function namespace (line 3152) | namespace vr
function namespace (line 3264) | namespace vr
function IsPropertySet (line 3761) | inline bool CVRPropertyHelpers::IsPropertySet( PropertyContainerHandle_t...
function namespace (line 3776) | namespace vr
function namespace (line 3835) | namespace vr
function namespace (line 3852) | namespace vr
function namespace (line 3920) | namespace vr
function namespace (line 3937) | namespace vr
function namespace (line 3994) | namespace vr
function namespace (line 4014) | namespace vr
function namespace (line 4047) | namespace vr
function namespace (line 4075) | namespace vr
function namespace (line 4129) | namespace vr
function namespace (line 4153) | namespace vr
function namespace (line 4246) | namespace vr
function namespace (line 4323) | namespace vr
FILE: projects/psvr2_openvr_driver_ex/trigger_effect_manager.cpp
type psvr2_toolkit (line 5) | namespace psvr2_toolkit {
type AstonContext_t (line 7) | struct AstonContext_t {
type AstonManager_t (line 13) | struct AstonManager_t {
function TriggerEffectManager (line 28) | TriggerEffectManager *TriggerEffectManager::Instance() {
FILE: projects/psvr2_openvr_driver_ex/trigger_effect_manager.h
function namespace (line 6) | namespace psvr2_toolkit {
FILE: projects/psvr2_openvr_driver_ex/usb_thread_gaze.cpp
function j_CaesarUsbThreadGaze__close (line 43) | void j_CaesarUsbThreadGaze__close(CaesarUsbThreadGaze *thisptr) {
function j_CaesarUsbThreadGaze__getUsbInf (line 47) | uint8_t j_CaesarUsbThreadGaze__getUsbInf(CaesarUsbThreadGaze *thisptr) {
function j_CaesarUsbThreadGaze__getReadPipeId (line 51) | uint8_t j_CaesarUsbThreadGaze__getReadPipeId(CaesarUsbThreadGaze *thispt...
function j_CaesarUsbThreadGaze__poll (line 55) | int j_CaesarUsbThreadGaze__poll(CaesarUsbThreadGaze *thisptr) {
function CaesarUsbThreadGaze (line 63) | CaesarUsbThreadGaze *CaesarUsbThreadGaze::Instance() {
FILE: projects/psvr2_openvr_driver_ex/usb_thread_gaze.h
function class (line 5) | class CaesarUsbThreadGaze {
FILE: projects/psvr2_openvr_driver_ex/usb_thread_hooks.cpp
type psvr2_toolkit (line 7) | namespace psvr2_toolkit {
function CaesarUsbThreadImuStatus__pollHook (line 12) | int CaesarUsbThreadImuStatus__pollHook(void *thisptr) {
FILE: projects/psvr2_openvr_driver_ex/usb_thread_hooks.h
function namespace (line 3) | namespace psvr2_toolkit {
FILE: projects/psvr2_openvr_driver_ex/util.h
function namespace (line 14) | namespace psvr2_toolkit {
FILE: projects/psvr2_openvr_driver_ex/vr_settings.h
function namespace (line 17) | namespace psvr2_toolkit {
FILE: projects/shared/ipc_protocol.h
function namespace (line 7) | namespace psvr2_toolkit {
Condensed preview — 67 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (422K chars).
[
{
"path": ".github/workflows/msbuild.yml",
"chars": 2131,
"preview": "# This workflow uses actions that are not certified by GitHub.\n# They are provided by a third-party and are governed by\n"
},
{
"path": ".gitignore",
"chars": 7018,
"preview": "## Ignore Visual Studio temporary files, build results, and\n## files generated by popular Visual Studio add-ons.\n##\n## G"
},
{
"path": "LICENSE",
"chars": 1072,
"preview": "MIT License\n\nCopyright (c) 2026 Bnuuy Solutions\n\nPermission is hereby granted, free of charge, to any person obtaining a"
},
{
"path": "PSVR2Toolkit.sln",
"chars": 6352,
"preview": "\nMicrosoft Visual Studio Solution File, Format Version 12.00\n# Visual Studio Version 17\nVisualStudioVersion = 17.12.355"
},
{
"path": "README.md",
"chars": 3421,
"preview": "> [!WARNING]\n> If you have paid for PlayStation VR2 Toolkit, you have been scammed and you should immediately request a "
},
{
"path": "include/psvr2_toolkit_capi.h",
"chars": 2177,
"preview": "#pragma once\n\n#include <windows.h>\n#include <inttypes.h>\n\n#define TRIGGER_EFFECT_CONTROL_POINT_NUM 10\n\nenum EResultType "
},
{
"path": "projects/PSVR2Toolkit.App/App.xaml",
"chars": 375,
"preview": "<Application x:Class=\"PSVR2Toolkit.App.App\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentati"
},
{
"path": "projects/PSVR2Toolkit.App/App.xaml.cs",
"chars": 160,
"preview": "using System.Windows;\n\nnamespace PSVR2Toolkit.App;\n\n/// <summary>\n/// Interaction logic for App.xaml\n/// </summary>\npub"
},
{
"path": "projects/PSVR2Toolkit.App/AssemblyInfo.cs",
"chars": 634,
"preview": "using System.Windows;\n\n[assembly: ThemeInfo(\n ResourceDictionaryLocation.None, //where theme specific reso"
},
{
"path": "projects/PSVR2Toolkit.App/MainWindow.xaml",
"chars": 497,
"preview": "<Window x:Class=\"PSVR2Toolkit.App.MainWindow\"\n xmlns=\"http://schemas.microsoft.com/winfx/2006/xaml/presentation\""
},
{
"path": "projects/PSVR2Toolkit.App/MainWindow.xaml.cs",
"chars": 236,
"preview": "using System.Windows;\n\nnamespace PSVR2Toolkit.App;\n\n/// <summary>\n/// Interaction logic for MainWindow.xaml\n/// </summa"
},
{
"path": "projects/PSVR2Toolkit.App/PSVR2Toolkit.App.csproj",
"chars": 394,
"preview": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n <PropertyGroup>\n <OutputType>WinExe</OutputType>\n <TargetFramework>net472</T"
},
{
"path": "projects/PSVR2Toolkit.App/Resources/.gitkeep",
"chars": 0,
"preview": ""
},
{
"path": "projects/PSVR2Toolkit.IPC/IpcClient.cs",
"chars": 15698,
"preview": "using System;\nusing System.Diagnostics;\nusing System.Net.Sockets;\nusing System.Runtime.InteropServices;\nusing System.Th"
},
{
"path": "projects/PSVR2Toolkit.IPC/IpcProtocol.cs",
"chars": 5316,
"preview": "using System.Runtime.InteropServices;\n\nnamespace PSVR2Toolkit.CAPI {\n public enum ECommandType : ushort {\n Cl"
},
{
"path": "projects/PSVR2Toolkit.IPC/PSVR2Toolkit.IPC.csproj",
"chars": 242,
"preview": "<Project Sdk=\"Microsoft.NET.Sdk\">\n\n <PropertyGroup>\n <TargetFramework>netstandard2.0</TargetFramework>\n <LangVer"
},
{
"path": "projects/UnifiedTelemetry.Client_stub/UnifiedTelemetry.Client_stub.vcxproj",
"chars": 8762,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msb"
},
{
"path": "projects/UnifiedTelemetry.Client_stub/UnifiedTelemetry.Client_stub.vcxproj.filters",
"chars": 705,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
},
{
"path": "projects/UnifiedTelemetry.Client_stub/dllmain.cpp",
"chars": 669,
"preview": "extern \"C\" __declspec(dllexport) void utCreateClient() {}\nextern \"C\" __declspec(dllexport) void utDestroyClient() {}\next"
},
{
"path": "projects/UnifiedTelemetry.Model_stub/UnifiedTelemetry.Model_stub.vcxproj",
"chars": 8753,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msb"
},
{
"path": "projects/UnifiedTelemetry.Model_stub/UnifiedTelemetry.Model_stub.vcxproj.filters",
"chars": 705,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
},
{
"path": "projects/UnifiedTelemetry.Model_stub/dllmain.cpp",
"chars": 1395,
"preview": "extern \"C\" __declspec(dllexport) void utSetString() {}\nextern \"C\" __declspec(dllexport) void utSetNumber() {}\nextern \"C\""
},
{
"path": "projects/UnifiedTelemetry.Service_stub/UnifiedTelemetry.Service_stub.vcxproj",
"chars": 8771,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msb"
},
{
"path": "projects/UnifiedTelemetry.Service_stub/UnifiedTelemetry.Service_stub.vcxproj.filters",
"chars": 705,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
},
{
"path": "projects/UnifiedTelemetry.Service_stub/dllmain.cpp",
"chars": 1492,
"preview": "extern \"C\" __declspec(dllexport) void utCreateService() {}\nextern \"C\" __declspec(dllexport) void utDestroyService() {}\ne"
},
{
"path": "projects/libcustomshare/custom_share_manager.cpp",
"chars": 720,
"preview": "#include \"custom_share_manager.h\"\n\nCustomShareManager *CustomShareManager::m_pInstance = nullptr;\n\nvoid CustomShareManag"
},
{
"path": "projects/libcustomshare/custom_share_manager.h",
"chars": 233,
"preview": "#pragma once\n\nclass CustomShareManager {\npublic:\n static void createSingleton();\n static CustomShareManager *getSingle"
},
{
"path": "projects/libcustomshare/libcustomshare.vcxproj",
"chars": 3934,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msb"
},
{
"path": "projects/libcustomshare/libcustomshare.vcxproj.filters",
"chars": 849,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
},
{
"path": "projects/psvr2_openvr_driver_ex/caesar_manager_hooks.cpp",
"chars": 2129,
"preview": "#include \"caesar_manager_hooks.h\"\n\n#include \"hmd_driver_loader.h\"\n#include \"hook_lib.h\"\n#include \"usb_thread_gaze.h\"\n#in"
},
{
"path": "projects/psvr2_openvr_driver_ex/caesar_manager_hooks.h",
"chars": 137,
"preview": "#pragma once\n\nnamespace psvr2_toolkit {\n\n class CaesarManagerHooks {\n public:\n static void InstallHooks();\n };\n\n} "
},
{
"path": "projects/psvr2_openvr_driver_ex/config.h",
"chars": 577,
"preview": "#pragma once\n\n#define DRIVER_IS_STABLE false\n#define DRIVER_IS_PRERELEASE true\n#define DRIVER_IS_EXPERIMENTAL false\n\n#de"
},
{
"path": "projects/psvr2_openvr_driver_ex/device_provider_proxy.cpp",
"chars": 4010,
"preview": "#include \"device_provider_proxy.h\"\n\n#include \"config.h\"\n#include \"caesar_manager_hooks.h\"\n#include \"driver_context_proxy"
},
{
"path": "projects/psvr2_openvr_driver_ex/device_provider_proxy.h",
"chars": 880,
"preview": "#pragma once\n\n#include <openvr_driver.h>\n\nnamespace psvr2_toolkit {\n\n class DeviceProviderProxy : public vr::IServerTra"
},
{
"path": "projects/psvr2_openvr_driver_ex/driver_context_proxy.cpp",
"chars": 1255,
"preview": "#include \"driver_context_proxy.h\"\n\n#include \"driver_host_proxy.h\"\n\nnamespace psvr2_toolkit {\n\n DriverContextProxy *Driv"
},
{
"path": "projects/psvr2_openvr_driver_ex/driver_context_proxy.h",
"chars": 592,
"preview": "#pragma once\n\n#include <openvr_driver.h>\n\nnamespace psvr2_toolkit {\n\n class DriverContextProxy : public vr::IVRDriverCo"
},
{
"path": "projects/psvr2_openvr_driver_ex/driver_host_proxy.cpp",
"chars": 6382,
"preview": "#include \"driver_host_proxy.h\"\n\n#include \"hmd_math.h\"\n#include \"util.h\"\n#include \"vr_settings.h\"\n\n#include <cstdint>\n\nna"
},
{
"path": "projects/psvr2_openvr_driver_ex/driver_host_proxy.h",
"chars": 2187,
"preview": "#pragma once\n\n#include <openvr_driver.h>\n\n#include <list>\n\nnamespace psvr2_toolkit {\n\n class DriverHostProxy : public v"
},
{
"path": "projects/psvr2_openvr_driver_ex/eyelid_estimator.cpp",
"chars": 2917,
"preview": "#include \"eyelid_estimator.h\"\n\n#include <algorithm>\n#include <cmath>\n\nnamespace psvr2_toolkit {\n\n // parameters\n stati"
},
{
"path": "projects/psvr2_openvr_driver_ex/eyelid_estimator.h",
"chars": 362,
"preview": "#pragma once\n\n#include \"hmd2_gaze.h\"\n\nnamespace psvr2_toolkit {\n\n class EyelidEstimator {\n public:\n EyelidEstimator"
},
{
"path": "projects/psvr2_openvr_driver_ex/hmd2_gaze.h",
"chars": 1762,
"preview": "#pragma once\n\n#include <cstdint>\n\ntypedef enum {\n HMD2_BOOL_FALSE = 0,\n HMD2_BOOL_TRUE = 1\n} Hmd2Bool;\n\ntypedef struct"
},
{
"path": "projects/psvr2_openvr_driver_ex/hmd_device_hooks.cpp",
"chars": 7713,
"preview": "#ifdef OPENVR_EXTENSIONS_AVAILABLE\n#include \"psvr2_openvr_driver/openvr_ex/openvr_ex.h\"\n#endif\n\n#include \"driver_host_pr"
},
{
"path": "projects/psvr2_openvr_driver_ex/hmd_device_hooks.h",
"chars": 217,
"preview": "#pragma once\n\n#include <openvr_driver.h>\n\nnamespace psvr2_toolkit {\n\n class HmdDeviceHooks {\n public:\n static void "
},
{
"path": "projects/psvr2_openvr_driver_ex/hmd_driver_factory.cpp",
"chars": 1239,
"preview": "#include \"device_provider_proxy.h\"\n#include \"hmd_driver_loader.h\"\n\n#include <openvr_driver.h>\n#include <windows.h>\n\nusin"
},
{
"path": "projects/psvr2_openvr_driver_ex/hmd_driver_loader.cpp",
"chars": 1640,
"preview": "#include \"hmd_driver_loader.h\"\n\n#include <shlwapi.h>\n\n#define HMD_DLL_NAME L\"driver_playstation_vr2_orig.dll\"\n\nextern \"C"
},
{
"path": "projects/psvr2_openvr_driver_ex/hmd_driver_loader.h",
"chars": 534,
"preview": "#pragma once\n\n#include <windows.h>\n\n#include <cstdint>\n\nnamespace psvr2_toolkit {\n\n // Provides a thin interface betwee"
},
{
"path": "projects/psvr2_openvr_driver_ex/hmd_math.h",
"chars": 1594,
"preview": "#pragma once\n\n#include <openvr_driver.h>\n\nnamespace psvr2_toolkit {\n\n class HmdMath {\n public:\n static vr::HmdQuate"
},
{
"path": "projects/psvr2_openvr_driver_ex/hook_lib.h",
"chars": 1197,
"preview": "#pragma once\n\n#include <minhook.h>\n\n#define INSTALL_STUB(pTarget) psvr2_toolkit::HookLib::InstallStub(pTarget)\n#define I"
},
{
"path": "projects/psvr2_openvr_driver_ex/ipc_server.cpp",
"chars": 18148,
"preview": "#include \"ipc_server.h\"\n\n#include \"trigger_effect_manager.h\"\n#include \"util.h\"\n#include \"vr_settings.h\"\n\n#include <cstdi"
},
{
"path": "projects/psvr2_openvr_driver_ex/ipc_server.h",
"chars": 1355,
"preview": "#pragma once\n\n#include \"hmd2_gaze.h\"\n#include \"../shared/ipc_protocol.h\"\n\n#include <windows.h>\n\n#include <cstdint>\n#incl"
},
{
"path": "projects/psvr2_openvr_driver_ex/minhook/LICENSE.txt",
"chars": 4363,
"preview": "MinHook - The Minimalistic API Hooking Library for x64/x86\nCopyright (C) 2009-2017 Tsuda Kageyu.\nAll rights reserved.\n\n"
},
{
"path": "projects/psvr2_openvr_driver_ex/minhook/include/MinHook.h",
"chars": 7529,
"preview": "/*\n * MinHook - The Minimalistic API Hooking Library for x64/x86\n * Copyright (C) 2009-2017 Tsuda Kageyu.\n * All righ"
},
{
"path": "projects/psvr2_openvr_driver_ex/pad_trigger_effect.h",
"chars": 6834,
"preview": "/* SIE CONFIDENTIAL\n * $PSLibId$\n * Copyright (C) 2019 Sony Interactive Entertainment Inc.\n * All Rights Reserved.\n */\n\n"
},
{
"path": "projects/psvr2_openvr_driver_ex/psvr2_openvr_driver/openvr/LICENSE",
"chars": 1488,
"preview": "Copyright (c) 2015, Valve Corporation\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or w"
},
{
"path": "projects/psvr2_openvr_driver_ex/psvr2_openvr_driver/openvr/headers/openvr_driver.h",
"chars": 197161,
"preview": "#pragma once\n\n// openvr_driver.h\n//========= Copyright Valve Corporation ============//\n// Dynamically generated file. D"
},
{
"path": "projects/psvr2_openvr_driver_ex/psvr2_openvr_driver_ex.vcxproj",
"chars": 11581,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msb"
},
{
"path": "projects/psvr2_openvr_driver_ex/psvr2_openvr_driver_ex.vcxproj.filters",
"chars": 5343,
"preview": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"4.0\" xmlns=\"http://schemas.microsoft.com/developer/msbuil"
},
{
"path": "projects/psvr2_openvr_driver_ex/trigger_effect_manager.cpp",
"chars": 7999,
"preview": "#include \"trigger_effect_manager.h\"\n#include \"hmd_driver_loader.h\"\n#include \"util.h\"\n\nnamespace psvr2_toolkit {\n\n struc"
},
{
"path": "projects/psvr2_openvr_driver_ex/trigger_effect_manager.h",
"chars": 618,
"preview": "#pragma once\n\n#include \"pad_trigger_effect.h\"\n#include \"../shared/ipc_protocol.h\"\n\nnamespace psvr2_toolkit {\n\n class Tr"
},
{
"path": "projects/psvr2_openvr_driver_ex/usb_thread_gaze.cpp",
"chars": 5199,
"preview": "#include \"usb_thread_gaze.h\"\n\n#include \"hmd_driver_loader.h\"\n#include \"hmd_device_hooks.h\"\n#include \"eyelid_estimator.h\""
},
{
"path": "projects/psvr2_openvr_driver_ex/usb_thread_gaze.h",
"chars": 420,
"preview": "#pragma once\n\n#include <cstdint>\n\nclass CaesarUsbThreadGaze {\npublic:\n static void Reset();\n static CaesarUsbThreadGaz"
},
{
"path": "projects/psvr2_openvr_driver_ex/usb_thread_hooks.cpp",
"chars": 1264,
"preview": "#include \"usb_thread_hooks.h\"\n\n#include \"hmd_driver_loader.h\"\n#include \"hook_lib.h\"\n#include \"vr_settings.h\"\n\nnamespace "
},
{
"path": "projects/psvr2_openvr_driver_ex/usb_thread_hooks.h",
"chars": 133,
"preview": "#pragma once\n\nnamespace psvr2_toolkit {\n\n class UsbThreadHooks {\n public:\n static void InstallHooks();\n };\n\n} // p"
},
{
"path": "projects/psvr2_openvr_driver_ex/util.h",
"chars": 1466,
"preview": "#pragma once\n\n#include \"config.h\"\n\n#include <windows.h>\n#include <tlhelp32.h>\n#include <stdarg.h>\n#include <stdio.h>\n#in"
},
{
"path": "projects/psvr2_openvr_driver_ex/vr_settings.h",
"chars": 1361,
"preview": "#pragma once\n\n#include <openvr_driver.h>\n\n#define STEAMVR_SETTINGS_SECTION_PLAYSTATION_VR2_EX \"playstation_vr2_ex\"\n\n#def"
},
{
"path": "projects/shared/ipc_protocol.h",
"chars": 4920,
"preview": "#pragma once\n\n#include <cstdint>\n\n#define IPC_SERVER_PORT 3364\n\nnamespace psvr2_toolkit {\n namespace ipc {\n\n static "
}
]
// ... and 1 more files (download for full content)
About this extraction
This page contains the full source code of the BnuuySolutions/PSVR2Toolkit GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 67 files (388.6 KB), approximately 105.9k tokens, and a symbol index with 198 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.