diff --git a/DriverInstaller/DriverInstaller.vdproj b/DriverInstaller/DriverInstaller.vdproj index acc2e47..5f81eaa 100644 --- a/DriverInstaller/DriverInstaller.vdproj +++ b/DriverInstaller/DriverInstaller.vdproj @@ -50,6 +50,14 @@ "PrerequisitesLocation" = "2:1" "Url" = "8:" "ComponentsUrl" = "8:" + "Items" + { + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.7.2" + { + "Name" = "8:Microsoft .NET Framework 4.7.2 (x86 and x64)" + "ProductCode" = "8:.NETFramework,Version=v4.7.2" + } + } } } "Release" @@ -232,7 +240,7 @@ "Name" = "8:Microsoft Visual Studio" "ProductName" = "8:Generic USB Gamepad Vibration Driver" "ProductCode" = "8:{50CD8B4D-CD82-49D1-9E0A-2B7887448068}" - "PackageCode" = "8:{C6059427-7868-44F2-86B6-E029402B5181}" + "PackageCode" = "8:{EDB47070-D2FC-442D-95F2-A102800934A9}" "UpgradeCode" = "8:{A08375A2-DC94-4A88-8431-ED8D9717FA62}" "AspNetVersion" = "8:4.0.30319.0" "RestartWWWService" = "11:FALSE" diff --git a/DriverInstaller/DriverInstallerDebug.vdproj b/DriverInstaller/DriverInstallerDebug.vdproj new file mode 100644 index 0000000..6dab2fc --- /dev/null +++ b/DriverInstaller/DriverInstallerDebug.vdproj @@ -0,0 +1,707 @@ +"DeployProject" +{ +"VSVersion" = "3:800" +"ProjectType" = "8:{978C614F-708E-4E1A-B201-565925725DBA}" +"IsWebType" = "8:FALSE" +"ProjectName" = "8:DriverInstallerDebug" +"LanguageId" = "3:1033" +"CodePage" = "3:1252" +"UILanguageId" = "3:1033" +"SccProjectName" = "8:" +"SccLocalPath" = "8:" +"SccAuxPath" = "8:" +"SccProvider" = "8:" + "Hierarchy" + { + "Entry" + { + "MsmKey" = "8:_9A855B283BFC488DBE4152B94AFCF1C5" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + "Entry" + { + "MsmKey" = "8:_9DF9D13D2E094E0EB10939E8BFD399EE" + "OwnerKey" = "8:_UNDEFINED" + "MsmSig" = "8:_UNDEFINED" + } + } + "Configurations" + { + "Debug" + { + "DisplayName" = "8:Debug" + "IsDebugOnly" = "11:TRUE" + "IsReleaseOnly" = "11:FALSE" + "OutputFilename" = "8:..\\Debug\\VibrationDriverInstaller.msi" + "PackageFilesAs" = "3:2" + "PackageFileSize" = "3:-2147483648" + "CabType" = "3:1" + "Compression" = "3:2" + "SignOutput" = "11:FALSE" + "CertificateFile" = "8:" + "PrivateKeyFile" = "8:" + "TimeStampServer" = "8:" + "InstallerBootstrapper" = "3:2" + "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" + { + "Enabled" = "11:TRUE" + "PromptEnabled" = "11:TRUE" + "PrerequisitesLocation" = "2:1" + "Url" = "8:" + "ComponentsUrl" = "8:" + "Items" + { + "{EDC2488A-8267-493A-A98E-7D9C3B36CDF3}:.NETFramework,Version=v4.7.2" + { + "Name" = "8:Microsoft .NET Framework 4.7.2 (x86 and x64)" + "ProductCode" = "8:.NETFramework,Version=v4.7.2" + } + } + } + } + "Release" + { + "DisplayName" = "8:Release" + "IsDebugOnly" = "11:FALSE" + "IsReleaseOnly" = "11:TRUE" + "OutputFilename" = "8:..\\Release\\VibrationDriverInstaller.msi" + "PackageFilesAs" = "3:2" + "PackageFileSize" = "3:-2147483648" + "CabType" = "3:1" + "Compression" = "3:2" + "SignOutput" = "11:FALSE" + "CertificateFile" = "8:" + "PrivateKeyFile" = "8:" + "TimeStampServer" = "8:" + "InstallerBootstrapper" = "3:2" + "BootstrapperCfg:{63ACBE69-63AA-4F98-B2B6-99F9E24495F2}" + { + "Enabled" = "11:TRUE" + "PromptEnabled" = "11:TRUE" + "PrerequisitesLocation" = "2:1" + "Url" = "8:" + "ComponentsUrl" = "8:" + "Items" + { + } + } + } + } + "Deployable" + { + "CustomAction" + { + "{4AA51A2D-7D85-4A59-BA75-B0809FC8B380}:_A58FBA840C67404E868C9D92987CA01A" + { + "Name" = "8:GenericFFBDriver32.dll" + "Condition" = "8:" + "Object" = "8:" + "FileType" = "3:1" + "InstallAction" = "3:1" + "Arguments" = "8:" + "EntryPoint" = "8:RegisterVibrationDriver" + "Sequence" = "3:1" + "Identifier" = "8:_E9FCB57E_3CD7_4256_8EE5_1BFB7014D07D" + "InstallerClass" = "11:FALSE" + "CustomActionData" = "8:" + } + } + "DefaultFeature" + { + "Name" = "8:DefaultFeature" + "Title" = "8:" + "Description" = "8:" + } + "ExternalPersistence" + { + "LaunchCondition" + { + } + } + "File" + { + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_9A855B283BFC488DBE4152B94AFCF1C5" + { + "SourcePath" = "8:..\\Debug\\GenericFFBDriver32.dll" + "TargetName" = "8:GenericFFBDriver32.dll" + "Tag" = "8:" + "Folder" = "8:_70D2A39DB17244D1A08BF53BE196346B" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + "{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_9DF9D13D2E094E0EB10939E8BFD399EE" + { + "SourcePath" = "8:..\\Debug\\GenericFFBDriver64.dll" + "TargetName" = "8:GenericFFBDriver64.dll" + "Tag" = "8:" + "Folder" = "8:_70D2A39DB17244D1A08BF53BE196346B" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Vital" = "11:TRUE" + "ReadOnly" = "11:FALSE" + "Hidden" = "11:FALSE" + "System" = "11:FALSE" + "Permanent" = "11:FALSE" + "SharedLegacy" = "11:FALSE" + "PackageAs" = "3:1" + "Register" = "3:1" + "Exclude" = "11:FALSE" + "IsDependency" = "11:FALSE" + "IsolateTo" = "8:" + } + } + "FileType" + { + } + "Folder" + { + "{1525181F-901A-416C-8A58-119130FE478E}:_3C374CD273CA4CC39B0D8104E3AB571D" + { + "Name" = "8:#1916" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:DesktopFolder" + "Folders" + { + } + } + "{3C67513D-01DD-4637-8A68-80971EB9504F}:_70D2A39DB17244D1A08BF53BE196346B" + { + "DefaultLocation" = "8:[ProgramFilesFolder][Manufacturer]\\[ProductName]" + "Name" = "8:#1925" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:TARGETDIR" + "Folders" + { + } + } + "{1525181F-901A-416C-8A58-119130FE478E}:_D65F07704BE14C7BBDEA675AC60C1B96" + { + "Name" = "8:#1919" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:ProgramMenuFolder" + "Folders" + { + } + } + "{1525181F-901A-416C-8A58-119130FE478E}:_EB20EB274A8046AEA4621B3A08C74E43" + { + "Name" = "8:#1924" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:WindowsFolder" + "Folders" + { + "{9EF0B969-E518-4E46-987F-47570745A589}:_08365EDD8FF742F7A8EA90AD36CEE015" + { + "Name" = "8:GenericFFBDriver" + "AlwaysCreate" = "11:FALSE" + "Condition" = "8:" + "Transitive" = "11:FALSE" + "Property" = "8:_C4024A52445545BFAFDC66ED44DCA719" + "Folders" + { + } + } + } + } + } + "LaunchCondition" + { + } + "Locator" + { + } + "MsiBootstrapper" + { + "LangId" = "3:1033" + "RequiresElevation" = "11:FALSE" + } + "Product" + { + "Name" = "8:Microsoft Visual Studio" + "ProductName" = "8:Generic USB Gamepad Vibration Driver" + "ProductCode" = "8:{50CD8B4D-CD82-49D1-9E0A-2B7887448068}" + "PackageCode" = "8:{FD3782BF-AD47-4F2E-8EFE-E5F85136487E}" + "UpgradeCode" = "8:{A08375A2-DC94-4A88-8431-ED8D9717FA62}" + "AspNetVersion" = "8:4.0.30319.0" + "RestartWWWService" = "11:FALSE" + "RemovePreviousVersions" = "11:FALSE" + "DetectNewerInstalledVersion" = "11:TRUE" + "InstallAllUsers" = "11:TRUE" + "ProductVersion" = "8:1.0.0" + "Manufacturer" = "8:Generic USB Gamepad Vibration Driver" + "ARPHELPTELEPHONE" = "8:" + "ARPHELPLINK" = "8:" + "Title" = "8:Generic USB Gamepad Vibration Driver" + "Subject" = "8:" + "ARPCONTACT" = "8:Alessandro Menezes" + "Keywords" = "8:" + "ARPCOMMENTS" = "8:Generic USB Gamepad Vibration Driver" + "ARPURLINFOABOUT" = "8:" + "ARPPRODUCTICON" = "8:" + "ARPIconIndex" = "3:0" + "SearchPath" = "8:" + "UseSystemSearchPath" = "11:TRUE" + "TargetPlatform" = "3:0" + "PreBuildEvent" = "8:" + "PostBuildEvent" = "8:" + "RunPostBuildEvent" = "3:0" + } + "Registry" + { + "HKLM" + { + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_A03B79DD76BC403D8D64F0A5924EDAA2" + { + "Name" = "8:Software" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_9C43F01D1E7E43D182803227C7A74A7A" + { + "Name" = "8:[Manufacturer]" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + } + "Values" + { + } + } + } + "Values" + { + } + } + } + } + "HKCU" + { + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_BB99176430A34FDBB16EC9E3116E7EE1" + { + "Name" = "8:Software" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + "{60EA8692-D2D5-43EB-80DC-7906BF13D6EF}:_D26FE68C1E724154A3D4AA81E6752CA3" + { + "Name" = "8:[Manufacturer]" + "Condition" = "8:" + "AlwaysCreate" = "11:FALSE" + "DeleteAtUninstall" = "11:FALSE" + "Transitive" = "11:FALSE" + "Keys" + { + } + "Values" + { + } + } + } + "Values" + { + } + } + } + } + "HKCR" + { + "Keys" + { + } + } + "HKU" + { + "Keys" + { + } + } + "HKPU" + { + "Keys" + { + } + } + } + "Sequences" + { + } + "Shortcut" + { + } + "UserInterface" + { + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_0FF6F84D0BA54521991F2527BD699A88" + { + "Name" = "8:#1902" + "Sequence" = "3:2" + "Attributes" = "3:3" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_27D0116D431343499F8962DAE0B00519" + { + "Sequence" = "3:100" + "DisplayName" = "8:Concluído" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminFinishedDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_24F6F4B7064B47979A0B600ED5E601DD" + { + "Name" = "8:#1901" + "Sequence" = "3:2" + "Attributes" = "3:2" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_4D7B9E7D283848AC86EBDCF44654BE9C" + { + "Sequence" = "3:100" + "DisplayName" = "8:Progresso" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminProgressDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "ShowProgress" + { + "Name" = "8:ShowProgress" + "DisplayName" = "8:#1009" + "Description" = "8:#1109" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_54D9D9225BFE431CAE28289D40AEEE77" + { + "Name" = "8:#1901" + "Sequence" = "3:1" + "Attributes" = "3:2" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_65F0BC8F89BB4BFBBA673E2CB16B605F" + { + "Sequence" = "3:100" + "DisplayName" = "8:Progresso" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdProgressDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "ShowProgress" + { + "Name" = "8:ShowProgress" + "DisplayName" = "8:#1009" + "Description" = "8:#1109" + "Type" = "3:5" + "ContextData" = "8:1;True=1;False=0" + "Attributes" = "3:0" + "Setting" = "3:0" + "Value" = "3:1" + "DefaultValue" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_584332E75132435AB9FB749AF7B4E61C" + { + "UseDynamicProperties" = "11:FALSE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdUserInterface.wim" + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_6F17A7FA3C9B4FF69A30A170352D707D" + { + "Name" = "8:#1900" + "Sequence" = "3:2" + "Attributes" = "3:1" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_6B933086611643879EEF520AA3F86685" + { + "Sequence" = "3:100" + "DisplayName" = "8:Bem-vindo" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminWelcomeDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "CopyrightWarning" + { + "Name" = "8:CopyrightWarning" + "DisplayName" = "8:#1002" + "Description" = "8:#1102" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1202" + "DefaultValue" = "8:#1202" + "UsePlugInResources" = "11:TRUE" + } + "Welcome" + { + "Name" = "8:Welcome" + "DisplayName" = "8:#1003" + "Description" = "8:#1103" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1203" + "DefaultValue" = "8:#1203" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_9BE8FAE1869B4AF9A0C02B28C9389574" + { + "Sequence" = "3:300" + "DisplayName" = "8:Confirmar Instalação" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdAdminConfirmDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{2479F3F5-0309-486D-8047-8187E2CE5BA0}:_781D1A01A61242E48BB1652DE8A42A73" + { + "UseDynamicProperties" = "11:FALSE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdBasicDialogs.wim" + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_995B3019C9464C2A9514AE443DF7CF47" + { + "Name" = "8:#1902" + "Sequence" = "3:1" + "Attributes" = "3:3" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_55481C96BD37447D9F16309504026CE4" + { + "Sequence" = "3:100" + "DisplayName" = "8:Concluído" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdFinishedDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "UpdateText" + { + "Name" = "8:UpdateText" + "DisplayName" = "8:#1058" + "Description" = "8:#1158" + "Type" = "3:15" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1258" + "DefaultValue" = "8:#1258" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + "{DF760B10-853B-4699-99F2-AFF7185B4A62}:_DA878B541BD14957B064CE6842C379A6" + { + "Name" = "8:#1900" + "Sequence" = "3:1" + "Attributes" = "3:1" + "Dialogs" + { + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_DD51DDF859CE471FA216BD8D94DC9BF2" + { + "Sequence" = "3:300" + "DisplayName" = "8:Confirmar Instalação" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdConfirmDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + } + } + "{688940B3-5CA9-4162-8DEE-2993FA9D8CBC}:_F1A2FA987BAA486495F47BEBD0FEDCCA" + { + "Sequence" = "3:100" + "DisplayName" = "8:Bem-vindo" + "UseDynamicProperties" = "11:TRUE" + "IsDependency" = "11:FALSE" + "SourcePath" = "8:\\VsdWelcomeDlg.wid" + "Properties" + { + "BannerBitmap" + { + "Name" = "8:BannerBitmap" + "DisplayName" = "8:#1001" + "Description" = "8:#1101" + "Type" = "3:8" + "ContextData" = "8:Bitmap" + "Attributes" = "3:4" + "Setting" = "3:1" + "UsePlugInResources" = "11:TRUE" + } + "CopyrightWarning" + { + "Name" = "8:CopyrightWarning" + "DisplayName" = "8:#1002" + "Description" = "8:#1102" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1202" + "DefaultValue" = "8:#1202" + "UsePlugInResources" = "11:TRUE" + } + "Welcome" + { + "Name" = "8:Welcome" + "DisplayName" = "8:#1003" + "Description" = "8:#1103" + "Type" = "3:3" + "ContextData" = "8:" + "Attributes" = "3:0" + "Setting" = "3:1" + "Value" = "8:#1203" + "DefaultValue" = "8:#1203" + "UsePlugInResources" = "11:TRUE" + } + } + } + } + } + } + "MergeModule" + { + } + "ProjectOutput" + { + } + } +} diff --git a/GenericFFBDriver/FFBDriver.cpp b/GenericFFBDriver/FFBDriver.cpp index 81fd6fd..81f7efb 100644 --- a/GenericFFBDriver/FFBDriver.cpp +++ b/GenericFFBDriver/FFBDriver.cpp @@ -17,7 +17,7 @@ void LogMessage(const char* msg) { printf(buffer); std::ofstream outfile; - outfile.open("J:\\Gamepad\\driverlog.txt", std::ios_base::app); + outfile.open("D:\\driverlog.txt", std::ios_base::app); outfile << buffer; outfile.close(); #endif @@ -158,7 +158,7 @@ HRESULT STDMETHODCALLTYPE FFBDriver::DownloadEffect( LogMessage(buff); #endif - vibration::VibrationController::StartEffect(dwEffectID, peff); + vibration::VibrationController::StartEffect(dwEffectID, peff, dwID); return S_OK; } diff --git a/GenericFFBDriver/FFBDriver.h b/GenericFFBDriver/FFBDriver.h index 665bc83..88f0254 100644 --- a/GenericFFBDriver/FFBDriver.h +++ b/GenericFFBDriver/FFBDriver.h @@ -6,9 +6,9 @@ #include "Registrar.h" #include "ComBase.h" -// {0AB5665A-4549-4FD0-A952-5A2B9699BDA8} +// {B4FE8B13-40D0-438A-B4C2-DE4522951071} _declspec(selectany) GUID CLSID_FFBDriver = - { 0xab5665a, 0x4549, 0x4fd0,{ 0xa9, 0x52, 0x5a, 0x2b, 0x96, 0x99, 0xbd, 0xa8 } }; + { 0xB4FE8B13, 0x40D0, 0x438A, { 0xB4, 0xC2, 0xDE, 0x45, 0x22, 0x95, 0x10, 0x71 } }; //IID_IDirectInputEffectDriver diff --git a/GenericFFBDriver/GenericFFBDriver.vcxproj b/GenericFFBDriver/GenericFFBDriver.vcxproj index 1dcd0e3..f59ca82 100644 --- a/GenericFFBDriver/GenericFFBDriver.vcxproj +++ b/GenericFFBDriver/GenericFFBDriver.vcxproj @@ -22,32 +22,32 @@ {D6C39223-E1E8-4679-908C-BACACEA1E6CA} Win32Proj GenericFFBDriver - 8.1 + 10.0.19041.0 DynamicLibrary true - v140 + v142 Unicode DynamicLibrary false - v140 + v142 true Unicode DynamicLibrary true - v140 + v142 Unicode DynamicLibrary false - v140 + v142 true Unicode @@ -95,12 +95,15 @@ Disabled WIN32;_DEBUG;_WINDOWS;_USRDLL;GENERICFFBDRIVER_EXPORTS;%(PreprocessorDefinitions) MultiThreadedDebug + stdcpp17 Windows true genericFFBDriver.def kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;uuid.lib;Hid.lib;%(AdditionalDependencies) + false + false @@ -111,12 +114,15 @@ Disabled _DEBUG;_WINDOWS;_USRDLL;GENERICFFBDRIVER_EXPORTS;%(PreprocessorDefinitions) MultiThreadedDebug + stdcpp17 Windows true genericFFBDriver.def kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;uuid.lib;Hid.lib;%(AdditionalDependencies) + false + false @@ -129,6 +135,7 @@ true WIN32;NDEBUG;_WINDOWS;_USRDLL;GENERICFFBDRIVER_EXPORTS;%(PreprocessorDefinitions) MultiThreaded + stdcpp17 Windows @@ -149,6 +156,7 @@ true NDEBUG;_WINDOWS;_USRDLL;GENERICFFBDRIVER_EXPORTS;%(PreprocessorDefinitions) MultiThreaded + stdcpp17 Windows diff --git a/GenericFFBDriver/Registrar.h b/GenericFFBDriver/Registrar.h index 472b352..efde64f 100644 --- a/GenericFFBDriver/Registrar.h +++ b/GenericFFBDriver/Registrar.h @@ -132,9 +132,9 @@ class CDllRegistrar : public CRegistrar return false; // Creating DirectInput keys - const char* oemPath = "SYSTEM\\CurrentControlSet\\Control\\MediaProperties\\PrivateProperties\\Joystick\\OEM\\VID_0079&PID_0006\\OEMForceFeedback"; + const char* oemPath = "SYSTEM\\CurrentControlSet\\Control\\MediaProperties\\PrivateProperties\\Joystick\\OEM\\VID_0D9D&PID_3012\\OEMForceFeedback"; - if (!SetInRegistry(HKEY_LOCAL_MACHINE, oemPath, "CLSID", "{0AB5665A-4549-4FD0-A952-5A2B9699BDA8}")) + if (!SetInRegistry(HKEY_LOCAL_MACHINE, oemPath, "CLSID", "{B4FE8B13-40D0-438A-B4C2-DE4522951071}")) return false; const byte attrVal[] = { @@ -146,7 +146,7 @@ class CDllRegistrar : public CRegistrar return false; // Registering Axe attributes - const char* axePath = "SYSTEM\\CurrentControlSet\\Control\\MediaProperties\\PrivateProperties\\Joystick\\OEM\\VID_0079&PID_0006\\Axes"; + const char* axePath = "SYSTEM\\CurrentControlSet\\Control\\MediaProperties\\PrivateProperties\\Joystick\\OEM\\VID_0D9D&PID_3012\\Axes"; byte axeAttrData[] = { 0x01, 0x81, 0x00, 0x00, 0x01, 0x00, 0x30, 0x00 }; diff --git a/GenericFFBDriver/vibration/VibrationController.cpp b/GenericFFBDriver/vibration/VibrationController.cpp index a1c2f46..3a79c2b 100644 --- a/GenericFFBDriver/vibration/VibrationController.cpp +++ b/GenericFFBDriver/vibration/VibrationController.cpp @@ -10,25 +10,21 @@ namespace vibration { bool quitVibrationThread = false; - const byte GP_STOP_COMMAND[8] = { - 0x00, 0xf3, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + const byte GP_STOP_COMMAND[5] = { + 0x01, 0x01, 0x00, 0x00, 0x00 }; void SendHidCommand(HANDLE hHidDevice, const byte* buff, DWORD buffsz) { - HidD_SetOutputReport(hHidDevice, (PVOID)buff, 8); + HidD_SetOutputReport(hHidDevice, (PVOID)buff, 5); } void SendVibrationForce(HANDLE hHidDevice, byte forceSmallMotor, byte forceBigMotor) { - const byte buffer1[8] = { - 0x00, 0x51, 0x00, forceSmallMotor, 0x00, forceBigMotor, 0x00, 0x00 - }; - const byte buffer2[8] = { - 0x00, 0xfa, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00 + const byte buffer1[5] = { + 0x01, 0x01, 0x00, forceBigMotor, forceSmallMotor }; - SendHidCommand(hHidDevice, (const byte*)&buffer1, 8); - SendHidCommand(hHidDevice, (const byte*)&buffer2, 8); + SendHidCommand(hHidDevice, (const byte*)&buffer1, 5); } void SendVibrationStop(HANDLE hHidDevice) { - SendHidCommand(hHidDevice, (const byte*)&GP_STOP_COMMAND, 8); + SendHidCommand(hHidDevice, (const byte*)&GP_STOP_COMMAND, 5); } struct VibrationEff { @@ -45,7 +41,7 @@ namespace vibration { VibrationEff VibEffects[MAX_EFFECTS]; - std::wstring VibrationController::hidDevPath; + std::vector VibrationController::hidDevPath; std::mutex VibrationController::mtxSync; std::unique_ptr VibrationController::thrVibration; @@ -58,7 +54,7 @@ namespace vibration { { } - void VibrationController::StartVibrationThread() + void VibrationController::StartVibrationThread(DWORD dwID) { mtxSync.lock(); @@ -70,17 +66,17 @@ namespace vibration { VibEffects[k].dwEffectId = -1; } - thrVibration.reset(new std::thread(VibrationController::VibrationThreadEntryPoint)); + thrVibration.reset(new std::thread(VibrationController::VibrationThreadEntryPoint, dwID)); } mtxSync.unlock(); } - void VibrationController::VibrationThreadEntryPoint() + void VibrationController::VibrationThreadEntryPoint(DWORD dwID) { // Initialization HANDLE hHidDevice = CreateFile( - hidDevPath.c_str(), + hidDevPath[0].c_str(), // Will only use adapter's port 1 for now GENERIC_WRITE | GENERIC_READ, FILE_SHARE_WRITE | FILE_SHARE_READ, NULL, @@ -113,14 +109,11 @@ namespace vibration { if (VibEffects[k].dwStopFrame <= frame) { VibEffects[k].isActive = FALSE; - } else { forceX = MAXC(forceX, VibEffects[k].forceX); forceY = MAXC(forceY, VibEffects[k].forceY); - } - } else { forceX = MAXC(forceX, VibEffects[k].forceX); @@ -136,8 +129,6 @@ namespace vibration { DWORD frmStop = VibEffects[k].dwStopFrame; DWORD dt = frmStart <= frmStop ? frmStop - frmStart : frmStart + 100; - //if (dt > 750) - // dt = 750; VibEffects[k].dwStopFrame = frame + dt; } @@ -171,20 +162,18 @@ namespace vibration { } if (hHidDevice != NULL) { - // Send stop command SendVibrationStop(hHidDevice); - CloseHandle(hHidDevice); } } void VibrationController::SetHidDevicePath(LPWSTR path) { - hidDevPath = path; + hidDevPath.push_back(path); Reset(); } - void VibrationController::StartEffect(DWORD dwEffectID, LPCDIEFFECT peff) + void VibrationController::StartEffect(DWORD dwEffectID, LPCDIEFFECT peff, DWORD dwID) { mtxSync.lock(); @@ -276,7 +265,7 @@ namespace vibration { VibEffects[idx].started = FALSE; mtxSync.unlock(); - StartVibrationThread(); + StartVibrationThread(dwID); } void VibrationController::StopEffect(DWORD dwEffectID) diff --git a/GenericFFBDriver/vibration/VibrationController.h b/GenericFFBDriver/vibration/VibrationController.h index 6587ff2..bb56fc3 100644 --- a/GenericFFBDriver/vibration/VibrationController.h +++ b/GenericFFBDriver/vibration/VibrationController.h @@ -2,6 +2,7 @@ #include "../stdafx.h" #include #include +#include namespace vibration { @@ -18,19 +19,19 @@ namespace vibration { } }; - static std::wstring hidDevPath; + static std::vector hidDevPath; static std::mutex mtxSync; static std::unique_ptr thrVibration; VibrationController(); ~VibrationController(); - static void StartVibrationThread(); - static void VibrationThreadEntryPoint(); + static void StartVibrationThread(DWORD dwID); + static void VibrationThreadEntryPoint(DWORD dwID); public: static void SetHidDevicePath(LPWSTR path); - static void StartEffect(DWORD dwEffectID, LPCDIEFFECT peff); + static void StartEffect(DWORD dwEffectID, LPCDIEFFECT peff, DWORD dwID); static void StopEffect(DWORD dwEffectID); static void StopAllEffects(); static void Reset(); diff --git a/Joypad.sln b/Joypad.sln index 4337d6c..0b60807 100644 --- a/Joypad.sln +++ b/Joypad.sln @@ -1,11 +1,11 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.31424.327 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GenericFFBDriver", "GenericFFBDriver\GenericFFBDriver.vcxproj", "{D6C39223-E1E8-4679-908C-BACACEA1E6CA}" EndProject -Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "DriverInstaller-x86", "DriverInstaller\DriverInstaller.vdproj", "{C408790E-C9A8-4E4E-866F-F29991472631}" +Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "DriverInstaller", "DriverInstaller\DriverInstaller.vdproj", "{C408790E-C9A8-4E4E-866F-F29991472631}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -21,6 +21,7 @@ Global EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution {D6C39223-E1E8-4679-908C-BACACEA1E6CA}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {D6C39223-E1E8-4679-908C-BACACEA1E6CA}.Debug|Any CPU.Build.0 = Debug|Win32 {D6C39223-E1E8-4679-908C-BACACEA1E6CA}.Debug|x64.ActiveCfg = Debug|x64 {D6C39223-E1E8-4679-908C-BACACEA1E6CA}.Debug|x64.Build.0 = Debug|x64 {D6C39223-E1E8-4679-908C-BACACEA1E6CA}.Debug|x86.ActiveCfg = Debug|Win32 @@ -49,4 +50,7 @@ Global GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {9B5BA05B-B4FE-4F4B-86A7-47FF5E945E1F} + EndGlobalSection EndGlobal diff --git a/README.md b/README.md index e8194df..aad2a85 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,20 @@ -# USB Gamepad force feedback driver -This project implements a simple feedback driver for cheap USB Gamepads that works on Windows 8 / 10. I started this project because I couldn't find anywhere a driver that works on anything but Windows 7. +# DualShock Rumble Extension -It works with gamepads that identify themselves as VID=0x0079 and PID=0x0006. Mine looks like the one in this picture: - -![Gamepad image](http://alessandroasm.com.br/SACCJG50A_l.jpg) +Driver to enable the rumble feature of the DualShock on **VID_0D9D&PID_3012** adapters. ## Instalation -The latest MSI installer can be found here: -https://github.com/alessandroasm/generic-usb-gamepad-vibration-driver/releases +Use the latest installer found here: + +https://github.com/NishiyamaPedro/DualShock-Rumble-Extension/releases + +**It is highly recommended that you use HidHide with xOutput 3 with this driver for the best experience.** + +### Know Issus + + - Port 2 vibrations are being redirected to the Port 1. + +### Credits + +Alessandro Menezes - Original project: https://github.com/alessandroasm/generic-usb-gamepad-vibration-driver/ -### References -This project contains some code found in this article: https://www.codeproject.com/Articles/665/A-very-simple-COM-server-without-ATL-or-MFC +Shoaib Ali - COM Server base: https://www.codeproject.com/Articles/665/A-very-simple-COM-server-without-ATL-or-MFC