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
ecbd9978
Commit
ecbd9978
authored
Jul 02, 2021
by
Huw Davies
Committed by
Alexandre Julliard
Jul 02, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
nsiproxy: Implement NDIS index to luid get_parameter.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
8eef4a87
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
0 deletions
+65
-0
nsi.c
dlls/nsi/tests/nsi.c
+30
-0
ndis.c
dlls/nsiproxy.sys/ndis.c
+35
-0
No files found.
dlls/nsi/tests/nsi.c
View file @
ecbd9978
...
...
@@ -382,9 +382,39 @@ static void test_ndis_ifinfo( void )
NsiFreeTable
(
luid_tbl
,
rw_tbl
,
dyn_tbl
,
stat_tbl
);
}
static
void
test_ndis_index_luid
(
void
)
{
DWORD
err
,
count
,
i
;
NET_LUID
*
luids
,
luid
;
DWORD
index
;
/* index -> luid map. NsiAllocateAndGetTable and NsiGetAllParameters fail */
/* first get the luids */
err
=
NsiAllocateAndGetTable
(
1
,
&
NPI_MS_NDIS_MODULEID
,
NSI_NDIS_IFINFO_TABLE
,
(
void
**
)
&
luids
,
sizeof
(
*
luids
),
NULL
,
0
,
NULL
,
0
,
NULL
,
0
,
&
count
,
0
);
ok
(
!
err
,
"got %d
\n
"
,
err
);
for
(
i
=
0
;
i
<
count
;
i
++
)
{
ConvertInterfaceLuidToIndex
(
luids
+
i
,
&
index
);
err
=
NsiGetParameter
(
1
,
&
NPI_MS_NDIS_MODULEID
,
NSI_NDIS_INDEX_LUID_TABLE
,
&
index
,
sizeof
(
index
),
NSI_PARAM_TYPE_STATIC
,
&
luid
,
sizeof
(
luid
),
0
);
ok
(
!
err
,
"got %d
\n
"
,
err
);
ok
(
luid
.
Value
==
luids
[
i
].
Value
,
"%d: luid mismatch
\n
"
,
i
);
}
NsiFreeTable
(
luids
,
NULL
,
NULL
,
NULL
);
index
=
~
0u
;
err
=
NsiGetParameter
(
1
,
&
NPI_MS_NDIS_MODULEID
,
NSI_NDIS_INDEX_LUID_TABLE
,
&
index
,
sizeof
(
index
),
NSI_PARAM_TYPE_STATIC
,
&
luid
,
sizeof
(
luid
),
0
);
ok
(
err
==
ERROR_FILE_NOT_FOUND
,
"got %d
\n
"
,
err
);
}
START_TEST
(
nsi
)
{
test_nsi_api
();
test_ndis_ifinfo
();
test_ndis_index_luid
();
}
dlls/nsiproxy.sys/ndis.c
View file @
ecbd9978
...
...
@@ -584,6 +584,31 @@ static NTSTATUS ifinfo_get_parameter( const void *key, DWORD key_size, DWORD par
return
status
;
}
static
NTSTATUS
index_luid_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
);
if
(
param_type
!=
NSI_PARAM_TYPE_STATIC
||
data_size
!=
sizeof
(
NET_LUID
)
||
data_offset
!=
0
)
return
STATUS_INVALID_PARAMETER
;
EnterCriticalSection
(
&
if_list_cs
);
update_if_table
();
entry
=
find_entry_from_index
(
*
(
DWORD
*
)
key
);
if
(
entry
)
{
*
(
NET_LUID
*
)
data
=
entry
->
if_luid
;
status
=
STATUS_SUCCESS
;
}
LeaveCriticalSection
(
&
if_list_cs
);
return
status
;
}
static
const
struct
module_table
tables
[]
=
{
{
...
...
@@ -596,6 +621,16 @@ static const struct module_table tables[] =
ifinfo_get_all_parameters
,
ifinfo_get_parameter
},
{
NSI_NDIS_INDEX_LUID_TABLE
,
{
sizeof
(
DWORD
),
0
,
0
,
sizeof
(
NET_LUID
)
},
NULL
,
NULL
,
index_luid_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