I have a driver source code, and understand it. I write a app under user mode. I want to call functions of driver. How should I do?
some driver headers code:
...
BYTE ReadRegister(DEVICE_CONTEXT *pDevice, BYTE SlavAddr, BYTE SlavMode, WORD RegAddr, BYTE* pData, BYTE DataCont);
BYTE WriteRegister(DEVICE_CONTEXT *pDevice, BYTE SlavAddr, BYTE SlavMode, WORD RegAddr, BYTE* pData, BYTE DataCont);
...
driver cpp code pieces:
BYTE ReadRegister(DEVICE_CONTEXT *pDevice, BYTE SlavAddr, BYTE SlavMode, WORD RegAddr, BYTE* pData, BYTE DataCont)
{
.....
}
//-----------------------------------------------------------------------------
BYTE WriteRegister(DEVICE_CONTEXT *pDevice, BYTE SlavAddr, BYTE SlavMode, WORD RegAddr, BYTE* pData, BYTE DataCont)
{
....
}
You could not call directly kernel-mode driver API function. You shall use IOCTL API instead.
Usual workflow scenario is like this:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With