高手救急!NTDDK的问题

001kill 2000-02-13 10:40:00
我把NT的DRIVER写出来了,但在编写用户模式的应用程序时遇到麻烦了!
当DRIVER收到一个中断请求时,我应该怎么把这个信息通知给应用程序?
换句话说,就是我需要在应用程序实现一个函数,它能把线程挂起,又不占CPU大量时间,等待数据来。WIN32SDK中串口就有这么一个功能的函数。
我在DDK的SAMPLE中没找到我想要的例子,各位高手,救命!
最好有原程序,或告诉我在哪里,我自己去找!
...全文
267 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
茂奇软件 2000-05-22
  • 打赏
  • 举报
回复
welcome to disscuss DDK in the asm group.
sanhan 2000-05-22
  • 打赏
  • 举报
回复
也可以用APC(异步过程调用)。等我回去查查书:)
001kill 2000-05-22
  • 打赏
  • 举报
回复
thank you very much!
茂奇软件 2000-04-19
  • 打赏
  • 举报
回复
HI 001kill,
the logrecord is in the dd\filemon.c

I also agree the advice of the lu0.

I'm the master of the asm discussion group.
I'd like to see some driver problem at asm
field
thanks.

yours jansen. I hope to got all score again.
lu0 2000-04-19
  • 打赏
  • 举报
回复
DRIVER SIDE

NTSTATUS DriverEntry(IN PDRIVER_OBJECT DriverObject,IN PUNICODE_STRING
RegistryPath)
{
...
// Create a named notification event that will be used to signal when
// the timer routine has hit its count. Make sure to set the state to
// non-signalled.
//
RtlInitUnicodeString(&eventName,
L"\\BaseNamedObjects\\Async2SignalEvt");
extension->Event =
IoCreateNotificationEvent(&eventName,&extension->Handle);

if(!extension->Event) {
IoDeleteDevice(DeviceObject);
return(STATUS_UNSUCCESSFUL);
}

KeClearEvent(extension->Event);

...
}

And when you want to send the event to the appli. :

KeSetEvent(extension->Event,0,FALSE);
KeClearEvent(extension->Event);


APPLICATION SIDE

VOID SignalEvent186(VOID)
{
HANDLE event;
USHORT count = 0;
event = OpenEvent(SYNCHRONIZE,FALSE,"Async2SignalEvt");

if (event == NULL)
{
Tracef("Error opening event: %d\n", GetLastError()) ;
return;
}

for(;;) {
WaitForSingleObject(event,INFINITE);
Tracef("Event signalled! .... count = %d",count++);
}
CloseHandle(event);
}
001kill 2000-04-17
  • 打赏
  • 举报
回复
jansen,thank you,But I can not find function :LogRecord.
CoGi,thank you too,let me try!
wait , I will give me score to you .
CoGi 2000-04-16
  • 打赏
  • 举报
回复
创建一个命名的EVENT,在win32下用CreateEvent,就可以在driver and application
间传送消息了
注意driver中消息的设置只可在Passive_Level下!!
Wish it can help you.
并请你呼吁斑竹创建driver版
茂奇软件 2000-04-14
  • 打赏
  • 举报
回复
Hi 001kill,
Do you have finished read it?

yours jansen.
OpenBall 2000-04-13
  • 打赏
  • 举报
回复
你指的是不是虚拟设备驱动程序?Driver接到终端后,可以查询正在运行的其他程序。得到局柄后,PostMessage 即可。
茂奇软件 2000-04-13
  • 打赏
  • 举报
回复
there is a demo of file system filter.
the url is :
http://www.sysinternals.com/filesrc.zip

Would you please reference the function:
LogRecord, which is a function pass message to
the GUI application.

yours jansen.
I hope to got all the 400 point.
thanks
001kill 2000-02-17
  • 打赏
  • 举报
回复
就命啊

16,466

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧