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
f5238be3
Commit
f5238be3
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_parameter for a few parameters.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
794ecdc5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
2 deletions
+81
-2
nsi.c
dlls/nsi/tests/nsi.c
+11
-2
ndis.c
dlls/nsiproxy.sys/ndis.c
+70
-0
No files found.
dlls/nsi/tests/nsi.c
View file @
f5238be3
...
...
@@ -113,9 +113,7 @@ static void test_nsi_api( void )
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
"
);
...
...
@@ -362,12 +360,23 @@ static void test_ndis_ifinfo( void )
ok
(
!
err
,
"got %d
\n
"
,
err
);
ok
(
IsEqualGUID
(
&
stat_tbl
[
0
].
if_guid
,
&
stat_get
.
if_guid
),
"mismatch
\n
"
);
err
=
NsiGetParameter
(
1
,
&
NPI_MS_NDIS_MODULEID
,
NSI_NDIS_IFINFO_TABLE
,
luid_tbl
,
sizeof
(
*
luid_tbl
),
NSI_PARAM_TYPE_STATIC
,
&
stat_get
.
if_guid
,
sizeof
(
stat_get
.
if_guid
),
FIELD_OFFSET
(
struct
nsi_ndis_ifinfo_static
,
if_guid
)
);
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
);
err
=
NsiGetParameter
(
1
,
&
NPI_MS_NDIS_MODULEID
,
NSI_NDIS_IFINFO_TABLE
,
&
luid_get
,
sizeof
(
luid_get
),
NSI_PARAM_TYPE_STATIC
,
&
stat_get
.
if_guid
,
sizeof
(
stat_get
.
if_guid
),
FIELD_OFFSET
(
struct
nsi_ndis_ifinfo_static
,
if_guid
)
);
ok
(
err
==
ERROR_FILE_NOT_FOUND
,
"got %d
\n
"
,
err
);
FreeMibTable
(
table
);
NsiFreeTable
(
luid_tbl_2
,
NULL
,
dyn_tbl_2
,
NULL
);
NsiFreeTable
(
luid_tbl
,
rw_tbl
,
dyn_tbl
,
stat_tbl
);
...
...
dlls/nsiproxy.sys/ndis.c
View file @
f5238be3
...
...
@@ -515,6 +515,75 @@ static NTSTATUS ifinfo_get_all_parameters( const void *key, DWORD key_size, void
return
status
;
}
static
NTSTATUS
ifinfo_get_rw_parameter
(
struct
if_entry
*
entry
,
void
*
data
,
DWORD
data_size
,
DWORD
data_offset
)
{
switch
(
data_offset
)
{
case
FIELD_OFFSET
(
struct
nsi_ndis_ifinfo_rw
,
alias
):
{
IF_COUNTED_STRING
*
str
=
(
IF_COUNTED_STRING
*
)
data
;
if
(
data_size
!=
sizeof
(
*
str
))
return
STATUS_INVALID_PARAMETER
;
if_counted_string_init
(
str
,
entry
->
if_name
);
return
STATUS_SUCCESS
;
}
default:
FIXME
(
"Offset %#x not handled
\n
"
,
data_offset
);
}
return
STATUS_INVALID_PARAMETER
;
}
static
NTSTATUS
ifinfo_get_static_parameter
(
struct
if_entry
*
entry
,
void
*
data
,
DWORD
data_size
,
DWORD
data_offset
)
{
switch
(
data_offset
)
{
case
FIELD_OFFSET
(
struct
nsi_ndis_ifinfo_static
,
if_index
):
if
(
data_size
!=
sizeof
(
DWORD
))
return
STATUS_INVALID_PARAMETER
;
*
(
DWORD
*
)
data
=
entry
->
if_index
;
return
STATUS_SUCCESS
;
case
FIELD_OFFSET
(
struct
nsi_ndis_ifinfo_static
,
if_guid
):
if
(
data_size
!=
sizeof
(
GUID
))
return
STATUS_INVALID_PARAMETER
;
*
(
GUID
*
)
data
=
entry
->
if_guid
;
return
STATUS_SUCCESS
;
default:
FIXME
(
"Offset %#x not handled
\n
"
,
data_offset
);
}
return
STATUS_INVALID_PARAMETER
;
}
static
NTSTATUS
ifinfo_get_parameter
(
const
void
*
key
,
DWORD
key_size
,
DWORD
param_type
,
void
*
data
,
DWORD
data_size
,
DWORD
data_offset
)
{
struct
if_entry
*
entry
;
NTSTATUS
status
=
STATUS_OBJECT_NAME_NOT_FOUND
;
TRACE
(
"%p %d %d %p %d %d
\n
"
,
key
,
key_size
,
param_type
,
data
,
data_size
,
data_offset
);
EnterCriticalSection
(
&
if_list_cs
);
update_if_table
();
entry
=
find_entry_from_luid
(
(
const
NET_LUID
*
)
key
);
if
(
entry
)
{
switch
(
param_type
)
{
case
NSI_PARAM_TYPE_RW
:
status
=
ifinfo_get_rw_parameter
(
entry
,
data
,
data_size
,
data_offset
);
break
;
case
NSI_PARAM_TYPE_STATIC
:
status
=
ifinfo_get_static_parameter
(
entry
,
data
,
data_size
,
data_offset
);
break
;
}
}
LeaveCriticalSection
(
&
if_list_cs
);
return
status
;
}
static
const
struct
module_table
tables
[]
=
{
{
...
...
@@ -525,6 +594,7 @@ static const struct module_table tables[] =
},
ifinfo_enumerate_all
,
ifinfo_get_all_parameters
,
ifinfo_get_parameter
},
{
~
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