BUG: RegQueryValueEx()May Fail When lpszValueName Is NULL

Last reviewed: October 20, 1997
Article ID: Q175333
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with: - Microsoft Windows 95

SYMPTOMS

In certain circumstances, namely when you are accessing a remote registry key, passing NULL as the second parameter to RegQueryValueEx may cause that function to fail. In this case, GetLastError() will return error 14:

   Not enough storage is available to complete this operation

RESOLUTION

To workaround this, pass the NULL string ("") as the second parameter to RegQueryValueEx().

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.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Install Windows 95 on the client computer. Install Windows NT 4.0 on the server.

  2. Enable the Remote Registry Service on the Windows 95 client. Please see the following Knowledge Base article for further information:

    ARTICLE-ID: Q141460

       TITLE     : How to Install Remote Administration Services
    
    

  3. Invoke RegConnectRegistry() on the Windows 95 client computer to obtain a handle to a top-level key on the remote computer.

  4. Open a subkey via a call to RegOpenKeyEx().

  5. Attempt to read the default value of this key by passing NULL as the second parameter to RegQueryValueEx().

Results:

RegQueryValueEx() fails. GetLastError() returns 14.


Additional query words: win95
Keywords : BseRegistry
Version : WINNT:
Platform : Win95
Issue type : kbbug


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: October 20, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.