Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore StartProcess stdout & stderr handles #11

Open
wants to merge 10 commits into
base: 7.7
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jobs:
# Build Dependencies
"bison"
"pkg-config"
"mingw-w64"
"gcenx/wine/cx-llvm"

# Utilities (DXVK)
Expand All @@ -53,6 +52,26 @@ jobs:

brew install "${REQUIRED_PACKAGES[@]}"

- name: Install mingw
continue-on-error: true
run: |
# As of mingw-w64 12, brew uses UCRT instead of MSVCRT
# Wine will fail to build with UCRT, so we must rollback.

curl -L https://raw.githubusercontent.com/Homebrew/homebrew-core/31209a399a7b40bf2cd3abd7aee2715547ccd5bd/Formula/m/mingw-w64.rb > mingw-w64.rb && brew install mingw-w64.rb
rm mingw-w64.rb

- name: Echo Libs [DEBUG]
run: |
echo "Brew Libs\n========="
ls $(brew --prefix)/lib

echo "FFmpeg Libs\n==========="
ls $(brew --prefix ffmpeg@6)/lib

echo "GStreamer Libs\n=============="
ls $(brew --prefix gstreamer)/lib/gstreamer-1.0

- name: Add bison & cx-llvm to $PATH
run: |
echo "$(brew --prefix bison)/bin" >> $GITHUB_PATH
Expand Down Expand Up @@ -198,6 +217,7 @@ jobs:
- name: Copy External Libs
run: |
LIBS=(
"libbluray.2"
"libfreetype"
"libfreetype.6"
"libgio-2.0.0"
Expand Down Expand Up @@ -238,6 +258,7 @@ jobs:
"libSDL2-2.0.0"
"libtasn1.6"
"libunistring.5"
"libvpx.8"
"libXau.6"
"libXdmcp.6"
"libX11.6"
Expand All @@ -250,6 +271,9 @@ jobs:
"libavformat.60"
"libavcodec.60"
"libavutil.58"
"libpostproc.57"
"libswresample.4"
"libswscale.7"
)

GSTREAMER_LIBS=(
Expand Down
218 changes: 146 additions & 72 deletions GPTK/redist/Read Me.rtf

Large diffs are not rendered by default.

Binary file modified GPTK/redist/lib/external/D3DMetal.framework/Versions/A/D3DMetal
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
<key>BuildVersion</key>
<string>1</string>
<key>CFBundleShortVersionString</key>
<string>1.1</string>
<string>2.0b1</string>
<key>CFBundleVersion</key>
<string>1.1</string>
<string>2.0b1</string>
<key>ProjectName</key>
<string>D3DRendererMetal</string>
<key>SourceVersion</key>
<string>18000000000000</string>
<string>25011000000000</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -6,35 +6,35 @@
<dict>
<key>Resources/Info.plist</key>
<data>
hzsBQ6cbbnHppYzNvPQAI2Cy7UA=
vHGLkInuoUsB8AH0OnqKGAShx9Y=
</data>
<key>Resources/LICENSE</key>
<data>
1s+LZYFe//ikbe8+xMdMVwM9Jfo=
</data>
<key>Resources/default.metallib</key>
<data>
gYcOTKQJiteCQ5E7LXczKjN1nAQ=
LQZ8p5HlC6WNBzOhGZB0I59xJHI=
</data>
<key>Resources/libdxccontainer.dylib</key>
<data>
Ptn6MFTuEJHo0v5yJ6NbI3etMaM=
sjzzc3d+CUWxeURQG95BtKO6dEE=
</data>
<key>Resources/libdxcompiler.dylib</key>
<data>
ez6SzGY2XUP4QGQiRxEDPKbRj+w=
SosJ4ruO0UnCrmNGxE1DTPICox0=
</data>
<key>Resources/libdxilconv.dylib</key>
<data>
BnF78QISXSqXReIJ5caE2kO/4II=
1HaxatZtI8A0RGYMXWqeZry18mI=
</data>
<key>Resources/libmetalirconverter.dylib</key>
<data>
EvaL7uQF5KMaSW4Bh1t/lUJew90=
dLIQcMwng33L6rSQaE80hAaIAQo=
</data>
<key>Resources/version.plist</key>
<data>
bQczriH5Fz7qW+e6B4nZIqUEGgA=
y7JjtFeGtpaYPX0tFHQCu7bum0Y=
</data>
</dict>
<key>files2</key>
Expand All @@ -43,7 +43,7 @@
<dict>
<key>hash2</key>
<data>
dhtwN93oHSf/rvWOELWFll5vIBeOGGe+uWfJSjvF76U=
7OP6tTTfUIS1dgf5xAIb+B0LqhFr9gKg0oVS9nf/9wc=
</data>
</dict>
<key>Resources/LICENSE</key>
Expand All @@ -57,42 +57,42 @@
<dict>
<key>hash2</key>
<data>
Kp83/Ijjmwqow6gqVddHFHTxI3kNgoqGlDEHwcqi2Xg=
B95I9T2lA9AsJHu/pTkKeI4k+6OqbVThfK8nIaLDl04=
</data>
</dict>
<key>Resources/libdxccontainer.dylib</key>
<dict>
<key>hash2</key>
<data>
a9OSHVyoExGmGSkxIqKTz43b454SMP+ad7vCVYOGUQU=
zm7gUzeEpj0QNjMTViwMmjA0EfTCy3lLfSuCuXVBBBg=
</data>
</dict>
<key>Resources/libdxcompiler.dylib</key>
<dict>
<key>hash2</key>
<data>
fwQLfh+ega5+OTilGCHQIOBF6Qhpzzk9DHHNdz13tIc=
erzoN04l+P/qm6x+uVfL2HJYy3zbCGssSLQN27biL6g=
</data>
</dict>
<key>Resources/libdxilconv.dylib</key>
<dict>
<key>hash2</key>
<data>
4pCMRYibeSQTU9YrAVXPmDQp6MfdYQSYicwmFf3Ma9M=
5FnyTvUK0kRYY7vT+F0eNy7YIg4H/aCCG9XL4DzCJpA=
</data>
</dict>
<key>Resources/libmetalirconverter.dylib</key>
<dict>
<key>hash2</key>
<data>
r9EUAuP9u3ZcurAm7GIgrm+DhHKZWq0hz97FbM0Fri4=
9OvZc+2PlPYaNiWRZ4kzxR1OnhvAjZXoiv+AWu/xfUY=
</data>
</dict>
<key>Resources/version.plist</key>
<dict>
<key>hash2</key>
<data>
O2LMR9xWGSdtjOV/G5G4BADpzT95MUYLTZqHc20YjMk=
idHsvcSD9w+BzMvuhXYk32/rYL+mN3jfj+0bXOSuIQM=
</data>
</dict>
</dict>
Expand Down
Binary file modified GPTK/redist/lib/external/libd3dshared.dylib
Binary file not shown.
Binary file modified GPTK/redist/lib/wine/x86_64-windows/atidxx64.dll
Binary file not shown.
Binary file modified GPTK/redist/lib/wine/x86_64-windows/d3d10.dll
Binary file not shown.
Binary file modified GPTK/redist/lib/wine/x86_64-windows/d3d11.dll
Binary file not shown.
Binary file modified GPTK/redist/lib/wine/x86_64-windows/d3d12.dll
Binary file not shown.
Binary file modified GPTK/redist/lib/wine/x86_64-windows/dxgi.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions WhiskyWineVersion.plist
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<key>major</key>
<integer>2</integer>
<key>minor</key>
<integer>2</integer>
<integer>3</integer>
<key>patch</key>
<integer>1</integer>
<integer>2</integer>
<key>preRelease</key>
<string></string>
</dict>
Expand Down
4 changes: 2 additions & 2 deletions dlls/kernelbase/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ static RTL_USER_PROCESS_PARAMETERS *create_process_params( const WCHAR *filename
if (startup->dwFlags & STARTF_USESTDHANDLES)
{
params->hStdInput = startup->hStdInput;
params->hStdOutput = startup->hStdOutput;
params->hStdError = startup->hStdError;
params->hStdOutput = INVALID_HANDLE_VALUE;
params->hStdError = INVALID_HANDLE_VALUE;
}
else if (flags & (DETACHED_PROCESS | CREATE_NEW_CONSOLE))
{
Expand Down
114 changes: 113 additions & 1 deletion programs/wineboot/wineboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -241,12 +241,120 @@ static void initialize_xstate_features(struct _KUSER_SHARED_DATA *data)
TRACE("XSAVE feature 2 %#x, %#x, %#x, %#x.\n", regs[0], regs[1], regs[2], regs[3]);
}

static BOOL is_tsc_trusted_by_the_kernel(void)
{
char buf[4] = {0};
DWORD num_read;
HANDLE handle;
BOOL ret = TRUE;

/* Darwin for x86-64 uses the TSC internally for timekeeping, so it can always
* be trusted.
* For BSDs there seems to be no unified interface to query TSC quality.
* If there is a sysfs entry with clocksource information, use it to check though. */
handle = CreateFileW( L"\\??\\unix\\sys\\bus\\clocksource\\devices\\clocksource0\\current_clocksource",
GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0 );
if (handle == INVALID_HANDLE_VALUE) return TRUE;

if (ReadFile( handle, buf, sizeof(buf) - 1, &num_read, NULL ) && strcmp( "tsc", buf ))
ret = FALSE;

CloseHandle( handle );
return ret;
}

static UINT64 read_tsc_frequency(void)
{
UINT64 freq = 0;
LONGLONG time0, time1, tsc0, tsc1, tsc2, tsc3, freq0, freq1, error;
BOOL has_rdtscp = FALSE;
unsigned int aux;
UINT retries = 50;
int regs[4];

if (!is_tsc_trusted_by_the_kernel())
{
WARN( "Failed to compute TSC frequency, not trusted by the kernel.\n" );
return 0;
}

__cpuid(regs, 1);
if (!(regs[3] & (1 << 4)))
{
WARN( "Failed to compute TSC frequency, RDTSC instruction not supported.\n" );
return 0;
}

__cpuid( regs, 0x80000000 );
if (regs[0] < 0x80000007)
{
WARN( "Failed to compute TSC frequency, unable to check invariant TSC.\n" );
return 0;
}

/* check for invariant tsc bit */
__cpuid( regs, 0x80000007 );
if (!(regs[3] & (1 << 8)))
{
WARN( "Failed to compute TSC frequency, no invariant TSC.\n" );
return 0;
}

/* check for rdtscp support bit */
__cpuid( regs, 0x80000001 );
if ((regs[3] & (1 << 27))) has_rdtscp = TRUE;

do
{
if (has_rdtscp)
{
tsc0 = __rdtscp( &aux );
time0 = RtlGetSystemTimePrecise();
tsc1 = __rdtscp( &aux );
Sleep( 1 );
tsc2 = __rdtscp( &aux );
time1 = RtlGetSystemTimePrecise();
tsc3 = __rdtscp( &aux );
}
else
{
tsc0 = __rdtsc(); __cpuid( regs, 0 );
time0 = RtlGetSystemTimePrecise();
tsc1 = __rdtsc(); __cpuid( regs, 0 );
Sleep( 1 );
tsc2 = __rdtsc(); __cpuid( regs, 0 );
time1 = RtlGetSystemTimePrecise();
tsc3 = __rdtsc(); __cpuid( regs, 0 );
}

freq0 = (tsc2 - tsc0) * 10000000 / (time1 - time0);
freq1 = (tsc3 - tsc1) * 10000000 / (time1 - time0);
error = llabs( (freq1 - freq0) * 1000000 / min( freq1, freq0 ) );
}
while (error > 500 && --retries);

if (!retries) WARN( "TSC frequency calibration failed, unstable TSC?\n" );
else
{
freq = (freq0 + freq1) / 2;
TRACE( "TSC frequency calibration complete, found %I64u Hz\n", freq );
}

return freq;
}

#else

static void initialize_xstate_features(struct _KUSER_SHARED_DATA *data)
{
}

static UINT64 read_tsc_frequency(void)
{
FIXME( "TSC frequency calibration not implemented\n" );
return 0;
}

#endif

static void create_user_shared_data(void)
Expand Down Expand Up @@ -654,6 +762,7 @@ static void create_hardware_registry_keys(void)
SYSTEM_CPU_INFORMATION sci;
PROCESSOR_POWER_INFORMATION* power_info;
ULONG sizeof_power_info = sizeof(PROCESSOR_POWER_INFORMATION) * NtCurrentTeb()->Peb->NumberOfProcessors;
UINT64 tsc_frequency = read_tsc_frequency();
WCHAR id[60], namestr[49], vendorid[13];

get_namestring( namestr );
Expand Down Expand Up @@ -722,12 +831,15 @@ static void create_hardware_registry_keys(void)
if (!RegCreateKeyExW( cpu_key, numW, 0, NULL, REG_OPTION_VOLATILE,
KEY_ALL_ACCESS, NULL, &hkey, NULL ))
{
DWORD tsc_freq_mhz = (DWORD)(tsc_frequency / 1000000ull); /* Hz -> Mhz */
if (!tsc_freq_mhz) tsc_freq_mhz = power_info[i].MaxMhz;

RegSetValueExW( hkey, L"FeatureSet", 0, REG_DWORD, (BYTE *)&sci.ProcessorFeatureBits, sizeof(DWORD) );
set_reg_value( hkey, L"Identifier", id );
/* TODO: report ARM properly */
set_reg_value( hkey, L"ProcessorNameString", namestr );
set_reg_value( hkey, L"VendorIdentifier", vendorid );
RegSetValueExW( hkey, L"~MHz", 0, REG_DWORD, (BYTE *)&power_info[i].MaxMhz, sizeof(DWORD) );
RegSetValueExW( hkey, L"~MHz", 0, REG_DWORD, (BYTE *)&tsc_freq_mhz, sizeof(DWORD) );
RegCloseKey( hkey );
}
if (sci.ProcessorArchitecture != PROCESSOR_ARCHITECTURE_ARM &&
Expand Down
Loading