Morning,

I have two ulong values blocks and LBA.

Code:
typedef struct _CAPACITY {
  ULONG LBA ;
  ULONG Blocks ;

} CAPACITY, *PCAPACITY;
And I can print them
Code:
printf("No of Logical block addresses        : %u  \n", wordSwap(receiveCapacity.LBA));
printf("length of blocks in bytes                : %u   \n", wordSwap(receiveCapacity.Blocks));

How does one multiply the values to get the total number of bytes on a disc? I've tried putting it into a few data types as I think the value "4,549,356,616" which is 4.23GB is too big for ULONG: Unsigned LONG. The range is 0 through 4294967295 decimal.

It has to be declared as ULONG from the MMC6 specs I'm working from.
wordswap reverses the byte order and it prints out fine.


Code:
ULONG Length_Bytes = wordSwap(recveiveCapacity.LBA) * wordSwap(recveiveCapacity.Blocks);
printf("\nLenth Bytes = %u", Length_Bytes);
= 254932992

I've tried using ulong64 and ulonglong.

Thanks!