阅读:1264回复:0
新人,求助,关于串口驱动,谢谢!
status = IoCreateDevice( DriverObject,
sizeof(DEVICE_EXTENSION), &deviceName, FILE_DEVICE_SERIAL_PORT, 0, TRUE, &pDevObj ); //创建设备对象 status = IoCreateSymbolicLink(&linkName,&deviceName); pDevExt = (PDEVICE_EXTENSION)pDevObj->DeviceExtension; pDevExt->MyDriver = pDevObj; RtlInitUnicodeString(&val,L"Vcom"); status = RtlWriteRegistryValue(RTL_REGISTRY_DEVICEMAP, (PWSTR)L"SERIALCOMM", deviceName.Buffer, REG_SZ, val.Buffer, val.Length + sizeof(WCHAR)); //在DEVICEMAP下的SERIALCOMM建立新的值 pDevObj->Flags &= DO_BUFFERED_IO; pDevObj->Flags &= ~DO_DEVICE_INITIALIZING; 在CreateDriver中做了这些代码,请问是否还要加上其他代码,在超级终端中总是说无法打开端口.. |
|