Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling of some instructions in simple x86/x64 #58

Merged
merged 5 commits into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/mypytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,15 @@ jobs:
with:
python-version: ${{ matrix.python-version}}
architecture: x86
update-environment: false
## Install the 64bits version of python3 asked
- name: Set up Python3 ${{ matrix.python-version }} x64
if: ${{ matrix.python-version != '2.7' }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version}}
architecture: x64
update-environment: false

# Manually install python2.7 (both version at once)
- name: Set up Python2.7 ${{ matrix.python-version }} x86 & x64
Expand All @@ -64,7 +66,7 @@ jobs:
run: py -${{ matrix.python-version}}-${{ matrix.python-bitness-to-test}} -m pytest --junitxml=junit/test-results.xml -s -k "not known_to_fail" -v tests/

- name: Publish PyTest Results
uses: EnricoMi/publish-unit-test-result-action/composite@v1
uses: EnricoMi/publish-unit-test-result-action/windows@v2
if: always()
with:
files: junit/test-results.xml
Expand Down
1 change: 1 addition & 0 deletions ctypes_generation/definitions/defines/section.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#define MEM_EXTENDED_PARAMETER_TYPE_BITS 8
25 changes: 25 additions & 0 deletions ctypes_generation/definitions/functions/syscall.txt
Original file line number Diff line number Diff line change
Expand Up @@ -367,3 +367,28 @@ NTSTATUS NtTerminateProcess(
HANDLE ProcessHandle,
NTSTATUS ExitStatus
);


NTSTATUS NtReadFile(
_In_ HANDLE FileHandle,
_In_opt_ HANDLE Event,
_In_opt_ PIO_APC_ROUTINE ApcRoutine,
_In_opt_ PVOID ApcContext,
_Out_ PIO_STATUS_BLOCK IoStatusBlock,
_Out_ PVOID Buffer,
_In_ ULONG Length,
_In_opt_ PLARGE_INTEGER ByteOffset,
_In_opt_ PULONG Key
);

NTSTATUS NtWriteFile(
[in] HANDLE FileHandle,
[in, optional] HANDLE Event,
[in, optional] PIO_APC_ROUTINE ApcRoutine,
[in, optional] PVOID ApcContext,
[out] PIO_STATUS_BLOCK IoStatusBlock,
[in] PVOID Buffer,
[in] ULONG Length,
[in, optional] PLARGE_INTEGER ByteOffset,
[in, optional] PULONG Key
);
32 changes: 32 additions & 0 deletions ctypes_generation/definitions/structures/section.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
typedef enum MEM_EXTENDED_PARAMETER_TYPE {
MemExtendedParameterInvalidType = 0,
MemExtendedParameterAddressRequirements = 1,
MemExtendedParameterNumaNode = 2,
MemExtendedParameterPartitionHandle = 3,
MemExtendedParameterUserPhysicalHandle = 4,
MemExtendedParameterAttributeFlags = 5,
MemExtendedParameterImageMachine = 6,
MemExtendedParameterMax
} *PMEM_EXTENDED_PARAMETER_TYPE;


typedef struct _MEM_ADDRESS_REQUIREMENTS {
PVOID LowestStartingAddress;
PVOID HighestEndingAddress;
SIZE_T Alignment;
} MEM_ADDRESS_REQUIREMENTS, *PMEM_ADDRESS_REQUIREMENTS;


typedef struct MEM_EXTENDED_PARAMETER {
struct {
ULONG64 Type : 8; // MEM_EXTENDED_PARAMETER_TYPE_BITS -> define not handled in parser here
ULONG64 Reserved : 56; // 64 - MEM_EXTENDED_PARAMETER_TYPE_BITS -> define not handled in parser here
} DUMMYSTRUCTNAME;
union {
ULONG64 ULong64;
PVOID Pointer;
SIZE_T Size;
HANDLE Handle;
ULONG ULong;
} DUMMYUNIONNAME;
} MEM_EXTENDED_PARAMETER, *PMEM_EXTENDED_PARAMETER;
Loading