File tree Expand file tree Collapse file tree
packages/share_plus/share_plus/lib/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import 'dart:io' ;
21import 'dart:ffi' ;
2+ import 'dart:io' ;
3+
34import 'package:ffi/ffi.dart' ;
45import 'package:win32/win32.dart' ;
56
@@ -18,24 +19,9 @@ class VersionHelper {
1819
1920 VersionHelper ._() {
2021 if (Platform .isWindows) {
21- final pointer = calloc <OSVERSIONINFOEX >();
22- pointer.ref
23- ..dwOSVersionInfoSize = sizeOf <OSVERSIONINFOEX >()
24- ..dwBuildNumber = 0
25- ..dwMajorVersion = 0
26- ..dwMinorVersion = 0
27- ..dwPlatformId = 0
28- ..szCSDVersion = ''
29- ..wServicePackMajor = 0
30- ..wServicePackMinor = 0
31- ..wSuiteMask = 0
32- ..wProductType = 0 ;
33- final rtlGetVersion = DynamicLibrary .open ('ntdll.dll' )
34- .lookupFunction<
35- Void Function (Pointer <OSVERSIONINFOEX >),
36- void Function (Pointer <OSVERSIONINFOEX >)
37- > ('RtlGetVersion' );
38- rtlGetVersion (pointer);
22+ final pointer = calloc <OSVERSIONINFOEX >()
23+ ..ref.dwOSVersionInfoSize = sizeOf <OSVERSIONINFOEX >();
24+ RtlGetVersion (pointer.cast ());
3925 isWindows10RS5OrGreater =
4026 pointer.ref.dwBuildNumber >= kWindows10RS5BuildNumber;
4127 calloc.free (pointer);
You can’t perform that action at this time.
0 commit comments