-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
198 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using System.Management; | ||
using SSSHV = Sucrose.Shared.Space.Helper.Virtual; | ||
|
||
namespace Sucrose.Backgroundog.Extension | ||
{ | ||
internal static class Virtual | ||
{ | ||
public static bool VirtualityActive() | ||
{ | ||
try | ||
{ | ||
string Query = "SELECT * FROM Win32_Process WHERE "; | ||
|
||
foreach (string Name in SSSHV.GetApp()) | ||
{ | ||
Query += $"Name = '{Name}' OR "; | ||
} | ||
|
||
Query = Query.TrimEnd(" OR ".ToCharArray()); | ||
|
||
ManagementObjectSearcher Searcher = new(Query); | ||
|
||
ManagementObjectCollection Collection = Searcher.Get(); | ||
|
||
return Collection.Count > 0; | ||
} | ||
catch | ||
{ | ||
return false; | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ internal enum CategoryPerformanceType | |
Saver, | ||
Memory, | ||
Remote, | ||
Virtual, | ||
Network, | ||
Battery, | ||
Fullscreen | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
namespace Sucrose.Shared.Space.Helper | ||
{ | ||
internal static class Virtual | ||
{ | ||
public static List<string> GetApp() | ||
{ | ||
return new() | ||
{ | ||
"nox.exe", | ||
"memu.exe", | ||
"vmware.exe", | ||
"dnplayer.exe", | ||
"noxplayer.exe", | ||
"hd-player.exe", | ||
"vmware-vmx.exe", | ||
"virtualbox.exe", | ||
"bluestacks.exe", | ||
"noxvmhandle.exe", | ||
"virtualboxvm.exe", | ||
"windowssandbox.exe", | ||
"windowssandboxclient.exe" | ||
}; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters