46 L"SOFTWARE\\Microsoft\\Shared Tools\\MSConfig",
47 L"HideEssentialServiceWarning",
58 L"SOFTWARE\\Microsoft\\Shared Tools\\MSConfig",
59 L"HideEssentialServiceWarning",
138 DWORD dwType = 0, dwBufSize = 0;
174 DWORD dwStartType = 0;
180 pContextParams->
time = disableDate;
201 if (hService ==
NULL)
204 DWORD dwBytesNeeded = 0;
209 if (!lpServiceConfig)
223 #if 0 // Disabled until CmdLineToArgv is included 224 unsigned int argc = 0;
253 if (bHideOSVendorServices)
272 bAddServiceToList =
TRUE;
273 bIsModifiedService =
TRUE;
279 if (!bAddServiceToList)
281 if (!bIsServiceEnabled)
284 KeysQueryTable[0].
QueryRoutine = GetRegistryKeyedDisabledServicesQueryRoutine;
288 bAddServiceToList =
params.bIsPresent;
293 ValuesQueryTable[0].
QueryRoutine = GetRegistryValuedDisabledServicesQueryRoutine;
297 bAddServiceToList =
params.bIsPresent;
302 bAddServiceToList =
TRUE;
306 if (bAddServiceToList)
318 if (!lpServiceFailureActions)
332 ( lpServiceFailureActions &&
333 (lpServiceFailureActions->cActions >= 1) &&
338 MemFree(lpServiceFailureActions);
346 item.lParam = reinterpret_cast<LPARAM>(
new ServiceItem(
Service->lpServiceName, bIsServiceEnabled, bIsRequired));
362 if (!bIsServiceEnabled)
394 delete reinterpret_cast<ServiceItem*>(lvitem.lParam);
395 lvitem.lParam =
NULL;
419 DWORD dwBytesNeeded = 0;
420 DWORD dwNumServices = 0;
434 for (
DWORD i = 0 ;
i < dwNumServices ; ++
i)
460 size_t itemLength = 0;
513 pSvcItem = reinterpret_cast<ServiceItem*>(truc.lParam);
526 if (bOldState == bNewState)
533 if (bNewState ==
FALSE)
537 else if (bNewState ==
TRUE)
546 OutputDebugString(
_T(
"(1) \"WTF: What The Fukhurmajalmahamadahaldeliya ?!\" (The Dictator, Sacha Baron Cohen)\n"));
552 if (bNewState ==
TRUE)
556 else if (bNewState ==
FALSE)
565 OutputDebugString(
_T(
"(2) \"WTF: What The Fukhurmajalmahamadahaldeliya ?!\" (The Dictator, Sacha Baron Cohen)\n"));
594 #define OP(a, b) ((a) == (b) ? (a) : 2) 599 uRootCheckState =
OP(uRootCheckState,
temp);
602 if (uRootCheckState == 0)
607 else if (uRootCheckState == 1)
612 else if (uRootCheckState == 2)
646 size_t itemLength = 0;
806 switch (reinterpret_cast<LPNMHDR>(
lParam)->
code)
862 int iSortingColumn = reinterpret_cast<LPNMLISTVIEW>(
lParam)->iSubItem;
873 switch (reinterpret_cast<LPNMHDR>(
lParam)->
code)
910 if (hService ==
NULL)
916 DWORD dwBytesNeeded = 0;
921 if (!lpServiceConfig)
934 KeysQueryTable[0].
QueryRoutine = GetRegistryKeyedDisabledServicesQueryRoutine;
941 ValuesQueryTable[0].
QueryRoutine = GetRegistryValuedDisabledServicesQueryRoutine;
949 ChangeServiceConfigW(hService,
SERVICE_NO_CHANGE,
params.dwStartType,
SERVICE_NO_CHANGE,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
954 CAtlStringW serviceRegKey(
L"SOFTWARE\\Microsoft\\Shared Tools\\MSConfig\\services\\");
955 serviceRegKey += svcName;
999 ChangeServiceConfigW(hService,
SERVICE_NO_CHANGE,
SERVICE_DISABLED,
SERVICE_NO_CHANGE,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
1002 CAtlStringW serviceRegKey(
L"SOFTWARE\\Microsoft\\Shared Tools\\MSConfig\\services\\");
1003 serviceRegKey += svcName;
1009 #if 1 // DisableDate
LPWSTR GetExecutableVendor(IN LPCWSTR lpszFilename)
#define ListView_GetNextItem(hwnd, i, flags)
#define SC_MANAGER_ENUMERATE_SERVICE
LONG RegSetDWORDValue(IN HKEY hKey, IN LPCWSTR lpSubKey OPTIONAL, IN LPCWSTR lpValue OPTIONAL, IN BOOL bCreateKeyIfDoesntExist, IN DWORD dwData)
QUERY_SERVICE_CONFIGA * LPQUERY_SERVICE_CONFIG
BOOL MemFree(IN PVOID lpMem)
int WINAPI MapWindowPoints(_In_opt_ HWND hWndFrom, _In_opt_ HWND hWndTo, _Inout_updates_(cPoints) LPPOINT lpPoints, _In_ UINT cPoints)
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ PNDIS_STRING SubKeyName
#define IDC_SERVICES_LIST
#define UNREFERENCED_PARAMETER(P)
BOOL WINAPI QueryServiceConfigW(SC_HANDLE hService, LPQUERY_SERVICE_CONFIGW lpServiceConfig, DWORD cbBufSize, LPDWORD pcbBytesNeeded)
INT_PTR CALLBACK RequiredServicesDisablingDialogWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
#define HKEY_CURRENT_USER
LRESULT RegQueryRegistryKeys(IN HKEY hRootKey, IN LPCWSTR KeyName, IN PQUERY_REGISTRY_KEYS_TABLE QueryTable, IN PVOID Context)
_Check_return_ _CRTIMP size_t __cdecl wcscspn(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_Control)
#define IDS_SERVICES_COLUMN_REQ
#define ListView_SubItemHitTest(hwnd, plvhti)
LONG WINAPI RegDeleteKeyW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey)
#define PropSheet_CancelToClose(d)
#define LVS_EX_FULLROWSELECT
static CAtlList< CAtlStringW > userModificationsList
#define ListView_Sort(hListView, iSortingColumn)
#define UM_CHECKSTATECHANGE
static BOOL RegisterNoMsgAnymore(VOID)
#define SERVICE_STATE_ALL
DWORD WINAPI GetMessagePos(void)
#define ListView_InsertItem(hwnd, pitem)
#define OutputDebugString
DWORD FormatString(DWORD dwFlags, HINSTANCE hInstance, DWORD dwStringId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, va_list *Arguments)
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _In_ ULONG _Out_opt_ PULONG _Out_opt_ PULONG ValueType
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
#define SERVICE_NO_CHANGE
LPENUM_SERVICE_STATUS_PROCESSA LPENUM_SERVICE_STATUS_PROCESS
BOOL bIsPreVistaOSVersion
#define ListView_InsertColumn(hwnd, iCol, pcol)
#define IDC_BTN_SERVICES_DEACTIVATE
LONG WINAPI RegCloseKey(HKEY hKey)
QUERY_REGISTRY_VALUES_ROUTINE(GetRegistryValuedDisabledServicesQueryRoutine)
GLenum const GLfloat * params
#define ListView_SetItemState(hwndLV, i, data, mask)
#define ListView_GetExtendedListViewStyle(hwndLV)
#define IDS_SERVICES_STATUS_STOPPED
BOOL WINAPI ChangeServiceConfigW(SC_HANDLE hService, DWORD dwServiceType, DWORD dwStartType, DWORD dwErrorControl, LPCWSTR lpBinaryPathName, LPCWSTR lpLoadOrderGroup, LPDWORD lpdwTagId, LPCWSTR lpDependencies, LPCWSTR lpServiceStartName, LPCWSTR lpPassword, LPCWSTR lpDisplayName)
SC_HANDLE WINAPI OpenServiceW(SC_HANDLE hSCManager, LPCWSTR lpServiceName, DWORD dwDesiredAccess)
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
BOOL WINAPI CloseServiceHandle(SC_HANDLE hSCObject)
_In_ PCWSTR _Inout_ _At_ QueryTable EntryContext
#define QueryServiceConfig2
#define IDC_CBX_REQSVCSDIS_NO_MSG_ANYMORE
static void UpdateBtnStates(HWND hDlg)
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
static BOOL bMaskProprietarySvcs
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
#define IDS_SERVICES_COLUMN_DATEDISABLED
#define IDS_SERVICES_COLUMN_STATUS
#define DialogBoxW(i, t, p, f)
#define REG_OPTION_NON_VOLATILE
#define ListView_SetItemText(hwndLV, i, iSubItem_, pszText_)
static void ClearServicesList(void)
VOID LoadResourceString(UINT ResourceId, LPVOID Buffer, UINT ccount, LPVOID DefaultString, BOOL bUnicode)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define PropSheet_Changed(d, w)
PVOID MemAlloc(IN DWORD dwFlags, IN SIZE_T dwBytes)
PQUERY_REGISTRY_VALUES_ROUTINE QueryRoutine
#define IDC_CBX_SERVICES_MASK_PROPRIETARY_SVCS
const LPCWSTR IDS_MICROSOFT
#define SERVICE_CHANGE_CONFIG
#define Button_GetCheck(hwndCtl)
LONG RegGetDWORDValue(IN HKEY hKey, IN LPCWSTR lpSubKey OPTIONAL, IN LPCWSTR lpValue OPTIONAL, OUT LPDWORD lpData OPTIONAL)
#define SERVICE_CONFIG_FAILURE_ACTIONS
_In_ GUID _In_ PVOID ValueData
LRESULT RegQueryRegistryValues(IN HKEY hRootKey, IN LPCWSTR KeyName, IN PQUERY_REGISTRY_VALUES_TABLE QueryTable, IN PVOID Context)
#define ListView_SetExtendedListViewStyle(hwndLV, dw)
VOID FreeDateTime(IN LPWSTR lpszDateTime)
#define IDD_REQUIRED_SERVICES_DISABLING_DIALOG
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
#define MB_ICONINFORMATION
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
#define LVS_EX_CHECKBOXES
SC_HANDLE WINAPI OpenSCManagerW(LPCWSTR lpMachineName, LPCWSTR lpDatabaseName, DWORD dwDesiredAccess)
static void GetServices(BOOL bHideOSVendorServices=FALSE)
static HWND hServicesPage
#define IDS_SERVICES_STATUS_RUNNING
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
BOOL SetServicesActivation(DWORD dwState)
#define IDC_STATIC_SERVICES_WARNING
LPSERVICE_FAILURE_ACTIONSA LPSERVICE_FAILURE_ACTIONS
HWND WINAPI GetParent(_In_ HWND)
BOOL ListView_SortEx(HWND hListView, int iSortingColumn, int iSortedColumn)
PQUERY_REGISTRY_KEYS_ROUTINE QueryRoutine
#define ListView_GetCheckState(hwndLV, i)
_CRTIMP wchar_t *__cdecl wcsncpy(wchar_t *_Dest, const wchar_t *_Source, size_t _Count)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
LPTSTR FindSubStrI(LPCTSTR str, LPCTSTR strSearch)
static const struct newhuff ht[]
ServiceItem(const LPCWSTR lpszSvcName, BOOL bIsEnabled, BOOL bIsRequired)
DWORD GetServicesActivation(VOID)
INT_PTR CALLBACK ServicesPageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
#define SC_MANAGER_ALL_ACCESS
#define ListView_SetCheckState(hwndLV, i, fCheck)
#define ListView_GetItem(hwnd, pitem)
#define IDC_STATIC_REQSVCSDIS_INFO
#define LVHT_ONITEMSTATEICON
static BOOL ValidateItem(int index, BOOL bNewState, BOOL bDisplayErrors)
CAtlStringW m_lpszSvcName
#define GetWindowTextLength
#define SERVICE_QUERY_CONFIG
QUERY_REGISTRY_KEYS_ROUTINE(GetRegistryKeyedDisabledServicesQueryRoutine)
#define MAKEINTRESOURCEW(i)
LPWSTR FormatDateTime(IN LPSYSTEMTIME pDateTime)
#define IDS_SERVICES_COLUMN_SERVICE
#define ListView_GetSelectionMark(hwnd)
#define IDS_SERVICES_COLUMN_VENDOR
static void AddService(SC_HANDLE hSCManager, LPENUM_SERVICE_STATUS_PROCESS Service, BOOL bHideOSVendorServices)
#define IDC_BTN_SERVICES_ACTIVATE
const LPCWSTR IDS_WINDOWS
BOOL WINAPI EnumServicesStatusExW(SC_HANDLE hSCManager, SC_ENUM_TYPE InfoLevel, DWORD dwServiceType, DWORD dwServiceState, LPBYTE lpServices, DWORD cbBufSize, LPDWORD pcbBytesNeeded, LPDWORD lpServicesReturned, LPDWORD lpResumeHandle, LPCWSTR pszGroupName)
BOOL HideEssentialServiceWarning(VOID)
#define PSN_QUERYINITIALFOCUS
static HWND hServicesListCtrl
#define ListView_DeleteAllItems(hwnd)
#define HKEY_LOCAL_MACHINE
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _In_ ULONG ValueLength