View Issue Details

IDProjectCategoryView StatusLast Update
0006549JEDI VCL00 JVCL Componentspublic2019-04-27 13:26
ReporterdavedelageAssigned To 
PrioritynormalSeveritycrashReproducibilityalways
Status feedbackResolutionopen 
Product Version3.48 
Target VersionFixed in Version 
Summary0006549: JvHidDeviceController fails
DescriptionJVCL version actually 3.49 but problem exists in earlier version.
Compiling example SimpleHidWrite using Rad Studio 2010 on Windows 8.1 and it works as advertised. Copy SimpleHidWrite.exe to alternate machine running Windows 8.1 Pro or Windows 10 and executable fails during startup with exception "Device cannot be identified."

Specifically, in the 8.1 Pro machine, EControllerError in module SimpleHidWrite.exe at 000CBA49 Device cannot be identified.

Getting the same problem with my USB/HID code which works in 8.1 but not others. Attempting to trace leads to the idea that the problem is thread related. Compiled file attached.
TagsNo tags attached.

Activities

2017-03-07 00:26

 

SimpleHIDWrite.exe (1,241,088 bytes)

obones

2017-03-24 17:37

administrator   ~0021414

Please use the latest GIT content, many changes have occurred in this area

davedelage

2017-03-25 20:00

reporter   ~0021416

Thank you. I downloaded the most recent source (JVCL3-Source-2017-03-25). Since the problem appears in the USB/HID application, I checked hid.pas, hidtoken.pas and hidusage.pas against the 3.49 release using WinMerge. It reports all the new files are identical to their older versions. Could it have been fixed somewhere else?
Dave

davedelage

2017-04-18 18:41

reporter   ~0021423

I found this info when looking at a separate issue, perhaps it will help someone smarter than me find the problem with the JvHidDeviceController component code.

"FPC [or other language] currently uses 32 bits (4 bytes) for integers, whether the machine is a 32-bit or 64-bit machine. This will cause code expecting an integer and a pointer to be the same size to fail as a 64bit machine uses 64-bit pointers."

obones

2018-07-18 15:53

administrator   ~0021522

Could you check if the issue is still present in the latest GIT content? If yes, please provide the zipped sources of an application showing this.

mh

2019-03-07 21:32

reporter   ~0021622

Is this the same as this one?
http://issuetracker.delphi-jedi.org/view.php?id=6664

mh

2019-03-19 20:02

reporter   ~0021652

About this one:
"FPC [or other language] currently uses 32 bits (4 bytes) for integers, whether the machine is a 32-bit or 64-bit machine. This will cause code expecting an integer and a pointer to be the same size to fail as a 64bit machine uses 64-bit pointers."

Does FPC have NativeInt or NativePtr datatypes? If yes that might be a solution to this issue at least for newer Delphi versions.

obones

2019-03-20 09:02

administrator   ~0021653

Yes, FPC has NativeInt
And considering compatibility with older versions, the JvJCLUtils declares NativeInt properly for compiler versions where it is missing/bogus

mh

2019-04-25 21:25

reporter   ~0021737

So do you propose to switch the code of JvHidDeviceController to NativeInt or NativePtr where applicable?

obones

2019-04-26 09:51

administrator   ~0021745

I strongly believe that this has nothing to do with the issue at hand.
The 32/64 pointer size is only valid if the application itself is 64bits.
If the same application works on a computer, and not on another one, 32 versus 64 is definitely not an issue but rather an issue with drivers or windows version.

Now, if inside JvHidDeviceController there is code that casts pointers (or handles) to Cardinal/LongInt/Integer, then this is an issue that needs to be fixed by using a NativeInt cast instead.

mh

2019-04-27 13:26

reporter   ~0021755

I had a short look at this unit now and didn't spot any suspicious casts. So the issue seems to really originate from somewhere else.

Issue History

Date Modified Username Field Change
2017-03-07 00:26 davedelage New Issue
2017-03-07 00:26 davedelage File Added: SimpleHIDWrite.exe
2017-03-24 17:37 obones Note Added: 0021414
2017-03-24 17:37 obones Status new => feedback
2017-03-25 20:01 davedelage Note Added: 0021416
2017-04-18 18:41 davedelage Note Added: 0021423
2018-07-18 15:53 obones Note Added: 0021522
2019-03-07 21:32 mh Note Added: 0021622
2019-03-19 20:02 mh Note Added: 0021652
2019-03-20 09:02 obones Note Added: 0021653
2019-04-25 21:25 mh Note Added: 0021737
2019-04-26 09:51 obones Note Added: 0021745
2019-04-27 13:26 mh Note Added: 0021755