diff --git a/CppRuleSet.ruleset b/CppRuleSet.ruleset index 540b9f7674..2718c2e3f1 100644 --- a/CppRuleSet.ruleset +++ b/CppRuleSet.ruleset @@ -80,7 +80,7 @@ - + diff --git a/installer/PowerToysSetupCustomActions/CustomAction.cpp b/installer/PowerToysSetupCustomActions/CustomAction.cpp index fdec216592..3e5c5045ab 100644 --- a/installer/PowerToysSetupCustomActions/CustomAction.cpp +++ b/installer/PowerToysSetupCustomActions/CustomAction.cpp @@ -264,7 +264,7 @@ UINT __stdcall CreateScheduledTaskCA(MSIHANDLE hInstall) nullptr, CLSCTX_INPROC_SERVER, IID_ITaskService, - (void**)&pService); + reinterpret_cast(&pService)); ExitOnFailure(hr, "Failed to create an instance of ITaskService: %x", hr); // Connect to the task service. @@ -490,7 +490,7 @@ UINT __stdcall RemoveScheduledTasksCA(MSIHANDLE hInstall) nullptr, CLSCTX_INPROC_SERVER, IID_ITaskService, - (void**)&pService); + reinterpret_cast(&pService)); ExitOnFailure(hr, "Failed to create an instance of ITaskService: %x", hr); // Connect to the task service. @@ -809,7 +809,7 @@ UINT __stdcall CertifyVirtualCameraDriverCA(MSIHANDLE hInstall) ExitOnFailure(hr, "Certificate file size not valid", hr); } - pFileContent = (char*)malloc(size); + pFileContent = static_cast(malloc(size)); DWORD sizeread; if (!ReadFile(hfile, pFileContent, size, &sizeread, nullptr)) @@ -820,7 +820,7 @@ UINT __stdcall CertifyVirtualCameraDriverCA(MSIHANDLE hInstall) if (!CertAddEncodedCertificateToStore(hCertStore, X509_ASN_ENCODING, - (const BYTE*)pFileContent, + reinterpret_cast(pFileContent), size, CERT_STORE_ADD_ALWAYS, nullptr)) diff --git a/tools/StylesReportTool/StylesReportTool.cpp b/tools/StylesReportTool/StylesReportTool.cpp index 40b1f23f8e..4b84e08dac 100644 --- a/tools/StylesReportTool/StylesReportTool.cpp +++ b/tools/StylesReportTool/StylesReportTool.cpp @@ -49,7 +49,7 @@ inline std::wstring get_process_path(DWORD pid) noexcept { name.resize(MAX_PATH); DWORD name_length = static_cast(name.length()); - if (QueryFullProcessImageNameW(process, 0, (LPWSTR)name.data(), &name_length) == 0) + if (QueryFullProcessImageNameW(process, 0, static_cast(name.data()), &name_length) == 0) { name_length = 0; } @@ -410,7 +410,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) LPCWSTR text = L"Please select the target window (using a mouse or Alt+Tab), \r\nand press Ctrl+Alt+S to capture its styles. \r\nYou can find the output file \"window_styles.txt\" on your desktop."; RECT rc{0,50,600,200}; - DrawText(hdc, text, (int)wcslen(text), &rc, DT_CENTER | DT_WORDBREAK); + DrawText(hdc, text, static_cast(wcslen(text)), &rc, DT_CENTER | DT_WORDBREAK); EndPaint(hWnd, &ps); }