hwdet::WindowsDetector Class Reference

Windows detector core class. More...

#include <WindowsDetector.h>

Inheritance diagram for hwdet::WindowsDetector:

hwdet::Detector hwdet::MessageReporter

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.

Detailed Description

Windows detector core class.

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:


Constructor & Destructor Documentation

hwdet::WindowsDetector::WindowsDetector ( void   ) 

Constructor.

hwdet::WindowsDetector::~WindowsDetector ( void   ) 

Destructor.


Member Function Documentation

bool hwdet::WindowsDetector::Destroy ( void   )  [virtual]

Clear all used memory.

Disconnect from WMI and delete all generated data.

Returns:
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.

Returns:
true on success, false otherwise.

Implements hwdet::Detector.

bool hwdet::WindowsDetector::DetectCDRom ( XMLElement drives  )  [private]

Detect CD/DVD drives.

Enumerate all CD/DVD drives.

Returns:
true on success, false otherwise.

bool hwdet::WindowsDetector::DetectCPU ( void   )  [private]

Detect CPU features.

Detect CPU features.

Returns:
true on success, false otherwise.

bool hwdet::WindowsDetector::DetectDrives ( void   )  [private]

Detect all drives.

Detect all drives present on the system.

Returns:
true on success, false otherwise.

bool hwdet::WindowsDetector::DetectHDD ( XMLElement drives  )  [private]

Detect hard-drives.

Enumerate all hard-drives installed on the computer.

Returns:
true on success, false otherwise.

bool hwdet::WindowsDetector::DetectMemory ( void   )  [private]

Detect memory features.

Detect features of memory sub-system.

Returns:
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.

Returns:
true on success, false otherwise.

bool hwdet::WindowsDetector::DetectOS ( void   )  [private]

Detect OS features.

Detect properties of the operating system.

Returns:
true on success, false otherwise.

bool hwdet::WindowsDetector::DetectOtherDrives ( XMLElement drives  )  [private]

Detect other drive types (tape drives).

Enumerate tape drives installed.

Returns:
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.

Parameters:
disk_drive Disk drive into which data about partitions will be inserted.
Returns:
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.

Returns:
true on success, false otherwise.

String hwdet::WindowsDetector::GetOutputString ( void   )  const [virtual]

Get string containing output file.

Returns:
String containing data retrieved by detector.

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.

Returns:
true on success, false otherwise.

Implements hwdet::Detector.

template<typename T>
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.

Parameters:
cr Result to test.
message Message to report in case of failure.
Returns:
true if CheckedResult is valid, false otherwise.

bool hwdet::WindowsDetector::WriteToStream ( OStream stream  )  const [virtual]

Write generated output to the stream.

Parameters:
stream Stream to which output file should be written.
Returns:
true on success, false otherwise.

Implements hwdet::Detector.


Field Documentation

IWbemServices* hwdet::WindowsDetector::Services [private]

Pointer to the WMI Services provider.


The documentation for this class was generated from the following files:
Generated on Tue Dec 19 17:43:52 2006 for Detector for Windows by  doxygen 1.4.7