Skip to content

Commit

Permalink
Minor String Parameter Optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
NoMoreFood committed Mar 3, 2020
1 parent 4e9ded0 commit e9ace6b
Show file tree
Hide file tree
Showing 74 changed files with 85 additions and 87 deletions.
2 changes: 1 addition & 1 deletion Functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ std::wstring GetNameFromSidEx(const PSID tSid, bool * bMarkAsOrphan = nullptr);
std::wstring GetDomainNameFromSid(const PSID tSid);
std::wstring GenerateAccessMask(DWORD iCurrentMask);
std::wstring GenerateInheritanceFlags(DWORD iCurrentFlags);
HANDLE RegisterFileHandle(HANDLE hFile, std::wstring sOperation);
HANDLE RegisterFileHandle(HANDLE hFile, const std::wstring & sOperation);
std::wstring GetAntivirusStateDescription();
std::wstring FileTimeToString(LPFILETIME const tFileTime);
BOOL WriteToFile(const std::wstring & sStringToWrite, HANDLE hFile);
Expand Down
2 changes: 1 addition & 1 deletion Helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ VOID EnablePrivs()
return;
}

HANDLE RegisterFileHandle(HANDLE hFile, std::wstring sOperation)
HANDLE RegisterFileHandle(HANDLE hFile, const std::wstring & sOperation)
{
// lookup do a reverse lookup on file name
static std::map<std::wstring, std::pair<HANDLE,std::wstring>> oFileLookup;
Expand Down
3 changes: 1 addition & 2 deletions Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@
#include <condition_variable>

#include "Operation.h"
#include "OperationHelp.h"
#include "InputOutput.h"
#include "ConcurrentQueue.h"
#include "DriverKitPartial.h"
#include "Functions.h"
#include "Version.h"

#define MAX_DIRECTORY_BUFFER 65536
constexpr ULONG MAX_DIRECTORY_BUFFER = 65536;

std::vector<Operation *> oOperationList;

Expand Down
2 changes: 1 addition & 1 deletion OperationAddAccountIfMissing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

ClassFactory<OperationAddAccountIfMissing> OperationAddAccountIfMissing::RegisteredFactory(GetCommand());

OperationAddAccountIfMissing::OperationAddAccountIfMissing(std::queue<std::wstring> & oArgList, std::wstring sCommand) : Operation(oArgList)
OperationAddAccountIfMissing::OperationAddAccountIfMissing(std::queue<std::wstring> & oArgList, const std::wstring & sCommand) : Operation(oArgList)
{
// exit if there are not enough arguments to parse
std::vector<std::wstring> sSubArgs = ProcessAndCheckArgs(1, oArgList);
Expand Down
2 changes: 1 addition & 1 deletion OperationAddAccountIfMissing.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ class OperationAddAccountIfMissing : public Operation
bool ProcessAclAction(WCHAR * const sSdPart, ObjectEntry & tObjectEntry, PACL & tCurrentAcl, bool & bAclReplacement) override;

// constructors
OperationAddAccountIfMissing(std::queue<std::wstring> & oArgList, std::wstring sCommand);
OperationAddAccountIfMissing(std::queue<std::wstring> & oArgList, const std::wstring & sCommand);
};
2 changes: 1 addition & 1 deletion OperationBackupSecurity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

ClassFactory<OperationBackupSecurity> OperationBackupSecurity::RegisteredFactory(GetCommand());

OperationBackupSecurity::OperationBackupSecurity(std::queue<std::wstring> & oArgList, std::wstring sCommand) : Operation(oArgList)
OperationBackupSecurity::OperationBackupSecurity(std::queue<std::wstring> & oArgList, const std::wstring & sCommand) : Operation(oArgList)
{
// exit if there are not enough arguments to parse
std::vector<std::wstring> sSubArgs = ProcessAndCheckArgs(1, oArgList, L"\\0");
Expand Down
2 changes: 1 addition & 1 deletion OperationBackupSecurity.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ class OperationBackupSecurity : public Operation
bool ProcessSdAction(std::wstring & sFileName, ObjectEntry & tObjectEntry, PSECURITY_DESCRIPTOR & tDescriptor, bool & bDescReplacement) override;

// constructors
OperationBackupSecurity(std::queue<std::wstring> & oArgList, std::wstring sCommand);
OperationBackupSecurity(std::queue<std::wstring> & oArgList, const std::wstring & sCommand);
};

3 changes: 1 addition & 2 deletions OperationCanonicalizeAcls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
#include "OperationCheckCanonical.h"
#include "DriverKitPartial.h"
#include "InputOutput.h"
#include "Functions.h"

ClassFactory<OperationCanonicalizeAcls> OperationCanonicalizeAcls::RegisteredFactory(GetCommand());

OperationCanonicalizeAcls::OperationCanonicalizeAcls(std::queue<std::wstring> & oArgList, std::wstring sCommand) : Operation(oArgList)
OperationCanonicalizeAcls::OperationCanonicalizeAcls(std::queue<std::wstring> & oArgList, const std::wstring & sCommand) : Operation(oArgList)
{
// flag this as being an ace-level action
AppliesToDacl = true;
Expand Down
2 changes: 1 addition & 1 deletion OperationCanonicalizeAcls.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ class OperationCanonicalizeAcls : public Operation
bool ProcessAclAction(WCHAR * const sSdPart, ObjectEntry & tObjectEntry, PACL & tCurrentAcl, bool & bAclReplacement) override;

// constructors
OperationCanonicalizeAcls(std::queue<std::wstring> & oArgList, std::wstring sCommand);
OperationCanonicalizeAcls(std::queue<std::wstring> & oArgList, const std::wstring & sCommand);
};

2 changes: 1 addition & 1 deletion OperationCheckCanonical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

ClassFactory<OperationCheckCanonical> OperationCheckCanonical::RegisteredFactory(GetCommand());

OperationCheckCanonical::OperationCheckCanonical(std::queue<std::wstring> & oArgList, std::wstring sCommand) : Operation(oArgList)
OperationCheckCanonical::OperationCheckCanonical(std::queue<std::wstring> & oArgList, const std::wstring & sCommand) : Operation(oArgList)
{
// flag this as being an ace-level action
AppliesToDacl = true;
Expand Down
2 changes: 1 addition & 1 deletion OperationCheckCanonical.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ class OperationCheckCanonical : public Operation
bool ProcessAclAction(WCHAR * const sSdPart, ObjectEntry & tObjectEntry, PACL & tCurrentAcl, bool & bAclReplacement) override;

// constructors
OperationCheckCanonical(std::queue<std::wstring> & oArgList, std::wstring sCommand);
OperationCheckCanonical(std::queue<std::wstring> & oArgList, const std::wstring & sCommand);
};

2 changes: 1 addition & 1 deletion OperationCompact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

ClassFactory<OperationCompact> OperationCompact::RegisteredFactory(GetCommand());

OperationCompact::OperationCompact(std::queue<std::wstring> & oArgList, std::wstring sCommand) : Operation(oArgList)
OperationCompact::OperationCompact(std::queue<std::wstring> & oArgList, const std::wstring & sCommand) : Operation(oArgList)
{
// flag this as being an ace-level action
AppliesToDacl = true;
Expand Down
2 changes: 1 addition & 1 deletion OperationCompact.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ class OperationCompact : public Operation
bool ProcessAclAction(WCHAR * const sSdPart, ObjectEntry & tObjectEntry, PACL & tCurrentAcl, bool & bAclReplacement) override;

// constructors
OperationCompact(std::queue<std::wstring> & oArgList, std::wstring sCommand);
OperationCompact(std::queue<std::wstring> & oArgList, const std::wstring & sCommand);
};

2 changes: 1 addition & 1 deletion OperationCopyDomain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

ClassFactory<OperationCopyDomain> OperationCopyDomain::RegisteredFactory(GetCommand());

OperationCopyDomain::OperationCopyDomain(std::queue<std::wstring> & oArgList, std::wstring sCommand) : Operation(oArgList)
OperationCopyDomain::OperationCopyDomain(std::queue<std::wstring> & oArgList, const std::wstring & sCommand) : Operation(oArgList)
{
// exit if there are not enough arguments to parse
std::vector<std::wstring> sSubArgs = ProcessAndCheckArgs(2, oArgList);
Expand Down
2 changes: 1 addition & 1 deletion OperationCopyDomain.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ class OperationCopyDomain : public Operation
bool ProcessAclAction(WCHAR * const sSdPart, ObjectEntry & tObjectEntry, PACL & tCurrentAcl, bool & bAclReplacement) override;

// constructors
OperationCopyDomain(std::queue<std::wstring> & oArgList, std::wstring sCommand);
OperationCopyDomain(std::queue<std::wstring> & oArgList, const std::wstring & sCommand);
};
2 changes: 1 addition & 1 deletion OperationDomainPaths.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

ClassFactory<OperationDomainPaths> OperationDomainPaths::RegisteredFactory(GetCommand());

OperationDomainPaths::OperationDomainPaths(std::queue<std::wstring> & oArgList, std::wstring sCommand) : Operation(oArgList)
OperationDomainPaths::OperationDomainPaths(std::queue<std::wstring> & oArgList, const std::wstring & sCommand) : Operation(oArgList)
{
// exit if there are not enough arguments to parse
std::vector<std::wstring> sSubArgs = ProcessAndCheckArgs(1, oArgList);
Expand Down
2 changes: 1 addition & 1 deletion OperationDomainPaths.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ class OperationDomainPaths : public Operation
public:

// constructors
OperationDomainPaths(std::queue<std::wstring> & oArgList, std::wstring sCommand);
OperationDomainPaths(std::queue<std::wstring> & oArgList, const std::wstring & sCommand);
};
8 changes: 5 additions & 3 deletions OperationFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class FactoryPlant
{
protected:

virtual Operation * CreateInstanceSub(std::queue<std::wstring> & oArgList, std::wstring sCommand) = 0;
virtual Operation * CreateInstanceSub(std::queue<std::wstring> & oArgList, const std::wstring & sCommand) = 0;

static std::map<std::wstring, FactoryPlant *> & GetCommands()
{
Expand All @@ -15,6 +15,8 @@ class FactoryPlant
}

public:

virtual ~FactoryPlant() = default;

static Operation * CreateInstance(std::queue<std::wstring> & oArgList)
{
Expand Down Expand Up @@ -52,11 +54,11 @@ class FactoryPlant
}
};

template <class SubType> class ClassFactory : public FactoryPlant
template <class SubType> class ClassFactory final : public FactoryPlant
{
private:

Operation * CreateInstanceSub(std::queue<std::wstring> & oArgList, std::wstring sCommand) override
Operation * CreateInstanceSub(std::queue<std::wstring> & oArgList, const std::wstring & sCommand) override
{
return new SubType(oArgList, sCommand);
}
Expand Down
2 changes: 1 addition & 1 deletion OperationFindAccount.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

ClassFactory<OperationFindAccount> OperationFindAccount::RegisteredFactory(GetCommand());

OperationFindAccount::OperationFindAccount(std::queue<std::wstring> & oArgList, std::wstring sCommand) : Operation(oArgList)
OperationFindAccount::OperationFindAccount(std::queue<std::wstring> & oArgList, const std::wstring & sCommand) : Operation(oArgList)
{
// exit if there are not enough arguments to parse
std::vector<std::wstring> sSubArgs = ProcessAndCheckArgs(1, oArgList);
Expand Down
2 changes: 1 addition & 1 deletion OperationFindAccount.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ class OperationFindAccount : public Operation
SidActionResult DetermineSid(WCHAR * const sSdPart, ObjectEntry & tObjectEntry, PSID const tCurrentSid, PSID & tResultantSid) override;

// constructors
OperationFindAccount(std::queue<std::wstring> & oArgList, std::wstring sCommand);
OperationFindAccount(std::queue<std::wstring> & oArgList, const std::wstring & sCommand);
};
2 changes: 1 addition & 1 deletion OperationFindDomain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

ClassFactory<OperationFindDomain> OperationFindDomain::RegisteredFactory(GetCommand());

OperationFindDomain::OperationFindDomain(std::queue<std::wstring> & oArgList, std::wstring sCommand) : Operation(oArgList)
OperationFindDomain::OperationFindDomain(std::queue<std::wstring> & oArgList, const std::wstring & sCommand) : Operation(oArgList)
{
// exit if there are not enough arguments to parse
std::vector<std::wstring> sSubArgs = ProcessAndCheckArgs(1, oArgList);
Expand Down
2 changes: 1 addition & 1 deletion OperationFindDomain.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ class OperationFindDomain : public Operation
SidActionResult DetermineSid(WCHAR * const sSdPart, ObjectEntry & tObjectEntry, PSID const tCurrentSid, PSID & tResultantSid) override;

// constructors
OperationFindDomain(std::queue<std::wstring> & oArgList, std::wstring sCommand);
OperationFindDomain(std::queue<std::wstring> & oArgList, const std::wstring & sCommand);
};
2 changes: 1 addition & 1 deletion OperationFindNullAcl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

ClassFactory<OperationFindNullAcl> OperationFindNullAcl::RegisteredFactory(GetCommand());

OperationFindNullAcl::OperationFindNullAcl(std::queue<std::wstring> & oArgList, std::wstring sCommand) : Operation(oArgList)
OperationFindNullAcl::OperationFindNullAcl(std::queue<std::wstring> & oArgList, const std::wstring & sCommand) : Operation(oArgList)
{
// flag this as being an ace-level action
AppliesToDacl = true;
Expand Down
2 changes: 1 addition & 1 deletion OperationFindNullAcl.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ class OperationFindNullAcl : public Operation
bool ProcessAclAction(WCHAR * const sSdPart, ObjectEntry & tObjectEntry, PACL & tCurrentAcl, bool & bAclReplacement) override;

// constructors
OperationFindNullAcl(std::queue<std::wstring> & oArgList, std::wstring sCommand);
OperationFindNullAcl(std::queue<std::wstring> & oArgList, const std::wstring & sCommand);
};

15 changes: 8 additions & 7 deletions OperationGrantDenyPerms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
ClassFactory<OperationGrantDenyPerms> OperationGrantDenyPerms::RegisteredFactoryGrant(GetCommandAdd());
ClassFactory<OperationGrantDenyPerms> OperationGrantDenyPerms::RegisteredFactoryDeny(GetCommandDeny());

OperationGrantDenyPerms::OperationGrantDenyPerms(std::queue<std::wstring>& oArgList, std::wstring sCommand) : Operation(oArgList)
OperationGrantDenyPerms::OperationGrantDenyPerms(std::queue<std::wstring>& oArgList, const std::wstring & sCommand) : Operation(oArgList)
{
// exit if there are not enough arguments to parse
std::vector<std::wstring> sSubArgs = ProcessAndCheckArgs(2, oArgList);
Expand All @@ -23,20 +23,21 @@ OperationGrantDenyPerms::OperationGrantDenyPerms(std::queue<std::wstring>& oArgL
std::vector<std::wstring> aPermList;
const std::wregex oPermsRegex(LR"(\(([A-Z]+)\))");
for (std::wsregex_iterator oPermsIterator(sPerms.begin(), sPerms.end(), oPermsRegex,
std::regex_constants::match_continuous); oPermsIterator != std::wsregex_iterator(); oPermsIterator++) {
std::regex_constants::match_continuous); oPermsIterator != std::wsregex_iterator(); ++oPermsIterator) {
aPermList.push_back((*oPermsIterator).str(1));
}

// error if no options set
if (aPermList.size() == 0)
if (aPermList.empty())
{
wprintf(L"ERROR: Invalid or no permissions string specified for parameter '%s'.\n", GetCommandAdd().c_str());
exit(-1);
}

// populate default values
ConvertToUpper(sCommand);
tEa.grfAccessMode = (sCommand == GetCommandAdd()) ? GRANT_ACCESS : DENY_ACCESS;
std::wstring sCommandUpper(sCommand);
ConvertToUpper(sCommandUpper);
tEa.grfAccessMode = (sCommandUpper == GetCommandAdd()) ? GRANT_ACCESS : DENY_ACCESS;
tEa.grfInheritance = NO_INHERITANCE;
tEa.grfAccessPermissions = 0;
tEa.Trustee.MultipleTrusteeOperation = NO_MULTIPLE_TRUSTEE;
Expand Down Expand Up @@ -98,7 +99,7 @@ OperationGrantDenyPerms::OperationGrantDenyPerms(std::queue<std::wstring>& oArgL
};

// decode the permissions string to their binary values
for (const std::wstring sKey : aPermList)
for (const std::wstring & sKey : aPermList)
{
if (aInheritMap.find(sKey) != aInheritMap.end()) tEa.grfInheritance |= aInheritMap.at(sKey);
else if (aPermsMap.find(sKey) != aPermsMap.end()) tEa.grfAccessPermissions |= aPermsMap.at(sKey);
Expand All @@ -123,7 +124,7 @@ bool OperationGrantDenyPerms::ProcessAclAction(WCHAR* const sSdPart, ObjectEntry
const DWORD iObjectTypeMask = IsDirectory(tObjectEntry.Attributes)
? ~0 : ~(CONTAINER_INHERIT_ACE | OBJECT_INHERIT_ACE);

// verify this is not alraedy part of the ace as an inherited or explicit entry
// verify this is not already part of the ace as an inherited or explicit entry
if (tCurrentAcl != nullptr)
{
ACCESS_ACE* tAceDacl = FirstAce(tCurrentAcl);
Expand Down
2 changes: 1 addition & 1 deletion OperationGrantDenyPerms.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ class OperationGrantDenyPerms : public Operation
bool ProcessAclAction(WCHAR* const sSdPart, ObjectEntry& tObjectEntry, PACL& tCurrentAcl, bool& bAclReplacement) override;

// constructors
OperationGrantDenyPerms(std::queue<std::wstring>& oArgList, std::wstring sCommand);
OperationGrantDenyPerms(std::queue<std::wstring>& oArgList, const std::wstring & sCommand);
};
2 changes: 1 addition & 1 deletion OperationHelp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ClassFactory<OperationHelp> OperationHelp::RegisteredFactory(GetCommand());
ClassFactory<OperationHelp> OperationHelp::RegisteredFactoryAltOne(GetCommandAltOne());
ClassFactory<OperationHelp> OperationHelp::RegisteredFactoryAltTwo(GetCommandAltTwo());

OperationHelp::OperationHelp(std::queue<std::wstring> & oArgList, std::wstring sCommand) : Operation(oArgList)
OperationHelp::OperationHelp(std::queue<std::wstring> & oArgList, const std::wstring & sCommand) : Operation(oArgList)
{
std::wcout <<
LR"(
Expand Down
2 changes: 1 addition & 1 deletion OperationHelp.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ class OperationHelp : public Operation
public:

// constructors
OperationHelp(std::queue<std::wstring> & oArgList, std::wstring sCommand);
OperationHelp(std::queue<std::wstring> & oArgList, const std::wstring & sCommand);
};
2 changes: 1 addition & 1 deletion OperationInheritChildren.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

ClassFactory<OperationInheritChildren> OperationInheritChildren::RegisteredFactory(GetCommand());

OperationInheritChildren::OperationInheritChildren(std::queue<std::wstring> & oArgList, std::wstring sCommand) : Operation(oArgList)
OperationInheritChildren::OperationInheritChildren(std::queue<std::wstring> & oArgList, const std::wstring & sCommand) : Operation(oArgList)
{
// flag this as being an ace-level action
AppliesToDacl = true;
Expand Down
2 changes: 1 addition & 1 deletion OperationInheritChildren.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ class OperationInheritChildren : public Operation
bool ProcessAclAction(WCHAR * const sSdPart, ObjectEntry & tObjectEntry, PACL & tCurrentAcl, bool & bAclReplacement) override;

// constructors
OperationInheritChildren(std::queue<std::wstring> & oArgList, std::wstring sCommand);
OperationInheritChildren(std::queue<std::wstring> & oArgList, const std::wstring & sCommand);
};

2 changes: 1 addition & 1 deletion OperationLocate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ClassFactory<OperationLocate> OperationLocate::RegisteredFactory(GetCommand());

#define Q(x) L"\"" + (x) + L"\""

OperationLocate::OperationLocate(std::queue<std::wstring> & oArgList, std::wstring sCommand) : Operation(oArgList)
OperationLocate::OperationLocate(std::queue<std::wstring> & oArgList, const std::wstring & sCommand) : Operation(oArgList)
{
// exit if there are not enough arguments to parse
std::vector<std::wstring> sReportFile = ProcessAndCheckArgs(1, oArgList, L"\\0");
Expand Down
2 changes: 1 addition & 1 deletion OperationLocate.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ class OperationLocate : public Operation
void ProcessObjectAction(ObjectEntry & tObjectEntry) override;

// constructors
OperationLocate(std::queue<std::wstring> & oArgList, std::wstring sCommand);
OperationLocate(std::queue<std::wstring> & oArgList, const std::wstring & sCommand);
};
2 changes: 1 addition & 1 deletion OperationLocateShortcut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ClassFactory<OperationLocateShortcut> OperationLocateShortcut::RegisteredFactory

#define Q(x) L"\"" + (x) + L"\""

OperationLocateShortcut::OperationLocateShortcut(std::queue<std::wstring> & oArgList, std::wstring sCommand) : Operation(oArgList)
OperationLocateShortcut::OperationLocateShortcut(std::queue<std::wstring> & oArgList, const std::wstring & sCommand) : Operation(oArgList)
{
// exit if there are not enough arguments to parse
std::vector<std::wstring> sReportFile = ProcessAndCheckArgs(1, oArgList, L"\\0");
Expand Down
2 changes: 1 addition & 1 deletion OperationLocateShortcut.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ class OperationLocateShortcut : public Operation
void ProcessObjectAction(ObjectEntry & tObjectEntry) override;

// constructors
OperationLocateShortcut(std::queue<std::wstring> & oArgList, std::wstring sCommand);
OperationLocateShortcut(std::queue<std::wstring> & oArgList, const std::wstring & sCommand);
};
5 changes: 1 addition & 4 deletions OperationLog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@
#include "InputOutput.h"
#include "Functions.h"

#include <fstream>
#include <iostream>
#include <locale>
#include <codecvt>

ClassFactory<OperationLog> OperationLog::RegisteredFactory(GetCommand());

#define Q(x) L"\"" + (x) + L"\""

HANDLE OperationLog::hLogHandle = INVALID_HANDLE_VALUE;

OperationLog::OperationLog(std::queue<std::wstring> & oArgList, std::wstring sCommand) : Operation(oArgList)
OperationLog::OperationLog(std::queue<std::wstring> & oArgList, const std::wstring & sCommand) : Operation(oArgList)
{
// exit if there are not enough arguments to parse
std::vector<std::wstring> sLogFile = ProcessAndCheckArgs(1, oArgList, L"\\0");
Expand Down
2 changes: 1 addition & 1 deletion OperationLog.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class OperationLog : public Operation
public:

// constructors
OperationLog(std::queue<std::wstring> & oArgList, std::wstring sCommand);
OperationLog(std::queue<std::wstring> & oArgList, const std::wstring & sCommand);

// functions
static void LogFileItem(const std::wstring & sInfoLevel, const std::wstring & sPath, const std::wstring & sMessage);
Expand Down
Loading

0 comments on commit e9ace6b

Please sign in to comment.