@@ -10,7 +10,7 @@ internal static class Advapi32
1010 /// <summary>
1111 /// Predefined handle to the HKEY_CURRENT_USER root key.
1212 /// </summary>
13- public static readonly UIntPtr HKEY_CURRENT_USER = ( UIntPtr ) 0x80000001u ;
13+ public static readonly nuint HKEY_CURRENT_USER = 0x80000001u ;
1414
1515 /// <summary>
1616 /// Access right for querying key value data.
@@ -53,11 +53,11 @@ internal static class Advapi32
5353 /// <returns>Win32 error code. ERROR_SUCCESS indicates success.</returns>
5454 [ DllImport ( "advapi32.dll" , CharSet = CharSet . Unicode , SetLastError = true ) ]
5555 public static extern int RegOpenKeyEx (
56- UIntPtr hKey ,
56+ nuint hKey ,
5757 string lpSubKey ,
5858 int ulOptions ,
5959 int samDesired ,
60- out IntPtr phkResult ) ;
60+ out nint phkResult ) ;
6161
6262 /// <summary>
6363 /// Creates or opens the specified registry key.
@@ -68,20 +68,20 @@ public static extern int RegOpenKeyEx(
6868 /// <param name="lpClass">The user-defined class type for this key. Typically null.</param>
6969 /// <param name="dwOptions">Special options for key creation. Typically zero.</param>
7070 /// <param name="samDesired">The access rights requested for the key.</param>
71- /// <param name="lpSecurityAttributes">Security descriptor pointer. Typically IntPtr.Zero .</param>
71+ /// <param name="lpSecurityAttributes">Security descriptor pointer. Typically 0 .</param>
7272 /// <param name="phkResult">When successful, receives a handle to the opened or created key.</param>
7373 /// <param name="lpdwDisposition">Receives status indicating whether key was created or opened.</param>
7474 /// <returns>Win32 error code. ERROR_SUCCESS indicates success.</returns>
7575 [ DllImport ( "advapi32.dll" , CharSet = CharSet . Unicode , SetLastError = true ) ]
7676 public static extern int RegCreateKeyEx (
77- UIntPtr hKey ,
77+ nuint hKey ,
7878 string lpSubKey ,
7979 int Reserved ,
8080 string ? lpClass ,
8181 uint dwOptions ,
8282 int samDesired ,
83- IntPtr lpSecurityAttributes ,
84- out IntPtr phkResult ,
83+ nint lpSecurityAttributes ,
84+ out nint phkResult ,
8585 out uint lpdwDisposition ) ;
8686
8787 /// <summary>
@@ -96,7 +96,7 @@ public static extern int RegCreateKeyEx(
9696 /// <returns>Win32 error code. ERROR_SUCCESS indicates success.</returns>
9797 [ DllImport ( "advapi32.dll" , CharSet = CharSet . Unicode , SetLastError = true ) ]
9898 public static extern int RegSetValueEx (
99- IntPtr hKey ,
99+ nint hKey ,
100100 string lpValueName ,
101101 int Reserved ,
102102 uint dwType ,
@@ -115,7 +115,7 @@ public static extern int RegSetValueEx(
115115 /// <returns>Win32 error code. ERROR_SUCCESS indicates success.</returns>
116116 [ DllImport ( "advapi32.dll" , SetLastError = true ) ]
117117 public static extern int RegSetValueEx (
118- IntPtr hKey ,
118+ nint hKey ,
119119 string lpValueName ,
120120 int Reserved ,
121121 uint dwType ,
@@ -134,7 +134,7 @@ public static extern int RegSetValueEx(
134134 /// <returns>Win32 error code. ERROR_SUCCESS indicates success.</returns>
135135 [ DllImport ( "advapi32.dll" , CharSet = CharSet . Unicode , SetLastError = true ) ]
136136 public static extern int RegQueryValueEx (
137- IntPtr hKey ,
137+ nint hKey ,
138138 string lpValueName ,
139139 int lpReserved ,
140140 out uint lpType ,
@@ -149,7 +149,7 @@ public static extern int RegQueryValueEx(
149149 /// <returns>Win32 error code. ERROR_SUCCESS indicates success.</returns>
150150 [ DllImport ( "advapi32.dll" , CharSet = CharSet . Unicode , SetLastError = true ) ]
151151 public static extern int RegDeleteValue (
152- IntPtr hKey ,
152+ nint hKey ,
153153 string lpValueName ) ;
154154
155155 /// <summary>
@@ -158,5 +158,5 @@ public static extern int RegDeleteValue(
158158 /// <param name="hKey">A handle to an open registry key.</param>
159159 /// <returns>Win32 error code. ERROR_SUCCESS indicates success.</returns>
160160 [ DllImport ( "advapi32.dll" , SetLastError = true ) ]
161- public static extern int RegCloseKey ( IntPtr hKey ) ;
162- }
161+ public static extern int RegCloseKey ( nint hKey ) ;
162+ }
0 commit comments