Error calling setupdigetdeviceregistrypropertyw 122 x360ce как исправить

Hi, I don't know what I'm doing wrong. As far as I know I have all the prerequisites. I will try reinstalling/repairing them all, but I get this error message: Error Calling SetupDiGetDevic...

Hi, I don’t know what I’m doing wrong. As far as I know I have all the prerequisites. I will try reinstalling/repairing them all, but I get this error message:
Error Calling SetupDiGetDeviceRegistryPropertyW: 122

This is for GTA 5, I have tried both the X86 and x64, this is on x64, which I believe the game to be.

Is there anything I’m missing? Please help :) I tried looking this up and haven’t found anything similar, but I might have not looked hard enough and if so I’m sorry for asking again.

I’ve also tested administrator privelege and compatability.

The exception text seems to be related to the program, but I’m unsure of what it means.

Details:


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

************** Exception Text **************
System.Exception: Error calling SetupDiGetDeviceRegistryPropertyW: 122
   at JocysCom.ClassLibrary.IO.DeviceDetector.GetStringPropertyForDevice(IntPtr deviceInfoSet, SP_DEVINFO_DATA deviceInfoData, SPDRP propId)
   at JocysCom.ClassLibrary.IO.DeviceDetector.GetVidPidRev(IntPtr deviceInfoSet, SP_DEVINFO_DATA deviceInfoData, UInt32& vid, UInt32& pid, UInt32& rev)
   at JocysCom.ClassLibrary.IO.DeviceDetector.GetDeviceInfo(IntPtr deviceInfoSet, SP_DEVINFO_DATA deviceInfoData, String deviceId)
   at JocysCom.ClassLibrary.IO.DeviceDetector.GetDevices(Guid classGuid, DIGCF flags, String deviceId, Int32 vid, Int32 pid, Int32 rev)
   at x360ce.App.MainForm.RefreshCurrentInstances(Boolean forceReload)
   at x360ce.App.MainForm.UpdateForm3()
   at x360ce.App.MainForm.UpdateTimer_Elapsed(Object sender, ElapsedEventArgs e)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2600.0 built by: NET471REL1LAST
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
x360ce
    Assembly Version: 3.2.10.82
    Win32 Version: 3.2.10.82
    CodeBase: file:///D:/Games/Steam/steamapps/common/Grand%20Theft%20Auto%20V/x360ce_x64.exe
----------------------------------------
System.Configuration.Install
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2556.0 built by: NET471REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration.Install/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.Install.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2556.0 built by: NET471REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2556.0 built by: NET471REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2556.0 built by: NET471REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2556.0 built by: NET471REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2600.0 built by: NET471REL1LAST
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
SharpDX.DirectInput
    Assembly Version: 2.6.3.0
    Win32 Version: 3.2.10.82
    CodeBase: file:///D:/Games/Steam/steamapps/common/Grand%20Theft%20Auto%20V/x360ce_x64.exe
----------------------------------------
SharpDX
    Assembly Version: 2.6.3.0
    Win32 Version: 3.2.10.82
    CodeBase: file:///D:/Games/Steam/steamapps/common/Grand%20Theft%20Auto%20V/x360ce_x64.exe
----------------------------------------
x360ce.Engine
    Assembly Version: 1.0.0.0
    Win32 Version: 3.2.10.82
    CodeBase: file:///D:/Games/Steam/steamapps/common/Grand%20Theft%20Auto%20V/x360ce_x64.exe
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2556.0 built by: NET471REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Data.Entity
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2556.0 built by: NET471REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Data.Entity/v4.0_4.0.0.0__b77a5c561934e089/System.Data.Entity.dll
----------------------------------------
System.Runtime.Serialization
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2556.0 built by: NET471REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
----------------------------------------
System.ComponentModel.DataAnnotations
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2556.0
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.ComponentModel.DataAnnotations/v4.0_4.0.0.0__31bf3856ad364e35/System.ComponentModel.DataAnnotations.dll
----------------------------------------
System.Data
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2556.0 built by: NET471REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------
Microsoft.GeneratedCode
    Assembly Version: 1.0.0.0
    Win32 Version: 4.7.2556.0 built by: NET471REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Microsoft.GeneratedCode
    Assembly Version: 1.0.0.0
    Win32 Version: 4.7.2556.0 built by: NET471REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Microsoft.GeneratedCode
    Assembly Version: 1.0.0.0
    Win32 Version: 4.7.2556.0 built by: NET471REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Microsoft.GeneratedCode
    Assembly Version: 1.0.0.0
    Win32 Version: 4.7.2556.0 built by: NET471REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Web
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2556.0 built by: NET471REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Web/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Web.dll
----------------------------------------
Microsoft.GeneratedCode
    Assembly Version: 1.0.0.0
    Win32 Version: 4.7.2556.0 built by: NET471REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Microsoft.GeneratedCode
    Assembly Version: 1.0.0.0
    Win32 Version: 4.7.2556.0 built by: NET471REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Accessibility
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2556.0 built by: NET471REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
vJoyInterfaceWrap
    Assembly Version: 0.2.0.5
    Win32 Version: 3.2.10.82
    CodeBase: file:///D:/Games/Steam/steamapps/common/Grand%20Theft%20Auto%20V/x360ce_x64.exe
----------------------------------------
System.Numerics
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.2556.0 built by: NET471REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.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.

Содержание

  1. Error SetupDiGetDeviceRegistryPropertyW: 122 #830
  2. Comments
  3. 4.9.0 — Mouse and keyboard stopped responding #940
  4. Comments
  5. Footer
  6. Код ошибки 122 с использованием SetupDiGetDeviceRegistryPropertyW для получения требуемого размера
  7. SetupDiGetDeviceRegistryPropertyA function (setupapi.h)
  8. Syntax
  9. Parameters
  10. SPDRP_ADDRESS
  11. SPDRP_BUSNUMBER
  12. SPDRP_BUSTYPEGUID
  13. SPDRP_CAPABILITIES
  14. SPDRP_CHARACTERISTICS
  15. SPDRP_CLASS
  16. SPDRP_CLASSGUID
  17. SPDRP_COMPATIBLEIDS
  18. SPDRP_CONFIGFLAGS
  19. SPDRP_DEVICE_POWER_DATA
  20. SPDRP_DEVICEDESC
  21. SPDRP_DEVTYPE
  22. SPDRP_DRIVER
  23. SPDRP_ENUMERATOR_NAME
  24. SPDRP_EXCLUSIVE
  25. SPDRP_FRIENDLYNAME
  26. SPDRP_HARDWAREID
  27. SPDRP_INSTALL_STATE
  28. SPDRP_LEGACYBUSTYPE
  29. SPDRP_LOCATION_INFORMATION
  30. SPDRP_LOCATION_PATHS
  31. SPDRP_LOWERFILTERS
  32. SPDRP_MFG
  33. SPDRP_PHYSICAL_DEVICE_OBJECT_NAME
  34. SPDRP_REMOVAL_POLICY
  35. SPDRP_REMOVAL_POLICY_HW_DEFAULT
  36. SPDRP_REMOVAL_POLICY_OVERRIDE
  37. SPDRP_SECURITY
  38. SPDRP_SECURITY_SDS
  39. SPDRP_SERVICE
  40. SPDRP_UI_NUMBER
  41. SPDRP_UI_NUMBER_DESC_FORMAT
  42. SPDRP_UPPERFILTERS
  43. Return value
  44. Remarks

Error SetupDiGetDeviceRegistryPropertyW: 122 #830

Hi, I don’t know what I’m doing wrong. As far as I know I have all the prerequisites. I will try reinstalling/repairing them all, but I get this error message:
Error Calling SetupDiGetDeviceRegistryPropertyW: 122

This is for GTA 5, I have tried both the X86 and x64, this is on x64, which I believe the game to be.

Is there anything I’m missing? Please help 🙂 I tried looking this up and haven’t found anything similar, but I might have not looked hard enough and if so I’m sorry for asking again.

I’ve also tested administrator privelege and compatability.

The exception text seems to be related to the program, but I’m unsure of what it means.

Details:

The text was updated successfully, but these errors were encountered:

Try new version from here: #818

Thank you for fixing my comment, and thank you for your help. It seems the new version has fixed my issue. It doesn’t like being open on one of my monitors but that’s okay. You’re awesome 🙂

Still not working brother. before somedays it was working well and goo. please help

I have the same problem then I downloaded the older version (more stable) of x360ce from here check this out! https://steamcommunity.com/sharedfiles/filedetails/?id=859052855

@EJocys
This seems to be problem in in this function:

private static string GetStringPropertyForDevice ( IntPtr deviceInfoSet , SP_DEVINFO_DATA deviceInfoData , SPDRP propId )

Error 122 is ERROR_INSUFFICIENT_BUFFER, so it seems buffer is too small . try to add sizeof current char type.

An older version of x360ce, 4.10.0.0 solved Error SetupDiGetDeviceRegistryPropertyW: 122 for me:

@EJocys
Cela semble être un problème dans cette fonction:

private static string GetStringPropertyForDevice ( IntPtr deviceInfoSet , SP_DEVINFO_DATA deviceInfoData , SPDRP propId )

L’erreur 122 est ERROR_INSUFFICIENT_BUFFER, il semble donc que la mémoire tampon est trop petite . essayez d’ajouter la taille du type de caractère actuel.

Bonjour, comment faire donc pour libérer la mémoire tampon?

@EJocys
if (outsize > 0) should be before var buffer = new byte[outsize]; because is outsize is 0 there .

It was fixed in v4.13.41.0 (2020-09-10) i.e. code returns empty string if no description:

Try XOutput. It’ll save you the stress.

It was fixed in v4.13.41.0 (2020-09-10) i.e. code returns empty string if no description:

@EJocys , Its an old topic, but can you also make the fix for version 3.2 ?
latest version 4 works correct on my Pinball Cabinet, but my front end doesn’t want to work with it.
Version 3.2 always worked, but properly with a Windows update it screwed something and not able to use the xinput1_x.dll anymore.
I tried to completly reinstall my cabinet with W11 and add all your dependencies, but after pluging in my pinscape controller I directly get the error «system.Exception: Error calling SetupDiGetDeviceRegistryPropertyW: 122»
Or is this something I can check/fix in registry as well ?

I hope you can fix this, or point me to the regkey where I can make a manual fix

122 is ERROR_INSUFFICIENT_BUFFER — this can happen, and this is normal operation — SetupDiGetDeviceRegistryPropertyW will return then required buffer size in RequiredSize argument.
In most cases apps will call this 2 times — one to get the size and secund one to data.

I think i see a problem:
var buffer = new byte[requiredSize];
buffer is to smal as it is WCHAR, you need to multiply it by char type size @EJocys

Источник

4.9.0 — Mouse and keyboard stopped responding #940

Nice work with the software, thanks.

I don’t know if it’s a coincidence or not, but I’ve just downloaded 4.9.0 and, shortly after I’ve opened it (and, I don’t know if it’s relevant, tried to move it to another monitor), my mouse and keyboard stopped answering completely. My mouse light even turned off. I thought the PC had frozen and I restarted it without messing with the USB connections or anything, as soon as it started rebooting the mouse’s light and the keyboard was working again.

I’m now downloading the 3.x version, I might try 4.X again later and post here if it happens again.

Just to let you know.

The text was updated successfully, but these errors were encountered:

Also not sure if it’s relevant, but this popped up as soon as I opened 3.x:

Connected on USB:

  • Mouse Razer Abyssus
  • Keyboard and Mouse Wireless Kit Logitech K270
  • Steering Wheel Logitech Driving Force EX

Yes, it happened again. Just opened 4.x to test and same thing happened.

It starts out alright, but shortly after the inputs become readonly , the mouse/keyboard freezes, left me with a reboot as only option.

In 3.X, even though that exception pops up (which doesn’t happen on 4.x), mouse and keyboard does not freeze.

Hey buddy, I can do a TeamViewer session if would like, just let me know.

Same for me. 3.x versions still works with old games, though.
Mouse — Steelseries Sensei [RAW]
Logitech K220 (keyboard and mouse with one radio)
Pads — some noname chinese twin joysticks. two pads with one radio.

Seems like something wrong with logitech devices. With only steelseries mouse and joysticks works fine

After having configured joystick I connected logitech kb and everything worked fine

@sniper02z I use a Logitech K270 keyboard and a Razer Abyssus mouse

So, have you tried to run the program with uplugged logitech keyboard?

User error / has masked the wrong devices with hid guardian.

© 2023 GitHub, Inc.

You can’t perform that action at this time.

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.

Источник

Код ошибки 122 с использованием SetupDiGetDeviceRegistryPropertyW для получения требуемого размера

Я хочу получить идентификатор устройства USB-накопителя с помощью Setup API, но сначала я пытаюсь понять некоторые функции, которые мне нужно использовать. В документации SetupDiGetDeviceRegistryProperty сказано, что я могу отправить NULL в буфер и размер буфера, чтобы получить требуемый размер, но я получаю код ошибки 122 , что означает:

The data area passed to a system call is too small

Кто-нибудь может сказать мне, что я делаю не так?

Предполагается, что с этой ошибкой произойдет сбой. Теперь вы знаете requiredSize, поэтому вы выделяете буфер, достаточно большой, чтобы вызвать его снова, теперь передавая значение, отличное от NULL, для 5-го аргумента. Особенность, а не ошибка.

Чтобы добавить к тому, что сказал @HansPassant, это довольно распространенный шаблон Windows API. Предположим, что вместо передачи NULL и нуля вы передали действительный указатель и длину 200 но запрошенным данным требовали 400 байтов. Вы получите ту же ошибку «слишком малая», а для requiredSize будет установлено значение 400. Передача NULL и нуля — это просто простой способ вызвать эту ошибку, поэтому вы получите набор переменных requiredSize .

Ох, я понял. Я думал, что получу другой код ошибки в результате, когда он будет вызван с NULL и 0 . Большое спасибо, тогда никаких ошибок.

Возможно, вы слишком поздно звоните в GetLastError . Вам нужно вызвать его сразу после входа в состояние, в котором он возвращает значимое значение, и не позже.

@IInspectable, не могли бы вы показать мне, куда мне положить GetLastError ?

Сделайте это единым заявлением и переместите его за пределы ваших вызовов fwprintf .

Источник

SetupDiGetDeviceRegistryPropertyA function (setupapi.h)

The SetupDiGetDeviceRegistryProperty function retrieves a specified Plug and Play device property.

Syntax

Parameters

A handle to a device information set that contains a device information element that represents the device for which to retrieve a Plug and Play property.

A pointer to an SP_DEVINFO_DATA structure that specifies the device information element in DeviceInfoSet.

One of the following values that specifies the property to be retrieved:

SPDRP_ADDRESS

The function retrieves the device’s address.

SPDRP_BUSNUMBER

The function retrieves the device’s bus number.

SPDRP_BUSTYPEGUID

The function retrieves the GUID for the device’s bus type.

SPDRP_CAPABILITIES

The function retrieves a bitwise OR of the following CM_DEVCAP_Xxx flags in a DWORD. The device capabilities that are represented by these flags correspond to the device capabilities that are represented by the members of the DEVICE_CAPABILITIES structure. The CM_DEVCAP_Xxx constants are defined in Cfgmgr32.h.

CM_DEVCAP_Xxx flag Corresponding DEVICE_CAPABILITIES structure member
CM_DEVCAP_LOCKSUPPORTED LockSupported
CM_DEVCAP_EJECTSUPPORTED EjectSupported
CM_DEVCAP_REMOVABLE Removable
CM_DEVCAP_DOCKDEVICE DockDevice
CM_DEVCAP_UNIQUEID UniqueID
CM_DEVCAP_SILENTINSTALL SilentInstall
CM_DEVCAP_RAWDEVICEOK RawDeviceOK
CM_DEVCAP_SURPRISEREMOVALOK SurpriseRemovalOK
CM_DEVCAP_HARDWAREDISABLED HardwareDisabled
CM_DEVCAP_NONDYNAMIC NonDynamic

В

SPDRP_CHARACTERISTICS

The function retrieves a bitwise OR of a device’s characteristics flags in a DWORD. For a description of these flags, which are defined in Wdm.h and Ntddk.h, see the DeviceCharacteristics parameter of the IoCreateDevice function.

SPDRP_CLASS

The function retrieves a REG_SZ string that contains the device setup class of a device.

SPDRP_CLASSGUID

The function retrieves a REG_SZ string that contains the GUID that represents the device setup class of a device.

SPDRP_COMPATIBLEIDS

The function retrieves a REG_MULTI_SZ string that contains the list of compatible IDs for a device. For information about compatible IDs, see Device Identification Strings.

SPDRP_CONFIGFLAGS

The function retrieves a bitwise OR of a device’s configuration flags in a DWORD value. The configuration flags are represented by the CONFIGFLAG_Xxx bitmasks that are defined in Regstr.h.

SPDRP_DEVICE_POWER_DATA

(Windows XP and later) The function retrieves a CM_POWER_DATA structure that contains the device’s power management information.

SPDRP_DEVICEDESC

The function retrieves a REG_SZ string that contains the description of a device.

SPDRP_DEVTYPE

The function retrieves a DWORD value that represents the device’s type. For more information, see Specifying Device Types.

SPDRP_DRIVER

The function retrieves a string that identifies the device’s software key (sometimes called the driver key). For more information about driver keys, see Registry Trees and Keys for Devices and Drivers.

SPDRP_ENUMERATOR_NAME

The function retrieves a REG_SZ string that contains the name of the device’s enumerator.

SPDRP_EXCLUSIVE

The function retrieves a DWORD value that indicates whether a user can obtain exclusive use of the device. The returned value is one if exclusive use is allowed, or zero otherwise. For more information, see IoCreateDevice.

SPDRP_FRIENDLYNAME

The function retrieves a REG_SZ string that contains the friendly name of a device.

SPDRP_HARDWAREID

The function retrieves a REG_MULTI_SZ string that contains the list of hardware IDs for a device. For information about hardware IDs, see Device Identification Strings.

SPDRP_INSTALL_STATE

(Windows XP and later) The function retrieves a DWORD value that indicates the installation state of a device. The installation state is represented by one of the CM_INSTALL_STATE_Xxx values that are defined in Cfgmgr32.h. The CM_INSTALL_STATE_Xxx values correspond to the DEVICE_INSTALL_STATE enumeration values.

SPDRP_LEGACYBUSTYPE

The function retrieves the device’s legacy bus type as an INTERFACE_TYPE value (defined in Wdm.h and Ntddk.h).

SPDRP_LOCATION_INFORMATION

The function retrieves a REG_SZ string that contains the hardware location of a device.

SPDRP_LOCATION_PATHS

(Windows Server 2003 and later) The function retrieves a REG_MULTI_SZ string that represents the location of the device in the device tree.

SPDRP_LOWERFILTERS

The function retrieves a REG_MULTI_SZ string that contains the names of a device’s lower-filter drivers.

SPDRP_MFG

The function retrieves a REG_SZ string that contains the name of the device manufacturer.

SPDRP_PHYSICAL_DEVICE_OBJECT_NAME

The function retrieves a REG_SZ string that contains the name that is associated with the device’s PDO. For more information, see IoCreateDevice.

SPDRP_REMOVAL_POLICY

(Windows XP and later) The function retrieves the device’s current removal policy as a DWORD that contains one of the CM_REMOVAL_POLICY_Xxx values that are defined in Cfgmgr32.h.

SPDRP_REMOVAL_POLICY_HW_DEFAULT

(Windows XP and later) The function retrieves the device’s hardware-specified default removal policy as a DWORD that contains one of the CM_REMOVAL_POLICY_Xxx values that are defined in Cfgmgr32.h.

SPDRP_REMOVAL_POLICY_OVERRIDE

(Windows XP and later) The function retrieves the device’s override removal policy (if it exists) from the registry, as a DWORD that contains one of the CM_REMOVAL_POLICY_Xxx values that are defined in Cfgmgr32.h.

SPDRP_SECURITY

The function retrieves a SECURITY_DESCRIPTOR structure for a device.

SPDRP_SECURITY_SDS

The function retrieves a REG_SZ string that contains the device’s security descriptor. For information about security descriptor strings, see Security Descriptor Definition Language (Windows). For information about the format of security descriptor strings, see Security Descriptor Definition Language (Windows).

SPDRP_SERVICE

The function retrieves a REG_SZ string that contains the service name for a device.

SPDRP_UI_NUMBER

The function retrieves a DWORD value set to the value of the UINumber member of the device’s DEVICE_CAPABILITIES structure.

SPDRP_UI_NUMBER_DESC_FORMAT

The function retrieves a format string (REG_SZ) used to display the UINumber value.

SPDRP_UPPERFILTERS

The function retrieves a REG_MULTI_SZ string that contains the names of a device’s upper filter drivers.

[out, optional] PropertyRegDataType

A pointer to a variable that receives the data type of the property that is being retrieved. This is one of the standard registry data types. This parameter is optional and can be NULL.

[out, optional] PropertyBuffer

A pointer to a buffer that receives the property that is being retrieved. If this parameter is set to NULL, and PropertyBufferSize is also set to zero, the function returns the required size for the buffer in RequiredSize.

The size, in bytes, of the PropertyBuffer buffer.

[out, optional] RequiredSize

A pointer to a variable of type DWORD that receives the required size, in bytes, of the PropertyBuffer buffer that is required to hold the data for the requested property. This parameter is optional and can be NULL.

Return value

SetupDiGetDeviceRegistryProperty returns TRUE if the call was successful. Otherwise, it returns FALSE and the logged error can be retrieved by making a call to GetLastError. SetupDiGetDeviceRegistryProperty returns the ERROR_INVALID_DATA error code if the requested property does not exist for a device or if the property data is not valid.

The setupapi.h header defines SetupDiGetDeviceRegistryProperty as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for Function Prototypes.

Источник

I downloaded the latest version of x360ce. But when I try to run I’m facing with this error message:

Error calling SetupDiGetDeviceRegistryPropertyW: 122.

This doesn’t happen with the older versions (but these old versions didn’t work with the Ancestors game). I have also installed the latest .NET Framework. How can I get this to work? Or are there any other alternatives? This is on Windows 10.

galacticninja's user avatar

galacticninja

44.1k95 gold badges289 silver badges535 bronze badges

asked Oct 12, 2019 at 4:15

Trax's user avatar

An older version of the x360 emulator would do it. Search for x360 v 4.10 and the System.Exception: Error calling SetupDiGetDeviceRegistryPropertyW: 122 will be solved

answered Aug 3, 2020 at 1:13

Favour's user avatar

An older version of x360ce, version 4.10.0.0 solved the issue for me:

answered Jun 15, 2020 at 11:25

gamer powered up's user avatar

1

You must log in to answer this question.

Not the answer you’re looking for? Browse other questions tagged

.

I want to get the Device ID of a USB stick by using the Setup API, but first I am trying to understand some of the functions I have to use. The SetupDiGetDeviceRegistryProperty documentation says I can send NULL to the buffer and buffer size to get the required size, but I am getting the 122 error code, which means:

The data area passed to a system call is too small

Can anyone tell me what am I doing wrong?

Here is my code so far:

#include <Windows.h>
#include <wchar.h>
#include <SetupAPI.h>

#pragma comment(lib, "Setupapi.lib")

int wmain(int argc, wchar_t *arv[])
{
    // SetupDiGetClassDevs
    HDEVINFO hDeviceInfo;
    DWORD filterDevInfo = DIGCF_ALLCLASSES;

    hDeviceInfo = SetupDiGetClassDevsW(NULL, NULL, NULL, filterDevInfo);

    if (hDeviceInfo != INVALID_HANDLE_VALUE)
    {
        // SetupDiEnumDeviceInfo
        DWORD memberIndex = 0;
        SP_DEVINFO_DATA devInfoData;

        devInfoData.cbSize = sizeof(SP_DEVINFO_DATA);

        if (!SetupDiEnumDeviceInfo(
            hDeviceInfo,
            memberIndex,
            &devInfoData))
        {
            fwprintf(stderr, L"Error on enum: %un", GetLastError());
            return 1;

        }

        // SetupDiGetDeviceRegistryProperty
        DWORD propertyRetrieved = SPDRP_DEVICEDESC;
        DWORD requiredSize;

        // First call to get the required size for the buffer

        if (!SetupDiGetDeviceRegistryPropertyW(
            hDeviceInfo,
            &devInfoData,
            propertyRetrieved,
            NULL,
            NULL,
            0,
            &requiredSize))
        {
            fwprintf(stderr, L"Error on registry property: %un", GetLastError());
            return 1;

        }

    }
    else
    {
        wprintf(L"Error code: %un", GetLastError());
        return 1;
    }

    return 0;
}

R

I did a lot of research, and here are the results. Damage type is in the top left corner of each chart. Separate rows for each number of blast resistance upgrades and separate columns for each number of crit resistance upgraded. Tested each for, normal heavy, Demoman with Charging Targe Shield and Fists of Steel.

The damage is calculated by tf2 as follows. The damage of a crit pipe is separated into crit damage and normal damage, then each resistance is applied, then both valued are added together, then weapon/buffbanner/VACmedic resistances are applied.

From this we also learn that for non-crit damage the first resistance upgrade only reduces dmg by 25% compared to no upgrade. 2 upgrades reduce dmg by 33% compared to 1 upgrade. And 3 upgrades reduce dmg by 50% compared to 2 upgrades.
So logically, whatever it is you’re upgrading (like blast resistance), make sure to upgrade it all the way, before upgrading something else (like bullet resistance). Upgrading a damage resistance only once is probably a waste of credits, as they will be better spent elsewhere (like speed, to dodge rockets, or health regen). If you have 1200 credits, its much better to upgrade 3x blast and 1x bullet (or 1x blast and 3x bullet) than 2x blast and 2x bullet.
If there are crit soldier robots or crit heavy robots approaching always upgrade crits 3x (not 2x or 1x). If you only have 1050 credits, it would be wiser to upgrade crit 3x and blast 2x, instead of blast 3x and crit 1x. If non-crit robots are the bigger threat, obviously upgrade blast 3x.
One more thing, I noticed a bug for pyro. Bullet resistances will reduce pyros self fire damage in the same way as fire resistance does. And the effect is even stacked. Very useful to know if you like to jump around the map with detonator and jump height upgrade and don’t fancy taking 45 damage with every blast. For consistency reasons this chart is for the scorch shot:

silky eya

silky eya

2 года назад

pls does it support 32bit game


Omar Khaled

Omar Khaled

1 неделя назад

thx man it working😉


Umutcan Ayas

Umutcan Ayas

1 неделя назад

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa


Umutcan Ayas

Umutcan Ayas

1 неделя назад

Allah razı olsun


The Nomes

The Nomes

3 недели назад

bro, after so many days, I’m looking for video tutorial on this problem, I can’t find it. finally I searched again and again, and finally got your video which is very helpful and it works 100%. i am very proud. thank you very much. you are the best. stay healthy


Billy Messimer

Billy Messimer

3 недели назад

same shit as everyone else but does not do anything with that error and my controller still not showing up


SELAM

SELAM

1 месяц назад

adamsın Allah razı olsun senden Allah ne muradın varsa versin Allah tutuğunu altın etsin


Phantom Gamer

Phantom Gamer

1 месяц назад

Thankyou so much brooo


sibi raj

sibi raj

1 месяц назад

Mine got crashed


Deemx

Deemx

1 месяц назад

makasih bg


JSw0rd_YT

JSw0rd_YT

1 месяц назад

music


Klevor Art

Klevor Art

1 месяц назад

I have gone through video like for 5hrs but ur has saved me bless up fam🤝


Lingga Archieve

Lingga Archieve

2 месяца назад

It work on game Nier Automata, Thank you


Steffie Law

Steffie Law

2 месяца назад

Tetep g bisa bang gw padahal dah ikutin step dengan bener tapi tetep aja g bisa, di controllernya gak berubah warnanya bang


Gilang Pratama adji

Gilang Pratama adji

2 месяца назад

Game jump force not work


Rahul Rai

Rahul Rai

2 месяца назад

What about 2nd controller


Fazza Gaming

Fazza Gaming

2 месяца назад

thanks dude work for me


Harena V1.0

Harena V1.0

3 месяца назад

x360ce gta v not working


Harena V1.0

Harena V1.0

3 месяца назад

x360ce not detecting ps3 controller


Sauvik Paul

Sauvik Paul

3 месяца назад

tons of thanks man… really a life saver


Я хочу получить идентификатор устройства USB-накопителя с помощью Setup API, но сначала я пытаюсь понять некоторые функции, которые мне нужно использовать. В документации SetupDiGetDeviceRegistryProperty сказано, что я могу отправить NULL в буфер и размер буфера, чтобы получить требуемый размер, но я получаю код ошибки 122, что означает:

The data area passed to a system call is too small

Кто-нибудь может сказать мне, что я делаю не так?

Вот мой код:

#include <Windows.h>
#include <wchar.h>
#include <SetupAPI.h>

#pragma comment(lib, "Setupapi.lib")

int wmain(int argc, wchar_t *arv[])
{
    // SetupDiGetClassDevs
    HDEVINFO hDeviceInfo;
    DWORD filterDevInfo = DIGCF_ALLCLASSES;

    hDeviceInfo = SetupDiGetClassDevsW(NULL, NULL, NULL, filterDevInfo);

    if (hDeviceInfo != INVALID_HANDLE_VALUE)
    {
        // SetupDiEnumDeviceInfo
        DWORD memberIndex = 0;
        SP_DEVINFO_DATA devInfoData;

        devInfoData.cbSize = sizeof(SP_DEVINFO_DATA);

        if (!SetupDiEnumDeviceInfo(
            hDeviceInfo,
            memberIndex,
            &devInfoData))
        {
            fwprintf(stderr, L"Error on enum: %un", GetLastError());
            return 1;

        }

        // SetupDiGetDeviceRegistryProperty
        DWORD propertyRetrieved = SPDRP_DEVICEDESC;
        DWORD requiredSize;

        // First call to get the required size for the buffer

        if (!SetupDiGetDeviceRegistryPropertyW(
            hDeviceInfo,
            &devInfoData,
            propertyRetrieved,
            NULL,
            NULL,
            0,
            &requiredSize))
        {
            fwprintf(stderr, L"Error on registry property: %un", GetLastError());
            return 1;

        }

    }
    else
    {
        wprintf(L"Error code: %un", GetLastError());
        return 1;
    }

    return 0;
}

Понравилась статья? Поделить с друзьями:
  • Error calling protect method on socket 30 times
  • Error calling post перевод
  • Error calling post wattpad
  • Error calling method on npobject
  • Error calling kernel32 dll createdirectory