Func prototype:
foo(_out_ PSIZE_T arg);
Usage:
LARGE_INTEGER offset = {0};
foo(&offset.QuadPart); // Is it safe ?
Reference: http://msdn.microsoft.com/en-us/library/windows/desktop/aa383713(v=vs.85).aspx
That documentation defines QuadPart as LONGLONG. This defines LONGLONG as a . This defines __int64
in 64bit and double
in 32 bitLONGLONG
as __int64
.
If you compile for 32 bit, then it's definitely wrong, as size_t is an unsigned 32bit integer there. If you compile for 64 bit, it's still wrong, because size_t is an unsigned int and LONGLONG is signed.
So it's not correct in 64 bit either, because LONGLONG is signed and size_t is unsigned, as Steve noted.
Your compiler should flag it as an error anyway.