mirror of https://github.com/microsoft/WSL
pr feedback
This commit is contained in:
parent
f3821479ad
commit
881edcf6b4
|
|
@ -2179,9 +2179,17 @@ try
|
|||
|
||||
wsl::shared::SocketChannel channel(std::move(socket), "Telemetry", m_vmTerminating.get());
|
||||
|
||||
// Check if drvfs notifications are enabled for the user.
|
||||
bool drvFsNotifications{};
|
||||
{
|
||||
auto impersonate = wil::impersonate_token(m_userToken.get());
|
||||
const auto lxssKey = wsl::windows::common::registry::OpenLxssUserKey();
|
||||
drvFsNotifications =
|
||||
wsl::windows::common::registry::ReadDword(lxssKey.get(), LXSS_NOTIFICATIONS_KEY, LXSS_NOTIFICATION_DRVFS_PERF_DISABLED, 0) == 0;
|
||||
}
|
||||
|
||||
// Aggregate information about what is running inside the VM. This is logged
|
||||
// periodically because logging each event individually would be too noisy.
|
||||
bool drvFsNotifications = true;
|
||||
for (;;)
|
||||
{
|
||||
auto [Message, Span] = channel.ReceiveMessageOrClosed<LX_MINI_INIT_TELEMETRY_MESSAGE>();
|
||||
|
|
@ -2222,20 +2230,9 @@ try
|
|||
|
||||
if (drvFsNotifications && Message->ShowDrvFsNotification && !values.empty())
|
||||
{
|
||||
// Check if drvfs notifications are enabled for the user.
|
||||
{
|
||||
auto impersonate = wil::impersonate_token(m_userToken.get());
|
||||
const auto lxssKey = wsl::windows::common::registry::OpenLxssUserKey();
|
||||
drvFsNotifications = wsl::windows::common::registry::ReadDword(
|
||||
lxssKey.get(), LXSS_NOTIFICATIONS_KEY, LXSS_NOTIFICATION_DRVFS_PERF_DISABLED, 0) == 0;
|
||||
}
|
||||
|
||||
// If a drvfs notification is requested, the first entry is the executable that triggered it.
|
||||
if (drvFsNotifications)
|
||||
{
|
||||
LOG_IF_FAILED(wsl::windows::common::notifications::DisplayFilesystemNotification(values[0].c_str()));
|
||||
drvFsNotifications = false;
|
||||
}
|
||||
LOG_IF_FAILED(wsl::windows::common::notifications::DisplayFilesystemNotification(values[0].c_str()));
|
||||
drvFsNotifications = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -74,10 +74,7 @@ public:
|
|||
// Log telemetry when a WSL notification is activated, used to determine user engagement for notifications
|
||||
WSL_LOG_TELEMETRY("NotificationActivate", PDT_ProductAndServicePerformance, TraceLoggingValue(invokedArgs, "Arguments"));
|
||||
|
||||
// Prepend the executable name to the arguments.
|
||||
auto commandLine = std::format(L"\"{}\" {}", wil::GetModuleFileNameW<std::wstring>(wil::GetModuleInstanceHandle()), invokedArgs);
|
||||
|
||||
ArgumentParser parser(commandLine.c_str(), wslhost::binary_name);
|
||||
ArgumentParser parser(invokedArgs, wslhost::binary_name, 0);
|
||||
parser.AddArgument(
|
||||
[]() {
|
||||
std::wstring path;
|
||||
|
|
|
|||
Loading…
Reference in New Issue