public string [] GetValueNames (RegistryKey rkey)
{
IntPtr handle = GetHandle (rkey);
ArrayList values = new ArrayList ();
for (int index = 0; true; index ++)
{
StringBuilder buffer = new StringBuilder (BufferMaxLength);
int bufferCapacity = buffer.Capacity;
RegistryValueKind type = 0;
int result = RegEnumValue (handle, index, buffer, ref bufferCapacity,
IntPtr.Zero, ref type, IntPtr.Zero, IntPtr.Zero);
if (result == Win32ResultCode.Success || result == Win32ResultCode.MoreData) {
values.Add (buffer.ToString ());
continue;
}
if (result == Win32ResultCode.NoMoreEntries)
break;
if (result == Win32ResultCode.MarkedForDeletion)
throw RegistryKey.CreateMarkedForDeletionException ();
GenerateException (result);
}
return (string []) values.ToArray (typeof(String));
}