Generate a UNICODE_STRING structure class.
(archbits: int)
| 119 | # https://learn.microsoft.com/en-us/windows/win32/api/ntdef/ns-ntdef-_unicode_string |
| 120 | @lru_cache(maxsize=2) |
| 121 | def make_unicode_string(archbits: int): |
| 122 | """Generate a UNICODE_STRING structure class. |
| 123 | """ |
| 124 | |
| 125 | native_type = struct.get_native_type(archbits) |
| 126 | Struct = struct.get_aligned_struct(archbits) |
| 127 | |
| 128 | class UNICODE_STRING(Struct): |
| 129 | _fields_ = ( |
| 130 | ('Length', ctypes.c_uint16), |
| 131 | ('MaximumLength', ctypes.c_uint16), |
| 132 | ('Buffer', native_type) |
| 133 | ) |
| 134 | |
| 135 | return UNICODE_STRING |
| 136 | |
| 137 | |
| 138 | # https://learn.microsoft.com/en-us/windows/win32/api/ntdef/ns-ntdef-string |
no outgoing calls
no test coverage detected