mirror of
https://github.com/OpenVPN/openvpn.git
synced 2026-05-28 04:03:29 -04:00
Add logging for windows driver selection process
Signed-off-by: Lev Stipakov <lev@openvpn.net>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <20230216160129.994-1-lstipakov@gmail.com>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26281.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit 5b748ad099)
This commit is contained in:
parent
f63c9b1edb
commit
dff1e78957
1 changed files with 12 additions and 1 deletions
|
|
@ -3705,6 +3705,7 @@ get_device_instance_id_interface(struct gc_arena *gc)
|
|||
msg(M_FATAL, "Error [%u] opening device information set key: %s", (unsigned int)err, strerror_win32(err, gc));
|
||||
}
|
||||
|
||||
msg(D_TAP_WIN_DEBUG, "Enumerate device interface lists:");
|
||||
for (DWORD i = 0;; ++i)
|
||||
{
|
||||
SP_DEVINFO_DATA device_info_data;
|
||||
|
|
@ -3790,6 +3791,10 @@ get_device_instance_id_interface(struct gc_arena *gc)
|
|||
dev_iif->net_cfg_instance_id = (unsigned char *)string_alloc((char *)net_cfg_instance_id, gc);
|
||||
dev_iif->device_interface = string_alloc(dev_if, gc);
|
||||
|
||||
msg(D_TAP_WIN_DEBUG, "NetCfgInstanceId: %s, Device Interface: %s",
|
||||
dev_iif->net_cfg_instance_id,
|
||||
dev_iif->device_interface);
|
||||
|
||||
/* link into return list */
|
||||
if (!first)
|
||||
{
|
||||
|
|
@ -3835,6 +3840,7 @@ get_tap_reg(struct gc_arena *gc)
|
|||
msg(M_FATAL, "Error opening registry key: %s", ADAPTER_KEY);
|
||||
}
|
||||
|
||||
msg(D_TAP_WIN_DEBUG, "Enumerate drivers in registy: ");
|
||||
while (true)
|
||||
{
|
||||
char enum_name[256];
|
||||
|
|
@ -3942,6 +3948,9 @@ get_tap_reg(struct gc_arena *gc)
|
|||
last->next = reg;
|
||||
}
|
||||
last = reg;
|
||||
|
||||
msg(D_TAP_WIN_DEBUG, "NetCfgInstanceId: %s, Driver: %s",
|
||||
reg->guid, print_windows_driver(reg->windows_driver));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -6520,6 +6529,8 @@ tun_try_open_device(struct tuntap *tt, const char *device_guid, const struct dev
|
|||
path = tuntap_device_path;
|
||||
}
|
||||
|
||||
msg(D_TAP_WIN_DEBUG, "Using device interface: %s", path);
|
||||
|
||||
tt->hand = CreateFile(path,
|
||||
GENERIC_READ | GENERIC_WRITE,
|
||||
0, /* was: FILE_SHARE_READ */
|
||||
|
|
@ -6529,7 +6540,7 @@ tun_try_open_device(struct tuntap *tt, const char *device_guid, const struct dev
|
|||
0);
|
||||
if (tt->hand == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
msg(D_TUNTAP_INFO, "CreateFile failed on %s device: %s", print_windows_driver(tt->windows_driver), path);
|
||||
msg(D_TUNTAP_INFO | M_ERRNO, "CreateFile failed on %s device: %s", print_windows_driver(tt->windows_driver), path);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue