阅读:789回复:2
在自己的驱动里调用串口驱动,怎么写不了?
status = ZwCreateFile( &com1Handle,
GENERIC_READ | GENERIC_WRITE, &ObjectAttributes, &IoStatus, 0, // alloc size = none FILE_ATTRIBUTE_NORMAL, FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, 0, NULL, // eabuffer 0 ); // ealength if( NT_SUCCESS(status) && com1Handle != NULL) { HANDLE threadHandle; DebugPrint( \"Open com1 success\"); status = ZwWriteFile( com1Handle, NULL, NULL, NULL, &IoStatus, ReceiveBuffer, 2, NULL, NULL); if(! NT_SUCCESS(status)) DebugPrint(\"Write Error\"); } DebugPrint(\"ReadCom1Thread end\"); ZwClose(com1Handle); |
|
|
沙发#
发布于:2003-11-24 16:48
为什么我写的时候总是出错?
老是打印 Write Error\"。 请热心大虾帮助! |
|
|
板凳#
发布于:2003-11-24 16:50
补充: CreateFile 是成功的,我打开的是:\\device\\serial0.
|
|
|