コード例 #1
0
void ObScript_DumpCommands(void)
{
	_MESSAGE("block types:");
	DumpCommands(g_blockTypeStart, g_blockTypeEnd);
	_MESSAGE("console commands");
	DumpCommands(g_consoleCommandsStart, g_consoleCommandsEnd);
	_MESSAGE("script commands");
	DumpCommands(g_scriptCommandsStart, g_scriptCommandsEnd);
}
コード例 #2
0
bool CWII_IPC_HLE_Device_usb_kbd::Write(u32 _CommandAddress)
{
	INFO_LOG(WII_IPC_STM, "Ignoring write to CWII_IPC_HLE_Device_usb_kbd");
#if defined(_DEBUG) || defined(DEBUGFAST)
	DumpCommands(_CommandAddress, 10, LogTypes::WII_IPC_STM, LogTypes::LDEBUG);
#endif
	return true;
}
コード例 #3
0
bool CWII_IPC_HLE_Device_FileIO::IOCtl(u32 _CommandAddress) 
{
	INFO_LOG(WII_IPC_FILEIO, "FileIO: IOCtl (Device=%s)", m_Name.c_str());
#if defined(_DEBUG) || defined(DEBUGFAST)
	DumpCommands(_CommandAddress);
#endif
	const u32 Parameter =  Memory::Read_U32(_CommandAddress + 0xC);	
	u32 ReturnValue = 0;

	switch (Parameter)
	{
	case ISFS_IOCTL_GETFILESTATS:
		{
			if (auto file = OpenFile())
			{
				u32 m_FileLength = (u32)file.GetSize();

				const u32 BufferOut = Memory::Read_U32(_CommandAddress + 0x18);
				INFO_LOG(WII_IPC_FILEIO, "FileIO: ISFS_IOCTL_GETFILESTATS");
				INFO_LOG(WII_IPC_FILEIO, "  File: %s, Length: %i, Pos: %i", m_Name.c_str(), m_FileLength, m_SeekPos);

				Memory::Write_U32(m_FileLength, BufferOut);
				Memory::Write_U32(m_SeekPos, BufferOut+4);
			}
			else
			{
				ReturnValue = FS_FILE_NOT_EXIST;
			}
		}
		break;

	default:
		{
			PanicAlert("CWII_IPC_HLE_Device_FileIO: Parameter %i", Parameter);
		}
		break;

	}

	Memory::Write_U32(ReturnValue, _CommandAddress + 0x4);

	return true;
}
コード例 #4
0
ファイル: linktool.cpp プロジェクト: Andrel322/gecko-dev
int wmain(int argc, WCHAR* argv[])
{
  WCHAR shortcutPathStr[MAX_PATH];
  WCHAR targetPathStr[MAX_PATH];
  WCHAR appModelIDStr[MAX_PATH];
  WCHAR descriptionStr[MAX_PATH];
  
  shortcutPathStr[0] = '\0';
  targetPathStr[0] = '\0';
  appModelIDStr[0] = '\0';
  descriptionStr[0] = '\0';

  bool createShortcutFound = false;
  bool updateFound = false;
  bool shortcutPathFound = false;
  bool targetPathFound = false;
  bool appModelIDFound = false;
  bool modeFound = false;
  bool descriptionFound = false;
  bool printFound = false;

  int idx;
  for (idx = 1; idx < argc; idx++) {
    if (!wcscmp(L"/CREATE", argv[idx])) {
      createShortcutFound = true;
      continue;
    }
    if (!wcscmp(L"/UPDATE", argv[idx])) {
      updateFound = true;
      continue;
    }
    if (!wcscmp(L"/PRINT", argv[idx])) {
      printFound = true;
      continue;
    }

    if (!wcsncmp(L"/S", argv[idx], 2) && wcslen(argv[idx]) > 2) {
      wcscpy_s(shortcutPathStr, MAX_PATH, (argv[idx]+2));
      shortcutPathFound = true;
      continue;
    }
    if (!wcsncmp(L"/T", argv[idx], 2) && wcslen(argv[idx]) > 2) {
      wcscpy_s(targetPathStr, MAX_PATH, (argv[idx]+2));
      targetPathFound = true;
      continue;
    }
    if (!wcsncmp(L"/A", argv[idx], 2) && wcslen(argv[idx]) > 2) {
      wcscpy_s(appModelIDStr, MAX_PATH, (argv[idx]+2));
      appModelIDFound = true;
      continue;
    }
    if (!wcsncmp(L"/D", argv[idx], 2) && wcslen(argv[idx]) > 2 && wcslen(argv[idx]) < MAX_PATH) {
      wcscpy_s(descriptionStr, MAX_PATH, (argv[idx]+2));
      descriptionFound = true;
      continue;
    }
    if (!wcscmp(L"/M", argv[idx])) {
      modeFound = true;
      continue;
    }
  }

  DumpParameters(targetPathStr, shortcutPathStr, appModelIDStr, descriptionStr);

  if (!createShortcutFound && !updateFound && !printFound) {
    DumpCommands();
    return 0;
  }

  if (!targetPathFound) {
    printf("missing target file path.\n");
    return -1;
  }

  HRESULT hres;

  if (printFound) {
    if (FAILED(hres = PrintShortcutProps(targetPathStr))) {
      printf("failed printing target props HRESULT=%X\n", hres);
      return -1;
    }
    return 0;
  }

  if (createShortcutFound && !shortcutPathFound) {
    printf("missing shortcut file path.\n");
    return -1;
  }

  if (updateFound && !appModelIDFound && !modeFound) {
    printf("no properties selected.\n");
    return -1;
  }

  if (createShortcutFound) {
    if (FAILED(hres = CreateLink(targetPathStr,
                                 shortcutPathStr,
                                 (descriptionFound ? descriptionStr : nullptr)))) {
      printf("failed creating shortcut HRESULT=%X\n", hres);
      return -1;
    }
  }

  LPCWSTR target;
  if (createShortcutFound) {
    target = shortcutPathStr;
  } else {
    target = targetPathStr;
  }

  if (appModelIDFound || modeFound) {
    if (FAILED(hres = SetShortcutProps(target,
                                       (appModelIDFound ? appModelIDStr : nullptr),
                                       appModelIDFound, modeFound))) {
      printf("failed adding property HRESULT=%X\n", hres);
      return -1;
    }
  }

	return 0;
}