예제 #1
0
DWORD CUsbIo::GetStatus(
        USHORT& StatusValue,
        USBIO_REQUEST_RECIPIENT Recipient,
        USHORT Index/*=0*/ )
{
  DWORD Status;
  USBIO_STATUS_REQUEST req;
  USBIO_STATUS_REQUEST_DATA data;

  // zero the structs if any fields are added...
  ZeroMemory(&req,sizeof(req));
  ZeroMemory(&data,sizeof(data));
  req.Recipient = Recipient;
  req.Index = Index;
  
  Status = IoctlSync(
              IOCTL_USBIO_GET_STATUS,
              &req,
              sizeof(req),
              &data,
              sizeof(data),
              NULL
              );

  StatusValue = data.Status;

  return Status;
}
예제 #2
0
DWORD CUsbIo::SetDescriptor(
        const void* Buffer,
        DWORD& ByteCount,
        USBIO_REQUEST_RECIPIENT Recipient,
        UCHAR DescriptorType,
        UCHAR DescriptorIndex/*=0*/,
        USHORT LanguageId/*=0*/ 
        )
{
  DWORD Status;
  USBIO_DESCRIPTOR_REQUEST req;

  // zero the struct if any fields are added...
  ZeroMemory(&req,sizeof(req));
  req.Recipient = Recipient;
  req.DescriptorType = DescriptorType;
  req.DescriptorIndex = DescriptorIndex;
  req.LanguageId = LanguageId;
  
  Status = IoctlSync(
              IOCTL_USBIO_SET_DESCRIPTOR,
              &req,
              sizeof(req),
              (void*)Buffer,
              ByteCount,
              &ByteCount
              );

  return Status;
}
예제 #3
0
DWORD CUsbIo::ClearFeature(
        USBIO_REQUEST_RECIPIENT Recipient,
        USHORT FeatureSelector,
        USHORT Index/*=0*/ 
        )
{
  DWORD Status;
  USBIO_FEATURE_REQUEST req;

  // zero the struct if any fields are added...
  ZeroMemory(&req,sizeof(req));
  req.Recipient = Recipient;
  req.FeatureSelector = FeatureSelector;
  req.Index = Index;
  
  Status = IoctlSync(
              IOCTL_USBIO_CLEAR_FEATURE,
              &req,
              sizeof(req),
              NULL,
              0,
              NULL
              );

  return Status;
}
예제 #4
0
DWORD CUsbIo::GetInterface(
        UCHAR& AlternateSetting,
        USHORT Interface/*=0*/
        )
{
  DWORD Status;
  USBIO_GET_INTERFACE req;
  USBIO_GET_INTERFACE_DATA data;

  // zero the structs if any fields are added...
  ZeroMemory(&req,sizeof(req));
  ZeroMemory(&data,sizeof(data));
  req.Interface = Interface;
  
  Status = IoctlSync(
              IOCTL_USBIO_GET_INTERFACE,
              &req,
              sizeof(req),
              &data,
              sizeof(data),
              NULL
              );

  AlternateSetting = data.AlternateSetting;

  return Status;
}
예제 #5
0
void UsbDkRedirectorAccess::SetAltsetting(ULONG64 InterfaceIdx, ULONG64 AltSettingIdx)
{
    USBDK_ALTSETTINGS_IDXS AltSetting;
    AltSetting.InterfaceIdx = InterfaceIdx;
    AltSetting.AltSettingIdx = AltSettingIdx;

    IoctlSync(IOCTL_USBDK_DEVICE_SET_ALTSETTING, false, &AltSetting, sizeof(AltSetting));
}
예제 #6
0
DWORD CUsbIo::GetBandwidthInfo(USBIO_BANDWIDTH_INFO* BandwidthInfo)
{
  return IoctlSync(
              IOCTL_USBIO_GET_BANDWIDTH_INFO,
              NULL,
              0,
              BandwidthInfo,
              sizeof(USBIO_BANDWIDTH_INFO),
              NULL
              );
}
예제 #7
0
DWORD CUsbIo::GetDeviceInfo(USBIO_DEVICE_INFO* DeviceInfo)
{
  return IoctlSync(
              IOCTL_USBIO_GET_DEVICE_INFO,
              NULL,
              0,
              DeviceInfo,
              sizeof(USBIO_DEVICE_INFO),
              NULL
              );
}
예제 #8
0
DWORD CUsbIo::UnconfigureDevice()
{
  DWORD Status;

  Status = IoctlSync(
              IOCTL_USBIO_UNCONFIGURE_DEVICE,
              NULL,
              0,
              NULL,
              0,
              NULL
              );

  return Status;
}
예제 #9
0
DWORD CUsbIo::SetConfiguration(const USBIO_SET_CONFIGURATION* Conf)
{
  DWORD Status;

  Status = IoctlSync(
              IOCTL_USBIO_SET_CONFIGURATION,
              Conf,
              sizeof(USBIO_SET_CONFIGURATION),
              NULL,
              0,
              NULL
              );

  return Status;
}
예제 #10
0
DWORD CUsbIo::ReleaseDevice()
{
 DWORD Status;

  Status = IoctlSync(
              IOCTL_USBIO_RELEASE_DEVICE,
              NULL,
              0,
              NULL,
              0,
              NULL
              );

  return Status;
}
예제 #11
0
DWORD CUsbIo::SetInterface(const USBIO_INTERFACE_SETTING* Setting)
{
  DWORD Status;

  Status = IoctlSync(
              IOCTL_USBIO_SET_INTERFACE,
              Setting,
              sizeof(USBIO_INTERFACE_SETTING),
              NULL,
              0,
              NULL
              );

  return Status;
}
예제 #12
0
DWORD CUsbIo::GetDriverInfo(USBIO_DRIVER_INFO *DriverInfo)
{
  DWORD Status;

  Status = IoctlSync(
              IOCTL_USBIO_GET_DRIVER_INFO,
              NULL,
              0,
              DriverInfo,
              sizeof(USBIO_DRIVER_INFO),
              NULL
              );

  return Status;
}
예제 #13
0
DWORD CUsbIo::CyclePort()
{
  DWORD Status;

  Status = IoctlSync(
              IOCTL_USBIO_CYCLE_PORT,
              NULL,
              0,
              NULL,
              0,
              NULL
              );

  return Status;
}
예제 #14
0
DWORD CUsbIo::SetDevicePowerState(USBIO_DEVICE_POWER_STATE DevicePowerState)
{
  USBIO_DEVICE_POWER PowerRequest;

  PowerRequest.DevicePowerState = DevicePowerState;

  return IoctlSync(
              IOCTL_USBIO_SET_DEVICE_POWER_STATE,
              &PowerRequest,
              sizeof(USBIO_DEVICE_POWER),
              NULL,
              0,
              NULL
              );
}
예제 #15
0
DWORD CUsbIo::SetDeviceParameters(const USBIO_DEVICE_PARAMETERS *DevParam)
{
  DWORD Status;

  Status = IoctlSync(
              IOCTL_USBIO_SET_DEVICE_PARAMETERS,
              DevParam,
              sizeof(USBIO_DEVICE_PARAMETERS),
              NULL,
              0,
              NULL
              );

  return Status;
}
예제 #16
0
DWORD CUsbIo::ResetDevice()
{
  DWORD Status;

  Status = IoctlSync(
              IOCTL_USBIO_RESET_DEVICE,
              NULL,
              0,
              NULL,
              0,
              NULL
              );

  return Status;
}
예제 #17
0
DWORD CUsbIo::StoreConfigurationDescriptor(const USB_CONFIGURATION_DESCRIPTOR *Desc)
{
  DWORD Status;

  Status = IoctlSync(
              IOCTL_USBIO_STORE_CONFIG_DESCRIPTOR,
              Desc,
              Desc->wTotalLength,
              NULL,
              0,
              NULL
              );

  return Status;
}
예제 #18
0
DWORD CUsbIo::AcquireDevice()
{
 DWORD Status;

  Status = IoctlSync(
              IOCTL_USBIO_ACQUIRE_DEVICE,
              NULL,
              0,
              NULL,
              0,
              NULL
              );

  return Status;
}
예제 #19
0
DWORD CUsbIo::GetDeviceParameters(USBIO_DEVICE_PARAMETERS *DevParam)
{
  DWORD Status;

  // zero the struct if any fields are added...
  ZeroMemory(DevParam,sizeof(USBIO_DEVICE_PARAMETERS));

  Status = IoctlSync(
              IOCTL_USBIO_GET_DEVICE_PARAMETERS,
              NULL,
              0,
              DevParam,
              sizeof(USBIO_DEVICE_PARAMETERS),
              NULL
              );

  return Status;
}
예제 #20
0
DWORD CUsbIo::GetConfigurationInfo(USBIO_CONFIGURATION_INFO *Info)
{
  DWORD Status;

  // zero the struct if any fields are added...
  ZeroMemory(Info,sizeof(USBIO_CONFIGURATION_INFO));

  Status = IoctlSync(
              IOCTL_USBIO_GET_CONFIGURATION_INFO,
              NULL,
              0,
              Info,
              sizeof(USBIO_CONFIGURATION_INFO),
              NULL
              );

  return Status;
}
예제 #21
0
DWORD CUsbIo::ClassOrVendorOutRequest(
        const void* Buffer,
        DWORD& ByteCount,
        const USBIO_CLASS_OR_VENDOR_REQUEST* Request
        )
{
  DWORD Status;

  Status = IoctlSync(
              IOCTL_USBIO_CLASS_OR_VENDOR_OUT_REQUEST,
              Request,
              sizeof(USBIO_CLASS_OR_VENDOR_REQUEST),
              (void*)Buffer,
              ByteCount,
              &ByteCount
              );

  return Status;
}
예제 #22
0
DWORD CUsbIo::GetDevicePowerState(USBIO_DEVICE_POWER_STATE& DevicePowerState)
{
  USBIO_DEVICE_POWER PowerRequest;
  DWORD err;

  // zero the struct if any fields are added...
  ZeroMemory(&PowerRequest,sizeof(PowerRequest));

  err = IoctlSync(
              IOCTL_USBIO_GET_DEVICE_POWER_STATE,
              NULL,
              0,
              &PowerRequest,
              sizeof(USBIO_DEVICE_POWER),
              NULL
              );
  if ( err == USBIO_ERR_SUCCESS ) {
    DevicePowerState = PowerRequest.DevicePowerState;
  }
  return err;
}
예제 #23
0
DWORD CUsbIo::GetCurrentFrameNumber(DWORD &FrameNumber)
{
  DWORD Status;
  USBIO_FRAME_NUMBER data;

  // zero the struct if any fields are added...
  ZeroMemory(&data,sizeof(data));

  Status = IoctlSync(
              IOCTL_USBIO_GET_CURRENT_FRAME_NUMBER,
              NULL,
              0,
              &data,
              sizeof(data),
              NULL
              );

  FrameNumber = data.FrameNumber;

  return Status;
}
예제 #24
0
DWORD CUsbIo::GetConfiguration(UCHAR& ConfigurationValue)
{
  DWORD Status;
  USBIO_GET_CONFIGURATION_DATA data;

  // zero the struct
  ZeroMemory(&data,sizeof(data));
  
  Status = IoctlSync(
              IOCTL_USBIO_GET_CONFIGURATION,
              NULL,
              0,
              &data,
              sizeof(data),
              NULL
              );

  ConfigurationValue = data.ConfigurationValue;

  return Status;
}
예제 #25
0
void UsbDkRedirectorAccess::ResetDevice()
{
    IoctlSync(IOCTL_USBDK_DEVICE_RESET_DEVICE);
}
예제 #26
0
void UsbDkRedirectorAccess::ResetPipe(ULONG64 PipeAddress)
{
    IoctlSync(IOCTL_USBDK_DEVICE_RESET_PIPE, false, &PipeAddress, sizeof(PipeAddress));
}