Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/desktop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Beyer <s-beyer@gmx.net>2020-06-05 01:51:32 +0300
committerKevin Ottens <ervin@ipsquad.net>2020-06-08 21:07:50 +0300
commitea16804751eec498e34a3048a295a1dfafbc1612 (patch)
treebcd399be73a45b594e61d3af259a9d0d34be1286 /shell_integration
parentbce93b052b24c23d76a9f9b8864d71b0ad5b040e (diff)
Replace NULL by nullptr in all C++ files
We keep NULL in the pure C files in src/csync/std and test/csync. We also replace Doxygen documentation referring to "NULL" to "\c nullptr" (formatted as code). Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Diffstat (limited to 'shell_integration')
-rw-r--r--shell_integration/windows/OCContextMenu/OCContextMenu.cpp4
-rw-r--r--shell_integration/windows/OCContextMenu/OCContextMenuFactory.cpp4
-rw-r--r--shell_integration/windows/OCContextMenu/OCContextMenuRegHandler.cpp30
-rw-r--r--shell_integration/windows/OCContextMenu/RegDelnode.h8
-rw-r--r--shell_integration/windows/OCContextMenu/dllmain.cpp4
-rw-r--r--shell_integration/windows/OCOverlays/DllMain.cpp2
-rw-r--r--shell_integration/windows/OCOverlays/OCOverlay.cpp2
-rw-r--r--shell_integration/windows/OCOverlays/OCOverlayFactory.cpp6
-rw-r--r--shell_integration/windows/OCOverlays/OCOverlayRegistrationHandler.cpp36
-rw-r--r--shell_integration/windows/OCUtil/CommunicationSocket.cpp8
-rw-r--r--shell_integration/windows/OCUtil/RegistryUtil.cpp8
-rw-r--r--shell_integration/windows/OCUtil/RemotePathChecker.cpp10
12 files changed, 61 insertions, 61 deletions
diff --git a/shell_integration/windows/OCContextMenu/OCContextMenu.cpp b/shell_integration/windows/OCContextMenu/OCContextMenu.cpp
index 9e9052211..a5cab4ff1 100644
--- a/shell_integration/windows/OCContextMenu/OCContextMenu.cpp
+++ b/shell_integration/windows/OCContextMenu/OCContextMenu.cpp
@@ -81,14 +81,14 @@ IFACEMETHODIMP OCContextMenu::Initialize(
return E_INVALIDARG;
}
- FORMATETC fe = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
+ FORMATETC fe = { CF_HDROP, nullptr, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
STGMEDIUM stm;
if (SUCCEEDED(pDataObj->GetData(&fe, &stm))) {
// Get an HDROP handle.
HDROP hDrop = static_cast<HDROP>(GlobalLock(stm.hGlobal));
if (hDrop) {
- UINT nFiles = DragQueryFile(hDrop, 0xFFFFFFFF, NULL, 0);
+ UINT nFiles = DragQueryFile(hDrop, 0xFFFFFFFF, nullptr, 0);
for (UINT i = 0; i < nFiles; ++i) {
// Get the path of the file.
wchar_t buffer[MAX_PATH];
diff --git a/shell_integration/windows/OCContextMenu/OCContextMenuFactory.cpp b/shell_integration/windows/OCContextMenu/OCContextMenuFactory.cpp
index 006a0091a..13eb904a9 100644
--- a/shell_integration/windows/OCContextMenu/OCContextMenuFactory.cpp
+++ b/shell_integration/windows/OCContextMenu/OCContextMenuFactory.cpp
@@ -65,7 +65,7 @@ IFACEMETHODIMP OCContextMenuFactory::CreateInstance(IUnknown *pUnkOuter, REFIID
HRESULT hr = CLASS_E_NOAGGREGATION;
// pUnkOuter is used for aggregation. We do not support it in the sample.
- if (pUnkOuter == NULL) {
+ if (pUnkOuter == nullptr) {
hr = E_OUTOFMEMORY;
// Create the COM component.
@@ -88,4 +88,4 @@ IFACEMETHODIMP OCContextMenuFactory::LockServer(BOOL fLock)
InterlockedDecrement(&g_cDllRef);
}
return S_OK;
-} \ No newline at end of file
+}
diff --git a/shell_integration/windows/OCContextMenu/OCContextMenuRegHandler.cpp b/shell_integration/windows/OCContextMenu/OCContextMenuRegHandler.cpp
index 1bbfc6605..6c04734da 100644
--- a/shell_integration/windows/OCContextMenu/OCContextMenuRegHandler.cpp
+++ b/shell_integration/windows/OCContextMenu/OCContextMenuRegHandler.cpp
@@ -24,16 +24,16 @@ namespace {
HRESULT SetHKCRRegistryKeyAndValue(PCWSTR pszSubKey, PCWSTR pszValueName, PCWSTR pszData)
{
HRESULT hr;
- HKEY hKey = NULL;
+ HKEY hKey = nullptr;
// Creates the specified registry key. If the key already exists, the
// function opens it.
hr = HRESULT_FROM_WIN32(RegCreateKeyEx(HKEY_CLASSES_ROOT, pszSubKey, 0,
- NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &hKey, NULL));
+ nullptr, REG_OPTION_NON_VOLATILE, KEY_WRITE, nullptr, &hKey, nullptr));
if (SUCCEEDED(hr))
{
- if (pszData != NULL)
+ if (pszData != nullptr)
{
// Set the specified value of the key.
DWORD cbData = lstrlen(pszData) * sizeof(*pszData);
@@ -50,7 +50,7 @@ HRESULT SetHKCRRegistryKeyAndValue(PCWSTR pszSubKey, PCWSTR pszValueName, PCWSTR
HRESULT GetHKCRRegistryKeyAndValue(PCWSTR pszSubKey, PCWSTR pszValueName, PWSTR pszData, DWORD cbData)
{
HRESULT hr;
- HKEY hKey = NULL;
+ HKEY hKey = nullptr;
// Try to open the specified registry key.
hr = HRESULT_FROM_WIN32(RegOpenKeyEx(HKEY_CLASSES_ROOT, pszSubKey, 0,
@@ -59,8 +59,8 @@ HRESULT GetHKCRRegistryKeyAndValue(PCWSTR pszSubKey, PCWSTR pszValueName, PWSTR
if (SUCCEEDED(hr))
{
// Get the data for the specified value name.
- hr = HRESULT_FROM_WIN32(RegQueryValueEx(hKey, pszValueName, NULL,
- NULL, reinterpret_cast<LPBYTE>(pszData), &cbData));
+ hr = HRESULT_FROM_WIN32(RegQueryValueEx(hKey, pszValueName, nullptr,
+ nullptr, reinterpret_cast<LPBYTE>(pszData), &cbData));
RegCloseKey(hKey);
}
@@ -72,7 +72,7 @@ HRESULT GetHKCRRegistryKeyAndValue(PCWSTR pszSubKey, PCWSTR pszValueName, PWSTR
HRESULT OCContextMenuRegHandler::RegisterInprocServer(PCWSTR pszModule, const CLSID& clsid, PCWSTR pszFriendlyName, PCWSTR pszThreadModel)
{
- if (pszModule == NULL || pszThreadModel == NULL)
+ if (pszModule == nullptr || pszThreadModel == nullptr)
{
return E_INVALIDARG;
}
@@ -88,7 +88,7 @@ HRESULT OCContextMenuRegHandler::RegisterInprocServer(PCWSTR pszModule, const CL
hr = StringCchPrintf(szSubkey, ARRAYSIZE(szSubkey), L"CLSID\\%s", szCLSID);
if (SUCCEEDED(hr))
{
- hr = SetHKCRRegistryKeyAndValue(szSubkey, NULL, pszFriendlyName);
+ hr = SetHKCRRegistryKeyAndValue(szSubkey, nullptr, pszFriendlyName);
// Create the HKCR\CLSID\{<CLSID>}\InprocServer32 key.
if (SUCCEEDED(hr))
@@ -99,7 +99,7 @@ HRESULT OCContextMenuRegHandler::RegisterInprocServer(PCWSTR pszModule, const CL
{
// Set the default value of the InprocServer32 key to the
// path of the COM module.
- hr = SetHKCRRegistryKeyAndValue(szSubkey, NULL, pszModule);
+ hr = SetHKCRRegistryKeyAndValue(szSubkey, nullptr, pszModule);
if (SUCCEEDED(hr))
{
// Set the threading model of the component.
@@ -136,7 +136,7 @@ HRESULT OCContextMenuRegHandler::UnregisterInprocServer(const CLSID& clsid)
HRESULT OCContextMenuRegHandler::RegisterShellExtContextMenuHandler(
PCWSTR pszFileType, const CLSID& clsid, PCWSTR pszFriendlyName)
{
- if (pszFileType == NULL)
+ if (pszFileType == nullptr)
{
return E_INVALIDARG;
}
@@ -154,7 +154,7 @@ HRESULT OCContextMenuRegHandler::RegisterShellExtContextMenuHandler(
if (*pszFileType == L'.')
{
wchar_t szDefaultVal[260];
- hr = GetHKCRRegistryKeyAndValue(pszFileType, NULL, szDefaultVal,
+ hr = GetHKCRRegistryKeyAndValue(pszFileType, nullptr, szDefaultVal,
sizeof(szDefaultVal));
// If the key exists and its default value is not empty, use the
@@ -171,7 +171,7 @@ HRESULT OCContextMenuRegHandler::RegisterShellExtContextMenuHandler(
if (SUCCEEDED(hr))
{
// Set the default value of the key.
- hr = SetHKCRRegistryKeyAndValue(szSubkey, NULL, szCLSID);
+ hr = SetHKCRRegistryKeyAndValue(szSubkey, nullptr, szCLSID);
}
return hr;
@@ -180,7 +180,7 @@ HRESULT OCContextMenuRegHandler::RegisterShellExtContextMenuHandler(
HRESULT OCContextMenuRegHandler::UnregisterShellExtContextMenuHandler(
PCWSTR pszFileType, PCWSTR pszFriendlyName)
{
- if (pszFileType == NULL)
+ if (pszFileType == nullptr)
{
return E_INVALIDARG;
}
@@ -195,7 +195,7 @@ HRESULT OCContextMenuRegHandler::UnregisterShellExtContextMenuHandler(
if (*pszFileType == L'.')
{
wchar_t szDefaultVal[260];
- hr = GetHKCRRegistryKeyAndValue(pszFileType, NULL, szDefaultVal,
+ hr = GetHKCRRegistryKeyAndValue(pszFileType, nullptr, szDefaultVal,
sizeof(szDefaultVal));
// If the key exists and its default value is not empty, use the
@@ -215,4 +215,4 @@ HRESULT OCContextMenuRegHandler::UnregisterShellExtContextMenuHandler(
}
return hr;
-} \ No newline at end of file
+}
diff --git a/shell_integration/windows/OCContextMenu/RegDelnode.h b/shell_integration/windows/OCContextMenu/RegDelnode.h
index 633745b62..f79d1dcca 100644
--- a/shell_integration/windows/OCContextMenu/RegDelnode.h
+++ b/shell_integration/windows/OCContextMenu/RegDelnode.h
@@ -58,8 +58,8 @@ HRESULT RegDelnodeRecurse(HKEY hKeyRoot, LPTSTR lpSubKey)
// Enumerate the keys
dwSize = MAX_PATH;
- lResult = RegEnumKeyEx(hKey, 0, szName, &dwSize, NULL,
- NULL, NULL, &ftWrite);
+ lResult = RegEnumKeyEx(hKey, 0, szName, &dwSize, nullptr,
+ nullptr, nullptr, &ftWrite);
if (lResult == ERROR_SUCCESS)
{
@@ -73,8 +73,8 @@ HRESULT RegDelnodeRecurse(HKEY hKeyRoot, LPTSTR lpSubKey)
dwSize = MAX_PATH;
- lResult = RegEnumKeyEx(hKey, 0, szName, &dwSize, NULL,
- NULL, NULL, &ftWrite);
+ lResult = RegEnumKeyEx(hKey, 0, szName, &dwSize, nullptr,
+ nullptr, nullptr, &ftWrite);
} while (lResult == ERROR_SUCCESS);
}
diff --git a/shell_integration/windows/OCContextMenu/dllmain.cpp b/shell_integration/windows/OCContextMenu/dllmain.cpp
index 088dea767..8cd31fea4 100644
--- a/shell_integration/windows/OCContextMenu/dllmain.cpp
+++ b/shell_integration/windows/OCContextMenu/dllmain.cpp
@@ -22,7 +22,7 @@
// {841A0AAD-AA11-4B50-84D9-7F8E727D77D7}
static const GUID CLSID_FileContextMenuExt = { 0x841a0aad, 0xaa11, 0x4b50, { 0x84, 0xd9, 0x7f, 0x8e, 0x72, 0x7d, 0x77, 0xd7 } };
-HINSTANCE g_hInst = NULL;
+HINSTANCE g_hInst = nullptr;
long g_cDllRef = 0;
BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
@@ -105,4 +105,4 @@ STDAPI DllUnregisterServer(void)
}
return hr;
-} \ No newline at end of file
+}
diff --git a/shell_integration/windows/OCOverlays/DllMain.cpp b/shell_integration/windows/OCOverlays/DllMain.cpp
index 02166f591..00195b6e5 100644
--- a/shell_integration/windows/OCOverlays/DllMain.cpp
+++ b/shell_integration/windows/OCOverlays/DllMain.cpp
@@ -17,7 +17,7 @@
#include "OCOverlayRegistrationHandler.h"
#include "OCOverlayFactory.h"
-HINSTANCE instanceHandle = NULL;
+HINSTANCE instanceHandle = nullptr;
long dllReferenceCount = 0;
diff --git a/shell_integration/windows/OCOverlays/OCOverlay.cpp b/shell_integration/windows/OCOverlays/OCOverlay.cpp
index dd03a8664..f7ff64f5b 100644
--- a/shell_integration/windows/OCOverlays/OCOverlay.cpp
+++ b/shell_integration/windows/OCOverlays/OCOverlay.cpp
@@ -82,7 +82,7 @@ IFACEMETHODIMP OCOverlay::QueryInterface(REFIID riid, void **ppv)
else
{
hr = E_NOINTERFACE;
- *ppv = NULL;
+ *ppv = nullptr;
}
if (*ppv)
diff --git a/shell_integration/windows/OCOverlays/OCOverlayFactory.cpp b/shell_integration/windows/OCOverlays/OCOverlayFactory.cpp
index 1a317dae1..34b22f539 100644
--- a/shell_integration/windows/OCOverlays/OCOverlayFactory.cpp
+++ b/shell_integration/windows/OCOverlays/OCOverlayFactory.cpp
@@ -43,7 +43,7 @@ IFACEMETHODIMP OCOverlayFactory::QueryInterface(REFIID riid, void **ppv)
else
{
hResult = E_NOINTERFACE;
- *ppv = NULL;
+ *ppv = nullptr;
}
return hResult;
@@ -70,7 +70,7 @@ IFACEMETHODIMP OCOverlayFactory::CreateInstance(
{
HRESULT hResult = CLASS_E_NOAGGREGATION;
- if (pUnkOuter != NULL) { return hResult; }
+ if (pUnkOuter != nullptr) { return hResult; }
hResult = E_OUTOFMEMORY;
OCOverlay *lrOverlay = new (std::nothrow) OCOverlay(_state);
@@ -90,4 +90,4 @@ IFACEMETHODIMP OCOverlayFactory::LockServer(BOOL fLock)
InterlockedDecrement(&dllReferenceCount);
}
return S_OK;
-} \ No newline at end of file
+}
diff --git a/shell_integration/windows/OCOverlays/OCOverlayRegistrationHandler.cpp b/shell_integration/windows/OCOverlays/OCOverlayRegistrationHandler.cpp
index 0ef83b84c..b10d64671 100644
--- a/shell_integration/windows/OCOverlays/OCOverlayRegistrationHandler.cpp
+++ b/shell_integration/windows/OCOverlays/OCOverlayRegistrationHandler.cpp
@@ -24,9 +24,9 @@ using namespace std;
HRESULT OCOverlayRegistrationHandler::MakeRegistryEntries(const CLSID& clsid, PCWSTR friendlyName)
{
HRESULT hResult;
- HKEY shellOverlayKey = NULL;
+ HKEY shellOverlayKey = nullptr;
// the key may not exist yet
- hResult = HRESULT_FROM_WIN32(RegCreateKeyEx(HKEY_LOCAL_MACHINE, REGISTRY_OVERLAY_KEY, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &shellOverlayKey, NULL));
+ hResult = HRESULT_FROM_WIN32(RegCreateKeyEx(HKEY_LOCAL_MACHINE, REGISTRY_OVERLAY_KEY, 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_WRITE, nullptr, &shellOverlayKey, nullptr));
if (!SUCCEEDED(hResult)) {
hResult = RegCreateKey(HKEY_LOCAL_MACHINE, REGISTRY_OVERLAY_KEY, &shellOverlayKey);
if(!SUCCEEDED(hResult)) {
@@ -34,8 +34,8 @@ HRESULT OCOverlayRegistrationHandler::MakeRegistryEntries(const CLSID& clsid, PC
}
}
- HKEY syncExOverlayKey = NULL;
- hResult = HRESULT_FROM_WIN32(RegCreateKeyEx(shellOverlayKey, friendlyName, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &syncExOverlayKey, NULL));
+ HKEY syncExOverlayKey = nullptr;
+ hResult = HRESULT_FROM_WIN32(RegCreateKeyEx(shellOverlayKey, friendlyName, 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_WRITE, nullptr, &syncExOverlayKey, nullptr));
if (!SUCCEEDED(hResult)) {
return hResult;
@@ -44,7 +44,7 @@ HRESULT OCOverlayRegistrationHandler::MakeRegistryEntries(const CLSID& clsid, PC
wchar_t stringCLSID[MAX_PATH];
StringFromGUID2(clsid, stringCLSID, ARRAYSIZE(stringCLSID));
LPCTSTR value = stringCLSID;
- hResult = RegSetValueEx(syncExOverlayKey, NULL, 0, REG_SZ, (LPBYTE)value, (DWORD)((wcslen(value)+1) * sizeof(TCHAR)));
+ hResult = RegSetValueEx(syncExOverlayKey, nullptr, 0, REG_SZ, (LPBYTE)value, (DWORD)((wcslen(value)+1) * sizeof(TCHAR)));
if (!SUCCEEDED(hResult)) {
return hResult;
}
@@ -55,14 +55,14 @@ HRESULT OCOverlayRegistrationHandler::MakeRegistryEntries(const CLSID& clsid, PC
HRESULT OCOverlayRegistrationHandler::RemoveRegistryEntries(PCWSTR friendlyName)
{
HRESULT hResult;
- HKEY shellOverlayKey = NULL;
+ HKEY shellOverlayKey = nullptr;
hResult = HRESULT_FROM_WIN32(RegOpenKeyEx(HKEY_LOCAL_MACHINE, REGISTRY_OVERLAY_KEY, 0, KEY_WRITE, &shellOverlayKey));
if (!SUCCEEDED(hResult)) {
return hResult;
}
- HKEY syncExOverlayKey = NULL;
+ HKEY syncExOverlayKey = nullptr;
hResult = HRESULT_FROM_WIN32(RegDeleteKey(shellOverlayKey, friendlyName));
if (!SUCCEEDED(hResult)) {
return hResult;
@@ -73,35 +73,35 @@ HRESULT OCOverlayRegistrationHandler::RemoveRegistryEntries(PCWSTR friendlyName)
HRESULT OCOverlayRegistrationHandler::RegisterCOMObject(PCWSTR modulePath, PCWSTR friendlyName, const CLSID& clsid)
{
- if (modulePath == NULL) {
+ if (modulePath == nullptr) {
return E_FAIL;
}
wchar_t stringCLSID[MAX_PATH];
StringFromGUID2(clsid, stringCLSID, ARRAYSIZE(stringCLSID));
HRESULT hResult;
- HKEY hKey = NULL;
+ HKEY hKey = nullptr;
hResult = HRESULT_FROM_WIN32(RegOpenKeyEx(HKEY_CLASSES_ROOT, REGISTRY_CLSID, 0, KEY_WRITE, &hKey));
if (!SUCCEEDED(hResult)) {
return hResult;
}
- HKEY clsidKey = NULL;
- hResult = HRESULT_FROM_WIN32(RegCreateKeyEx(hKey, stringCLSID, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &clsidKey, NULL));
+ HKEY clsidKey = nullptr;
+ hResult = HRESULT_FROM_WIN32(RegCreateKeyEx(hKey, stringCLSID, 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_WRITE, nullptr, &clsidKey, nullptr));
if(!SUCCEEDED(hResult)) {
return hResult;
}
- hResult = HRESULT_FROM_WIN32(RegSetValue(clsidKey, NULL, REG_SZ, friendlyName, (DWORD) wcslen(friendlyName)));
+ hResult = HRESULT_FROM_WIN32(RegSetValue(clsidKey, nullptr, REG_SZ, friendlyName, (DWORD) wcslen(friendlyName)));
- HKEY inprocessKey = NULL;
- hResult = HRESULT_FROM_WIN32(RegCreateKeyEx(clsidKey, REGISTRY_IN_PROCESS, 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, &inprocessKey, NULL));
+ HKEY inprocessKey = nullptr;
+ hResult = HRESULT_FROM_WIN32(RegCreateKeyEx(clsidKey, REGISTRY_IN_PROCESS, 0, nullptr, REG_OPTION_NON_VOLATILE, KEY_WRITE, nullptr, &inprocessKey, nullptr));
if(!SUCCEEDED(hResult)) {
return hResult;
}
- hResult = HRESULT_FROM_WIN32(RegSetValue(inprocessKey, NULL, REG_SZ, modulePath, (DWORD) wcslen(modulePath)));
+ hResult = HRESULT_FROM_WIN32(RegSetValue(inprocessKey, nullptr, REG_SZ, modulePath, (DWORD) wcslen(modulePath)));
if(!SUCCEEDED(hResult)) {
return hResult;
@@ -126,13 +126,13 @@ HRESULT OCOverlayRegistrationHandler::UnregisterCOMObject(const CLSID& clsid)
StringFromGUID2(clsid, stringCLSID, ARRAYSIZE(stringCLSID));
HRESULT hResult;
- HKEY hKey = NULL;
+ HKEY hKey = nullptr;
hResult = HRESULT_FROM_WIN32(RegOpenKeyEx(HKEY_CLASSES_ROOT, REGISTRY_CLSID, 0, DELETE, &hKey));
if (!SUCCEEDED(hResult)) {
return hResult;
}
- HKEY clsidKey = NULL;
+ HKEY clsidKey = nullptr;
hResult = HRESULT_FROM_WIN32(RegOpenKeyEx(hKey, stringCLSID, 0, DELETE, &clsidKey));
if(!SUCCEEDED(hResult)) {
return hResult;
@@ -149,4 +149,4 @@ HRESULT OCOverlayRegistrationHandler::UnregisterCOMObject(const CLSID& clsid)
}
return S_OK;
-} \ No newline at end of file
+}
diff --git a/shell_integration/windows/OCUtil/CommunicationSocket.cpp b/shell_integration/windows/OCUtil/CommunicationSocket.cpp
index b7dd64c32..f24b30ba6 100644
--- a/shell_integration/windows/OCUtil/CommunicationSocket.cpp
+++ b/shell_integration/windows/OCUtil/CommunicationSocket.cpp
@@ -73,7 +73,7 @@ bool CommunicationSocket::Close()
bool CommunicationSocket::Connect(const std::wstring &pipename)
{
- _pipe = CreateFile(pipename.data(), GENERIC_READ | GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL);
+ _pipe = CreateFile(pipename.data(), GENERIC_READ | GENERIC_WRITE, 0, nullptr, OPEN_EXISTING, 0, nullptr);
if (_pipe == INVALID_HANDLE_VALUE) {
return false;
@@ -87,7 +87,7 @@ bool CommunicationSocket::SendMsg(const wchar_t* message) const
auto utf8_msg = StringUtil::toUtf8(message);
DWORD numBytesWritten = 0;
- auto result = WriteFile( _pipe, utf8_msg.c_str(), DWORD(utf8_msg.size()), &numBytesWritten, NULL);
+ auto result = WriteFile( _pipe, utf8_msg.c_str(), DWORD(utf8_msg.size()), &numBytesWritten, nullptr);
if (result) {
return true;
@@ -123,7 +123,7 @@ bool CommunicationSocket::ReadLine(wstring* response)
DWORD numBytesRead = 0;
DWORD totalBytesAvailable = 0;
- if (!PeekNamedPipe(_pipe, NULL, 0, 0, &totalBytesAvailable, 0)) {
+ if (!PeekNamedPipe(_pipe, nullptr, 0, 0, &totalBytesAvailable, 0)) {
Close();
return false;
}
@@ -131,7 +131,7 @@ bool CommunicationSocket::ReadLine(wstring* response)
return false;
}
- if (!ReadFile(_pipe, resp_utf8.data(), DWORD(resp_utf8.size()), &numBytesRead, NULL)) {
+ if (!ReadFile(_pipe, resp_utf8.data(), DWORD(resp_utf8.size()), &numBytesRead, nullptr)) {
Close();
return false;
}
diff --git a/shell_integration/windows/OCUtil/RegistryUtil.cpp b/shell_integration/windows/OCUtil/RegistryUtil.cpp
index 5542ac4d6..fc8b125dc 100644
--- a/shell_integration/windows/OCUtil/RegistryUtil.cpp
+++ b/shell_integration/windows/OCUtil/RegistryUtil.cpp
@@ -38,9 +38,9 @@ bool RegistryUtil::ReadRegistry(const wchar_t* key, const wchar_t* name, wstring
{
HRESULT hResult;
- HKEY rootKey = NULL;
+ HKEY rootKey = nullptr;
- hResult = HRESULT_FROM_WIN32(RegOpenKeyEx(HKEY_CURRENT_USER, (LPCWSTR)key, NULL, KEY_READ, &rootKey));
+ hResult = HRESULT_FROM_WIN32(RegOpenKeyEx(HKEY_CURRENT_USER, (LPCWSTR)key, nullptr, KEY_READ, &rootKey));
if(!SUCCEEDED(hResult))
{
@@ -49,8 +49,8 @@ bool RegistryUtil::ReadRegistry(const wchar_t* key, const wchar_t* name, wstring
wchar_t value[SIZE];
DWORD value_length = SIZE;
-
- hResult = RegQueryValueEx(rootKey, (LPCWSTR)name, NULL, NULL, (LPBYTE)value, &value_length );
+
+ hResult = RegQueryValueEx(rootKey, (LPCWSTR)name, nullptr, nullptr, (LPBYTE)value, &value_length );
if(!SUCCEEDED(hResult))
{
diff --git a/shell_integration/windows/OCUtil/RemotePathChecker.cpp b/shell_integration/windows/OCUtil/RemotePathChecker.cpp
index 37caee182..99b46d3ba 100644
--- a/shell_integration/windows/OCUtil/RemotePathChecker.cpp
+++ b/shell_integration/windows/OCUtil/RemotePathChecker.cpp
@@ -83,7 +83,7 @@ void RemotePathChecker::workerThreadLoop()
// We don't keep track of all files and can't know which file is currently visible
// to the user, but at least reload the root dir so that any shortcut to the root
// is updated without the user needing to refresh.
- SHChangeNotify(SHCNE_UPDATEDIR, SHCNF_PATH | SHCNF_FLUSHNOWAIT, responsePath.data(), NULL);
+ SHChangeNotify(SHCNE_UPDATEDIR, SHCNF_PATH | SHCNF_FLUSHNOWAIT, responsePath.data(), nullptr);
} else if (StringUtil::begins_with(response, wstring(L"UNREGISTER_PATH:"))) {
wstring responsePath = response.substr(16); // length of UNREGISTER_PATH:
@@ -107,7 +107,7 @@ void RemotePathChecker::workerThreadLoop()
}
}
for (auto& path : removedPaths)
- SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH | SHCNF_FLUSHNOWAIT, path.data(), NULL);
+ SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH | SHCNF_FLUSHNOWAIT, path.data(), nullptr);
} else if (StringUtil::begins_with(response, wstring(L"STATUS:")) ||
StringUtil::begins_with(response, wstring(L"BROADCAST:"))) {
@@ -135,7 +135,7 @@ void RemotePathChecker::workerThreadLoop()
it->second = state;
}
if (updateView) {
- SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH | SHCNF_FLUSHNOWAIT, responsePath.data(), NULL);
+ SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH | SHCNF_FLUSHNOWAIT, responsePath.data(), nullptr);
}
}
}
@@ -151,7 +151,7 @@ void RemotePathChecker::workerThreadLoop()
lock.unlock();
// Let explorer know about each invalidated cache entry that needs to get its icon removed.
for (auto it = cache.begin(); it != cache.end(); ++it) {
- SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH | SHCNF_FLUSHNOWAIT, it->first.data(), NULL);
+ SHChangeNotify(SHCNE_UPDATEITEM, SHCNF_PATH | SHCNF_FLUSHNOWAIT, it->first.data(), nullptr);
}
}
@@ -168,7 +168,7 @@ RemotePathChecker::RemotePathChecker()
: _stop(false)
, _watchedDirectories(make_shared<const vector<wstring>>())
, _connected(false)
- , _newQueries(CreateEvent(NULL, FALSE, FALSE, NULL))
+ , _newQueries(CreateEvent(nullptr, FALSE, FALSE, nullptr))
, _thread([this]{ this->workerThreadLoop(); })
{
}