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
d93954bd
Commit
d93954bd
authored
Jul 17, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jul 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ole32: Use the ARRAY_SIZE() macro.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
489c01ee
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
16 additions
and
17 deletions
+16
-17
classmoniker.c
dlls/ole32/classmoniker.c
+3
-3
clipboard.c
dlls/ole32/clipboard.c
+1
-1
datacache.c
dlls/ole32/datacache.c
+1
-1
moniker.c
dlls/ole32/moniker.c
+1
-1
ole2.c
dlls/ole32/ole2.c
+1
-1
ole2impl.c
dlls/ole32/ole2impl.c
+1
-1
rpc.c
dlls/ole32/rpc.c
+2
-2
storage32.c
dlls/ole32/storage32.c
+4
-5
usrmarshal.c
dlls/ole32/usrmarshal.c
+2
-2
No files found.
dlls/ole32/classmoniker.c
View file @
d93954bd
...
...
@@ -536,14 +536,14 @@ static HRESULT WINAPI ClassMoniker_GetDisplayName(IMoniker* iface,
*
ppszDisplayName
=
CoTaskMemAlloc
(
sizeof
(
wszClsidPrefix
)
+
(
CHARS_IN_GUID
-
2
)
*
sizeof
(
WCHAR
));
StringFromGUID2
(
&
This
->
clsid
,
*
ppszDisplayName
+
sizeof
(
wszClsidPrefix
)
/
sizeof
(
WCHAR
)
-
2
,
CHARS_IN_GUID
);
StringFromGUID2
(
&
This
->
clsid
,
*
ppszDisplayName
+
ARRAY_SIZE
(
wszClsidPrefix
)
-
2
,
CHARS_IN_GUID
);
/* note: this overwrites the opening curly bracket of the CLSID string generated above */
memcpy
(
*
ppszDisplayName
,
wszClsidPrefix
,
sizeof
(
wszClsidPrefix
)
-
sizeof
(
WCHAR
));
/* note: this overwrites the closing curly bracket of the CLSID string generated above */
(
*
ppszDisplayName
)[
sizeof
(
wszClsidPrefix
)
/
sizeof
(
WCHAR
)
-
2
+
CHARS_IN_GUID
-
2
]
=
':'
;
(
*
ppszDisplayName
)[
sizeof
(
wszClsidPrefix
)
/
sizeof
(
WCHAR
)
-
2
+
CHARS_IN_GUID
-
1
]
=
'\0'
;
(
*
ppszDisplayName
)[
ARRAY_SIZE
(
wszClsidPrefix
)
-
2
+
CHARS_IN_GUID
-
2
]
=
':'
;
(
*
ppszDisplayName
)[
ARRAY_SIZE
(
wszClsidPrefix
)
-
2
+
CHARS_IN_GUID
-
1
]
=
'\0'
;
TRACE
(
"string is %s
\n
"
,
debugstr_w
(
*
ppszDisplayName
));
return
S_OK
;
...
...
dlls/ole32/clipboard.c
View file @
d93954bd
...
...
@@ -1197,7 +1197,7 @@ static HRESULT get_priv_data(ole_priv_data **data)
for
(
cf
=
0
;
(
cf
=
EnumClipboardFormats
(
cf
))
!=
0
;
count
++
)
{
WCHAR
buf
[
256
];
if
(
GetClipboardFormatNameW
(
cf
,
buf
,
sizeof
(
buf
)
/
sizeof
(
WCHAR
)))
if
(
GetClipboardFormatNameW
(
cf
,
buf
,
ARRAY_SIZE
(
buf
)))
TRACE
(
"cf %04x %s
\n
"
,
cf
,
debugstr_w
(
buf
));
else
TRACE
(
"cf %04x
\n
"
,
cf
);
...
...
dlls/ole32/datacache.c
View file @
d93954bd
...
...
@@ -2667,7 +2667,7 @@ static HRESULT WINAPI DataCache_UpdateCache( IOleCache2 *iface, IDataObject *dat
}
else
{
for
(
i
=
0
;
i
<
sizeof
(
view_list
)
/
sizeof
(
view_list
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
view_list
);
i
++
)
{
fmt
.
cfFormat
=
view_list
[
i
];
fmt
.
tymed
=
tymed_from_cf
(
fmt
.
cfFormat
);
...
...
dlls/ole32/moniker.c
View file @
d93954bd
...
...
@@ -1152,7 +1152,7 @@ HRESULT WINAPI MkParseDisplayName(LPBC pbc, LPCOLESTR szDisplayName,
*
pchEaten
=
0
;
*
ppmk
=
NULL
;
if
(
!
strncmpiW
(
szDisplayName
,
wszClsidColon
,
sizeof
(
wszClsidColon
)
/
sizeof
(
wszClsidColon
[
0
]
)))
if
(
!
strncmpiW
(
szDisplayName
,
wszClsidColon
,
ARRAY_SIZE
(
wszClsidColon
)))
{
hr
=
ClassMoniker_CreateFromDisplayName
(
pbc
,
szDisplayName
,
&
chEaten
,
&
moniker
);
if
(
FAILED
(
hr
)
&&
(
hr
!=
MK_E_SYNTAX
))
...
...
dlls/ole32/ole2.c
View file @
d93954bd
...
...
@@ -967,7 +967,7 @@ static HRESULT WINAPI EnumOLEVERB_Next(
LPWSTR
pwszOLEVERB
;
LPWSTR
pwszMenuFlags
;
LPWSTR
pwszAttribs
;
LONG
res
=
RegEnumKeyW
(
This
->
hkeyVerb
,
This
->
index
,
wszSubKey
,
sizeof
(
wszSubKey
)
/
sizeof
(
wszSubKey
[
0
]
));
LONG
res
=
RegEnumKeyW
(
This
->
hkeyVerb
,
This
->
index
,
wszSubKey
,
ARRAY_SIZE
(
wszSubKey
));
if
(
res
==
ERROR_NO_MORE_ITEMS
)
{
hr
=
S_FALSE
;
...
...
dlls/ole32/ole2impl.c
View file @
d93954bd
...
...
@@ -135,7 +135,7 @@ static HRESULT get_storage(IDataObject *data, IStorage *stg, UINT *src_cf, BOOL
if
(
other_fmts
)
{
for
(
i
=
0
;
i
<
sizeof
(
fmt_id
)
/
sizeof
(
fmt_id
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
fmt_id
);
i
++
)
{
init_fmtetc
(
&
fmt
,
fmt_id
[
i
],
TYMED_ISTORAGE
);
hr
=
IDataObject_QueryGetData
(
data
,
&
fmt
);
...
...
dlls/ole32/rpc.c
View file @
d93954bd
...
...
@@ -1658,7 +1658,7 @@ static HRESULT create_server(REFCLSID rclsid, HANDLE *process)
static
const
WCHAR
embedding
[]
=
{
' '
,
'-'
,
'E'
,
'm'
,
'b'
,
'e'
,
'd'
,
'd'
,
'i'
,
'n'
,
'g'
,
0
};
HKEY
key
;
HRESULT
hres
;
WCHAR
command
[
MAX_PATH
+
sizeof
(
embedding
)
/
sizeof
(
WCHAR
)];
WCHAR
command
[
MAX_PATH
+
ARRAY_SIZE
(
embedding
)];
DWORD
size
=
(
MAX_PATH
+
1
)
*
sizeof
(
WCHAR
);
STARTUPINFOW
sinfo
;
PROCESS_INFORMATION
pinfo
;
...
...
@@ -1799,7 +1799,7 @@ static void get_localserver_pipe_name(WCHAR *pipefn, REFCLSID rclsid)
{
static
const
WCHAR
wszPipeRef
[]
=
{
'\\'
,
'\\'
,
'.'
,
'\\'
,
'p'
,
'i'
,
'p'
,
'e'
,
'\\'
,
0
};
strcpyW
(
pipefn
,
wszPipeRef
);
StringFromGUID2
(
rclsid
,
pipefn
+
sizeof
(
wszPipeRef
)
/
sizeof
(
wszPipeRef
[
0
]
)
-
1
,
CHARS_IN_GUID
);
StringFromGUID2
(
rclsid
,
pipefn
+
ARRAY_SIZE
(
wszPipeRef
)
-
1
,
CHARS_IN_GUID
);
}
/* FIXME: should call to rpcss instead */
...
...
dlls/ole32/storage32.c
View file @
d93954bd
...
...
@@ -5057,7 +5057,7 @@ static HRESULT StorageImpl_LockOne(StorageImpl *This, ULONG start, ULONG end)
if
(
SUCCEEDED
(
hr
))
{
for
(
j
=
0
;
j
<
sizeof
(
This
->
locked_bytes
)
/
sizeof
(
This
->
locked_bytes
[
0
]
);
j
++
)
for
(
j
=
0
;
j
<
ARRAY_SIZE
(
This
->
locked_bytes
);
j
++
)
{
if
(
This
->
locked_bytes
[
j
]
==
0
)
{
...
...
@@ -5200,10 +5200,10 @@ static void StorageImpl_Destroy(StorageBaseImpl* iface)
BlockChainStream_Destroy
(
This
->
rootBlockChain
);
BlockChainStream_Destroy
(
This
->
smallBlockDepotChain
);
for
(
i
=
0
;
i
<
BLOCKCHAIN_CACHE_SIZE
;
i
++
)
for
(
i
=
0
;
i
<
BLOCKCHAIN_CACHE_SIZE
;
i
++
)
BlockChainStream_Destroy
(
This
->
blockChainCache
[
i
]);
for
(
i
=
0
;
i
<
sizeof
(
This
->
locked_bytes
)
/
sizeof
(
This
->
locked_bytes
[
0
]
);
i
++
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
This
->
locked_bytes
);
i
++
)
{
ULARGE_INTEGER
offset
,
cb
;
cb
.
QuadPart
=
1
;
...
...
@@ -9369,8 +9369,7 @@ HRESULT WINAPI WriteFmtUserTypeStg(
/* get the clipboard format name */
if
(
cf
)
{
n
=
GetClipboardFormatNameW
(
cf
,
szwClipName
,
sizeof
(
szwClipName
)
/
sizeof
(
szwClipName
[
0
])
);
n
=
GetClipboardFormatNameW
(
cf
,
szwClipName
,
ARRAY_SIZE
(
szwClipName
));
szwClipName
[
n
]
=
0
;
}
...
...
dlls/ole32/usrmarshal.c
View file @
d93954bd
...
...
@@ -116,7 +116,7 @@ ULONG __RPC_USER CLIPFORMAT_UserSize(ULONG *pFlags, ULONG size, CLIPFORMAT *pCF)
/* urg! this function is badly designed because it won't tell us how
* much space is needed without doing a dummy run of storing the
* name into a buffer */
ret
=
GetClipboardFormatNameW
(
*
pCF
,
format
,
sizeof
(
format
)
/
sizeof
(
format
[
0
]
)
-
1
);
ret
=
GetClipboardFormatNameW
(
*
pCF
,
format
,
ARRAY_SIZE
(
format
)
-
1
);
if
(
!
ret
)
RaiseException
(
DV_E_CLIPFORMAT
,
0
,
0
,
NULL
);
size
+=
(
ret
+
1
)
*
sizeof
(
WCHAR
);
...
...
@@ -161,7 +161,7 @@ unsigned char * __RPC_USER CLIPFORMAT_UserMarshal(ULONG *pFlags, unsigned char *
*
(
DWORD
*
)
pBuffer
=
*
pCF
;
pBuffer
+=
4
;
len
=
GetClipboardFormatNameW
(
*
pCF
,
format
,
sizeof
(
format
)
/
sizeof
(
format
[
0
]
)
-
1
);
len
=
GetClipboardFormatNameW
(
*
pCF
,
format
,
ARRAY_SIZE
(
format
)
-
1
);
if
(
!
len
)
RaiseException
(
DV_E_CLIPFORMAT
,
0
,
0
,
NULL
);
len
+=
1
;
...
...
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