hwreadwrite.h

来自「Windows下Hardware直接读写」· C头文件 代码 · 共 36 行

H
36
字号
#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 + =
减小字号Ctrl + -
显示快捷键?