I need to check if a program has been run with a sandbox, adding to that program a code to check this statement. I've already tried to check Windows's username with the name of the username who run the program but they were always the same. Do you have any suggestion? I'm stuck. I've tried to implement something but I don't know how the GetExitCodeProcess function works, here is my code:
#include <intrin.h>
#include <iostream>
#include <windows.h>
#pragma comment(lib, "Kernel32.lib")
bool IsActive(){
LPDWORD active;
GetExitCodeProcess(/*I don't know what to put here */,active);
if (active!=0){
return true;
}
return false;
}
int main() {
if (IsActive()) {
std::cout << "The player is using sandboxie";
return 0;
}
std::cout << "The player isn't using sandboxie.";
return 0;
}