/////////////////////////////////////////////////////////////////////////////
//
// This header file defines functions exported by RivaTuner.exe 
//
/////////////////////////////////////////////////////////////////////////////

#ifndef _RIVATUNER_EXPORTS_INCLUDED_
#define _RIVATUNER_EXPORTS_INCLUDED_

#ifdef RIVATUNER_EXPORTS
#define RIVATUNER_API extern "C" __declspec(dllexport)
#else
#define RIVATUNER_API extern "C" __declspec(dllimport)
#endif
 
/////////////////////////////////////////////////////////////////////////////
//
// host application IDs
//
/////////////////////////////////////////////////////////////////////////////

#define RIVATUNER_HOST_APP										0x00000000
#define MONITORINGHOSTSAMPLE_HOST_APP							0x00000001

/////////////////////////////////////////////////////////////////////////////
//
// exported function names
//
/////////////////////////////////////////////////////////////////////////////

//R/O access to host application ID/version

typedef DWORD (*GET_HOST_APP_ID_PROC		)();
	//DWORD GetHostAppID()
typedef DWORD (*GET_HOST_APP_VERSION_PROC	)();
	//DWORD GetHostAppVersion()

//R/O access to current display device identification

typedef LPCSTR	(*GET_DEVICE_NAME_PROC		)();
	//LPCSTR GetDeviceName()
typedef LPCSTR	(*GET_DEVICE_ID_PROC		)();
	//LPCSTR GetDeviceID()

//R/O access to display device identification

typedef LPCSTR	(*GET_DEVICE_NAME_EX_PROC	)(DWORD);
	//LPCSTR GetDeviceNameEx(DWORD gpu)
typedef LPCSTR	(*GET_DEVICE_ID_EX_PROC		)(DWORD);
	//LPCSTR GetDeviceIDEx(DWORD gpu)

//R/W access to IO ports

typedef int				(*INP_PROC	)(unsigned short);
	//int inp(unsigned short port)
typedef unsigned short	(*INPW_PROC	)(unsigned short);
	//unsigned short inpw(unsigned short port)
typedef unsigned long	(*INPD_PROC	)(unsigned short);
	//unsigned long inpd(unsigned short port)

typedef int				(*OUTP_PROC	)(unsigned short, int			);
	//int outp(unsigned short port, int data)
typedef unsigned short	(*OUTPW_PROC)(unsigned short, unsigned short);
	//unsigned short outpw(unsigned short port, unsigned short data)
typedef unsigned long	(*OUTPD_PROC)(unsigned short, unsigned long	);
	//unsigned long outpd(unsigned short port, unsigned long data)

//R/W access to PCI bus configuration registers

typedef DWORD	(*READ_BUS_DATA_ULONG_PROC	)(DWORD, DWORD, DWORD);
	//DWORD ReadBusDataUlong(DWORD bus, DWORD devfn, DWORD offset)
typedef WORD	(*READ_BUS_DATA_USHORT_PROC	)(DWORD, DWORD, DWORD);
	//WORD ReadBusDataUshort(DWORD bus, DWORD devfn, DWORD offset)
typedef BYTE	(*READ_BUS_DATA_UCHAR_PROC	)(DWORD, DWORD, DWORD);
	//BYTE ReadBusDataUchar(DWORD bus, DWORD devfn, DWORD offset)

typedef void (*WRITE_BUS_DATA_ULONG_PROC	)(DWORD, DWORD, DWORD, DWORD);
	//void WriteBusDataUlong(DWORD bus, DWORD devfn, DWORD offset, DWORD data)
typedef void (*WRITE_BUS_DATA_USHORT_PROC	)(DWORD, DWORD, DWORD, WORD	);
	//void WriteBusDataUshort(DWORD bus, DWORD devfn, DWORD offset, WORD data)
typedef void (*WRITE_BUS_DATA_UCHAR_PROC	)(DWORD, DWORD, DWORD, BYTE	);
	//void WriteBusDataUchar(DWORD bus, DWORD devfn, DWORD offset, BYTE data)

//R/W access to MSR

typedef BOOL	(*READ_MSR_PROC	)(DWORD, LPDWORD, LPDWORD);
	//BOOL ReadMSR(DWORD dwIndex, LPDWORD lpHigh, LPDWORD lpLow)
typedef BOOL	(*WRITE_MSR_PROC)(DWORD, DWORD, DWORD);
	//BOOL WriteMSR(DWORD dwIndex, DWORD dwHigh, DWORD dwLow)

//R/W access to current display device GPU registers 

typedef DWORD	(*READ_REGISTER_ULONG_PROC		)(DWORD);
	//DWORD ReadRegisterUlong(DWORD address)
typedef WORD	(*READ_REGISTER_USHORT_PROC		)(DWORD);
	//WORD ReadRegisterUshort(DWORD address)
typedef BYTE	(*READ_REGISTER_UCHAR_PROC		)(DWORD);
	//BYTE ReadRegisterUchar(DWORD address)

typedef void	(*WRITE_REGISTER_ULONG_PROC	)(DWORD, DWORD	);
	//void WriteRegisterUlong(DWORD address, DWORD data)
typedef void	(*WRITE_REGISTER_USHORT_PROC)(DWORD, WORD	);
	//void WriteRegisterUshort(DWORD address, WORD data)
typedef void	(*WRITE_REGISTER_UCHAR_PROC	)(DWORD, BYTE	);
	//void WriteRegisterUchar(DWORD address, BYTE data)

//R/W access to display device GPU registers 

typedef DWORD	(*READ_REGISTER_ULONG_EX_PROC	)(DWORD, DWORD);
	//DWORD ReadRegisterUlongEx(DWORD dwDevice, DWORD address)
typedef WORD	(*READ_REGISTER_USHORT_EX_PROC	)(DWORD, DWORD);
	//WORD ReadRegisterUshortEx(DWORD gpu, DWORD address)
typedef BYTE	(*READ_REGISTER_UCHAR_EX_PROC	)(DWORD, DWORD);
	//BYTE ReadRegisterUcharEx(DWORD gpu, DWORD address)

typedef void	(*WRITE_REGISTER_ULONG_EX_PROC	)(DWORD, DWORD, DWORD	);
	//void WriteRegisterUlongEx(DWORD gpu, DWORD address, DWORD data)
typedef void	(*WRITE_REGISTER_USHORT_EX_PROC	)(DWORD, DWORD, WORD	);
	//void WriteRegisterUshortEx(DWORD gpu, DWORD address, WORD data)
typedef void	(*WRITE_REGISTER_UCHAR_EX_PROC	)(DWORD, DWORD, BYTE	);
	//void WriteRegisterUcharEx(DWORD gpu, DWORD address, BYTE data)

//R/O access to current display device VGA BIOS

typedef BOOL	(*ENABLE_READ_BIOS_PROC	)(BOOL );
	//BYTE EnableReadBIOS(BOOL bEnable)
typedef BYTE	(*READ_BIOS_PROC	)(DWORD);
	//BYTE ReadBIOS(DWORD address)

//R/O access to display device VGA BIOS

typedef BOOL	(*ENABLE_READ_BIOS_EX_PROC	)(DWORD, BOOL );
	//BYTE EnableReadBIOSEx(DWORD gpu, BOOL bEnable)
typedef BYTE	(*READ_BIOS_EX_PROC			)(DWORD, DWORD);
	//BYTE ReadBIOSEx(DWORD gpu, DWORD address)

//R/W access to current display device I2C buses

typedef BYTE	(*GET_I2C_BUS_NUM_PROC	)();
	//BYTE GetI2CBusNum()
typedef BOOL	(*READ_I2C_PROC			)(BYTE,BYTE,BYTE,LPBYTE);
	//BOOL ReadI2C(BYTE bus, BYTE dev, BYTE off, LPBYTE lpData)
typedef BOOL	(*WRITE_I2C_PROC		)(BYTE,BYTE,BYTE,LPBYTE);
	//BOOL WriteI2C(BYTE bus, BYTE dev, BYTE off, LPBYTE lpData)

//R/W access to display device I2C buses

typedef BYTE	(*GET_I2C_BUS_NUM_EX_PROC	)(DWORD);
	//BYTE GetI2CBusNumEx(DWORD gpu)
typedef BOOL	(*READ_I2C_EX_PROC			)(DWORD, BYTE,BYTE,BYTE,LPBYTE);
	//BOOL ReadI2CEx(DWORD gpu, BYTE bus, BYTE dev, BYTE off, LPBYTE lpData)
typedef BOOL	(*WRITE_I2C_EX_PROC			)(DWORD, BYTE,BYTE,BYTE,LPBYTE);
	//BOOL WriteI2CEx(DWORD gpu, BYTE bus, BYTE dev, BYTE off, LPBYTE lpData)

//R/O access to current NVIDIA display device driver resource manager

typedef BOOL	(*NVRM_GET_CFG_PROC		)(DWORD,LPDWORD);
	//BOOL NvRmGetCfg(DWORD dwIndex, LPDWORD lpData)
typedef BOOL	(*NVRM_GET_CFG_EX_PROC	)(DWORD,LPBYTE,DWORD);
	//BOOL NvRmGetCfgEx(DWORD dwIndex, LPBYTE lpData, DWORD dwSize)

//localization

typedef void	(*LOCALIZEWND_PROC	)(HWND);
	//void LocalizeWnd(HWND hWnd)
typedef LPCSTR	(*LOCALIZESTR_PROC	)(LPCSTR);
	//LPCSTR LocalizeStr(LPCSTR lpStr)

#endif

