Re: TRegistry.WriteString. Character limit?

From: Ndi (Ndi_at_Ndi_dot_ro)
Date: 12/18/03


Date: Thu, 18 Dec 2003 04:32:54 +0200


> >Does anyone out there know if there is a limit to the length of a string
the
> >Windows Registry can handle?

  Depends on the OS.

  If data is quite large I suggest you write it to a file and just store the
path to it. True, MS suggests to storing under 2k but commercial apps store
tons, some up to 500k in a single key+subkeys.

  Also note that even though it explicitly recommends up to 2k, it also
recommends not storing :objects such as icons: for performance reasons. An
icon typically has 800 bytes. So the message is "Keep it down".

Quote:

      Platform SDK: Windows System Information

Registry Element Size Limits
The following are the size limits for the various registry elements.

  a.. The maximum size of a key name is 255 characters.
  b.. The maximum size of a value name is as follows:
    a.. Windows XP, Windows .NET Server: 16383 characters
    b.. Windows 2000: 260 ANSI characters or 16383 Unicode characters.
    c.. Windows 95/98/Me: 255 characters
  c.. Long values (more than 2048 bytes) should be stored as files with the
file names stored in the registry. This helps the registry perform
efficiently. The maximum size of a value is as follows:
    a.. Windows NT/2000/XP: Available memory.
    b.. Windows 95/98/Me: 16,300 bytes. There is a 64K limit for the total
size of all values of a key.

-- 
Andrei "Ndi" Dobrin
Brainbench MVP
www.Brainbench.com


Relevant Pages

  • NewestShareware.com Issue #89
    ... FileBoss for Windows ... Program Homepage/Download url ... In general users make a program execute at window startup by ... Adding programs to the Registry and WIN.INI file protects the program. ...
    (comp.software.shareware.announce)
  • Re: Windows XP home login/off
    ... How to Perform an In-Place Upgrade of Windows XP ... Click on How To Run a Repair Install ... registry has worked the 5 or 6 times I have seen this problem. ... The script will stop and ask you to hit enter to continue to load SCSI ...
    (microsoft.public.windowsxp.wmi)
  • [Full-disclosure] Miscrosoft Registry Editor 5.1/XP/2K long string key vulnerability
    ... The following are the size limits for the various registry elements. ... The maximum size of a key name is 255 characters. ... Windows Server 2003 and Windows XP: ...
    (Full-Disclosure)
  • RE: Windows 2000 RRAS and ipSEC /L2TP VPN
    ... How to Configure a L2TP/IPSec Connection Using Pre-shared Key Authentication ... This article contains information about modifying the registry. ... , Windows 2000 is compliant with IKE RFC ...
    (microsoft.public.win2000.networking)
  • RE: Networking and DOS attacks
    ... Windows has found 55 Critical System Errors... ... Install Repair Registry Pro. ... I have tracked all of these UDP port hits since 2001. ...
    (Security-Basics)