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

(0021416)
davedelage (reporter)2017-03-25 20:00

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

(0021423)
davedelage (reporter)2017-04-18 18:41

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."

(0021522)
obones (administrator)2018-07-18 15:53

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.

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.

(0021653)
obones (administrator)2019-03-20 09:02

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

(0021737)
mh (reporter)2019-04-25 21:25

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

(0021745)
obones (administrator)2019-04-26 09:51

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.

(0021755)
mh (reporter)2019-04-27 13:26

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.