/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * WinIoEx - Sample.h
 *
 * WinIoEx Copyright (C) 2009-2010 Doug Chen.
 * 
 *
 * You can use the binary files or source code, I DO NOT restrict you anything on anywhere even 
 * commercial purpose, but please send a mail or leave a message on MSN to me before releasing your 
 * project for encourage me keep going on the project, thank you.
 *
 *
 *                                                           Doug Chen, 2009/11/10 20:23 Taiwan Taipei
 *	
 *	Name		: Doug Chen  (³―Αδ·½)
 * 	Email		: dougchen850208@gmail.com
 * 	MSN			: dougchen850208@gmail.com
 *  Location	: Taiwan Taipei
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */




#ifndef _WINIOEX_SAMPLECODE_H__
#define	_WINIOEX_SAMPLECODE_H__


#include "..\..\Lib\WinIoEx\WinIoEx.h"
#include "..\..\Lib\WinIoEx\ErrorCode.h"

#pragma warning(disable : 4996)





BOOL SampleCode_Initial(unsigned char _status);


BOOL SampleCode_GetIoPort(unsigned char _type, 
						  unsigned long _addr, 
						  unsigned long &_value);

BOOL SampleCode_SetIoPort(unsigned char _type, 
						  unsigned long _addr, 
						  unsigned long _value);



BOOL SampleCode_GetPciBus(	unsigned char _type, 
							unsigned char _bus, 
							unsigned char _device, 
							unsigned char _function, 
							unsigned char _index, 
							unsigned long &_data);

BOOL SampleCode_SetPciBus(	unsigned char _type, 
							unsigned char _bus, 
							unsigned char _device, 
							unsigned char _function, 
							unsigned char _index, 
							unsigned long _data);


BOOL SampleCode_GetMemBlock(	unsigned long	 _index,
								unsigned long	 _length,
								unsigned char	*_buffer);

BOOL SampleCode_SetMemBlock(	unsigned long	 _index,
								unsigned long	 _length,
								unsigned char	*_buffer);

BOOL SampleCode_GetCpuMsr(	HANDLE			_hproc,	
							unsigned char	_core, 
							unsigned long	_msr, 
							unsigned long	&_eax,
							unsigned long	&_ebx,
							unsigned long	&_ecx,
							unsigned long	&_edx);

BOOL SampleCode_SetCpuMsr(	HANDLE			_hproc,	
							unsigned char	_core, 
							unsigned long	_msr, 
							unsigned long	_eax,
							unsigned long	_ebx,
							unsigned long	_ecx,
							unsigned long	_edx);


#endif