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
de6db115
Commit
de6db115
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 registry keys.
Signed-off-by:
Isabella Bosia
<
ibosia@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
7c1dd57b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
0 deletions
+50
-0
Makefile.in
dlls/ndis.sys/Makefile.in
+1
-0
main.c
dlls/ndis.sys/main.c
+49
-0
No files found.
dlls/ndis.sys/Makefile.in
View file @
de6db115
MODULE
=
ndis.sys
IMPORTS
=
advapi32 ntoskrnl iphlpapi
EXTRADLLFLAGS
=
-Wl
,--subsystem,native
-mno-cygwin
C_SRCS
=
\
...
...
dlls/ndis.sys/main.c
View file @
de6db115
...
...
@@ -21,21 +21,70 @@
#include <stdarg.h>
#define NONAMELESSUNION
#include "ntstatus.h"
#define WIN32_NO_STATUS
#include "windef.h"
#include "winbase.h"
#include "winternl.h"
#include "winioctl.h"
#include "winsock2.h"
#include "ws2ipdef.h"
#include "iphlpapi.h"
#include "netioapi.h"
#include "ntddndis.h"
#include "ddk/wdm.h"
#include "ddk/ndis.h"
#include "winreg.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
ndis
);
static
void
add_key
(
const
WCHAR
*
guidstrW
,
const
MIB_IF_ROW2
*
netdev
)
{
HKEY
card_key
;
WCHAR
keynameW
[
100
];
swprintf
(
keynameW
,
ARRAY_SIZE
(
keynameW
),
L"Software
\\
Microsoft
\\
Windows NT
\\
CurrentVersion
\\
NetworkCards
\\
%d"
,
netdev
->
InterfaceIndex
);
if
(
RegCreateKeyExW
(
HKEY_LOCAL_MACHINE
,
keynameW
,
0
,
NULL
,
REG_OPTION_VOLATILE
,
KEY_ALL_ACCESS
,
NULL
,
&
card_key
,
NULL
)
==
ERROR_SUCCESS
)
{
RegSetValueExW
(
card_key
,
L"Description"
,
0
,
REG_SZ
,
(
BYTE
*
)
netdev
->
Description
,
(
lstrlenW
(
netdev
->
Description
)
+
1
)
*
sizeof
(
WCHAR
)
);
RegSetValueExW
(
card_key
,
L"ServiceName"
,
0
,
REG_SZ
,
(
BYTE
*
)
guidstrW
,
(
lstrlenW
(
guidstrW
)
+
1
)
*
sizeof
(
WCHAR
)
);
RegCloseKey
(
card_key
);
}
}
static
void
create_network_devices
(
DRIVER_OBJECT
*
driver
)
{
MIB_IF_TABLE2
*
table
;
ULONG
i
;
if
(
GetIfTable2
(
&
table
)
!=
NO_ERROR
)
return
;
for
(
i
=
0
;
i
<
table
->
NumEntries
;
i
++
)
{
GUID
*
guid
=
&
table
->
Table
[
i
].
InterfaceGuid
;
WCHAR
guidstrW
[
39
];
swprintf
(
guidstrW
,
ARRAY_SIZE
(
guidstrW
),
L"{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}"
,
guid
->
Data1
,
guid
->
Data2
,
guid
->
Data3
,
guid
->
Data4
[
0
],
guid
->
Data4
[
1
],
guid
->
Data4
[
2
],
guid
->
Data4
[
3
],
guid
->
Data4
[
4
],
guid
->
Data4
[
5
],
guid
->
Data4
[
6
],
guid
->
Data4
[
7
]
);
add_key
(
guidstrW
,
&
table
->
Table
[
i
]
);
}
FreeMibTable
(
table
);
}
NTSTATUS
WINAPI
DriverEntry
(
DRIVER_OBJECT
*
driver
,
UNICODE_STRING
*
path
)
{
TRACE
(
"(%p, %s)
\n
"
,
driver
,
debugstr_w
(
path
->
Buffer
));
create_network_devices
(
driver
);
return
STATUS_SUCCESS
;
}
...
...
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