//---------------------------------------------------------------------------


#pragma hdrstop
#pragma option push -w-
#pragma option push -Vx
//#include "jydisk.h"
#include <Windows.h>
//---------------------------------------------------------------------------
#pragma option push -b
enum HOST_READS_WRITES_UNIT { HOST_READS_WRITES_UNKNOWN, HOST_READS_WRITES_512B, HOST_READS_WRITES_32MB, HOST_READS_WRITES_GB };
#pragma option pop
#pragma option push -b
enum INTERFACE_TYPE { INTERFACE_TYPE_UNKNOWN, INTERFACE_TYPE_PATA, INTERFACE_TYPE_SATA, INTERFACE_TYPE_USB, INTERFACE_TYPE_IEEE1394, INTERFACE_TYPE_UASP, INTERFACE_TYPE_SCSI, INTERFACE_TYPE_NVME };
#pragma option pop
#pragma option push -b
enum VENDOR_ID { HDD_GENERAL, SSD_GENERAL, SSD_VENDOR_MTRON, SSD_VENDOR_INDILINX, SSD_VENDOR_JMICRON, SSD_VENDOR_INTEL, SSD_VENDOR_SAMSUNG, SSD_VENDOR_SANDFORCE, SSD_VENDOR_MICRON, SSD_VENDOR_OCZ, HDD_SSD_VENDOR_SEAGATE, HDD_VENDOR_WESTERN_DIGITAL, SSD_VENDOR_PLEXTOR, SSD_VENDOR_SANDISK, SSD_VENDOR_OCZ_VECTOR, HDD_SSD_VENDOR_TOSHIBA, SSD_VENDOR_CORSAIR, SSD_VENDOR_KINGSTON, SSD_VENDOR_MICRON_MU02, SSD_VENDOR_NVME };
#pragma option pop
//typedef unsigned short       Word;
//typedef unsigned char        Byte;       
struct JyHDiskInfo
{
	bool IsSmartSupported;
	bool IsApmSupported;
	bool IsApmEnabled;
	bool IsAamSupported;
	bool IsAamEnabled;
	bool IsLba48Supported;
	bool IsNcqSupported;
	bool IsNvCacheSupported;
	bool IsTrimSupported;
	bool IsSsd;
	bool IsDeviceSleepSupported;
	bool IsMaxtorMinute;
	bool IsRawValues8;
	bool IsRawValues7;
	unsigned DetectedTimeUnitType;
	char ModelNumber[40];
	char FirmwareRev[8];
	char SerialNumber[20];
	__int64 Cylinders;
	unsigned Heads;
	unsigned BytesPerSector;
	unsigned SectorsPerTrack;
	unsigned TracksPerCylinder;
	__int64 disksize;
	int Temperature;
	int PowerOnTime;
	int PowerOnCount;
	Word RotationRate;
	unsigned BufferSize;
	__int64 HostWrites;
	__int64 HostReads;
	char CurrentTransferMode[256];
	char MaxTransferMode[256];
	char Interface_[256];
	unsigned TransferModeType;
	unsigned Major;
	__int64 Life;
	char MajorVersion[256];
	char MinorVersion[256];
	char SmartKeyName[256];
	char SsdVendorString[256];
	int SmartCount;
	Byte ItemId[30];
	Byte CurrentValue[30];
	Byte WorstValue[30];
	Byte ThresholdValue[30];
	__int64 DataValue[30];
	Byte DataValueArr[30][6];
	Byte State[30];
	Byte StatusFlags[30];
	INTERFACE_TYPE InterfaceType;
	HOST_READS_WRITES_UNIT HostReadsWritesUnit;
	VENDOR_ID DiskVendorId;
} ;

extern "C" __declspec(dllexport) void __stdcall DoReg(char * fuser, int usersize, char * fregid, int regidsize);
extern "C" __declspec(dllexport) BOOL __stdcall IsRegisted(void);
extern "C" __declspec(dllexport) void __stdcall GetDiskSerialNumber1(char drive, char * pout, int &poutsize);
extern "C" __declspec(dllexport) void __stdcall GetDiskSerialNumber2(int index, char * pout, int &poutsize);
extern "C" __declspec(dllexport) void __stdcall GetDiskTypeStr(int itype, wchar_t * pout, int &poutsize);
extern "C" __declspec(dllexport) int __stdcall GetDiskType1(char drive);
extern "C" __declspec(dllexport) int __stdcall GetDiskType2(int index);
extern "C" __declspec(dllexport) int __stdcall GetDiskIndex(char drive);
extern "C" __declspec(dllexport) int __stdcall GetPhysicalDriveCount(char * pout, int &poutsize);
extern "C" __declspec(dllexport) void __stdcall GetDriverList(char * pout, int &poutsize);
extern "C" __declspec(dllexport) int __stdcall GetPhysicalDrivePartitionCount(int PhysicalDriveId);
extern "C" __declspec(dllexport) void __stdcall GetDiskDrive(int PhysicalDriveId, char * pout, int &poutsize);
extern "C" __declspec(dllexport) BOOL __stdcall RunAsAdmin(void);
extern "C" __declspec(dllexport) BOOL __stdcall GetHardDiskPartitionInfo(const char DriveLetter, char * pVolumeName, int &pVolumeNameSize, char * pVolumeSerialNumber, int &pVolumeSerialNumberSize, char * pPartitionType, int &pPartitionTypeSize, __int64 &TotalSpace, __int64 &TotalFreeSpace);
extern "C" __declspec(dllexport) BOOL __stdcall GetDiskInfo(int index, JyHDiskInfo &ainfo);
extern "C" __declspec(dllexport) int __stdcall GetDiskPartitionIndex(char drive);
extern "C" __declspec(dllexport) void __stdcall GetMd5String(const char * pin, const int pinsize, char * pout, int &poutsize);
extern "C" __declspec(dllexport) void __stdcall GetCpuID(char * pout, int &poutsize);
extern "C" __declspec(dllexport) void __stdcall GetDisplayDeviceID(char * pout, int &poutsize);
extern "C" __declspec(dllexport) void __stdcall GetBiosID(char * pout, int &poutsize);
extern "C" __declspec(dllexport) void __stdcall GetIP(char * pout, int &poutsize);
extern "C" __declspec(dllexport) void __stdcall GetMacAddr(char * pout, int &poutsize);
extern "C" __declspec(dllexport) BOOL __stdcall IsWin64(void);
extern "C" __declspec(dllexport) void __stdcall Init(void);
#pragma option pop	// -w-
#pragma option pop	// -Vx
#pragma package(smart_init)
