Alexander's Blog

Sharing knowledge with the global IT community since November 1, 2004

Using DWORD vs. QWORD When Adding Values to Windows Registry

/
/
Windows 10

When you are working with the Windows 10 registry, you may have seen instructions telling you to add a REG_DWORD (32-bit) Value. You can also add a REG_QWORD (64-bit) Value. When you add a new value, the options look like the following.

Windows Registry Values - DWORD vs. QWORD

In this article, I want to explain the difference between the two, in case you are wondering when to use one or the other.

DWORD (32-bit) vs. QWORD (64-bit)

First of all, I just want to make it clear that whether to use DWORD (32-bit) value or QWORD (64-bit) value has absolutely nothing to do with your Windows 10 version (32-bit vs. 64-bit). When you store data under a registry, you have to specify certain values and the type of data that is being stored. For example, the REG_DWORD value can store a type of data that’s a 32-bit number and REG_QWORD value can store a type of data that’s a 64-bit number. These numbers (32-bit or 64-bit) do not correspond to the Windows 10 operating systems. They represent the type of data that will be stored in a value. The REG-DWORD value stores a 32-bit number and REG_QWORD value stores a 64-bit number.

You should simply follow the instructions given to you in a document. If the instructions say to use DWORD then you use DWORD, if the instructions say to use QWORD then you use QWORD. So you shouldn’t confuse them with the type of Windows 10 operating system (32-bit or 64-bit). Most of the entries you will see in Windows 10 registry are DWORD (32-bit) and most of the Windows 10 operating systems in use these days are Windows 64-bit.

The following table describes the Windows registry values and types. Visit this Microsoft document for more details, including explanation of String Values and Byte Formats.

Windows Registry Values and Types
Value Type
REG_BINARY Binary data in any form.
REG_DWORD A 32-bit number.
REG_DWORD_LITTLE_ENDIAN A 32-bit number in little-endian format.
Windows is designed to run on little-endian computer architectures. Therefore, this value is defined as REG_DWORD in the Windows header files.
REG_DWORD_BIG_ENDIAN A 32-bit number in big-endian format.
Some UNIX systems support big-endian architectures.
REG_EXPAND_SZ A null-terminated string that contains unexpanded references to environment variables (for example, “%PATH%”). It will be a Unicode or ANSI string depending on whether you use the Unicode or ANSI functions. To expand the environment variable references, use the ExpandEnvironmentStrings function.
REG_LINK A null-terminated Unicode string that contains the target path of a symbolic link that was created by calling the RegCreateKeyEx function with REG_OPTION_CREATE_LINK.
REG_MULTI_SZ A sequence of null-terminated strings, terminated by an empty string (\0).
The following is an example:
String1\0String2\0String3\0LastString\0\0
The first \0 terminates the first string, the second to the last \0 terminates the last string, and the final \0 terminates the sequence. Note that the final terminator must be factored into the length of the string.
REG_NONE No defined value type.
REG_QWORD A 64-bit number.
REG_QWORD_LITTLE_ENDIAN A 64-bit number in little-endian format.
Windows is designed to run on little-endian computer architectures. Therefore, this value is defined as REG_QWORD in the Windows header files.
REG_SZ A null-terminated string. This will be either a Unicode or an ANSI string, depending on whether you use the Unicode or ANSI functions.

Windows Registry Best Practices

There are a few things about the Windows registry you should always remember:

  1. Back up your registry before making any changes.
  2. Anything you enter in the registry is case-sensitive, hyphen-sensitive, etc. So enter the values and data exactly as you see in the instructions.
  3. Although it’s not common, incorrect entries or changes to the Windows registry can potentially corrupt the registry and render your computer unusable. Therefore, ideally you first want to back up your computer, and then backup your registry before you make any changes to the registry.
Thanks for reading my article. If you are interested in IT training & consulting services, please reach out to me. Visit ZubairAlexander.com for information on my professional background.

Copyright © 2020 SeattlePro Enterprises, LLC. All rights reserved.

  • Facebook
  • Twitter
  • Linkedin

8 Comments

  1. It’s not true that 64 bit hardware can only run a 64 bit OS. You can still install 32 bit win10 on current hardware. There’s just not much reason to do so, unless you need to run 16 bit code, which win10 64 bit can’t do.

  2. @Jonathan: Nice catch! Of course, 64-bit hardware (CPU) can run both 64-bit and 32-bit OS and applications. The second part of the sentence at the end of the second paragraph was incorrect, but I’ve deleted that entire sentence because it was not necessary. Thank you for taking the time to point out the error. I really appreciate it.

  3. In the Windows 10, 7 and XP registry when I try to set the Base of a key to the Decimal mode, after I click OK and open the key again, I see it return to the Hexadecimal mode … I bring it to the Decimal, it goes to the Hexadecimal again! What’s the problem?

  4. @Kavoos: There’s no problem with the registry. The Hexadecimal is the default setting, so even if you switch to Decimal to enter the value data, the Base automatically switches back to Hexadecimal when you reopen the entry. You don’t need to worry about this because the correct value is still there, and you can easily verify that.

    The decimal numbering system is a Base-10 system, while the hexadecimal is a Base-16 system. The hexadecimal system uses 16 different digits with a combination of numbers from 0 to 15. If you enter a number between 0 and 9 in the Registry Editor, the digital and hexadecimal values are the same. If you enter decimal 10, it will display the hexadecimal equivalent of 10, which is the letter “A.” You can verify that your decimal value of 10 is still there by selecting the Decimal radio button. The hexadecimal equivalent for 11 is B, 12 is C, 13 is D, 14 is E, and 15 is F. The pattern changes starting decimal 16, and so on. Visit https://www.rapidtables.com/convert/number/decimal-to-hex.html to view decimal to hexadecimal conversion table. You can also use the online table to enter any decimal number to hexadecimal, or vice versa.

  5. In the Windows 10, 7 and XP registry when I try to set the Base of a key to the Decimal mode, after I click OK and open the key again, I see it return to the Hexadecimal mode … I bring it to the Decimal, it goes to the Hexadecimal again! What’s the problem?
    What should I do to keep the key on the decimal?
    Which file is the database of this key?

  6. @Kavoos: I’ve already answered your question in detail on January 27, 2022. Please see my comments in response to your original question.

Leave a Comment

Your email address will not be published. Required fields are marked *

This div height required for enabling the sticky sidebar