LPSTR to PBYTE

J

James Kanze

DWORD has always confused me a little bit. Like Michael I
always remembered DWORD to be a typedef for unsigned int and
will remain 32 bits even on a 64 bit arch.

Back when I did use it, DWORD was 64 bits (8 bytes). The
standard nomenclature (invented by IBM), is BYTE, HWORD, WORD
and DWORD, for 8, 16 32 and 64 bits respectively. And
signedness didn't matter, because this was back in the days of
assembler.

In C++, if you want a specific size, the "standard" types are
int8_t/uint8_t, int16_t/uint16_t, etc.
 
J

James Kanze

I'm not sure who we is.
The most portable solution when a fixed width type is required
(which isn't that often) is the standard C
int[8|16|32|64]_t types.


Outside of IBM assembler (where DWORD is 64 bits), the only time
I use DWORD is when I don't want a fixed size---at least one
established by me. I want the same time that the function in
<windows.h> returns.
 
E

Evil's Toy

Dilip said:
DWORD has always confused me a little bit. Like Michael I always
remembered DWORD to be a typedef for unsigned int and will remain 32
bits even on a 64 bit arch. Why then do we have a DWORD32 datatype?
There is even a DWORD64 datatype but that at least makes sense.

DWORD: http://msdn.microsoft.com/en-us/library/cc230318(PROT.10).aspx

Hm DWORD, BYTE, WORD came from 16 bit x86 assembler, intel syntax.
So better they stick with semantics we get from intel assembler,
or there would be problems...

Greets
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,163
Latest member
Sasha15427
Top