Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef __CSMART_h__
- #define __CSMART_h__
- #include <windows.h>
- #include <string>
- using std::string;
- // ATA ID command response; structure memory alignment set to 1 so
- // we can grab this straight from the response buffer.
- #pragma pack (push, 1)
- struct ATA_ID_SECTOR {
- USHORT wGenConfig;
- USHORT wNumCyls;
- USHORT wReserved;
- USHORT wNumHeads;
- USHORT wBytesPerTrack;
- USHORT wBytesPerSector;
- USHORT wSectorsPerTrack;
- USHORT wVendorUnique[3];
- CHAR sSerialNumber[20]; // <-- not a c-style string (see source)
- USHORT wBufferType;
- USHORT wBufferSize;
- USHORT wECCSize;
- CHAR sFirmwareRev[8]; // <-- not a c-style string (see source)
- CHAR sModelNumber[40]; // <-- not a c-style string (see source)
- USHORT wMoreVendorUnique;
- USHORT wDoubleWordIO;
- USHORT wCapabilities;
- USHORT wReserved1;
- USHORT wPIOTiming;
- USHORT wDMATiming;
- USHORT wBS;
- USHORT wNumCurrentCyls;
- USHORT wNumCurrentHeads;
- USHORT wNumCurrentSectorsPerTrack;
- ULONG ulCurrentSectorCapacity;
- USHORT wMultSectorStuff;
- ULONG ulTotalAddressableSectors;
- USHORT wSingleWordDMA;
- USHORT wMultiWordDMA;
- BYTE bReserved[128];
- };
- #pragma pack (pop)
- class CSMART {
- public:
- CSMART (unsigned drive_index) throw (string);
- ~CSMART (void);
- void dump (void) const;
- private:
- string _filename;
- unsigned _dindex;
- HANDLE _hdrive;
- GETVERSIONINPARAMS _verinfo;
- ATA_ID_SECTOR _ataid;
- string _ataid_serial;
- string _ataid_model;
- string _ataid_firmware;
- void _enableSMART (void) throw (string);
- };
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement