RegOpenKeyEx() returns Status 1450

G

Guest

I am experiencing a problem very similar to that described in
<http://support.microsoft.com/kb/q237304/>. It is similar in that I
periodically receive Status 1450 from RegOpenKeyEx(). Once this occurs the
HKLM\SOFTWARE Hive seem to be un-mounted. However my problem is occurring on
multiple platforms running various OS's including Win2k, XP-Home and XP-Pro.
The problem referenced above is stated to be an NT problem that was fixed in
Win2K.

My problem does not seem to be related to how many times I access a key,
rather with how long the application is open. In a test application I wrote
in an attempt to debug the problem I can access keys 100,000 times or more
without failure, but if I leave the application running for a few hours the
failure (usually) occurs.

I am using VB6. A snippet of the code where the problem occurs follows:


---Declaration Section---

Private Declare Function RegOpenKeyEx Lib "advapi32" Alias "RegOpenKeyExA" _
(ByVal hKey As Long, _
ByVal lpSubKey As String, _
ByVal ulOptions As Long, _
ByVal samDesired As Long, _
ByRef phkResult As Long) As Long


Private Function GetKeyValue(KeyRoot As Long, _
KeyName As String, _
SubKeyRef As String, _
ByRef KeyVal As String) As Boolean

Dim i As Long ' Loop Counter
Dim rc As Long ' Return Code
Dim hKey As Long ' Handle To An Open Registry Key
Dim hDepth As Long '
Dim KeyValType As Long ' Data Type Of A Registry Key
Dim tmpVal As String ' Tempory Storage For A Registry Key Value
Dim KeyValSize As Long ' Size Of Registry Key Variable
'------------------------------------------------------------
' Open RegKey Under KeyRoot {HKEY_LOCAL_MACHINE...}
'------------------------------------------------------------
rc = RegOpenKeyEx(KeyRoot, KeyName, 0, KEY_READ, hKey) ' Open Registry Key

If (rc <> ERROR_SUCCESS) Then GoTo GetKeyError ' Handle Error...

^^^^^When the problem is occuring rc returns 1450 here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top