当前位置: 首页>>代码示例>>C++>>正文


C++ GetDefaultReply函数代码示例

本文整理汇总了C++中GetDefaultReply函数的典型用法代码示例。如果您正苦于以下问题:C++ GetDefaultReply函数的具体用法?C++ GetDefaultReply怎么用?C++ GetDefaultReply使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了GetDefaultReply函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetDefaultReply

IPCCommandResult ES::ImportTitleDone(Context& context, const IOCtlVRequest& request)
{
  if (!request.HasNumberOfValidVectors(0, 0))
    return GetDefaultReply(ES_EINVAL);

  return GetDefaultReply(ImportTitleDone(context));
}
开发者ID:OrN,项目名称:dolphin,代码行数:7,代码来源:TitleManagement.cpp

示例2: INFO_LOG

IPCCommandResult NetIPTop::HandleSetSockOptRequest(const IOCtlRequest& request)
{
  u32 fd = Memory::Read_U32(request.buffer_in);
  u32 level = Memory::Read_U32(request.buffer_in + 4);
  u32 optname = Memory::Read_U32(request.buffer_in + 8);
  u32 optlen = Memory::Read_U32(request.buffer_in + 0xc);
  u8 optval[20];
  optlen = std::min(optlen, (u32)sizeof(optval));
  Memory::CopyFromEmu(optval, request.buffer_in + 0x10, optlen);

  INFO_LOG(IOS_NET, "IOCTL_SO_SETSOCKOPT(%08x, %08x, %08x, %08x) "
                    "BufferIn: (%08x, %i), BufferOut: (%08x, %i)"
                    "%02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx "
                    "%02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx %02hhx",
           fd, level, optname, optlen, request.buffer_in, request.buffer_in_size,
           request.buffer_out, request.buffer_out_size, optval[0], optval[1], optval[2], optval[3],
           optval[4], optval[5], optval[6], optval[7], optval[8], optval[9], optval[10], optval[11],
           optval[12], optval[13], optval[14], optval[15], optval[16], optval[17], optval[18],
           optval[19]);

  // TODO: bug booto about this, 0x2005 most likely timeout related, default value on Wii is ,
  // 0x2001 is most likely tcpnodelay
  if (level == 6 && (optname == 0x2005 || optname == 0x2001))
    return GetDefaultReply(0);

  // Do the level/optname translation
  int nat_level = MapWiiSockOptLevelToNative(level);
  int nat_optname = MapWiiSockOptNameToNative(optname);

  int ret = setsockopt(WiiSockMan::GetInstance().GetHostSocket(fd), nat_level, nat_optname,
                       (char*)optval, optlen);
  return GetDefaultReply(WiiSockMan::GetNetErrorCode(ret, "SO_SETSOCKOPT", false));
}
开发者ID:Tinob,项目名称:Ishiiruka,代码行数:33,代码来源:Top.cpp

示例3: sizeof

IPCCommandResult ES::DeleteTicket(const IOCtlVRequest& request)
{
  if (!request.HasNumberOfValidVectors(1, 0) ||
      request.in_vectors[0].size != sizeof(IOS::ES::TicketView))
  {
    return GetDefaultReply(ES_EINVAL);
  }
  return GetDefaultReply(DeleteTicket(Memory::GetPointer(request.in_vectors[0].address)));
}
开发者ID:OrN,项目名称:dolphin,代码行数:9,代码来源:TitleManagement.cpp

示例4: GetDefaultReply

IPCCommandResult ES::GetTitleCount(const std::vector<u64>& titles, const IOCtlVRequest& request)
{
  if (!request.HasNumberOfValidVectors(0, 1) || request.io_vectors[0].size != 4)
    return GetDefaultReply(ES_EINVAL);

  Memory::Write_U32(static_cast<u32>(titles.size()), request.io_vectors[0].address);

  return GetDefaultReply(IPC_SUCCESS);
}
开发者ID:Anti-Ultimate,项目名称:dolphin,代码行数:9,代码来源:TitleInformation.cpp

示例5: GetDefaultReply

IPCCommandResult STMEventHook::IOCtl(const IOCtlRequest& request)
{
  if (request.request != IOCTL_STM_EVENTHOOK)
    return GetDefaultReply(IPC_EINVAL);

  if (s_event_hook_request)
    return GetDefaultReply(IPC_EEXIST);

  // IOCTL_STM_EVENTHOOK waits until the reset button or power button is pressed.
  s_event_hook_request = std::make_unique<IOCtlRequest>(request.address);
  return GetNoReply();
}
开发者ID:spankminister,项目名称:dolphin,代码行数:12,代码来源:STM.cpp

示例6: GetDefaultReply

IPCCommandResult USBHost::HandleTransfer(std::shared_ptr<USB::Device> device, u32 request,
                                         std::function<s32()> submit) const
{
  if (!device)
    return GetDefaultReply(IPC_ENOENT);

  const s32 ret = submit();
  if (ret == IPC_SUCCESS)
    return GetNoReply();

  ERROR_LOG(IOS_USB, "[%04x:%04x] Failed to submit transfer (request %u): %s", device->GetVid(),
            device->GetPid(), request, device->GetErrorName(ret).c_str());
  return GetDefaultReply(ret <= 0 ? ret : IPC_EINVAL);
}
开发者ID:Anti-Ultimate,项目名称:dolphin,代码行数:14,代码来源:Host.cpp

示例7: DEBUG_LOG

IPCCommandResult FileIO::IOCtl(const IOCtlRequest& request)
{
  DEBUG_LOG(IOS_FILEIO, "FileIO: IOCtl (Device=%s)", m_name.c_str());
  s32 return_value = IPC_SUCCESS;

  switch (request.request)
  {
  case ISFS_IOCTL_GETFILESTATS:
  {
    if (m_file->IsOpen())
    {
      DEBUG_LOG(IOS_FILEIO, "File: %s, Length: %" PRIu64 ", Pos: %i", m_name.c_str(),
                m_file->GetSize(), m_SeekPos);
      Memory::Write_U32(static_cast<u32>(m_file->GetSize()), request.buffer_out);
      Memory::Write_U32(m_SeekPos, request.buffer_out + 4);
    }
    else
    {
      return_value = FS_ENOENT;
    }
  }
  break;

  default:
    request.Log(GetDeviceName(), LogTypes::IOS_FILEIO, LogTypes::LERROR);
  }

  return GetDefaultReply(return_value);
}
开发者ID:spankminister,项目名称:dolphin,代码行数:29,代码来源:FileIO.cpp

示例8: GetDefaultReply

IPCCommandResult CWII_IPC_HLE_Device_di::Close(u32 _CommandAddress, bool _bForce)
{
    if (!_bForce)
        Memory::Write_U32(0, _CommandAddress + 4);
    m_Active = false;
    return GetDefaultReply();
}
开发者ID:gamax92,项目名称:Ishiiruka,代码行数:7,代码来源:WII_IPC_HLE_Device_DI.cpp

示例9: ERROR_LOG

IPCCommandResult CWII_IPC_HLE_Device_usb_oh1_57e_305_base::IOCtl(u32 command_address)
{
  // NeoGamma (homebrew) is known to use this path.
  ERROR_LOG(WII_IPC_WIIMOTE, "Bad IOCtl to /dev/usb/oh1/57e/305");
  Memory::Write_U32(FS_EINVAL, command_address + 4);
  return GetDefaultReply();
}
开发者ID:stenzek,项目名称:dolphin,代码行数:7,代码来源:WII_IPC_HLE_Device_usb_bt_base.cpp

示例10: HLE_IPC_BuildFilename

IPCCommandResult CWII_IPC_HLE_Device_FileIO::Open(u32 _CommandAddress, u32 _Mode)
{
  m_Mode = _Mode;
  u32 ReturnValue = 0;

  static const char* const Modes[] = {"Unk Mode", "Read only", "Write only", "Read and Write"};

  m_filepath = HLE_IPC_BuildFilename(m_Name);

  // The file must exist before we can open it
  // It should be created by ISFS_CreateFile, not here
  if (File::Exists(m_filepath) && !File::IsDirectory(m_filepath))
  {
    INFO_LOG(WII_IPC_FILEIO, "FileIO: Open %s (%s == %08X)", m_Name.c_str(), Modes[_Mode], _Mode);
    OpenFile();
    ReturnValue = m_DeviceID;
  }
  else
  {
    WARN_LOG(WII_IPC_FILEIO, "FileIO: Open (%s) failed - File doesn't exist %s", Modes[_Mode],
             m_filepath.c_str());
    ReturnValue = FS_FILE_NOT_EXIST;
  }

  if (_CommandAddress)
    Memory::Write_U32(ReturnValue, _CommandAddress + 4);
  m_Active = true;
  return GetDefaultReply();
}
开发者ID:stenzek,项目名称:dolphin,代码行数:29,代码来源:WII_IPC_HLE_Device_FileIO.cpp

示例11: DEBUG_LOG

IPCCommandResult CWII_IPC_HLE_Device_hid::Open(u32 _CommandAddress, u32 _Mode)
{
    DEBUG_LOG(WII_IPC_HID, "HID::Open");
    m_Active = true;
    Memory::Write_U32(GetDeviceID(), _CommandAddress + 4);
    return GetDefaultReply();
}
开发者ID:JanDevDE,项目名称:dolphin,代码行数:7,代码来源:WII_IPC_HLE_Device_hid.cpp

示例12: WARN_LOG

IPCCommandResult CWII_IPC_HLE_Device_FileIO::Write(u32 _CommandAddress)
{
	u32 ReturnValue = FS_EACCESS;
	const u32 Address = Memory::Read_U32(_CommandAddress + 0xC); // Write data from this memory address
	const u32 Size    = Memory::Read_U32(_CommandAddress + 0x10);

	if (m_file->IsOpen())
	{
		if (m_Mode == ISFS_OPEN_READ)
		{
			WARN_LOG(WII_IPC_FILEIO, "FileIO: Attempted to write 0x%x bytes from 0x%08x to a read-only file %s", Size, Address, m_Name.c_str());
		}
		else
		{
			INFO_LOG(WII_IPC_FILEIO, "FileIO: Write 0x%04x bytes from 0x%08x to %s", Size, Address, m_Name.c_str());
			m_file->Seek(m_SeekPos, SEEK_SET); // File might be opened twice, need to seek before we write
			if (m_file->WriteBytes(Memory::GetPointer(Address), Size))
			{
				ReturnValue = Size;
				m_SeekPos += Size;
			}
		}
	}
	else
	{
		ERROR_LOG(WII_IPC_FILEIO, "FileIO: Failed to read from %s (Addr=0x%08x Size=0x%x) - file could not be opened or does not exist", m_Name.c_str(), Address, Size);
		ReturnValue = FS_FILE_NOT_EXIST;
	}

	Memory::Write_U32(ReturnValue, _CommandAddress + 0x4);
	return GetDefaultReply();
}
开发者ID:hawkeye2777,项目名称:dolphin,代码行数:32,代码来源:WII_IPC_HLE_Device_FileIO.cpp

示例13: WARN_LOG

IPCCommandResult FileIO::Write(const ReadWriteRequest& request)
{
  s32 return_value = FS_EACCESS;
  if (m_file->IsOpen())
  {
    if (m_Mode == IOS_OPEN_READ)
    {
      WARN_LOG(IOS_FILEIO,
               "FileIO: Attempted to write 0x%x bytes from 0x%08x to a read-only file %s",
               request.size, request.buffer, m_name.c_str());
    }
    else
    {
      DEBUG_LOG(IOS_FILEIO, "FileIO: Write 0x%04x bytes from 0x%08x to %s", request.size,
                request.buffer, m_name.c_str());
      m_file->Seek(m_SeekPos,
                   SEEK_SET);  // File might be opened twice, need to seek before we write
      if (m_file->WriteBytes(Memory::GetPointer(request.buffer), request.size))
      {
        return_value = request.size;
        m_SeekPos += request.size;
      }
    }
  }
  else
  {
    ERROR_LOG(IOS_FILEIO, "FileIO: Failed to read from %s (Addr=0x%08x Size=0x%x) - file could "
                          "not be opened or does not exist",
              m_name.c_str(), request.buffer, request.size);
    return_value = FS_ENOENT;
  }

  return GetDefaultReply(return_value);
}
开发者ID:spankminister,项目名称:dolphin,代码行数:34,代码来源:FileIO.cpp

示例14: switch

IPCCommandResult SDIOSlot0::IOCtl(const IOCtlRequest& request)
{
  Memory::Memset(request.buffer_out, 0, request.buffer_out_size);

  switch (request.request)
  {
  case IOCTL_WRITEHCR:
    return WriteHCRegister(request);
  case IOCTL_READHCR:
    return ReadHCRegister(request);
  case IOCTL_RESETCARD:
    return ResetCard(request);
  case IOCTL_SETCLK:
    return SetClk(request);
  case IOCTL_SENDCMD:
    return SendCommand(request);
  case IOCTL_GETSTATUS:
    return GetStatus(request);
  case IOCTL_GETOCR:
    return GetOCRegister(request);
  default:
    ERROR_LOG(IOS_SD, "Unknown SD IOCtl command (0x%08x)", request.request);
    break;
  }

  return GetDefaultReply(IPC_SUCCESS);
}
开发者ID:Anti-Ultimate,项目名称:dolphin,代码行数:27,代码来源:SDIOSlot0.cpp


注:本文中的GetDefaultReply函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。