]> glassweightruler.freedombox.rocks Git - Ventoy.git/commitdiff
[Ventoy2Disk.exe] improve Windows edition reporting
authorlongpanda <admin@ventoy.net>
Fri, 29 Oct 2021 01:28:20 +0000 (09:28 +0800)
committerlongpanda <admin@ventoy.net>
Fri, 29 Oct 2021 01:28:20 +0000 (09:28 +0800)
INSTALL/Ventoy2Disk.exe
Ventoy2Disk/Ventoy2Disk/DiskService_vds.c
Ventoy2Disk/Ventoy2Disk/Utility.c

index 895af0342d36ae6f222b7b41cf5de12c60dcb5c7..e8bd61c7034d59a5be462b92583ea69937ca93c2 100644 (file)
Binary files a/INSTALL/Ventoy2Disk.exe and b/INSTALL/Ventoy2Disk.exe differ
index 49479b6d594f5f0c2b2de4d6e8eeeab43e15bc7d..763ab0351584f2fe268a9757c11145268f9b738a 100644 (file)
@@ -608,7 +608,7 @@ STATIC IVdsService * VDS_InitService(void)
     if (hr != S_OK) \r
     {\r
         VDS_SET_ERROR(hr);\r
     if (hr != S_OK) \r
     {\r
         VDS_SET_ERROR(hr);\r
-        Log("Could not create VDS Loader Instance: %u", LASTERR);\r
+        Log("Could not create VDS Loader Instance: 0x%x", LASTERR);\r
         return NULL;\r
     }\r
 \r
         return NULL;\r
     }\r
 \r
@@ -618,7 +618,7 @@ STATIC IVdsService * VDS_InitService(void)
     if (hr != S_OK) \r
     {\r
         VDS_SET_ERROR(hr);\r
     if (hr != S_OK) \r
     {\r
         VDS_SET_ERROR(hr);\r
-        Log("Could not load VDS Service: %u", LASTERR);\r
+        Log("Could not load VDS Service: 0x%x", LASTERR);\r
         return NULL;\r
     }\r
 \r
         return NULL;\r
     }\r
 \r
@@ -627,7 +627,7 @@ STATIC IVdsService * VDS_InitService(void)
     if (hr != S_OK) \r
     {\r
         VDS_SET_ERROR(hr);\r
     if (hr != S_OK) \r
     {\r
         VDS_SET_ERROR(hr);\r
-        Log("VDS Service is not ready: %u", LASTERR);\r
+        Log("VDS Service is not ready: 0x%x", LASTERR);\r
         return NULL;\r
     }\r
 \r
         return NULL;\r
     }\r
 \r
index c9c32bd1b5557cc5ffae800a4ba147e2c75c27b8..1fbe9f4434ac37beaaeeb855e999ba315a3ec3b1 100644 (file)
@@ -267,69 +267,93 @@ static const char* GetEdition(DWORD ProductType)
     // From: https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getproductinfo\r
     // These values can be found in the winnt.h header.\r
     switch (ProductType) {\r
     // From: https://docs.microsoft.com/en-us/windows/win32/api/sysinfoapi/nf-sysinfoapi-getproductinfo\r
     // These values can be found in the winnt.h header.\r
     switch (ProductType) {\r
-    case 0x00000000: return "";        //  Undefined\r
-    case 0x00000001: return "Ultimate";\r
-    case 0x00000002: return "Home Basic";\r
-    case 0x00000003: return "Home Premium";\r
-    case 0x00000004: return "Enterprise";\r
-    case 0x00000005: return "Home Basic N";\r
-    case 0x00000006: return "Business";\r
-    case 0x00000007: return "Standard Server";\r
-    case 0x00000008: return "Datacenter Server";\r
-    case 0x00000009: return "Smallbusiness Server";\r
-    case 0x0000000A: return "Enterprise Server";\r
-    case 0x0000000B: return "Starter";\r
-    case 0x00000010: return "Business N";\r
-    case 0x00000011: return "Web Server";\r
-    case 0x00000012: return "Cluster Server";\r
-    case 0x00000013: return "Home Server";\r
-    case 0x0000001A: return "Home Premium N";\r
-    case 0x0000001B: return "Enterprise N";\r
-    case 0x0000001C: return "Ultimate N";\r
-    case 0x00000022: return "Home Premium Server";\r
-    case 0x0000002F: return "Starter N";\r
-    case 0x00000030: return "Pro";\r
-    case 0x00000031: return "Pro N";\r
-    case 0x00000042: return "Starter E";\r
-    case 0x00000043: return "Home Basic E";\r
-    case 0x00000044: return "Premium E";\r
-    case 0x00000045: return "Pro E";\r
-    case 0x00000046: return "Enterprise E";\r
-    case 0x00000047: return "Ultimate E";\r
-    case 0x00000048: return "Enterprise Eval";\r
-    case 0x00000054: return "Enterprise N Eval";\r
-    case 0x00000057: return "Thin PC";\r
-    case 0x0000006F: return "Core Connected";\r
-    case 0x00000070: return "Pro Student";\r
-    case 0x00000071: return "Core Connected N";\r
-    case 0x00000072: return "Pro Student N";\r
-    case 0x00000073: return "Core Connected Single Language";\r
-    case 0x00000074: return "Core Connected China";\r
-    case 0x00000079: return "Edu";\r
-    case 0x0000007A: return "Edu N";\r
-    case 0x0000007D: return "Enterprise S";\r
-    case 0x0000007E: return "Enterprise S N";\r
-    case 0x0000007F: return "Pro S";\r
-    case 0x00000080: return "Pro S N";\r
-    case 0x00000081: return "Enterprise S Eval";\r
-    case 0x00000082: return "Enterprise S N Eval";\r
-    case 0x0000008A: return "Pro Single Language";\r
-    case 0x0000008B: return "Pro China";\r
-    case 0x0000008C: return "Enterprise Subscription";\r
-    case 0x0000008D: return "Enterprise Subscription N";\r
-    case 0x00000095: return "Utility VM";\r
-    case 0x000000A1: return "Pro Workstation";\r
-    case 0x000000A2: return "Pro Workstation N";\r
-    case 0x000000A4: return "Pro for Education";\r
-    case 0x000000A5: return "Pro for Education N";\r
-    case 0x000000AB: return "Enterprise G";    // I swear Microsoft are just making up editions...\r
-    case 0x000000AC: return "Enterprise G N";\r
-    case 0x000000B6: return "Core OS";\r
-    case 0x000000B7: return "Cloud E";\r
-    case 0x000000B8: return "Cloud E N";\r
-    case 0x000000BD: return "Lite";\r
-    case 0xABCDABCD: return "(Unlicensed)";\r
-    default: return "(Unknown Edition)";\r
+               case 0x00000000: return "";     //  Undefined\r
+               case 0x00000001: return "Ultimate";\r
+               case 0x00000002: return "Home Basic";\r
+               case 0x00000003: return "Home Premium";\r
+               case 0x00000004: return "Enterprise";\r
+               case 0x00000005: return "Home Basic N";\r
+               case 0x00000006: return "Business";\r
+               case 0x00000007: return "Server Standard";\r
+               case 0x00000008: return "Server Datacenter";\r
+               case 0x00000009: return "Smallbusiness Server";\r
+               case 0x0000000A: return "Server Enterprise";\r
+               case 0x0000000B: return "Starter";\r
+               case 0x0000000C: return "Server Datacenter (Core)";\r
+               case 0x0000000D: return "Server Standard (Core)";\r
+               case 0x0000000E: return "Server Enterprise (Core)";\r
+               case 0x00000010: return "Business N";\r
+               case 0x00000011: return "Web Server";\r
+               case 0x00000012: return "HPC Edition";\r
+               case 0x00000013: return "Storage Server (Essentials)";\r
+               case 0x0000001A: return "Home Premium N";\r
+               case 0x0000001B: return "Enterprise N";\r
+               case 0x0000001C: return "Ultimate N";\r
+               case 0x00000022: return "Home Server";\r
+               case 0x00000024: return "Server Standard without Hyper-V";\r
+               case 0x00000025: return "Server Datacenter without Hyper-V";\r
+               case 0x00000026: return "Server Enterprise without Hyper-V";\r
+               case 0x00000027: return "Server Datacenter without Hyper-V (Core)";\r
+               case 0x00000028: return "Server Standard without Hyper-V (Core)";\r
+               case 0x00000029: return "Server Enterprise without Hyper-V (Core)";\r
+               case 0x0000002A: return "Hyper-V Server";\r
+               case 0x0000002F: return "Starter N";\r
+               case 0x00000030: return "Pro";\r
+               case 0x00000031: return "Pro N";\r
+               case 0x00000034: return "Server Solutions Premium";\r
+               case 0x00000035: return "Server Solutions Premium (Core)";\r
+               case 0x00000040: return "Server Hyper Core V";\r
+               case 0x00000042: return "Starter E";\r
+               case 0x00000043: return "Home Basic E";\r
+               case 0x00000044: return "Premium E";\r
+               case 0x00000045: return "Pro E";\r
+               case 0x00000046: return "Enterprise E";\r
+               case 0x00000047: return "Ultimate E";\r
+               case 0x00000048: return "Enterprise (Eval)";\r
+               case 0x0000004F: return "Server Standard (Eval)";\r
+               case 0x00000050: return "Server Datacenter (Eval)";\r
+               case 0x00000054: return "Enterprise N (Eval)";\r
+               case 0x00000057: return "Thin PC";\r
+               case 0x00000058: case 0x00000059: case 0x0000005A: case 0x0000005B: case 0x0000005C: return "Embedded";\r
+               case 0x00000062: return "Home N";\r
+               case 0x00000063: return "Home China";\r
+               case 0x00000064: return "Home Single Language";\r
+               case 0x00000065: return "Home";\r
+               case 0x00000067: return "Pro with Media Center";\r
+               case 0x00000069: case 0x0000006A: case 0x0000006B: case 0x0000006C: return "Embedded";\r
+               case 0x0000006F: return "Home Connected";\r
+               case 0x00000070: return "Pro Student";\r
+               case 0x00000071: return "Home Connected N";\r
+               case 0x00000072: return "Pro Student N";\r
+               case 0x00000073: return "Home Connected Single Language";\r
+               case 0x00000074: return "Home Connected China";\r
+               case 0x00000079: return "Education";\r
+               case 0x0000007A: return "Education N";\r
+               case 0x0000007D: return "Enterprise LTSB";\r
+               case 0x0000007E: return "Enterprise LTSB N";\r
+               case 0x0000007F: return "Pro S";\r
+               case 0x00000080: return "Pro S N";\r
+               case 0x00000081: return "Enterprise LTSB (Eval)";\r
+               case 0x00000082: return "Enterprise LTSB N (Eval)";\r
+               case 0x0000008A: return "Pro Single Language";\r
+               case 0x0000008B: return "Pro China";\r
+               case 0x0000008C: return "Enterprise Subscription";\r
+               case 0x0000008D: return "Enterprise Subscription N";\r
+               case 0x00000091: return "Server Datacenter SA (Core)";\r
+               case 0x00000092: return "Server Standard SA (Core)";\r
+               case 0x00000095: return "Utility VM";\r
+               case 0x000000A1: return "Pro for Workstations";\r
+               case 0x000000A2: return "Pro for Workstations N";\r
+               case 0x000000A4: return "Pro for Education";\r
+               case 0x000000A5: return "Pro for Education N";\r
+               case 0x000000AB: return "Enterprise G"; // I swear Microsoft are just making up editions...\r
+               case 0x000000AC: return "Enterprise G N";\r
+               case 0x000000B6: return "Home OS";\r
+               case 0x000000B7: return "Cloud E";\r
+               case 0x000000B8: return "Cloud E N";\r
+               case 0x000000BD: return "Lite";\r
+               case 0xABCDABCD: return "(Unlicensed)";\r
+               default: return "(Unknown Edition)";\r
     }\r
 }\r
 \r
     }\r
 }\r
 \r