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
25a582cf
Commit
25a582cf
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: Introduce IOCTL_NSIPROXY_WINE_GET_ALL_PARAMETERS.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
151370c4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
0 deletions
+88
-0
device.c
dlls/nsiproxy.sys/device.c
+45
-0
nsi.c
dlls/nsiproxy.sys/nsi.c
+25
-0
nsiproxy_private.h
dlls/nsiproxy.sys/nsiproxy_private.h
+4
-0
nsi.h
include/wine/nsi.h
+14
-0
No files found.
dlls/nsiproxy.sys/device.c
View file @
25a582cf
...
...
@@ -82,6 +82,47 @@ static void nsiproxy_enumerate_all( IRP *irp )
else
irp
->
IoStatus
.
Information
=
0
;
}
static
void
nsiproxy_get_all_parameters
(
IRP
*
irp
)
{
IO_STACK_LOCATION
*
irpsp
=
IoGetCurrentIrpStackLocation
(
irp
);
struct
nsiproxy_get_all_parameters
*
in
=
(
struct
nsiproxy_get_all_parameters
*
)
irp
->
AssociatedIrp
.
SystemBuffer
;
DWORD
in_len
=
irpsp
->
Parameters
.
DeviceIoControl
.
InputBufferLength
;
BYTE
*
out
=
irp
->
AssociatedIrp
.
SystemBuffer
;
DWORD
out_len
=
irpsp
->
Parameters
.
DeviceIoControl
.
OutputBufferLength
;
struct
nsi_get_all_parameters_ex
get_all
;
if
(
in_len
<
FIELD_OFFSET
(
struct
nsiproxy_get_all_parameters
,
key
[
0
])
||
in_len
<
FIELD_OFFSET
(
struct
nsiproxy_get_all_parameters
,
key
[
in
->
key_size
]))
{
irp
->
IoStatus
.
u
.
Status
=
STATUS_INVALID_PARAMETER
;
return
;
}
if
(
out_len
<
in
->
rw_size
+
in
->
dynamic_size
+
in
->
static_size
)
{
irp
->
IoStatus
.
u
.
Status
=
STATUS_INVALID_PARAMETER
;
return
;
}
get_all
.
unknown
[
0
]
=
0
;
get_all
.
unknown
[
1
]
=
0
;
get_all
.
first_arg
=
in
->
first_arg
;
get_all
.
unknown2
=
0
;
get_all
.
module
=
&
in
->
module
;
get_all
.
table
=
in
->
table
;
get_all
.
key
=
in
->
key
;
get_all
.
key_size
=
in
->
key_size
;
get_all
.
rw_data
=
out
;
get_all
.
rw_size
=
in
->
rw_size
;
get_all
.
dynamic_data
=
out
+
in
->
rw_size
;
get_all
.
dynamic_size
=
in
->
dynamic_size
;
get_all
.
static_data
=
out
+
in
->
rw_size
+
in
->
dynamic_size
;
get_all
.
static_size
=
in
->
static_size
;
irp
->
IoStatus
.
u
.
Status
=
nsi_get_all_parameters_ex
(
&
get_all
);
irp
->
IoStatus
.
Information
=
(
irp
->
IoStatus
.
u
.
Status
==
STATUS_SUCCESS
)
?
out_len
:
0
;
}
static
NTSTATUS
WINAPI
nsi_ioctl
(
DEVICE_OBJECT
*
device
,
IRP
*
irp
)
{
IO_STACK_LOCATION
*
irpsp
=
IoGetCurrentIrpStackLocation
(
irp
);
...
...
@@ -97,6 +138,10 @@ static NTSTATUS WINAPI nsi_ioctl( DEVICE_OBJECT *device, IRP *irp )
nsiproxy_enumerate_all
(
irp
);
break
;
case
IOCTL_NSIPROXY_WINE_GET_ALL_PARAMETERS
:
nsiproxy_get_all_parameters
(
irp
);
break
;
default:
FIXME
(
"ioctl %x not supported
\n
"
,
irpsp
->
Parameters
.
DeviceIoControl
.
IoControlCode
);
irp
->
IoStatus
.
u
.
Status
=
STATUS_NOT_SUPPORTED
;
...
...
dlls/nsiproxy.sys/nsi.c
View file @
25a582cf
...
...
@@ -74,3 +74,28 @@ NTSTATUS nsi_enumerate_all_ex( struct nsi_enumerate_all_ex *params )
return
entry
->
enumerate_all
(
data
[
0
],
sizes
[
0
],
data
[
1
],
sizes
[
1
],
data
[
2
],
sizes
[
2
],
data
[
3
],
sizes
[
3
],
&
params
->
count
);
}
NTSTATUS
nsi_get_all_parameters_ex
(
struct
nsi_get_all_parameters_ex
*
params
)
{
const
struct
module_table
*
entry
=
get_module_table
(
params
->
module
,
params
->
table
);
void
*
rw
=
params
->
rw_data
;
void
*
dyn
=
params
->
dynamic_data
;
void
*
stat
=
params
->
static_data
;
if
(
!
entry
||
!
entry
->
get_all_parameters
)
{
WARN
(
"table not found
\n
"
);
return
STATUS_INVALID_PARAMETER
;
}
if
(
params
->
key_size
!=
entry
->
sizes
[
0
])
return
STATUS_INVALID_PARAMETER
;
if
(
!
params
->
rw_size
)
rw
=
NULL
;
else
if
(
params
->
rw_size
!=
entry
->
sizes
[
1
])
return
STATUS_INVALID_PARAMETER
;
if
(
!
params
->
dynamic_size
)
dyn
=
NULL
;
else
if
(
params
->
dynamic_size
!=
entry
->
sizes
[
2
])
return
STATUS_INVALID_PARAMETER
;
if
(
!
params
->
static_size
)
stat
=
NULL
;
else
if
(
params
->
static_size
!=
entry
->
sizes
[
3
])
return
STATUS_INVALID_PARAMETER
;
return
entry
->
get_all_parameters
(
params
->
key
,
params
->
key_size
,
rw
,
params
->
rw_size
,
dyn
,
params
->
dynamic_size
,
stat
,
params
->
static_size
);
}
dlls/nsiproxy.sys/nsiproxy_private.h
View file @
25a582cf
...
...
@@ -19,6 +19,7 @@
*/
NTSTATUS
nsi_enumerate_all_ex
(
struct
nsi_enumerate_all_ex
*
params
)
DECLSPEC_HIDDEN
;
NTSTATUS
nsi_get_all_parameters_ex
(
struct
nsi_get_all_parameters_ex
*
params
)
DECLSPEC_HIDDEN
;
struct
module_table
{
...
...
@@ -27,6 +28,9 @@ struct module_table
NTSTATUS
(
*
enumerate_all
)(
void
*
key_data
,
DWORD
key_size
,
void
*
rw_data
,
DWORD
rw_size
,
void
*
dynamic_data
,
DWORD
dynamic_size
,
void
*
static_data
,
DWORD
static_size
,
DWORD_PTR
*
count
);
NTSTATUS
(
*
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
module
...
...
include/wine/nsi.h
View file @
25a582cf
...
...
@@ -97,6 +97,7 @@ struct nsi_ndis_ifinfo_static
/* Wine specific ioctl interface */
#define IOCTL_NSIPROXY_WINE_ENUMERATE_ALL CTL_CODE(FILE_DEVICE_NETWORK, 0x400, METHOD_BUFFERED, 0)
#define IOCTL_NSIPROXY_WINE_GET_ALL_PARAMETERS CTL_CODE(FILE_DEVICE_NETWORK, 0x401, METHOD_BUFFERED, 0)
/* input for IOCTL_NSIPROXY_WINE_ENUMERATE_ALL */
struct
nsiproxy_enumerate_all
...
...
@@ -112,6 +113,19 @@ struct nsiproxy_enumerate_all
DWORD
count
;
};
/* input for IOCTL_NSIPROXY_WINE_GET_ALL_PARAMETERS */
struct
nsiproxy_get_all_parameters
{
NPI_MODULEID
module
;
DWORD
first_arg
;
DWORD
table
;
DWORD
key_size
;
DWORD
rw_size
;
DWORD
dynamic_size
;
DWORD
static_size
;
BYTE
key
[
1
];
/* key_size */
};
/* Undocumented Nsi api */
#define NSI_PARAM_TYPE_RW 0
...
...
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