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
280999ae
Commit
280999ae
authored
Oct 01, 2021
by
Huw Davies
Committed by
Alexandre Julliard
Oct 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nsiproxy: Use an ascii version of str(n)casecmp() instead of _strnicmp().
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7199f32c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
17 deletions
+38
-17
ip.c
dlls/nsiproxy.sys/ip.c
+11
-11
ndis.c
dlls/nsiproxy.sys/ndis.c
+1
-1
nsiproxy_private.h
dlls/nsiproxy.sys/nsiproxy_private.h
+21
-0
tcp.c
dlls/nsiproxy.sys/tcp.c
+2
-2
udp.c
dlls/nsiproxy.sys/udp.c
+3
-3
No files found.
dlls/nsiproxy.sys/ip.c
View file @
280999ae
...
...
@@ -261,10 +261,10 @@ static NTSTATUS ipv4_icmpstats_get_all_parameters( const void *key, DWORD key_si
while
((
ptr
=
fgets
(
buf
,
sizeof
(
buf
),
fp
)))
{
if
(
_strni
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
continue
;
if
(
ascii_strncase
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
continue
;
/* last line was a header, get another */
if
(
!
(
ptr
=
fgets
(
buf
,
sizeof
(
buf
),
fp
)))
break
;
if
(
!
_strni
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
if
(
!
ascii_strncase
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
{
ptr
+=
sizeof
(
hdr
);
sscanf
(
ptr
,
"%u %u %*u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u %u"
,
...
...
@@ -427,13 +427,13 @@ static NTSTATUS ipv6_icmpstats_get_all_parameters( const void *key, DWORD key_si
while
(
*
value
==
' '
)
value
++
;
if
((
ptr
=
strchr
(
value
,
'\n'
)))
*
ptr
=
'\0'
;
if
(
!
_strnicmp
(
buf
,
"Icmp6InMsgs"
,
-
1
))
if
(
!
ascii_strcasecmp
(
buf
,
"Icmp6InMsgs"
))
{
if
(
sscanf
(
value
,
"%d"
,
&
res
))
dyn
.
in_msgs
=
res
;
continue
;
}
if
(
!
_strnicmp
(
buf
,
"Icmp6InErrors"
,
-
1
))
if
(
!
ascii_strcasecmp
(
buf
,
"Icmp6InErrors"
))
{
if
(
sscanf
(
value
,
"%d"
,
&
res
))
dyn
.
in_errors
=
res
;
continue
;
...
...
@@ -441,7 +441,7 @@ static NTSTATUS ipv6_icmpstats_get_all_parameters( const void *key, DWORD key_si
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
in_list
);
i
++
)
{
if
(
!
_strnicmp
(
buf
,
in_list
[
i
].
name
,
-
1
))
if
(
!
ascii_strcasecmp
(
buf
,
in_list
[
i
].
name
))
{
if
(
sscanf
(
value
,
"%d"
,
&
res
))
dyn
.
in_type_counts
[
in_list
[
i
].
pos
]
=
res
;
...
...
@@ -449,13 +449,13 @@ static NTSTATUS ipv6_icmpstats_get_all_parameters( const void *key, DWORD key_si
}
}
if
(
!
_strnicmp
(
buf
,
"Icmp6OutMsgs"
,
-
1
))
if
(
!
ascii_strcasecmp
(
buf
,
"Icmp6OutMsgs"
))
{
if
(
sscanf
(
value
,
"%d"
,
&
res
))
dyn
.
out_msgs
=
res
;
continue
;
}
if
(
!
_strnicmp
(
buf
,
"Icmp6OutErrors"
,
-
1
))
if
(
!
ascii_strcasecmp
(
buf
,
"Icmp6OutErrors"
))
{
if
(
sscanf
(
value
,
"%d"
,
&
res
))
dyn
.
out_errors
=
res
;
continue
;
...
...
@@ -463,7 +463,7 @@ static NTSTATUS ipv6_icmpstats_get_all_parameters( const void *key, DWORD key_si
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
out_list
);
i
++
)
{
if
(
!
_strnicmp
(
buf
,
out_list
[
i
].
name
,
-
1
))
if
(
!
ascii_strcasecmp
(
buf
,
out_list
[
i
].
name
))
{
if
(
sscanf
(
value
,
"%d"
,
&
res
))
dyn
.
out_type_counts
[
out_list
[
i
].
pos
]
=
res
;
...
...
@@ -504,10 +504,10 @@ static NTSTATUS ipv4_ipstats_get_all_parameters( const void *key, DWORD key_size
while
((
ptr
=
fgets
(
buf
,
sizeof
(
buf
),
fp
)))
{
if
(
_strni
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
continue
;
if
(
ascii_strncase
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
continue
;
/* last line was a header, get another */
if
(
!
(
ptr
=
fgets
(
buf
,
sizeof
(
buf
),
fp
)))
break
;
if
(
!
_strni
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
if
(
!
ascii_strncase
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
{
DWORD
in_recv
,
in_hdr_errs
,
fwd_dgrams
,
in_delivers
,
out_reqs
;
ptr
+=
sizeof
(
hdr
);
...
...
@@ -643,7 +643,7 @@ static NTSTATUS ipv6_ipstats_get_all_parameters( const void *key, DWORD key_size
if
((
ptr
=
strchr
(
value
,
'\n'
)))
*
ptr
=
'\0'
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
ipstatlist
);
i
++
)
if
(
!
_strnicmp
(
buf
,
ipstatlist
[
i
].
name
,
-
1
))
if
(
!
ascii_strcasecmp
(
buf
,
ipstatlist
[
i
].
name
))
{
if
(
ipstatlist
[
i
].
size
==
sizeof
(
long
))
*
(
long
*
)
ipstatlist
[
i
].
elem
=
strtoul
(
value
,
NULL
,
10
);
...
...
dlls/nsiproxy.sys/ndis.c
View file @
280999ae
...
...
@@ -354,7 +354,7 @@ static void ifinfo_fill_dynamic( struct if_entry *entry, struct nsi_ndis_ifinfo_
while
((
ptr
=
fgets
(
buf
,
sizeof
(
buf
),
fp
)))
{
while
(
*
ptr
&&
isspace
(
*
ptr
))
ptr
++
;
if
(
!
_strni
cmp
(
ptr
,
entry
->
if_unix_name
,
name_len
)
&&
ptr
[
name_len
]
==
':'
)
if
(
!
ascii_strncase
cmp
(
ptr
,
entry
->
if_unix_name
,
name_len
)
&&
ptr
[
name_len
]
==
':'
)
{
unsigned
long
long
values
[
9
];
ptr
+=
name_len
+
1
;
...
...
dlls/nsiproxy.sys/nsiproxy_private.h
View file @
280999ae
...
...
@@ -135,3 +135,24 @@ extern const struct module ipv4_module DECLSPEC_HIDDEN;
extern
const
struct
module
ipv6_module
DECLSPEC_HIDDEN
;
extern
const
struct
module
tcp_module
DECLSPEC_HIDDEN
;
extern
const
struct
module
udp_module
DECLSPEC_HIDDEN
;
static
inline
int
ascii_strncasecmp
(
const
char
*
s1
,
const
char
*
s2
,
size_t
n
)
{
int
l1
,
l2
;
while
(
n
--
)
{
l1
=
(
unsigned
char
)((
*
s1
>=
'A'
&&
*
s1
<=
'Z'
)
?
*
s1
+
(
'a'
-
'A'
)
:
*
s1
);
l2
=
(
unsigned
char
)((
*
s2
>=
'A'
&&
*
s2
<=
'Z'
)
?
*
s2
+
(
'a'
-
'A'
)
:
*
s2
);
if
(
l1
!=
l2
)
return
l1
-
l2
;
if
(
!
l1
)
return
0
;
s1
++
;
s2
++
;
}
return
0
;
}
static
inline
int
ascii_strcasecmp
(
const
char
*
s1
,
const
char
*
s2
)
{
return
ascii_strncasecmp
(
s1
,
s2
,
-
1
);
}
dlls/nsiproxy.sys/tcp.c
View file @
280999ae
...
...
@@ -147,10 +147,10 @@ static NTSTATUS tcp_stats_get_all_parameters( const void *key, DWORD key_size, v
while
((
ptr
=
fgets
(
buf
,
sizeof
(
buf
),
fp
)))
{
if
(
_strni
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
continue
;
if
(
ascii_strncase
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
continue
;
/* last line was a header, get another */
if
(
!
(
ptr
=
fgets
(
buf
,
sizeof
(
buf
),
fp
)))
break
;
if
(
!
_strni
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
if
(
!
ascii_strncase
cmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
{
DWORD
in_segs
,
out_segs
;
ptr
+=
sizeof
(
hdr
);
...
...
dlls/nsiproxy.sys/udp.c
View file @
280999ae
...
...
@@ -123,10 +123,10 @@ static NTSTATUS udp_stats_get_all_parameters( const void *key, DWORD key_size, v
while
((
ptr
=
fgets
(
buf
,
sizeof
(
buf
),
fp
)))
{
if
(
_strnicmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
)
)
continue
;
if
(
ascii_strncasecmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
)
)
continue
;
/* last line was a header, get another */
if
(
!
(
ptr
=
fgets
(
buf
,
sizeof
(
buf
),
fp
)))
break
;
if
(
!
_strnicmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
if
(
!
ascii_strncasecmp
(
buf
,
hdr
,
sizeof
(
hdr
)
-
1
))
{
unsigned
int
in_dgrams
,
out_dgrams
;
ptr
+=
sizeof
(
hdr
);
...
...
@@ -176,7 +176,7 @@ static NTSTATUS udp_stats_get_all_parameters( const void *key, DWORD key_size, v
if
((
ptr
=
strchr
(
value
,
'\n'
)))
*
ptr
=
'\0'
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
udp_stat_list
);
i
++
)
if
(
!
_strnicmp
(
buf
,
udp_stat_list
[
i
].
name
,
-
1
)
&&
sscanf
(
value
,
"%d"
,
&
res
))
if
(
!
ascii_strcasecmp
(
buf
,
udp_stat_list
[
i
].
name
)
&&
sscanf
(
value
,
"%d"
,
&
res
))
*
udp_stat_list
[
i
].
elem
=
res
;
}
dyn
.
in_dgrams
=
in_dgrams
;
...
...
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