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
132 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
5a85ab07af | ||
|
4971d171bb | ||
|
4f57895f06 | ||
|
eb630f686f | ||
|
2802df41dc | ||
|
f3f4f80a01 | ||
|
8710aa32b4 | ||
|
f15b462860 | ||
|
616bf11236 | ||
|
20f1d05973 | ||
|
8519a9eaf6 | ||
|
803ed475af | ||
|
f5d03d51d3 | ||
|
3d981b8d47 | ||
|
a804fed0f7 | ||
|
ad4de04511 | ||
|
a83917b70e | ||
|
f4a4f3f5b7 | ||
|
30dca36aeb | ||
|
9556a78ab9 | ||
|
b56e74f39d | ||
|
652a39caf1 | ||
|
6bb65ccf88 | ||
|
4beed4a313 | ||
|
5a2c1ea66d | ||
|
8dced4d4ac | ||
|
15e36c54fc | ||
|
2de179532e | ||
|
f17ad5a016 | ||
|
faf8498490 | ||
|
9d20573c6e | ||
|
be75db4704 | ||
|
20a4649b84 | ||
|
1b1af92c85 | ||
|
5cf1692e74 | ||
|
9146bbc3d4 | ||
|
dc83f04f04 | ||
|
761ca063a0 | ||
|
732d40058d | ||
|
64561065d2 | ||
|
1bd95055a7 | ||
|
3f082c2d0a | ||
|
42312b1e3f | ||
|
a840ce50e7 | ||
|
912b650b76 | ||
|
5ae728e2ec | ||
|
9517e98320 | ||
|
bd3794c11e | ||
|
7cfceb78b2 | ||
|
1ee9d7c6e8 | ||
|
5d3992d777 | ||
|
d4710fd098 | ||
|
6587db3575 | ||
|
8f0e72776f | ||
|
6e0d8f18d9 | ||
|
28e66e552f | ||
|
3cc8f97398 | ||
|
1cbabaac9d | ||
|
b9ae1089c7 | ||
|
5a71716118 | ||
|
214a0fd7bd | ||
|
94f314ccaa | ||
|
90c47aa854 | ||
|
51cfdc619e | ||
|
d7154d5d3f | ||
|
412e20cd9a | ||
|
a043977b12 | ||
|
b64814b44a | ||
|
f3b9983a5e | ||
|
d205b5f8e9 | ||
|
ab69e65646 | ||
|
965002dc53 | ||
|
a6eddc4c25 | ||
|
7a9913e0a9 | ||
|
e8ba49a434 | ||
|
3dcb983637 | ||
|
74e9c4f8ce | ||
|
8ff32873d6 | ||
|
9190e30a15 | ||
|
8cf0e5c285 | ||
|
110a6f6016 | ||
|
720db34b6e | ||
|
a701f0ed4c | ||
|
c58c70e961 | ||
|
93e4c328d7 | ||
|
06c1bde586 | ||
|
ec47c04ab3 | ||
|
e7bff1bb4f | ||
|
39cafb1db1 | ||
|
49f93040fe | ||
|
af0347a0f2 | ||
|
0e828a225e | ||
|
eb5196c132 | ||
|
f45bfd8af7 | ||
|
d9dc36f879 | ||
|
2c7a662655 | ||
|
ec218012c3 | ||
|
c2d58dc59a | ||
|
2f3ba1fb46 | ||
|
9a1a1f02fb | ||
|
f7210fb07e | ||
|
9d12bd013b | ||
|
7da7ae71d2 | ||
|
f23105a6d8 | ||
|
a7ae3783c5 | ||
|
12d22ddfd7 | ||
|
b6649197d6 | ||
|
e1fb783018 | ||
|
1de1a96f1e | ||
|
00de4984f6 | ||
|
87b63971e9 | ||
|
f07947d41c | ||
|
ea7016fe39 | ||
|
a5044d57dd | ||
|
ba9e6db9f3 | ||
|
925645e710 | ||
|
2e982e862f | ||
|
8b65c06f30 | ||
|
f0d3ae8cf2 | ||
|
44aadc3afc | ||
|
18f4be0e03 | ||
|
49025c255b | ||
|
12be01bfc1 | ||
|
79f6a17908 | ||
|
2b85113f61 | ||
|
60e4f489f6 | ||
|
fd81bd7755 | ||
|
292a0e67f4 | ||
|
7993325086 | ||
|
77ecb8ba3f | ||
|
d3bb80f8eb | ||
|
0b4011d95c |
@@ -22,7 +22,7 @@ parallel. If this is the case for your distribution, you will have to type
|
||||
`/opt/wine-staging/bin/wine` instead of just `wine`. The same also applies for
|
||||
other wine-specific programs like `winecfg`. To learn more about how to use
|
||||
Wine Staging, please take a look at the
|
||||
[usage instructions](https://github.com/wine-compholio/wine-staging/wiki/Usage).
|
||||
[usage instructions](https://wiki.winehq.org/Wine-Staging_Usage).
|
||||
|
||||
Building
|
||||
--------
|
||||
@@ -73,7 +73,7 @@ Before you proceed with the compilation, please make sure that you installed all
|
||||
additional build dependencies required for the Wine Staging features you are
|
||||
interested in (check output of `./configure`). More information about building
|
||||
Wine Staging, optional build dependencies, and hints for packagers are collected
|
||||
in our [Wiki](https://github.com/wine-compholio/wine-staging/wiki/Packaging).
|
||||
in our [Wiki](https://wiki.winehq.org/Wine-Staging).
|
||||
|
||||
Contributing
|
||||
------------
|
||||
|
@@ -0,0 +1,61 @@
|
||||
From fc5c0462f64e0976d596bd726da4d7f0e4857384 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Wed, 19 Sep 2018 09:03:19 +1000
|
||||
Subject: [PATCH] windowscodecs: Avoid implicit cast of interface pointer.
|
||||
|
||||
---
|
||||
dlls/windowscodecs/info.c | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/windowscodecs/info.c b/dlls/windowscodecs/info.c
|
||||
index 0a86266..8c81574 100644
|
||||
--- a/dlls/windowscodecs/info.c
|
||||
+++ b/dlls/windowscodecs/info.c
|
||||
@@ -222,7 +222,7 @@ typedef struct {
|
||||
|
||||
static inline BitmapDecoderInfo *impl_from_IWICBitmapDecoderInfo(IWICBitmapDecoderInfo *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, BitmapDecoderInfo, base.IWICComponentInfo_iface);
|
||||
+ return CONTAINING_RECORD((IWICComponentInfo*)iface, BitmapDecoderInfo, base.IWICComponentInfo_iface);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI BitmapDecoderInfo_QueryInterface(IWICBitmapDecoderInfo *iface, REFIID iid,
|
||||
@@ -713,7 +713,7 @@ typedef struct {
|
||||
|
||||
static inline BitmapEncoderInfo *impl_from_IWICBitmapEncoderInfo(IWICBitmapEncoderInfo *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, BitmapEncoderInfo, base.IWICComponentInfo_iface);
|
||||
+ return CONTAINING_RECORD((IWICComponentInfo*)iface, BitmapEncoderInfo, base.IWICComponentInfo_iface);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI BitmapEncoderInfo_QueryInterface(IWICBitmapEncoderInfo *iface, REFIID iid,
|
||||
@@ -1005,7 +1005,7 @@ typedef struct {
|
||||
|
||||
static inline FormatConverterInfo *impl_from_IWICFormatConverterInfo(IWICFormatConverterInfo *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, FormatConverterInfo, base.IWICComponentInfo_iface);
|
||||
+ return CONTAINING_RECORD((IWICComponentInfo*)iface, FormatConverterInfo, base.IWICComponentInfo_iface);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI FormatConverterInfo_QueryInterface(IWICFormatConverterInfo *iface, REFIID iid,
|
||||
@@ -1219,7 +1219,7 @@ typedef struct {
|
||||
|
||||
static inline PixelFormatInfo *impl_from_IWICPixelFormatInfo2(IWICPixelFormatInfo2 *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, PixelFormatInfo, base.IWICComponentInfo_iface);
|
||||
+ return CONTAINING_RECORD((IWICComponentInfo*)iface, PixelFormatInfo, base.IWICComponentInfo_iface);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI PixelFormatInfo_QueryInterface(IWICPixelFormatInfo2 *iface, REFIID iid,
|
||||
@@ -1531,7 +1531,7 @@ static struct metadata_container *get_metadata_container(MetadataReaderInfo *inf
|
||||
|
||||
static inline MetadataReaderInfo *impl_from_IWICMetadataReaderInfo(IWICMetadataReaderInfo *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, MetadataReaderInfo, base.IWICComponentInfo_iface);
|
||||
+ return CONTAINING_RECORD((IWICComponentInfo*)iface, MetadataReaderInfo, base.IWICComponentInfo_iface);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI MetadataReaderInfo_QueryInterface(IWICMetadataReaderInfo *iface,
|
||||
--
|
||||
1.9.1
|
||||
|
@@ -1,24 +0,0 @@
|
||||
From 560a25c662f7b56d2b895759be1ea65c64d0f5af Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sun, 4 Jun 2017 12:57:17 +0200
|
||||
Subject: ws2_32/tests: Work around an incorrect detection in GCC 7.
|
||||
|
||||
---
|
||||
dlls/ws2_32/tests/sock.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c
|
||||
index 677a750ec6b..65c82e36524 100644
|
||||
--- a/dlls/ws2_32/tests/sock.c
|
||||
+++ b/dlls/ws2_32/tests/sock.c
|
||||
@@ -3601,6 +3601,7 @@ static DWORD WINAPI SelectReadThread(void *param)
|
||||
struct sockaddr_in addr;
|
||||
struct timeval select_timeout;
|
||||
|
||||
+ memset(&readfds, 0, sizeof(readfds));
|
||||
FD_ZERO(&readfds);
|
||||
FD_SET(par->s, &readfds);
|
||||
select_timeout.tv_sec=5;
|
||||
--
|
||||
2.13.0
|
||||
|
@@ -1,67 +0,0 @@
|
||||
From cd34de81164087b3593d0ec9416e2f157a5df40d Mon Sep 17 00:00:00 2001
|
||||
From: "Erich E. Hoover" <erich.e.hoover@gmail.com>
|
||||
Date: Fri, 8 Aug 2014 19:33:14 -0600
|
||||
Subject: Appease the blessed version of gcc (4.5) when -Werror is enabled.
|
||||
|
||||
---
|
||||
dlls/d3d9/tests/visual.c | 2 +-
|
||||
dlls/netapi32/netapi32.c | 2 +-
|
||||
dlls/wined3d/glsl_shader.c | 2 +-
|
||||
tools/makedep.c | 2 +-
|
||||
4 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
|
||||
index c8a6a1fa5a8..0261d3708e6 100644
|
||||
--- a/dlls/d3d9/tests/visual.c
|
||||
+++ b/dlls/d3d9/tests/visual.c
|
||||
@@ -12304,7 +12304,7 @@ static void yuv_layout_test(void)
|
||||
IDirect3D9 *d3d;
|
||||
D3DCOLOR color;
|
||||
DWORD ref_color;
|
||||
- BYTE *buf, *chroma_buf, *u_buf, *v_buf;
|
||||
+ BYTE *buf, *chroma_buf, *u_buf = NULL, *v_buf = NULL;
|
||||
UINT width = 20, height = 16;
|
||||
IDirect3DDevice9 *device;
|
||||
ULONG refcount;
|
||||
diff --git a/dlls/netapi32/netapi32.c b/dlls/netapi32/netapi32.c
|
||||
index 278d4528b01..1c5f110b828 100644
|
||||
--- a/dlls/netapi32/netapi32.c
|
||||
+++ b/dlls/netapi32/netapi32.c
|
||||
@@ -780,7 +780,7 @@ static NET_API_STATUS share_info_to_samba( DWORD level, const BYTE *buf, unsigne
|
||||
static NET_API_STATUS share_add( LMSTR servername, DWORD level, LPBYTE buf, LPDWORD parm_err )
|
||||
{
|
||||
char *server = NULL;
|
||||
- unsigned char *info;
|
||||
+ unsigned char *info = NULL;
|
||||
NET_API_STATUS status;
|
||||
|
||||
if (servername && !(server = strdup_unixcp( servername ))) return ERROR_OUTOFMEMORY;
|
||||
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
|
||||
index f96f48d97d1..8fe3318cd78 100644
|
||||
--- a/dlls/wined3d/glsl_shader.c
|
||||
+++ b/dlls/wined3d/glsl_shader.c
|
||||
@@ -9721,7 +9721,7 @@ static void set_glsl_shader_program(const struct wined3d_context *context, const
|
||||
GLuint ds_id = 0;
|
||||
GLuint gs_id = 0;
|
||||
GLuint ps_id = 0;
|
||||
- struct list *ps_list, *vs_list;
|
||||
+ struct list *ps_list = NULL, *vs_list = NULL;
|
||||
WORD attribs_map;
|
||||
struct wined3d_string_buffer *tmp_name;
|
||||
|
||||
diff --git a/tools/makedep.c b/tools/makedep.c
|
||||
index 296356b0a57..5a2873b56f1 100644
|
||||
--- a/tools/makedep.c
|
||||
+++ b/tools/makedep.c
|
||||
@@ -1608,7 +1608,7 @@ static const char *get_make_variable( const struct makefile *make, const char *n
|
||||
static char *get_expanded_make_variable( const struct makefile *make, const char *name )
|
||||
{
|
||||
const char *var;
|
||||
- char *p, *end, *expand, *tmp;
|
||||
+ char *p, *end, *expand, *tmp = NULL;
|
||||
|
||||
var = get_make_variable( make, name );
|
||||
if (!var) return NULL;
|
||||
--
|
||||
2.13.1
|
||||
|
@@ -1,18 +1,34 @@
|
||||
From 79ff79dba6d5c8008c53e4bcf5e38c3a54271091 Mon Sep 17 00:00:00 2001
|
||||
From 2aeb3a9e57142c3f4ff86cb81b206bdbc146552d Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Tue, 22 Mar 2016 21:54:26 +0100
|
||||
Subject: d2d1: Avoid implicit cast of interface pointer.
|
||||
Subject: [PATCH] d2d1: Avoid implicit cast of interface pointer.
|
||||
|
||||
---
|
||||
dlls/d2d1/brush.c | 8 ++++----
|
||||
dlls/d2d1/geometry.c | 6 +++---
|
||||
2 files changed, 7 insertions(+), 7 deletions(-)
|
||||
dlls/d2d1/bitmap.c | 2 +-
|
||||
dlls/d2d1/brush.c | 8 ++++----
|
||||
dlls/d2d1/dc_render_target.c | 2 +-
|
||||
dlls/d2d1/device.c | 2 +-
|
||||
dlls/d2d1/geometry.c | 6 +++---
|
||||
dlls/d2d1/hwnd_render_target.c | 2 +-
|
||||
dlls/d2d1/state_block.c | 2 +-
|
||||
7 files changed, 12 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/dlls/d2d1/bitmap.c b/dlls/d2d1/bitmap.c
|
||||
index c0aef3c..8a4b517 100644
|
||||
--- a/dlls/d2d1/bitmap.c
|
||||
+++ b/dlls/d2d1/bitmap.c
|
||||
@@ -626,5 +626,5 @@ struct d2d_bitmap *unsafe_impl_from_ID2D1Bitmap(ID2D1Bitmap *iface)
|
||||
if (!iface)
|
||||
return NULL;
|
||||
assert(iface->lpVtbl == (ID2D1BitmapVtbl *)&d2d_bitmap_vtbl);
|
||||
- return CONTAINING_RECORD(iface, struct d2d_bitmap, ID2D1Bitmap1_iface);
|
||||
+ return CONTAINING_RECORD((ID2D1Bitmap1*)iface, struct d2d_bitmap, ID2D1Bitmap1_iface);
|
||||
}
|
||||
diff --git a/dlls/d2d1/brush.c b/dlls/d2d1/brush.c
|
||||
index 7f4c7bbb763..30d25fec4b4 100644
|
||||
index 9c73ae1..a748669 100644
|
||||
--- a/dlls/d2d1/brush.c
|
||||
+++ b/dlls/d2d1/brush.c
|
||||
@@ -251,7 +251,7 @@ static void d2d_brush_init(struct d2d_brush *brush, ID2D1Factory *factory,
|
||||
@@ -256,7 +256,7 @@ static void d2d_brush_init(struct d2d_brush *brush, ID2D1Factory *factory,
|
||||
|
||||
static inline struct d2d_brush *impl_from_ID2D1SolidColorBrush(ID2D1SolidColorBrush *iface)
|
||||
{
|
||||
@@ -21,7 +37,7 @@ index 7f4c7bbb763..30d25fec4b4 100644
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_solid_color_brush_QueryInterface(ID2D1SolidColorBrush *iface,
|
||||
@@ -394,7 +394,7 @@ HRESULT d2d_solid_color_brush_create(ID2D1Factory *factory, const D2D1_COLOR_F *
|
||||
@@ -399,7 +399,7 @@ HRESULT d2d_solid_color_brush_create(ID2D1Factory *factory, const D2D1_COLOR_F *
|
||||
|
||||
static inline struct d2d_brush *impl_from_ID2D1LinearGradientBrush(ID2D1LinearGradientBrush *iface)
|
||||
{
|
||||
@@ -30,7 +46,7 @@ index 7f4c7bbb763..30d25fec4b4 100644
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_linear_gradient_brush_QueryInterface(ID2D1LinearGradientBrush *iface,
|
||||
@@ -580,7 +580,7 @@ HRESULT d2d_linear_gradient_brush_create(ID2D1Factory *factory, const D2D1_LINEA
|
||||
@@ -586,7 +586,7 @@ HRESULT d2d_linear_gradient_brush_create(ID2D1Factory *factory,
|
||||
|
||||
static inline struct d2d_brush *impl_from_ID2D1RadialGradientBrush(ID2D1RadialGradientBrush *iface)
|
||||
{
|
||||
@@ -39,20 +55,46 @@ index 7f4c7bbb763..30d25fec4b4 100644
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_radial_gradient_brush_QueryInterface(ID2D1RadialGradientBrush *iface,
|
||||
@@ -776,7 +776,7 @@ HRESULT d2d_radial_gradient_brush_create(ID2D1Factory *factory, const D2D1_BRUSH
|
||||
@@ -818,7 +818,7 @@ HRESULT d2d_radial_gradient_brush_create(ID2D1Factory *factory,
|
||||
|
||||
static inline struct d2d_brush *impl_from_ID2D1BitmapBrush(ID2D1BitmapBrush *iface)
|
||||
static inline struct d2d_brush *impl_from_ID2D1BitmapBrush1(ID2D1BitmapBrush1 *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, struct d2d_brush, ID2D1Brush_iface);
|
||||
+ return CONTAINING_RECORD((ID2D1Brush *)iface, struct d2d_brush, ID2D1Brush_iface);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_bitmap_brush_QueryInterface(ID2D1BitmapBrush *iface,
|
||||
static HRESULT STDMETHODCALLTYPE d2d_bitmap_brush_QueryInterface(ID2D1BitmapBrush1 *iface,
|
||||
diff --git a/dlls/d2d1/dc_render_target.c b/dlls/d2d1/dc_render_target.c
|
||||
index b095008..6030826 100644
|
||||
--- a/dlls/d2d1/dc_render_target.c
|
||||
+++ b/dlls/d2d1/dc_render_target.c
|
||||
@@ -26,7 +26,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d2d);
|
||||
|
||||
static inline struct d2d_dc_render_target *impl_from_IUnknown(IUnknown *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, struct d2d_dc_render_target, ID2D1DCRenderTarget_iface);
|
||||
+ return CONTAINING_RECORD((ID2D1DCRenderTarget*)iface, struct d2d_dc_render_target, ID2D1DCRenderTarget_iface);
|
||||
}
|
||||
|
||||
static HRESULT d2d_dc_render_target_present(IUnknown *outer_unknown)
|
||||
diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c
|
||||
index 45b2258..bf32c23 100644
|
||||
--- a/dlls/d2d1/device.c
|
||||
+++ b/dlls/d2d1/device.c
|
||||
@@ -207,7 +207,7 @@ static inline struct d2d_device_context *impl_from_ID2D1DeviceContext(ID2D1Devic
|
||||
|
||||
static inline struct d2d_device_context *impl_from_ID2D1RenderTarget(ID2D1RenderTarget *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, struct d2d_device_context, ID2D1DeviceContext_iface);
|
||||
+ return CONTAINING_RECORD((ID2D1DeviceContext*)iface, struct d2d_device_context, ID2D1DeviceContext_iface);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_device_context_inner_QueryInterface(IUnknown *iface, REFIID iid, void **out)
|
||||
diff --git a/dlls/d2d1/geometry.c b/dlls/d2d1/geometry.c
|
||||
index a9588985642..b8457a9e1ea 100644
|
||||
index 421ba2b..f8db51c 100644
|
||||
--- a/dlls/d2d1/geometry.c
|
||||
+++ b/dlls/d2d1/geometry.c
|
||||
@@ -3024,7 +3024,7 @@ static const struct ID2D1GeometrySinkVtbl d2d_geometry_sink_vtbl =
|
||||
@@ -2987,7 +2987,7 @@ static const struct ID2D1GeometrySinkVtbl d2d_geometry_sink_vtbl =
|
||||
|
||||
static inline struct d2d_geometry *impl_from_ID2D1PathGeometry(ID2D1PathGeometry *iface)
|
||||
{
|
||||
@@ -61,7 +103,7 @@ index a9588985642..b8457a9e1ea 100644
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_path_geometry_QueryInterface(ID2D1PathGeometry *iface, REFIID iid, void **out)
|
||||
@@ -3540,7 +3540,7 @@ void d2d_path_geometry_init(struct d2d_geometry *geometry, ID2D1Factory *factory
|
||||
@@ -3503,7 +3503,7 @@ void d2d_path_geometry_init(struct d2d_geometry *geometry, ID2D1Factory *factory
|
||||
|
||||
static inline struct d2d_geometry *impl_from_ID2D1RectangleGeometry(ID2D1RectangleGeometry *iface)
|
||||
{
|
||||
@@ -70,7 +112,7 @@ index a9588985642..b8457a9e1ea 100644
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_rectangle_geometry_QueryInterface(ID2D1RectangleGeometry *iface,
|
||||
@@ -3876,7 +3876,7 @@ fail:
|
||||
@@ -3838,7 +3838,7 @@ fail:
|
||||
|
||||
static inline struct d2d_geometry *impl_from_ID2D1TransformedGeometry(ID2D1TransformedGeometry *iface)
|
||||
{
|
||||
@@ -79,6 +121,30 @@ index a9588985642..b8457a9e1ea 100644
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_transformed_geometry_QueryInterface(ID2D1TransformedGeometry *iface,
|
||||
diff --git a/dlls/d2d1/hwnd_render_target.c b/dlls/d2d1/hwnd_render_target.c
|
||||
index d0b9695..429561e 100644
|
||||
--- a/dlls/d2d1/hwnd_render_target.c
|
||||
+++ b/dlls/d2d1/hwnd_render_target.c
|
||||
@@ -26,7 +26,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d2d);
|
||||
|
||||
static inline struct d2d_hwnd_render_target *impl_from_IUnknown(IUnknown *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, struct d2d_hwnd_render_target, ID2D1HwndRenderTarget_iface);
|
||||
+ return CONTAINING_RECORD((ID2D1HwndRenderTarget*)iface, struct d2d_hwnd_render_target, ID2D1HwndRenderTarget_iface);
|
||||
}
|
||||
|
||||
static HRESULT d2d_hwnd_render_target_present(IUnknown *outer_unknown)
|
||||
diff --git a/dlls/d2d1/state_block.c b/dlls/d2d1/state_block.c
|
||||
index b15384e..4e7e34b 100644
|
||||
--- a/dlls/d2d1/state_block.c
|
||||
+++ b/dlls/d2d1/state_block.c
|
||||
@@ -190,5 +190,5 @@ struct d2d_state_block *unsafe_impl_from_ID2D1DrawingStateBlock(ID2D1DrawingStat
|
||||
if (!iface)
|
||||
return NULL;
|
||||
assert(iface->lpVtbl == (ID2D1DrawingStateBlockVtbl *)&d2d_state_block_vtbl);
|
||||
- return CONTAINING_RECORD(iface, struct d2d_state_block, ID2D1DrawingStateBlock1_iface);
|
||||
+ return CONTAINING_RECORD((ID2D1DrawingStateBlock1*)iface, struct d2d_state_block, ID2D1DrawingStateBlock1_iface);
|
||||
}
|
||||
--
|
||||
2.14.1
|
||||
1.9.1
|
||||
|
||||
|
@@ -1,21 +0,0 @@
|
||||
#
|
||||
# This file is deprecated and will be deleted in the future.
|
||||
# Please use patchinstall.sh instead, to apply the Wine Staging patches.
|
||||
#
|
||||
|
||||
CURDIR ?= ${.CURDIR}
|
||||
|
||||
.PHONY: install
|
||||
install:
|
||||
@echo "WARNING: Using this Makefile is deprecated!" >&2
|
||||
"$(CURDIR)/patchinstall.sh" DESTDIR="$(DESTDIR)" --all
|
||||
|
||||
.PHONY: install-git
|
||||
install-git:
|
||||
@echo "WARNING: Using this Makefile is deprecated!" >&2
|
||||
"$(CURDIR)/patchinstall.sh" DESTDIR="$(DESTDIR)" --all --backend=git-am
|
||||
|
||||
.PHONY: series
|
||||
series:
|
||||
@echo "ERROR: Using this Makefile is deprecated!" >&2
|
||||
@false
|
@@ -1,2 +1 @@
|
||||
Depends: server-Misc_ACL
|
||||
Depends: server-CreateProcess_ACLs
|
||||
|
@@ -1,267 +0,0 @@
|
||||
From e950724c38a4f81efb97bb9595dc59c5fb925da0 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Wed, 12 Apr 2017 12:33:31 +0800
|
||||
Subject: advapi32/tests: Add more tests for performance counters.
|
||||
|
||||
---
|
||||
dlls/advapi32/tests/registry.c | 196 ++++++++++++++++++++++++++++++++++++++++-
|
||||
include/winreg.h | 2 +
|
||||
2 files changed, 194 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c
|
||||
index 846f1c49628..d850f6a3aa7 100644
|
||||
--- a/dlls/advapi32/tests/registry.c
|
||||
+++ b/dlls/advapi32/tests/registry.c
|
||||
@@ -3520,35 +3520,73 @@ static void test_RegNotifyChangeKeyValue(void)
|
||||
CloseHandle(event);
|
||||
}
|
||||
|
||||
+static const char *dbgstr_longlong(ULONGLONG ll)
|
||||
+{
|
||||
+ static char buf[16][64];
|
||||
+ static int idx;
|
||||
+
|
||||
+ idx &= 0x0f;
|
||||
+
|
||||
+ if (sizeof(ll) > sizeof(unsigned long) && ll >> 32)
|
||||
+ sprintf(buf[idx], "0x%lx%08lx", (unsigned long)(ll >> 32), (unsigned long)ll);
|
||||
+ else
|
||||
+ sprintf(buf[idx], "0x%08lx", (unsigned long)ll);
|
||||
+
|
||||
+ return buf[idx++];
|
||||
+}
|
||||
+
|
||||
+#define cmp_li(a, b, c) cmp_li_real(a, b, c, __LINE__)
|
||||
+static void cmp_li_real(LARGE_INTEGER *l1, LARGE_INTEGER *l2, LONGLONG slack, int line)
|
||||
+{
|
||||
+ LONGLONG diff = l2->QuadPart - l1->QuadPart;
|
||||
+ if (diff < 0) diff = -diff;
|
||||
+ ok_(__FILE__, line)(diff <= slack, "values don't match: %s/%s\n",
|
||||
+ dbgstr_longlong(l1->QuadPart), dbgstr_longlong(l2->QuadPart));
|
||||
+}
|
||||
+
|
||||
static void test_RegQueryValueExPerformanceData(void)
|
||||
{
|
||||
- DWORD cbData, len;
|
||||
+ static const WCHAR globalW[] = { 'G','l','o','b','a','l',0 };
|
||||
+ static const WCHAR dummyW[5] = { 'd','u','m','m','y' };
|
||||
+ static const char * const names[] = { NULL, "", "Global", "2" "invalid counter name" };
|
||||
+ DWORD cbData, len, i, type;
|
||||
BYTE *value;
|
||||
DWORD dwret;
|
||||
LONG limit = 6;
|
||||
PERF_DATA_BLOCK *pdb;
|
||||
+ HKEY hkey;
|
||||
+ BYTE buf[256 + sizeof(PERF_DATA_BLOCK)];
|
||||
|
||||
/* Test with data == NULL */
|
||||
dwret = RegQueryValueExA( HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, NULL, &cbData );
|
||||
todo_wine ok( dwret == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %d\n", dwret );
|
||||
|
||||
+ dwret = RegQueryValueExW( HKEY_PERFORMANCE_DATA, globalW, NULL, NULL, NULL, &cbData );
|
||||
+ todo_wine ok( dwret == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %d\n", dwret );
|
||||
+
|
||||
/* Test ERROR_MORE_DATA, start with small buffer */
|
||||
len = 10;
|
||||
value = HeapAlloc(GetProcessHeap(), 0, len);
|
||||
cbData = len;
|
||||
- dwret = RegQueryValueExA( HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, value, &cbData );
|
||||
+ type = 0xdeadbeef;
|
||||
+ dwret = RegQueryValueExA( HKEY_PERFORMANCE_DATA, "Global", NULL, &type, value, &cbData );
|
||||
todo_wine ok( dwret == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %d\n", dwret );
|
||||
+todo_wine
|
||||
+ ok(type == REG_BINARY, "got %u\n", type);
|
||||
while( dwret == ERROR_MORE_DATA && limit)
|
||||
{
|
||||
len = len * 10;
|
||||
value = HeapReAlloc( GetProcessHeap(), 0, value, len );
|
||||
cbData = len;
|
||||
- dwret = RegQueryValueExA( HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, value, &cbData );
|
||||
+ type = 0xdeadbeef;
|
||||
+ dwret = RegQueryValueExA( HKEY_PERFORMANCE_DATA, "Global", NULL, &type, value, &cbData );
|
||||
limit--;
|
||||
}
|
||||
ok(limit > 0, "too many times ERROR_MORE_DATA returned\n");
|
||||
|
||||
todo_wine ok(dwret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", dwret);
|
||||
+todo_wine
|
||||
+ ok(type == REG_BINARY, "got %u\n", type);
|
||||
|
||||
/* Check returned data */
|
||||
if (dwret == ERROR_SUCCESS)
|
||||
@@ -3565,8 +3603,158 @@ static void test_RegQueryValueExPerformanceData(void)
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, value);
|
||||
-}
|
||||
|
||||
+ for (i = 0; i < sizeof(names)/sizeof(names[0]); i++)
|
||||
+ {
|
||||
+ cbData = 0xdeadbeef;
|
||||
+ dwret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, names[i], NULL, NULL, NULL, &cbData);
|
||||
+todo_wine
|
||||
+ ok(dwret == ERROR_MORE_DATA, "%u/%s: got %u\n", i, names[i], dwret);
|
||||
+ ok(cbData == 0, "got %u\n", cbData);
|
||||
+
|
||||
+ cbData = 0;
|
||||
+ dwret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, names[i], NULL, NULL, NULL, &cbData);
|
||||
+todo_wine
|
||||
+ ok(dwret == ERROR_MORE_DATA, "%u/%s: got %u\n", i, names[i], dwret);
|
||||
+ ok(cbData == 0, "got %u\n", cbData);
|
||||
+
|
||||
+ cbData = 0xdeadbeef;
|
||||
+ dwret = RegQueryValueExA(HKEY_PERFORMANCE_TEXT, names[i], NULL, NULL, NULL, &cbData);
|
||||
+todo_wine
|
||||
+ ok(dwret == ERROR_MORE_DATA, "%u/%s: got %u\n", i, names[i], dwret);
|
||||
+ ok(cbData == 0, "got %u\n", cbData);
|
||||
+
|
||||
+ cbData = 0;
|
||||
+ dwret = RegQueryValueExA(HKEY_PERFORMANCE_TEXT, names[i], NULL, NULL, NULL, &cbData);
|
||||
+todo_wine
|
||||
+ ok(dwret == ERROR_MORE_DATA, "%u/%s: got %u\n", i, names[i], dwret);
|
||||
+ ok(cbData == 0, "got %u\n", cbData);
|
||||
+
|
||||
+ cbData = 0xdeadbeef;
|
||||
+ dwret = RegQueryValueExA(HKEY_PERFORMANCE_NLSTEXT, names[i], NULL, NULL, NULL, &cbData);
|
||||
+todo_wine
|
||||
+ ok(dwret == ERROR_MORE_DATA, "%u/%s: got %u\n", i, names[i], dwret);
|
||||
+ ok(cbData == 0, "got %u\n", cbData);
|
||||
+
|
||||
+ cbData = 0;
|
||||
+ dwret = RegQueryValueExA(HKEY_PERFORMANCE_NLSTEXT, names[i], NULL, NULL, NULL, &cbData);
|
||||
+todo_wine
|
||||
+ ok(dwret == ERROR_MORE_DATA, "%u/%s: got %u\n", i, names[i], dwret);
|
||||
+ ok(cbData == 0, "got %u\n", cbData);
|
||||
+ }
|
||||
+
|
||||
+ memset(buf, 0x77, sizeof(buf));
|
||||
+ type = 0xdeadbeef;
|
||||
+ cbData = sizeof(buf);
|
||||
+ dwret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, "invalid counter name", NULL, &type, buf, &cbData);
|
||||
+todo_wine
|
||||
+ ok(dwret == ERROR_SUCCESS, "got %u\n", dwret);
|
||||
+todo_wine
|
||||
+ ok(type == REG_BINARY, "got %u\n", type);
|
||||
+ if (dwret == ERROR_SUCCESS)
|
||||
+ {
|
||||
+ SYSTEMTIME st;
|
||||
+ WCHAR sysname[MAX_COMPUTERNAME_LENGTH + 1];
|
||||
+ DWORD sysname_len;
|
||||
+ LARGE_INTEGER counter, freq, ftime;
|
||||
+
|
||||
+ GetSystemTime(&st);
|
||||
+ GetSystemTimeAsFileTime((FILETIME *)&ftime);
|
||||
+ QueryPerformanceCounter(&counter);
|
||||
+ QueryPerformanceFrequency(&freq);
|
||||
+
|
||||
+ sysname_len = MAX_COMPUTERNAME_LENGTH + 1;
|
||||
+ GetComputerNameW(sysname, &sysname_len);
|
||||
+
|
||||
+ pdb = (PERF_DATA_BLOCK *)buf;
|
||||
+ ok(pdb->Signature[0] == 'P', "got '%c'\n", pdb->Signature[0]);
|
||||
+ ok(pdb->Signature[1] == 'E', "got '%c'\n", pdb->Signature[1]);
|
||||
+ ok(pdb->Signature[2] == 'R', "got '%c'\n", pdb->Signature[2]);
|
||||
+ ok(pdb->Signature[3] == 'F', "got '%c'\n", pdb->Signature[3]);
|
||||
+
|
||||
+ ok(pdb->LittleEndian == 1, "got %u\n", pdb->LittleEndian);
|
||||
+ ok(pdb->Version == 1, "got %u\n", pdb->Version);
|
||||
+ ok(pdb->Revision == 1, "got %u\n", pdb->Revision);
|
||||
+ len = (sizeof(*pdb) + pdb->SystemNameLength + 7) & ~7;
|
||||
+ ok(pdb->TotalByteLength == len, "got %u vs %u\n", pdb->TotalByteLength, len);
|
||||
+ ok(pdb->HeaderLength == pdb->TotalByteLength, "got %u\n", pdb->HeaderLength);
|
||||
+ ok(pdb->NumObjectTypes == 0, "got %u\n", pdb->NumObjectTypes);
|
||||
+ ok(pdb->DefaultObject != 0, "got %u\n", pdb->DefaultObject);
|
||||
+ ok(pdb->SystemTime.wYear == st.wYear, "got %u\n", pdb->SystemTime.wYear);
|
||||
+ ok(pdb->SystemTime.wMonth == st.wMonth, "got %u\n", pdb->SystemTime.wMonth);
|
||||
+ ok(pdb->SystemTime.wDayOfWeek == st.wDayOfWeek, "got %u\n", pdb->SystemTime.wDayOfWeek);
|
||||
+ ok(pdb->SystemTime.wDay == st.wDay, "got %u\n", pdb->SystemTime.wDay);
|
||||
+ if (U(pdb->PerfTime).LowPart != 0x77777777) /* TestBot is broken */
|
||||
+ cmp_li(&pdb->PerfTime, &counter, freq.QuadPart);
|
||||
+ if (U(pdb->PerfFreq).LowPart != 0x77777777) /* TestBot is broken */
|
||||
+ cmp_li(&pdb->PerfFreq, &freq, 0);
|
||||
+ cmp_li(&pdb->PerfTime100nSec, &ftime, 200000); /* TestBot needs huge slack value */
|
||||
+ ok(pdb->SystemNameLength == (sysname_len + 1) * sizeof(WCHAR), "expected %u, got %u\n",
|
||||
+ (sysname_len + 1) * sizeof(WCHAR), pdb->SystemNameLength);
|
||||
+ ok(pdb->SystemNameOffset == sizeof(*pdb), "got %u\n", pdb->SystemNameOffset);
|
||||
+ ok(!lstrcmpW(sysname, (LPCWSTR)(pdb + 1)), "%s != %s\n",
|
||||
+ wine_dbgstr_w(sysname), wine_dbgstr_w((LPCWSTR)(pdb + 1)));
|
||||
+
|
||||
+ len = pdb->TotalByteLength - (sizeof(*pdb) + pdb->SystemNameLength);
|
||||
+ if (len)
|
||||
+ {
|
||||
+ BYTE remainder[8], *p;
|
||||
+
|
||||
+ memset(remainder, 0x77, sizeof(remainder));
|
||||
+ p = buf + sizeof(*pdb) + pdb->SystemNameLength;
|
||||
+ ok(!memcmp(p, remainder, len), "remainder: %02x,%02x...\n", p[0], p[1]);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ dwret = RegOpenKeyA(HKEY_PERFORMANCE_DATA, NULL, &hkey);
|
||||
+todo_wine
|
||||
+ ok(dwret == ERROR_INVALID_HANDLE, "got %u\n", dwret);
|
||||
+
|
||||
+ dwret = RegOpenKeyA(HKEY_PERFORMANCE_DATA, "Global", &hkey);
|
||||
+todo_wine
|
||||
+ ok(dwret == ERROR_INVALID_HANDLE, "got %u\n", dwret);
|
||||
+
|
||||
+ dwret = RegOpenKeyExA(HKEY_PERFORMANCE_DATA, "Global", 0, KEY_READ, &hkey);
|
||||
+todo_wine
|
||||
+ ok(dwret == ERROR_INVALID_HANDLE, "got %u\n", dwret);
|
||||
+
|
||||
+ dwret = RegQueryValueA(HKEY_PERFORMANCE_DATA, "Global", NULL, (LONG *)&cbData);
|
||||
+todo_wine
|
||||
+ ok(dwret == ERROR_INVALID_HANDLE, "got %u\n", dwret);
|
||||
+
|
||||
+ dwret = RegSetValueA(HKEY_PERFORMANCE_DATA, "Global", REG_SZ, "dummy", 4);
|
||||
+todo_wine
|
||||
+ ok(dwret == ERROR_INVALID_HANDLE, "got %u\n", dwret);
|
||||
+
|
||||
+ dwret = RegSetValueExA(HKEY_PERFORMANCE_DATA, "Global", 0, REG_SZ, (const BYTE *)"dummy", 40);
|
||||
+todo_wine
|
||||
+ ok(dwret == ERROR_INVALID_HANDLE, "got %u\n", dwret);
|
||||
+
|
||||
+ cbData = sizeof(buf);
|
||||
+ dwret = RegEnumKeyA(HKEY_PERFORMANCE_DATA, 0, (LPSTR)buf, cbData);
|
||||
+todo_wine
|
||||
+ ok(dwret == ERROR_INVALID_HANDLE, "got %u\n", dwret);
|
||||
+
|
||||
+ cbData = sizeof(buf);
|
||||
+ dwret = RegEnumValueA(HKEY_PERFORMANCE_DATA, 0, (LPSTR)buf, &cbData, NULL, NULL, NULL, NULL);
|
||||
+todo_wine
|
||||
+ ok(dwret == ERROR_MORE_DATA, "got %u\n", dwret);
|
||||
+todo_wine
|
||||
+ ok(cbData == sizeof(buf), "got %u\n", cbData);
|
||||
+
|
||||
+ dwret = RegEnumValueA(HKEY_PERFORMANCE_DATA, 0, NULL, &cbData, NULL, NULL, NULL, NULL);
|
||||
+ ok(dwret == ERROR_INVALID_PARAMETER, "got %u\n", dwret);
|
||||
+
|
||||
+ if (pRegSetKeyValueW)
|
||||
+ {
|
||||
+ dwret = pRegSetKeyValueW(HKEY_PERFORMANCE_DATA, NULL, globalW, REG_SZ, dummyW, sizeof(dummyW));
|
||||
+todo_wine
|
||||
+ ok(dwret == ERROR_INVALID_HANDLE, "got %u\n", dwret);
|
||||
+ }
|
||||
+
|
||||
+ dwret = RegCloseKey(HKEY_PERFORMANCE_DATA);
|
||||
+ ok(dwret == ERROR_SUCCESS, "got %u\n", dwret);
|
||||
+}
|
||||
|
||||
START_TEST(registry)
|
||||
{
|
||||
diff --git a/include/winreg.h b/include/winreg.h
|
||||
index 42b77251ae4..ddbd9293783 100644
|
||||
--- a/include/winreg.h
|
||||
+++ b/include/winreg.h
|
||||
@@ -32,6 +32,8 @@ extern "C" {
|
||||
#define HKEY_PERFORMANCE_DATA ((HKEY)(LONG_PTR)(LONG)0x80000004)
|
||||
#define HKEY_CURRENT_CONFIG ((HKEY)(LONG_PTR)(LONG)0x80000005)
|
||||
#define HKEY_DYN_DATA ((HKEY)(LONG_PTR)(LONG)0x80000006)
|
||||
+#define HKEY_PERFORMANCE_TEXT ((HKEY)(LONG_PTR)(LONG)0x80000050)
|
||||
+#define HKEY_PERFORMANCE_NLSTEXT ((HKEY)(LONG_PTR)(LONG)0x80000060)
|
||||
|
||||
/*
|
||||
* registry provider structs
|
||||
--
|
||||
2.13.1
|
||||
|
@@ -1,139 +0,0 @@
|
||||
From f72de28ee3a7a3cb25165f0aaee0c7e17eb7e6d7 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Wed, 12 Apr 2017 12:48:29 +0800
|
||||
Subject: include: Add more definitions for performance counters.
|
||||
|
||||
---
|
||||
include/winperf.h | 113 ++++++++++++++++++++++++++++++++++++++++++++++--------
|
||||
1 file changed, 97 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/include/winperf.h b/include/winperf.h
|
||||
index dce1a6d648d..113bfbae40f 100644
|
||||
--- a/include/winperf.h
|
||||
+++ b/include/winperf.h
|
||||
@@ -67,25 +67,106 @@
|
||||
#define PERF_DETAIL_EXPERT 300
|
||||
#define PERF_DETAIL_WIZARD 400
|
||||
|
||||
+#include <pshpack8.h>
|
||||
+
|
||||
/* Performance data structure header
|
||||
* returned in answer to HKEY_PERFORMANCE_DATA request
|
||||
*/
|
||||
|
||||
-typedef struct _PERF_DATA_BLOCK {
|
||||
- WCHAR Signature[4];
|
||||
- DWORD LittleEndian;
|
||||
- DWORD Version;
|
||||
- DWORD Revision;
|
||||
- DWORD TotalByteLength;
|
||||
- DWORD HeaderLength;
|
||||
- DWORD NumObjectTypes;
|
||||
- DWORD DefaultObject;
|
||||
- SYSTEMTIME SystemTime;
|
||||
- LARGE_INTEGER PerfTime;
|
||||
- LARGE_INTEGER PerfFreq;
|
||||
- LARGE_INTEGER PerfTime100nSec;
|
||||
- DWORD SystemNameLength;
|
||||
- DWORD SystemNameOffset;
|
||||
-} PERF_DATA_BLOCK, *PPERF_DATA_BLOCK, *LPPERF_DATA_BLOCK;
|
||||
+#define PERF_DATA_VERSION 1
|
||||
+#define PERF_DATA_REVISION 1
|
||||
+
|
||||
+typedef struct _PERF_DATA_BLOCK
|
||||
+{
|
||||
+ WCHAR Signature[4];
|
||||
+ DWORD LittleEndian;
|
||||
+ DWORD Version;
|
||||
+ DWORD Revision;
|
||||
+ DWORD TotalByteLength;
|
||||
+ DWORD HeaderLength;
|
||||
+ DWORD NumObjectTypes;
|
||||
+ DWORD DefaultObject;
|
||||
+ SYSTEMTIME SystemTime;
|
||||
+ LARGE_INTEGER PerfTime;
|
||||
+ LARGE_INTEGER PerfFreq;
|
||||
+ LARGE_INTEGER PerfTime100nSec;
|
||||
+ DWORD SystemNameLength;
|
||||
+ DWORD SystemNameOffset;
|
||||
+} PERF_DATA_BLOCK, *PPERF_DATA_BLOCK;
|
||||
+
|
||||
+#define PERF_NO_INSTANCES -1
|
||||
+
|
||||
+typedef struct _PERF_OBJECT_TYPE
|
||||
+{
|
||||
+ DWORD TotalByteLength;
|
||||
+ DWORD DefinitionLength;
|
||||
+ DWORD HeaderLength;
|
||||
+ DWORD ObjectNameTitleIndex;
|
||||
+#ifdef _WIN64
|
||||
+ DWORD ObjectNameTitle;
|
||||
+#else
|
||||
+ LPWSTR ObjectNameTitle;
|
||||
+#endif
|
||||
+ DWORD ObjectHelpTitleIndex;
|
||||
+#ifdef _WIN64
|
||||
+ DWORD ObjectHelpTitle;
|
||||
+#else
|
||||
+ LPWSTR ObjectHelpTitle;
|
||||
+#endif
|
||||
+ DWORD DetailLevel;
|
||||
+ DWORD NumCounters;
|
||||
+ LONG DefaultCounter;
|
||||
+ LONG NumInstances;
|
||||
+ DWORD CodePage;
|
||||
+ LARGE_INTEGER PerfTime;
|
||||
+ LARGE_INTEGER PerfFreq;
|
||||
+} PERF_OBJECT_TYPE, *PPERF_OBJECT_TYPE;
|
||||
+
|
||||
+typedef struct _PERF_COUNTER_DEFINITION
|
||||
+{
|
||||
+ DWORD ByteLength;
|
||||
+ DWORD CounterNameTitleIndex;
|
||||
+#ifdef _WIN64
|
||||
+ DWORD CounterNameTitle;
|
||||
+#else
|
||||
+ LPWSTR CounterNameTitle;
|
||||
+#endif
|
||||
+ DWORD CounterHelpTitleIndex;
|
||||
+#ifdef _WIN64
|
||||
+ DWORD CounterHelpTitle;
|
||||
+#else
|
||||
+ LPWSTR CounterHelpTitle;
|
||||
+#endif
|
||||
+ LONG DefaultScale;
|
||||
+ DWORD DetailLevel;
|
||||
+ DWORD CounterType;
|
||||
+ DWORD CounterSize;
|
||||
+ DWORD CounterOffset;
|
||||
+} PERF_COUNTER_DEFINITION, *PPERF_COUNTER_DEFINITION;
|
||||
+
|
||||
+#define PERF_NO_UNIQUE_ID -1
|
||||
+
|
||||
+typedef struct _PERF_INSTANCE_DEFINITION
|
||||
+{
|
||||
+ DWORD ByteLength;
|
||||
+ DWORD ParentObjectTitleIndex;
|
||||
+ DWORD ParentObjectInstance;
|
||||
+ LONG UniqueID;
|
||||
+ DWORD NameOffset;
|
||||
+ DWORD NameLength;
|
||||
+} PERF_INSTANCE_DEFINITION, *PPERF_INSTANCE_DEFINITION;
|
||||
+
|
||||
+typedef struct _PERF_COUNTER_BLOCK
|
||||
+{
|
||||
+ DWORD ByteLength;
|
||||
+} PERF_COUNTER_BLOCK, *PPERF_COUNTER_BLOCK;
|
||||
+
|
||||
+
|
||||
+#include <poppack.h>
|
||||
+
|
||||
+typedef DWORD (APIENTRY PM_OPEN_PROC)(LPWSTR);
|
||||
+typedef DWORD (APIENTRY PM_COLLECT_PROC)(LPWSTR,LPVOID *,LPDWORD,LPDWORD);
|
||||
+typedef DWORD (APIENTRY PM_CLOSE_PROC)(void);
|
||||
+typedef DWORD (APIENTRY PM_QUERY_PROC)(LPDWORD,LPVOID *,LPDWORD,LPDWORD);
|
||||
|
||||
#endif /* _WINPERF_ */
|
||||
--
|
||||
2.13.1
|
||||
|
@@ -1,380 +0,0 @@
|
||||
From 4fc763b4564cf0dc7e9e27826d785255133c8187 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Wed, 12 Apr 2017 13:59:20 +0800
|
||||
Subject: advapi32: Add initial support for querying performance counters data.
|
||||
(v2)
|
||||
|
||||
---
|
||||
dlls/advapi32/registry.c | 244 ++++++++++++++++++++++++++++++++++++++++-
|
||||
dlls/advapi32/tests/registry.c | 17 +--
|
||||
2 files changed, 249 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c
|
||||
index 7a26fffc55e..4dd29d3ba72 100644
|
||||
--- a/dlls/advapi32/registry.c
|
||||
+++ b/dlls/advapi32/registry.c
|
||||
@@ -2,6 +2,7 @@
|
||||
* Registry management
|
||||
*
|
||||
* Copyright (C) 1999 Alexandre Julliard
|
||||
+ * Copyright (C) 2017 Dmitry Timoshkov
|
||||
*
|
||||
* Based on misc/registry.c code
|
||||
* Copyright (C) 1996 Marcus Meissner
|
||||
@@ -36,6 +37,7 @@
|
||||
#include "winreg.h"
|
||||
#include "winerror.h"
|
||||
#include "winternl.h"
|
||||
+#include "winperf.h"
|
||||
#include "winuser.h"
|
||||
#include "sddl.h"
|
||||
#include "advapi32_misc.h"
|
||||
@@ -1482,6 +1484,234 @@ LONG WINAPI RegSetKeyValueA( HKEY hkey, LPCSTR subkey, LPCSTR name, DWORD type,
|
||||
return ret;
|
||||
}
|
||||
|
||||
+struct perf_provider
|
||||
+{
|
||||
+ HMODULE perflib;
|
||||
+ PM_OPEN_PROC *pOpen;
|
||||
+ PM_CLOSE_PROC *pClose;
|
||||
+ PM_COLLECT_PROC *pCollect;
|
||||
+};
|
||||
+
|
||||
+static void *get_provider_entry(HKEY perf, HMODULE perflib, const char *name)
|
||||
+{
|
||||
+ char buf[MAX_PATH];
|
||||
+ DWORD err, type, len;
|
||||
+
|
||||
+ len = sizeof(buf) - 1;
|
||||
+ err = RegQueryValueExA(perf, name, NULL, &type, (BYTE *)buf, &len);
|
||||
+ if (err != ERROR_SUCCESS || type != REG_SZ)
|
||||
+ return NULL;
|
||||
+
|
||||
+ buf[len] = 0;
|
||||
+ TRACE("Loading function pointer for %s: %s\n", name, debugstr_a(buf));
|
||||
+
|
||||
+ return GetProcAddress(perflib, buf);
|
||||
+}
|
||||
+
|
||||
+static BOOL load_provider(HKEY root, const WCHAR *name, struct perf_provider *provider)
|
||||
+{
|
||||
+ static const WCHAR performanceW[] = { 'P','e','r','f','o','r','m','a','n','c','e',0 };
|
||||
+ static const WCHAR libraryW[] = { 'L','i','b','r','a','r','y',0 };
|
||||
+ WCHAR buf[MAX_PATH], buf2[MAX_PATH];
|
||||
+ DWORD err, type, len;
|
||||
+ HKEY service, perf;
|
||||
+
|
||||
+ err = RegOpenKeyExW(root, name, 0, KEY_READ, &service);
|
||||
+ if (err != ERROR_SUCCESS)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ err = RegOpenKeyExW(service, performanceW, 0, KEY_READ, &perf);
|
||||
+ RegCloseKey(service);
|
||||
+ if (err != ERROR_SUCCESS)
|
||||
+ return FALSE;
|
||||
+
|
||||
+ len = sizeof(buf) - sizeof(WCHAR);
|
||||
+ err = RegQueryValueExW(perf, libraryW, NULL, &type, (BYTE *)buf, &len);
|
||||
+ if (err != ERROR_SUCCESS || !(type == REG_SZ || type == REG_EXPAND_SZ))
|
||||
+ goto error;
|
||||
+
|
||||
+ buf[len / sizeof(WCHAR)] = 0;
|
||||
+ if (type == REG_EXPAND_SZ)
|
||||
+ {
|
||||
+ len = ExpandEnvironmentStringsW(buf, buf2, MAX_PATH);
|
||||
+ if (!len || len > MAX_PATH) goto error;
|
||||
+ strcpyW(buf, buf2);
|
||||
+ }
|
||||
+
|
||||
+ if (!(provider->perflib = LoadLibraryW(buf)))
|
||||
+ {
|
||||
+ WARN("Failed to load %s\n", debugstr_w(buf));
|
||||
+ goto error;
|
||||
+ }
|
||||
+
|
||||
+ GetModuleFileNameW(provider->perflib, buf, MAX_PATH);
|
||||
+ TRACE("Loaded provider %s\n", wine_dbgstr_w(buf));
|
||||
+
|
||||
+ provider->pOpen = get_provider_entry(perf, provider->perflib, "Open");
|
||||
+ provider->pClose = get_provider_entry(perf, provider->perflib, "Close");
|
||||
+ provider->pCollect = get_provider_entry(perf, provider->perflib, "Collect");
|
||||
+ if (provider->pOpen && provider->pClose && provider->pCollect)
|
||||
+ {
|
||||
+ RegCloseKey(perf);
|
||||
+ return TRUE;
|
||||
+ }
|
||||
+
|
||||
+ TRACE("Provider is missing required exports\n");
|
||||
+ FreeLibrary(provider->perflib);
|
||||
+
|
||||
+error:
|
||||
+ RegCloseKey(perf);
|
||||
+ return FALSE;
|
||||
+}
|
||||
+
|
||||
+static DWORD collect_data(struct perf_provider *provider, const WCHAR *query, void **data, DWORD *size, DWORD *obj_count)
|
||||
+{
|
||||
+ DWORD err;
|
||||
+
|
||||
+ err = provider->pOpen(NULL);
|
||||
+ if (err != ERROR_SUCCESS)
|
||||
+ {
|
||||
+ TRACE("Open error %u (%#x)\n", err, err);
|
||||
+ return err;
|
||||
+ }
|
||||
+
|
||||
+ *obj_count = 0;
|
||||
+ err = provider->pCollect((WCHAR *)query, data, size, obj_count);
|
||||
+ if (err != ERROR_SUCCESS)
|
||||
+ {
|
||||
+ TRACE("Collect error %u (%#x)\n", err, err);
|
||||
+ *obj_count = 0;
|
||||
+ }
|
||||
+
|
||||
+ provider->pClose();
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
+#define MAX_SERVICE_NAME 260
|
||||
+
|
||||
+static DWORD query_perf_data(const WCHAR *query, DWORD *type, void *data, DWORD *ret_size)
|
||||
+{
|
||||
+ static const WCHAR SZ_SERVICES_KEY[] = { 'S','y','s','t','e','m','\\',
|
||||
+ 'C','u','r','r','e','n','t','C','o','n','t','r','o','l','S','e','t','\\',
|
||||
+ 'S','e','r','v','i','c','e','s',0 };
|
||||
+ DWORD err, i, data_size;
|
||||
+ HKEY root;
|
||||
+ PERF_DATA_BLOCK *pdb;
|
||||
+
|
||||
+ if (!ret_size)
|
||||
+ return ERROR_INVALID_PARAMETER;
|
||||
+
|
||||
+ data_size = *ret_size;
|
||||
+ *ret_size = 0;
|
||||
+
|
||||
+ if (type)
|
||||
+ *type = REG_BINARY;
|
||||
+
|
||||
+ if (!data || data_size < sizeof(*pdb))
|
||||
+ return ERROR_MORE_DATA;
|
||||
+
|
||||
+ pdb = data;
|
||||
+
|
||||
+ pdb->Signature[0] = 'P';
|
||||
+ pdb->Signature[1] = 'E';
|
||||
+ pdb->Signature[2] = 'R';
|
||||
+ pdb->Signature[3] = 'F';
|
||||
+#ifdef WORDS_BIGENDIAN
|
||||
+ pdb->LittleEndian = FALSE;
|
||||
+#else
|
||||
+ pdb->LittleEndian = TRUE;
|
||||
+#endif
|
||||
+ pdb->Version = PERF_DATA_VERSION;
|
||||
+ pdb->Revision = PERF_DATA_REVISION;
|
||||
+ pdb->TotalByteLength = 0;
|
||||
+ pdb->HeaderLength = sizeof(*pdb);
|
||||
+ pdb->NumObjectTypes = 0;
|
||||
+ pdb->DefaultObject = 0;
|
||||
+ QueryPerformanceCounter(&pdb->PerfTime);
|
||||
+ QueryPerformanceFrequency(&pdb->PerfFreq);
|
||||
+
|
||||
+ data = pdb + 1;
|
||||
+ pdb->SystemNameOffset = sizeof(*pdb);
|
||||
+ pdb->SystemNameLength = (data_size - sizeof(*pdb)) / sizeof(WCHAR);
|
||||
+ if (!GetComputerNameW(data, &pdb->SystemNameLength))
|
||||
+ return ERROR_MORE_DATA;
|
||||
+
|
||||
+ pdb->SystemNameLength++;
|
||||
+ pdb->SystemNameLength *= sizeof(WCHAR);
|
||||
+
|
||||
+ pdb->HeaderLength += pdb->SystemNameLength;
|
||||
+
|
||||
+ /* align to 8 bytes */
|
||||
+ if (pdb->SystemNameLength & 7)
|
||||
+ pdb->HeaderLength += 8 - (pdb->SystemNameLength & 7);
|
||||
+
|
||||
+ if (data_size < pdb->HeaderLength)
|
||||
+ return ERROR_MORE_DATA;
|
||||
+
|
||||
+ pdb->TotalByteLength = pdb->HeaderLength;
|
||||
+
|
||||
+ data_size -= pdb->HeaderLength;
|
||||
+ data = (char *)data + pdb->HeaderLength;
|
||||
+
|
||||
+ err = RegOpenKeyExW(HKEY_LOCAL_MACHINE, SZ_SERVICES_KEY, 0, KEY_READ, &root);
|
||||
+ if (err != ERROR_SUCCESS)
|
||||
+ return err;
|
||||
+
|
||||
+ i = 0;
|
||||
+ for (;;)
|
||||
+ {
|
||||
+ DWORD collected_size = data_size, obj_count = 0;
|
||||
+ struct perf_provider provider;
|
||||
+ WCHAR name[MAX_SERVICE_NAME];
|
||||
+ void *collected_data = data;
|
||||
+
|
||||
+ err = RegEnumKeyW(root, i++, name, MAX_SERVICE_NAME);
|
||||
+ if (err == ERROR_NO_MORE_ITEMS)
|
||||
+ {
|
||||
+ err = ERROR_SUCCESS;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ if (err != ERROR_SUCCESS)
|
||||
+ continue;
|
||||
+
|
||||
+ if (!load_provider(root, name, &provider))
|
||||
+ continue;
|
||||
+
|
||||
+ err = collect_data(&provider, query, &collected_data, &collected_size, &obj_count);
|
||||
+ FreeLibrary(provider.perflib);
|
||||
+
|
||||
+ if (err == ERROR_MORE_DATA)
|
||||
+ break;
|
||||
+
|
||||
+ if (err == ERROR_SUCCESS)
|
||||
+ {
|
||||
+ PERF_OBJECT_TYPE *obj = (PERF_OBJECT_TYPE *)data;
|
||||
+
|
||||
+ TRACE("Collect: obj->TotalByteLength %u, collected_size %u\n",
|
||||
+ obj->TotalByteLength, collected_size);
|
||||
+
|
||||
+ data_size -= collected_size;
|
||||
+ data = collected_data;
|
||||
+
|
||||
+ pdb->TotalByteLength += collected_size;
|
||||
+ pdb->NumObjectTypes += obj_count;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ RegCloseKey(root);
|
||||
+
|
||||
+ if (err == ERROR_SUCCESS)
|
||||
+ {
|
||||
+ *ret_size = pdb->TotalByteLength;
|
||||
+
|
||||
+ GetSystemTime(&pdb->SystemTime);
|
||||
+ GetSystemTimeAsFileTime((FILETIME *)&pdb->PerfTime100nSec);
|
||||
+ }
|
||||
+
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
/******************************************************************************
|
||||
* RegQueryValueExW [ADVAPI32.@]
|
||||
*
|
||||
@@ -1502,6 +1732,10 @@ LSTATUS WINAPI RegQueryValueExW( HKEY hkey, LPCWSTR name, LPDWORD reserved, LPDW
|
||||
(count && data) ? *count : 0 );
|
||||
|
||||
if ((data && !count) || reserved) return ERROR_INVALID_PARAMETER;
|
||||
+
|
||||
+ if (hkey == HKEY_PERFORMANCE_DATA)
|
||||
+ return query_perf_data(name, type, data, count);
|
||||
+
|
||||
if (!(hkey = get_special_root_hkey( hkey, 0 ))) return ERROR_INVALID_HANDLE;
|
||||
|
||||
RtlInitUnicodeString( &name_str, name );
|
||||
@@ -1592,7 +1826,8 @@ LSTATUS WINAPI DECLSPEC_HOTPATCH RegQueryValueExA( HKEY hkey, LPCSTR name, LPDWO
|
||||
hkey, debugstr_a(name), reserved, type, data, count, count ? *count : 0 );
|
||||
|
||||
if ((data && !count) || reserved) return ERROR_INVALID_PARAMETER;
|
||||
- if (!(hkey = get_special_root_hkey( hkey, 0 ))) return ERROR_INVALID_HANDLE;
|
||||
+ if (hkey != HKEY_PERFORMANCE_DATA && !(hkey = get_special_root_hkey( hkey, 0 )))
|
||||
+ return ERROR_INVALID_HANDLE;
|
||||
|
||||
if (count) datalen = *count;
|
||||
if (!data && count) *count = 0;
|
||||
@@ -1604,6 +1839,13 @@ LSTATUS WINAPI DECLSPEC_HOTPATCH RegQueryValueExA( HKEY hkey, LPCSTR name, LPDWO
|
||||
if ((status = RtlAnsiStringToUnicodeString( &nameW, &nameA, TRUE )))
|
||||
return RtlNtStatusToDosError(status);
|
||||
|
||||
+ if (hkey == HKEY_PERFORMANCE_DATA)
|
||||
+ {
|
||||
+ DWORD ret = query_perf_data( nameW.Buffer, type, data, count );
|
||||
+ RtlFreeUnicodeString( &nameW );
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
status = NtQueryValueKey( hkey, &nameW, KeyValuePartialInformation,
|
||||
buffer, sizeof(buffer), &total_size );
|
||||
if (status && status != STATUS_BUFFER_OVERFLOW) goto done;
|
||||
diff --git a/dlls/advapi32/tests/registry.c b/dlls/advapi32/tests/registry.c
|
||||
index 43599359ac6..9706478a135 100644
|
||||
--- a/dlls/advapi32/tests/registry.c
|
||||
+++ b/dlls/advapi32/tests/registry.c
|
||||
@@ -3520,10 +3520,10 @@ static void test_RegQueryValueExPerformanceData(void)
|
||||
|
||||
/* Test with data == NULL */
|
||||
dwret = RegQueryValueExA( HKEY_PERFORMANCE_DATA, "Global", NULL, NULL, NULL, &cbData );
|
||||
- todo_wine ok( dwret == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %d\n", dwret );
|
||||
+ ok( dwret == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %d\n", dwret );
|
||||
|
||||
dwret = RegQueryValueExW( HKEY_PERFORMANCE_DATA, globalW, NULL, NULL, NULL, &cbData );
|
||||
- todo_wine ok( dwret == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %d\n", dwret );
|
||||
+ ok( dwret == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %d\n", dwret );
|
||||
|
||||
/* Test ERROR_MORE_DATA, start with small buffer */
|
||||
len = 10;
|
||||
@@ -3531,8 +3531,7 @@ static void test_RegQueryValueExPerformanceData(void)
|
||||
cbData = len;
|
||||
type = 0xdeadbeef;
|
||||
dwret = RegQueryValueExA( HKEY_PERFORMANCE_DATA, "Global", NULL, &type, value, &cbData );
|
||||
- todo_wine ok( dwret == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %d\n", dwret );
|
||||
-todo_wine
|
||||
+ ok( dwret == ERROR_MORE_DATA, "expected ERROR_MORE_DATA, got %d\n", dwret );
|
||||
ok(type == REG_BINARY, "got %u\n", type);
|
||||
while( dwret == ERROR_MORE_DATA && limit)
|
||||
{
|
||||
@@ -3545,14 +3544,13 @@ todo_wine
|
||||
}
|
||||
ok(limit > 0, "too many times ERROR_MORE_DATA returned\n");
|
||||
|
||||
- todo_wine ok(dwret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", dwret);
|
||||
-todo_wine
|
||||
+ ok(dwret == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %d\n", dwret);
|
||||
ok(type == REG_BINARY, "got %u\n", type);
|
||||
|
||||
/* Check returned data */
|
||||
if (dwret == ERROR_SUCCESS)
|
||||
{
|
||||
- todo_wine ok(len >= sizeof(PERF_DATA_BLOCK), "got size %d\n", len);
|
||||
+ ok(len >= sizeof(PERF_DATA_BLOCK), "got size %d\n", len);
|
||||
if (len >= sizeof(PERF_DATA_BLOCK)) {
|
||||
pdb = (PERF_DATA_BLOCK*) value;
|
||||
ok(pdb->Signature[0] == 'P', "expected Signature[0] = 'P', got 0x%x\n", pdb->Signature[0]);
|
||||
@@ -3569,13 +3567,11 @@ todo_wine
|
||||
{
|
||||
cbData = 0xdeadbeef;
|
||||
dwret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, names[i], NULL, NULL, NULL, &cbData);
|
||||
-todo_wine
|
||||
ok(dwret == ERROR_MORE_DATA, "%u/%s: got %u\n", i, names[i], dwret);
|
||||
ok(cbData == 0, "got %u\n", cbData);
|
||||
|
||||
cbData = 0;
|
||||
dwret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, names[i], NULL, NULL, NULL, &cbData);
|
||||
-todo_wine
|
||||
ok(dwret == ERROR_MORE_DATA, "%u/%s: got %u\n", i, names[i], dwret);
|
||||
ok(cbData == 0, "got %u\n", cbData);
|
||||
|
||||
@@ -3608,9 +3604,7 @@ todo_wine
|
||||
type = 0xdeadbeef;
|
||||
cbData = sizeof(buf);
|
||||
dwret = RegQueryValueExA(HKEY_PERFORMANCE_DATA, "invalid counter name", NULL, &type, buf, &cbData);
|
||||
-todo_wine
|
||||
ok(dwret == ERROR_SUCCESS, "got %u\n", dwret);
|
||||
-todo_wine
|
||||
ok(type == REG_BINARY, "got %u\n", type);
|
||||
if (dwret == ERROR_SUCCESS)
|
||||
{
|
||||
@@ -3640,6 +3634,7 @@ todo_wine
|
||||
ok(pdb->TotalByteLength == len, "got %u vs %u\n", pdb->TotalByteLength, len);
|
||||
ok(pdb->HeaderLength == pdb->TotalByteLength, "got %u\n", pdb->HeaderLength);
|
||||
ok(pdb->NumObjectTypes == 0, "got %u\n", pdb->NumObjectTypes);
|
||||
+todo_wine
|
||||
ok(pdb->DefaultObject != 0, "got %u\n", pdb->DefaultObject);
|
||||
ok(pdb->SystemTime.wYear == st.wYear, "got %u\n", pdb->SystemTime.wYear);
|
||||
ok(pdb->SystemTime.wMonth == st.wMonth, "got %u\n", pdb->SystemTime.wMonth);
|
||||
--
|
||||
2.13.1
|
||||
|
@@ -1,93 +0,0 @@
|
||||
From efdcec40d501c6b27e3f3460ad0ad5fe26643e9d Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Wed, 12 Apr 2017 15:04:03 +0800
|
||||
Subject: winspool.drv: Add performance counters service stubs.
|
||||
|
||||
---
|
||||
dlls/winspool.drv/info.c | 29 +++++++++++++++++++++++++++++
|
||||
dlls/winspool.drv/winspool.drv.spec | 6 +++---
|
||||
loader/wine.inf.in | 7 +++++++
|
||||
3 files changed, 39 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/dlls/winspool.drv/info.c b/dlls/winspool.drv/info.c
|
||||
index f09745d1e6b..330ce236b45 100644
|
||||
--- a/dlls/winspool.drv/info.c
|
||||
+++ b/dlls/winspool.drv/info.c
|
||||
@@ -8681,3 +8681,32 @@ HRESULT WINAPI UploadPrinterDriverPackageW( LPCWSTR server, LPCWSTR path, LPCWST
|
||||
flags, hwnd, dst, dstlen);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
+
|
||||
+/*****************************************************************************
|
||||
+ * PerfOpen [WINSPOOL.@]
|
||||
+ */
|
||||
+DWORD WINAPI PerfOpen(LPWSTR context)
|
||||
+{
|
||||
+ FIXME("%s: stub\n", debugstr_w(context));
|
||||
+ return ERROR_SUCCESS;
|
||||
+}
|
||||
+
|
||||
+/*****************************************************************************
|
||||
+ * PerfClose [WINSPOOL.@]
|
||||
+ */
|
||||
+DWORD WINAPI PerfClose(void)
|
||||
+{
|
||||
+ FIXME("stub\n");
|
||||
+ return ERROR_SUCCESS;
|
||||
+}
|
||||
+
|
||||
+/*****************************************************************************
|
||||
+ * PerfCollect [WINSPOOL.@]
|
||||
+ */
|
||||
+DWORD WINAPI PerfCollect(LPWSTR query, LPVOID *data, LPDWORD size, LPDWORD obj_count)
|
||||
+{
|
||||
+ FIXME("%s,%p,%p,%p: stub\n", debugstr_w(query), data, size, obj_count);
|
||||
+ *size = 0;
|
||||
+ *obj_count = 0;
|
||||
+ return ERROR_SUCCESS;
|
||||
+}
|
||||
diff --git a/dlls/winspool.drv/winspool.drv.spec b/dlls/winspool.drv/winspool.drv.spec
|
||||
index 58dc60bcc9f..a23ea2ced99 100644
|
||||
--- a/dlls/winspool.drv/winspool.drv.spec
|
||||
+++ b/dlls/winspool.drv/winspool.drv.spec
|
||||
@@ -2,9 +2,9 @@
|
||||
101 stub -noname ClusterSplOpen
|
||||
102 stub -noname ClusterSplClose
|
||||
103 stub -noname ClusterSplIsAlive
|
||||
-104 stub PerfClose
|
||||
-105 stub PerfCollect
|
||||
-106 stub PerfOpen
|
||||
+104 stdcall PerfClose()
|
||||
+105 stdcall PerfCollect(wstr ptr ptr ptr)
|
||||
+106 stdcall PerfOpen(wstr)
|
||||
201 stdcall GetDefaultPrinterA(ptr ptr)
|
||||
202 stdcall SetDefaultPrinterA(str)
|
||||
203 stdcall GetDefaultPrinterW(ptr ptr)
|
||||
diff --git a/loader/wine.inf.in b/loader/wine.inf.in
|
||||
index 176647b8beb..a83cc209a96 100644
|
||||
--- a/loader/wine.inf.in
|
||||
+++ b/loader/wine.inf.in
|
||||
@@ -3353,6 +3353,7 @@ StartType=3
|
||||
ErrorControl=1
|
||||
|
||||
[SpoolerService]
|
||||
+AddReg=SpoolerServiceKeys
|
||||
Description="Loads files to memory for later printing"
|
||||
DisplayName="Print Spooler"
|
||||
ServiceBinary="%11%\spoolsv.exe"
|
||||
@@ -3361,6 +3362,12 @@ StartType=3
|
||||
ErrorControl=1
|
||||
LoadOrderGroup="SpoolerGroup"
|
||||
|
||||
+[SpoolerServiceKeys]
|
||||
+HKLM,"System\CurrentControlSet\Services\Spooler\Performance","Library",,"winspool.drv"
|
||||
+HKLM,"System\CurrentControlSet\Services\Spooler\Performance","Open",,"PerfOpen"
|
||||
+HKLM,"System\CurrentControlSet\Services\Spooler\Performance","Close",,"PerfClose"
|
||||
+HKLM,"System\CurrentControlSet\Services\Spooler\Performance","Collect",,"PerfCollect"
|
||||
+
|
||||
[TerminalServices]
|
||||
Description="Remote desktop access"
|
||||
DisplayName="Terminal Services"
|
||||
--
|
||||
2.13.1
|
||||
|
@@ -1,72 +0,0 @@
|
||||
From ea1f7f191b65313ed472e660a10d75e609a31dfc Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Fri, 14 Apr 2017 16:39:21 +0800
|
||||
Subject: advapi32: Performance providers' Open() expects to see the configured
|
||||
name as its parameter.
|
||||
|
||||
---
|
||||
dlls/advapi32/registry.c | 23 +++++++++++++++++++++--
|
||||
1 file changed, 21 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c
|
||||
index a6e5c7903cf..37462380c40 100644
|
||||
--- a/dlls/advapi32/registry.c
|
||||
+++ b/dlls/advapi32/registry.c
|
||||
@@ -1487,6 +1487,7 @@ LONG WINAPI RegSetKeyValueA( HKEY hkey, LPCSTR subkey, LPCSTR name, DWORD type,
|
||||
struct perf_provider
|
||||
{
|
||||
HMODULE perflib;
|
||||
+ WCHAR linkage[MAX_PATH];
|
||||
PM_OPEN_PROC *pOpen;
|
||||
PM_CLOSE_PROC *pClose;
|
||||
PM_COLLECT_PROC *pCollect;
|
||||
@@ -1512,6 +1513,8 @@ static BOOL load_provider(HKEY root, const WCHAR *name, struct perf_provider *pr
|
||||
{
|
||||
static const WCHAR performanceW[] = { 'P','e','r','f','o','r','m','a','n','c','e',0 };
|
||||
static const WCHAR libraryW[] = { 'L','i','b','r','a','r','y',0 };
|
||||
+ static const WCHAR linkageW[] = { 'L','i','n','k','a','g','e',0 };
|
||||
+ static const WCHAR exportW[] = { 'E','x','p','o','r','t',0 };
|
||||
WCHAR buf[MAX_PATH], buf2[MAX_PATH];
|
||||
DWORD err, type, len;
|
||||
HKEY service, perf;
|
||||
@@ -1520,6 +1523,21 @@ static BOOL load_provider(HKEY root, const WCHAR *name, struct perf_provider *pr
|
||||
if (err != ERROR_SUCCESS)
|
||||
return FALSE;
|
||||
|
||||
+ provider->linkage[0] = 0;
|
||||
+ err = RegOpenKeyExW(service, linkageW, 0, KEY_READ, &perf);
|
||||
+ if (err == ERROR_SUCCESS)
|
||||
+ {
|
||||
+ len = sizeof(buf) - sizeof(WCHAR);
|
||||
+ err = RegQueryValueExW(perf, exportW, NULL, &type, (BYTE *)buf, &len);
|
||||
+ if (err == ERROR_SUCCESS && (type == REG_SZ || type == REG_MULTI_SZ))
|
||||
+ {
|
||||
+ memcpy(provider->linkage, buf, len);
|
||||
+ provider->linkage[len / sizeof(WCHAR)] = 0;
|
||||
+ TRACE("Export: %s\n", debugstr_w(provider->linkage));
|
||||
+ }
|
||||
+ RegCloseKey(perf);
|
||||
+ }
|
||||
+
|
||||
err = RegOpenKeyExW(service, performanceW, 0, KEY_READ, &perf);
|
||||
RegCloseKey(service);
|
||||
if (err != ERROR_SUCCESS)
|
||||
@@ -1563,12 +1581,13 @@ error:
|
||||
|
||||
static DWORD collect_data(struct perf_provider *provider, const WCHAR *query, void **data, DWORD *size, DWORD *obj_count)
|
||||
{
|
||||
+ WCHAR *linkage = provider->linkage[0] ? provider->linkage : NULL;
|
||||
DWORD err;
|
||||
|
||||
- err = provider->pOpen(NULL);
|
||||
+ err = provider->pOpen(linkage);
|
||||
if (err != ERROR_SUCCESS)
|
||||
{
|
||||
- TRACE("Open error %u (%#x)\n", err, err);
|
||||
+ TRACE("Open(%s) error %u (%#x)\n", debugstr_w(linkage), err, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
--
|
||||
2.13.1
|
||||
|
@@ -1,31 +0,0 @@
|
||||
From f734e1d94b068a78cc10600c190bb2d527ab4866 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Fri, 14 Apr 2017 16:40:43 +0800
|
||||
Subject: advapi32: If the query is not specified the default query is
|
||||
"Global".
|
||||
|
||||
---
|
||||
dlls/advapi32/registry.c | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c
|
||||
index 37462380c40..0aa38c5b9b3 100644
|
||||
--- a/dlls/advapi32/registry.c
|
||||
+++ b/dlls/advapi32/registry.c
|
||||
@@ -1581,9 +1581,13 @@ error:
|
||||
|
||||
static DWORD collect_data(struct perf_provider *provider, const WCHAR *query, void **data, DWORD *size, DWORD *obj_count)
|
||||
{
|
||||
+ static const WCHAR globalW[] = { 'G','l','o','b','a','l',0 };
|
||||
WCHAR *linkage = provider->linkage[0] ? provider->linkage : NULL;
|
||||
DWORD err;
|
||||
|
||||
+ if (!query || !query[0])
|
||||
+ query = globalW;
|
||||
+
|
||||
err = provider->pOpen(linkage);
|
||||
if (err != ERROR_SUCCESS)
|
||||
{
|
||||
--
|
||||
2.13.1
|
||||
|
@@ -1,53 +0,0 @@
|
||||
From de80831314ecb76ac22b19b249467a600129a9e3 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Fri, 14 Apr 2017 16:43:31 +0800
|
||||
Subject: advapi32: Read the configured object list for the performance
|
||||
provider.
|
||||
|
||||
FIXME: it's not currently used, but the queries should be matched
|
||||
against the configured object lists, and the providers should be
|
||||
loaded and called only in case of a match.
|
||||
---
|
||||
dlls/advapi32/registry.c | 12 ++++++++++++
|
||||
1 file changed, 12 insertions(+)
|
||||
|
||||
diff --git a/dlls/advapi32/registry.c b/dlls/advapi32/registry.c
|
||||
index 0aa38c5b9b3..5af8128748b 100644
|
||||
--- a/dlls/advapi32/registry.c
|
||||
+++ b/dlls/advapi32/registry.c
|
||||
@@ -1488,6 +1488,7 @@ struct perf_provider
|
||||
{
|
||||
HMODULE perflib;
|
||||
WCHAR linkage[MAX_PATH];
|
||||
+ WCHAR objects[MAX_PATH];
|
||||
PM_OPEN_PROC *pOpen;
|
||||
PM_CLOSE_PROC *pClose;
|
||||
PM_COLLECT_PROC *pCollect;
|
||||
@@ -1511,6 +1512,7 @@ static void *get_provider_entry(HKEY perf, HMODULE perflib, const char *name)
|
||||
|
||||
static BOOL load_provider(HKEY root, const WCHAR *name, struct perf_provider *provider)
|
||||
{
|
||||
+ static const WCHAR object_listW[] = { 'O','b','j','e','c','t',' ','L','i','s','t',0 };
|
||||
static const WCHAR performanceW[] = { 'P','e','r','f','o','r','m','a','n','c','e',0 };
|
||||
static const WCHAR libraryW[] = { 'L','i','b','r','a','r','y',0 };
|
||||
static const WCHAR linkageW[] = { 'L','i','n','k','a','g','e',0 };
|
||||
@@ -1543,6 +1545,16 @@ static BOOL load_provider(HKEY root, const WCHAR *name, struct perf_provider *pr
|
||||
if (err != ERROR_SUCCESS)
|
||||
return FALSE;
|
||||
|
||||
+ provider->objects[0] = 0;
|
||||
+ len = sizeof(buf) - sizeof(WCHAR);
|
||||
+ err = RegQueryValueExW(perf, object_listW, NULL, &type, (BYTE *)buf, &len);
|
||||
+ if (err == ERROR_SUCCESS && (type == REG_SZ || type == REG_MULTI_SZ))
|
||||
+ {
|
||||
+ memcpy(provider->objects, buf, len);
|
||||
+ provider->objects[len / sizeof(WCHAR)] = 0;
|
||||
+ TRACE("Object List: %s\n", debugstr_w(provider->objects));
|
||||
+ }
|
||||
+
|
||||
len = sizeof(buf) - sizeof(WCHAR);
|
||||
err = RegQueryValueExW(perf, libraryW, NULL, &type, (BYTE *)buf, &len);
|
||||
if (err != ERROR_SUCCESS || !(type == REG_SZ || type == REG_EXPAND_SZ))
|
||||
--
|
||||
2.13.1
|
||||
|
@@ -1 +0,0 @@
|
||||
Fixes: [33037] Add support for querying performance counters data
|
@@ -1,7 +1,7 @@
|
||||
From 4b428e09733605affb987d369f56ec09d2525858 Mon Sep 17 00:00:00 2001
|
||||
From c8dc0ec6406e8449b59c219ede2e9bd88d8a56fa Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 5 Aug 2017 00:26:03 +0200
|
||||
Subject: server: Implement token elevation information.
|
||||
Subject: [PATCH] server: Implement token elevation information.
|
||||
|
||||
---
|
||||
dlls/ntdll/nt.c | 16 ++++++++++++----
|
||||
@@ -10,10 +10,10 @@ Subject: server: Implement token elevation information.
|
||||
3 files changed, 39 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
|
||||
index 5822dec9b15..dda6cabe1cf 100644
|
||||
index cd271fde9c..b1dd999cf5 100644
|
||||
--- a/dlls/ntdll/nt.c
|
||||
+++ b/dlls/ntdll/nt.c
|
||||
@@ -597,18 +597,26 @@ NTSTATUS WINAPI NtQueryInformationToken(
|
||||
@@ -625,18 +625,26 @@ NTSTATUS WINAPI NtQueryInformationToken(
|
||||
SERVER_END_REQ;
|
||||
break;
|
||||
case TokenElevationType:
|
||||
@@ -45,10 +45,10 @@ index 5822dec9b15..dda6cabe1cf 100644
|
||||
case TokenSessionId:
|
||||
{
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index b3dce66eb9c..33f1d5f0ab8 100644
|
||||
index 90af9df7f4..93afaabca1 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -3673,6 +3673,14 @@ struct handle_info
|
||||
@@ -3643,6 +3643,14 @@ struct handle_info
|
||||
@END
|
||||
|
||||
|
||||
@@ -64,10 +64,10 @@ index b3dce66eb9c..33f1d5f0ab8 100644
|
||||
@REQ(create_completion)
|
||||
unsigned int access; /* desired access to a port */
|
||||
diff --git a/server/token.c b/server/token.c
|
||||
index 7ab0f634c05..6a1085bae12 100644
|
||||
index 6d193603b4..64f20e1b57 100644
|
||||
--- a/server/token.c
|
||||
+++ b/server/token.c
|
||||
@@ -126,6 +126,7 @@ struct token
|
||||
@@ -112,6 +112,7 @@ struct token
|
||||
ACL *default_dacl; /* the default DACL to assign to objects created by this user */
|
||||
TOKEN_SOURCE source; /* source of the token */
|
||||
int impersonation_level; /* impersonation level this token is capable of if non-primary token */
|
||||
@@ -75,7 +75,7 @@ index 7ab0f634c05..6a1085bae12 100644
|
||||
};
|
||||
|
||||
struct privilege
|
||||
@@ -566,7 +567,7 @@ static struct token *create_token( unsigned primary, const SID *user,
|
||||
@@ -545,7 +546,7 @@ static struct token *create_token( unsigned primary, const SID *user,
|
||||
const LUID_AND_ATTRIBUTES *privs, unsigned int priv_count,
|
||||
const ACL *default_dacl, TOKEN_SOURCE source,
|
||||
const luid_t *modified_id,
|
||||
@@ -84,7 +84,7 @@ index 7ab0f634c05..6a1085bae12 100644
|
||||
{
|
||||
struct token *token = alloc_object( &token_ops );
|
||||
if (token)
|
||||
@@ -588,6 +589,7 @@ static struct token *create_token( unsigned primary, const SID *user,
|
||||
@@ -567,6 +568,7 @@ static struct token *create_token( unsigned primary, const SID *user,
|
||||
token->impersonation_level = impersonation_level;
|
||||
token->default_dacl = NULL;
|
||||
token->primary_group = NULL;
|
||||
@@ -92,7 +92,7 @@ index 7ab0f634c05..6a1085bae12 100644
|
||||
|
||||
/* copy user */
|
||||
token->user = memdup( user, security_sid_len( user ));
|
||||
@@ -700,7 +702,8 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
|
||||
@@ -682,7 +684,8 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
|
||||
token = create_token( primary, src_token->user, NULL, 0,
|
||||
NULL, 0, src_token->default_dacl,
|
||||
src_token->source, modified_id,
|
||||
@@ -102,16 +102,16 @@ index 7ab0f634c05..6a1085bae12 100644
|
||||
if (!token) return token;
|
||||
|
||||
/* copy groups */
|
||||
@@ -904,7 +907,7 @@ struct token *token_create_admin( void )
|
||||
@@ -888,7 +891,7 @@ struct token *token_create_admin( void )
|
||||
static const TOKEN_SOURCE admin_source = {"SeMgr", {0, 0}};
|
||||
token = create_token( TRUE, user_sid, admin_groups, sizeof(admin_groups)/sizeof(admin_groups[0]),
|
||||
admin_privs, sizeof(admin_privs)/sizeof(admin_privs[0]), default_dacl,
|
||||
token = create_token( TRUE, user_sid, admin_groups, ARRAY_SIZE( admin_groups ),
|
||||
admin_privs, ARRAY_SIZE( admin_privs ), default_dacl,
|
||||
- admin_source, NULL, -1 );
|
||||
+ admin_source, NULL, -1, TokenElevationTypeFull );
|
||||
/* we really need a primary group */
|
||||
assert( token->primary_group );
|
||||
}
|
||||
@@ -1652,6 +1655,19 @@ DECL_HANDLER(get_token_statistics)
|
||||
@@ -1627,6 +1630,19 @@ DECL_HANDLER(get_token_statistics)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,5 +132,5 @@ index 7ab0f634c05..6a1085bae12 100644
|
||||
{
|
||||
struct token *token;
|
||||
--
|
||||
2.13.1
|
||||
2.19.1
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 971789f2af6149998e54382522569b3790309cf2 Mon Sep 17 00:00:00 2001
|
||||
From 7d07ac217db0b5226fed0b7233fdb21ef70b0cc9 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:28:35 +0200
|
||||
Subject: [PATCH] server: Implement token integrity level.
|
||||
@@ -10,10 +10,10 @@ Subject: [PATCH] server: Implement token integrity level.
|
||||
3 files changed, 48 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
|
||||
index 9e60196..59c6e49 100644
|
||||
index b1dd999cf5..249b715da3 100644
|
||||
--- a/dlls/ntdll/nt.c
|
||||
+++ b/dlls/ntdll/nt.c
|
||||
@@ -340,7 +340,7 @@ NTSTATUS WINAPI NtQueryInformationToken(
|
||||
@@ -400,7 +400,7 @@ NTSTATUS WINAPI NtQueryInformationToken(
|
||||
0, /* TokenAccessInformation */
|
||||
0, /* TokenVirtualizationAllowed */
|
||||
0, /* TokenVirtualizationEnabled */
|
||||
@@ -22,7 +22,7 @@ index 9e60196..59c6e49 100644
|
||||
0, /* TokenUIAccess */
|
||||
0, /* TokenMandatoryPolicy */
|
||||
0, /* TokenLogonSid */
|
||||
@@ -593,18 +593,23 @@ NTSTATUS WINAPI NtQueryInformationToken(
|
||||
@@ -653,18 +653,23 @@ NTSTATUS WINAPI NtQueryInformationToken(
|
||||
}
|
||||
break;
|
||||
case TokenIntegrityLevel:
|
||||
@@ -55,10 +55,10 @@ index 9e60196..59c6e49 100644
|
||||
case TokenAppContainerSid:
|
||||
{
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index c961eaf..0bb04cd 100644
|
||||
index 93afaabca1..685f69f4e2 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -3388,6 +3388,13 @@ enum caret_state
|
||||
@@ -3405,6 +3405,13 @@ enum caret_state
|
||||
VARARG(sid,SID); /* the sid specified by which_sid from the token */
|
||||
@END
|
||||
|
||||
@@ -73,10 +73,10 @@ index c961eaf..0bb04cd 100644
|
||||
obj_handle_t handle; /* handle to the token */
|
||||
@REPLY
|
||||
diff --git a/server/token.c b/server/token.c
|
||||
index 355a523..1ed994a 100644
|
||||
index e97c460ae0..fb40c1b551 100644
|
||||
--- a/server/token.c
|
||||
+++ b/server/token.c
|
||||
@@ -112,6 +112,7 @@ struct token
|
||||
@@ -113,6 +113,7 @@ struct token
|
||||
TOKEN_SOURCE source; /* source of the token */
|
||||
int impersonation_level; /* impersonation level this token is capable of if non-primary token */
|
||||
TOKEN_ELEVATION_TYPE elevation; /* elevation level */
|
||||
@@ -84,7 +84,7 @@ index 355a523..1ed994a 100644
|
||||
};
|
||||
|
||||
struct privilege
|
||||
@@ -544,7 +545,8 @@ static struct token *create_token( unsigned primary, const SID *user,
|
||||
@@ -546,7 +547,8 @@ static struct token *create_token( unsigned primary, const SID *user,
|
||||
const LUID_AND_ATTRIBUTES *privs, unsigned int priv_count,
|
||||
const ACL *default_dacl, TOKEN_SOURCE source,
|
||||
const luid_t *modified_id,
|
||||
@@ -94,7 +94,7 @@ index 355a523..1ed994a 100644
|
||||
{
|
||||
struct token *token = alloc_object( &token_ops );
|
||||
if (token)
|
||||
@@ -625,6 +627,7 @@ static struct token *create_token( unsigned primary, const SID *user,
|
||||
@@ -630,6 +632,7 @@ static struct token *create_token( unsigned primary, const SID *user,
|
||||
}
|
||||
|
||||
token->source = source;
|
||||
@@ -102,7 +102,7 @@ index 355a523..1ed994a 100644
|
||||
}
|
||||
return token;
|
||||
}
|
||||
@@ -680,7 +683,8 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
|
||||
@@ -685,7 +688,8 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
|
||||
NULL, 0, src_token->default_dacl,
|
||||
src_token->source, modified_id,
|
||||
impersonation_level,
|
||||
@@ -112,16 +112,16 @@ index 355a523..1ed994a 100644
|
||||
if (!token) return token;
|
||||
|
||||
/* copy groups */
|
||||
@@ -884,7 +888,7 @@ struct token *token_create_admin( void )
|
||||
@@ -891,7 +895,7 @@ struct token *token_create_admin( void )
|
||||
static const TOKEN_SOURCE admin_source = {"SeMgr", {0, 0}};
|
||||
token = create_token( TRUE, user_sid, admin_groups, sizeof(admin_groups)/sizeof(admin_groups[0]),
|
||||
admin_privs, sizeof(admin_privs)/sizeof(admin_privs[0]), default_dacl,
|
||||
token = create_token( TRUE, user_sid, admin_groups, ARRAY_SIZE( admin_groups ),
|
||||
admin_privs, ARRAY_SIZE( admin_privs ), default_dacl,
|
||||
- admin_source, NULL, -1, TokenElevationTypeFull );
|
||||
+ admin_source, NULL, -1, TokenElevationTypeFull, &high_label_sid );
|
||||
/* we really need a primary group */
|
||||
assert( token->primary_group );
|
||||
}
|
||||
@@ -1530,6 +1534,26 @@ DECL_HANDLER(get_token_sid)
|
||||
@@ -1525,6 +1529,26 @@ DECL_HANDLER(get_token_sid)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,5 +149,5 @@ index 355a523..1ed994a 100644
|
||||
DECL_HANDLER(get_token_groups)
|
||||
{
|
||||
--
|
||||
1.9.1
|
||||
2.19.1
|
||||
|
||||
|
@@ -1,109 +0,0 @@
|
||||
From a7af0ee96959aab299e543e9d6938e2533780c47 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sat, 5 Aug 2017 04:02:16 +0200
|
||||
Subject: [PATCH] kernel32: Implement CreateProcessInternalW.
|
||||
|
||||
---
|
||||
dlls/kernel32/kernel32.spec | 2 +-
|
||||
dlls/kernel32/process.c | 24 ++++++++++++++----------
|
||||
dlls/kernelbase/kernelbase.spec | 2 +-
|
||||
include/winbase.h | 1 +
|
||||
4 files changed, 17 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/dlls/kernel32/kernel32.spec b/dlls/kernel32/kernel32.spec
|
||||
index e78c1ca..fde5f18 100644
|
||||
--- a/dlls/kernel32/kernel32.spec
|
||||
+++ b/dlls/kernel32/kernel32.spec
|
||||
@@ -315,7 +315,7 @@
|
||||
@ stdcall CreateProcessA(str str ptr ptr long long ptr str ptr ptr)
|
||||
# @ stub CreateProcessAsUserW
|
||||
# @ stub CreateProcessInternalA
|
||||
-# @ stub CreateProcessInternalW
|
||||
+@ stdcall CreateProcessInternalW(long wstr wstr ptr ptr long long ptr wstr ptr ptr ptr)
|
||||
# @ stub CreateProcessInternalWSecure
|
||||
@ stdcall CreateProcessW(wstr wstr ptr ptr long long ptr wstr ptr ptr)
|
||||
@ stdcall CreateRemoteThread(long ptr long ptr long long ptr)
|
||||
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
|
||||
index 2075dfd..f9606be 100644
|
||||
--- a/dlls/kernel32/process.c
|
||||
+++ b/dlls/kernel32/process.c
|
||||
@@ -2436,12 +2436,13 @@ static LPWSTR get_file_name( LPCWSTR appname, LPWSTR cmdline, LPWSTR buffer,
|
||||
return ret;
|
||||
}
|
||||
|
||||
-
|
||||
-/* Steam hotpatches CreateProcessA and W, so to prevent it from crashing use an internal function */
|
||||
-static BOOL create_process_impl( LPCWSTR app_name, LPWSTR cmd_line, LPSECURITY_ATTRIBUTES process_attr,
|
||||
- LPSECURITY_ATTRIBUTES thread_attr, BOOL inherit, DWORD flags,
|
||||
- LPVOID env, LPCWSTR cur_dir, LPSTARTUPINFOW startup_info,
|
||||
- LPPROCESS_INFORMATION info )
|
||||
+/**********************************************************************
|
||||
+ * CreateProcessInternalW (KERNEL32.@)
|
||||
+ */
|
||||
+BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_line, LPSECURITY_ATTRIBUTES process_attr,
|
||||
+ LPSECURITY_ATTRIBUTES thread_attr, BOOL inherit, DWORD flags,
|
||||
+ LPVOID env, LPCWSTR cur_dir, LPSTARTUPINFOW startup_info,
|
||||
+ LPPROCESS_INFORMATION info, HANDLE *new_token )
|
||||
{
|
||||
BOOL retv = FALSE;
|
||||
HANDLE hFile = 0;
|
||||
@@ -2454,6 +2455,9 @@ static BOOL create_process_impl( LPCWSTR app_name, LPWSTR cmd_line, LPSECURITY_A
|
||||
|
||||
TRACE("app %s cmdline %s\n", debugstr_w(app_name), debugstr_w(cmd_line) );
|
||||
|
||||
+ if (token) FIXME("Creating a process with a token is not yet implemented\n");
|
||||
+ if (new_token) FIXME("No support for returning created process token\n");
|
||||
+
|
||||
if (!(tidy_cmdline = get_file_name( app_name, cmd_line, name, sizeof(name)/sizeof(WCHAR),
|
||||
&hFile, &binary_info )))
|
||||
return FALSE;
|
||||
@@ -2605,8 +2609,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessA( LPCSTR app_name, LPSTR cmd_line, L
|
||||
FIXME("StartupInfo.lpReserved is used, please report (%s)\n",
|
||||
debugstr_a(startup_info->lpReserved));
|
||||
|
||||
- ret = create_process_impl( app_nameW, cmd_lineW, process_attr, thread_attr,
|
||||
- inherit, flags, env, cur_dirW, &infoW, info );
|
||||
+ ret = CreateProcessInternalW( NULL, app_nameW, cmd_lineW, process_attr, thread_attr,
|
||||
+ inherit, flags, env, cur_dirW, &infoW, info, NULL );
|
||||
done:
|
||||
HeapFree( GetProcessHeap(), 0, app_nameW );
|
||||
HeapFree( GetProcessHeap(), 0, cmd_lineW );
|
||||
@@ -2625,8 +2629,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessW( LPCWSTR app_name, LPWSTR cmd_line,
|
||||
LPVOID env, LPCWSTR cur_dir, LPSTARTUPINFOW startup_info,
|
||||
LPPROCESS_INFORMATION info )
|
||||
{
|
||||
- return create_process_impl( app_name, cmd_line, process_attr, thread_attr,
|
||||
- inherit, flags, env, cur_dir, startup_info, info);
|
||||
+ return CreateProcessInternalW( NULL, app_name, cmd_line, process_attr, thread_attr,
|
||||
+ inherit, flags, env, cur_dir, startup_info, info, NULL);
|
||||
}
|
||||
|
||||
|
||||
diff --git a/dlls/kernelbase/kernelbase.spec b/dlls/kernelbase/kernelbase.spec
|
||||
index 8cac67f..e8fd7aa 100644
|
||||
--- a/dlls/kernelbase/kernelbase.spec
|
||||
+++ b/dlls/kernelbase/kernelbase.spec
|
||||
@@ -209,7 +209,7 @@
|
||||
@ stdcall CreateProcessAsUserA(long str str ptr ptr long long ptr str ptr ptr) advapi32.CreateProcessAsUserA
|
||||
@ stdcall CreateProcessAsUserW(long wstr wstr ptr ptr long long ptr wstr ptr ptr) advapi32.CreateProcessAsUserW
|
||||
# @ stub CreateProcessInternalA
|
||||
-# @ stub CreateProcessInternalW
|
||||
+@ stdcall CreateProcessInternalW(long wstr wstr ptr ptr long long ptr wstr ptr ptr ptr) kernel32.CreateProcessInternalW
|
||||
@ stdcall CreateProcessW(wstr wstr ptr ptr long long ptr wstr ptr ptr) kernel32.CreateProcessW
|
||||
@ stdcall CreateRemoteThread(long ptr long ptr long long ptr) kernel32.CreateRemoteThread
|
||||
@ stdcall CreateRemoteThreadEx(long ptr long ptr ptr long ptr ptr) kernel32.CreateRemoteThreadEx
|
||||
diff --git a/include/winbase.h b/include/winbase.h
|
||||
index 4ddc1d3..e21cf6e 100644
|
||||
--- a/include/winbase.h
|
||||
+++ b/include/winbase.h
|
||||
@@ -1856,6 +1856,7 @@ WINBASEAPI BOOL WINAPI CreateProcessW(LPCWSTR,LPWSTR,LPSECURITY_ATTRIBUTE
|
||||
WINADVAPI BOOL WINAPI CreateProcessAsUserA(HANDLE,LPCSTR,LPSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,LPVOID,LPCSTR,LPSTARTUPINFOA,LPPROCESS_INFORMATION);
|
||||
WINADVAPI BOOL WINAPI CreateProcessAsUserW(HANDLE,LPCWSTR,LPWSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,LPVOID,LPCWSTR,LPSTARTUPINFOW,LPPROCESS_INFORMATION);
|
||||
#define CreateProcessAsUser WINELIB_NAME_AW(CreateProcessAsUser)
|
||||
+WINBASEAPI BOOL WINAPI CreateProcessInternalW(HANDLE,LPCWSTR,LPWSTR,LPSECURITY_ATTRIBUTES,LPSECURITY_ATTRIBUTES,BOOL,DWORD,LPVOID,LPCWSTR,LPSTARTUPINFOW,LPPROCESS_INFORMATION,HANDLE*);
|
||||
WINADVAPI BOOL WINAPI CreateProcessWithLogonW(LPCWSTR,LPCWSTR,LPCWSTR,DWORD,LPCWSTR,LPWSTR,DWORD,LPVOID,LPCWSTR,LPSTARTUPINFOW,LPPROCESS_INFORMATION);
|
||||
WINBASEAPI HANDLE WINAPI CreateRemoteThread(HANDLE,LPSECURITY_ATTRIBUTES,SIZE_T,LPTHREAD_START_ROUTINE,LPVOID,DWORD,LPDWORD);
|
||||
WINBASEAPI HANDLE WINAPI CreateRemoteThreadEx(HANDLE,LPSECURITY_ATTRIBUTES,SIZE_T,LPTHREAD_START_ROUTINE,LPVOID,DWORD,LPPROC_THREAD_ATTRIBUTE_LIST,LPDWORD);
|
||||
--
|
||||
1.9.1
|
||||
|
@@ -1,79 +1,80 @@
|
||||
From 23181e8cbe07ac0fd3b6effd04624122a6b0024f Mon Sep 17 00:00:00 2001
|
||||
From e571cdf9236e083f196c09d0fc96ed7c98fae440 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 6 Aug 2017 02:08:05 +0200
|
||||
Subject: [PATCH] server: Implement support for creating processes using a
|
||||
token.
|
||||
|
||||
---
|
||||
dlls/kernel32/process.c | 33 ++++++++++++++++++---------------
|
||||
server/process.c | 29 +++++++++++++++++++++++++----
|
||||
dlls/kernel32/process.c | 27 +++++++++++++++------------
|
||||
server/process.c | 39 +++++++++++++++++++++++++++++++++++----
|
||||
server/process.h | 2 +-
|
||||
server/protocol.def | 1 +
|
||||
server/request.c | 2 +-
|
||||
server/security.h | 2 ++
|
||||
server/token.c | 11 +++++++++++
|
||||
7 files changed, 59 insertions(+), 21 deletions(-)
|
||||
7 files changed, 66 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
|
||||
index f9606be..c0b89f9 100644
|
||||
index bb6cc3e..7b202db 100644
|
||||
--- a/dlls/kernel32/process.c
|
||||
+++ b/dlls/kernel32/process.c
|
||||
@@ -2034,7 +2034,7 @@ static NTSTATUS create_struct_sd(PSECURITY_DESCRIPTOR nt_sd, struct security_des
|
||||
@@ -2289,7 +2289,7 @@ static BOOL replace_process( HANDLE handle, const RTL_USER_PROCESS_PARAMETERS *p
|
||||
* Create a new process. If hFile is a valid handle we have an exe
|
||||
* file, otherwise it is a Winelib app.
|
||||
*/
|
||||
-static BOOL create_process( HANDLE hFile, LPCWSTR filename, LPWSTR cmd_line, LPWSTR env,
|
||||
+static BOOL create_process( HANDLE token, HANDLE hFile, LPCWSTR filename, LPWSTR cmd_line, LPWSTR env,
|
||||
LPCWSTR cur_dir, LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa,
|
||||
BOOL inherit, DWORD flags, LPSTARTUPINFOW startup,
|
||||
LPPROCESS_INFORMATION info, LPCSTR unixdir,
|
||||
@@ -2180,6 +2180,7 @@ static BOOL create_process( HANDLE hFile, LPCWSTR filename, LPWSTR cmd_line, LPW
|
||||
-static BOOL create_process( HANDLE hFile, LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa,
|
||||
+static BOOL create_process( HANDLE token, HANDLE hFile, LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa,
|
||||
BOOL inherit, DWORD flags, const RTL_USER_PROCESS_PARAMETERS *params,
|
||||
LPPROCESS_INFORMATION info, LPCSTR unixdir, const pe_image_info_t *pe_info )
|
||||
{
|
||||
@@ -2356,6 +2356,7 @@ static BOOL create_process( HANDLE hFile, LPSECURITY_ATTRIBUTES psa, LPSECURITY_
|
||||
req->access = PROCESS_ALL_ACCESS;
|
||||
req->cpu = pe_info->cpu;
|
||||
req->info_size = startup_info_size;
|
||||
req->env_size = (env_end - env) * sizeof(WCHAR);
|
||||
req->process_sd_size = process_sd_size;
|
||||
+ req->token = wine_server_obj_handle( token );
|
||||
|
||||
wine_server_add_data( req, objattr, attr_len );
|
||||
wine_server_add_data( req, startup_info, startup_info_size );
|
||||
wine_server_add_data( req, env, (env_end - env) * sizeof(WCHAR) );
|
||||
@@ -2280,7 +2281,7 @@ error:
|
||||
wine_server_add_data( req, params->Environment, (env_end - params->Environment) * sizeof(WCHAR) );
|
||||
@@ -2526,7 +2527,7 @@ static RTL_USER_PROCESS_PARAMETERS *get_vdm_params( const RTL_USER_PROCESS_PARAM
|
||||
*
|
||||
* Create a new VDM process for a 16-bit or DOS application.
|
||||
*/
|
||||
-static BOOL create_vdm_process( LPCWSTR filename, LPWSTR cmd_line, LPWSTR env, LPCWSTR cur_dir,
|
||||
+static BOOL create_vdm_process( HANDLE token, LPCWSTR filename, LPWSTR cmd_line, LPWSTR env, LPCWSTR cur_dir,
|
||||
LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa,
|
||||
BOOL inherit, DWORD flags, LPSTARTUPINFOW startup,
|
||||
LPPROCESS_INFORMATION info, LPCSTR unixdir,
|
||||
@@ -2304,7 +2305,7 @@ static BOOL create_vdm_process( LPCWSTR filename, LPWSTR cmd_line, LPWSTR env, L
|
||||
return FALSE;
|
||||
}
|
||||
sprintfW(new_cmd_line, argsW, winevdmW, buffer, cmd_line);
|
||||
- ret = create_process( 0, winevdmW, new_cmd_line, env, cur_dir, psa, tsa, inherit,
|
||||
+ ret = create_process( token, 0, winevdmW, new_cmd_line, env, cur_dir, psa, tsa, inherit,
|
||||
flags, startup, info, unixdir, binary_info, exec_only );
|
||||
HeapFree( GetProcessHeap(), 0, new_cmd_line );
|
||||
-static BOOL create_vdm_process( LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa,
|
||||
+static BOOL create_vdm_process( HANDLE token, LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa,
|
||||
BOOL inherit, DWORD flags, const RTL_USER_PROCESS_PARAMETERS *params,
|
||||
LPPROCESS_INFORMATION info, LPCSTR unixdir )
|
||||
{
|
||||
@@ -2536,7 +2537,7 @@ static BOOL create_vdm_process( LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES
|
||||
|
||||
if (!(new_params = get_vdm_params( params, &pe_info ))) return FALSE;
|
||||
|
||||
- ret = create_process( 0, psa, tsa, inherit, flags, new_params, info, unixdir, &pe_info );
|
||||
+ ret = create_process( token, 0, psa, tsa, inherit, flags, new_params, info, unixdir, &pe_info );
|
||||
RtlDestroyProcessParameters( new_params );
|
||||
return ret;
|
||||
@@ -2316,7 +2317,7 @@ static BOOL create_vdm_process( LPCWSTR filename, LPWSTR cmd_line, LPWSTR env, L
|
||||
}
|
||||
@@ -2547,7 +2548,7 @@ static BOOL create_vdm_process( LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES
|
||||
*
|
||||
* Create a new cmd shell process for a .BAT file.
|
||||
*/
|
||||
-static BOOL create_cmd_process( LPCWSTR filename, LPWSTR cmd_line, LPVOID env, LPCWSTR cur_dir,
|
||||
+static BOOL create_cmd_process( HANDLE token, LPCWSTR filename, LPWSTR cmd_line, LPVOID env, LPCWSTR cur_dir,
|
||||
LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa,
|
||||
-static BOOL create_cmd_process( LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa,
|
||||
+static BOOL create_cmd_process( HANDLE token, LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES tsa,
|
||||
BOOL inherit, DWORD flags, LPSTARTUPINFOW startup,
|
||||
const RTL_USER_PROCESS_PARAMETERS *params,
|
||||
LPPROCESS_INFORMATION info )
|
||||
@@ -2344,8 +2345,8 @@ static BOOL create_cmd_process( LPCWSTR filename, LPWSTR cmd_line, LPVOID env, L
|
||||
strcatW( newcmdline, quotW );
|
||||
strcatW( newcmdline, cmd_line );
|
||||
@@ -2577,9 +2578,9 @@ static BOOL create_cmd_process( LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES
|
||||
strcatW( newcmdline, params->CommandLine.Buffer );
|
||||
strcatW( newcmdline, quotW );
|
||||
if (params->CurrentDirectory.DosPath.Length) cur_dir = params->CurrentDirectory.DosPath.Buffer;
|
||||
- ret = CreateProcessW( comspec, newcmdline, psa, tsa, inherit,
|
||||
- flags, env, cur_dir, startup, info );
|
||||
+ ret = CreateProcessInternalW( token, comspec, newcmdline, psa, tsa, inherit,
|
||||
+ flags, env, cur_dir, startup, info, NULL );
|
||||
flags | CREATE_UNICODE_ENVIRONMENT, params->Environment, cur_dir,
|
||||
- startup, info );
|
||||
+ startup, info, NULL );
|
||||
HeapFree( GetProcessHeap(), 0, newcmdline );
|
||||
return ret;
|
||||
}
|
||||
@@ -2455,7 +2456,9 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l
|
||||
@@ -2692,7 +2693,9 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l
|
||||
|
||||
TRACE("app %s cmdline %s\n", debugstr_w(app_name), debugstr_w(cmd_line) );
|
||||
|
||||
@@ -83,87 +84,59 @@ index f9606be..c0b89f9 100644
|
||||
+
|
||||
if (new_token) FIXME("No support for returning created process token\n");
|
||||
|
||||
if (!(tidy_cmdline = get_file_name( app_name, cmd_line, name, sizeof(name)/sizeof(WCHAR),
|
||||
@@ -2513,20 +2516,20 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l
|
||||
debugstr_w(name), (binary_info.flags & BINARY_FLAG_64BIT) ? 64 : 32,
|
||||
wine_dbgstr_longlong(binary_info.res_start), wine_dbgstr_longlong(binary_info.res_end),
|
||||
binary_info.arch, (binary_info.flags & BINARY_FLAG_FAKEDLL) ? ", fakedll" : "" );
|
||||
- retv = create_process( hFile, name, tidy_cmdline, envW, cur_dir, process_attr, thread_attr,
|
||||
+ retv = create_process( token, hFile, name, tidy_cmdline, envW, cur_dir, process_attr, thread_attr,
|
||||
inherit, flags, startup_info, info, unixdir, &binary_info, FALSE );
|
||||
if (!(tidy_cmdline = get_file_name( app_name, cmd_line, name, ARRAY_SIZE( name ), &hFile, &is_64bit )))
|
||||
@@ -2760,17 +2763,17 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l
|
||||
debugstr_w(name), is_64bit_arch(pe_info.cpu) ? 64 : 32,
|
||||
wine_dbgstr_longlong(pe_info.base), wine_dbgstr_longlong(pe_info.base + pe_info.map_size),
|
||||
cpu_names[pe_info.cpu] );
|
||||
- retv = create_process( hFile, process_attr, thread_attr,
|
||||
+ retv = create_process( token, hFile, process_attr, thread_attr,
|
||||
inherit, flags, params, info, unixdir, &pe_info );
|
||||
break;
|
||||
case BINARY_OS216:
|
||||
case BINARY_WIN16:
|
||||
case BINARY_DOS:
|
||||
TRACE( "starting %s as Win16/DOS binary\n", debugstr_w(name) );
|
||||
- retv = create_vdm_process( name, tidy_cmdline, envW, cur_dir, process_attr, thread_attr,
|
||||
+ retv = create_vdm_process( token, name, tidy_cmdline, envW, cur_dir, process_attr, thread_attr,
|
||||
inherit, flags, startup_info, info, unixdir, &binary_info, FALSE );
|
||||
- retv = create_vdm_process( process_attr, thread_attr, inherit, flags, params, info, unixdir );
|
||||
+ retv = create_vdm_process( token, process_attr, thread_attr, inherit, flags, params, info, unixdir );
|
||||
break;
|
||||
case BINARY_UNIX_LIB:
|
||||
TRACE( "starting %s as %d-bit Winelib app\n",
|
||||
debugstr_w(name), (binary_info.flags & BINARY_FLAG_64BIT) ? 64 : 32 );
|
||||
- retv = create_process( hFile, name, tidy_cmdline, envW, cur_dir, process_attr, thread_attr,
|
||||
+ retv = create_process( token, hFile, name, tidy_cmdline, envW, cur_dir, process_attr, thread_attr,
|
||||
inherit, flags, startup_info, info, unixdir, &binary_info, FALSE );
|
||||
debugstr_w(name), is_64bit_arch(pe_info.cpu) ? 64 : 32 );
|
||||
- retv = create_process( hFile, process_attr, thread_attr,
|
||||
+ retv = create_process( token, hFile, process_attr, thread_attr,
|
||||
inherit, flags, params, info, unixdir, &pe_info );
|
||||
break;
|
||||
case BINARY_UNKNOWN:
|
||||
@@ -2538,7 +2541,7 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l
|
||||
@@ -2780,14 +2783,14 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l
|
||||
if (!strcmpiW( p, comW ) || !strcmpiW( p, pifW ))
|
||||
{
|
||||
TRACE( "starting %s as DOS binary\n", debugstr_w(name) );
|
||||
binary_info.type = BINARY_DOS;
|
||||
binary_info.arch = IMAGE_FILE_MACHINE_I386;
|
||||
- retv = create_vdm_process( name, tidy_cmdline, envW, cur_dir, process_attr, thread_attr,
|
||||
+ retv = create_vdm_process( token, name, tidy_cmdline, envW, cur_dir, process_attr, thread_attr,
|
||||
inherit, flags, startup_info, info, unixdir,
|
||||
&binary_info, FALSE );
|
||||
- retv = create_vdm_process( process_attr, thread_attr,
|
||||
+ retv = create_vdm_process( token, process_attr, thread_attr,
|
||||
inherit, flags, params, info, unixdir );
|
||||
break;
|
||||
@@ -2546,7 +2549,7 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l
|
||||
}
|
||||
if (!strcmpiW( p, batW ) || !strcmpiW( p, cmdW ) )
|
||||
{
|
||||
TRACE( "starting %s as batch binary\n", debugstr_w(name) );
|
||||
- retv = create_cmd_process( name, tidy_cmdline, envW, cur_dir, process_attr, thread_attr,
|
||||
+ retv = create_cmd_process( token, name, tidy_cmdline, envW, cur_dir, process_attr, thread_attr,
|
||||
inherit, flags, startup_info, info );
|
||||
- retv = create_cmd_process( process_attr, thread_attr,
|
||||
+ retv = create_cmd_process( token, process_attr, thread_attr,
|
||||
inherit, flags, startup_info, params, info );
|
||||
break;
|
||||
}
|
||||
@@ -2666,12 +2669,12 @@ static void exec_process( LPCWSTR name )
|
||||
debugstr_w(name), (binary_info.flags & BINARY_FLAG_64BIT) ? 64 : 32,
|
||||
wine_dbgstr_longlong(binary_info.res_start), wine_dbgstr_longlong(binary_info.res_end),
|
||||
binary_info.arch );
|
||||
- create_process( hFile, name, GetCommandLineW(), NULL, NULL, NULL, NULL,
|
||||
+ create_process( NULL, hFile, name, GetCommandLineW(), NULL, NULL, NULL, NULL,
|
||||
FALSE, 0, &startup_info, &info, NULL, &binary_info, TRUE );
|
||||
break;
|
||||
case BINARY_UNIX_LIB:
|
||||
TRACE( "%s is a Unix library, starting as Winelib app\n", debugstr_w(name) );
|
||||
- create_process( hFile, name, GetCommandLineW(), NULL, NULL, NULL, NULL,
|
||||
+ create_process( NULL, hFile, name, GetCommandLineW(), NULL, NULL, NULL, NULL,
|
||||
FALSE, 0, &startup_info, &info, NULL, &binary_info, TRUE );
|
||||
break;
|
||||
case BINARY_UNKNOWN:
|
||||
@@ -2685,7 +2688,7 @@ static void exec_process( LPCWSTR name )
|
||||
case BINARY_WIN16:
|
||||
case BINARY_DOS:
|
||||
TRACE( "starting %s as Win16/DOS binary\n", debugstr_w(name) );
|
||||
- create_vdm_process( name, GetCommandLineW(), NULL, NULL, NULL, NULL,
|
||||
+ create_vdm_process( NULL, name, GetCommandLineW(), NULL, NULL, NULL, NULL,
|
||||
FALSE, 0, &startup_info, &info, NULL, &binary_info, TRUE );
|
||||
break;
|
||||
default:
|
||||
diff --git a/server/process.c b/server/process.c
|
||||
index 81cea2f..7d2206f 100644
|
||||
index af2ba3d..57bf0ec 100644
|
||||
--- a/server/process.c
|
||||
+++ b/server/process.c
|
||||
@@ -496,7 +496,7 @@ static void start_sigkill_timer( struct process *process )
|
||||
|
||||
/* create a new process and its main thread */
|
||||
@@ -486,7 +486,7 @@ static void start_sigkill_timer( struct process *process )
|
||||
/* create a new process */
|
||||
/* if the function fails the fd is closed */
|
||||
-struct thread *create_process( int fd, struct thread *parent_thread, int inherit_all )
|
||||
+struct thread *create_process( int fd, struct thread *parent_thread, int inherit_all, struct token *token )
|
||||
struct process *create_process( int fd, struct process *parent, int inherit_all,
|
||||
- const struct security_descriptor *sd )
|
||||
+ const struct security_descriptor *sd, struct token *token )
|
||||
{
|
||||
struct process *process;
|
||||
struct thread *thread = NULL;
|
||||
@@ -567,7 +567,7 @@ struct thread *create_process( int fd, struct thread *parent_thread, int inherit
|
||||
|
||||
@@ -561,7 +561,7 @@ struct process *create_process( int fd, struct process *parent, int inherit_all,
|
||||
: alloc_handle_table( process, 0 );
|
||||
/* Note: for security reasons, starting a new process does not attempt
|
||||
* to use the current impersonation token for the new process */
|
||||
@@ -172,15 +145,15 @@ index 81cea2f..7d2206f 100644
|
||||
process->affinity = parent->affinity;
|
||||
}
|
||||
if (!process->handles || !process->token) goto error;
|
||||
@@ -1147,6 +1147,7 @@ DECL_HANDLER(new_process)
|
||||
struct startup_info *info;
|
||||
struct thread *thread;
|
||||
struct process *process;
|
||||
@@ -1127,6 +1127,7 @@ DECL_HANDLER(new_process)
|
||||
const struct security_descriptor *sd;
|
||||
const struct object_attributes *objattr = get_req_object_attributes( &sd, &name, NULL );
|
||||
struct process *process = NULL;
|
||||
+ struct token *token = NULL;
|
||||
struct process *parent = current->process;
|
||||
int socket_fd = thread_get_inflight_fd( current, req->socket_fd );
|
||||
const struct security_descriptor *process_sd = NULL, *thread_sd = NULL;
|
||||
@@ -1182,9 +1183,27 @@ DECL_HANDLER(new_process)
|
||||
|
||||
@@ -1167,10 +1168,39 @@ DECL_HANDLER(new_process)
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -201,77 +174,89 @@ index 81cea2f..7d2206f 100644
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
if (!req->info_size) /* create an orphaned process */
|
||||
{
|
||||
- create_process( socket_fd, NULL, 0 );
|
||||
+ create_process( socket_fd, NULL, 0, token );
|
||||
+ if (!req->info_size) /* create an orphaned process */
|
||||
+ {
|
||||
+ if ((process = create_process( socket_fd, NULL, 0, sd, token )))
|
||||
+ {
|
||||
+ create_thread( -1, process, NULL );
|
||||
+ release_object( process );
|
||||
+ }
|
||||
+ if (token) release_object( token );
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1192,6 +1211,7 @@ DECL_HANDLER(new_process)
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
/* build the startup info for a new process */
|
||||
if (!(info = alloc_object( &startup_info_ops )))
|
||||
{
|
||||
close( socket_fd );
|
||||
+ if (token) release_object( token );
|
||||
return;
|
||||
}
|
||||
info->exe_file = NULL;
|
||||
@@ -1274,7 +1294,7 @@ DECL_HANDLER(new_process)
|
||||
}
|
||||
info->process = NULL;
|
||||
@@ -1217,7 +1247,7 @@ DECL_HANDLER(new_process)
|
||||
#undef FIXUP_LEN
|
||||
}
|
||||
|
||||
- if (!(thread = create_process( socket_fd, current, req->inherit_all ))) goto done;
|
||||
+ if (!(thread = create_process( socket_fd, current, req->inherit_all, token ))) goto done;
|
||||
process = thread->process;
|
||||
- if (!(process = create_process( socket_fd, parent, req->inherit_all, sd ))) goto done;
|
||||
+ if (!(process = create_process( socket_fd, parent, req->inherit_all, sd, token ))) goto done;
|
||||
|
||||
process->startup_info = (struct startup_info *)grab_object( info );
|
||||
|
||||
@@ -1356,6 +1376,7 @@ DECL_HANDLER(new_process)
|
||||
}
|
||||
@@ -1279,6 +1309,7 @@ DECL_HANDLER(new_process)
|
||||
reply->handle = alloc_handle_no_access_check( parent, process, req->access, objattr->attributes );
|
||||
|
||||
done:
|
||||
+ if (token) release_object( token );
|
||||
if (process) release_object( process );
|
||||
release_object( info );
|
||||
}
|
||||
|
||||
@@ -1311,7 +1342,7 @@ DECL_HANDLER(exec_process)
|
||||
close( socket_fd );
|
||||
return;
|
||||
}
|
||||
- if (!(process = create_process( socket_fd, NULL, 0, NULL ))) return;
|
||||
+ if (!(process = create_process( socket_fd, NULL, 0, NULL, NULL ))) return;
|
||||
create_thread( -1, process, NULL );
|
||||
release_object( process );
|
||||
}
|
||||
diff --git a/server/process.h b/server/process.h
|
||||
index 78e88ec..313c36a 100644
|
||||
index 029b328..ea28091 100644
|
||||
--- a/server/process.h
|
||||
+++ b/server/process.h
|
||||
@@ -114,7 +114,7 @@ struct process_snapshot
|
||||
extern unsigned int alloc_ptid( void *ptr );
|
||||
@@ -116,7 +116,7 @@ extern unsigned int alloc_ptid( void *ptr );
|
||||
extern void free_ptid( unsigned int id );
|
||||
extern void *get_ptid_entry( unsigned int id );
|
||||
-extern struct thread *create_process( int fd, struct thread *parent_thread, int inherit_all );
|
||||
+extern struct thread *create_process( int fd, struct thread *parent_thread, int inherit_all, struct token *token );
|
||||
extern struct process *create_process( int fd, struct process *parent, int inherit_all,
|
||||
- const struct security_descriptor *sd );
|
||||
+ const struct security_descriptor *sd, struct token *token );
|
||||
extern data_size_t init_process( struct thread *thread );
|
||||
extern struct thread *get_process_first_thread( struct process *process );
|
||||
extern struct process *get_process_from_id( process_id_t id );
|
||||
diff --git a/server/protocol.def b/server/protocol.def
|
||||
index 5fb6e38..f0bc83b 100644
|
||||
index 607644e..1b5e6de 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -748,6 +748,7 @@ struct rawinput_device
|
||||
@@ -744,6 +744,7 @@ struct rawinput_device
|
||||
unsigned int access; /* access rights for process object */
|
||||
cpu_type_t cpu; /* CPU that the new process will use */
|
||||
data_size_t info_size; /* size of startup info */
|
||||
data_size_t env_size; /* size of the environment */
|
||||
data_size_t process_sd_size;/* size of the process security descriptor */
|
||||
+ obj_handle_t token; /* token for the new process */
|
||||
VARARG(objattr,object_attributes); /* object attributes */
|
||||
VARARG(info,startup_info,info_size); /* startup information */
|
||||
VARARG(env,unicode_str,env_size); /* environment for new process */
|
||||
VARARG(process_sd,security_descriptor,process_sd_size); /* security descriptor to set on the process */
|
||||
VARARG(env,unicode_str); /* environment for new process */
|
||||
diff --git a/server/request.c b/server/request.c
|
||||
index 6120bc5..a648c30 100644
|
||||
index c10c4e6..86f293f 100644
|
||||
--- a/server/request.c
|
||||
+++ b/server/request.c
|
||||
@@ -570,7 +570,7 @@ static void master_socket_poll_event( struct fd *fd, int event )
|
||||
@@ -577,7 +577,7 @@ static void master_socket_poll_event( struct fd *fd, int event )
|
||||
int client = accept( get_unix_fd( master_socket->fd ), (struct sockaddr *) &dummy, &len );
|
||||
if (client == -1) return;
|
||||
fcntl( client, F_SETFL, O_NONBLOCK );
|
||||
- create_process( client, NULL, 0 );
|
||||
+ create_process( client, NULL, 0, NULL );
|
||||
}
|
||||
}
|
||||
|
||||
- if ((process = create_process( client, NULL, 0, NULL )))
|
||||
+ if ((process = create_process( client, NULL, 0, NULL, NULL )))
|
||||
{
|
||||
create_thread( -1, process, NULL );
|
||||
release_object( process );
|
||||
diff --git a/server/security.h b/server/security.h
|
||||
index 21e90cc..32dfe5f 100644
|
||||
--- a/server/security.h
|
||||
@@ -286,7 +271,7 @@ index 21e90cc..32dfe5f 100644
|
||||
static inline const ACE_HEADER *ace_next( const ACE_HEADER *ace )
|
||||
{
|
||||
diff --git a/server/token.c b/server/token.c
|
||||
index de1d624..2804247 100644
|
||||
index 1184241..5db97b4 100644
|
||||
--- a/server/token.c
|
||||
+++ b/server/token.c
|
||||
@@ -836,6 +836,12 @@ int token_assign_label( struct token *token, PSID label )
|
||||
@@ -302,7 +287,7 @@ index de1d624..2804247 100644
|
||||
struct token *token_create_admin( void )
|
||||
{
|
||||
struct token *token = NULL;
|
||||
@@ -1263,6 +1269,11 @@ const SID *token_get_primary_group( struct token *token )
|
||||
@@ -1262,6 +1268,11 @@ const SID *token_get_primary_group( struct token *token )
|
||||
return token->primary_group;
|
||||
}
|
||||
|
||||
|
@@ -1,62 +0,0 @@
|
||||
From bddfc5e460ca5d5751bf7d9069379e0e0462ae94 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 6 Aug 2017 02:11:15 +0200
|
||||
Subject: advapi32: Use token in CreateProcessAsUserW and
|
||||
CreateProcessWithTokenW.
|
||||
|
||||
---
|
||||
dlls/advapi32/security.c | 14 ++++++++------
|
||||
1 file changed, 8 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c
|
||||
index c531e45c9a0..4fc27ef82f9 100644
|
||||
--- a/dlls/advapi32/security.c
|
||||
+++ b/dlls/advapi32/security.c
|
||||
@@ -5700,13 +5700,14 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessAsUserW(
|
||||
LPSTARTUPINFOW lpStartupInfo,
|
||||
LPPROCESS_INFORMATION lpProcessInformation )
|
||||
{
|
||||
- FIXME("%p %s %s %p %p %d 0x%08x %p %s %p %p - semi-stub\n", hToken,
|
||||
+ TRACE("%p %s %s %p %p %d 0x%08x %p %s %p %p\n", hToken,
|
||||
debugstr_w(lpApplicationName), debugstr_w(lpCommandLine), lpProcessAttributes,
|
||||
lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment,
|
||||
debugstr_w(lpCurrentDirectory), lpStartupInfo, lpProcessInformation);
|
||||
|
||||
/* We should create the process with a suspended main thread */
|
||||
- if (!CreateProcessW (lpApplicationName,
|
||||
+ if (!CreateProcessInternalW(hToken,
|
||||
+ lpApplicationName,
|
||||
lpCommandLine,
|
||||
lpProcessAttributes,
|
||||
lpThreadAttributes,
|
||||
@@ -5715,7 +5716,8 @@ BOOL WINAPI DECLSPEC_HOTPATCH CreateProcessAsUserW(
|
||||
lpEnvironment,
|
||||
lpCurrentDirectory,
|
||||
lpStartupInfo,
|
||||
- lpProcessInformation))
|
||||
+ lpProcessInformation,
|
||||
+ NULL))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
@@ -5742,14 +5744,14 @@ BOOL WINAPI CreateProcessWithTokenW(HANDLE token, DWORD logon_flags, LPCWSTR app
|
||||
DWORD creation_flags, void *environment, LPCWSTR current_directory, STARTUPINFOW *startup_info,
|
||||
PROCESS_INFORMATION *process_information )
|
||||
{
|
||||
- FIXME("%p 0x%08x %s %s 0x%08x %p %s %p %p - semi-stub\n", token,
|
||||
+ TRACE("%p 0x%08x %s %s 0x%08x %p %s %p %p\n", token,
|
||||
logon_flags, debugstr_w(application_name), debugstr_w(command_line),
|
||||
creation_flags, environment, debugstr_w(current_directory),
|
||||
startup_info, process_information);
|
||||
|
||||
/* FIXME: check if handles should be inherited */
|
||||
- return CreateProcessW( application_name, command_line, NULL, NULL, FALSE, creation_flags, environment,
|
||||
- current_directory, startup_info, process_information );
|
||||
+ return CreateProcessInternalW( token, application_name, command_line, NULL, NULL, FALSE, creation_flags, environment,
|
||||
+ current_directory, startup_info, process_information, NULL );
|
||||
}
|
||||
|
||||
/******************************************************************************
|
||||
--
|
||||
2.13.1
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user