Help and Support

BUG: RegQueryValueEx() Fails When lpValueName Is NULL

Article ID:189782
Last Review:November 21, 2006
Revision:4.1
This article was previously published under Q189782
On This Page

SYMPTOMS

When you are accessing a remote registry key and you pass NULL as the second parameter to RegQueryValueEx, the function might fail. RegQueryValueEx returns 14:
Not enough storage is available to complete this operation.
NOTE: Remote registry access is not supported on Windows Millennium (Me) Edition.

Back to the top

RESOLUTION

Pass the NULL string ("") as the second parameter to RegQueryValueEx().

Back to the top

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

Back to the top

MORE INFORMATION

In the VC++ 4.2 Help documentation, the entry for the 2nd parameter passed to RegQueryValueEx reads:
lpszValueName Points to a null-terminated string specifying the name of the subkey of hkey for which a text string is retrieved. If lpszValueName is NULL or points to an empty string, RegQueryValueEx retrieves the value of hkey.
The VC++ 5.0 documentation does not mention anything about passing NULL or "" as the second parameter to RegQueryValueEx().

Back to the top

Steps to Reproduce the Behavior

1.Install Windows 95 on the client machine. Install Windows NT 4.0 on the server.
2.Enable the remote registry services on the client. For additional information about how to do this, please see the following article in the Microsoft Knowledge Base:
141460 (http://support.microsoft.com/kb/141460/EN-US/) How to Install Remote Administration Services
3.Invoke RegConnectRegistry() from the client to obtain a handle to a top-level key on the remote server.
4.Open a subkey through a call to RegOpenKeyEx().
5.Attempt to read the default value of this key by passing NULL as the second parameter to RegQueryValueEx().

Back to the top


APPLIES TO
Microsoft Win32 Application Programming Interface, when used with:
  Microsoft Windows 95
  Microsoft Windows 98 Standard Edition

Back to the top

Keywords: 
kbbug kbkernbase kbnofix kbregistry KB189782

Back to the top

Article Translations

 

Other Support Options

  • Contact Microsoft
    Phone Numbers, Support Options and Pricing, Online Help, and more.
  • Customer Service
    For non-technical assistance with product purchases, subscriptions, online services, events, training courses, corporate sales, piracy issues, and more.
  • Newsgroups
    Pose a question to other users. Discussion groups and Forums about specific Microsoft products, technologies, and services.