⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hwreadwrite.h

📁 Windows下Hardware直接读写
💻 H
字号:
#pragma once

#include "afxtempl.h"
#include "pciop.h"


//Get PCI Config Information
// saved in the list
class CHwReadWrite
{
public:
	CHwReadWrite(void);
	~CHwReadWrite(void);
	bool GetFirstPciConfig(PCIDEVQUERY pciQuery);
	CList <PCIQUERYRESULT, PCIQUERYRESULT&> listPciQueryResults;
	// Init the device driver, open the service and start, return the handle
	HANDLE InitHwRwDriver(char* DriverName, char* DriverLocationFile);
	HANDLE m_hDevice;
	void CloseHwRwDriver(char* DriverName, char* DriverLocationFile);
	int GetAllPciConfig(void);
	int TestBufferIo(void);
	bool GetPortVal(WORD wPortAddr, PDWORD pdwPortVal, BYTE bSize);
	bool SetPortVal(WORD wPortAddr, DWORD dwPortVal, BYTE bSize);
	// Get the Memory Data from physical address
	bool GetMemoryData(PBYTE phyAddress, unsigned long rSize, PBYTE rBuffer);
	// Test if the byte is writable
	bool TestMemoryWritable(PBYTE memAddress, unsigned long offset);
	// Write the Memory Data to physical address
	bool SetMemoryData(PBYTE phyAddress, unsigned long rSize, PBYTE rBuffer);
private:
	TCHAR m_cDriverLocation[MAX_PATH + 10];
};


extern CHwReadWrite* gpHwRw;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -