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
b0ceee34
Commit
b0ceee34
authored
Jul 01, 2021
by
Huw Davies
Committed by
Alexandre Julliard
Jul 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nsiproxy: Implement NDIS ifinfo get_all_parameters.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0f25a946
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
6 deletions
+54
-6
nsi.c
dlls/nsi/tests/nsi.c
+17
-6
ndis.c
dlls/nsiproxy.sys/ndis.c
+37
-0
No files found.
dlls/nsi/tests/nsi.c
View file @
b0ceee34
...
...
@@ -66,9 +66,7 @@ static void test_nsi_api( void )
err
=
NsiGetAllParameters
(
1
,
&
NPI_MS_NDIS_MODULEID
,
NSI_NDIS_IFINFO_TABLE
,
luid_tbl
+
i
,
sizeof
(
*
luid_tbl
),
&
get_rw
,
rw_size
,
&
get_dyn
,
sizeof
(
get_dyn
),
&
get_stat
,
sizeof
(
get_stat
)
);
todo_wine
ok
(
!
err
,
"got %d
\n
"
,
err
);
if
(
err
)
break
;
/* test a selection of members */
ok
(
IsEqualGUID
(
&
get_rw
.
network_guid
,
&
rw
->
network_guid
),
"mismatch
\n
"
);
ok
(
get_rw
.
alias
.
Length
==
rw
->
alias
.
Length
,
"mismatch
\n
"
);
...
...
@@ -115,7 +113,9 @@ todo_wine
err
=
NsiGetParameter
(
1
,
&
NPI_MS_NDIS_MODULEID
,
NSI_NDIS_IFINFO_TABLE
,
luid_tbl
+
i
,
sizeof
(
*
luid_tbl
),
NSI_PARAM_TYPE_RW
,
&
get_rw
.
alias
,
sizeof
(
get_rw
.
alias
),
FIELD_OFFSET
(
struct
nsi_ndis_ifinfo_rw
,
alias
)
);
todo_wine
ok
(
!
err
,
"got %d
\n
"
,
err
);
if
(
err
)
continue
;
ok
(
get_rw
.
alias
.
Length
==
rw
->
alias
.
Length
,
"mismatch
\n
"
);
ok
(
!
memcmp
(
get_rw
.
alias
.
String
,
rw
->
alias
.
String
,
rw
->
alias
.
Length
),
"mismatch
\n
"
);
...
...
@@ -257,11 +257,11 @@ static void test_ndis_ifinfo( void )
{
DWORD
rw_sizes
[]
=
{
FIELD_OFFSET
(
struct
nsi_ndis_ifinfo_rw
,
name2
),
FIELD_OFFSET
(
struct
nsi_ndis_ifinfo_rw
,
unk
),
sizeof
(
struct
nsi_ndis_ifinfo_rw
)
};
struct
nsi_ndis_ifinfo_rw
*
rw_tbl
;
struct
nsi_ndis_ifinfo_dynamic
*
dyn_tbl
,
*
dyn_tbl_2
;
struct
nsi_ndis_ifinfo_static
*
stat_tbl
;
struct
nsi_ndis_ifinfo_rw
*
rw_tbl
,
rw_get
;
struct
nsi_ndis_ifinfo_dynamic
*
dyn_tbl
,
*
dyn_tbl_2
,
dyn_get
;
struct
nsi_ndis_ifinfo_static
*
stat_tbl
,
stat_get
;
DWORD
err
,
count
,
i
,
rw_size
;
NET_LUID
*
luid_tbl
,
*
luid_tbl_2
;
NET_LUID
*
luid_tbl
,
*
luid_tbl_2
,
luid_get
;
MIB_IF_TABLE2
*
table
;
/* Contents of GetIfTable2() keyed by luids */
...
...
@@ -356,6 +356,17 @@ static void test_ndis_ifinfo( void )
/* OutQLen */
winetest_pop_context
();
}
err
=
NsiGetAllParameters
(
1
,
&
NPI_MS_NDIS_MODULEID
,
NSI_NDIS_IFINFO_TABLE
,
luid_tbl
,
sizeof
(
*
luid_tbl
),
&
rw_get
,
rw_size
,
&
dyn_get
,
sizeof
(
dyn_get
),
&
stat_get
,
sizeof
(
stat_get
)
);
ok
(
!
err
,
"got %d
\n
"
,
err
);
ok
(
IsEqualGUID
(
&
stat_tbl
[
0
].
if_guid
,
&
stat_get
.
if_guid
),
"mismatch
\n
"
);
luid_get
.
Value
=
~
0u
;
err
=
NsiGetAllParameters
(
1
,
&
NPI_MS_NDIS_MODULEID
,
NSI_NDIS_IFINFO_TABLE
,
&
luid_get
,
sizeof
(
luid_get
),
&
rw_get
,
rw_size
,
&
dyn_get
,
sizeof
(
dyn_get
),
&
stat_get
,
sizeof
(
stat_get
)
);
ok
(
err
==
ERROR_FILE_NOT_FOUND
,
"got %d
\n
"
,
err
);
FreeMibTable
(
table
);
NsiFreeTable
(
luid_tbl_2
,
NULL
,
dyn_tbl_2
,
NULL
);
...
...
dlls/nsiproxy.sys/ndis.c
View file @
b0ceee34
...
...
@@ -118,6 +118,16 @@ static struct if_entry *find_entry_from_index( DWORD index )
return
NULL
;
}
static
struct
if_entry
*
find_entry_from_luid
(
const
NET_LUID
*
luid
)
{
struct
if_entry
*
entry
;
LIST_FOR_EACH_ENTRY
(
entry
,
&
if_list
,
struct
if_entry
,
entry
)
if
(
entry
->
if_luid
.
Value
==
luid
->
Value
)
return
entry
;
return
NULL
;
}
#if defined (SIOCGIFHWADDR) && defined (HAVE_STRUCT_IFREQ_IFR_HWADDR)
static
NTSTATUS
if_get_physical
(
const
char
*
name
,
DWORD
*
type
,
IF_PHYSICAL_ADDRESS
*
phys_addr
)
{
...
...
@@ -479,6 +489,32 @@ static NTSTATUS ifinfo_enumerate_all( void *key_data, DWORD key_size, void *rw_d
return
status
;
}
static
NTSTATUS
ifinfo_get_all_parameters
(
const
void
*
key
,
DWORD
key_size
,
void
*
rw_data
,
DWORD
rw_size
,
void
*
dynamic_data
,
DWORD
dynamic_size
,
void
*
static_data
,
DWORD
static_size
)
{
struct
if_entry
*
entry
;
NTSTATUS
status
=
STATUS_OBJECT_NAME_NOT_FOUND
;
TRACE
(
"%p %d %p %d %p %d %p %d
\n
"
,
key
,
key_size
,
rw_data
,
rw_size
,
dynamic_data
,
dynamic_size
,
static_data
,
static_size
);
EnterCriticalSection
(
&
if_list_cs
);
update_if_table
();
entry
=
find_entry_from_luid
(
(
const
NET_LUID
*
)
key
);
if
(
entry
)
{
ifinfo_fill_entry
(
entry
,
NULL
,
rw_data
,
dynamic_data
,
static_data
);
status
=
STATUS_SUCCESS
;
}
LeaveCriticalSection
(
&
if_list_cs
);
return
status
;
}
static
const
struct
module_table
tables
[]
=
{
{
...
...
@@ -488,6 +524,7 @@ static const struct module_table tables[] =
sizeof
(
struct
nsi_ndis_ifinfo_dynamic
),
sizeof
(
struct
nsi_ndis_ifinfo_static
)
},
ifinfo_enumerate_all
,
ifinfo_get_all_parameters
,
},
{
~
0u
}
};
...
...
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