Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista Drivers > USB to serial virtual Driver

Reply
Thread Tools Display Modes

USB to serial virtual Driver

 
 
Junior Member
Join Date: Oct 2010
Posts: 2

 
      10-29-2010
i am unable to send the proper character, it is printing junk characters in the remote system

Even i checked with the IOCTL_LINE_CONTROL, Baudrate.. everything is correct
plz help me out, how do i proceed, or give some hints,

the sample code is below.....


NTSTATUS
WriteUrb(
PDEVICE_EXTENSION Extension
)
{

USBD_PIPE_HANDLE PipeHandle;
BOOLEAN startirp;
KIRQL oldirql;
PIRP Irp;
PURB urb;
PIO_STACK_LOCATION stack;

if (Extension->writepending)
startirp = FALSE;
else
startirp = TRUE, Extension->writepending = TRUE;

if (!startirp)
return STATUS_DEVICE_BUSY;

Irp = Extension->WritingIrp;
urb = Extension->WritingUrb;
PipeHandle = Extension->UsbInterface->Pipes[Extension->DataOutPipe].PipeHandle;

ASSERT(Irp && urb);
// Initialize the URB we use for reading the interrupt pipe

UsbBuildInterruptOrBulkTransferRequest(
urb,
sizeof (struct _URB_BULK_OR_INTERRUPT_TRANSFER),
PipeHandle,
Extension->WriteCurrentChar,
NULL,
Extension->WriteSize,
USBD_TRANSFER_DIRECTION_OUT,
NULL);

// Install "OnInterrupt" as the completion routine for the polling IRP.

IoSetCompletionRoutine(
Irp,
(PIO_COMPLETION_ROUTINE) OnWriteInterrupt,
Extension,
TRUE,
TRUE,
TRUE);

// Initialize the IRP for an internal control request

stack = IoGetNextIrpStackLocation(Irp);
stack->MajorFunction = IRP_MJ_INTERNAL_DEVICE_CONTROL;
stack->Parameters.DeviceIoControl.IoControlCode = IOCTL_INTERNAL_USB_SUBMIT_URB;
stack->Parameters.Others.Argument1 = urb;


Irp->Cancel = FALSE;

return IoCallDriver(Extension->TopOfStackDeviceObject, Irp);
}
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DTM Studio 1.5 New Submission Fails Ken Spikowski Windows Vista Drivers 1 02-25-2010 06:52 PM
COM port driver inf issue shivaprasad Windows Vista Drivers 4 11-14-2009 04:45 PM
crcdisk.sys start up problem (with boot log) Jimmy Windows Vista Hardware 2 08-13-2007 07:22 PM
Missing VGA driver rh0000 Windows Vista Hardware 14 06-13-2007 10:21 AM
Going Golfing but not with Vista markbyrn Windows Vista Games 15 03-08-2007 10:59 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59