Article ID: 176906 - View products that this article applies to.
This article was previously published under Q176906
This article has been archived. It is offered "as is" and will no longer be updated.
If you simultaneously access the same registry key from multiple threads in a single process, an error might occur. For example, if several threads in a carefully designed multi-threaded Win32 application try to open the same registry key using RegOpenKeyEx()in a loop, the function could fail with the following error code of 6:
This error does not occur across process boundaries. Thus, two single- threaded processes that are competing for the same registry key will not be affected by this bug.
This behavior is intermittent and is the result of a race condition between the threads simultaneously accessing the same registry key.
There are several possible workarounds for this situation:
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.
The following sample code illustrates the problem with the RegOpenKeyEx() function. Note that the error only happens intermittently with the following code.
Article ID: 176906 - Last Review: February 24, 2014 - Revision: 4.1