Discussion:
LPDWORD, 32 or 64 bit?
(too old to reply)
T
2020-04-01 02:01:10 UTC
Permalink
Hi All,

As far as Windows API calls are concerned, is LPDWORD
(long pointer to DWORD) as 32 bit or 64 bit value?

Many thanks,
-T
T
2020-04-01 04:20:03 UTC
Permalink
Post by T
Hi All,
As far as Windows API calls are concerned, is LPDWORD
(long pointer to DWORD) as 32 bit or 64 bit value?
Many thanks,
-T
It is 32 bit
JJ
2020-04-01 13:41:21 UTC
Permalink
Post by T
Hi All,
As far as Windows API calls are concerned, is LPDWORD
(long pointer to DWORD) as 32 bit or 64 bit value?
Many thanks,
-T
LPxxx is a 64-bit value for 64-bit process, and 32-bit value for 32-bit
process.
R.Wieser
2020-04-01 15:25:03 UTC
Permalink
JJ,
Post by JJ
LPxxx is a 64-bit value for 64-bit process, and 32-bit value for
32-bit process.
Several sources do not agree with you there:

https://en.wikipedia.org/wiki/Word_(computer_architecture)

https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types

In short: a DWORD is, even on a 64-bit machine, 32 bits wide.

However, the size of the Long is variable. On a 64-bit machine a LPDWORD
would be a 64-bit pointer to a 32-bit piece of data.

Regards,
Rudy Wieser
JJ
2020-04-02 08:22:07 UTC
Permalink
Post by R.Wieser
JJ,
Post by JJ
LPxxx is a 64-bit value for 64-bit process, and 32-bit value for
32-bit process.
https://en.wikipedia.org/wiki/Word_(computer_architecture)
https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types
In short: a DWORD is, even on a 64-bit machine, 32 bits wide.
However, the size of the Long is variable. On a 64-bit machine a LPDWORD
would be a 64-bit pointer to a 32-bit piece of data.
Regards,
Rudy Wieser
You misunderstood. I never mention anything about the DWORD. I only
mentioned the "LP" part of the symbol. Meaning that it's a pointer of any
value type. And the value of a pointer (i.e. the pointer itself; not the
value it points to) depends on the bitness of the process.
T
2020-04-02 08:33:53 UTC
Permalink
Post by JJ
Post by R.Wieser
JJ,
Post by JJ
LPxxx is a 64-bit value for 64-bit process, and 32-bit value for
32-bit process.
https://en.wikipedia.org/wiki/Word_(computer_architecture)
https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types
In short: a DWORD is, even on a 64-bit machine, 32 bits wide.
However, the size of the Long is variable. On a 64-bit machine a LPDWORD
would be a 64-bit pointer to a 32-bit piece of data.
Regards,
Rudy Wieser
You misunderstood. I never mention anything about the DWORD. I only
mentioned the "LP" part of the symbol. Meaning that it's a pointer of any
value type. And the value of a pointer (i.e. the pointer itself; not the
value it points to) depends on the bitness of the process.
I am getting away with using it as 32 bits for API calls
JJ
2020-04-02 15:02:56 UTC
Permalink
Post by T
Post by JJ
Post by R.Wieser
JJ,
Post by JJ
LPxxx is a 64-bit value for 64-bit process, and 32-bit value for
32-bit process.
https://en.wikipedia.org/wiki/Word_(computer_architecture)
https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types
In short: a DWORD is, even on a 64-bit machine, 32 bits wide.
However, the size of the Long is variable. On a 64-bit machine a LPDWORD
would be a 64-bit pointer to a 32-bit piece of data.
Regards,
Rudy Wieser
You misunderstood. I never mention anything about the DWORD. I only
mentioned the "LP" part of the symbol. Meaning that it's a pointer of any
value type. And the value of a pointer (i.e. the pointer itself; not the
value it points to) depends on the bitness of the process.
I am getting away with using it as 32 bits for API calls
If you're making a 32-bit application, that is fine. I do that too.

However, if the code also need to be compilable to 64-bit program, then the
width of a pointer value type need to be considered. This includes structure
field alignment - which may affect the size of the whole structure.
R.Wieser
2020-04-02 10:56:08 UTC
Permalink
This post might be inappropriate. Click to display it.
Bonita Montero
2020-04-01 17:35:52 UTC
Permalink
Post by T
As far as Windows API calls are concerned, is LPDWORD
(long pointer to DWORD) as 32 bit or 64 bit value?
LPDWORD is a pointer which is 32 or 64 bit depending on if you are
running a 32- or 64-bit-program. But the data-wordl it points to is
32 bit.
Loading...