Partager via


Using the RetryOpenServiceWithReadAccess Fix

Applies To: Windows 7, Windows Vista

This section includes information about using the RetryOpenServiceWithReadAccess compatibility fix, including the issue details, the intercepted APIs, and the recommended fix for a permanent solution.

RetryOpenServiceWithReadAccess

RetryOpenServiceWithReadAccess fixes an issue whereby an application attempts to open a service by requesting SERVICES_ALL_ACCESS or GENERIC_ALL. Due to the increased security in the Windows Vista operating system, this can cause issues as even administrators do not always have write permissions to a service.

This compatibility fix intercepts the ERROR_ACCESS_DENIED returned value and if the user is an administrator, will attempt to retry the call by requesting GENERIC_READ.

Investigating the Issue

Application-related issues that can be resolved by applying the RetryOpenServiceWithReadAccess fix are typically detected by using the Standard User Analyzer (SUA) tool, which is provided by the Application Compatibility Toolkit (ACT). SUA can detect if there are issues with the OpenService* APIs. However, it does not include automatic fixes for this issue.

Intercepted APIs

The following APIs are intercepted by the RetryOpenServiceWithReadAccess compatibility fix.

  • OpenServiceA

  • OpenServiceW

Fixing Your Code

Applications should be modified to demand only the minimal amount of permissions required for an action. This modification can be done by changing the call to the OpenService* API.

See Also

Concepts

Windows Vista and Windows 7 Operating Systems