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
8f7f4f13
Commit
8f7f4f13
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_PARAMETER.
Signed-off-by:
Huw Davies
<
huw@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
b0ceee34
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
71 additions
and
0 deletions
+71
-0
device.c
dlls/nsiproxy.sys/device.c
+37
-0
nsi.c
dlls/nsiproxy.sys/nsi.c
+18
-0
nsiproxy_private.h
dlls/nsiproxy.sys/nsiproxy_private.h
+3
-0
nsi.h
include/wine/nsi.h
+13
-0
No files found.
dlls/nsiproxy.sys/device.c
View file @
8f7f4f13
...
...
@@ -123,6 +123,39 @@ static void nsiproxy_get_all_parameters( IRP *irp )
irp
->
IoStatus
.
Information
=
(
irp
->
IoStatus
.
u
.
Status
==
STATUS_SUCCESS
)
?
out_len
:
0
;
}
static
void
nsiproxy_get_parameter
(
IRP
*
irp
)
{
IO_STACK_LOCATION
*
irpsp
=
IoGetCurrentIrpStackLocation
(
irp
);
struct
nsiproxy_get_parameter
*
in
=
(
struct
nsiproxy_get_parameter
*
)
irp
->
AssociatedIrp
.
SystemBuffer
;
DWORD
in_len
=
irpsp
->
Parameters
.
DeviceIoControl
.
InputBufferLength
;
void
*
out
=
irp
->
AssociatedIrp
.
SystemBuffer
;
DWORD
out_len
=
irpsp
->
Parameters
.
DeviceIoControl
.
OutputBufferLength
;
struct
nsi_get_parameter_ex
get_param
;
if
(
in_len
<
FIELD_OFFSET
(
struct
nsiproxy_get_parameter
,
key
[
0
])
||
in_len
<
FIELD_OFFSET
(
struct
nsiproxy_get_parameter
,
key
[
in
->
key_size
]))
{
irp
->
IoStatus
.
u
.
Status
=
STATUS_INVALID_PARAMETER
;
return
;
}
get_param
.
unknown
[
0
]
=
0
;
get_param
.
unknown
[
1
]
=
0
;
get_param
.
first_arg
=
in
->
first_arg
;
get_param
.
unknown2
=
0
;
get_param
.
module
=
&
in
->
module
;
get_param
.
table
=
in
->
table
;
get_param
.
key
=
in
->
key
;
get_param
.
key_size
=
in
->
key_size
;
get_param
.
param_type
=
in
->
param_type
;
get_param
.
data
=
out
;
get_param
.
data_size
=
out_len
;
get_param
.
data_offset
=
in
->
data_offset
;
irp
->
IoStatus
.
u
.
Status
=
nsi_get_parameter_ex
(
&
get_param
);
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
);
...
...
@@ -142,6 +175,10 @@ static NTSTATUS WINAPI nsi_ioctl( DEVICE_OBJECT *device, IRP *irp )
nsiproxy_get_all_parameters
(
irp
);
break
;
case
IOCTL_NSIPROXY_WINE_GET_PARAMETER
:
nsiproxy_get_parameter
(
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 @
8f7f4f13
...
...
@@ -99,3 +99,21 @@ NTSTATUS nsi_get_all_parameters_ex( struct nsi_get_all_parameters_ex *params )
return
entry
->
get_all_parameters
(
params
->
key
,
params
->
key_size
,
rw
,
params
->
rw_size
,
dyn
,
params
->
dynamic_size
,
stat
,
params
->
static_size
);
}
NTSTATUS
nsi_get_parameter_ex
(
struct
nsi_get_parameter_ex
*
params
)
{
const
struct
module_table
*
entry
=
get_module_table
(
params
->
module
,
params
->
table
);
if
(
!
entry
||
!
entry
->
get_parameter
)
{
WARN
(
"table not found
\n
"
);
return
STATUS_INVALID_PARAMETER
;
}
if
(
params
->
param_type
>
2
)
return
STATUS_INVALID_PARAMETER
;
if
(
params
->
key_size
!=
entry
->
sizes
[
0
])
return
STATUS_INVALID_PARAMETER
;
if
(
params
->
data_offset
+
params
->
data_size
>
entry
->
sizes
[
params
->
param_type
+
1
])
return
STATUS_INVALID_PARAMETER
;
return
entry
->
get_parameter
(
params
->
key
,
params
->
key_size
,
params
->
param_type
,
params
->
data
,
params
->
data_size
,
params
->
data_offset
);
}
dlls/nsiproxy.sys/nsiproxy_private.h
View file @
8f7f4f13
...
...
@@ -20,6 +20,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
;
NTSTATUS
nsi_get_parameter_ex
(
struct
nsi_get_parameter_ex
*
params
)
DECLSPEC_HIDDEN
;
struct
module_table
{
...
...
@@ -31,6 +32,8 @@ struct module_table
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
);
NTSTATUS
(
*
get_parameter
)(
const
void
*
key
,
DWORD
key_size
,
DWORD
param_type
,
void
*
data
,
DWORD
data_size
,
DWORD
data_offset
);
};
struct
module
...
...
include/wine/nsi.h
View file @
8f7f4f13
...
...
@@ -98,6 +98,7 @@ struct nsi_ndis_ifinfo_static
#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)
#define IOCTL_NSIPROXY_WINE_GET_PARAMETER CTL_CODE(FILE_DEVICE_NETWORK, 0x402, METHOD_BUFFERED, 0)
/* input for IOCTL_NSIPROXY_WINE_ENUMERATE_ALL */
struct
nsiproxy_enumerate_all
...
...
@@ -126,6 +127,18 @@ struct nsiproxy_get_all_parameters
BYTE
key
[
1
];
/* key_size */
};
/* input for IOCTL_NSIPROXY_WINE_GET_PARAMETER */
struct
nsiproxy_get_parameter
{
NPI_MODULEID
module
;
DWORD
first_arg
;
DWORD
table
;
DWORD
key_size
;
DWORD
param_type
;
DWORD
data_offset
;
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