Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ GetSubKeyNames()

string[] Internal.Win32.RegistryKey.GetSubKeyNames ( )
inline

Definition at line 66 of file RegistryKey.cs.

67 {
69 char[] array = ArrayPool<char>.Shared.Rent(256);
70 try
71 {
72 int lpcbName = array.Length;
73 int num;
74 while ((num = Interop.Advapi32.RegEnumKeyEx(_hkey, list.Count, array, ref lpcbName, null, null, null, null)) != 259)
75 {
76 if (num == 0)
77 {
78 list.Add(new string(array, 0, lpcbName));
79 lpcbName = array.Length;
80 }
81 else
82 {
83 Win32Error(num, null);
84 }
85 }
86 }
87 finally
88 {
89 ArrayPool<char>.Shared.Return(array);
90 }
91 return list.ToArray();
92 }
readonly SafeRegistryHandle _hkey
static void Win32Error(int errorCode, string str)
static int RegEnumKeyEx(SafeRegistryHandle hKey, int dwIndex, char[] lpName, ref int lpcbName, int[] lpReserved, [Out] char[] lpClass, int[] lpcbClass, long[] lpftLastWriteTime)
void Add(TKey key, TValue value)

References Internal.Win32.RegistryKey._hkey, System.Collections.Generic.Dictionary< TKey, TValue >.Add(), System.array, System.list, Interop.Advapi32.RegEnumKeyEx(), and Internal.Win32.RegistryKey.Win32Error().