14. windows.generated_def
– generated Windows defines and structures¶
windows.generated_def
contains Python
files generated by ctypes_generation/
.
Those generated files includes:
some Windows structures and enums
some Windows defines including some
NTSTATUS
some Windows function prototypes
Each value in windef
and ntstatus
is a Flag
or a StrFlag
.
Here is every generated definition by type:
- class windows.generated_def.StrFlag¶
A
str
with a name
14.8. Example¶
>>> import windows.generated_def
>>> import windows.generated_def as gdef
>>> gdef
<module 'windows.generated_def' from 'c:\users\hakril\documents\work\pythonforwindows\windows\generated_def\__init__.pyc'>
>>> gdef.PAGE_EXECUTE_READWRITE
PAGE_EXECUTE_READWRITE(0x40L)
>>> gdef.PAGE_EXECUTE_READWRITE == 0x40
True
>>> gdef.PAGE_EXECUTE_READWRITE + 1
65L
>>> gdef.STATUS_ACCESS_VIOLATION
STATUS_ACCESS_VIOLATION(0xc0000005L)
>>> gdef.LDR_DATA_TABLE_ENTRY
<class 'windows.generated_def.winstructs._LDR_DATA_TABLE_ENTRY'>
>>> gdef.LDR_DATA_TABLE_ENTRY._fields_
[('Reserved1', <class 'windows.generated_def.winstructs.c_void_p_Array_2'>), ...]
>>> gdef.MEMORY_INFORMATION_CLASS
<class 'windows.generated_def.winstructs._MEMORY_INFORMATION_CLASS'>
>>> gdef.MEMORY_INFORMATION_CLASS.values
[_MEMORY_INFORMATION_CLASS.MemoryBasicInformation(0x0L), _MEMORY_INFORMATION_CLASS.MemoryWorkingSetList(0x1L),
_MEMORY_INFORMATION_CLASS.MemorySectionName(0x2L), _MEMORY_INFORMATION_CLASS.MemoryBasicVlmInformation(0x3L),
_MEMORY_INFORMATION_CLASS.MemoryWorkingSetListEx(0x4L)]
>>> gdef.MemoryBasicInformation
_MEMORY_INFORMATION_CLASS.MemoryBasicInformation(0x0L)