HOWTO: Troubleshoot Remote Registry Access on Windows 95/98

ID: Q193463

The information in this article applies to:

SYMPTOMS

This article describes several problems that can occur with remote registry access when one or more of the computers involved is running Windows 95 or Windows 98.

MORE INFORMATION

RegConnectRegistry() Fails with ERROR_ACCESS_DENIED

To troubleshoot this problem:

1. Make sure that the Remote Administration Services are installed on each

   of the Windows 95 or Windows 98 computers involved. For additional
   information, please see the following article in the Microsoft Knowledge
   Base:

   ARTICLE-ID: Q141460
   TITLE     : How to Install Remote Administration Services

2. On the remote machine that you are trying to connect to, make sure that
   remote administration is enabled. To check this, go to the Control
   Panel, open the Passwords dialog box, click the Remote Administration
   tab, and make sure the Enable Remote Administration check box is
   selected.

3. If the remote computer that you are trying to connect to is configured
   for user-level security, make sure that you are listed as a remote
   administrator. To check this, go to the Control Panel, open the
   Passwords dialog box, click the Remote Administration tab, and make sure
   you are listed in the Administrators list box.

RegConnectRegistry() Fails with ERROR_BAD_NETPATH

To troubleshoot this problem:

1. Make sure that the Remote Administration Services are installed on each

   of the Windows 95 or Windows 98 computers involved. For additional
   information, please see the following article in the Microsoft Knowledge
   Base:

   ARTICLE-ID: Q141460
   TITLE     : How to Install Remote Administration Services

2. On the remote computer that you are trying to connect to, make sure
   that remote administration is enabled. To check this, go to the Control
   Panel, open the Passwords dialog box, click the Remote Administration
   tab, and make sure the Enable Remote Administration check box is
   selected.

3. Make sure the computers are communicating through the same network
   protocol (for example, TCP/IP).

4. If you fail to connect to a remote Windows 9x registry after connecting
   to a remote Windows NT registry, try installing the IPX/SPX network
   protocol alongside the TCP/IP protocol, please see the following article
   in the Microsoft Knowledge Base:

   ARTICLE-ID: Q193464
   TITLE     : BUG: Windows 95/98 Fails to Connect to other Win 95/98
               Registry

RegQueryInfoKey() returns incorrect data

To troubleshoot this problem:

1. You should allocate a buffer twice as large as cbMaxSubKeyLen when

   accessing a remote Windows 95 or Windows 98 registry. When connected to
   a remote Windows 95 or Windows 98 registry, the cbMaxSubKeyLen parameter
   receives only half the actual length of the longest subkey of hKey. For
   additional information, please see the following article in the
   Microsoft Knowledge Base:

   ARTICLE-ID: Q193465
   TITLE     : BUG: RegQueryInfoKey Returns Length Div 2 for cbMaxSubKeyLen

2. When connected to a remote Windows NT registry, the size returned in
   cbMaxSubKeyLen includes the final NULL character, even though the API
   reference says it does not. This should not cause any serious problems,
   because it usually means that the allocated buffer is one byte too
   large. It can be a problem if strings are being compared based solely on
   buffer size.

NOTE: Item number two was a documentation error. The API behaves in this manner by design on Windows 95. The documents will be updated to reflect this in future releases of Visual Studio.

Additional query words:

Keywords          : kbKernBase kbRegistry 
Issue type        : kbhowto

Last Reviewed: October 2, 1998