#ifndef TDDDeviceIdentifierH #define TDDDeviceIdentifierH // ========================================================================== // File: TDDDeviceIdentifier.H // Authors: BCB_Code_Generator v2.00, // Darren Dwyer (source code, documentation, demos, website), // Hugh Edwards (documentation, icons) // Description: This file defines the TDDDeviceIdentifier Component // // "TDx_Draw_Library v1.80" // (c) 2006 BCB-Tools.com Pty. Ltd., Sydney, Australia. // All Rights Reserved. // // Refer to the 'Licence.Txt' file for licencing & copyright information. // ========================================================================== // -------------------------------------------------------------------------- #include "TDx_Library_Defns.H" #include "TDx_Library_Functions.H" // -------------------------------------------------------------------------- #include "TDx_Draw_Library_Defns.H" #include "TDx_Draw_Library_Functions.H" // -------------------------------------------------------------------------- // ========================================================================== // Class: TDDDeviceIdentifier // Class Type: Wrapper // Description: The TDDDeviceIdentifier component wraps the DirectX // DDDEVICEIDENTIFIER2 structure, which defines a device's // identifier information. // // It is used by TDx_Draw::GetDeviceIdentifier() when retrieving // information which uniquely identifies a device. // // TDDDeviceIdentifier::Driver and // TDDDeviceIdentifier::Description may be displayed for the // benefit of the user, but should not be used to identify a // particular driver. They may contain identical strings for // different drivers or different strings for the same driver // from a different manufacturer. // // TDDDeviceIdentifier::VendorId, TDDDeviceIdentifier::DeviceId, // TDDDeviceIdentifier::SubsysId and // TDDDeviceIdentifier::Revision may be used to identify // specific chipsets but only with extreme caution. // ========================================================================== #if (__BORLANDC__ >= 0x0530) // BCB Version 3 + class PACKAGE TDDDeviceIdentifier : public TComponent { // -------------------------------------------------------------------------- #else // BCB Version 1 class TDDDeviceIdentifier : public TComponent { #endif // ========================================================================== __published: // ========================================================================== // ---------------------------------------------------------------------- // Property: Description // Description: The Driver property defines the manufacturers driver // description. // This description should not be used to uniquely identify // a particular driver. // ---------------------------------------------------------------------- __property AnsiString Description = { read=FGetDescription, write=FSetDescription, nodefault }; // ---------------------------------------------------------------------- // Property: DeviceId // Description: The DeviceId property defines the chipset type // identifier. // This property may be 0 if the chipset type's ID is // unknown. // ---------------------------------------------------------------------- __property dword DeviceId = { read=FGetDeviceId, write=FSetDeviceId, default=0 }; // ---------------------------------------------------------------------- // Property: Driver // Description: The Driver property defines the name given to the driver // by the manufacturer. // This name should not be used to uniquely identify a // particular driver. // ---------------------------------------------------------------------- __property AnsiString Driver = { read=FGetDriver, write=FSetDriver, nodefault }; // ---------------------------------------------------------------------- // Property: Revision // Description: The Revision property defines the revision identifier of // the device's chipset. // This property may be 0 if the revision ID is unknown. // ---------------------------------------------------------------------- __property dword Revision = { read=FGetRevision, write=FSetRevision, default=0 }; // ---------------------------------------------------------------------- // Property: SubSysId // Description: The SubSysId property defines the subsystem identifier, // often the identifier for the particuar board. // This property may be 0 if the subsystem ID is unknown. // ---------------------------------------------------------------------- __property dword SubSysId = { read=FGetSubSysId, write=FSetSubSysId, default=0 }; // ---------------------------------------------------------------------- // Property: VendorId // Description: The VendorId property defines the device manufacturer's // identifier. // This property may be 0 if the manufacturer's ID is // unknown. // ---------------------------------------------------------------------- __property dword VendorId = { read=FGetVendorId, write=FSetVendorId, default=0 }; // ---------------------------------------------------------------------- // Property: WHQLLevel // Description: The WHQLLevel property defines the Windows Hardware // Quality Lab (WHQL) certification level that applies for // the particular device driver pair. // ---------------------------------------------------------------------- __property dword WHQLLevel = { read=FGetWHQLLevel, write=FSetWHQLLevel, default=0 }; // ---------------------------------------------------------------------- // Event: OnError() // Description: The OnError event is called when an error occurs in the // TDDDeviceIdentifier component. // ---------------------------------------------------------------------- __property TDx_Error OnError = {read=FOnError, write=FOnError, nodefault}; // ========================================================================== public: // ========================================================================== // ---------------------------------------------------------------------- // Property: DeviceIdentifier // Description: The DeviceIdentifier property defines the GUID of the // driver chipset pair. // This GUID is the most reliable way of identifying a // problematic driver. // This GUID can also be used to track driver/chipset // changes for the purpose of reprofiling the graphics // subsystem. // ---------------------------------------------------------------------- __property GUID DeviceIdentifier = { read=FGetDeviceIdentifier, write=FSetDeviceIdentifier, nodefault }; // ---------------------------------------------------------------------- // Property: DriverVersion // Description: The DriverVersion property defines the driver's version // numbers. // Less than or greater than comparisons can legally be made // on the whole 64 bits, but care should be taken when // trying to use this property to identify problematic // drivers. TDDDeviceIdentifier::DeviceGUID is much better // suited to this purpose. // The version numbers contained by this property are in the // following format : // Product = HIWORD(liDriverVersion.HighPart) // Version = LOWORD(liDriverVersion.HighPart) // SubVersion = HIWORD(liDriverVersion.LowPart) // Build = LOWORD(liDriverVersion.LowPart) // ---------------------------------------------------------------------- __property large_int DriverVersion = { read=FGetDriverVersion, write=FSetDriverVersion, nodefault }; // ---------------------------------------------------------------------- // Property: ErrorValue // Description: The ErrorValue property contains the last error value // returned from a call to a TDDDeviceIdentifier method or // fget/fset. eg. DD_OK or DDERR_SURFACELOST or TDX_ERROR // ---------------------------------------------------------------------- __property HRESULT ErrorValue = { read=FGetErrorValue, write=FSetErrorValue, default=DD_OK }; // ---------------------------------------------------------------------- // Property: Size // Description: The Size property contains the size in bytes of the // internal DDDEVICEIDENTIFIER2 structure. // ---------------------------------------------------------------------- __property dword Size = { read=FGetSize, write=FSetSize, nodefault }; // ---------------------------------------------------------------------- // Method: Clear() // Description: The Clear() method can be used to clear the contents of // the TDDDeviceIdentifier's internal DDDEVICEIDENTIFIER2 // structure. // Note: if you have manually linked a structure member to a // chunk of memory, make sure you release this memory before // calling Clear(). // ---------------------------------------------------------------------- virtual void __fastcall Clear(); // ---------------------------------------------------------------------- // Constructor() and Destructor() // ---------------------------------------------------------------------- __fastcall TDDDeviceIdentifier(TComponent* Owner); virtual __fastcall ~TDDDeviceIdentifier(); // ---------------------------------------------------------------------- // Internal Structure Access // ---------------------------------------------------------------------- __property DDDEVICEIDENTIFIER2* Internal_DDDEVICEIDENTIFIER2_Ptr = { read=FGetInternal_DDDEVICEIDENTIFIER2_Ptr, nodefault }; void __fastcall Internal_DDDEVICEIDENTIFIER2_Update(); // ========================================================================== protected: // ========================================================================== // ---------------------------------------------------------------------- // Property Access Methods // ---------------------------------------------------------------------- AnsiString __fastcall FGetDescription(); void __fastcall FSetDescription( AnsiString pDescription ); dword __fastcall FGetDeviceId(); void __fastcall FSetDeviceId( dword pDeviceId ); GUID __fastcall FGetDeviceIdentifier(); void __fastcall FSetDeviceIdentifier( GUID pDeviceIdentifier ); AnsiString __fastcall FGetDriver(); void __fastcall FSetDriver( AnsiString pDriver ); large_int __fastcall FGetDriverVersion(); void __fastcall FSetDriverVersion( large_int pDriverVersion ); HRESULT __fastcall FGetErrorValue(); void __fastcall FSetErrorValue( HRESULT pErrorValue ); dword __fastcall FGetRevision(); void __fastcall FSetRevision( dword pRevision ); dword __fastcall FGetSize(); void __fastcall FSetSize( dword pSize ); dword __fastcall FGetSubSysId(); void __fastcall FSetSubSysId( dword pSubSysId ); dword __fastcall FGetVendorId(); void __fastcall FSetVendorId( dword pVendorId ); dword __fastcall FGetWHQLLevel(); void __fastcall FSetWHQLLevel( dword pWHQLLevel ); // ========================================================================== private: // ========================================================================== // ---------------------------------------------------------------------- // Internal Structure Access // ---------------------------------------------------------------------- DDDEVICEIDENTIFIER2* __fastcall FGetInternal_DDDEVICEIDENTIFIER2_Ptr(); void __fastcall FSetInternal_DDDEVICEIDENTIFIER2( DDDEVICEIDENTIFIER2* pDDDEVICEIDENTIFIER2 ); // ---------------------------------------------------------------------- // Property Variables // ---------------------------------------------------------------------- GUID fDeviceIdentifier; HRESULT fErrorValue; dword fSize; // ---------------------------------------------------------------------- // Structure Variables // ---------------------------------------------------------------------- DDDEVICEIDENTIFIER2 fDDDEVICEIDENTIFIER2; // ---------------------------------------------------------------------- // Event Variables // ---------------------------------------------------------------------- TDx_Error FOnError; }; // -------------------------------------------------------------------------- #endif // --------------------------------------------------------------------------