d3b6026bfd
- Filled empty libs/hbb_common/ submodule (cloned from rustdesk/hbb_common) - Patched Flutter 3.44 / Dart 3.12 compatibility: * flutter/lib/generated_bridge.dart: asTypedList with cast<>, DartPort=Int64 * flutter/lib/common.dart: DialogTheme->DialogThemeData, TabBarTheme->TabBarThemeData * flutter/pubspec.yaml: extended_text 14.0.0->15.0.2, google_fonts override 5.0.0 * flutter/macos/Runner/Configs/Release.xcconfig: EXCLUDED_ARCHS=x86_64 - Build verified: cargo check + cargo build --features flutter + cargo build --release --features flutter - Verified flutter build macos --debug and --release both produce working .app - Verified .dmg installer (27MB arm64) created via hdiutil - Build deps: Xcode 26.5, CocoaPods 1.16.2, Flutter 3.44, VCPKG arm64-osx
42 lines
1.2 KiB
Dart
42 lines
1.2 KiB
Dart
import 'dart:ffi' hide Size;
|
|
|
|
import 'package:ffi/ffi.dart';
|
|
|
|
import 'package:win32/win32.dart' as win32;
|
|
|
|
/// Get windows target build number.
|
|
///
|
|
/// [Note]
|
|
/// Please use this function wrapped with `Platform.isWindows`.
|
|
int getWindowsTargetBuildNumber_() {
|
|
final rtlGetVersion = DynamicLibrary.open('ntdll.dll').lookupFunction<
|
|
Void Function(Pointer<win32.OSVERSIONINFOEX>),
|
|
void Function(Pointer<win32.OSVERSIONINFOEX>)>('RtlGetVersion');
|
|
final osVersionInfo = _getOSVERSIONINFOEXPointer();
|
|
rtlGetVersion(osVersionInfo);
|
|
int buildNumber = osVersionInfo.ref.dwBuildNumber;
|
|
calloc.free(osVersionInfo);
|
|
return buildNumber;
|
|
}
|
|
|
|
/// Get Windows OS version pointer
|
|
///
|
|
/// [Note]
|
|
/// Please use this function wrapped with `Platform.isWindows`.
|
|
Pointer<win32.OSVERSIONINFOEX> _getOSVERSIONINFOEXPointer() {
|
|
final pointer = calloc<win32.OSVERSIONINFOEX>();
|
|
pointer.ref
|
|
..dwOSVersionInfoSize = sizeOf<win32.OSVERSIONINFOEX>()
|
|
..dwBuildNumber = 0
|
|
..dwMajorVersion = 0
|
|
..dwMinorVersion = 0
|
|
..dwPlatformId = 0
|
|
..szCSDVersion = ''
|
|
..wServicePackMajor = 0
|
|
..wServicePackMinor = 0
|
|
..wSuiteMask = 0
|
|
..wProductType = 0
|
|
..wReserved = 0;
|
|
return pointer;
|
|
}
|