mirror of
https://github.com/hakril/PythonForWindows
synced 2026-06-08 14:31:45 +00:00
Add windows.pipe for simpler communication with injected process
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
#define PIPE_ACCESS_INBOUND 0x00000001
|
||||
#define PIPE_ACCESS_OUTBOUND 0x00000002
|
||||
#define PIPE_ACCESS_DUPLEX 0x00000003
|
||||
|
||||
//
|
||||
// Define the Named Pipe End flags for GetNamedPipeInfo
|
||||
//
|
||||
|
||||
#define PIPE_CLIENT_END 0x00000000
|
||||
#define PIPE_SERVER_END 0x00000001
|
||||
|
||||
//
|
||||
// Define the dwPipeMode values for CreateNamedPipe
|
||||
//
|
||||
|
||||
#define PIPE_WAIT 0x00000000
|
||||
#define PIPE_NOWAIT 0x00000001
|
||||
#define PIPE_READMODE_BYTE 0x00000000
|
||||
#define PIPE_READMODE_MESSAGE 0x00000002
|
||||
#define PIPE_TYPE_BYTE 0x00000000
|
||||
#define PIPE_TYPE_MESSAGE 0x00000004
|
||||
#define PIPE_ACCEPT_REMOTE_CLIENTS 0x00000000
|
||||
#define PIPE_REJECT_REMOTE_CLIENTS 0x00000008
|
||||
|
||||
//
|
||||
// Define the well known values for CreateNamedPipe nMaxInstances
|
||||
//
|
||||
|
||||
#define PIPE_UNLIMITED_INSTANCES 255
|
||||
|
||||
|
||||
#define NMPWAIT_WAIT_FOREVER 0xffffffff
|
||||
#define NMPWAIT_NOWAIT 0x00000001
|
||||
#define NMPWAIT_USE_DEFAULT_WAIT 0x00000000
|
||||
@@ -501,4 +501,11 @@
|
||||
#define RPC_S_UNKNOWN_IF 1717
|
||||
#define RPC_S_PROTOCOL_ERROR 1728
|
||||
#define RPC_S_UNSUPPORTED_TRANS_SYN 1730
|
||||
#define RPC_S_PROCNUM_OUT_OF_RANGE 1745
|
||||
#define RPC_S_PROCNUM_OUT_OF_RANGE 1745
|
||||
|
||||
#define ERROR_INVALID_TRANSACTION 6700
|
||||
#define ERROR_TRANSACTION_NOT_ACTIVE 6701
|
||||
#define ERROR_TRANSACTION_REQUEST_NOT_VALID 6702
|
||||
#define ERROR_TRANSACTION_NOT_REQUESTED 6703
|
||||
#define ERROR_TRANSACTION_ALREADY_ABORTED 6704
|
||||
#define ERROR_TRANSACTION_ALREADY_COMMITTED 6705
|
||||
@@ -0,0 +1,35 @@
|
||||
HANDLE WINAPI CreateNamedPipeA(
|
||||
_In_ LPCSTR lpName,
|
||||
_In_ DWORD dwOpenMode,
|
||||
_In_ DWORD dwPipeMode,
|
||||
_In_ DWORD nMaxInstances,
|
||||
_In_ DWORD nOutBufferSize,
|
||||
_In_ DWORD nInBufferSize,
|
||||
_In_ DWORD nDefaultTimeOut,
|
||||
_In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes
|
||||
);
|
||||
|
||||
HANDLE WINAPI CreateNamedPipeW(
|
||||
_In_ LPWSTR lpName,
|
||||
_In_ DWORD dwOpenMode,
|
||||
_In_ DWORD dwPipeMode,
|
||||
_In_ DWORD nMaxInstances,
|
||||
_In_ DWORD nOutBufferSize,
|
||||
_In_ DWORD nInBufferSize,
|
||||
_In_ DWORD nDefaultTimeOut,
|
||||
_In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes
|
||||
);
|
||||
|
||||
|
||||
BOOL WINAPI ConnectNamedPipe(
|
||||
_In_ HANDLE hNamedPipe,
|
||||
_Inout_opt_ LPOVERLAPPED lpOverlapped
|
||||
);
|
||||
|
||||
|
||||
BOOL WINAPI SetNamedPipeHandleState(
|
||||
_In_ HANDLE hNamedPipe,
|
||||
_In_opt_ LPDWORD lpMode,
|
||||
_In_opt_ LPDWORD lpMaxCollectionCount,
|
||||
_In_opt_ LPDWORD lpCollectDataTimeout
|
||||
);
|
||||
+1097
-1074
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,46 @@
|
||||
import windows.pipe
|
||||
from pfwtest import *
|
||||
|
||||
import time
|
||||
|
||||
PIPE_NAME = "PFW_Test_Pipe"
|
||||
|
||||
rcode_test_ipc_pipe = """
|
||||
import windows
|
||||
windows.pipe.send_object("{pipe}", {{'Hello': 2}})
|
||||
"""
|
||||
|
||||
def test_ipc_pipe(proc32_64):
|
||||
with windows.pipe.create(PIPE_NAME) as np:
|
||||
proc32_64.execute_python(rcode_test_ipc_pipe.format(pipe=PIPE_NAME))
|
||||
obj = np.recv()
|
||||
assert obj == {'Hello': 2}
|
||||
|
||||
|
||||
rcode_test_echo_pipe = """
|
||||
import windows
|
||||
|
||||
|
||||
with windows.pipe.create("{pipe}") as np:
|
||||
np.wait_connection()
|
||||
obj = np.recv()
|
||||
np.send(obj)
|
||||
"""
|
||||
|
||||
def test_pipe_echo_server(proc32_64):
|
||||
t = proc32_64.execute_python_unsafe(rcode_test_echo_pipe.format(pipe=PIPE_NAME))
|
||||
time.sleep(0.5)
|
||||
assert not t.is_exit
|
||||
obj = {'MYPID': windows.current_process.pid}
|
||||
pipe = windows.pipe.connect(PIPE_NAME)
|
||||
pipe.send(obj)
|
||||
echoobj = pipe.recv()
|
||||
assert obj == echoobj
|
||||
|
||||
def test_pipe_recv_object(proc32_64):
|
||||
# not the good way to do the exchange (race possible)
|
||||
# Just for the sake of the test
|
||||
proc32_64.execute_python_unsafe(rcode_test_ipc_pipe.format(pipe=PIPE_NAME))
|
||||
obj = windows.pipe.recv_object(PIPE_NAME)
|
||||
assert obj == {'Hello': 2}
|
||||
|
||||
@@ -35,5 +35,6 @@ import windows.debug
|
||||
import windows.wintrust
|
||||
import windows.syswow64
|
||||
import windows.com
|
||||
import windows.pipe
|
||||
|
||||
__all__ = ["system", 'current_process', 'current_thread']
|
||||
|
||||
File diff suppressed because one or more lines are too long
+1097
-1074
File diff suppressed because it is too large
Load Diff
+293
-273
@@ -29,250 +29,40 @@ RollbackTransactionParams = ((1, 'TransactionHandle'),)
|
||||
OpenTransactionPrototype = WINFUNCTYPE(HANDLE, DWORD, LPGUID)
|
||||
OpenTransactionParams = ((1, 'dwDesiredAccess'), (1, 'TransactionId'))
|
||||
|
||||
#def TpCallbackSendAlpcMessageOnCompletion(TpHandle, PortHandle, Flags, SendMessage):
|
||||
# return TpCallbackSendAlpcMessageOnCompletion.ctypes_function(TpHandle, PortHandle, Flags, SendMessage)
|
||||
TpCallbackSendAlpcMessageOnCompletionPrototype = WINFUNCTYPE(NTSTATUS, HANDLE, HANDLE, ULONG, PPORT_MESSAGE)
|
||||
TpCallbackSendAlpcMessageOnCompletionParams = ((1, 'TpHandle'), (1, 'PortHandle'), (1, 'Flags'), (1, 'SendMessage'))
|
||||
#def OpenEventLogA(lpUNCServerName, lpSourceName):
|
||||
# return OpenEventLogA.ctypes_function(lpUNCServerName, lpSourceName)
|
||||
OpenEventLogAPrototype = WINFUNCTYPE(HANDLE, LPCSTR, LPCSTR)
|
||||
OpenEventLogAParams = ((1, 'lpUNCServerName'), (1, 'lpSourceName'))
|
||||
|
||||
#def CryptCATAdminCalcHashFromFileHandle(hFile, pcbHash, pbHash, dwFlags):
|
||||
# return CryptCATAdminCalcHashFromFileHandle.ctypes_function(hFile, pcbHash, pbHash, dwFlags)
|
||||
CryptCATAdminCalcHashFromFileHandlePrototype = WINFUNCTYPE(BOOL, HANDLE, POINTER(DWORD), POINTER(BYTE), DWORD)
|
||||
CryptCATAdminCalcHashFromFileHandleParams = ((1, 'hFile'), (1, 'pcbHash'), (1, 'pbHash'), (1, 'dwFlags'))
|
||||
#def OpenEventLogW(lpUNCServerName, lpSourceName):
|
||||
# return OpenEventLogW.ctypes_function(lpUNCServerName, lpSourceName)
|
||||
OpenEventLogWPrototype = WINFUNCTYPE(HANDLE, LPWSTR, LPWSTR)
|
||||
OpenEventLogWParams = ((1, 'lpUNCServerName'), (1, 'lpSourceName'))
|
||||
|
||||
#def CryptCATAdminEnumCatalogFromHash(hCatAdmin, pbHash, cbHash, dwFlags, phPrevCatInfo):
|
||||
# return CryptCATAdminEnumCatalogFromHash.ctypes_function(hCatAdmin, pbHash, cbHash, dwFlags, phPrevCatInfo)
|
||||
CryptCATAdminEnumCatalogFromHashPrototype = WINFUNCTYPE(HCATINFO, HCATADMIN, POINTER(BYTE), DWORD, DWORD, POINTER(HCATINFO))
|
||||
CryptCATAdminEnumCatalogFromHashParams = ((1, 'hCatAdmin'), (1, 'pbHash'), (1, 'cbHash'), (1, 'dwFlags'), (1, 'phPrevCatInfo'))
|
||||
#def ReadEventLogA(hEventLog, dwReadFlags, dwRecordOffset, lpBuffer, nNumberOfBytesToRead, pnBytesRead, pnMinNumberOfBytesNeeded):
|
||||
# return ReadEventLogA.ctypes_function(hEventLog, dwReadFlags, dwRecordOffset, lpBuffer, nNumberOfBytesToRead, pnBytesRead, pnMinNumberOfBytesNeeded)
|
||||
ReadEventLogAPrototype = WINFUNCTYPE(BOOL, HANDLE, DWORD, DWORD, LPVOID, DWORD, POINTER(DWORD), POINTER(DWORD))
|
||||
ReadEventLogAParams = ((1, 'hEventLog'), (1, 'dwReadFlags'), (1, 'dwRecordOffset'), (1, 'lpBuffer'), (1, 'nNumberOfBytesToRead'), (1, 'pnBytesRead'), (1, 'pnMinNumberOfBytesNeeded'))
|
||||
|
||||
#def CryptCATAdminAcquireContext(phCatAdmin, pgSubsystem, dwFlags):
|
||||
# return CryptCATAdminAcquireContext.ctypes_function(phCatAdmin, pgSubsystem, dwFlags)
|
||||
CryptCATAdminAcquireContextPrototype = WINFUNCTYPE(BOOL, POINTER(HCATADMIN), POINTER(GUID), DWORD)
|
||||
CryptCATAdminAcquireContextParams = ((1, 'phCatAdmin'), (1, 'pgSubsystem'), (1, 'dwFlags'))
|
||||
#def ReadEventLogW(hEventLog, dwReadFlags, dwRecordOffset, lpBuffer, nNumberOfBytesToRead, pnBytesRead, pnMinNumberOfBytesNeeded):
|
||||
# return ReadEventLogW.ctypes_function(hEventLog, dwReadFlags, dwRecordOffset, lpBuffer, nNumberOfBytesToRead, pnBytesRead, pnMinNumberOfBytesNeeded)
|
||||
ReadEventLogWPrototype = WINFUNCTYPE(BOOL, HANDLE, DWORD, DWORD, LPVOID, DWORD, POINTER(DWORD), POINTER(DWORD))
|
||||
ReadEventLogWParams = ((1, 'hEventLog'), (1, 'dwReadFlags'), (1, 'dwRecordOffset'), (1, 'lpBuffer'), (1, 'nNumberOfBytesToRead'), (1, 'pnBytesRead'), (1, 'pnMinNumberOfBytesNeeded'))
|
||||
|
||||
#def CryptCATCatalogInfoFromContext(hCatInfo, psCatInfo, dwFlags):
|
||||
# return CryptCATCatalogInfoFromContext.ctypes_function(hCatInfo, psCatInfo, dwFlags)
|
||||
CryptCATCatalogInfoFromContextPrototype = WINFUNCTYPE(BOOL, HCATINFO, POINTER(CATALOG_INFO), DWORD)
|
||||
CryptCATCatalogInfoFromContextParams = ((1, 'hCatInfo'), (1, 'psCatInfo'), (1, 'dwFlags'))
|
||||
#def GetEventLogInformation(hEventLog, dwInfoLevel, lpBuffer, cbBufSize, pcbBytesNeeded):
|
||||
# return GetEventLogInformation.ctypes_function(hEventLog, dwInfoLevel, lpBuffer, cbBufSize, pcbBytesNeeded)
|
||||
GetEventLogInformationPrototype = WINFUNCTYPE(BOOL, HANDLE, DWORD, LPVOID, DWORD, LPDWORD)
|
||||
GetEventLogInformationParams = ((1, 'hEventLog'), (1, 'dwInfoLevel'), (1, 'lpBuffer'), (1, 'cbBufSize'), (1, 'pcbBytesNeeded'))
|
||||
|
||||
#def CryptCATAdminReleaseCatalogContext(hCatAdmin, hCatInfo, dwFlags):
|
||||
# return CryptCATAdminReleaseCatalogContext.ctypes_function(hCatAdmin, hCatInfo, dwFlags)
|
||||
CryptCATAdminReleaseCatalogContextPrototype = WINFUNCTYPE(BOOL, HCATADMIN, HCATINFO, DWORD)
|
||||
CryptCATAdminReleaseCatalogContextParams = ((1, 'hCatAdmin'), (1, 'hCatInfo'), (1, 'dwFlags'))
|
||||
#def GetNumberOfEventLogRecords(hEventLog, NumberOfRecords):
|
||||
# return GetNumberOfEventLogRecords.ctypes_function(hEventLog, NumberOfRecords)
|
||||
GetNumberOfEventLogRecordsPrototype = WINFUNCTYPE(BOOL, HANDLE, PDWORD)
|
||||
GetNumberOfEventLogRecordsParams = ((1, 'hEventLog'), (1, 'NumberOfRecords'))
|
||||
|
||||
#def CryptCATAdminReleaseContext(hCatAdmin, dwFlags):
|
||||
# return CryptCATAdminReleaseContext.ctypes_function(hCatAdmin, dwFlags)
|
||||
CryptCATAdminReleaseContextPrototype = WINFUNCTYPE(BOOL, HCATADMIN, DWORD)
|
||||
CryptCATAdminReleaseContextParams = ((1, 'hCatAdmin'), (1, 'dwFlags'))
|
||||
|
||||
#def CryptCATGetAttrInfo(hCatalog, pCatMember, pwszReferenceTag):
|
||||
# return CryptCATGetAttrInfo.ctypes_function(hCatalog, pCatMember, pwszReferenceTag)
|
||||
CryptCATGetAttrInfoPrototype = WINFUNCTYPE(POINTER(CRYPTCATATTRIBUTE), HANDLE, POINTER(CRYPTCATMEMBER), LPWSTR)
|
||||
CryptCATGetAttrInfoParams = ((1, 'hCatalog'), (1, 'pCatMember'), (1, 'pwszReferenceTag'))
|
||||
|
||||
#def CryptCATGetMemberInfo(hCatalog, pwszReferenceTag):
|
||||
# return CryptCATGetMemberInfo.ctypes_function(hCatalog, pwszReferenceTag)
|
||||
CryptCATGetMemberInfoPrototype = WINFUNCTYPE(POINTER(CRYPTCATMEMBER), HANDLE, LPWSTR)
|
||||
CryptCATGetMemberInfoParams = ((1, 'hCatalog'), (1, 'pwszReferenceTag'))
|
||||
|
||||
#def CryptCATGetAttrInfo(hCatalog, pCatMember, pwszReferenceTag):
|
||||
# return CryptCATGetAttrInfo.ctypes_function(hCatalog, pCatMember, pwszReferenceTag)
|
||||
CryptCATGetAttrInfoPrototype = WINFUNCTYPE(POINTER(CRYPTCATATTRIBUTE), HANDLE, POINTER(CRYPTCATMEMBER), LPWSTR)
|
||||
CryptCATGetAttrInfoParams = ((1, 'hCatalog'), (1, 'pCatMember'), (1, 'pwszReferenceTag'))
|
||||
|
||||
#def CryptCATEnumerateCatAttr(hCatalog, pPrevAttr):
|
||||
# return CryptCATEnumerateCatAttr.ctypes_function(hCatalog, pPrevAttr)
|
||||
CryptCATEnumerateCatAttrPrototype = WINFUNCTYPE(POINTER(CRYPTCATATTRIBUTE), HANDLE, POINTER(CRYPTCATATTRIBUTE))
|
||||
CryptCATEnumerateCatAttrParams = ((1, 'hCatalog'), (1, 'pPrevAttr'))
|
||||
|
||||
#def CryptCATEnumerateAttr(hCatalog, pCatMember, pPrevAttr):
|
||||
# return CryptCATEnumerateAttr.ctypes_function(hCatalog, pCatMember, pPrevAttr)
|
||||
CryptCATEnumerateAttrPrototype = WINFUNCTYPE(POINTER(CRYPTCATATTRIBUTE), HANDLE, POINTER(CRYPTCATMEMBER), POINTER(CRYPTCATATTRIBUTE))
|
||||
CryptCATEnumerateAttrParams = ((1, 'hCatalog'), (1, 'pCatMember'), (1, 'pPrevAttr'))
|
||||
|
||||
#def CryptCATEnumerateMember(hCatalog, pPrevMember):
|
||||
# return CryptCATEnumerateMember.ctypes_function(hCatalog, pPrevMember)
|
||||
CryptCATEnumerateMemberPrototype = WINFUNCTYPE(POINTER(CRYPTCATMEMBER), HANDLE, POINTER(CRYPTCATMEMBER))
|
||||
CryptCATEnumerateMemberParams = ((1, 'hCatalog'), (1, 'pPrevMember'))
|
||||
|
||||
#def CryptQueryObject(dwObjectType, pvObject, dwExpectedContentTypeFlags, dwExpectedFormatTypeFlags, dwFlags, pdwMsgAndCertEncodingType, pdwContentType, pdwFormatType, phCertStore, phMsg, ppvContext):
|
||||
# return CryptQueryObject.ctypes_function(dwObjectType, pvObject, dwExpectedContentTypeFlags, dwExpectedFormatTypeFlags, dwFlags, pdwMsgAndCertEncodingType, pdwContentType, pdwFormatType, phCertStore, phMsg, ppvContext)
|
||||
CryptQueryObjectPrototype = WINFUNCTYPE(BOOL, DWORD, PVOID, DWORD, DWORD, DWORD, POINTER(DWORD), POINTER(DWORD), POINTER(DWORD), POINTER(HCERTSTORE), POINTER(HCRYPTMSG), POINTER(PVOID))
|
||||
CryptQueryObjectParams = ((1, 'dwObjectType'), (1, 'pvObject'), (1, 'dwExpectedContentTypeFlags'), (1, 'dwExpectedFormatTypeFlags'), (1, 'dwFlags'), (1, 'pdwMsgAndCertEncodingType'), (1, 'pdwContentType'), (1, 'pdwFormatType'), (1, 'phCertStore'), (1, 'phMsg'), (1, 'ppvContext'))
|
||||
|
||||
#def CryptMsgGetParam(hCryptMsg, dwParamType, dwIndex, pvData, pcbData):
|
||||
# return CryptMsgGetParam.ctypes_function(hCryptMsg, dwParamType, dwIndex, pvData, pcbData)
|
||||
CryptMsgGetParamPrototype = WINFUNCTYPE(BOOL, HCRYPTMSG, DWORD, DWORD, PVOID, POINTER(DWORD))
|
||||
CryptMsgGetParamParams = ((1, 'hCryptMsg'), (1, 'dwParamType'), (1, 'dwIndex'), (1, 'pvData'), (1, 'pcbData'))
|
||||
|
||||
#def CryptDecodeObject(dwCertEncodingType, lpszStructType, pbEncoded, cbEncoded, dwFlags, pvStructInfo, pcbStructInfo):
|
||||
# return CryptDecodeObject.ctypes_function(dwCertEncodingType, lpszStructType, pbEncoded, cbEncoded, dwFlags, pvStructInfo, pcbStructInfo)
|
||||
CryptDecodeObjectPrototype = WINFUNCTYPE(BOOL, DWORD, LPCSTR, POINTER(BYTE), DWORD, DWORD, PVOID, POINTER(DWORD))
|
||||
CryptDecodeObjectParams = ((1, 'dwCertEncodingType'), (1, 'lpszStructType'), (1, 'pbEncoded'), (1, 'cbEncoded'), (1, 'dwFlags'), (1, 'pvStructInfo'), (1, 'pcbStructInfo'))
|
||||
|
||||
#def CertFindCertificateInStore(hCertStore, dwCertEncodingType, dwFindFlags, dwFindType, pvFindPara, pPrevCertContext):
|
||||
# return CertFindCertificateInStore.ctypes_function(hCertStore, dwCertEncodingType, dwFindFlags, dwFindType, pvFindPara, pPrevCertContext)
|
||||
CertFindCertificateInStorePrototype = WINFUNCTYPE(PCCERT_CONTEXT, HCERTSTORE, DWORD, DWORD, DWORD, PVOID, PCCERT_CONTEXT)
|
||||
CertFindCertificateInStoreParams = ((1, 'hCertStore'), (1, 'dwCertEncodingType'), (1, 'dwFindFlags'), (1, 'dwFindType'), (1, 'pvFindPara'), (1, 'pPrevCertContext'))
|
||||
|
||||
#def CertGetNameStringA(pCertContext, dwType, dwFlags, pvTypePara, pszNameString, cchNameString):
|
||||
# return CertGetNameStringA.ctypes_function(pCertContext, dwType, dwFlags, pvTypePara, pszNameString, cchNameString)
|
||||
CertGetNameStringAPrototype = WINFUNCTYPE(DWORD, PCCERT_CONTEXT, DWORD, DWORD, PVOID, LPCSTR, DWORD)
|
||||
CertGetNameStringAParams = ((1, 'pCertContext'), (1, 'dwType'), (1, 'dwFlags'), (1, 'pvTypePara'), (1, 'pszNameString'), (1, 'cchNameString'))
|
||||
|
||||
#def CertGetNameStringW(pCertContext, dwType, dwFlags, pvTypePara, pszNameString, cchNameString):
|
||||
# return CertGetNameStringW.ctypes_function(pCertContext, dwType, dwFlags, pvTypePara, pszNameString, cchNameString)
|
||||
CertGetNameStringWPrototype = WINFUNCTYPE(DWORD, PCCERT_CONTEXT, DWORD, DWORD, PVOID, LPWSTR, DWORD)
|
||||
CertGetNameStringWParams = ((1, 'pCertContext'), (1, 'dwType'), (1, 'dwFlags'), (1, 'pvTypePara'), (1, 'pszNameString'), (1, 'cchNameString'))
|
||||
|
||||
#def CertGetCertificateChain(hChainEngine, pCertContext, pTime, hAdditionalStore, pChainPara, dwFlags, pvReserved, ppChainContext):
|
||||
# return CertGetCertificateChain.ctypes_function(hChainEngine, pCertContext, pTime, hAdditionalStore, pChainPara, dwFlags, pvReserved, ppChainContext)
|
||||
CertGetCertificateChainPrototype = WINFUNCTYPE(BOOL, HCERTCHAINENGINE, PCCERT_CONTEXT, LPFILETIME, HCERTSTORE, PCERT_CHAIN_PARA, DWORD, LPVOID, POINTER(PCCERT_CHAIN_CONTEXT))
|
||||
CertGetCertificateChainParams = ((1, 'hChainEngine'), (1, 'pCertContext'), (1, 'pTime'), (1, 'hAdditionalStore'), (1, 'pChainPara'), (1, 'dwFlags'), (1, 'pvReserved'), (1, 'ppChainContext'))
|
||||
|
||||
#def CertCreateSelfSignCertificate(hCryptProvOrNCryptKey, pSubjectIssuerBlob, dwFlags, pKeyProvInfo, pSignatureAlgorithm, pStartTime, pEndTime, pExtensions):
|
||||
# return CertCreateSelfSignCertificate.ctypes_function(hCryptProvOrNCryptKey, pSubjectIssuerBlob, dwFlags, pKeyProvInfo, pSignatureAlgorithm, pStartTime, pEndTime, pExtensions)
|
||||
CertCreateSelfSignCertificatePrototype = WINFUNCTYPE(PCCERT_CONTEXT, HCRYPTPROV_OR_NCRYPT_KEY_HANDLE, PCERT_NAME_BLOB, DWORD, PCRYPT_KEY_PROV_INFO, PCRYPT_ALGORITHM_IDENTIFIER, PSYSTEMTIME, PSYSTEMTIME, PCERT_EXTENSIONS)
|
||||
CertCreateSelfSignCertificateParams = ((1, 'hCryptProvOrNCryptKey'), (1, 'pSubjectIssuerBlob'), (1, 'dwFlags'), (1, 'pKeyProvInfo'), (1, 'pSignatureAlgorithm'), (1, 'pStartTime'), (1, 'pEndTime'), (1, 'pExtensions'))
|
||||
|
||||
#def CertStrToNameA(dwCertEncodingType, pszX500, dwStrType, pvReserved, pbEncoded, pcbEncoded, ppszError):
|
||||
# return CertStrToNameA.ctypes_function(dwCertEncodingType, pszX500, dwStrType, pvReserved, pbEncoded, pcbEncoded, ppszError)
|
||||
CertStrToNameAPrototype = WINFUNCTYPE(BOOL, DWORD, LPCSTR, DWORD, PVOID, POINTER(BYTE), POINTER(DWORD), POINTER(LPCSTR))
|
||||
CertStrToNameAParams = ((1, 'dwCertEncodingType'), (1, 'pszX500'), (1, 'dwStrType'), (1, 'pvReserved'), (1, 'pbEncoded'), (1, 'pcbEncoded'), (1, 'ppszError'))
|
||||
|
||||
#def CertStrToNameW(dwCertEncodingType, pszX500, dwStrType, pvReserved, pbEncoded, pcbEncoded, ppszError):
|
||||
# return CertStrToNameW.ctypes_function(dwCertEncodingType, pszX500, dwStrType, pvReserved, pbEncoded, pcbEncoded, ppszError)
|
||||
CertStrToNameWPrototype = WINFUNCTYPE(BOOL, DWORD, LPWSTR, DWORD, PVOID, POINTER(BYTE), POINTER(DWORD), POINTER(LPWSTR))
|
||||
CertStrToNameWParams = ((1, 'dwCertEncodingType'), (1, 'pszX500'), (1, 'dwStrType'), (1, 'pvReserved'), (1, 'pbEncoded'), (1, 'pcbEncoded'), (1, 'ppszError'))
|
||||
|
||||
#def CertOpenStore(lpszStoreProvider, dwMsgAndCertEncodingType, hCryptProv, dwFlags, pvPara):
|
||||
# return CertOpenStore.ctypes_function(lpszStoreProvider, dwMsgAndCertEncodingType, hCryptProv, dwFlags, pvPara)
|
||||
CertOpenStorePrototype = WINFUNCTYPE(HCERTSTORE, LPCSTR, DWORD, HCRYPTPROV_LEGACY, DWORD, PVOID)
|
||||
CertOpenStoreParams = ((1, 'lpszStoreProvider'), (1, 'dwMsgAndCertEncodingType'), (1, 'hCryptProv'), (1, 'dwFlags'), (1, 'pvPara'))
|
||||
|
||||
#def CertAddCertificateContextToStore(hCertStore, pCertContext, dwAddDisposition, ppStoreContext):
|
||||
# return CertAddCertificateContextToStore.ctypes_function(hCertStore, pCertContext, dwAddDisposition, ppStoreContext)
|
||||
CertAddCertificateContextToStorePrototype = WINFUNCTYPE(BOOL, HCERTSTORE, PCCERT_CONTEXT, DWORD, POINTER(PCCERT_CONTEXT))
|
||||
CertAddCertificateContextToStoreParams = ((1, 'hCertStore'), (1, 'pCertContext'), (1, 'dwAddDisposition'), (1, 'ppStoreContext'))
|
||||
|
||||
#def PFXExportCertStoreEx(hStore, pPFX, szPassword, pvPara, dwFlags):
|
||||
# return PFXExportCertStoreEx.ctypes_function(hStore, pPFX, szPassword, pvPara, dwFlags)
|
||||
PFXExportCertStoreExPrototype = WINFUNCTYPE(BOOL, HCERTSTORE, POINTER(CRYPT_DATA_BLOB), LPCWSTR, PVOID, DWORD)
|
||||
PFXExportCertStoreExParams = ((1, 'hStore'), (1, 'pPFX'), (1, 'szPassword'), (1, 'pvPara'), (1, 'dwFlags'))
|
||||
|
||||
#def PFXImportCertStore(pPFX, szPassword, dwFlags):
|
||||
# return PFXImportCertStore.ctypes_function(pPFX, szPassword, dwFlags)
|
||||
PFXImportCertStorePrototype = WINFUNCTYPE(HCERTSTORE, POINTER(CRYPT_DATA_BLOB), LPCWSTR, DWORD)
|
||||
PFXImportCertStoreParams = ((1, 'pPFX'), (1, 'szPassword'), (1, 'dwFlags'))
|
||||
|
||||
#def CryptGenKey(hProv, Algid, dwFlags, phKey):
|
||||
# return CryptGenKey.ctypes_function(hProv, Algid, dwFlags, phKey)
|
||||
CryptGenKeyPrototype = WINFUNCTYPE(BOOL, HCRYPTPROV, ALG_ID, DWORD, POINTER(HCRYPTKEY))
|
||||
CryptGenKeyParams = ((1, 'hProv'), (1, 'Algid'), (1, 'dwFlags'), (1, 'phKey'))
|
||||
|
||||
#def CryptDestroyKey(hKey):
|
||||
# return CryptDestroyKey.ctypes_function(hKey)
|
||||
CryptDestroyKeyPrototype = WINFUNCTYPE(BOOL, HCRYPTKEY)
|
||||
CryptDestroyKeyParams = ((1, 'hKey'),)
|
||||
|
||||
#def CryptAcquireContextA(phProv, pszContainer, pszProvider, dwProvType, dwFlags):
|
||||
# return CryptAcquireContextA.ctypes_function(phProv, pszContainer, pszProvider, dwProvType, dwFlags)
|
||||
CryptAcquireContextAPrototype = WINFUNCTYPE(BOOL, POINTER(HCRYPTPROV), LPCSTR, LPCSTR, DWORD, DWORD)
|
||||
CryptAcquireContextAParams = ((1, 'phProv'), (1, 'pszContainer'), (1, 'pszProvider'), (1, 'dwProvType'), (1, 'dwFlags'))
|
||||
|
||||
#def CryptAcquireContextW(phProv, pszContainer, pszProvider, dwProvType, dwFlags):
|
||||
# return CryptAcquireContextW.ctypes_function(phProv, pszContainer, pszProvider, dwProvType, dwFlags)
|
||||
CryptAcquireContextWPrototype = WINFUNCTYPE(BOOL, POINTER(HCRYPTPROV), LPWSTR, LPWSTR, DWORD, DWORD)
|
||||
CryptAcquireContextWParams = ((1, 'phProv'), (1, 'pszContainer'), (1, 'pszProvider'), (1, 'dwProvType'), (1, 'dwFlags'))
|
||||
|
||||
#def CryptReleaseContext(hProv, dwFlags):
|
||||
# return CryptReleaseContext.ctypes_function(hProv, dwFlags)
|
||||
CryptReleaseContextPrototype = WINFUNCTYPE(BOOL, HCRYPTPROV, DWORD)
|
||||
CryptReleaseContextParams = ((1, 'hProv'), (1, 'dwFlags'))
|
||||
|
||||
#def CryptExportKey(hKey, hExpKey, dwBlobType, dwFlags, pbData, pdwDataLen):
|
||||
# return CryptExportKey.ctypes_function(hKey, hExpKey, dwBlobType, dwFlags, pbData, pdwDataLen)
|
||||
CryptExportKeyPrototype = WINFUNCTYPE(BOOL, HCRYPTKEY, HCRYPTKEY, DWORD, DWORD, POINTER(BYTE), POINTER(DWORD))
|
||||
CryptExportKeyParams = ((1, 'hKey'), (1, 'hExpKey'), (1, 'dwBlobType'), (1, 'dwFlags'), (1, 'pbData'), (1, 'pdwDataLen'))
|
||||
|
||||
#def CertGetCertificateContextProperty(pCertContext, dwPropId, pvData, pcbData):
|
||||
# return CertGetCertificateContextProperty.ctypes_function(pCertContext, dwPropId, pvData, pcbData)
|
||||
CertGetCertificateContextPropertyPrototype = WINFUNCTYPE(BOOL, PCCERT_CONTEXT, DWORD, PVOID, POINTER(DWORD))
|
||||
CertGetCertificateContextPropertyParams = ((1, 'pCertContext'), (1, 'dwPropId'), (1, 'pvData'), (1, 'pcbData'))
|
||||
|
||||
#def CertEnumCertificateContextProperties(pCertContext, dwPropId):
|
||||
# return CertEnumCertificateContextProperties.ctypes_function(pCertContext, dwPropId)
|
||||
CertEnumCertificateContextPropertiesPrototype = WINFUNCTYPE(DWORD, PCCERT_CONTEXT, DWORD)
|
||||
CertEnumCertificateContextPropertiesParams = ((1, 'pCertContext'), (1, 'dwPropId'))
|
||||
|
||||
#def CryptEncryptMessage(pEncryptPara, cRecipientCert, rgpRecipientCert, pbToBeEncrypted, cbToBeEncrypted, pbEncryptedBlob, pcbEncryptedBlob):
|
||||
# return CryptEncryptMessage.ctypes_function(pEncryptPara, cRecipientCert, rgpRecipientCert, pbToBeEncrypted, cbToBeEncrypted, pbEncryptedBlob, pcbEncryptedBlob)
|
||||
CryptEncryptMessagePrototype = WINFUNCTYPE(BOOL, PCRYPT_ENCRYPT_MESSAGE_PARA, DWORD, POINTER(PCCERT_CONTEXT), POINTER(BYTE), DWORD, POINTER(BYTE), POINTER(DWORD))
|
||||
CryptEncryptMessageParams = ((1, 'pEncryptPara'), (1, 'cRecipientCert'), (1, 'rgpRecipientCert'), (1, 'pbToBeEncrypted'), (1, 'cbToBeEncrypted'), (1, 'pbEncryptedBlob'), (1, 'pcbEncryptedBlob'))
|
||||
|
||||
#def CryptDecryptMessage(pDecryptPara, pbEncryptedBlob, cbEncryptedBlob, pbDecrypted, pcbDecrypted, ppXchgCert):
|
||||
# return CryptDecryptMessage.ctypes_function(pDecryptPara, pbEncryptedBlob, cbEncryptedBlob, pbDecrypted, pcbDecrypted, ppXchgCert)
|
||||
CryptDecryptMessagePrototype = WINFUNCTYPE(BOOL, PCRYPT_DECRYPT_MESSAGE_PARA, POINTER(BYTE), DWORD, POINTER(BYTE), POINTER(DWORD), POINTER(PCCERT_CONTEXT))
|
||||
CryptDecryptMessageParams = ((1, 'pDecryptPara'), (1, 'pbEncryptedBlob'), (1, 'cbEncryptedBlob'), (1, 'pbDecrypted'), (1, 'pcbDecrypted'), (1, 'ppXchgCert'))
|
||||
|
||||
#def CryptAcquireCertificatePrivateKey(pCert, dwFlags, pvParameters, phCryptProvOrNCryptKey, pdwKeySpec, pfCallerFreeProvOrNCryptKey):
|
||||
# return CryptAcquireCertificatePrivateKey.ctypes_function(pCert, dwFlags, pvParameters, phCryptProvOrNCryptKey, pdwKeySpec, pfCallerFreeProvOrNCryptKey)
|
||||
CryptAcquireCertificatePrivateKeyPrototype = WINFUNCTYPE(BOOL, PCCERT_CONTEXT, DWORD, PVOID, POINTER(HCRYPTPROV_OR_NCRYPT_KEY_HANDLE), POINTER(DWORD), POINTER(BOOL))
|
||||
CryptAcquireCertificatePrivateKeyParams = ((1, 'pCert'), (1, 'dwFlags'), (1, 'pvParameters'), (1, 'phCryptProvOrNCryptKey'), (1, 'pdwKeySpec'), (1, 'pfCallerFreeProvOrNCryptKey'))
|
||||
|
||||
#def CertDuplicateCertificateContext(pCertContext):
|
||||
# return CertDuplicateCertificateContext.ctypes_function(pCertContext)
|
||||
CertDuplicateCertificateContextPrototype = WINFUNCTYPE(PCCERT_CONTEXT, PCCERT_CONTEXT)
|
||||
CertDuplicateCertificateContextParams = ((1, 'pCertContext'),)
|
||||
|
||||
#def CertEnumCertificatesInStore(hCertStore, pPrevCertContext):
|
||||
# return CertEnumCertificatesInStore.ctypes_function(hCertStore, pPrevCertContext)
|
||||
CertEnumCertificatesInStorePrototype = WINFUNCTYPE(PCCERT_CONTEXT, HCERTSTORE, PCCERT_CONTEXT)
|
||||
CertEnumCertificatesInStoreParams = ((1, 'hCertStore'), (1, 'pPrevCertContext'))
|
||||
|
||||
#def CryptEncodeObjectEx(dwCertEncodingType, lpszStructType, pvStructInfo, dwFlags, pEncodePara, pvEncoded, pcbEncoded):
|
||||
# return CryptEncodeObjectEx.ctypes_function(dwCertEncodingType, lpszStructType, pvStructInfo, dwFlags, pEncodePara, pvEncoded, pcbEncoded)
|
||||
CryptEncodeObjectExPrototype = WINFUNCTYPE(BOOL, DWORD, LPCSTR, PVOID, DWORD, PCRYPT_ENCODE_PARA, PVOID, POINTER(DWORD))
|
||||
CryptEncodeObjectExParams = ((1, 'dwCertEncodingType'), (1, 'lpszStructType'), (1, 'pvStructInfo'), (1, 'dwFlags'), (1, 'pEncodePara'), (1, 'pvEncoded'), (1, 'pcbEncoded'))
|
||||
|
||||
#def CertCreateCertificateContext(dwCertEncodingType, pbCertEncoded, cbCertEncoded):
|
||||
# return CertCreateCertificateContext.ctypes_function(dwCertEncodingType, pbCertEncoded, cbCertEncoded)
|
||||
CertCreateCertificateContextPrototype = WINFUNCTYPE(PCCERT_CONTEXT, DWORD, POINTER(BYTE), DWORD)
|
||||
CertCreateCertificateContextParams = ((1, 'dwCertEncodingType'), (1, 'pbCertEncoded'), (1, 'cbCertEncoded'))
|
||||
|
||||
#def CertCompareCertificate(dwCertEncodingType, pCertId1, pCertId2):
|
||||
# return CertCompareCertificate.ctypes_function(dwCertEncodingType, pCertId1, pCertId2)
|
||||
CertCompareCertificatePrototype = WINFUNCTYPE(BOOL, DWORD, PCERT_INFO, PCERT_INFO)
|
||||
CertCompareCertificateParams = ((1, 'dwCertEncodingType'), (1, 'pCertId1'), (1, 'pCertId2'))
|
||||
|
||||
#def CertEnumCTLsInStore(hCertStore, pPrevCtlContext):
|
||||
# return CertEnumCTLsInStore.ctypes_function(hCertStore, pPrevCtlContext)
|
||||
CertEnumCTLsInStorePrototype = WINFUNCTYPE(PCCTL_CONTEXT, HCERTSTORE, PCCTL_CONTEXT)
|
||||
CertEnumCTLsInStoreParams = ((1, 'hCertStore'), (1, 'pPrevCtlContext'))
|
||||
|
||||
#def CertDuplicateCTLContext(pCtlContext):
|
||||
# return CertDuplicateCTLContext.ctypes_function(pCtlContext)
|
||||
CertDuplicateCTLContextPrototype = WINFUNCTYPE(PCCTL_CONTEXT, PCCTL_CONTEXT)
|
||||
CertDuplicateCTLContextParams = ((1, 'pCtlContext'),)
|
||||
|
||||
#def CertFreeCTLContext(pCtlContext):
|
||||
# return CertFreeCTLContext.ctypes_function(pCtlContext)
|
||||
CertFreeCTLContextPrototype = WINFUNCTYPE(BOOL, PCCTL_CONTEXT)
|
||||
CertFreeCTLContextParams = ((1, 'pCtlContext'),)
|
||||
|
||||
#def CryptUIDlgViewContext(dwContextType, pvContext, hwnd, pwszTitle, dwFlags, pvReserved):
|
||||
# return CryptUIDlgViewContext.ctypes_function(dwContextType, pvContext, hwnd, pwszTitle, dwFlags, pvReserved)
|
||||
CryptUIDlgViewContextPrototype = WINFUNCTYPE(BOOL, DWORD, PVOID, HWND, LPCWSTR, DWORD, PVOID)
|
||||
CryptUIDlgViewContextParams = ((1, 'dwContextType'), (1, 'pvContext'), (1, 'hwnd'), (1, 'pwszTitle'), (1, 'dwFlags'), (1, 'pvReserved'))
|
||||
|
||||
#def CryptMsgVerifyCountersignatureEncoded(hCryptProv, dwEncodingType, pbSignerInfo, cbSignerInfo, pbSignerInfoCountersignature, cbSignerInfoCountersignature, pciCountersigner):
|
||||
# return CryptMsgVerifyCountersignatureEncoded.ctypes_function(hCryptProv, dwEncodingType, pbSignerInfo, cbSignerInfo, pbSignerInfoCountersignature, cbSignerInfoCountersignature, pciCountersigner)
|
||||
CryptMsgVerifyCountersignatureEncodedPrototype = WINFUNCTYPE(BOOL, HCRYPTPROV_LEGACY, DWORD, PBYTE, DWORD, PBYTE, DWORD, PCERT_INFO)
|
||||
CryptMsgVerifyCountersignatureEncodedParams = ((1, 'hCryptProv'), (1, 'dwEncodingType'), (1, 'pbSignerInfo'), (1, 'cbSignerInfo'), (1, 'pbSignerInfoCountersignature'), (1, 'cbSignerInfoCountersignature'), (1, 'pciCountersigner'))
|
||||
|
||||
#def CryptMsgVerifyCountersignatureEncodedEx(hCryptProv, dwEncodingType, pbSignerInfo, cbSignerInfo, pbSignerInfoCountersignature, cbSignerInfoCountersignature, dwSignerType, pvSigner, dwFlags, pvExtra):
|
||||
# return CryptMsgVerifyCountersignatureEncodedEx.ctypes_function(hCryptProv, dwEncodingType, pbSignerInfo, cbSignerInfo, pbSignerInfoCountersignature, cbSignerInfoCountersignature, dwSignerType, pvSigner, dwFlags, pvExtra)
|
||||
CryptMsgVerifyCountersignatureEncodedExPrototype = WINFUNCTYPE(BOOL, HCRYPTPROV_LEGACY, DWORD, PBYTE, DWORD, PBYTE, DWORD, DWORD, PVOID, DWORD, PVOID)
|
||||
CryptMsgVerifyCountersignatureEncodedExParams = ((1, 'hCryptProv'), (1, 'dwEncodingType'), (1, 'pbSignerInfo'), (1, 'cbSignerInfo'), (1, 'pbSignerInfoCountersignature'), (1, 'cbSignerInfoCountersignature'), (1, 'dwSignerType'), (1, 'pvSigner'), (1, 'dwFlags'), (1, 'pvExtra'))
|
||||
#def CloseEventLog(hEventLog):
|
||||
# return CloseEventLog.ctypes_function(hEventLog)
|
||||
CloseEventLogPrototype = WINFUNCTYPE(BOOL, HANDLE)
|
||||
CloseEventLogParams = ((1, 'hEventLog'),)
|
||||
|
||||
#def GetCursorPos(lpPoint):
|
||||
# return GetCursorPos.ctypes_function(lpPoint)
|
||||
@@ -399,41 +189,6 @@ GetClassNameWParams = ((1, 'hWnd'), (1, 'lpClassName'), (1, 'nMaxCount'))
|
||||
GetWindowThreadProcessIdPrototype = WINFUNCTYPE(DWORD, HWND, LPDWORD)
|
||||
GetWindowThreadProcessIdParams = ((1, 'hWnd'), (1, 'lpdwProcessId'))
|
||||
|
||||
#def OpenEventLogA(lpUNCServerName, lpSourceName):
|
||||
# return OpenEventLogA.ctypes_function(lpUNCServerName, lpSourceName)
|
||||
OpenEventLogAPrototype = WINFUNCTYPE(HANDLE, LPCSTR, LPCSTR)
|
||||
OpenEventLogAParams = ((1, 'lpUNCServerName'), (1, 'lpSourceName'))
|
||||
|
||||
#def OpenEventLogW(lpUNCServerName, lpSourceName):
|
||||
# return OpenEventLogW.ctypes_function(lpUNCServerName, lpSourceName)
|
||||
OpenEventLogWPrototype = WINFUNCTYPE(HANDLE, LPWSTR, LPWSTR)
|
||||
OpenEventLogWParams = ((1, 'lpUNCServerName'), (1, 'lpSourceName'))
|
||||
|
||||
#def ReadEventLogA(hEventLog, dwReadFlags, dwRecordOffset, lpBuffer, nNumberOfBytesToRead, pnBytesRead, pnMinNumberOfBytesNeeded):
|
||||
# return ReadEventLogA.ctypes_function(hEventLog, dwReadFlags, dwRecordOffset, lpBuffer, nNumberOfBytesToRead, pnBytesRead, pnMinNumberOfBytesNeeded)
|
||||
ReadEventLogAPrototype = WINFUNCTYPE(BOOL, HANDLE, DWORD, DWORD, LPVOID, DWORD, POINTER(DWORD), POINTER(DWORD))
|
||||
ReadEventLogAParams = ((1, 'hEventLog'), (1, 'dwReadFlags'), (1, 'dwRecordOffset'), (1, 'lpBuffer'), (1, 'nNumberOfBytesToRead'), (1, 'pnBytesRead'), (1, 'pnMinNumberOfBytesNeeded'))
|
||||
|
||||
#def ReadEventLogW(hEventLog, dwReadFlags, dwRecordOffset, lpBuffer, nNumberOfBytesToRead, pnBytesRead, pnMinNumberOfBytesNeeded):
|
||||
# return ReadEventLogW.ctypes_function(hEventLog, dwReadFlags, dwRecordOffset, lpBuffer, nNumberOfBytesToRead, pnBytesRead, pnMinNumberOfBytesNeeded)
|
||||
ReadEventLogWPrototype = WINFUNCTYPE(BOOL, HANDLE, DWORD, DWORD, LPVOID, DWORD, POINTER(DWORD), POINTER(DWORD))
|
||||
ReadEventLogWParams = ((1, 'hEventLog'), (1, 'dwReadFlags'), (1, 'dwRecordOffset'), (1, 'lpBuffer'), (1, 'nNumberOfBytesToRead'), (1, 'pnBytesRead'), (1, 'pnMinNumberOfBytesNeeded'))
|
||||
|
||||
#def GetEventLogInformation(hEventLog, dwInfoLevel, lpBuffer, cbBufSize, pcbBytesNeeded):
|
||||
# return GetEventLogInformation.ctypes_function(hEventLog, dwInfoLevel, lpBuffer, cbBufSize, pcbBytesNeeded)
|
||||
GetEventLogInformationPrototype = WINFUNCTYPE(BOOL, HANDLE, DWORD, LPVOID, DWORD, LPDWORD)
|
||||
GetEventLogInformationParams = ((1, 'hEventLog'), (1, 'dwInfoLevel'), (1, 'lpBuffer'), (1, 'cbBufSize'), (1, 'pcbBytesNeeded'))
|
||||
|
||||
#def GetNumberOfEventLogRecords(hEventLog, NumberOfRecords):
|
||||
# return GetNumberOfEventLogRecords.ctypes_function(hEventLog, NumberOfRecords)
|
||||
GetNumberOfEventLogRecordsPrototype = WINFUNCTYPE(BOOL, HANDLE, PDWORD)
|
||||
GetNumberOfEventLogRecordsParams = ((1, 'hEventLog'), (1, 'NumberOfRecords'))
|
||||
|
||||
#def CloseEventLog(hEventLog):
|
||||
# return CloseEventLog.ctypes_function(hEventLog)
|
||||
CloseEventLogPrototype = WINFUNCTYPE(BOOL, HANDLE)
|
||||
CloseEventLogParams = ((1, 'hEventLog'),)
|
||||
|
||||
#def ExitProcess(uExitCode):
|
||||
# return ExitProcess.ctypes_function(uExitCode)
|
||||
ExitProcessPrototype = WINFUNCTYPE(VOID, UINT)
|
||||
@@ -1779,3 +1534,268 @@ RtlDosPathNameToNtPathName_UParams = ((1, 'DosName'), (1, 'NtName'), (1, 'PartNa
|
||||
ApiSetResolveToHostPrototype = WINFUNCTYPE(NTSTATUS, PVOID, PUNICODE_STRING, PUNICODE_STRING, PBOOLEAN, PUNICODE_STRING)
|
||||
ApiSetResolveToHostParams = ((1, 'Schema'), (1, 'FileNameIn'), (1, 'ParentName'), (1, 'Resolved'), (1, 'HostBinary'))
|
||||
|
||||
#def CreateNamedPipeA(lpName, dwOpenMode, dwPipeMode, nMaxInstances, nOutBufferSize, nInBufferSize, nDefaultTimeOut, lpSecurityAttributes):
|
||||
# return CreateNamedPipeA.ctypes_function(lpName, dwOpenMode, dwPipeMode, nMaxInstances, nOutBufferSize, nInBufferSize, nDefaultTimeOut, lpSecurityAttributes)
|
||||
CreateNamedPipeAPrototype = WINFUNCTYPE(HANDLE, LPCSTR, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPSECURITY_ATTRIBUTES)
|
||||
CreateNamedPipeAParams = ((1, 'lpName'), (1, 'dwOpenMode'), (1, 'dwPipeMode'), (1, 'nMaxInstances'), (1, 'nOutBufferSize'), (1, 'nInBufferSize'), (1, 'nDefaultTimeOut'), (1, 'lpSecurityAttributes'))
|
||||
|
||||
#def CreateNamedPipeW(lpName, dwOpenMode, dwPipeMode, nMaxInstances, nOutBufferSize, nInBufferSize, nDefaultTimeOut, lpSecurityAttributes):
|
||||
# return CreateNamedPipeW.ctypes_function(lpName, dwOpenMode, dwPipeMode, nMaxInstances, nOutBufferSize, nInBufferSize, nDefaultTimeOut, lpSecurityAttributes)
|
||||
CreateNamedPipeWPrototype = WINFUNCTYPE(HANDLE, LPWSTR, DWORD, DWORD, DWORD, DWORD, DWORD, DWORD, LPSECURITY_ATTRIBUTES)
|
||||
CreateNamedPipeWParams = ((1, 'lpName'), (1, 'dwOpenMode'), (1, 'dwPipeMode'), (1, 'nMaxInstances'), (1, 'nOutBufferSize'), (1, 'nInBufferSize'), (1, 'nDefaultTimeOut'), (1, 'lpSecurityAttributes'))
|
||||
|
||||
#def ConnectNamedPipe(hNamedPipe, lpOverlapped):
|
||||
# return ConnectNamedPipe.ctypes_function(hNamedPipe, lpOverlapped)
|
||||
ConnectNamedPipePrototype = WINFUNCTYPE(BOOL, HANDLE, LPOVERLAPPED)
|
||||
ConnectNamedPipeParams = ((1, 'hNamedPipe'), (1, 'lpOverlapped'))
|
||||
|
||||
#def SetNamedPipeHandleState(hNamedPipe, lpMode, lpMaxCollectionCount, lpCollectDataTimeout):
|
||||
# return SetNamedPipeHandleState.ctypes_function(hNamedPipe, lpMode, lpMaxCollectionCount, lpCollectDataTimeout)
|
||||
SetNamedPipeHandleStatePrototype = WINFUNCTYPE(BOOL, HANDLE, LPDWORD, LPDWORD, LPDWORD)
|
||||
SetNamedPipeHandleStateParams = ((1, 'hNamedPipe'), (1, 'lpMode'), (1, 'lpMaxCollectionCount'), (1, 'lpCollectDataTimeout'))
|
||||
|
||||
#def TpCallbackSendAlpcMessageOnCompletion(TpHandle, PortHandle, Flags, SendMessage):
|
||||
# return TpCallbackSendAlpcMessageOnCompletion.ctypes_function(TpHandle, PortHandle, Flags, SendMessage)
|
||||
TpCallbackSendAlpcMessageOnCompletionPrototype = WINFUNCTYPE(NTSTATUS, HANDLE, HANDLE, ULONG, PPORT_MESSAGE)
|
||||
TpCallbackSendAlpcMessageOnCompletionParams = ((1, 'TpHandle'), (1, 'PortHandle'), (1, 'Flags'), (1, 'SendMessage'))
|
||||
|
||||
#def CryptCATAdminCalcHashFromFileHandle(hFile, pcbHash, pbHash, dwFlags):
|
||||
# return CryptCATAdminCalcHashFromFileHandle.ctypes_function(hFile, pcbHash, pbHash, dwFlags)
|
||||
CryptCATAdminCalcHashFromFileHandlePrototype = WINFUNCTYPE(BOOL, HANDLE, POINTER(DWORD), POINTER(BYTE), DWORD)
|
||||
CryptCATAdminCalcHashFromFileHandleParams = ((1, 'hFile'), (1, 'pcbHash'), (1, 'pbHash'), (1, 'dwFlags'))
|
||||
|
||||
#def CryptCATAdminEnumCatalogFromHash(hCatAdmin, pbHash, cbHash, dwFlags, phPrevCatInfo):
|
||||
# return CryptCATAdminEnumCatalogFromHash.ctypes_function(hCatAdmin, pbHash, cbHash, dwFlags, phPrevCatInfo)
|
||||
CryptCATAdminEnumCatalogFromHashPrototype = WINFUNCTYPE(HCATINFO, HCATADMIN, POINTER(BYTE), DWORD, DWORD, POINTER(HCATINFO))
|
||||
CryptCATAdminEnumCatalogFromHashParams = ((1, 'hCatAdmin'), (1, 'pbHash'), (1, 'cbHash'), (1, 'dwFlags'), (1, 'phPrevCatInfo'))
|
||||
|
||||
#def CryptCATAdminAcquireContext(phCatAdmin, pgSubsystem, dwFlags):
|
||||
# return CryptCATAdminAcquireContext.ctypes_function(phCatAdmin, pgSubsystem, dwFlags)
|
||||
CryptCATAdminAcquireContextPrototype = WINFUNCTYPE(BOOL, POINTER(HCATADMIN), POINTER(GUID), DWORD)
|
||||
CryptCATAdminAcquireContextParams = ((1, 'phCatAdmin'), (1, 'pgSubsystem'), (1, 'dwFlags'))
|
||||
|
||||
#def CryptCATCatalogInfoFromContext(hCatInfo, psCatInfo, dwFlags):
|
||||
# return CryptCATCatalogInfoFromContext.ctypes_function(hCatInfo, psCatInfo, dwFlags)
|
||||
CryptCATCatalogInfoFromContextPrototype = WINFUNCTYPE(BOOL, HCATINFO, POINTER(CATALOG_INFO), DWORD)
|
||||
CryptCATCatalogInfoFromContextParams = ((1, 'hCatInfo'), (1, 'psCatInfo'), (1, 'dwFlags'))
|
||||
|
||||
#def CryptCATAdminReleaseCatalogContext(hCatAdmin, hCatInfo, dwFlags):
|
||||
# return CryptCATAdminReleaseCatalogContext.ctypes_function(hCatAdmin, hCatInfo, dwFlags)
|
||||
CryptCATAdminReleaseCatalogContextPrototype = WINFUNCTYPE(BOOL, HCATADMIN, HCATINFO, DWORD)
|
||||
CryptCATAdminReleaseCatalogContextParams = ((1, 'hCatAdmin'), (1, 'hCatInfo'), (1, 'dwFlags'))
|
||||
|
||||
#def CryptCATAdminReleaseContext(hCatAdmin, dwFlags):
|
||||
# return CryptCATAdminReleaseContext.ctypes_function(hCatAdmin, dwFlags)
|
||||
CryptCATAdminReleaseContextPrototype = WINFUNCTYPE(BOOL, HCATADMIN, DWORD)
|
||||
CryptCATAdminReleaseContextParams = ((1, 'hCatAdmin'), (1, 'dwFlags'))
|
||||
|
||||
#def CryptCATGetAttrInfo(hCatalog, pCatMember, pwszReferenceTag):
|
||||
# return CryptCATGetAttrInfo.ctypes_function(hCatalog, pCatMember, pwszReferenceTag)
|
||||
CryptCATGetAttrInfoPrototype = WINFUNCTYPE(POINTER(CRYPTCATATTRIBUTE), HANDLE, POINTER(CRYPTCATMEMBER), LPWSTR)
|
||||
CryptCATGetAttrInfoParams = ((1, 'hCatalog'), (1, 'pCatMember'), (1, 'pwszReferenceTag'))
|
||||
|
||||
#def CryptCATGetMemberInfo(hCatalog, pwszReferenceTag):
|
||||
# return CryptCATGetMemberInfo.ctypes_function(hCatalog, pwszReferenceTag)
|
||||
CryptCATGetMemberInfoPrototype = WINFUNCTYPE(POINTER(CRYPTCATMEMBER), HANDLE, LPWSTR)
|
||||
CryptCATGetMemberInfoParams = ((1, 'hCatalog'), (1, 'pwszReferenceTag'))
|
||||
|
||||
#def CryptCATGetAttrInfo(hCatalog, pCatMember, pwszReferenceTag):
|
||||
# return CryptCATGetAttrInfo.ctypes_function(hCatalog, pCatMember, pwszReferenceTag)
|
||||
CryptCATGetAttrInfoPrototype = WINFUNCTYPE(POINTER(CRYPTCATATTRIBUTE), HANDLE, POINTER(CRYPTCATMEMBER), LPWSTR)
|
||||
CryptCATGetAttrInfoParams = ((1, 'hCatalog'), (1, 'pCatMember'), (1, 'pwszReferenceTag'))
|
||||
|
||||
#def CryptCATEnumerateCatAttr(hCatalog, pPrevAttr):
|
||||
# return CryptCATEnumerateCatAttr.ctypes_function(hCatalog, pPrevAttr)
|
||||
CryptCATEnumerateCatAttrPrototype = WINFUNCTYPE(POINTER(CRYPTCATATTRIBUTE), HANDLE, POINTER(CRYPTCATATTRIBUTE))
|
||||
CryptCATEnumerateCatAttrParams = ((1, 'hCatalog'), (1, 'pPrevAttr'))
|
||||
|
||||
#def CryptCATEnumerateAttr(hCatalog, pCatMember, pPrevAttr):
|
||||
# return CryptCATEnumerateAttr.ctypes_function(hCatalog, pCatMember, pPrevAttr)
|
||||
CryptCATEnumerateAttrPrototype = WINFUNCTYPE(POINTER(CRYPTCATATTRIBUTE), HANDLE, POINTER(CRYPTCATMEMBER), POINTER(CRYPTCATATTRIBUTE))
|
||||
CryptCATEnumerateAttrParams = ((1, 'hCatalog'), (1, 'pCatMember'), (1, 'pPrevAttr'))
|
||||
|
||||
#def CryptCATEnumerateMember(hCatalog, pPrevMember):
|
||||
# return CryptCATEnumerateMember.ctypes_function(hCatalog, pPrevMember)
|
||||
CryptCATEnumerateMemberPrototype = WINFUNCTYPE(POINTER(CRYPTCATMEMBER), HANDLE, POINTER(CRYPTCATMEMBER))
|
||||
CryptCATEnumerateMemberParams = ((1, 'hCatalog'), (1, 'pPrevMember'))
|
||||
|
||||
#def CryptQueryObject(dwObjectType, pvObject, dwExpectedContentTypeFlags, dwExpectedFormatTypeFlags, dwFlags, pdwMsgAndCertEncodingType, pdwContentType, pdwFormatType, phCertStore, phMsg, ppvContext):
|
||||
# return CryptQueryObject.ctypes_function(dwObjectType, pvObject, dwExpectedContentTypeFlags, dwExpectedFormatTypeFlags, dwFlags, pdwMsgAndCertEncodingType, pdwContentType, pdwFormatType, phCertStore, phMsg, ppvContext)
|
||||
CryptQueryObjectPrototype = WINFUNCTYPE(BOOL, DWORD, PVOID, DWORD, DWORD, DWORD, POINTER(DWORD), POINTER(DWORD), POINTER(DWORD), POINTER(HCERTSTORE), POINTER(HCRYPTMSG), POINTER(PVOID))
|
||||
CryptQueryObjectParams = ((1, 'dwObjectType'), (1, 'pvObject'), (1, 'dwExpectedContentTypeFlags'), (1, 'dwExpectedFormatTypeFlags'), (1, 'dwFlags'), (1, 'pdwMsgAndCertEncodingType'), (1, 'pdwContentType'), (1, 'pdwFormatType'), (1, 'phCertStore'), (1, 'phMsg'), (1, 'ppvContext'))
|
||||
|
||||
#def CryptMsgGetParam(hCryptMsg, dwParamType, dwIndex, pvData, pcbData):
|
||||
# return CryptMsgGetParam.ctypes_function(hCryptMsg, dwParamType, dwIndex, pvData, pcbData)
|
||||
CryptMsgGetParamPrototype = WINFUNCTYPE(BOOL, HCRYPTMSG, DWORD, DWORD, PVOID, POINTER(DWORD))
|
||||
CryptMsgGetParamParams = ((1, 'hCryptMsg'), (1, 'dwParamType'), (1, 'dwIndex'), (1, 'pvData'), (1, 'pcbData'))
|
||||
|
||||
#def CryptDecodeObject(dwCertEncodingType, lpszStructType, pbEncoded, cbEncoded, dwFlags, pvStructInfo, pcbStructInfo):
|
||||
# return CryptDecodeObject.ctypes_function(dwCertEncodingType, lpszStructType, pbEncoded, cbEncoded, dwFlags, pvStructInfo, pcbStructInfo)
|
||||
CryptDecodeObjectPrototype = WINFUNCTYPE(BOOL, DWORD, LPCSTR, POINTER(BYTE), DWORD, DWORD, PVOID, POINTER(DWORD))
|
||||
CryptDecodeObjectParams = ((1, 'dwCertEncodingType'), (1, 'lpszStructType'), (1, 'pbEncoded'), (1, 'cbEncoded'), (1, 'dwFlags'), (1, 'pvStructInfo'), (1, 'pcbStructInfo'))
|
||||
|
||||
#def CertFindCertificateInStore(hCertStore, dwCertEncodingType, dwFindFlags, dwFindType, pvFindPara, pPrevCertContext):
|
||||
# return CertFindCertificateInStore.ctypes_function(hCertStore, dwCertEncodingType, dwFindFlags, dwFindType, pvFindPara, pPrevCertContext)
|
||||
CertFindCertificateInStorePrototype = WINFUNCTYPE(PCCERT_CONTEXT, HCERTSTORE, DWORD, DWORD, DWORD, PVOID, PCCERT_CONTEXT)
|
||||
CertFindCertificateInStoreParams = ((1, 'hCertStore'), (1, 'dwCertEncodingType'), (1, 'dwFindFlags'), (1, 'dwFindType'), (1, 'pvFindPara'), (1, 'pPrevCertContext'))
|
||||
|
||||
#def CertGetNameStringA(pCertContext, dwType, dwFlags, pvTypePara, pszNameString, cchNameString):
|
||||
# return CertGetNameStringA.ctypes_function(pCertContext, dwType, dwFlags, pvTypePara, pszNameString, cchNameString)
|
||||
CertGetNameStringAPrototype = WINFUNCTYPE(DWORD, PCCERT_CONTEXT, DWORD, DWORD, PVOID, LPCSTR, DWORD)
|
||||
CertGetNameStringAParams = ((1, 'pCertContext'), (1, 'dwType'), (1, 'dwFlags'), (1, 'pvTypePara'), (1, 'pszNameString'), (1, 'cchNameString'))
|
||||
|
||||
#def CertGetNameStringW(pCertContext, dwType, dwFlags, pvTypePara, pszNameString, cchNameString):
|
||||
# return CertGetNameStringW.ctypes_function(pCertContext, dwType, dwFlags, pvTypePara, pszNameString, cchNameString)
|
||||
CertGetNameStringWPrototype = WINFUNCTYPE(DWORD, PCCERT_CONTEXT, DWORD, DWORD, PVOID, LPWSTR, DWORD)
|
||||
CertGetNameStringWParams = ((1, 'pCertContext'), (1, 'dwType'), (1, 'dwFlags'), (1, 'pvTypePara'), (1, 'pszNameString'), (1, 'cchNameString'))
|
||||
|
||||
#def CertGetCertificateChain(hChainEngine, pCertContext, pTime, hAdditionalStore, pChainPara, dwFlags, pvReserved, ppChainContext):
|
||||
# return CertGetCertificateChain.ctypes_function(hChainEngine, pCertContext, pTime, hAdditionalStore, pChainPara, dwFlags, pvReserved, ppChainContext)
|
||||
CertGetCertificateChainPrototype = WINFUNCTYPE(BOOL, HCERTCHAINENGINE, PCCERT_CONTEXT, LPFILETIME, HCERTSTORE, PCERT_CHAIN_PARA, DWORD, LPVOID, POINTER(PCCERT_CHAIN_CONTEXT))
|
||||
CertGetCertificateChainParams = ((1, 'hChainEngine'), (1, 'pCertContext'), (1, 'pTime'), (1, 'hAdditionalStore'), (1, 'pChainPara'), (1, 'dwFlags'), (1, 'pvReserved'), (1, 'ppChainContext'))
|
||||
|
||||
#def CertCreateSelfSignCertificate(hCryptProvOrNCryptKey, pSubjectIssuerBlob, dwFlags, pKeyProvInfo, pSignatureAlgorithm, pStartTime, pEndTime, pExtensions):
|
||||
# return CertCreateSelfSignCertificate.ctypes_function(hCryptProvOrNCryptKey, pSubjectIssuerBlob, dwFlags, pKeyProvInfo, pSignatureAlgorithm, pStartTime, pEndTime, pExtensions)
|
||||
CertCreateSelfSignCertificatePrototype = WINFUNCTYPE(PCCERT_CONTEXT, HCRYPTPROV_OR_NCRYPT_KEY_HANDLE, PCERT_NAME_BLOB, DWORD, PCRYPT_KEY_PROV_INFO, PCRYPT_ALGORITHM_IDENTIFIER, PSYSTEMTIME, PSYSTEMTIME, PCERT_EXTENSIONS)
|
||||
CertCreateSelfSignCertificateParams = ((1, 'hCryptProvOrNCryptKey'), (1, 'pSubjectIssuerBlob'), (1, 'dwFlags'), (1, 'pKeyProvInfo'), (1, 'pSignatureAlgorithm'), (1, 'pStartTime'), (1, 'pEndTime'), (1, 'pExtensions'))
|
||||
|
||||
#def CertStrToNameA(dwCertEncodingType, pszX500, dwStrType, pvReserved, pbEncoded, pcbEncoded, ppszError):
|
||||
# return CertStrToNameA.ctypes_function(dwCertEncodingType, pszX500, dwStrType, pvReserved, pbEncoded, pcbEncoded, ppszError)
|
||||
CertStrToNameAPrototype = WINFUNCTYPE(BOOL, DWORD, LPCSTR, DWORD, PVOID, POINTER(BYTE), POINTER(DWORD), POINTER(LPCSTR))
|
||||
CertStrToNameAParams = ((1, 'dwCertEncodingType'), (1, 'pszX500'), (1, 'dwStrType'), (1, 'pvReserved'), (1, 'pbEncoded'), (1, 'pcbEncoded'), (1, 'ppszError'))
|
||||
|
||||
#def CertStrToNameW(dwCertEncodingType, pszX500, dwStrType, pvReserved, pbEncoded, pcbEncoded, ppszError):
|
||||
# return CertStrToNameW.ctypes_function(dwCertEncodingType, pszX500, dwStrType, pvReserved, pbEncoded, pcbEncoded, ppszError)
|
||||
CertStrToNameWPrototype = WINFUNCTYPE(BOOL, DWORD, LPWSTR, DWORD, PVOID, POINTER(BYTE), POINTER(DWORD), POINTER(LPWSTR))
|
||||
CertStrToNameWParams = ((1, 'dwCertEncodingType'), (1, 'pszX500'), (1, 'dwStrType'), (1, 'pvReserved'), (1, 'pbEncoded'), (1, 'pcbEncoded'), (1, 'ppszError'))
|
||||
|
||||
#def CertOpenStore(lpszStoreProvider, dwMsgAndCertEncodingType, hCryptProv, dwFlags, pvPara):
|
||||
# return CertOpenStore.ctypes_function(lpszStoreProvider, dwMsgAndCertEncodingType, hCryptProv, dwFlags, pvPara)
|
||||
CertOpenStorePrototype = WINFUNCTYPE(HCERTSTORE, LPCSTR, DWORD, HCRYPTPROV_LEGACY, DWORD, PVOID)
|
||||
CertOpenStoreParams = ((1, 'lpszStoreProvider'), (1, 'dwMsgAndCertEncodingType'), (1, 'hCryptProv'), (1, 'dwFlags'), (1, 'pvPara'))
|
||||
|
||||
#def CertAddCertificateContextToStore(hCertStore, pCertContext, dwAddDisposition, ppStoreContext):
|
||||
# return CertAddCertificateContextToStore.ctypes_function(hCertStore, pCertContext, dwAddDisposition, ppStoreContext)
|
||||
CertAddCertificateContextToStorePrototype = WINFUNCTYPE(BOOL, HCERTSTORE, PCCERT_CONTEXT, DWORD, POINTER(PCCERT_CONTEXT))
|
||||
CertAddCertificateContextToStoreParams = ((1, 'hCertStore'), (1, 'pCertContext'), (1, 'dwAddDisposition'), (1, 'ppStoreContext'))
|
||||
|
||||
#def PFXExportCertStoreEx(hStore, pPFX, szPassword, pvPara, dwFlags):
|
||||
# return PFXExportCertStoreEx.ctypes_function(hStore, pPFX, szPassword, pvPara, dwFlags)
|
||||
PFXExportCertStoreExPrototype = WINFUNCTYPE(BOOL, HCERTSTORE, POINTER(CRYPT_DATA_BLOB), LPCWSTR, PVOID, DWORD)
|
||||
PFXExportCertStoreExParams = ((1, 'hStore'), (1, 'pPFX'), (1, 'szPassword'), (1, 'pvPara'), (1, 'dwFlags'))
|
||||
|
||||
#def PFXImportCertStore(pPFX, szPassword, dwFlags):
|
||||
# return PFXImportCertStore.ctypes_function(pPFX, szPassword, dwFlags)
|
||||
PFXImportCertStorePrototype = WINFUNCTYPE(HCERTSTORE, POINTER(CRYPT_DATA_BLOB), LPCWSTR, DWORD)
|
||||
PFXImportCertStoreParams = ((1, 'pPFX'), (1, 'szPassword'), (1, 'dwFlags'))
|
||||
|
||||
#def CryptGenKey(hProv, Algid, dwFlags, phKey):
|
||||
# return CryptGenKey.ctypes_function(hProv, Algid, dwFlags, phKey)
|
||||
CryptGenKeyPrototype = WINFUNCTYPE(BOOL, HCRYPTPROV, ALG_ID, DWORD, POINTER(HCRYPTKEY))
|
||||
CryptGenKeyParams = ((1, 'hProv'), (1, 'Algid'), (1, 'dwFlags'), (1, 'phKey'))
|
||||
|
||||
#def CryptDestroyKey(hKey):
|
||||
# return CryptDestroyKey.ctypes_function(hKey)
|
||||
CryptDestroyKeyPrototype = WINFUNCTYPE(BOOL, HCRYPTKEY)
|
||||
CryptDestroyKeyParams = ((1, 'hKey'),)
|
||||
|
||||
#def CryptAcquireContextA(phProv, pszContainer, pszProvider, dwProvType, dwFlags):
|
||||
# return CryptAcquireContextA.ctypes_function(phProv, pszContainer, pszProvider, dwProvType, dwFlags)
|
||||
CryptAcquireContextAPrototype = WINFUNCTYPE(BOOL, POINTER(HCRYPTPROV), LPCSTR, LPCSTR, DWORD, DWORD)
|
||||
CryptAcquireContextAParams = ((1, 'phProv'), (1, 'pszContainer'), (1, 'pszProvider'), (1, 'dwProvType'), (1, 'dwFlags'))
|
||||
|
||||
#def CryptAcquireContextW(phProv, pszContainer, pszProvider, dwProvType, dwFlags):
|
||||
# return CryptAcquireContextW.ctypes_function(phProv, pszContainer, pszProvider, dwProvType, dwFlags)
|
||||
CryptAcquireContextWPrototype = WINFUNCTYPE(BOOL, POINTER(HCRYPTPROV), LPWSTR, LPWSTR, DWORD, DWORD)
|
||||
CryptAcquireContextWParams = ((1, 'phProv'), (1, 'pszContainer'), (1, 'pszProvider'), (1, 'dwProvType'), (1, 'dwFlags'))
|
||||
|
||||
#def CryptReleaseContext(hProv, dwFlags):
|
||||
# return CryptReleaseContext.ctypes_function(hProv, dwFlags)
|
||||
CryptReleaseContextPrototype = WINFUNCTYPE(BOOL, HCRYPTPROV, DWORD)
|
||||
CryptReleaseContextParams = ((1, 'hProv'), (1, 'dwFlags'))
|
||||
|
||||
#def CryptExportKey(hKey, hExpKey, dwBlobType, dwFlags, pbData, pdwDataLen):
|
||||
# return CryptExportKey.ctypes_function(hKey, hExpKey, dwBlobType, dwFlags, pbData, pdwDataLen)
|
||||
CryptExportKeyPrototype = WINFUNCTYPE(BOOL, HCRYPTKEY, HCRYPTKEY, DWORD, DWORD, POINTER(BYTE), POINTER(DWORD))
|
||||
CryptExportKeyParams = ((1, 'hKey'), (1, 'hExpKey'), (1, 'dwBlobType'), (1, 'dwFlags'), (1, 'pbData'), (1, 'pdwDataLen'))
|
||||
|
||||
#def CertGetCertificateContextProperty(pCertContext, dwPropId, pvData, pcbData):
|
||||
# return CertGetCertificateContextProperty.ctypes_function(pCertContext, dwPropId, pvData, pcbData)
|
||||
CertGetCertificateContextPropertyPrototype = WINFUNCTYPE(BOOL, PCCERT_CONTEXT, DWORD, PVOID, POINTER(DWORD))
|
||||
CertGetCertificateContextPropertyParams = ((1, 'pCertContext'), (1, 'dwPropId'), (1, 'pvData'), (1, 'pcbData'))
|
||||
|
||||
#def CertEnumCertificateContextProperties(pCertContext, dwPropId):
|
||||
# return CertEnumCertificateContextProperties.ctypes_function(pCertContext, dwPropId)
|
||||
CertEnumCertificateContextPropertiesPrototype = WINFUNCTYPE(DWORD, PCCERT_CONTEXT, DWORD)
|
||||
CertEnumCertificateContextPropertiesParams = ((1, 'pCertContext'), (1, 'dwPropId'))
|
||||
|
||||
#def CryptEncryptMessage(pEncryptPara, cRecipientCert, rgpRecipientCert, pbToBeEncrypted, cbToBeEncrypted, pbEncryptedBlob, pcbEncryptedBlob):
|
||||
# return CryptEncryptMessage.ctypes_function(pEncryptPara, cRecipientCert, rgpRecipientCert, pbToBeEncrypted, cbToBeEncrypted, pbEncryptedBlob, pcbEncryptedBlob)
|
||||
CryptEncryptMessagePrototype = WINFUNCTYPE(BOOL, PCRYPT_ENCRYPT_MESSAGE_PARA, DWORD, POINTER(PCCERT_CONTEXT), POINTER(BYTE), DWORD, POINTER(BYTE), POINTER(DWORD))
|
||||
CryptEncryptMessageParams = ((1, 'pEncryptPara'), (1, 'cRecipientCert'), (1, 'rgpRecipientCert'), (1, 'pbToBeEncrypted'), (1, 'cbToBeEncrypted'), (1, 'pbEncryptedBlob'), (1, 'pcbEncryptedBlob'))
|
||||
|
||||
#def CryptDecryptMessage(pDecryptPara, pbEncryptedBlob, cbEncryptedBlob, pbDecrypted, pcbDecrypted, ppXchgCert):
|
||||
# return CryptDecryptMessage.ctypes_function(pDecryptPara, pbEncryptedBlob, cbEncryptedBlob, pbDecrypted, pcbDecrypted, ppXchgCert)
|
||||
CryptDecryptMessagePrototype = WINFUNCTYPE(BOOL, PCRYPT_DECRYPT_MESSAGE_PARA, POINTER(BYTE), DWORD, POINTER(BYTE), POINTER(DWORD), POINTER(PCCERT_CONTEXT))
|
||||
CryptDecryptMessageParams = ((1, 'pDecryptPara'), (1, 'pbEncryptedBlob'), (1, 'cbEncryptedBlob'), (1, 'pbDecrypted'), (1, 'pcbDecrypted'), (1, 'ppXchgCert'))
|
||||
|
||||
#def CryptAcquireCertificatePrivateKey(pCert, dwFlags, pvParameters, phCryptProvOrNCryptKey, pdwKeySpec, pfCallerFreeProvOrNCryptKey):
|
||||
# return CryptAcquireCertificatePrivateKey.ctypes_function(pCert, dwFlags, pvParameters, phCryptProvOrNCryptKey, pdwKeySpec, pfCallerFreeProvOrNCryptKey)
|
||||
CryptAcquireCertificatePrivateKeyPrototype = WINFUNCTYPE(BOOL, PCCERT_CONTEXT, DWORD, PVOID, POINTER(HCRYPTPROV_OR_NCRYPT_KEY_HANDLE), POINTER(DWORD), POINTER(BOOL))
|
||||
CryptAcquireCertificatePrivateKeyParams = ((1, 'pCert'), (1, 'dwFlags'), (1, 'pvParameters'), (1, 'phCryptProvOrNCryptKey'), (1, 'pdwKeySpec'), (1, 'pfCallerFreeProvOrNCryptKey'))
|
||||
|
||||
#def CertDuplicateCertificateContext(pCertContext):
|
||||
# return CertDuplicateCertificateContext.ctypes_function(pCertContext)
|
||||
CertDuplicateCertificateContextPrototype = WINFUNCTYPE(PCCERT_CONTEXT, PCCERT_CONTEXT)
|
||||
CertDuplicateCertificateContextParams = ((1, 'pCertContext'),)
|
||||
|
||||
#def CertEnumCertificatesInStore(hCertStore, pPrevCertContext):
|
||||
# return CertEnumCertificatesInStore.ctypes_function(hCertStore, pPrevCertContext)
|
||||
CertEnumCertificatesInStorePrototype = WINFUNCTYPE(PCCERT_CONTEXT, HCERTSTORE, PCCERT_CONTEXT)
|
||||
CertEnumCertificatesInStoreParams = ((1, 'hCertStore'), (1, 'pPrevCertContext'))
|
||||
|
||||
#def CryptEncodeObjectEx(dwCertEncodingType, lpszStructType, pvStructInfo, dwFlags, pEncodePara, pvEncoded, pcbEncoded):
|
||||
# return CryptEncodeObjectEx.ctypes_function(dwCertEncodingType, lpszStructType, pvStructInfo, dwFlags, pEncodePara, pvEncoded, pcbEncoded)
|
||||
CryptEncodeObjectExPrototype = WINFUNCTYPE(BOOL, DWORD, LPCSTR, PVOID, DWORD, PCRYPT_ENCODE_PARA, PVOID, POINTER(DWORD))
|
||||
CryptEncodeObjectExParams = ((1, 'dwCertEncodingType'), (1, 'lpszStructType'), (1, 'pvStructInfo'), (1, 'dwFlags'), (1, 'pEncodePara'), (1, 'pvEncoded'), (1, 'pcbEncoded'))
|
||||
|
||||
#def CertCreateCertificateContext(dwCertEncodingType, pbCertEncoded, cbCertEncoded):
|
||||
# return CertCreateCertificateContext.ctypes_function(dwCertEncodingType, pbCertEncoded, cbCertEncoded)
|
||||
CertCreateCertificateContextPrototype = WINFUNCTYPE(PCCERT_CONTEXT, DWORD, POINTER(BYTE), DWORD)
|
||||
CertCreateCertificateContextParams = ((1, 'dwCertEncodingType'), (1, 'pbCertEncoded'), (1, 'cbCertEncoded'))
|
||||
|
||||
#def CertCompareCertificate(dwCertEncodingType, pCertId1, pCertId2):
|
||||
# return CertCompareCertificate.ctypes_function(dwCertEncodingType, pCertId1, pCertId2)
|
||||
CertCompareCertificatePrototype = WINFUNCTYPE(BOOL, DWORD, PCERT_INFO, PCERT_INFO)
|
||||
CertCompareCertificateParams = ((1, 'dwCertEncodingType'), (1, 'pCertId1'), (1, 'pCertId2'))
|
||||
|
||||
#def CertEnumCTLsInStore(hCertStore, pPrevCtlContext):
|
||||
# return CertEnumCTLsInStore.ctypes_function(hCertStore, pPrevCtlContext)
|
||||
CertEnumCTLsInStorePrototype = WINFUNCTYPE(PCCTL_CONTEXT, HCERTSTORE, PCCTL_CONTEXT)
|
||||
CertEnumCTLsInStoreParams = ((1, 'hCertStore'), (1, 'pPrevCtlContext'))
|
||||
|
||||
#def CertDuplicateCTLContext(pCtlContext):
|
||||
# return CertDuplicateCTLContext.ctypes_function(pCtlContext)
|
||||
CertDuplicateCTLContextPrototype = WINFUNCTYPE(PCCTL_CONTEXT, PCCTL_CONTEXT)
|
||||
CertDuplicateCTLContextParams = ((1, 'pCtlContext'),)
|
||||
|
||||
#def CertFreeCTLContext(pCtlContext):
|
||||
# return CertFreeCTLContext.ctypes_function(pCtlContext)
|
||||
CertFreeCTLContextPrototype = WINFUNCTYPE(BOOL, PCCTL_CONTEXT)
|
||||
CertFreeCTLContextParams = ((1, 'pCtlContext'),)
|
||||
|
||||
#def CryptUIDlgViewContext(dwContextType, pvContext, hwnd, pwszTitle, dwFlags, pvReserved):
|
||||
# return CryptUIDlgViewContext.ctypes_function(dwContextType, pvContext, hwnd, pwszTitle, dwFlags, pvReserved)
|
||||
CryptUIDlgViewContextPrototype = WINFUNCTYPE(BOOL, DWORD, PVOID, HWND, LPCWSTR, DWORD, PVOID)
|
||||
CryptUIDlgViewContextParams = ((1, 'dwContextType'), (1, 'pvContext'), (1, 'hwnd'), (1, 'pwszTitle'), (1, 'dwFlags'), (1, 'pvReserved'))
|
||||
|
||||
#def CryptMsgVerifyCountersignatureEncoded(hCryptProv, dwEncodingType, pbSignerInfo, cbSignerInfo, pbSignerInfoCountersignature, cbSignerInfoCountersignature, pciCountersigner):
|
||||
# return CryptMsgVerifyCountersignatureEncoded.ctypes_function(hCryptProv, dwEncodingType, pbSignerInfo, cbSignerInfo, pbSignerInfoCountersignature, cbSignerInfoCountersignature, pciCountersigner)
|
||||
CryptMsgVerifyCountersignatureEncodedPrototype = WINFUNCTYPE(BOOL, HCRYPTPROV_LEGACY, DWORD, PBYTE, DWORD, PBYTE, DWORD, PCERT_INFO)
|
||||
CryptMsgVerifyCountersignatureEncodedParams = ((1, 'hCryptProv'), (1, 'dwEncodingType'), (1, 'pbSignerInfo'), (1, 'cbSignerInfo'), (1, 'pbSignerInfoCountersignature'), (1, 'cbSignerInfoCountersignature'), (1, 'pciCountersigner'))
|
||||
|
||||
#def CryptMsgVerifyCountersignatureEncodedEx(hCryptProv, dwEncodingType, pbSignerInfo, cbSignerInfo, pbSignerInfoCountersignature, cbSignerInfoCountersignature, dwSignerType, pvSigner, dwFlags, pvExtra):
|
||||
# return CryptMsgVerifyCountersignatureEncodedEx.ctypes_function(hCryptProv, dwEncodingType, pbSignerInfo, cbSignerInfo, pbSignerInfoCountersignature, cbSignerInfoCountersignature, dwSignerType, pvSigner, dwFlags, pvExtra)
|
||||
CryptMsgVerifyCountersignatureEncodedExPrototype = WINFUNCTYPE(BOOL, HCRYPTPROV_LEGACY, DWORD, PBYTE, DWORD, PBYTE, DWORD, DWORD, PVOID, DWORD, PVOID)
|
||||
CryptMsgVerifyCountersignatureEncodedExParams = ((1, 'hCryptProv'), (1, 'dwEncodingType'), (1, 'pbSignerInfo'), (1, 'cbSignerInfo'), (1, 'pbSignerInfoCountersignature'), (1, 'cbSignerInfoCountersignature'), (1, 'dwSignerType'), (1, 'pvSigner'), (1, 'dwFlags'), (1, 'pvExtra'))
|
||||
|
||||
|
||||
+324
-324
@@ -160,6 +160,35 @@ class _API_SET_NAMESPACE_V6(Structure):
|
||||
]
|
||||
API_SET_NAMESPACE_V6 = _API_SET_NAMESPACE_V6
|
||||
|
||||
class _EVENTLOGRECORD(Structure):
|
||||
_fields_ = [
|
||||
("Length", DWORD),
|
||||
("Reserved", DWORD),
|
||||
("RecordNumber", DWORD),
|
||||
("TimeGenerated", DWORD),
|
||||
("TimeWritten", DWORD),
|
||||
("EventID", DWORD),
|
||||
("EventType", WORD),
|
||||
("NumStrings", WORD),
|
||||
("EventCategory", WORD),
|
||||
("ReservedFlags", WORD),
|
||||
("ClosingRecordNumber", DWORD),
|
||||
("StringOffset", DWORD),
|
||||
("UserSidLength", DWORD),
|
||||
("UserSidOffset", DWORD),
|
||||
("DataLength", DWORD),
|
||||
("DataOffset", DWORD),
|
||||
]
|
||||
PEVENTLOGRECORD = POINTER(_EVENTLOGRECORD)
|
||||
EVENTLOGRECORD = _EVENTLOGRECORD
|
||||
|
||||
class _EVENTLOG_FULL_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("dwFull", DWORD),
|
||||
]
|
||||
EVENTLOG_FULL_INFORMATION = _EVENTLOG_FULL_INFORMATION
|
||||
LPEVENTLOG_FULL_INFORMATION = POINTER(_EVENTLOG_FULL_INFORMATION)
|
||||
|
||||
VOID = DWORD
|
||||
BYTE = c_ubyte
|
||||
PWSTR = LPWSTR
|
||||
@@ -253,6 +282,215 @@ HCERTSTORE = PVOID
|
||||
HCRYPTMSG = PVOID
|
||||
PALPC_PORT_ATTRIBUTES = PVOID
|
||||
PPORT_MESSAGE = PVOID
|
||||
FakeFileInformationZero = EnumValue("_FILE_INFORMATION_CLASS", "FakeFileInformationZero", 0x0)
|
||||
FileDirectoryInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileDirectoryInformation", 0x1)
|
||||
FileFullDirectoryInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileFullDirectoryInformation", 0x2)
|
||||
FileBothDirectoryInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileBothDirectoryInformation", 0x3)
|
||||
FileBasicInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileBasicInformation", 0x4)
|
||||
FileStandardInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileStandardInformation", 0x5)
|
||||
FileInternalInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileInternalInformation", 0x6)
|
||||
FileEaInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileEaInformation", 0x7)
|
||||
FileAccessInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileAccessInformation", 0x8)
|
||||
FileNameInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileNameInformation", 0x9)
|
||||
FileRenameInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileRenameInformation", 0xa)
|
||||
FileLinkInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileLinkInformation", 0xb)
|
||||
FileNamesInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileNamesInformation", 0xc)
|
||||
FileDispositionInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileDispositionInformation", 0xd)
|
||||
FilePositionInformation = EnumValue("_FILE_INFORMATION_CLASS", "FilePositionInformation", 0xe)
|
||||
FileFullEaInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileFullEaInformation", 0xf)
|
||||
FileModeInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileModeInformation", 0x10)
|
||||
FileAlignmentInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileAlignmentInformation", 0x11)
|
||||
FileAllInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileAllInformation", 0x12)
|
||||
FileAllocationInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileAllocationInformation", 0x13)
|
||||
FileEndOfFileInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileEndOfFileInformation", 0x14)
|
||||
FileAlternateNameInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileAlternateNameInformation", 0x15)
|
||||
FileStreamInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileStreamInformation", 0x16)
|
||||
FilePipeInformation = EnumValue("_FILE_INFORMATION_CLASS", "FilePipeInformation", 0x17)
|
||||
FilePipeLocalInformation = EnumValue("_FILE_INFORMATION_CLASS", "FilePipeLocalInformation", 0x18)
|
||||
FilePipeRemoteInformation = EnumValue("_FILE_INFORMATION_CLASS", "FilePipeRemoteInformation", 0x19)
|
||||
FileMailslotQueryInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileMailslotQueryInformation", 0x1a)
|
||||
FileMailslotSetInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileMailslotSetInformation", 0x1b)
|
||||
FileCompressionInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileCompressionInformation", 0x1c)
|
||||
FileObjectIdInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileObjectIdInformation", 0x1d)
|
||||
FileCompletionInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileCompletionInformation", 0x1e)
|
||||
FileMoveClusterInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileMoveClusterInformation", 0x1f)
|
||||
FileQuotaInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileQuotaInformation", 0x20)
|
||||
FileReparsePointInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileReparsePointInformation", 0x21)
|
||||
FileNetworkOpenInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileNetworkOpenInformation", 0x22)
|
||||
FileAttributeTagInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileAttributeTagInformation", 0x23)
|
||||
FileTrackingInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileTrackingInformation", 0x24)
|
||||
FileIdBothDirectoryInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileIdBothDirectoryInformation", 0x25)
|
||||
FileIdFullDirectoryInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileIdFullDirectoryInformation", 0x26)
|
||||
FileValidDataLengthInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileValidDataLengthInformation", 0x27)
|
||||
FileShortNameInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileShortNameInformation", 0x28)
|
||||
FileIoCompletionNotificationInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileIoCompletionNotificationInformation", 0x29)
|
||||
FileIoStatusBlockRangeInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileIoStatusBlockRangeInformation", 0x2a)
|
||||
FileIoPriorityHintInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileIoPriorityHintInformation", 0x2b)
|
||||
FileSfioReserveInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileSfioReserveInformation", 0x2c)
|
||||
FileSfioVolumeInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileSfioVolumeInformation", 0x2d)
|
||||
FileHardLinkInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileHardLinkInformation", 0x2e)
|
||||
FileProcessIdsUsingFileInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileProcessIdsUsingFileInformation", 0x2f)
|
||||
FileNormalizedNameInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileNormalizedNameInformation", 0x30)
|
||||
FileNetworkPhysicalNameInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileNetworkPhysicalNameInformation", 0x31)
|
||||
FileIdGlobalTxDirectoryInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileIdGlobalTxDirectoryInformation", 0x32)
|
||||
FileIsRemoteDeviceInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileIsRemoteDeviceInformation", 0x33)
|
||||
FileUnusedInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileUnusedInformation", 0x34)
|
||||
FileNumaNodeInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileNumaNodeInformation", 0x35)
|
||||
FileStandardLinkInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileStandardLinkInformation", 0x36)
|
||||
FileRemoteProtocolInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileRemoteProtocolInformation", 0x37)
|
||||
FileRenameInformationBypassAccessCheck = EnumValue("_FILE_INFORMATION_CLASS", "FileRenameInformationBypassAccessCheck", 0x38)
|
||||
FileLinkInformationBypassAccessCheck = EnumValue("_FILE_INFORMATION_CLASS", "FileLinkInformationBypassAccessCheck", 0x39)
|
||||
FileVolumeNameInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileVolumeNameInformation", 0x3a)
|
||||
FileIdInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileIdInformation", 0x3b)
|
||||
FileIdExtdDirectoryInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileIdExtdDirectoryInformation", 0x3c)
|
||||
FileReplaceCompletionInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileReplaceCompletionInformation", 0x3d)
|
||||
FileHardLinkFullIdInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileHardLinkFullIdInformation", 0x3e)
|
||||
FileIdExtdBothDirectoryInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileIdExtdBothDirectoryInformation", 0x3f)
|
||||
FileDispositionInformationEx = EnumValue("_FILE_INFORMATION_CLASS", "FileDispositionInformationEx", 0x40)
|
||||
FileRenameInformationEx = EnumValue("_FILE_INFORMATION_CLASS", "FileRenameInformationEx", 0x41)
|
||||
FileRenameInformationExBypassAccessCheck = EnumValue("_FILE_INFORMATION_CLASS", "FileRenameInformationExBypassAccessCheck", 0x42)
|
||||
FileMaximumInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileMaximumInformation", 0x43)
|
||||
class _FILE_INFORMATION_CLASS(EnumType):
|
||||
values = [FakeFileInformationZero, FileDirectoryInformation, FileFullDirectoryInformation, FileBothDirectoryInformation, FileBasicInformation, FileStandardInformation, FileInternalInformation, FileEaInformation, FileAccessInformation, FileNameInformation, FileRenameInformation, FileLinkInformation, FileNamesInformation, FileDispositionInformation, FilePositionInformation, FileFullEaInformation, FileModeInformation, FileAlignmentInformation, FileAllInformation, FileAllocationInformation, FileEndOfFileInformation, FileAlternateNameInformation, FileStreamInformation, FilePipeInformation, FilePipeLocalInformation, FilePipeRemoteInformation, FileMailslotQueryInformation, FileMailslotSetInformation, FileCompressionInformation, FileObjectIdInformation, FileCompletionInformation, FileMoveClusterInformation, FileQuotaInformation, FileReparsePointInformation, FileNetworkOpenInformation, FileAttributeTagInformation, FileTrackingInformation, FileIdBothDirectoryInformation, FileIdFullDirectoryInformation, FileValidDataLengthInformation, FileShortNameInformation, FileIoCompletionNotificationInformation, FileIoStatusBlockRangeInformation, FileIoPriorityHintInformation, FileSfioReserveInformation, FileSfioVolumeInformation, FileHardLinkInformation, FileProcessIdsUsingFileInformation, FileNormalizedNameInformation, FileNetworkPhysicalNameInformation, FileIdGlobalTxDirectoryInformation, FileIsRemoteDeviceInformation, FileUnusedInformation, FileNumaNodeInformation, FileStandardLinkInformation, FileRemoteProtocolInformation, FileRenameInformationBypassAccessCheck, FileLinkInformationBypassAccessCheck, FileVolumeNameInformation, FileIdInformation, FileIdExtdDirectoryInformation, FileReplaceCompletionInformation, FileHardLinkFullIdInformation, FileIdExtdBothDirectoryInformation, FileDispositionInformationEx, FileRenameInformationEx, FileRenameInformationExBypassAccessCheck, FileMaximumInformation]
|
||||
mapper = {x:x for x in values}
|
||||
FILE_INFORMATION_CLASS = _FILE_INFORMATION_CLASS
|
||||
PFILE_INFORMATION_CLASS = POINTER(_FILE_INFORMATION_CLASS)
|
||||
|
||||
|
||||
IoPriorityVeryLow = EnumValue("_IO_PRIORITY_HINT", "IoPriorityVeryLow", 0x0)
|
||||
IoPriorityLow = EnumValue("_IO_PRIORITY_HINT", "IoPriorityLow", 0x1)
|
||||
IoPriorityNormal = EnumValue("_IO_PRIORITY_HINT", "IoPriorityNormal", 0x2)
|
||||
IoPriorityHigh = EnumValue("_IO_PRIORITY_HINT", "IoPriorityHigh", 0x3)
|
||||
IoPriorityCritical = EnumValue("_IO_PRIORITY_HINT", "IoPriorityCritical", 0x4)
|
||||
MaxIoPriorityTypes = EnumValue("_IO_PRIORITY_HINT", "MaxIoPriorityTypes", 0x5)
|
||||
class _IO_PRIORITY_HINT(EnumType):
|
||||
values = [IoPriorityVeryLow, IoPriorityLow, IoPriorityNormal, IoPriorityHigh, IoPriorityCritical, MaxIoPriorityTypes]
|
||||
mapper = {x:x for x in values}
|
||||
IO_PRIORITY_HINT = _IO_PRIORITY_HINT
|
||||
|
||||
|
||||
class _FILE_INTERNAL_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("IndexNumber", LARGE_INTEGER),
|
||||
]
|
||||
FILE_INTERNAL_INFORMATION = _FILE_INTERNAL_INFORMATION
|
||||
PFILE_INTERNAL_INFORMATION = POINTER(_FILE_INTERNAL_INFORMATION)
|
||||
|
||||
class _FILE_ALIGNMENT_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("AlignmentRequirement", ULONG),
|
||||
]
|
||||
PFILE_ALIGNMENT_INFORMATION = POINTER(_FILE_ALIGNMENT_INFORMATION)
|
||||
FILE_ALIGNMENT_INFORMATION = _FILE_ALIGNMENT_INFORMATION
|
||||
|
||||
class _FILE_ATTRIBUTE_TAG_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("FileAttributes", ULONG),
|
||||
("ReparseTag", ULONG),
|
||||
]
|
||||
PFILE_ATTRIBUTE_TAG_INFORMATION = POINTER(_FILE_ATTRIBUTE_TAG_INFORMATION)
|
||||
FILE_ATTRIBUTE_TAG_INFORMATION = _FILE_ATTRIBUTE_TAG_INFORMATION
|
||||
|
||||
class _FILE_BASIC_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("CreationTime", LARGE_INTEGER),
|
||||
("LastAccessTime", LARGE_INTEGER),
|
||||
("LastWriteTime", LARGE_INTEGER),
|
||||
("ChangeTime", LARGE_INTEGER),
|
||||
("FileAttributes", ULONG),
|
||||
]
|
||||
FILE_BASIC_INFORMATION = _FILE_BASIC_INFORMATION
|
||||
PFILE_BASIC_INFORMATION = POINTER(_FILE_BASIC_INFORMATION)
|
||||
|
||||
class _FILE_EA_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("EaSize", ULONG),
|
||||
]
|
||||
PFILE_EA_INFORMATION = POINTER(_FILE_EA_INFORMATION)
|
||||
FILE_EA_INFORMATION = _FILE_EA_INFORMATION
|
||||
|
||||
class _FILE_IO_PRIORITY_HINT_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("PriorityHint", IO_PRIORITY_HINT),
|
||||
]
|
||||
PFILE_IO_PRIORITY_HINT_INFORMATION = POINTER(_FILE_IO_PRIORITY_HINT_INFORMATION)
|
||||
FILE_IO_PRIORITY_HINT_INFORMATION = _FILE_IO_PRIORITY_HINT_INFORMATION
|
||||
|
||||
class _FILE_MODE_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("Mode", ULONG),
|
||||
]
|
||||
PFILE_MODE_INFORMATION = POINTER(_FILE_MODE_INFORMATION)
|
||||
FILE_MODE_INFORMATION = _FILE_MODE_INFORMATION
|
||||
|
||||
class _FILE_NAME_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("FileNameLength", ULONG),
|
||||
("FileName", WCHAR * 1),
|
||||
]
|
||||
PFILE_NAME_INFORMATION = POINTER(_FILE_NAME_INFORMATION)
|
||||
FILE_NAME_INFORMATION = _FILE_NAME_INFORMATION
|
||||
|
||||
class _FILE_NETWORK_OPEN_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("CreationTime", LARGE_INTEGER),
|
||||
("LastAccessTime", LARGE_INTEGER),
|
||||
("LastWriteTime", LARGE_INTEGER),
|
||||
("ChangeTime", LARGE_INTEGER),
|
||||
("AllocationSize", LARGE_INTEGER),
|
||||
("EndOfFile", LARGE_INTEGER),
|
||||
("FileAttributes", ULONG),
|
||||
]
|
||||
PFILE_NETWORK_OPEN_INFORMATION = POINTER(_FILE_NETWORK_OPEN_INFORMATION)
|
||||
FILE_NETWORK_OPEN_INFORMATION = _FILE_NETWORK_OPEN_INFORMATION
|
||||
|
||||
class _FILE_STANDARD_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("AllocationSize", LARGE_INTEGER),
|
||||
("EndOfFile", LARGE_INTEGER),
|
||||
("NumberOfLinks", ULONG),
|
||||
("DeletePending", BOOLEAN),
|
||||
("Directory", BOOLEAN),
|
||||
]
|
||||
FILE_STANDARD_INFORMATION = _FILE_STANDARD_INFORMATION
|
||||
PFILE_STANDARD_INFORMATION = POINTER(_FILE_STANDARD_INFORMATION)
|
||||
|
||||
class _FILE_ACCESS_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("AccessFlags", ACCESS_MASK),
|
||||
]
|
||||
FILE_ACCESS_INFORMATION = _FILE_ACCESS_INFORMATION
|
||||
PFILE_ACCESS_INFORMATION = POINTER(_FILE_ACCESS_INFORMATION)
|
||||
|
||||
class _FILE_POSITION_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("CurrentByteOffset", LARGE_INTEGER),
|
||||
]
|
||||
PFILE_POSITION_INFORMATION = POINTER(_FILE_POSITION_INFORMATION)
|
||||
FILE_POSITION_INFORMATION = _FILE_POSITION_INFORMATION
|
||||
|
||||
class _FILE_IS_REMOTE_DEVICE_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("IsRemote", BOOLEAN),
|
||||
]
|
||||
FILE_IS_REMOTE_DEVICE_INFORMATION = _FILE_IS_REMOTE_DEVICE_INFORMATION
|
||||
PFILE_IS_REMOTE_DEVICE_INFORMATION = POINTER(_FILE_IS_REMOTE_DEVICE_INFORMATION)
|
||||
|
||||
class _FILE_ALL_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("BasicInformation", FILE_BASIC_INFORMATION),
|
||||
("StandardInformation", FILE_STANDARD_INFORMATION),
|
||||
("InternalInformation", FILE_INTERNAL_INFORMATION),
|
||||
("EaInformation", FILE_EA_INFORMATION),
|
||||
("AccessInformation", FILE_ACCESS_INFORMATION),
|
||||
("PositionInformation", FILE_POSITION_INFORMATION),
|
||||
("ModeInformation", FILE_MODE_INFORMATION),
|
||||
("AlignmentInformation", FILE_ALIGNMENT_INFORMATION),
|
||||
("NameInformation", FILE_NAME_INFORMATION),
|
||||
]
|
||||
PFILE_ALL_INFORMATION = POINTER(_FILE_ALL_INFORMATION)
|
||||
FILE_ALL_INFORMATION = _FILE_ALL_INFORMATION
|
||||
|
||||
class tagRGBTRIPLE(Structure):
|
||||
_fields_ = [
|
||||
("rgbtBlue", BYTE),
|
||||
@@ -387,34 +625,95 @@ WNDCLASSEXW = tagWNDCLASSEXW
|
||||
LPWNDCLASSEXW = POINTER(tagWNDCLASSEXW)
|
||||
PWNDCLASSEXW = POINTER(tagWNDCLASSEXW)
|
||||
|
||||
class _EVENTLOGRECORD(Structure):
|
||||
_fields_ = [
|
||||
("Length", DWORD),
|
||||
("Reserved", DWORD),
|
||||
("RecordNumber", DWORD),
|
||||
("TimeGenerated", DWORD),
|
||||
("TimeWritten", DWORD),
|
||||
("EventID", DWORD),
|
||||
("EventType", WORD),
|
||||
("NumStrings", WORD),
|
||||
("EventCategory", WORD),
|
||||
("ReservedFlags", WORD),
|
||||
("ClosingRecordNumber", DWORD),
|
||||
("StringOffset", DWORD),
|
||||
("UserSidLength", DWORD),
|
||||
("UserSidOffset", DWORD),
|
||||
("DataLength", DWORD),
|
||||
("DataOffset", DWORD),
|
||||
]
|
||||
PEVENTLOGRECORD = POINTER(_EVENTLOGRECORD)
|
||||
EVENTLOGRECORD = _EVENTLOGRECORD
|
||||
BG_JOB_STATE_QUEUED = EnumValue("_BG_JOB_STATE", "BG_JOB_STATE_QUEUED", 0x0)
|
||||
BG_JOB_STATE_CONNECTING = EnumValue("_BG_JOB_STATE", "BG_JOB_STATE_CONNECTING", 0x1)
|
||||
BG_JOB_STATE_TRANSFERRING = EnumValue("_BG_JOB_STATE", "BG_JOB_STATE_TRANSFERRING", 0x2)
|
||||
BG_JOB_STATE_SUSPENDED = EnumValue("_BG_JOB_STATE", "BG_JOB_STATE_SUSPENDED", 0x3)
|
||||
BG_JOB_STATE_ERROR = EnumValue("_BG_JOB_STATE", "BG_JOB_STATE_ERROR", 0x4)
|
||||
BG_JOB_STATE_TRANSIENT_ERROR = EnumValue("_BG_JOB_STATE", "BG_JOB_STATE_TRANSIENT_ERROR", 0x5)
|
||||
BG_JOB_STATE_TRANSFERRED = EnumValue("_BG_JOB_STATE", "BG_JOB_STATE_TRANSFERRED", 0x6)
|
||||
BG_JOB_STATE_ACKNOWLEDGED = EnumValue("_BG_JOB_STATE", "BG_JOB_STATE_ACKNOWLEDGED", 0x7)
|
||||
BG_JOB_STATE_CANCELLED = EnumValue("_BG_JOB_STATE", "BG_JOB_STATE_CANCELLED", 0x8)
|
||||
class _BG_JOB_STATE(EnumType):
|
||||
values = [BG_JOB_STATE_QUEUED, BG_JOB_STATE_CONNECTING, BG_JOB_STATE_TRANSFERRING, BG_JOB_STATE_SUSPENDED, BG_JOB_STATE_ERROR, BG_JOB_STATE_TRANSIENT_ERROR, BG_JOB_STATE_TRANSFERRED, BG_JOB_STATE_ACKNOWLEDGED, BG_JOB_STATE_CANCELLED]
|
||||
mapper = {x:x for x in values}
|
||||
BG_JOB_STATE = _BG_JOB_STATE
|
||||
|
||||
class _EVENTLOG_FULL_INFORMATION(Structure):
|
||||
|
||||
BG_JOB_PROXY_USAGE_PRECONFIG = EnumValue("_BG_JOB_PROXY_USAGE", "BG_JOB_PROXY_USAGE_PRECONFIG", 0x0)
|
||||
BG_JOB_PROXY_USAGE_NO_PROXY = EnumValue("_BG_JOB_PROXY_USAGE", "BG_JOB_PROXY_USAGE_NO_PROXY", 0x1)
|
||||
BG_JOB_PROXY_USAGE_OVERRIDE = EnumValue("_BG_JOB_PROXY_USAGE", "BG_JOB_PROXY_USAGE_OVERRIDE", 0x2)
|
||||
BG_JOB_PROXY_USAGE_AUTODETECT = EnumValue("_BG_JOB_PROXY_USAGE", "BG_JOB_PROXY_USAGE_AUTODETECT", 0x3)
|
||||
class _BG_JOB_PROXY_USAGE(EnumType):
|
||||
values = [BG_JOB_PROXY_USAGE_PRECONFIG, BG_JOB_PROXY_USAGE_NO_PROXY, BG_JOB_PROXY_USAGE_OVERRIDE, BG_JOB_PROXY_USAGE_AUTODETECT]
|
||||
mapper = {x:x for x in values}
|
||||
BG_JOB_PROXY_USAGE = _BG_JOB_PROXY_USAGE
|
||||
|
||||
|
||||
BG_JOB_PRIORITY_FOREGROUND = EnumValue("_BG_JOB_PRIORITY", "BG_JOB_PRIORITY_FOREGROUND", 0x0)
|
||||
BG_JOB_PRIORITY_HIGH = EnumValue("_BG_JOB_PRIORITY", "BG_JOB_PRIORITY_HIGH", 0x1)
|
||||
BG_JOB_PRIORITY_NORMAL = EnumValue("_BG_JOB_PRIORITY", "BG_JOB_PRIORITY_NORMAL", 0x2)
|
||||
BG_JOB_PRIORITY_LOW = EnumValue("_BG_JOB_PRIORITY", "BG_JOB_PRIORITY_LOW", 0x3)
|
||||
class _BG_JOB_PRIORITY(EnumType):
|
||||
values = [BG_JOB_PRIORITY_FOREGROUND, BG_JOB_PRIORITY_HIGH, BG_JOB_PRIORITY_NORMAL, BG_JOB_PRIORITY_LOW]
|
||||
mapper = {x:x for x in values}
|
||||
BG_JOB_PRIORITY = _BG_JOB_PRIORITY
|
||||
|
||||
|
||||
BG_ERROR_CONTEXT_NONE = EnumValue("_BG_ERROR_CONTEXT", "BG_ERROR_CONTEXT_NONE", 0x0)
|
||||
BG_ERROR_CONTEXT_UNKNOWN = EnumValue("_BG_ERROR_CONTEXT", "BG_ERROR_CONTEXT_UNKNOWN", 0x1)
|
||||
BG_ERROR_CONTEXT_GENERAL_QUEUE_MANAGER = EnumValue("_BG_ERROR_CONTEXT", "BG_ERROR_CONTEXT_GENERAL_QUEUE_MANAGER", 0x2)
|
||||
BG_ERROR_CONTEXT_QUEUE_MANAGER_NOTIFICATION = EnumValue("_BG_ERROR_CONTEXT", "BG_ERROR_CONTEXT_QUEUE_MANAGER_NOTIFICATION", 0x3)
|
||||
BG_ERROR_CONTEXT_LOCAL_FILE = EnumValue("_BG_ERROR_CONTEXT", "BG_ERROR_CONTEXT_LOCAL_FILE", 0x4)
|
||||
BG_ERROR_CONTEXT_REMOTE_FILE = EnumValue("_BG_ERROR_CONTEXT", "BG_ERROR_CONTEXT_REMOTE_FILE", 0x5)
|
||||
BG_ERROR_CONTEXT_GENERAL_TRANSPORT = EnumValue("_BG_ERROR_CONTEXT", "BG_ERROR_CONTEXT_GENERAL_TRANSPORT", 0x6)
|
||||
BG_ERROR_CONTEXT_REMOTE_APPLICATION = EnumValue("_BG_ERROR_CONTEXT", "BG_ERROR_CONTEXT_REMOTE_APPLICATION", 0x7)
|
||||
class _BG_ERROR_CONTEXT(EnumType):
|
||||
values = [BG_ERROR_CONTEXT_NONE, BG_ERROR_CONTEXT_UNKNOWN, BG_ERROR_CONTEXT_GENERAL_QUEUE_MANAGER, BG_ERROR_CONTEXT_QUEUE_MANAGER_NOTIFICATION, BG_ERROR_CONTEXT_LOCAL_FILE, BG_ERROR_CONTEXT_REMOTE_FILE, BG_ERROR_CONTEXT_GENERAL_TRANSPORT, BG_ERROR_CONTEXT_REMOTE_APPLICATION]
|
||||
mapper = {x:x for x in values}
|
||||
BG_ERROR_CONTEXT = _BG_ERROR_CONTEXT
|
||||
|
||||
|
||||
BG_JOB_TYPE_DOWNLOAD = EnumValue("_BG_JOB_TYPE", "BG_JOB_TYPE_DOWNLOAD", 0x0)
|
||||
BG_JOB_TYPE_UPLOAD = EnumValue("_BG_JOB_TYPE", "BG_JOB_TYPE_UPLOAD", 0x1)
|
||||
BG_JOB_TYPE_UPLOAD_REPLY = EnumValue("_BG_JOB_TYPE", "BG_JOB_TYPE_UPLOAD_REPLY", 0x2)
|
||||
class _BG_JOB_TYPE(EnumType):
|
||||
values = [BG_JOB_TYPE_DOWNLOAD, BG_JOB_TYPE_UPLOAD, BG_JOB_TYPE_UPLOAD_REPLY]
|
||||
mapper = {x:x for x in values}
|
||||
BG_JOB_TYPE = _BG_JOB_TYPE
|
||||
|
||||
|
||||
class _BG_FILE_PROGRESS(Structure):
|
||||
_fields_ = [
|
||||
("dwFull", DWORD),
|
||||
("BytesTotal", UINT64),
|
||||
("BytesTransferred", UINT64),
|
||||
("Completed", BOOL),
|
||||
]
|
||||
EVENTLOG_FULL_INFORMATION = _EVENTLOG_FULL_INFORMATION
|
||||
LPEVENTLOG_FULL_INFORMATION = POINTER(_EVENTLOG_FULL_INFORMATION)
|
||||
BG_FILE_PROGRESS = _BG_FILE_PROGRESS
|
||||
|
||||
class _BG_JOB_PROGRESS(Structure):
|
||||
_fields_ = [
|
||||
("BytesTotal", UINT64),
|
||||
("BytesTransferred", UINT64),
|
||||
("FilesTotal", ULONG),
|
||||
("FilesTransferred", ULONG),
|
||||
]
|
||||
BG_JOB_PROGRESS = _BG_JOB_PROGRESS
|
||||
|
||||
class _BG_FILE_INFO(Structure):
|
||||
_fields_ = [
|
||||
("RemoteName", LPWSTR),
|
||||
("LocalName", LPWSTR),
|
||||
]
|
||||
BG_FILE_INFO = _BG_FILE_INFO
|
||||
|
||||
class _BG_JOB_TIMES(Structure):
|
||||
_fields_ = [
|
||||
("CreationTime", FILETIME),
|
||||
("ModificationTime", FILETIME),
|
||||
("TransferCompletionTime", FILETIME),
|
||||
]
|
||||
BG_JOB_TIMES = _BG_JOB_TIMES
|
||||
|
||||
class _GUID(Structure):
|
||||
_fields_ = [
|
||||
@@ -4900,305 +5199,6 @@ class _RPC_IF_ID(INITIAL_RPC_IF_ID):
|
||||
def __repr__(self):
|
||||
return '<RPC_IF_ID "{0}" ({1}, {2})>'.format(self.Uuid.to_string(), self.VersMajor, self.VersMinor)
|
||||
RPC_IF_ID = _RPC_IF_ID
|
||||
BG_JOB_STATE_QUEUED = EnumValue("_BG_JOB_STATE", "BG_JOB_STATE_QUEUED", 0x0)
|
||||
BG_JOB_STATE_CONNECTING = EnumValue("_BG_JOB_STATE", "BG_JOB_STATE_CONNECTING", 0x1)
|
||||
BG_JOB_STATE_TRANSFERRING = EnumValue("_BG_JOB_STATE", "BG_JOB_STATE_TRANSFERRING", 0x2)
|
||||
BG_JOB_STATE_SUSPENDED = EnumValue("_BG_JOB_STATE", "BG_JOB_STATE_SUSPENDED", 0x3)
|
||||
BG_JOB_STATE_ERROR = EnumValue("_BG_JOB_STATE", "BG_JOB_STATE_ERROR", 0x4)
|
||||
BG_JOB_STATE_TRANSIENT_ERROR = EnumValue("_BG_JOB_STATE", "BG_JOB_STATE_TRANSIENT_ERROR", 0x5)
|
||||
BG_JOB_STATE_TRANSFERRED = EnumValue("_BG_JOB_STATE", "BG_JOB_STATE_TRANSFERRED", 0x6)
|
||||
BG_JOB_STATE_ACKNOWLEDGED = EnumValue("_BG_JOB_STATE", "BG_JOB_STATE_ACKNOWLEDGED", 0x7)
|
||||
BG_JOB_STATE_CANCELLED = EnumValue("_BG_JOB_STATE", "BG_JOB_STATE_CANCELLED", 0x8)
|
||||
class _BG_JOB_STATE(EnumType):
|
||||
values = [BG_JOB_STATE_QUEUED, BG_JOB_STATE_CONNECTING, BG_JOB_STATE_TRANSFERRING, BG_JOB_STATE_SUSPENDED, BG_JOB_STATE_ERROR, BG_JOB_STATE_TRANSIENT_ERROR, BG_JOB_STATE_TRANSFERRED, BG_JOB_STATE_ACKNOWLEDGED, BG_JOB_STATE_CANCELLED]
|
||||
mapper = {x:x for x in values}
|
||||
BG_JOB_STATE = _BG_JOB_STATE
|
||||
|
||||
|
||||
BG_JOB_PROXY_USAGE_PRECONFIG = EnumValue("_BG_JOB_PROXY_USAGE", "BG_JOB_PROXY_USAGE_PRECONFIG", 0x0)
|
||||
BG_JOB_PROXY_USAGE_NO_PROXY = EnumValue("_BG_JOB_PROXY_USAGE", "BG_JOB_PROXY_USAGE_NO_PROXY", 0x1)
|
||||
BG_JOB_PROXY_USAGE_OVERRIDE = EnumValue("_BG_JOB_PROXY_USAGE", "BG_JOB_PROXY_USAGE_OVERRIDE", 0x2)
|
||||
BG_JOB_PROXY_USAGE_AUTODETECT = EnumValue("_BG_JOB_PROXY_USAGE", "BG_JOB_PROXY_USAGE_AUTODETECT", 0x3)
|
||||
class _BG_JOB_PROXY_USAGE(EnumType):
|
||||
values = [BG_JOB_PROXY_USAGE_PRECONFIG, BG_JOB_PROXY_USAGE_NO_PROXY, BG_JOB_PROXY_USAGE_OVERRIDE, BG_JOB_PROXY_USAGE_AUTODETECT]
|
||||
mapper = {x:x for x in values}
|
||||
BG_JOB_PROXY_USAGE = _BG_JOB_PROXY_USAGE
|
||||
|
||||
|
||||
BG_JOB_PRIORITY_FOREGROUND = EnumValue("_BG_JOB_PRIORITY", "BG_JOB_PRIORITY_FOREGROUND", 0x0)
|
||||
BG_JOB_PRIORITY_HIGH = EnumValue("_BG_JOB_PRIORITY", "BG_JOB_PRIORITY_HIGH", 0x1)
|
||||
BG_JOB_PRIORITY_NORMAL = EnumValue("_BG_JOB_PRIORITY", "BG_JOB_PRIORITY_NORMAL", 0x2)
|
||||
BG_JOB_PRIORITY_LOW = EnumValue("_BG_JOB_PRIORITY", "BG_JOB_PRIORITY_LOW", 0x3)
|
||||
class _BG_JOB_PRIORITY(EnumType):
|
||||
values = [BG_JOB_PRIORITY_FOREGROUND, BG_JOB_PRIORITY_HIGH, BG_JOB_PRIORITY_NORMAL, BG_JOB_PRIORITY_LOW]
|
||||
mapper = {x:x for x in values}
|
||||
BG_JOB_PRIORITY = _BG_JOB_PRIORITY
|
||||
|
||||
|
||||
BG_ERROR_CONTEXT_NONE = EnumValue("_BG_ERROR_CONTEXT", "BG_ERROR_CONTEXT_NONE", 0x0)
|
||||
BG_ERROR_CONTEXT_UNKNOWN = EnumValue("_BG_ERROR_CONTEXT", "BG_ERROR_CONTEXT_UNKNOWN", 0x1)
|
||||
BG_ERROR_CONTEXT_GENERAL_QUEUE_MANAGER = EnumValue("_BG_ERROR_CONTEXT", "BG_ERROR_CONTEXT_GENERAL_QUEUE_MANAGER", 0x2)
|
||||
BG_ERROR_CONTEXT_QUEUE_MANAGER_NOTIFICATION = EnumValue("_BG_ERROR_CONTEXT", "BG_ERROR_CONTEXT_QUEUE_MANAGER_NOTIFICATION", 0x3)
|
||||
BG_ERROR_CONTEXT_LOCAL_FILE = EnumValue("_BG_ERROR_CONTEXT", "BG_ERROR_CONTEXT_LOCAL_FILE", 0x4)
|
||||
BG_ERROR_CONTEXT_REMOTE_FILE = EnumValue("_BG_ERROR_CONTEXT", "BG_ERROR_CONTEXT_REMOTE_FILE", 0x5)
|
||||
BG_ERROR_CONTEXT_GENERAL_TRANSPORT = EnumValue("_BG_ERROR_CONTEXT", "BG_ERROR_CONTEXT_GENERAL_TRANSPORT", 0x6)
|
||||
BG_ERROR_CONTEXT_REMOTE_APPLICATION = EnumValue("_BG_ERROR_CONTEXT", "BG_ERROR_CONTEXT_REMOTE_APPLICATION", 0x7)
|
||||
class _BG_ERROR_CONTEXT(EnumType):
|
||||
values = [BG_ERROR_CONTEXT_NONE, BG_ERROR_CONTEXT_UNKNOWN, BG_ERROR_CONTEXT_GENERAL_QUEUE_MANAGER, BG_ERROR_CONTEXT_QUEUE_MANAGER_NOTIFICATION, BG_ERROR_CONTEXT_LOCAL_FILE, BG_ERROR_CONTEXT_REMOTE_FILE, BG_ERROR_CONTEXT_GENERAL_TRANSPORT, BG_ERROR_CONTEXT_REMOTE_APPLICATION]
|
||||
mapper = {x:x for x in values}
|
||||
BG_ERROR_CONTEXT = _BG_ERROR_CONTEXT
|
||||
|
||||
|
||||
BG_JOB_TYPE_DOWNLOAD = EnumValue("_BG_JOB_TYPE", "BG_JOB_TYPE_DOWNLOAD", 0x0)
|
||||
BG_JOB_TYPE_UPLOAD = EnumValue("_BG_JOB_TYPE", "BG_JOB_TYPE_UPLOAD", 0x1)
|
||||
BG_JOB_TYPE_UPLOAD_REPLY = EnumValue("_BG_JOB_TYPE", "BG_JOB_TYPE_UPLOAD_REPLY", 0x2)
|
||||
class _BG_JOB_TYPE(EnumType):
|
||||
values = [BG_JOB_TYPE_DOWNLOAD, BG_JOB_TYPE_UPLOAD, BG_JOB_TYPE_UPLOAD_REPLY]
|
||||
mapper = {x:x for x in values}
|
||||
BG_JOB_TYPE = _BG_JOB_TYPE
|
||||
|
||||
|
||||
class _BG_FILE_PROGRESS(Structure):
|
||||
_fields_ = [
|
||||
("BytesTotal", UINT64),
|
||||
("BytesTransferred", UINT64),
|
||||
("Completed", BOOL),
|
||||
]
|
||||
BG_FILE_PROGRESS = _BG_FILE_PROGRESS
|
||||
|
||||
class _BG_JOB_PROGRESS(Structure):
|
||||
_fields_ = [
|
||||
("BytesTotal", UINT64),
|
||||
("BytesTransferred", UINT64),
|
||||
("FilesTotal", ULONG),
|
||||
("FilesTransferred", ULONG),
|
||||
]
|
||||
BG_JOB_PROGRESS = _BG_JOB_PROGRESS
|
||||
|
||||
class _BG_FILE_INFO(Structure):
|
||||
_fields_ = [
|
||||
("RemoteName", LPWSTR),
|
||||
("LocalName", LPWSTR),
|
||||
]
|
||||
BG_FILE_INFO = _BG_FILE_INFO
|
||||
|
||||
class _BG_JOB_TIMES(Structure):
|
||||
_fields_ = [
|
||||
("CreationTime", FILETIME),
|
||||
("ModificationTime", FILETIME),
|
||||
("TransferCompletionTime", FILETIME),
|
||||
]
|
||||
BG_JOB_TIMES = _BG_JOB_TIMES
|
||||
|
||||
FakeFileInformationZero = EnumValue("_FILE_INFORMATION_CLASS", "FakeFileInformationZero", 0x0)
|
||||
FileDirectoryInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileDirectoryInformation", 0x1)
|
||||
FileFullDirectoryInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileFullDirectoryInformation", 0x2)
|
||||
FileBothDirectoryInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileBothDirectoryInformation", 0x3)
|
||||
FileBasicInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileBasicInformation", 0x4)
|
||||
FileStandardInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileStandardInformation", 0x5)
|
||||
FileInternalInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileInternalInformation", 0x6)
|
||||
FileEaInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileEaInformation", 0x7)
|
||||
FileAccessInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileAccessInformation", 0x8)
|
||||
FileNameInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileNameInformation", 0x9)
|
||||
FileRenameInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileRenameInformation", 0xa)
|
||||
FileLinkInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileLinkInformation", 0xb)
|
||||
FileNamesInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileNamesInformation", 0xc)
|
||||
FileDispositionInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileDispositionInformation", 0xd)
|
||||
FilePositionInformation = EnumValue("_FILE_INFORMATION_CLASS", "FilePositionInformation", 0xe)
|
||||
FileFullEaInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileFullEaInformation", 0xf)
|
||||
FileModeInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileModeInformation", 0x10)
|
||||
FileAlignmentInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileAlignmentInformation", 0x11)
|
||||
FileAllInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileAllInformation", 0x12)
|
||||
FileAllocationInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileAllocationInformation", 0x13)
|
||||
FileEndOfFileInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileEndOfFileInformation", 0x14)
|
||||
FileAlternateNameInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileAlternateNameInformation", 0x15)
|
||||
FileStreamInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileStreamInformation", 0x16)
|
||||
FilePipeInformation = EnumValue("_FILE_INFORMATION_CLASS", "FilePipeInformation", 0x17)
|
||||
FilePipeLocalInformation = EnumValue("_FILE_INFORMATION_CLASS", "FilePipeLocalInformation", 0x18)
|
||||
FilePipeRemoteInformation = EnumValue("_FILE_INFORMATION_CLASS", "FilePipeRemoteInformation", 0x19)
|
||||
FileMailslotQueryInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileMailslotQueryInformation", 0x1a)
|
||||
FileMailslotSetInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileMailslotSetInformation", 0x1b)
|
||||
FileCompressionInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileCompressionInformation", 0x1c)
|
||||
FileObjectIdInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileObjectIdInformation", 0x1d)
|
||||
FileCompletionInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileCompletionInformation", 0x1e)
|
||||
FileMoveClusterInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileMoveClusterInformation", 0x1f)
|
||||
FileQuotaInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileQuotaInformation", 0x20)
|
||||
FileReparsePointInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileReparsePointInformation", 0x21)
|
||||
FileNetworkOpenInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileNetworkOpenInformation", 0x22)
|
||||
FileAttributeTagInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileAttributeTagInformation", 0x23)
|
||||
FileTrackingInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileTrackingInformation", 0x24)
|
||||
FileIdBothDirectoryInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileIdBothDirectoryInformation", 0x25)
|
||||
FileIdFullDirectoryInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileIdFullDirectoryInformation", 0x26)
|
||||
FileValidDataLengthInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileValidDataLengthInformation", 0x27)
|
||||
FileShortNameInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileShortNameInformation", 0x28)
|
||||
FileIoCompletionNotificationInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileIoCompletionNotificationInformation", 0x29)
|
||||
FileIoStatusBlockRangeInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileIoStatusBlockRangeInformation", 0x2a)
|
||||
FileIoPriorityHintInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileIoPriorityHintInformation", 0x2b)
|
||||
FileSfioReserveInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileSfioReserveInformation", 0x2c)
|
||||
FileSfioVolumeInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileSfioVolumeInformation", 0x2d)
|
||||
FileHardLinkInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileHardLinkInformation", 0x2e)
|
||||
FileProcessIdsUsingFileInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileProcessIdsUsingFileInformation", 0x2f)
|
||||
FileNormalizedNameInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileNormalizedNameInformation", 0x30)
|
||||
FileNetworkPhysicalNameInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileNetworkPhysicalNameInformation", 0x31)
|
||||
FileIdGlobalTxDirectoryInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileIdGlobalTxDirectoryInformation", 0x32)
|
||||
FileIsRemoteDeviceInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileIsRemoteDeviceInformation", 0x33)
|
||||
FileUnusedInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileUnusedInformation", 0x34)
|
||||
FileNumaNodeInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileNumaNodeInformation", 0x35)
|
||||
FileStandardLinkInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileStandardLinkInformation", 0x36)
|
||||
FileRemoteProtocolInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileRemoteProtocolInformation", 0x37)
|
||||
FileRenameInformationBypassAccessCheck = EnumValue("_FILE_INFORMATION_CLASS", "FileRenameInformationBypassAccessCheck", 0x38)
|
||||
FileLinkInformationBypassAccessCheck = EnumValue("_FILE_INFORMATION_CLASS", "FileLinkInformationBypassAccessCheck", 0x39)
|
||||
FileVolumeNameInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileVolumeNameInformation", 0x3a)
|
||||
FileIdInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileIdInformation", 0x3b)
|
||||
FileIdExtdDirectoryInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileIdExtdDirectoryInformation", 0x3c)
|
||||
FileReplaceCompletionInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileReplaceCompletionInformation", 0x3d)
|
||||
FileHardLinkFullIdInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileHardLinkFullIdInformation", 0x3e)
|
||||
FileIdExtdBothDirectoryInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileIdExtdBothDirectoryInformation", 0x3f)
|
||||
FileDispositionInformationEx = EnumValue("_FILE_INFORMATION_CLASS", "FileDispositionInformationEx", 0x40)
|
||||
FileRenameInformationEx = EnumValue("_FILE_INFORMATION_CLASS", "FileRenameInformationEx", 0x41)
|
||||
FileRenameInformationExBypassAccessCheck = EnumValue("_FILE_INFORMATION_CLASS", "FileRenameInformationExBypassAccessCheck", 0x42)
|
||||
FileMaximumInformation = EnumValue("_FILE_INFORMATION_CLASS", "FileMaximumInformation", 0x43)
|
||||
class _FILE_INFORMATION_CLASS(EnumType):
|
||||
values = [FakeFileInformationZero, FileDirectoryInformation, FileFullDirectoryInformation, FileBothDirectoryInformation, FileBasicInformation, FileStandardInformation, FileInternalInformation, FileEaInformation, FileAccessInformation, FileNameInformation, FileRenameInformation, FileLinkInformation, FileNamesInformation, FileDispositionInformation, FilePositionInformation, FileFullEaInformation, FileModeInformation, FileAlignmentInformation, FileAllInformation, FileAllocationInformation, FileEndOfFileInformation, FileAlternateNameInformation, FileStreamInformation, FilePipeInformation, FilePipeLocalInformation, FilePipeRemoteInformation, FileMailslotQueryInformation, FileMailslotSetInformation, FileCompressionInformation, FileObjectIdInformation, FileCompletionInformation, FileMoveClusterInformation, FileQuotaInformation, FileReparsePointInformation, FileNetworkOpenInformation, FileAttributeTagInformation, FileTrackingInformation, FileIdBothDirectoryInformation, FileIdFullDirectoryInformation, FileValidDataLengthInformation, FileShortNameInformation, FileIoCompletionNotificationInformation, FileIoStatusBlockRangeInformation, FileIoPriorityHintInformation, FileSfioReserveInformation, FileSfioVolumeInformation, FileHardLinkInformation, FileProcessIdsUsingFileInformation, FileNormalizedNameInformation, FileNetworkPhysicalNameInformation, FileIdGlobalTxDirectoryInformation, FileIsRemoteDeviceInformation, FileUnusedInformation, FileNumaNodeInformation, FileStandardLinkInformation, FileRemoteProtocolInformation, FileRenameInformationBypassAccessCheck, FileLinkInformationBypassAccessCheck, FileVolumeNameInformation, FileIdInformation, FileIdExtdDirectoryInformation, FileReplaceCompletionInformation, FileHardLinkFullIdInformation, FileIdExtdBothDirectoryInformation, FileDispositionInformationEx, FileRenameInformationEx, FileRenameInformationExBypassAccessCheck, FileMaximumInformation]
|
||||
mapper = {x:x for x in values}
|
||||
FILE_INFORMATION_CLASS = _FILE_INFORMATION_CLASS
|
||||
PFILE_INFORMATION_CLASS = POINTER(_FILE_INFORMATION_CLASS)
|
||||
|
||||
|
||||
IoPriorityVeryLow = EnumValue("_IO_PRIORITY_HINT", "IoPriorityVeryLow", 0x0)
|
||||
IoPriorityLow = EnumValue("_IO_PRIORITY_HINT", "IoPriorityLow", 0x1)
|
||||
IoPriorityNormal = EnumValue("_IO_PRIORITY_HINT", "IoPriorityNormal", 0x2)
|
||||
IoPriorityHigh = EnumValue("_IO_PRIORITY_HINT", "IoPriorityHigh", 0x3)
|
||||
IoPriorityCritical = EnumValue("_IO_PRIORITY_HINT", "IoPriorityCritical", 0x4)
|
||||
MaxIoPriorityTypes = EnumValue("_IO_PRIORITY_HINT", "MaxIoPriorityTypes", 0x5)
|
||||
class _IO_PRIORITY_HINT(EnumType):
|
||||
values = [IoPriorityVeryLow, IoPriorityLow, IoPriorityNormal, IoPriorityHigh, IoPriorityCritical, MaxIoPriorityTypes]
|
||||
mapper = {x:x for x in values}
|
||||
IO_PRIORITY_HINT = _IO_PRIORITY_HINT
|
||||
|
||||
|
||||
class _FILE_INTERNAL_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("IndexNumber", LARGE_INTEGER),
|
||||
]
|
||||
FILE_INTERNAL_INFORMATION = _FILE_INTERNAL_INFORMATION
|
||||
PFILE_INTERNAL_INFORMATION = POINTER(_FILE_INTERNAL_INFORMATION)
|
||||
|
||||
class _FILE_ALIGNMENT_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("AlignmentRequirement", ULONG),
|
||||
]
|
||||
PFILE_ALIGNMENT_INFORMATION = POINTER(_FILE_ALIGNMENT_INFORMATION)
|
||||
FILE_ALIGNMENT_INFORMATION = _FILE_ALIGNMENT_INFORMATION
|
||||
|
||||
class _FILE_ATTRIBUTE_TAG_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("FileAttributes", ULONG),
|
||||
("ReparseTag", ULONG),
|
||||
]
|
||||
PFILE_ATTRIBUTE_TAG_INFORMATION = POINTER(_FILE_ATTRIBUTE_TAG_INFORMATION)
|
||||
FILE_ATTRIBUTE_TAG_INFORMATION = _FILE_ATTRIBUTE_TAG_INFORMATION
|
||||
|
||||
class _FILE_BASIC_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("CreationTime", LARGE_INTEGER),
|
||||
("LastAccessTime", LARGE_INTEGER),
|
||||
("LastWriteTime", LARGE_INTEGER),
|
||||
("ChangeTime", LARGE_INTEGER),
|
||||
("FileAttributes", ULONG),
|
||||
]
|
||||
FILE_BASIC_INFORMATION = _FILE_BASIC_INFORMATION
|
||||
PFILE_BASIC_INFORMATION = POINTER(_FILE_BASIC_INFORMATION)
|
||||
|
||||
class _FILE_EA_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("EaSize", ULONG),
|
||||
]
|
||||
PFILE_EA_INFORMATION = POINTER(_FILE_EA_INFORMATION)
|
||||
FILE_EA_INFORMATION = _FILE_EA_INFORMATION
|
||||
|
||||
class _FILE_IO_PRIORITY_HINT_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("PriorityHint", IO_PRIORITY_HINT),
|
||||
]
|
||||
PFILE_IO_PRIORITY_HINT_INFORMATION = POINTER(_FILE_IO_PRIORITY_HINT_INFORMATION)
|
||||
FILE_IO_PRIORITY_HINT_INFORMATION = _FILE_IO_PRIORITY_HINT_INFORMATION
|
||||
|
||||
class _FILE_MODE_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("Mode", ULONG),
|
||||
]
|
||||
PFILE_MODE_INFORMATION = POINTER(_FILE_MODE_INFORMATION)
|
||||
FILE_MODE_INFORMATION = _FILE_MODE_INFORMATION
|
||||
|
||||
class _FILE_NAME_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("FileNameLength", ULONG),
|
||||
("FileName", WCHAR * 1),
|
||||
]
|
||||
PFILE_NAME_INFORMATION = POINTER(_FILE_NAME_INFORMATION)
|
||||
FILE_NAME_INFORMATION = _FILE_NAME_INFORMATION
|
||||
|
||||
class _FILE_NETWORK_OPEN_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("CreationTime", LARGE_INTEGER),
|
||||
("LastAccessTime", LARGE_INTEGER),
|
||||
("LastWriteTime", LARGE_INTEGER),
|
||||
("ChangeTime", LARGE_INTEGER),
|
||||
("AllocationSize", LARGE_INTEGER),
|
||||
("EndOfFile", LARGE_INTEGER),
|
||||
("FileAttributes", ULONG),
|
||||
]
|
||||
PFILE_NETWORK_OPEN_INFORMATION = POINTER(_FILE_NETWORK_OPEN_INFORMATION)
|
||||
FILE_NETWORK_OPEN_INFORMATION = _FILE_NETWORK_OPEN_INFORMATION
|
||||
|
||||
class _FILE_STANDARD_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("AllocationSize", LARGE_INTEGER),
|
||||
("EndOfFile", LARGE_INTEGER),
|
||||
("NumberOfLinks", ULONG),
|
||||
("DeletePending", BOOLEAN),
|
||||
("Directory", BOOLEAN),
|
||||
]
|
||||
FILE_STANDARD_INFORMATION = _FILE_STANDARD_INFORMATION
|
||||
PFILE_STANDARD_INFORMATION = POINTER(_FILE_STANDARD_INFORMATION)
|
||||
|
||||
class _FILE_ACCESS_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("AccessFlags", ACCESS_MASK),
|
||||
]
|
||||
FILE_ACCESS_INFORMATION = _FILE_ACCESS_INFORMATION
|
||||
PFILE_ACCESS_INFORMATION = POINTER(_FILE_ACCESS_INFORMATION)
|
||||
|
||||
class _FILE_POSITION_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("CurrentByteOffset", LARGE_INTEGER),
|
||||
]
|
||||
PFILE_POSITION_INFORMATION = POINTER(_FILE_POSITION_INFORMATION)
|
||||
FILE_POSITION_INFORMATION = _FILE_POSITION_INFORMATION
|
||||
|
||||
class _FILE_IS_REMOTE_DEVICE_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("IsRemote", BOOLEAN),
|
||||
]
|
||||
FILE_IS_REMOTE_DEVICE_INFORMATION = _FILE_IS_REMOTE_DEVICE_INFORMATION
|
||||
PFILE_IS_REMOTE_DEVICE_INFORMATION = POINTER(_FILE_IS_REMOTE_DEVICE_INFORMATION)
|
||||
|
||||
class _FILE_ALL_INFORMATION(Structure):
|
||||
_fields_ = [
|
||||
("BasicInformation", FILE_BASIC_INFORMATION),
|
||||
("StandardInformation", FILE_STANDARD_INFORMATION),
|
||||
("InternalInformation", FILE_INTERNAL_INFORMATION),
|
||||
("EaInformation", FILE_EA_INFORMATION),
|
||||
("AccessInformation", FILE_ACCESS_INFORMATION),
|
||||
("PositionInformation", FILE_POSITION_INFORMATION),
|
||||
("ModeInformation", FILE_MODE_INFORMATION),
|
||||
("AlignmentInformation", FILE_ALIGNMENT_INFORMATION),
|
||||
("NameInformation", FILE_NAME_INFORMATION),
|
||||
]
|
||||
PFILE_ALL_INFORMATION = POINTER(_FILE_ALL_INFORMATION)
|
||||
FILE_ALL_INFORMATION = _FILE_ALL_INFORMATION
|
||||
|
||||
class _SHITEMID(Structure):
|
||||
_fields_ = [
|
||||
("cb", USHORT),
|
||||
|
||||
@@ -0,0 +1,98 @@
|
||||
import windows
|
||||
from windows import winproxy
|
||||
import windows.generated_def as gdef
|
||||
|
||||
import _multiprocessing
|
||||
|
||||
# Inspired from 'multiprocessing\connection.py'
|
||||
|
||||
def full_pipe_address(addr):
|
||||
"""Return the full address of the pipe `addr`"""
|
||||
if addr.startswith("\\\\"):
|
||||
return addr
|
||||
return r"\\.\pipe\{addr}".format(addr=addr)
|
||||
|
||||
class PipeConnection(object): # Cannot inherit: crash the interpreter
|
||||
"""A wrapper arround :class:`_multiprocessing.PipeConnection` able to work as a ContextManager"""
|
||||
BUFFER_SIZE = 0x2000
|
||||
|
||||
def __init__(self, connection, name=None, server=False):
|
||||
self.handle = connection.fileno()
|
||||
self.connection = connection
|
||||
self.name = name
|
||||
self.server = server
|
||||
|
||||
@classmethod
|
||||
def from_handle(cls, phandle, *args, **kwargs):
|
||||
"""Create a :class:`PipeConnection` from pipe handle `phandle`"""
|
||||
connection = _multiprocessing.PipeConnection(phandle)
|
||||
return cls(connection, *args, **kwargs)
|
||||
|
||||
@classmethod
|
||||
def create(cls, addr):
|
||||
"""Create a namedpipe pipe `addr`
|
||||
|
||||
:returns type: :class:`PipeConnection`
|
||||
"""
|
||||
addr = full_pipe_address(addr)
|
||||
pipehandle = winproxy.CreateNamedPipeA(
|
||||
addr, gdef.PIPE_ACCESS_DUPLEX,
|
||||
gdef.PIPE_TYPE_MESSAGE | gdef.PIPE_READMODE_MESSAGE |
|
||||
gdef.PIPE_WAIT,
|
||||
gdef.PIPE_UNLIMITED_INSTANCES, cls.BUFFER_SIZE, cls.BUFFER_SIZE,
|
||||
gdef.NMPWAIT_WAIT_FOREVER, None
|
||||
)
|
||||
return cls.from_handle(pipehandle, name=addr, server=True)
|
||||
|
||||
@classmethod
|
||||
def connect(cls, addr):
|
||||
"""Connect to the named pipe `addr`
|
||||
|
||||
:returns type: :class:`PipeConnection`
|
||||
"""
|
||||
addr = full_pipe_address(addr)
|
||||
pipehandle = winproxy.CreateFileA(addr, gdef.GENERIC_READ | gdef.GENERIC_WRITE, 0, None, gdef.OPEN_EXISTING, 0, None)
|
||||
winproxy.SetNamedPipeHandleState(pipehandle, gdef.ULONG(gdef.PIPE_READMODE_MESSAGE), None, None)
|
||||
return cls.from_handle(pipehandle, name=addr, server=False)
|
||||
|
||||
def send(self, *args, **kwargs):
|
||||
"""Send an object on the pipe"""
|
||||
return self.connection.send(*args, **kwargs)
|
||||
|
||||
def recv(self, *args, **kwargs):
|
||||
"""Send an object from the pipe"""
|
||||
return self.connection.recv(*args, **kwargs)
|
||||
|
||||
def wait_connection(self):
|
||||
"""Wait for a client process to connect to the named pipe"""
|
||||
return winproxy.ConnectNamedPipe(self.handle, None)
|
||||
|
||||
def close(self):
|
||||
"""Close the handle of the pipe"""
|
||||
self.connection.close()
|
||||
self.handle = None
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, *args, **kwargs):
|
||||
self.close()
|
||||
|
||||
def __repr__(self):
|
||||
return """<{0} name="{1}" server={2}>""".format(type(self).__name__, self.name, self.server)
|
||||
|
||||
|
||||
connect = PipeConnection.connect
|
||||
create = PipeConnection.create
|
||||
|
||||
def send_object(addr, obj):
|
||||
"""Send `obj` on pipe `addr`"""
|
||||
with connect(addr) as np:
|
||||
np.send(obj)
|
||||
return None
|
||||
|
||||
def recv_object(addr):
|
||||
"""Receive an object from pipe `addr`"""
|
||||
with create(addr) as np:
|
||||
np.wait_connection()
|
||||
return np.recv()
|
||||
@@ -1719,3 +1719,22 @@ def RollbackTransaction(TransactionHandle):
|
||||
def OpenTransaction(dwDesiredAccess, TransactionId):
|
||||
return OpenTransaction.ctypes_function(dwDesiredAccess, TransactionId)
|
||||
|
||||
|
||||
# Pipe
|
||||
|
||||
@Kernel32Proxy("CreateNamedPipeA")
|
||||
def CreateNamedPipeA(lpName, dwOpenMode, dwPipeMode, nMaxInstances, nOutBufferSize, nInBufferSize, nDefaultTimeOut, lpSecurityAttributes):
|
||||
return CreateNamedPipeA.ctypes_function(lpName, dwOpenMode, dwPipeMode, nMaxInstances, nOutBufferSize, nInBufferSize, nDefaultTimeOut, lpSecurityAttributes)
|
||||
|
||||
@Kernel32Proxy("CreateNamedPipeW")
|
||||
def CreateNamedPipeW(lpName, dwOpenMode, dwPipeMode, nMaxInstances, nOutBufferSize, nInBufferSize, nDefaultTimeOut, lpSecurityAttributes):
|
||||
return CreateNamedPipeW.ctypes_function(lpName, dwOpenMode, dwPipeMode, nMaxInstances, nOutBufferSize, nInBufferSize, nDefaultTimeOut, lpSecurityAttributes)
|
||||
|
||||
@Kernel32Proxy("ConnectNamedPipe")
|
||||
def ConnectNamedPipe(hNamedPipe, lpOverlapped):
|
||||
return ConnectNamedPipe.ctypes_function(hNamedPipe, lpOverlapped)
|
||||
|
||||
@Kernel32Proxy("SetNamedPipeHandleState")
|
||||
def SetNamedPipeHandleState(hNamedPipe, lpMode, lpMaxCollectionCount, lpCollectDataTimeout):
|
||||
return SetNamedPipeHandleState.ctypes_function(hNamedPipe, lpMode, lpMaxCollectionCount, lpCollectDataTimeout)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user