mirror of
https://github.com/hakril/PythonForWindows
synced 2026-06-08 14:31:45 +00:00
Adding some ALPC struct/funcs
This commit is contained in:
@@ -948,6 +948,13 @@ NTSTATUS WINAPI NtAlpcCreatePort(
|
||||
_In_opt_ PALPC_PORT_ATTRIBUTES PortAttributes
|
||||
);
|
||||
|
||||
NTSTATUS WINAPI NtAlpcQueryInformation(
|
||||
_In_opt_ HANDLE PortHandle,
|
||||
_In_ ALPC_PORT_INFORMATION_CLASS PortInformationClass,
|
||||
_Inout_opt_ PVOID PortInformation,
|
||||
_In_ ULONG Length,
|
||||
_Out_opt_ PULONG ReturnLength
|
||||
);
|
||||
|
||||
NTSTATUS WINAPI NtAlpcConnectPort(
|
||||
_Out_ PHANDLE PortHandle,
|
||||
@@ -1013,6 +1020,72 @@ NTSTATUS WINAPI NtAlpcSendWaitReceivePort(
|
||||
_In_opt_ PLARGE_INTEGER Timeout
|
||||
);
|
||||
|
||||
NTSTATUS WINAPI NtAlpcCreatePortSection(
|
||||
_In_ HANDLE PortHandle,
|
||||
_In_ ULONG Flags,
|
||||
_In_opt_ HANDLE SectionHandle,
|
||||
_In_ SIZE_T SectionSize,
|
||||
_Out_ PALPC_HANDLE AlpcSectionHandle,
|
||||
_Out_ PSIZE_T ActualSectionSize
|
||||
);
|
||||
|
||||
NTSTATUS WINAPI NtAlpcDeletePortSection(
|
||||
_In_ HANDLE PortHandle,
|
||||
_Reserved_ ULONG Flags,
|
||||
_In_ ALPC_HANDLE SectionHandle
|
||||
);
|
||||
|
||||
|
||||
|
||||
NTSTATUS WINAPI NtAlpcCreateResourceReserve(
|
||||
_In_ HANDLE PortHandle,
|
||||
_Reserved_ ULONG Flags,
|
||||
_In_ SIZE_T MessageSize,
|
||||
_Out_ PALPC_HANDLE ResourceId
|
||||
);
|
||||
|
||||
|
||||
NTSTATUS WINAPI NtAlpcDeleteResourceReserve(
|
||||
_In_ HANDLE PortHandle,
|
||||
_Reserved_ ULONG Flags,
|
||||
_In_ ALPC_HANDLE ResourceId
|
||||
);
|
||||
|
||||
|
||||
NTSTATUS WINAPI NtAlpcCreateSectionView(
|
||||
_In_ HANDLE PortHandle,
|
||||
_Reserved_ ULONG Flags,
|
||||
_Inout_ PALPC_DATA_VIEW_ATTR ViewAttributes
|
||||
);
|
||||
|
||||
|
||||
NTSTATUS WINAPI NtAlpcDeleteSectionView(
|
||||
_In_ HANDLE PortHandle,
|
||||
_Reserved_ ULONG Flags,
|
||||
_In_ PVOID ViewBase
|
||||
);
|
||||
|
||||
|
||||
NTSTATUS WINAPI NtAlpcCreateSecurityContext(
|
||||
_In_ HANDLE PortHandle,
|
||||
_Reserved_ ULONG Flags,
|
||||
_Inout_ PALPC_SECURITY_ATTR SecurityAttribute
|
||||
);
|
||||
|
||||
|
||||
NTSTATUS WINAPI NtAlpcDeleteSecurityContext(
|
||||
_In_ HANDLE PortHandle,
|
||||
_Reserved_ ULONG Flags,
|
||||
_In_ ALPC_HANDLE ContextHandle
|
||||
);
|
||||
|
||||
|
||||
NTSTATUS WINAPI NtAlpcRevokeSecurityContext(
|
||||
_In_ HANDLE PortHandle,
|
||||
_Reserved_ ULONG Flags,
|
||||
_In_ ALPC_HANDLE ContextHandle
|
||||
);
|
||||
|
||||
|
||||
INT WINAPI lstrcmpA(
|
||||
__in LPCSTR lpString1,
|
||||
|
||||
@@ -510,6 +510,8 @@ typedef enum NET_FW_RULE_DIRECTION_ {
|
||||
NET_FW_RULE_DIR_MAX = 3
|
||||
} NET_FW_RULE_DIRECTION;
|
||||
|
||||
|
||||
|
||||
typedef enum tag_WBEMSTATUS {
|
||||
WBEM_NO_ERROR = 0,
|
||||
WBEM_S_NO_ERROR = 0,
|
||||
@@ -2367,100 +2369,6 @@ typedef struct _SECURITY_QUALITY_OF_SERVICE {
|
||||
BOOLEAN EffectiveOnly;
|
||||
} SECURITY_QUALITY_OF_SERVICE, * PSECURITY_QUALITY_OF_SERVICE;
|
||||
|
||||
typedef struct _ALPC_PORT_ATTRIBUTES32
|
||||
{
|
||||
ULONG Flags;
|
||||
SECURITY_QUALITY_OF_SERVICE SecurityQos;
|
||||
SIZE_T MaxMessageLength;
|
||||
SIZE_T MemoryBandwidth;
|
||||
SIZE_T MaxPoolUsage;
|
||||
SIZE_T MaxSectionSize;
|
||||
SIZE_T MaxViewSize;
|
||||
SIZE_T MaxTotalSectionSize;
|
||||
ULONG DupObjectTypes;
|
||||
} ALPC_PORT_ATTRIBUTES32, *PALPC_PORT_ATTRIBUTES32;
|
||||
|
||||
|
||||
typedef struct _ALPC_PORT_ATTRIBUTES64
|
||||
{
|
||||
ULONG Flags;
|
||||
SECURITY_QUALITY_OF_SERVICE SecurityQos;
|
||||
SIZE_T MaxMessageLength;
|
||||
SIZE_T MemoryBandwidth;
|
||||
SIZE_T MaxPoolUsage;
|
||||
SIZE_T MaxSectionSize;
|
||||
SIZE_T MaxViewSize;
|
||||
SIZE_T MaxTotalSectionSize;
|
||||
ULONG DupObjectTypes;
|
||||
ULONG Reserved;
|
||||
} ALPC_PORT_ATTRIBUTES64, *PALPC_PORT_ATTRIBUTES64;
|
||||
|
||||
typedef struct _ALPC_MESSAGE_ATTRIBUTES
|
||||
{
|
||||
ULONG AllocatedAttributes;
|
||||
ULONG ValidAttributes;
|
||||
} ALPC_MESSAGE_ATTRIBUTES, *PALPC_MESSAGE_ATTRIBUTES;
|
||||
|
||||
|
||||
typedef union _PORT_MESSAGE32_TMP_UNION
|
||||
{
|
||||
ULONG ClientViewSize;
|
||||
ULONG CallbackId;
|
||||
} PORT_MESSAGE_TMP_UNION;
|
||||
|
||||
typedef union _PORT_MESSAGE64_TMP_UNION
|
||||
{
|
||||
ULONGLONG ClientViewSize;
|
||||
ULONG CallbackId;
|
||||
} PORT_MESSAGE_TMP_UNION;
|
||||
|
||||
|
||||
typedef struct _PORT_MESSAGE_TMP_SUBSTRUCT_S1
|
||||
{
|
||||
CSHORT DataLength;
|
||||
CSHORT TotalLength;
|
||||
} _PORT_MESSAGE_TMP_SUBSTRUCT_S1;
|
||||
|
||||
|
||||
typedef union _PORT_MESSAGE_TMP_UNION_U1
|
||||
{
|
||||
ULONG Length;
|
||||
_PORT_MESSAGE_TMP_SUBSTRUCT_S1 s1;
|
||||
} _PORT_MESSAGE_TMP_UNION_U1;
|
||||
|
||||
|
||||
typedef struct _PORT_MESSAGE_TMP_SUBSTRUCT_S2
|
||||
{
|
||||
CSHORT Type;
|
||||
CSHORT DataInfoOffset;
|
||||
} _PORT_MESSAGE_TMP_SUBSTRUCT_S2;
|
||||
|
||||
|
||||
typedef union _PORT_MESSAGE_TMP_UNION_U2
|
||||
{
|
||||
ULONG ZeroInit;
|
||||
_PORT_MESSAGE_TMP_SUBSTRUCT_S2 s2;
|
||||
} _PORT_MESSAGE_TMP_UNION_U2;
|
||||
|
||||
|
||||
typedef struct _PORT_MESSAGE32
|
||||
{
|
||||
_PORT_MESSAGE_TMP_UNION_U1 u1;
|
||||
_PORT_MESSAGE_TMP_UNION_U2 u2;
|
||||
CLIENT_ID32 ClientId;
|
||||
ULONG MessageId;
|
||||
_PORT_MESSAGE32_TMP_UNION tmp_union;
|
||||
} PORT_MESSAGE32, *PPORT_MESSAGE32;
|
||||
|
||||
typedef struct _PORT_MESSAGE64
|
||||
{
|
||||
_PORT_MESSAGE_TMP_UNION_U1 u1;
|
||||
_PORT_MESSAGE_TMP_UNION_U2 u2;
|
||||
CLIENT_ID64 ClientId;
|
||||
ULONG MessageId;
|
||||
_PORT_MESSAGE64_TMP_UNION tmp_union;
|
||||
} PORT_MESSAGE64, *PPORT_MESSAGE64;
|
||||
|
||||
|
||||
typedef struct _SERVICE_STATUS {
|
||||
DWORD dwServiceType;
|
||||
|
||||
@@ -83,6 +83,8 @@ TYPE_EQUIVALENCE = [
|
||||
('SC_HANDLE', 'HANDLE'),
|
||||
('HCERTCHAINENGINE', 'HANDLE'),
|
||||
('LPHANDLE', 'POINTER(HANDLE)'),
|
||||
('ALPC_HANDLE', 'HANDLE'),
|
||||
('PALPC_HANDLE', 'POINTER(ALPC_HANDLE)'),
|
||||
('PHKEY', 'POINTER(HKEY)'),
|
||||
('ACCESS_MASK', 'DWORD'),
|
||||
('REGSAM', 'ACCESS_MASK'),
|
||||
@@ -728,6 +730,7 @@ defs_with_ntstatus.append_input_file(from_here("definitions\\windef_error.txt"))
|
||||
structs = StructGenerator(from_here("definitions\\winstruct.txt"), from_here(r"..\windows\generated_def\\winstructs.py"), dependances=[defs_with_ntstatus])
|
||||
structs.append_input_file(from_here("definitions\\display_struct.txt"))
|
||||
structs.append_input_file(from_here("definitions\\winstruct_bits.txt"))
|
||||
structs.append_input_file(from_here("definitions\\winstruct_alpc.txt"))
|
||||
|
||||
functions = FuncGenerator(from_here("definitions\\winfunc.txt"), from_here(r"..\windows\generated_def\\winfuncs.py"), dependances=[structs])
|
||||
functions.append_input_file(from_here("definitions\\wintrust_crypt_func.txt"))
|
||||
|
||||
@@ -39,8 +39,8 @@ else:
|
||||
winstructs.PALPC_PORT_ATTRIBUTES = winstructs.PALPC_PORT_ATTRIBUTES64
|
||||
winstructs.ALPC_PORT_ATTRIBUTES = winstructs.ALPC_PORT_ATTRIBUTES64
|
||||
|
||||
winstructs.PORT_MESSAGE64 = winstructs.PORT_MESSAGE64
|
||||
winstructs.PPORT_MESSAGE64 = winstructs.PPORT_MESSAGE64
|
||||
winstructs.PORT_MESSAGE = winstructs.PORT_MESSAGE64
|
||||
winstructs.PPORT_MESSAGE = winstructs.PPORT_MESSAGE64
|
||||
|
||||
|
||||
from . import winfuncs
|
||||
|
||||
File diff suppressed because one or more lines are too long
+265
-103
@@ -67,6 +67,8 @@ HBITMAP = HANDLE
|
||||
SC_HANDLE = HANDLE
|
||||
HCERTCHAINENGINE = HANDLE
|
||||
LPHANDLE = POINTER(HANDLE)
|
||||
ALPC_HANDLE = HANDLE
|
||||
PALPC_HANDLE = POINTER(ALPC_HANDLE)
|
||||
PHKEY = POINTER(HKEY)
|
||||
ACCESS_MASK = DWORD
|
||||
REGSAM = ACCESS_MASK
|
||||
@@ -1001,6 +1003,25 @@ class _BG_JOB_TYPE(EnumType):
|
||||
BG_JOB_TYPE = _BG_JOB_TYPE
|
||||
|
||||
|
||||
AlpcBasicInformation = EnumValue("_ALPC_PORT_INFORMATION_CLASS", "AlpcBasicInformation", 0x0)
|
||||
AlpcPortInformation = EnumValue("_ALPC_PORT_INFORMATION_CLASS", "AlpcPortInformation", 0x1)
|
||||
AlpcAssociateCompletionPortInformation = EnumValue("_ALPC_PORT_INFORMATION_CLASS", "AlpcAssociateCompletionPortInformation", 0x2)
|
||||
AlpcConnectedSIDInformation = EnumValue("_ALPC_PORT_INFORMATION_CLASS", "AlpcConnectedSIDInformation", 0x3)
|
||||
AlpcServerInformation = EnumValue("_ALPC_PORT_INFORMATION_CLASS", "AlpcServerInformation", 0x4)
|
||||
AlpcMessageZoneInformation = EnumValue("_ALPC_PORT_INFORMATION_CLASS", "AlpcMessageZoneInformation", 0x5)
|
||||
AlpcRegisterCompletionListInformation = EnumValue("_ALPC_PORT_INFORMATION_CLASS", "AlpcRegisterCompletionListInformation", 0x6)
|
||||
AlpcUnregisterCompletionListInformation = EnumValue("_ALPC_PORT_INFORMATION_CLASS", "AlpcUnregisterCompletionListInformation", 0x7)
|
||||
AlpcAdjustCompletionListConcurrencyCountInformation = EnumValue("_ALPC_PORT_INFORMATION_CLASS", "AlpcAdjustCompletionListConcurrencyCountInformation", 0x8)
|
||||
AlpcRegisterCallbackInformation = EnumValue("_ALPC_PORT_INFORMATION_CLASS", "AlpcRegisterCallbackInformation", 0x9)
|
||||
AlpcCompletionListRundownInformation = EnumValue("_ALPC_PORT_INFORMATION_CLASS", "AlpcCompletionListRundownInformation", 0xa)
|
||||
AlpcWaitForPortReferences = EnumValue("_ALPC_PORT_INFORMATION_CLASS", "AlpcWaitForPortReferences", 0xb)
|
||||
MaxAlpcPortInfoClass = EnumValue("_ALPC_PORT_INFORMATION_CLASS", "MaxAlpcPortInfoClass", 0xc)
|
||||
class _ALPC_PORT_INFORMATION_CLASS(EnumType):
|
||||
values = [AlpcBasicInformation, AlpcPortInformation, AlpcAssociateCompletionPortInformation, AlpcConnectedSIDInformation, AlpcServerInformation, AlpcMessageZoneInformation, AlpcRegisterCompletionListInformation, AlpcUnregisterCompletionListInformation, AlpcAdjustCompletionListConcurrencyCountInformation, AlpcRegisterCallbackInformation, AlpcCompletionListRundownInformation, AlpcWaitForPortReferences, MaxAlpcPortInfoClass]
|
||||
mapper = {x:x for x in values}
|
||||
ALPC_PORT_INFORMATION_CLASS = _ALPC_PORT_INFORMATION_CLASS
|
||||
|
||||
|
||||
# Self referencing struct tricks
|
||||
class _LIST_ENTRY(Structure): pass
|
||||
PLIST_ENTRY = POINTER(_LIST_ENTRY)
|
||||
@@ -3024,109 +3045,6 @@ class _SECURITY_QUALITY_OF_SERVICE(Structure):
|
||||
PSECURITY_QUALITY_OF_SERVICE = POINTER(_SECURITY_QUALITY_OF_SERVICE)
|
||||
SECURITY_QUALITY_OF_SERVICE = _SECURITY_QUALITY_OF_SERVICE
|
||||
|
||||
class _ALPC_PORT_ATTRIBUTES32(Structure):
|
||||
_fields_ = [
|
||||
("Flags", ULONG),
|
||||
("SecurityQos", SECURITY_QUALITY_OF_SERVICE),
|
||||
("MaxMessageLength", SIZE_T),
|
||||
("MemoryBandwidth", SIZE_T),
|
||||
("MaxPoolUsage", SIZE_T),
|
||||
("MaxSectionSize", SIZE_T),
|
||||
("MaxViewSize", SIZE_T),
|
||||
("MaxTotalSectionSize", SIZE_T),
|
||||
("DupObjectTypes", ULONG),
|
||||
]
|
||||
PALPC_PORT_ATTRIBUTES32 = POINTER(_ALPC_PORT_ATTRIBUTES32)
|
||||
ALPC_PORT_ATTRIBUTES32 = _ALPC_PORT_ATTRIBUTES32
|
||||
|
||||
class _ALPC_PORT_ATTRIBUTES64(Structure):
|
||||
_fields_ = [
|
||||
("Flags", ULONG),
|
||||
("SecurityQos", SECURITY_QUALITY_OF_SERVICE),
|
||||
("MaxMessageLength", SIZE_T),
|
||||
("MemoryBandwidth", SIZE_T),
|
||||
("MaxPoolUsage", SIZE_T),
|
||||
("MaxSectionSize", SIZE_T),
|
||||
("MaxViewSize", SIZE_T),
|
||||
("MaxTotalSectionSize", SIZE_T),
|
||||
("DupObjectTypes", ULONG),
|
||||
("Reserved", ULONG),
|
||||
]
|
||||
ALPC_PORT_ATTRIBUTES64 = _ALPC_PORT_ATTRIBUTES64
|
||||
PALPC_PORT_ATTRIBUTES64 = POINTER(_ALPC_PORT_ATTRIBUTES64)
|
||||
|
||||
class _ALPC_MESSAGE_ATTRIBUTES(Structure):
|
||||
_fields_ = [
|
||||
("AllocatedAttributes", ULONG),
|
||||
("ValidAttributes", ULONG),
|
||||
]
|
||||
ALPC_MESSAGE_ATTRIBUTES = _ALPC_MESSAGE_ATTRIBUTES
|
||||
PALPC_MESSAGE_ATTRIBUTES = POINTER(_ALPC_MESSAGE_ATTRIBUTES)
|
||||
|
||||
class _PORT_MESSAGE32_TMP_UNION(Union):
|
||||
_fields_ = [
|
||||
("ClientViewSize", ULONG),
|
||||
("CallbackId", ULONG),
|
||||
]
|
||||
PORT_MESSAGE_TMP_UNION = _PORT_MESSAGE32_TMP_UNION
|
||||
|
||||
class _PORT_MESSAGE64_TMP_UNION(Union):
|
||||
_fields_ = [
|
||||
("ClientViewSize", ULONGLONG),
|
||||
("CallbackId", ULONG),
|
||||
]
|
||||
PORT_MESSAGE_TMP_UNION = _PORT_MESSAGE64_TMP_UNION
|
||||
|
||||
class _PORT_MESSAGE_TMP_SUBSTRUCT_S1(Structure):
|
||||
_fields_ = [
|
||||
("DataLength", CSHORT),
|
||||
("TotalLength", CSHORT),
|
||||
]
|
||||
_PORT_MESSAGE_TMP_SUBSTRUCT_S1 = _PORT_MESSAGE_TMP_SUBSTRUCT_S1
|
||||
|
||||
class _PORT_MESSAGE_TMP_UNION_U1(Union):
|
||||
_fields_ = [
|
||||
("Length", ULONG),
|
||||
("s1", _PORT_MESSAGE_TMP_SUBSTRUCT_S1),
|
||||
]
|
||||
_PORT_MESSAGE_TMP_UNION_U1 = _PORT_MESSAGE_TMP_UNION_U1
|
||||
|
||||
class _PORT_MESSAGE_TMP_SUBSTRUCT_S2(Structure):
|
||||
_fields_ = [
|
||||
("Type", CSHORT),
|
||||
("DataInfoOffset", CSHORT),
|
||||
]
|
||||
_PORT_MESSAGE_TMP_SUBSTRUCT_S2 = _PORT_MESSAGE_TMP_SUBSTRUCT_S2
|
||||
|
||||
class _PORT_MESSAGE_TMP_UNION_U2(Union):
|
||||
_fields_ = [
|
||||
("ZeroInit", ULONG),
|
||||
("s2", _PORT_MESSAGE_TMP_SUBSTRUCT_S2),
|
||||
]
|
||||
_PORT_MESSAGE_TMP_UNION_U2 = _PORT_MESSAGE_TMP_UNION_U2
|
||||
|
||||
class _PORT_MESSAGE32(Structure):
|
||||
_fields_ = [
|
||||
("u1", _PORT_MESSAGE_TMP_UNION_U1),
|
||||
("u2", _PORT_MESSAGE_TMP_UNION_U2),
|
||||
("ClientId", CLIENT_ID32),
|
||||
("MessageId", ULONG),
|
||||
("tmp_union", _PORT_MESSAGE32_TMP_UNION),
|
||||
]
|
||||
PORT_MESSAGE32 = _PORT_MESSAGE32
|
||||
PPORT_MESSAGE32 = POINTER(_PORT_MESSAGE32)
|
||||
|
||||
class _PORT_MESSAGE64(Structure):
|
||||
_fields_ = [
|
||||
("u1", _PORT_MESSAGE_TMP_UNION_U1),
|
||||
("u2", _PORT_MESSAGE_TMP_UNION_U2),
|
||||
("ClientId", CLIENT_ID64),
|
||||
("MessageId", ULONG),
|
||||
("tmp_union", _PORT_MESSAGE64_TMP_UNION),
|
||||
]
|
||||
PPORT_MESSAGE64 = POINTER(_PORT_MESSAGE64)
|
||||
PORT_MESSAGE64 = _PORT_MESSAGE64
|
||||
|
||||
class _SERVICE_STATUS(Structure):
|
||||
_fields_ = [
|
||||
("dwServiceType", DWORD),
|
||||
@@ -3949,3 +3867,247 @@ class _BG_JOB_TIMES(Structure):
|
||||
("TransferCompletionTime", FILETIME),
|
||||
]
|
||||
BG_JOB_TIMES = _BG_JOB_TIMES
|
||||
|
||||
class _ALPC_PORT_ATTRIBUTES32(Structure):
|
||||
_fields_ = [
|
||||
("Flags", ULONG),
|
||||
("SecurityQos", SECURITY_QUALITY_OF_SERVICE),
|
||||
("MaxMessageLength", SIZE_T),
|
||||
("MemoryBandwidth", SIZE_T),
|
||||
("MaxPoolUsage", SIZE_T),
|
||||
("MaxSectionSize", SIZE_T),
|
||||
("MaxViewSize", SIZE_T),
|
||||
("MaxTotalSectionSize", SIZE_T),
|
||||
("DupObjectTypes", ULONG),
|
||||
]
|
||||
PALPC_PORT_ATTRIBUTES32 = POINTER(_ALPC_PORT_ATTRIBUTES32)
|
||||
ALPC_PORT_ATTRIBUTES32 = _ALPC_PORT_ATTRIBUTES32
|
||||
|
||||
class _ALPC_PORT_ATTRIBUTES64(Structure):
|
||||
_fields_ = [
|
||||
("Flags", ULONG),
|
||||
("SecurityQos", SECURITY_QUALITY_OF_SERVICE),
|
||||
("MaxMessageLength", SIZE_T),
|
||||
("MemoryBandwidth", SIZE_T),
|
||||
("MaxPoolUsage", SIZE_T),
|
||||
("MaxSectionSize", SIZE_T),
|
||||
("MaxViewSize", SIZE_T),
|
||||
("MaxTotalSectionSize", SIZE_T),
|
||||
("DupObjectTypes", ULONG),
|
||||
("Reserved", ULONG),
|
||||
]
|
||||
ALPC_PORT_ATTRIBUTES64 = _ALPC_PORT_ATTRIBUTES64
|
||||
PALPC_PORT_ATTRIBUTES64 = POINTER(_ALPC_PORT_ATTRIBUTES64)
|
||||
|
||||
class _ALPC_MESSAGE_ATTRIBUTES(Structure):
|
||||
_fields_ = [
|
||||
("AllocatedAttributes", ULONG),
|
||||
("ValidAttributes", ULONG),
|
||||
]
|
||||
ALPC_MESSAGE_ATTRIBUTES = _ALPC_MESSAGE_ATTRIBUTES
|
||||
PALPC_MESSAGE_ATTRIBUTES = POINTER(_ALPC_MESSAGE_ATTRIBUTES)
|
||||
|
||||
class _PORT_MESSAGE32_TMP_UNION(Union):
|
||||
_fields_ = [
|
||||
("ClientViewSize", ULONG),
|
||||
("CallbackId", ULONG),
|
||||
]
|
||||
PORT_MESSAGE_TMP_UNION = _PORT_MESSAGE32_TMP_UNION
|
||||
|
||||
class _PORT_MESSAGE64_TMP_UNION(Union):
|
||||
_fields_ = [
|
||||
("ClientViewSize", ULONGLONG),
|
||||
("CallbackId", ULONG),
|
||||
]
|
||||
PORT_MESSAGE_TMP_UNION = _PORT_MESSAGE64_TMP_UNION
|
||||
|
||||
class _PORT_MESSAGE_TMP_SUBSTRUCT_S1(Structure):
|
||||
_fields_ = [
|
||||
("DataLength", CSHORT),
|
||||
("TotalLength", CSHORT),
|
||||
]
|
||||
_PORT_MESSAGE_TMP_SUBSTRUCT_S1 = _PORT_MESSAGE_TMP_SUBSTRUCT_S1
|
||||
|
||||
class _PORT_MESSAGE_TMP_UNION_U1(Union):
|
||||
_fields_ = [
|
||||
("Length", ULONG),
|
||||
("s1", _PORT_MESSAGE_TMP_SUBSTRUCT_S1),
|
||||
]
|
||||
_PORT_MESSAGE_TMP_UNION_U1 = _PORT_MESSAGE_TMP_UNION_U1
|
||||
|
||||
class _PORT_MESSAGE_TMP_SUBSTRUCT_S2(Structure):
|
||||
_fields_ = [
|
||||
("Type", CSHORT),
|
||||
("DataInfoOffset", CSHORT),
|
||||
]
|
||||
_PORT_MESSAGE_TMP_SUBSTRUCT_S2 = _PORT_MESSAGE_TMP_SUBSTRUCT_S2
|
||||
|
||||
class _PORT_MESSAGE_TMP_UNION_U2(Union):
|
||||
_fields_ = [
|
||||
("ZeroInit", ULONG),
|
||||
("s2", _PORT_MESSAGE_TMP_SUBSTRUCT_S2),
|
||||
]
|
||||
_PORT_MESSAGE_TMP_UNION_U2 = _PORT_MESSAGE_TMP_UNION_U2
|
||||
|
||||
class _PORT_MESSAGE32(Structure):
|
||||
_fields_ = [
|
||||
("u1", _PORT_MESSAGE_TMP_UNION_U1),
|
||||
("u2", _PORT_MESSAGE_TMP_UNION_U2),
|
||||
("ClientId", CLIENT_ID32),
|
||||
("MessageId", ULONG),
|
||||
("tmp_union", _PORT_MESSAGE32_TMP_UNION),
|
||||
]
|
||||
PORT_MESSAGE32 = _PORT_MESSAGE32
|
||||
PPORT_MESSAGE32 = POINTER(_PORT_MESSAGE32)
|
||||
|
||||
class _PORT_MESSAGE64(Structure):
|
||||
_fields_ = [
|
||||
("u1", _PORT_MESSAGE_TMP_UNION_U1),
|
||||
("u2", _PORT_MESSAGE_TMP_UNION_U2),
|
||||
("ClientId", CLIENT_ID64),
|
||||
("MessageId", ULONG),
|
||||
("tmp_union", _PORT_MESSAGE64_TMP_UNION),
|
||||
]
|
||||
PPORT_MESSAGE64 = POINTER(_PORT_MESSAGE64)
|
||||
PORT_MESSAGE64 = _PORT_MESSAGE64
|
||||
|
||||
class _ALPC_SERVER_INFORMATION_TMP_IN(Structure):
|
||||
_fields_ = [
|
||||
("ThreadHandle", HANDLE),
|
||||
]
|
||||
ALPC_SERVER_INFORMATION_TMP_IN = _ALPC_SERVER_INFORMATION_TMP_IN
|
||||
|
||||
class _ALPC_SERVER_INFORMATION_TMP_OUT(Structure):
|
||||
_fields_ = [
|
||||
("ThreadBlocked", BOOLEAN),
|
||||
("ConnectedProcessId", HANDLE),
|
||||
("ConnectionPortName", UNICODE_STRING),
|
||||
]
|
||||
ALPC_SERVER_INFORMATION_TMP_OUT = _ALPC_SERVER_INFORMATION_TMP_OUT
|
||||
|
||||
class ALPC_SERVER_INFORMATION(Union):
|
||||
_fields_ = [
|
||||
("In", ALPC_SERVER_INFORMATION_TMP_IN),
|
||||
("Out", ALPC_SERVER_INFORMATION_TMP_OUT),
|
||||
]
|
||||
ALPC_SERVER_INFORMATION = ALPC_SERVER_INFORMATION
|
||||
|
||||
class _ALPC_CONTEXT_ATTR(Structure):
|
||||
_fields_ = [
|
||||
("PortContext", PVOID),
|
||||
("MessageContext", PVOID),
|
||||
("Sequence", ULONG),
|
||||
("MessageId", ULONG),
|
||||
("CallbackId", ULONG),
|
||||
]
|
||||
PALPC_CONTEXT_ATTR = POINTER(_ALPC_CONTEXT_ATTR)
|
||||
ALPC_CONTEXT_ATTR = _ALPC_CONTEXT_ATTR
|
||||
|
||||
class _ALPC_CONTEXT_ATTR32(Structure):
|
||||
_fields_ = [
|
||||
("PortContext", ULONG),
|
||||
("MessageContext", ULONG),
|
||||
("Sequence", ULONG),
|
||||
("MessageId", ULONG),
|
||||
("CallbackId", ULONG),
|
||||
]
|
||||
ALPC_CONTEXT_ATTR32 = _ALPC_CONTEXT_ATTR32
|
||||
PALPC_CONTEXT_ATTR32 = POINTER(_ALPC_CONTEXT_ATTR32)
|
||||
|
||||
class _ALPC_CONTEXT_ATTR64(Structure):
|
||||
_fields_ = [
|
||||
("PortContext", ULONGLONG),
|
||||
("MessageContext", ULONGLONG),
|
||||
("Sequence", ULONG),
|
||||
("MessageId", ULONG),
|
||||
("CallbackId", ULONG),
|
||||
]
|
||||
ALPC_CONTEXT_ATTR64 = _ALPC_CONTEXT_ATTR64
|
||||
PALPC_CONTEXT_ATTR64 = POINTER(_ALPC_CONTEXT_ATTR64)
|
||||
|
||||
class _ALPC_HANDLE_ATTR(Structure):
|
||||
_fields_ = [
|
||||
("Flags", ULONG),
|
||||
("Handle", HANDLE),
|
||||
("ObjectType", ULONG),
|
||||
("DesiredAccess", ACCESS_MASK),
|
||||
]
|
||||
PALPC_HANDLE_ATTR = POINTER(_ALPC_HANDLE_ATTR)
|
||||
ALPC_HANDLE_ATTR = _ALPC_HANDLE_ATTR
|
||||
|
||||
class _ALPC_HANDLE_ATTR32(Structure):
|
||||
_fields_ = [
|
||||
("Flags", ULONG),
|
||||
("Handle", ULONG),
|
||||
("ObjectType", ULONG),
|
||||
("DesiredAccess", ACCESS_MASK),
|
||||
]
|
||||
ALPC_HANDLE_ATTR32 = _ALPC_HANDLE_ATTR32
|
||||
PALPC_HANDLE_ATTR32 = POINTER(_ALPC_HANDLE_ATTR32)
|
||||
|
||||
class _ALPC_HANDLE_ATTR64(Structure):
|
||||
_fields_ = [
|
||||
("Flags", ULONG),
|
||||
("Handle", ULONGLONG),
|
||||
("ObjectType", ULONG),
|
||||
("DesiredAccess", ACCESS_MASK),
|
||||
]
|
||||
PALPC_HANDLE_ATTR64 = POINTER(_ALPC_HANDLE_ATTR64)
|
||||
ALPC_HANDLE_ATTR64 = _ALPC_HANDLE_ATTR64
|
||||
|
||||
class _ALPC_SECURITY_ATTR(Structure):
|
||||
_fields_ = [
|
||||
("Flags", ULONG),
|
||||
("QoS", PSECURITY_QUALITY_OF_SERVICE),
|
||||
("ContextHandle", ALPC_HANDLE),
|
||||
]
|
||||
PALPC_SECURITY_ATTR = POINTER(_ALPC_SECURITY_ATTR)
|
||||
ALPC_SECURITY_ATTR = _ALPC_SECURITY_ATTR
|
||||
|
||||
class _ALPC_SECURITY_ATTR32(Structure):
|
||||
_fields_ = [
|
||||
("Flags", ULONG),
|
||||
("QoS", ULONG),
|
||||
("ContextHandle", ULONG),
|
||||
]
|
||||
ALPC_SECURITY_ATTR32 = _ALPC_SECURITY_ATTR32
|
||||
PALPC_SECURITY_ATTR32 = POINTER(_ALPC_SECURITY_ATTR32)
|
||||
|
||||
class _ALPC_SECURITY_ATTR64(Structure):
|
||||
_fields_ = [
|
||||
("Flags", ULONGLONG),
|
||||
("QoS", ULONGLONG),
|
||||
("ContextHandle", ULONGLONG),
|
||||
]
|
||||
PALPC_SECURITY_ATTR64 = POINTER(_ALPC_SECURITY_ATTR64)
|
||||
ALPC_SECURITY_ATTR64 = _ALPC_SECURITY_ATTR64
|
||||
|
||||
class _ALPC_DATA_VIEW_ATTR(Structure):
|
||||
_fields_ = [
|
||||
("Flags", ULONG),
|
||||
("SectionHandle", ALPC_HANDLE),
|
||||
("ViewBase", PVOID),
|
||||
("ViewSize", PVOID),
|
||||
]
|
||||
PALPC_DATA_VIEW_ATTR = POINTER(_ALPC_DATA_VIEW_ATTR)
|
||||
ALPC_DATA_VIEW_ATTR = _ALPC_DATA_VIEW_ATTR
|
||||
|
||||
class _ALPC_DATA_VIEW_ATTR32(Structure):
|
||||
_fields_ = [
|
||||
("Flags", ULONG),
|
||||
("SectionHandle", ULONG),
|
||||
("ViewBase", ULONG),
|
||||
("ViewSize", ULONG),
|
||||
]
|
||||
PALPC_DATA_VIEW_ATTR32 = POINTER(_ALPC_DATA_VIEW_ATTR32)
|
||||
ALPC_DATA_VIEW_ATTR32 = _ALPC_DATA_VIEW_ATTR32
|
||||
|
||||
class _ALPC_DATA_VIEW_ATTR64(Structure):
|
||||
_fields_ = [
|
||||
("Flags", ULONG),
|
||||
("SectionHandle", ULONGLONG),
|
||||
("ViewBase", ULONGLONG),
|
||||
("ViewSize", ULONGLONG),
|
||||
]
|
||||
PALPC_DATA_VIEW_ATTR64 = POINTER(_ALPC_DATA_VIEW_ATTR64)
|
||||
ALPC_DATA_VIEW_ATTR64 = _ALPC_DATA_VIEW_ATTR64
|
||||
|
||||
@@ -823,6 +823,12 @@ def NtAlpcConnectPortEx(PortHandle, ConnectionPortObjectAttributes, ClientPortOb
|
||||
def NtAlpcAcceptConnectPort(PortHandle, ConnectionPortHandle, Flags, ObjectAttributes, PortAttributes, PortContext, ConnectionRequest, ConnectionMessageAttributes, AcceptConnection):
|
||||
return NtAlpcAcceptConnectPort.ctypes_function(PortHandle, ConnectionPortHandle, Flags, ObjectAttributes, PortAttributes, PortContext, ConnectionRequest, ConnectionMessageAttributes, AcceptConnection)
|
||||
|
||||
|
||||
@NtdllProxy("NtAlpcQueryInformation", error_ntstatus)
|
||||
def NtAlpcQueryInformation(PortHandle, PortInformationClass, PortInformation, Length, ReturnLength):
|
||||
return NtAlpcQueryInformation.ctypes_function(PortHandle, PortInformationClass, PortInformation, Length, ReturnLength)
|
||||
|
||||
|
||||
@NtdllProxy("NtAlpcSendWaitReceivePort", error_ntstatus)
|
||||
def NtAlpcSendWaitReceivePort(PortHandle, Flags, SendMessage, SendMessageAttributes, ReceiveMessage, BufferLength, ReceiveMessageAttributes, Timeout):
|
||||
return NtAlpcSendWaitReceivePort.ctypes_function(PortHandle, Flags, SendMessage, SendMessageAttributes, ReceiveMessage, BufferLength, ReceiveMessageAttributes, Timeout)
|
||||
@@ -838,6 +844,26 @@ def AlpcGetMessageAttribute(Buffer, AttributeFlag):
|
||||
return AlpcGetMessageAttribute.ctypes_function(Buffer, AttributeFlag)
|
||||
|
||||
|
||||
@NtdllProxy("NtAlpcCreatePortSection", error_ntstatus)
|
||||
def NtAlpcCreatePortSection(PortHandle, Flags, SectionHandle, SectionSize, AlpcSectionHandle, ActualSectionSize):
|
||||
return NtAlpcCreatePortSection.ctypes_function(PortHandle, Flags, SectionHandle, SectionSize, AlpcSectionHandle, ActualSectionSize)
|
||||
|
||||
|
||||
@NtdllProxy("NtAlpcDeletePortSection", error_ntstatus)
|
||||
def NtAlpcDeletePortSection(PortHandle, Flags, SectionHandle):
|
||||
return NtAlpcDeletePortSection.ctypes_function(PortHandle, Flags, SectionHandle)
|
||||
|
||||
|
||||
@NtdllProxy("NtAlpcCreateSectionView", error_ntstatus)
|
||||
def NtAlpcCreateSectionView(PortHandle, Flags, ViewAttributes):
|
||||
return NtAlpcCreateSectionView.ctypes_function(PortHandle, Flags, ViewAttributes)
|
||||
|
||||
|
||||
@NtdllProxy("NtAlpcDeleteSectionView", error_ntstatus)
|
||||
def NtAlpcDeleteSectionView(PortHandle, Flags, ViewBase):
|
||||
return NtAlpcDeleteSectionView.ctypes_function(PortHandle, Flags, ViewBase)
|
||||
|
||||
|
||||
@NtdllProxy("NtOpenDirectoryObject", error_ntstatus)
|
||||
def NtOpenDirectoryObject(DirectoryHandle, DesiredAccess, ObjectAttributes):
|
||||
return NtOpenDirectoryObject.ctypes_function(DirectoryHandle, DesiredAccess, ObjectAttributes)
|
||||
|
||||
Reference in New Issue
Block a user