hakril / PythonForWindows

A codebase aimed to make interaction with Windows and native execution easier
BSD 3-Clause "New" or "Revised" License
573 stars 112 forks source link

wrong type error occurred when I run query_sacl.py with python3 #40

Closed ycdxsb closed 2 years ago

ycdxsb commented 2 years ago

wrong type error occurred when I run https://github.com/hakril/PythonForWindows/blob/master/samples/security/query_sacl.py with python3

[NO-PRIV] Querying <C:\windows\notepad.exe> SecurityDescriptor without SACL
Traceback (most recent call last):
  File "test.py", line 11, in <module>
    sd = windows.security.SecurityDescriptor.from_filename(TARGET)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python38\lib\site-packages\pythonforwindows-0.6.0-py3.8.egg\windows\security.py", line 877, in from_filename
    return cls._from_name_and_type(filename, gdef.SE_FILE_OBJECT, flags=flags, query_sacl=query_sacl)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python38\lib\site-packages\pythonforwindows-0.6.0-py3.8.egg\windows\security.py", line 823, in _from_name_and_type
    winproxy.GetNamedSecurityInfoA(
  File "C:\Users\admin\AppData\Local\Programs\Python\Python38\lib\site-packages\pythonforwindows-0.6.0-py3.8.egg\windows\winproxy\apis\advapi32.py", line 176, in GetNamedSecurityInfoA
    return GetNamedSecurityInfoA.ctypes_function(pObjectName, ObjectType, SecurityInfo, ppsidOwner, ppsidGroup, ppDacl, ppSacl, ppSecurityDescriptor)
  File "C:\Users\admin\AppData\Local\Programs\Python\Python38\lib\site-packages\pythonforwindows-0.6.0-py3.8.egg\windows\winproxy\apiproxy.py", line 99, in perform_call
    return self._cprototyped(*args)
ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong type
hakril commented 2 years ago

Hi, thank you for the issue.

It should be fixed with commit ad59298, can you confirm me that ?