In your code you are using
_tcscpy() and _tcslen()
, but these functions will not work if you have non-ascii values within your structures, which you do (
int num1
for example).
In order for this to work you will need to calculate the length of your data in some other way, possibly by the
sizeof()
operator, or just counting the type and number of elementary items. You can then use a pointer to the start of your struct/union and cast it to a BYTE type, and send that to the SHA routine. There is little point in copying the data from one place to another just to change the casting, as this merely adds unnecessary overhead to your program.
wrote:
ps: my english is poor...sorry :(
But your explanation is still good. And you do not need to apologise for your English; I don't expect I can speak any of your native language.