Is there any Win32 API which return the return values both in EAX and EDX? Or twice DWORD return values are always returned in memory operand(s)? I've asked in C/C++ forum but I haven't got satisfactory answer.

Posted on 2003-06-13 08:22:17 by MazeGen
EAX is the only register used by Win32 APIs for returning information, either data or error codes. Any data larger than 32 bits would need to be returned to a memory location generally specified by the user.

However, ECX and EDX are free to be trashed by any of the APIs. If their content needs to be used after the API call, that data must be preserved before the call and restored as needed.

Posted on 2003-06-13 08:53:38 by Raymond
In win32 you always get eax as return value. If you have quadword values you are asked for a pointer
Posted on 2003-06-13 08:54:44 by greenant
I don't know of any API functions that return QWORDs or REAL8s.

Any API function would follow VC++ conventions.
A disassembly of some simple VC++ functions shows the following:

REAL8 is returned on the FP stack.

QWORD is returned with low DWORD in EAX and high DWORD in EDX.
Posted on 2003-06-13 15:46:44 by tenkey
GetFileSize returns the low DWORD in EAX and the high DWORD in the memory pointed to by lpFileSizeHigh.

For others, search the PSDK for "LONGLONG" or "LARGE_INTEGER", there are a bunch of them.
Posted on 2003-06-13 17:01:41 by iblis
I think M$, intended not to make a API functions to return __int64 values because many compilers don't support __int64. VB, as an example, cannot support integer values of 8 bytes (it's their product).

I found just 1 function that returns __int64 and its name is GetFrameTimeStamp.
Posted on 2003-06-14 03:56:53 by rxbagain