Since your return parameter `size` is a 32-bit integer, this code is either not necessary or insufficient to cover file sizes that exceed the range of a 32-bit unsigned int (ie. 4,294,967,295 bytes -- which is just shy of 4Gb file size).

The quick resolution, ignoring files larger than 4Gb, would be to just use 'nFileSizeLow', which would be the low-order 32-bit value.  So, delete lines 674-676 and just say `size = fad.nFileSizeHigh;`.  Of course, this means that your returned file size would be wrong if the file was greater than 4Gb -- probably not a very common scenario.

To be completely correct, you need to either pass the size as a 64-bit unsigned int (`uint64`), although I'm not sure that JS will handle that.

Alternatively, you could check whether `nFileSizeHigh` is non-zero, and then return an error from this method which signals that the file size exceeds the input parameter.