From da52b0d55cfb409b24165ce974befe5a9e153a38 Mon Sep 17 00:00:00 2001 From: Adrien JUND Date: Fri, 10 Mar 2017 14:56:17 +0100 Subject: [PATCH] Dokan - GetFileSecurity has a default implementation since 1.0.3 --- fs/expose/dokan/__init__.py | 11 ----------- fs/expose/dokan/libdokan.py | 12 +----------- 2 files changed, 1 insertion(+), 22 deletions(-) diff --git a/fs/expose/dokan/__init__.py b/fs/expose/dokan/__init__.py index 1a52074..c6cea7c 100644 --- a/fs/expose/dokan/__init__.py +++ b/fs/expose/dokan/__init__.py @@ -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 diff --git a/fs/expose/dokan/libdokan.py b/fs/expose/dokan/libdokan.py index 9d33be4..b0203c1 100644 --- a/fs/expose/dokan/libdokan.py +++ b/fs/expose/dokan/libdokan.py @@ -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 -) +) \ No newline at end of file