Jump to content
Tuts 4 You

Masm + Vc + Qword == &$#!"


Killboy

Recommended Posts

Posted

Heya :)

I just tried coding something in C++ which exports a function in a dll that takes an ULONGLONG param.

Now I was trying to create a MASM inc file for the prototypes.

The problem is that if I use Function PROTO STDCALL Value : QWORD

it seems to swap the lo and hi values.

This seems to be a problem with C++ where the low part of the qword is located at [offset] and the high part at [offset+4].

(Offset being the address of the qword)

AFAIK it's the other way around in MASM so I was looking for a data type that would behave the same...

Instead of having to use:

Function PROTO STDCALL ValueLow : DWORD, ValueHigh : DWORD

Or am I wrong and MASM does it the same way ? I've just seen a few sources where it is done differently, but I havent worked with QWORDs very much, let alone MASM :wacko:

Thanks in advance :)

Posted

Nevermind, I think I figured it out:

QWORD structure actually looks like this:

Lo-Value | Hi-Value

just like ULONGLONG for C++

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...