阅读:1151回复:1
DS开发出来的USB驱动请教~~~
《10分钟开发一个USB驱动》里面做出来的TEST.exe,可以用来打开USB的一个灯吗?里面有这样的程序:
NTSTATUS TESTDevice::TEST_IOCTL_LED_Handler(KIrp I) { NTSTATUS status = STATUS_INVALID_PARAMETER; t << \"Entering TESTDevice::TEST_IOCTL_LED_Handler, \" << I << EOL; __try { // TODO: Verify that the input parameters are correct // If not, return STATUS_INVALID_PARAMETER if(I.IoctlOutputBufferSize() || !I.IoctlBuffer() || (I.IoctlInputBufferSize() != sizeof(UCHAR))) __leave; // TODO: Handle the the ZBUARD_IOCTL_LED_ON request, or // defer the processing of the IRP (i.e. by queuing) and set // status to STATUS_PENDING. PURB pUrb = m_Lower.BuildVendorRequest( NULL, // transfer buffer 0, // transfer buffer size 0, // request reserved bits (UCHAR)(*(PUCHAR)I.IoctlBuffer()), // request. 1 = LED_ON, 0 = LED_OFF 0 // Value ); // transmit status = m_Lower.SubmitUrb(pUrb, NULL, NULL, 5000L); } __finally { // TODO: Assuming that the request was handled here. Set I.Information // to indicate how much data to copy back to the user. I.Information() = 0; I.Status() = status; } return status; } 如何把里面的程序改一下可使USB设备的灯亮和灭,达到控制? 有人知道如何改吗?请教。 [编辑 - 6/8/03 by Pcidler_Beny] |
|
沙发#
发布于:2003-06-09 00:58
TODO要怎么改?
好心人教一教我吧,急啊~~~ DEBUG编译成功通过;FREE和RELEASE不能通过,错误为:“TESTDEVICE”为未定义的类。 如果我只要在电脑上实现控制设备的灯亮和灭就行,那我用DEBUG 编译出来的TEST.EXE要作修改吗? [编辑 - 6/9/03 by Pcidler_Beny] [编辑 - 6/9/03 by Pcidler_Beny] |
|