mirror of
https://github.com/tihmstar/futurerestore.git
synced 2024-12-21 17:25:30 +00:00
Windows 10: enable virtual terminal processing
Co-Authored-By: Luke S. <luke@street.dev>
This commit is contained in:
parent
c02e9d5876
commit
7720c6ef52
|
@ -6,13 +6,6 @@
|
|||
// Copyright © 2016 tihmstar. All rights reserved.
|
||||
//
|
||||
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#ifndef WIN32
|
||||
//make sure WIN32 is defined if compiling for windows
|
||||
#define WIN32
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <libgeneral/macros.h>
|
||||
|
||||
#include <iostream>
|
||||
|
@ -41,7 +34,6 @@ extern "C"{
|
|||
#include <libirecovery.h>
|
||||
}
|
||||
|
||||
|
||||
//(re)define __mkdir
|
||||
#ifdef __mkdir
|
||||
#undef __mkdir
|
||||
|
@ -56,8 +48,12 @@ extern "C"{
|
|||
|
||||
#define USEC_PER_SEC 1000000
|
||||
|
||||
#ifdef WIN32
|
||||
#define FUTURERESTORE_TMP_PATH "download"
|
||||
#else
|
||||
#define TMP_PATH "/tmp"
|
||||
#define FUTURERESTORE_TMP_PATH TMP_PATH"/futurerestore"
|
||||
#endif
|
||||
|
||||
#define BASEBAND_TMP_PATH FUTURERESTORE_TMP_PATH"/baseband.bbfw"
|
||||
#define BASEBAND_MANIFEST_TMP_PATH FUTURERESTORE_TMP_PATH"/basebandManifest.plist"
|
||||
|
|
|
@ -9,6 +9,13 @@
|
|||
#ifndef futurerestore_hpp
|
||||
#define futurerestore_hpp
|
||||
|
||||
#if defined _WIN32 || defined __CYGWIN__
|
||||
#ifndef WIN32
|
||||
//make sure WIN32 is defined if compiling for windows
|
||||
#define WIN32
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
|
|
|
@ -24,6 +24,12 @@ extern "C"{
|
|||
#include <libipatcher/libipatcher.hpp>
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
#include <windows.h>
|
||||
#ifndef ENABLE_VIRTUAL_TERMINAL_PROCESSING
|
||||
#define ENABLE_VIRTUAL_TERMINAL_PROCESSING 0x0004
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static struct option longopts[] = {
|
||||
{ "apticket", required_argument, NULL, 't' },
|
||||
|
@ -75,6 +81,13 @@ void cmd_help(){
|
|||
printf(" \t\tWARNING: only use this for device without baseband (eg iPod or some wifi only iPads)\n\n");
|
||||
}
|
||||
|
||||
#ifdef WIN32
|
||||
DWORD termFlags;
|
||||
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
if (GetConsoleMode(handle, &termFlags))
|
||||
SetConsoleMode(handle, termFlags | ENABLE_VIRTUAL_TERMINAL_PROCESSING);
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
using namespace tihmstar;
|
||||
int main_r(int argc, const char * argv[]) {
|
||||
|
|
Loading…
Reference in a new issue