|
@@ -23,7 +23,7 @@ String getMachineGuid() {
|
|
|
} finally {
|
|
} finally {
|
|
|
_Native.RegCloseKey(hkey);
|
|
_Native.RegCloseKey(hkey);
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ }).replaceAll(RegExp(r'[\u0000-\u001F\u007F]'), '').trim();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
class _Native {
|
|
class _Native {
|
|
@@ -31,21 +31,36 @@ class _Native {
|
|
|
static final _advapi32 = DynamicLibrary.open('Advapi32.dll');
|
|
static final _advapi32 = DynamicLibrary.open('Advapi32.dll');
|
|
|
|
|
|
|
|
// Define the RegOpenKeyExW function signature
|
|
// Define the RegOpenKeyExW function signature
|
|
|
- static final _RegOpenKeyExA = _advapi32.lookupFunction<
|
|
|
|
|
- Int32 Function(IntPtr, Pointer<Utf8>, Uint32, Uint32, Pointer<IntPtr>),
|
|
|
|
|
- int Function(
|
|
|
|
|
- int, Pointer<Utf8>, int, int, Pointer<IntPtr>)>('RegOpenKeyExA');
|
|
|
|
|
|
|
+ static final _RegOpenKeyExA = _advapi32
|
|
|
|
|
+ .lookupFunction<
|
|
|
|
|
+ Int32 Function(IntPtr, Pointer<Utf8>, Uint32, Uint32, Pointer<IntPtr>),
|
|
|
|
|
+ int Function(int, Pointer<Utf8>, int, int, Pointer<IntPtr>)
|
|
|
|
|
+ >('RegOpenKeyExA');
|
|
|
|
|
|
|
|
// Define the RegCloseKey function signature
|
|
// Define the RegCloseKey function signature
|
|
|
static final _RegCloseKey = _advapi32
|
|
static final _RegCloseKey = _advapi32
|
|
|
.lookupFunction<Int32 Function(IntPtr), int Function(int)>('RegCloseKey');
|
|
.lookupFunction<Int32 Function(IntPtr), int Function(int)>('RegCloseKey');
|
|
|
|
|
|
|
|
// Define the RegQueryValueExW function signature
|
|
// Define the RegQueryValueExW function signature
|
|
|
- static final _RegQueryValueExA = _advapi32.lookupFunction<
|
|
|
|
|
- Int32 Function(IntPtr, Pointer<Utf8>, Pointer<IntPtr>, Pointer<Uint32>,
|
|
|
|
|
- Pointer<Uint8>, Pointer<Uint32>),
|
|
|
|
|
- int Function(int, Pointer<Utf8>, Pointer<IntPtr>, Pointer<Uint32>,
|
|
|
|
|
- Pointer<Uint8>, Pointer<Uint32>)>('RegQueryValueExA');
|
|
|
|
|
|
|
+ static final _RegQueryValueExA = _advapi32
|
|
|
|
|
+ .lookupFunction<
|
|
|
|
|
+ Int32 Function(
|
|
|
|
|
+ IntPtr,
|
|
|
|
|
+ Pointer<Utf8>,
|
|
|
|
|
+ Pointer<IntPtr>,
|
|
|
|
|
+ Pointer<Uint32>,
|
|
|
|
|
+ Pointer<Uint8>,
|
|
|
|
|
+ Pointer<Uint32>,
|
|
|
|
|
+ ),
|
|
|
|
|
+ int Function(
|
|
|
|
|
+ int,
|
|
|
|
|
+ Pointer<Utf8>,
|
|
|
|
|
+ Pointer<IntPtr>,
|
|
|
|
|
+ Pointer<Uint32>,
|
|
|
|
|
+ Pointer<Uint8>,
|
|
|
|
|
+ Pointer<Uint32>,
|
|
|
|
|
+ )
|
|
|
|
|
+ >('RegQueryValueExA');
|
|
|
|
|
|
|
|
// Define the HKEY_LOCAL_MACHINE constant
|
|
// Define the HKEY_LOCAL_MACHINE constant
|
|
|
static const _HKEY_LOCAL_MACHINE = 0x80000002;
|
|
static const _HKEY_LOCAL_MACHINE = 0x80000002;
|