Compare commits

...

16 Commits
v8.9 ... v8.10

Author SHA1 Message Date
Alistair Leslie-Hughes
adda594159 Release v8.10 2023-06-10 15:46:29 +10:00
Alistair Leslie-Hughes
710e29cc68 Updated vkd3d-latest patchset 2023-06-10 10:59:31 +10:00
Alistair Leslie-Hughes
6c167535e3 Added dnsapi_dns_records patchset 2023-06-09 14:43:49 +10:00
Aida JonikenÄ—
e9b0c33d65 msxml3-FreeThreadedXMLHTTP60: Initialize request_body_size when creating the XML HTTP request.
This fixes a crash in TeamTalk 5.
2023-06-08 12:35:13 -05:00
Alistair Leslie-Hughes
d44a516142 Updated vkd3d-latest patchset 2023-06-08 14:12:14 +10:00
Alistair Leslie-Hughes
453c5cda07 Added oleaut32-default-pic-size patchset 2023-06-08 13:27:09 +10:00
Alistair Leslie-Hughes
d3d87f1a2c Rebase against 07d0f1f0c0bbd744f5f107f82b702a891e41c2eb. 2023-06-08 09:21:24 +10:00
Alistair Leslie-Hughes
42e2a72d37 Added d3dx9-sprite-state patchset 2023-06-07 08:26:53 +10:00
Alistair Leslie-Hughes
d7bbcc7ad9 Updated vkd3d-latest 2023-06-07 08:13:06 +10:00
Alistair Leslie-Hughes
4625289771 Updated vkd3d-latest patchset 2023-06-02 10:31:36 +10:00
Alistair Leslie-Hughes
cda4a1e125 Updated winex11-_NET_ACTIVE_WINDOW patchset 2023-06-02 09:14:30 +10:00
Alistair Leslie-Hughes
1039d808e2 Rebase against 6b0836e3f157318b00effc1de563da4d4b0d16b8. 2023-06-01 14:58:39 +10:00
Alistair Leslie-Hughes
6173bd8b0d Rebase against 7ed63c30e8dee3509c52e11230470be2dcfe6cf5. 2023-05-31 11:01:58 +10:00
Zebediah Figura
ba6e2398d7 Rebase against d0d472bb3e8680e286e404a73fceb29cebe85b73. 2023-05-29 16:33:43 -05:00
Alistair Leslie-Hughes
2dcacd0dbf Release v8.9.1 2023-05-29 07:26:53 +10:00
Alistair Leslie-Hughes
1039396c8e Updated vkd3d-latest patchset
Fix the mingw mac build.
2023-05-28 21:36:15 +10:00
27 changed files with 2009 additions and 1472 deletions

View File

@@ -0,0 +1,127 @@
From cf47173eec41f4427248796a781e3aa4463a79db Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rafa=C5=82=20Mu=C5=BCy=C5=82o?= <galtgendo@o2.pl>
Date: Wed, 7 Jun 2023 08:17:59 +1000
Subject: [PATCH] d3dx9: Improve handling of Sprite render states
---
dlls/d3dx9_36/sprite.c | 76 +++++++++++++++++++++++-------------------
1 file changed, 41 insertions(+), 35 deletions(-)
diff --git a/dlls/d3dx9_36/sprite.c b/dlls/d3dx9_36/sprite.c
index 1a072e52cda..0ce2ab977f3 100644
--- a/dlls/d3dx9_36/sprite.c
+++ b/dlls/d3dx9_36/sprite.c
@@ -193,7 +193,7 @@ static HRESULT WINAPI d3dx9_sprite_SetWorldViewLH(ID3DXSprite *iface,
}
/* Helper function */
-static void set_states(struct d3dx9_sprite *object)
+static void set_states(struct d3dx9_sprite *object, DWORD flags)
{
D3DXMATRIX mat;
D3DVIEWPORT9 vp;
@@ -204,32 +204,35 @@ static void set_states(struct d3dx9_sprite *object)
IDirect3DDevice9_SetNPatchMode(object->device, 0.0f);
/* Render states */
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_ALPHABLENDENABLE, TRUE);
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_ALPHAFUNC, D3DCMP_GREATER);
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_ALPHAREF, 0x00);
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_ALPHATESTENABLE, object->alphacmp_caps);
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_BLENDOP, D3DBLENDOP_ADD);
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_CLIPPING, TRUE);
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_CLIPPLANEENABLE, 0);
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_COLORWRITEENABLE, D3DCOLORWRITEENABLE_ALPHA | D3DCOLORWRITEENABLE_BLUE |
- D3DCOLORWRITEENABLE_GREEN | D3DCOLORWRITEENABLE_RED);
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_CULLMODE, D3DCULL_NONE);
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_DIFFUSEMATERIALSOURCE, D3DMCS_COLOR1);
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_ENABLEADAPTIVETESSELLATION, FALSE);
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_FILLMODE, D3DFILL_SOLID);
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_FOGENABLE, FALSE);
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_INDEXEDVERTEXBLENDENABLE, FALSE);
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_LIGHTING, FALSE);
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_RANGEFOGENABLE, FALSE);
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_SEPARATEALPHABLENDENABLE, FALSE);
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_SHADEMODE, D3DSHADE_GOURAUD);
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_SPECULARENABLE, FALSE);
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_SRGBWRITEENABLE, FALSE);
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_STENCILENABLE, FALSE);
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_VERTEXBLEND, FALSE);
- IDirect3DDevice9_SetRenderState(object->device, D3DRS_WRAP0, 0);
+ if (!(flags & D3DXSPRITE_DONOTMODIFY_RENDERSTATE))
+ {
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_ALPHABLENDENABLE, TRUE);
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_ALPHAFUNC, D3DCMP_GREATER);
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_ALPHAREF, 0x00);
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_ALPHATESTENABLE, object->alphacmp_caps);
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_BLENDOP, D3DBLENDOP_ADD);
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_CLIPPING, TRUE);
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_CLIPPLANEENABLE, 0);
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_COLORWRITEENABLE, D3DCOLORWRITEENABLE_ALPHA | D3DCOLORWRITEENABLE_BLUE |
+ D3DCOLORWRITEENABLE_GREEN | D3DCOLORWRITEENABLE_RED);
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_CULLMODE, D3DCULL_NONE);
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA);
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_DIFFUSEMATERIALSOURCE, D3DMCS_COLOR1);
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_ENABLEADAPTIVETESSELLATION, FALSE);
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_FILLMODE, D3DFILL_SOLID);
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_FOGENABLE, FALSE);
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_INDEXEDVERTEXBLENDENABLE, FALSE);
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_LIGHTING, FALSE);
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_RANGEFOGENABLE, FALSE);
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_SEPARATEALPHABLENDENABLE, FALSE);
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_SHADEMODE, D3DSHADE_GOURAUD);
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_SPECULARENABLE, FALSE);
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_SRGBWRITEENABLE, FALSE);
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_STENCILENABLE, FALSE);
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_VERTEXBLEND, FALSE);
+ IDirect3DDevice9_SetRenderState(object->device, D3DRS_WRAP0, 0);
+ }
/* Texture stage states */
IDirect3DDevice9_SetTextureStageState(object->device, 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE);
@@ -266,12 +269,15 @@ static void set_states(struct d3dx9_sprite *object)
IDirect3DDevice9_SetSamplerState(object->device, 0, D3DSAMP_SRGBTEXTURE, 0);
/* Matrices */
- D3DXMatrixIdentity(&mat);
- IDirect3DDevice9_SetTransform(object->device, D3DTS_WORLD, &mat);
- IDirect3DDevice9_SetTransform(object->device, D3DTS_VIEW, &object->view);
- IDirect3DDevice9_GetViewport(object->device, &vp);
- D3DXMatrixOrthoOffCenterLH(&mat, vp.X+0.5f, (float)vp.Width+vp.X+0.5f, (float)vp.Height+vp.Y+0.5f, vp.Y+0.5f, vp.MinZ, vp.MaxZ);
- IDirect3DDevice9_SetTransform(object->device, D3DTS_PROJECTION, &mat);
+ if (!(flags & D3DXSPRITE_OBJECTSPACE))
+ {
+ D3DXMatrixIdentity(&mat);
+ IDirect3DDevice9_SetTransform(object->device, D3DTS_WORLD, &mat);
+ IDirect3DDevice9_SetTransform(object->device, D3DTS_VIEW, &object->view);
+ IDirect3DDevice9_GetViewport(object->device, &vp);
+ D3DXMatrixOrthoOffCenterLH(&mat, vp.X+0.5f, (float)vp.Width+vp.X+0.5f, (float)vp.Height+vp.Y+0.5f, vp.Y+0.5f, vp.MinZ, vp.MaxZ);
+ IDirect3DDevice9_SetTransform(object->device, D3DTS_PROJECTION, &mat);
+ }
}
static HRESULT WINAPI d3dx9_sprite_Begin(ID3DXSprite *iface, DWORD flags)
@@ -317,7 +323,7 @@ D3DXSPRITE_SORT_TEXTURE: sort by texture (so that it doesn't change too often)
hr=IDirect3DDevice9_BeginStateBlock(This->device);
if(hr!=D3D_OK) return hr;
- set_states(This);
+ set_states(This, flags);
IDirect3DDevice9_SetVertexDeclaration(This->device, This->vdecl);
IDirect3DDevice9_SetStreamSource(This->device, 0, NULL, 0, sizeof(struct sprite_vertex));
@@ -330,7 +336,7 @@ D3DXSPRITE_SORT_TEXTURE: sort by texture (so that it doesn't change too often)
}
/* Apply device state */
- set_states(This);
+ set_states(This, flags);
This->flags=flags;
This->ready=TRUE;
--
2.40.1

View File

@@ -0,0 +1 @@
Fixes: [54034] d3dx9: Improve sprite rendering state handling.

View File

@@ -1,4 +1,4 @@
From f78fc333748a6c4f664bb10ee2115c86690b3b16 Mon Sep 17 00:00:00 2001
From e9f5c886b6b40ca77eb1dd7f0d21bbdc483b7a95 Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Mon, 6 Oct 2014 05:06:06 +0200
Subject: [PATCH] dbghelp: Always check for debug symbols in BINDIR.
@@ -9,12 +9,12 @@ Subject: [PATCH] dbghelp: Always check for debug symbols in BINDIR.
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/dbghelp/Makefile.in b/dlls/dbghelp/Makefile.in
index 22be2612eeb..2e11bb2b62d 100644
index 74647820126..9f0aad2fc4f 100644
--- a/dlls/dbghelp/Makefile.in
+++ b/dlls/dbghelp/Makefile.in
@@ -2,7 +2,7 @@ MODULE = dbghelp.dll
IMPORTLIB = dbghelp
IMPORTS = $(ZLIB_PE_LIBS)
IMPORTS = kernelbase $(ZLIB_PE_LIBS)
EXTRAINCL = $(ZLIB_PE_CFLAGS)
-EXTRADEFS = -D_IMAGEHLP_SOURCE_
+EXTRADEFS = -D_IMAGEHLP_SOURCE_ -DBINDIR="L\"${bindir}\""
@@ -22,10 +22,10 @@ index 22be2612eeb..2e11bb2b62d 100644
C_SRCS = \
diff --git a/dlls/dbghelp/elf_module.c b/dlls/dbghelp/elf_module.c
index 3c1e225e195..4468f7fa4ed 100644
index a2a60752a68..a2bca11048f 100644
--- a/dlls/dbghelp/elf_module.c
+++ b/dlls/dbghelp/elf_module.c
@@ -1445,6 +1445,7 @@ static BOOL elf_search_and_load_file(struct process* pcs, const WCHAR* filename,
@@ -1457,6 +1457,7 @@ static BOOL elf_search_and_load_file(struct process* pcs, const WCHAR* filename,
load_elf.elf_info = elf_info;
ret = search_unix_path(filename, process_getenv(pcs, L"LD_LIBRARY_PATH"), elf_load_file_cb, &load_elf)
@@ -34,5 +34,5 @@ index 3c1e225e195..4468f7fa4ed 100644
}
--
2.39.1
2.40.1

View File

@@ -0,0 +1,96 @@
From fcf816014b4f7ce60b544f5a50a5a88ade3b055b Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Thu, 1 Jun 2023 14:30:10 +0300
Subject: [PATCH] dnsapi/tests: Add some tests for DNS_TYPE_SRV messages.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
---
dlls/dnsapi/tests/record.c | 65 ++++++++++++++++++++++++++++++++++++++
1 file changed, 65 insertions(+)
diff --git a/dlls/dnsapi/tests/record.c b/dlls/dnsapi/tests/record.c
index 20738de3618..8abcdadaacc 100644
--- a/dlls/dnsapi/tests/record.c
+++ b/dlls/dnsapi/tests/record.c
@@ -193,6 +193,28 @@ static BYTE msg_types[] = /* various record types */
/* KEY */ 0xc0, 0x0c, 0x00, 0x19, 0x00, 0x01, 0x04, 0x05, 0x06, 0x07, 0x00, 0x06, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66,
/* TXT */ 0x01, 't', 0x01, 'x', 0x00, 0x00, 0x10, 0x00, 0x01, 0x04, 0x05, 0x06, 0x07, 0x00, 0x09, 0x02, 'z', 'y', 0x00, 0x04, 'X', 'Y', 0xc3, 0xa9
};
+static BYTE msg_question_srv[] = /* SRV question only */
+{
+ 0x12, 0x34, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 5,'_','l','d','a','p',4,'_','t','c','p',2,'d','c',6,'_','m','s','d','c','s',6,'w','i','n','e','h','q',3,'o','r','g',0x00,0x00,0x00,0x21,0x00
+};
+static BYTE msg_answer_srv[] = /* SRV answer only */
+{
+ 0x12, 0x34, 0x81, 0x80, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 5,'_','l','d','a','p',4,'_','t','c','p',2,'d','c',6,'_','m','s','d','c','s',6,'w','i','n','e','h','q',3,'o','r','g',0x00,
+ 0x00,0x21,0x00,0x01,0x04,0x05,0x06,0x07,
+ 0x00,0x15,0x00,0x00,0x00,0x00,0x01,0x85,
+ 2,'d','c',6,'w','i','n','e','h','q',3,'o','r','g',0x00
+};
+static BYTE msg_full_srv[] = /* SRV question + answer */
+{
+ 0x12, 0x34, 0x81, 0x80, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 5,'_','l','d','a','p',4,'_','t','c','p',2,'d','c',6,'_','m','s','d','c','s',6,'w','i','n','e','h','q',3,'o','r','g',0x00,
+ 0x00,0x21,0x00,0x01,
+ 0xc0,0x0c,0x00,0x21,0x00,0x01,0x04,0x05,0x06,0x07,
+ 0x00,0x15,0x00,0x00,0x00,0x00,0x01,0x85,
+ 2,'d','c',6,'w','i','n','e','h','q',3,'o','r','g',0x00
+};
static void test_DnsExtractRecordsFromMessage(void)
{
@@ -200,6 +222,49 @@ static void test_DnsExtractRecordsFromMessage(void)
DNS_RECORDA *rec, *r;
DNS_RECORDW *recW, *rW;
+ rec = NULL;
+ ret = DnsExtractRecordsFromMessage_UTF8( (DNS_MESSAGE_BUFFER *)msg_full_srv, sizeof(msg_full_srv), &rec );
+ todo_wine
+ ok( !ret, "failed %ld\n", ret );
+ todo_wine
+ ok( rec != NULL, "record not set\n" );
+ if (!rec) goto next;
+ ok( !strcmp( rec->pName, "_ldap._tcp.dc._msdcs.winehq.org" ), "wrong name %s\n", rec->pName );
+ ok( rec->Flags.S.Section == DnsSectionAnswer, "wrong section %u\n", rec->Flags.S.Section );
+ ok( rec->Flags.S.CharSet == DnsCharSetUtf8, "wrong charset %u\n", rec->Flags.S.CharSet );
+ ok( rec->wType == DNS_TYPE_SRV, "wrong type %u\n", rec->wType );
+ todo_wine
+ ok( rec->wDataLength == sizeof(DNS_SRV_DATAA) + strlen( "dc.winehq.org" ) + 1, "wrong len %u\n", rec->wDataLength );
+ ok( rec->dwTtl == 0x04050607, "wrong ttl %#lx\n", rec->dwTtl );
+ ok( !strcmp( rec->Data.SRV.pNameTarget, "dc.winehq.org"), "wrong target %s\n", rec->Data.SRV.pNameTarget );
+ ok( !rec->pNext, "next record %p\n", rec->pNext );
+ DnsRecordListFree( (DNS_RECORD *)rec, DnsFreeRecordList );
+
+next:
+ rec = (void *)0xdeadbeef;
+ ret = DnsExtractRecordsFromMessage_UTF8( (DNS_MESSAGE_BUFFER *)msg_question_srv, sizeof(msg_question_srv), &rec );
+ ok( !ret, "failed %ld\n", ret );
+ ok( !rec, "record %p\n", rec );
+
+ rec = NULL;
+ ret = DnsExtractRecordsFromMessage_UTF8( (DNS_MESSAGE_BUFFER *)msg_answer_srv, sizeof(msg_answer_srv), &rec );
+ todo_wine
+ ok( !ret, "failed %ld\n", ret );
+ todo_wine
+ ok( rec != NULL, "record not set\n" );
+ if (!rec) goto next2;
+ ok( !strcmp( rec->pName, "_ldap._tcp.dc._msdcs.winehq.org" ), "wrong name %s\n", rec->pName );
+ ok( rec->Flags.S.Section == DnsSectionAnswer, "wrong section %u\n", rec->Flags.S.Section );
+ ok( rec->Flags.S.CharSet == DnsCharSetUtf8, "wrong charset %u\n", rec->Flags.S.CharSet );
+ ok( rec->wType == DNS_TYPE_SRV, "wrong type %u\n", rec->wType );
+ todo_wine
+ ok( rec->wDataLength == sizeof(DNS_SRV_DATAA) + strlen( "dc.winehq.org" ) + 1, "wrong len %u\n", rec->wDataLength );
+ ok( rec->dwTtl == 0x04050607, "wrong ttl %#lx\n", rec->dwTtl );
+ ok( !strcmp( rec->Data.SRV.pNameTarget, "dc.winehq.org"), "wrong target %s\n", rec->Data.SRV.pNameTarget );
+ ok( !rec->pNext, "next record %p\n", rec->pNext );
+ DnsRecordListFree( (DNS_RECORD *)rec, DnsFreeRecordList );
+
+next2:
ret = DnsExtractRecordsFromMessage_UTF8( (DNS_MESSAGE_BUFFER *)msg_empty, sizeof(msg_empty) - 1, &rec );
ok( ret == ERROR_INVALID_PARAMETER || broken(ret == DNS_ERROR_BAD_PACKET) /* win7 */,
"failed %ld\n", ret );
--
2.40.1

View File

@@ -0,0 +1,72 @@
From 3c5ac02e18d5898d68c01f6a58996dc47e5582db Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Thu, 1 Jun 2023 14:32:55 +0300
Subject: [PATCH] dnsapi: Accept name records of exact size at the end of the
packet.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
---
dlls/dnsapi/record.c | 2 +-
dlls/dnsapi/tests/record.c | 8 --------
2 files changed, 1 insertion(+), 9 deletions(-)
diff --git a/dlls/dnsapi/record.c b/dlls/dnsapi/record.c
index 01786842b73..cfd55a44852 100644
--- a/dlls/dnsapi/record.c
+++ b/dlls/dnsapi/record.c
@@ -199,7 +199,7 @@ static const BYTE *get_name( const BYTE *base, const BYTE *end, const BYTE *ptr,
return NULL;
}
}
- if (ptr >= end) return NULL;
+ if (ptr > end) return NULL;
if (out == name) *out++ = '.';
*out = 0;
return next ? next : ptr;
diff --git a/dlls/dnsapi/tests/record.c b/dlls/dnsapi/tests/record.c
index 8abcdadaacc..340d10f6024 100644
--- a/dlls/dnsapi/tests/record.c
+++ b/dlls/dnsapi/tests/record.c
@@ -224,11 +224,8 @@ static void test_DnsExtractRecordsFromMessage(void)
rec = NULL;
ret = DnsExtractRecordsFromMessage_UTF8( (DNS_MESSAGE_BUFFER *)msg_full_srv, sizeof(msg_full_srv), &rec );
- todo_wine
ok( !ret, "failed %ld\n", ret );
- todo_wine
ok( rec != NULL, "record not set\n" );
- if (!rec) goto next;
ok( !strcmp( rec->pName, "_ldap._tcp.dc._msdcs.winehq.org" ), "wrong name %s\n", rec->pName );
ok( rec->Flags.S.Section == DnsSectionAnswer, "wrong section %u\n", rec->Flags.S.Section );
ok( rec->Flags.S.CharSet == DnsCharSetUtf8, "wrong charset %u\n", rec->Flags.S.CharSet );
@@ -240,7 +237,6 @@ static void test_DnsExtractRecordsFromMessage(void)
ok( !rec->pNext, "next record %p\n", rec->pNext );
DnsRecordListFree( (DNS_RECORD *)rec, DnsFreeRecordList );
-next:
rec = (void *)0xdeadbeef;
ret = DnsExtractRecordsFromMessage_UTF8( (DNS_MESSAGE_BUFFER *)msg_question_srv, sizeof(msg_question_srv), &rec );
ok( !ret, "failed %ld\n", ret );
@@ -248,11 +244,8 @@ next:
rec = NULL;
ret = DnsExtractRecordsFromMessage_UTF8( (DNS_MESSAGE_BUFFER *)msg_answer_srv, sizeof(msg_answer_srv), &rec );
- todo_wine
ok( !ret, "failed %ld\n", ret );
- todo_wine
ok( rec != NULL, "record not set\n" );
- if (!rec) goto next2;
ok( !strcmp( rec->pName, "_ldap._tcp.dc._msdcs.winehq.org" ), "wrong name %s\n", rec->pName );
ok( rec->Flags.S.Section == DnsSectionAnswer, "wrong section %u\n", rec->Flags.S.Section );
ok( rec->Flags.S.CharSet == DnsCharSetUtf8, "wrong charset %u\n", rec->Flags.S.CharSet );
@@ -264,7 +257,6 @@ next:
ok( !rec->pNext, "next record %p\n", rec->pNext );
DnsRecordListFree( (DNS_RECORD *)rec, DnsFreeRecordList );
-next2:
ret = DnsExtractRecordsFromMessage_UTF8( (DNS_MESSAGE_BUFFER *)msg_empty, sizeof(msg_empty) - 1, &rec );
ok( ret == ERROR_INVALID_PARAMETER || broken(ret == DNS_ERROR_BAD_PACKET) /* win7 */,
"failed %ld\n", ret );
--
2.40.1

View File

@@ -0,0 +1,49 @@
From 623038324e863d3438243f75f5726291e5ee3ac2 Mon Sep 17 00:00:00 2001
From: Dmitry Timoshkov <dmitry@baikal.ru>
Date: Thu, 1 Jun 2023 14:48:23 +0300
Subject: [PATCH] dnsapi: Set correct wDataLength for DNS_TYPE_SRV records.
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
---
dlls/dnsapi/record.c | 4 ++++
dlls/dnsapi/tests/record.c | 2 --
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/dlls/dnsapi/record.c b/dlls/dnsapi/record.c
index cfd55a44852..1b4cbfeac0f 100644
--- a/dlls/dnsapi/record.c
+++ b/dlls/dnsapi/record.c
@@ -1046,6 +1046,10 @@ static DNS_STATUS extract_rdata( const BYTE *base, const BYTE *end, const BYTE *
if (!get_name( base, end, pos, name )) return DNS_ERROR_BAD_PACKET;
if (!(r->Data.SRV.pNameTarget = strdupX( name, in, out ))) return ERROR_NOT_ENOUGH_MEMORY;
r->wDataLength = sizeof(DNS_SRV_DATAA);
+ if (out == DnsCharSetUnicode)
+ r->wDataLength += (wcslen( (const WCHAR *)r->Data.SRV.pNameTarget ) + 1) * sizeof(WCHAR);
+ else
+ r->wDataLength += strlen( r->Data.SRV.pNameTarget ) + 1;
break;
case DNS_TYPE_HINFO:
diff --git a/dlls/dnsapi/tests/record.c b/dlls/dnsapi/tests/record.c
index 340d10f6024..d340c064554 100644
--- a/dlls/dnsapi/tests/record.c
+++ b/dlls/dnsapi/tests/record.c
@@ -230,7 +230,6 @@ static void test_DnsExtractRecordsFromMessage(void)
ok( rec->Flags.S.Section == DnsSectionAnswer, "wrong section %u\n", rec->Flags.S.Section );
ok( rec->Flags.S.CharSet == DnsCharSetUtf8, "wrong charset %u\n", rec->Flags.S.CharSet );
ok( rec->wType == DNS_TYPE_SRV, "wrong type %u\n", rec->wType );
- todo_wine
ok( rec->wDataLength == sizeof(DNS_SRV_DATAA) + strlen( "dc.winehq.org" ) + 1, "wrong len %u\n", rec->wDataLength );
ok( rec->dwTtl == 0x04050607, "wrong ttl %#lx\n", rec->dwTtl );
ok( !strcmp( rec->Data.SRV.pNameTarget, "dc.winehq.org"), "wrong target %s\n", rec->Data.SRV.pNameTarget );
@@ -250,7 +249,6 @@ static void test_DnsExtractRecordsFromMessage(void)
ok( rec->Flags.S.Section == DnsSectionAnswer, "wrong section %u\n", rec->Flags.S.Section );
ok( rec->Flags.S.CharSet == DnsCharSetUtf8, "wrong charset %u\n", rec->Flags.S.CharSet );
ok( rec->wType == DNS_TYPE_SRV, "wrong type %u\n", rec->wType );
- todo_wine
ok( rec->wDataLength == sizeof(DNS_SRV_DATAA) + strlen( "dc.winehq.org" ) + 1, "wrong len %u\n", rec->wDataLength );
ok( rec->dwTtl == 0x04050607, "wrong ttl %#lx\n", rec->dwTtl );
ok( !strcmp( rec->Data.SRV.pNameTarget, "dc.winehq.org"), "wrong target %s\n", rec->Data.SRV.pNameTarget );
--
2.40.1

View File

@@ -0,0 +1 @@
Fixes: [54998] - DnsQuery(DNS_TYPE_SRV) fails to parse some of the server answers

View File

@@ -1,22 +1,22 @@
From 271f43a1fafb19e1404b05ec597b504ecad74784 Mon Sep 17 00:00:00 2001
From d4094baaba721220b0a81170d1f9e6c276dae4ae Mon Sep 17 00:00:00 2001
From: Zebediah Figura <zfigura@codeweavers.com>
Date: Mon, 6 Jul 2020 12:09:22 -0500
Subject: [PATCH] ntdll: Create eventfd-based objects for semaphores.
---
dlls/ntdll/Makefile.in | 1 +
dlls/ntdll/unix/esync.c | 271 +++++++++++++++++++++++++++++++++++++++
dlls/ntdll/unix/esync.c | 270 +++++++++++++++++++++++++++++++++++++++
dlls/ntdll/unix/esync.h | 35 +++++
dlls/ntdll/unix/loader.c | 2 +
dlls/ntdll/unix/server.c | 4 +-
dlls/ntdll/unix/sync.c | 4 +
server/esync.c | 1 +
7 files changed, 316 insertions(+), 2 deletions(-)
7 files changed, 315 insertions(+), 2 deletions(-)
create mode 100644 dlls/ntdll/unix/esync.c
create mode 100644 dlls/ntdll/unix/esync.h
diff --git a/dlls/ntdll/Makefile.in b/dlls/ntdll/Makefile.in
index 07688a5fcf6..4e490c475a2 100644
index f8ca3e689ec..82af2152595 100644
--- a/dlls/ntdll/Makefile.in
+++ b/dlls/ntdll/Makefile.in
@@ -47,6 +47,7 @@ C_SRCS = \
@@ -29,10 +29,10 @@ index 07688a5fcf6..4e490c475a2 100644
unix/loadorder.c \
diff --git a/dlls/ntdll/unix/esync.c b/dlls/ntdll/unix/esync.c
new file mode 100644
index 00000000000..9e1ef7d8afd
index 00000000000..7be4e03fa34
--- /dev/null
+++ b/dlls/ntdll/unix/esync.c
@@ -0,0 +1,271 @@
@@ -0,0 +1,270 @@
+/*
+ * eventfd-based synchronization objects
+ *
@@ -73,7 +73,6 @@ index 00000000000..9e1ef7d8afd
+
+#include "ntstatus.h"
+#define WIN32_NO_STATUS
+#define NONAMELESSUNION
+#include "windef.h"
+#include "winternl.h"
+#include "wine/server.h"
@@ -346,10 +345,10 @@ index 00000000000..a50a755149a
+
+extern int receive_fd( obj_handle_t *handle ) DECLSPEC_HIDDEN;
diff --git a/dlls/ntdll/unix/loader.c b/dlls/ntdll/unix/loader.c
index 35f2e5f986f..4d95c29ab24 100644
index 5b8b6962b4a..92855f7cccc 100644
--- a/dlls/ntdll/unix/loader.c
+++ b/dlls/ntdll/unix/loader.c
@@ -89,6 +89,7 @@
@@ -87,6 +87,7 @@
#include "winioctl.h"
#include "winternl.h"
#include "unix_private.h"
@@ -357,7 +356,7 @@ index 35f2e5f986f..4d95c29ab24 100644
#include "wine/list.h"
#include "wine/debug.h"
@@ -2188,6 +2189,7 @@ static void start_main_thread(void)
@@ -2055,6 +2056,7 @@ static void start_main_thread(void)
signal_alloc_thread( teb );
dbg_init();
startup_info_size = server_init_process();
@@ -366,10 +365,10 @@ index 35f2e5f986f..4d95c29ab24 100644
init_cpu_info();
init_files();
diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c
index b7d8733f2bc..8cd5f0474e6 100644
index 227784448d3..99563e43cc3 100644
--- a/dlls/ntdll/unix/server.c
+++ b/dlls/ntdll/unix/server.c
@@ -106,7 +106,7 @@ sigset_t server_block_set; /* signals to block during server calls */
@@ -103,7 +103,7 @@ sigset_t server_block_set; /* signals to block during server calls */
static int fd_socket = -1; /* socket to exchange file descriptors with the server */
static int initial_cwd = -1;
static pid_t server_pid;
@@ -378,7 +377,7 @@ index b7d8733f2bc..8cd5f0474e6 100644
/* atomically exchange a 64-bit value */
static inline LONG64 interlocked_xchg64( LONG64 *dest, LONG64 val )
@@ -834,7 +834,7 @@ void wine_server_send_fd( int fd )
@@ -907,7 +907,7 @@ void wine_server_send_fd( int fd )
*
* Receive a file descriptor passed from the server.
*/
@@ -388,10 +387,10 @@ index b7d8733f2bc..8cd5f0474e6 100644
struct iovec vec;
struct msghdr msghdr;
diff --git a/dlls/ntdll/unix/sync.c b/dlls/ntdll/unix/sync.c
index 9112572c67d..c5f30428f79 100644
index d1e4e5ee111..b5299c323e3 100644
--- a/dlls/ntdll/unix/sync.c
+++ b/dlls/ntdll/unix/sync.c
@@ -64,6 +64,7 @@
@@ -63,6 +63,7 @@
#include "wine/server.h"
#include "wine/debug.h"
#include "unix_private.h"
@@ -399,7 +398,7 @@ index 9112572c67d..c5f30428f79 100644
WINE_DEFAULT_DEBUG_CHANNEL(sync);
@@ -273,6 +274,9 @@ NTSTATUS WINAPI NtCreateSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJ
@@ -272,6 +273,9 @@ NTSTATUS WINAPI NtCreateSemaphore( HANDLE *handle, ACCESS_MASK access, const OBJ
if (max <= 0 || initial < 0 || initial > max) return STATUS_INVALID_PARAMETER;
if ((ret = alloc_object_attributes( attr, &objattr, &len ))) return ret;
@@ -410,7 +409,7 @@ index 9112572c67d..c5f30428f79 100644
{
req->access = access;
diff --git a/server/esync.c b/server/esync.c
index b9dbfa322bc..99e57eca44c 100644
index 35b4833fd4c..75ef586df30 100644
--- a/server/esync.c
+++ b/server/esync.c
@@ -41,6 +41,7 @@
@@ -422,5 +421,5 @@ index b9dbfa322bc..99e57eca44c 100644
int do_esync(void)
{
--
2.38.1
2.40.1

View File

@@ -1,4 +1,4 @@
From 0d55971a114d650b7826e01e43ccd3a60597fefd Mon Sep 17 00:00:00 2001
From 61e2cd91e7eb3654e6663a44d950f40808c4f30b Mon Sep 17 00:00:00 2001
From: Zebediah Figura <zfigura@codeweavers.com>
Date: Mon, 6 Jul 2020 16:01:56 -0500
Subject: [PATCH] server: Create eventfd file descriptors for message queues.
@@ -8,10 +8,10 @@ Subject: [PATCH] server: Create eventfd file descriptors for message queues.
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/server/queue.c b/server/queue.c
index b6decc521e9..23fb338924e 100644
index 0aa8888d646..e29764f7870 100644
--- a/server/queue.c
+++ b/server/queue.c
@@ -41,6 +41,7 @@
@@ -42,6 +42,7 @@
#include "process.h"
#include "request.h"
#include "user.h"
@@ -19,7 +19,7 @@ index b6decc521e9..23fb338924e 100644
#define WM_NCMOUSEFIRST WM_NCMOUSEMOVE
#define WM_NCMOUSELAST (WM_NCMOUSEFIRST+(WM_MOUSELAST-WM_MOUSEFIRST))
@@ -142,6 +143,7 @@ struct msg_queue
@@ -143,6 +144,7 @@ struct msg_queue
timeout_t last_get_msg; /* time of last get message call */
int keystate_lock; /* owns an input keystate lock */
unsigned int ignore_post_msg; /* ignore post messages newer than this unique id */
@@ -27,7 +27,7 @@ index b6decc521e9..23fb338924e 100644
};
struct hotkey
@@ -158,6 +160,7 @@ static void msg_queue_dump( struct object *obj, int verbose );
@@ -159,6 +161,7 @@ static void msg_queue_dump( struct object *obj, int verbose );
static int msg_queue_add_queue( struct object *obj, struct wait_queue_entry *entry );
static void msg_queue_remove_queue( struct object *obj, struct wait_queue_entry *entry );
static int msg_queue_signaled( struct object *obj, struct wait_queue_entry *entry );
@@ -35,7 +35,7 @@ index b6decc521e9..23fb338924e 100644
static void msg_queue_satisfied( struct object *obj, struct wait_queue_entry *entry );
static void msg_queue_destroy( struct object *obj );
static void msg_queue_poll_event( struct fd *fd, int event );
@@ -173,7 +176,7 @@ static const struct object_ops msg_queue_ops =
@@ -174,7 +177,7 @@ static const struct object_ops msg_queue_ops =
msg_queue_add_queue, /* add_queue */
msg_queue_remove_queue, /* remove_queue */
msg_queue_signaled, /* signaled */
@@ -44,7 +44,7 @@ index b6decc521e9..23fb338924e 100644
msg_queue_satisfied, /* satisfied */
no_signal, /* signal */
no_get_fd, /* get_fd */
@@ -313,12 +316,16 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
@@ -314,12 +317,16 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
queue->last_get_msg = current_time;
queue->keystate_lock = 0;
queue->ignore_post_msg = 0;
@@ -70,8 +70,8 @@ index b6decc521e9..23fb338924e 100644
+ esync_clear( queue->esync_fd );
}
/* check whether msg is a keyboard message */
@@ -1046,6 +1056,13 @@ static int msg_queue_signaled( struct object *obj, struct wait_queue_entry *entr
/* check if message is matched by the filter */
@@ -1040,6 +1050,13 @@ static int msg_queue_signaled( struct object *obj, struct wait_queue_entry *entr
return ret || is_signaled( queue );
}
@@ -85,7 +85,7 @@ index b6decc521e9..23fb338924e 100644
static void msg_queue_satisfied( struct object *obj, struct wait_queue_entry *entry )
{
struct msg_queue *queue = (struct msg_queue *)obj;
@@ -1090,6 +1107,7 @@ static void msg_queue_destroy( struct object *obj )
@@ -1084,6 +1101,7 @@ static void msg_queue_destroy( struct object *obj )
release_object( queue->input );
if (queue->hooks) release_object( queue->hooks );
if (queue->fd) release_object( queue->fd );
@@ -93,7 +93,7 @@ index b6decc521e9..23fb338924e 100644
}
static void msg_queue_poll_event( struct fd *fd, int event )
@@ -2485,6 +2503,9 @@ DECL_HANDLER(set_queue_mask)
@@ -2458,6 +2476,9 @@ DECL_HANDLER(set_queue_mask)
if (req->skip_wait) queue->wake_mask = queue->changed_mask = 0;
else wake_up( &queue->obj, 0 );
}
@@ -103,7 +103,7 @@ index b6decc521e9..23fb338924e 100644
}
}
@@ -2498,6 +2519,9 @@ DECL_HANDLER(get_queue_status)
@@ -2471,6 +2492,9 @@ DECL_HANDLER(get_queue_status)
reply->wake_bits = queue->wake_bits;
reply->changed_bits = queue->changed_bits;
queue->changed_bits &= ~req->clear_bits;
@@ -113,7 +113,7 @@ index b6decc521e9..23fb338924e 100644
}
else reply->wake_bits = reply->changed_bits = 0;
}
@@ -2746,6 +2770,10 @@ DECL_HANDLER(get_message)
@@ -2717,6 +2741,10 @@ DECL_HANDLER(get_message)
queue->wake_mask = req->wake_mask;
queue->changed_mask = req->changed_mask;
set_error( STATUS_PENDING ); /* FIXME */
@@ -125,5 +125,5 @@ index b6decc521e9..23fb338924e 100644
found_msg:
--
2.35.1
2.40.1

View File

@@ -1,4 +1,4 @@
From 2a1229098b39f923ff6e9a13bde05e161c797b0a Mon Sep 17 00:00:00 2001
From 7dff09756ebc13c38695050b9de271a84c2ea7b6 Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Tue, 9 Jul 2019 14:13:28 +1000
Subject: [PATCH] user32: Do not enumerate the registry in
@@ -25,11 +25,11 @@ index 8f3cd8acae7..072f1fab23a 100644
{
SendMessageTimeoutW(handle, WM_DEVICECHANGE, flags, (LPARAM)header, SMTO_ABORTIFHUNG, 2000, NULL);
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c
index 8f3d5750c2f..3bdfd042e85 100644
index 197a82db251..6385ef002b9 100644
--- a/dlls/user32/tests/input.c
+++ b/dlls/user32/tests/input.c
@@ -5091,6 +5091,40 @@ static void test_EnableMouseInPointer( char **argv, BOOL enable )
CloseHandle( info.hProcess );
@@ -5369,6 +5369,40 @@ static void test_ClipCursor( char **argv )
if (!EqualRect( &rect, &virtual_rect )) ok_ret( 1, ClipCursor( NULL ) );
}
+static void test_GetKeyboardLayoutList(void)
@@ -69,7 +69,7 @@ index 8f3d5750c2f..3bdfd042e85 100644
START_TEST(input)
{
char **argv;
@@ -5142,6 +5176,7 @@ START_TEST(input)
@@ -5413,6 +5447,7 @@ START_TEST(input)
test_GetRawInputBuffer();
test_RegisterRawInputDevices();
test_rawinput(argv[0]);
@@ -78,10 +78,10 @@ index 8f3d5750c2f..3bdfd042e85 100644
if(pGetMouseMovePointsEx)
diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c
index 11bb129134c..9864d80ceff 100644
index 22f371969b9..e0a0bd332ed 100644
--- a/dlls/win32u/input.c
+++ b/dlls/win32u/input.c
@@ -1250,11 +1250,7 @@ HKL WINAPI NtUserActivateKeyboardLayout( HKL layout, UINT flags )
@@ -1257,11 +1257,7 @@ HKL WINAPI NtUserActivateKeyboardLayout( HKL layout, UINT flags )
*/
UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts )
{
@@ -94,7 +94,7 @@ index 11bb129134c..9864d80ceff 100644
HKL layout;
TRACE_(keyboard)( "size %d, layouts %p.\n", size, layouts );
@@ -1268,33 +1264,6 @@ UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts )
@@ -1275,33 +1271,6 @@ UINT WINAPI NtUserGetKeyboardLayoutList( INT size, HKL *layouts )
if (size && layouts)
{
layouts[count - 1] = layout;
@@ -129,5 +129,5 @@ index 11bb129134c..9864d80ceff 100644
return count;
--
2.39.2
2.40.1

View File

@@ -1,17 +1,17 @@
From ca9c7d377e3e5e9689d67fbb9622ac1554442cdc Mon Sep 17 00:00:00 2001
From 19e3e3de97851559f2b5d67582e8b58606a4d7ff Mon Sep 17 00:00:00 2001
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Date: Thu, 5 Jan 2023 14:36:08 +1100
Subject: [PATCH 3/4] msxml3: Copy body size to request object
Subject: [PATCH] msxml3: Copy body size to request object
Dont assume that the data needs to be convert
NOTE: should use SetProperty value.
---
dlls/msxml3/httprequest.c | 44 ++++++++++++++++++++++++++-------------
1 file changed, 30 insertions(+), 14 deletions(-)
dlls/msxml3/httprequest.c | 46 +++++++++++++++++++++++++++------------
1 file changed, 32 insertions(+), 14 deletions(-)
diff --git a/dlls/msxml3/httprequest.c b/dlls/msxml3/httprequest.c
index d8360680411..48ed444576e 100644
index d8360680411..e7e66dec202 100644
--- a/dlls/msxml3/httprequest.c
+++ b/dlls/msxml3/httprequest.c
@@ -117,6 +117,7 @@ typedef struct
@@ -39,21 +39,21 @@ index d8360680411..48ed444576e 100644
+ UINT i, cp = CP_ACP;
+
+ for (i = 0; i < len; i++)
+ {
{
- cp = CP_UTF8;
- break;
+ if (str[i] > 127)
+ {
+ cp = CP_UTF8;
+ break;
+ }
+ }
}
+ size = WideCharToMultiByte(cp, 0, str, len, NULL, 0, NULL, NULL);
+ if (!(ptr = heap_alloc(size)))
{
- cp = CP_UTF8;
- break;
+ {
+ heap_free(bsc);
+ return E_OUTOFMEMORY;
}
+ }
+ WideCharToMultiByte(cp, 0, str, len, ptr, size, NULL, NULL);
+ if (cp == CP_UTF8) This->use_utf8_content = TRUE;
}
@@ -86,6 +86,15 @@ index d8360680411..48ed444576e 100644
}
hr = httprequest_send(&This->req, body_v);
@@ -2624,6 +2640,8 @@ static void init_httprequest(httprequest *req)
req->threshold = 0x100;
req->enterrprised_id = 0;
req->max_connections = 10;
+
+ req->request_body_size = 0;
}
HRESULT XMLHTTPRequest_create(void **obj)
--
2.39.0
2.40.1

View File

@@ -1,3 +1,3 @@
Fixes: [48175] AION (64 bit) - crashes in crysystem.dll.CryFree() due to high memory pointers allocated
Fixes: [46568] 64-bit msxml6.dll from Microsoft Core XML Services 6.0 redist package fails to load (Wine doesn't respect 44-bit user-mode VA limitation from Windows < 8.1)
Depends: ntdll-Placeholders
Disabled: True

View File

@@ -1,43 +0,0 @@
From 6e76ba9655c02041be67b3466dbdb62a2c9ecc10 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Hentschel?= <nerv@dawncrow.de>
Date: Tue, 13 Nov 2018 11:07:46 +1100
Subject: [PATCH] ntdll: Support ISOLATIONAWARE_MANIFEST_RESOURCE_ID range
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=18889
---
dlls/ntdll/actctx.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/dlls/ntdll/actctx.c b/dlls/ntdll/actctx.c
index 08b6c50..4366051 100644
--- a/dlls/ntdll/actctx.c
+++ b/dlls/ntdll/actctx.c
@@ -57,6 +57,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(actctx);
/* we don't want to include winuser.h */
#define RT_MANIFEST ((ULONG_PTR)24)
#define CREATEPROCESS_MANIFEST_RESOURCE_ID ((ULONG_PTR)1)
+#define MINIMUM_RESERVED_MANIFEST_RESOURCE_ID ((ULONG_PTR)1)
+#define MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID ((ULONG_PTR)16)
/* from oaidl.h */
typedef enum tagLIBFLAGS {
@@ -3291,8 +3293,14 @@ static NTSTATUS lookup_assembly(struct actctx_loader* acl,
status = open_nt_file( &file, &nameW );
if (!status)
{
- status = get_manifest_in_pe_file( acl, ai, nameW.Buffer, directory, FALSE, file,
- (LPCWSTR)CREATEPROCESS_MANIFEST_RESOURCE_ID, 0 );
+ INT rid;
+ for (rid = MINIMUM_RESERVED_MANIFEST_RESOURCE_ID;
+ rid <= MAXIMUM_RESERVED_MANIFEST_RESOURCE_ID; rid++)
+ {
+ status = get_manifest_in_pe_file( acl, ai, nameW.Buffer, directory, FALSE, file,
+ (LPCWSTR)(ULONG_PTR)rid, 0 );
+ if (status == STATUS_SUCCESS) break;
+ }
NtClose( file );
if (status == STATUS_SUCCESS)
break;
--
1.9.1

View File

@@ -1 +0,0 @@
Fixes: [18889] ntdll: Support ISOLATIONAWARE_MANIFEST_RESOURCE_ID range

View File

@@ -1,205 +0,0 @@
From 03f652283badc478f715d50d63de4cb9064ef7f1 Mon Sep 17 00:00:00 2001
From: Paul Gofman <pgofman@codeweavers.com>
Date: Thu, 10 Nov 2022 19:02:50 -0600
Subject: [PATCH] ntdll: Support MEM_COALESCE_PLACEHOLDERS in
NtFreeVirtualMemory().
---
dlls/ntdll/tests/virtual.c | 72 ++++++++++++++++++++++++++++++++++++--
dlls/ntdll/unix/virtual.c | 55 ++++++++++++++++++++++++++++-
2 files changed, 124 insertions(+), 3 deletions(-)
diff --git a/dlls/ntdll/tests/virtual.c b/dlls/ntdll/tests/virtual.c
index 45ba58868df..f5f1964e516 100644
--- a/dlls/ntdll/tests/virtual.c
+++ b/dlls/ntdll/tests/virtual.c
@@ -295,9 +295,9 @@ static void test_NtAllocateVirtualMemoryEx(void)
{
MEMORY_BASIC_INFORMATION mbi;
MEM_EXTENDED_PARAMETER ext[2];
+ char *p, *p1, *p2, *p3;
void *addresses[16];
SIZE_T size, size2;
- char *p, *p1, *p2;
ULONG granularity;
NTSTATUS status;
ULONG_PTR count;
@@ -510,6 +510,7 @@ static void test_NtAllocateVirtualMemoryEx(void)
p1 = addr1;
p2 = p1 + size / 4;
+ p3 = p2 + size / 4;
size2 = size / 4;
status = NtFreeVirtualMemory(NtCurrentProcess(), (void **)&p1, &size2, MEM_RELEASE | MEM_PRESERVE_PLACEHOLDER);
ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status);
@@ -517,12 +518,79 @@ static void test_NtAllocateVirtualMemoryEx(void)
ok(size2 == 0x4000, "Unexpected size %#Ix.\n", size2);
ok(p1 == addr1, "Unexpected addr %p, expected %p.\n", p1, addr1);
+ status = NtFreeVirtualMemory(NtCurrentProcess(), (void **)&p2, &size2, MEM_RELEASE | MEM_PRESERVE_PLACEHOLDER);
+ ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status);
+
+ check_region_size(p1, p2 - p1);
+ check_region_size(p2, p3 - p2);
+ check_region_size(p3, size - (p3 - p1));
+
+ status = NtFreeVirtualMemory(NtCurrentProcess(), (void **)&p1, &size2, MEM_RELEASE | MEM_COALESCE_PLACEHOLDERS);
+ ok(status == STATUS_CONFLICTING_ADDRESSES, "Unexpected status %08lx.\n", status);
+
+ status = NtFreeVirtualMemory(NtCurrentProcess(), (void **)&p1, &size, MEM_COALESCE_PLACEHOLDERS);
+ ok(status == STATUS_INVALID_PARAMETER_4, "Unexpected status %08lx.\n", status);
+
+ size2 = size + 0x1000;
+ status = NtFreeVirtualMemory(NtCurrentProcess(), (void **)&p1, &size2, MEM_RELEASE | MEM_COALESCE_PLACEHOLDERS);
+ ok(status == STATUS_CONFLICTING_ADDRESSES, "Unexpected status %08lx.\n", status);
+
+ size2 = size - 0x1000;
+ status = NtFreeVirtualMemory(NtCurrentProcess(), (void **)&p1, &size2, MEM_RELEASE | MEM_COALESCE_PLACEHOLDERS);
+ ok(status == STATUS_CONFLICTING_ADDRESSES, "Unexpected status %08lx.\n", status);
+
+ p1 = (char *)addr1 + 0x1000;
+ status = NtFreeVirtualMemory(NtCurrentProcess(), (void **)&p1, &size2, MEM_RELEASE | MEM_COALESCE_PLACEHOLDERS);
+ ok(status == STATUS_CONFLICTING_ADDRESSES, "Unexpected status %08lx.\n", status);
+ p1 = addr1;
+
+ size2 = 0;
+ status = NtFreeVirtualMemory(NtCurrentProcess(), (void **)&p1, &size2, MEM_RELEASE | MEM_COALESCE_PLACEHOLDERS);
+ ok(status == STATUS_INVALID_PARAMETER_3, "Unexpected status %08lx.\n", status);
+
+ status = NtFreeVirtualMemory(NtCurrentProcess(), (void **)&p1, &size, MEM_RELEASE);
+ ok(status == STATUS_UNABLE_TO_FREE_VM, "Unexpected status %08lx.\n", status);
+
+ status = NtFreeVirtualMemory(NtCurrentProcess(), (void **)&p1, &size, MEM_RELEASE | MEM_COALESCE_PLACEHOLDERS);
+ ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status);
+ ok(size == 0x10000, "Unexpected size %#Ix.\n", size);
+ ok(p1 == addr1, "Unexpected addr %p, expected %p.\n", p1, addr1);
+ check_region_size(p1, size);
+
+ size2 = size / 4;
+ status = NtFreeVirtualMemory(NtCurrentProcess(), (void **)&p1, &size2, MEM_RELEASE | MEM_PRESERVE_PLACEHOLDER);
+ ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status);
+ ok(size2 == 0x4000, "Unexpected size %#Ix.\n", size2);
+ ok(p1 == addr1, "Unexpected addr %p, expected %p.\n", p1, addr1);
check_region_size(p1, size / 4);
check_region_size(p2, size - size / 4);
- status = NtFreeVirtualMemory(NtCurrentProcess(), (void **)&p1, &size2, MEM_RELEASE);
+
+ size2 = size - size / 4;
+ status = pNtAllocateVirtualMemoryEx(NtCurrentProcess(), (void **)&p2, &size2, MEM_RESERVE | MEM_REPLACE_PLACEHOLDER,
+ PAGE_READWRITE, NULL, 0);
ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status);
+
+ status = NtFreeVirtualMemory(NtCurrentProcess(), (void **)&p1, &size, MEM_RELEASE | MEM_COALESCE_PLACEHOLDERS);
+ ok(status == STATUS_CONFLICTING_ADDRESSES, "Unexpected status %08lx.\n", status);
+
+ size2 = size - size / 4;
status = NtFreeVirtualMemory(NtCurrentProcess(), (void **)&p2, &size2, MEM_RELEASE);
ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status);
+ ok(size2 == 0xc000, "Unexpected size %#Ix.\n", size2);
+ ok(p2 == p1 + size / 4, "Unexpected addr %p, expected %p.\n", p2, p1 + size / 4);
+
+ status = NtFreeVirtualMemory(NtCurrentProcess(), (void **)&p1, &size, MEM_RELEASE | MEM_COALESCE_PLACEHOLDERS);
+ ok(status == STATUS_CONFLICTING_ADDRESSES, "Unexpected status %08lx.\n", status);
+
+ size2 = size / 4;
+ status = NtFreeVirtualMemory(NtCurrentProcess(), (void **)&p1, &size2, MEM_RELEASE);
+ ok(status == STATUS_SUCCESS, "Unexpected status %08lx.\n", status);
+ ok(size2 == 0x4000, "Unexpected size %#Ix.\n", size2);
+ ok(p1 == addr1, "Unexpected addr %p, expected %p.\n", p1, addr1);
+
+ size2 = 0;
+ status = NtFreeVirtualMemory(NtCurrentProcess(), (void **)&p3, &size2, MEM_RELEASE);
+ ok(status == STATUS_MEMORY_NOT_ALLOCATED, "Unexpected status %08lx.\n", status);
/* Split in two regions, specifying second half. */
addr1 = NULL;
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
index f68c5ec84d6..26d4edb019a 100644
--- a/dlls/ntdll/unix/virtual.c
+++ b/dlls/ntdll/unix/virtual.c
@@ -114,6 +114,9 @@ struct file_view
unsigned int protect; /* protection for all pages at allocation time and SEC_* flags */
};
+/* Assert this so RB_ENTRY_VALUE() result can be checked for NULL. */
+C_ASSERT( offsetof( struct file_view, entry ) == 0 );
+
/* per-page protection flags */
#define VPROT_READ 0x01
#define VPROT_WRITE 0x02
@@ -2335,6 +2338,52 @@ static NTSTATUS free_pages( struct file_view *view, char *base, size_t size )
}
+/***********************************************************************
+ * coalesce_placeholders
+ *
+ * Coalesce placeholder views.
+ * virtual_mutex must be held by caller.
+ */
+static NTSTATUS coalesce_placeholders( struct file_view *view, char *base, size_t size, ULONG type )
+{
+ struct file_view *curr_view, *next_view;
+ unsigned int i, view_count = 0;
+ size_t views_size = 0;
+
+ if (type != (MEM_RELEASE | MEM_COALESCE_PLACEHOLDERS)) return STATUS_INVALID_PARAMETER_4;
+ if (!size) return STATUS_INVALID_PARAMETER_3;
+ if (base != view->base) return STATUS_CONFLICTING_ADDRESSES;
+
+ curr_view = view;
+ while (curr_view->protect & VPROT_FREE_PLACEHOLDER)
+ {
+ ++view_count;
+ views_size += curr_view->size;
+ if (views_size >= size) break;
+ if (!(next_view = RB_ENTRY_VALUE( rb_next( &curr_view->entry ), struct file_view, entry ))) break;
+ if ((char *)curr_view->base + curr_view->size != next_view->base) break;
+ curr_view = next_view;
+ }
+
+ if (view_count < 2 || size != views_size) return STATUS_CONFLICTING_ADDRESSES;
+
+ for (i = 1; i < view_count; ++i)
+ {
+ curr_view = RB_ENTRY_VALUE( rb_next( &view->entry ), struct file_view, entry );
+ unregister_view( curr_view );
+ free_view( curr_view );
+ }
+
+ unregister_view( view );
+ view->size = views_size;
+ register_view( view );
+
+ VIRTUAL_DEBUG_DUMP_VIEW( view );
+
+ return STATUS_SUCCESS;
+}
+
+
/***********************************************************************
* allocate_dos_memory
*
@@ -4509,7 +4558,8 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si
else if (!(view = find_view( base, 0 ))) status = STATUS_MEMORY_NOT_ALLOCATED;
else if (!is_view_valloc( view )) status = STATUS_INVALID_PARAMETER;
else if (!size && base != view->base) status = STATUS_FREE_VM_NOT_AT_BASE;
- else if ((char *)view->base + view->size - base < size) status = STATUS_UNABLE_TO_FREE_VM;
+ else if ((char *)view->base + view->size - base < size && !(type & MEM_COALESCE_PLACEHOLDERS))
+ status = STATUS_UNABLE_TO_FREE_VM;
else switch (type)
{
case MEM_DECOMMIT:
@@ -4522,6 +4572,9 @@ NTSTATUS WINAPI NtFreeVirtualMemory( HANDLE process, PVOID *addr_ptr, SIZE_T *si
case MEM_RELEASE | MEM_PRESERVE_PLACEHOLDER:
status = free_pages_preserve_placeholder( view, base, size );
break;
+ case MEM_COALESCE_PLACEHOLDERS:
+ status = coalesce_placeholders( view, base, size, type );
+ break;
default:
status = STATUS_INVALID_PARAMETER;
break;
--
2.40.1

View File

@@ -1,54 +0,0 @@
From 9628228a974df1aaa3649ee8b80361d4ede75b06 Mon Sep 17 00:00:00 2001
From: Paul Gofman <pgofman@codeweavers.com>
Date: Fri, 11 Nov 2022 12:41:31 -0600
Subject: [PATCH] ntdll: Factor out unmap_view_of_section() function.
---
dlls/ntdll/unix/virtual.c | 17 +++++++++++------
1 file changed, 11 insertions(+), 6 deletions(-)
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
index f5634e64021..fe2e81fbe95 100644
--- a/dlls/ntdll/unix/virtual.c
+++ b/dlls/ntdll/unix/virtual.c
@@ -5288,11 +5288,7 @@ NTSTATUS WINAPI NtMapViewOfSectionEx( HANDLE handle, HANDLE process, PVOID *addr
alloc_type, protect, machine );
}
-/***********************************************************************
- * NtUnmapViewOfSection (NTDLL.@)
- * ZwUnmapViewOfSection (NTDLL.@)
- */
-NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr )
+NTSTATUS unmap_view_of_section( HANDLE process, PVOID addr )
{
struct file_view *view;
unsigned int status = STATUS_NOT_MAPPED_VIEW;
@@ -5349,6 +5345,15 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr )
return status;
}
+/***********************************************************************
+ * NtUnmapViewOfSection (NTDLL.@)
+ * ZwUnmapViewOfSection (NTDLL.@)
+ */
+NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr )
+{
+ return unmap_view_of_section( process, addr );
+}
+
/***********************************************************************
* NtUnmapViewOfSectionEx (NTDLL.@)
* ZwUnmapViewOfSectionEx (NTDLL.@)
@@ -5356,7 +5361,7 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr )
NTSTATUS WINAPI NtUnmapViewOfSectionEx( HANDLE process, PVOID addr, ULONG flags )
{
if (flags) FIXME("Ignoring flags %#x.\n", (int)flags);
- return NtUnmapViewOfSection( process, addr );
+ return unmap_view_of_section( process, addr );
}
/******************************************************************************
--
2.40.1

View File

@@ -1,210 +0,0 @@
From 5b6d1300eec9340cccf52cb7551878a82210c8fa Mon Sep 17 00:00:00 2001
From: Paul Gofman <pgofman@codeweavers.com>
Date: Fri, 11 Nov 2022 12:54:19 -0600
Subject: [PATCH] ntdll: Support MEM_PRESERVE_PLACEHOLDER in
NtUnmapViewOfSectionEx().
---
dlls/kernelbase/tests/process.c | 53 +++++++++++++++++++++++++++++++--
dlls/ntdll/unix/server.c | 2 +-
dlls/ntdll/unix/virtual.c | 18 ++++++++---
server/protocol.def | 1 +
4 files changed, 66 insertions(+), 8 deletions(-)
diff --git a/dlls/kernelbase/tests/process.c b/dlls/kernelbase/tests/process.c
index e5185a2587d..d70f947d6aa 100644
--- a/dlls/kernelbase/tests/process.c
+++ b/dlls/kernelbase/tests/process.c
@@ -41,6 +41,7 @@ static PVOID (WINAPI *pVirtualAllocFromApp)(PVOID, SIZE_T, DWORD, DWORD);
static HANDLE (WINAPI *pOpenFileMappingFromApp)( ULONG, BOOL, LPCWSTR);
static HANDLE (WINAPI *pCreateFileMappingFromApp)(HANDLE, PSECURITY_ATTRIBUTES, ULONG, ULONG64, PCWSTR);
static LPVOID (WINAPI *pMapViewOfFileFromApp)(HANDLE, ULONG, ULONG64, SIZE_T);
+static BOOL (WINAPI *pUnmapViewOfFile2)(HANDLE, void *, ULONG);
static void test_CompareObjectHandles(void)
{
@@ -166,6 +167,13 @@ static void test_VirtualAlloc2(void)
ret = VirtualFree(addr, 0, MEM_RELEASE);
ok(ret, "Unexpected return value %d, error %lu.\n", ret, GetLastError());
+ placeholder1 = pVirtualAlloc2(NULL, NULL, 2 * size, MEM_RESERVE, PAGE_NOACCESS, NULL, 0);
+ ok(!!placeholder1, "Failed to create a placeholder range.\n");
+ ret = VirtualFree(placeholder1, size, MEM_RELEASE | MEM_PRESERVE_PLACEHOLDER);
+ ok(!ret && GetLastError() == ERROR_INVALID_ADDRESS, "Got ret %d, error %lu.\n", ret, GetLastError());
+ ret = VirtualFree(placeholder1, 0, MEM_RELEASE);
+ ok(ret, "Unexpected return value %d, error %lu.\n", ret, GetLastError());
+
/* Placeholder splitting functionality */
placeholder1 = pVirtualAlloc2(NULL, NULL, 2 * size, MEM_RESERVE_PLACEHOLDER | MEM_RESERVE, PAGE_NOACCESS, NULL, 0);
ok(!!placeholder1, "Failed to create a placeholder range.\n");
@@ -198,11 +206,20 @@ static void test_VirtualAlloc2(void)
section = CreateFileMappingW(INVALID_HANDLE_VALUE, NULL, PAGE_READWRITE, 0, size, NULL);
ok(!!section, "Failed to create a section.\n");
- view1 = pMapViewOfFile3(section, NULL, placeholder1, 0, size, MEM_REPLACE_PLACEHOLDER, PAGE_READWRITE, NULL, 0);
+ view1 = pMapViewOfFile3(section, NULL, NULL, 0, size, 0, PAGE_READWRITE, NULL, 0);
ok(!!view1, "Failed to map a section.\n");
+ ret = VirtualFree( view1, size, MEM_RELEASE | MEM_PRESERVE_PLACEHOLDER );
+ ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "Got ret %d, error %lu.\n", ret, GetLastError());
+ ret = pUnmapViewOfFile2(GetCurrentProcess(), view1, MEM_PRESERVE_PLACEHOLDER);
+ ok(!ret && GetLastError() == ERROR_INVALID_ADDRESS, "Got ret %d, error %lu.\n", ret, GetLastError());
+ ret = pUnmapViewOfFile2(GetCurrentProcess(), view1, 0);
+ ok(ret, "Got error %lu.\n", GetLastError());
+
+ view1 = pMapViewOfFile3(section, NULL, placeholder1, 0, size, MEM_REPLACE_PLACEHOLDER, PAGE_READWRITE, NULL, 0);
+ ok(view1 == placeholder1, "Address does not match.\n");
view2 = pMapViewOfFile3(section, NULL, placeholder2, 0, size, MEM_REPLACE_PLACEHOLDER, PAGE_READWRITE, NULL, 0);
- ok(!!view2, "Failed to map a section.\n");
+ ok(view2 == placeholder2, "Address does not match.\n");
memset(&info, 0, sizeof(info));
VirtualQuery(placeholder1, &info, sizeof(info));
@@ -219,7 +236,34 @@ static void test_VirtualAlloc2(void)
ok(info.RegionSize == size, "Unexpected size.\n");
CloseHandle(section);
- UnmapViewOfFile(view1);
+ ret = pUnmapViewOfFile2(NULL, view1, MEM_PRESERVE_PLACEHOLDER);
+ ok(!ret && GetLastError() == ERROR_INVALID_HANDLE, "Got error %lu.\n", GetLastError());
+
+ ret = VirtualFree( placeholder1, size, MEM_RELEASE | MEM_PRESERVE_PLACEHOLDER );
+ ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "Got ret %d, error %lu.\n", ret, GetLastError());
+
+ ret = pUnmapViewOfFile2(GetCurrentProcess(), view1, MEM_PRESERVE_PLACEHOLDER);
+ ok(ret, "Got error %lu.\n", GetLastError());
+ memset(&info, 0, sizeof(info));
+ VirtualQuery(placeholder1, &info, sizeof(info));
+ ok(info.AllocationProtect == PAGE_NOACCESS, "Unexpected protection %#lx.\n", info.AllocationProtect);
+ ok(info.State == MEM_RESERVE, "Unexpected state %#lx.\n", info.State);
+ ok(info.Type == MEM_PRIVATE, "Unexpected type %#lx.\n", info.Type);
+ ok(info.RegionSize == size, "Unexpected size.\n");
+
+ ret = pUnmapViewOfFile2(GetCurrentProcess(), view1, MEM_PRESERVE_PLACEHOLDER);
+ ok(!ret && GetLastError() == ERROR_INVALID_ADDRESS, "Got error %lu.\n", GetLastError());
+
+ ret = UnmapViewOfFile(view1);
+ ok(!ret && GetLastError() == ERROR_INVALID_ADDRESS, "Got error %lu.\n", GetLastError());
+
+ ret = VirtualFree( placeholder1, size, MEM_RELEASE | MEM_PRESERVE_PLACEHOLDER );
+ ok(!ret && GetLastError() == ERROR_INVALID_ADDRESS, "Got ret %d, error %lu.\n", ret, GetLastError());
+ ret = VirtualFreeEx(GetCurrentProcess(), placeholder1, size, MEM_RELEASE | MEM_PRESERVE_PLACEHOLDER );
+ ok(!ret && GetLastError() == ERROR_INVALID_ADDRESS, "Got ret %d, error %lu.\n", ret, GetLastError());
+ ret = VirtualFree(placeholder1, 0, MEM_RELEASE);
+ ok(ret, "Got error %lu.\n", GetLastError());
+
UnmapViewOfFile(view2);
VirtualFree(placeholder1, 0, MEM_RELEASE);
@@ -249,6 +293,8 @@ static void test_VirtualAlloc2(void)
p1 = p;
p2 = p + size / 2;
+ ret = VirtualFree(p1, 0, MEM_RELEASE | MEM_PRESERVE_PLACEHOLDER);
+ ok(!ret && GetLastError() == ERROR_INVALID_PARAMETER, "Got ret %d, error %lu.\n", ret, GetLastError());
ret = VirtualFree(p1, size / 2, MEM_RELEASE | MEM_PRESERVE_PLACEHOLDER);
ok(ret, "Failed to split a placeholder.\n");
check_region_size(p1, size / 2);
@@ -461,6 +507,7 @@ static void init_funcs(void)
X(VirtualAlloc2);
X(VirtualAlloc2FromApp);
X(VirtualAllocFromApp);
+ X(UnmapViewOfFile2);
hmod = GetModuleHandleA("ntdll.dll");
diff --git a/dlls/ntdll/unix/server.c b/dlls/ntdll/unix/server.c
index 5de4a7374bc..b3a8d79194f 100644
--- a/dlls/ntdll/unix/server.c
+++ b/dlls/ntdll/unix/server.c
@@ -624,7 +624,7 @@ static void invoke_system_apc( const apc_call_t *call, apc_result_t *result, BOO
result->type = call->type;
addr = wine_server_get_ptr( call->unmap_view.addr );
if ((ULONG_PTR)addr == call->unmap_view.addr)
- result->unmap_view.status = NtUnmapViewOfSection( NtCurrentProcess(), addr );
+ result->unmap_view.status = NtUnmapViewOfSectionEx( NtCurrentProcess(), addr, call->unmap_view.flags );
else
result->unmap_view.status = STATUS_INVALID_PARAMETER;
break;
diff --git a/dlls/ntdll/unix/virtual.c b/dlls/ntdll/unix/virtual.c
index fe2e81fbe95..fc120eaafc0 100644
--- a/dlls/ntdll/unix/virtual.c
+++ b/dlls/ntdll/unix/virtual.c
@@ -5288,7 +5288,7 @@ NTSTATUS WINAPI NtMapViewOfSectionEx( HANDLE handle, HANDLE process, PVOID *addr
alloc_type, protect, machine );
}
-NTSTATUS unmap_view_of_section( HANDLE process, PVOID addr )
+static NTSTATUS unmap_view_of_section( HANDLE process, PVOID addr, ULONG flags )
{
struct file_view *view;
unsigned int status = STATUS_NOT_MAPPED_VIEW;
@@ -5303,6 +5303,7 @@ NTSTATUS unmap_view_of_section( HANDLE process, PVOID addr )
call.unmap_view.type = APC_UNMAP_VIEW;
call.unmap_view.addr = wine_server_client_ptr( addr );
+ call.unmap_view.flags = flags;
status = server_queue_process_apc( process, &call, &result );
if (status == STATUS_SUCCESS) status = result.unmap_view.status;
return status;
@@ -5311,6 +5312,11 @@ NTSTATUS unmap_view_of_section( HANDLE process, PVOID addr )
server_enter_uninterrupted_section( &virtual_mutex, &sigset );
if ((view = find_view( addr, 0 )) && !is_view_valloc( view ))
{
+ if (flags & MEM_PRESERVE_PLACEHOLDER && !(view->protect & VPROT_PLACEHOLDER))
+ {
+ status = STATUS_CONFLICTING_ADDRESSES;
+ goto done;
+ }
if (view->protect & VPROT_SYSTEM)
{
struct builtin_module *builtin;
@@ -5337,10 +5343,14 @@ NTSTATUS unmap_view_of_section( HANDLE process, PVOID addr )
if (!status)
{
if (view->protect & SEC_IMAGE) release_builtin_module( view->base );
- delete_view( view );
+ if (flags & MEM_PRESERVE_PLACEHOLDER)
+ remove_pages_from_view( view, view->base, view->size );
+ else
+ delete_view( view );
}
else FIXME( "failed to unmap %p %x\n", view->base, status );
}
+done:
server_leave_uninterrupted_section( &virtual_mutex, &sigset );
return status;
}
@@ -5351,7 +5361,7 @@ NTSTATUS unmap_view_of_section( HANDLE process, PVOID addr )
*/
NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr )
{
- return unmap_view_of_section( process, addr );
+ return unmap_view_of_section( process, addr, 0 );
}
/***********************************************************************
@@ -5361,7 +5371,7 @@ NTSTATUS WINAPI NtUnmapViewOfSection( HANDLE process, PVOID addr )
NTSTATUS WINAPI NtUnmapViewOfSectionEx( HANDLE process, PVOID addr, ULONG flags )
{
if (flags) FIXME("Ignoring flags %#x.\n", (int)flags);
- return unmap_view_of_section( process, addr );
+ return unmap_view_of_section( process, addr, flags );
}
/******************************************************************************
diff --git a/server/protocol.def b/server/protocol.def
index 4c8de97041c..40125371249 100644
--- a/server/protocol.def
+++ b/server/protocol.def
@@ -616,6 +616,7 @@ typedef union
enum apc_type type; /* APC_UNMAP_VIEW */
int __pad;
client_ptr_t addr; /* view address */
+ unsigned int flags; /* unmap flags */
} unmap_view;
struct
{
--
2.40.1

View File

@@ -1,4 +0,0 @@
# Originally written for Proton games, specifically "King under the Mountain"
# and "Halo Infinite". Neither have been tested with upstream Wine. Added to
# wine-staging primarly because ntdll-ForceBottomUpAlloc touches the same area.
Depends: ntdll-WRITECOPY

View File

@@ -0,0 +1,82 @@
From e6f8042ee351aa6821639a1d99e003e8425c36e9 Mon Sep 17 00:00:00 2001
From: Damjan Jovanovic <damjan.jov@gmail.com>
Date: Sat, 29 Feb 2020 09:21:55 +0200
Subject: [PATCH] oleaut32: preferentially load icons having the desired size
in OleLoadPictureEx
Currently OleLoadPictureEx() ignores the caller-desired icon size
and always loads the 32x32 icon, which sometimes has to be
scaled down to 16x16, resulting in quality loss. Change this
to load the icon having the desired size, falling back to 32x32
only when the desired size is unavailable.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=20732
Signed-off-by: Damjan Jovanovic <damjan.jov@gmail.com>
Updated to default 32 when x/y are LP_DEFAULT.
---
dlls/oleaut32/olepicture.c | 22 ++++++++++++++++++----
1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c
index 535a16146aa..05ad1137296 100644
--- a/dlls/oleaut32/olepicture.c
+++ b/dlls/oleaut32/olepicture.c
@@ -151,6 +151,8 @@ typedef struct OLEPictureImpl {
BOOL bIsDirty; /* Set to TRUE if picture has changed */
unsigned int loadtime_magic; /* If a length header was found, saves value */
unsigned int loadtime_format; /* for PICTYPE_BITMAP only, keeps track of image format (GIF/BMP/JPEG) */
+ DWORD desiredWidth;
+ DWORD desiredHeight;
} OLEPictureImpl;
static inline OLEPictureImpl *impl_from_IPicture(IPicture *iface)
@@ -1190,14 +1192,20 @@ static HRESULT OLEPictureImpl_LoadIcon(OLEPictureImpl *This, BYTE *xbuf, ULONG x
return E_FAIL;
}
i=0;
- /* If we have more than one icon, try to find the best.
- * this currently means '32 pixel wide'.
- */
if (cifd->idCount!=1) {
+ /* First try exact match on the desired dimensions */
for (i=0;i<cifd->idCount;i++) {
- if (cifd->idEntries[i].bWidth == 32)
+ if (cifd->idEntries[i].bWidth == This->desiredWidth &&
+ cifd->idEntries[i].bHeight == This->desiredHeight)
break;
}
+ /* Otherwise, try to find the best. This currently means '32 pixel wide'. */
+ if (i==cifd->idCount) {
+ for (i=0;i<cifd->idCount;i++) {
+ if (cifd->idEntries[i].bWidth == 32)
+ break;
+ }
+ }
if (i==cifd->idCount) i=0;
}
if (xread < cifd->idEntries[i].dwDIBOffset + cifd->idEntries[i].dwDIBSize)
@@ -2356,6 +2364,7 @@ HRESULT WINAPI OleLoadPictureEx( LPSTREAM lpstream, LONG lSize, BOOL fRunmode,
{
LPPERSISTSTREAM ps;
IPicture *newpic;
+ OLEPictureImpl *pictureImpl;
HRESULT hr;
FIXME("%p, %ld, %d, %s, %lu, %lu, %#lx, %p, partially implemented.\n",
@@ -2364,6 +2373,11 @@ HRESULT WINAPI OleLoadPictureEx( LPSTREAM lpstream, LONG lSize, BOOL fRunmode,
hr = OleCreatePictureIndirect(NULL,riid,!fRunmode,(LPVOID*)&newpic);
if (hr != S_OK)
return hr;
+ if (xsiz == LP_DEFAULT && ysiz == LP_DEFAULT)
+ xsiz = ysiz = 32;
+ pictureImpl = impl_from_IPicture(newpic);
+ pictureImpl->desiredWidth = xsiz;
+ pictureImpl->desiredHeight = ysiz;
hr = IPicture_QueryInterface(newpic,&IID_IPersistStream, (LPVOID*)&ps);
if (hr != S_OK) {
ERR("Could not get IPersistStream iface from Ole Picture?\n");
--
2.40.1

View File

@@ -0,0 +1 @@
Fixes: [20732] OleLoadPictureEx - First look for specific size if specified.

Some files were not shown because too many files have changed in this diff Show More