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
1f9d83f8
Commit
1f9d83f8
authored
Sep 01, 2020
by
Isabella Bosia
Committed by
Alexandre Julliard
Sep 03, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ndis.sys: Create network card devices.
Signed-off-by:
Isabella Bosia
<
ibosia@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
de6db115
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletion
+28
-1
main.c
dlls/ndis.sys/main.c
+28
-1
No files found.
dlls/ndis.sys/main.c
View file @
1f9d83f8
...
...
@@ -55,6 +55,32 @@ static void add_key(const WCHAR *guidstrW, const MIB_IF_ROW2 *netdev)
}
}
static
int
add_device
(
DRIVER_OBJECT
*
driver
,
const
WCHAR
*
guidstrW
,
MIB_IF_ROW2
*
netdev
)
{
WCHAR
nameW
[
47
],
linkW
[
51
];
UNICODE_STRING
name
,
link
;
DEVICE_OBJECT
*
device
;
NTSTATUS
status
;
swprintf
(
nameW
,
ARRAY_SIZE
(
nameW
),
L"
\\
Device
\\
%s"
,
guidstrW
);
RtlInitUnicodeString
(
&
name
,
nameW
);
swprintf
(
linkW
,
ARRAY_SIZE
(
linkW
),
L"
\\
DosDevices
\\
%s"
,
guidstrW
);
RtlInitUnicodeString
(
&
link
,
linkW
);
if
(
!
(
status
=
IoCreateDevice
(
driver
,
sizeof
(
*
netdev
),
&
name
,
0
,
0
,
FALSE
,
&
device
)))
status
=
IoCreateSymbolicLink
(
&
link
,
&
name
);
if
(
status
)
{
FIXME
(
"failed to create device error %x
\n
"
,
status
);
return
0
;
}
memcpy
(
device
->
DeviceExtension
,
netdev
,
sizeof
(
*
netdev
)
);
return
1
;
}
static
void
create_network_devices
(
DRIVER_OBJECT
*
driver
)
{
MIB_IF_TABLE2
*
table
;
...
...
@@ -73,7 +99,8 @@ static void create_network_devices(DRIVER_OBJECT *driver)
guid
->
Data4
[
2
],
guid
->
Data4
[
3
],
guid
->
Data4
[
4
],
guid
->
Data4
[
5
],
guid
->
Data4
[
6
],
guid
->
Data4
[
7
]
);
add_key
(
guidstrW
,
&
table
->
Table
[
i
]
);
if
(
add_device
(
driver
,
guidstrW
,
&
table
->
Table
[
i
]
))
add_key
(
guidstrW
,
&
table
->
Table
[
i
]
);
}
FreeMibTable
(
table
);
...
...
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