Removed patch to fix issues with invalid console handles for new processes (accepted upstream).

This commit is contained in:
Sebastian Lackner 2015-04-23 17:03:20 +02:00
parent a139cd10bd
commit 8e8e15c81a
7 changed files with 52 additions and 241 deletions

View File

@ -150,7 +150,7 @@ for more details.*
* GetMonitorInfo returns the same name for all monitors ([Wine Bug #37709](https://bugs.winehq.org/show_bug.cgi?id=37709))
* GetSecurityInfo returns NULL DACL for process object ([Wine Bug #15980](https://bugs.winehq.org/show_bug.cgi?id=15980))
* Graphical issues in Inquisitor ([Wine Bug #32490](https://bugs.winehq.org/show_bug.cgi?id=32490))
* Hearthstone fails to start ([Wine Bug #36216](https://bugs.winehq.org/show_bug.cgi?id=36216))
* ~~Hearthstone fails to start~~ ([Wine Bug #36216](https://bugs.winehq.org/show_bug.cgi?id=36216))
* IOCTL_DVD_READ_STRUCTURE expects the wrong size of output buffer for some requests ([Wine Bug #37767](https://bugs.winehq.org/show_bug.cgi?id=37767))
* Ignore unsupported flags for CoInternetSetFeatureEnabled ([Wine Bug #35197](https://bugs.winehq.org/show_bug.cgi?id=35197))
* Implement D3DXGetShaderOutputSemantics

1
debian/changelog vendored
View File

@ -1,6 +1,7 @@
wine-staging (1.7.42) UNRELEASED; urgency=low
* Removed patch to avoid crash when trying to bind mshtml event scripts to window (fixed upstream).
* Removed patch for stub of ntdll.WinSqmIsOptedIn (fixed upstream).
* Removed patch to fix issues with invalid console handles for new processes (accepted upstream).
-- Sebastian Lackner <sebastian@fds-team.de> Mon, 20 Apr 2015 15:55:51 +0200
wine-staging (1.7.41) unstable; urgency=low

View File

@ -1,189 +0,0 @@
From 6a8d343ee865ec6aab96d5325f4cb374a5049cdf Mon Sep 17 00:00:00 2001
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
Date: Sat, 3 Jan 2015 23:37:42 -0700
Subject: kernel32: Invalid console handles for new processes are 0, not
INVALID_HANDLE_VALUE.
---
dlls/kernel32/console.c | 15 ++++++------
dlls/kernel32/environ.c | 12 +++++-----
dlls/kernel32/tests/process.c | 54 ++++++++++++++++++++++++++++++++++++++++++-
3 files changed, 67 insertions(+), 14 deletions(-)
diff --git a/dlls/kernel32/console.c b/dlls/kernel32/console.c
index 303b638..14f1189 100644
--- a/dlls/kernel32/console.c
+++ b/dlls/kernel32/console.c
@@ -3119,24 +3119,25 @@ BOOL CONSOLE_Init(RTL_USER_PROCESS_PARAMETERS *params)
}
/* convert value from server:
- * + 0 => INVALID_HANDLE_VALUE
+ * + INVALID_HANDLE_VALUE => TEB: 0, STARTUPINFO: INVALID_HANDLE_VALUE
+ * + 0 => TEB: 0, STARTUPINFO: INVALID_HANDLE_VALUE
* + console handle needs to be mapped
*/
- if (!params->hStdInput)
- params->hStdInput = INVALID_HANDLE_VALUE;
+ if (!params->hStdInput || params->hStdInput == INVALID_HANDLE_VALUE)
+ params->hStdInput = 0;
else if (VerifyConsoleIoHandle(console_handle_map(params->hStdInput)))
{
params->hStdInput = console_handle_map(params->hStdInput);
save_console_mode(params->hStdInput);
}
- if (!params->hStdOutput)
- params->hStdOutput = INVALID_HANDLE_VALUE;
+ if (!params->hStdOutput || params->hStdOutput == INVALID_HANDLE_VALUE)
+ params->hStdOutput = 0;
else if (VerifyConsoleIoHandle(console_handle_map(params->hStdOutput)))
params->hStdOutput = console_handle_map(params->hStdOutput);
- if (!params->hStdError)
- params->hStdError = INVALID_HANDLE_VALUE;
+ if (!params->hStdError || params->hStdError == INVALID_HANDLE_VALUE)
+ params->hStdError = 0;
else if (VerifyConsoleIoHandle(console_handle_map(params->hStdError)))
params->hStdError = console_handle_map(params->hStdError);
diff --git a/dlls/kernel32/environ.c b/dlls/kernel32/environ.c
index 57b6a1f..99bf706 100644
--- a/dlls/kernel32/environ.c
+++ b/dlls/kernel32/environ.c
@@ -464,9 +464,9 @@ void ENV_CopyStartupInformation(void)
startup_infoW.wShowWindow = rupp->wShowWindow;
startup_infoW.cbReserved2 = rupp->RuntimeInfo.MaximumLength;
startup_infoW.lpReserved2 = rupp->RuntimeInfo.MaximumLength ? (void*)rupp->RuntimeInfo.Buffer : NULL;
- startup_infoW.hStdInput = rupp->hStdInput;
- startup_infoW.hStdOutput = rupp->hStdOutput;
- startup_infoW.hStdError = rupp->hStdError;
+ startup_infoW.hStdInput = rupp->hStdInput ? rupp->hStdInput : INVALID_HANDLE_VALUE;
+ startup_infoW.hStdOutput = rupp->hStdOutput ? rupp->hStdOutput : INVALID_HANDLE_VALUE;
+ startup_infoW.hStdError = rupp->hStdError ? rupp->hStdError : INVALID_HANDLE_VALUE;
startup_infoA.cb = sizeof(startup_infoA);
startup_infoA.lpReserved = NULL;
@@ -485,9 +485,9 @@ void ENV_CopyStartupInformation(void)
startup_infoA.wShowWindow = rupp->wShowWindow;
startup_infoA.cbReserved2 = rupp->RuntimeInfo.MaximumLength;
startup_infoA.lpReserved2 = rupp->RuntimeInfo.MaximumLength ? (void*)rupp->RuntimeInfo.Buffer : NULL;
- startup_infoA.hStdInput = rupp->hStdInput;
- startup_infoA.hStdOutput = rupp->hStdOutput;
- startup_infoA.hStdError = rupp->hStdError;
+ startup_infoA.hStdInput = rupp->hStdInput ? rupp->hStdInput : INVALID_HANDLE_VALUE;
+ startup_infoA.hStdOutput = rupp->hStdOutput ? rupp->hStdOutput : INVALID_HANDLE_VALUE;
+ startup_infoA.hStdError = rupp->hStdError ? rupp->hStdError : INVALID_HANDLE_VALUE;
RtlReleasePebLock();
}
diff --git a/dlls/kernel32/tests/process.c b/dlls/kernel32/tests/process.c
index fd3ce7f..5ab8fa2 100644
--- a/dlls/kernel32/tests/process.c
+++ b/dlls/kernel32/tests/process.c
@@ -57,7 +57,7 @@
wine_dbgstr_w(expected), wine_dbgstr_w(value)); \
} while (0)
-static HINSTANCE hkernel32;
+static HINSTANCE hkernel32, hntdll;
static void (WINAPI *pGetNativeSystemInfo)(LPSYSTEM_INFO);
static BOOL (WINAPI *pGetSystemRegistryQuota)(PDWORD, PDWORD);
static BOOL (WINAPI *pIsWow64Process)(HANDLE,PBOOL);
@@ -66,6 +66,7 @@ static BOOL (WINAPI *pVirtualFreeEx)(HANDLE, LPVOID, SIZE_T, DWORD);
static BOOL (WINAPI *pQueryFullProcessImageNameA)(HANDLE hProcess, DWORD dwFlags, LPSTR lpExeName, PDWORD lpdwSize);
static BOOL (WINAPI *pQueryFullProcessImageNameW)(HANDLE hProcess, DWORD dwFlags, LPWSTR lpExeName, PDWORD lpdwSize);
static DWORD (WINAPI *pK32GetProcessImageFileNameA)(HANDLE,LPSTR,DWORD);
+static struct _TEB * (WINAPI *pNtCurrentTeb)(void);
static HANDLE (WINAPI *pCreateJobObjectW)(LPSECURITY_ATTRIBUTES sa, LPCWSTR name);
static BOOL (WINAPI *pAssignProcessToJobObject)(HANDLE job, HANDLE process);
static BOOL (WINAPI *pIsProcessInJob)(HANDLE process, HANDLE job, PBOOL result);
@@ -208,6 +209,8 @@ static BOOL init(void)
if ((p = strrchr(exename, '/')) != NULL) exename = p + 1;
hkernel32 = GetModuleHandleA("kernel32");
+ hntdll = GetModuleHandleA("ntdll.dll");
+
pGetNativeSystemInfo = (void *) GetProcAddress(hkernel32, "GetNativeSystemInfo");
pGetSystemRegistryQuota = (void *) GetProcAddress(hkernel32, "GetSystemRegistryQuota");
pIsWow64Process = (void *) GetProcAddress(hkernel32, "IsWow64Process");
@@ -216,6 +219,7 @@ static BOOL init(void)
pQueryFullProcessImageNameA = (void *) GetProcAddress(hkernel32, "QueryFullProcessImageNameA");
pQueryFullProcessImageNameW = (void *) GetProcAddress(hkernel32, "QueryFullProcessImageNameW");
pK32GetProcessImageFileNameA = (void *) GetProcAddress(hkernel32, "K32GetProcessImageFileNameA");
+ pNtCurrentTeb = (void *)GetProcAddress(hntdll, "NtCurrentTeb");
pCreateJobObjectW = (void *)GetProcAddress(hkernel32, "CreateJobObjectW");
pAssignProcessToJobObject = (void *)GetProcAddress(hkernel32, "AssignProcessToJobObject");
pIsProcessInJob = (void *)GetProcAddress(hkernel32, "IsProcessInJob");
@@ -291,6 +295,16 @@ static void doChild(const char* file, const char* option)
siA.dwFlags, siA.wShowWindow,
(DWORD_PTR)siA.hStdInput, (DWORD_PTR)siA.hStdOutput, (DWORD_PTR)siA.hStdError);
+ if (pNtCurrentTeb)
+ {
+ RTL_USER_PROCESS_PARAMETERS *params = pNtCurrentTeb()->Peb->ProcessParameters;
+
+ /* check the console handles in the TEB */
+ childPrintf(hFile, "[TEB]\nhStdInput=%lu\nhStdOutput=%lu\nhStdError=%lu\n\n",
+ (DWORD_PTR)params->hStdInput, (DWORD_PTR)params->hStdOutput,
+ (DWORD_PTR)params->hStdError);
+ }
+
/* since GetStartupInfoW is only implemented in win2k,
* zero out before calling so we can notice the difference
*/
@@ -2548,6 +2562,43 @@ static void test_BreakawayOk(HANDLE job)
ok(ret, "SetInformationJobObject error %u\n", GetLastError());
}
+void test_StartupNoConsole(void)
+{
+#ifndef _WIN64
+ char buffer[MAX_PATH];
+ STARTUPINFOA startup;
+ PROCESS_INFORMATION info;
+ DWORD code;
+
+ if (!pNtCurrentTeb)
+ {
+ win_skip( "NtCurrentTeb not supported\n" );
+ return;
+ }
+
+ memset(&startup, 0, sizeof(startup));
+ startup.cb = sizeof(startup);
+ startup.dwFlags = STARTF_USESHOWWINDOW;
+ startup.wShowWindow = SW_SHOWNORMAL;
+ get_file_name(resfile);
+ sprintf(buffer, "\"%s\" tests/process.c dump \"%s\"", selfname, resfile);
+ ok(CreateProcessA(NULL, buffer, NULL, NULL, TRUE, DETACHED_PROCESS, NULL, NULL, &startup,
+ &info), "CreateProcess\n");
+ ok(WaitForSingleObject(info.hProcess, 30000) == WAIT_OBJECT_0, "Child process termination\n");
+ ok(GetExitCodeProcess(info.hProcess, &code), "Getting exit code\n");
+ WritePrivateProfileStringA(NULL, NULL, NULL, resfile);
+ okChildInt("StartupInfoA", "hStdInput", (UINT)INVALID_HANDLE_VALUE);
+ okChildInt("StartupInfoA", "hStdOutput", (UINT)INVALID_HANDLE_VALUE);
+ okChildInt("StartupInfoA", "hStdError", (UINT)INVALID_HANDLE_VALUE);
+ okChildInt("TEB", "hStdInput", 0);
+ okChildInt("TEB", "hStdOutput", 0);
+ okChildInt("TEB", "hStdError", 0);
+ release_memory();
+ assert(DeleteFileA(resfile) != 0);
+#endif
+
+}
+
START_TEST(process)
{
HANDLE job;
@@ -2596,6 +2647,7 @@ START_TEST(process)
test_SystemInfo();
test_RegistryQuota();
test_DuplicateHandle();
+ test_StartupNoConsole();
/* things that can be tested:
* lookup: check the way program to be executed is searched
* handles: check the handle inheritance stuff (+sec options)
--
2.3.3

View File

@ -1 +1 @@
Fixes: [36216] Hearthstone fails to start
#Fixes: [36216] Hearthstone fails to start

View File

@ -2666,18 +2666,13 @@ fi
# Patchset kernel32-Console_Handles
# |
# | This patchset fixes the following Wine bugs:
# | * [#36216] Hearthstone fails to start
# |
# | Modified files:
# | * dlls/kernel32/console.c, dlls/kernel32/environ.c, dlls/kernel32/tests/process.c, dlls/krnl386.exe16/file.c
# | * dlls/krnl386.exe16/file.c
# |
if test "$enable_kernel32_Console_Handles" -eq 1; then
patch_apply kernel32-Console_Handles/0001-krnl386-Invalid-console-handles-should-translate-int.patch
patch_apply kernel32-Console_Handles/0002-kernel32-Invalid-console-handles-for-new-processes-a.patch
(
echo '+ { "Erich E. Hoover", "krnl386: Invalid console handles should translate into real handles when creating a new process.", 1 },';
echo '+ { "Erich E. Hoover", "kernel32: Invalid console handles for new processes are 0, not INVALID_HANDLE_VALUE.", 1 },';
) >> "$patchlist"
fi

View File

@ -1,4 +1,4 @@
From f3e0bbee4a69994ffdae5e15c180d65104ed515c Mon Sep 17 00:00:00 2001
From 9e339aaca2d76bc24048081c3e47b49a840c716e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20D=C3=B6singer?= <stefan@codeweavers.com>
Date: Thu, 20 Dec 2012 13:09:17 +0100
Subject: wined3d: Move the framebuffer into wined3d_state
@ -11,13 +11,13 @@ Subject: wined3d: Move the framebuffer into wined3d_state
dlls/wined3d/drawprim.c | 14 ++---
dlls/wined3d/glsl_shader.c | 2 +-
dlls/wined3d/shader.c | 2 +-
dlls/wined3d/state.c | 18 +++---
dlls/wined3d/state.c | 20 +++----
dlls/wined3d/stateblock.c | 45 +++++++++++++--
dlls/wined3d/surface.c | 2 +-
dlls/wined3d/swapchain.c | 2 +-
dlls/wined3d/utils.c | 4 +-
dlls/wined3d/wined3d_private.h | 46 +++++++++++----
13 files changed, 171 insertions(+), 126 deletions(-)
13 files changed, 172 insertions(+), 127 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index c3878ea..78ecff7 100644
@ -577,7 +577,7 @@ index f2c2f42..c6a72fc 100644
surface_modify_ds_location(ds, location, ds->ds_current_size.cx, ds->ds_current_size.cy);
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 655bb33..eddf6b5 100644
index f1bf0a3..77c526e 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -1083,7 +1083,7 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont
@ -590,20 +590,20 @@ index 655bb33..eddf6b5 100644
const struct wined3d_shader_lconst *lconst;
const char *prefix;
diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
index d5a90c0..2746ba1 100644
index c249c9a..8a21921 100644
--- a/dlls/wined3d/shader.c
+++ b/dlls/wined3d/shader.c
@@ -2344,7 +2344,7 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3
memset(args, 0, sizeof(*args)); /* FIXME: Make sure all bits are set. */
if (!gl_info->supported[ARB_FRAMEBUFFER_SRGB] && state->render_states[WINED3D_RS_SRGBWRITEENABLE])
{
- const struct wined3d_format *rt_format = state->fb->render_targets[0]->format;
+ const struct wined3d_format *rt_format = state->fb.render_targets[0]->format;
if (rt_format->flags & WINED3DFMT_FLAG_SRGB_WRITE)
- unsigned int rt_fmt_flags = state->fb->render_targets[0]->format_flags;
+ unsigned int rt_fmt_flags = state->fb.render_targets[0]->format_flags;
if (rt_fmt_flags & WINED3DFMT_FLAG_SRGB_WRITE)
{
static unsigned int warned = 0;
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 91f3485..6105283 100644
index b025dff..9a52777 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -105,7 +105,7 @@ static void state_zenable(struct wined3d_context *context, const struct wined3d_
@ -615,16 +615,18 @@ index 91f3485..6105283 100644
{
TRACE("No Z buffer - disabling depth test\n");
zenable = WINED3D_ZB_FALSE;
@@ -367,7 +367,7 @@ static GLenum gl_blend_factor(enum wined3d_blend factor, const struct wined3d_fo
@@ -367,8 +367,8 @@ static GLenum gl_blend_factor(enum wined3d_blend factor, const struct wined3d_fo
static void state_blend(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
- const struct wined3d_format *rt_format = state->fb->render_targets[0]->format;
- unsigned int rt_fmt_flags = state->fb->render_targets[0]->format_flags;
+ const struct wined3d_format *rt_format = state->fb.render_targets[0]->format;
+ unsigned int rt_fmt_flags = state->fb.render_targets[0]->format_flags;
const struct wined3d_gl_info *gl_info = context->gl_info;
GLenum srcBlend, dstBlend;
enum wined3d_blend d3d_blend;
@@ -812,7 +812,7 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_
@@ -813,7 +813,7 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_
GLint depthFail_ccw;
/* No stencil test without a stencil buffer. */
@ -633,7 +635,7 @@ index 91f3485..6105283 100644
{
gl_info->gl_ops.gl.p_glDisable(GL_STENCIL_TEST);
checkGLcall("glDisable GL_STENCIL_TEST");
@@ -908,7 +908,7 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_
@@ -909,7 +909,7 @@ static void state_stencil(struct wined3d_context *context, const struct wined3d_
static void state_stencilwrite2s(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
@ -642,7 +644,7 @@ index 91f3485..6105283 100644
const struct wined3d_gl_info *gl_info = context->gl_info;
GL_EXTCALL(glActiveStencilFaceEXT(GL_BACK));
@@ -922,7 +922,7 @@ static void state_stencilwrite2s(struct wined3d_context *context, const struct w
@@ -923,7 +923,7 @@ static void state_stencilwrite2s(struct wined3d_context *context, const struct w
static void state_stencilwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
@ -651,7 +653,7 @@ index 91f3485..6105283 100644
const struct wined3d_gl_info *gl_info = context->gl_info;
gl_info->gl_ops.gl.p_glStencilMask(mask);
@@ -1762,7 +1762,7 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3
@@ -1763,7 +1763,7 @@ static void state_depthbias(struct wined3d_context *context, const struct wined3
if (state->render_states[WINED3D_RS_SLOPESCALEDEPTHBIAS]
|| state->render_states[WINED3D_RS_DEPTHBIAS])
{
@ -660,7 +662,7 @@ index 91f3485..6105283 100644
float scale;
union
@@ -4657,7 +4657,7 @@ static void vertexdeclaration(struct wined3d_context *context, const struct wine
@@ -4658,7 +4658,7 @@ static void vertexdeclaration(struct wined3d_context *context, const struct wine
static void viewport_miscpart(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
@ -669,7 +671,7 @@ index 91f3485..6105283 100644
const struct wined3d_gl_info *gl_info = context->gl_info;
struct wined3d_viewport vp = state->viewport;
@@ -4835,7 +4835,7 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st
@@ -4836,7 +4836,7 @@ static void scissorrect(struct wined3d_context *context, const struct wined3d_st
}
else
{
@ -678,12 +680,12 @@ index 91f3485..6105283 100644
UINT height;
UINT width;
@@ -4899,7 +4899,7 @@ static void psorigin(struct wined3d_context *context, const struct wined3d_state
@@ -4900,7 +4900,7 @@ static void psorigin(struct wined3d_context *context, const struct wined3d_state
void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
- const struct wined3d_format *rt_format = state->fb->render_targets[0]->format;
+ const struct wined3d_format *rt_format = state->fb.render_targets[0]->format;
- unsigned int rt_fmt_flags = state->fb->render_targets[0]->format_flags;
+ unsigned int rt_fmt_flags = state->fb.render_targets[0]->format_flags;
const struct wined3d_gl_info *gl_info = context->gl_info;
TRACE("context %p, state %p, state_id %#x.\n", context, state, state_id);
@ -815,7 +817,7 @@ index 1ac5e7a..454cb21 100644
struct wined3d_context *context;
struct wined3d_surface *front;
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
index 1686e30..09408e4 100644
index 5596375..17435c4 100644
--- a/dlls/wined3d/utils.c
+++ b/dlls/wined3d/utils.c
@@ -3192,7 +3192,7 @@ void get_projection_matrix(const struct wined3d_context *context, const struct w
@ -831,13 +833,13 @@ index 1686e30..09408e4 100644
unsigned int i;
DWORD ttff;
DWORD cop, aop, carg0, carg1, carg2, aarg0, aarg1, aarg2;
- const struct wined3d_format *rt_format = state->fb->render_targets[0]->format;
+ const struct wined3d_format *rt_format = state->fb.render_targets[0]->format;
- unsigned int rt_fmt_flags = state->fb->render_targets[0]->format_flags;
+ unsigned int rt_fmt_flags = state->fb.render_targets[0]->format_flags;
const struct wined3d_gl_info *gl_info = context->gl_info;
const struct wined3d_d3d_info *d3d_info = context->d3d_info;
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 1d0d644..7253e54 100644
index e12ce80..2be7639 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1124,6 +1124,36 @@ struct wined3d_timestamp_query

View File

@ -328,19 +328,21 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
{
TRACE("No Z buffer - disabling depth test\n");
zenable = WINED3D_ZB_FALSE;
@@ -367,7 +371,11 @@
@@ -367,8 +371,13 @@
static void state_blend(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
+#if defined(STAGING_CSMT)
const struct wined3d_format *rt_format = state->fb.render_targets[0]->format;
unsigned int rt_fmt_flags = state->fb.render_targets[0]->format_flags;
+#else /* STAGING_CSMT */
+ const struct wined3d_format *rt_format = state->fb->render_targets[0]->format;
+ unsigned int rt_fmt_flags = state->fb->render_targets[0]->format_flags;
+#endif /* STAGING_CSMT */
const struct wined3d_gl_info *gl_info = context->gl_info;
GLenum srcBlend, dstBlend;
enum wined3d_blend d3d_blend;
@@ -812,7 +820,11 @@
@@ -813,7 +822,11 @@
GLint depthFail_ccw;
/* No stencil test without a stencil buffer. */
@ -352,7 +354,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
{
gl_info->gl_ops.gl.p_glDisable(GL_STENCIL_TEST);
checkGLcall("glDisable GL_STENCIL_TEST");
@@ -908,7 +920,11 @@
@@ -909,7 +922,11 @@
static void state_stencilwrite2s(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
@ -364,7 +366,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
const struct wined3d_gl_info *gl_info = context->gl_info;
GL_EXTCALL(glActiveStencilFaceEXT(GL_BACK));
@@ -922,7 +938,11 @@
@@ -923,7 +940,11 @@
static void state_stencilwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
@ -376,7 +378,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
const struct wined3d_gl_info *gl_info = context->gl_info;
gl_info->gl_ops.gl.p_glStencilMask(mask);
@@ -1163,10 +1183,17 @@
@@ -1164,10 +1185,17 @@
/* drop through */
case WINED3D_FOG_NONE:
@ -394,7 +396,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
new_source = FOGSOURCE_COORD;
gl_info->gl_ops.gl.p_glFogi(GL_FOG_MODE, GL_LINEAR);
checkGLcall("glFogi(GL_FOG_MODE, GL_LINEAR)");
@@ -1762,7 +1789,11 @@
@@ -1763,7 +1791,11 @@
if (state->render_states[WINED3D_RS_SLOPESCALEDEPTHBIAS]
|| state->render_states[WINED3D_RS_DEPTHBIAS])
{
@ -406,7 +408,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
float scale;
union
@@ -4303,9 +4334,15 @@
@@ -4304,9 +4336,15 @@
}
}
} else {
@ -422,7 +424,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
WARN("unsupported blending in openGl\n");
}
}
@@ -4657,7 +4694,11 @@
@@ -4658,7 +4696,11 @@
static void viewport_miscpart(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
@ -434,7 +436,7 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
const struct wined3d_gl_info *gl_info = context->gl_info;
struct wined3d_viewport vp = state->viewport;
@@ -4835,7 +4876,11 @@
@@ -4836,7 +4878,11 @@
}
else
{
@ -446,14 +448,14 @@ diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
UINT height;
UINT width;
@@ -4899,7 +4944,11 @@
@@ -4900,7 +4946,11 @@
void state_srgbwrite(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
{
+#if defined(STAGING_CSMT)
const struct wined3d_format *rt_format = state->fb.render_targets[0]->format;
unsigned int rt_fmt_flags = state->fb.render_targets[0]->format_flags;
+#else /* STAGING_CSMT */
+ const struct wined3d_format *rt_format = state->fb->render_targets[0]->format;
+ unsigned int rt_fmt_flags = state->fb->render_targets[0]->format_flags;
+#endif /* STAGING_CSMT */
const struct wined3d_gl_info *gl_info = context->gl_info;
@ -1143,9 +1145,9 @@ diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
DWORD ttff;
DWORD cop, aop, carg0, carg1, carg2, aarg0, aarg1, aarg2;
+#if defined(STAGING_CSMT)
const struct wined3d_format *rt_format = state->fb.render_targets[0]->format;
unsigned int rt_fmt_flags = state->fb.render_targets[0]->format_flags;
+#else /* STAGING_CSMT */
+ const struct wined3d_format *rt_format = state->fb->render_targets[0]->format;
+ unsigned int rt_fmt_flags = state->fb->render_targets[0]->format_flags;
+#endif /* STAGING_CSMT */
const struct wined3d_gl_info *gl_info = context->gl_info;
const struct wined3d_d3d_info *d3d_info = context->d3d_info;
@ -2253,7 +2255,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
struct wined3d_rendertarget_view
{
@@ -2904,8 +3122,10 @@
@@ -2905,8 +3123,10 @@
return surface_from_resource(resource);
}
@ -2264,7 +2266,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
struct wined3d_shader_resource_view
{
LONG refcount;
@@ -2918,8 +3138,12 @@
@@ -2919,8 +3139,12 @@
struct wined3d_swapchain_ops
{
void (*swapchain_present)(struct wined3d_swapchain *swapchain, const RECT *src_rect,
@ -2277,7 +2279,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
};
struct wined3d_swapchain
@@ -2959,8 +3183,10 @@
@@ -2960,8 +3184,10 @@
HDC swapchain_get_backup_dc(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
void swapchain_update_draw_bindings(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
void swapchain_update_render_to_fbo(struct wined3d_swapchain *swapchain) DECLSPEC_HIDDEN;
@ -2288,7 +2290,7 @@ diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
/*****************************************************************************
* Utility function prototypes
@@ -3175,7 +3401,9 @@
@@ -3176,7 +3402,9 @@
void shader_generate_main(const struct wined3d_shader *shader, struct wined3d_shader_buffer *buffer,
const struct wined3d_shader_reg_maps *reg_maps, const DWORD *byte_code, void *backend_ctx) DECLSPEC_HIDDEN;
BOOL shader_match_semantic(const char *semantic_name, enum wined3d_decl_usage usage) DECLSPEC_HIDDEN;
@ -9124,11 +9126,11 @@ diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c
if (!gl_info->supported[ARB_FRAMEBUFFER_SRGB] && state->render_states[WINED3D_RS_SRGBWRITEENABLE])
{
+#if defined(STAGING_CSMT)
const struct wined3d_format *rt_format = state->fb.render_targets[0]->format;
unsigned int rt_fmt_flags = state->fb.render_targets[0]->format_flags;
+#else /* STAGING_CSMT */
+ const struct wined3d_format *rt_format = state->fb->render_targets[0]->format;
+ unsigned int rt_fmt_flags = state->fb->render_targets[0]->format_flags;
+#endif /* STAGING_CSMT */
if (rt_format->flags & WINED3DFMT_FLAG_SRGB_WRITE)
if (rt_fmt_flags & WINED3DFMT_FLAG_SRGB_WRITE)
{
static unsigned int warned = 0;
diff --git a/dlls/wined3d/buffer.c b/dlls/wined3d/buffer.c