384384#include < psapi.h>
385385#include < shlwapi.h>
386386#include < shlobj_core.h>
387- #include < dshow.h>
388- #include < io.h>
389387#include < winspool.h>
390388#include < powerbase.h>
391389#include < setupapi.h>
392- #include < mmdeviceapi.h>
393- #include < Functiondiscoverykeys_devpkey.h>
394390#include < mmsystem.h>
395- #include < queue>
396391#include < dxgi.h>
397392#include < d3d9.h>
398393
@@ -3099,7 +3094,7 @@ struct VM {
30993094 key (brands::WINE, " HKLM\\ SOFTWARE\\ Wine" );
31003095
31013096 // Xen
3102- key (brands::KVM , " HKLM\\ SYSTEM\\ CurrentControlSet\\ Enum\\ PCI\\ VEN_5853*" );
3097+ key (brands::XEN , " HKLM\\ SYSTEM\\ CurrentControlSet\\ Enum\\ PCI\\ VEN_5853*" );
31033098 key (brands::XEN, " HKLM\\ HARDWARE\\ ACPI\\ DSDT\\ xen" );
31043099 key (brands::XEN, " HKLM\\ HARDWARE\\ ACPI\\ FADT\\ xen" );
31053100 key (brands::XEN, " HKLM\\ HARDWARE\\ ACPI\\ RSDT\\ xen" );
@@ -7323,6 +7318,7 @@ struct VM {
73237318 * @brief Check for specific GPU string signatures related to VMs
73247319 * @category Windows
73257320 * @author Requiem (https://github.com/NotRequiem)
7321+ * @author dmfrpro (https://github.com/dmfrpro) (VDD detection)
73267322 * @note utoshu did this with WMI in a removed technique (VM::GPU_CHIPTYPE)
73277323 * @implements VM::GPU_VM_STRING
73287324 */
@@ -7336,14 +7332,17 @@ struct VM {
73367332 size_t length;
73377333 };
73387334
7339- constexpr std::array<VMGpuInfo, 7 > vm_gpu_names = { {
7335+ constexpr std::array<VMGpuInfo, 10 > vm_gpu_names = { {
73407336 { L" VMware SVGA 3D" , brands::VMWARE, 14 },
73417337 { L" VirtualBox Graphics Adapter" , brands::VBOX, 27 },
73427338 { L" QXL GPU" , brands::KVM, 7 },
73437339 { L" VirGL 3D" , brands::QEMU, 8 },
73447340 { L" Microsoft Hyper-V Video" , brands::HYPERV, 23 },
73457341 { L" Parallels Display Adapter (WDDM)" , brands::PARALLELS, 32 },
7346- { L" Bochs Graphics Adapter" , brands::BOCHS, 22 }
7342+ { L" Bochs Graphics Adapter" , brands::BOCHS, 22 },
7343+ { L" Bochs Graphics Adapter" , brands::BOCHS, 22 },
7344+ { L" Virtual Display Driver" , brands::NULL_BRAND, 22 },
7345+ { L" IddSampleDriver Device" , brands::NULL_BRAND, 22 }
73477346 } };
73487347
73497348 DISPLAY_DEVICEW dd{};
@@ -7362,8 +7361,11 @@ struct VM {
73627361 const char * brand = entry.brand ;
73637362 const size_t len = entry.length ;
73647363#endif
7365- if (deviceStrLen == len && wcscmp (deviceStr, name) == 0 ) {
7366- return core::add (brand);;
7364+ if (deviceStrLen == len && wcscmp (deviceStr, name) == 0 ) {
7365+ char * castedName = (char *)calloc (len, sizeof (char ));
7366+ size_t ret = wcstombs (castedName, name, len);
7367+ castedName[ret] = ' \0 ' ;
7368+ return core::add (brand);
73677369 }
73687370 }
73697371
@@ -7668,7 +7670,7 @@ struct VM {
76687670 newParam.sched_priority = sched_get_priority_max (SCHED_FIFO);
76697671
76707672 if (sched_setscheduler (0 , SCHED_FIFO, &newParam) == -1 ) {
7671- hasSchedPriority = false ;
7673+ hasSchedPriority = false ;
76727674 }
76737675 }
76747676#endif
@@ -7946,7 +7948,7 @@ struct VM {
79467948 ? (tscCore2 - tscCore1)
79477949 : (tscCore1 - tscCore2);
79487950
7949- if (diff < tscSyncDiffThreshold) {
7951+ if (diff < tscSyncDiffThreshold) {
79507952 tscIssueCount++;
79517953 }
79527954 }
@@ -10775,8 +10777,6 @@ struct VM {
1077510777 // brand is "Azure Hyper-V" instead of just "Hyper-V". So what
1077610778 // this section does is "merge" the brands together to form
1077710779 // a more accurate idea of the brand(s) involved.
10778-
10779-
1078010780 merge (TMP_AZURE, TMP_HYPERV, TMP_AZURE);
1078110781 merge (TMP_AZURE, TMP_VPC, TMP_AZURE);
1078210782 merge (TMP_AZURE, TMP_HYPERV_VPC, TMP_AZURE);
0 commit comments