RegQueryInfoKey (coredll)
Last changed: anonymous

.
Summary
Retrieves information about a specified registry key.

C# Signature:

[DllImport("coredll.dll")]
public static extern int RegQueryInfoKey(
   IntPtr hKey, [Out()]StringBuilder lpClass, ref uint lpcchClass,
   IntPtr lpReserved, out uint lpcSubkey, out uint lpcchMaxSubkeyLen,
   out uint lpcchMaxClassLen, out uint lpcValues, out uint lpcchMaxValueNameLen,
   out uint lpcbMaxValueLen, IntPtr lpSecurityDescriptor, IntPtr lpftLastWriteTime);

User-Defined Types:

None.

Notes:

The .NET Compact Framework does not contain a HandleRef type, so it may be necessary to call GC.KeepAlive after calling this function if the calling class wraps the hKey parameter as an unmanaged resource.

OutAttribute is used with StringBuilder parameters because StringBuilder is a reference type. Using the out keyword will result in passing the reference by-reference, but in this case the reference must be passed by-value.

Tips & Tricks:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Documentation