Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
923cb0a9
Commit
923cb0a9
authored
Sep 15, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Sep 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shlwapi: Avoid ARRAY_SIZE-like macros.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
15b17a0e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
11 deletions
+8
-11
path.c
dlls/shlwapi/path.c
+4
-6
reg.c
dlls/shlwapi/reg.c
+3
-4
url.c
dlls/shlwapi/url.c
+1
-1
No files found.
dlls/shlwapi/path.c
View file @
923cb0a9
...
...
@@ -4217,8 +4217,6 @@ HRESULT WINAPI SHGetWebFolderFilePathW(LPCWSTR lpszFile, LPWSTR lpszPath, DWORD
{
static
const
WCHAR
szWeb
[]
=
{
'\\'
,
'W'
,
'e'
,
'b'
,
'\\'
,
'\0'
};
static
const
WCHAR
szWebMui
[]
=
{
'm'
,
'u'
,
'i'
,
'\\'
,
'%'
,
'0'
,
'4'
,
'x'
,
'\\'
,
'\0'
};
#define szWebLen (sizeof(szWeb)/sizeof(WCHAR))
#define szWebMuiLen ((sizeof(szWebMui)+1)/sizeof(WCHAR))
DWORD
dwLen
,
dwFileLen
;
LANGID
lidSystem
,
lidUser
;
...
...
@@ -4231,11 +4229,11 @@ HRESULT WINAPI SHGetWebFolderFilePathW(LPCWSTR lpszFile, LPWSTR lpszPath, DWORD
dwFileLen
=
strlenW
(
lpszFile
);
if
(
dwLen
+
dwFileLen
+
szWebLen
>=
dwPathLen
)
if
(
dwLen
+
dwFileLen
+
ARRAY_SIZE
(
szWeb
)
>=
dwPathLen
)
return
E_FAIL
;
/* lpszPath too short */
strcpyW
(
lpszPath
+
dwLen
,
szWeb
);
dwLen
+=
szWebLen
;
dwLen
+=
ARRAY_SIZE
(
szWeb
)
;
dwPathLen
=
dwPathLen
-
dwLen
;
/* Remaining space */
lidSystem
=
GetSystemDefaultUILanguage
();
...
...
@@ -4243,11 +4241,11 @@ HRESULT WINAPI SHGetWebFolderFilePathW(LPCWSTR lpszFile, LPWSTR lpszPath, DWORD
if
(
lidSystem
!=
lidUser
)
{
if
(
dwFileLen
+
szWebMuiLen
<
dwPathLen
)
if
(
dwFileLen
+
ARRAY_SIZE
(
szWebMui
)
<
dwPathLen
)
{
/* Use localised content in the users UI language if present */
wsprintfW
(
lpszPath
+
dwLen
,
szWebMui
,
lidUser
);
strcpyW
(
lpszPath
+
dwLen
+
szWebMuiLen
,
lpszFile
);
strcpyW
(
lpszPath
+
dwLen
+
ARRAY_SIZE
(
szWebMui
)
,
lpszFile
);
if
(
PathFileExistsW
(
lpszPath
))
return
S_OK
;
}
...
...
dlls/shlwapi/reg.c
View file @
923cb0a9
...
...
@@ -2426,19 +2426,18 @@ HRESULT WINAPI SHRegGetCLSIDKeyW(REFGUID guid, LPCWSTR lpszValue, BOOL bUseHKCU,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'W'
,
'i'
,
'n'
,
'd'
,
'o'
,
'w'
,
's'
,
'\\'
,
'C'
,
'u'
,
'r'
,
'r'
,
'e'
,
'n'
,
't'
,
'V'
,
'e'
,
'r'
,
's'
,
'i'
,
'o'
,
'n'
,
'\\'
,
'E'
,
'x'
,
'p'
,
'l'
,
'o'
,
'r'
,
'e'
,
'r'
,
'\\'
,
'C'
,
'L'
,
'S'
,
'I'
,
'D'
,
'\\'
};
#define szClassIdKeyLen (sizeof(szClassIdKey)/sizeof(WCHAR))
WCHAR
szKey
[
MAX_PATH
];
DWORD
dwRet
;
HKEY
hkey
;
/* Create the key string */
memcpy
(
szKey
,
szClassIdKey
,
sizeof
(
szClassIdKey
));
SHStringFromGUIDW
(
guid
,
szKey
+
szClassIdKeyLen
,
39
);
/* Append guid */
SHStringFromGUIDW
(
guid
,
szKey
+
ARRAY_SIZE
(
szClassIdKey
)
,
39
);
/* Append guid */
if
(
lpszValue
)
{
szKey
[
szClassIdKeyLen
+
39
]
=
'\\'
;
strcpyW
(
szKey
+
szClassIdKeyLen
+
40
,
lpszValue
);
/* Append value name */
szKey
[
ARRAY_SIZE
(
szClassIdKey
)
+
39
]
=
'\\'
;
strcpyW
(
szKey
+
ARRAY_SIZE
(
szClassIdKey
)
+
40
,
lpszValue
);
/* Append value name */
}
hkey
=
bUseHKCU
?
HKEY_CURRENT_USER
:
HKEY_CLASSES_ROOT
;
...
...
dlls/shlwapi/url.c
View file @
923cb0a9
...
...
@@ -2570,7 +2570,7 @@ HRESULT WINAPI MLBuildResURLW(LPCWSTR lpszLibName, HMODULE hMod, DWORD dwFlags,
LPCWSTR
lpszRes
,
LPWSTR
lpszDest
,
DWORD
dwDestLen
)
{
static
const
WCHAR
szRes
[]
=
{
'r'
,
'e'
,
's'
,
':'
,
'/'
,
'/'
,
'\0'
};
#define szResLen ((sizeof(szRes) - sizeof(WCHAR))/sizeof(WCHAR))
static
const
unsigned
int
szResLen
=
ARRAY_SIZE
(
szRes
)
-
1
;
HRESULT
hRet
=
E_FAIL
;
TRACE
(
"(%s,%p,0x%08x,%s,%p,%d)
\n
"
,
debugstr_w
(
lpszLibName
),
hMod
,
dwFlags
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment