I'm using the ExtEscape/DrvEscape functions(with
application defined escape codes), to pass some parameters
into the driver. However, simply using EngProbeForRead
inside a try/except block, does not seem to be working; as
it throws access violation exceptions everytime, even
though the pointer is valid. Is there a specific way of
doing this? I've submitted code snippets to show what
I've done.
In Userlevel application:
InputBuf.Length = sizeof(INPUTBUF);
InputBuf.ulValue = VALUE;
ExtEscape(m_hdc, APP_ESC, InputBuf.Length, (LPCSTR)
&InputBuf, 0, NULL);
In DrvEscape:
pInputBuf = (PINPUTBUF)pvIn;
__try
{
EngProbeForRead(pInputBuf, cjIn, 1);
}
__except( EXCEPTION_EXECUTE_HANDLER )
{
Kprint((0, "DrvEscape: EngProbe failed!\n"));
}