[DllImport("advapi32.dll", SetLastError=true)]
static extern TODO RegConnectRegistry(TODO);
e.g.:
[DllImport("advapi32.dll", SetLastError = true)]
static extern long RegConnectRegistry(string lpmachineName, long hKey, out long phKResult);
Declare Auto Function RegConnectRegistry Lib "Advapi32" ( _
ByVal lpMachineName As String, _
ByVal hKey As IntPtr, _
ByRef phkResult As IntPtr _
) As Integer
None.
Windows.Win32.RegistryKey.OpenRemoteBaseKey
LONG RegConnectRegistry(
LPCTSTR lpMachineName,
HKEY hKey,
PHKEY phkResult
);
Please add some!
' static method
Public Shared Function OpenRemoteBaseKey(ByVal Hive As RegistryHive, ByVal RemotePC As String) As RegistryKey
Dim ret As Integer
Dim hRemoteKey As IntPtr
ret = RegConnectRegistry("\\" & RemotePC, New IntPtr(Hive), hRemoteKey)
If ret <> 0 Then
Throw New Win32Exception(ret)
End If
Dim ans As New RegistryKey
ans.IsRootHive = False
ans.hKey = hRemoteKey
Return ans
End Function