You've already forked wine-staging
mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Compare commits
100 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
12bbb07ced | ||
|
7f80904f89 | ||
|
c084f2e153 | ||
|
4ff6ecc4ac | ||
|
123aed11ee | ||
|
0ebc680f8f | ||
|
68925c8f61 | ||
|
791a70faf0 | ||
|
3ab6d734c0 | ||
|
31a5df0839 | ||
|
7adaca8b1b | ||
|
d5c85dc450 | ||
|
a78e9f3998 | ||
|
05c875caa5 | ||
|
a2170c577b | ||
|
d8260944be | ||
|
f76ea979db | ||
|
e4078c26a2 | ||
|
b0595d928b | ||
|
6a6e7da97e | ||
|
56d40e2349 | ||
|
2f18b0cd6d | ||
|
0d13d81503 | ||
|
a4b239f15e | ||
|
0f06925bd9 | ||
|
cd8789cb1f | ||
|
3dd9038110 | ||
|
a051432871 | ||
|
6919d12eba | ||
|
ff5ea043b5 | ||
|
e7edc67e91 | ||
|
4c85dbb157 | ||
|
95f743ef8b | ||
|
804145a02a | ||
|
b682f11906 | ||
|
c5ff81413f | ||
|
58ef511299 | ||
|
a9bf69097e | ||
|
0c32c319e2 | ||
|
c33355e3b7 | ||
|
127b7fafb4 | ||
|
054ecfb60a | ||
|
85146f009d | ||
|
8fc0710def | ||
|
e84e5d31e9 | ||
|
1f578b2d53 | ||
|
164a792cb2 | ||
|
506d9500b8 | ||
|
6839d5b534 | ||
|
9d59c4b21a | ||
|
ac31c3f5c5 | ||
|
a1057e16a6 | ||
|
bcf38efc5b | ||
|
320847e6f5 | ||
|
5d8ef8d881 | ||
|
fdd0f9a334 | ||
|
3ed5b91e33 | ||
|
f3b50676a1 | ||
|
4ca74ae0ca | ||
|
1219be1be0 | ||
|
9dc6767d18 | ||
|
810ecd4aab | ||
|
722ee5ed7e | ||
|
126e7db0e0 | ||
|
5a1e1cb2e0 | ||
|
9160b38ad3 | ||
|
e1966ac26e | ||
|
a5a28003b4 | ||
|
621740283c | ||
|
761fef8d70 | ||
|
63300ffaad | ||
|
badfcbc451 | ||
|
6a314e5994 | ||
|
435e01412e | ||
|
410820a918 | ||
|
a604ca1f6d | ||
|
445948eee3 | ||
|
50bad5b9af | ||
|
eb8cc143d6 | ||
|
680ab2f323 | ||
|
9a4fd0b9b0 | ||
|
aa8b27c396 | ||
|
daf7cb4cb9 | ||
|
9e265ac738 | ||
|
ec3dd19d45 | ||
|
1ba0c55d0d | ||
|
7d2ceeab63 | ||
|
445ab8ff01 | ||
|
64f5451ac7 | ||
|
0b083c6f73 | ||
|
d999a6d250 | ||
|
6a02ba0240 | ||
|
ff5fc9c0fa | ||
|
21b92f9611 | ||
|
3d69e00892 | ||
|
6d50e5c435 | ||
|
dd22e6eb1d | ||
|
e768e46a86 | ||
|
34eb04e7cc | ||
|
91d4974f10 |
12
.github/workflows/macOS.yml
vendored
12
.github/workflows/macOS.yml
vendored
@@ -7,17 +7,20 @@ on:
|
||||
|
||||
jobs:
|
||||
wine-staging:
|
||||
runs-on: macos-latest
|
||||
# https://github.com/actions/runner-images/issues/9741
|
||||
runs-on: macos-13
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
brew install --cask xquartz
|
||||
brew install bison \
|
||||
brew install autoconf \
|
||||
bison \
|
||||
gphoto2 \
|
||||
gst-plugins-base \
|
||||
gstreamer \
|
||||
gcenx/wine/libinotify-kqueue \
|
||||
mingw-w64 \
|
||||
molten-vk \
|
||||
sdl2
|
||||
@@ -52,7 +55,6 @@ jobs:
|
||||
--without-alsa \
|
||||
--without-capi \
|
||||
--without-dbus \
|
||||
--without-inotify \
|
||||
--without-oss \
|
||||
--without-pulse \
|
||||
--without-udev \
|
||||
|
@@ -1,17 +1,17 @@
|
||||
From 31ad180c1c96e6e9a2e666ebbe90c3d8b78cefa4 Mon Sep 17 00:00:00 2001
|
||||
From 61f65bb6024f63c6ab278ae6c9844d2d38339be8 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Fri, 16 Feb 2024 11:01:45 +1100
|
||||
Subject: [PATCH] combase: Avoid implicit cast of interface pointer.
|
||||
|
||||
---
|
||||
dlls/combase/string.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
dlls/combase/string.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/combase/string.c b/dlls/combase/string.c
|
||||
index 1345870cf2f..dda6ab78141 100644
|
||||
index 1345870cf2f..e60ea251011 100644
|
||||
--- a/dlls/combase/string.c
|
||||
+++ b/dlls/combase/string.c
|
||||
@@ -55,7 +55,7 @@ static inline struct hstring_private *impl_from_HSTRING(HSTRING string)
|
||||
@@ -55,12 +55,12 @@ static inline struct hstring_private *impl_from_HSTRING(HSTRING string)
|
||||
|
||||
static inline struct hstring_private *impl_from_HSTRING_HEADER(HSTRING_HEADER *header)
|
||||
{
|
||||
@@ -20,6 +20,12 @@ index 1345870cf2f..dda6ab78141 100644
|
||||
}
|
||||
|
||||
static inline struct hstring_private *impl_from_HSTRING_BUFFER(HSTRING_BUFFER buffer)
|
||||
{
|
||||
- return CONTAINING_RECORD(buffer, struct hstring_private, buffer);
|
||||
+ return CONTAINING_RECORD( (void*)buffer, struct hstring_private, buffer);
|
||||
}
|
||||
|
||||
static BOOL alloc_string(UINT32 len, HSTRING *out)
|
||||
--
|
||||
2.43.0
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 683fab1d88342c11a52ac3b919964837e6f36823 Mon Sep 17 00:00:00 2001
|
||||
From b0fb00cbd4ec71e184cf066a4f30002d646ceebe Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Tue, 22 Mar 2016 21:54:26 +0100
|
||||
Subject: [PATCH] d2d1: Avoid implicit cast of interface pointer.
|
||||
@@ -8,11 +8,13 @@ Subject: [PATCH] d2d1: Avoid implicit cast of interface pointer.
|
||||
dlls/d2d1/brush.c | 8 ++++----
|
||||
dlls/d2d1/d2d1_private.h | 2 +-
|
||||
dlls/d2d1/dc_render_target.c | 2 +-
|
||||
dlls/d2d1/device.c | 2 +-
|
||||
dlls/d2d1/effect.c | 10 +++++-----
|
||||
dlls/d2d1/geometry.c | 12 ++++++------
|
||||
dlls/d2d1/hwnd_render_target.c | 2 +-
|
||||
dlls/d2d1/state_block.c | 2 +-
|
||||
dlls/d2d1/stroke.c | 2 +-
|
||||
8 files changed, 16 insertions(+), 16 deletions(-)
|
||||
10 files changed, 22 insertions(+), 22 deletions(-)
|
||||
|
||||
diff --git a/dlls/d2d1/bitmap.c b/dlls/d2d1/bitmap.c
|
||||
index e5048611519..8e031290528 100644
|
||||
@@ -66,15 +68,15 @@ index 75cd72b5b9f..314123373b7 100644
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_bitmap_brush_QueryInterface(ID2D1BitmapBrush1 *iface,
|
||||
diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h
|
||||
index dced9847390..e86e1945bdd 100644
|
||||
index 58507fd2c0b..c2c7026052c 100644
|
||||
--- a/dlls/d2d1/d2d1_private.h
|
||||
+++ b/dlls/d2d1/d2d1_private.h
|
||||
@@ -697,7 +697,7 @@ struct d2d_factory
|
||||
@@ -702,7 +702,7 @@ struct d2d_factory
|
||||
|
||||
static inline struct d2d_factory *unsafe_impl_from_ID2D1Factory(ID2D1Factory *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, struct d2d_factory, ID2D1Factory3_iface);
|
||||
+ return CONTAINING_RECORD((ID2D1Factory3*)iface, struct d2d_factory, ID2D1Factory3_iface);
|
||||
- return CONTAINING_RECORD(iface, struct d2d_factory, ID2D1Factory7_iface);
|
||||
+ return CONTAINING_RECORD((ID2D1Factory7*)iface, struct d2d_factory, ID2D1Factory7_iface);
|
||||
}
|
||||
|
||||
void d2d_effects_init_builtins(struct d2d_factory *factory);
|
||||
@@ -91,6 +93,57 @@ index aa0c715baa5..31389b15cf8 100644
|
||||
}
|
||||
|
||||
static HRESULT d2d_dc_render_target_present(IUnknown *outer_unknown)
|
||||
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c
|
||||
index 75da15c99a5..cf2fb530466 100644
|
||||
--- a/dlls/d2d1/device.c
|
||||
+++ b/dlls/d2d1/device.c
|
||||
@@ -4516,7 +4516,7 @@ struct d2d_device *unsafe_impl_from_ID2D1Device(ID2D1Device1 *iface)
|
||||
if (!iface)
|
||||
return NULL;
|
||||
assert(iface->lpVtbl == (ID2D1Device1Vtbl *)&d2d_device_vtbl);
|
||||
- return CONTAINING_RECORD(iface, struct d2d_device, ID2D1Device6_iface);
|
||||
+ return CONTAINING_RECORD((ID2D1Device6*)iface, struct d2d_device, ID2D1Device6_iface);
|
||||
}
|
||||
|
||||
void d2d_device_init(struct d2d_device *device, struct d2d_factory *factory, IDXGIDevice *dxgi_device)
|
||||
diff --git a/dlls/d2d1/effect.c b/dlls/d2d1/effect.c
|
||||
index cebc492d895..a5e33c0ad9b 100644
|
||||
--- a/dlls/d2d1/effect.c
|
||||
+++ b/dlls/d2d1/effect.c
|
||||
@@ -22,28 +22,28 @@ WINE_DEFAULT_DEBUG_CHANNEL(d2d);
|
||||
|
||||
static inline struct d2d_transform *impl_from_ID2D1OffsetTransform(ID2D1OffsetTransform *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, struct d2d_transform, ID2D1TransformNode_iface);
|
||||
+ return CONTAINING_RECORD((ID2D1TransformNode*)iface, struct d2d_transform, ID2D1TransformNode_iface);
|
||||
}
|
||||
|
||||
static inline struct d2d_transform *impl_from_ID2D1BlendTransform(ID2D1BlendTransform *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, struct d2d_transform, ID2D1TransformNode_iface);
|
||||
+ return CONTAINING_RECORD((ID2D1TransformNode*)iface, struct d2d_transform, ID2D1TransformNode_iface);
|
||||
}
|
||||
|
||||
static inline struct d2d_transform *impl_from_ID2D1BorderTransform(ID2D1BorderTransform *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, struct d2d_transform, ID2D1TransformNode_iface);
|
||||
+ return CONTAINING_RECORD((ID2D1TransformNode*)iface, struct d2d_transform, ID2D1TransformNode_iface);
|
||||
}
|
||||
|
||||
static inline struct d2d_transform *impl_from_ID2D1BoundsAdjustmentTransform(
|
||||
ID2D1BoundsAdjustmentTransform *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, struct d2d_transform, ID2D1TransformNode_iface);
|
||||
+ return CONTAINING_RECORD((ID2D1TransformNode*)iface, struct d2d_transform, ID2D1TransformNode_iface);
|
||||
}
|
||||
|
||||
static inline struct d2d_vertex_buffer *impl_from_ID2D1VertexBuffer(ID2D1VertexBuffer *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, struct d2d_vertex_buffer, ID2D1VertexBuffer_iface);
|
||||
+ return CONTAINING_RECORD((ID2D1VertexBuffer*)iface, struct d2d_vertex_buffer, ID2D1VertexBuffer_iface);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_vertex_buffer_QueryInterface(ID2D1VertexBuffer *iface,
|
||||
diff --git a/dlls/d2d1/geometry.c b/dlls/d2d1/geometry.c
|
||||
index 3da3ad2e65b..849a2cd2762 100644
|
||||
--- a/dlls/d2d1/geometry.c
|
||||
|
@@ -0,0 +1,45 @@
|
||||
From 53cc7a0c9e6d6abe983d7f9d70f83f36ccc1c0a5 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Sun, 19 May 2024 14:49:44 +1000
|
||||
Subject: [PATCH] combase/tests: Avoid implicit cast of interface pointer.
|
||||
|
||||
---
|
||||
dlls/combase/tests/string.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/combase/tests/string.c b/dlls/combase/tests/string.c
|
||||
index ceb8ffa6e09..76863c2f4dd 100644
|
||||
--- a/dlls/combase/tests/string.c
|
||||
+++ b/dlls/combase/tests/string.c
|
||||
@@ -509,7 +509,7 @@ static void test_hstring_struct(void)
|
||||
|
||||
ok(WindowsCreateString(input_string, 6, &str) == S_OK, "Failed to create string.\n");
|
||||
|
||||
- prv = CONTAINING_RECORD(str, struct hstring_private, header);
|
||||
+ prv = CONTAINING_RECORD((void*)str, struct hstring_private, header);
|
||||
|
||||
ok(prv->header.flags == 0, "Expected 0 in flags field, got %#x.\n", prv->header.flags);
|
||||
ok(prv->header.length == 6, "Expected 6 in length field, got %u.\n", prv->header.length);
|
||||
@@ -520,7 +520,7 @@ static void test_hstring_struct(void)
|
||||
|
||||
ok(WindowsDuplicateString(str, &str2) == S_OK, "Failed to duplicate string.\n");
|
||||
|
||||
- prv2 = CONTAINING_RECORD(str2, struct hstring_private, header);
|
||||
+ prv2 = CONTAINING_RECORD((void*)str2, struct hstring_private, header);
|
||||
|
||||
ok(prv->refcount == 2, "Expected 2 in refcount, got %lu.\n", prv->refcount);
|
||||
ok(prv2->refcount == 2, "Expected 2 in refcount, got %lu.\n", prv2->refcount);
|
||||
@@ -534,8 +534,8 @@ static void test_hstring_struct(void)
|
||||
|
||||
ok(WindowsCreateStringReference(input_string, 6, &hdr, &str) == S_OK, "Failed to create string ref.\n");
|
||||
|
||||
- prv = CONTAINING_RECORD(&hdr, struct hstring_private, header);
|
||||
- prv2 = CONTAINING_RECORD(str, struct hstring_private, header);
|
||||
+ prv = CONTAINING_RECORD((void*)&hdr, struct hstring_private, header);
|
||||
+ prv2 = CONTAINING_RECORD((void*)str, struct hstring_private, header);
|
||||
|
||||
ok(prv == prv2, "Pointers not identical.\n");
|
||||
ok(prv2->header.flags == 1, "Expected HSTRING_REFERENCE_FLAG to be set, got %#x.\n", prv2->header.flags);
|
||||
--
|
||||
2.43.0
|
||||
|
@@ -1,41 +0,0 @@
|
||||
From 32ae090ad4a99862a420cfe44847d8e2905cdde7 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sat, 21 Dec 2013 23:57:02 +0100
|
||||
Subject: winex11: Implement X11DRV_FLUSH_GDI_DISPLAY ExtEscape command
|
||||
|
||||
---
|
||||
dlls/winex11.drv/init.c | 3 +++
|
||||
dlls/winex11.drv/x11drv.h | 3 ++-
|
||||
2 files changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c
|
||||
index 5a7d316..68d3f96 100644
|
||||
--- a/dlls/winex11.drv/init.c
|
||||
+++ b/dlls/winex11.drv/init.c
|
||||
@@ -440,6 +440,9 @@ static INT X11DRV_ExtEscape( PHYSDEV dev, INT escape, INT in_count, LPCVOID in_d
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
+ case X11DRV_FLUSH_GDI_DISPLAY:
|
||||
+ XFlush( gdi_display );
|
||||
+ return TRUE;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
|
||||
index 9008db6..85dd2a5 100644
|
||||
--- a/dlls/winex11.drv/x11drv.h
|
||||
+++ b/dlls/winex11.drv/x11drv.h
|
||||
@@ -277,7 +277,8 @@ enum x11drv_escape_codes
|
||||
X11DRV_GET_DRAWABLE, /* get current drawable for a DC */
|
||||
X11DRV_START_EXPOSURES, /* start graphics exposures */
|
||||
X11DRV_END_EXPOSURES, /* end graphics exposures */
|
||||
- X11DRV_FLUSH_GL_DRAWABLE /* flush changes made to the gl drawable */
|
||||
+ X11DRV_FLUSH_GL_DRAWABLE, /* flush changes made to the gl drawable */
|
||||
+ X11DRV_FLUSH_GDI_DISPLAY /* flush the gdi display */
|
||||
};
|
||||
|
||||
struct x11drv_escape_set_drawable
|
||||
--
|
||||
1.7.9.5
|
||||
|
@@ -1,25 +0,0 @@
|
||||
From ebe00ceb4f2d24f2611dbec87486d6597a3466a9 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Fri, 2 May 2014 20:46:19 +0200
|
||||
Subject: [PATCH] user32: Decrease minimum SetTimer interval to 5 ms. (try 2)
|
||||
|
||||
---
|
||||
dlls/win32u/message.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/win32u/message.c b/dlls/win32u/message.c
|
||||
index d2909339983..337d4a2cc1d 100644
|
||||
--- a/dlls/win32u/message.c
|
||||
+++ b/dlls/win32u/message.c
|
||||
@@ -3975,7 +3975,7 @@ UINT_PTR WINAPI NtUserSetTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC
|
||||
|
||||
if (proc) winproc = alloc_winproc( (WNDPROC)proc, TRUE );
|
||||
|
||||
- timeout = min( max( USER_TIMER_MINIMUM, timeout ), USER_TIMER_MAXIMUM );
|
||||
+ timeout = min( max( 5, timeout ), USER_TIMER_MAXIMUM );
|
||||
|
||||
SERVER_START_REQ( set_win_timer )
|
||||
{
|
||||
--
|
||||
2.42.0
|
||||
|
@@ -1,46 +0,0 @@
|
||||
From a9cf27a493697c97249ce526483d25c871c053c4 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 1 Jun 2014 22:51:32 +0200
|
||||
Subject: [PATCH] winex11.drv: Indicate direct rendering through OpenGL
|
||||
extension
|
||||
|
||||
---
|
||||
dlls/winex11.drv/opengl.c | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
|
||||
index 92555841f71..71e7ecbcf7c 100644
|
||||
--- a/dlls/winex11.drv/opengl.c
|
||||
+++ b/dlls/winex11.drv/opengl.c
|
||||
@@ -410,6 +410,7 @@ static int GLXErrorHandler(Display *dpy, XErrorEvent *event, void *arg)
|
||||
static BOOL X11DRV_WineGL_InitOpenglInfo(void)
|
||||
{
|
||||
static const char legacy_extensions[] = " WGL_EXT_extensions_string WGL_EXT_swap_control";
|
||||
+ static const char direct_extension[] = " WINE_EXT_direct_rendering";
|
||||
|
||||
int screen = DefaultScreen(gdi_display);
|
||||
Window win = 0, root = 0;
|
||||
@@ -465,16 +466,18 @@ static BOOL X11DRV_WineGL_InitOpenglInfo(void)
|
||||
}
|
||||
gl_renderer = (const char *)opengl_funcs.gl.p_glGetString(GL_RENDERER);
|
||||
gl_version = (const char *)opengl_funcs.gl.p_glGetString(GL_VERSION);
|
||||
+ glx_direct = pglXIsDirect(gdi_display, ctx);
|
||||
str = (const char *) opengl_funcs.gl.p_glGetString(GL_EXTENSIONS);
|
||||
- glExtensions = malloc( strlen(str) + sizeof(legacy_extensions) );
|
||||
+ glExtensions = malloc( strlen(str)+sizeof(legacy_extensions)+sizeof(direct_extension) );
|
||||
strcpy(glExtensions, str);
|
||||
strcat(glExtensions, legacy_extensions);
|
||||
+ if (glx_direct)
|
||||
+ strcat(glExtensions, direct_extension);
|
||||
|
||||
/* Get the common GLX version supported by GLX client and server ( major/minor) */
|
||||
pglXQueryVersion(gdi_display, &glxVersion[0], &glxVersion[1]);
|
||||
|
||||
glxExtensions = pglXQueryExtensionsString(gdi_display, screen);
|
||||
- glx_direct = pglXIsDirect(gdi_display, ctx);
|
||||
|
||||
TRACE("GL version : %s.\n", gl_version);
|
||||
TRACE("GL renderer : %s.\n", gl_renderer);
|
||||
--
|
||||
2.35.1
|
||||
|
@@ -1,2 +0,0 @@
|
||||
Fixes: Reduced SetTimer minimum value from 10 ms to 5 ms (improves Silverlight framerates)
|
||||
Fixes: Other Pipelight-specific enhancements
|
@@ -1,149 +0,0 @@
|
||||
From 51cde3dff5de27d1aebc964a4802758534d56773 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 5 Aug 2017 03:39:55 +0200
|
||||
Subject: [PATCH] ntdll: Implement process token elevation through manifests.
|
||||
|
||||
---
|
||||
dlls/ntdll/loader.c | 37 +++++++++++++++++++++++++++++++++++++
|
||||
server/process.c | 8 ++++++++
|
||||
server/process.h | 1 +
|
||||
server/protocol.def | 7 +++++++
|
||||
server/token.c | 14 ++++++++++++++
|
||||
5 files changed, 67 insertions(+)
|
||||
|
||||
diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c
|
||||
index 6290cbcb4e6..9a8f13901b2 100644
|
||||
--- a/dlls/ntdll/loader.c
|
||||
+++ b/dlls/ntdll/loader.c
|
||||
@@ -3489,6 +3489,32 @@ void WINAPI LdrInitializeThunk( CONTEXT *context, void **entry, ULONG_PTR unknow
|
||||
}
|
||||
|
||||
|
||||
+/***********************************************************************
|
||||
+ * elevate_process
|
||||
+ */
|
||||
+static void elevate_process( void )
|
||||
+{
|
||||
+ NTSTATUS status;
|
||||
+ HANDLE token;
|
||||
+
|
||||
+ if (!(token = __wine_create_default_token( TRUE )))
|
||||
+ {
|
||||
+ ERR( "Failed to create admin token\n" );
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ SERVER_START_REQ( replace_process_token )
|
||||
+ {
|
||||
+ req->token = wine_server_obj_handle( token );
|
||||
+ if ((status = wine_server_call( req )))
|
||||
+ ERR( "Failed to replace process token: %08x\n", status );
|
||||
+ }
|
||||
+ SERVER_END_REQ;
|
||||
+
|
||||
+ NtClose( token );
|
||||
+}
|
||||
+
|
||||
+
|
||||
/***********************************************************************
|
||||
* load_global_options
|
||||
*/
|
||||
@@ -3900,6 +3926,7 @@ void __wine_process_init(void)
|
||||
'k','e','r','n','e','l','3','2','.','d','l','l',0};
|
||||
void (WINAPI *kernel32_start_process)(LPTHREAD_START_ROUTINE,void*) = NULL;
|
||||
RTL_USER_PROCESS_PARAMETERS *params;
|
||||
+ ACTIVATION_CONTEXT_RUN_LEVEL_INFORMATION runlevel;
|
||||
WINE_MODREF *wm;
|
||||
NTSTATUS status;
|
||||
ANSI_STRING func_name;
|
||||
@@ -4021,6 +4048,16 @@ void __wine_process_init(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
+ /* elevate process if necessary */
|
||||
+ status = RtlQueryInformationActivationContext( 0, NULL, 0, RunlevelInformationInActivationContext,
|
||||
+ &runlevel, sizeof(runlevel), NULL );
|
||||
+ if (!status && (runlevel.RunLevel == ACTCTX_RUN_LEVEL_HIGHEST_AVAILABLE ||
|
||||
+ runlevel.RunLevel == ACTCTX_RUN_LEVEL_REQUIRE_ADMIN))
|
||||
+ {
|
||||
+ TRACE( "Application requested admin rights (run level %d)\n", runlevel.RunLevel );
|
||||
+ elevate_process(); /* FIXME: the process exists with a wrong token for a short time */
|
||||
+ }
|
||||
+
|
||||
/* the main exe needs to be the first in the load order list */
|
||||
RemoveEntryList( &wm->ldr.InLoadOrderLinks );
|
||||
InsertHeadList( &peb->LdrData->InLoadOrderModuleList, &wm->ldr.InLoadOrderLinks );
|
||||
diff --git a/server/process.c b/server/process.c
|
||||
index fa8495511e0..df72efdecc8 100644
|
||||
--- a/server/process.c
|
||||
+++ b/server/process.c
|
||||
@@ -1086,6 +1086,14 @@ int set_process_debug_flag( struct process *process, int flag )
|
||||
return write_process_memory( process, process->peb + 2, 1, &data );
|
||||
}
|
||||
|
||||
+/* replace the token of a process */
|
||||
+void replace_process_token( struct process *process, struct token *new_token )
|
||||
+{
|
||||
+ release_object(current->process->token);
|
||||
+ current->process->token = new_token;
|
||||
+ grab_object(new_token);
|
||||
+}
|
||||
+
|
||||
/* create a new process */
|
||||
DECL_HANDLER(new_process)
|
||||
{
|
||||
diff --git a/server/process.h b/server/process.h
|
||||
index 0fdf070b78e..43e8cc1ad7e 100644
|
||||
--- a/server/process.h
|
||||
+++ b/server/process.h
|
||||
@@ -129,6 +129,7 @@ extern void kill_console_processes( struct thread *renderer, int exit_code );
|
||||
extern void kill_debugged_processes( struct thread *debugger, int exit_code );
|
||||
extern void detach_debugged_processes( struct thread *debugger );
|
||||
extern void enum_processes( int (*cb)(struct process*, void*), void *user);
|
||||
+extern void replace_process_token( struct process *process, struct token *token );
|
||||
|
||||
/* console functions */
|
||||
extern obj_handle_t inherit_console( struct thread *parent_thread, obj_handle_t handle,
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index a9308904afc..8c40fba8d0a 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -3489,6 +3489,13 @@ struct handle_info
|
||||
@END
|
||||
|
||||
|
||||
+/* Create a new token */
|
||||
+@REQ(replace_process_token)
|
||||
+ obj_handle_t token; /* new process token */
|
||||
+@REPLY
|
||||
+@END
|
||||
+
|
||||
+
|
||||
/* Create I/O completion port */
|
||||
@REQ(create_completion)
|
||||
unsigned int access; /* desired access to a port */
|
||||
diff --git a/server/token.c b/server/token.c
|
||||
index 970ed1838da..1c1d49989b3 100644
|
||||
--- a/server/token.c
|
||||
+++ b/server/token.c
|
||||
@@ -1804,3 +1804,17 @@ DECL_HANDLER(create_token)
|
||||
release_object( token );
|
||||
}
|
||||
}
|
||||
+
|
||||
+/* Replaces the token of the current process */
|
||||
+DECL_HANDLER(replace_process_token)
|
||||
+{
|
||||
+ struct token *token;
|
||||
+
|
||||
+ if ((token = (struct token *)get_handle_obj( current->process, req->token,
|
||||
+ TOKEN_ASSIGN_PRIMARY,
|
||||
+ &token_ops )))
|
||||
+ {
|
||||
+ replace_process_token( current->process, token );
|
||||
+ release_object( token );
|
||||
+ }
|
||||
+}
|
||||
--
|
||||
2.28.0
|
||||
|
@@ -1,80 +0,0 @@
|
||||
From baff5c160cf7f1ac0011bf8f55d506bf0346e1fd Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Mon, 7 Aug 2017 02:53:06 +0200
|
||||
Subject: [PATCH] user32: Start explorer.exe using limited rights.
|
||||
|
||||
---
|
||||
dlls/advapi32/tests/security.c | 4 ++--
|
||||
dlls/user32/win.c | 12 ++++++++++--
|
||||
2 files changed, 12 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
|
||||
index f27642e7a7..0271cd72e0 100644
|
||||
--- a/dlls/advapi32/tests/security.c
|
||||
+++ b/dlls/advapi32/tests/security.c
|
||||
@@ -7313,7 +7313,7 @@ static void test_token_security_descriptor(void)
|
||||
ret = GetTokenInformation(token4, TokenIntegrityLevel, buffer_integrity, sizeof(buffer_integrity), &size);
|
||||
ok(ret, "GetTokenInformation failed with error %u\n", GetLastError());
|
||||
tml = (TOKEN_MANDATORY_LABEL *)buffer_integrity;
|
||||
- todo_wine ok(EqualSid(tml->Label.Sid, &medium_level), "Expected medium integrity level\n");
|
||||
+ ok(EqualSid(tml->Label.Sid, &medium_level), "Expected medium integrity level\n");
|
||||
|
||||
size = 0;
|
||||
ret = GetKernelObjectSecurity(token4, LABEL_SECURITY_INFORMATION, NULL, 0, &size);
|
||||
@@ -7768,7 +7768,7 @@ static void test_child_token_sd_medium(void)
|
||||
ret = GetTokenInformation(token, TokenIntegrityLevel, buffer_integrity, sizeof(buffer_integrity), &size);
|
||||
ok(ret, "GetTokenInformation failed with error %u\n", GetLastError());
|
||||
tml = (TOKEN_MANDATORY_LABEL *)buffer_integrity;
|
||||
- todo_wine ok(EqualSid(tml->Label.Sid, &medium_level), "Expected medium integrity level\n");
|
||||
+ ok(EqualSid(tml->Label.Sid, &medium_level), "Expected medium integrity level\n");
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, sd);
|
||||
}
|
||||
diff --git a/dlls/user32/win.c b/dlls/user32/win.c
|
||||
index cbfd8bb14a..8039f54fb0 100644
|
||||
--- a/dlls/user32/win.c
|
||||
+++ b/dlls/user32/win.c
|
||||
@@ -43,6 +43,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(win);
|
||||
#define NB_USER_HANDLES ((LAST_USER_HANDLE - FIRST_USER_HANDLE + 1) >> 1)
|
||||
#define USER_HANDLE_TO_INDEX(hwnd) ((LOWORD(hwnd) - FIRST_USER_HANDLE) >> 1)
|
||||
|
||||
+extern HANDLE CDECL __wine_create_default_token(BOOL admin);
|
||||
+
|
||||
static DWORD process_layout = ~0u;
|
||||
|
||||
static struct list window_surfaces = LIST_INIT( window_surfaces );
|
||||
@@ -2052,6 +2054,7 @@ HWND WINAPI GetDesktopWindow(void)
|
||||
WCHAR app[MAX_PATH + ARRAY_SIZE( explorer )];
|
||||
WCHAR cmdline[MAX_PATH + ARRAY_SIZE( explorer ) + ARRAY_SIZE( args )];
|
||||
WCHAR desktop[MAX_PATH];
|
||||
+ HANDLE token;
|
||||
void *redir;
|
||||
|
||||
SERVER_START_REQ( set_user_object_info )
|
||||
@@ -2084,9 +2087,12 @@ HWND WINAPI GetDesktopWindow(void)
|
||||
strcpyW( cmdline, app );
|
||||
strcatW( cmdline, args );
|
||||
|
||||
+ if (!(token = __wine_create_default_token( FALSE )))
|
||||
+ ERR( "Failed to create limited token\n" );
|
||||
+
|
||||
Wow64DisableWow64FsRedirection( &redir );
|
||||
- if (CreateProcessW( app, cmdline, NULL, NULL, FALSE, DETACHED_PROCESS,
|
||||
- NULL, windir, &si, &pi ))
|
||||
+ if (CreateProcessAsUserW( token, app, cmdline, NULL, NULL, FALSE, DETACHED_PROCESS,
|
||||
+ NULL, windir, &si, &pi ))
|
||||
{
|
||||
TRACE( "started explorer pid %04x tid %04x\n", pi.dwProcessId, pi.dwThreadId );
|
||||
WaitForInputIdle( pi.hProcess, 10000 );
|
||||
@@ -2096,6 +2102,8 @@ HWND WINAPI GetDesktopWindow(void)
|
||||
else WARN( "failed to start explorer, err %d\n", GetLastError() );
|
||||
Wow64RevertWow64FsRedirection( redir );
|
||||
|
||||
+ if (token) CloseHandle( token );
|
||||
+
|
||||
SERVER_START_REQ( get_desktop_window )
|
||||
{
|
||||
req->force = 1;
|
||||
--
|
||||
2.18.0
|
||||
|
@@ -1,344 +0,0 @@
|
||||
From 5bf0baa79c46ec44dfd5e1340e96ff9289bc37f8 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 6 Aug 2017 03:15:34 +0200
|
||||
Subject: [PATCH] programs/runas: Basic implementation for starting processes
|
||||
with a different trustlevel.
|
||||
|
||||
---
|
||||
configure.ac | 1 +
|
||||
programs/runas/Makefile.in | 8 ++
|
||||
programs/runas/runas.c | 214 +++++++++++++++++++++++++++++++++++++
|
||||
programs/runas/runas.h | 26 +++++
|
||||
programs/runas/runas.rc | 39 +++++++
|
||||
5 files changed, 288 insertions(+)
|
||||
create mode 100644 programs/runas/Makefile.in
|
||||
create mode 100644 programs/runas/runas.c
|
||||
create mode 100644 programs/runas/runas.h
|
||||
create mode 100644 programs/runas/runas.rc
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 499c4f37ca..6f12614af1 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -3891,6 +3891,7 @@ WINE_CONFIG_MAKEFILE(programs/regedit/tests)
|
||||
WINE_CONFIG_MAKEFILE(programs/regsvcs)
|
||||
WINE_CONFIG_MAKEFILE(programs/regsvr32)
|
||||
WINE_CONFIG_MAKEFILE(programs/rpcss)
|
||||
+WINE_CONFIG_MAKEFILE(programs/runas)
|
||||
WINE_CONFIG_MAKEFILE(programs/rundll.exe16,enable_win16)
|
||||
WINE_CONFIG_MAKEFILE(programs/rundll32)
|
||||
WINE_CONFIG_MAKEFILE(programs/sc)
|
||||
diff --git a/programs/runas/Makefile.in b/programs/runas/Makefile.in
|
||||
new file mode 100644
|
||||
index 0000000000..33aa00ab03
|
||||
--- /dev/null
|
||||
+++ b/programs/runas/Makefile.in
|
||||
@@ -0,0 +1,8 @@
|
||||
+MODULE = runas.exe
|
||||
+APPMODE = -mconsole -municode -mno-cygwin
|
||||
+IMPORTS = advapi32 user32
|
||||
+
|
||||
+C_SRCS = \
|
||||
+ runas.c
|
||||
+
|
||||
+RC_SRCS = runas.rc
|
||||
diff --git a/programs/runas/runas.c b/programs/runas/runas.c
|
||||
new file mode 100644
|
||||
index 0000000000..412755afa0
|
||||
--- /dev/null
|
||||
+++ b/programs/runas/runas.c
|
||||
@@ -0,0 +1,214 @@
|
||||
+/*
|
||||
+ * runas.exe implementation
|
||||
+ *
|
||||
+ * Copyright 2017 Michael MĂĽller
|
||||
+ *
|
||||
+ * This library is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU Lesser General Public
|
||||
+ * License as published by the Free Software Foundation; either
|
||||
+ * version 2.1 of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This library is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * Lesser General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU Lesser General Public
|
||||
+ * License along with this library; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
+ */
|
||||
+
|
||||
+#include <windows.h>
|
||||
+#include <wchar.h>
|
||||
+#include <wine/debug.h>
|
||||
+
|
||||
+#include "runas.h"
|
||||
+
|
||||
+WINE_DEFAULT_DEBUG_CHANNEL(runas);
|
||||
+
|
||||
+extern HANDLE CDECL __wine_create_default_token(BOOL admin);
|
||||
+
|
||||
+struct cmdinfo
|
||||
+{
|
||||
+ WCHAR *program;
|
||||
+ DWORD trustlevel;
|
||||
+};
|
||||
+
|
||||
+static void output_writeconsole(const WCHAR *str, DWORD wlen)
|
||||
+{
|
||||
+ DWORD count, ret;
|
||||
+
|
||||
+ ret = WriteConsoleW(GetStdHandle(STD_OUTPUT_HANDLE), str, wlen, &count, NULL);
|
||||
+ if (!ret)
|
||||
+ {
|
||||
+ DWORD len;
|
||||
+ char *msgA;
|
||||
+
|
||||
+ /* On Windows WriteConsoleW() fails if the output is redirected. So fall
|
||||
+ * back to WriteFile(), assuming the console encoding is still the right
|
||||
+ * one in that case.
|
||||
+ */
|
||||
+ len = WideCharToMultiByte(GetConsoleOutputCP(), 0, str, wlen, NULL, 0, NULL, NULL);
|
||||
+ msgA = HeapAlloc(GetProcessHeap(), 0, len * sizeof(char));
|
||||
+ if (!msgA) return;
|
||||
+
|
||||
+ WideCharToMultiByte(GetConsoleOutputCP(), 0, str, wlen, msgA, len, NULL, NULL);
|
||||
+ WriteFile(GetStdHandle(STD_OUTPUT_HANDLE), msgA, len, &count, FALSE);
|
||||
+ HeapFree(GetProcessHeap(), 0, msgA);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static void output_formatstring(const WCHAR *fmt, __ms_va_list va_args)
|
||||
+{
|
||||
+ WCHAR *str;
|
||||
+ DWORD len;
|
||||
+
|
||||
+ SetLastError(NO_ERROR);
|
||||
+ len = FormatMessageW(FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ALLOCATE_BUFFER,
|
||||
+ fmt, 0, 0, (WCHAR *)&str, 0, &va_args);
|
||||
+ if (len == 0 && GetLastError() != NO_ERROR)
|
||||
+ {
|
||||
+ WINE_FIXME("Could not format string: le=%u, fmt=%s\n", GetLastError(), wine_dbgstr_w(fmt));
|
||||
+ return;
|
||||
+ }
|
||||
+ output_writeconsole(str, len);
|
||||
+ LocalFree(str);
|
||||
+}
|
||||
+
|
||||
+static void WINAPIV output_message(unsigned int id, ...)
|
||||
+{
|
||||
+ WCHAR fmt[1024];
|
||||
+ __ms_va_list va_args;
|
||||
+
|
||||
+ if (!LoadStringW(GetModuleHandleW(NULL), id, fmt, sizeof(fmt)/sizeof(WCHAR)))
|
||||
+ {
|
||||
+ WINE_FIXME("LoadString failed with %d\n", GetLastError());
|
||||
+ return;
|
||||
+ }
|
||||
+ __ms_va_start(va_args, id);
|
||||
+ output_formatstring(fmt, va_args);
|
||||
+ __ms_va_end(va_args);
|
||||
+}
|
||||
+
|
||||
+static void show_usage(void)
|
||||
+{
|
||||
+ output_message(STRING_USAGE);
|
||||
+}
|
||||
+
|
||||
+static void show_trustlevels(void)
|
||||
+{
|
||||
+ output_message(STRING_TRUSTLEVELS);
|
||||
+ ExitProcess(0);
|
||||
+}
|
||||
+
|
||||
+static WCHAR *starts_with(WCHAR *str, const WCHAR *start)
|
||||
+{
|
||||
+ DWORD start_len = lstrlenW(start);
|
||||
+ if (lstrlenW(str) < start_len)
|
||||
+ return NULL;
|
||||
+ if (wcsncmp(str, start, start_len))
|
||||
+ return NULL;
|
||||
+ return str + start_len;
|
||||
+}
|
||||
+
|
||||
+static BOOL parse_command_line(int argc, WCHAR *argv[], struct cmdinfo *cmd)
|
||||
+{
|
||||
+ static const WCHAR showtrustlevelsW[] = {'/','s','h','o','w','t','r','u','s','t','l','e','v','e','l','s',0};
|
||||
+ static const WCHAR trustlevelW[] = {'/','t','r','u','s','t','l','e','v','e','l',':',0};
|
||||
+ int i;
|
||||
+
|
||||
+ memset(cmd, 0, sizeof(*cmd));
|
||||
+
|
||||
+ for (i = 1; i < argc; i++)
|
||||
+ {
|
||||
+ if (argv[i][0] == '/')
|
||||
+ {
|
||||
+ WCHAR *arg;
|
||||
+
|
||||
+ if ((arg = starts_with(argv[i], trustlevelW)))
|
||||
+ cmd->trustlevel = wcstoul(arg, NULL, 0);
|
||||
+ else if (!lstrcmpW(argv[i], showtrustlevelsW))
|
||||
+ show_trustlevels();
|
||||
+ else
|
||||
+ WINE_FIXME("Ignoring parameter %s\n", wine_dbgstr_w(argv[i]));
|
||||
+ }
|
||||
+ else if (argv[i][0])
|
||||
+ {
|
||||
+ if (cmd->program) return FALSE;
|
||||
+ cmd->program = argv[i];
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return TRUE;
|
||||
+}
|
||||
+
|
||||
+static BOOL start_process(struct cmdinfo *cmd)
|
||||
+{
|
||||
+ PROCESS_INFORMATION info;
|
||||
+ STARTUPINFOW startup;
|
||||
+ HANDLE token = NULL;
|
||||
+ BOOL ret;
|
||||
+
|
||||
+ if (cmd->trustlevel == 0x20000)
|
||||
+ {
|
||||
+ if (!(token = __wine_create_default_token(FALSE)))
|
||||
+ ERR("Failed to create limited token\n");
|
||||
+ }
|
||||
+
|
||||
+ memset(&startup, 0, sizeof(startup));
|
||||
+ startup.cb = sizeof(startup);
|
||||
+ ret = CreateProcessAsUserW(token, NULL, cmd->program, NULL, NULL, FALSE, 0, NULL, NULL, &startup, &info);
|
||||
+ if (ret)
|
||||
+ {
|
||||
+ CloseHandle(info.hProcess);
|
||||
+ CloseHandle(info.hThread);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ DWORD error = GetLastError();
|
||||
+ WCHAR *str;
|
||||
+
|
||||
+ if (FormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
||||
+ FORMAT_MESSAGE_IGNORE_INSERTS, NULL, error, 0, (WCHAR *)&str, 0, NULL))
|
||||
+ {
|
||||
+ output_message(STRING_START_ERROR, cmd->program, error, str);
|
||||
+ LocalFree(str);
|
||||
+ }
|
||||
+ else
|
||||
+ WINE_FIXME("Failed to format error: %u\n", error);
|
||||
+ }
|
||||
+
|
||||
+ if (token) CloseHandle(token);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+int wmain(int argc, WCHAR *argv[])
|
||||
+{
|
||||
+ struct cmdinfo cmd;
|
||||
+
|
||||
+ if (argc <= 1)
|
||||
+ {
|
||||
+ show_usage();
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ if (!parse_command_line(argc, argv, &cmd))
|
||||
+ {
|
||||
+ show_usage();
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ if (!cmd.program)
|
||||
+ {
|
||||
+ show_usage();
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ if (cmd.trustlevel && cmd.trustlevel != 0x20000)
|
||||
+ {
|
||||
+ output_message(STRING_UNHANDLED_TRUSTLEVEL, cmd.trustlevel);
|
||||
+ return 1;
|
||||
+ }
|
||||
+
|
||||
+ return start_process(&cmd);
|
||||
+}
|
||||
diff --git a/programs/runas/runas.h b/programs/runas/runas.h
|
||||
new file mode 100644
|
||||
index 0000000000..40599a3b33
|
||||
--- /dev/null
|
||||
+++ b/programs/runas/runas.h
|
||||
@@ -0,0 +1,26 @@
|
||||
+/*
|
||||
+ * runas.exe implementation
|
||||
+ *
|
||||
+ * Copyright 2017 Michael MĂĽller
|
||||
+ *
|
||||
+ * This library is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU Lesser General Public
|
||||
+ * License as published by the Free Software Foundation; either
|
||||
+ * version 2.1 of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This library is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * Lesser General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU Lesser General Public
|
||||
+ * License along with this library; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
+ */
|
||||
+
|
||||
+#include <windef.h>
|
||||
+
|
||||
+#define STRING_USAGE 101
|
||||
+#define STRING_UNHANDLED_TRUSTLEVEL 102
|
||||
+#define STRING_TRUSTLEVELS 103
|
||||
+#define STRING_START_ERROR 104
|
||||
diff --git a/programs/runas/runas.rc b/programs/runas/runas.rc
|
||||
new file mode 100644
|
||||
index 0000000000..f9297a4479
|
||||
--- /dev/null
|
||||
+++ b/programs/runas/runas.rc
|
||||
@@ -0,0 +1,39 @@
|
||||
+/*
|
||||
+ * runas.exe implementation
|
||||
+ *
|
||||
+ * Copyright 2017 Michael MĂĽller
|
||||
+ *
|
||||
+ * This library is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU Lesser General Public
|
||||
+ * License as published by the Free Software Foundation; either
|
||||
+ * version 2.1 of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This library is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * Lesser General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU Lesser General Public
|
||||
+ * License along with this library; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
+ */
|
||||
+
|
||||
+#include "runas.h"
|
||||
+
|
||||
+#pragma makedep po
|
||||
+
|
||||
+LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
|
||||
+
|
||||
+STRINGTABLE
|
||||
+{
|
||||
+ STRING_USAGE, "Usage of RUNAS:\n\n\
|
||||
+\RUNAS /trustlevel:<trustlevel> program\n\n\
|
||||
+\ /showtrustlevels Show possible trustlevels\n\
|
||||
+\ /trustlevel <trustlevel> should be listed in /showtrustlevels\n\
|
||||
+\ program Program to start\n\n"
|
||||
+ STRING_UNHANDLED_TRUSTLEVEL, "runas: Unhandled trustlevel 0x%1!x!\n"
|
||||
+ STRING_TRUSTLEVELS, "The following trustlevels are supported:\n\
|
||||
+0x20000 (standard user)\n"
|
||||
+ STRING_START_ERROR, "RUNAS-Error: %1 could not be started\n\
|
||||
+ %2!u!: %3\n"
|
||||
+}
|
||||
--
|
||||
2.23.0.rc1
|
||||
|
@@ -0,0 +1,182 @@
|
||||
From ae80ae124a784078a9838a8aca4b3af308d645dd Mon Sep 17 00:00:00 2001
|
||||
From: Patrick Hibbs <hibbsncc1701@gmail.com>
|
||||
Date: Fri, 30 Sep 2022 17:58:15 -0400
|
||||
Subject: [PATCH] d3dx9: Implement d3dx_effect_SetRawValue
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46012
|
||||
|
||||
Signed-off-by: Patrick Hibbs <hibbsncc1701@gmail.com>
|
||||
---
|
||||
dlls/d3dx9_36/effect.c | 154 ++++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 152 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/effect.c b/dlls/d3dx9_36/effect.c
|
||||
index ea965ce789b..625af4af36b 100644
|
||||
--- a/dlls/d3dx9_36/effect.c
|
||||
+++ b/dlls/d3dx9_36/effect.c
|
||||
@@ -4445,10 +4445,160 @@ static HRESULT WINAPI d3dx_effect_CloneEffect(ID3DXEffect *iface, IDirect3DDevic
|
||||
static HRESULT WINAPI d3dx_effect_SetRawValue(ID3DXEffect *iface, D3DXHANDLE parameter, const void *data,
|
||||
UINT byte_offset, UINT bytes)
|
||||
{
|
||||
- FIXME("iface %p, parameter %p, data %p, byte_offset %u, bytes %u stub!\n",
|
||||
+ struct d3dx_effect *effect = impl_from_ID3DXEffect(iface);
|
||||
+ struct d3dx_parameter *param = (parameter == INVALID_HANDLE_VALUE) ? NULL : get_valid_parameter(effect, parameter);
|
||||
+ const unsigned int single_size = sizeof(DWORD);
|
||||
+ unsigned int x, index_offset, remaining_byte_offset, remaining_bytes;
|
||||
+ void *raw;
|
||||
+
|
||||
+ TRACE("iface %p, parameter %p, data %p, byte_offset %u, bytes %u.\n",
|
||||
iface, parameter, data, byte_offset, bytes);
|
||||
|
||||
- return E_NOTIMPL;
|
||||
+ /* pendentic */
|
||||
+ index_offset = 0;
|
||||
+ remaining_byte_offset = 0;
|
||||
+
|
||||
+ /* BOOLs and Matries with a single value copy require sanitization of the
|
||||
+ byte_offset.
|
||||
+
|
||||
+ Specificly, matries with a single value copy only allow byte shifts that
|
||||
+ are not multiples of the value (DWORD) size. For multiples, we increment
|
||||
+ the index of the promoted data type, then add any remainder as a byte
|
||||
+ offset.
|
||||
+
|
||||
+ For BOOLs, due to their value sanitization, we only care about the
|
||||
+ index of their promoted data type. Unless it's a non value size matrix.
|
||||
+ In that case we do care about the byte offset.
|
||||
+ */
|
||||
+ if (byte_offset > 0 && (param->type == D3DXPT_BOOL ||
|
||||
+ (param->class == D3DXPC_MATRIX_COLUMNS ||
|
||||
+ param->class == D3DXPC_MATRIX_ROWS)))
|
||||
+ {
|
||||
+ remaining_byte_offset = byte_offset % single_size;
|
||||
+ if (remaining_byte_offset != 0)
|
||||
+ index_offset = byte_offset / single_size;
|
||||
+ else
|
||||
+ index_offset = byte_offset;
|
||||
+ if (param->type != D3DXPT_BOOL || (bytes != single_size &&
|
||||
+ (param->class == D3DXPC_MATRIX_COLUMNS ||
|
||||
+ param->class == D3DXPC_MATRIX_ROWS)))
|
||||
+ {
|
||||
+ index_offset = index_offset * single_size;
|
||||
+ if (param->type != D3DXPT_BOOL)
|
||||
+ index_offset = index_offset * single_size;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* If parameter is bad, we are expected to throw C0000005. */
|
||||
+ switch (param->class)
|
||||
+ {
|
||||
+ case D3DXPC_STRUCT:
|
||||
+ break;
|
||||
+ case D3DXPC_OBJECT:
|
||||
+ raw = param_get_data_and_dirtify(effect, param, param->bytes, TRUE);
|
||||
+ if (data && bytes)
|
||||
+ {
|
||||
+ if (((char*)raw)[0] != '\0')
|
||||
+ {
|
||||
+ memset(raw, '\0', param->bytes);
|
||||
+ return S_OK; /* This returns a false success. */
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ return D3DERR_INVALIDCALL;
|
||||
+ }
|
||||
+ }
|
||||
+ break;
|
||||
+ case D3DXPC_SCALAR:
|
||||
+ raw = param_get_data_and_dirtify(effect, param, param->bytes, TRUE);
|
||||
+ if (param->type == D3DXPT_BOOL)
|
||||
+ *(BOOL*)raw = *(BOOL*)data ? TRUE : FALSE;
|
||||
+ else
|
||||
+ memcpy((unsigned char*)raw + byte_offset, data, bytes);
|
||||
+ return S_OK;
|
||||
+ break;
|
||||
+ case D3DXPC_VECTOR:
|
||||
+ raw = (unsigned char*)param_get_data_and_dirtify(effect, param, param->bytes, TRUE);
|
||||
+ if (param->type == D3DXPT_BOOL)
|
||||
+ {
|
||||
+ raw = (unsigned char*)raw + index_offset;
|
||||
+ *(DWORD*)raw = *(DWORD*)data ? TRUE : FALSE;
|
||||
+ memset((unsigned char*)raw + single_size, \
|
||||
+ '\0', param->bytes - index_offset - single_size);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ raw = (unsigned char*)raw + byte_offset;
|
||||
+ for (x = 0; (x * single_size) + byte_offset < param->bytes && (x * single_size) < bytes; x++)
|
||||
+ {
|
||||
+ memcpy((unsigned char*)raw + (x * single_size), \
|
||||
+ (unsigned char*)data + (x * single_size), \
|
||||
+ single_size);
|
||||
+ }
|
||||
+ }
|
||||
+ return S_OK;
|
||||
+ break;
|
||||
+ case D3DXPC_MATRIX_COLUMNS:
|
||||
+ case D3DXPC_MATRIX_ROWS:
|
||||
+ raw = (unsigned char*)param_get_data_and_dirtify(effect, param, param->bytes, TRUE);
|
||||
+ if (param->type == D3DXPT_BOOL)
|
||||
+ {
|
||||
+ if (bytes == single_size)
|
||||
+ {
|
||||
+ raw = (unsigned char*)raw + index_offset;
|
||||
+ for (x = 0; (x * single_size) < param->bytes - index_offset; x++)
|
||||
+ {
|
||||
+ remaining_bytes = param->bytes - index_offset - \
|
||||
+ (x * single_size) - single_size;
|
||||
+ *(DWORD*)raw = *(DWORD*)data ? TRUE : FALSE;
|
||||
+ memset((unsigned char*)raw + single_size, \
|
||||
+ '\0', (remaining_bytes > (single_size * 4) ? \
|
||||
+ single_size * 4 : remaining_bytes));
|
||||
+ raw = (unsigned char*)raw + (remaining_bytes > (single_size * 4) ? \
|
||||
+ single_size * 4 : remaining_bytes);
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ raw = (unsigned char*)raw + index_offset;
|
||||
+ for (x = 0; (x * single_size) < param->bytes - index_offset; x++)
|
||||
+ {
|
||||
+ ((DWORD*)raw)[x] = ((DWORD*)data)[x] ? TRUE : FALSE;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ if (bytes == single_size)
|
||||
+ {
|
||||
+ raw = (unsigned char*)raw + index_offset + remaining_byte_offset;
|
||||
+ for (x = 0; (x * single_size) + byte_offset < param->bytes && (x * single_size) < bytes; x++)
|
||||
+ {
|
||||
+ memcpy((unsigned char*)raw + (x * single_size), \
|
||||
+ (unsigned char*)data + (x * single_size), \
|
||||
+ single_size);
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ raw = (unsigned char*)raw + byte_offset;
|
||||
+ for (x = 0; byte_offset + (x * single_size) < param->bytes &&
|
||||
+ (x * single_size) < bytes; x++)
|
||||
+ {
|
||||
+ memcpy((unsigned char*)raw + (x * single_size), \
|
||||
+ (unsigned char*)data + (x * single_size), \
|
||||
+ single_size);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ return S_OK;
|
||||
+ break;
|
||||
+ default:
|
||||
+ FIXME("Unhandled param class %s.\n", debug_d3dxparameter_class(param->class));
|
||||
+ break;
|
||||
+ };
|
||||
+
|
||||
+ return D3DERR_INVALIDCALL;
|
||||
}
|
||||
#endif
|
||||
|
||||
--
|
||||
2.43.0
|
||||
|
File diff suppressed because it is too large
Load Diff
3
patches/d3dx9_SetRawValue/definition
Normal file
3
patches/d3dx9_SetRawValue/definition
Normal file
@@ -0,0 +1,3 @@
|
||||
Fixes: [46012] d3d9: Implement ID3DXEffect::SetRawValue
|
||||
|
||||
# https://gitlab.winehq.org/wine/wine/-/merge_requests/979
|
@@ -1,4 +1,4 @@
|
||||
From 0a5214d0fe032778fa3ca4ee60c3d2ba64f8f4c0 Mon Sep 17 00:00:00 2001
|
||||
From 274e40a7f25d8041f5b93d132f01e0a66fefe481 Mon Sep 17 00:00:00 2001
|
||||
From: Matthew Wong <itsmattkc@gmail.com>
|
||||
Date: Fri, 18 Sep 2020 00:47:13 +0000
|
||||
Subject: [PATCH] ddraw: Implement Pick() and GetPickRecords().
|
||||
@@ -37,10 +37,10 @@ Signed-off-by: Myah Caron <qsniyg@protonmail.com>
|
||||
4 files changed, 373 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/dlls/ddraw/ddraw_private.h b/dlls/ddraw/ddraw_private.h
|
||||
index 6fc93b91860..c90b894ea61 100644
|
||||
index 1f0c94a9c6e..157384e3579 100644
|
||||
--- a/dlls/ddraw/ddraw_private.h
|
||||
+++ b/dlls/ddraw/ddraw_private.h
|
||||
@@ -338,6 +338,11 @@ struct d3d_device
|
||||
@@ -337,6 +337,11 @@ struct d3d_device
|
||||
struct d3d_viewport *current_viewport;
|
||||
D3DVIEWPORT7 active_viewport;
|
||||
|
||||
@@ -52,7 +52,7 @@ index 6fc93b91860..c90b894ea61 100644
|
||||
/* Required to keep track which of two available texture blending modes in d3ddevice3 is used */
|
||||
BOOL legacyTextureBlending;
|
||||
D3DTEXTUREBLEND texture_map_blend;
|
||||
@@ -571,7 +576,7 @@ struct d3d_execute_buffer *unsafe_impl_from_IDirect3DExecuteBuffer(IDirect3DExec
|
||||
@@ -573,7 +578,7 @@ struct d3d_execute_buffer *unsafe_impl_from_IDirect3DExecuteBuffer(IDirect3DExec
|
||||
|
||||
/* The execute function */
|
||||
HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *execute_buffer,
|
||||
@@ -62,11 +62,11 @@ index 6fc93b91860..c90b894ea61 100644
|
||||
/*****************************************************************************
|
||||
* IDirect3DVertexBuffer
|
||||
diff --git a/dlls/ddraw/device.c b/dlls/ddraw/device.c
|
||||
index bc1d91ee00b..82a813f9064 100644
|
||||
index f64db3aa633..60c43c250b1 100644
|
||||
--- a/dlls/ddraw/device.c
|
||||
+++ b/dlls/ddraw/device.c
|
||||
@@ -349,6 +349,9 @@ static ULONG WINAPI d3d_device_inner_Release(IUnknown *iface)
|
||||
IDirect3DDevice3_DeleteViewport(&This->IDirect3DDevice3_iface, &vp->IDirect3DViewport3_iface);
|
||||
@@ -333,6 +333,9 @@ static ULONG WINAPI d3d_device_inner_Release(IUnknown *iface)
|
||||
This->ddraw = NULL;
|
||||
}
|
||||
|
||||
+ if (This->pick_record_size > 0)
|
||||
@@ -75,7 +75,7 @@ index bc1d91ee00b..82a813f9064 100644
|
||||
TRACE("Releasing render target %p.\n", This->rt_iface);
|
||||
rt_iface = This->rt_iface;
|
||||
This->rt_iface = NULL;
|
||||
@@ -758,7 +761,7 @@ static HRESULT WINAPI d3d_device1_Execute(IDirect3DDevice *iface,
|
||||
@@ -739,7 +742,7 @@ static HRESULT WINAPI d3d_device1_Execute(IDirect3DDevice *iface,
|
||||
|
||||
/* Execute... */
|
||||
wined3d_mutex_lock();
|
||||
@@ -84,7 +84,7 @@ index bc1d91ee00b..82a813f9064 100644
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
return hr;
|
||||
@@ -1025,16 +1028,44 @@ static HRESULT WINAPI d3d_device1_NextViewport(IDirect3DDevice *iface,
|
||||
@@ -1006,16 +1009,44 @@ static HRESULT WINAPI d3d_device1_NextViewport(IDirect3DDevice *iface,
|
||||
* x2 and y2 are ignored.
|
||||
*
|
||||
* Returns:
|
||||
@@ -133,7 +133,7 @@ index bc1d91ee00b..82a813f9064 100644
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
@@ -1050,13 +1081,35 @@ static HRESULT WINAPI d3d_device1_Pick(IDirect3DDevice *iface, IDirect3DExecuteB
|
||||
@@ -1031,13 +1062,35 @@ static HRESULT WINAPI d3d_device1_Pick(IDirect3DDevice *iface, IDirect3DExecuteB
|
||||
* D3DPickRec: Address to store the resulting D3DPICKRECORD array.
|
||||
*
|
||||
* Returns:
|
||||
@@ -172,7 +172,7 @@ index bc1d91ee00b..82a813f9064 100644
|
||||
return D3D_OK;
|
||||
}
|
||||
diff --git a/dlls/ddraw/executebuffer.c b/dlls/ddraw/executebuffer.c
|
||||
index 320ce6649d4..84366dafd7d 100644
|
||||
index 0cf0bf121f3..89915fb7145 100644
|
||||
--- a/dlls/ddraw/executebuffer.c
|
||||
+++ b/dlls/ddraw/executebuffer.c
|
||||
@@ -45,15 +45,106 @@ static void _dump_D3DEXECUTEBUFFERDESC(const D3DEXECUTEBUFFERDESC *lpDesc) {
|
||||
@@ -378,7 +378,7 @@ index 320ce6649d4..84366dafd7d 100644
|
||||
/* Drop through. */
|
||||
case 2:
|
||||
indices[(i * primitive_size) + 1] = ci->v2;
|
||||
@@ -426,6 +597,7 @@ HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *buffer, struct d3d
|
||||
@@ -424,6 +595,7 @@ HRESULT d3d_execute_buffer_execute(struct d3d_execute_buffer *buffer, struct d3d
|
||||
end_of_buffer:
|
||||
return D3D_OK;
|
||||
}
|
||||
@@ -387,10 +387,10 @@ index 320ce6649d4..84366dafd7d 100644
|
||||
static inline struct d3d_execute_buffer *impl_from_IDirect3DExecuteBuffer(IDirect3DExecuteBuffer *iface)
|
||||
{
|
||||
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
|
||||
index d8fcb188c40..bacd9049d6e 100644
|
||||
index 96047744635..2364c92eb96 100644
|
||||
--- a/dlls/ddraw/tests/ddraw1.c
|
||||
+++ b/dlls/ddraw/tests/ddraw1.c
|
||||
@@ -15467,6 +15467,137 @@ static void test_enum_devices(void)
|
||||
@@ -15507,6 +15507,137 @@ static void test_enum_devices(void)
|
||||
ok(!refcount, "Device has %lu references left.\n", refcount);
|
||||
}
|
||||
|
||||
@@ -528,7 +528,7 @@ index d8fcb188c40..bacd9049d6e 100644
|
||||
/* Emperor: Rise of the Middle Kingdom locks a sysmem surface and then accesses
|
||||
* the pointer after unlocking it. This test roughly replicates the calls that
|
||||
* it makes. */
|
||||
@@ -15527,6 +15658,7 @@ static void test_pinned_sysmem(void)
|
||||
@@ -15567,6 +15698,7 @@ static void test_pinned_sysmem(void)
|
||||
IDirectDrawSurface_Release(surface);
|
||||
refcount = IDirectDraw_Release(ddraw);
|
||||
ok(!refcount, "Device has %lu references left.\n", refcount);
|
||||
@@ -536,7 +536,7 @@ index d8fcb188c40..bacd9049d6e 100644
|
||||
DestroyWindow(window);
|
||||
}
|
||||
|
||||
@@ -15646,6 +15778,7 @@ START_TEST(ddraw1)
|
||||
@@ -15789,6 +15921,7 @@ START_TEST(ddraw1)
|
||||
test_vtbl_protection();
|
||||
test_window_position();
|
||||
test_get_display_mode();
|
||||
|
@@ -1,15 +1,15 @@
|
||||
From e4688a88901a1c13b2df67a0444c34e3ee02bbab Mon Sep 17 00:00:00 2001
|
||||
From 9c7acdba85edafc52bc0cc2719ac556894a59351 Mon Sep 17 00:00:00 2001
|
||||
From: Andrew D'Addesio <andrew@fatbag.net>
|
||||
Date: Fri, 8 Feb 2019 18:48:33 -1000
|
||||
Subject: [PATCH] ddraw: Return correct devices based off requested DirectX
|
||||
version.
|
||||
|
||||
---
|
||||
dlls/ddraw/ddraw.c | 232 +++++++++++++++++++++++++--------------------
|
||||
1 file changed, 129 insertions(+), 103 deletions(-)
|
||||
dlls/ddraw/ddraw.c | 240 +++++++++++++++++++++++++--------------------
|
||||
1 file changed, 131 insertions(+), 109 deletions(-)
|
||||
|
||||
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
|
||||
index 5887854556b..5ac95dc3043 100644
|
||||
index 8f2fd9f3b4b..0ef400b7a26 100644
|
||||
--- a/dlls/ddraw/ddraw.c
|
||||
+++ b/dlls/ddraw/ddraw.c
|
||||
@@ -44,37 +44,80 @@ static const DDDEVICEIDENTIFIER2 deviceidentifier =
|
||||
@@ -122,7 +122,7 @@ index 5887854556b..5ac95dc3043 100644
|
||||
/* Fill the missing members, and do some fixup */
|
||||
caps->dpcLineCaps.dwSize = sizeof(caps->dpcLineCaps);
|
||||
caps->dpcLineCaps.dwTextureBlendCaps = D3DPTBLENDCAPS_ADD
|
||||
@@ -3746,8 +3780,7 @@ static HRESULT WINAPI ddraw1_DuplicateSurface(IDirectDraw *iface, IDirectDrawSur
|
||||
@@ -3770,8 +3804,7 @@ static HRESULT WINAPI ddraw1_DuplicateSurface(IDirectDraw *iface, IDirectDrawSur
|
||||
/*****************************************************************************
|
||||
* IDirect3D7::EnumDevices
|
||||
*
|
||||
@@ -132,7 +132,7 @@ index 5887854556b..5ac95dc3043 100644
|
||||
*
|
||||
* Params:
|
||||
* callback: Function to call for each enumerated device
|
||||
@@ -3779,13 +3812,16 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
|
||||
@@ -3803,13 +3836,16 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
|
||||
}
|
||||
dev_caps = device_desc7.dwDevCaps;
|
||||
|
||||
@@ -153,7 +153,7 @@ index 5887854556b..5ac95dc3043 100644
|
||||
if (ret != DDENUMRET_OK)
|
||||
{
|
||||
TRACE("Application cancelled the enumeration.\n");
|
||||
@@ -3801,11 +3837,21 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
|
||||
@@ -3825,11 +3861,21 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
|
||||
return D3D_OK;
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ index 5887854556b..5ac95dc3043 100644
|
||||
*
|
||||
* Versions 1, 2 and 3
|
||||
*
|
||||
@@ -3820,18 +3866,18 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
|
||||
@@ -3844,18 +3890,18 @@ static HRESULT WINAPI d3d7_EnumDevices(IDirect3D7 *iface, LPD3DENUMDEVICESCALLBA
|
||||
*****************************************************************************/
|
||||
static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBACK callback, void *context)
|
||||
{
|
||||
@@ -205,7 +205,7 @@ index 5887854556b..5ac95dc3043 100644
|
||||
|
||||
TRACE("iface %p, callback %p, context %p.\n", iface, callback, context);
|
||||
|
||||
@@ -3840,55 +3886,60 @@ static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBA
|
||||
@@ -3864,58 +3910,59 @@ static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBA
|
||||
|
||||
wined3d_mutex_lock();
|
||||
|
||||
@@ -221,7 +221,6 @@ index 5887854556b..5ac95dc3043 100644
|
||||
wined3d_mutex_unlock();
|
||||
return hr;
|
||||
}
|
||||
+
|
||||
ddraw_d3dcaps1_from_7(&device_desc1, &device_desc7);
|
||||
+ device_desc1.dwSize = desc_size;
|
||||
|
||||
@@ -245,15 +244,12 @@ index 5887854556b..5ac95dc3043 100644
|
||||
- * flag set. This way it refuses the emulation device, and HAL devices
|
||||
- * never have POW2 unset in d3d7 on windows. */
|
||||
- if (ddraw->d3dversion != 1)
|
||||
+ clear_device_desc(&empty_desc1);
|
||||
+ empty_desc1.dwSize = desc_size;
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(device_list); i++)
|
||||
{
|
||||
- static CHAR reference_description[] = "RGB Direct3D emulation";
|
||||
+ if (!(device_list[i].version_mask & D3D_VERSION(ddraw->d3dversion)))
|
||||
+ continue;
|
||||
|
||||
- {
|
||||
- /* Tomb Raider 3 overwrites the reference device description buffer
|
||||
- * with its own custom string. Reserve some extra space in the array
|
||||
- * to avoid a buffer overrun. */
|
||||
- static CHAR reference_description[64] = "RGB Direct3D emulation";
|
||||
-
|
||||
- TRACE("Enumerating WineD3D D3DDevice interface.\n");
|
||||
- hal_desc = device_desc1;
|
||||
- hel_desc = device_desc1;
|
||||
@@ -269,13 +265,22 @@ index 5887854556b..5ac95dc3043 100644
|
||||
- /* RGB, REF, RAMP and MMX devices don't report hardware transform and lighting capability */
|
||||
- hal_desc.dwDevCaps &= ~(D3DDEVCAPS_HWTRANSFORMANDLIGHT | D3DDEVCAPS_DRAWPRIMITIVES2EX | D3DDEVCAPS_HWRASTERIZATION);
|
||||
- hel_desc.dwDevCaps &= ~(D3DDEVCAPS_HWTRANSFORMANDLIGHT | D3DDEVCAPS_DRAWPRIMITIVES2EX | D3DDEVCAPS_HWRASTERIZATION);
|
||||
+ if (IsEqualGUID(&IID_IDirect3DHALDevice, device_list[i].device_guid))
|
||||
+ {
|
||||
+ hal_desc = device_desc1;
|
||||
|
||||
-
|
||||
- hr = callback((GUID *)&IID_IDirect3DRGBDevice, reference_description,
|
||||
- device_name, &hal_desc, &hel_desc, context);
|
||||
- if (hr != D3DENUMRET_OK)
|
||||
+ clear_device_desc(&empty_desc1);
|
||||
+ empty_desc1.dwSize = desc_size;
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(device_list); i++)
|
||||
+ {
|
||||
+ if (!(device_list[i].version_mask & D3D_VERSION(ddraw->d3dversion)))
|
||||
+ continue;
|
||||
+
|
||||
+ if (IsEqualGUID(&IID_IDirect3DHALDevice, device_list[i].device_guid))
|
||||
+ {
|
||||
+ hal_desc = device_desc1;
|
||||
+
|
||||
+ /* The HAL device's hel_desc is almost empty -- but not completely */
|
||||
+ hel_desc = empty_desc1;
|
||||
+ hel_desc.dwFlags = D3DDD_COLORMODEL | D3DDD_DEVCAPS | D3DDD_TRANSFORMCAPS
|
||||
@@ -305,7 +310,7 @@ index 5887854556b..5ac95dc3043 100644
|
||||
{
|
||||
TRACE("Application cancelled the enumeration.\n");
|
||||
wined3d_mutex_unlock();
|
||||
@@ -3896,31 +3947,6 @@ static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBA
|
||||
@@ -3923,31 +3970,6 @@ static HRESULT WINAPI d3d3_EnumDevices(IDirect3D3 *iface, LPD3DENUMDEVICESCALLBA
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From d09ac9a348309f956a2f3985a1b465b51b6e174c Mon Sep 17 00:00:00 2001
|
||||
From 6ef73a30a9f0c7c6775786d4cdba169f95056393 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sat, 28 Mar 2015 08:18:10 +0100
|
||||
Subject: [PATCH] dsound: Apply filters before sound is multiplied to speakers.
|
||||
@@ -11,10 +11,10 @@ Based on a patch by Mark Harmstone.
|
||||
3 files changed, 81 insertions(+), 36 deletions(-)
|
||||
|
||||
diff --git a/dlls/dsound/dsound.c b/dlls/dsound/dsound.c
|
||||
index 0b8edaaaf06..bdf3a824511 100644
|
||||
index 7629810db50..4c1c022acb7 100644
|
||||
--- a/dlls/dsound/dsound.c
|
||||
+++ b/dlls/dsound/dsound.c
|
||||
@@ -234,6 +234,7 @@ static ULONG DirectSoundDevice_Release(DirectSoundDevice * device)
|
||||
@@ -236,6 +236,7 @@ static ULONG DirectSoundDevice_Release(DirectSoundDevice * device)
|
||||
if(device->mmdevice)
|
||||
IMMDevice_Release(device->mmdevice);
|
||||
CloseHandle(device->sleepev);
|
||||
@@ -23,10 +23,10 @@ index 0b8edaaaf06..bdf3a824511 100644
|
||||
free(device->cp_buffer);
|
||||
free(device->buffer);
|
||||
diff --git a/dlls/dsound/dsound_private.h b/dlls/dsound/dsound_private.h
|
||||
index 124a4311b4c..fe39ca221fa 100644
|
||||
index 61323be99d8..c2656ab82f1 100644
|
||||
--- a/dlls/dsound/dsound_private.h
|
||||
+++ b/dlls/dsound/dsound_private.h
|
||||
@@ -89,8 +89,8 @@ struct DirectSoundDevice
|
||||
@@ -90,8 +90,8 @@ struct DirectSoundDevice
|
||||
int speaker_num[DS_MAX_CHANNELS];
|
||||
int num_speakers;
|
||||
int lfe_channel;
|
||||
@@ -34,14 +34,14 @@ index 124a4311b4c..fe39ca221fa 100644
|
||||
- DWORD tmp_buffer_len, cp_buffer_len;
|
||||
+ float *tmp_buffer, *cp_buffer, *dsp_buffer;
|
||||
+ DWORD tmp_buffer_len, cp_buffer_len, dsp_buffer_len;
|
||||
CO_MTA_USAGE_COOKIE mta_cookie;
|
||||
|
||||
DSVOLUMEPAN volpan;
|
||||
|
||||
diff --git a/dlls/dsound/mixer.c b/dlls/dsound/mixer.c
|
||||
index c26b19ea8c1..68a45c46d1e 100644
|
||||
index 042b9499727..f261588454a 100644
|
||||
--- a/dlls/dsound/mixer.c
|
||||
+++ b/dlls/dsound/mixer.c
|
||||
@@ -283,10 +283,9 @@ static inline float get_current_sample(const IDirectSoundBufferImpl *dsb,
|
||||
@@ -286,10 +286,9 @@ static inline float get_current_sample(const IDirectSoundBufferImpl *dsb,
|
||||
return dsb->get(dsb, buffer + (mixpos % buflen), channel);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ index c26b19ea8c1..68a45c46d1e 100644
|
||||
UINT committed_samples = 0;
|
||||
DWORD channel, i;
|
||||
|
||||
@@ -305,17 +304,16 @@ static UINT cp_fields_noresample(IDirectSoundBufferImpl *dsb, UINT count)
|
||||
@@ -308,17 +307,16 @@ static UINT cp_fields_noresample(IDirectSoundBufferImpl *dsb, UINT count)
|
||||
|
||||
for (; i < count; i++)
|
||||
for (channel = 0; channel < dsb->mix_channels; channel++)
|
||||
@@ -74,7 +74,7 @@ index c26b19ea8c1..68a45c46d1e 100644
|
||||
UINT channels = dsb->mix_channels;
|
||||
|
||||
LONG64 freqAcc_start = *freqAccNum;
|
||||
@@ -343,7 +341,7 @@ static UINT cp_fields_resample_lq(IDirectSoundBufferImpl *dsb, UINT count, LONG6
|
||||
@@ -346,7 +344,7 @@ static UINT cp_fields_resample_lq(IDirectSoundBufferImpl *dsb, UINT count, LONG6
|
||||
float s1 = get_current_sample(dsb, dsb->buffer->memory, dsb->buflen, idx, channel);
|
||||
float s2 = get_current_sample(dsb, dsb->buffer->memory, dsb->buflen, idx + istride, channel);
|
||||
float result = s1 * cur_freqAcc2 + s2 * cur_freqAcc;
|
||||
@@ -83,7 +83,7 @@ index c26b19ea8c1..68a45c46d1e 100644
|
||||
}
|
||||
}
|
||||
|
||||
@@ -351,11 +349,11 @@ static UINT cp_fields_resample_lq(IDirectSoundBufferImpl *dsb, UINT count, LONG6
|
||||
@@ -354,11 +352,11 @@ static UINT cp_fields_resample_lq(IDirectSoundBufferImpl *dsb, UINT count, LONG6
|
||||
return max_ipos;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ index c26b19ea8c1..68a45c46d1e 100644
|
||||
UINT committed_samples = 0;
|
||||
|
||||
LONG64 freqAcc_start = *freqAccNum;
|
||||
@@ -430,23 +428,24 @@ static UINT cp_fields_resample_hq(IDirectSoundBufferImpl *dsb, UINT count, LONG6
|
||||
@@ -433,23 +431,24 @@ static UINT cp_fields_resample_hq(IDirectSoundBufferImpl *dsb, UINT count, LONG6
|
||||
float* cache = &intermediate[channel * required_input + ipos];
|
||||
for (j = 0; j < fir_used; j++)
|
||||
sum += fir_copy[j] * cache[j];
|
||||
@@ -127,7 +127,7 @@ index c26b19ea8c1..68a45c46d1e 100644
|
||||
|
||||
ipos = dsb->sec_mixpos + adv * dsb->pwfx->nBlockAlign;
|
||||
if (ipos >= dsb->buflen) {
|
||||
@@ -482,6 +481,21 @@ static inline DWORD DSOUND_BufPtrDiff(DWORD buflen, DWORD ptr1, DWORD ptr2)
|
||||
@@ -485,6 +484,21 @@ static inline DWORD DSOUND_BufPtrDiff(DWORD buflen, DWORD ptr1, DWORD ptr2)
|
||||
return buflen + ptr1 - ptr2;
|
||||
}
|
||||
}
|
||||
@@ -149,7 +149,7 @@ index c26b19ea8c1..68a45c46d1e 100644
|
||||
/**
|
||||
* Mix at most the given amount of data into the allocated temporary buffer
|
||||
* of the given secondary buffer, starting from the dsb's first currently
|
||||
@@ -497,31 +511,61 @@ static inline DWORD DSOUND_BufPtrDiff(DWORD buflen, DWORD ptr1, DWORD ptr2)
|
||||
@@ -500,31 +514,61 @@ static inline DWORD DSOUND_BufPtrDiff(DWORD buflen, DWORD ptr1, DWORD ptr2)
|
||||
*/
|
||||
static void DSOUND_MixToTemporary(IDirectSoundBufferImpl *dsb, DWORD frames)
|
||||
{
|
||||
@@ -180,12 +180,22 @@ index c26b19ea8c1..68a45c46d1e 100644
|
||||
+ }
|
||||
+ if(dsb->put_aux == putieee32_sum)
|
||||
+ memset(dsb->device->tmp_buffer, 0, dsb->device->tmp_buffer_len);
|
||||
+
|
||||
|
||||
- if (size_bytes > 0) {
|
||||
- for (i = 0; i < dsb->num_filters; i++) {
|
||||
- if (dsb->filters[i].inplace) {
|
||||
- hr = IMediaObjectInPlace_Process(dsb->filters[i].inplace, size_bytes, (BYTE*)dsb->device->tmp_buffer, 0, DMO_INPLACE_NORMAL);
|
||||
+ if (using_filters) {
|
||||
+ put = putieee32_dsp;
|
||||
+ ostride = dsb->mix_channels * sizeof(float);
|
||||
+ size_bytes = frames * ostride;
|
||||
+
|
||||
|
||||
- if (FAILED(hr))
|
||||
- WARN("IMediaObjectInPlace_Process failed for filter %u\n", i);
|
||||
- } else
|
||||
- WARN("filter %u has no inplace object - unsupported\n", i);
|
||||
- }
|
||||
- }
|
||||
+ if (dsb->device->dsp_buffer_len < size_bytes || !dsb->device->dsp_buffer) {
|
||||
+ if (dsb->device->dsp_buffer)
|
||||
+ dsb->device->dsp_buffer = HeapReAlloc(GetProcessHeap(), 0, dsb->device->dsp_buffer, size_bytes);
|
||||
@@ -194,11 +204,7 @@ index c26b19ea8c1..68a45c46d1e 100644
|
||||
+ dsb->device->dsp_buffer_len = size_bytes;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- if (size_bytes > 0) {
|
||||
- for (i = 0; i < dsb->num_filters; i++) {
|
||||
- if (dsb->filters[i].inplace) {
|
||||
- hr = IMediaObjectInPlace_Process(dsb->filters[i].inplace, size_bytes, (BYTE*)dsb->device->tmp_buffer, 0, DMO_INPLACE_NORMAL);
|
||||
+
|
||||
+ cp_fields(dsb, put, ostride, frames, &dsb->freqAccNum);
|
||||
+
|
||||
+ if (using_filters) {
|
||||
@@ -213,13 +219,7 @@ index c26b19ea8c1..68a45c46d1e 100644
|
||||
+ WARN("filter %lu has no inplace object - unsupported\n", i);
|
||||
+ }
|
||||
+ }
|
||||
|
||||
- if (FAILED(hr))
|
||||
- WARN("IMediaObjectInPlace_Process failed for filter %u\n", i);
|
||||
- } else
|
||||
- WARN("filter %u has no inplace object - unsupported\n", i);
|
||||
- }
|
||||
- }
|
||||
+
|
||||
+ istride = ostride;
|
||||
+ ostride = dsb->device->pwfx->nChannels * sizeof(float);
|
||||
+ for (i = 0; i < frames; i++) {
|
||||
@@ -232,5 +232,5 @@ index c26b19ea8c1..68a45c46d1e 100644
|
||||
|
||||
static void DSOUND_MixerVol(const IDirectSoundBufferImpl *dsb, INT frames)
|
||||
--
|
||||
2.39.2
|
||||
2.43.0
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 61fb7e02aa6779469e94c79f1132c4991cb27244 Mon Sep 17 00:00:00 2001
|
||||
From ad881c0cf988811e4b8662eac50f8998dfed40ca Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <zfigura@codeweavers.com>
|
||||
Date: Mon, 6 Jul 2020 15:11:12 -0500
|
||||
Subject: [PATCH] server: Create eventfd file descriptors for process objects.
|
||||
@@ -11,7 +11,7 @@ Subject: [PATCH] server: Create eventfd file descriptors for process objects.
|
||||
4 files changed, 35 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/server/esync.c b/server/esync.c
|
||||
index c7b0323f204..27049ffbdb0 100644
|
||||
index 85f7f1e060f..44214e5fe02 100644
|
||||
--- a/server/esync.c
|
||||
+++ b/server/esync.c
|
||||
@@ -295,6 +295,24 @@ struct esync *create_esync( struct object *root, const struct unicode_str *name,
|
||||
@@ -49,7 +49,7 @@ index 00f9e638d83..8522d8a69ae 100644
|
||||
void esync_init(void);
|
||||
+int esync_create_fd( int initval, int flags );
|
||||
diff --git a/server/process.c b/server/process.c
|
||||
index da11b90c613..22ac16fb540 100644
|
||||
index 4a5ef0876b0..a7be3ee3876 100644
|
||||
--- a/server/process.c
|
||||
+++ b/server/process.c
|
||||
@@ -63,6 +63,7 @@
|
||||
@@ -77,15 +77,15 @@ index da11b90c613..22ac16fb540 100644
|
||||
no_satisfied, /* satisfied */
|
||||
no_signal, /* signal */
|
||||
no_get_fd, /* get_fd */
|
||||
@@ -686,6 +688,7 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla
|
||||
process->rawinput_mouse = NULL;
|
||||
@@ -688,6 +690,7 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla
|
||||
process->rawinput_kbd = NULL;
|
||||
memset( &process->image_info, 0, sizeof(process->image_info) );
|
||||
list_init( &process->rawinput_entry );
|
||||
+ process->esync_fd = -1;
|
||||
list_init( &process->kernel_object );
|
||||
list_init( &process->thread_list );
|
||||
list_init( &process->locks );
|
||||
@@ -742,6 +745,9 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla
|
||||
@@ -744,6 +747,9 @@ struct process *create_process( int fd, struct process *parent, unsigned int fla
|
||||
if (!token_assign_label( process->token, &high_label_sid ))
|
||||
goto error;
|
||||
|
||||
@@ -95,7 +95,7 @@ index da11b90c613..22ac16fb540 100644
|
||||
set_fd_events( process->msg_fd, POLLIN ); /* start listening to events */
|
||||
return process;
|
||||
|
||||
@@ -789,6 +795,7 @@ static void process_destroy( struct object *obj )
|
||||
@@ -792,6 +798,7 @@ static void process_destroy( struct object *obj )
|
||||
free( process->rawinput_devices );
|
||||
free( process->dir_cache );
|
||||
free( process->image );
|
||||
@@ -103,7 +103,7 @@ index da11b90c613..22ac16fb540 100644
|
||||
}
|
||||
|
||||
/* dump a process on stdout for debugging purposes */
|
||||
@@ -806,6 +813,13 @@ static int process_signaled( struct object *obj, struct wait_queue_entry *entry
|
||||
@@ -809,6 +816,13 @@ static int process_signaled( struct object *obj, struct wait_queue_entry *entry
|
||||
return !process->running_threads;
|
||||
}
|
||||
|
||||
@@ -118,11 +118,11 @@ index da11b90c613..22ac16fb540 100644
|
||||
{
|
||||
access = default_map_access( obj, access );
|
||||
diff --git a/server/process.h b/server/process.h
|
||||
index 97e0d455ece..a0a071d8f88 100644
|
||||
index 1e73e9d47dc..bedd8bb4586 100644
|
||||
--- a/server/process.h
|
||||
+++ b/server/process.h
|
||||
@@ -85,6 +85,7 @@ struct process
|
||||
const struct rawinput_device *rawinput_kbd; /* rawinput keyboard device, if any */
|
||||
@@ -86,6 +86,7 @@ struct process
|
||||
struct list rawinput_entry; /* entry in the rawinput process list */
|
||||
struct list kernel_object; /* list of kernel object pointers */
|
||||
pe_image_info_t image_info; /* main exe image info */
|
||||
+ int esync_fd; /* esync file descriptor (signaled on exit) */
|
||||
@@ -130,5 +130,5 @@ index 97e0d455ece..a0a071d8f88 100644
|
||||
|
||||
/* process functions */
|
||||
--
|
||||
2.35.1
|
||||
2.43.0
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 1cf7540fcddc9fbaa7411f3293f115555a6dd0ab Mon Sep 17 00:00:00 2001
|
||||
From d7b142aa0b60d99bd225849439cd49119a6e3e80 Mon Sep 17 00:00:00 2001
|
||||
From: Zebediah Figura <zfigura@codeweavers.com>
|
||||
Date: Mon, 6 Jul 2020 16:11:23 -0500
|
||||
Subject: [PATCH] server, ntdll: Implement message waits.
|
||||
@@ -105,10 +105,10 @@ index 399930c444b..06d7d8babc6 100644
|
||||
{
|
||||
struct stat st;
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index 915332ece6f..dd5e996cbc7 100644
|
||||
index a2700b043ba..fb290c7964c 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -3921,3 +3921,8 @@ enum esync_type
|
||||
@@ -3907,3 +3907,8 @@ enum esync_type
|
||||
int type;
|
||||
unsigned int shm_idx;
|
||||
@END
|
||||
@@ -118,10 +118,10 @@ index 915332ece6f..dd5e996cbc7 100644
|
||||
+ int in_msgwait; /* are we in a message wait? */
|
||||
+@END
|
||||
diff --git a/server/queue.c b/server/queue.c
|
||||
index 3d5da326400..80731383401 100644
|
||||
index 936a6309683..fc13b1cf6eb 100644
|
||||
--- a/server/queue.c
|
||||
+++ b/server/queue.c
|
||||
@@ -146,6 +146,7 @@ struct msg_queue
|
||||
@@ -148,6 +148,7 @@ struct msg_queue
|
||||
int keystate_lock; /* owns an input keystate lock */
|
||||
unsigned int ignore_post_msg; /* ignore post messages newer than this unique id */
|
||||
int esync_fd; /* esync file descriptor (signalled on message) */
|
||||
@@ -129,7 +129,7 @@ index 3d5da326400..80731383401 100644
|
||||
};
|
||||
|
||||
struct hotkey
|
||||
@@ -319,6 +320,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
|
||||
@@ -321,6 +322,7 @@ static struct msg_queue *create_msg_queue( struct thread *thread, struct thread_
|
||||
queue->keystate_lock = 0;
|
||||
queue->ignore_post_msg = 0;
|
||||
queue->esync_fd = -1;
|
||||
@@ -137,7 +137,7 @@ index 3d5da326400..80731383401 100644
|
||||
list_init( &queue->send_result );
|
||||
list_init( &queue->callback_result );
|
||||
list_init( &queue->pending_timers );
|
||||
@@ -1106,6 +1108,10 @@ static int is_queue_hung( struct msg_queue *queue )
|
||||
@@ -1108,6 +1110,10 @@ static int is_queue_hung( struct msg_queue *queue )
|
||||
if (get_wait_queue_thread(entry)->queue == queue)
|
||||
return 0; /* thread is waiting on queue -> not hung */
|
||||
}
|
||||
@@ -148,9 +148,9 @@ index 3d5da326400..80731383401 100644
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -3568,3 +3574,18 @@ DECL_HANDLER(update_rawinput_devices)
|
||||
process->rawinput_mouse = find_rawinput_device( process, MAKELONG(HID_USAGE_GENERIC_MOUSE, HID_USAGE_PAGE_GENERIC) );
|
||||
process->rawinput_kbd = find_rawinput_device( process, MAKELONG(HID_USAGE_GENERIC_KEYBOARD, HID_USAGE_PAGE_GENERIC) );
|
||||
@@ -3735,3 +3741,18 @@ DECL_HANDLER(update_rawinput_devices)
|
||||
release_object( desktop );
|
||||
}
|
||||
}
|
||||
+
|
||||
+DECL_HANDLER(esync_msgwait)
|
||||
|
@@ -1,153 +0,0 @@
|
||||
From 8caf8262a8ae8b5f0275172a62d807240d86968d Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Sun, 29 Aug 2021 13:26:53 +1000
|
||||
Subject: [PATCH 1/3] fltmgr.sys: Implement FltBuildDefaultSecurityDescriptor
|
||||
|
||||
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
---
|
||||
dlls/fltmgr.sys/Makefile.in | 1 +
|
||||
dlls/fltmgr.sys/fltmgr.sys.spec | 4 +-
|
||||
dlls/fltmgr.sys/main.c | 75 ++++++++++++++++++++++++++++++++-
|
||||
include/ddk/fltkernel.h | 3 +-
|
||||
4 files changed, 79 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/fltmgr.sys/Makefile.in b/dlls/fltmgr.sys/Makefile.in
|
||||
index 6ebd48d9412..ae0e812cb22 100644
|
||||
--- a/dlls/fltmgr.sys/Makefile.in
|
||||
+++ b/dlls/fltmgr.sys/Makefile.in
|
||||
@@ -1,5 +1,6 @@
|
||||
MODULE = fltmgr.sys
|
||||
EXTRADLLFLAGS = -Wl,--subsystem,native
|
||||
+IMPORTS = ntoskrnl
|
||||
|
||||
SOURCES = \
|
||||
fltmgr.sys.spec \
|
||||
diff --git a/dlls/fltmgr.sys/fltmgr.sys.spec b/dlls/fltmgr.sys/fltmgr.sys.spec
|
||||
index 39ce6798178..8943b9f85cf 100644
|
||||
--- a/dlls/fltmgr.sys/fltmgr.sys.spec
|
||||
+++ b/dlls/fltmgr.sys/fltmgr.sys.spec
|
||||
@@ -10,7 +10,7 @@
|
||||
@ stub FltAllocatePoolAlignedWithTag
|
||||
@ stub FltAttachVolume
|
||||
@ stub FltAttachVolumeAtAltitude
|
||||
-@ stub FltBuildDefaultSecurityDescriptor
|
||||
+@ stdcall FltBuildDefaultSecurityDescriptor(ptr long)
|
||||
@ stub FltCancelFileOpen
|
||||
@ stub FltCancelIo
|
||||
@ stub FltCbdqDisable
|
||||
@@ -60,7 +60,7 @@
|
||||
@ stub FltFreeFileLock
|
||||
@ stub FltFreeGenericWorkItem
|
||||
@ stub FltFreePoolAlignedWithTag
|
||||
-@ stub FltFreeSecurityDescriptor
|
||||
+@ stdcall FltFreeSecurityDescriptor(ptr)
|
||||
@ stub FltFsControlFile
|
||||
@ stub FltGetBottomInstance
|
||||
@ stub FltGetContexts
|
||||
diff --git a/dlls/fltmgr.sys/main.c b/dlls/fltmgr.sys/main.c
|
||||
index e1016a4989c..9a85f4b6c82 100644
|
||||
--- a/dlls/fltmgr.sys/main.c
|
||||
+++ b/dlls/fltmgr.sys/main.c
|
||||
@@ -23,7 +23,6 @@
|
||||
#include "ntstatus.h"
|
||||
#define WIN32_NO_STATUS
|
||||
#include "windef.h"
|
||||
-#include "winbase.h"
|
||||
#include "winternl.h"
|
||||
#include "ddk/fltkernel.h"
|
||||
|
||||
@@ -93,3 +92,77 @@ void* WINAPI FltGetRoutineAddress(LPCSTR name)
|
||||
|
||||
return func;
|
||||
}
|
||||
+
|
||||
+NTSTATUS WINAPI FltBuildDefaultSecurityDescriptor(PSECURITY_DESCRIPTOR *descriptor, ACCESS_MASK access)
|
||||
+{
|
||||
+ PACL dacl;
|
||||
+ NTSTATUS ret = STATUS_INSUFFICIENT_RESOURCES;
|
||||
+ DWORD sid_len;
|
||||
+ SID *sid;
|
||||
+ SID *sid_system = NULL;
|
||||
+ PSECURITY_DESCRIPTOR sec_desc = NULL;
|
||||
+ SID_IDENTIFIER_AUTHORITY auth = { SECURITY_NULL_SID_AUTHORITY };
|
||||
+
|
||||
+ *descriptor = NULL;
|
||||
+
|
||||
+ sid_len = RtlLengthRequiredSid(2);
|
||||
+ sid = ExAllocatePool(PagedPool, sid_len);
|
||||
+ if (!sid)
|
||||
+ goto done;
|
||||
+ RtlInitializeSid(sid, &auth, 2);
|
||||
+ sid->SubAuthority[1] = DOMAIN_GROUP_RID_ADMINS;
|
||||
+ sid->SubAuthority[0] = SECURITY_BUILTIN_DOMAIN_RID;
|
||||
+
|
||||
+ sid_len = RtlLengthRequiredSid(1);
|
||||
+ sid_system = ExAllocatePool(PagedPool, sid_len);
|
||||
+ if (!sid_system)
|
||||
+ goto done;
|
||||
+ RtlInitializeSid(sid_system, &auth, 1);
|
||||
+ sid_system->SubAuthority[0] = SECURITY_LOCAL_SYSTEM_RID;
|
||||
+
|
||||
+ sid_len = SECURITY_DESCRIPTOR_MIN_LENGTH + sizeof(ACL) +
|
||||
+ sizeof(ACCESS_ALLOWED_ACE) + RtlLengthSid(sid) +
|
||||
+ sizeof(ACCESS_ALLOWED_ACE) + RtlLengthSid(sid_system);
|
||||
+
|
||||
+ sec_desc = ExAllocatePool(PagedPool, sid_len);
|
||||
+ if (!sec_desc)
|
||||
+ {
|
||||
+ ret = STATUS_NO_MEMORY;
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
+ ret = RtlCreateSecurityDescriptor(sec_desc, SECURITY_DESCRIPTOR_REVISION);
|
||||
+ if (ret != STATUS_SUCCESS)
|
||||
+ goto done;
|
||||
+
|
||||
+ dacl = (PACL)((char*)sec_desc + SECURITY_DESCRIPTOR_MIN_LENGTH);
|
||||
+ ret = RtlCreateAcl(dacl, sid_len - SECURITY_DESCRIPTOR_MIN_LENGTH, ACL_REVISION);
|
||||
+ if (ret != STATUS_SUCCESS)
|
||||
+ goto done;
|
||||
+
|
||||
+ ret = RtlAddAccessAllowedAce(dacl, ACL_REVISION, access, sid);
|
||||
+ if (ret != STATUS_SUCCESS)
|
||||
+ goto done;
|
||||
+
|
||||
+ ret = RtlAddAccessAllowedAce(dacl, ACL_REVISION, access, sid_system);
|
||||
+ if (ret != STATUS_SUCCESS)
|
||||
+ goto done;
|
||||
+
|
||||
+ ret = RtlSetDaclSecurityDescriptor(sec_desc, 1, dacl, 0);
|
||||
+ if (ret == STATUS_SUCCESS)
|
||||
+ *descriptor = sec_desc;
|
||||
+
|
||||
+done:
|
||||
+ if (ret != STATUS_SUCCESS)
|
||||
+ ExFreePool(sec_desc);
|
||||
+
|
||||
+ ExFreePool(sid);
|
||||
+ ExFreePool(sid_system);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+void WINAPI FltFreeSecurityDescriptor(PSECURITY_DESCRIPTOR descriptor)
|
||||
+{
|
||||
+ ExFreePool(descriptor);
|
||||
+}
|
||||
diff --git a/include/ddk/fltkernel.h b/include/ddk/fltkernel.h
|
||||
index 49c9d55dbaa..e5483d5a3fa 100644
|
||||
--- a/include/ddk/fltkernel.h
|
||||
+++ b/include/ddk/fltkernel.h
|
||||
@@ -653,7 +653,8 @@ typedef struct _FLT_REGISTRATION
|
||||
PFLT_SECTION_CONFLICT_NOTIFICATION_CALLBACK SectionNotificationCallback;
|
||||
} FLT_REGISTRATION, *PFLT_REGISTRATION;
|
||||
|
||||
-
|
||||
+NTSTATUS WINAPI FltBuildDefaultSecurityDescriptor(PSECURITY_DESCRIPTOR *, ACCESS_MASK);
|
||||
+void WINAPI FltFreeSecurityDescriptor(PSECURITY_DESCRIPTOR);
|
||||
void* WINAPI FltGetRoutineAddress(LPCSTR name);
|
||||
NTSTATUS WINAPI FltRegisterFilter(PDRIVER_OBJECT, const FLT_REGISTRATION *, PFLT_FILTER *);
|
||||
NTSTATUS WINAPI FltStartFiltering(PFLT_FILTER);
|
||||
--
|
||||
2.42.0
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user