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
3a61d1d5
Commit
3a61d1d5
authored
Jul 18, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jul 19, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
oleacc: Use the ARRAY_SIZE() macro.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
d265dd88
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
client.c
dlls/oleacc/client.c
+2
-2
main.c
dlls/oleacc/main.c
+9
-9
No files found.
dlls/oleacc/client.c
View file @
3a61d1d5
...
...
@@ -168,7 +168,7 @@ static HRESULT WINAPI Client_get_accName(IAccessible *iface, VARIANT varID, BSTR
if
(
convert_child_id
(
&
varID
)
!=
CHILDID_SELF
||
!
IsWindow
(
This
->
hwnd
))
return
E_INVALIDARG
;
len
=
SendMessageW
(
This
->
hwnd
,
WM_GETTEXT
,
sizeof
(
name
)
/
sizeof
(
WCHAR
),
(
LPARAM
)
name
);
len
=
SendMessageW
(
This
->
hwnd
,
WM_GETTEXT
,
ARRAY_SIZE
(
name
),
(
LPARAM
)
name
);
if
(
!
len
)
return
S_FALSE
;
...
...
@@ -286,7 +286,7 @@ static HRESULT WINAPI Client_get_accKeyboardShortcut(IAccessible *iface,
if
(
convert_child_id
(
&
varID
)
!=
CHILDID_SELF
)
return
E_INVALIDARG
;
len
=
SendMessageW
(
This
->
hwnd
,
WM_GETTEXT
,
sizeof
(
name
)
/
sizeof
(
WCHAR
),
(
LPARAM
)
name
);
len
=
SendMessageW
(
This
->
hwnd
,
WM_GETTEXT
,
ARRAY_SIZE
(
name
),
(
LPARAM
)
name
);
for
(
i
=
0
;
i
<
len
;
i
++
)
{
if
(
name
[
i
]
==
'&'
)
break
;
...
...
dlls/oleacc/main.c
View file @
3a61d1d5
...
...
@@ -109,11 +109,11 @@ static accessible_create get_builtin_accessible_obj(HWND hwnd, LONG objid)
WCHAR
class_name
[
64
];
int
i
,
idx
;
if
(
!
RealGetWindowClassW
(
hwnd
,
class_name
,
sizeof
(
class_name
)
/
sizeof
(
WCHAR
)))
if
(
!
RealGetWindowClassW
(
hwnd
,
class_name
,
ARRAY_SIZE
(
class_name
)))
return
NULL
;
TRACE
(
"got window class: %s
\n
"
,
debugstr_w
(
class_name
));
for
(
i
=
0
;
i
<
sizeof
(
builtin_classes
)
/
sizeof
(
builtin_classes
[
0
]
);
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
builtin_classes
);
i
++
)
{
if
(
!
strcmpiW
(
class_name
,
builtin_classes
[
i
].
name
))
{
accessible_create
ret
;
...
...
@@ -128,7 +128,7 @@ static accessible_create get_builtin_accessible_obj(HWND hwnd, LONG objid)
idx
=
SendMessageW
(
hwnd
,
WM_GETOBJECT
,
0
,
OBJID_QUERYCLASSNAMEIDX
);
if
(
idx
)
{
for
(
i
=
0
;
i
<
sizeof
(
builtin_classes
)
/
sizeof
(
builtin_classes
[
0
]
);
i
++
)
{
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
builtin_classes
);
i
++
)
{
if
(
idx
==
builtin_classes
[
i
].
idx
)
{
accessible_create
ret
;
...
...
@@ -172,7 +172,7 @@ HRESULT WINAPI CreateStdAccessibleObject( HWND hwnd, LONG idObject,
HRESULT
WINAPI
ObjectFromLresult
(
LRESULT
result
,
REFIID
riid
,
WPARAM
wParam
,
void
**
ppObject
)
{
WCHAR
atom_str
[
sizeof
(
lresult_atom_prefix
)
/
sizeof
(
WCHAR
)
+
3
*
8
+
3
];
WCHAR
atom_str
[
ARRAY_SIZE
(
lresult_atom_prefix
)
+
3
*
8
+
3
];
HANDLE
server_proc
,
server_mapping
,
mapping
;
DWORD
proc_id
,
size
;
IStream
*
stream
;
...
...
@@ -193,11 +193,11 @@ HRESULT WINAPI ObjectFromLresult( LRESULT result, REFIID riid, WPARAM wParam, vo
if
(
result
!=
(
ATOM
)
result
)
return
E_FAIL
;
if
(
!
GlobalGetAtomNameW
(
result
,
atom_str
,
sizeof
(
atom_str
)
/
sizeof
(
WCHAR
)))
if
(
!
GlobalGetAtomNameW
(
result
,
atom_str
,
ARRAY_SIZE
(
atom_str
)))
return
E_FAIL
;
if
(
memcmp
(
atom_str
,
lresult_atom_prefix
,
sizeof
(
lresult_atom_prefix
)))
return
E_FAIL
;
p
=
atom_str
+
sizeof
(
lresult_atom_prefix
)
/
sizeof
(
WCHAR
);
p
=
atom_str
+
ARRAY_SIZE
(
lresult_atom_prefix
);
proc_id
=
strtoulW
(
p
,
&
p
,
16
);
if
(
*
p
!=
':'
)
return
E_FAIL
;
...
...
@@ -247,7 +247,7 @@ LRESULT WINAPI LresultFromObject( REFIID riid, WPARAM wParam, LPUNKNOWN pAcc )
static
const
WCHAR
atom_fmt
[]
=
{
'%'
,
'0'
,
'8'
,
'x'
,
':'
,
'%'
,
'0'
,
'8'
,
'x'
,
':'
,
'%'
,
'0'
,
'8'
,
'x'
,
0
};
static
const
LARGE_INTEGER
seek_zero
=
{{
0
}};
WCHAR
atom_str
[
sizeof
(
lresult_atom_prefix
)
/
sizeof
(
WCHAR
)
+
3
*
8
+
3
];
WCHAR
atom_str
[
ARRAY_SIZE
(
lresult_atom_prefix
)
+
3
*
8
+
3
];
IStream
*
stream
;
HANDLE
mapping
;
STATSTG
stat
;
...
...
@@ -320,8 +320,8 @@ LRESULT WINAPI LresultFromObject( REFIID riid, WPARAM wParam, LPUNKNOWN pAcc )
}
memcpy
(
atom_str
,
lresult_atom_prefix
,
sizeof
(
lresult_atom_prefix
));
sprintfW
(
atom_str
+
sizeof
(
lresult_atom_prefix
)
/
sizeof
(
WCHAR
),
atom_fmt
,
GetCurrentProcessId
(),
HandleToUlong
(
mapping
),
stat
.
cbSize
.
u
.
LowPart
);
sprintfW
(
atom_str
+
ARRAY_SIZE
(
lresult_atom_prefix
),
atom_fmt
,
GetCurrentProcessId
(
),
HandleToUlong
(
mapping
),
stat
.
cbSize
.
u
.
LowPart
);
atom
=
GlobalAddAtomW
(
atom_str
);
if
(
!
atom
)
{
CloseHandle
(
mapping
);
...
...
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