-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix icon missing issue due to file system permissions
- Loading branch information
1 parent
5e8aac9
commit e4f9037
Showing
13 changed files
with
135 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "pch.h" | ||
#include "AclHelper.h" | ||
|
||
AclHelper::AclHelper() | ||
{ | ||
emptyAcl = (PACL)malloc(sizeof(ACL)); | ||
|
||
if (emptyAcl) | ||
{ | ||
InitializeAcl(emptyAcl, sizeof(ACL), ACL_REVISION); | ||
} | ||
} | ||
|
||
AclHelper::~AclHelper() | ||
{ | ||
if (emptyAcl) | ||
{ | ||
free(emptyAcl); | ||
} | ||
} | ||
|
||
DWORD AclHelper::ResetAcl(const wstring& path) | ||
{ | ||
if (emptyAcl) | ||
{ | ||
return SetNamedSecurityInfoW(const_cast<LPWSTR>(path.c_str()), SE_FILE_OBJECT, DACL_SECURITY_INFORMATION | UNPROTECTED_DACL_SECURITY_INFORMATION, NULL, NULL, emptyAcl, NULL); | ||
} | ||
else | ||
{ | ||
return ERROR_OUTOFMEMORY; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#pragma once | ||
|
||
class AclHelper | ||
{ | ||
public: | ||
AclHelper(); | ||
~AclHelper(); | ||
|
||
DWORD ResetAcl(const wstring& path); | ||
|
||
private: | ||
PACL emptyAcl; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#include "pch.h" | ||
#include "PathHelper.h" | ||
|
||
using namespace NppShell::Helpers; | ||
using namespace std::filesystem; | ||
|
||
extern HMODULE thisModule; | ||
|
||
const path GetThisModulePath() | ||
{ | ||
wchar_t pathBuffer[FILENAME_MAX] = { 0 }; | ||
GetModuleFileName(thisModule, pathBuffer, FILENAME_MAX); | ||
return path(pathBuffer); | ||
} | ||
|
||
const wstring NppShell::Helpers::GetApplicationPath() | ||
{ | ||
path modulePath = GetThisModulePath(); | ||
return modulePath.parent_path().parent_path().wstring(); | ||
} | ||
|
||
const wstring NppShell::Helpers::GetContextMenuPath() | ||
{ | ||
path modulePath = GetThisModulePath(); | ||
return modulePath.parent_path().wstring(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters