News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

C to MASM type definition conversion

Started by jdoe, August 30, 2007, 06:14:41 AM

Previous topic - Next topic

jdoe

Hi,

I'd like to hear from you what you would choose for these types. I can't be sure which one is the good one for x86 platform.



time_t TYPEDEF DWORD
time_t TYPEDEF QWORD

size_t TYPEDEF DWORD
size_t TYPEDEF QWORD

POINTER_64_INT TYPEDEF DWORD
POINTER_64_INT TYPEDEF QWORD

KSPIN_LOCK_QUEUE_NUMBER TYPEDEF DWORD
KSPIN_LOCK_QUEUE_NUMBER TYPEDEF QWORD




By the way, if you didn't knew, I'm working on a Windows 5.0 to 6.0 SDK translation for MASM.
Windows DDK is included but only for 2000/XP/2003 because I can't get the hand on Vista DDK.

I use types definition for building the correct structures and the one above are the only ones that cause me problems.

Thanks

Tedd

'time_t' and 'size_t' are meant to be the native sizes for these types - so dwords for 32-bit, and qwords for 64-bit.
Same reasoning for 'kspin_lock_queue_number' (the maximum length of a kernel spin-lock queue?)
'pointer_64_int' falls out as "unsigned __int64" when '_M_IA64' is defined, and "unsigned long" otherwise.
So it's DWORDs for 32-bit, and QWORDs for 64-bits!
No snowflake in an avalanche feels responsible.

jdoe


Thanks a lot Tedd.  I thought I would be stuck with these for a while.

:dance: