[General]Add an option for telemetry opt-in and visualization(#34078)

* Data diagnostics opt-in

* [c++] Drop DROP_PII flag

* Bump telemtry package to 2.0.2

* Drop DropPii from custom actions

* Cleanup

* Do not start manually C# EtwTrace. FZ engine exit event.

* ImageResizer, PowerRename, FileLocksmith prev handlers

* Revert C# handlers exe logging

* Revert "Revert C# handlers exe logging"

This reverts commit 4c75a3953b.

* Do not recreate EtwTrace

* consume package

* xaml formatting

* Fix deps.json audit

* Update telem package paths

* Address PR comments

* Fix AdvancedPaste close on PT close

* Override etl file name for explorer loaded dlls
Start/stop tracer when needed for explorer loaded dlls to prevent explorer overload

* Fix setting desc

* Fix missing events

* Add infobar to restart when enable data viewing

* Flush on timer every 30s

* [Settings] Update View Data diagnostic description text
[New+] Add tracer

* Show Restart info bar for both enable/disable data viewer

* Fix newplus

* Fix stuck on restart and terminate AdvPaste exe on destroy()

* [Installer] Add tracer

* Address PR comment

* Add missing tracers

* Exclude etw dir from BugReport

* Fix bad merge

* [Hosts] Proper exit on initial dialog

* [OOBE] Make Data diagnostic setting visible without scroll

* [OOBE] Add hiperlynk to open general settings

* Disable data view on disabling data diagnostics

* Don't disable View data button

* Fix disabling data viewing

* Add missing dot

* Revert formatting
This commit is contained in:
Stefan Markovic
2024-10-24 22:04:32 +02:00
committed by GitHub
parent f9127b63a5
commit 133aa85f2b
269 changed files with 2622 additions and 1256 deletions

View File

@@ -161,8 +161,13 @@ HRESULT CContextMenuHandler::QueryContextMenu(_In_ HMENU hmenu, UINT indexMenu,
if (!InsertMenuItem(hmenu, indexMenu, TRUE, &mii))
{
m_etwTrace.UpdateState(true);
hr = HRESULT_FROM_WIN32(GetLastError());
Trace::QueryContextMenuError(hr);
m_etwTrace.Flush();
m_etwTrace.UpdateState(false);
}
else
{
@@ -193,6 +198,8 @@ HRESULT CContextMenuHandler::GetCommandString(UINT_PTR idCmd, UINT uType, _In_ U
HRESULT CContextMenuHandler::InvokeCommand(_In_ CMINVOKECOMMANDINFO* pici)
{
m_etwTrace.UpdateState(true);
BOOL fUnicode = FALSE;
Trace::Invoked();
HRESULT hr = E_FAIL;
@@ -216,6 +223,10 @@ HRESULT CContextMenuHandler::InvokeCommand(_In_ CMINVOKECOMMANDINFO* pici)
hr = ResizePictures(pici, nullptr);
}
Trace::InvokedRet(hr);
m_etwTrace.Flush();
m_etwTrace.UpdateState(false);
return hr;
}
@@ -427,8 +438,14 @@ HRESULT __stdcall CContextMenuHandler::EnumSubCommands(IEnumExplorerCommand** pp
// psiItemArray contains the list of files that have been selected when the context menu entry is invoked
HRESULT __stdcall CContextMenuHandler::Invoke(IShellItemArray* psiItemArray, IBindCtx* /*pbc*/)
{
m_etwTrace.UpdateState(true);
Trace::Invoked();
HRESULT hr = ResizePictures(nullptr, psiItemArray);
Trace::InvokedRet(hr);
m_etwTrace.Flush();
m_etwTrace.UpdateState(false);
return hr;
}

View File

@@ -5,6 +5,7 @@
#include "pch.h"
#include "Generated Files/resource.h"
#include "ImageResizerExt_i.h"
#include <common/Telemetry/EtwTrace/EtwTrace.h>
#if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA)
#error "Single-threaded COM objects are not properly supported on Windows CE platform, such as the Windows Mobile platforms that do not include full DCOM support. Define _CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA to force ATL to support creating single-thread COM object's and allow use of it's single-threaded COM object implementations. The threading model in your rgs file was set to 'Free' as that is the only threading model supported in non DCOM Windows CE platforms."
@@ -53,6 +54,7 @@ private:
HBITMAP m_hbmpIcon = nullptr;
std::wstring context_menu_caption;
std::wstring context_menu_caption_here;
Shared::Trace::ETWTrace m_etwTrace{ L"ImageResizerExt" };
};
OBJECT_ENTRY_AUTO(__uuidof(ContextMenuHandler), CContextMenuHandler)

View File

@@ -80,12 +80,14 @@
<ClCompile Include="ContextMenuHandler.cpp" />
<ClCompile Include="dllmain.cpp">
<CompileAsManaged>false</CompileAsManaged>
<PrecompiledHeader></PrecompiledHeader>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<ClCompile Include="ImageResizerExt.cpp" />
<ClCompile Include="ImageResizerExt_i.c">
<CompileAsManaged>false</CompileAsManaged>
<PrecompiledHeader></PrecompiledHeader>
<PrecompiledHeader>
</PrecompiledHeader>
</ClCompile>
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(UsePrecompiledHeaders)' != 'false'">Create</PrecompiledHeader>
@@ -120,6 +122,9 @@
<ProjectReference Include="..\..\..\common\SettingsAPI\SettingsAPI.vcxproj">
<Project>{6955446d-23f7-4023-9bb3-8657f904af99}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\common\Telemetry\EtwTrace\EtwTrace.vcxproj">
<Project>{8f021b46-362b-485c-bfba-ccf83e820cbd}</Project>
</ProjectReference>
<ProjectReference Include="..\..\..\common\Themes\Themes.vcxproj">
<Project>{98537082-0fdb-40de-abd8-0dc5a4269bab}</Project>
</ProjectReference>

View File

@@ -22,4 +22,3 @@
#include <windows.h>
#include <ShlObj.h>
#include <ProjectTelemetry.h>