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
135 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
498c9eae60 | ||
|
a46b9ff3dc | ||
|
6589142220 | ||
|
fd3bb06a4c | ||
|
49aafeb17b | ||
|
841e2a8cda | ||
|
4aa460b8cd | ||
|
512d0b1d30 | ||
|
ff10ae6e74 | ||
|
fcfeaf092c | ||
|
2da5f18812 | ||
|
004a5a5717 | ||
|
7447216104 | ||
|
938dddf7df | ||
|
618e349c72 | ||
|
2007f010ac | ||
|
fb4fcb4da6 | ||
|
74068f2cab | ||
|
31157f5ed4 | ||
|
3813f414ed | ||
|
c6f239ef2e | ||
|
3b3cb09acc | ||
|
5734c2c2df | ||
|
8ceae1a2a3 | ||
|
31c73c6b53 | ||
|
c205df71c7 | ||
|
010c308abd | ||
|
924665da6f | ||
|
523d4ac996 | ||
|
67035d62f7 | ||
|
35a5f7db93 | ||
|
ca09e8918c | ||
|
49b441e0df | ||
|
f901156486 | ||
|
c7780d90cb | ||
|
73f58bac41 | ||
|
ad822b6405 | ||
|
9917fb4559 | ||
|
3f06c18b19 | ||
|
2474aff2c1 | ||
|
c9b8050f9d | ||
|
2394b08005 | ||
|
276ed085b7 | ||
|
b5010c55e8 | ||
|
391055dbe1 | ||
|
7ebc640edb | ||
|
4413770af1 | ||
|
aad0b50e62 | ||
|
9fd7972c2b | ||
|
a67dca35a1 | ||
|
5d7a86d054 | ||
|
a12c030bd9 | ||
|
a0735f083d | ||
|
460094e600 | ||
|
c95aae1049 | ||
|
394c51bd20 | ||
|
0bdc57245a | ||
|
9092f3922a | ||
|
e298cdfaf9 | ||
|
b95b9109b8 | ||
|
8d19b3fc4b | ||
|
aa2ec8b32c | ||
|
944b464511 | ||
|
1b15ab1bdc | ||
|
6e530333e6 | ||
|
5ed9211eab | ||
|
e0bf5ac738 | ||
|
accf189516 | ||
|
f07181375b | ||
|
35f28c4538 | ||
|
4babcaf231 | ||
|
eba1e9b28a | ||
|
52076762ec | ||
|
e1bfd97e2b | ||
|
ca8ae3e929 | ||
|
c08046e1cc | ||
|
53dad92c83 | ||
|
82c59d7eca | ||
|
507cb29933 | ||
|
dff74f4169 | ||
|
292e3c87d9 | ||
|
fbb8eac819 | ||
|
41d6d5f39a | ||
|
ca67426420 | ||
|
3ad0475779 | ||
|
fad0c725ae | ||
|
be41345d31 | ||
|
e6f1cafdd8 | ||
|
79ed5e86aa | ||
|
3bba693408 | ||
|
be5814e428 | ||
|
ed630b8146 | ||
|
11194ea339 | ||
|
694f513d71 | ||
|
b5055c0b1b | ||
|
e07b0fa042 | ||
|
e7110e5153 | ||
|
e2fa6bd9c0 | ||
|
ed9681d9df | ||
|
1196bcb86b | ||
|
9afb244a8e | ||
|
5681cd5466 | ||
|
1d3c799e6f | ||
|
a49aa40ac8 | ||
|
1998c0570d | ||
|
245fc7913d | ||
|
a1afc6f151 | ||
|
3287f0fc9b | ||
|
671295089e | ||
|
197e08b441 | ||
|
cd1862609a | ||
|
8725e273cc | ||
|
b9204d93c9 | ||
|
e1259ef094 | ||
|
bccec28691 | ||
|
f25c0ce411 | ||
|
7fd92efae8 | ||
|
968a9068f4 | ||
|
5e5b163eba | ||
|
5bc08f5e70 | ||
|
eb91fab43e | ||
|
5b59788752 | ||
|
5634d119e0 | ||
|
52f92a42de | ||
|
6f185a694c | ||
|
0bb3121273 | ||
|
77619384a4 | ||
|
77ef8ff7ef | ||
|
831b1f895e | ||
|
071fe01910 | ||
|
1b7ebd3bb8 | ||
|
6ce73c283d | ||
|
f3e2363b52 | ||
|
6e49a945cf | ||
|
92cc7818b2 |
@@ -1,25 +0,0 @@
|
||||
From bd48f0d6b1476a77520f0bf5f82ac08e9dbf9acd Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Tue, 22 Mar 2016 21:54:01 +0100
|
||||
Subject: amstream: Avoid implicit cast of interface pointer.
|
||||
|
||||
---
|
||||
dlls/amstream/mediastreamfilter.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/amstream/mediastreamfilter.c b/dlls/amstream/mediastreamfilter.c
|
||||
index 5abcb2f..a7ff6e8 100644
|
||||
--- a/dlls/amstream/mediastreamfilter.c
|
||||
+++ b/dlls/amstream/mediastreamfilter.c
|
||||
@@ -42,7 +42,7 @@ typedef struct {
|
||||
|
||||
static inline IMediaStreamFilterImpl *impl_from_IMediaStreamFilter(IMediaStreamFilter *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, IMediaStreamFilterImpl, filter);
|
||||
+ return CONTAINING_RECORD((IBaseFilter *)iface, IMediaStreamFilterImpl, filter.IBaseFilter_iface);
|
||||
}
|
||||
|
||||
/*** IUnknown methods ***/
|
||||
--
|
||||
2.7.4
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 2aeb3a9e57142c3f4ff86cb81b206bdbc146552d Mon Sep 17 00:00:00 2001
|
||||
From c8f9b712a946fac79af1290d14c1d31d0a8f0c10 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Tue, 22 Mar 2016 21:54:26 +0100
|
||||
Subject: [PATCH] d2d1: Avoid implicit cast of interface pointer.
|
||||
@@ -7,17 +7,16 @@ Subject: [PATCH] d2d1: Avoid implicit cast of interface pointer.
|
||||
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(-)
|
||||
6 files changed, 11 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/dlls/d2d1/bitmap.c b/dlls/d2d1/bitmap.c
|
||||
index c0aef3c..8a4b517 100644
|
||||
index 39e81192f77..52810211701 100644
|
||||
--- a/dlls/d2d1/bitmap.c
|
||||
+++ b/dlls/d2d1/bitmap.c
|
||||
@@ -626,5 +626,5 @@ struct d2d_bitmap *unsafe_impl_from_ID2D1Bitmap(ID2D1Bitmap *iface)
|
||||
@@ -623,5 +623,5 @@ struct d2d_bitmap *unsafe_impl_from_ID2D1Bitmap(ID2D1Bitmap *iface)
|
||||
if (!iface)
|
||||
return NULL;
|
||||
assert(iface->lpVtbl == (ID2D1BitmapVtbl *)&d2d_bitmap_vtbl);
|
||||
@@ -25,10 +24,10 @@ index c0aef3c..8a4b517 100644
|
||||
+ return CONTAINING_RECORD((ID2D1Bitmap1*)iface, struct d2d_bitmap, ID2D1Bitmap1_iface);
|
||||
}
|
||||
diff --git a/dlls/d2d1/brush.c b/dlls/d2d1/brush.c
|
||||
index 9c73ae1..a748669 100644
|
||||
index 21abf1456ab..1030884c2b7 100644
|
||||
--- a/dlls/d2d1/brush.c
|
||||
+++ b/dlls/d2d1/brush.c
|
||||
@@ -256,7 +256,7 @@ static void d2d_brush_init(struct d2d_brush *brush, ID2D1Factory *factory,
|
||||
@@ -253,7 +253,7 @@ static void d2d_brush_init(struct d2d_brush *brush, ID2D1Factory *factory,
|
||||
|
||||
static inline struct d2d_brush *impl_from_ID2D1SolidColorBrush(ID2D1SolidColorBrush *iface)
|
||||
{
|
||||
@@ -37,7 +36,7 @@ index 9c73ae1..a748669 100644
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_solid_color_brush_QueryInterface(ID2D1SolidColorBrush *iface,
|
||||
@@ -399,7 +399,7 @@ HRESULT d2d_solid_color_brush_create(ID2D1Factory *factory, const D2D1_COLOR_F *
|
||||
@@ -396,7 +396,7 @@ HRESULT d2d_solid_color_brush_create(ID2D1Factory *factory, const D2D1_COLOR_F *
|
||||
|
||||
static inline struct d2d_brush *impl_from_ID2D1LinearGradientBrush(ID2D1LinearGradientBrush *iface)
|
||||
{
|
||||
@@ -46,7 +45,7 @@ index 9c73ae1..a748669 100644
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_linear_gradient_brush_QueryInterface(ID2D1LinearGradientBrush *iface,
|
||||
@@ -586,7 +586,7 @@ HRESULT d2d_linear_gradient_brush_create(ID2D1Factory *factory,
|
||||
@@ -583,7 +583,7 @@ HRESULT d2d_linear_gradient_brush_create(ID2D1Factory *factory,
|
||||
|
||||
static inline struct d2d_brush *impl_from_ID2D1RadialGradientBrush(ID2D1RadialGradientBrush *iface)
|
||||
{
|
||||
@@ -55,7 +54,7 @@ index 9c73ae1..a748669 100644
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_radial_gradient_brush_QueryInterface(ID2D1RadialGradientBrush *iface,
|
||||
@@ -818,7 +818,7 @@ HRESULT d2d_radial_gradient_brush_create(ID2D1Factory *factory,
|
||||
@@ -815,7 +815,7 @@ HRESULT d2d_radial_gradient_brush_create(ID2D1Factory *factory,
|
||||
|
||||
static inline struct d2d_brush *impl_from_ID2D1BitmapBrush1(ID2D1BitmapBrush1 *iface)
|
||||
{
|
||||
@@ -65,10 +64,10 @@ index 9c73ae1..a748669 100644
|
||||
|
||||
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
|
||||
index 310c5412967..9d9168dc8ee 100644
|
||||
--- a/dlls/d2d1/dc_render_target.c
|
||||
+++ b/dlls/d2d1/dc_render_target.c
|
||||
@@ -26,7 +26,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d2d);
|
||||
@@ -23,7 +23,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d2d);
|
||||
|
||||
static inline struct d2d_dc_render_target *impl_from_IUnknown(IUnknown *iface)
|
||||
{
|
||||
@@ -77,24 +76,11 @@ index b095008..6030826 100644
|
||||
}
|
||||
|
||||
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 421ba2b..f8db51c 100644
|
||||
index 91ce32c28e7..da4a1f2d3ee 100644
|
||||
--- a/dlls/d2d1/geometry.c
|
||||
+++ b/dlls/d2d1/geometry.c
|
||||
@@ -2987,7 +2987,7 @@ static const struct ID2D1GeometrySinkVtbl d2d_geometry_sink_vtbl =
|
||||
@@ -2982,7 +2982,7 @@ static const struct ID2D1GeometrySinkVtbl d2d_geometry_sink_vtbl =
|
||||
|
||||
static inline struct d2d_geometry *impl_from_ID2D1PathGeometry(ID2D1PathGeometry *iface)
|
||||
{
|
||||
@@ -103,7 +89,7 @@ index 421ba2b..f8db51c 100644
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_path_geometry_QueryInterface(ID2D1PathGeometry *iface, REFIID iid, void **out)
|
||||
@@ -3503,7 +3503,7 @@ void d2d_path_geometry_init(struct d2d_geometry *geometry, ID2D1Factory *factory
|
||||
@@ -3498,7 +3498,7 @@ void d2d_path_geometry_init(struct d2d_geometry *geometry, ID2D1Factory *factory
|
||||
|
||||
static inline struct d2d_geometry *impl_from_ID2D1RectangleGeometry(ID2D1RectangleGeometry *iface)
|
||||
{
|
||||
@@ -112,7 +98,7 @@ index 421ba2b..f8db51c 100644
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d2d_rectangle_geometry_QueryInterface(ID2D1RectangleGeometry *iface,
|
||||
@@ -3838,7 +3838,7 @@ fail:
|
||||
@@ -3833,7 +3833,7 @@ fail:
|
||||
|
||||
static inline struct d2d_geometry *impl_from_ID2D1TransformedGeometry(ID2D1TransformedGeometry *iface)
|
||||
{
|
||||
@@ -122,10 +108,10 @@ index 421ba2b..f8db51c 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
|
||||
index 625f101eaa7..f3626c42cee 100644
|
||||
--- a/dlls/d2d1/hwnd_render_target.c
|
||||
+++ b/dlls/d2d1/hwnd_render_target.c
|
||||
@@ -26,7 +26,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d2d);
|
||||
@@ -23,7 +23,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d2d);
|
||||
|
||||
static inline struct d2d_hwnd_render_target *impl_from_IUnknown(IUnknown *iface)
|
||||
{
|
||||
@@ -135,10 +121,10 @@ index d0b9695..429561e 100644
|
||||
|
||||
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
|
||||
index e3175146a64..b66752983e6 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
|
||||
@@ -187,5 +187,5 @@ struct d2d_state_block *unsafe_impl_from_ID2D1DrawingStateBlock(ID2D1DrawingStat
|
||||
if (!iface)
|
||||
return NULL;
|
||||
assert(iface->lpVtbl == (ID2D1DrawingStateBlockVtbl *)&d2d_state_block_vtbl);
|
||||
@@ -146,5 +132,5 @@ index b15384e..4e7e34b 100644
|
||||
+ return CONTAINING_RECORD((ID2D1DrawingStateBlock1*)iface, struct d2d_state_block, ID2D1DrawingStateBlock1_iface);
|
||||
}
|
||||
--
|
||||
1.9.1
|
||||
2.20.1
|
||||
|
||||
|
@@ -1,25 +0,0 @@
|
||||
From b4586e37df817f205c8bebe319b4765dea5c62d5 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Lackner <sebastian@fds-team.de>
|
||||
Date: Sun, 24 Sep 2017 19:21:06 +0200
|
||||
Subject: evr: Avoid implicit cast of interface pointer.
|
||||
|
||||
---
|
||||
dlls/evr/evr.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/evr/evr.c b/dlls/evr/evr.c
|
||||
index c2d2933211e..5533f38a649 100644
|
||||
--- a/dlls/evr/evr.c
|
||||
+++ b/dlls/evr/evr.c
|
||||
@@ -136,7 +136,7 @@ static const IUnknownVtbl evr_inner_vtbl =
|
||||
|
||||
static inline evr_filter *impl_from_IBaseFilter(IBaseFilter *iface)
|
||||
{
|
||||
- return CONTAINING_RECORD(iface, evr_filter, filter);
|
||||
+ return CONTAINING_RECORD(iface, evr_filter, filter.IBaseFilter_iface);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI filter_QueryInterface(IBaseFilter *iface, REFIID riid, void **ppv)
|
||||
--
|
||||
2.14.1
|
||||
|
2
patches/Compiler_Warnings/definition
Normal file
2
patches/Compiler_Warnings/definition
Normal file
@@ -0,0 +1,2 @@
|
||||
Fixes: Fixes compile warnings.
|
||||
#Depends: mailing-list-patches
|
@@ -1,19 +1,18 @@
|
||||
From 2a1064c5f90beac2bd709ab5d1c454c90a16189b Mon Sep 17 00:00:00 2001
|
||||
From 3c1f5962482e7acf531f57f49d923d9c4e5278b1 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Fri, 4 Aug 2017 02:51:57 +0200
|
||||
Subject: advapi32: Implement CreateRestrictedToken.
|
||||
Subject: [PATCH] advapi32: Implement CreateRestrictedToken.
|
||||
|
||||
---
|
||||
dlls/advapi32/security.c | 88 +++++++++++++++++++++++++++++++++++-------
|
||||
dlls/advapi32/tests/security.c | 88 +++++++++++++++++++++++++++++++++++++++---
|
||||
2 files changed, 157 insertions(+), 19 deletions(-)
|
||||
dlls/kernelbase/security.c | 103 ++++++++++++++++++++++++++++++-------
|
||||
1 file changed, 84 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/dlls/advapi32/security.c b/dlls/advapi32/security.c
|
||||
index 82bb6689d43..c531e45c9a0 100644
|
||||
--- a/dlls/advapi32/security.c
|
||||
+++ b/dlls/advapi32/security.c
|
||||
@@ -840,6 +840,60 @@ BOOL WINAPI SetThreadToken(PHANDLE thread, HANDLE token)
|
||||
ThreadImpersonationToken, &token, sizeof token ));
|
||||
diff --git a/dlls/kernelbase/security.c b/dlls/kernelbase/security.c
|
||||
index 2e75e81ed77..97f6ee6a2fd 100644
|
||||
--- a/dlls/kernelbase/security.c
|
||||
+++ b/dlls/kernelbase/security.c
|
||||
@@ -592,31 +592,96 @@ exit:
|
||||
return ret;
|
||||
}
|
||||
|
||||
+static BOOL allocate_groups(TOKEN_GROUPS **groups_ret, SID_AND_ATTRIBUTES *sids, DWORD count)
|
||||
@@ -71,11 +70,16 @@ index 82bb6689d43..c531e45c9a0 100644
|
||||
+}
|
||||
+
|
||||
/*************************************************************************
|
||||
* CreateRestrictedToken [ADVAPI32.@]
|
||||
*
|
||||
@@ -871,25 +925,33 @@ BOOL WINAPI CreateRestrictedToken(
|
||||
PSID_AND_ATTRIBUTES restrictSids,
|
||||
PHANDLE newToken)
|
||||
* CreateRestrictedToken (kernelbase.@)
|
||||
*/
|
||||
-BOOL WINAPI CreateRestrictedToken( HANDLE token, DWORD flags,
|
||||
- DWORD disable_count, PSID_AND_ATTRIBUTES disable_sids,
|
||||
- DWORD delete_count, PLUID_AND_ATTRIBUTES delete_privs,
|
||||
- DWORD restrict_count, PSID_AND_ATTRIBUTES restrict_sids, PHANDLE ret )
|
||||
+BOOL WINAPI CreateRestrictedToken( HANDLE baseToken, DWORD flags,
|
||||
+ DWORD nDisableSids, PSID_AND_ATTRIBUTES disableSids,
|
||||
+ DWORD nDeletePrivs, PLUID_AND_ATTRIBUTES deletePrivs,
|
||||
+ DWORD nRestrictSids, PSID_AND_ATTRIBUTES restrictSids, PHANDLE newToken )
|
||||
{
|
||||
- TOKEN_TYPE type;
|
||||
- SECURITY_IMPERSONATION_LEVEL level = SecurityAnonymous;
|
||||
@@ -86,21 +90,14 @@ index 82bb6689d43..c531e45c9a0 100644
|
||||
+ BOOL ret = FALSE;
|
||||
|
||||
- FIXME("(%p, 0x%x, %u, %p, %u, %p, %u, %p, %p): stub\n",
|
||||
- token, flags, disable_count, disable_sids, delete_count, delete_privs,
|
||||
- restrict_count, restrict_sids, ret );
|
||||
+ TRACE("(%p, 0x%x, %u, %p, %u, %p, %u, %p, %p)\n",
|
||||
baseToken, flags, nDisableSids, disableSids,
|
||||
nDeletePrivs, deletePrivs,
|
||||
nRestrictSids, restrictSids,
|
||||
newToken);
|
||||
|
||||
- size = sizeof(type);
|
||||
- if (!GetTokenInformation( baseToken, TokenType, &type, size, &size )) return FALSE;
|
||||
- if (type == TokenImpersonation)
|
||||
- {
|
||||
- size = sizeof(level);
|
||||
- if (!GetTokenInformation( baseToken, TokenImpersonationLevel, &level, size, &size ))
|
||||
- return FALSE;
|
||||
- }
|
||||
- return DuplicateTokenEx( baseToken, MAXIMUM_ALLOWED, NULL, level, type, newToken );
|
||||
+ baseToken, flags, nDisableSids, disableSids,
|
||||
+ nDeletePrivs, deletePrivs,
|
||||
+ nRestrictSids, restrictSids,
|
||||
+ newToken);
|
||||
+
|
||||
+ if (!allocate_groups(&disable_groups, disableSids, nDisableSids))
|
||||
+ goto done;
|
||||
+
|
||||
@@ -117,155 +114,19 @@ index 82bb6689d43..c531e45c9a0 100644
|
||||
+ heap_free(delete_privs);
|
||||
+ heap_free(restrict_sids);
|
||||
+ return ret;
|
||||
|
||||
- size = sizeof(type);
|
||||
- if (!GetTokenInformation( token, TokenType, &type, size, &size )) return FALSE;
|
||||
- if (type == TokenImpersonation)
|
||||
- {
|
||||
- size = sizeof(level);
|
||||
- if (!GetTokenInformation( token, TokenImpersonationLevel, &level, size, &size ))
|
||||
- return FALSE;
|
||||
- }
|
||||
- return DuplicateTokenEx( token, MAXIMUM_ALLOWED, NULL, level, type, ret );
|
||||
}
|
||||
|
||||
/* ##############################
|
||||
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
|
||||
index a1ecc409b73..0fd41fe82fa 100644
|
||||
--- a/dlls/advapi32/tests/security.c
|
||||
+++ b/dlls/advapi32/tests/security.c
|
||||
@@ -5292,10 +5292,13 @@ static void test_GetUserNameW(void)
|
||||
|
||||
static void test_CreateRestrictedToken(void)
|
||||
{
|
||||
+ TOKEN_PRIMARY_GROUP *primary_group, *primary_group2;
|
||||
HANDLE process_token, token, r_token;
|
||||
PTOKEN_GROUPS token_groups, groups2;
|
||||
SID_AND_ATTRIBUTES sattr;
|
||||
SECURITY_IMPERSONATION_LEVEL level;
|
||||
+ TOKEN_PRIVILEGES *privs;
|
||||
+ PRIVILEGE_SET privset;
|
||||
TOKEN_TYPE type;
|
||||
BOOL is_member;
|
||||
DWORD size;
|
||||
@@ -5311,7 +5314,7 @@ static void test_CreateRestrictedToken(void)
|
||||
ret = OpenProcessToken(GetCurrentProcess(), TOKEN_DUPLICATE|TOKEN_QUERY, &process_token);
|
||||
ok(ret, "got error %d\n", GetLastError());
|
||||
|
||||
- ret = DuplicateTokenEx(process_token, TOKEN_DUPLICATE|TOKEN_ADJUST_GROUPS|TOKEN_QUERY,
|
||||
+ ret = DuplicateTokenEx(process_token, TOKEN_DUPLICATE|TOKEN_ADJUST_GROUPS|TOKEN_ADJUST_PRIVILEGES|TOKEN_QUERY,
|
||||
NULL, SecurityImpersonation, TokenImpersonation, &token);
|
||||
ok(ret, "got error %d\n", GetLastError());
|
||||
|
||||
@@ -5342,11 +5345,21 @@ static void test_CreateRestrictedToken(void)
|
||||
ok(ret, "got error %d\n", GetLastError());
|
||||
ok(is_member, "not a member\n");
|
||||
|
||||
- /* disable a SID in new token */
|
||||
+ privset.PrivilegeCount = 1;
|
||||
+ privset.Control = PRIVILEGE_SET_ALL_NECESSARY;
|
||||
+ ret = LookupPrivilegeValueA(NULL, "SeChangeNotifyPrivilege", &privset.Privilege[0].Luid);
|
||||
+ ok(ret, "got error %d\n", GetLastError());
|
||||
+
|
||||
+ is_member = FALSE;
|
||||
+ ret = PrivilegeCheck(token, &privset, &is_member);
|
||||
+ ok(ret, "got error %d\n", GetLastError());
|
||||
+ ok(is_member, "Expected SeChangeNotifyPrivilege to be enabled\n");
|
||||
+
|
||||
+ /* disable a SID and a privilege in new token */
|
||||
sattr.Sid = token_groups->Groups[i].Sid;
|
||||
sattr.Attributes = 0;
|
||||
r_token = NULL;
|
||||
- ret = pCreateRestrictedToken(token, 0, 1, &sattr, 0, NULL, 0, NULL, &r_token);
|
||||
+ ret = pCreateRestrictedToken(token, 0, 1, &sattr, 1, &privset.Privilege[0], 0, NULL, &r_token);
|
||||
ok(ret, "got error %d\n", GetLastError());
|
||||
|
||||
if (ret)
|
||||
@@ -5355,7 +5368,7 @@ static void test_CreateRestrictedToken(void)
|
||||
is_member = TRUE;
|
||||
ret = pCheckTokenMembership(r_token, token_groups->Groups[i].Sid, &is_member);
|
||||
ok(ret, "got error %d\n", GetLastError());
|
||||
- todo_wine ok(!is_member, "not a member\n");
|
||||
+ ok(!is_member, "not a member\n");
|
||||
|
||||
ret = GetTokenInformation(r_token, TokenGroups, NULL, 0, &size);
|
||||
ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %d with error %d\n",
|
||||
@@ -5370,9 +5383,9 @@ static void test_CreateRestrictedToken(void)
|
||||
break;
|
||||
}
|
||||
|
||||
- todo_wine ok(groups2->Groups[j].Attributes & SE_GROUP_USE_FOR_DENY_ONLY,
|
||||
+ ok(groups2->Groups[j].Attributes & SE_GROUP_USE_FOR_DENY_ONLY,
|
||||
"got wrong attributes\n");
|
||||
- todo_wine ok((groups2->Groups[j].Attributes & SE_GROUP_ENABLED) == 0,
|
||||
+ ok((groups2->Groups[j].Attributes & SE_GROUP_ENABLED) == 0,
|
||||
"got wrong attributes\n");
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, groups2);
|
||||
@@ -5386,10 +5399,73 @@ static void test_CreateRestrictedToken(void)
|
||||
ret = GetTokenInformation(r_token, TokenImpersonationLevel, &level, size, &size);
|
||||
ok(ret, "got error %d\n", GetLastError());
|
||||
ok(level == SecurityImpersonation, "got level %u\n", type);
|
||||
+
|
||||
+ is_member = TRUE;
|
||||
+ ret = PrivilegeCheck(r_token, &privset, &is_member);
|
||||
+ ok(ret, "got error %d\n", GetLastError());
|
||||
+ ok(!is_member, "Expected SeChangeNotifyPrivilege not to be enabled\n");
|
||||
+
|
||||
+ ret = GetTokenInformation(r_token, TokenPrivileges, NULL, 0, &size);
|
||||
+ ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %d with error %d\n",
|
||||
+ ret, GetLastError());
|
||||
+ privs = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
+ ret = GetTokenInformation(r_token, TokenPrivileges, privs, size, &size);
|
||||
+ ok(ret, "got error %d\n", GetLastError());
|
||||
+
|
||||
+ is_member = FALSE;
|
||||
+ for (j = 0; j < privs->PrivilegeCount; j++)
|
||||
+ {
|
||||
+ if (RtlEqualLuid(&privs->Privileges[j].Luid, &privset.Privilege[0].Luid))
|
||||
+ {
|
||||
+ is_member = TRUE;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ ok(!is_member, "Expected not to find privilege\n");
|
||||
+ HeapFree(GetProcessHeap(), 0, privs);
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, token_groups);
|
||||
CloseHandle(r_token);
|
||||
+
|
||||
+ ret = GetTokenInformation(token, TokenPrimaryGroup, NULL, 0, &size);
|
||||
+ ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %d with error %d\n",
|
||||
+ ret, GetLastError());
|
||||
+ primary_group = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
+ ret = GetTokenInformation(token, TokenPrimaryGroup, primary_group, size, &size);
|
||||
+ ok(ret, "got error %d\n", GetLastError());
|
||||
+
|
||||
+ /* disable primary group */
|
||||
+ sattr.Sid = primary_group->PrimaryGroup;
|
||||
+ sattr.Attributes = 0;
|
||||
+ r_token = NULL;
|
||||
+ ret = pCreateRestrictedToken(token, 0, 1, &sattr, 0, NULL, 0, NULL, &r_token);
|
||||
+ ok(ret, "got error %d\n", GetLastError());
|
||||
+
|
||||
+ if (ret)
|
||||
+ {
|
||||
+ is_member = TRUE;
|
||||
+ ret = pCheckTokenMembership(r_token, primary_group->PrimaryGroup, &is_member);
|
||||
+ ok(ret, "got error %d\n", GetLastError());
|
||||
+ ok(!is_member, "not a member\n");
|
||||
+
|
||||
+ ret = GetTokenInformation(r_token, TokenPrimaryGroup, NULL, 0, &size);
|
||||
+ ok(!ret && GetLastError() == ERROR_INSUFFICIENT_BUFFER, "got %d with error %d\n",
|
||||
+ ret, GetLastError());
|
||||
+ primary_group2 = HeapAlloc(GetProcessHeap(), 0, size);
|
||||
+ ret = GetTokenInformation(r_token, TokenPrimaryGroup, primary_group2, size, &size);
|
||||
+ ok(ret, "got error %d\n", GetLastError());
|
||||
+
|
||||
+ ok(EqualSid(primary_group2->PrimaryGroup, primary_group->PrimaryGroup),
|
||||
+ "Expected same primary group\n");
|
||||
+
|
||||
+ HeapFree(GetProcessHeap(), 0, primary_group2);
|
||||
+ }
|
||||
+
|
||||
+ HeapFree(GetProcessHeap(), 0, primary_group);
|
||||
+ CloseHandle(r_token);
|
||||
+
|
||||
CloseHandle(token);
|
||||
CloseHandle(process_token);
|
||||
}
|
||||
/******************************************************************************
|
||||
--
|
||||
2.13.1
|
||||
2.20.1
|
||||
|
||||
|
@@ -1,31 +0,0 @@
|
||||
From be28c746d013c16fa6c2e50f5f9debc45d39d81b Mon Sep 17 00:00:00 2001
|
||||
From: Qian Hong <qhong@codeweavers.com>
|
||||
Date: Tue, 7 Apr 2015 13:18:31 +0800
|
||||
Subject: advapi32: Initialize buffer length to zero in LsaLookupSids to
|
||||
prevent crash. (try 2)
|
||||
|
||||
Superseded 110588-110594
|
||||
|
||||
Try 2:
|
||||
- Use RtlInitUnicodeStringEx to simplify code when possible. Same for
|
||||
other patches in this series. (Thanks Nikolay)
|
||||
---
|
||||
dlls/advapi32/lsa.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/advapi32/lsa.c b/dlls/advapi32/lsa.c
|
||||
index 2a8b791..69c29c5 100644
|
||||
--- a/dlls/advapi32/lsa.c
|
||||
+++ b/dlls/advapi32/lsa.c
|
||||
@@ -502,7 +502,7 @@ NTSTATUS WINAPI LsaLookupSids(
|
||||
{
|
||||
(*Names)[i].Use = SidTypeUnknown;
|
||||
(*Names)[i].DomainIndex = -1;
|
||||
- (*Names)[i].Name.Buffer = NULL;
|
||||
+ RtlInitUnicodeStringEx(&(*Names)[i].Name, NULL);
|
||||
|
||||
memset(&(*ReferencedDomains)->Domains[i], 0, sizeof(LSA_TRUST_INFORMATION));
|
||||
|
||||
--
|
||||
2.3.5
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From e571cdf9236e083f196c09d0fc96ed7c98fae440 Mon Sep 17 00:00:00 2001
|
||||
From 9f35230848f29e79b65c8e340221d7eb81382a43 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
|
||||
@@ -15,10 +15,10 @@ Subject: [PATCH] server: Implement support for creating processes using a
|
||||
7 files changed, 66 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
|
||||
index bb6cc3e..7b202db 100644
|
||||
index 802d99f2a12..03c0588d59a 100644
|
||||
--- a/dlls/kernel32/process.c
|
||||
+++ b/dlls/kernel32/process.c
|
||||
@@ -2289,7 +2289,7 @@ static BOOL replace_process( HANDLE handle, const RTL_USER_PROCESS_PARAMETERS *p
|
||||
@@ -2341,7 +2341,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.
|
||||
*/
|
||||
@@ -27,7 +27,7 @@ index bb6cc3e..7b202db 100644
|
||||
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_
|
||||
@@ -2408,6 +2408,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;
|
||||
@@ -35,7 +35,7 @@ index bb6cc3e..7b202db 100644
|
||||
wine_server_add_data( req, objattr, attr_len );
|
||||
wine_server_add_data( req, startup_info, startup_info_size );
|
||||
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
|
||||
@@ -2567,7 +2568,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.
|
||||
*/
|
||||
@@ -44,7 +44,7 @@ index bb6cc3e..7b202db 100644
|
||||
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
|
||||
@@ -2577,7 +2578,7 @@ static BOOL create_vdm_process( LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES
|
||||
|
||||
if (!(new_params = get_vdm_params( params, &pe_info ))) return FALSE;
|
||||
|
||||
@@ -53,7 +53,7 @@ index bb6cc3e..7b202db 100644
|
||||
RtlDestroyProcessParameters( new_params );
|
||||
return ret;
|
||||
}
|
||||
@@ -2547,7 +2548,7 @@ static BOOL create_vdm_process( LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES
|
||||
@@ -2588,7 +2589,7 @@ static BOOL create_vdm_process( LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES
|
||||
*
|
||||
* Create a new cmd shell process for a .BAT file.
|
||||
*/
|
||||
@@ -62,7 +62,7 @@ index bb6cc3e..7b202db 100644
|
||||
BOOL inherit, DWORD flags, LPSTARTUPINFOW startup,
|
||||
const RTL_USER_PROCESS_PARAMETERS *params,
|
||||
LPPROCESS_INFORMATION info )
|
||||
@@ -2577,9 +2578,9 @@ static BOOL create_cmd_process( LPSECURITY_ATTRIBUTES psa, LPSECURITY_ATTRIBUTES
|
||||
@@ -2618,9 +2619,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;
|
||||
@@ -74,7 +74,7 @@ index bb6cc3e..7b202db 100644
|
||||
HeapFree( GetProcessHeap(), 0, newcmdline );
|
||||
return ret;
|
||||
}
|
||||
@@ -2692,7 +2693,9 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l
|
||||
@@ -2734,7 +2735,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) );
|
||||
|
||||
@@ -85,7 +85,7 @@ index bb6cc3e..7b202db 100644
|
||||
if (new_token) FIXME("No support for returning created process token\n");
|
||||
|
||||
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
|
||||
@@ -2802,17 +2805,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] );
|
||||
@@ -106,7 +106,7 @@ index bb6cc3e..7b202db 100644
|
||||
inherit, flags, params, info, unixdir, &pe_info );
|
||||
break;
|
||||
case BINARY_UNKNOWN:
|
||||
@@ -2780,14 +2783,14 @@ BOOL WINAPI CreateProcessInternalW( HANDLE token, LPCWSTR app_name, LPWSTR cmd_l
|
||||
@@ -2822,14 +2825,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) );
|
||||
@@ -124,10 +124,10 @@ index bb6cc3e..7b202db 100644
|
||||
break;
|
||||
}
|
||||
diff --git a/server/process.c b/server/process.c
|
||||
index af2ba3d..57bf0ec 100644
|
||||
index 30832f474da..028ffa1b454 100644
|
||||
--- a/server/process.c
|
||||
+++ b/server/process.c
|
||||
@@ -486,7 +486,7 @@ static void start_sigkill_timer( struct process *process )
|
||||
@@ -491,7 +491,7 @@ static void start_sigkill_timer( struct process *process )
|
||||
/* create a new process */
|
||||
/* if the function fails the fd is closed */
|
||||
struct process *create_process( int fd, struct process *parent, int inherit_all,
|
||||
@@ -136,7 +136,7 @@ index af2ba3d..57bf0ec 100644
|
||||
{
|
||||
struct process *process;
|
||||
|
||||
@@ -561,7 +561,7 @@ struct process *create_process( int fd, struct process *parent, int inherit_all,
|
||||
@@ -567,7 +567,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 */
|
||||
@@ -145,7 +145,7 @@ index af2ba3d..57bf0ec 100644
|
||||
process->affinity = parent->affinity;
|
||||
}
|
||||
if (!process->handles || !process->token) goto error;
|
||||
@@ -1127,6 +1127,7 @@ DECL_HANDLER(new_process)
|
||||
@@ -1123,6 +1123,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;
|
||||
@@ -153,7 +153,7 @@ index af2ba3d..57bf0ec 100644
|
||||
struct process *parent = current->process;
|
||||
int socket_fd = thread_get_inflight_fd( current, req->socket_fd );
|
||||
|
||||
@@ -1167,10 +1168,39 @@ DECL_HANDLER(new_process)
|
||||
@@ -1163,10 +1164,39 @@ DECL_HANDLER(new_process)
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ index af2ba3d..57bf0ec 100644
|
||||
return;
|
||||
}
|
||||
info->process = NULL;
|
||||
@@ -1217,7 +1247,7 @@ DECL_HANDLER(new_process)
|
||||
@@ -1213,7 +1243,7 @@ DECL_HANDLER(new_process)
|
||||
#undef FIXUP_LEN
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ index af2ba3d..57bf0ec 100644
|
||||
|
||||
process->startup_info = (struct startup_info *)grab_object( info );
|
||||
|
||||
@@ -1279,6 +1309,7 @@ DECL_HANDLER(new_process)
|
||||
@@ -1275,6 +1305,7 @@ DECL_HANDLER(new_process)
|
||||
reply->handle = alloc_handle_no_access_check( parent, process, req->access, objattr->attributes );
|
||||
|
||||
done:
|
||||
@@ -210,7 +210,7 @@ index af2ba3d..57bf0ec 100644
|
||||
if (process) release_object( process );
|
||||
release_object( info );
|
||||
}
|
||||
@@ -1311,7 +1342,7 @@ DECL_HANDLER(exec_process)
|
||||
@@ -1307,7 +1338,7 @@ DECL_HANDLER(exec_process)
|
||||
close( socket_fd );
|
||||
return;
|
||||
}
|
||||
@@ -220,10 +220,10 @@ index af2ba3d..57bf0ec 100644
|
||||
release_object( process );
|
||||
}
|
||||
diff --git a/server/process.h b/server/process.h
|
||||
index 029b328..ea28091 100644
|
||||
index f21ab7722a9..774c147e783 100644
|
||||
--- a/server/process.h
|
||||
+++ b/server/process.h
|
||||
@@ -116,7 +116,7 @@ extern unsigned int alloc_ptid( void *ptr );
|
||||
@@ -117,7 +117,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 process *create_process( int fd, struct process *parent, int inherit_all,
|
||||
@@ -233,22 +233,22 @@ index 029b328..ea28091 100644
|
||||
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 607644e..1b5e6de 100644
|
||||
index fcca1d255ba..4b01c6d1904 100644
|
||||
--- a/server/protocol.def
|
||||
+++ b/server/protocol.def
|
||||
@@ -744,6 +744,7 @@ struct rawinput_device
|
||||
@@ -790,6 +790,7 @@ struct rawinput_device
|
||||
unsigned int access; /* access rights for process object */
|
||||
cpu_type_t cpu; /* CPU that the new process will use */
|
||||
client_cpu_t cpu; /* CPU that the new process will use */
|
||||
data_size_t info_size; /* size of startup info */
|
||||
+ 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); /* environment for new process */
|
||||
diff --git a/server/request.c b/server/request.c
|
||||
index c10c4e6..86f293f 100644
|
||||
index d2adb08a183..139d643e8c8 100644
|
||||
--- a/server/request.c
|
||||
+++ b/server/request.c
|
||||
@@ -577,7 +577,7 @@ static void master_socket_poll_event( struct fd *fd, int event )
|
||||
@@ -578,7 +578,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 );
|
||||
@@ -258,7 +258,7 @@ index c10c4e6..86f293f 100644
|
||||
create_thread( -1, process, NULL );
|
||||
release_object( process );
|
||||
diff --git a/server/security.h b/server/security.h
|
||||
index 21e90cc..32dfe5f 100644
|
||||
index 21e90ccf23f..32dfe5f8db9 100644
|
||||
--- a/server/security.h
|
||||
+++ b/server/security.h
|
||||
@@ -67,6 +67,8 @@ extern const ACL *token_get_default_dacl( struct token *token );
|
||||
@@ -271,10 +271,10 @@ 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 1184241..5db97b4 100644
|
||||
index 181219d2179..858ec25d792 100644
|
||||
--- a/server/token.c
|
||||
+++ b/server/token.c
|
||||
@@ -836,6 +836,12 @@ int token_assign_label( struct token *token, PSID label )
|
||||
@@ -845,6 +845,12 @@ int token_assign_label( struct token *token, PSID label )
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -287,7 +287,7 @@ index 1184241..5db97b4 100644
|
||||
struct token *token_create_admin( void )
|
||||
{
|
||||
struct token *token = NULL;
|
||||
@@ -1262,6 +1268,11 @@ const SID *token_get_primary_group( struct token *token )
|
||||
@@ -1271,6 +1277,11 @@ const SID *token_get_primary_group( struct token *token )
|
||||
return token->primary_group;
|
||||
}
|
||||
|
||||
@@ -300,5 +300,5 @@ index 1184241..5db97b4 100644
|
||||
{
|
||||
GENERIC_MAPPING mapping;
|
||||
--
|
||||
1.9.1
|
||||
2.20.1
|
||||
|
||||
|
@@ -1,4 +1,4 @@
|
||||
From 0616176a3276be4ae49dc86c7d96b11240afca78 Mon Sep 17 00:00:00 2001
|
||||
From 5bf0baa79c46ec44dfd5e1340e96ff9289bc37f8 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 6 Aug 2017 03:15:34 +0200
|
||||
Subject: [PATCH] programs/runas: Basic implementation for starting processes
|
||||
@@ -7,9 +7,9 @@ Subject: [PATCH] programs/runas: Basic implementation for starting processes
|
||||
---
|
||||
configure.ac | 1 +
|
||||
programs/runas/Makefile.in | 8 ++
|
||||
programs/runas/runas.c | 214 +++++++++++++++++++++++++++++++++++++++++++++
|
||||
programs/runas/runas.h | 26 ++++++
|
||||
programs/runas/runas.rc | 39 +++++++++
|
||||
programs/runas/runas.c | 214 +++++++++++++++++++++++++++++++++++++
|
||||
programs/runas/runas.h | 26 +++++
|
||||
programs/runas/runas.rc | 39 +++++++
|
||||
5 files changed, 288 insertions(+)
|
||||
create mode 100644 programs/runas/Makefile.in
|
||||
create mode 100644 programs/runas/runas.c
|
||||
@@ -17,10 +17,10 @@ Subject: [PATCH] programs/runas: Basic implementation for starting processes
|
||||
create mode 100644 programs/runas/runas.rc
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index b9ef668..404ab7a 100644
|
||||
index 499c4f37ca..6f12614af1 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -3879,6 +3879,7 @@ WINE_CONFIG_MAKEFILE(programs/regedit/tests)
|
||||
@@ -3891,6 +3891,7 @@ WINE_CONFIG_MAKEFILE(programs/regedit/tests)
|
||||
WINE_CONFIG_MAKEFILE(programs/regsvcs)
|
||||
WINE_CONFIG_MAKEFILE(programs/regsvr32)
|
||||
WINE_CONFIG_MAKEFILE(programs/rpcss)
|
||||
@@ -30,12 +30,12 @@ index b9ef668..404ab7a 100644
|
||||
WINE_CONFIG_MAKEFILE(programs/sc)
|
||||
diff --git a/programs/runas/Makefile.in b/programs/runas/Makefile.in
|
||||
new file mode 100644
|
||||
index 0000000..be9434b
|
||||
index 0000000000..33aa00ab03
|
||||
--- /dev/null
|
||||
+++ b/programs/runas/Makefile.in
|
||||
@@ -0,0 +1,8 @@
|
||||
+MODULE = runas.exe
|
||||
+APPMODE = -mconsole -municode
|
||||
+APPMODE = -mconsole -municode -mno-cygwin
|
||||
+IMPORTS = advapi32 user32
|
||||
+
|
||||
+C_SRCS = \
|
||||
@@ -44,7 +44,7 @@ index 0000000..be9434b
|
||||
+RC_SRCS = runas.rc
|
||||
diff --git a/programs/runas/runas.c b/programs/runas/runas.c
|
||||
new file mode 100644
|
||||
index 0000000..8e96aff
|
||||
index 0000000000..412755afa0
|
||||
--- /dev/null
|
||||
+++ b/programs/runas/runas.c
|
||||
@@ -0,0 +1,214 @@
|
||||
@@ -69,7 +69,7 @@ index 0000000..8e96aff
|
||||
+ */
|
||||
+
|
||||
+#include <windows.h>
|
||||
+#include <wine/unicode.h>
|
||||
+#include <wchar.h>
|
||||
+#include <wine/debug.h>
|
||||
+
|
||||
+#include "runas.h"
|
||||
@@ -153,10 +153,10 @@ index 0000000..8e96aff
|
||||
+
|
||||
+static WCHAR *starts_with(WCHAR *str, const WCHAR *start)
|
||||
+{
|
||||
+ DWORD start_len = strlenW(start);
|
||||
+ if (strlenW(str) < start_len)
|
||||
+ DWORD start_len = lstrlenW(start);
|
||||
+ if (lstrlenW(str) < start_len)
|
||||
+ return NULL;
|
||||
+ if (strncmpW(str, start, start_len))
|
||||
+ if (wcsncmp(str, start, start_len))
|
||||
+ return NULL;
|
||||
+ return str + start_len;
|
||||
+}
|
||||
@@ -176,8 +176,8 @@ index 0000000..8e96aff
|
||||
+ WCHAR *arg;
|
||||
+
|
||||
+ if ((arg = starts_with(argv[i], trustlevelW)))
|
||||
+ cmd->trustlevel = strtoulW(arg, NULL, 0);
|
||||
+ else if (!strcmpW(argv[i], showtrustlevelsW))
|
||||
+ cmd->trustlevel = wcstoul(arg, NULL, 0);
|
||||
+ else if (!lstrcmpW(argv[i], showtrustlevelsW))
|
||||
+ show_trustlevels();
|
||||
+ else
|
||||
+ WINE_FIXME("Ignoring parameter %s\n", wine_dbgstr_w(argv[i]));
|
||||
@@ -264,7 +264,7 @@ index 0000000..8e96aff
|
||||
+}
|
||||
diff --git a/programs/runas/runas.h b/programs/runas/runas.h
|
||||
new file mode 100644
|
||||
index 0000000..40599a3
|
||||
index 0000000000..40599a3b33
|
||||
--- /dev/null
|
||||
+++ b/programs/runas/runas.h
|
||||
@@ -0,0 +1,26 @@
|
||||
@@ -296,7 +296,7 @@ index 0000000..40599a3
|
||||
+#define STRING_START_ERROR 104
|
||||
diff --git a/programs/runas/runas.rc b/programs/runas/runas.rc
|
||||
new file mode 100644
|
||||
index 0000000..f9297a4
|
||||
index 0000000000..f9297a4479
|
||||
--- /dev/null
|
||||
+++ b/programs/runas/runas.rc
|
||||
@@ -0,0 +1,39 @@
|
||||
@@ -340,5 +340,5 @@ index 0000000..f9297a4
|
||||
+ %2!u!: %3\n"
|
||||
+}
|
||||
--
|
||||
2.7.4
|
||||
2.23.0.rc1
|
||||
|
||||
|
@@ -1,26 +1,26 @@
|
||||
From 7f05362e86a285551a5694e98fa9abecb99018a0 Mon Sep 17 00:00:00 2001
|
||||
From 19efcf925a49a5d7e0b82eb6e4797b0ac725f2dc Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Sun, 17 Jan 2016 17:07:35 +0100
|
||||
Subject: [PATCH] ext-ms-win-xaml-pal-l1-1-0: Add dll and add stub for
|
||||
XamlBehaviorEnabled.
|
||||
|
||||
---
|
||||
configure.ac | 1 +
|
||||
dlls/ext-ms-win-xaml-pal-l1-1-0/Makefile.in | 4 +++
|
||||
.../ext-ms-win-xaml-pal-l1-1-0.spec | 6 ++++
|
||||
dlls/ext-ms-win-xaml-pal-l1-1-0/main.c | 35 +++++++++++++++++++
|
||||
configure.ac | 1 +
|
||||
dlls/ext-ms-win-xaml-pal-l1-1-0/Makefile.in | 4 +++
|
||||
.../ext-ms-win-xaml-pal-l1-1-0.spec | 6 ++++
|
||||
dlls/ext-ms-win-xaml-pal-l1-1-0/main.c | 35 ++++++++++++++++++++++
|
||||
4 files changed, 46 insertions(+)
|
||||
create mode 100644 dlls/ext-ms-win-xaml-pal-l1-1-0/Makefile.in
|
||||
create mode 100644 dlls/ext-ms-win-xaml-pal-l1-1-0/ext-ms-win-xaml-pal-l1-1-0.spec
|
||||
create mode 100644 dlls/ext-ms-win-xaml-pal-l1-1-0/main.c
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 420f6311db3..30718491bb8 100644
|
||||
index 8484c83..a9b51d2 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -3289,6 +3289,7 @@ WINE_CONFIG_MAKEFILE(dlls/ext-ms-win-rtcore-ntuser-sysparams-l1-1-0)
|
||||
WINE_CONFIG_MAKEFILE(dlls/ext-ms-win-security-credui-l1-1-0)
|
||||
WINE_CONFIG_MAKEFILE(dlls/ext-ms-win-security-cryptui-l1-1-0)
|
||||
@@ -3255,6 +3255,7 @@ WINE_CONFIG_MAKEFILE(dlls/ext-ms-win-shell-comctl32-init-l1-1-0)
|
||||
WINE_CONFIG_MAKEFILE(dlls/ext-ms-win-shell-comdlg32-l1-1-0)
|
||||
WINE_CONFIG_MAKEFILE(dlls/ext-ms-win-shell-shell32-l1-2-0)
|
||||
WINE_CONFIG_MAKEFILE(dlls/ext-ms-win-uxtheme-themes-l1-1-0)
|
||||
+WINE_CONFIG_MAKEFILE(dlls/ext-ms-win-xaml-pal-l1-1-0)
|
||||
WINE_CONFIG_MAKEFILE(dlls/faultrep)
|
||||
@@ -28,7 +28,7 @@ index 420f6311db3..30718491bb8 100644
|
||||
WINE_CONFIG_MAKEFILE(dlls/feclient)
|
||||
diff --git a/dlls/ext-ms-win-xaml-pal-l1-1-0/Makefile.in b/dlls/ext-ms-win-xaml-pal-l1-1-0/Makefile.in
|
||||
new file mode 100644
|
||||
index 00000000000..6382d85272b
|
||||
index 0000000..6382d85
|
||||
--- /dev/null
|
||||
+++ b/dlls/ext-ms-win-xaml-pal-l1-1-0/Makefile.in
|
||||
@@ -0,0 +1,4 @@
|
||||
@@ -38,7 +38,7 @@ index 00000000000..6382d85272b
|
||||
+ main.c
|
||||
diff --git a/dlls/ext-ms-win-xaml-pal-l1-1-0/ext-ms-win-xaml-pal-l1-1-0.spec b/dlls/ext-ms-win-xaml-pal-l1-1-0/ext-ms-win-xaml-pal-l1-1-0.spec
|
||||
new file mode 100644
|
||||
index 00000000000..c167f5e753e
|
||||
index 0000000..c167f5e
|
||||
--- /dev/null
|
||||
+++ b/dlls/ext-ms-win-xaml-pal-l1-1-0/ext-ms-win-xaml-pal-l1-1-0.spec
|
||||
@@ -0,0 +1,6 @@
|
||||
@@ -50,7 +50,7 @@ index 00000000000..c167f5e753e
|
||||
+@ stub XamlPalUninitialize
|
||||
diff --git a/dlls/ext-ms-win-xaml-pal-l1-1-0/main.c b/dlls/ext-ms-win-xaml-pal-l1-1-0/main.c
|
||||
new file mode 100644
|
||||
index 00000000000..3e282758f41
|
||||
index 0000000..3e28275
|
||||
--- /dev/null
|
||||
+++ b/dlls/ext-ms-win-xaml-pal-l1-1-0/main.c
|
||||
@@ -0,0 +1,35 @@
|
||||
@@ -90,5 +90,5 @@ index 00000000000..3e282758f41
|
||||
+ return TRUE;
|
||||
+}
|
||||
--
|
||||
2.17.0
|
||||
1.9.1
|
||||
|
||||
|
@@ -1,15 +1,15 @@
|
||||
From 9a67b4c62e5a575a38081114d4434f274355020e Mon Sep 17 00:00:00 2001
|
||||
From 21b4b65eadc9e39008ccadc48307fcfea05a24fb Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Tue, 12 Apr 2016 01:02:34 +0200
|
||||
Subject: [PATCH] uiautomationcore: Add dll and stub some functions.
|
||||
|
||||
---
|
||||
dlls/uiautomationcore/Makefile.in | 1 +
|
||||
dlls/uiautomationcore/uia_main.c | 53 ++++++++++++++++++++++++++++++++++-----
|
||||
dlls/uiautomationcore/uia_main.c | 53 +++++++++++++++++++++++++++----
|
||||
2 files changed, 48 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/dlls/uiautomationcore/Makefile.in b/dlls/uiautomationcore/Makefile.in
|
||||
index 5221450..5173f23 100644
|
||||
index b6edec5f6a9..bf2204d5ab4 100644
|
||||
--- a/dlls/uiautomationcore/Makefile.in
|
||||
+++ b/dlls/uiautomationcore/Makefile.in
|
||||
@@ -1,5 +1,6 @@
|
||||
@@ -17,10 +17,10 @@ index 5221450..5173f23 100644
|
||||
IMPORTLIB = uiautomationcore
|
||||
+IMPORTS = uuid
|
||||
|
||||
C_SRCS = \
|
||||
uia_main.c
|
||||
EXTRADLLFLAGS = -mno-cygwin
|
||||
|
||||
diff --git a/dlls/uiautomationcore/uia_main.c b/dlls/uiautomationcore/uia_main.c
|
||||
index f0d8247..b9c24b4 100644
|
||||
index f0d8247724d..b9c24b4b963 100644
|
||||
--- a/dlls/uiautomationcore/uia_main.c
|
||||
+++ b/dlls/uiautomationcore/uia_main.c
|
||||
@@ -1,4 +1,5 @@
|
||||
@@ -122,5 +122,5 @@ index f0d8247..b9c24b4 100644
|
||||
}
|
||||
|
||||
--
|
||||
1.9.1
|
||||
2.17.1
|
||||
|
||||
|
@@ -1,91 +0,0 @@
|
||||
From 72d00367b9863fd84d47623b6811552e155fca84 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Tue, 5 Feb 2019 10:00:26 +1100
|
||||
Subject: [PATCH] bcrypt: Add BCryptDestroySecret/BCryptSecretAgreement stubs
|
||||
|
||||
---
|
||||
dlls/bcrypt/bcrypt.spec | 4 ++--
|
||||
dlls/bcrypt/bcrypt_main.c | 16 ++++++++++++++++
|
||||
include/bcrypt.h | 3 +++
|
||||
3 files changed, 21 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/bcrypt.spec b/dlls/bcrypt/bcrypt.spec
|
||||
index 052a099..dfe08e7 100644
|
||||
--- a/dlls/bcrypt/bcrypt.spec
|
||||
+++ b/dlls/bcrypt/bcrypt.spec
|
||||
@@ -11,7 +11,7 @@
|
||||
@ stdcall BCryptDeriveKeyPBKDF2(ptr ptr long ptr long int64 ptr long long)
|
||||
@ stdcall BCryptDestroyHash(ptr)
|
||||
@ stdcall BCryptDestroyKey(ptr)
|
||||
-@ stub BCryptDestroySecret
|
||||
+@ stdcall BCryptDestroySecret(ptr)
|
||||
@ stdcall BCryptDuplicateHash(ptr ptr ptr long long)
|
||||
@ stdcall BCryptDuplicateKey(ptr ptr ptr long long)
|
||||
@ stdcall BCryptEncrypt(ptr ptr long ptr ptr long ptr long ptr long)
|
||||
@@ -44,7 +44,7 @@
|
||||
@ stdcall BCryptRemoveContextFunction(long wstr long wstr)
|
||||
@ stdcall BCryptRemoveContextFunctionProvider(long wstr long wstr wstr)
|
||||
@ stub BCryptResolveProviders
|
||||
-@ stub BCryptSecretAgreement
|
||||
+@ stdcall BCryptSecretAgreement(ptr ptr ptr long)
|
||||
@ stub BCryptSetAuditingInterface
|
||||
@ stub BCryptSetContextFunctionProperty
|
||||
@ stdcall BCryptSetProperty(ptr wstr ptr long long)
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index 80bd14b..36451c9 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -1556,6 +1556,22 @@ NTSTATUS WINAPI BCryptDeriveKeyPBKDF2( BCRYPT_ALG_HANDLE handle,
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
+NTSTATUS WINAPI BCryptSecretAgreement(BCRYPT_KEY_HANDLE handle, BCRYPT_KEY_HANDLE key, BCRYPT_SECRET_HANDLE *secret, ULONG flags)
|
||||
+{
|
||||
+ FIXME( "%p, %p, %p, %08x\n", handle, key, secret, flags );
|
||||
+
|
||||
+ if(secret)
|
||||
+ *secret = (BCRYPT_SECRET_HANDLE *)0xDEADFEED;
|
||||
+
|
||||
+ return STATUS_SUCCESS;
|
||||
+}
|
||||
+
|
||||
+NTSTATUS WINAPI BCryptDestroySecret(BCRYPT_SECRET_HANDLE secret)
|
||||
+{
|
||||
+ FIXME( "%p\n", secret );
|
||||
+ return STATUS_SUCCESS;
|
||||
+}
|
||||
+
|
||||
BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
|
||||
{
|
||||
switch (reason)
|
||||
diff --git a/include/bcrypt.h b/include/bcrypt.h
|
||||
index ba78c1d..866914c 100644
|
||||
--- a/include/bcrypt.h
|
||||
+++ b/include/bcrypt.h
|
||||
@@ -211,6 +211,7 @@ typedef PVOID BCRYPT_ALG_HANDLE;
|
||||
typedef PVOID BCRYPT_KEY_HANDLE;
|
||||
typedef PVOID BCRYPT_HANDLE;
|
||||
typedef PVOID BCRYPT_HASH_HANDLE;
|
||||
+typedef PVOID BCRYPT_SECRET_HANDLE;
|
||||
|
||||
/* Flags for BCryptGenRandom */
|
||||
#define BCRYPT_RNG_USE_ENTROPY_IN_BUFFER 0x00000001
|
||||
@@ -228,6 +229,7 @@ NTSTATUS WINAPI BCryptDecrypt(BCRYPT_KEY_HANDLE, PUCHAR, ULONG, VOID *, PUCHAR,
|
||||
NTSTATUS WINAPI BCryptDeriveKeyPBKDF2(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, PUCHAR, ULONG, ULONGLONG, PUCHAR, ULONG, ULONG);
|
||||
NTSTATUS WINAPI BCryptDestroyHash(BCRYPT_HASH_HANDLE);
|
||||
NTSTATUS WINAPI BCryptDestroyKey(BCRYPT_KEY_HANDLE);
|
||||
+NTSTATUS WINAPI BCryptDestroySecret(BCRYPT_SECRET_HANDLE);
|
||||
NTSTATUS WINAPI BCryptDuplicateHash(BCRYPT_HASH_HANDLE, BCRYPT_HASH_HANDLE *, UCHAR *, ULONG, ULONG);
|
||||
NTSTATUS WINAPI BCryptEncrypt(BCRYPT_KEY_HANDLE, PUCHAR, ULONG, VOID *, PUCHAR, ULONG, PUCHAR, ULONG, ULONG *, ULONG);
|
||||
NTSTATUS WINAPI BCryptEnumAlgorithms(ULONG, ULONG *, BCRYPT_ALGORITHM_IDENTIFIER **, ULONG);
|
||||
@@ -242,6 +244,7 @@ NTSTATUS WINAPI BCryptHash(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, PUCHAR, ULONG, PUCH
|
||||
NTSTATUS WINAPI BCryptHashData(BCRYPT_HASH_HANDLE, PUCHAR, ULONG, ULONG);
|
||||
NTSTATUS WINAPI BCryptImportKeyPair(BCRYPT_ALG_HANDLE, BCRYPT_KEY_HANDLE, LPCWSTR, BCRYPT_KEY_HANDLE *, UCHAR *, ULONG, ULONG);
|
||||
NTSTATUS WINAPI BCryptOpenAlgorithmProvider(BCRYPT_ALG_HANDLE *, LPCWSTR, LPCWSTR, ULONG);
|
||||
+NTSTATUS WINAPI BCryptSecretAgreement(BCRYPT_KEY_HANDLE, BCRYPT_KEY_HANDLE, BCRYPT_SECRET_HANDLE *, ULONG);
|
||||
NTSTATUS WINAPI BCryptSetProperty(BCRYPT_HANDLE, LPCWSTR, PUCHAR, ULONG, ULONG);
|
||||
NTSTATUS WINAPI BCryptVerifySignature(BCRYPT_KEY_HANDLE, void *, UCHAR *, ULONG, UCHAR *, ULONG, ULONG);
|
||||
|
||||
--
|
||||
1.9.1
|
||||
|
@@ -1,78 +0,0 @@
|
||||
From 315b52406fbddcaf9289b2a47e8498fba49f8278 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Tue, 5 Feb 2019 10:09:59 +1100
|
||||
Subject: [PATCH] bcrypt: Add BCryptDeriveKey stub
|
||||
|
||||
---
|
||||
dlls/bcrypt/bcrypt.spec | 2 +-
|
||||
dlls/bcrypt/bcrypt_main.c | 7 +++++++
|
||||
include/bcrypt.h | 15 +++++++++++++++
|
||||
3 files changed, 23 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/bcrypt/bcrypt.spec b/dlls/bcrypt/bcrypt.spec
|
||||
index dfe08e7..4946ee5 100644
|
||||
--- a/dlls/bcrypt/bcrypt.spec
|
||||
+++ b/dlls/bcrypt/bcrypt.spec
|
||||
@@ -7,7 +7,7 @@
|
||||
@ stdcall BCryptCreateHash(ptr ptr ptr long ptr long long)
|
||||
@ stdcall BCryptDecrypt(ptr ptr long ptr ptr long ptr long ptr long)
|
||||
@ stub BCryptDeleteContext
|
||||
-@ stub BCryptDeriveKey
|
||||
+@ stdcall BCryptDeriveKey(ptr wstr ptr ptr long ptr long)
|
||||
@ stdcall BCryptDeriveKeyPBKDF2(ptr ptr long ptr long int64 ptr long long)
|
||||
@ stdcall BCryptDestroyHash(ptr)
|
||||
@ stdcall BCryptDestroyKey(ptr)
|
||||
diff --git a/dlls/bcrypt/bcrypt_main.c b/dlls/bcrypt/bcrypt_main.c
|
||||
index 36451c9..ca2f274 100644
|
||||
--- a/dlls/bcrypt/bcrypt_main.c
|
||||
+++ b/dlls/bcrypt/bcrypt_main.c
|
||||
@@ -1572,6 +1572,13 @@ NTSTATUS WINAPI BCryptDestroySecret(BCRYPT_SECRET_HANDLE secret)
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
+NTSTATUS WINAPI BCryptDeriveKey(BCRYPT_SECRET_HANDLE secret, LPCWSTR kdf, BCryptBufferDesc *parameter,
|
||||
+ PUCHAR derived, ULONG derived_size, ULONG *result, ULONG flags)
|
||||
+{
|
||||
+ FIXME( "%p, %s, %p, %p, %d, %p, %08x\n", secret, debugstr_w(kdf), parameter, derived, derived_size, result, flags );
|
||||
+ return STATUS_INTERNAL_ERROR;
|
||||
+}
|
||||
+
|
||||
BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved )
|
||||
{
|
||||
switch (reason)
|
||||
diff --git a/include/bcrypt.h b/include/bcrypt.h
|
||||
index 866914c..a5abf23 100644
|
||||
--- a/include/bcrypt.h
|
||||
+++ b/include/bcrypt.h
|
||||
@@ -204,6 +204,20 @@ typedef struct _BCRYPT_KEY_DATA_BLOB_HEADER
|
||||
ULONG cbKeyData;
|
||||
} BCRYPT_KEY_DATA_BLOB_HEADER, *PBCRYPT_KEY_DATA_BLOB_HEADER;
|
||||
|
||||
+typedef struct _BCryptBuffer
|
||||
+{
|
||||
+ ULONG cbBuffer;
|
||||
+ ULONG BufferType;
|
||||
+ void *pvBuffer;
|
||||
+} BCryptBuffer, *PBCryptBuffer;
|
||||
+
|
||||
+typedef struct _BCryptBufferDesc
|
||||
+{
|
||||
+ ULONG ulVersion;
|
||||
+ ULONG cBuffers;
|
||||
+ PBCryptBuffer pBuffers;
|
||||
+} BCryptBufferDesc, *PBCryptBufferDesc;
|
||||
+
|
||||
#define BCRYPT_KEY_DATA_BLOB_MAGIC 0x4d42444b
|
||||
#define BCRYPT_KEY_DATA_BLOB_VERSION1 1
|
||||
|
||||
@@ -226,6 +240,7 @@ typedef PVOID BCRYPT_SECRET_HANDLE;
|
||||
NTSTATUS WINAPI BCryptCloseAlgorithmProvider(BCRYPT_ALG_HANDLE, ULONG);
|
||||
NTSTATUS WINAPI BCryptCreateHash(BCRYPT_ALG_HANDLE, BCRYPT_HASH_HANDLE *, PUCHAR, ULONG, PUCHAR, ULONG, ULONG);
|
||||
NTSTATUS WINAPI BCryptDecrypt(BCRYPT_KEY_HANDLE, PUCHAR, ULONG, VOID *, PUCHAR, ULONG, PUCHAR, ULONG, ULONG *, ULONG);
|
||||
+NTSTATUS WINAPI BCryptDeriveKey(BCRYPT_SECRET_HANDLE, LPCWSTR, BCryptBufferDesc*, PUCHAR, ULONG, ULONG *, ULONG);
|
||||
NTSTATUS WINAPI BCryptDeriveKeyPBKDF2(BCRYPT_ALG_HANDLE, PUCHAR, ULONG, PUCHAR, ULONG, ULONGLONG, PUCHAR, ULONG, ULONG);
|
||||
NTSTATUS WINAPI BCryptDestroyHash(BCRYPT_HASH_HANDLE);
|
||||
NTSTATUS WINAPI BCryptDestroyKey(BCRYPT_KEY_HANDLE);
|
||||
--
|
||||
1.9.1
|
||||
|
@@ -1 +0,0 @@
|
||||
Fixes: [46564] Add BCryptDestroySecret/BCryptSecretAgreement stubs.
|
@@ -0,0 +1,203 @@
|
||||
From 25b5e818272cf6fc52a8707c80b9ade3a5ca5df5 Mon Sep 17 00:00:00 2001
|
||||
From: Jason Edmeades <us@edmeades.me.uk>
|
||||
Date: Tue, 16 Jul 2019 13:49:18 +1000
|
||||
Subject: [PATCH 1/2] cmd: Support for launching programs based on file
|
||||
association
|
||||
|
||||
cmd already handles exe, cmd, bat etc but if you run a file with another extension,
|
||||
then use the associations set in the registry (for example via ftype / assoc) to
|
||||
launch a program. This enables you to run test.txt and notepad to pop up, or
|
||||
fred.msi for msiexec to be launched.
|
||||
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=18154
|
||||
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=36646
|
||||
---
|
||||
programs/cmd/wcmdmain.c | 140 +++++++++++++++++++++++++++++-----------
|
||||
1 file changed, 104 insertions(+), 36 deletions(-)
|
||||
|
||||
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c
|
||||
index 29e498a48d..2a9e4c75ee 100644
|
||||
--- a/programs/cmd/wcmdmain.c
|
||||
+++ b/programs/cmd/wcmdmain.c
|
||||
@@ -1142,8 +1142,10 @@ void WCMD_run_program (WCHAR *command, BOOL called)
|
||||
|
||||
/* 1. If extension supplied, see if that file exists */
|
||||
if (extensionsupplied) {
|
||||
- if (GetFileAttributesW(thisDir) != INVALID_FILE_ATTRIBUTES) {
|
||||
+ DWORD attribs = GetFileAttributesW(thisDir);
|
||||
+ if (attribs != INVALID_FILE_ATTRIBUTES && !(attribs&FILE_ATTRIBUTE_DIRECTORY)) {
|
||||
found = TRUE;
|
||||
+ WINE_TRACE("Found as file with extension as '%s'\n", wine_dbgstr_w(thisDir));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1174,6 +1176,7 @@ void WCMD_run_program (WCHAR *command, BOOL called)
|
||||
}
|
||||
|
||||
if (GetFileAttributesW(thisDir) != INVALID_FILE_ATTRIBUTES) {
|
||||
+ WINE_TRACE("Found via search and pathext as '%s'\n", wine_dbgstr_w(thisDir));
|
||||
found = TRUE;
|
||||
thisExt = NULL;
|
||||
}
|
||||
@@ -1191,58 +1194,123 @@ void WCMD_run_program (WCHAR *command, BOOL called)
|
||||
WCHAR *ext = wcsrchr( thisDir, '.' );
|
||||
static const WCHAR batExt[] = {'.','b','a','t','\0'};
|
||||
static const WCHAR cmdExt[] = {'.','c','m','d','\0'};
|
||||
+ static const WCHAR exeExt[] = {'.','e','x','e','\0'};
|
||||
+ static const WCHAR comExt[] = {'.','c','o','m','\0'};
|
||||
|
||||
WINE_TRACE("Found as %s\n", wine_dbgstr_w(thisDir));
|
||||
|
||||
/* Special case BAT and CMD */
|
||||
if (ext && (!wcsicmp(ext, batExt) || !wcsicmp(ext, cmdExt))) {
|
||||
BOOL oldinteractive = interactive;
|
||||
+ WINE_TRACE("Calling batch program\n");
|
||||
interactive = FALSE;
|
||||
WCMD_batch (thisDir, command, called, NULL, INVALID_HANDLE_VALUE);
|
||||
interactive = oldinteractive;
|
||||
+ WINE_TRACE("Back from call to batch program\n");
|
||||
return;
|
||||
- } else {
|
||||
+ }
|
||||
|
||||
- /* thisDir contains the file to be launched, but with what?
|
||||
- eg. a.exe will require a.exe to be launched, a.html may be iexplore */
|
||||
- hinst = FindExecutableW (thisDir, NULL, temp);
|
||||
- if ((INT_PTR)hinst < 32)
|
||||
- console = 0;
|
||||
- else
|
||||
- console = SHGetFileInfoW(temp, 0, &psfi, sizeof(psfi), SHGFI_EXETYPE);
|
||||
-
|
||||
- ZeroMemory (&st, sizeof(STARTUPINFOW));
|
||||
- st.cb = sizeof(STARTUPINFOW);
|
||||
- init_msvcrt_io_block(&st);
|
||||
-
|
||||
- /* Launch the process and if a CUI wait on it to complete
|
||||
- Note: Launching internal wine processes cannot specify a full path to exe */
|
||||
- status = CreateProcessW(thisDir,
|
||||
- command, NULL, NULL, TRUE, 0, NULL, NULL, &st, &pe);
|
||||
- heap_free(st.lpReserved2);
|
||||
- if ((opt_c || opt_k) && !opt_s && !status
|
||||
- && GetLastError()==ERROR_FILE_NOT_FOUND && command[0]=='\"') {
|
||||
- /* strip first and last quote WCHARacters and try again */
|
||||
- WCMD_strip_quotes(command);
|
||||
- opt_s = TRUE;
|
||||
- WCMD_run_program(command, called);
|
||||
+ /* Calculate what program will be launched, and whether it is a
|
||||
+ console application or not. Note the program may be different
|
||||
+ from the parameter (eg running a .txt file will launch notepad.exe) */
|
||||
+ hinst = FindExecutableW (thisDir, NULL, temp);
|
||||
+ if ((INT_PTR)hinst < 32)
|
||||
+ console = 0; /* Assume not console app by default */
|
||||
+ else
|
||||
+ console = SHGetFileInfoW(temp, 0, &psfi, sizeof(psfi), SHGFI_EXETYPE);
|
||||
+
|
||||
+
|
||||
+ /* If it is not a .com or .exe, try to launch through ShellExecuteExW
|
||||
+ which takes into account the association for the extension. */
|
||||
+ if (ext && (wcsicmp(ext, exeExt) && wcsicmp(ext, comExt))) {
|
||||
+
|
||||
+ SHELLEXECUTEINFOW shexw;
|
||||
+ BOOL rc;
|
||||
+ WCHAR *rawarg;
|
||||
+
|
||||
+ WCMD_parameter(command, 1, &rawarg, FALSE, TRUE);
|
||||
+ WINE_TRACE("Launching via ShellExecuteEx\n");
|
||||
+ memset(&shexw, 0x00, sizeof(shexw));
|
||||
+ shexw.cbSize = sizeof(SHELLEXECUTEINFOW);
|
||||
+ shexw.fMask = SEE_MASK_NO_CONSOLE | /* Run in same console as currently using */
|
||||
+ SEE_MASK_NOCLOSEPROCESS; /* We need a process handle to possibly wait on */
|
||||
+ shexw.lpFile = thisDir;
|
||||
+ shexw.lpParameters = rawarg;
|
||||
+ shexw.nShow = SW_SHOWNORMAL;
|
||||
+
|
||||
+ /* Try to launch the binary or its associated program */
|
||||
+ rc = ShellExecuteExW(&shexw);
|
||||
+
|
||||
+ if (rc && (INT_PTR)shexw.hInstApp >= 32) {
|
||||
+
|
||||
+ WINE_TRACE("Successfully launched\n");
|
||||
+
|
||||
+ /* It worked... Always wait when non-interactive (cmd /c or in
|
||||
+ batch program), or for console applications */
|
||||
+ if (!interactive || (console && !HIWORD(console))) {
|
||||
+ WINE_TRACE("Waiting for process to end\n");
|
||||
+ WaitForSingleObject (shexw.hProcess, INFINITE);
|
||||
+ }
|
||||
+
|
||||
+ GetExitCodeProcess (shexw.hProcess, &errorlevel);
|
||||
+ if (errorlevel == STILL_ACTIVE) {
|
||||
+ WINE_TRACE("Process still running, but returning anyway\n");
|
||||
+ errorlevel = 0;
|
||||
+ } else {
|
||||
+ WINE_TRACE("Process ended, errorlevel %d\n", errorlevel);
|
||||
+ }
|
||||
+
|
||||
+ CloseHandle(pe.hProcess);
|
||||
return;
|
||||
+
|
||||
}
|
||||
+ }
|
||||
|
||||
- if (!status)
|
||||
- break;
|
||||
+ /* If its a .exe or .com or the shellexecute failed due to no association,
|
||||
+ CreateProcess directly */
|
||||
+ ZeroMemory (&st, sizeof(STARTUPINFOW));
|
||||
+ st.cb = sizeof(STARTUPINFOW);
|
||||
+ init_msvcrt_io_block(&st);
|
||||
+
|
||||
+ /* Launch the process and if a CUI wait on it to complete
|
||||
+ Note: Launching internal wine processes cannot specify a full path to exe */
|
||||
+ WINE_TRACE("Launching via CreateProcess\n");
|
||||
+ status = CreateProcessW(thisDir,
|
||||
+ command, NULL, NULL, TRUE, 0, NULL, NULL, &st, &pe);
|
||||
+ heap_free(st.lpReserved2);
|
||||
+ if ((opt_c || opt_k) && !opt_s && !status
|
||||
+ && GetLastError()==ERROR_FILE_NOT_FOUND && command[0]=='\"') {
|
||||
+ /* strip first and last quote WCHARacters and try again */
|
||||
+ WCMD_strip_quotes(command);
|
||||
+ opt_s = TRUE;
|
||||
+ WCMD_run_program(command, called);
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
- /* Always wait when non-interactive (cmd /c or in batch program),
|
||||
- or for console applications */
|
||||
- if (!interactive || (console && !HIWORD(console)))
|
||||
- WaitForSingleObject (pe.hProcess, INFINITE);
|
||||
- GetExitCodeProcess (pe.hProcess, &errorlevel);
|
||||
- if (errorlevel == STILL_ACTIVE) errorlevel = 0;
|
||||
+ if (!status) {
|
||||
+ WINE_TRACE("Failed to launch via CreateProcess, rc %d (%d)\n",
|
||||
+ status, GetLastError());
|
||||
+ break;
|
||||
+ }
|
||||
|
||||
- CloseHandle(pe.hProcess);
|
||||
- CloseHandle(pe.hThread);
|
||||
- return;
|
||||
+ /* Always wait when non-interactive (cmd /c or in batch program),
|
||||
+ or for console applications */
|
||||
+ if (!interactive || (console && !HIWORD(console))) {
|
||||
+ WINE_TRACE("Waiting for process to end\n");
|
||||
+ WaitForSingleObject (pe.hProcess, INFINITE);
|
||||
}
|
||||
+
|
||||
+ GetExitCodeProcess (pe.hProcess, &errorlevel);
|
||||
+ if (errorlevel == STILL_ACTIVE) {
|
||||
+ WINE_TRACE("Process still running, but returning anyway\n");
|
||||
+ errorlevel = 0;
|
||||
+ } else {
|
||||
+ WINE_TRACE("Process ended, errorlevel %d\n", errorlevel);
|
||||
+ }
|
||||
+
|
||||
+ CloseHandle(pe.hProcess);
|
||||
+ CloseHandle(pe.hThread);
|
||||
+ return;
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
@@ -0,0 +1,79 @@
|
||||
From 7bb9825d921f91be01144110f6478a0c017cbd79 Mon Sep 17 00:00:00 2001
|
||||
From: Jason Edmeades <us@edmeades.me.uk>
|
||||
Date: Tue, 16 Jul 2019 13:51:58 +1000
|
||||
Subject: [PATCH 2/2] cmd: ftype failed to clear file associations
|
||||
|
||||
If a file association was set (e.g. ftype fred=xxx), ftype fred= needs to clear it,
|
||||
but previously it failed to do so.
|
||||
---
|
||||
programs/cmd/builtins.c | 6 +++---
|
||||
programs/cmd/tests/test_builtins.cmd | 9 +++++++++
|
||||
programs/cmd/tests/test_builtins.cmd.exp | 5 ++++-
|
||||
3 files changed, 16 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/programs/cmd/builtins.c b/programs/cmd/builtins.c
|
||||
index 62ae19a494..e85e553c05 100644
|
||||
--- a/programs/cmd/builtins.c
|
||||
+++ b/programs/cmd/builtins.c
|
||||
@@ -4939,11 +4939,11 @@ void WCMD_assoc (const WCHAR *args, BOOL assoc) {
|
||||
/* If nothing after '=' then clear value - only valid for ASSOC */
|
||||
if (*newValue == 0x00) {
|
||||
|
||||
- if (assoc) rc = RegDeleteKeyW(key, args);
|
||||
- if (assoc && rc == ERROR_SUCCESS) {
|
||||
+ rc = RegDeleteTreeW(key, args);
|
||||
+ if (rc == ERROR_SUCCESS) {
|
||||
WINE_TRACE("HKCR Key '%s' deleted\n", wine_dbgstr_w(args));
|
||||
|
||||
- } else if (assoc && rc != ERROR_FILE_NOT_FOUND) {
|
||||
+ } else if (rc != ERROR_FILE_NOT_FOUND) {
|
||||
WCMD_print_error();
|
||||
errorlevel = 2;
|
||||
|
||||
diff --git a/programs/cmd/tests/test_builtins.cmd b/programs/cmd/tests/test_builtins.cmd
|
||||
index f4dfc9f26d..0ef049a4ab 100644
|
||||
--- a/programs/cmd/tests/test_builtins.cmd
|
||||
+++ b/programs/cmd/tests/test_builtins.cmd
|
||||
@@ -2440,6 +2440,12 @@ echo echo +++>> tmp.cmd
|
||||
echo ftype footype>> tmp.cmd
|
||||
cmd /c tmp.cmd
|
||||
|
||||
+echo --- testing association
|
||||
+ftype footype=cmd.exe /c "echo '%%1'"
|
||||
+echo dummy>test.foo
|
||||
+test.foo
|
||||
+del test.foo
|
||||
+
|
||||
echo --- resetting association
|
||||
assoc .foo=
|
||||
|
||||
@@ -2471,6 +2477,9 @@ echo .foo=footype
|
||||
echo footype=foo_opencmd
|
||||
echo +++
|
||||
echo footype=foo_opencmd
|
||||
+echo --- testing association
|
||||
+echo footype=cmd.exe /c "echo '%%1'"
|
||||
+echo Skipped as not enough permissions
|
||||
echo --- resetting association
|
||||
echo original value
|
||||
|
||||
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
|
||||
index d78d91a6cf..e6ebe06714 100644
|
||||
--- a/programs/cmd/tests/test_builtins.cmd.exp
|
||||
+++ b/programs/cmd/tests/test_builtins.cmd.exp
|
||||
@@ -1444,8 +1444,11 @@ footype=foo_opencmd
|
||||
footype=foo_opencmd
|
||||
+++
|
||||
footype=foo_opencmd
|
||||
+--- testing association
|
||||
+footype=cmd.exe /c "echo '%1'"
|
||||
+'@drive@@path@foobar\test.foo'@or_broken@Skipped as not enough permissions
|
||||
--- resetting association
|
||||
-@todo_wine@original value@or_broken@buggyXP@or_broken@!WINE_FOO!
|
||||
+original value@or_broken@buggyXP@or_broken@!WINE_FOO!
|
||||
------------ Testing CALL ------------
|
||||
--- external script
|
||||
foo@space@
|
||||
--
|
||||
2.17.1
|
||||
|
2
patches/cmd-launch-association/definition
Normal file
2
patches/cmd-launch-association/definition
Normal file
@@ -0,0 +1,2 @@
|
||||
Fixes: [18154] cmd: Support for launching programs based on file association
|
||||
# Fixes: [36646]
|
@@ -0,0 +1,251 @@
|
||||
From ebbaf56bdb75f853dafdbbffba81233784ecb618 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Sat, 4 May 2019 18:21:05 +0800
|
||||
Subject: [PATCH 1/2] comctl32: Switch to using a structure for extra storage.
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
To: wine-devel@winehq.org
|
||||
|
||||
These patches aim to fix the bug 47018.
|
||||
|
||||
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
---
|
||||
dlls/comctl32/static.c | 92 ++++++++++++++++++++++++++++++++++--------
|
||||
1 file changed, 76 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/dlls/comctl32/static.c b/dlls/comctl32/static.c
|
||||
index 5cc02ced97..d08710c06f 100644
|
||||
--- a/dlls/comctl32/static.c
|
||||
+++ b/dlls/comctl32/static.c
|
||||
@@ -36,6 +36,7 @@
|
||||
#include "winuser.h"
|
||||
#include "commctrl.h"
|
||||
|
||||
+#include "wine/heap.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
#include "comctl32.h"
|
||||
@@ -50,10 +51,16 @@ static void STATIC_PaintBitmapfn( HWND hwnd, HDC hdc, DWORD style );
|
||||
static void STATIC_PaintEnhMetafn( HWND hwnd, HDC hdc, DWORD style );
|
||||
static void STATIC_PaintEtchedfn( HWND hwnd, HDC hdc, DWORD style );
|
||||
|
||||
-/* offsets for GetWindowLong for static private information */
|
||||
-#define HFONT_GWL_OFFSET 0
|
||||
-#define HICON_GWL_OFFSET (sizeof(HFONT))
|
||||
-#define STATIC_EXTRA_BYTES (HICON_GWL_OFFSET + sizeof(HICON))
|
||||
+struct static_extra_info
|
||||
+{
|
||||
+ HFONT hfont;
|
||||
+ union
|
||||
+ {
|
||||
+ HICON hicon;
|
||||
+ HBITMAP hbitmap;
|
||||
+ HENHMETAFILE hemf;
|
||||
+ } image;
|
||||
+};
|
||||
|
||||
typedef void (*pfPaint)( HWND hwnd, HDC hdc, DWORD style );
|
||||
|
||||
@@ -80,6 +87,18 @@ static const pfPaint staticPaintFunc[SS_TYPEMASK+1] =
|
||||
STATIC_PaintEtchedfn, /* SS_ETCHEDFRAME */
|
||||
};
|
||||
|
||||
+static struct static_extra_info *get_extra_ptr( HWND hwnd, BOOL force )
|
||||
+{
|
||||
+ struct static_extra_info *extra = (struct static_extra_info *)GetWindowLongPtrW( hwnd, 0 );
|
||||
+ if (!extra && force)
|
||||
+ {
|
||||
+ extra = heap_alloc_zero( sizeof(*extra) );
|
||||
+ if (extra)
|
||||
+ SetWindowLongPtrW( hwnd, 0, (ULONG_PTR)extra );
|
||||
+ }
|
||||
+ return extra;
|
||||
+}
|
||||
+
|
||||
static BOOL get_icon_size( HICON handle, SIZE *size )
|
||||
{
|
||||
ICONINFO info;
|
||||
@@ -111,6 +130,7 @@ static HICON STATIC_SetIcon( HWND hwnd, HICON hicon, DWORD style )
|
||||
{
|
||||
HICON prevIcon;
|
||||
SIZE size;
|
||||
+ struct static_extra_info *extra;
|
||||
|
||||
if ((style & SS_TYPEMASK) != SS_ICON) return 0;
|
||||
if (hicon && !get_icon_size( hicon, &size ))
|
||||
@@ -118,7 +138,12 @@ static HICON STATIC_SetIcon( HWND hwnd, HICON hicon, DWORD style )
|
||||
WARN("hicon != 0, but invalid\n");
|
||||
return 0;
|
||||
}
|
||||
- prevIcon = (HICON)SetWindowLongPtrW( hwnd, HICON_GWL_OFFSET, (LONG_PTR)hicon );
|
||||
+
|
||||
+ extra = get_extra_ptr( hwnd, TRUE );
|
||||
+ if (!extra) return 0;
|
||||
+
|
||||
+ prevIcon = extra->image.hicon;
|
||||
+ extra->image.hicon = hicon;
|
||||
if (hicon && !(style & SS_CENTERIMAGE) && !(style & SS_REALSIZECONTROL))
|
||||
{
|
||||
/* Windows currently doesn't implement SS_RIGHTJUST */
|
||||
@@ -146,6 +171,7 @@ static HICON STATIC_SetIcon( HWND hwnd, HICON hicon, DWORD style )
|
||||
static HBITMAP STATIC_SetBitmap( HWND hwnd, HBITMAP hBitmap, DWORD style )
|
||||
{
|
||||
HBITMAP hOldBitmap;
|
||||
+ struct static_extra_info *extra;
|
||||
|
||||
if ((style & SS_TYPEMASK) != SS_BITMAP) return 0;
|
||||
if (hBitmap && GetObjectType(hBitmap) != OBJ_BITMAP)
|
||||
@@ -153,7 +179,12 @@ static HBITMAP STATIC_SetBitmap( HWND hwnd, HBITMAP hBitmap, DWORD style )
|
||||
WARN("hBitmap != 0, but it's not a bitmap\n");
|
||||
return 0;
|
||||
}
|
||||
- hOldBitmap = (HBITMAP)SetWindowLongPtrW( hwnd, HICON_GWL_OFFSET, (LONG_PTR)hBitmap );
|
||||
+
|
||||
+ extra = get_extra_ptr( hwnd, TRUE );
|
||||
+ if (!extra) return 0;
|
||||
+
|
||||
+ hOldBitmap = extra->image.hbitmap;
|
||||
+ extra->image.hbitmap = hBitmap;
|
||||
if (hBitmap && !(style & SS_CENTERIMAGE) && !(style & SS_REALSIZECONTROL))
|
||||
{
|
||||
BITMAP bm;
|
||||
@@ -183,13 +214,23 @@ static HBITMAP STATIC_SetBitmap( HWND hwnd, HBITMAP hBitmap, DWORD style )
|
||||
*/
|
||||
static HENHMETAFILE STATIC_SetEnhMetaFile( HWND hwnd, HENHMETAFILE hEnhMetaFile, DWORD style )
|
||||
{
|
||||
+ HENHMETAFILE old_hemf;
|
||||
+ struct static_extra_info *extra;
|
||||
+
|
||||
if ((style & SS_TYPEMASK) != SS_ENHMETAFILE) return 0;
|
||||
if (hEnhMetaFile && GetObjectType(hEnhMetaFile) != OBJ_ENHMETAFILE)
|
||||
{
|
||||
WARN("hEnhMetaFile != 0, but it's not an enhanced metafile\n");
|
||||
return 0;
|
||||
}
|
||||
- return (HENHMETAFILE)SetWindowLongPtrW( hwnd, HICON_GWL_OFFSET, (LONG_PTR)hEnhMetaFile );
|
||||
+
|
||||
+ extra = get_extra_ptr( hwnd, TRUE );
|
||||
+ if (!extra) return 0;
|
||||
+
|
||||
+ old_hemf = extra->image.hemf;
|
||||
+ extra->image.hemf = hEnhMetaFile;
|
||||
+
|
||||
+ return old_hemf;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
@@ -200,6 +241,8 @@ static HENHMETAFILE STATIC_SetEnhMetaFile( HWND hwnd, HENHMETAFILE hEnhMetaFile,
|
||||
*/
|
||||
static HANDLE STATIC_GetImage( HWND hwnd, WPARAM wParam, DWORD style )
|
||||
{
|
||||
+ struct static_extra_info *extra;
|
||||
+
|
||||
switch (style & SS_TYPEMASK)
|
||||
{
|
||||
case SS_ICON:
|
||||
@@ -215,7 +258,22 @@ static HANDLE STATIC_GetImage( HWND hwnd, WPARAM wParam, DWORD style )
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
- return (HANDLE)GetWindowLongPtrW( hwnd, HICON_GWL_OFFSET );
|
||||
+
|
||||
+ extra = get_extra_ptr( hwnd, FALSE );
|
||||
+ return extra ? extra->image.hbitmap : 0;
|
||||
+}
|
||||
+
|
||||
+static void STATIC_SetFont( HWND hwnd, HFONT hfont )
|
||||
+{
|
||||
+ struct static_extra_info *extra = get_extra_ptr( hwnd, TRUE );
|
||||
+ if (extra)
|
||||
+ extra->hfont = hfont;
|
||||
+}
|
||||
+
|
||||
+static HFONT STATIC_GetFont( HWND hwnd )
|
||||
+{
|
||||
+ struct static_extra_info *extra = get_extra_ptr( hwnd, FALSE );
|
||||
+ return extra ? extra->hfont : 0;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
@@ -327,6 +385,8 @@ static LRESULT CALLBACK STATIC_WindowProc( HWND hwnd, UINT uMsg, WPARAM wParam,
|
||||
case WM_NCDESTROY:
|
||||
if (style == SS_ICON)
|
||||
{
|
||||
+ struct static_extra_info *extra = get_extra_ptr( hwnd, FALSE );
|
||||
+ heap_free( extra );
|
||||
/*
|
||||
* FIXME
|
||||
* DestroyIcon32( STATIC_SetIcon( wndPtr, 0 ) );
|
||||
@@ -423,14 +483,14 @@ static LRESULT CALLBACK STATIC_WindowProc( HWND hwnd, UINT uMsg, WPARAM wParam,
|
||||
case WM_SETFONT:
|
||||
if (hasTextStyle( full_style ))
|
||||
{
|
||||
- SetWindowLongPtrW( hwnd, HFONT_GWL_OFFSET, wParam );
|
||||
+ STATIC_SetFont( hwnd, (HFONT)wParam );
|
||||
if (LOWORD(lParam))
|
||||
RedrawWindow( hwnd, NULL, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ALLCHILDREN );
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_GETFONT:
|
||||
- return GetWindowLongPtrW( hwnd, HFONT_GWL_OFFSET );
|
||||
+ return (LRESULT)STATIC_GetFont( hwnd );
|
||||
|
||||
case WM_NCHITTEST:
|
||||
if (full_style & SS_NOTIFY)
|
||||
@@ -508,7 +568,7 @@ static void STATIC_PaintOwnerDrawfn( HWND hwnd, HDC hdc, DWORD style )
|
||||
dis.itemData = 0;
|
||||
GetClientRect( hwnd, &dis.rcItem );
|
||||
|
||||
- font = (HFONT)GetWindowLongPtrW( hwnd, HFONT_GWL_OFFSET );
|
||||
+ font = STATIC_GetFont( hwnd );
|
||||
if (font) oldFont = SelectObject( hdc, font );
|
||||
SendMessageW( GetParent(hwnd), WM_CTLCOLORSTATIC, (WPARAM)hdc, (LPARAM)hwnd );
|
||||
SendMessageW( GetParent(hwnd), WM_DRAWITEM, id, (LPARAM)&dis );
|
||||
@@ -572,7 +632,7 @@ static void STATIC_PaintTextfn( HWND hwnd, HDC hdc, DWORD style )
|
||||
format |= DT_SINGLELINE | DT_WORD_ELLIPSIS;
|
||||
}
|
||||
|
||||
- if ((hFont = (HFONT)GetWindowLongPtrW( hwnd, HFONT_GWL_OFFSET )))
|
||||
+ if ((hFont = STATIC_GetFont( hwnd )))
|
||||
hOldFont = SelectObject( hdc, hFont );
|
||||
|
||||
/* SS_SIMPLE controls: WM_CTLCOLORSTATIC is sent, but the returned
|
||||
@@ -668,7 +728,7 @@ static void STATIC_PaintIconfn( HWND hwnd, HDC hdc, DWORD style )
|
||||
|
||||
GetClientRect( hwnd, &rc );
|
||||
hbrush = STATIC_SendWmCtlColorStatic(hwnd, hdc);
|
||||
- hIcon = (HICON)GetWindowLongPtrW( hwnd, HICON_GWL_OFFSET );
|
||||
+ hIcon = STATIC_GetImage( hwnd, IMAGE_ICON, style );
|
||||
if (!hIcon || !get_icon_size( hIcon, &size ))
|
||||
{
|
||||
FillRect(hdc, &rc, hbrush);
|
||||
@@ -698,7 +758,7 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style )
|
||||
|
||||
hbrush = STATIC_SendWmCtlColorStatic(hwnd, hdc);
|
||||
|
||||
- if ((hBitmap = (HBITMAP)GetWindowLongPtrW( hwnd, HICON_GWL_OFFSET ))
|
||||
+ if ((hBitmap = STATIC_GetImage( hwnd, IMAGE_BITMAP, style ))
|
||||
&& (GetObjectType(hBitmap) == OBJ_BITMAP)
|
||||
&& (hMemDC = CreateCompatibleDC( hdc )))
|
||||
{
|
||||
@@ -742,7 +802,7 @@ static void STATIC_PaintEnhMetafn(HWND hwnd, HDC hdc, DWORD style )
|
||||
GetClientRect(hwnd, &rc);
|
||||
hbrush = STATIC_SendWmCtlColorStatic(hwnd, hdc);
|
||||
FillRect(hdc, &rc, hbrush);
|
||||
- if ((hEnhMetaFile = (HENHMETAFILE)GetWindowLongPtrW( hwnd, HICON_GWL_OFFSET )))
|
||||
+ if ((hEnhMetaFile = STATIC_GetImage( hwnd, IMAGE_ENHMETAFILE, style )))
|
||||
{
|
||||
/* The control's current font is not selected into the
|
||||
device context! */
|
||||
@@ -779,7 +839,7 @@ void STATIC_Register(void)
|
||||
wndClass.style = CS_DBLCLKS | CS_PARENTDC | CS_GLOBALCLASS;
|
||||
wndClass.lpfnWndProc = STATIC_WindowProc;
|
||||
wndClass.cbClsExtra = 0;
|
||||
- wndClass.cbWndExtra = STATIC_EXTRA_BYTES;
|
||||
+ wndClass.cbWndExtra = sizeof(struct static_extra_info *);
|
||||
wndClass.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW);
|
||||
wndClass.hbrBackground = NULL;
|
||||
wndClass.lpszClassName = WC_STATICW;
|
||||
--
|
||||
2.20.1
|
||||
|
@@ -0,0 +1,152 @@
|
||||
From 334262255a66b05a852c90ebc722815b8a0eb7e9 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Sat, 4 May 2019 19:46:35 +0800
|
||||
Subject: [PATCH 2/2] comctl32: Paint 32-bpp bitmaps with an alpha channel
|
||||
using GdiAlphaBlend.
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
To: wine-devel@winehq.org
|
||||
|
||||
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
---
|
||||
dlls/comctl32/static.c | 83 ++++++++++++++++++++++++++++++++++++++++--
|
||||
1 file changed, 79 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/comctl32/static.c b/dlls/comctl32/static.c
|
||||
index d08710c06f..fe566645d3 100644
|
||||
--- a/dlls/comctl32/static.c
|
||||
+++ b/dlls/comctl32/static.c
|
||||
@@ -60,6 +60,7 @@ struct static_extra_info
|
||||
HBITMAP hbitmap;
|
||||
HENHMETAFILE hemf;
|
||||
} image;
|
||||
+ BOOL image_has_alpha;
|
||||
};
|
||||
|
||||
typedef void (*pfPaint)( HWND hwnd, HDC hdc, DWORD style );
|
||||
@@ -163,6 +164,56 @@ static HICON STATIC_SetIcon( HWND hwnd, HICON hicon, DWORD style )
|
||||
return prevIcon;
|
||||
}
|
||||
|
||||
+static HBITMAP create_alpha_bitmap( HBITMAP hbitmap )
|
||||
+{
|
||||
+ HBITMAP alpha = 0;
|
||||
+ BITMAPINFO *info = NULL;
|
||||
+ BITMAP bm;
|
||||
+ HDC src, dst;
|
||||
+ void *bits;
|
||||
+ DWORD i;
|
||||
+ const unsigned char *ptr;
|
||||
+ BOOL has_alpha = FALSE;
|
||||
+
|
||||
+ if (!GetObjectW( hbitmap, sizeof(bm), &bm )) return 0;
|
||||
+ if (bm.bmBitsPixel != 32) return 0;
|
||||
+
|
||||
+ if (!(src = CreateCompatibleDC( 0 ))) return 0;
|
||||
+ if (!(dst = CreateCompatibleDC( src ))) goto done;
|
||||
+ if (!(info = HeapAlloc( GetProcessHeap(), 0, FIELD_OFFSET( BITMAPINFO, bmiColors[256] )))) goto done;
|
||||
+ info->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
||||
+ info->bmiHeader.biWidth = bm.bmWidth;
|
||||
+ info->bmiHeader.biHeight = -bm.bmHeight;
|
||||
+ info->bmiHeader.biPlanes = 1;
|
||||
+ info->bmiHeader.biBitCount = 32;
|
||||
+ info->bmiHeader.biCompression = BI_RGB;
|
||||
+ info->bmiHeader.biSizeImage = bm.bmWidth * bm.bmHeight * 4;
|
||||
+ info->bmiHeader.biXPelsPerMeter = 0;
|
||||
+ info->bmiHeader.biYPelsPerMeter = 0;
|
||||
+ info->bmiHeader.biClrUsed = 0;
|
||||
+ info->bmiHeader.biClrImportant = 0;
|
||||
+ if (!(alpha = CreateDIBSection( dst, info, DIB_RGB_COLORS, &bits, NULL, 0 ))) goto done;
|
||||
+
|
||||
+ SelectObject( src, hbitmap );
|
||||
+ SelectObject( dst, alpha );
|
||||
+ BitBlt(dst, 0, 0, bm.bmWidth, bm.bmHeight, src, 0, 0, SRCCOPY);
|
||||
+
|
||||
+ for (i = 0, ptr = bits; i < bm.bmWidth * bm.bmHeight; i++, ptr += 4)
|
||||
+ if ((has_alpha = (ptr[3] != 0))) break;
|
||||
+
|
||||
+done:
|
||||
+ DeleteDC( src );
|
||||
+ DeleteDC( dst );
|
||||
+ HeapFree( GetProcessHeap(), 0, info );
|
||||
+
|
||||
+ if (!has_alpha)
|
||||
+ {
|
||||
+ DeleteObject( alpha );
|
||||
+ alpha = 0;
|
||||
+ }
|
||||
+ return alpha;
|
||||
+}
|
||||
+
|
||||
/***********************************************************************
|
||||
* STATIC_SetBitmap
|
||||
*
|
||||
@@ -170,7 +221,7 @@ static HICON STATIC_SetIcon( HWND hwnd, HICON hicon, DWORD style )
|
||||
*/
|
||||
static HBITMAP STATIC_SetBitmap( HWND hwnd, HBITMAP hBitmap, DWORD style )
|
||||
{
|
||||
- HBITMAP hOldBitmap;
|
||||
+ HBITMAP hOldBitmap, alpha;
|
||||
struct static_extra_info *extra;
|
||||
|
||||
if ((style & SS_TYPEMASK) != SS_BITMAP) return 0;
|
||||
@@ -184,7 +235,18 @@ static HBITMAP STATIC_SetBitmap( HWND hwnd, HBITMAP hBitmap, DWORD style )
|
||||
if (!extra) return 0;
|
||||
|
||||
hOldBitmap = extra->image.hbitmap;
|
||||
- extra->image.hbitmap = hBitmap;
|
||||
+ alpha = create_alpha_bitmap( hBitmap );
|
||||
+ if (alpha)
|
||||
+ {
|
||||
+ extra->image.hbitmap = alpha;
|
||||
+ extra->image_has_alpha = TRUE;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ extra->image.hbitmap = hBitmap;
|
||||
+ extra->image_has_alpha = FALSE;
|
||||
+ }
|
||||
+
|
||||
if (hBitmap && !(style & SS_CENTERIMAGE) && !(style & SS_REALSIZECONTROL))
|
||||
{
|
||||
BITMAP bm;
|
||||
@@ -386,7 +448,12 @@ static LRESULT CALLBACK STATIC_WindowProc( HWND hwnd, UINT uMsg, WPARAM wParam,
|
||||
if (style == SS_ICON)
|
||||
{
|
||||
struct static_extra_info *extra = get_extra_ptr( hwnd, FALSE );
|
||||
- heap_free( extra );
|
||||
+ if (extra)
|
||||
+ {
|
||||
+ if (extra->image_has_alpha)
|
||||
+ DeleteObject( extra->image.hbitmap );
|
||||
+ heap_free( extra );
|
||||
+ }
|
||||
/*
|
||||
* FIXME
|
||||
* DestroyIcon32( STATIC_SetIcon( wndPtr, 0 ) );
|
||||
@@ -765,6 +832,8 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style )
|
||||
BITMAP bm;
|
||||
RECT rcClient;
|
||||
LOGBRUSH brush;
|
||||
+ BLENDFUNCTION blend = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
|
||||
+ struct static_extra_info *extra = get_extra_ptr( hwnd, FALSE );
|
||||
|
||||
GetObjectW(hBitmap, sizeof(bm), &bm);
|
||||
oldbitmap = SelectObject(hMemDC, hBitmap);
|
||||
@@ -785,7 +854,13 @@ static void STATIC_PaintBitmapfn(HWND hwnd, HDC hdc, DWORD style )
|
||||
rcClient.right = rcClient.left + bm.bmWidth;
|
||||
rcClient.bottom = rcClient.top + bm.bmHeight;
|
||||
}
|
||||
- StretchBlt(hdc, rcClient.left, rcClient.top, rcClient.right - rcClient.left,
|
||||
+
|
||||
+ if (extra->image_has_alpha)
|
||||
+ GdiAlphaBlend(hdc, rcClient.left, rcClient.top, rcClient.right - rcClient.left,
|
||||
+ rcClient.bottom - rcClient.top, hMemDC,
|
||||
+ 0, 0, bm.bmWidth, bm.bmHeight, blend);
|
||||
+ else
|
||||
+ StretchBlt(hdc, rcClient.left, rcClient.top, rcClient.right - rcClient.left,
|
||||
rcClient.bottom - rcClient.top, hMemDC,
|
||||
0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY);
|
||||
SelectObject(hMemDC, oldbitmap);
|
||||
--
|
||||
2.20.1
|
||||
|
1
patches/comctl32-alpha-bitmaps/definition
Normal file
1
patches/comctl32-alpha-bitmaps/definition
Normal file
@@ -0,0 +1 @@
|
||||
Fixes: [47018] Paint 32-bpp bitmaps with an alpha channel using GdiAlphaBlend
|
@@ -0,0 +1,231 @@
|
||||
From 39c92b48498d080c4d90e9b8d16c580dd72b1941 Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Fri, 5 Jul 2019 13:20:23 +0800
|
||||
Subject: [PATCH] cryptext: Implement CryptExtOpenCER.
|
||||
|
||||
Signed-off-by: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
---
|
||||
configure | 1 +
|
||||
configure.ac | 1 +
|
||||
dlls/cryptext/Makefile.in | 3 +-
|
||||
dlls/cryptext/cryptext.spec | 4 +--
|
||||
dlls/cryptext/cryptext_main.c | 64 +++++++++++++++++++++++++++++++++
|
||||
dlls/cryptext/tests/Makefile.in | 4 +++
|
||||
dlls/cryptext/tests/cryptext.c | 61 +++++++++++++++++++++++++++++++
|
||||
7 files changed, 135 insertions(+), 3 deletions(-)
|
||||
create mode 100644 dlls/cryptext/tests/Makefile.in
|
||||
create mode 100644 dlls/cryptext/tests/cryptext.c
|
||||
|
||||
diff --git a/configure b/configure
|
||||
index f1de2c4052..ed79a35e0e 100755
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -20063,6 +20063,7 @@ wine_fn_config_makefile dlls/crypt32/tests enable_tests
|
||||
wine_fn_config_makefile dlls/cryptdlg enable_cryptdlg
|
||||
wine_fn_config_makefile dlls/cryptdll enable_cryptdll
|
||||
wine_fn_config_makefile dlls/cryptext enable_cryptext
|
||||
+wine_fn_config_makefile dlls/cryptext/tests enable_tests
|
||||
wine_fn_config_makefile dlls/cryptnet enable_cryptnet
|
||||
wine_fn_config_makefile dlls/cryptnet/tests enable_tests
|
||||
wine_fn_config_makefile dlls/cryptui enable_cryptui
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index a7c45ace73..e801c35c46 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -3049,6 +3049,7 @@ WINE_CONFIG_MAKEFILE(dlls/crypt32/tests)
|
||||
WINE_CONFIG_MAKEFILE(dlls/cryptdlg)
|
||||
WINE_CONFIG_MAKEFILE(dlls/cryptdll)
|
||||
WINE_CONFIG_MAKEFILE(dlls/cryptext)
|
||||
+WINE_CONFIG_MAKEFILE(dlls/cryptext/tests)
|
||||
WINE_CONFIG_MAKEFILE(dlls/cryptnet)
|
||||
WINE_CONFIG_MAKEFILE(dlls/cryptnet/tests)
|
||||
WINE_CONFIG_MAKEFILE(dlls/cryptui)
|
||||
diff --git a/dlls/cryptext/Makefile.in b/dlls/cryptext/Makefile.in
|
||||
index 9c9f84cee8..0e817ffda6 100644
|
||||
--- a/dlls/cryptext/Makefile.in
|
||||
+++ b/dlls/cryptext/Makefile.in
|
||||
@@ -1,4 +1,5 @@
|
||||
-MODULE = cryptext.dll
|
||||
+MODULE = cryptext.dll
|
||||
+IMPORTS = crypt32 cryptui user32
|
||||
|
||||
EXTRADLLFLAGS = -mno-cygwin
|
||||
|
||||
diff --git a/dlls/cryptext/cryptext.spec b/dlls/cryptext/cryptext.spec
|
||||
index 0dba38e393..911ab2f4ba 100644
|
||||
--- a/dlls/cryptext/cryptext.spec
|
||||
+++ b/dlls/cryptext/cryptext.spec
|
||||
@@ -12,8 +12,8 @@
|
||||
@ stub CryptExtAddSPCW
|
||||
@ stub CryptExtOpenCAT
|
||||
@ stub CryptExtOpenCATW
|
||||
-@ stub CryptExtOpenCER
|
||||
-@ stub CryptExtOpenCERW
|
||||
+@ stdcall CryptExtOpenCER(long ptr str long)
|
||||
+@ stdcall CryptExtOpenCERW(long ptr wstr long)
|
||||
@ stub CryptExtOpenCRL
|
||||
@ stub CryptExtOpenCRLW
|
||||
@ stub CryptExtOpenCTL
|
||||
diff --git a/dlls/cryptext/cryptext_main.c b/dlls/cryptext/cryptext_main.c
|
||||
index f7c7bd1f55..2a381782d6 100644
|
||||
--- a/dlls/cryptext/cryptext_main.c
|
||||
+++ b/dlls/cryptext/cryptext_main.c
|
||||
@@ -22,10 +22,29 @@
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
+#include "winnls.h"
|
||||
+#include "wincrypt.h"
|
||||
+#include "winuser.h"
|
||||
+#include "cryptuiapi.h"
|
||||
+
|
||||
+#include "wine/heap.h"
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(cryptext);
|
||||
|
||||
+static WCHAR *heap_strdupAtoW(const char *str)
|
||||
+{
|
||||
+ WCHAR *ret;
|
||||
+ INT len;
|
||||
+
|
||||
+ if (!str) return NULL;
|
||||
+ len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
|
||||
+ ret = heap_alloc(len * sizeof(WCHAR));
|
||||
+ if (ret)
|
||||
+ MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID reserved)
|
||||
{
|
||||
TRACE("(%p, %u, %p)\n", instance, reason, reserved);
|
||||
@@ -59,3 +78,48 @@ HRESULT WINAPI CryptExtAddPFXW(LPCWSTR filename)
|
||||
FIXME("stub: %s\n", debugstr_w(filename));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
+
|
||||
+/***********************************************************************
|
||||
+ * CryptExtOpenCERW (CRYPTEXT.@)
|
||||
+ */
|
||||
+HRESULT WINAPI CryptExtOpenCERW(HWND hwnd, HINSTANCE hinst, LPCWSTR filename, DWORD showcmd)
|
||||
+{
|
||||
+ PCCERT_CONTEXT ctx;
|
||||
+ CRYPTUI_VIEWCERTIFICATE_STRUCTW info;
|
||||
+
|
||||
+ TRACE("(%p, %p, %s, %u)\n", hwnd, hinst, debugstr_w(filename), showcmd);
|
||||
+
|
||||
+ if (!CryptQueryObject(CERT_QUERY_OBJECT_FILE, filename, CERT_QUERY_CONTENT_FLAG_CERT,
|
||||
+ CERT_QUERY_FORMAT_FLAG_ALL, 0, NULL, NULL, NULL, NULL, NULL,
|
||||
+ (const void **)&ctx))
|
||||
+ {
|
||||
+ /* FIXME: move to the resources */
|
||||
+ static const WCHAR msg[] = {'T','h','i','s',' ','i','s',' ','n','o','t',' ','a',' ','v','a','l','i','d',' ','c','e','r','t','i','f','i','c','a','t','e',0};
|
||||
+ MessageBoxW(NULL, msg, filename, MB_OK | MB_ICONERROR);
|
||||
+ return S_OK; /* according to the tests */
|
||||
+ }
|
||||
+
|
||||
+ memset(&info, 0, sizeof(info));
|
||||
+ info.dwSize = sizeof(info);
|
||||
+ info.pCertContext = ctx;
|
||||
+ CryptUIDlgViewCertificateW(&info, NULL);
|
||||
+ CertFreeCertificateContext(ctx);
|
||||
+
|
||||
+ return S_OK;
|
||||
+}
|
||||
+
|
||||
+/***********************************************************************
|
||||
+ * CryptExtOpenCER (CRYPTEXT.@)
|
||||
+ */
|
||||
+HRESULT WINAPI CryptExtOpenCER(HWND hwnd, HINSTANCE hinst, LPCSTR filename, DWORD showcmd)
|
||||
+{
|
||||
+ HRESULT hr;
|
||||
+ LPWSTR filenameW;
|
||||
+
|
||||
+ TRACE("(%p, %p, %s, %u)\n", hwnd, hinst, debugstr_a(filename), showcmd);
|
||||
+
|
||||
+ filenameW = heap_strdupAtoW(filename);
|
||||
+ hr = CryptExtOpenCERW(hwnd, hinst, filenameW, showcmd);
|
||||
+ heap_free(filenameW);
|
||||
+ return hr;
|
||||
+}
|
||||
diff --git a/dlls/cryptext/tests/Makefile.in b/dlls/cryptext/tests/Makefile.in
|
||||
new file mode 100644
|
||||
index 0000000000..522fc60a4a
|
||||
--- /dev/null
|
||||
+++ b/dlls/cryptext/tests/Makefile.in
|
||||
@@ -0,0 +1,4 @@
|
||||
+TESTDLL = cryptext.dll
|
||||
+
|
||||
+C_SRCS = \
|
||||
+ cryptext.c
|
||||
diff --git a/dlls/cryptext/tests/cryptext.c b/dlls/cryptext/tests/cryptext.c
|
||||
new file mode 100644
|
||||
index 0000000000..cc62a772b5
|
||||
--- /dev/null
|
||||
+++ b/dlls/cryptext/tests/cryptext.c
|
||||
@@ -0,0 +1,61 @@
|
||||
+/*
|
||||
+ * Copyright 2019 Dmitry Timoshkov
|
||||
+ *
|
||||
+ * This library is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU Lesser General Public
|
||||
+ * License as published by the Free Software Foundation; either
|
||||
+ * version 2.1 of the License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This library is distributed in the hope that it will be useful,
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
+ * Lesser General Public License for more details.
|
||||
+ *
|
||||
+ * You should have received a copy of the GNU Lesser General Public
|
||||
+ * License along with this library; if not, write to the Free Software
|
||||
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
+ */
|
||||
+
|
||||
+#include <stdarg.h>
|
||||
+#include <assert.h>
|
||||
+#include <windef.h>
|
||||
+#include <winbase.h>
|
||||
+#include <winuser.h>
|
||||
+#include <winerror.h>
|
||||
+
|
||||
+#include "wine/test.h"
|
||||
+
|
||||
+static HRESULT (WINAPI *pCryptExtOpenCER)(HWND,HINSTANCE,LPCSTR,DWORD);
|
||||
+
|
||||
+static void test_CryptExtOpenCER(void)
|
||||
+{
|
||||
+ HRESULT hr;
|
||||
+
|
||||
+ if (!pCryptExtOpenCER)
|
||||
+ {
|
||||
+ win_skip("CryptExtOpenCER is not available on this platform\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (!winetest_interactive)
|
||||
+ {
|
||||
+ skip("CryptExtOpenCER test needs user interaction\n");
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ SetLastError(0xdeadbeef);
|
||||
+ hr = pCryptExtOpenCER(0, 0, "dead.beef", SW_HIDE);
|
||||
+ ok(hr == S_OK, "got %#x\n", hr);
|
||||
+
|
||||
+ hr = pCryptExtOpenCER(0, 0, "VeriSign Class 3 Public Primary Certification Authority - G4.txt", SW_SHOW);
|
||||
+ ok(hr == S_OK, "got %#x\n", hr);
|
||||
+}
|
||||
+
|
||||
+START_TEST(cryptext)
|
||||
+{
|
||||
+ HMODULE hmod = LoadLibraryA("cryptext.dll");
|
||||
+
|
||||
+ pCryptExtOpenCER = (void *)GetProcAddress(hmod, "CryptExtOpenCER");
|
||||
+
|
||||
+ test_CryptExtOpenCER();
|
||||
+}
|
||||
--
|
||||
2.17.1
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user