Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
2f4f1399
Commit
2f4f1399
authored
Jul 09, 2018
by
Michael Stefaniuc
Committed by
Alexandre Julliard
Jul 09, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netapi32: Use the ARRAY_SIZE() macro.
Signed-off-by:
Michael Stefaniuc
<
mstefani@winehq.org
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
4341c449
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
12 deletions
+10
-12
nbt.c
dlls/netapi32/nbt.c
+3
-5
netapi32.c
dlls/netapi32/netapi32.c
+6
-6
netbios.c
dlls/netapi32/netbios.c
+1
-1
No files found.
dlls/netapi32/nbt.c
View file @
2f4f1399
...
...
@@ -1095,8 +1095,7 @@ static UCHAR NetBTSend(void *adapt, void *sess, PNCB ncb)
wsaBufs
[
1
].
len
=
ncb
->
ncb_length
;
wsaBufs
[
1
].
buf
=
(
char
*
)
ncb
->
ncb_buffer
;
r
=
WSASend
(
session
->
fd
,
wsaBufs
,
sizeof
(
wsaBufs
)
/
sizeof
(
wsaBufs
[
0
]),
&
bytesSent
,
0
,
NULL
,
NULL
);
r
=
WSASend
(
session
->
fd
,
wsaBufs
,
ARRAY_SIZE
(
wsaBufs
),
&
bytesSent
,
0
,
NULL
,
NULL
);
if
(
r
==
SOCKET_ERROR
)
{
NetBIOSHangupSession
(
ncb
);
...
...
@@ -1523,10 +1522,9 @@ void NetBTInit(void)
char
nsString
[
16
];
DWORD
size
,
ndx
;
for
(
ndx
=
0
;
ndx
<
sizeof
(
nsValueNames
)
/
sizeof
(
nsValueNames
[
0
]);
ndx
++
)
for
(
ndx
=
0
;
ndx
<
ARRAY_SIZE
(
nsValueNames
);
ndx
++
)
{
size
=
sizeof
(
nsString
)
/
sizeof
(
char
);
size
=
ARRAY_SIZE
(
nsString
);
if
(
RegQueryValueExA
(
hKey
,
nsValueNames
[
ndx
],
NULL
,
NULL
,
(
LPBYTE
)
nsString
,
&
size
)
==
ERROR_SUCCESS
)
{
...
...
dlls/netapi32/netapi32.c
View file @
2f4f1399
...
...
@@ -923,7 +923,7 @@ static NET_API_STATUS wksta_getinfo( LMSTR servername, DWORD level, LPBYTE *buf
static
BOOL
NETAPI_IsLocalComputer
(
LMCSTR
name
)
{
WCHAR
buf
[
MAX_COMPUTERNAME_LENGTH
+
1
];
DWORD
size
=
sizeof
(
buf
)
/
sizeof
(
buf
[
0
]
);
DWORD
size
=
ARRAY_SIZE
(
buf
);
BOOL
ret
;
if
(
!
name
||
!
name
[
0
])
return
TRUE
;
...
...
@@ -2360,7 +2360,7 @@ NetUserEnum(LPCWSTR servername, DWORD level, DWORD filter, LPBYTE* bufptr,
{
NET_API_STATUS
status
;
WCHAR
user
[
UNLEN
+
1
];
DWORD
size
,
len
=
sizeof
(
user
)
/
sizeof
(
user
[
0
]
);
DWORD
size
,
len
=
ARRAY_SIZE
(
user
);
TRACE
(
"(%s, %u, 0x%x, %p, %u, %p, %p, %p)
\n
"
,
debugstr_w
(
servername
),
level
,
filter
,
bufptr
,
prefmaxlen
,
entriesread
,
totalentries
,
resume_handle
);
...
...
@@ -3477,8 +3477,8 @@ DWORD WINAPI DavGetUNCFromHTTPPath(const WCHAR *http_path, WCHAR *buf, DWORD *bu
TRACE
(
"(%s %p %p)
\n
"
,
debugstr_w
(
http_path
),
buf
,
buflen
);
while
(
*
p
&&
*
p
!=
':'
)
{
p
++
;
len
++
;
};
if
(
len
==
sizeof
(
httpW
)
/
sizeof
(
httpW
[
0
]
)
&&
!
memicmpW
(
http_path
,
httpW
,
len
))
ssl
=
FALSE
;
else
if
(
len
==
sizeof
(
httpsW
)
/
sizeof
(
httpsW
[
0
]
)
&&
!
memicmpW
(
http_path
,
httpsW
,
len
))
ssl
=
TRUE
;
if
(
len
==
ARRAY_SIZE
(
httpW
)
&&
!
memicmpW
(
http_path
,
httpW
,
len
))
ssl
=
FALSE
;
else
if
(
len
==
ARRAY_SIZE
(
httpsW
)
&&
!
memicmpW
(
http_path
,
httpsW
,
len
))
ssl
=
TRUE
;
else
return
ERROR_INVALID_PARAMETER
;
if
(
p
[
0
]
!=
':'
||
p
[
1
]
!=
'/'
||
p
[
2
]
!=
'/'
)
return
ERROR_INVALID_PARAMETER
;
...
...
@@ -3506,7 +3506,7 @@ DWORD WINAPI DavGetUNCFromHTTPPath(const WCHAR *http_path, WCHAR *buf, DWORD *bu
len
=
len_server
+
2
;
/* \\ */
if
(
ssl
)
len
+=
4
;
/* @SSL */
if
(
port
)
len
+=
len_port
+
1
/* @ */
;
len
+=
sizeof
(
davrootW
)
/
sizeof
(
davrootW
[
0
]
);
len
+=
ARRAY_SIZE
(
davrootW
);
len
+=
len_path
+
1
;
/* nul */
if
(
*
buflen
<
len
)
...
...
@@ -3531,7 +3531,7 @@ DWORD WINAPI DavGetUNCFromHTTPPath(const WCHAR *http_path, WCHAR *buf, DWORD *bu
buf
+=
len_port
;
}
memcpy
(
buf
,
davrootW
,
sizeof
(
davrootW
)
);
buf
+=
sizeof
(
davrootW
)
/
sizeof
(
davrootW
[
0
]
);
buf
+=
ARRAY_SIZE
(
davrootW
);
for
(
i
=
0
;
i
<
len_path
;
i
++
)
{
if
(
path
[
i
]
==
'/'
)
*
buf
++
=
'\\'
;
...
...
dlls/netapi32/netbios.c
View file @
2f4f1399
...
...
@@ -135,7 +135,7 @@ BOOL NetBIOSRegisterTransport(ULONG id, NetBIOSTransport *transport)
TRACE
(
": transport 0x%08x, p %p
\n
"
,
id
,
transport
);
if
(
!
transport
)
ret
=
FALSE
;
else
if
(
gNumTransports
>=
sizeof
(
gTransports
)
/
sizeof
(
gTransports
[
0
]
))
else
if
(
gNumTransports
>=
ARRAY_SIZE
(
gTransports
))
{
FIXME
(
"Too many transports %d
\n
"
,
gNumTransports
+
1
);
ret
=
FALSE
;
...
...
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