channels/urbdrc: fix compilation

This commit is contained in:
Marc-André Moreau 2012-11-13 11:19:17 -05:00
parent 53135af2f0
commit d2728aa2ee
2 changed files with 22 additions and 17 deletions

View File

@ -715,18 +715,19 @@ static int urb_control_transfer(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data,
static int urb_bulk_or_interrupt_transfer(URBDRC_CHANNEL_CALLBACK* callback, BYTE* data,
UINT32 data_sizem, UINT32 MessageId, IUDEVMAN* udevman, UINT32 UsbDevice, int transferDir)
{
IUDEVICE * pdev;
UINT32 out_size, RequestId, InterfaceId, EndpointAddress, PipeHandle;
UINT32 TransferFlags, OutputBufferSize, usbd_status = 0;
BYTE * Buffer;
BYTE * out_data;
int offset;
int offset;
BYTE* Buffer;
IUDEVICE* pdev;
BYTE* out_data;
UINT32 out_size, RequestId, InterfaceId, EndpointAddress, PipeHandle;
UINT32 TransferFlags, OutputBufferSize, usbd_status = 0;
pdev = udevman->get_udevice_by_UsbDevice(udevman, UsbDevice);
if (pdev == NULL)
return 0;
InterfaceId = ((STREAM_ID_PROXY<<30) | pdev->get_ReqCompletion(pdev));
InterfaceId = ((STREAM_ID_PROXY << 30) | pdev->get_ReqCompletion(pdev));
data_read_UINT32(data + 0, RequestId);
data_read_UINT32(data + 4, PipeHandle);
@ -740,7 +741,8 @@ static int urb_bulk_or_interrupt_transfer(URBDRC_CHANNEL_CALLBACK* callback, BYT
else
out_size = 36 + OutputBufferSize;
out_data = (BYTE *) malloc(out_size);
Buffer = NULL;
out_data = (BYTE*) malloc(out_size);
memset(out_data, 0, out_size);
switch (transferDir)
@ -748,10 +750,12 @@ static int urb_bulk_or_interrupt_transfer(URBDRC_CHANNEL_CALLBACK* callback, BYT
case USBD_TRANSFER_DIRECTION_OUT:
Buffer = data + offset;
break;
case USBD_TRANSFER_DIRECTION_IN:
Buffer = out_data + 36;
break;
}
/** process URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER */
pdev->bulk_or_interrupt_transfer(
pdev, RequestId, EndpointAddress,

View File

@ -21,6 +21,7 @@
#ifndef __MSCONFIG_H
#define __MSCONFIG_H
#include <freerdp/api.h>
#include <freerdp/types.h>
#include <freerdp/utils/memory.h>
#include <freerdp/utils/stream.h>
@ -120,18 +121,18 @@ struct _MSUSB_CONFIG_DESCRIPTOR
} __attribute__((packed));
/* MSUSB_PIPE exported functions */
void msusb_mspipes_replace(MSUSB_INTERFACE_DESCRIPTOR* MsInterface, MSUSB_PIPE_DESCRIPTOR** NewMsPipes, UINT32 NewNumberOfPipes);
FREERDP_API void msusb_mspipes_replace(MSUSB_INTERFACE_DESCRIPTOR* MsInterface, MSUSB_PIPE_DESCRIPTOR** NewMsPipes, UINT32 NewNumberOfPipes);
/* MSUSB_INTERFACE exported functions */
void msusb_msinterface_replace(MSUSB_CONFIG_DESCRIPTOR* MsConfig, BYTE InterfaceNumber, MSUSB_INTERFACE_DESCRIPTOR* NewMsInterface);
MSUSB_INTERFACE_DESCRIPTOR* msusb_msinterface_read(BYTE* data, UINT32 data_size, int* offset);
int msusb_msinterface_write(MSUSB_INTERFACE_DESCRIPTOR* MsInterface, BYTE* data, int* offset);
FREERDP_API void msusb_msinterface_replace(MSUSB_CONFIG_DESCRIPTOR* MsConfig, BYTE InterfaceNumber, MSUSB_INTERFACE_DESCRIPTOR* NewMsInterface);
FREERDP_API MSUSB_INTERFACE_DESCRIPTOR* msusb_msinterface_read(BYTE* data, UINT32 data_size, int* offset);
FREERDP_API int msusb_msinterface_write(MSUSB_INTERFACE_DESCRIPTOR* MsInterface, BYTE* data, int* offset);
/* MSUSB_CONFIG exported functions */
MSUSB_CONFIG_DESCRIPTOR* msusb_msconfig_new();
void msusb_msconfig_free(MSUSB_CONFIG_DESCRIPTOR* MsConfig);
MSUSB_CONFIG_DESCRIPTOR* msusb_msconfig_read(BYTE* data, UINT32 data_size, UINT32 NumInterfaces);
int msusb_msconfig_write(MSUSB_CONFIG_DESCRIPTOR* MsConfg, BYTE* data, int * offset);
void msusb_msconfig_dump(MSUSB_CONFIG_DESCRIPTOR* MsConfg);
FREERDP_API MSUSB_CONFIG_DESCRIPTOR* msusb_msconfig_new();
FREERDP_API void msusb_msconfig_free(MSUSB_CONFIG_DESCRIPTOR* MsConfig);
FREERDP_API MSUSB_CONFIG_DESCRIPTOR* msusb_msconfig_read(BYTE* data, UINT32 data_size, UINT32 NumInterfaces);
FREERDP_API int msusb_msconfig_write(MSUSB_CONFIG_DESCRIPTOR* MsConfg, BYTE* data, int * offset);
FREERDP_API void msusb_msconfig_dump(MSUSB_CONFIG_DESCRIPTOR* MsConfg);
#endif