mirror of
https://gitlab.winehq.org/wine/wine-staging.git
synced 2025-04-13 14:42:51 -07:00
Rebase against ba9f3dc198dfc81bb40159077b73b797006bb73c
This commit is contained in:
parent
39cafb1db1
commit
e7bff1bb4f
@ -1,2 +1 @@
|
||||
Depends: ml-array_size
|
||||
Depends: ml-patches
|
||||
|
@ -1,7 +1,7 @@
|
||||
From 31a5f689a12c1db6edcc86dcd8e81f38a5f19fc5 Mon Sep 17 00:00:00 2001
|
||||
From baff5c160cf7f1ac0011bf8f55d506bf0346e1fd Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Mon, 7 Aug 2017 02:53:06 +0200
|
||||
Subject: user32: Start explorer.exe using limited rights.
|
||||
Subject: [PATCH] user32: Start explorer.exe using limited rights.
|
||||
|
||||
---
|
||||
dlls/advapi32/tests/security.c | 4 ++--
|
||||
@ -9,10 +9,10 @@ Subject: user32: Start explorer.exe using limited rights.
|
||||
2 files changed, 12 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
|
||||
index f1a64e29dea..52524ee6fe2 100644
|
||||
index f27642e7a7..0271cd72e0 100644
|
||||
--- a/dlls/advapi32/tests/security.c
|
||||
+++ b/dlls/advapi32/tests/security.c
|
||||
@@ -7387,7 +7387,7 @@ static void test_token_security_descriptor(void)
|
||||
@@ -7313,7 +7313,7 @@ static void test_token_security_descriptor(void)
|
||||
ret = GetTokenInformation(token4, TokenIntegrityLevel, buffer_integrity, sizeof(buffer_integrity), &size);
|
||||
ok(ret, "GetTokenInformation failed with error %u\n", GetLastError());
|
||||
tml = (TOKEN_MANDATORY_LABEL *)buffer_integrity;
|
||||
@ -21,7 +21,7 @@ index f1a64e29dea..52524ee6fe2 100644
|
||||
|
||||
size = 0;
|
||||
ret = GetKernelObjectSecurity(token4, LABEL_SECURITY_INFORMATION, NULL, 0, &size);
|
||||
@@ -7841,7 +7841,7 @@ static void test_child_token_sd_medium(void)
|
||||
@@ -7768,7 +7768,7 @@ static void test_child_token_sd_medium(void)
|
||||
ret = GetTokenInformation(token, TokenIntegrityLevel, buffer_integrity, sizeof(buffer_integrity), &size);
|
||||
ok(ret, "GetTokenInformation failed with error %u\n", GetLastError());
|
||||
tml = (TOKEN_MANDATORY_LABEL *)buffer_integrity;
|
||||
@ -31,7 +31,7 @@ index f1a64e29dea..52524ee6fe2 100644
|
||||
HeapFree(GetProcessHeap(), 0, sd);
|
||||
}
|
||||
diff --git a/dlls/user32/win.c b/dlls/user32/win.c
|
||||
index cbf22374374..ea116b9d139 100644
|
||||
index cbfd8bb14a..8039f54fb0 100644
|
||||
--- a/dlls/user32/win.c
|
||||
+++ b/dlls/user32/win.c
|
||||
@@ -43,6 +43,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(win);
|
||||
@ -43,15 +43,15 @@ index cbf22374374..ea116b9d139 100644
|
||||
static DWORD process_layout = ~0u;
|
||||
|
||||
static struct list window_surfaces = LIST_INIT( window_surfaces );
|
||||
@@ -2067,6 +2069,7 @@ HWND WINAPI GetDesktopWindow(void)
|
||||
WCHAR app[MAX_PATH + sizeof(explorer)/sizeof(WCHAR)];
|
||||
WCHAR cmdline[MAX_PATH + (sizeof(explorer) + sizeof(args))/sizeof(WCHAR)];
|
||||
@@ -2052,6 +2054,7 @@ HWND WINAPI GetDesktopWindow(void)
|
||||
WCHAR app[MAX_PATH + ARRAY_SIZE( explorer )];
|
||||
WCHAR cmdline[MAX_PATH + ARRAY_SIZE( explorer ) + ARRAY_SIZE( args )];
|
||||
WCHAR desktop[MAX_PATH];
|
||||
+ HANDLE token;
|
||||
void *redir;
|
||||
|
||||
SERVER_START_REQ( set_user_object_info )
|
||||
@@ -2099,9 +2102,12 @@ HWND WINAPI GetDesktopWindow(void)
|
||||
@@ -2084,9 +2087,12 @@ HWND WINAPI GetDesktopWindow(void)
|
||||
strcpyW( cmdline, app );
|
||||
strcatW( cmdline, args );
|
||||
|
||||
@ -66,7 +66,7 @@ index cbf22374374..ea116b9d139 100644
|
||||
{
|
||||
TRACE( "started explorer pid %04x tid %04x\n", pi.dwProcessId, pi.dwThreadId );
|
||||
WaitForInputIdle( pi.hProcess, 10000 );
|
||||
@@ -2111,6 +2117,8 @@ HWND WINAPI GetDesktopWindow(void)
|
||||
@@ -2096,6 +2102,8 @@ HWND WINAPI GetDesktopWindow(void)
|
||||
else WARN( "failed to start explorer, err %d\n", GetLastError() );
|
||||
Wow64RevertWow64FsRedirection( redir );
|
||||
|
||||
@ -76,5 +76,5 @@ index cbf22374374..ea116b9d139 100644
|
||||
{
|
||||
req->force = 1;
|
||||
--
|
||||
2.13.1
|
||||
2.18.0
|
||||
|
||||
|
@ -1,20 +1,20 @@
|
||||
From 71366dad7ac934b2e24cfcf19104b4589b91652a Mon Sep 17 00:00:00 2001
|
||||
From b14282d138ff6a5ad1d5c152d0a556c9ca648c36 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Mon, 7 Aug 2017 03:33:26 +0200
|
||||
Subject: server: Correctly assign security labels for tokens.
|
||||
Subject: [PATCH] server: Correctly assign security labels for tokens.
|
||||
|
||||
---
|
||||
dlls/advapi32/tests/security.c | 21 ++++++++++-----------
|
||||
server/process.c | 8 +-------
|
||||
dlls/advapi32/tests/security.c | 21 +++++++++--------
|
||||
server/process.c | 8 +------
|
||||
server/security.h | 2 +-
|
||||
server/token.c | 41 ++++++++++++++++++++++++-----------------
|
||||
server/token.c | 41 ++++++++++++++++++++--------------
|
||||
4 files changed, 36 insertions(+), 36 deletions(-)
|
||||
|
||||
diff --git a/dlls/advapi32/tests/security.c b/dlls/advapi32/tests/security.c
|
||||
index 52524ee6fe2..a35baab0e25 100644
|
||||
index 0271cd72e0..3b07e7cd2f 100644
|
||||
--- a/dlls/advapi32/tests/security.c
|
||||
+++ b/dlls/advapi32/tests/security.c
|
||||
@@ -7289,7 +7289,6 @@ static void test_token_security_descriptor(void)
|
||||
@@ -7215,7 +7215,6 @@ static void test_token_security_descriptor(void)
|
||||
defaulted = TRUE;
|
||||
ret = GetSecurityDescriptorDacl(sd2, &present, &acl2, &defaulted);
|
||||
ok(ret, "GetSecurityDescriptorDacl failed with error %u\n", GetLastError());
|
||||
@ -22,7 +22,7 @@ index 52524ee6fe2..a35baab0e25 100644
|
||||
ok(present, "DACL not present\n");
|
||||
|
||||
if (present)
|
||||
@@ -7410,7 +7409,7 @@ static void test_token_security_descriptor(void)
|
||||
@@ -7336,7 +7335,7 @@ static void test_token_security_descriptor(void)
|
||||
ok(ret, "GetAce failed with error %u\n", GetLastError());
|
||||
ok(ace->Header.AceType == SYSTEM_MANDATORY_LABEL_ACE_TYPE,
|
||||
"Unexpected ACE type %#x\n", ace->Header.AceType);
|
||||
@ -31,7 +31,7 @@ index 52524ee6fe2..a35baab0e25 100644
|
||||
"Expected medium integrity level\n");
|
||||
}
|
||||
|
||||
@@ -7463,8 +7462,8 @@ static void test_token_security_descriptor(void)
|
||||
@@ -7389,8 +7388,8 @@ static void test_token_security_descriptor(void)
|
||||
sacl = NULL;
|
||||
ret = GetSecurityDescriptorSacl(sd3, &present, &sacl, &defaulted);
|
||||
ok(ret, "GetSecurityDescriptorSacl failed with error %u\n", GetLastError());
|
||||
@ -42,7 +42,7 @@ index 52524ee6fe2..a35baab0e25 100644
|
||||
|
||||
if (sacl)
|
||||
{
|
||||
@@ -7513,8 +7512,8 @@ static void test_token_security_descriptor(void)
|
||||
@@ -7439,8 +7438,8 @@ static void test_token_security_descriptor(void)
|
||||
sacl = NULL;
|
||||
ret = GetSecurityDescriptorSacl(sd3, &present, &sacl, &defaulted);
|
||||
ok(ret, "GetSecurityDescriptorSacl failed with error %u\n", GetLastError());
|
||||
@ -53,7 +53,7 @@ index 52524ee6fe2..a35baab0e25 100644
|
||||
|
||||
if (sacl)
|
||||
{
|
||||
@@ -7578,8 +7577,8 @@ static void test_token_security_descriptor(void)
|
||||
@@ -7504,8 +7503,8 @@ static void test_token_security_descriptor(void)
|
||||
|
||||
ret = GetSecurityDescriptorSacl(sd3, &present, &sacl, &defaulted);
|
||||
ok(ret, "GetSecurityDescriptorSacl failed with error %u\n", GetLastError());
|
||||
@ -64,7 +64,7 @@ index 52524ee6fe2..a35baab0e25 100644
|
||||
|
||||
if (sacl)
|
||||
{
|
||||
@@ -7616,8 +7615,8 @@ static void test_token_security_descriptor(void)
|
||||
@@ -7542,8 +7541,8 @@ static void test_token_security_descriptor(void)
|
||||
sacl = NULL;
|
||||
ret = GetSecurityDescriptorSacl(sd3, &present, &sacl, &defaulted);
|
||||
ok(ret, "GetSecurityDescriptorSacl failed with error %u\n", GetLastError());
|
||||
@ -75,7 +75,7 @@ index 52524ee6fe2..a35baab0e25 100644
|
||||
|
||||
if (sacl)
|
||||
{
|
||||
@@ -7834,7 +7833,7 @@ static void test_child_token_sd_medium(void)
|
||||
@@ -7761,7 +7760,7 @@ static void test_child_token_sd_medium(void)
|
||||
ok(ret, "GetAce failed with error %u\n", GetLastError());
|
||||
ok(ace_label->Header.AceType == SYSTEM_MANDATORY_LABEL_ACE_TYPE,
|
||||
"Unexpected ACE type %#x\n", ace_label->Header.AceType);
|
||||
@ -85,10 +85,10 @@ index 52524ee6fe2..a35baab0e25 100644
|
||||
|
||||
memset(buffer_integrity, 0, sizeof(buffer_integrity));
|
||||
diff --git a/server/process.c b/server/process.c
|
||||
index ef2452fb8fb..ae998ab80b9 100644
|
||||
index 7d2206f274..74cc320f44 100644
|
||||
--- a/server/process.c
|
||||
+++ b/server/process.c
|
||||
@@ -571,17 +571,11 @@ struct thread *create_process( int fd, struct thread *parent_thread, int inherit
|
||||
@@ -567,17 +567,11 @@ struct thread *create_process( int fd, struct thread *parent_thread, int inherit
|
||||
: 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 */
|
||||
@ -108,7 +108,7 @@ index ef2452fb8fb..ae998ab80b9 100644
|
||||
if (pipe( request_pipe ) == -1)
|
||||
{
|
||||
diff --git a/server/security.h b/server/security.h
|
||||
index 32dfe5f8db9..87377ccd673 100644
|
||||
index 32dfe5f8db..87377ccd67 100644
|
||||
--- a/server/security.h
|
||||
+++ b/server/security.h
|
||||
@@ -59,7 +59,7 @@ extern int token_assign_label( struct token *token, PSID label );
|
||||
@ -121,10 +121,10 @@ index 32dfe5f8db9..87377ccd673 100644
|
||||
const LUID_AND_ATTRIBUTES *reqprivs,
|
||||
unsigned int count, LUID_AND_ATTRIBUTES *usedprivs);
|
||||
diff --git a/server/token.c b/server/token.c
|
||||
index c507294b49d..c6b0f0d39d3 100644
|
||||
index 28042471b0..e5639fc0d5 100644
|
||||
--- a/server/token.c
|
||||
+++ b/server/token.c
|
||||
@@ -686,7 +686,7 @@ static int filter_privilege( struct privilege *privilege, const LUID_AND_ATTRIBU
|
||||
@@ -668,7 +668,7 @@ static int filter_privilege( struct privilege *privilege, const LUID_AND_ATTRIBU
|
||||
struct token *token_duplicate( struct token *src_token, unsigned primary,
|
||||
int impersonation_level, const struct security_descriptor *sd,
|
||||
const LUID_AND_ATTRIBUTES *filter_privileges, unsigned int priv_count,
|
||||
@ -133,7 +133,7 @@ index c507294b49d..c6b0f0d39d3 100644
|
||||
{
|
||||
const luid_t *modified_id =
|
||||
primary || (impersonation_level == src_token->impersonation_level) ?
|
||||
@@ -750,6 +750,12 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
|
||||
@@ -735,6 +735,12 @@ struct token *token_duplicate( struct token *src_token, unsigned primary,
|
||||
if (sd) default_set_sd( &token->obj, sd, OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION |
|
||||
DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION );
|
||||
|
||||
@ -146,7 +146,7 @@ index c507294b49d..c6b0f0d39d3 100644
|
||||
return token;
|
||||
}
|
||||
|
||||
@@ -922,6 +928,12 @@ struct token *token_create_admin( void )
|
||||
@@ -907,6 +913,12 @@ struct token *token_create_admin( void )
|
||||
admin_source, NULL, -1, TokenElevationTypeFull, &high_label_sid );
|
||||
/* we really need a primary group */
|
||||
assert( token->primary_group );
|
||||
@ -159,7 +159,7 @@ index c507294b49d..c6b0f0d39d3 100644
|
||||
}
|
||||
|
||||
free( logon_sid );
|
||||
@@ -980,6 +992,12 @@ static struct token *token_create_limited( void )
|
||||
@@ -965,6 +977,12 @@ static struct token *token_create_limited( void )
|
||||
admin_source, NULL, -1, TokenElevationTypeLimited, &medium_label_sid );
|
||||
/* we really need a primary group */
|
||||
assert( token->primary_group );
|
||||
@ -172,7 +172,7 @@ index c507294b49d..c6b0f0d39d3 100644
|
||||
}
|
||||
|
||||
free( logon_sid );
|
||||
@@ -1448,7 +1466,8 @@ DECL_HANDLER(duplicate_token)
|
||||
@@ -1433,7 +1451,8 @@ DECL_HANDLER(duplicate_token)
|
||||
TOKEN_DUPLICATE,
|
||||
&token_ops )))
|
||||
{
|
||||
@ -182,7 +182,7 @@ index c507294b49d..c6b0f0d39d3 100644
|
||||
if (token)
|
||||
{
|
||||
unsigned int access = req->access ? req->access : get_handle_access( current->process, req->handle );
|
||||
@@ -1478,7 +1497,7 @@ DECL_HANDLER(filter_token)
|
||||
@@ -1463,7 +1482,7 @@ DECL_HANDLER(filter_token)
|
||||
group_count = get_sid_count( filter_groups, get_req_data_size() - priv_count * sizeof(LUID_AND_ATTRIBUTES) );
|
||||
|
||||
token = token_duplicate( src_token, src_token->primary, src_token->impersonation_level, NULL,
|
||||
@ -191,7 +191,7 @@ index c507294b49d..c6b0f0d39d3 100644
|
||||
if (token)
|
||||
{
|
||||
unsigned int access = get_handle_access( current->process, req->handle );
|
||||
@@ -1813,23 +1832,11 @@ DECL_HANDLER(set_token_default_dacl)
|
||||
@@ -1789,23 +1808,11 @@ DECL_HANDLER(set_token_default_dacl)
|
||||
DECL_HANDLER(create_token)
|
||||
{
|
||||
struct token *token;
|
||||
@ -218,5 +218,5 @@ index c507294b49d..c6b0f0d39d3 100644
|
||||
}
|
||||
}
|
||||
--
|
||||
2.13.1
|
||||
2.18.0
|
||||
|
||||
|
@ -1,26 +0,0 @@
|
||||
From 34607775675c9475973fd249b8a68a59935b0391 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
|
||||
Date: Thu, 30 Jul 2015 11:57:28 +1000
|
||||
Subject: d3dx9_36: Return a mesh in D3DXCreateTeapot
|
||||
|
||||
Fixes https://bugs.winehq.org/show_bug.cgi?id=36884
|
||||
---
|
||||
dlls/d3dx9_36/mesh.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c
|
||||
index 39d279d..59e385e4 100644
|
||||
--- a/dlls/d3dx9_36/mesh.c
|
||||
+++ b/dlls/d3dx9_36/mesh.c
|
||||
@@ -5153,7 +5153,7 @@ HRESULT WINAPI D3DXCreateTeapot(struct IDirect3DDevice9 *device,
|
||||
{
|
||||
FIXME("(%p, %p, %p): stub\n", device, mesh, adjacency);
|
||||
|
||||
- return E_NOTIMPL;
|
||||
+ return D3DXCreateSphere(device, 1.0f, 4, 4, mesh, adjacency);
|
||||
}
|
||||
|
||||
HRESULT WINAPI D3DXCreateTextA(struct IDirect3DDevice9 *device, HDC hdc, const char *text, float deviation,
|
||||
--
|
||||
2.5.0
|
||||
|
@ -1 +0,0 @@
|
||||
Fixes: [36884] Return a valid mesh in D3DXCreateTeapot
|
@ -1,4 +1,4 @@
|
||||
From 07d42b7a75491947866e6edb9d7746ca35274238 Mon Sep 17 00:00:00 2001
|
||||
From 25c2a52b1109022a01b8f59a22b8a04566af0d3c Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Michael=20M=C3=BCller?= <michael@fds-team.de>
|
||||
Date: Fri, 4 Mar 2016 22:22:42 +0100
|
||||
Subject: [PATCH] ddraw: Set ddsOldCaps correctly in ddraw7_GetCaps.
|
||||
@ -12,7 +12,7 @@ Subject: [PATCH] ddraw: Set ddsOldCaps correctly in ddraw7_GetCaps.
|
||||
5 files changed, 106 insertions(+)
|
||||
|
||||
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
|
||||
index ed90478..47f079f 100644
|
||||
index ed904785dd..47f079fb97 100644
|
||||
--- a/dlls/ddraw/ddraw.c
|
||||
+++ b/dlls/ddraw/ddraw.c
|
||||
@@ -1542,6 +1542,8 @@ static HRESULT WINAPI ddraw7_GetCaps(IDirectDraw7 *iface, DDCAPS *DriverCaps, DD
|
||||
@ -25,10 +25,10 @@ index ed90478..47f079f 100644
|
||||
|
||||
if(DriverCaps)
|
||||
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
|
||||
index c767d3a..70d4b8f 100644
|
||||
index d4fe1f294a..29d9d3afb7 100644
|
||||
--- a/dlls/ddraw/tests/ddraw1.c
|
||||
+++ b/dlls/ddraw/tests/ddraw1.c
|
||||
@@ -11411,6 +11411,31 @@ static void test_execute_data(void)
|
||||
@@ -11538,6 +11538,31 @@ static void test_execute_data(void)
|
||||
DestroyWindow(window);
|
||||
}
|
||||
|
||||
@ -60,7 +60,7 @@ index c767d3a..70d4b8f 100644
|
||||
static void test_viewport(void)
|
||||
{
|
||||
static struct
|
||||
@@ -11686,6 +11711,7 @@ START_TEST(ddraw1)
|
||||
@@ -11815,6 +11840,7 @@ START_TEST(ddraw1)
|
||||
test_depth_readback();
|
||||
test_clear();
|
||||
test_enum_surfaces();
|
||||
@ -69,10 +69,10 @@ index c767d3a..70d4b8f 100644
|
||||
test_viewport();
|
||||
}
|
||||
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
|
||||
index 794f90b..9c6055e 100644
|
||||
index 941d46bf42..752b39568d 100644
|
||||
--- a/dlls/ddraw/tests/ddraw2.c
|
||||
+++ b/dlls/ddraw/tests/ddraw2.c
|
||||
@@ -12673,6 +12673,31 @@ static void test_enum_surfaces(void)
|
||||
@@ -12800,6 +12800,31 @@ static void test_enum_surfaces(void)
|
||||
IDirectDraw2_Release(ddraw);
|
||||
}
|
||||
|
||||
@ -104,7 +104,7 @@ index 794f90b..9c6055e 100644
|
||||
static void test_viewport(void)
|
||||
{
|
||||
static struct
|
||||
@@ -12977,5 +13002,6 @@ START_TEST(ddraw2)
|
||||
@@ -13106,5 +13131,6 @@ START_TEST(ddraw2)
|
||||
test_depth_readback();
|
||||
test_clear();
|
||||
test_enum_surfaces();
|
||||
@ -112,10 +112,10 @@ index 794f90b..9c6055e 100644
|
||||
test_viewport();
|
||||
}
|
||||
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
|
||||
index 172d99d..c036a6d 100644
|
||||
index e81472d4f2..4e083ec503 100644
|
||||
--- a/dlls/ddraw/tests/ddraw4.c
|
||||
+++ b/dlls/ddraw/tests/ddraw4.c
|
||||
@@ -14953,6 +14953,31 @@ static void test_viewport(void)
|
||||
@@ -15089,6 +15089,31 @@ static void test_viewport(void)
|
||||
DestroyWindow(window);
|
||||
}
|
||||
|
||||
@ -147,17 +147,17 @@ index 172d99d..c036a6d 100644
|
||||
START_TEST(ddraw4)
|
||||
{
|
||||
DDDEVICEIDENTIFIER identifier;
|
||||
@@ -15078,4 +15103,5 @@ START_TEST(ddraw4)
|
||||
@@ -15215,4 +15240,5 @@ START_TEST(ddraw4)
|
||||
test_clear();
|
||||
test_enum_surfaces();
|
||||
test_viewport();
|
||||
+ test_caps();
|
||||
}
|
||||
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
|
||||
index 7cbf408..095212b 100644
|
||||
index 70318a8492..f3dde436d3 100644
|
||||
--- a/dlls/ddraw/tests/ddraw7.c
|
||||
+++ b/dlls/ddraw/tests/ddraw7.c
|
||||
@@ -14417,6 +14417,31 @@ static void test_color_vertex(void)
|
||||
@@ -15035,6 +15035,31 @@ static void test_color_vertex(void)
|
||||
DestroyWindow(window);
|
||||
}
|
||||
|
||||
@ -189,13 +189,13 @@ index 7cbf408..095212b 100644
|
||||
START_TEST(ddraw7)
|
||||
{
|
||||
DDDEVICEIDENTIFIER2 identifier;
|
||||
@@ -14552,5 +14577,6 @@ START_TEST(ddraw7)
|
||||
test_clear();
|
||||
@@ -15172,5 +15197,6 @@ START_TEST(ddraw7)
|
||||
test_enum_surfaces();
|
||||
test_viewport();
|
||||
test_device_load();
|
||||
+ test_caps();
|
||||
test_color_vertex();
|
||||
}
|
||||
--
|
||||
1.9.1
|
||||
2.18.0
|
||||
|
||||
|
@ -1,26 +0,0 @@
|
||||
From 1b821d7a8398741a164800039535aaad396c299e Mon Sep 17 00:00:00 2001
|
||||
From: Nikolay Sivov <nsivov@codeweavers.com>
|
||||
Date: Tue, 31 Jul 2018 08:35:01 +0300
|
||||
Subject: [PATCH] dwrite: Avoid possible out-of-bounds cluster metrics access.
|
||||
|
||||
Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
|
||||
---
|
||||
dlls/dwrite/layout.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/dwrite/layout.c b/dlls/dwrite/layout.c
|
||||
index 306c1178d4..903e7e8978 100644
|
||||
--- a/dlls/dwrite/layout.c
|
||||
+++ b/dlls/dwrite/layout.c
|
||||
@@ -2089,7 +2089,7 @@ static HRESULT layout_compute_effective_runs(struct dwrite_textlayout *layout)
|
||||
*/
|
||||
if (layout->len == 0)
|
||||
hr = layout_set_dummy_line_metrics(layout, 0);
|
||||
- else if (layout->clustermetrics[layout->cluster_count - 1].isNewline)
|
||||
+ else if (layout->cluster_count && layout->clustermetrics[layout->cluster_count - 1].isNewline)
|
||||
hr = layout_set_dummy_line_metrics(layout, layout->len - 1);
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
--
|
||||
2.18.0
|
||||
|
@ -1,2 +0,0 @@
|
||||
Fixes: [45535] - dwrite Correct out of access
|
||||
|
@ -1,4 +1,4 @@
|
||||
From 6cd8711153dfad60cf2816d2f9f07189bd37719b Mon Sep 17 00:00:00 2001
|
||||
From de4b7a3055065faed4cdc9ca253248eed5a3a7bb Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Tue, 15 Nov 2016 13:02:13 +0800
|
||||
Subject: [PATCH] kernel32: MoveFile(source, source) should succeed.
|
||||
@ -11,7 +11,7 @@ Subject: [PATCH] kernel32: MoveFile(source, source) should succeed.
|
||||
4 files changed, 14 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c
|
||||
index 232ea7e..ba75b7e 100644
|
||||
index bde58e9dc4..c7c5cbd3f7 100644
|
||||
--- a/dlls/kernel32/path.c
|
||||
+++ b/dlls/kernel32/path.c
|
||||
@@ -1354,7 +1354,7 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest,
|
||||
@ -21,10 +21,10 @@ index 232ea7e..ba75b7e 100644
|
||||
- HANDLE source_handle = 0, dest_handle;
|
||||
+ HANDLE source_handle = 0, dest_handle = 0;
|
||||
ANSI_STRING source_unix, dest_unix;
|
||||
DWORD options;
|
||||
|
||||
TRACE("(%s,%s,%p,%p,%04x)\n",
|
||||
@@ -1413,18 +1413,22 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest,
|
||||
FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT );
|
||||
@@ -1414,18 +1414,22 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest,
|
||||
status = NtOpenFile( &dest_handle, GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE, &attr, &io, 0, options );
|
||||
if (status == STATUS_SUCCESS) /* destination exists */
|
||||
{
|
||||
- NtClose( dest_handle );
|
||||
@ -50,7 +50,7 @@ index 232ea7e..ba75b7e 100644
|
||||
}
|
||||
else if (status != STATUS_OBJECT_NAME_NOT_FOUND)
|
||||
{
|
||||
@@ -1484,6 +1488,7 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest,
|
||||
@@ -1485,6 +1489,7 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest,
|
||||
|
||||
error:
|
||||
if (source_handle) NtClose( source_handle );
|
||||
@ -59,7 +59,7 @@ index 232ea7e..ba75b7e 100644
|
||||
RtlFreeAnsiString( &dest_unix );
|
||||
return FALSE;
|
||||
diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c
|
||||
index e201f62..e152cf1 100644
|
||||
index ef4eebc31c..07b3ffb77b 100644
|
||||
--- a/dlls/kernel32/tests/file.c
|
||||
+++ b/dlls/kernel32/tests/file.c
|
||||
@@ -1886,7 +1886,7 @@ static void test_MoveFileA(void)
|
||||
@ -72,10 +72,10 @@ index e201f62..e152cf1 100644
|
||||
ret = MoveFileA(source, dest);
|
||||
ok(!ret && GetLastError() == ERROR_ALREADY_EXISTS,
|
||||
diff --git a/dlls/msvcp120/tests/msvcp120.c b/dlls/msvcp120/tests/msvcp120.c
|
||||
index 969902d..d6051b0 100644
|
||||
index d7b82a3aae..5141622d6a 100644
|
||||
--- a/dlls/msvcp120/tests/msvcp120.c
|
||||
+++ b/dlls/msvcp120/tests/msvcp120.c
|
||||
@@ -1402,7 +1402,7 @@ static void test_tr2_sys__Rename(void)
|
||||
@@ -1524,7 +1524,7 @@ static void test_tr2_sys__Rename(void)
|
||||
CloseHandle(file);
|
||||
|
||||
ret = p_tr2_sys__Rename("tr2_test_dir\\f1", "tr2_test_dir\\f1");
|
||||
@ -85,10 +85,10 @@ index 969902d..d6051b0 100644
|
||||
errno = 0xdeadbeef;
|
||||
if(tests[i].val == ERROR_SUCCESS) {
|
||||
diff --git a/programs/cmd/tests/test_builtins.cmd.exp b/programs/cmd/tests/test_builtins.cmd.exp
|
||||
index dcc9629..e16f9f3 100644
|
||||
index ea4157c09d..298c4e9a9e 100644
|
||||
--- a/programs/cmd/tests/test_builtins.cmd.exp
|
||||
+++ b/programs/cmd/tests/test_builtins.cmd.exp
|
||||
@@ -1261,8 +1261,8 @@ file move succeeded
|
||||
@@ -1295,8 +1295,8 @@ file move succeeded
|
||||
@todo_wine@bar@or_broken@baz
|
||||
read-only files are moveable
|
||||
file moved in subdirectory
|
||||
@ -100,5 +100,5 @@ index dcc9629..e16f9f3 100644
|
||||
simple directory move succeeded
|
||||
moving a directory to itself gives error; errlevel 1
|
||||
--
|
||||
1.9.1
|
||||
2.18.0
|
||||
|
||||
|
@ -1,19 +1,19 @@
|
||||
From 96e7b57c5591087cfd07b0658ac33a1ec6bde3b5 Mon Sep 17 00:00:00 2001
|
||||
From 8031fda3ffc4d2469524f21198ef0aaf9725562e Mon Sep 17 00:00:00 2001
|
||||
From: Dmitry Timoshkov <dmitry@baikal.ru>
|
||||
Date: Tue, 15 Nov 2016 13:32:42 +0800
|
||||
Subject: kernel32: MoveFile should make sure that it has the delete access to
|
||||
the source file.
|
||||
Subject: [PATCH] kernel32: MoveFile should make sure that it has the delete
|
||||
access to the source file.
|
||||
|
||||
---
|
||||
dlls/kernel32/path.c | 6 ++++--
|
||||
dlls/kernel32/path.c | 4 ++--
|
||||
dlls/kernel32/tests/file.c | 20 ++++++++------------
|
||||
2 files changed, 12 insertions(+), 14 deletions(-)
|
||||
2 files changed, 10 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/dlls/kernel32/path.c b/dlls/kernel32/path.c
|
||||
index f554d14..d7fc20e 100644
|
||||
index c7c5cbd3f7..5388586094 100644
|
||||
--- a/dlls/kernel32/path.c
|
||||
+++ b/dlls/kernel32/path.c
|
||||
@@ -1338,7 +1338,8 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest,
|
||||
@@ -1383,7 +1383,8 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest,
|
||||
attr.SecurityDescriptor = NULL;
|
||||
attr.SecurityQualityOfService = NULL;
|
||||
|
||||
@ -23,21 +23,19 @@ index f554d14..d7fc20e 100644
|
||||
if (status == STATUS_SUCCESS)
|
||||
status = wine_nt_to_unix_file_name( &nt_name, &source_unix, FILE_OPEN, FALSE );
|
||||
RtlFreeUnicodeString( &nt_name );
|
||||
@@ -1362,7 +1363,8 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest,
|
||||
@@ -1407,7 +1408,6 @@ BOOL WINAPI MoveFileWithProgressW( LPCWSTR source, LPCWSTR dest,
|
||||
SetLastError( ERROR_PATH_NOT_FOUND );
|
||||
goto error;
|
||||
}
|
||||
- status = NtOpenFile( &dest_handle, GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE, &attr, &io, 0,
|
||||
+ status = NtOpenFile( &dest_handle, GENERIC_READ | GENERIC_WRITE | SYNCHRONIZE, &attr, &io,
|
||||
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
|
||||
FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT );
|
||||
if (status == STATUS_SUCCESS) /* destination exists */
|
||||
{
|
||||
-
|
||||
options = FILE_NON_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT;
|
||||
if (flag & MOVEFILE_WRITE_THROUGH)
|
||||
options |= FILE_WRITE_THROUGH;
|
||||
diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c
|
||||
index f0f9232..6fcf019 100644
|
||||
index 07b3ffb77b..4729e75728 100644
|
||||
--- a/dlls/kernel32/tests/file.c
|
||||
+++ b/dlls/kernel32/tests/file.c
|
||||
@@ -1905,12 +1905,10 @@ static void test_MoveFileA(void)
|
||||
@@ -1906,12 +1906,10 @@ static void test_MoveFileA(void)
|
||||
ok(hmapfile != NULL, "CreateFileMapping: error %d\n", GetLastError());
|
||||
|
||||
ret = MoveFileA(source, dest);
|
||||
@ -54,7 +52,7 @@ index f0f9232..6fcf019 100644
|
||||
|
||||
CloseHandle(hmapfile);
|
||||
CloseHandle(hfile);
|
||||
@@ -1925,12 +1923,10 @@ static void test_MoveFileA(void)
|
||||
@@ -1926,12 +1924,10 @@ static void test_MoveFileA(void)
|
||||
ok(hmapfile != NULL, "CreateFileMapping: error %d\n", GetLastError());
|
||||
|
||||
ret = MoveFileA(source, dest);
|
||||
@ -72,5 +70,5 @@ index f0f9232..6fcf019 100644
|
||||
CloseHandle(hmapfile);
|
||||
CloseHandle(hfile);
|
||||
--
|
||||
2.9.0
|
||||
2.18.0
|
||||
|
||||
|
@ -1,141 +0,0 @@
|
||||
From 4944b0ed67011898a68fb244bdd947a15ef1c8ab Mon Sep 17 00:00:00 2001
|
||||
From: Michael Stefaniuc <mstefani@winehq.org>
|
||||
Date: Wed, 18 Jul 2018 18:37:52 +0200
|
||||
Subject: [PATCH] windowscodecs: Use the ARRAY_SIZE() macro
|
||||
|
||||
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
|
||||
---
|
||||
dlls/windowscodecs/bitmap.c | 2 +-
|
||||
dlls/windowscodecs/bmpencode.c | 2 +-
|
||||
dlls/windowscodecs/jpegformat.c | 2 +-
|
||||
dlls/windowscodecs/metadataquery.c | 10 +++++-----
|
||||
dlls/windowscodecs/pngformat.c | 4 ++--
|
||||
dlls/windowscodecs/tiffformat.c | 2 +-
|
||||
6 files changed, 11 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/dlls/windowscodecs/bitmap.c b/dlls/windowscodecs/bitmap.c
|
||||
index f8414962f2..116fd3134a 100644
|
||||
--- a/dlls/windowscodecs/bitmap.c
|
||||
+++ b/dlls/windowscodecs/bitmap.c
|
||||
@@ -555,7 +555,7 @@ static HRESULT WINAPI IMILBitmapImpl_GetPixelFormat(IMILBitmapSource *iface,
|
||||
|
||||
*format = 0;
|
||||
|
||||
- for (i = 0; i < sizeof(pixel_fmt_map)/sizeof(pixel_fmt_map[0]); i++)
|
||||
+ for (i = 0; i < ARRAY_SIZE(pixel_fmt_map); i++)
|
||||
{
|
||||
if (IsEqualGUID(pixel_fmt_map[i].WIC_format, &This->pixelformat))
|
||||
{
|
||||
diff --git a/dlls/windowscodecs/bmpencode.c b/dlls/windowscodecs/bmpencode.c
|
||||
index 97f30d7197..aa65675a98 100644
|
||||
--- a/dlls/windowscodecs/bmpencode.c
|
||||
+++ b/dlls/windowscodecs/bmpencode.c
|
||||
@@ -529,7 +529,7 @@ static HRESULT WINAPI BmpEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
|
||||
|
||||
if (ppIEncoderOptions)
|
||||
{
|
||||
- hr = CreatePropertyBag2(opts, sizeof(opts)/sizeof(opts[0]), ppIEncoderOptions);
|
||||
+ hr = CreatePropertyBag2(opts, ARRAY_SIZE(opts), ppIEncoderOptions);
|
||||
if (FAILED(hr)) return hr;
|
||||
}
|
||||
|
||||
diff --git a/dlls/windowscodecs/jpegformat.c b/dlls/windowscodecs/jpegformat.c
|
||||
index f05663f070..d24af6dc9e 100644
|
||||
--- a/dlls/windowscodecs/jpegformat.c
|
||||
+++ b/dlls/windowscodecs/jpegformat.c
|
||||
@@ -1463,7 +1463,7 @@ static HRESULT WINAPI JpegEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
|
||||
|
||||
if (ppIEncoderOptions)
|
||||
{
|
||||
- hr = CreatePropertyBag2(opts, sizeof(opts)/sizeof(opts[0]), ppIEncoderOptions);
|
||||
+ hr = CreatePropertyBag2(opts, ARRAY_SIZE(opts), ppIEncoderOptions);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
LeaveCriticalSection(&This->lock);
|
||||
diff --git a/dlls/windowscodecs/metadataquery.c b/dlls/windowscodecs/metadataquery.c
|
||||
index e33884881b..2d7c918921 100644
|
||||
--- a/dlls/windowscodecs/metadataquery.c
|
||||
+++ b/dlls/windowscodecs/metadataquery.c
|
||||
@@ -164,7 +164,7 @@ static VARTYPE map_type(struct string_t *str)
|
||||
{
|
||||
UINT i;
|
||||
|
||||
- for (i = 0; i < sizeof(str2vt)/sizeof(str2vt[0]); i++)
|
||||
+ for (i = 0; i < ARRAY_SIZE(str2vt); i++)
|
||||
{
|
||||
if (str2vt[i].len == str->len)
|
||||
{
|
||||
@@ -743,7 +743,7 @@ HRESULT WINAPI WICMapGuidToShortName(REFGUID guid, UINT len, WCHAR *name, UINT *
|
||||
|
||||
if (!guid) return E_INVALIDARG;
|
||||
|
||||
- for (i = 0; i < sizeof(guid2name)/sizeof(guid2name[0]); i++)
|
||||
+ for (i = 0; i < ARRAY_SIZE(guid2name); i++)
|
||||
{
|
||||
if (IsEqualGUID(guid, guid2name[i].guid))
|
||||
{
|
||||
@@ -774,7 +774,7 @@ HRESULT WINAPI WICMapShortNameToGuid(PCWSTR name, GUID *guid)
|
||||
|
||||
if (!name || !guid) return E_INVALIDARG;
|
||||
|
||||
- for (i = 0; i < sizeof(guid2name)/sizeof(guid2name[0]); i++)
|
||||
+ for (i = 0; i < ARRAY_SIZE(guid2name); i++)
|
||||
{
|
||||
if (!lstrcmpiW(name, guid2name[i].name))
|
||||
{
|
||||
@@ -884,7 +884,7 @@ static const WCHAR *map_shortname_to_schema(const GUID *format, const WCHAR *nam
|
||||
!IsEqualGUID(format, &GUID_MetadataFormatXMPStruct))
|
||||
return NULL;
|
||||
|
||||
- for (i = 0; i < sizeof(name2schema)/sizeof(name2schema[0]); i++)
|
||||
+ for (i = 0; i < ARRAY_SIZE(name2schema); i++)
|
||||
{
|
||||
if (!lstrcmpW(name2schema[i].name, name))
|
||||
return name2schema[i].schema;
|
||||
@@ -909,7 +909,7 @@ HRESULT WINAPI WICMapSchemaToName(REFGUID format, LPWSTR schema, UINT len, WCHAR
|
||||
!IsEqualGUID(format, &GUID_MetadataFormatXMPStruct))
|
||||
return WINCODEC_ERR_PROPERTYNOTFOUND;
|
||||
|
||||
- for (i = 0; i < sizeof(name2schema)/sizeof(name2schema[0]); i++)
|
||||
+ for (i = 0; i < ARRAY_SIZE(name2schema); i++)
|
||||
{
|
||||
if (!lstrcmpW(name2schema[i].schema, schema))
|
||||
{
|
||||
diff --git a/dlls/windowscodecs/pngformat.c b/dlls/windowscodecs/pngformat.c
|
||||
index fd0d197bb3..6b13112130 100644
|
||||
--- a/dlls/windowscodecs/pngformat.c
|
||||
+++ b/dlls/windowscodecs/pngformat.c
|
||||
@@ -1441,7 +1441,7 @@ static HRESULT WINAPI PngFrameEncode_Initialize(IWICBitmapFrameEncode *iface,
|
||||
|
||||
if (pIEncoderOptions)
|
||||
{
|
||||
- hr = IPropertyBag2_Read(pIEncoderOptions, sizeof(opts)/sizeof(opts[0]), opts, NULL, opt_values, opt_hres);
|
||||
+ hr = IPropertyBag2_Read(pIEncoderOptions, ARRAY_SIZE(opts), opts, NULL, opt_values, opt_hres);
|
||||
|
||||
if (FAILED(hr))
|
||||
return hr;
|
||||
@@ -2046,7 +2046,7 @@ static HRESULT WINAPI PngEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
|
||||
|
||||
if (ppIEncoderOptions)
|
||||
{
|
||||
- hr = CreatePropertyBag2(opts, sizeof(opts)/sizeof(opts[0]), ppIEncoderOptions);
|
||||
+ hr = CreatePropertyBag2(opts, ARRAY_SIZE(opts), ppIEncoderOptions);
|
||||
if (FAILED(hr))
|
||||
{
|
||||
LeaveCriticalSection(&This->lock);
|
||||
diff --git a/dlls/windowscodecs/tiffformat.c b/dlls/windowscodecs/tiffformat.c
|
||||
index 2b2f84f859..966ab3eb4b 100644
|
||||
--- a/dlls/windowscodecs/tiffformat.c
|
||||
+++ b/dlls/windowscodecs/tiffformat.c
|
||||
@@ -1956,7 +1956,7 @@ static HRESULT WINAPI TiffEncoder_CreateNewFrame(IWICBitmapEncoder *iface,
|
||||
|
||||
if (ppIEncoderOptions && SUCCEEDED(hr))
|
||||
{
|
||||
- hr = CreatePropertyBag2(opts, sizeof(opts)/sizeof(opts[0]), ppIEncoderOptions);
|
||||
+ hr = CreatePropertyBag2(opts, ARRAY_SIZE(opts), ppIEncoderOptions);
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
VARIANT v;
|
||||
--
|
||||
2.14.4
|
||||
|
@ -1,147 +0,0 @@
|
||||
From a786168729fc3af234574a6f2a9baa7ea562a9ee Mon Sep 17 00:00:00 2001
|
||||
From: Michael Stefaniuc <mstefani@winehq.org>
|
||||
Date: Fri, 20 Jul 2018 14:20:24 +0200
|
||||
Subject: [PATCH] localspl: Use the ARRAY_SIZE() macro
|
||||
|
||||
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
|
||||
---
|
||||
dlls/localspl/localmon.c | 10 +++++-----
|
||||
dlls/localspl/provider.c | 20 ++++++++++----------
|
||||
2 files changed, 15 insertions(+), 15 deletions(-)
|
||||
|
||||
diff --git a/dlls/localspl/localmon.c b/dlls/localspl/localmon.c
|
||||
index 4be1ad6101..8553aa2297 100644
|
||||
--- a/dlls/localspl/localmon.c
|
||||
+++ b/dlls/localspl/localmon.c
|
||||
@@ -279,10 +279,10 @@ static DWORD get_type_from_name(LPCWSTR name)
|
||||
{
|
||||
HANDLE hfile;
|
||||
|
||||
- if (!strncmpW(name, portname_LPT, sizeof(portname_LPT) / sizeof(WCHAR) -1))
|
||||
+ if (!strncmpW(name, portname_LPT, ARRAY_SIZE(portname_LPT) -1))
|
||||
return PORT_IS_LPT;
|
||||
|
||||
- if (!strncmpW(name, portname_COM, sizeof(portname_COM) / sizeof(WCHAR) -1))
|
||||
+ if (!strncmpW(name, portname_COM, ARRAY_SIZE(portname_COM) -1))
|
||||
return PORT_IS_COM;
|
||||
|
||||
if (!strcmpW(name, portname_FILE))
|
||||
@@ -294,10 +294,10 @@ static DWORD get_type_from_name(LPCWSTR name)
|
||||
if (name[0] == '|')
|
||||
return PORT_IS_PIPE;
|
||||
|
||||
- if (!strncmpW(name, portname_CUPS, sizeof(portname_CUPS) / sizeof(WCHAR) -1))
|
||||
+ if (!strncmpW(name, portname_CUPS, ARRAY_SIZE(portname_CUPS) -1))
|
||||
return PORT_IS_CUPS;
|
||||
|
||||
- if (!strncmpW(name, portname_LPR, sizeof(portname_LPR) / sizeof(WCHAR) -1))
|
||||
+ if (!strncmpW(name, portname_LPR, ARRAY_SIZE(portname_LPR) -1))
|
||||
return PORT_IS_LPR;
|
||||
|
||||
/* Must be a file or a directory. Does the file exist ? */
|
||||
@@ -704,7 +704,7 @@ static DWORD WINAPI localmon_XcvDataPort(HANDLE hXcv, LPCWSTR pszDataName, PBYTE
|
||||
{
|
||||
ptr = ((xcv_t *)hXcv)->nameW;
|
||||
}
|
||||
- lstrcpynW(buffer, ptr, sizeof(buffer)/sizeof(WCHAR));
|
||||
+ lstrcpynW(buffer, ptr, ARRAY_SIZE(buffer));
|
||||
if (buffer[0]) buffer[lstrlenW(buffer)-1] = '\0'; /* remove the ':' */
|
||||
res = SetDefaultCommConfigW(buffer, (LPCOMMCONFIG) pInputData, cbInputData);
|
||||
TRACE("got %u with %u\n", res, GetLastError() );
|
||||
diff --git a/dlls/localspl/provider.c b/dlls/localspl/provider.c
|
||||
index 3538947281..c17d982fa7 100644
|
||||
--- a/dlls/localspl/provider.c
|
||||
+++ b/dlls/localspl/provider.c
|
||||
@@ -275,7 +275,7 @@ static LONG copy_servername_from_name(LPCWSTR name, LPWSTR target)
|
||||
target[serverlen] = '\0';
|
||||
}
|
||||
|
||||
- len = sizeof(buffer) / sizeof(buffer[0]);
|
||||
+ len = ARRAY_SIZE(buffer);
|
||||
if (GetComputerNameW(buffer, &len)) {
|
||||
if ((serverlen == len) && (strncmpiW(server, buffer, len) == 0)) {
|
||||
/* The requested Servername is our computername */
|
||||
@@ -693,7 +693,7 @@ static const printenv_t * validate_envW(LPCWSTR env)
|
||||
TRACE("(%s)\n", debugstr_w(env));
|
||||
if (env && env[0])
|
||||
{
|
||||
- for (i = 0; i < sizeof(all_printenv)/sizeof(all_printenv[0]); i++)
|
||||
+ for (i = 0; i < ARRAY_SIZE(all_printenv); i++)
|
||||
{
|
||||
if (lstrcmpiW(env, all_printenv[i]->envname) == 0)
|
||||
{
|
||||
@@ -749,7 +749,7 @@ static DWORD get_local_monitors(DWORD level, LPBYTE pMonitors, DWORD cbBuf, LPDW
|
||||
ptr = (LPWSTR) &pMonitors[len];
|
||||
|
||||
numentries = 0;
|
||||
- len = sizeof(buffer)/sizeof(buffer[0]);
|
||||
+ len = ARRAY_SIZE(buffer);
|
||||
buffer[0] = '\0';
|
||||
|
||||
/* Windows creates the "Monitors"-Key on reboot / start "spooler" */
|
||||
@@ -802,7 +802,7 @@ static DWORD get_local_monitors(DWORD level, LPBYTE pMonitors, DWORD cbBuf, LPDW
|
||||
}
|
||||
}
|
||||
index++;
|
||||
- len = sizeof(buffer)/sizeof(buffer[0]);
|
||||
+ len = ARRAY_SIZE(buffer);
|
||||
buffer[0] = '\0';
|
||||
}
|
||||
RegCloseKey(hroot);
|
||||
@@ -838,7 +838,7 @@ static DWORD get_local_printprocessors(LPWSTR regpathW, LPBYTE pPPInfo, DWORD cb
|
||||
ptr = (LPWSTR) &pPPInfo[len];
|
||||
|
||||
numentries = 0;
|
||||
- len = sizeof(buffer)/sizeof(buffer[0]);
|
||||
+ len = ARRAY_SIZE(buffer);
|
||||
buffer[0] = '\0';
|
||||
|
||||
if (RegCreateKeyW(HKEY_LOCAL_MACHINE, regpathW, &hroot) == ERROR_SUCCESS) {
|
||||
@@ -852,7 +852,7 @@ static DWORD get_local_printprocessors(LPWSTR regpathW, LPBYTE pPPInfo, DWORD cb
|
||||
TRACE("%p: writing PRINTPROCESSOR_INFO_1W #%d\n", ppi, numentries);
|
||||
ppi->pName = ptr;
|
||||
lstrcpyW(ptr, winprintW); /* Name of the Print Processor */
|
||||
- ptr += sizeof(winprintW) / sizeof(WCHAR);
|
||||
+ ptr += ARRAY_SIZE(winprintW);
|
||||
}
|
||||
|
||||
/* Scan all Printprocessor Keys */
|
||||
@@ -888,7 +888,7 @@ static DWORD get_local_printprocessors(LPWSTR regpathW, LPBYTE pPPInfo, DWORD cb
|
||||
}
|
||||
}
|
||||
index++;
|
||||
- len = sizeof(buffer)/sizeof(buffer[0]);
|
||||
+ len = ARRAY_SIZE(buffer);
|
||||
buffer[0] = '\0';
|
||||
}
|
||||
RegCloseKey(hroot);
|
||||
@@ -1196,7 +1196,7 @@ static HANDLE printer_alloc_handle(LPCWSTR name, LPPRINTER_DEFAULTSW pDefault)
|
||||
printer = NULL;
|
||||
}
|
||||
if (printername) {
|
||||
- len = sizeof(XcvMonitorW)/sizeof(WCHAR) - 1;
|
||||
+ len = ARRAY_SIZE(XcvMonitorW) - 1;
|
||||
if (strncmpW(printername, XcvMonitorW, len) == 0) {
|
||||
/* OpenPrinter(",XcvMonitor ", ...) detected */
|
||||
TRACE(",XcvMonitor: %s\n", debugstr_w(&printername[len]));
|
||||
@@ -1210,7 +1210,7 @@ static HANDLE printer_alloc_handle(LPCWSTR name, LPPRINTER_DEFAULTSW pDefault)
|
||||
}
|
||||
else
|
||||
{
|
||||
- len = sizeof(XcvPortW)/sizeof(WCHAR) - 1;
|
||||
+ len = ARRAY_SIZE(XcvPortW) - 1;
|
||||
if (strncmpW( printername, XcvPortW, len) == 0) {
|
||||
/* OpenPrinter(",XcvPort ", ...) detected */
|
||||
TRACE(",XcvPort: %s\n", debugstr_w(&printername[len]));
|
||||
@@ -1303,7 +1303,7 @@ static BOOL myAddPrinterDriverEx(DWORD level, LPBYTE pDriverInfo, DWORD dwFileCo
|
||||
DRIVER_INFO, that the caller supplied */
|
||||
|
||||
ZeroMemory(&di, sizeof(di));
|
||||
- if (pDriverInfo && (level < (sizeof(di_sizeof) / sizeof(di_sizeof[0])))) {
|
||||
+ if (pDriverInfo && (level < ARRAY_SIZE(di_sizeof))) {
|
||||
memcpy(&di, pDriverInfo, di_sizeof[level]);
|
||||
}
|
||||
|
||||
--
|
||||
2.14.4
|
||||
|
@ -1,76 +0,0 @@
|
||||
From cc5f7e223678e31439d4194fd62d6448a06570f3 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Stefaniuc <mstefani@winehq.org>
|
||||
Date: Fri, 20 Jul 2018 18:13:30 +0200
|
||||
Subject: [PATCH] mmdevapi: Use the ARRAY_SIZE() macro
|
||||
|
||||
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
|
||||
---
|
||||
dlls/mmdevapi/devenum.c | 10 +++++-----
|
||||
dlls/mmdevapi/main.c | 2 +-
|
||||
2 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/dlls/mmdevapi/devenum.c b/dlls/mmdevapi/devenum.c
|
||||
index b189e8e060..685ec27de6 100644
|
||||
--- a/dlls/mmdevapi/devenum.c
|
||||
+++ b/dlls/mmdevapi/devenum.c
|
||||
@@ -338,7 +338,7 @@ static MMDevice *MMDevice_Create(WCHAR *name, GUID *id, EDataFlow flow, DWORD st
|
||||
cur->state = state;
|
||||
cur->devguid = *id;
|
||||
|
||||
- StringFromGUID2(&cur->devguid, guidstr, sizeof(guidstr)/sizeof(*guidstr));
|
||||
+ StringFromGUID2(&cur->devguid, guidstr, ARRAY_SIZE(guidstr));
|
||||
|
||||
if (flow == eRender)
|
||||
root = key_render;
|
||||
@@ -429,7 +429,7 @@ static HRESULT load_devices_from_reg(void)
|
||||
DWORD len;
|
||||
PROPVARIANT pv = { VT_EMPTY };
|
||||
|
||||
- len = sizeof(guidvalue)/sizeof(guidvalue[0]);
|
||||
+ len = ARRAY_SIZE(guidvalue);
|
||||
ret = RegEnumKeyExW(cur, i++, guidvalue, &len, NULL, NULL, NULL, NULL);
|
||||
if (ret == ERROR_NO_MORE_ITEMS)
|
||||
{
|
||||
@@ -1395,7 +1395,7 @@ static HRESULT WINAPI MMDevPropStore_GetCount(IPropertyStore *iface, DWORD *npro
|
||||
return hr;
|
||||
*nprops = 0;
|
||||
do {
|
||||
- DWORD len = sizeof(buffer)/sizeof(*buffer);
|
||||
+ DWORD len = ARRAY_SIZE(buffer);
|
||||
if (RegEnumValueW(propkey, i, buffer, &len, NULL, NULL, NULL, NULL) != ERROR_SUCCESS)
|
||||
break;
|
||||
i++;
|
||||
@@ -1410,7 +1410,7 @@ static HRESULT WINAPI MMDevPropStore_GetAt(IPropertyStore *iface, DWORD prop, PR
|
||||
{
|
||||
MMDevPropStore *This = impl_from_IPropertyStore(iface);
|
||||
WCHAR buffer[50];
|
||||
- DWORD len = sizeof(buffer)/sizeof(*buffer);
|
||||
+ DWORD len = ARRAY_SIZE(buffer);
|
||||
HRESULT hr;
|
||||
HKEY propkey;
|
||||
|
||||
@@ -1530,7 +1530,7 @@ static HRESULT WINAPI PB_Read(IPropertyBag *iface, LPCOLESTR name, VARIANT *var,
|
||||
if (!lstrcmpW(name, dsguid))
|
||||
{
|
||||
WCHAR guidstr[39];
|
||||
- StringFromGUID2(&This->devguid, guidstr,sizeof(guidstr)/sizeof(*guidstr));
|
||||
+ StringFromGUID2(&This->devguid, guidstr,ARRAY_SIZE(guidstr));
|
||||
var->n1.n2.vt = VT_BSTR;
|
||||
var->n1.n2.n3.bstrVal = SysAllocString(guidstr);
|
||||
return S_OK;
|
||||
diff --git a/dlls/mmdevapi/main.c b/dlls/mmdevapi/main.c
|
||||
index 2b0a6f946b..8886975c96 100644
|
||||
--- a/dlls/mmdevapi/main.c
|
||||
+++ b/dlls/mmdevapi/main.c
|
||||
@@ -295,7 +295,7 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
- for (i = 0; i < sizeof(MMDEVAPI_CF)/sizeof(MMDEVAPI_CF[0]); ++i)
|
||||
+ for (i = 0; i < ARRAY_SIZE(MMDEVAPI_CF); ++i)
|
||||
{
|
||||
if (IsEqualGUID(rclsid, MMDEVAPI_CF[i].rclsid)) {
|
||||
IClassFactory_AddRef(&MMDEVAPI_CF[i].IClassFactory_iface);
|
||||
--
|
||||
2.14.4
|
||||
|
@ -1,53 +0,0 @@
|
||||
From 5499bc6ae7bbc3b6924ec2a692ab0821d6c7113d Mon Sep 17 00:00:00 2001
|
||||
From: Michael Stefaniuc <mstefani@winehq.org>
|
||||
Date: Fri, 20 Jul 2018 18:16:59 +0200
|
||||
Subject: [PATCH] mapi32: Use the ARRAY_SIZE() macro
|
||||
|
||||
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
|
||||
---
|
||||
dlls/mapi32/sendmail.c | 8 ++++----
|
||||
dlls/mapi32/util.c | 2 +-
|
||||
2 files changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
diff --git a/dlls/mapi32/sendmail.c b/dlls/mapi32/sendmail.c
|
||||
index 9ebb220c03..407dd13041 100644
|
||||
--- a/dlls/mapi32/sendmail.c
|
||||
+++ b/dlls/mapi32/sendmail.c
|
||||
@@ -542,8 +542,8 @@ ULONG WINAPI MAPISendMail( LHANDLE session, ULONG_PTR uiparam,
|
||||
}
|
||||
|
||||
/* Display an error message since we apparently have no mail clients */
|
||||
- LoadStringW(hInstMAPI32, IDS_NO_MAPI_CLIENT, error_msg, sizeof(error_msg) / sizeof(WCHAR));
|
||||
- LoadStringW(hInstMAPI32, IDS_SEND_MAIL, msg_title, sizeof(msg_title) / sizeof(WCHAR));
|
||||
+ LoadStringW(hInstMAPI32, IDS_NO_MAPI_CLIENT, error_msg, ARRAY_SIZE(error_msg));
|
||||
+ LoadStringW(hInstMAPI32, IDS_SEND_MAIL, msg_title, ARRAY_SIZE(msg_title));
|
||||
|
||||
MessageBoxW((HWND) uiparam, error_msg, msg_title, MB_ICONEXCLAMATION);
|
||||
|
||||
@@ -701,8 +701,8 @@ ULONG WINAPI MAPISendMailW(LHANDLE session, ULONG_PTR uiparam,
|
||||
}
|
||||
|
||||
/* Display an error message since we apparently have no mail clients */
|
||||
- LoadStringW(hInstMAPI32, IDS_NO_MAPI_CLIENT, error_msg, sizeof(error_msg) / sizeof(WCHAR));
|
||||
- LoadStringW(hInstMAPI32, IDS_SEND_MAIL, msg_title, sizeof(msg_title) / sizeof(WCHAR));
|
||||
+ LoadStringW(hInstMAPI32, IDS_NO_MAPI_CLIENT, error_msg, ARRAY_SIZE(error_msg));
|
||||
+ LoadStringW(hInstMAPI32, IDS_SEND_MAIL, msg_title, ARRAY_SIZE(msg_title));
|
||||
|
||||
MessageBoxW((HWND) uiparam, error_msg, msg_title, MB_ICONEXCLAMATION);
|
||||
|
||||
diff --git a/dlls/mapi32/util.c b/dlls/mapi32/util.c
|
||||
index 13e4affc39..9c3b01944a 100644
|
||||
--- a/dlls/mapi32/util.c
|
||||
+++ b/dlls/mapi32/util.c
|
||||
@@ -903,7 +903,7 @@ BOOL WINAPI FGetComponentPath(LPCSTR component, LPCSTR qualifier, LPSTR dll_path
|
||||
char lcid_ver[20];
|
||||
UINT i;
|
||||
|
||||
- for (i = 0; i < sizeof(fmt)/sizeof(fmt[0]); i++)
|
||||
+ for (i = 0; i < ARRAY_SIZE(fmt); i++)
|
||||
{
|
||||
/* FIXME: what's the correct behaviour here? */
|
||||
if (!qualifier || qualifier == lcid_ver)
|
||||
--
|
||||
2.14.4
|
||||
|
@ -1,126 +0,0 @@
|
||||
From d66b0e6cc5066669c5e856d4627af51f7004fead Mon Sep 17 00:00:00 2001
|
||||
From: Michael Stefaniuc <mstefani@winehq.org>
|
||||
Date: Fri, 20 Jul 2018 18:21:27 +0200
|
||||
Subject: [PATCH] krnl386.exe16: Use the ARRAY_SIZE() macro
|
||||
|
||||
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
|
||||
---
|
||||
dlls/krnl386.exe16/int21.c | 6 +++---
|
||||
dlls/krnl386.exe16/interrupts.c | 4 ++--
|
||||
dlls/krnl386.exe16/relay.c | 4 ++--
|
||||
dlls/krnl386.exe16/snoop.c | 4 ++--
|
||||
dlls/krnl386.exe16/vxd.c | 6 +++---
|
||||
5 files changed, 12 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/dlls/krnl386.exe16/int21.c b/dlls/krnl386.exe16/int21.c
|
||||
index f32b1a767c..f5b257b6d7 100644
|
||||
--- a/dlls/krnl386.exe16/int21.c
|
||||
+++ b/dlls/krnl386.exe16/int21.c
|
||||
@@ -814,8 +814,8 @@ static HANDLE INT21_CreateMagicDeviceHandle( LPCWSTR name )
|
||||
return 0;
|
||||
}
|
||||
memcpy( nameW.Buffer, prefixW, sizeof(prefixW) );
|
||||
- MultiByteToWideChar( CP_UNIXCP, 0, dir, -1, nameW.Buffer + sizeof(prefixW)/sizeof(WCHAR), len );
|
||||
- len += sizeof(prefixW) / sizeof(WCHAR);
|
||||
+ MultiByteToWideChar( CP_UNIXCP, 0, dir, -1, nameW.Buffer + ARRAY_SIZE(prefixW), len );
|
||||
+ len += ARRAY_SIZE(prefixW);
|
||||
nameW.Buffer[len-1] = '/';
|
||||
strcpyW( nameW.Buffer + len, name );
|
||||
|
||||
@@ -3264,7 +3264,7 @@ static BOOL INT21_NetworkFunc (CONTEXT *context)
|
||||
case 0x00: /* Get machine name. */
|
||||
{
|
||||
WCHAR dstW[MAX_COMPUTERNAME_LENGTH + 1];
|
||||
- DWORD s = sizeof(dstW) / sizeof(WCHAR);
|
||||
+ DWORD s = ARRAY_SIZE(dstW);
|
||||
int len;
|
||||
|
||||
char *dst = CTX_SEG_OFF_TO_LIN (context,context->SegDs,context->Edx);
|
||||
diff --git a/dlls/krnl386.exe16/interrupts.c b/dlls/krnl386.exe16/interrupts.c
|
||||
index e1b01b7b3d..c4448c6d00 100644
|
||||
--- a/dlls/krnl386.exe16/interrupts.c
|
||||
+++ b/dlls/krnl386.exe16/interrupts.c
|
||||
@@ -103,7 +103,7 @@ static void WINAPI DOSVM_DefaultHandler( CONTEXT *context )
|
||||
*/
|
||||
static INTPROC DOSVM_GetBuiltinHandler( BYTE intnum )
|
||||
{
|
||||
- if (intnum < sizeof(DOSVM_VectorsBuiltin)/sizeof(INTPROC)) {
|
||||
+ if (intnum < ARRAY_SIZE(DOSVM_VectorsBuiltin)) {
|
||||
INTPROC proc = DOSVM_VectorsBuiltin[intnum];
|
||||
if (proc)
|
||||
return proc;
|
||||
@@ -274,7 +274,7 @@ BOOL DOSVM_EmulateInterruptPM( CONTEXT *context, BYTE intnum )
|
||||
else if (wine_ldt_is_system(context->SegCs))
|
||||
{
|
||||
INTPROC proc;
|
||||
- if (intnum >= sizeof(DOSVM_VectorsBuiltin)/sizeof(INTPROC)) return FALSE;
|
||||
+ if (intnum >= ARRAY_SIZE(DOSVM_VectorsBuiltin)) return FALSE;
|
||||
if (!(proc = DOSVM_VectorsBuiltin[intnum])) return FALSE;
|
||||
proc( context );
|
||||
}
|
||||
diff --git a/dlls/krnl386.exe16/relay.c b/dlls/krnl386.exe16/relay.c
|
||||
index f1fbc57a0f..264ba2c589 100644
|
||||
--- a/dlls/krnl386.exe16/relay.c
|
||||
+++ b/dlls/krnl386.exe16/relay.c
|
||||
@@ -345,7 +345,7 @@ static int relay_call_from_16_no_debug( void *entry_point, unsigned char *args16
|
||||
int args32[20];
|
||||
|
||||
/* look for the ret instruction */
|
||||
- for (j = 0; j < sizeof(call->ret)/sizeof(call->ret[0]); j++)
|
||||
+ for (j = 0; j < ARRAY_SIZE(call->ret); j++)
|
||||
if (call->ret[j] == 0xca66 || call->ret[j] == 0xcb66) break;
|
||||
|
||||
if (call->ret[j] == 0xcb66) /* cdecl */
|
||||
@@ -449,7 +449,7 @@ int relay_call_from_16( void *entry_point, unsigned char *args16, CONTEXT *conte
|
||||
TRACE( "\1Call %s.%d: %s(", module, ordinal, func );
|
||||
|
||||
/* look for the ret instruction */
|
||||
- for (j = 0; j < sizeof(call->ret)/sizeof(call->ret[0]); j++)
|
||||
+ for (j = 0; j < ARRAY_SIZE(call->ret); j++)
|
||||
if (call->ret[j] == 0xca66 || call->ret[j] == 0xcb66) break;
|
||||
|
||||
if (call->ret[j] == 0xcb66) /* cdecl */
|
||||
diff --git a/dlls/krnl386.exe16/snoop.c b/dlls/krnl386.exe16/snoop.c
|
||||
index 95a5154a4b..4496080dad 100644
|
||||
--- a/dlls/krnl386.exe16/snoop.c
|
||||
+++ b/dlls/krnl386.exe16/snoop.c
|
||||
@@ -262,10 +262,10 @@ static void WINAPI SNOOP16_Entry(FARPROC proc, LPBYTE args, CONTEXT *context) {
|
||||
return; /* oops */
|
||||
}
|
||||
while (*rets) {
|
||||
- for (i=0;i<sizeof((*rets)->entry)/sizeof((*rets)->entry[0]);i++)
|
||||
+ for (i=0;i<ARRAY_SIZE((*rets)->entry);i++)
|
||||
if (!(*rets)->entry[i].origreturn)
|
||||
break;
|
||||
- if (i!=sizeof((*rets)->entry)/sizeof((*rets)->entry[0]))
|
||||
+ if (i!=ARRAY_SIZE((*rets)->entry))
|
||||
break;
|
||||
rets = &((*rets)->next);
|
||||
}
|
||||
diff --git a/dlls/krnl386.exe16/vxd.c b/dlls/krnl386.exe16/vxd.c
|
||||
index dc14600f5d..e103b96bb9 100644
|
||||
--- a/dlls/krnl386.exe16/vxd.c
|
||||
+++ b/dlls/krnl386.exe16/vxd.c
|
||||
@@ -129,8 +129,8 @@ static HANDLE open_vxd_handle( LPCWSTR name )
|
||||
return 0;
|
||||
}
|
||||
memcpy( nameW.Buffer, prefixW, sizeof(prefixW) );
|
||||
- MultiByteToWideChar( CP_UNIXCP, 0, dir, -1, nameW.Buffer + sizeof(prefixW)/sizeof(WCHAR), len );
|
||||
- len += sizeof(prefixW) / sizeof(WCHAR);
|
||||
+ MultiByteToWideChar( CP_UNIXCP, 0, dir, -1, nameW.Buffer + ARRAY_SIZE(prefixW), len );
|
||||
+ len += ARRAY_SIZE(prefixW);
|
||||
nameW.Buffer[len-1] = '/';
|
||||
strcpyW( nameW.Buffer + len, name );
|
||||
|
||||
@@ -201,7 +201,7 @@ HANDLE __wine_vxd_open( LPCWSTR filenameW, DWORD access, SECURITY_ATTRIBUTES *sa
|
||||
|
||||
/* normalize the filename */
|
||||
|
||||
- if (strlenW( filenameW ) >= sizeof(name)/sizeof(WCHAR) - 4 ||
|
||||
+ if (strlenW( filenameW ) >= ARRAY_SIZE(name) - 4 ||
|
||||
strchrW( filenameW, '/' ) || strchrW( filenameW, '\\' ))
|
||||
{
|
||||
SetLastError( ERROR_FILE_NOT_FOUND );
|
||||
--
|
||||
2.14.4
|
||||
|
@ -1,101 +0,0 @@
|
||||
From a2c03d68887fc2bd2eb4cde9bb4ea7aa133af5ee Mon Sep 17 00:00:00 2001
|
||||
From: Michael Stefaniuc <mstefani@winehq.org>
|
||||
Date: Fri, 20 Jul 2018 18:24:53 +0200
|
||||
Subject: [PATCH] inetcpl.cpl: Use the ARRAY_SIZE() macro
|
||||
|
||||
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
|
||||
---
|
||||
dlls/inetcpl.cpl/connections.c | 9 ++++-----
|
||||
dlls/inetcpl.cpl/general.c | 4 ++--
|
||||
dlls/inetcpl.cpl/security.c | 10 +++++-----
|
||||
3 files changed, 11 insertions(+), 12 deletions(-)
|
||||
|
||||
diff --git a/dlls/inetcpl.cpl/connections.c b/dlls/inetcpl.cpl/connections.c
|
||||
index 707fb3c4f7..648cd3d002 100644
|
||||
--- a/dlls/inetcpl.cpl/connections.c
|
||||
+++ b/dlls/inetcpl.cpl/connections.c
|
||||
@@ -273,13 +273,12 @@ static INT_PTR connections_on_notify(HWND hwnd, WPARAM wparam, LPARAM lparam)
|
||||
}
|
||||
TRACE("ProxyEnable set to %x\n", use_proxy);
|
||||
|
||||
- proxy_len = GetDlgItemTextW(hwnd, IDC_EDIT_PROXY_SERVER,
|
||||
- proxy, sizeof(proxy)/sizeof(proxy[0]));
|
||||
+ proxy_len = GetDlgItemTextW(hwnd, IDC_EDIT_PROXY_SERVER, proxy, ARRAY_SIZE(proxy));
|
||||
if(proxy_len)
|
||||
{
|
||||
proxy[proxy_len++] = ':';
|
||||
- port_len = GetDlgItemTextW(hwnd, IDC_EDIT_PROXY_PORT,
|
||||
- proxy+proxy_len, sizeof(proxy)/sizeof(proxy[0])-proxy_len);
|
||||
+ port_len = GetDlgItemTextW(hwnd, IDC_EDIT_PROXY_PORT, proxy+proxy_len,
|
||||
+ ARRAY_SIZE(proxy)-proxy_len);
|
||||
if(!port_len)
|
||||
{
|
||||
proxy[proxy_len++] = '8';
|
||||
@@ -305,7 +304,7 @@ static INT_PTR connections_on_notify(HWND hwnd, WPARAM wparam, LPARAM lparam)
|
||||
|
||||
use_pac_script = IsDlgButtonChecked(hwnd, IDC_USE_PAC_SCRIPT);
|
||||
pac_script_len = GetDlgItemTextW(hwnd, IDC_EDIT_PAC_SCRIPT,
|
||||
- pac_script, sizeof(pac_script)/sizeof(pac_script[0]));
|
||||
+ pac_script, ARRAY_SIZE(pac_script));
|
||||
if(!pac_script_len) use_pac_script = FALSE;
|
||||
if(use_pac_script)
|
||||
{
|
||||
diff --git a/dlls/inetcpl.cpl/general.c b/dlls/inetcpl.cpl/general.c
|
||||
index e0f473caf7..b9fbf1eb0a 100644
|
||||
--- a/dlls/inetcpl.cpl/general.c
|
||||
+++ b/dlls/inetcpl.cpl/general.c
|
||||
@@ -263,10 +263,10 @@ static INT_PTR general_on_notify(HWND hwnd, WPARAM wparam, LPARAM lparam)
|
||||
if (psn->hdr.code == PSN_APPLY)
|
||||
{
|
||||
*buffer = 0;
|
||||
- GetDlgItemTextW(hwnd, IDC_HOME_EDIT, buffer, sizeof(buffer)/sizeof(WCHAR));
|
||||
+ GetDlgItemTextW(hwnd, IDC_HOME_EDIT, buffer, ARRAY_SIZE(buffer));
|
||||
TRACE("EDITTEXT has %s\n", debugstr_w(buffer));
|
||||
|
||||
- res = parse_url_from_outside(buffer, parsed, sizeof(parsed)/sizeof(WCHAR));
|
||||
+ res = parse_url_from_outside(buffer, parsed, ARRAY_SIZE(parsed));
|
||||
TRACE("got %d with %s\n", res, debugstr_w(parsed));
|
||||
|
||||
if (res)
|
||||
diff --git a/dlls/inetcpl.cpl/security.c b/dlls/inetcpl.cpl/security.c
|
||||
index 543ada433d..e11caf1fc3 100644
|
||||
--- a/dlls/inetcpl.cpl/security.c
|
||||
+++ b/dlls/inetcpl.cpl/security.c
|
||||
@@ -73,7 +73,7 @@ static DWORD url_templates[] = {URLTEMPLATE_CUSTOM,
|
||||
static DWORD index_from_urltemplate(URLTEMPLATE value)
|
||||
{
|
||||
|
||||
- DWORD index = sizeof(url_templates) / sizeof(url_templates[0]);
|
||||
+ DWORD index = ARRAY_SIZE(url_templates);
|
||||
|
||||
while((index > 0) && (url_templates[index-1] != value))
|
||||
index--;
|
||||
@@ -105,12 +105,12 @@ static void update_security_level(secdlg_data *sd, DWORD lv_index, DWORD tb_inde
|
||||
current_index = (tb_index > 0) ? tb_index : index_from_urltemplate(sd->levels[lv_index]);
|
||||
|
||||
name[0] = 0;
|
||||
- LoadStringW(hcpl, IDS_SEC_LEVEL0 + current_index, name, sizeof(name)/sizeof(name[0]));
|
||||
+ LoadStringW(hcpl, IDS_SEC_LEVEL0 + current_index, name, ARRAY_SIZE(name));
|
||||
TRACE("new level #%d: %s\n", current_index, debugstr_w(name));
|
||||
SetWindowTextW(GetDlgItem(sd->hsec, IDC_SEC_LEVEL), name);
|
||||
|
||||
name[0] = 0;
|
||||
- LoadStringW(hcpl, IDS_SEC_LEVEL0_INFO + (current_index * 0x10), name, sizeof(name)/sizeof(name[0]));
|
||||
+ LoadStringW(hcpl, IDS_SEC_LEVEL0_INFO + (current_index * 0x10), name, ARRAY_SIZE(name));
|
||||
TRACE("new level info: %s\n", debugstr_w(name));
|
||||
SetWindowTextW(GetDlgItem(sd->hsec, IDC_SEC_LEVEL_INFO), name);
|
||||
|
||||
@@ -134,8 +134,8 @@ static void update_zone_info(secdlg_data *sd, DWORD lv_index)
|
||||
|
||||
SetWindowTextW(GetDlgItem(sd->hsec, IDC_SEC_ZONE_INFO), za->szDescription);
|
||||
|
||||
- len = LoadStringW(hcpl, IDS_SEC_SETTINGS, name, sizeof(name)/sizeof(*name));
|
||||
- lstrcpynW(&name[len], za->szDisplayName, sizeof(name)/sizeof(*name) - len - 1);
|
||||
+ len = LoadStringW(hcpl, IDS_SEC_SETTINGS, name, ARRAY_SIZE(name));
|
||||
+ lstrcpynW(&name[len], za->szDisplayName, ARRAY_SIZE(name) - len - 1);
|
||||
|
||||
TRACE("new title: %s\n", debugstr_w(name));
|
||||
SetWindowTextW(GetDlgItem(sd->hsec, IDC_SEC_GROUP), name);
|
||||
--
|
||||
2.14.4
|
||||
|
@ -1,68 +0,0 @@
|
||||
From 00e499b6eef608c2b3eceec3b51db412637cd803 Mon Sep 17 00:00:00 2001
|
||||
From: Michael Stefaniuc <mstefani@winehq.org>
|
||||
Date: Fri, 20 Jul 2018 20:15:42 +0200
|
||||
Subject: [PATCH] hhctrl.ocx: Use the ARRAY_SIZE() macro
|
||||
|
||||
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
|
||||
---
|
||||
dlls/hhctrl.ocx/chm.c | 12 ++++++------
|
||||
dlls/hhctrl.ocx/help.c | 6 +++---
|
||||
2 files changed, 9 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/dlls/hhctrl.ocx/chm.c b/dlls/hhctrl.ocx/chm.c
|
||||
index 8cf2539d71..01403368b0 100644
|
||||
--- a/dlls/hhctrl.ocx/chm.c
|
||||
+++ b/dlls/hhctrl.ocx/chm.c
|
||||
@@ -483,12 +483,12 @@ LPCWSTR skip_schema(LPCWSTR url)
|
||||
static const WCHAR msits_schema[] = {'m','s','-','i','t','s',':'};
|
||||
static const WCHAR mk_schema[] = {'m','k',':','@','M','S','I','T','S','t','o','r','e',':'};
|
||||
|
||||
- if(!strncmpiW(its_schema, url, sizeof(its_schema)/sizeof(WCHAR)))
|
||||
- return url+sizeof(its_schema)/sizeof(WCHAR);
|
||||
- if(!strncmpiW(msits_schema, url, sizeof(msits_schema)/sizeof(WCHAR)))
|
||||
- return url+sizeof(msits_schema)/sizeof(WCHAR);
|
||||
- if(!strncmpiW(mk_schema, url, sizeof(mk_schema)/sizeof(WCHAR)))
|
||||
- return url+sizeof(mk_schema)/sizeof(WCHAR);
|
||||
+ if(!strncmpiW(its_schema, url, ARRAY_SIZE(its_schema)))
|
||||
+ return url + ARRAY_SIZE(its_schema);
|
||||
+ if(!strncmpiW(msits_schema, url, ARRAY_SIZE(msits_schema)))
|
||||
+ return url + ARRAY_SIZE(msits_schema);
|
||||
+ if(!strncmpiW(mk_schema, url, ARRAY_SIZE(mk_schema)))
|
||||
+ return url + ARRAY_SIZE(mk_schema);
|
||||
|
||||
return url;
|
||||
}
|
||||
diff --git a/dlls/hhctrl.ocx/help.c b/dlls/hhctrl.ocx/help.c
|
||||
index c7a2a7a9e2..75b28f2f57 100644
|
||||
--- a/dlls/hhctrl.ocx/help.c
|
||||
+++ b/dlls/hhctrl.ocx/help.c
|
||||
@@ -241,7 +241,7 @@ static BOOL AppendFullPathURL(LPCWSTR file, LPWSTR buf, LPCWSTR index)
|
||||
|
||||
TRACE("%s %p %s\n", debugstr_w(file), buf, debugstr_w(index));
|
||||
|
||||
- if(!GetFullPathNameW(file, sizeof(full_path)/sizeof(full_path[0]), full_path, NULL)) {
|
||||
+ if (!GetFullPathNameW(file, ARRAY_SIZE(full_path), full_path, NULL)) {
|
||||
WARN("GetFullPathName failed: %u\n", GetLastError());
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1830,7 +1830,7 @@ HHInfo *CreateHelpViewer(HHInfo *info, LPCWSTR filename, HWND caller)
|
||||
/* Set the invalid tab ID (-1) as the default value for all
|
||||
* of the tabs, this matches a failed TCM_INSERTITEM call.
|
||||
*/
|
||||
- for(i=0;i<sizeof(info->tabs)/sizeof(HHTab);i++)
|
||||
+ for (i = 0; i < ARRAY_SIZE(info->tabs); i++)
|
||||
info->tabs[i].id = -1;
|
||||
|
||||
OleInitialize(NULL);
|
||||
@@ -1867,7 +1867,7 @@ HHInfo *CreateHelpViewer(HHInfo *info, LPCWSTR filename, HWND caller)
|
||||
*/
|
||||
static char find_html_symbol(const char *entity, int entity_len)
|
||||
{
|
||||
- int max = sizeof(html_encoded_symbols)/sizeof(html_encoded_symbols[0])-1;
|
||||
+ int max = ARRAY_SIZE(html_encoded_symbols)-1;
|
||||
int min = 0, dir;
|
||||
|
||||
while(min <= max)
|
||||
--
|
||||
2.14.4
|
||||
|
@ -1,27 +0,0 @@
|
||||
From e8731fe8f894a10182df1f2f699a0f9f107062bb Mon Sep 17 00:00:00 2001
|
||||
From: Michael Stefaniuc <mstefani@winehq.org>
|
||||
Date: Fri, 20 Jul 2018 20:18:06 +0200
|
||||
Subject: [PATCH] dpnet: Use the ARRAY_SIZE() macro
|
||||
|
||||
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
|
||||
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
|
||||
---
|
||||
dlls/dpnet/address.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/dlls/dpnet/address.c b/dlls/dpnet/address.c
|
||||
index 4d55caa47e..0bfa2bca03 100644
|
||||
--- a/dlls/dpnet/address.c
|
||||
+++ b/dlls/dpnet/address.c
|
||||
@@ -150,7 +150,7 @@ static const char *debugstr_SP(const GUID *id) {
|
||||
|
||||
if (!id) return "(null)";
|
||||
|
||||
- for (i = 0; i < sizeof(guids)/sizeof(guids[0]); i++) {
|
||||
+ for (i = 0; i < ARRAY_SIZE(guids); i++) {
|
||||
if (IsEqualGUID(id, guids[i].guid))
|
||||
return guids[i].name;
|
||||
}
|
||||
--
|
||||
2.14.4
|
||||
|
@ -1,34 +0,0 @@
|
||||
From d4c354720d4534593b3a49ece07b40ea4be4b92d Mon Sep 17 00:00:00 2001
|
||||
From: Michael Stefaniuc <mstefani@winehq.org>
|
||||
Date: Fri, 20 Jul 2018 20:19:12 +0200
|
||||
Subject: [PATCH] dx8vb: Use the ARRAY_SIZE() macro
|
||||
|
||||
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
|
||||
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
|
||||
---
|
||||
dlls/dx8vb/main.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/dlls/dx8vb/main.c b/dlls/dx8vb/main.c
|
||||
index aa6b9436ce..a1ee7c918e 100644
|
||||
--- a/dlls/dx8vb/main.c
|
||||
+++ b/dlls/dx8vb/main.c
|
||||
@@ -157,13 +157,13 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv)
|
||||
&& !IsEqualGUID( &IID_IUnknown, riid))
|
||||
return E_NOINTERFACE;
|
||||
|
||||
- for (i = 0; i < sizeof(object_creation)/sizeof(object_creation[0]); i++)
|
||||
+ for (i = 0; i < ARRAY_SIZE(object_creation); i++)
|
||||
{
|
||||
if (IsEqualGUID(object_creation[i].clsid, rclsid))
|
||||
break;
|
||||
}
|
||||
|
||||
- if (i == sizeof(object_creation)/sizeof(object_creation[0]))
|
||||
+ if (i == ARRAY_SIZE(object_creation))
|
||||
{
|
||||
FIXME("%s: no class found.\n", debugstr_guid(rclsid));
|
||||
return CLASS_E_CLASSNOTAVAILABLE;
|
||||
--
|
||||
2.14.4
|
||||
|
@ -1,78 +0,0 @@
|
||||
From 7e95288b2d586f41e746cf930a1a75979591399a Mon Sep 17 00:00:00 2001
|
||||
From: Michael Stefaniuc <mstefani@winehq.org>
|
||||
Date: Fri, 20 Jul 2018 20:22:05 +0200
|
||||
Subject: [PATCH] fusion: Use the ARRAY_SIZE() macro
|
||||
|
||||
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
|
||||
---
|
||||
dlls/fusion/asmcache.c | 8 ++++----
|
||||
dlls/fusion/fusion.c | 10 +++++-----
|
||||
2 files changed, 9 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/dlls/fusion/asmcache.c b/dlls/fusion/asmcache.c
|
||||
index 668aa8777e..deca5f4c37 100644
|
||||
--- a/dlls/fusion/asmcache.c
|
||||
+++ b/dlls/fusion/asmcache.c
|
||||
@@ -117,14 +117,14 @@ static BOOL get_assembly_directory(LPWSTR dir, DWORD size, const char *version,
|
||||
if (!strcmp(version, "v4.0.30319"))
|
||||
{
|
||||
strcpyW(dir + len, dotnet);
|
||||
- len += sizeof(dotnet)/sizeof(WCHAR) -1;
|
||||
+ len += ARRAY_SIZE(dotnet) - 1;
|
||||
strcpyW(dir + len, gac + 1);
|
||||
- len += sizeof(gac)/sizeof(WCHAR) - 2;
|
||||
+ len += ARRAY_SIZE(gac) - 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
strcpyW(dir + len, gac);
|
||||
- len += sizeof(gac)/sizeof(WCHAR) - 1;
|
||||
+ len += ARRAY_SIZE(gac) - 1;
|
||||
}
|
||||
switch (architecture)
|
||||
{
|
||||
@@ -433,7 +433,7 @@ static HRESULT WINAPI IAssemblyCacheImpl_InstallAssembly(IAssemblyCache *iface,
|
||||
WCHAR asmdir[MAX_PATH], *p, **external_files = NULL, *dst_dir = NULL;
|
||||
PEKIND architecture;
|
||||
char *clr_version;
|
||||
- DWORD i, count = 0, src_len, dst_len = sizeof(format_v40)/sizeof(format_v40[0]);
|
||||
+ DWORD i, count = 0, src_len, dst_len = ARRAY_SIZE(format_v40);
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p, %d, %s, %p)\n", iface, dwFlags,
|
||||
diff --git a/dlls/fusion/fusion.c b/dlls/fusion/fusion.c
|
||||
index b038b38092..a57d7e067c 100644
|
||||
--- a/dlls/fusion/fusion.c
|
||||
+++ b/dlls/fusion/fusion.c
|
||||
@@ -144,9 +144,9 @@ HRESULT WINAPI GetCachePath(ASM_CACHE_FLAGS dwCacheFlags, LPWSTR pwzCachePath,
|
||||
case ASM_CACHE_GAC:
|
||||
{
|
||||
strcpyW(path + len, assembly);
|
||||
- len += sizeof(assembly)/sizeof(WCHAR) - 1;
|
||||
+ len += ARRAY_SIZE(assembly) - 1;
|
||||
strcpyW(path + len, gac);
|
||||
- len += sizeof(gac)/sizeof(WCHAR) - 1;
|
||||
+ len += ARRAY_SIZE(gac) - 1;
|
||||
break;
|
||||
}
|
||||
case ASM_CACHE_DOWNLOAD:
|
||||
@@ -156,13 +156,13 @@ HRESULT WINAPI GetCachePath(ASM_CACHE_FLAGS dwCacheFlags, LPWSTR pwzCachePath,
|
||||
}
|
||||
case ASM_CACHE_ROOT:
|
||||
strcpyW(path + len, assembly);
|
||||
- len += sizeof(assembly)/sizeof(WCHAR) - 1;
|
||||
+ len += ARRAY_SIZE(assembly) - 1;
|
||||
break;
|
||||
case ASM_CACHE_ROOT_EX:
|
||||
strcpyW(path + len, dotnet);
|
||||
- len += sizeof(dotnet)/sizeof(WCHAR) - 1;
|
||||
+ len += ARRAY_SIZE(dotnet) - 1;
|
||||
strcpyW(path + len, assembly);
|
||||
- len += sizeof(assembly)/sizeof(WCHAR) - 1;
|
||||
+ len += ARRAY_SIZE(assembly) - 1;
|
||||
break;
|
||||
default:
|
||||
return E_INVALIDARG;
|
||||
--
|
||||
2.14.4
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user