1
2
3
4
5 package oshi.driver.windows.wmi;
6
7 import java.util.Objects;
8
9 import com.sun.jna.platform.win32.COM.WbemcliUtil.WmiQuery;
10 import com.sun.jna.platform.win32.COM.WbemcliUtil.WmiResult;
11
12 import oshi.annotation.concurrent.ThreadSafe;
13 import oshi.util.platform.windows.WmiQueryHandler;
14
15
16
17
18 @ThreadSafe
19 public final class Win32ComputerSystemProduct {
20
21 private static final String WIN32_COMPUTER_SYSTEM_PRODUCT = "Win32_ComputerSystemProduct";
22
23
24
25
26 public enum ComputerSystemProductProperty {
27 IDENTIFYINGNUMBER, UUID;
28 }
29
30 private Win32ComputerSystemProduct() {
31 }
32
33
34
35
36
37
38 public static WmiResult<ComputerSystemProductProperty> queryIdentifyingNumberUUID() {
39 WmiQuery<ComputerSystemProductProperty> identifyingNumberQuery = new WmiQuery<>(WIN32_COMPUTER_SYSTEM_PRODUCT,
40 ComputerSystemProductProperty.class);
41 return Objects.requireNonNull(WmiQueryHandler.createInstance()).queryWMI(identifyingNumberQuery);
42 }
43 }