mirror of
https://github.com/hakril/PythonForWindows
synced 2026-06-08 14:31:45 +00:00
Added some API to winproxy
This commit is contained in:
@@ -16,4 +16,5 @@ from version import *
|
||||
from wevtapi import *
|
||||
from wintrust import *
|
||||
from tdh import *
|
||||
from dnsapi import *
|
||||
from dnsapi import *
|
||||
from virtdisk import *
|
||||
@@ -201,3 +201,11 @@ def CryptMsgVerifyCountersignatureEncodedEx(hCryptProv, dwEncodingType, pbSigner
|
||||
@Crypt32Proxy()
|
||||
def CryptMsgClose(hCryptMsg):
|
||||
return CryptMsgClose.ctypes_function(hCryptMsg)
|
||||
|
||||
@Crypt32Proxy()
|
||||
def CryptEnumOIDFunction(dwEncodingType, pszFuncName, pszOID, dwFlags, pvArg, pfnEnumOIDFunc):
|
||||
return CryptEnumOIDFunction.ctypes_function(dwEncodingType, pszFuncName, pszOID, dwFlags, pvArg, pfnEnumOIDFunc)
|
||||
|
||||
@Crypt32Proxy()
|
||||
def CryptGetOIDFunctionValue(dwEncodingType, pszFuncName, pszOID, pwszValueName, pdwValueType, pbValueData, pcbValueData):
|
||||
return CryptGetOIDFunctionValue.ctypes_function(dwEncodingType, pszFuncName, pszOID, pwszValueName, pdwValueType, pbValueData, pcbValueData)
|
||||
|
||||
@@ -504,6 +504,31 @@ def MapViewOfFile(hFileMappingObject, dwDesiredAccess=gdef.FILE_MAP_ALL_ACCESS,
|
||||
return MapViewOfFile.ctypes_function(hFileMappingObject, dwDesiredAccess, dwFileOffsetHigh, dwFileOffsetLow, dwNumberOfBytesToMap)
|
||||
|
||||
|
||||
@Kernel32Proxy()
|
||||
def FindFirstFileA(lpFileName, lpFindFileData):
|
||||
return FindFirstFileA.ctypes_function(lpFileName, lpFindFileData)
|
||||
|
||||
|
||||
@Kernel32Proxy()
|
||||
def FindFirstFileW(lpFileName, lpFindFileData):
|
||||
return FindFirstFileW.ctypes_function(lpFileName, lpFindFileData)
|
||||
|
||||
|
||||
@Kernel32Proxy()
|
||||
def FindNextFileA(hFindFile, lpFindFileData):
|
||||
return FindNextFileA.ctypes_function(hFindFile, lpFindFileData)
|
||||
|
||||
|
||||
@Kernel32Proxy()
|
||||
def FindNextFileW(hFindFile, lpFindFileData):
|
||||
return FindNextFileW.ctypes_function(hFindFile, lpFindFileData)
|
||||
|
||||
|
||||
@Kernel32Proxy()
|
||||
def FindClose(hFindFile):
|
||||
return FindClose.ctypes_function(hFindFile)
|
||||
|
||||
|
||||
## Tlhelp (snapshoot)
|
||||
|
||||
@Kernel32Proxy()
|
||||
|
||||
@@ -362,6 +362,12 @@ def NtQueryValueKey(KeyHandle, ValueName, KeyValueInformationClass, KeyValueInfo
|
||||
def NtEnumerateValueKey(KeyHandle, Index, KeyValueInformationClass, KeyValueInformation, Length, ResultLength):
|
||||
return NtEnumerateValueKey.ctypes_function(KeyHandle, Index, KeyValueInformationClass, KeyValueInformation, Length, ResultLength)
|
||||
|
||||
@NtdllProxy()
|
||||
def NtDeleteValueKey(KeyHandle, ValueName):
|
||||
if isinstance(ValueName, basestring):
|
||||
ValueName = gdef.UNICODE_STRING.from_string(ValueName)
|
||||
return NtDeleteValueKey.ctypes_function(KeyHandle, ValueName)
|
||||
|
||||
@NtdllProxy()
|
||||
def NtQueryLicenseValue(Name, Type, Buffer, Length=None, DataLength=NeededParameter):
|
||||
if Length is None and Buffer:
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
import ctypes
|
||||
import windows.generated_def as gdef
|
||||
|
||||
from ..apiproxy import ApiProxy, NeededParameter
|
||||
from ..error import no_error_check, result_is_error_code
|
||||
|
||||
class VirtDiskProxy(ApiProxy):
|
||||
APIDLL = "virtdisk"
|
||||
default_error_check = staticmethod(result_is_error_code)
|
||||
|
||||
|
||||
@VirtDiskProxy()
|
||||
def OpenVirtualDisk(VirtualStorageType, Path, VirtualDiskAccessMask, Flags, Parameters, Handle):
|
||||
return OpenVirtualDisk.ctypes_function(VirtualStorageType, Path, VirtualDiskAccessMask, Flags, Parameters, Handle)
|
||||
|
||||
@VirtDiskProxy()
|
||||
def AttachVirtualDisk(VirtualDiskHandle, SecurityDescriptor, Flags, ProviderSpecificFlags, Parameters, Overlapped):
|
||||
return AttachVirtualDisk.ctypes_function(VirtualDiskHandle, SecurityDescriptor, Flags, ProviderSpecificFlags, Parameters, Overlapped)
|
||||
@@ -9,6 +9,12 @@ class WevtapiProxy(ApiProxy):
|
||||
default_error_check = staticmethod(fail_on_zero)
|
||||
|
||||
|
||||
# Session
|
||||
|
||||
@WevtapiProxy()
|
||||
def EvtOpenSession(LoginClass, Login, Timeout=0, Flags=0):
|
||||
return EvtOpenSession.ctypes_function(LoginClass, Login, Timeout, Flags)
|
||||
|
||||
# Event
|
||||
|
||||
@WevtapiProxy()
|
||||
|
||||
Reference in New Issue
Block a user