Microsoft KB Archive/193463

{|
 * width="100%"|

HOWTO: Troubleshoot Remote Registry Access on Windows 95/98

 * }

Q193463

-

The information in this article applies to:


 * Microsoft Win32 Application Programming Interface (API), included with:
 * Microsoft Windows 95
 * Microsoft Windows 98

-

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.

RegConnectRegistry Fails with ERROR_ACCESS_DENIED
To troubleshoot this problem:

  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: "Q141460 How to Install Remote Administration Services" 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. 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:

  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: "Q141460 How to Install Remote Administration Services" 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. Make sure the computers are communicating through the same network protocol (for example, TCP/IP).  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: "Q193464 BUG: Windows 95/98 Fails to Connect to other Win 95/98 Registry"</li></ol>

RegQueryInfoKey returns incorrect data
To troubleshoot this problem:

  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: "Q193465 BUG: RegQueryInfoKey Returns Length Div 2 for cbMaxSubKeyLen"</li> 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.</li></ol>

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

Technology : kbAudDeveloper kbWin32sSearch kbWin32API