mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-01-28 22:04:43 -08:00
Rebase against 26ffc40bfb42b7c05ce9513bf479e31eb85294b1
This commit is contained in:
parent
8450903b5c
commit
69cb47fd36
@ -1,316 +0,0 @@
|
||||
From 4693069d7c35e2c186943b2394ab4a657253c5e1 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Costa <titan.costa@gmail.com>
|
||||
Date: Sun, 26 May 2013 19:42:08 +0200
|
||||
Subject: [PATCH] d3dx9_36: Implement ID3DXFontImpl_DrawText.
|
||||
|
||||
Changes by Sebastian Lackner <sebastian@fds-team.de>:
|
||||
* Use pitch value for locked buffer instead of assuming that pitch = width * bytesperpixel
|
||||
* Avoid one for loop to simplify code
|
||||
* Ensure that DrawText doesn't dereference a NULL pointer when count != 0.
|
||||
|
||||
Changes by Christian Costa <titan.costa@gmail.com>
|
||||
* Use dedicated variables for text width & height instead of reusing rect.right and rect.bottom
|
||||
* Remove useless test in pixel conversion
|
||||
* Remove left over 'partial stub' in fixme
|
||||
|
||||
Changes by Sebastian Lackner <sebastian@fds-team.de>:
|
||||
* Replace code to convert text from ascii to widechar
|
||||
* Strip terminating NULL chars before drawing text
|
||||
---
|
||||
dlls/d3dx9_36/font.c | 214 +++++++++++++++++++++++++++++++++++++++----
|
||||
1 file changed, 195 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/font.c b/dlls/d3dx9_36/font.c
|
||||
index cb09af22f57..89a60c9baf1 100644
|
||||
--- a/dlls/d3dx9_36/font.c
|
||||
+++ b/dlls/d3dx9_36/font.c
|
||||
@@ -32,6 +32,12 @@ struct d3dx_font
|
||||
|
||||
HDC hdc;
|
||||
HFONT hfont;
|
||||
+
|
||||
+ UINT tex_width;
|
||||
+ UINT tex_height;
|
||||
+ IDirect3DTexture9 *texture;
|
||||
+ HBITMAP bitmap;
|
||||
+ BYTE *bits;
|
||||
};
|
||||
|
||||
static inline struct d3dx_font *impl_from_ID3DXFont(ID3DXFont *iface)
|
||||
@@ -60,19 +66,27 @@ static HRESULT WINAPI ID3DXFontImpl_QueryInterface(ID3DXFont *iface, REFIID riid
|
||||
static ULONG WINAPI ID3DXFontImpl_AddRef(ID3DXFont *iface)
|
||||
{
|
||||
struct d3dx_font *This = impl_from_ID3DXFont(iface);
|
||||
- ULONG ref=InterlockedIncrement(&This->ref);
|
||||
+ ULONG ref = InterlockedIncrement(&This->ref);
|
||||
+
|
||||
TRACE("%p increasing refcount to %u\n", iface, ref);
|
||||
+
|
||||
return ref;
|
||||
}
|
||||
|
||||
static ULONG WINAPI ID3DXFontImpl_Release(ID3DXFont *iface)
|
||||
{
|
||||
struct d3dx_font *This = impl_from_ID3DXFont(iface);
|
||||
- ULONG ref=InterlockedDecrement(&This->ref);
|
||||
+ ULONG ref = InterlockedDecrement(&This->ref);
|
||||
|
||||
TRACE("%p decreasing refcount to %u\n", iface, ref);
|
||||
|
||||
- if(ref==0) {
|
||||
+ if (!ref)
|
||||
+ {
|
||||
+ if (This->texture)
|
||||
+ {
|
||||
+ IDirect3DTexture9_Release(This->texture);
|
||||
+ DeleteObject(This->bitmap);
|
||||
+ }
|
||||
DeleteObject(This->hfont);
|
||||
DeleteDC(This->hdc);
|
||||
IDirect3DDevice9_Release(This->device);
|
||||
@@ -175,17 +189,170 @@ static HRESULT WINAPI ID3DXFontImpl_PreloadTextW(ID3DXFont *iface, const WCHAR *
|
||||
static INT WINAPI ID3DXFontImpl_DrawTextA(ID3DXFont *iface, ID3DXSprite *sprite,
|
||||
const char *string, INT count, RECT *rect, DWORD format, D3DCOLOR color)
|
||||
{
|
||||
- FIXME("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x stub!\n",
|
||||
+ LPWSTR stringW;
|
||||
+ INT countW, ret = 0;
|
||||
+
|
||||
+ TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
|
||||
iface, sprite, debugstr_a(string), count, wine_dbgstr_rect(rect), format, color);
|
||||
- return 1;
|
||||
+
|
||||
+ if (!string || count <= 0)
|
||||
+ return 0;
|
||||
+
|
||||
+ countW = MultiByteToWideChar(CP_ACP, 0, string, count, NULL, 0);
|
||||
+ stringW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR));
|
||||
+ if (stringW)
|
||||
+ {
|
||||
+ MultiByteToWideChar(CP_ACP, 0, string, count, stringW, countW);
|
||||
+ ret = ID3DXFont_DrawTextW(iface, sprite, stringW, countW, rect, format, color);
|
||||
+ HeapFree(GetProcessHeap(), 0, stringW);
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
|
||||
const WCHAR *string, INT count, RECT *rect, DWORD format, D3DCOLOR color)
|
||||
{
|
||||
- FIXME("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x stub!\n",
|
||||
+ struct d3dx_font *This = impl_from_ID3DXFont(iface);
|
||||
+ RECT calc_rect = *rect;
|
||||
+ INT height;
|
||||
+
|
||||
+ TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
|
||||
iface, sprite, debugstr_w(string), count, wine_dbgstr_rect(rect), format, color);
|
||||
- return 1;
|
||||
+
|
||||
+ if (!string || count <= 0)
|
||||
+ return 0;
|
||||
+
|
||||
+ /* Strip terminating NULL characters */
|
||||
+ while (count > 0 && !string[count-1])
|
||||
+ count--;
|
||||
+
|
||||
+ height = DrawTextW(This->hdc, string, count, &calc_rect, format | DT_CALCRECT);
|
||||
+
|
||||
+ if (format & DT_CALCRECT)
|
||||
+ {
|
||||
+ *rect = calc_rect;
|
||||
+ return height;
|
||||
+ }
|
||||
+
|
||||
+ if (height && (calc_rect.left < calc_rect.right))
|
||||
+ {
|
||||
+ D3DLOCKED_RECT locked_rect;
|
||||
+ D3DXVECTOR3 position;
|
||||
+ UINT text_width, text_height;
|
||||
+ RECT text_rect;
|
||||
+ ID3DXSprite *target = sprite;
|
||||
+ HRESULT hr;
|
||||
+ int i, j;
|
||||
+
|
||||
+ /* Get rect position and dimensions */
|
||||
+ position.x = calc_rect.left;
|
||||
+ position.y = calc_rect.top;
|
||||
+ position.z = 0;
|
||||
+ text_width = calc_rect.right - calc_rect.left;
|
||||
+ text_height = calc_rect.bottom - calc_rect.top;
|
||||
+ text_rect.left = 0;
|
||||
+ text_rect.top = 0;
|
||||
+ text_rect.right = text_width;
|
||||
+ text_rect.bottom = text_height;
|
||||
+
|
||||
+ /* We need to flush as it seems all draws in the begin/end sequence use only the latest updated texture */
|
||||
+ if (sprite)
|
||||
+ ID3DXSprite_Flush(sprite);
|
||||
+
|
||||
+ /* Extend texture and DIB section to contain text */
|
||||
+ if ((text_width > This->tex_width) || (text_height > This->tex_height))
|
||||
+ {
|
||||
+ BITMAPINFOHEADER header;
|
||||
+
|
||||
+ if (text_width > This->tex_width)
|
||||
+ This->tex_width = make_pow2(text_width);
|
||||
+ if (text_height > This->tex_height)
|
||||
+ This->tex_height = make_pow2(text_height);
|
||||
+
|
||||
+ if (This->texture)
|
||||
+ {
|
||||
+ IDirect3DTexture9_Release(This->texture);
|
||||
+ DeleteObject(This->bitmap);
|
||||
+ }
|
||||
+
|
||||
+ hr = D3DXCreateTexture(This->device, This->tex_width, This->tex_height, 1, D3DUSAGE_DYNAMIC,
|
||||
+ D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &This->texture);
|
||||
+ if (FAILED(hr))
|
||||
+ {
|
||||
+ This->texture = NULL;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ header.biSize = sizeof(header);
|
||||
+ header.biWidth = This->tex_width;
|
||||
+ header.biHeight = -This->tex_height;
|
||||
+ header.biPlanes = 1;
|
||||
+ header.biBitCount = 32;
|
||||
+ header.biCompression = BI_RGB;
|
||||
+ header.biSizeImage = sizeof(DWORD) * This->tex_width * This->tex_height;
|
||||
+ header.biXPelsPerMeter = 0;
|
||||
+ header.biYPelsPerMeter = 0;
|
||||
+ header.biClrUsed = 0;
|
||||
+ header.biClrImportant = 0;
|
||||
+
|
||||
+ This->bitmap = CreateDIBSection(This->hdc, (const BITMAPINFO*)&header,
|
||||
+ DIB_RGB_COLORS, (void**)&This->bits, NULL, 0);
|
||||
+ if (!This->bitmap)
|
||||
+ {
|
||||
+ IDirect3DTexture9_Release(This->texture);
|
||||
+ This->texture = NULL;
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ SelectObject(This->hdc, This->bitmap);
|
||||
+ }
|
||||
+
|
||||
+ if (FAILED(IDirect3DTexture9_LockRect(This->texture, 0, &locked_rect, &text_rect, D3DLOCK_DISCARD)))
|
||||
+ return 0;
|
||||
+
|
||||
+ /* Clear rect */
|
||||
+ for (i = 0; i < text_height; i++)
|
||||
+ memset(This->bits + i * This->tex_width * sizeof(DWORD), 0,
|
||||
+ text_width * sizeof(DWORD));
|
||||
+
|
||||
+ DrawTextW(This->hdc, string, count, &text_rect, format);
|
||||
+
|
||||
+ /* All RGB components are equal so take one as alpha and set RGB
|
||||
+ * color to white, so it can be modulated with color parameter */
|
||||
+ for (i = 0; i < text_height; i++)
|
||||
+ {
|
||||
+ DWORD *src = (DWORD *)This->bits + i * This->tex_width;
|
||||
+ DWORD *dst = (DWORD *)((BYTE *)locked_rect.pBits + i * locked_rect.Pitch);
|
||||
+ for (j = 0; j < text_width; j++)
|
||||
+ {
|
||||
+ *dst++ = (*src++ << 24) | 0xFFFFFF;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ IDirect3DTexture9_UnlockRect(This->texture, 0);
|
||||
+
|
||||
+ if (!sprite)
|
||||
+ {
|
||||
+ hr = D3DXCreateSprite(This->device, &target);
|
||||
+ if (FAILED(hr))
|
||||
+ return 0;
|
||||
+ ID3DXSprite_Begin(target, 0);
|
||||
+ }
|
||||
+
|
||||
+ hr = target->lpVtbl->Draw(target, This->texture, &text_rect, NULL, &position, color);
|
||||
+
|
||||
+ if (!sprite)
|
||||
+ {
|
||||
+ ID3DXSprite_End(target);
|
||||
+ ID3DXSprite_Release(target);
|
||||
+ }
|
||||
+
|
||||
+ if (FAILED(hr))
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ return height;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ID3DXFontImpl_OnLostDevice(ID3DXFont *iface)
|
||||
@@ -298,46 +465,55 @@ HRESULT WINAPI D3DXCreateFontIndirectW(IDirect3DDevice9 *device, const D3DXFONT_
|
||||
|
||||
TRACE("(%p, %p, %p)\n", device, desc, font);
|
||||
|
||||
- if( !device || !desc || !font ) return D3DERR_INVALIDCALL;
|
||||
+ if (!device || !desc || !font) return D3DERR_INVALIDCALL;
|
||||
|
||||
- /* the device MUST support D3DFMT_A8R8G8B8 */
|
||||
+ TRACE("desc: %d %d %d %d %d %d %d %d %d %s\n", desc->Height, desc->Width, desc->Weight, desc->MipLevels, desc->Italic,
|
||||
+ desc->CharSet, desc->OutputPrecision, desc->Quality, desc->PitchAndFamily, debugstr_w(desc->FaceName));
|
||||
+
|
||||
+ /* The device MUST support D3DFMT_A8R8G8B8 */
|
||||
IDirect3DDevice9_GetDirect3D(device, &d3d);
|
||||
IDirect3DDevice9_GetCreationParameters(device, &cpars);
|
||||
IDirect3DDevice9_GetDisplayMode(device, 0, &mode);
|
||||
hr = IDirect3D9_CheckDeviceFormat(d3d, cpars.AdapterOrdinal, cpars.DeviceType, mode.Format, 0, D3DRTYPE_TEXTURE, D3DFMT_A8R8G8B8);
|
||||
- if(FAILED(hr)) {
|
||||
+ if (FAILED(hr))
|
||||
+ {
|
||||
IDirect3D9_Release(d3d);
|
||||
return D3DXERR_INVALIDDATA;
|
||||
}
|
||||
IDirect3D9_Release(d3d);
|
||||
|
||||
- object = HeapAlloc(GetProcessHeap(), 0, sizeof(struct d3dx_font));
|
||||
- if(object==NULL) {
|
||||
- *font=NULL;
|
||||
+ object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct d3dx_font));
|
||||
+ if (!object)
|
||||
+ {
|
||||
+ *font = NULL;
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
object->ID3DXFont_iface.lpVtbl = &D3DXFont_Vtbl;
|
||||
- object->ref=1;
|
||||
- object->device=device;
|
||||
- object->desc=*desc;
|
||||
+ object->ref = 1;
|
||||
+ object->device = device;
|
||||
+ object->desc = *desc;
|
||||
|
||||
object->hdc = CreateCompatibleDC(NULL);
|
||||
- if( !object->hdc ) {
|
||||
+ if (!object->hdc)
|
||||
+ {
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return D3DXERR_INVALIDDATA;
|
||||
}
|
||||
|
||||
object->hfont = CreateFontW(desc->Height, desc->Width, 0, 0, desc->Weight, desc->Italic, FALSE, FALSE, desc->CharSet,
|
||||
desc->OutputPrecision, CLIP_DEFAULT_PRECIS, desc->Quality, desc->PitchAndFamily, desc->FaceName);
|
||||
- if( !object->hfont ) {
|
||||
+ if (!object->hfont)
|
||||
+ {
|
||||
DeleteDC(object->hdc);
|
||||
HeapFree(GetProcessHeap(), 0, object);
|
||||
return D3DXERR_INVALIDDATA;
|
||||
}
|
||||
SelectObject(object->hdc, object->hfont);
|
||||
+ SetTextColor(object->hdc, 0x00ffffff);
|
||||
+ SetBkColor(object->hdc, 0x00000000);
|
||||
|
||||
IDirect3DDevice9_AddRef(device);
|
||||
- *font=&object->ID3DXFont_iface;
|
||||
+ *font = &object->ID3DXFont_iface;
|
||||
|
||||
return D3D_OK;
|
||||
}
|
||||
--
|
||||
2.25.0
|
||||
|
@ -1,32 +0,0 @@
|
||||
From 93b91dc6b0ccaf6c9babab7adb218454df93b750 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Costa <titan.costa@gmail.com>
|
||||
Date: Sun, 4 Jan 2015 18:43:42 +0100
|
||||
Subject: d3dx9_36: Fix horizontal centering in ID3DXFont_DrawText.
|
||||
|
||||
Fix remaining text issues in Air Strike.
|
||||
Should fix text placement in Stronghold Kingdoms.
|
||||
---
|
||||
dlls/d3dx9_36/font.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/font.c b/dlls/d3dx9_36/font.c
|
||||
index 368c784..fa52859 100644
|
||||
--- a/dlls/d3dx9_36/font.c
|
||||
+++ b/dlls/d3dx9_36/font.c
|
||||
@@ -254,6 +254,13 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
|
||||
return height;
|
||||
}
|
||||
|
||||
+ if (format & DT_CENTER)
|
||||
+ {
|
||||
+ UINT new_width = calc_rect.right - calc_rect.left;
|
||||
+ calc_rect.left = (rect->right + rect->left - new_width) / 2;
|
||||
+ calc_rect.right = calc_rect.left + new_width;
|
||||
+ }
|
||||
+
|
||||
if (height && (calc_rect.left < calc_rect.right))
|
||||
{
|
||||
D3DLOCKED_RECT locked_rect;
|
||||
--
|
||||
2.2.1
|
||||
|
@ -1,47 +0,0 @@
|
||||
From 0b6fc918564f580a9d62f14d76da83349075574f Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 4 Dec 2015 09:22:35 +1100
|
||||
Subject: [PATCH] d3dx9_36: Support NULL terminated strings in
|
||||
ID3DXFont_DrawText
|
||||
|
||||
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
---
|
||||
dlls/d3dx9_36/font.c | 10 ++++++++--
|
||||
dlls/d3dx9_36/tests/core.c | 1 -
|
||||
2 files changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/font.c b/dlls/d3dx9_36/font.c
|
||||
index ad1eb2383e4..83fec560fc5 100644
|
||||
--- a/dlls/d3dx9_36/font.c
|
||||
+++ b/dlls/d3dx9_36/font.c
|
||||
@@ -210,9 +210,12 @@ static INT WINAPI ID3DXFontImpl_DrawTextA(ID3DXFont *iface, ID3DXSprite *sprite,
|
||||
TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
|
||||
iface, sprite, debugstr_a(string), count, wine_dbgstr_rect(rect), format, color);
|
||||
|
||||
- if (!string || count <= 0)
|
||||
+ if (!string || count == 0)
|
||||
return 0;
|
||||
|
||||
+ if (count < 0)
|
||||
+ count = -1;
|
||||
+
|
||||
countW = MultiByteToWideChar(CP_ACP, 0, string, count, NULL, 0);
|
||||
stringW = HeapAlloc(GetProcessHeap(), 0, countW * sizeof(WCHAR));
|
||||
if (stringW)
|
||||
@@ -235,9 +238,12 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
|
||||
TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
|
||||
iface, sprite, debugstr_w(string), count, wine_dbgstr_rect(rect), format, color);
|
||||
|
||||
- if (!string || count <= 0)
|
||||
+ if (!string || count == 0)
|
||||
return 0;
|
||||
|
||||
+ if (count < 0)
|
||||
+ count = lstrlenW(string);
|
||||
+
|
||||
/* Strip terminating NULL characters */
|
||||
while (count > 0 && !string[count-1])
|
||||
count--;
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,43 +0,0 @@
|
||||
From ccf7cfe0cd7cbaa15ee34b4390dd6c30cf7e84ec Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Sat, 5 Dec 2015 15:31:06 +1100
|
||||
Subject: [PATCH] d3dx9_36: ID3DXFont_DrawText calc_rect can be null
|
||||
|
||||
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
---
|
||||
dlls/d3dx9_36/font.c | 8 ++++++--
|
||||
1 file changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/font.c b/dlls/d3dx9_36/font.c
|
||||
index 83fec560fc5..f5c704ebabb 100644
|
||||
--- a/dlls/d3dx9_36/font.c
|
||||
+++ b/dlls/d3dx9_36/font.c
|
||||
@@ -232,7 +232,7 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
|
||||
const WCHAR *string, INT count, RECT *rect, DWORD format, D3DCOLOR color)
|
||||
{
|
||||
struct d3dx_font *This = impl_from_ID3DXFont(iface);
|
||||
- RECT calc_rect = *rect;
|
||||
+ RECT calc_rect;
|
||||
INT height;
|
||||
|
||||
TRACE("iface %p, sprite %p, string %s, count %d, rect %s, format %#x, color 0x%08x\n",
|
||||
@@ -248,11 +248,15 @@ static INT WINAPI ID3DXFontImpl_DrawTextW(ID3DXFont *iface, ID3DXSprite *sprite,
|
||||
while (count > 0 && !string[count-1])
|
||||
count--;
|
||||
|
||||
+ if (rect)
|
||||
+ calc_rect = *rect;
|
||||
+
|
||||
height = DrawTextW(This->hdc, string, count, &calc_rect, format | DT_CALCRECT);
|
||||
|
||||
if (format & DT_CALCRECT)
|
||||
{
|
||||
- *rect = calc_rect;
|
||||
+ if (rect)
|
||||
+ *rect = calc_rect;
|
||||
return height;
|
||||
}
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@ -1,3 +0,0 @@
|
||||
Fixes: [24754] Support for ID3DXFont::DrawTextA/W
|
||||
#Disabled since it's in the process of being upstreamed.
|
||||
Disabled: true
|
@ -52,7 +52,7 @@ usage()
|
||||
# Get the upstream commit sha
|
||||
upstream_commit()
|
||||
{
|
||||
echo "eb63713f606d81dee75d7fdbc5685cc3862bc63f"
|
||||
echo "26ffc40bfb42b7c05ce9513bf479e31eb85294b1"
|
||||
}
|
||||
|
||||
# Show version information
|
||||
|
@ -1,4 +1,4 @@
|
||||
From cdfe27833233e77ad87e1552e3c550e99776bc90 Mon Sep 17 00:00:00 2001
|
||||
From e3f71059e2f8a7ef08becb3a3bc2cd7cc3ed2d61 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Gofman <gofmanp@gmail.com>
|
||||
Date: Fri, 3 Jan 2020 17:39:08 +0300
|
||||
Subject: [PATCH] ntdll: Call NtOpenFile through syscall thunk.
|
||||
@ -15,10 +15,10 @@ Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48410
|
||||
7 files changed, 17 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c
|
||||
index 9e7782c1ee..59e9671f9a 100644
|
||||
index c5134198285..0c6cda1cfaa 100644
|
||||
--- a/dlls/ntdll/actctx.c
|
||||
+++ b/dlls/ntdll/actctx.c
|
||||
@@ -2860,7 +2860,7 @@ static NTSTATUS open_nt_file( HANDLE *handle, UNICODE_STRING *name )
|
||||
@@ -2890,7 +2890,7 @@ static NTSTATUS open_nt_file( HANDLE *handle, UNICODE_STRING *name )
|
||||
attr.ObjectName = name;
|
||||
attr.SecurityDescriptor = NULL;
|
||||
attr.SecurityQualityOfService = NULL;
|
||||
@ -26,8 +26,8 @@ index 9e7782c1ee..59e9671f9a 100644
|
||||
+ return __syscall_NtOpenFile( handle, GENERIC_READ | SYNCHRONIZE, &attr, &io, FILE_SHARE_READ, FILE_SYNCHRONOUS_IO_ALERT );
|
||||
}
|
||||
|
||||
static NTSTATUS get_module_filename( HMODULE module, UNICODE_STRING *str, unsigned int extra_len )
|
||||
@@ -3200,7 +3200,7 @@ static NTSTATUS lookup_winsxs(struct actctx_loader* acl, struct assembly_identit
|
||||
static NTSTATUS get_manifest_in_module( struct actctx_loader* acl, struct assembly_identity* ai,
|
||||
@@ -3207,7 +3207,7 @@ static NTSTATUS lookup_winsxs(struct actctx_loader* acl, struct assembly_identit
|
||||
attr.SecurityDescriptor = NULL;
|
||||
attr.SecurityQualityOfService = NULL;
|
||||
|
||||
@ -37,10 +37,10 @@ index 9e7782c1ee..59e9671f9a 100644
|
||||
{
|
||||
sxs_ai = *ai;
|
||||
diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c
|
||||
index 2d96dd0537..9e61892a6b 100644
|
||||
index 95af2dde240..ba50aa1b807 100644
|
||||
--- a/dlls/ntdll/directory.c
|
||||
+++ b/dlls/ntdll/directory.c
|
||||
@@ -3026,7 +3026,7 @@ NTSTATUS DIR_get_unix_cwd( char **cwd )
|
||||
@@ -3012,7 +3012,7 @@ NTSTATUS DIR_get_unix_cwd( char **cwd )
|
||||
attr.SecurityDescriptor = NULL;
|
||||
attr.SecurityQualityOfService = NULL;
|
||||
|
||||
@ -50,7 +50,7 @@ index 2d96dd0537..9e61892a6b 100644
|
||||
RtlFreeUnicodeString( &dirW );
|
||||
if (status != STATUS_SUCCESS) goto done;
|
||||
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
|
||||
index a59f970cd8..037e13e0fb 100644
|
||||
index 7e8fd20e9d7..8fcd53b26ba 100644
|
||||
--- a/dlls/ntdll/loader.c
|
||||
+++ b/dlls/ntdll/loader.c
|
||||
@@ -2375,7 +2375,7 @@ static NTSTATUS open_dll_file( UNICODE_STRING *nt_name, WINE_MODREF **pwm,
|
||||
@ -63,10 +63,10 @@ index a59f970cd8..037e13e0fb 100644
|
||||
FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE )))
|
||||
{
|
||||
diff --git a/dlls/ntdll/locale.c b/dlls/ntdll/locale.c
|
||||
index b3717b3316..b1b749b475 100644
|
||||
index 8833cfa712c..9ce92007500 100644
|
||||
--- a/dlls/ntdll/locale.c
|
||||
+++ b/dlls/ntdll/locale.c
|
||||
@@ -249,7 +249,7 @@ static NTSTATUS open_nls_data_file( ULONG type, ULONG id, HANDLE *file )
|
||||
@@ -642,7 +642,7 @@ static NTSTATUS open_nls_data_file( ULONG type, ULONG id, HANDLE *file )
|
||||
return STATUS_NO_MEMORY;
|
||||
valueW.Length = sprintfW( valueW.Buffer, pathfmtW, system_dir, name ) * sizeof(WCHAR);
|
||||
InitializeObjectAttributes( &attr, &valueW, 0, 0, NULL );
|
||||
@ -75,7 +75,7 @@ index b3717b3316..b1b749b475 100644
|
||||
if (!status) TRACE( "found %s\n", debugstr_w( valueW.Buffer ));
|
||||
RtlFreeUnicodeString( &valueW );
|
||||
if (status != STATUS_OBJECT_NAME_NOT_FOUND) return status;
|
||||
@@ -274,7 +274,7 @@ static NTSTATUS open_nls_data_file( ULONG type, ULONG id, HANDLE *file )
|
||||
@@ -666,7 +666,7 @@ static NTSTATUS open_nls_data_file( ULONG type, ULONG id, HANDLE *file )
|
||||
strcatW( valueW.Buffer, name );
|
||||
valueW.Length = strlenW(valueW.Buffer) * sizeof(WCHAR);
|
||||
InitializeObjectAttributes( &attr, &valueW, 0, 0, NULL );
|
||||
@ -85,10 +85,10 @@ index b3717b3316..b1b749b475 100644
|
||||
}
|
||||
RtlFreeUnicodeString( &valueW );
|
||||
diff --git a/dlls/ntdll/ntdll_misc.h b/dlls/ntdll/ntdll_misc.h
|
||||
index a825366992..7a16803df1 100644
|
||||
index 94e8bf54576..0d8a603c859 100644
|
||||
--- a/dlls/ntdll/ntdll_misc.h
|
||||
+++ b/dlls/ntdll/ntdll_misc.h
|
||||
@@ -290,4 +290,13 @@ extern BOOL read_process_memory_stats(int unix_pid, VM_COUNTERS *pvmi) DECLSPEC_
|
||||
@@ -289,4 +289,13 @@ extern BOOL read_process_memory_stats(int unix_pid, VM_COUNTERS *pvmi) DECLSPEC_
|
||||
/* string functions */
|
||||
int __cdecl NTDLL_tolower( int c );
|
||||
int __cdecl _stricmp( LPCSTR str1, LPCSTR str2 );
|
||||
@ -103,10 +103,10 @@ index a825366992..7a16803df1 100644
|
||||
+
|
||||
#endif
|
||||
diff --git a/dlls/ntdll/path.c b/dlls/ntdll/path.c
|
||||
index 11483fabba..e23bb01978 100644
|
||||
index 610646be85b..e37c8957e24 100644
|
||||
--- a/dlls/ntdll/path.c
|
||||
+++ b/dlls/ntdll/path.c
|
||||
@@ -1025,7 +1025,7 @@ NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING* dir)
|
||||
@@ -1021,7 +1021,7 @@ NTSTATUS WINAPI RtlSetCurrentDirectory_U(const UNICODE_STRING* dir)
|
||||
attr.SecurityDescriptor = NULL;
|
||||
attr.SecurityQualityOfService = NULL;
|
||||
|
||||
@ -116,7 +116,7 @@ index 11483fabba..e23bb01978 100644
|
||||
if (nts != STATUS_SUCCESS) goto out;
|
||||
|
||||
diff --git a/dlls/ntdll/process.c b/dlls/ntdll/process.c
|
||||
index 2965981c48..d480246452 100644
|
||||
index a1c688745a7..83d610010b3 100644
|
||||
--- a/dlls/ntdll/process.c
|
||||
+++ b/dlls/ntdll/process.c
|
||||
@@ -1396,7 +1396,7 @@ static NTSTATUS get_pe_file_info( UNICODE_STRING *path, ULONG attributes,
|
||||
@ -129,5 +129,5 @@ index 2965981c48..d480246452 100644
|
||||
{
|
||||
BOOL is_64bit;
|
||||
--
|
||||
2.24.1
|
||||
2.17.1
|
||||
|
||||
|
@ -1,23 +1,23 @@
|
||||
From 4e0ec516c5494db8c99e0f2e32f491a88b93cac1 Mon Sep 17 00:00:00 2001
|
||||
From 2957b95552af20dcd56c8ebcde57f41f0e301628 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Thu, 20 Jul 2017 13:50:07 +0200
|
||||
Subject: [PATCH] wined3d: Implement all 8 d3d11 color write masks.
|
||||
|
||||
---
|
||||
dlls/d3d11/device.c | 29 ++++++++++-------------
|
||||
dlls/d3d11/state.c | 4 ----
|
||||
dlls/wined3d/context.c | 10 ++++----
|
||||
dlls/d3d11/device.c | 29 ++++++++++-----------
|
||||
dlls/d3d11/state.c | 4 ---
|
||||
dlls/wined3d/context.c | 10 +++-----
|
||||
dlls/wined3d/device.c | 6 ++---
|
||||
dlls/wined3d/state.c | 43 ++++++++++++++++++++++++----------
|
||||
dlls/wined3d/stateblock.c | 11 +++++----
|
||||
dlls/wined3d/state.c | 46 +++++++++++++++++++++++-----------
|
||||
dlls/wined3d/stateblock.c | 11 +++++---
|
||||
dlls/wined3d/surface.c | 7 +++---
|
||||
dlls/wined3d/utils.c | 6 ++++-
|
||||
dlls/wined3d/wined3d_private.h | 1 +
|
||||
include/wine/wined3d.h | 14 ++++++++++-
|
||||
10 files changed, 78 insertions(+), 53 deletions(-)
|
||||
10 files changed, 80 insertions(+), 54 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
|
||||
index 2ac8f2bf84c..15298d2cc97 100644
|
||||
index 143ae6ecc54..089b37e7868 100644
|
||||
--- a/dlls/d3d11/device.c
|
||||
+++ b/dlls/d3d11/device.c
|
||||
@@ -2088,6 +2088,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_OMSetBlendState(ID3D11Devi
|
||||
@ -71,7 +71,7 @@ index 2ac8f2bf84c..15298d2cc97 100644
|
||||
}
|
||||
|
||||
diff --git a/dlls/d3d11/state.c b/dlls/d3d11/state.c
|
||||
index 4d56f7dc752..186cb1511c3 100644
|
||||
index dd2eb6306e7..3375b31e949 100644
|
||||
--- a/dlls/d3d11/state.c
|
||||
+++ b/dlls/d3d11/state.c
|
||||
@@ -344,10 +344,6 @@ HRESULT d3d_blend_state_create(struct d3d_device *device, const D3D11_BLEND_DESC
|
||||
@ -86,7 +86,7 @@ index 4d56f7dc752..186cb1511c3 100644
|
||||
|
||||
/* glEnableIndexedEXT(GL_BLEND, ...) */
|
||||
diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
|
||||
index a634b6146ec..58ac8b6dfe1 100644
|
||||
index 149c7318d96..aa7fce873c7 100644
|
||||
--- a/dlls/wined3d/context.c
|
||||
+++ b/dlls/wined3d/context.c
|
||||
@@ -3059,7 +3059,7 @@ void wined3d_context_gl_apply_blit_state(struct wined3d_context_gl *context_gl,
|
||||
@ -98,7 +98,7 @@ index a634b6146ec..58ac8b6dfe1 100644
|
||||
SIZE rt_size;
|
||||
|
||||
TRACE("Setting up context %p for blitting.\n", context);
|
||||
@@ -3166,10 +3166,8 @@ void wined3d_context_gl_apply_blit_state(struct wined3d_context_gl *context_gl,
|
||||
@@ -3165,10 +3165,8 @@ void wined3d_context_gl_apply_blit_state(struct wined3d_context_gl *context_gl,
|
||||
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_SRGBWRITEENABLE));
|
||||
}
|
||||
gl_info->gl_ops.gl.p_glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
|
||||
@ -111,7 +111,7 @@ index a634b6146ec..58ac8b6dfe1 100644
|
||||
|
||||
context->last_was_rhw = TRUE;
|
||||
context_invalidate_state(context, STATE_VDECL); /* because of last_was_rhw = TRUE */
|
||||
@@ -5172,7 +5170,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
|
||||
@@ -5171,7 +5169,7 @@ void draw_primitive(struct wined3d_device *device, const struct wined3d_state *s
|
||||
if (!(rtv = fb->render_targets[i]) || rtv->format->id == WINED3DFMT_NULL)
|
||||
continue;
|
||||
|
||||
@ -121,7 +121,7 @@ index a634b6146ec..58ac8b6dfe1 100644
|
||||
wined3d_rendertarget_view_load_location(rtv, context, rtv->resource->draw_binding);
|
||||
wined3d_rendertarget_view_invalidate_location(rtv, ~rtv->resource->draw_binding);
|
||||
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
|
||||
index 53dcdbc5622..7400902e620 100644
|
||||
index de2f2b9a52f..a574b8933de 100644
|
||||
--- a/dlls/wined3d/device.c
|
||||
+++ b/dlls/wined3d/device.c
|
||||
@@ -437,10 +437,8 @@ void device_clear_render_targets(struct wined3d_device *device, UINT rt_count, c
|
||||
@ -138,7 +138,7 @@ index 53dcdbc5622..7400902e620 100644
|
||||
checkGLcall("glClearColor");
|
||||
clear_mask = clear_mask | GL_COLOR_BUFFER_BIT;
|
||||
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
|
||||
index 58e0a7e53e9..4d8253254b6 100644
|
||||
index 89051aa1e41..e162d37c28d 100644
|
||||
--- a/dlls/wined3d/state.c
|
||||
+++ b/dlls/wined3d/state.c
|
||||
@@ -1551,9 +1551,6 @@ static void state_colorwrite(struct wined3d_context *context, const struct wined
|
||||
@ -189,7 +189,7 @@ index 58e0a7e53e9..4d8253254b6 100644
|
||||
}
|
||||
|
||||
static void state_colorwrite1(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
|
||||
@@ -4673,8 +4675,22 @@ const struct wined3d_state_entry_template misc_state_template[] =
|
||||
@@ -4672,8 +4674,22 @@ const struct wined3d_state_entry_template misc_state_template[] =
|
||||
{ STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS), { STATE_RENDER(WINED3D_RS_MULTISAMPLEANTIALIAS), state_msaa_w }, WINED3D_GL_EXT_NONE },
|
||||
{ STATE_RENDER(WINED3D_RS_MULTISAMPLEMASK), { STATE_RENDER(WINED3D_RS_MULTISAMPLEMASK), state_multisampmask }, WINED3D_GL_EXT_NONE },
|
||||
{ STATE_RENDER(WINED3D_RS_DEBUGMONITORTOKEN), { STATE_RENDER(WINED3D_RS_DEBUGMONITORTOKEN), state_debug_monitor }, WINED3D_GL_EXT_NONE },
|
||||
@ -212,15 +212,18 @@ index 58e0a7e53e9..4d8253254b6 100644
|
||||
+ { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE7), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE },
|
||||
{ STATE_RENDER(WINED3D_RS_BLENDOP), { STATE_RENDER(WINED3D_RS_BLENDOP), state_blendop }, WINED3D_GL_BLEND_EQUATION },
|
||||
{ STATE_RENDER(WINED3D_RS_BLENDOP), { STATE_RENDER(WINED3D_RS_BLENDOP), state_blendop_w }, WINED3D_GL_EXT_NONE },
|
||||
{ STATE_RENDER(WINED3D_RS_SCISSORTESTENABLE), { STATE_RENDER(WINED3D_RS_SCISSORTESTENABLE), state_scissor }, WINED3D_GL_EXT_NONE },
|
||||
@@ -4684,6 +4700,7 @@ const struct wined3d_state_entry_template misc_state_template[] =
|
||||
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE1), state_colorwrite1 }, EXT_DRAW_BUFFERS2 },
|
||||
@@ -4681,7 +4697,9 @@ const struct wined3d_state_entry_template misc_state_template[] =
|
||||
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2), state_colorwrite2 }, EXT_DRAW_BUFFERS2 },
|
||||
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE2), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE },
|
||||
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3), state_colorwrite3 }, EXT_DRAW_BUFFERS2 },
|
||||
{ STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE },
|
||||
- { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL }, WINED3D_GL_EXT_NONE },
|
||||
+ { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE3), { STATE_RENDER(WINED3D_RS_COLORWRITEENABLE), NULL },
|
||||
+WINED3D_GL_EXT_NONE },
|
||||
+ { STATE_RENDER(WINED3D_RS_SLOPESCALEDEPTHBIAS), { STATE_RENDER(WINED3D_RS_DEPTHBIAS), NULL }, WINED3D_GL_EXT_NONE },
|
||||
{ STATE_RENDER(WINED3D_RS_DEPTHBIAS), { STATE_RENDER(WINED3D_RS_DEPTHBIAS), state_depthbias }, WINED3D_GL_EXT_NONE },
|
||||
{ STATE_RENDER(WINED3D_RS_ZVISIBLE), { STATE_RENDER(WINED3D_RS_ZVISIBLE), state_zvisible }, WINED3D_GL_EXT_NONE },
|
||||
/* Samplers */
|
||||
{ STATE_SAMPLER(0), { STATE_SAMPLER(0), sampler }, WINED3D_GL_EXT_NONE },
|
||||
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
|
||||
index 22862403e90..f4cca385dcf 100644
|
||||
--- a/dlls/wined3d/stateblock.c
|
||||
@ -272,7 +275,7 @@ index 22862403e90..f4cca385dcf 100644
|
||||
|
||||
static void init_default_texture_state(unsigned int i, DWORD stage[WINED3D_HIGHEST_TEXTURE_STATE + 1])
|
||||
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
|
||||
index 8a545d821e5..6a5a8fc870c 100644
|
||||
index cb79f5c0746..60950c45819 100644
|
||||
--- a/dlls/wined3d/surface.c
|
||||
+++ b/dlls/wined3d/surface.c
|
||||
@@ -153,6 +153,7 @@ void texture2d_blt_fbo(struct wined3d_device *device, struct wined3d_context *co
|
||||
@ -295,7 +298,7 @@ index 8a545d821e5..6a5a8fc870c 100644
|
||||
+ context_invalidate_state(context, STATE_RENDER(WINED3D_RS_COLORWRITE(i)));
|
||||
|
||||
gl_info->gl_ops.gl.p_glDisable(GL_SCISSOR_TEST);
|
||||
context_invalidate_state(context, STATE_RENDER(WINED3D_RS_SCISSORTESTENABLE));
|
||||
context_invalidate_state(context, STATE_RASTERIZER);
|
||||
diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c
|
||||
index 9ad294c597e..0e04fef296d 100644
|
||||
--- a/dlls/wined3d/utils.c
|
||||
@ -336,7 +339,7 @@ index 5c0324273a0..e2f715becf2 100644
|
||||
struct min_lookup
|
||||
{
|
||||
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
|
||||
index e7e3af50166..d9a09f0f6b4 100644
|
||||
index 07e0692fd7d..2c789db2f71 100644
|
||||
--- a/include/wine/wined3d.h
|
||||
+++ b/include/wine/wined3d.h
|
||||
@@ -404,8 +404,20 @@ enum wined3d_render_state
|
||||
@ -362,5 +365,5 @@ index e7e3af50166..d9a09f0f6b4 100644
|
||||
enum wined3d_blend
|
||||
{
|
||||
--
|
||||
2.25.1
|
||||
2.17.1
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user