A DWORD is a 32-bit unsigned integer (range: 0 through 4294967295 decimal). Because a DWORD is unsigned, its first bit (Most Significant Bit (MSB)) is not reserved for signing.
Questions tagged [dword]
153 questions
159
votes
3 answers
What does `dword ptr` mean?
Could someone explain what this means? (Intel Syntax, x86, Windows)
and dword ptr [ebp-4], 0

小太郎
- 5,510
- 6
- 37
- 48
157
votes
4 answers
Why in C++ do we use DWORD rather than unsigned int?
I'm not afraid to admit that I'm somewhat of a C++ newbie, so this might seem like a silly question but....
I see DWORD used all over the place in code examples. When I look up what a DWORD truly means, its apparently just an unsigned int (0 to…

dreadwail
- 15,098
- 21
- 65
- 96
57
votes
4 answers
How large is a DWORD with 32- and 64-bit code?
In Visual C++ a DWORD is just an unsigned long that is machine, platform, and SDK dependent. However, since DWORD is a double word (that is 2 * 16), is a DWORD still 32-bit on 64-bit architectures?

Haim Bender
- 7,937
- 10
- 53
- 55
36
votes
7 answers
Should DWORD map to int or uint?
When translating the Windows API (including data types) into P/Invoke, should I replace DWORD with int or uint?
It's normally unsigned, but I see people using int everywhere instead (is it just because of the CLS warning? even the .NET Framework…

user541686
- 205,094
- 128
- 528
- 886
26
votes
3 answers
What is the point WORD type in C?
In going through some source code, I found a method in a C program that takes an arguments of the types WORD, DWORD, and PWORD. I know they translate to unsigned numbers, but why are they called WORD?

Nealon
- 2,213
- 6
- 26
- 40
21
votes
2 answers
Set-ItemProperty sets Registry Value as String on some systems instead of DWord, why?
I try to create an item using Set-ItemProperty in PowerShell, which works on most systems:
New-PSDrive -name HKCR -PSProvider Registry -root HKEY_CLASSES_ROOT
Set-ItemProperty -Path HKCR:\Software\MyCompany\ -Name Level -Value 5 -ErrorAction…

Erik
- 2,316
- 9
- 36
- 58
18
votes
2 answers
dword ptr usage confusion
In assembly language if we use
mov eax, dword ptr[ebx]
then it means copy the value pointed by ebx (ebx contains the address value, not the actual value, this instruction copies the actual value in the address)?
If we use
mov eax, dword…

George2
- 44,761
- 110
- 317
- 455
10
votes
5 answers
Why are DWORD values commonly represented in Hexadecimal?
I am trying to understand why a DWORD value is often described in Hexadecimal on MSDN.
The reason why I am analyzing this is because I am trying to understand fundamentally why all these different number data types exist. A local mentor alluded to…

GreeneCreations
- 1,072
- 1
- 9
- 20
7
votes
2 answers
C# Registry Subkey dword value
Im making a program that sees if a subkey in Registry exist and, if it doesnt exist it will create a subkey with a value (dword). This program is being create to replace a .bat file that people (non programmers) had to run to execute the .reg file…

jeyejow
- 419
- 1
- 5
- 15
6
votes
1 answer
How can you calculate a factor if you have the other factor and the product with overflows?
a * x = b
I have a seemingly rather complicated multiplication / imul problem: if I have a and I have b, how can I calculate x if they're all 32-bit dwords (e.g. 0-1 = FFFFFFFF, FFFFFFFF+1 = 0)?
For example:
0xcb9102df * x = 0x4d243a5d
In that…

Lupe
- 319
- 1
- 3
- 16
6
votes
2 answers
batch regex the output of reg query command to a variable
summary
I need to be able to find the DWORD value of a registry key and set a variable to it to run an if statement against it.
how can i grab just the dword of a reg query so that i can work with it in the rest of my script?
reg query
reg query…

toosweetnitemare
- 2,226
- 8
- 33
- 44
6
votes
1 answer
Reading DWORD values from registry using WiX's RegistrySearch
I've created an installer with WiX and am trying to preserve an existing DWORD registry entry during a repair installation of my product. To store the existing values, I am using the following WiX fragment;

Chris McAtackney
- 5,192
- 8
- 45
- 69
5
votes
2 answers
Why do I get a different value at run-time when type-casting a string to DWORD?
std::cout << (DWORD)"test";
If I compile and run this I get different output values each time, but I can't figure out why.
Any ideas?
PS: I'm using Windows 7 64-bit and I'm compiling with Microsoft Visual C++ 2010 Ultimate.

Purebe
- 147
- 2
- 9
5
votes
3 answers
DWORD variable with low/high word and low/high byte
How in C can we read and make DWORD variables with a low and high word and low and high byte?

Midas
- 7,012
- 5
- 34
- 52
5
votes
4 answers
Help deciphering a few lines of assembly
I have found these few lines of assembly in ollydbg:
MOV ECX,DWORD PTR DS:[xxxxxxxx] ; xxxxxxxx is an address
MOV EDX,DWORD PTR DS:[ECX]
MOV EAX,DWORD PTR DS:[EDX+116]
CALL EAX
Could someone step through and tell me what's happening here?

Iron
- 153
- 1
- 1
- 4