os.windows.native_api¶
Attributes¶
Classes¶
list of file attributes constants. |
|
Reparse Point Tag constants. |
|
Desired Access constants. |
|
Share Access constants. |
|
File Open options. |
|
Constants for WaitFor* functions. |
|
Error constants. |
|
Map IO_STATUS_BLOCK structure. |
|
Structure base class |
|
Map UNICODE_STRING structure. |
|
Map FILETIME structure. |
|
Map filetime implemented using LARGE_INTEGER. |
|
Structure base class |
|
Declaration of structures returned by QueryInformationFile. |
|
Declaration of structures returned by QueryObjectInformation. |
|
Declaration of structure returned by QueryInformationProcess. |
|
OBJECT_ATTRIBUTES structure. |
|
Module Contents¶
- os.windows.native_api.NTSTATUS¶
- class os.windows.native_api.FileAttribute¶
Bases:
ctypes.Structurelist of file attributes constants.
- READONLY = 1¶
- HIDDEN = 2¶
- SYSTEM = 4¶
- DIRECTORY = 16¶
- ARCHIVE = 32¶
- DEVICE = 64¶
- NORMAL = 128¶
- TEMPORARY = 256¶
- SPARSE_FILE = 512¶
- REPARSE_POINT = 1024¶
- COMPRESSED = 2048¶
- OFFLINE = 4096¶
- NOT_CONTENT_INDEXED = 8192¶
- ENCRYPTED = 16384¶
- INTEGRITY_STREAM = 32768¶
- VIRTUAL = 65536¶
- NO_SCRUB_DATA = 131072¶
- _fields_¶
- __str__() str¶
Return str(self).
- class os.windows.native_api.IOReparseTag¶
Reparse Point Tag constants.
This is important to note that symbolic links on Windows are always implemented using reparse points. Nevertheless a reparse point is a more general concept not always associated with the concept of symbolic links. In the present code we are only interested in checking whether a reparse point is a symbolic link or not.
Currenly Windows supports two kinds of symbolic links. One for Win32 apps (SYMLINK) and one for WSL subsystem (WSL_SYMLINK). Note that Cygwin now uses the second one to implement symbolic links. Note that WSL symbolic links are not handled correctly by the Python runtime (for example os.path.islink will return False).
- SYMLINK = 2684354572¶
- WSL_SYMLINK = 2684354589¶
- class os.windows.native_api.Access¶
Desired Access constants.
- LIST_DIRECTORY = 1¶
- READ_DATA = 1¶
- ADD_FILE = 2¶
- WRITE_DATA = 2¶
- ADD_SUBDIR = 4¶
- APPEND_DATA = 4¶
- READ_EA = 8¶
- WRITE_EA = 16¶
- EXECUTE = 32¶
- TRAVERSE = 32¶
- DELETE_CHILD = 64¶
- READ_ATTRS = 128¶
- WRITE_ATTRS = 256¶
- DELETE = 65536¶
- SYNCHRONIZE = 1048576¶
- PROCESS_QUERY_INFORMATION = 1024¶
Share Access constants.
- class os.windows.native_api.OpenOptions¶
File Open options.
- BACKUP_INTENT = 16384¶
- SYNCHRONOUS_IO_NON_ALERT = 32¶
- DELETE_ON_CLOSE = 4096¶
- OPEN_REPARSE_POINT = 2097152¶
- class os.windows.native_api.Wait¶
Constants for WaitFor* functions.
- OBJECT = 0¶
- ABANDONED = 128¶
- TIMEOUT = 258¶
- FAILED = 4294967295¶
- INFINITE = 4294967295¶
- class os.windows.native_api.Status¶
Error constants.
- ACCESS_DENIED = 3221225506¶
- OBJECT_NAME_NOT_FOUND = 3221225524¶
- OBJECT_PATH_NOT_FOUND = 3221225530¶
- SHARING_VIOLATION = 3221225539¶
- DELETE_PENDING = 3221225558¶
- DIRECTORY_NOT_EMPTY = 3221225729¶
- CANNOT_DELETE = 3221225761¶
- NO_MORE_FILES = 2147483654¶
- msgs¶
- class os.windows.native_api.IOStatusBlock¶
Bases:
ctypes.StructureMap IO_STATUS_BLOCK structure.
- _fields_¶
- class os.windows.native_api.ReparseGUIDDataBuffer¶
Bases:
ctypes.StructureStructure base class
- _fields_¶
- class os.windows.native_api.UnicodeString(value: str | None = None, max_length: int = 0)¶
Bases:
ctypes.StructureMap UNICODE_STRING structure.
- _fields_¶
- __len__() int¶
- os.windows.native_api.W32_EPOCH_OFFSET = 11644473600¶
- class os.windows.native_api.FileTime(t: datetime.datetime)¶
Bases:
ctypes.StructureMap FILETIME structure.
- _fields_¶
- property filetime: int¶
- property as_datetime: datetime.datetime¶
- __str__() str¶
Return str(self).
- class os.windows.native_api.LargeFileTime(t: datetime.datetime)¶
Bases:
ctypes.StructureMap filetime implemented using LARGE_INTEGER.
- _fields_¶
- property as_datetime: datetime.datetime¶
- __str__() str¶
Return str(self).
- class os.windows.native_api.FileInfo¶
Declaration of structures returned by QueryInformationFile.
- class os.windows.native_api.ObjectInfo¶
Declaration of structures returned by QueryObjectInformation.
- class os.windows.native_api.ProcessInfo¶
Declaration of structure returned by QueryInformationProcess.
- STILL_ACTIVE = 259¶
- class os.windows.native_api.ObjectAttributes(name: UnicodeString, parent: ctypes.wintypes.HANDLE | None = None)¶
Bases:
ctypes.StructureOBJECT_ATTRIBUTES structure.
- OBJ_CASE_INSENSITIVE = 64¶
- _fields_¶
- class os.windows.native_api.NT¶
- FindFirstFile = None¶
- FindClose = None¶
- FsControlFile = None¶
- Sleep = None¶
- GetVolumePathName = None¶
- SetInformationFile = None¶
- QueryInformationFile = None¶
- QueryAttributesFile = None¶
- OpenFile = None¶
- QueryDirectoryFile = None¶
- Close = None¶
- QueryInformationProcess = None¶
- WaitForMultipleObjects = None¶
- OpenProcess = None¶
- QueryObject = None¶
- classmethod init_api() None¶