Giter Club home page Giter Club logo

devreorder's Introduction

devreorder

A utility for reordering and hiding controllers for games using DirectInput 8. It's implemented using a wrapper DLL and can be used to change the behavior of a single game or your entire system.

The main use of this tool is to bring some sanity to older DirectInput games that rely on the enumeration order of devices to determine the controller order in game (even though they are not supposed to do that). After Windows XP, and especially starting with Windows 8, the enumeration order of controllers is quite arbitrary and will change after rebooting Windows or unplugging and replugging in your devices. This can wreck havoc on games where you have carefully set up controller bindings for players 1-4, only to find that they are totally ruined the next time you boot up Windows.

There is no supported way to change this order, and the only method I found before writing devreorder was to physically unplug all of your devices and plug them back in the order that you want. This technique, however, falls apart when dealing with wireless and virtual devices. This tool finally allows the order to be defined explicitly.

Tested in Windows 8.1, but should in theory work in any version of Windows. Note that this currently only works for games that use DirectInput 8. Any older games that make use of an earlier version of DirectInput will not be affected, nor will games that use a different API for reading controller input, including Xinput, the old joystick API in winmm.dll, raw input, and the low level Windows HID API. (Although games that use older versions DirectInput, i.e. they use dinput.dll rather than dinput8.dll, may work with devreorder when combined with dinputto8.)

How to use:

Apply to single game or program

In the release zip file, or in the release directory if you cloned the repo, there is an x86 and x64 folder, each containing dinput8.dll. Depending on whether the game is 32-bit or 64-bit copy dinput8.dll in x86 or x64 respectively to the same folder containing the game's .exe file.

Also copy devreorder.ini and edit it so that its [order] section contains a list of controllers in the order that you want them to appear. You can also optionally decide to hide certain controllers by either adding all the controllers you want to be hidden to the [hidden] section, or adding all the controllers you don't want to be hidden to the [visible] section.

Any controllers listed in the [order] section will always be sorted ahead of any controller not listed in this section. Controllers with the same name will be grouped together, though their relative other between each other will remain the same. You may also use the instance GUID of a particular device in case you need to change the order of devices that have the same name.

When specifying names, you need to have it match exactly as it appears in the Game Controllers control panel or the included DeviceLister program, matching any punctuation, spaces, and capital letters. To open the Game Controllers control panel, type Win+R, type joy.cpl into the dialog box that appears, and then press enter. It will list any controllers that you currently have connected to your system in the order that they will appear to most games that use DirectInput. The DeviceLister application can also be used for this, and allows selecting the text so that it can be copied and pasted, probably making it a better, more convenient option.

You can also use DeviceLister.exe to find the GUIDs of each of your connected devices. You can use a GUID instead of a device name in the [order], [hidden], or [visible] sections if you need to specify a specific controller when multiple controllers have the same name. GUIDs may also work better in cases where devreorder doesn't match a controller by name for some reason (such as a bug). The GUID must be enclosed in curly braces and match the format in DeviceLister.exe, e.g. {01234567-89ab-cdef-0123-456789abcdef} Unfortunately, when there's more than one device with the same name, DeviceLister currently doesn't have a convenient way of determining which listing corresponds to which physical device. However, the order it uses should be the same as in the Game Controllers control panel, and that can display which buttons on a particular device are pressed, so you can use that to help figure out which GUID corresponds with which device. (I hope to improve this situation in the future.)

Please note that while these GUIDs are supposed to remain consistent for any one device, they are specific to a particular Windows installation and are therefore not transferable to another system. Also, people have reported that due to bugs in Windows, the GUIDs might be different between different user accounts. In that case you can specify all of the GUIDs that Windows reports for a particular device to ensure it's sorted or hidden consistently.

Finally, if you install devreorder system-wide, you can disable it for specific applications by adding their executable's filename to the [ignored processes] section. Be sure to include the file's extension too (which is usually .exe).

NOTE: This method of using devreorder will not work for games that initialize DirectInput via the COM interface. If you follow these directions to apply devreorder to a single game and it is not having any effect, it is likely that the game is accessing the DirectInput COM interface. In that case, you will need to follow the directions in the Registry changes section.

NOTE #2: If you get an error when running DeviceLister.exe that says something like System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.DirectX.DirectInput' then you probably need to install the DirectX 9 runtime. Here's a link to Microsoft's installer.

Use one settings file for all games

If you want to have a single devreorder.ini file that applies to all games, copy it to C:\ProgramData\devreorder\devreorder.ini (or wherever. your program-data folder is) The wrapper DLL will always check the game's current directory for devreorder.ini and, failing that, then check C:\ProgramData\devreorder\devreorder.ini so you can always change the settings on a per-game basis if you prefer.

Registry changes

As noted above, some games initialize DirectInput via COM. Starting from Windows 8, by default this ignores dinput8.dll from the application directory in favour of a system one, however this behaviour can be changed with a registry entry localized to the current user (therefore, this change does not require Administrator rights). With these changes, DI COM interfaces will load from dinput8.dll from the game directory, if one exists, and loaded from a system directory otherwise.

To make these changes, open the Command Prompt and run the following commands exactly as follows:

reg add HKCU\Software\Classes\CLSID\{25E609E4-B259-11CF-BFC7-444553540000}\InprocServer32 /ve /t REG_SZ /d dinput8.dll /reg:32
reg add HKCU\Software\Classes\CLSID\{25E609E4-B259-11CF-BFC7-444553540000}\InprocServer32 /ve /t REG_SZ /d dinput8.dll /reg:64
reg add HKCU\Software\Classes\CLSID\{25E609E5-B259-11CF-BFC7-444553540000}\InprocServer32 /ve /t REG_SZ /d dinput8.dll /reg:32
reg add HKCU\Software\Classes\CLSID\{25E609E5-B259-11CF-BFC7-444553540000}\InprocServer32 /ve /t REG_SZ /d dinput8.dll /reg:64

Apply to your entire system

(Warning! The following method involves changing DLL files in your Windows directory and is generally not recommended. Do not use this method unless you are comfortable making potentially breaking changes to your system and you understand the consequences, including the security implications. Proceed at your own peril!)

If you want to affect the order of controllers for your entire system, that can be accomplished with the following:

  1. Create a System Restore Point, just to be safe
  2. Fully quit any applications that make use of DirectInput. (They cannot be running in the system tray.)
  3. Open your system32 directory, usually C:\Windows\system32
  4. Take ownership of the file dinput8.dll and change its permissions so that the Administrators group has full control of the file. I'm not going to provide instructions here as you can use your favorite search engine to figure out how to do this. If you're not comfortable taking ownership of a file then you probably shouldn't be tampering with your Windows directory!
  5. Rename dinput8.dll to dinput8org.dll
  6. If your Windows installation is 64-bit, copy x64/dinput8.dll from the release directory or release zip file into system32. If your system is 32-bit (though these days that's uncommon), copy x86/dinput8.dll into system32 and skip to step 12.
  7. Open your sysWOW64 directory, usually C:\Windows\sysWOW64
  8. If you're using TrackIR, to prevent it from crashing, copy the original dinput8.dll from sysWOW64 to the TrackIR directory. If you're not using TrackIR then you can ignore this step.
  9. Take ownership of dinput8.dll and change its permissions so that the Administrators group has full control
  10. Rename dinput8.dll to dinput8org.dll
  11. Copy x86/dinput8.dll from the release directory or release zip file into sysWOW64
  12. Copy devreorder.ini to a folder named devreorder located in your program-data directory, usually C:\ProgramData\devreorder\devreorder.ini
  13. Edit that copy of devreorder.ini as per the instructions in the above sections

NB: It is extremely important that you rename the original copy of dinput8.dll to dinput8org.dll. devreorder will specifically look for a dll named that in the system32 / sysWOW64 directory, so if you use a different name than dinput8org.dll, then DirectInput will stop working and your game may crash!

Antivirus false positives

It's been reported to me that some antivirus software may flag devreorder's versions of dinput8.dll as a virus or other kind of malware. These are false positives. If this happens to you then you will need to configure your antivirus software to whitelist these files so that it doesn't prevent devreorder from working.

Possible future work

  • A GUI that streamlines installing the devreorder DLLs, and allows just dragging controllers into the order you want. (Wouldn't that be nice!)
  • Wrap other game input APIs

I make no guarantees that I will ever get around to implementing any of these!

Some credits

This project makes use of both MinHook by @TsudaKageyu and SimpleIni by @brofield.

The technique and a good chunk of source code for the DirectInput wrapper was adapted from the x360ce project. Special thanks to the contributors of that project!

devreorder's People

Contributors

briankendall avatar cookieplmonster avatar justindarc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

devreorder's Issues

Issue with mame and logitech wheel .

I hope i could get some answers here regarding devreorder .
I try to let work devreorder in mame .
My controllers in devicelister .

My controllers :
"Mayflash Wiimote PC Adapter": {348414e0-8550-11e9-8001-444553540000}
"Controller (Xbox One For Windows)": {020d1c00-b17e-11e9-8001-444553540000}
"Logitech G25 Racing Wheel USB": {44ae04b0-856f-11e9-8001-444553540000}
"Controller (XBOX 360 For Windows)": {9bdfa030-cce2-11e9-802a-444553540000}
"Mayflash Wiimote PC Adapter": {34877040-8550-11e9-8007-444553540000}
"Controller (XBOX 360 For Windows)": {9c89e9f0-cce2-11e9-802b-444553540000}
"Controller (Xbox One For Windows)": {045bee00-b17e-11e9-8002-444553540000}
"Mayflash Wiimote PC Adapter": {34885aa0-8550-11e9-800b-444553540000}
"Mayflash Wiimote PC Adapter": {348881b0-8550-11e9-800d-444553540000}

Like you see its a mess . Thats why i was searching after a solution .
So i found devreorder .

I tried this with mame .

I put my order like following :

"Controller (Xbox One For Windows)": {020d1c00-b17e-11e9-8001-444553540000}
"Controller (Xbox One For Windows)": {045bee00-b17e-11e9-8002-444553540000}
"Logitech G25 Racing Wheel USB": {44ae04b0-856f-11e9-8001-444553540000}
"Controller (XBOX 360 For Windows)": {9bdfa030-cce2-11e9-802a-444553540000}
"Controller (XBOX 360 For Windows)": {9c89e9f0-cce2-11e9-802b-444553540000}
"Mayflash Wiimote PC Adapter": {348414e0-8550-11e9-8001-444553540000}
"Mayflash Wiimote PC Adapter": {34877040-8550-11e9-8007-444553540000}
"Mayflash Wiimote PC Adapter": {34885aa0-8550-11e9-800b-444553540000}
"Mayflash Wiimote PC Adapter": {348881b0-8550-11e9-800d-444553540000}

And it works , my 2 xbox one controllers are on position 1 and 2 .
But My logitech wheel don't work , devreorder just ignore it .
Xbox 360 on position 3 and 4 . No logitech on position 3 ??? When trying it out in mame .
From the moment i remove the Dinput , my logitech wheel works again , but in the wrong order offcourse .

What could be the problem ?
I tried devreorder in retroarch , and there it works , but like this ==>
And this don't work in mame .

; devreorder settings
; Any line starting with ; is a comment and will be ignored

[order]
Controller (Xbox One For Windows)
{020d1c00-b17e-11e9-8001-444553540000}
Controller (Xbox One For Windows)
{045bee00-b17e-11e9-8002-444553540000
Logitech G25 Racing Wheel USB
{44ae04b0-856f-11e9-8001-444553540000}
Controller (XBOX 360 For Windows)
{9bdfa030-cce2-11e9-802a-444553540000}
Controller (XBOX 360 For Windows)
{9c89e9f0-cce2-11e9-802b-444553540000}

[hidden]

[visible]
Mayflash Wiimote PC Adapter
{348414e0-8550-11e9-8001-444553540000}
Controller (Xbox One For Windows)
{020d1c00-b17e-11e9-8001-444553540000}
Logitech G25 Racing Wheel USB
{44ae04b0-856f-11e9-8001-444553540000}
Controller (XBOX 360 For Windows)
{9bdfa030-cce2-11e9-802a-444553540000}
Mayflash Wiimote PC Adapter
{34877040-8550-11e9-8007-444553540000}
Controller (XBOX 360 For Windows)
{9c89e9f0-cce2-11e9-802b-444553540000}
Controller (Xbox One For Windows)
{045bee00-b17e-11e9-8002-444553540000}
Mayflash Wiimote PC Adapter
{34885aa0-8550-11e9-800b-444553540000}
Mayflash Wiimote PC Adapter
{348881b0-8550-11e9-800d-444553540000}

[ignored processes]

Freespace 2 Open 64-bit does not detect controllers from devreorder is installed system-wide

Well I spoke to soon. Yes I got TrackIR working but as I went through my games I found that having the DLL for the entire system broke Freespace 2 Open 64bit. I tried everything but no controllers would show up in the game. I changed it back and it started working fine and it did require using the normal DLL and ini file as Vjoy needs to be #1 and its normally not now. I tried a few others like IL-2 1946 and Everspace and they worked with the DLLs in the Windows folder location. So for now I will live without Sky Gamblers: Storm Raiders.

Unhandled exception on start

Screenshot:

Windows version:

Exception details:

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.DirectX.DirectInput, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.DirectX.DirectInput, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
   at DeviceLister.DeviceListerForm.DeviceListerForm_Load(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].



************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.8825 (WinRelRS3.050727-8800)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
DeviceLister
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///H:/Different/devreorder_v1.0.3/DeviceLister.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.8825 (WinRelRS3.050727-8800)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.8825 (WinRelRS3.050727-8800)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.8825 (WinRelRS3.050727-8800)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Accessibility
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.8825 (WinRelRS3.050727-8800)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

TP issues

Hi Briankendall. Thank you so much for devreorder. I was tearing my hair out until I found it. I have a cab with 4 controllers that randomly change order: a wheel, 2 ZeroDelay arcade encoders unfortunately with the same name, and a flight stick through a usb hub. I used the system wide settings with GUID and devreorder keeps them in the right order for everything except Teknoparrot.

Interestingly, for driving games it will move the wheel to the top of the list, which is where I want it. But it does not do so for other games and it doesn't put controllers 2, 3, 4 in the right order. Don't know if it would be of any use, but OutRun2 gives some info before starting. Have I done something wrong in the setup or is there a way around this? Would really appreciate any guidance you might have.

17:59:59.855 00008212
devreorder: Calling hooked DllGetClassObject

17:59:59.855 00008212 Current process name: budgieloader.exe

.....17:59:59.856 00008212 devreorder: using system-wide devreorder.ini

17:59:59.856 00008212 Ignored list:

17:59:59.857 00008212 devreorder: Loaded "C:\WINDOWS\system32\dinput8org.dll"

17:59:59.865 00008212 devreorder: in CreateHooks

17:59:59.865 00008212 Current process name: budgieloader.exe

17:59:59.865 00008212 Ignored list:

17:59:59.866 00008212 devreorder: using UNICODE interface

17:59:59.866 00008212 devreorder: CreateHook EnumDevicesW status MH_OK

.....17:59:59.879 00008212 devreorder: EnableHook EnumDevicesW status MH_OK

17:59:59.880 00008212 devreorder: using system-wide devreorder.ini

17:59:59.880 00008212 devreorder: determining new sorting order for devices

.....17:59:59.890 00008212 devreorder: using system-wide devreorder.ini

17:59:59.890 00008212 devreorder: using system-wide devreorder.ini

17:59:59.891 00008212 devreorder: product "USB Game Controllers" is sorted up by GUID

17:59:59.894 00008212 devreorder: product "ArcadeCabinet" is sorted up by GUID

17:59:59.895 00008212 devreorder: product "ArcadeCabinet" is sorted up by GUID

..........17:59:59.911 00008212 devreorder: product "Thrustmaster T150 Racing Wheel" is sorted up by GUID

17:59:59.917 00008212 devreorder: Calling hooked DllGetClassObject

17:59:59.917 00008212 Current process name: budgieloader.exe

17:59:59.917 00008212 Ignored list:

17:59:59.917 00008212 devreorder: in CreateHooks

17:59:59.918 00008212 Current process name: budgieloader.exe

17:59:59.918 00008212 Ignored list:

17:59:59.918 00008212 devreorder: using UNICODE interface

17:59:59.918 00008212 devreorder: EnableHook EnumDevicesW status MH_ERROR_ENABLED

17:59:59.918 00008212 devreorder: determining new sorting order for devices

..........17:59:59.938 00008212 devreorder: product "Thrustmaster T150 Racing Wheel" is sorted up by GUID

I must be doing something wrong

For the life of me I cant get this to work. I have essentially 2 controllers plugged into the system. I have a razer huntsman v2 analog and a xbox one controller. I am trying to avoid disabling the analog function of my keybaord and still have games like the original FF7 and remake of Secret of Mana recognize the xbox one controller. Unfortunately, no combination of configs seems to have worked. Here are my devices and how I have my ini configured.

Screenshot 2022-06-25 084927

Screenshot 2022-06-25 085020

XInput Reordering

Hello there! I am interested in this functionality applying to the Xinput API. This software does everything I need in DirectInput but I would need it for XInput. My goal is this: I would like to seamlessly use one or more XInput wireless controllers in place of my arcade controls on occasion. Is there a way to permanently assign and automatically disable or lower the priority of my already connected XInput controllers, which in this case are two Brook Zero Pi Fighting Boards (two permanently attached Xinput controllers), so the wireless ones always take precedence over them but only when they are connected? I would be willing to foot a monetary bounty as added incentive.

Having trouble getting this to work

I am building 2 pc 4 player arcades and this is my salvation to fix this issue I have had for years but I am having no luck with it. Its definitely the naming of my joysticks. I have the same issue as someone else with the framework error on device lister. Any help would be awesome so I can get these arcades done. Thanks

Bit Defender detecting file as a virus

A few weeks ago an update to Bit Defender started flagging the dll files specifically the x64 one as a virus and it happily quarantined it while it was in use. Windows 10 didn't react too well to that as you might imagine. Work around of course was to set exclusions in the AV. Just wanted to let you know it was happening.

Shuffle order with the same VID and PID numbers devices

Hi all,

First of all, I would like to thank you for sharing this amazing program. I did not have any issue at all until I used 4 joystick controllers with the same VID and PID.

The GUID stays in order but maybe when I restart my PC, whoever the joystick power up first will receive the first GUID in devreorder.ini and so on. That is why my joystick shuffles.

In act of desperation, I tried using Device Instance path enclosed with { } with no luck. I know its not included in the features yet but that is the only option I noticed which stays the same order no matter what.

Aside from my idea due to desperation, is there any other way to keep my joysticks in order? I'm using system wide setting by the way.

Game seems to crash on exit

I am using this great app but there are times when I exit the game (which is also using x360ce) to quit back to Windows I get a dialog "Application has stopped error on exit"

Problem signature:
Problem Event Name: APPCRASH
Application Name: RSG-Win64-Shipping.exe
Application Version: 4.13.2.0
Application Timestamp: 58400cd0
Fault Module Name: dinput8.dll
Fault Module Version: 6.1.7600.16385
Fault Module Timestamp: 4a5bdecf
Exception Code: c0000005
Exception Offset: 0000000000021b52
OS Version: 6.1.7601.2.1.0.256.48
Locale ID: 1033
Additional Information 1: ff2d
Additional Information 2: ff2de61358b40bee9a2f94b225eb1c4e
Additional Information 3: 7abf
Additional Information 4: 7abf5ca792c385aaa27ce35a301ce19a

Steam Issue

I applied every step and worked fine, but when I turned off and then turned on my computer steam doesn't starts no more.
Everything I get is a error screen with the text "Cannot load "C:\Windows\system32\dinput8org.dll" error: 0x7e"
Tried to restore the original file with a backup I did, but still not working.

How to specify order for same-named controllers?

How can we get unique names for controllers when they are the same controllers? For example, I have 2 Mayflash Arcade Stick controllers and 2 F300 versions as well:

controllers

I have to believe there's a logging mechanism that will give us some degree of uniqueness from the enumerator, but I'm really at a loss as to where to go for this. It'd be great if there were a way to change the names manually (I'd always hoped MS would implement a naming mechanism for controller devices that would also indicate order or something to that effect, but... here we are).

file not found exception directx

Win 10, 64bit, DirectX 12, I get the following error when trying to run devicelister.exe

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.DirectX.DirectInput, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.DirectX.DirectInput, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'

Reoder not Working in MAME

MAME will only keep the order on player 3, 4, 5 generic controllers and my other devices are ordered fine. Player 1 and 2 sometimes are 1 and 2 but they change almost every time I launch. Sometimes they are 12, and 13 and other 14 and 15.

Device Lister wont run

Hi

Thank you for your great solution to my arcade cabinet. I have been using the program for a while on a system wide install and got two new controllers the other day. I went back to device lister and now it is giving me a .net Framework error saying the program is not a valid Win32 Applications HRESULT: 0x800700C1.

I have tried going into windows features and unchecking both .net and then rechecking after restart and still the same issues.

Wondering if anyone else has had this experience. Or has any easy solution to get the device ids.

Regards

Usage with other wrappers

I'm using this wrapper in an arcade cabinet where I also use Boomslangnz/FFBArcadePlugin to add/improve force-feedback for driving games in MAME and M2Emulator.

The important part though is that FFBArcadePlugin also wraps dinput8.dll in some cases (when used with M2Emulator for instance).
I'm guessing that a system-wide install in this scenario would work, but, I'm wondering: is this scenario somehow supported for a local install?

I'm hoping that the following may possibly work in a local directory:

  • .\dinput8.dll from devreorder
  • .\dinput8org.dll from FFBArcadePlugin

I'll give this a shot when I have the time. If it works correctly, maybe this type of install is worth mentioning in README.md?

And, as an aside I prefer a local install because I use/maintain a setup script that configure all of my arcade emulators. Keeping everything localized is easier to manage for me.

Doesn't worth with 3rd party keymapping tools (ie JoyToKey)

I can not get this to work with the likes of JoyTokey, Xpadder etc. I am using the GUI in the devorder.ini file. I got these from the devicelister exe.

While the ordering does work in JoyToKey (if I open up the app and click configure joysticks the order is correct) the inputs are completely ignored.

Less invasive alternative to a system-wide installation

Currently, devreorder says this for cases when the game initializes DirectInput via COM:

NOTE: This method of using devreorder will not work for games that initialize DirectInput via the COM interface. If you follow these directions to apply devreorder to a single game and it is not having any effect, it is likely that the game is accessing the DirectInput COM interface. In that case, you will need to follow the directions in the Apply to your entire system section.

This is a much more heavy-handed solution than necessary. It is possible to avoid messing with the system files, or even avoid requiring admin access by modifying DirectInput's CLSID definitions. Looking into the registry in a HKEY_CLASSES_ROOT\CLSID directory, starting from Windows 8, CLSID's related to DirectInput specify an absolute path to dinput8.dll, therefore games ignore your custom DLL placed in the game directory.

The fix is trivial and can be applied to the current user only - replacing the path field (inside InProcServer32) with a relative path to the DLL (aka just the name) will revert to the "old" behaviour of first trying to load a DLL from the application directory, before getting it from the system directory.

The original guide for this was approach written by John-Paul Ownby for IndirectSound. I created a revision of this guide that does not require using regedit.exe, and can be done from the Command Prompt without admin access.

Naturally, for devreorder these steps should be taken for DirectInput interfaces, not XAudio/DirectSound interfaces, but the idea is the same.

Joystick input recognized differently

I've installed devreorder systemwide because I have applications that need it installed that way and it works well for them and I'm able to establish the controller order I'm looking for. However it's causing issues for games I don't really need it for i.e. MAME. I'm having an issue with MAME recognizing my joysticks as a different input code with the devreorder version of dinput8.dll versus the original version. With the original dinput8.dll files MAME will recognize inputs as "JOYCODE_1_HATSWITCHU" for UP on JOYSTICK 1. However with the devreorder version of the dll file MAME recognizes the input as "JOYCODE_1_U". This causes MAME problems and it will overwright the default configuration file with "JOYCODE_1_UNKNOWN_SWITCH" on the next launch. I tried to enter "mame64.exe" in the ignore processes section of the devreorder.ini file, but that didn't work. Any thoughts?

Does not work to hide joystick from Steam/Rocksmith2014

I have issues with Rocksmith 2014 thinking my spiking T-Rudder is an input, which leads to ghost UI selections.

I've configured devices into visible/hidden - the log says that DLL is effective and the settings are read

[1424] 21:59:22.585 00004484 devreorder: CreateHook EnumDevicesA status MH_OK 
[1424] 21:59:22.631 00004484 devreorder: EnableHook EnumDevicesA status MH_OK 
[1424] 21:59:24.277 00004484 devreorder: using program-specific devreorder.ini 
[1424] 21:59:24.277 00004484 devreorder: determining new sorting order for devices 
[1424] 21:59:24.294 00004484 devreorder: using program-specific devreorder.ini 
[1424] 21:59:24.294 00004484 devreorder: using program-specific devreorder.ini 
..
[1424] 21:59:24.316 00004484 devreorder: product "T-Rudder" is not in visible section 
...

From the code I take it that this means the joystick enumeration Rocksmith is doing should skip that joystick as input.

Alas Rocksmith continues to react to it.

I realize this is a special observation. Maybe others have a similar issue specifically with steam games.

Things tried

  • system install - no
  • steam controllers on/off - yes

Razer Huntsman V2 Analog

Hello,
I don't know if there's something that can be done about it.
I recently bought the Razer Huntsman V2 Analog keyboard. It has a function that simulates a controller, so Windows also recognizes it as such. I'm primarily using a PS5 controller connected through an 8BitDo USB Receiver. However the Razer is set as ID 1 which is why I found my way to this tool. I installed it systemwide, configured it and when I check the windows gamecontroller settings the controllers are in the order set by me. But in games Razer is still player 1 no matter what I do. Even when I set it to hide or the 8BitDo to visible the only thing that happens is that I can't use my PS5 controller anymore. Funnily enough the emulated Joystick from the Razer keyboard which was ID 2 before changed to ID 3 through the tool.

2 joypads, same name for both

Hi, my IPAC arcade board gives me 2 joypads but they both have the same top level name.
They have different ID numbers.
Can devreorder use ID numbers instead of top level names?

feature request: custom path for config file

Hi
I'm using devreorder as part of my LAN setup. for managability purposes, I'd like to be able to set a custom parameter for devreorder for the configuration file location.
so instead of running mygame.exe I could run mygame.exe --devreorder_path="C:\My Folder\devreorder123.ini"
or, using an environment variable perhaps:

set devreorder_path=C:\My Folder\devreorder123.ini
mygame.exe

and have devreorder load its configuration from C:\My Folder\devreorder123.ini instead of the working directory / ProgramData etc.

is this possible?

Stopped working on Windows 11

It has worked for a long time but I think a recent update to Windows 11 has stopped it working. I did it systemwide, and devicelister is showing a new order. The ini and directinput file are still in the proper location. I have tried to replace the dll, bit Windows will not allow me to replace the file in the system 32 folder.

DeviceLister doesn't work

Whenever I try to launch DeviceLister.exe, I get a .NET Framework error message as follow:

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.DirectX.DirectInput, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.DirectX.DirectInput, Version=1.0.2902.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
   at DeviceLister.DeviceListerForm.DeviceListerForm_Load(Object sender, EventArgs e)
   at System.Windows.Forms.Form.OnLoad(EventArgs e)
   at System.Windows.Forms.Form.OnCreateControl()
   at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   at System.Windows.Forms.Control.CreateControl()
   at System.Windows.Forms.Control.WmShowWindow(Message& m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WmShowWindow(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].



************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.9151 (WinRelRS6.050727-9100)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll
----------------------------------------
DeviceLister
    Assembly Version: 1.0.0.0

View Log Output

I'm having difficulty getting my devreorder settings to take hold, and have been trying to debug the situation. I see some logging calls in the code that may be helpful in debugging, but cannot determine where that log gets written. Or is there a better way to troubleshoot?

device list error net.framework

hi first sorry for use translate google
I have two Xbox 360 wireless gamepads in Windows 10
unzip on the desktop the devreorder-master folder I run the devicelister program of the release folder and it gives me an error of
net.framework
When JIT debugging is enabled, any unhandled exceptions
will be sent to the JIT debugger registered on the computer
instead of controlling it through the dialog box
when I continue and the controller window is blank
I have the dinput8 dll renamed in sytem32 and syswow64
I want to configure it for the complete system
Thank you

NFS: Porsche Unleashed crashes on race load

Following instructions from https://www.pcgamingwiki.com/wiki/Need_for_Speed:_Porsche_Unleashed#Menu_lag_when_using_a_controller.2FAxes_do_not_function_correctly_.28Win8.2B.29 I installed your program and hid/reordered my controllers based on GUID. Loading the game menu it did properly only show the listed controllers and I was able to configure the controller as well. However, once starting a race, it loads the track and right before switching over to the render of the race it closes without any message.

If there is anything I can do on my end to provide a more useful bug report or diagnostic data, please let me know.

Using Apply to your entire system crashes TrackIR

Had one game that seems to require this but after I made the changes (and the game did work) I noticed that my TrackIR no longer works. The application instantly closes with no errors. I restore the system to the restore point and it all works.

Not sure if this can be fixes but would love to see it work for this one game. All other games that require reordering controllers I have work with the DLL in the game folder.

Sort by parent device / usb port ?

Hi,

I have an Arcade cabinet with two Zero Delay USB Encoder on a PC.
As the two devices have the same name, is there a way to sort them by the USB port where they are connected ?

Best regards,
DUPONCHEEL Sébastien

Thankyou!

Sorry I dont have an issue, I just wanted to thank you for creating this little gem!
I have an IPAC and 2 Aimtrak lightguns in my arcade cabinet and I was close to pulling my hair out thanks to Windows and its constant re-ordering of my controllers.
I have added this program of yours to MAME and Retroarch and I can now sit back and enjoy my games.

Thankyou.

Can't get this to work (system-wide install)

I can't for the life of me get this to work. I did a system-wide install as such:

Windows 10 64bit (latest version).
Renamed c:\windows\system32\dinput8.dll to dinput8org.dll
Copied 64bit dinput8.dll from release 1.0.2 zip into c:\windows\system32.
Ran c:\program files\devreorder\devreorder.exe, it gave me:

"Generic USB Joystick ": {39cfaa30-2353-11ea-8007-444553540000}
"UltimatePINCABController": {0cc08e90-50ff-11ea-8001-444553540000}
"UltimatePINCABController": {0cc0dcb0-50ff-11ea-8002-444553540000}
"UltimatePINCABController": {0cc0dcb0-50ff-11ea-8003-444553540000}
"UltimatePINCABController": {0cc103c0-50ff-11ea-8004-444553540000}
"Generic USB Joystick ": {260f6170-242a-11ea-8001-444553540000}
"Generic USB Joystick ": {c9de1cd0-3f03-11ea-8001-444553540000}

The joysticks I need are "Generic USB Joystick" only.

Updated devreorder.ini to:

[order]
{39cfaa30-2353-11ea-8007-444553540000}
{260f6170-242a-11ea-8001-444553540000}
{c9de1cd0-3f03-11ea-8001-444553540000}

[hidden]

[visible]
{39cfaa30-2353-11ea-8007-444553540000}
{260f6170-242a-11ea-8001-444553540000}
{c9de1cd0-3f03-11ea-8001-444553540000}

[ignored processes]

Rebooted. Tried the following apps:

Steam
Mame
JoyToKey (keyboard mapping tool).

{260f6170-242a-11ea-8001-444553540000} still shows up as Joystick #6
{c9de1cd0-3f03-11ea-8001-444553540000} still shows up as Joystick #7

Thanks!

Device order not working - but hidden/visible working...

Thank you so much for this great bit of code. This has long been problem for many people, including myself, so I was delighted when I finally came across a solution such as yours.

I do have a bit of a problem though, so I hope you can help.

  • devices/applications are not respecting the order in 'devreorder'

  • devices placed in visible/hidden are working correctly in an applications ie they are hidden if set to hidden.

Nothing was working at all, so I went through the steps of applying to entire system (ie editing the ownership of the DLLs etc). This then made the visible/hidden section work correctly.

Specifically, I am trying to get this to work in Retroarch using the Retrobat front end. I have placed the 64bit dinput8.dll in the folder with Retroarch.exe as well as the main Retrobat and EmulationStation folders just in case.

I have many controllers but I am testing with 3 - a PS4 controller (wireless but connected via USB), an 8BITDO SN30 Pro and a generic USB Gamepad wired. The PS4 controller always reverts to P1 in Retroarch no matter what I do.

I have tried using both the device names and the GUIDs in the devreorder file. It doesn't appear to make a difference to functionality. I am using Windows 10 Pro 64bit.

If you can offer any advice as to what I am doing wrong, I would be much appreciated. I feel I am so close to solving a problem that has plagued me for years, but am obviously doing something wrong as many people have had great success with your code. Thank you for your time and help.

devreorder stopped working after the "Windows Creators Update"

dinput8.dll was upgraded to version 10.0.15063.0 in the "Windows Creators Update".
When I replace dinput8.dll with the devreorder 1.0.1 dlls, joy.cpl no longer starts up.

When I check my windows version with the "winver" command I have Windows version 1703 (OS-version 15063.332)

The creators update can be installed through windows update or here: https://support.microsoft.com/en-us/instantanswers/d4efb316-79f0-1aa1-9ef3-dcada78f3fa0/get-the-windows-10-creators-update

Devreorder is absolutely brilliant! Would be great if it would work with the latest Windows version.

TrackIR stops working

in a X64 system Track IR 5 stops working when dinput8.dll gets replaced in C:\Windows\SysWOW64

The following error is given

image

Tried system wide approach, but still not having any effect?

Hi there. I apologize in advance if I'm not clear enough, I'm not proficient in English. Or if it's not the correct place to ask.

I have games that should support Xbox 360 controller, and I'm using x360ce to emulate my controller (detected in joy.cpl and DeviceLister as "PC/PS3/Android Gamepad", but no Windows game supports it except emulator). It usually works without any problem nor any tinkering.

The problem is, with this particular game it only reads the first listed controller, which it doesn't support. I tried to use devreorder on the game directory, but it doesn't have any effect. Next, the system-wide approach, I followed the instruction as best as I could.

  1. Take ownership of dinput8.dll on both system32 and SysWOW64, then rename each of them to dinput8org.dll.
  2. My system is 64 bit, so I copied devreorder's version of x64 dinput8.dll to system32, and the x86 one to SysWOW64.
  3. Put the devreorder.ini to ProgramData\devreorder, with content as following:
    notworking
  4. Reboot.

The problem is, it still doesn't have any effect, my actual controller is still detected in joy.cpl.

To confirm it I started Steam's Big Picture, and true enough, Steam reads each controller input twice (from "PC/PS3/Android Gamepad" and "Controller (Xbox360 For Windows)", since Steam in Big Picture mode supports both).

Did I do something wrong on applying the system-wide configuration? What do I do to hide my actual controller in joy.cpl and only leaves the virtual controller?
Any help is appreciated, thanks!

Stopped working after newest W10 update

I'm on 1809 and the Build # is 17763.55. I believe it just updated a day or two ago and every since then, i can't get it to work. It had been working fine for a while. I have a 360 controller that has a bad cable and it disconnects and then reconnects as like player 2 or 3. Some games are ok and keep working ( like mafia 3) but Dragon Quest XI and others don't work unless its P1. So i got it setup and worked fine.

But every since the last windows update, i can't get it to work. I did the dll switch and checked over and over that it was the right ones. But i can't get the controller to work in those games if its on anything other than P2. Any ideas?

Enhance => Whitelist or Show section

hi
first, thank for your amazing work, finally i can use my pads correctly sorted.
my wish will be the possibility to implement whitelist option.
why?
Because i have those "big problems":
-I use xinput pads on xinput games (FINE)
-I use xinput pads on dinput games trough virtual dinput pad (FINE)

Problem 1:
every time a dinput pad was plugged into the system (wiimote, DS4, generic pad) it was shown into the system.
every time a xinput pad was plugged into the system, it was shown as xinput and dinput device.
and it is a problem?
well, some (very old) games and programs have a ¿stupid? problem.
if they detect more that 4 pad plugged in the system (my 4 virtual dinput pad shorted with your program + the real dinput pads), they crash!!!

Problem 2:
while xinput pads have an "unique Id access model" (select pad 1 to 4 to access xinput pads without any problem), every manufacturer has is own Hardware ID (VID + PID).
i found more that 20 different Hardware IDs on xinput pads, and every new xinput pads model has another new Hardware ID.
it is impossible to me know all possible Hardware IDs and include into [HIDE] section.

if you can include [whitelist] section, both problems will be gone, i can put inside the Hardware IDs of virtual dinput pads, and no other pads will be show ever.
thanks for your time.
regards.

CH PRO PEDALS USB not detected

First I want to say THANK YOU!!!!

I've been struggling with this issue for years and have looked for a solution but nothing has worked. I just installed a new controller last night and was yet again faced with this seemingly unresolvable problem.

Out of desperation I searched again the MS forums for any sign of a solution and low and behold....

This works, it just simply works.

One small detail in my case, the exact name of the CH rudder pedals is "CH PRO PEDALS USB" and no matter, they don't seem to be detected properly by the devreorder. It simply adds them to the bottom of the list in my Game Controllers. This is perfectly fine as it's a great deal better than what I used to face, sure they sit at the bottom of the list. I can live with that. Though I thought you should know.

Thank you again!

Programs that used to, now won't start with System-Wide Installation

Hi Brian,

Love your software it's a lifesaver.

Running Windows 10 x64

Recently, a few applications have stopped working with the system wide install that used to work just fine. These include

PCSX2 - Playstation 2 Emulator - The application was unable to start correctly (0xc000007b).
BlissBox API Tool - (I forget the error, and appreciate this is niché software - can get you the error if you need)

For both of these, replacing the dinput8.dll with dinput8org.dll restores functionality.

There has been a recent windows update... I'm not sure if that might have caused something?

Pete

Alternative to minhook

Hi,

I don't sure if can be usefull this information, if no please ignore it (I' am not an expert).

I see in this project:

https://github.com/hauzer/dinput8_nojoy/tree/master/dinput8_nojoy

that the autor use another technique that simply override the member without use MinHook , detours or similar.

If I understand this technique is called "IAT hook", that have the advatage to work in 100% of cases (I have tested it in many games).

So is not necessary to copy dinput8.dll to system wide becouse work always to game directory.

The disadvantage seem the performance that are slow.

Take this only like sort of potential alternative (ex: mode 0: default, mode 1: alternative)

I repeat if this is unuseful please ignore it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.