From 0e35dcd526795b1005a734260a7acd232ac180a1 Mon Sep 17 00:00:00 2001 From: Sergei Vorobev Date: Fri, 17 Jun 2016 14:21:09 -0700 Subject: [PATCH] Temporerely disable SQM Telemetry in pwrshplugin --- .../nativemsh/pwrshplugin/entrypoints.cpp | 50 ++++++++++--------- 1 file changed, 27 insertions(+), 23 deletions(-) diff --git a/src/powershell-native/nativemsh/pwrshplugin/entrypoints.cpp b/src/powershell-native/nativemsh/pwrshplugin/entrypoints.cpp index c5ae58224a..a521e0b890 100644 --- a/src/powershell-native/nativemsh/pwrshplugin/entrypoints.cpp +++ b/src/powershell-native/nativemsh/pwrshplugin/entrypoints.cpp @@ -8,9 +8,10 @@ // ---------------------------------------------------------------------- #include "pwrshplugin.h" -#include -#include "common/WindowsSqmDataID.h" -#include "common/winrmsqm.h" +// [Porting note] SQM is for Telemetry in Windows. Temporarily disabled. +//#include +//#include "common/WindowsSqmDataID.h" +//#include "common/winrmsqm.h" #if !CORECLR #include @@ -19,11 +20,12 @@ HINSTANCE g_hResourceInstance = 0; // TODO: Where is this freed? FreeMUILibrary for nonCoreClr and FreeLibrary for CoreCLR LPCWSTR g_MAIN_BINARY_NAME = L"pwrshplugin.dll"; -typedef VOID (NTAPI *PFN_WinSqmSetDWORD)( - __in_opt HSESSION hSession, - __in DWORD dwDatapointId, - __in DWORD dwDatapointValue - ); +// [Porting note] SQM is for Telemetry in Windows. Temporarily disabled. +// typedef VOID (NTAPI *PFN_WinSqmSetDWORD)( +// __in_opt HSESSION hSession, +// __in DWORD dwDatapointId, +// __in DWORD dwDatapointValue +// ); // gets the error message from the resources section of the current module. // the caller should free pwszErrorMessage using LocalFree(). @@ -351,22 +353,24 @@ DWORD WINAPI WSManPluginStartup( // Using global SQM session // WinSQMSetDWORD is not available on Vista - HMODULE hModule; - PFN_WinSqmSetDWORD pfnWinSqmSetDWORD; - hModule = GetModuleHandleW(L"ntdll"); - if (hModule) - { - pfnWinSqmSetDWORD = (PFN_WinSqmSetDWORD) GetProcAddress(hModule, "WinSqmSetDWORD"); - if (pfnWinSqmSetDWORD) - { - pfnWinSqmSetDWORD( - NULL, - DATAID_WINRMREMOTEENABLED, - WINRM_SQM_DATA_REMOTEENABLED - ); - } - } + // [Porting note] SQM is for Telemetry in Windows. Temporarily disabled. + // HMODULE hModule; + // PFN_WinSqmSetDWORD pfnWinSqmSetDWORD; + + // hModule = GetModuleHandleW(L"ntdll"); + // if (hModule) + // { + // pfnWinSqmSetDWORD = (PFN_WinSqmSetDWORD) GetProcAddress(hModule, "WinSqmSetDWORD"); + // if (pfnWinSqmSetDWORD) + // { + // pfnWinSqmSetDWORD( + // NULL, + // DATAID_WINRMREMOTEENABLED, + // WINRM_SQM_DATA_REMOTEENABLED + // ); + // } + // } return NO_ERROR; }