- May 7, 2013
- 10,400
This is just a very small program which I wrote for fun; I haven't written any code for a long while, so there is probably a better method for implementing this.
Code:
#include <Windows.h>
#include <iostream>
int main() {
int PAE_Support;
int ProcessorChannel_Support;
int NXBit_Support;
int User_Choice;
int User_Exit;
while (User_Exit != 4) {
std::cout << "Welcome to the Prcoessor Feature Checker!\n";
std::cout << '\n';
std::cout << "Which feature would like to check?\n";
std::cout << '\n';
std::cout << "1.PAE Support\n" << "2.Processor Channel Support\n" << "3.DEP Support\n" << "4.Exit\n";
std::cout << '\n';
std::cout << "Please select an option: ";
std::cin >> User_Choice;
std::cin.ignore();
std::cout << '\n';
switch (User_Choice) {
case 1:
PAE_Support = IsProcessorFeaturePresent(9);
if (PAE_Support == 1) {
std::cout << "PAE is supported on this processor.\n";
std::cout << '\n';
}
else {
std::cout << "PAE is not supported on this processor.\n";
std::cout << '\n';
}
break;
case 2:
ProcessorChannel_Support = IsProcessorFeaturePresent(16);
if (ProcessorChannel_Support == 1) {
std::cout << "Processor Channels are enabled for this processor.\n";
std::cout << '\n';
}
else {
std::cout << "Processor Channels are disabled for this processor.\n";
std::cout << '\n';
}
break;
case 3:
NXBit_Support = IsProcessorFeaturePresent(12);
if (NXBit_Support == 1) {
std::cout << "Data Execution Protection is supported on this processor.\n";
std::cout << '\n';
}
else {
std::cout << "Data Execution Protection is not supported on this processor.\n";
std::cout << '\n';
}
break;
case 4:
std::exit(EXIT_SUCCESS);
break;
}
}
std::cin.get();
return 0;
}