UDS-API parameter interpretation issue with x64 DLLs
Posted: Sat 29. Jun 2019, 16:40
Hi,
I've been playing around with the UDS-API and I've found an issue affecting the x64 DLLs and interpretation of parameters that differs from the x86 DLLs.
Test Scenario 1:
Both test cases use the same application code, but are compiled for different architectures. My expectation is that the resulting CAN communication from both test scenrios should be exactly the same.
Actual Result:
When comparing the test results from both test scenarios then the CAN communication differs in some cases:
x86 log:https://gist.github.com/Evilpaul/042d45 ... b710272487
x64 log:https://gist.github.com/Evilpaul/6a6b03 ... 042f798b3c
Analysing the differences then it appears that there is parameter interpretation issues on some x64 API calls:
The above list is not exhaustive and only covers those commands as tested in the sample app. I have also verfied the above using the C# interface and got the same results: https://github.com/Evilpaul/PCUClient
I've been playing around with the UDS-API and I've found an issue affecting the x64 DLLs and interpretation of parameters that differs from the x86 DLLs.
Test Scenario 1:
- PCAN-bASIC DLL version 4.3.3.239
- PCAN-ISO-TP DLL version 2.2.0.119
- PCAN-UDS DLL version 1.3.2.45
- Compile the C++ sample apps included in the PCAN-UDS package for 32bit
- Connect CAN channels 1 & 2 of PCAN-USB Pro FD with a physical connection and termination resistor
- Run x86 PCUServer and x86 PCUClient apps and log the CAN communication
- PCAN-bASIC DLL version 4.3.3.239
- PCAN-ISO-TP DLL version 2.2.0.119
- PCAN-UDS DLL version 1.3.2.45
- Compile the PCUClient C++ sample app included in the PCAN-UDS package for 64bit
- Connect CAN channels 1 & 2 of PCAN-USB Pro FD with a physical connection and termination resistor
- Run x86 PCUServer (from Test Scenario 1) and x64 PCUClient app and log the CAN communication
Both test cases use the same application code, but are compiled for different architectures. My expectation is that the resulting CAN communication from both test scenrios should be exactly the same.
Actual Result:
When comparing the test results from both test scenarios then the CAN communication differs in some cases:
x86 log:https://gist.github.com/Evilpaul/042d45 ... b710272487
x64 log:https://gist.github.com/Evilpaul/6a6b03 ... 042f798b3c
Analysing the differences then it appears that there is parameter interpretation issues on some x64 API calls:
- UDS_SvcReadScalingDataByIdentifier(TPUDSCANHandle CanChannel, TPUDSMsg * MessageBuffer, WORD DataIdentifier);
- UDS_SvcDynamicallyDefineDataIdentifierDBID(TPUDSCANHandle CanChannel, TPUDSMsg * MessageBuffer, WORD DynamicallyDefinedDataIdentifier, WORD * SourceDataIdentifier, BYTE * MemorySize, BYTE * PositionInSourceDataRecord, WORD BuffersLength);
- UDS_SvcDynamicallyDefineDataIdentifierDBMA(TPUDSCANHandle CanChannel, TPUDSMsg * MessageBuffer, WORD DynamicallyDefinedDataIdentifier, BYTE MemoryAddressLength, BYTE MemorySizeLength, BYTE * MemoryAddressBuffer, BYTE * MemorySizeBuffer, WORD BuffersLength);
- UDS_SvcDynamicallyDefineDataIdentifierCDDDI(TPUDSCANHandle CanChannel, TPUDSMsg * MessageBuffer, WORD DynamicallyDefinedDataIdentifier);
- UDS_SvcWriteDataByIdentifier(TPUDSCANHandle CanChannel, TPUDSMsg * MessageBuffer, WORD DataIdentifier, BYTE * Buffer, WORD BufferLength);
- UDS_SvcInputOutputControlByIdentifier(TPUDSCANHandle CanChannel, TPUDSMsg * MessageBuffer, WORD DataIdentifier, BYTE * ControlOptionRecord, WORD ControlOptionRecordLength, BYTE * ControlEnableMaskRecord, WORD ControlEnableMaskRecordLength);
- UDS_SvcRoutineControl(TPUDSCANHandle CanChannel, TPUDSMsg * MessageBuffer, BYTE RoutineControlType, WORD RoutineIdentifier, BYTE * Buffer, WORD BufferLength);
The above list is not exhaustive and only covers those commands as tested in the sample app. I have also verfied the above using the C# interface and got the same results: https://github.com/Evilpaul/PCUClient