Skip to content

Dokan - GetFileSecurity has a default implementation since 1.0.3 #270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions fs/expose/dokan/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,17 +812,6 @@ def UnlockFile(self, path, offset, length, info):

@handle_fs_errors
def GetFileSecurity(self, path, securityinformation, securitydescriptor, securitydescriptorlength, neededlength, info):
securitydescriptor = ctypes.cast(securitydescriptor, libdokan.PSECURITY_DESCRIPTOR)
path = self._dokanpath2pyfs(path)
if self.fs.isdir(path):
res = libdokan.GetFileSecurity(
self.securityfolder,
ctypes.cast(securityinformation, libdokan.PSECURITY_INFORMATION)[0],
securitydescriptor,
securitydescriptorlength,
neededlength,
)
return STATUS_SUCCESS if res else STATUS_BUFFER_OVERFLOW
return STATUS_NOT_IMPLEMENTED

@handle_fs_errors
Expand Down
12 changes: 1 addition & 11 deletions fs/expose/dokan/libdokan.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,4 @@ class DOKAN_OPERATIONS(Structure):
DokanResetTimeout.argtypes = (
ULONG, #timeout
PDOKAN_FILE_INFO, # file info pointer
)

GetFileSecurity = windll.advapi32.GetFileSecurityW
GetFileSecurity.restype = BOOL
GetFileSecurity.argtypes = (
LPWSTR, # _In_ LPCTSTR lpFileName,
SECURITY_INFORMATION, # _In_ SECURITY_INFORMATION RequestedInformation,
PSECURITY_DESCRIPTOR, # _Out_opt_ PSECURITY_DESCRIPTOR pSecurityDescriptor,
DWORD, # _In_ DWORD nLength,
LPDWORD, # _Out_ LPDWORD lpnLengthNeeded
)
)