зеркало из https://github.com/mozilla/gecko-dev.git
Bug 784739 - Switch from NULL to nullptr in toolkit/mozapps/; r=ehsan
This commit is contained in:
Родитель
d6529bb5d1
Коммит
50b0404404
|
@ -42,13 +42,13 @@ CalculateMD5(const char *data, DWORD dataSize,
|
||||||
HCRYPTPROV hProv = 0;
|
HCRYPTPROV hProv = 0;
|
||||||
HCRYPTHASH hHash = 0;
|
HCRYPTHASH hHash = 0;
|
||||||
|
|
||||||
if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL, 0)) {
|
if (!CryptAcquireContext(&hProv, nullptr, nullptr, PROV_RSA_FULL, 0)) {
|
||||||
if (NTE_BAD_KEYSET != GetLastError()) {
|
if (NTE_BAD_KEYSET != GetLastError()) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Maybe it doesn't exist, try to create it.
|
// Maybe it doesn't exist, try to create it.
|
||||||
if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL,
|
if (!CryptAcquireContext(&hProv, nullptr, nullptr, PROV_RSA_FULL,
|
||||||
CRYPT_NEWKEYSET)) {
|
CRYPT_NEWKEYSET)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,13 +62,13 @@ static char*
|
||||||
NS_strtok(const char *delims, char **str)
|
NS_strtok(const char *delims, char **str)
|
||||||
{
|
{
|
||||||
if (!*str)
|
if (!*str)
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
char *ret = (char*) NS_strspnp(delims, *str);
|
char *ret = (char*) NS_strspnp(delims, *str);
|
||||||
|
|
||||||
if (!*ret) {
|
if (!*ret) {
|
||||||
*str = ret;
|
*str = ret;
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *i = ret;
|
char *i = ret;
|
||||||
|
@ -83,7 +83,7 @@ NS_strtok(const char *delims, char **str)
|
||||||
++i;
|
++i;
|
||||||
} while (*i);
|
} while (*i);
|
||||||
|
|
||||||
*str = NULL;
|
*str = nullptr;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
#ifndef READSTRINGS_H__
|
#ifndef READSTRINGS_H__
|
||||||
#define READSTRINGS_H__
|
#define READSTRINGS_H__
|
||||||
|
|
||||||
|
#include "mozilla/NullPtr.h"
|
||||||
|
|
||||||
#define MAX_TEXT_LEN 600
|
#define MAX_TEXT_LEN 600
|
||||||
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
|
@ -38,6 +40,6 @@ int ReadStrings(const NS_tchar *path,
|
||||||
const char *keyList,
|
const char *keyList,
|
||||||
unsigned int numStrings,
|
unsigned int numStrings,
|
||||||
char results[][MAX_TEXT_LEN],
|
char results[][MAX_TEXT_LEN],
|
||||||
const char *section = NULL);
|
const char *section = nullptr);
|
||||||
|
|
||||||
#endif // READSTRINGS_H__
|
#endif // READSTRINGS_H__
|
||||||
|
|
|
@ -80,7 +80,7 @@ HANDLE
|
||||||
UACHelper::OpenUserToken(DWORD sessionID)
|
UACHelper::OpenUserToken(DWORD sessionID)
|
||||||
{
|
{
|
||||||
HMODULE module = LoadLibraryW(L"wtsapi32.dll");
|
HMODULE module = LoadLibraryW(L"wtsapi32.dll");
|
||||||
HANDLE token = NULL;
|
HANDLE token = nullptr;
|
||||||
LPWTSQueryUserToken wtsQueryUserToken =
|
LPWTSQueryUserToken wtsQueryUserToken =
|
||||||
(LPWTSQueryUserToken)GetProcAddress(module, "WTSQueryUserToken");
|
(LPWTSQueryUserToken)GetProcAddress(module, "WTSQueryUserToken");
|
||||||
if (wtsQueryUserToken) {
|
if (wtsQueryUserToken) {
|
||||||
|
@ -94,7 +94,7 @@ UACHelper::OpenUserToken(DWORD sessionID)
|
||||||
* Opens a linked token for the specified token.
|
* Opens a linked token for the specified token.
|
||||||
*
|
*
|
||||||
* @param token The token to get the linked token from
|
* @param token The token to get the linked token from
|
||||||
* @return A linked token or NULL if one does not exist.
|
* @return A linked token or nullptr if one does not exist.
|
||||||
* Caller should close the handle.
|
* Caller should close the handle.
|
||||||
*/
|
*/
|
||||||
HANDLE
|
HANDLE
|
||||||
|
@ -105,7 +105,7 @@ UACHelper::OpenLinkedToken(HANDLE token)
|
||||||
// the other is the UAC elevated one. Since we are running as a service
|
// the other is the UAC elevated one. Since we are running as a service
|
||||||
// as the system account we have access to both.
|
// as the system account we have access to both.
|
||||||
TOKEN_LINKED_TOKEN tlt;
|
TOKEN_LINKED_TOKEN tlt;
|
||||||
HANDLE hNewLinkedToken = NULL;
|
HANDLE hNewLinkedToken = nullptr;
|
||||||
DWORD len;
|
DWORD len;
|
||||||
if (GetTokenInformation(token, (TOKEN_INFORMATION_CLASS)TokenLinkedToken,
|
if (GetTokenInformation(token, (TOKEN_INFORMATION_CLASS)TokenLinkedToken,
|
||||||
&tlt, sizeof(TOKEN_LINKED_TOKEN), &len)) {
|
&tlt, sizeof(TOKEN_LINKED_TOKEN), &len)) {
|
||||||
|
@ -128,7 +128,7 @@ BOOL
|
||||||
UACHelper::SetPrivilege(HANDLE token, LPCTSTR priv, BOOL enable)
|
UACHelper::SetPrivilege(HANDLE token, LPCTSTR priv, BOOL enable)
|
||||||
{
|
{
|
||||||
LUID luidOfPriv;
|
LUID luidOfPriv;
|
||||||
if (!LookupPrivilegeValue(NULL, priv, &luidOfPriv)) {
|
if (!LookupPrivilegeValue(nullptr, priv, &luidOfPriv)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,7 +139,7 @@ UACHelper::SetPrivilege(HANDLE token, LPCTSTR priv, BOOL enable)
|
||||||
|
|
||||||
SetLastError(ERROR_SUCCESS);
|
SetLastError(ERROR_SUCCESS);
|
||||||
if (!AdjustTokenPrivileges(token, false, &tokenPriv,
|
if (!AdjustTokenPrivileges(token, false, &tokenPriv,
|
||||||
sizeof(tokenPriv), NULL, NULL)) {
|
sizeof(tokenPriv), nullptr, nullptr)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ UACHelper::SetPrivilege(HANDLE token, LPCTSTR priv, BOOL enable)
|
||||||
* drop the privilege.
|
* drop the privilege.
|
||||||
*
|
*
|
||||||
* @param token The token to adjust the privilege on.
|
* @param token The token to adjust the privilege on.
|
||||||
* Pass NULL for current token.
|
* Pass nullptr for current token.
|
||||||
* @param unneededPrivs An array of unneeded privileges.
|
* @param unneededPrivs An array of unneeded privileges.
|
||||||
* @param count The size of the array
|
* @param count The size of the array
|
||||||
* @return TRUE if there were no errors
|
* @return TRUE if there were no errors
|
||||||
|
@ -161,7 +161,7 @@ UACHelper::DisableUnneededPrivileges(HANDLE token,
|
||||||
LPCTSTR *unneededPrivs,
|
LPCTSTR *unneededPrivs,
|
||||||
size_t count)
|
size_t count)
|
||||||
{
|
{
|
||||||
HANDLE obtainedToken = NULL;
|
HANDLE obtainedToken = nullptr;
|
||||||
if (!token) {
|
if (!token) {
|
||||||
// Note: This handle is a pseudo-handle and need not be closed
|
// Note: This handle is a pseudo-handle and need not be closed
|
||||||
HANDLE process = GetCurrentProcess();
|
HANDLE process = GetCurrentProcess();
|
||||||
|
@ -198,7 +198,7 @@ UACHelper::DisableUnneededPrivileges(HANDLE token,
|
||||||
* explicitly disable these or not.
|
* explicitly disable these or not.
|
||||||
*
|
*
|
||||||
* @param token The token to drop the privilege on.
|
* @param token The token to drop the privilege on.
|
||||||
* Pass NULL for current token.
|
* Pass nullptr for current token.
|
||||||
* @return TRUE if there were no errors
|
* @return TRUE if there were no errors
|
||||||
*/
|
*/
|
||||||
BOOL
|
BOOL
|
||||||
|
|
|
@ -70,8 +70,8 @@ PathGetSiblingFilePath(LPWSTR destinationBuffer,
|
||||||
* @param updateInfoDir The directory where update info is stored.
|
* @param updateInfoDir The directory where update info is stored.
|
||||||
* @param forceSync If true even if the ini file specifies async, the
|
* @param forceSync If true even if the ini file specifies async, the
|
||||||
* process will wait for termination of PostUpdate.
|
* process will wait for termination of PostUpdate.
|
||||||
* @param userToken The user token to run as, if NULL the current user
|
* @param userToken The user token to run as, if nullptr the current
|
||||||
* will be used.
|
* user will be used.
|
||||||
* @return TRUE if there was no error starting the process.
|
* @return TRUE if there was no error starting the process.
|
||||||
*/
|
*/
|
||||||
BOOL
|
BOOL
|
||||||
|
@ -95,12 +95,12 @@ LaunchWinPostProcess(const WCHAR *installationDir,
|
||||||
WCHAR exearg[MAX_PATH + 1];
|
WCHAR exearg[MAX_PATH + 1];
|
||||||
WCHAR exeasync[10];
|
WCHAR exeasync[10];
|
||||||
bool async = true;
|
bool async = true;
|
||||||
if (!GetPrivateProfileStringW(L"PostUpdateWin", L"ExeRelPath", NULL, exefile,
|
if (!GetPrivateProfileStringW(L"PostUpdateWin", L"ExeRelPath", nullptr,
|
||||||
MAX_PATH + 1, inifile)) {
|
exefile, MAX_PATH + 1, inifile)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!GetPrivateProfileStringW(L"PostUpdateWin", L"ExeArg", NULL, exearg,
|
if (!GetPrivateProfileStringW(L"PostUpdateWin", L"ExeArg", nullptr, exearg,
|
||||||
MAX_PATH + 1, inifile)) {
|
MAX_PATH + 1, inifile)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -161,22 +161,22 @@ LaunchWinPostProcess(const WCHAR *installationDir,
|
||||||
ok = CreateProcessAsUserW(userToken,
|
ok = CreateProcessAsUserW(userToken,
|
||||||
exefullpath,
|
exefullpath,
|
||||||
cmdline,
|
cmdline,
|
||||||
NULL, // no special security attributes
|
nullptr, // no special security attributes
|
||||||
NULL, // no special thread attributes
|
nullptr, // no special thread attributes
|
||||||
false, // don't inherit filehandles
|
false, // don't inherit filehandles
|
||||||
0, // No special process creation flags
|
0, // No special process creation flags
|
||||||
NULL, // inherit my environment
|
nullptr, // inherit my environment
|
||||||
workingDirectory,
|
workingDirectory,
|
||||||
&si,
|
&si,
|
||||||
&pi);
|
&pi);
|
||||||
} else {
|
} else {
|
||||||
ok = CreateProcessW(exefullpath,
|
ok = CreateProcessW(exefullpath,
|
||||||
cmdline,
|
cmdline,
|
||||||
NULL, // no special security attributes
|
nullptr, // no special security attributes
|
||||||
NULL, // no special thread attributes
|
nullptr, // no special thread attributes
|
||||||
false, // don't inherit filehandles
|
false, // don't inherit filehandles
|
||||||
0, // No special process creation flags
|
0, // No special process creation flags
|
||||||
NULL, // inherit my environment
|
nullptr, // inherit my environment
|
||||||
workingDirectory,
|
workingDirectory,
|
||||||
&si,
|
&si,
|
||||||
&pi);
|
&pi);
|
||||||
|
@ -203,7 +203,7 @@ BOOL
|
||||||
StartServiceUpdate(LPCWSTR installDir)
|
StartServiceUpdate(LPCWSTR installDir)
|
||||||
{
|
{
|
||||||
// Get a handle to the local computer SCM database
|
// Get a handle to the local computer SCM database
|
||||||
SC_HANDLE manager = OpenSCManager(NULL, NULL,
|
SC_HANDLE manager = OpenSCManager(nullptr, nullptr,
|
||||||
SC_MANAGER_ALL_ACCESS);
|
SC_MANAGER_ALL_ACCESS);
|
||||||
if (!manager) {
|
if (!manager) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -237,9 +237,9 @@ StartServiceUpdate(LPCWSTR installDir)
|
||||||
sizeof(cmdLine) / sizeof(cmdLine[0]) - 1);
|
sizeof(cmdLine) / sizeof(cmdLine[0]) - 1);
|
||||||
BOOL svcUpdateProcessStarted = CreateProcessW(maintserviceInstallerPath,
|
BOOL svcUpdateProcessStarted = CreateProcessW(maintserviceInstallerPath,
|
||||||
cmdLine,
|
cmdLine,
|
||||||
NULL, NULL, FALSE,
|
nullptr, nullptr, FALSE,
|
||||||
0,
|
0,
|
||||||
NULL, installDir, &si, &pi);
|
nullptr, installDir, &si, &pi);
|
||||||
if (svcUpdateProcessStarted) {
|
if (svcUpdateProcessStarted) {
|
||||||
CloseHandle(pi.hProcess);
|
CloseHandle(pi.hProcess);
|
||||||
CloseHandle(pi.hThread);
|
CloseHandle(pi.hThread);
|
||||||
|
@ -270,7 +270,7 @@ StartServiceCommand(int argc, LPCWSTR* argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get a handle to the SCM database.
|
// Get a handle to the SCM database.
|
||||||
SC_HANDLE serviceManager = OpenSCManager(NULL, NULL,
|
SC_HANDLE serviceManager = OpenSCManager(nullptr, nullptr,
|
||||||
SC_MANAGER_CONNECT |
|
SC_MANAGER_CONNECT |
|
||||||
SC_MANAGER_ENUMERATE_SERVICE);
|
SC_MANAGER_ENUMERATE_SERVICE);
|
||||||
if (!serviceManager) {
|
if (!serviceManager) {
|
||||||
|
@ -375,14 +375,14 @@ WriteStatusPending(LPCWSTR updateDirPath)
|
||||||
|
|
||||||
const char pending[] = "pending";
|
const char pending[] = "pending";
|
||||||
HANDLE statusFile = CreateFileW(updateStatusFilePath, GENERIC_WRITE, 0,
|
HANDLE statusFile = CreateFileW(updateStatusFilePath, GENERIC_WRITE, 0,
|
||||||
NULL, CREATE_ALWAYS, 0, NULL);
|
nullptr, CREATE_ALWAYS, 0, nullptr);
|
||||||
if (statusFile == INVALID_HANDLE_VALUE) {
|
if (statusFile == INVALID_HANDLE_VALUE) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
DWORD wrote;
|
DWORD wrote;
|
||||||
BOOL ok = WriteFile(statusFile, pending,
|
BOOL ok = WriteFile(statusFile, pending,
|
||||||
sizeof(pending) - 1, &wrote, NULL);
|
sizeof(pending) - 1, &wrote, nullptr);
|
||||||
CloseHandle(statusFile);
|
CloseHandle(statusFile);
|
||||||
return ok && (wrote == sizeof(pending) - 1);
|
return ok && (wrote == sizeof(pending) - 1);
|
||||||
}
|
}
|
||||||
|
@ -403,7 +403,7 @@ WriteStatusFailure(LPCWSTR updateDirPath, int errorCode)
|
||||||
}
|
}
|
||||||
|
|
||||||
HANDLE statusFile = CreateFileW(updateStatusFilePath, GENERIC_WRITE, 0,
|
HANDLE statusFile = CreateFileW(updateStatusFilePath, GENERIC_WRITE, 0,
|
||||||
NULL, CREATE_ALWAYS, 0, NULL);
|
nullptr, CREATE_ALWAYS, 0, nullptr);
|
||||||
if (statusFile == INVALID_HANDLE_VALUE) {
|
if (statusFile == INVALID_HANDLE_VALUE) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -413,7 +413,7 @@ WriteStatusFailure(LPCWSTR updateDirPath, int errorCode)
|
||||||
DWORD toWrite = strlen(failure);
|
DWORD toWrite = strlen(failure);
|
||||||
DWORD wrote;
|
DWORD wrote;
|
||||||
BOOL ok = WriteFile(statusFile, failure,
|
BOOL ok = WriteFile(statusFile, failure,
|
||||||
toWrite, &wrote, NULL);
|
toWrite, &wrote, nullptr);
|
||||||
CloseHandle(statusFile);
|
CloseHandle(statusFile);
|
||||||
return ok && wrote == toWrite;
|
return ok && wrote == toWrite;
|
||||||
}
|
}
|
||||||
|
@ -459,7 +459,7 @@ WaitForServiceStop(LPCWSTR serviceName, DWORD maxWaitSeconds)
|
||||||
DWORD lastServiceState = 0x000000CF;
|
DWORD lastServiceState = 0x000000CF;
|
||||||
|
|
||||||
// Get a handle to the SCM database.
|
// Get a handle to the SCM database.
|
||||||
SC_HANDLE serviceManager = OpenSCManager(NULL, NULL,
|
SC_HANDLE serviceManager = OpenSCManager(nullptr, nullptr,
|
||||||
SC_MANAGER_CONNECT |
|
SC_MANAGER_CONNECT |
|
||||||
SC_MANAGER_ENUMERATE_SERVICE);
|
SC_MANAGER_ENUMERATE_SERVICE);
|
||||||
if (!serviceManager) {
|
if (!serviceManager) {
|
||||||
|
@ -674,7 +674,7 @@ static BOOL
|
||||||
GetDWORDValue(HKEY key, LPCWSTR valueName, DWORD &retValue)
|
GetDWORDValue(HKEY key, LPCWSTR valueName, DWORD &retValue)
|
||||||
{
|
{
|
||||||
DWORD regDWORDValueSize = sizeof(DWORD);
|
DWORD regDWORDValueSize = sizeof(DWORD);
|
||||||
LONG retCode = RegQueryValueExW(key, valueName, 0, NULL,
|
LONG retCode = RegQueryValueExW(key, valueName, 0, nullptr,
|
||||||
reinterpret_cast<LPBYTE>(&retValue),
|
reinterpret_cast<LPBYTE>(&retValue),
|
||||||
®DWORDValueSize);
|
®DWORDValueSize);
|
||||||
return ERROR_SUCCESS == retCode;
|
return ERROR_SUCCESS == retCode;
|
||||||
|
@ -736,7 +736,7 @@ IsUnpromptedElevation(BOOL &isUnpromptedElevation)
|
||||||
}
|
}
|
||||||
DWORD len = aCharLength * sizeof(WCHAR);
|
DWORD len = aCharLength * sizeof(WCHAR);
|
||||||
memset(aIDBuffer, 0, len);
|
memset(aIDBuffer, 0, len);
|
||||||
if (RegQueryValueExW(key, L"AppUserModelID", NULL, NULL,
|
if (RegQueryValueExW(key, L"AppUserModelID", nullptr, nullptr,
|
||||||
(LPBYTE)aIDBuffer, &len) != ERROR_SUCCESS || !len) {
|
(LPBYTE)aIDBuffer, &len) != ERROR_SUCCESS || !len) {
|
||||||
RegCloseKey(key);
|
RegCloseKey(key);
|
||||||
return false;
|
return false;
|
||||||
|
@ -748,12 +748,12 @@ IsUnpromptedElevation(BOOL &isUnpromptedElevation)
|
||||||
HRESULT
|
HRESULT
|
||||||
LaunchDefaultMetroBrowser()
|
LaunchDefaultMetroBrowser()
|
||||||
{
|
{
|
||||||
CoInitialize(NULL);
|
CoInitialize(nullptr);
|
||||||
HRESULT hr = E_FAIL;
|
HRESULT hr = E_FAIL;
|
||||||
// The interface that allows us to activate the browser
|
// The interface that allows us to activate the browser
|
||||||
IApplicationActivationManager *activateMgr;
|
IApplicationActivationManager *activateMgr;
|
||||||
if (FAILED(hr = CoCreateInstance(CLSID_ApplicationActivationManager, NULL,
|
if (FAILED(hr = CoCreateInstance(CLSID_ApplicationActivationManager,
|
||||||
CLSCTX_LOCAL_SERVER,
|
nullptr, CLSCTX_LOCAL_SERVER,
|
||||||
IID_IApplicationActivationManager,
|
IID_IApplicationActivationManager,
|
||||||
(void**)&activateMgr))) {
|
(void**)&activateMgr))) {
|
||||||
CoUninitialize();
|
CoUninitialize();
|
||||||
|
@ -770,7 +770,7 @@ IsUnpromptedElevation(BOOL &isUnpromptedElevation)
|
||||||
|
|
||||||
// Hand off focus rights to the out-of-process activation server. Without
|
// Hand off focus rights to the out-of-process activation server. Without
|
||||||
// this the metro interface won't launch.
|
// this the metro interface won't launch.
|
||||||
CoAllowSetForegroundWindow(activateMgr, NULL);
|
CoAllowSetForegroundWindow(activateMgr, nullptr);
|
||||||
|
|
||||||
// Launch default browser in Metro
|
// Launch default browser in Metro
|
||||||
DWORD processID;
|
DWORD processID;
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
#include "updatelogging.h"
|
#include "updatelogging.h"
|
||||||
|
|
||||||
UpdateLog::UpdateLog() : logFP(NULL)
|
UpdateLog::UpdateLog() : logFP(nullptr)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ void UpdateLog::Finish()
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fclose(logFP);
|
fclose(logFP);
|
||||||
logFP = NULL;
|
logFP = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void UpdateLog::Flush()
|
void UpdateLog::Flush()
|
||||||
|
|
|
@ -52,6 +52,7 @@
|
||||||
# define LOG_S "%s"
|
# define LOG_S "%s"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "mozilla/NullPtr.h"
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -81,7 +82,7 @@ WriteMsg(const NS_tchar *path, const char *status)
|
||||||
|
|
||||||
fprintf(outFP, "%s\n", status);
|
fprintf(outFP, "%s\n", status);
|
||||||
fclose(outFP);
|
fclose(outFP);
|
||||||
outFP = NULL;
|
outFP = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
|
@ -118,7 +119,7 @@ CheckMsg(const NS_tchar *path, const char *expected)
|
||||||
rb = mbuf;
|
rb = mbuf;
|
||||||
|
|
||||||
fclose(inFP);
|
fclose(inFP);
|
||||||
inFP = NULL;
|
inFP = nullptr;
|
||||||
return strcmp(rb, expected) == 0;
|
return strcmp(rb, expected) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -142,21 +143,21 @@ VerifyCertificateTrustForFile(LPCWSTR filePath)
|
||||||
WINTRUST_DATA trustData;
|
WINTRUST_DATA trustData;
|
||||||
ZeroMemory(&trustData, sizeof(trustData));
|
ZeroMemory(&trustData, sizeof(trustData));
|
||||||
trustData.cbStruct = sizeof(trustData);
|
trustData.cbStruct = sizeof(trustData);
|
||||||
trustData.pPolicyCallbackData = NULL;
|
trustData.pPolicyCallbackData = nullptr;
|
||||||
trustData.pSIPClientData = NULL;
|
trustData.pSIPClientData = nullptr;
|
||||||
trustData.dwUIChoice = WTD_UI_NONE;
|
trustData.dwUIChoice = WTD_UI_NONE;
|
||||||
trustData.fdwRevocationChecks = WTD_REVOKE_NONE;
|
trustData.fdwRevocationChecks = WTD_REVOKE_NONE;
|
||||||
trustData.dwUnionChoice = WTD_CHOICE_FILE;
|
trustData.dwUnionChoice = WTD_CHOICE_FILE;
|
||||||
trustData.dwStateAction = 0;
|
trustData.dwStateAction = 0;
|
||||||
trustData.hWVTStateData = NULL;
|
trustData.hWVTStateData = nullptr;
|
||||||
trustData.pwszURLReference = NULL;
|
trustData.pwszURLReference = nullptr;
|
||||||
// no UI
|
// no UI
|
||||||
trustData.dwUIContext = 0;
|
trustData.dwUIContext = 0;
|
||||||
trustData.pFile = &fileToCheck;
|
trustData.pFile = &fileToCheck;
|
||||||
|
|
||||||
GUID policyGUID = WINTRUST_ACTION_GENERIC_VERIFY_V2;
|
GUID policyGUID = WINTRUST_ACTION_GENERIC_VERIFY_V2;
|
||||||
// Check if the file is signed by something that is trusted.
|
// Check if the file is signed by something that is trusted.
|
||||||
return WinVerifyTrust(NULL, &policyGUID, &trustData);
|
return WinVerifyTrust(nullptr, &policyGUID, &trustData);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -313,7 +314,7 @@ int NS_main(int argc, NS_tchar **argv)
|
||||||
|
|
||||||
// File in use test helper section
|
// File in use test helper section
|
||||||
if (!NS_tstrcmp(argv[4], NS_T("-s"))) {
|
if (!NS_tstrcmp(argv[4], NS_T("-s"))) {
|
||||||
NS_tchar *cwd = NS_tgetcwd(NULL, 0);
|
NS_tchar *cwd = NS_tgetcwd(nullptr, 0);
|
||||||
NS_tchar inFilePath[MAXPATHLEN];
|
NS_tchar inFilePath[MAXPATHLEN];
|
||||||
NS_tsnprintf(inFilePath, sizeof(inFilePath)/sizeof(inFilePath[0]),
|
NS_tsnprintf(inFilePath, sizeof(inFilePath)/sizeof(inFilePath[0]),
|
||||||
NS_T("%s/%s"), cwd, argv[2]);
|
NS_T("%s/%s"), cwd, argv[2]);
|
||||||
|
@ -327,7 +328,7 @@ int NS_main(int argc, NS_tchar **argv)
|
||||||
if (argc == 7) {
|
if (argc == 7) {
|
||||||
hFile = CreateFileW(argv[6],
|
hFile = CreateFileW(argv[6],
|
||||||
DELETE | GENERIC_WRITE, 0,
|
DELETE | GENERIC_WRITE, 0,
|
||||||
NULL, OPEN_EXISTING, 0, NULL);
|
nullptr, OPEN_EXISTING, 0, nullptr);
|
||||||
if (hFile == INVALID_HANDLE_VALUE) {
|
if (hFile == INVALID_HANDLE_VALUE) {
|
||||||
WriteMsg(outFilePath, "error_locking");
|
WriteMsg(outFilePath, "error_locking");
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -363,7 +364,7 @@ int NS_main(int argc, NS_tchar **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(logFP);
|
fclose(logFP);
|
||||||
logFP = NULL;
|
logFP = nullptr;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,8 +27,8 @@
|
||||||
|
|
||||||
static int inbuf_size = 262144;
|
static int inbuf_size = 262144;
|
||||||
static int outbuf_size = 262144;
|
static int outbuf_size = 262144;
|
||||||
static char *inbuf = NULL;
|
static char *inbuf = nullptr;
|
||||||
static char *outbuf = NULL;
|
static char *outbuf = nullptr;
|
||||||
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
@ -46,7 +46,7 @@ static char *outbuf = NULL;
|
||||||
BOOL
|
BOOL
|
||||||
LoadFileInResource(int name, int type, const uint8_t *&data, uint32_t& size)
|
LoadFileInResource(int name, int type, const uint8_t *&data, uint32_t& size)
|
||||||
{
|
{
|
||||||
HMODULE handle = GetModuleHandle(NULL);
|
HMODULE handle = GetModuleHandle(nullptr);
|
||||||
if (!handle) {
|
if (!handle) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ int
|
||||||
VerifyLoadedCert(MarFile *archive, int name, int type)
|
VerifyLoadedCert(MarFile *archive, int name, int type)
|
||||||
{
|
{
|
||||||
uint32_t size = 0;
|
uint32_t size = 0;
|
||||||
const uint8_t *data = NULL;
|
const uint8_t *data = nullptr;
|
||||||
if (!LoadFileInResource(name, type, data, size) || !data || !size) {
|
if (!LoadFileInResource(name, type, data, size) || !data || !size) {
|
||||||
return CERT_LOAD_ERROR;
|
return CERT_LOAD_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -183,7 +183,7 @@ ArchiveReader::VerifyProductInformation(const char *MARChannelID,
|
||||||
rv = OK;
|
rv = OK;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
channel = strtok(NULL, delimiter);
|
channel = strtok(nullptr, delimiter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -253,17 +253,17 @@ ArchiveReader::Close()
|
||||||
{
|
{
|
||||||
if (mArchive) {
|
if (mArchive) {
|
||||||
mar_close(mArchive);
|
mar_close(mArchive);
|
||||||
mArchive = NULL;
|
mArchive = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inbuf) {
|
if (inbuf) {
|
||||||
free(inbuf);
|
free(inbuf);
|
||||||
inbuf = NULL;
|
inbuf = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (outbuf) {
|
if (outbuf) {
|
||||||
free(outbuf);
|
free(outbuf);
|
||||||
outbuf = NULL;
|
outbuf = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#ifndef ArchiveReader_h__
|
#ifndef ArchiveReader_h__
|
||||||
#define ArchiveReader_h__
|
#define ArchiveReader_h__
|
||||||
|
|
||||||
|
#include "mozilla/NullPtr.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "mar.h"
|
#include "mar.h"
|
||||||
|
|
||||||
|
@ -20,7 +21,7 @@
|
||||||
class ArchiveReader
|
class ArchiveReader
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ArchiveReader() : mArchive(NULL) {}
|
ArchiveReader() : mArchive(nullptr) {}
|
||||||
~ArchiveReader() { Close(); }
|
~ArchiveReader() { Close(); }
|
||||||
|
|
||||||
int Open(const NS_tchar *path);
|
int Open(const NS_tchar *path);
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
const char *kGonkMountsPath = "/proc/mounts";
|
const char *kGonkMountsPath = "/proc/mounts";
|
||||||
const char *kGonkSystemPath = "/system";
|
const char *kGonkSystemPath = "/system";
|
||||||
|
|
||||||
GonkAutoMounter::GonkAutoMounter() : mDevice(NULL), mAccess(Unknown)
|
GonkAutoMounter::GonkAutoMounter() : mDevice(nullptr), mAccess(Unknown)
|
||||||
{
|
{
|
||||||
if (!RemountSystem(ReadWrite)) {
|
if (!RemountSystem(ReadWrite)) {
|
||||||
LOGE("Could not remount %s as read-write.", kGonkSystemPath);
|
LOGE("Could not remount %s as read-write.", kGonkSystemPath);
|
||||||
|
@ -58,7 +58,7 @@ GonkAutoMounter::Reboot()
|
||||||
kGonkSystemPath);
|
kGonkSystemPath);
|
||||||
LogFlush();
|
LogFlush();
|
||||||
|
|
||||||
if (android_reboot(ANDROID_RB_RESTART, 0, NULL) != 0) {
|
if (android_reboot(ANDROID_RB_RESTART, 0, nullptr) != 0) {
|
||||||
LOGE("Safe system reboot failed, attempting to force");
|
LOGE("Safe system reboot failed, attempting to force");
|
||||||
LogFlush();
|
LogFlush();
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ GonkAutoMounter::UpdateMountStatus()
|
||||||
{
|
{
|
||||||
FILE *mountsFile = NS_tfopen(kGonkMountsPath, "r");
|
FILE *mountsFile = NS_tfopen(kGonkMountsPath, "r");
|
||||||
|
|
||||||
if (mountsFile == NULL) {
|
if (mountsFile == nullptr) {
|
||||||
LOGE("Error opening %s: %s", kGonkMountsPath, strerror(errno));
|
LOGE("Error opening %s: %s", kGonkMountsPath, strerror(errno));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -143,7 +143,7 @@ GonkAutoMounter::UpdateMountStatus()
|
||||||
|
|
||||||
for (token = strtok_r(mountData, "\n", &tokenContext);
|
for (token = strtok_r(mountData, "\n", &tokenContext);
|
||||||
token;
|
token;
|
||||||
token = strtok_r(NULL, "\n", &tokenContext))
|
token = strtok_r(nullptr, "\n", &tokenContext))
|
||||||
{
|
{
|
||||||
if (ProcessMount(token)) {
|
if (ProcessMount(token)) {
|
||||||
foundSystem = true;
|
foundSystem = true;
|
||||||
|
@ -188,7 +188,7 @@ GonkAutoMounter::ProcessMount(const char *mount)
|
||||||
char *option, *optionContext;
|
char *option, *optionContext;
|
||||||
for (option = strtok_r(mountAccess, ",", &optionContext);
|
for (option = strtok_r(mountAccess, ",", &optionContext);
|
||||||
option;
|
option;
|
||||||
option = strtok_r(NULL, ",", &optionContext))
|
option = strtok_r(nullptr, ",", &optionContext))
|
||||||
{
|
{
|
||||||
if (strcmp("ro", option) == 0) {
|
if (strcmp("ro", option) == 0) {
|
||||||
mAccess = ReadOnly;
|
mAccess = ReadOnly;
|
||||||
|
@ -211,7 +211,7 @@ GonkAutoMounter::MountSystem(unsigned long flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *readOnly = flags & MS_RDONLY ? "read-only" : "read-write";
|
const char *readOnly = flags & MS_RDONLY ? "read-only" : "read-write";
|
||||||
int result = mount(mDevice, kGonkSystemPath, "none", flags, NULL);
|
int result = mount(mDevice, kGonkSystemPath, "none", flags, nullptr);
|
||||||
|
|
||||||
if (result != 0) {
|
if (result != 0) {
|
||||||
LOGE("Error mounting %s as %s: %s", kGonkSystemPath, readOnly,
|
LOGE("Error mounting %s as %s: %s", kGonkSystemPath, readOnly,
|
||||||
|
|
|
@ -36,7 +36,7 @@ struct AutoLoadSystemDependencies
|
||||||
if (systemDirectory[systemDirLen - 1] != L'\\' && systemDirLen) {
|
if (systemDirectory[systemDirLen - 1] != L'\\' && systemDirLen) {
|
||||||
systemDirectory[systemDirLen] = L'\\';
|
systemDirectory[systemDirLen] = L'\\';
|
||||||
++systemDirLen;
|
++systemDirLen;
|
||||||
// No need to re-NULL terminate
|
// No need to re-null terminate
|
||||||
}
|
}
|
||||||
|
|
||||||
// For each known DLL ensure it is loaded from the system32 directory
|
// For each known DLL ensure it is loaded from the system32 directory
|
||||||
|
|
|
@ -86,7 +86,7 @@ ShowProgressUI()
|
||||||
snprintf(icon_path, sizeof(icon_path), "%s.png", sProgramPath);
|
snprintf(icon_path, sizeof(icon_path), "%s.png", sProgramPath);
|
||||||
|
|
||||||
g_signal_connect(G_OBJECT(sWin), "delete_event",
|
g_signal_connect(G_OBJECT(sWin), "delete_event",
|
||||||
G_CALLBACK(OnDeleteEvent), NULL);
|
G_CALLBACK(OnDeleteEvent), nullptr);
|
||||||
|
|
||||||
gtk_window_set_title(GTK_WINDOW(sWin), strings.title);
|
gtk_window_set_title(GTK_WINDOW(sWin), strings.title);
|
||||||
gtk_window_set_type_hint(GTK_WINDOW(sWin), GDK_WINDOW_TYPE_HINT_DIALOG);
|
gtk_window_set_type_hint(GTK_WINDOW(sWin), GDK_WINDOW_TYPE_HINT_DIALOG);
|
||||||
|
@ -94,7 +94,7 @@ ShowProgressUI()
|
||||||
gtk_window_set_resizable(GTK_WINDOW(sWin), FALSE);
|
gtk_window_set_resizable(GTK_WINDOW(sWin), FALSE);
|
||||||
gtk_window_set_decorated(GTK_WINDOW(sWin), TRUE);
|
gtk_window_set_decorated(GTK_WINDOW(sWin), TRUE);
|
||||||
gtk_window_set_deletable(GTK_WINDOW(sWin),FALSE);
|
gtk_window_set_deletable(GTK_WINDOW(sWin),FALSE);
|
||||||
pixbuf = gdk_pixbuf_new_from_file (icon_path, NULL);
|
pixbuf = gdk_pixbuf_new_from_file (icon_path, nullptr);
|
||||||
gtk_window_set_icon(GTK_WINDOW(sWin), pixbuf);
|
gtk_window_set_icon(GTK_WINDOW(sWin), pixbuf);
|
||||||
g_object_unref(pixbuf);
|
g_object_unref(pixbuf);
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ ShowProgressUI()
|
||||||
gtk_box_pack_start(GTK_BOX(vbox), sLabel, FALSE, FALSE, 0);
|
gtk_box_pack_start(GTK_BOX(vbox), sLabel, FALSE, FALSE, 0);
|
||||||
gtk_box_pack_start(GTK_BOX(vbox), sProgressBar, TRUE, TRUE, 0);
|
gtk_box_pack_start(GTK_BOX(vbox), sProgressBar, TRUE, TRUE, 0);
|
||||||
|
|
||||||
sTimerID = g_timeout_add(TIMER_INTERVAL, UpdateDialog, NULL);
|
sTimerID = g_timeout_add(TIMER_INTERVAL, UpdateDialog, nullptr);
|
||||||
|
|
||||||
gtk_container_set_border_width(GTK_CONTAINER(sWin), 10);
|
gtk_container_set_border_width(GTK_CONTAINER(sWin), 10);
|
||||||
gtk_container_add(GTK_CONTAINER(sWin), vbox);
|
gtk_container_add(GTK_CONTAINER(sWin), vbox);
|
||||||
|
|
|
@ -47,7 +47,7 @@ static StringTable sUIStrings;
|
||||||
static BOOL
|
static BOOL
|
||||||
GetStringsFile(WCHAR filename[MAX_PATH])
|
GetStringsFile(WCHAR filename[MAX_PATH])
|
||||||
{
|
{
|
||||||
if (!GetModuleFileNameW(NULL, filename, MAX_PATH))
|
if (!GetModuleFileNameW(nullptr, filename, MAX_PATH))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
WCHAR *dot = wcsrchr(filename, '.');
|
WCHAR *dot = wcsrchr(filename, '.');
|
||||||
|
@ -115,7 +115,8 @@ InitDialog(HWND hDlg)
|
||||||
SetWindowTextW(GetDlgItem(hDlg, IDC_INFO), szwInfo);
|
SetWindowTextW(GetDlgItem(hDlg, IDC_INFO), szwInfo);
|
||||||
|
|
||||||
// Set dialog icon
|
// Set dialog icon
|
||||||
HICON hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_DIALOG));
|
HICON hIcon = LoadIcon(GetModuleHandle(nullptr),
|
||||||
|
MAKEINTRESOURCE(IDI_DIALOG));
|
||||||
if (hIcon)
|
if (hIcon)
|
||||||
SendMessage(hDlg, WM_SETICON, ICON_BIG, (LPARAM) hIcon);
|
SendMessage(hDlg, WM_SETICON, ICON_BIG, (LPARAM) hIcon);
|
||||||
|
|
||||||
|
@ -171,7 +172,7 @@ InitDialog(HWND hDlg)
|
||||||
|
|
||||||
CenterDialog(hDlg); // make dialog appear in the center of the screen
|
CenterDialog(hDlg); // make dialog appear in the center of the screen
|
||||||
|
|
||||||
SetTimer(hDlg, TIMER_ID, TIMER_INTERVAL, NULL);
|
SetTimer(hDlg, TIMER_ID, TIMER_INTERVAL, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Message handler for update dialog.
|
// Message handler for update dialog.
|
||||||
|
@ -254,8 +255,8 @@ ShowProgressUI(bool indeterminate, bool initUIStrings)
|
||||||
};
|
};
|
||||||
InitCommonControlsEx(&icc);
|
InitCommonControlsEx(&icc);
|
||||||
|
|
||||||
DialogBox(GetModuleHandle(NULL),
|
DialogBox(GetModuleHandle(nullptr),
|
||||||
MAKEINTRESOURCE(IDD_DIALOG), NULL,
|
MAKEINTRESOURCE(IDD_DIALOG), nullptr,
|
||||||
(DLGPROC) DialogProc);
|
(DLGPROC) DialogProc);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -161,12 +161,12 @@ crc32(const unsigned char *buf, unsigned int len)
|
||||||
class AutoFile
|
class AutoFile
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AutoFile(FILE* file = NULL)
|
AutoFile(FILE* file = nullptr)
|
||||||
: mFile(file) {
|
: mFile(file) {
|
||||||
}
|
}
|
||||||
|
|
||||||
~AutoFile() {
|
~AutoFile() {
|
||||||
if (mFile != NULL)
|
if (mFile != nullptr)
|
||||||
fclose(mFile);
|
fclose(mFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -215,7 +215,8 @@ public:
|
||||||
|
|
||||||
unsigned int threadID;
|
unsigned int threadID;
|
||||||
|
|
||||||
mThread = (HANDLE) _beginthreadex(NULL, 0, ThreadMain, this, 0, &threadID);
|
mThread = (HANDLE) _beginthreadex(nullptr, 0, ThreadMain, this, 0,
|
||||||
|
&threadID);
|
||||||
|
|
||||||
return mThread ? 0 : -1;
|
return mThread ? 0 : -1;
|
||||||
}
|
}
|
||||||
|
@ -245,7 +246,7 @@ class Thread
|
||||||
public:
|
public:
|
||||||
int Run(ThreadFunc func, void *param)
|
int Run(ThreadFunc func, void *param)
|
||||||
{
|
{
|
||||||
return pthread_create(&thr, NULL, (void* (*)(void *)) func, param);
|
return pthread_create(&thr, nullptr, (void* (*)(void *)) func, param);
|
||||||
}
|
}
|
||||||
int Join()
|
int Join()
|
||||||
{
|
{
|
||||||
|
@ -266,7 +267,7 @@ public:
|
||||||
mThreadFunc = func;
|
mThreadFunc = func;
|
||||||
mThreadParam = param;
|
mThreadParam = param;
|
||||||
|
|
||||||
mThread = _beginthread(ThreadMain, NULL, 16384, (void *)this);
|
mThread = _beginthread(ThreadMain, nullptr, 16384, (void *)this);
|
||||||
|
|
||||||
return mThread ? 0 : -1;
|
return mThread ? 0 : -1;
|
||||||
}
|
}
|
||||||
|
@ -323,7 +324,7 @@ static NS_tchar*
|
||||||
mstrtok(const NS_tchar *delims, NS_tchar **str)
|
mstrtok(const NS_tchar *delims, NS_tchar **str)
|
||||||
{
|
{
|
||||||
if (!*str || !**str)
|
if (!*str || !**str)
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
// skip leading "whitespace"
|
// skip leading "whitespace"
|
||||||
NS_tchar *ret = *str;
|
NS_tchar *ret = *str;
|
||||||
|
@ -339,7 +340,7 @@ mstrtok(const NS_tchar *delims, NS_tchar **str)
|
||||||
|
|
||||||
if (!*ret) {
|
if (!*ret) {
|
||||||
*str = ret;
|
*str = ret;
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_tchar *i = ret;
|
NS_tchar *i = ret;
|
||||||
|
@ -354,7 +355,7 @@ mstrtok(const NS_tchar *delims, NS_tchar **str)
|
||||||
++i;
|
++i;
|
||||||
} while (*i);
|
} while (*i);
|
||||||
|
|
||||||
*str = NULL;
|
*str = nullptr;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -364,7 +365,7 @@ mstrtok(const NS_tchar *delims, NS_tchar **str)
|
||||||
*
|
*
|
||||||
* @param relpath
|
* @param relpath
|
||||||
* The relative path to convert to a full path.
|
* The relative path to convert to a full path.
|
||||||
* @return valid filesystem full path or NULL memory allocation fails.
|
* @return valid filesystem full path or nullptr if memory allocation fails.
|
||||||
*/
|
*/
|
||||||
static NS_tchar*
|
static NS_tchar*
|
||||||
get_full_path(const NS_tchar *relpath)
|
get_full_path(const NS_tchar *relpath)
|
||||||
|
@ -373,7 +374,7 @@ get_full_path(const NS_tchar *relpath)
|
||||||
size_t lenrelpath = NS_tstrlen(relpath);
|
size_t lenrelpath = NS_tstrlen(relpath);
|
||||||
NS_tchar *s = (NS_tchar *) malloc((lendestpath + lenrelpath + 1) * sizeof(NS_tchar));
|
NS_tchar *s = (NS_tchar *) malloc((lendestpath + lenrelpath + 1) * sizeof(NS_tchar));
|
||||||
if (!s)
|
if (!s)
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
NS_tchar *c = s;
|
NS_tchar *c = s;
|
||||||
|
|
||||||
|
@ -389,13 +390,13 @@ get_full_path(const NS_tchar *relpath)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the platform specific path and performs simple checks to the path. If
|
* Gets the platform specific path and performs simple checks to the path. If
|
||||||
* the path checks don't pass NULL will be returned.
|
* the path checks don't pass nullptr will be returned.
|
||||||
*
|
*
|
||||||
* @param line
|
* @param line
|
||||||
* The line from the manifest that contains the path.
|
* The line from the manifest that contains the path.
|
||||||
* @param isdir
|
* @param isdir
|
||||||
* Whether the path is a directory path. Defaults to false.
|
* Whether the path is a directory path. Defaults to false.
|
||||||
* @return valid filesystem path or NULL if the path checks fail.
|
* @return valid filesystem path or nullptr if the path checks fail.
|
||||||
*/
|
*/
|
||||||
static NS_tchar*
|
static NS_tchar*
|
||||||
get_valid_path(NS_tchar **line, bool isdir = false)
|
get_valid_path(NS_tchar **line, bool isdir = false)
|
||||||
|
@ -403,20 +404,20 @@ get_valid_path(NS_tchar **line, bool isdir = false)
|
||||||
NS_tchar *path = mstrtok(kQuote, line);
|
NS_tchar *path = mstrtok(kQuote, line);
|
||||||
if (!path) {
|
if (!path) {
|
||||||
LOG(("get_valid_path: unable to determine path: " LOG_S, line));
|
LOG(("get_valid_path: unable to determine path: " LOG_S, line));
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// All paths must be relative from the current working directory
|
// All paths must be relative from the current working directory
|
||||||
if (path[0] == NS_T('/')) {
|
if (path[0] == NS_T('/')) {
|
||||||
LOG(("get_valid_path: path must be relative: " LOG_S, path));
|
LOG(("get_valid_path: path must be relative: " LOG_S, path));
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
// All paths must be relative from the current working directory
|
// All paths must be relative from the current working directory
|
||||||
if (path[0] == NS_T('\\') || path[1] == NS_T(':')) {
|
if (path[0] == NS_T('\\') || path[1] == NS_T(':')) {
|
||||||
LOG(("get_valid_path: path must be relative: " LOG_S, path));
|
LOG(("get_valid_path: path must be relative: " LOG_S, path));
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -425,7 +426,7 @@ get_valid_path(NS_tchar **line, bool isdir = false)
|
||||||
if (path[NS_tstrlen(path) - 1] != NS_T('/')) {
|
if (path[NS_tstrlen(path) - 1] != NS_T('/')) {
|
||||||
LOG(("get_valid_path: directory paths must have a trailing forward " \
|
LOG(("get_valid_path: directory paths must have a trailing forward " \
|
||||||
"slash: " LOG_S, path));
|
"slash: " LOG_S, path));
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove the trailing forward slash because stat on Windows will return
|
// Remove the trailing forward slash because stat on Windows will return
|
||||||
|
@ -434,9 +435,9 @@ get_valid_path(NS_tchar **line, bool isdir = false)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't allow relative paths that resolve to a parent directory.
|
// Don't allow relative paths that resolve to a parent directory.
|
||||||
if (NS_tstrstr(path, NS_T("..")) != NULL) {
|
if (NS_tstrstr(path, NS_T("..")) != nullptr) {
|
||||||
LOG(("get_valid_path: paths must not contain '..': " LOG_S, path));
|
LOG(("get_valid_path: paths must not contain '..': " LOG_S, path));
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return path;
|
return path;
|
||||||
|
@ -451,7 +452,7 @@ get_quoted_path(const NS_tchar *path)
|
||||||
|
|
||||||
NS_tchar *s = (NS_tchar *) malloc(len * sizeof(NS_tchar));
|
NS_tchar *s = (NS_tchar *) malloc(len * sizeof(NS_tchar));
|
||||||
if (!s)
|
if (!s)
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
NS_tchar *c = s;
|
NS_tchar *c = s;
|
||||||
NS_tstrcpy(c, kQuote);
|
NS_tstrcpy(c, kQuote);
|
||||||
|
@ -569,17 +570,17 @@ static FILE* ensure_open(const NS_tchar *path, const NS_tchar *flags, unsigned i
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
if (NS_tchmod(path, options) != 0) {
|
if (NS_tchmod(path, options) != 0) {
|
||||||
if (f != NULL) {
|
if (f != nullptr) {
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
struct stat ss;
|
struct stat ss;
|
||||||
if (NS_tstat(path, &ss) != 0 || ss.st_mode != options) {
|
if (NS_tstat(path, &ss) != 0 || ss.st_mode != options) {
|
||||||
if (f != NULL) {
|
if (f != nullptr) {
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
@ -919,7 +920,7 @@ static int backup_discard(const NS_tchar *path)
|
||||||
// but this is ok since the installer / uninstaller will delete the
|
// but this is ok since the installer / uninstaller will delete the
|
||||||
// directory containing the file along with its contents after an update is
|
// directory containing the file along with its contents after an update is
|
||||||
// applied, on reinstall, and on uninstall.
|
// applied, on reinstall, and on uninstall.
|
||||||
if (MoveFileEx(path, NULL, MOVEFILE_DELAY_UNTIL_REBOOT)) {
|
if (MoveFileEx(path, nullptr, MOVEFILE_DELAY_UNTIL_REBOOT)) {
|
||||||
LOG(("backup_discard: file renamed and will be removed on OS " \
|
LOG(("backup_discard: file renamed and will be removed on OS " \
|
||||||
"reboot: " LOG_S, path));
|
"reboot: " LOG_S, path));
|
||||||
} else {
|
} else {
|
||||||
|
@ -951,7 +952,7 @@ static int DoUpdate();
|
||||||
class Action
|
class Action
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
Action() : mProgressCost(1), mNext(NULL) { }
|
Action() : mProgressCost(1), mNext(nullptr) { }
|
||||||
virtual ~Action() { }
|
virtual ~Action() { }
|
||||||
|
|
||||||
virtual int Parse(NS_tchar *line) = 0;
|
virtual int Parse(NS_tchar *line) = 0;
|
||||||
|
@ -979,7 +980,7 @@ private:
|
||||||
class RemoveFile : public Action
|
class RemoveFile : public Action
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RemoveFile() : mFile(NULL), mSkip(0) { }
|
RemoveFile() : mFile(nullptr), mSkip(0) { }
|
||||||
|
|
||||||
int Parse(NS_tchar *line);
|
int Parse(NS_tchar *line);
|
||||||
int Prepare();
|
int Prepare();
|
||||||
|
@ -1088,7 +1089,7 @@ RemoveFile::Finish(int status)
|
||||||
class RemoveDir : public Action
|
class RemoveDir : public Action
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
RemoveDir() : mDir(NULL), mSkip(0) { }
|
RemoveDir() : mDir(nullptr), mSkip(0) { }
|
||||||
|
|
||||||
virtual int Parse(NS_tchar *line);
|
virtual int Parse(NS_tchar *line);
|
||||||
virtual int Prepare(); // check that the source dir exists
|
virtual int Prepare(); // check that the source dir exists
|
||||||
|
@ -1195,7 +1196,7 @@ RemoveDir::Finish(int status)
|
||||||
class AddFile : public Action
|
class AddFile : public Action
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AddFile() : mFile(NULL)
|
AddFile() : mFile(nullptr)
|
||||||
, mAdded(false)
|
, mAdded(false)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
@ -1251,7 +1252,7 @@ AddFile::Execute()
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
char sourcefile[MAXPATHLEN];
|
char sourcefile[MAXPATHLEN];
|
||||||
if (!WideCharToMultiByte(CP_UTF8, 0, mFile, -1, sourcefile, MAXPATHLEN,
|
if (!WideCharToMultiByte(CP_UTF8, 0, mFile, -1, sourcefile, MAXPATHLEN,
|
||||||
NULL, NULL)) {
|
nullptr, nullptr)) {
|
||||||
LOG(("error converting wchar to utf8: %d", GetLastError()));
|
LOG(("error converting wchar to utf8: %d", GetLastError()));
|
||||||
return STRING_CONVERSION_ERROR;
|
return STRING_CONVERSION_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -1280,7 +1281,7 @@ AddFile::Finish(int status)
|
||||||
class PatchFile : public Action
|
class PatchFile : public Action
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PatchFile() : mPatchIndex(-1), buf(NULL) { }
|
PatchFile() : mPatchIndex(-1), buf(nullptr) { }
|
||||||
|
|
||||||
virtual ~PatchFile();
|
virtual ~PatchFile();
|
||||||
|
|
||||||
|
@ -1405,7 +1406,7 @@ PatchFile::Prepare()
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
char sourcefile[MAXPATHLEN];
|
char sourcefile[MAXPATHLEN];
|
||||||
if (!WideCharToMultiByte(CP_UTF8, 0, mPatchFile, -1, sourcefile, MAXPATHLEN,
|
if (!WideCharToMultiByte(CP_UTF8, 0, mPatchFile, -1, sourcefile, MAXPATHLEN,
|
||||||
NULL, NULL)) {
|
nullptr, nullptr)) {
|
||||||
LOG(("error converting wchar to utf8: %d", GetLastError()));
|
LOG(("error converting wchar to utf8: %d", GetLastError()));
|
||||||
return STRING_CONVERSION_ERROR;
|
return STRING_CONVERSION_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -1424,14 +1425,14 @@ PatchFile::Execute()
|
||||||
LOG(("EXECUTE PATCH " LOG_S, mFile));
|
LOG(("EXECUTE PATCH " LOG_S, mFile));
|
||||||
|
|
||||||
AutoFile pfile = NS_tfopen(spath, NS_T("rb"));
|
AutoFile pfile = NS_tfopen(spath, NS_T("rb"));
|
||||||
if (pfile == NULL)
|
if (pfile == nullptr)
|
||||||
return READ_ERROR;
|
return READ_ERROR;
|
||||||
|
|
||||||
int rv = MBS_ReadHeader(pfile, &header);
|
int rv = MBS_ReadHeader(pfile, &header);
|
||||||
if (rv)
|
if (rv)
|
||||||
return rv;
|
return rv;
|
||||||
|
|
||||||
FILE *origfile = NULL;
|
FILE *origfile = nullptr;
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
if (NS_tstrcmp(mFile, gCallbackRelPath) == 0) {
|
if (NS_tstrcmp(mFile, gCallbackRelPath) == 0) {
|
||||||
// Read from the copy of the callback when patching since the callback can't
|
// Read from the copy of the callback when patching since the callback can't
|
||||||
|
@ -1486,13 +1487,14 @@ PatchFile::Execute()
|
||||||
HANDLE hfile = CreateFileW(mFile,
|
HANDLE hfile = CreateFileW(mFile,
|
||||||
GENERIC_WRITE,
|
GENERIC_WRITE,
|
||||||
0,
|
0,
|
||||||
NULL,
|
nullptr,
|
||||||
CREATE_ALWAYS,
|
CREATE_ALWAYS,
|
||||||
FILE_ATTRIBUTE_NORMAL,
|
FILE_ATTRIBUTE_NORMAL,
|
||||||
NULL);
|
nullptr);
|
||||||
|
|
||||||
if (hfile != INVALID_HANDLE_VALUE) {
|
if (hfile != INVALID_HANDLE_VALUE) {
|
||||||
if (SetFilePointer(hfile, header.dlen, NULL, FILE_BEGIN) != INVALID_SET_FILE_POINTER &&
|
if (SetFilePointer(hfile, header.dlen,
|
||||||
|
nullptr, FILE_BEGIN) != INVALID_SET_FILE_POINTER &&
|
||||||
SetEndOfFile(hfile) != 0) {
|
SetEndOfFile(hfile) != 0) {
|
||||||
shouldTruncate = false;
|
shouldTruncate = false;
|
||||||
}
|
}
|
||||||
|
@ -1519,7 +1521,7 @@ PatchFile::Execute()
|
||||||
AutoFile ofile = ensure_open(mFile, NS_T("wb+"), ss.st_mode);
|
AutoFile ofile = ensure_open(mFile, NS_T("wb+"), ss.st_mode);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (ofile == NULL) {
|
if (ofile == nullptr) {
|
||||||
LOG(("unable to create new file: " LOG_S ", err: %d", mFile, errno));
|
LOG(("unable to create new file: " LOG_S ", err: %d", mFile, errno));
|
||||||
return WRITE_ERROR;
|
return WRITE_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -1533,13 +1535,13 @@ PatchFile::Execute()
|
||||||
rv = MBS_ApplyPatch(&header, pfile, buf, ofile);
|
rv = MBS_ApplyPatch(&header, pfile, buf, ofile);
|
||||||
|
|
||||||
// Go ahead and do a bit of cleanup now to minimize runtime overhead.
|
// Go ahead and do a bit of cleanup now to minimize runtime overhead.
|
||||||
// Set pfile to NULL to make AutoFile close the file so it can be deleted on
|
// Set pfile to nullptr to make AutoFile close the file so it can be deleted
|
||||||
// Windows.
|
// on Windows.
|
||||||
pfile = NULL;
|
pfile = nullptr;
|
||||||
NS_tremove(spath);
|
NS_tremove(spath);
|
||||||
spath[0] = NS_T('\0');
|
spath[0] = NS_T('\0');
|
||||||
free(buf);
|
free(buf);
|
||||||
buf = NULL;
|
buf = nullptr;
|
||||||
|
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
|
@ -1555,7 +1557,7 @@ PatchFile::Finish(int status)
|
||||||
class AddIfFile : public AddFile
|
class AddIfFile : public AddFile
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
AddIfFile() : mTestFile(NULL) { }
|
AddIfFile() : mTestFile(nullptr) { }
|
||||||
|
|
||||||
virtual int Parse(NS_tchar *line);
|
virtual int Parse(NS_tchar *line);
|
||||||
virtual int Prepare();
|
virtual int Prepare();
|
||||||
|
@ -1588,7 +1590,7 @@ AddIfFile::Prepare()
|
||||||
{
|
{
|
||||||
// If the test file does not exist, then skip this action.
|
// If the test file does not exist, then skip this action.
|
||||||
if (NS_taccess(mTestFile, F_OK)) {
|
if (NS_taccess(mTestFile, F_OK)) {
|
||||||
mTestFile = NULL;
|
mTestFile = nullptr;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1616,7 +1618,7 @@ AddIfFile::Finish(int status)
|
||||||
class PatchIfFile : public PatchFile
|
class PatchIfFile : public PatchFile
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PatchIfFile() : mTestFile(NULL) { }
|
PatchIfFile() : mTestFile(nullptr) { }
|
||||||
|
|
||||||
virtual int Parse(NS_tchar *line);
|
virtual int Parse(NS_tchar *line);
|
||||||
virtual int Prepare(); // should check for patch file and for checksum here
|
virtual int Prepare(); // should check for patch file and for checksum here
|
||||||
|
@ -1649,7 +1651,7 @@ PatchIfFile::Prepare()
|
||||||
{
|
{
|
||||||
// If the test file does not exist, then skip this action.
|
// If the test file does not exist, then skip this action.
|
||||||
if (NS_taccess(mTestFile, F_OK)) {
|
if (NS_taccess(mTestFile, F_OK)) {
|
||||||
mTestFile = NULL;
|
mTestFile = nullptr;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1732,7 +1734,7 @@ LaunchCallbackApp(const NS_tchar *workingDir,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
WinLaunchChild(argv[0], argc, argv, NULL);
|
WinLaunchChild(argv[0], argc, argv, nullptr);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
# warning "Need implementaton of LaunchCallbackApp"
|
# warning "Need implementaton of LaunchCallbackApp"
|
||||||
|
@ -1751,7 +1753,7 @@ WriteStatusFile(const char* aStatus)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
AutoFile file = NS_tfopen(filename, NS_T("wb+"));
|
AutoFile file = NS_tfopen(filename, NS_T("wb+"));
|
||||||
if (file == NULL)
|
if (file == nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (fwrite(aStatus, strlen(aStatus), 1, file) != 1)
|
if (fwrite(aStatus, strlen(aStatus), 1, file) != 1)
|
||||||
|
@ -1798,7 +1800,7 @@ IsUpdateStatusPendingService()
|
||||||
NS_T("%s/update.status"), gSourcePath);
|
NS_T("%s/update.status"), gSourcePath);
|
||||||
|
|
||||||
AutoFile file = NS_tfopen(filename, NS_T("rb"));
|
AutoFile file = NS_tfopen(filename, NS_T("rb"));
|
||||||
if (file == NULL)
|
if (file == nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
char buf[32] = { 0 };
|
char buf[32] = { 0 };
|
||||||
|
@ -1832,7 +1834,7 @@ IsUpdateStatusSucceeded(bool &isSucceeded)
|
||||||
NS_T("%s/update.status"), gSourcePath);
|
NS_T("%s/update.status"), gSourcePath);
|
||||||
|
|
||||||
AutoFile file = NS_tfopen(filename, NS_T("rb"));
|
AutoFile file = NS_tfopen(filename, NS_T("rb"));
|
||||||
if (file == NULL)
|
if (file == nullptr)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
char buf[32] = { 0 };
|
char buf[32] = { 0 };
|
||||||
|
@ -2011,7 +2013,7 @@ ProcessReplaceRequest()
|
||||||
if (rv) {
|
if (rv) {
|
||||||
LOG(("Removing tmpDir failed, err: %d", rv));
|
LOG(("Removing tmpDir failed, err: %d", rv));
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
if (MoveFileExW(tmpDir, NULL, MOVEFILE_DELAY_UNTIL_REBOOT)) {
|
if (MoveFileExW(tmpDir, nullptr, MOVEFILE_DELAY_UNTIL_REBOOT)) {
|
||||||
LOG(("tmpDir will be removed on OS reboot: " LOG_S, tmpDir));
|
LOG(("tmpDir will be removed on OS reboot: " LOG_S, tmpDir));
|
||||||
} else {
|
} else {
|
||||||
LOG(("Failed to schedule OS reboot removal of directory: " LOG_S,
|
LOG(("Failed to schedule OS reboot removal of directory: " LOG_S,
|
||||||
|
@ -2144,7 +2146,7 @@ GetUpdateFileName(NS_tchar *fileName, int maxChars)
|
||||||
NS_tsnprintf(linkFileName, sizeof(linkFileName)/sizeof(linkFileName[0]),
|
NS_tsnprintf(linkFileName, sizeof(linkFileName)/sizeof(linkFileName[0]),
|
||||||
NS_T("%s/update.link"), gSourcePath);
|
NS_T("%s/update.link"), gSourcePath);
|
||||||
AutoFile linkFile = NS_tfopen(linkFileName, NS_T("rb"));
|
AutoFile linkFile = NS_tfopen(linkFileName, NS_T("rb"));
|
||||||
if (linkFile == NULL) {
|
if (linkFile == nullptr) {
|
||||||
NS_tsnprintf(fileName, maxChars,
|
NS_tsnprintf(fileName, maxChars,
|
||||||
NS_T("%s/update.mar"), gSourcePath);
|
NS_T("%s/update.mar"), gSourcePath);
|
||||||
return OK;
|
return OK;
|
||||||
|
@ -2275,9 +2277,9 @@ UpdateThreadFunc(void *param)
|
||||||
// on the top-level Mac OS X bundle directory so that Mac OS X's
|
// on the top-level Mac OS X bundle directory so that Mac OS X's
|
||||||
// Launch Services picks up any major changes. Here we assume that
|
// Launch Services picks up any major changes. Here we assume that
|
||||||
// the current working directory is the top-level bundle directory.
|
// the current working directory is the top-level bundle directory.
|
||||||
char* cwd = getcwd(NULL, 0);
|
char* cwd = getcwd(nullptr, 0);
|
||||||
if (cwd) {
|
if (cwd) {
|
||||||
if (utimes(cwd, NULL) != 0) {
|
if (utimes(cwd, nullptr) != 0) {
|
||||||
LOG(("Couldn't set access/modification time on application bundle."));
|
LOG(("Couldn't set access/modification time on application bundle."));
|
||||||
}
|
}
|
||||||
free(cwd);
|
free(cwd);
|
||||||
|
@ -2351,7 +2353,7 @@ int NS_main(int argc, NS_tchar **argv)
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
bool useService = false;
|
bool useService = false;
|
||||||
bool testOnlyFallbackKeyExists = false;
|
bool testOnlyFallbackKeyExists = false;
|
||||||
bool noServiceFallback = getenv("MOZ_NO_SERVICE_FALLBACK") != NULL;
|
bool noServiceFallback = getenv("MOZ_NO_SERVICE_FALLBACK") != nullptr;
|
||||||
putenv(const_cast<char*>("MOZ_NO_SERVICE_FALLBACK="));
|
putenv(const_cast<char*>("MOZ_NO_SERVICE_FALLBACK="));
|
||||||
|
|
||||||
// We never want the service to be used unless we build with
|
// We never want the service to be used unless we build with
|
||||||
|
@ -2368,13 +2370,13 @@ int NS_main(int argc, NS_tchar **argv)
|
||||||
{
|
{
|
||||||
HKEY hkApp;
|
HKEY hkApp;
|
||||||
RegCreateKeyExW(HKEY_CURRENT_USER, L"Software\\Classes\\Applications",
|
RegCreateKeyExW(HKEY_CURRENT_USER, L"Software\\Classes\\Applications",
|
||||||
0, NULL, REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, NULL,
|
0, nullptr, REG_OPTION_NON_VOLATILE, KEY_SET_VALUE, nullptr,
|
||||||
&hkApp, NULL);
|
&hkApp, nullptr);
|
||||||
RegCloseKey(hkApp);
|
RegCloseKey(hkApp);
|
||||||
if (RegCreateKeyExW(HKEY_CURRENT_USER,
|
if (RegCreateKeyExW(HKEY_CURRENT_USER,
|
||||||
L"Software\\Classes\\Applications\\updater.exe",
|
L"Software\\Classes\\Applications\\updater.exe",
|
||||||
0, NULL, REG_OPTION_VOLATILE, KEY_SET_VALUE, NULL,
|
0, nullptr, REG_OPTION_VOLATILE, KEY_SET_VALUE, nullptr,
|
||||||
&hkApp, NULL) == ERROR_SUCCESS) {
|
&hkApp, nullptr) == ERROR_SUCCESS) {
|
||||||
RegSetValueExW(hkApp, L"IsHostApp", 0, REG_NONE, 0, 0);
|
RegSetValueExW(hkApp, L"IsHostApp", 0, REG_NONE, 0, 0);
|
||||||
RegSetValueExW(hkApp, L"NoOpenWith", 0, REG_NONE, 0, 0);
|
RegSetValueExW(hkApp, L"NoOpenWith", 0, REG_NONE, 0, 0);
|
||||||
RegSetValueExW(hkApp, L"NoStartPage", 0, REG_NONE, 0, 0);
|
RegSetValueExW(hkApp, L"NoStartPage", 0, REG_NONE, 0, 0);
|
||||||
|
@ -2481,7 +2483,7 @@ int NS_main(int argc, NS_tchar **argv)
|
||||||
#ifdef XP_WIN
|
#ifdef XP_WIN
|
||||||
if (pid > 0) {
|
if (pid > 0) {
|
||||||
HANDLE parent = OpenProcess(SYNCHRONIZE, false, (DWORD) pid);
|
HANDLE parent = OpenProcess(SYNCHRONIZE, false, (DWORD) pid);
|
||||||
// May return NULL if the parent process has already gone away.
|
// May return nullptr if the parent process has already gone away.
|
||||||
// Otherwise, wait for the parent process to exit before starting the
|
// Otherwise, wait for the parent process to exit before starting the
|
||||||
// update.
|
// update.
|
||||||
if (parent) {
|
if (parent) {
|
||||||
|
@ -2499,7 +2501,7 @@ int NS_main(int argc, NS_tchar **argv)
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (pid > 0)
|
if (pid > 0)
|
||||||
waitpid(pid, NULL, 0);
|
waitpid(pid, nullptr, 0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (sReplaceRequest) {
|
if (sReplaceRequest) {
|
||||||
|
@ -2519,7 +2521,7 @@ int NS_main(int argc, NS_tchar **argv)
|
||||||
const int callbackIndex = 5;
|
const int callbackIndex = 5;
|
||||||
|
|
||||||
#if defined(XP_WIN)
|
#if defined(XP_WIN)
|
||||||
sUsingService = getenv("MOZ_USING_SERVICE") != NULL;
|
sUsingService = getenv("MOZ_USING_SERVICE") != nullptr;
|
||||||
putenv(const_cast<char*>("MOZ_USING_SERVICE="));
|
putenv(const_cast<char*>("MOZ_USING_SERVICE="));
|
||||||
// lastFallbackError keeps track of the last error for the service not being
|
// lastFallbackError keeps track of the last error for the service not being
|
||||||
// used, in case of an error when fallback is not enabled we write the
|
// used, in case of an error when fallback is not enabled we write the
|
||||||
|
@ -2580,10 +2582,10 @@ int NS_main(int argc, NS_tchar **argv)
|
||||||
updateLockFileHandle = CreateFileW(updateLockFilePath,
|
updateLockFileHandle = CreateFileW(updateLockFilePath,
|
||||||
GENERIC_READ | GENERIC_WRITE,
|
GENERIC_READ | GENERIC_WRITE,
|
||||||
0,
|
0,
|
||||||
NULL,
|
nullptr,
|
||||||
OPEN_ALWAYS,
|
OPEN_ALWAYS,
|
||||||
FILE_FLAG_DELETE_ON_CLOSE,
|
FILE_FLAG_DELETE_ON_CLOSE,
|
||||||
NULL);
|
nullptr);
|
||||||
|
|
||||||
NS_tsnprintf(elevatedLockFilePath,
|
NS_tsnprintf(elevatedLockFilePath,
|
||||||
sizeof(elevatedLockFilePath)/sizeof(elevatedLockFilePath[0]),
|
sizeof(elevatedLockFilePath)/sizeof(elevatedLockFilePath[0]),
|
||||||
|
@ -2603,7 +2605,7 @@ int NS_main(int argc, NS_tchar **argv)
|
||||||
if(startedFromUnelevatedUpdater) {
|
if(startedFromUnelevatedUpdater) {
|
||||||
// Disable every privilege we don't need. Processes started using
|
// Disable every privilege we don't need. Processes started using
|
||||||
// CreateProcess will use the same token as this process.
|
// CreateProcess will use the same token as this process.
|
||||||
UACHelper::DisablePrivileges(NULL);
|
UACHelper::DisablePrivileges(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (updateLockFileHandle == INVALID_HANDLE_VALUE ||
|
if (updateLockFileHandle == INVALID_HANDLE_VALUE ||
|
||||||
|
@ -2618,10 +2620,10 @@ int NS_main(int argc, NS_tchar **argv)
|
||||||
elevatedFileHandle = CreateFileW(elevatedLockFilePath,
|
elevatedFileHandle = CreateFileW(elevatedLockFilePath,
|
||||||
GENERIC_READ | GENERIC_WRITE,
|
GENERIC_READ | GENERIC_WRITE,
|
||||||
0,
|
0,
|
||||||
NULL,
|
nullptr,
|
||||||
OPEN_ALWAYS,
|
OPEN_ALWAYS,
|
||||||
FILE_FLAG_DELETE_ON_CLOSE,
|
FILE_FLAG_DELETE_ON_CLOSE,
|
||||||
NULL);
|
nullptr);
|
||||||
|
|
||||||
if (elevatedFileHandle == INVALID_HANDLE_VALUE) {
|
if (elevatedFileHandle == INVALID_HANDLE_VALUE) {
|
||||||
LOG(("Unable to create elevated lock file! Exiting"));
|
LOG(("Unable to create elevated lock file! Exiting"));
|
||||||
|
@ -2712,7 +2714,7 @@ int NS_main(int argc, NS_tchar **argv)
|
||||||
DWORD lastState = WaitForServiceStop(SVC_NAME, 5);
|
DWORD lastState = WaitForServiceStop(SVC_NAME, 5);
|
||||||
if (lastState != SERVICE_STOPPED) {
|
if (lastState != SERVICE_STOPPED) {
|
||||||
Thread t1;
|
Thread t1;
|
||||||
if (t1.Run(WaitForServiceFinishThread, NULL) == 0 &&
|
if (t1.Run(WaitForServiceFinishThread, nullptr) == 0 &&
|
||||||
showProgressUI) {
|
showProgressUI) {
|
||||||
ShowProgressUI(true, false);
|
ShowProgressUI(true, false);
|
||||||
}
|
}
|
||||||
|
@ -2755,7 +2757,7 @@ int NS_main(int argc, NS_tchar **argv)
|
||||||
bool updateStatusSucceeded = false;
|
bool updateStatusSucceeded = false;
|
||||||
if (IsUpdateStatusSucceeded(updateStatusSucceeded) &&
|
if (IsUpdateStatusSucceeded(updateStatusSucceeded) &&
|
||||||
updateStatusSucceeded) {
|
updateStatusSucceeded) {
|
||||||
if (!LaunchWinPostProcess(installDir, gSourcePath, false, NULL)) {
|
if (!LaunchWinPostProcess(installDir, gSourcePath, false, nullptr)) {
|
||||||
fprintf(stderr, "The post update process which runs as the user"
|
fprintf(stderr, "The post update process which runs as the user"
|
||||||
" for service update could not be launched.");
|
" for service update could not be launched.");
|
||||||
}
|
}
|
||||||
|
@ -2776,7 +2778,7 @@ int NS_main(int argc, NS_tchar **argv)
|
||||||
sinfo.fMask = SEE_MASK_FLAG_NO_UI |
|
sinfo.fMask = SEE_MASK_FLAG_NO_UI |
|
||||||
SEE_MASK_FLAG_DDEWAIT |
|
SEE_MASK_FLAG_DDEWAIT |
|
||||||
SEE_MASK_NOCLOSEPROCESS;
|
SEE_MASK_NOCLOSEPROCESS;
|
||||||
sinfo.hwnd = NULL;
|
sinfo.hwnd = nullptr;
|
||||||
sinfo.lpFile = argv[0];
|
sinfo.lpFile = argv[0];
|
||||||
sinfo.lpParameters = cmdLine;
|
sinfo.lpParameters = cmdLine;
|
||||||
sinfo.lpVerb = L"runas";
|
sinfo.lpVerb = L"runas";
|
||||||
|
@ -2925,7 +2927,9 @@ int NS_main(int argc, NS_tchar **argv)
|
||||||
if (sReplaceRequest) {
|
if (sReplaceRequest) {
|
||||||
// In case of replace requests, we should look for the callback file in
|
// In case of replace requests, we should look for the callback file in
|
||||||
// the destination directory.
|
// the destination directory.
|
||||||
size_t commonPrefixLength = PathCommonPrefixW(argv[callbackIndex], gDestinationPath, NULL);
|
size_t commonPrefixLength = PathCommonPrefixW(argv[callbackIndex],
|
||||||
|
gDestinationPath,
|
||||||
|
nullptr);
|
||||||
NS_tchar *p = buffer;
|
NS_tchar *p = buffer;
|
||||||
NS_tstrncpy(p, argv[callbackIndex], commonPrefixLength);
|
NS_tstrncpy(p, argv[callbackIndex], commonPrefixLength);
|
||||||
p += commonPrefixLength;
|
p += commonPrefixLength;
|
||||||
|
@ -2942,7 +2946,9 @@ int NS_main(int argc, NS_tchar **argv)
|
||||||
NS_tchar installDir[MAXPATHLEN];
|
NS_tchar installDir[MAXPATHLEN];
|
||||||
if (!GetInstallationDir(installDir))
|
if (!GetInstallationDir(installDir))
|
||||||
return 1;
|
return 1;
|
||||||
size_t callbackPrefixLength = PathCommonPrefixW(argv[callbackIndex], installDir, NULL);
|
size_t callbackPrefixLength = PathCommonPrefixW(argv[callbackIndex],
|
||||||
|
installDir,
|
||||||
|
nullptr);
|
||||||
NS_tstrncpy(p, argv[callbackIndex] + max(callbackPrefixLength, commonPrefixLength), bufferLeft);
|
NS_tstrncpy(p, argv[callbackIndex] + max(callbackPrefixLength, commonPrefixLength), bufferLeft);
|
||||||
targetPath = buffer;
|
targetPath = buffer;
|
||||||
}
|
}
|
||||||
|
@ -3007,7 +3013,7 @@ int NS_main(int argc, NS_tchar **argv)
|
||||||
DELETE | GENERIC_WRITE,
|
DELETE | GENERIC_WRITE,
|
||||||
// allow delete, rename, and write
|
// allow delete, rename, and write
|
||||||
FILE_SHARE_DELETE | FILE_SHARE_WRITE,
|
FILE_SHARE_DELETE | FILE_SHARE_WRITE,
|
||||||
NULL, OPEN_EXISTING, 0, NULL);
|
nullptr, OPEN_EXISTING, 0, nullptr);
|
||||||
if (callbackFile != INVALID_HANDLE_VALUE)
|
if (callbackFile != INVALID_HANDLE_VALUE)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -3062,7 +3068,7 @@ int NS_main(int argc, NS_tchar **argv)
|
||||||
// before QuitProgressUI has been called, so wait for UpdateThreadFunc to
|
// before QuitProgressUI has been called, so wait for UpdateThreadFunc to
|
||||||
// terminate. Avoid showing the progress UI for background updates.
|
// terminate. Avoid showing the progress UI for background updates.
|
||||||
Thread t;
|
Thread t;
|
||||||
if (t.Run(UpdateThreadFunc, NULL) == 0) {
|
if (t.Run(UpdateThreadFunc, nullptr) == 0) {
|
||||||
if (!sBackgroundUpdate && !sReplaceRequest) {
|
if (!sBackgroundUpdate && !sReplaceRequest) {
|
||||||
ShowProgressUI();
|
ShowProgressUI();
|
||||||
}
|
}
|
||||||
|
@ -3090,7 +3096,7 @@ int NS_main(int argc, NS_tchar **argv)
|
||||||
// access to the HKEY_LOCAL_MACHINE registry key but this is ok since the
|
// access to the HKEY_LOCAL_MACHINE registry key but this is ok since the
|
||||||
// installer / uninstaller will delete the directory along with its contents
|
// installer / uninstaller will delete the directory along with its contents
|
||||||
// after an update is applied, on reinstall, and on uninstall.
|
// after an update is applied, on reinstall, and on uninstall.
|
||||||
if (MoveFileEx(DELETE_DIR, NULL, MOVEFILE_DELAY_UNTIL_REBOOT)) {
|
if (MoveFileEx(DELETE_DIR, nullptr, MOVEFILE_DELAY_UNTIL_REBOOT)) {
|
||||||
LOG(("NS_main: directory will be removed on OS reboot: " LOG_S,
|
LOG(("NS_main: directory will be removed on OS reboot: " LOG_S,
|
||||||
DELETE_DIR));
|
DELETE_DIR));
|
||||||
} else {
|
} else {
|
||||||
|
@ -3119,7 +3125,7 @@ int NS_main(int argc, NS_tchar **argv)
|
||||||
if (!sUsingService) {
|
if (!sUsingService) {
|
||||||
NS_tchar installDir[MAXPATHLEN];
|
NS_tchar installDir[MAXPATHLEN];
|
||||||
if (GetInstallationDir(installDir)) {
|
if (GetInstallationDir(installDir)) {
|
||||||
if (!LaunchWinPostProcess(installDir, gSourcePath, false, NULL)) {
|
if (!LaunchWinPostProcess(installDir, gSourcePath, false, nullptr)) {
|
||||||
LOG(("NS_main: The post update process could not be launched."));
|
LOG(("NS_main: The post update process could not be launched."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3147,7 +3153,7 @@ int NS_main(int argc, NS_tchar **argv)
|
||||||
class ActionList
|
class ActionList
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ActionList() : mFirst(NULL), mLast(NULL), mCount(0) { }
|
ActionList() : mFirst(nullptr), mLast(nullptr), mCount(0) { }
|
||||||
~ActionList();
|
~ActionList();
|
||||||
|
|
||||||
void Append(Action* action);
|
void Append(Action* action);
|
||||||
|
@ -3431,19 +3437,19 @@ int add_dir_entries(const NS_tchar *dirpath, ActionList *list)
|
||||||
// Remove the trailing slash so the paths don't contain double slashes. The
|
// Remove the trailing slash so the paths don't contain double slashes. The
|
||||||
// existence of the slash has already been checked in DoUpdate.
|
// existence of the slash has already been checked in DoUpdate.
|
||||||
searchpath[NS_tstrlen(searchpath) - 1] = NS_T('\0');
|
searchpath[NS_tstrlen(searchpath) - 1] = NS_T('\0');
|
||||||
char* const pathargv[] = {searchpath, NULL};
|
char* const pathargv[] = {searchpath, nullptr};
|
||||||
|
|
||||||
// FTS_NOCHDIR is used so relative paths from the destination directory are
|
// FTS_NOCHDIR is used so relative paths from the destination directory are
|
||||||
// returned.
|
// returned.
|
||||||
if (!(ftsdir = fts_open(pathargv,
|
if (!(ftsdir = fts_open(pathargv,
|
||||||
FTS_PHYSICAL | FTS_NOSTAT | FTS_XDEV | FTS_NOCHDIR,
|
FTS_PHYSICAL | FTS_NOSTAT | FTS_XDEV | FTS_NOCHDIR,
|
||||||
NULL)))
|
nullptr)))
|
||||||
return UNEXPECTED_FILE_OPERATION_ERROR;
|
return UNEXPECTED_FILE_OPERATION_ERROR;
|
||||||
|
|
||||||
while ((ftsdirEntry = fts_read(ftsdir)) != NULL) {
|
while ((ftsdirEntry = fts_read(ftsdir)) != nullptr) {
|
||||||
NS_tchar foundpath[MAXPATHLEN];
|
NS_tchar foundpath[MAXPATHLEN];
|
||||||
NS_tchar *quotedpath;
|
NS_tchar *quotedpath;
|
||||||
Action *action = NULL;
|
Action *action = nullptr;
|
||||||
|
|
||||||
switch (ftsdirEntry->fts_info) {
|
switch (ftsdirEntry->fts_info) {
|
||||||
// Filesystem objects that shouldn't be in the application's directories
|
// Filesystem objects that shouldn't be in the application's directories
|
||||||
|
@ -3533,21 +3539,21 @@ static NS_tchar*
|
||||||
GetManifestContents(const NS_tchar *manifest)
|
GetManifestContents(const NS_tchar *manifest)
|
||||||
{
|
{
|
||||||
AutoFile mfile = NS_tfopen(manifest, NS_T("rb"));
|
AutoFile mfile = NS_tfopen(manifest, NS_T("rb"));
|
||||||
if (mfile == NULL) {
|
if (mfile == nullptr) {
|
||||||
LOG(("GetManifestContents: error opening manifest file: " LOG_S, manifest));
|
LOG(("GetManifestContents: error opening manifest file: " LOG_S, manifest));
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct stat ms;
|
struct stat ms;
|
||||||
int rv = fstat(fileno((FILE *)mfile), &ms);
|
int rv = fstat(fileno((FILE *)mfile), &ms);
|
||||||
if (rv) {
|
if (rv) {
|
||||||
LOG(("GetManifestContents: error stating manifest file: " LOG_S, manifest));
|
LOG(("GetManifestContents: error stating manifest file: " LOG_S, manifest));
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *mbuf = (char *) malloc(ms.st_size + 1);
|
char *mbuf = (char *) malloc(ms.st_size + 1);
|
||||||
if (!mbuf)
|
if (!mbuf)
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
size_t r = ms.st_size;
|
size_t r = ms.st_size;
|
||||||
char *rb = mbuf;
|
char *rb = mbuf;
|
||||||
|
@ -3556,7 +3562,7 @@ GetManifestContents(const NS_tchar *manifest)
|
||||||
size_t c = fread(rb, 1, count, mfile);
|
size_t c = fread(rb, 1, count, mfile);
|
||||||
if (c != count) {
|
if (c != count) {
|
||||||
LOG(("GetManifestContents: error reading manifest file: " LOG_S, manifest));
|
LOG(("GetManifestContents: error reading manifest file: " LOG_S, manifest));
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
r -= c;
|
r -= c;
|
||||||
|
@ -3570,14 +3576,14 @@ GetManifestContents(const NS_tchar *manifest)
|
||||||
#else
|
#else
|
||||||
NS_tchar *wrb = (NS_tchar *) malloc((ms.st_size + 1) * sizeof(NS_tchar));
|
NS_tchar *wrb = (NS_tchar *) malloc((ms.st_size + 1) * sizeof(NS_tchar));
|
||||||
if (!wrb)
|
if (!wrb)
|
||||||
return NULL;
|
return nullptr;
|
||||||
|
|
||||||
if (!MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, rb, -1, wrb,
|
if (!MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, rb, -1, wrb,
|
||||||
ms.st_size + 1)) {
|
ms.st_size + 1)) {
|
||||||
LOG(("GetManifestContents: error converting utf8 to utf16le: %d", GetLastError()));
|
LOG(("GetManifestContents: error converting utf8 to utf16le: %d", GetLastError()));
|
||||||
free(mbuf);
|
free(mbuf);
|
||||||
free(wrb);
|
free(wrb);
|
||||||
return NULL;
|
return nullptr;
|
||||||
}
|
}
|
||||||
free(mbuf);
|
free(mbuf);
|
||||||
|
|
||||||
|
@ -3592,7 +3598,7 @@ int AddPreCompleteActions(ActionList *list)
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_tchar *rb = GetManifestContents(NS_T("precomplete"));
|
NS_tchar *rb = GetManifestContents(NS_T("precomplete"));
|
||||||
if (rb == NULL) {
|
if (rb == nullptr) {
|
||||||
LOG(("AddPreCompleteActions: error getting contents of precomplete " \
|
LOG(("AddPreCompleteActions: error getting contents of precomplete " \
|
||||||
"manifest"));
|
"manifest"));
|
||||||
// Applications aren't required to have a precomplete manifest yet.
|
// Applications aren't required to have a precomplete manifest yet.
|
||||||
|
@ -3612,7 +3618,7 @@ int AddPreCompleteActions(ActionList *list)
|
||||||
return PARSE_ERROR;
|
return PARSE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
Action *action = NULL;
|
Action *action = nullptr;
|
||||||
if (NS_tstrcmp(token, NS_T("remove")) == 0) { // rm file
|
if (NS_tstrcmp(token, NS_T("remove")) == 0) { // rm file
|
||||||
action = new RemoveFile();
|
action = new RemoveFile();
|
||||||
}
|
}
|
||||||
|
@ -3657,7 +3663,7 @@ int DoUpdate()
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_tchar *rb = GetManifestContents(manifest);
|
NS_tchar *rb = GetManifestContents(manifest);
|
||||||
if (rb == NULL) {
|
if (rb == nullptr) {
|
||||||
LOG(("DoUpdate: error opening manifest file: " LOG_S, manifest));
|
LOG(("DoUpdate: error opening manifest file: " LOG_S, manifest));
|
||||||
return READ_ERROR;
|
return READ_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -3692,7 +3698,7 @@ int DoUpdate()
|
||||||
|
|
||||||
isFirstAction = false;
|
isFirstAction = false;
|
||||||
|
|
||||||
Action *action = NULL;
|
Action *action = nullptr;
|
||||||
if (NS_tstrcmp(token, NS_T("remove")) == 0) { // rm file
|
if (NS_tstrcmp(token, NS_T("remove")) == 0) { // rm file
|
||||||
action = new RemoveFile();
|
action = new RemoveFile();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1026,7 +1026,7 @@ XRE_GetFileFromPath(const char *aPath, nsIFile* *aResult)
|
||||||
return NS_ERROR_INVALID_ARG;
|
return NS_ERROR_INVALID_ARG;
|
||||||
|
|
||||||
CFURLRef fullPath =
|
CFURLRef fullPath =
|
||||||
CFURLCreateFromFileSystemRepresentation(NULL, (const UInt8 *) aPath,
|
CFURLCreateFromFileSystemRepresentation(nullptr, (const UInt8 *) aPath,
|
||||||
pathLen, true);
|
pathLen, true);
|
||||||
if (!fullPath)
|
if (!fullPath)
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче