mirror of
https://github.com/hakril/PythonForWindows
synced 2026-06-08 14:31:45 +00:00
Update generation for ntstatus and add a parallele define module to ApiProxy
This commit is contained in:
@@ -3,9 +3,6 @@ TODO:
|
||||
|
||||
- Better WMI interface
|
||||
|
||||
- ProcessMemory object ? (metasm like)
|
||||
|
||||
- remove pe_parse.transform_ctypes_fields (use utils.transform_ctypes_fields)
|
||||
- DBG
|
||||
- Verif multiple bp at same place..
|
||||
- Verif multiple pending at same place
|
||||
@@ -35,6 +32,7 @@ TODO:
|
||||
|
||||
Documentation
|
||||
* verif samples
|
||||
* COMImplementation (example in LKD)
|
||||
|
||||
FIXME:
|
||||
- setup.py build seems to raise an error
|
||||
|
||||
@@ -298,10 +298,9 @@ class FuncGenerator(CtypesGenerator):
|
||||
return ctypes_code
|
||||
|
||||
class NtStatusGenerator(CtypesGenerator):
|
||||
HEADER_IMPORT = dedent("""
|
||||
IMPORT_HEADER = dedent("""
|
||||
import ctypes
|
||||
{deps}
|
||||
|
||||
""")
|
||||
HEADER = dedent("""
|
||||
class NtStatusException(WindowsError):
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
|
||||
import ctypes
|
||||
from windef import *
|
||||
|
||||
class NtStatusException(WindowsError):
|
||||
ALL_STATUS = {}
|
||||
def __init__(self , code):
|
||||
|
||||
+4
-3
@@ -100,7 +100,8 @@ class ExportNotFound(RuntimeError):
|
||||
class ApiProxy(object):
|
||||
APIDLL = None
|
||||
"""Create a python wrapper around a kernel32 function"""
|
||||
def __init__(self, func_name, error_check=None):
|
||||
def __init__(self, func_name, error_check=None, deffunc_module=None):
|
||||
self.deffunc_module = deffunc_module if deffunc_module is not None else winfuncs
|
||||
self.func_name = func_name
|
||||
if error_check is None:
|
||||
error_check = self.default_error_check
|
||||
@@ -108,8 +109,8 @@ class ApiProxy(object):
|
||||
self._cprototyped = None
|
||||
|
||||
def __call__(self, python_proxy, ):
|
||||
prototype = getattr(winfuncs, self.func_name + "Prototype")
|
||||
params = getattr(winfuncs, self.func_name + "Params")
|
||||
prototype = getattr(self.deffunc_module, self.func_name + "Prototype")
|
||||
params = getattr(self.deffunc_module, self.func_name + "Params")
|
||||
python_proxy.prototype = prototype
|
||||
python_proxy.params = params
|
||||
python_proxy.errcheck = self.error_check
|
||||
|
||||
Reference in New Issue
Block a user