#include <WindowsDetector.h>
Inheritance diagram for hwdet::WindowsDetector:
Public Member Functions | |
WindowsDetector (void) | |
Constructor. | |
~WindowsDetector (void) | |
Destructor. | |
bool | Initialize (void) |
Initialize detector. | |
bool | Detect (void) |
Detect all features. | |
bool | Destroy (void) |
Clear all used memory. | |
String | GetOutputString (void) const |
Get string containing output file. | |
bool | WriteToStream (OStream &stream) const |
Write generated output to the stream. | |
Private Member Functions | |
bool | DetectOS (void) |
Detect OS features. | |
bool | DetectCPU (void) |
Detect CPU features. | |
bool | DetectMemory (void) |
Detect memory features. | |
bool | DetectDrives (void) |
Detect all drives. | |
bool | DetectHDD (XMLElement *drives) |
Detect hard-drives. | |
bool | DetectPartitions (DiskDrive *disk_drive) |
Detect partitions on a given HDD. | |
bool | DetectCDRom (XMLElement *drives) |
Detect CD/DVD drives. | |
bool | DetectOtherDrives (XMLElement *drives) |
Detect other drive types (tape drives). | |
bool | DetectNetwork (void) |
Detect network features. | |
bool | DetectProducts (void) |
Enumerate installed applications. | |
template<typename T> | |
bool | TestAndReport (const CheckedResult< T > &cr, const String &message) |
Test for succes/failure and report message. | |
Private Attributes | |
IWbemServices * | Services |
Pointer to the WMI Services provider. |
This class does all hardware/software detection on Windows platform. It contains methods to detect OS, memory, drives, network and installed software. All output is saved into XMLOutputFile which can then be written to any output stream.
It uses WMI to detect some of the features, so it will work only on Windows 2000, Windows XP or newer.
Tested on:
hwdet::WindowsDetector::WindowsDetector | ( | void | ) |
Constructor.
hwdet::WindowsDetector::~WindowsDetector | ( | void | ) |
Destructor.
bool hwdet::WindowsDetector::Destroy | ( | void | ) | [virtual] |
Clear all used memory.
Disconnect from WMI and delete all generated data.
true
on success, false
otherwise. Implements hwdet::Detector.
bool hwdet::WindowsDetector::Detect | ( | void | ) | [virtual] |
Detect all features.
Run all detection routines and save output into XMLOutputFile.
true
on success, false
otherwise. Implements hwdet::Detector.
bool hwdet::WindowsDetector::DetectCDRom | ( | XMLElement * | drives | ) | [private] |
Detect CD/DVD drives.
Enumerate all CD/DVD drives.
true
on success, false
otherwise. bool hwdet::WindowsDetector::DetectCPU | ( | void | ) | [private] |
Detect CPU features.
Detect CPU features.
true
on success, false
otherwise. bool hwdet::WindowsDetector::DetectDrives | ( | void | ) | [private] |
Detect all drives.
Detect all drives present on the system.
true
on success, false
otherwise. bool hwdet::WindowsDetector::DetectHDD | ( | XMLElement * | drives | ) | [private] |
Detect hard-drives.
Enumerate all hard-drives installed on the computer.
true
on success, false
otherwise. bool hwdet::WindowsDetector::DetectMemory | ( | void | ) | [private] |
Detect memory features.
Detect features of memory sub-system.
true
on success, false
otherwise. bool hwdet::WindowsDetector::DetectNetwork | ( | void | ) | [private] |
Detect network features.
Enumerates all network adapters present on the system. Virtual and disabled adapters are not processed.
true
on success, false
otherwise. bool hwdet::WindowsDetector::DetectOS | ( | void | ) | [private] |
Detect OS features.
Detect properties of the operating system.
true
on success, false
otherwise. bool hwdet::WindowsDetector::DetectOtherDrives | ( | XMLElement * | drives | ) | [private] |
Detect other drive types (tape drives).
Enumerate tape drives installed.
true
on success, false
otherwise. bool hwdet::WindowsDetector::DetectPartitions | ( | DiskDrive * | disk_drive | ) | [private] |
Detect partitions on a given HDD.
Enumerate partitions on the given drive.
disk_drive | Disk drive into which data about partitions will be inserted. |
true
on success, false
otherwise. bool hwdet::WindowsDetector::DetectProducts | ( | void | ) | [private] |
Enumerate installed applications.
Enumerates all applications installed on the system. It will detect only applications which are visible in Control Panel->Add/Remove Programs applet.
true
on success, false
otherwise. String hwdet::WindowsDetector::GetOutputString | ( | void | ) | const [virtual] |
Get string containing output file.
Implements hwdet::Detector.
bool hwdet::WindowsDetector::Initialize | ( | void | ) | [virtual] |
Initialize detector.
Initialize WMI. This will connect to the WMI server on local computer and connect to the ROOT\CIMV2 WMI namespace.
true
on success, false
otherwise. Implements hwdet::Detector.
bool hwdet::WindowsDetector::TestAndReport | ( | const CheckedResult< T > & | cr, | |
const String & | message | |||
) | [inline, private] |
Test for succes/failure and report message.
This will test whether given CheckedResult is valid. If it is not, given message is reported.
cr | Result to test. | |
message | Message to report in case of failure. |
true
if CheckedResult is valid, false
otherwise. bool hwdet::WindowsDetector::WriteToStream | ( | OStream & | stream | ) | const [virtual] |
Write generated output to the stream.
stream | Stream to which output file should be written. |
true
on success, false
otherwise. Implements hwdet::Detector.
IWbemServices* hwdet::WindowsDetector::Services [private] |
Pointer to the WMI Services provider.