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


//#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;   
//#pragma pack(push, 1)
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;
	unsigned short RotationRate;//System::
	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;
	unsigned char ItemId[30];
	unsigned char CurrentValue[30];
	unsigned char WorstValue[30];
	unsigned char ThresholdValue[30];
	__int64 DataValue[30];
	unsigned char DataValueArr[30][6];
	unsigned char State[30];
	unsigned char StatusFlags[30];
	INTERFACE_TYPE InterfaceType;
	HOST_READS_WRITES_UNIT HostReadsWritesUnit;
	
	VENDOR_ID DiskVendorId;
} ;
//#pragma pack(pop)
 void  _DoReg(const char * fuser, const int usersize, const char * fregid, const int regidsize);//ok 1
 BOOL  _IsRegisted(void);//ok 2
 void  _GetDiskSerialNumber1(char drive, char * pout, int &poutsize);//ok 3
 void  _GetDiskSerialNumber2(int index, char * pout, int &poutsize);//ok 4
void  _GetDiskTypeStr(int itype, wchar_t * pout, int &poutsize);//ok 5
int  _GetDiskType1(char  drive);//ok 6
 int  _GetDiskType2(int index);//ok 7
 int  _GetDiskIndex(char drive);//ok 8
 int  _GetPhysicalDriveCount(char * pout, int &poutsize);//ok 9
 void  _GetDriverList(char * pout, int &poutsize);//ok 10
int  _GetPhysicalDrivePartitionCount(int PhysicalDriveId);//ok 11
 void  _GetDiskDrive(int PhysicalDriveId, char * pout, int &poutsize);//ok 12
 BOOL  _RunAsAdmin(void);//ok 13
BOOL  _GetHardDiskPartitionInfo(const  char  DriveLetter, char * pVolumeName, int &pVolumeNameSize, char * pVolumeSerialNumber, int &pVolumeSerialNumberSize, char * pPartitionType, int &pPartitionTypeSize, __int64 &TotalSpace, __int64 &TotalFreeSpace);//ok 14
BOOL  _GetDiskInfo(int index, JyHDiskInfo &ainfo);//15
 int  _GetDiskPartitionIndex(char drive);//ok 16
void  _GetMd5String(const char * pin, const int pinsize, char * pout, int &poutsize);//ok 17
 void  _GetCpuID(char * pout, int &poutsize);//ok 18
 void  _GetDisplayDeviceID(char * pout, int &poutsize);//ok 19
 void  _GetBiosID(char * pout, int &poutsize);//ok 20
void  _GetIP(char * pout, int &poutsize);//ok 21
 void  _GetMacAddr(char * pout, int &poutsize);//ok 22
 BOOL  _IsWin64(void);//ok 23
  void  _Init(void);//ok 24
void  _GetUsbPNPDeviceID1(char drive, char * pout, int &poutsize);//ok 25
 void  _GetUsbPNPDeviceID2(int index, char * pout, int &poutsize);//ok 26
 #pragma option pop	// -w-
#pragma option pop	// -Vx
