os.windows.native_api
=====================

.. py:module:: os.windows.native_api


Attributes
----------

.. autoapisummary::

   os.windows.native_api.NTSTATUS
   os.windows.native_api.W32_EPOCH_OFFSET


Classes
-------

.. autoapisummary::

   os.windows.native_api.FileAttribute
   os.windows.native_api.IOReparseTag
   os.windows.native_api.Access
   os.windows.native_api.Share
   os.windows.native_api.OpenOptions
   os.windows.native_api.Wait
   os.windows.native_api.Status
   os.windows.native_api.IOStatusBlock
   os.windows.native_api.ReparseGUIDDataBuffer
   os.windows.native_api.UnicodeString
   os.windows.native_api.FileTime
   os.windows.native_api.LargeFileTime
   os.windows.native_api.FindData
   os.windows.native_api.FileInfo
   os.windows.native_api.ObjectInfo
   os.windows.native_api.ProcessInfo
   os.windows.native_api.ObjectAttributes
   os.windows.native_api.NT
   os.windows.native_api.NTException


Module Contents
---------------

.. py:data:: NTSTATUS

.. py:class:: FileAttribute

   Bases: :py:obj:`ctypes.Structure`


   list of file attributes constants.


   .. py:attribute:: READONLY
      :value: 1



   .. py:attribute:: HIDDEN
      :value: 2



   .. py:attribute:: SYSTEM
      :value: 4



   .. py:attribute:: DIRECTORY
      :value: 16



   .. py:attribute:: ARCHIVE
      :value: 32



   .. py:attribute:: DEVICE
      :value: 64



   .. py:attribute:: NORMAL
      :value: 128



   .. py:attribute:: TEMPORARY
      :value: 256



   .. py:attribute:: SPARSE_FILE
      :value: 512



   .. py:attribute:: REPARSE_POINT
      :value: 1024



   .. py:attribute:: COMPRESSED
      :value: 2048



   .. py:attribute:: OFFLINE
      :value: 4096



   .. py:attribute:: NOT_CONTENT_INDEXED
      :value: 8192



   .. py:attribute:: ENCRYPTED
      :value: 16384



   .. py:attribute:: INTEGRITY_STREAM
      :value: 32768



   .. py:attribute:: VIRTUAL
      :value: 65536



   .. py:attribute:: NO_SCRUB_DATA
      :value: 131072



   .. py:attribute:: _fields_


   .. py:method:: __str__() -> str

      Return str(self).



.. py:class:: 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).


   .. py:attribute:: SYMLINK
      :value: 2684354572



   .. py:attribute:: WSL_SYMLINK
      :value: 2684354589



.. py:class:: Access

   Desired Access constants.


   .. py:attribute:: LIST_DIRECTORY
      :value: 1



   .. py:attribute:: READ_DATA
      :value: 1



   .. py:attribute:: ADD_FILE
      :value: 2



   .. py:attribute:: WRITE_DATA
      :value: 2



   .. py:attribute:: ADD_SUBDIR
      :value: 4



   .. py:attribute:: APPEND_DATA
      :value: 4



   .. py:attribute:: READ_EA
      :value: 8



   .. py:attribute:: WRITE_EA
      :value: 16



   .. py:attribute:: EXECUTE
      :value: 32



   .. py:attribute:: TRAVERSE
      :value: 32



   .. py:attribute:: DELETE_CHILD
      :value: 64



   .. py:attribute:: READ_ATTRS
      :value: 128



   .. py:attribute:: WRITE_ATTRS
      :value: 256



   .. py:attribute:: DELETE
      :value: 65536



   .. py:attribute:: SYNCHRONIZE
      :value: 1048576



   .. py:attribute:: PROCESS_QUERY_INFORMATION
      :value: 1024



.. py:class:: Share

   Share Access constants.


   .. py:attribute:: NOTHING
      :value: 0



   .. py:attribute:: READ
      :value: 1



   .. py:attribute:: WRITE
      :value: 2



   .. py:attribute:: DELETE
      :value: 4



   .. py:attribute:: ALL
      :value: 7



.. py:class:: OpenOptions

   File Open options.


   .. py:attribute:: BACKUP_INTENT
      :value: 16384



   .. py:attribute:: SYNCHRONOUS_IO_NON_ALERT
      :value: 32



   .. py:attribute:: DELETE_ON_CLOSE
      :value: 4096



   .. py:attribute:: OPEN_REPARSE_POINT
      :value: 2097152



.. py:class:: Wait

   Constants for WaitFor* functions.


   .. py:attribute:: OBJECT
      :value: 0



   .. py:attribute:: ABANDONED
      :value: 128



   .. py:attribute:: TIMEOUT
      :value: 258



   .. py:attribute:: FAILED
      :value: 4294967295



   .. py:attribute:: INFINITE
      :value: 4294967295



.. py:class:: Status

   Error constants.


   .. py:attribute:: ACCESS_DENIED
      :value: 3221225506



   .. py:attribute:: OBJECT_NAME_NOT_FOUND
      :value: 3221225524



   .. py:attribute:: OBJECT_PATH_NOT_FOUND
      :value: 3221225530



   .. py:attribute:: SHARING_VIOLATION
      :value: 3221225539



   .. py:attribute:: DELETE_PENDING
      :value: 3221225558



   .. py:attribute:: DIRECTORY_NOT_EMPTY
      :value: 3221225729



   .. py:attribute:: CANNOT_DELETE
      :value: 3221225761



   .. py:attribute:: NO_MORE_FILES
      :value: 2147483654



   .. py:attribute:: msgs


.. py:class:: IOStatusBlock

   Bases: :py:obj:`ctypes.Structure`


   Map IO_STATUS_BLOCK structure.


   .. py:attribute:: _fields_


.. py:class:: ReparseGUIDDataBuffer

   Bases: :py:obj:`ctypes.Structure`


   Structure base class


   .. py:attribute:: _fields_


.. py:class:: UnicodeString(value: str | None = None, max_length: int = 0)

   Bases: :py:obj:`ctypes.Structure`


   Map UNICODE_STRING structure.


   .. py:attribute:: _fields_


   .. py:method:: __len__() -> int


.. py:data:: W32_EPOCH_OFFSET
   :value: 11644473600


.. py:class:: FileTime(t: datetime.datetime)

   Bases: :py:obj:`ctypes.Structure`


   Map FILETIME structure.


   .. py:attribute:: _fields_


   .. py:property:: filetime
      :type: int



   .. py:property:: as_datetime
      :type: datetime.datetime



   .. py:method:: __str__() -> str

      Return str(self).



.. py:class:: LargeFileTime(t: datetime.datetime)

   Bases: :py:obj:`ctypes.Structure`


   Map filetime implemented using LARGE_INTEGER.


   .. py:attribute:: _fields_


   .. py:property:: as_datetime
      :type: datetime.datetime



   .. py:method:: __str__() -> str

      Return str(self).



.. py:class:: FindData

   Bases: :py:obj:`ctypes.Structure`


   Structure base class


   .. py:attribute:: _fields_


.. py:class:: FileInfo

   Declaration of structures returned by QueryInformationFile.


   .. py:class:: Names

      .. py:attribute:: class_id
         :value: 12




   .. py:class:: ReparsePoint

      Bases: :py:obj:`ctypes.Structure`


      Structure base class


      .. py:attribute:: _fields_


      .. py:attribute:: class_id
         :value: 33




   .. py:class:: Disposition

      Bases: :py:obj:`ctypes.Structure`


      Structure base class


      .. py:attribute:: _fields_


      .. py:attribute:: class_id
         :value: 13




   .. py:class:: Internal

      Bases: :py:obj:`ctypes.Structure`


      Structure base class


      .. py:attribute:: _fields_


      .. py:attribute:: class_id
         :value: 6




   .. py:class:: Rename

      Bases: :py:obj:`ctypes.Structure`


      Structure base class


      .. py:attribute:: _fields_
         :value: []



      .. py:attribute:: class_id
         :value: 10




   .. py:class:: Basic

      Bases: :py:obj:`ctypes.Structure`


      Structure base class


      .. py:attribute:: _fields_


      .. py:attribute:: class_id
         :value: 4



      .. py:attribute:: file_attributes


      .. py:method:: __str__() -> str

         Return str(self).




.. py:class:: ObjectInfo

   Declaration of structures returned by QueryObjectInformation.


   .. py:class:: Name

      Bases: :py:obj:`ctypes.Structure`


      Structure base class


      .. py:attribute:: _fields_
         :value: []



      .. py:attribute:: class_id
         :value: 1




.. py:class:: ProcessInfo

   Declaration of structure returned by QueryInformationProcess.


   .. py:class:: Basic

      Bases: :py:obj:`ctypes.Structure`


      Structure base class


      .. py:attribute:: class_id
         :value: 0



      .. py:attribute:: _fields_



   .. py:attribute:: STILL_ACTIVE
      :value: 259



.. py:class:: ObjectAttributes(name: UnicodeString, parent: ctypes.wintypes.HANDLE | None = None)

   Bases: :py:obj:`ctypes.Structure`


   OBJECT_ATTRIBUTES structure.


   .. py:attribute:: OBJ_CASE_INSENSITIVE
      :value: 64



   .. py:attribute:: _fields_


.. py:class:: NT

   .. py:attribute:: FindFirstFile
      :value: None



   .. py:attribute:: FindClose
      :value: None



   .. py:attribute:: FsControlFile
      :value: None



   .. py:attribute:: Sleep
      :value: None



   .. py:attribute:: GetVolumePathName
      :value: None



   .. py:attribute:: SetInformationFile
      :value: None



   .. py:attribute:: QueryInformationFile
      :value: None



   .. py:attribute:: QueryAttributesFile
      :value: None



   .. py:attribute:: OpenFile
      :value: None



   .. py:attribute:: QueryDirectoryFile
      :value: None



   .. py:attribute:: Close
      :value: None



   .. py:attribute:: QueryInformationProcess
      :value: None



   .. py:attribute:: WaitForMultipleObjects
      :value: None



   .. py:attribute:: OpenProcess
      :value: None



   .. py:attribute:: QueryObject
      :value: None



   .. py:method:: init_api() -> None
      :classmethod:



.. py:class:: NTException(status: int, message: str, origin: str | None = None)

   Bases: :py:obj:`e3.error.E3Error`


   .. py:attribute:: status


   .. py:method:: __str__()


