- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm trying to make a bulk transfer using the IOCTL Interface of the cyusb.sys driver with Delphi, but the DeviceIOControl Function always returns 87 (ERROR_INVALID_PARAMETER).
I'm using the following Code :
procedure NonEP0TransferOut(handle:THandle;endPointAddress:Byte; pBuffer:PBuffer; bufferSize:Word);
const cBufSize = 512;
var
singleTransfer:SINGLE_TRANSFER;
buffer : array[0..cBufSize+SizeOf(SINGLE_TRANSFER)-1] of Byte;
i : Integer;
dwBytes: DWORD;
begin
ZeroMemory(@singleTransfer, SizeOf(SINGLE_TRANSFER));
SingleTransfer.SetupPacket.ulTimeOut := 1000;
singleTransfer.ucEndpointAddress := endPointAddress;
singleTransfer.IsoPacketLength := 0;
singleTransfer.BufferOffset := SizeOf(SINGLE_TRANSFER);
singleTransfer.BufferLength := bufferSize;
dwBytes := 0;
Move(SingleTransfer,Buffer,SizeOf(SINGLE_TRANSFER));
for i := 0 to bufferSize-1 do begin
buffer[i+SizeOf(TSingleTransfernEP0)] := pBuffer^; // buffer direkt hinter den SINGLE_TRANFER record schreiben
end;
if not DeviceIoControl( handle,IOCTL_ADAPT_SEND_NON_EP0_TRANSFER,
@buffer, bufferSize+SizeOf(SINGLE_TRANSFER),
@buffer, bufferSize+SizeOf(SINGLE_TRANSFER),
dwBytes,nil) then
raise ECyUSBException.Create('Error #17 during nonEP0 control Transfer : ' + IntToStr(getLastError()));
end;
The SINGLE_TRANSFER structure seems to be correct. It works fine for EP0 Transfers. I also tried IOCTL_ADAPT_SEND_NON_EP0_DIRECT, which gives the same error. Can someone tell me what I'm doing wrong ?
regards
Simon Koops
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have the solution now, i used pipe address instead of descriptor address. now it works
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Glad to hear that the problem is solved now, and good that you shared it here.
Regards,
Gayathri