
    %
i                         d Z ddlZddlZddlZddlZddlZddlZddlZddlZd Z	e
dk    rB	  e	             dS # ej        $ r(Zej        ej        k    r ed           n Y dZ[dS dZ[ww xY wdS )z
This demonstrates the creation of miniversions of a file during a transaction.
The FSCTL_TXFS_CREATE_MINIVERSION control code saves any changes to a new
miniversion (effectively a savepoint within a transaction).
    Nc                     d} t          j        |           }t          j                    }t          j        |d          d         }t          d|           t          |d          }|                    d           |                                 t          j
        d          }t          j        |t          j        t          j        z  t          j        t          j        z  d	t          j        dd	|
          }t          j        |d           t          j        |t*          j        d	|d	          }t          j        | |          \  }}	}
}t          j        |dt          j                   t          j        |d           t          j        |t*          j        d	|d	          }t          j        | |          \  }}	}
}|                                 t          j        |t          j        t          j        t          j        z  d	t          j        dd	||
	  	        }t          d|
t          j        |d                     |                                 t          j        |t          j        t          j        t          j        z  d	t          j        dd	||	  	        }t          d|t          j        |d                     |                                 t          j        |t          j        t          j        t          j        z  d	t          j        dd	||	  	        }t          d|t          j        |d                     |                                 t          j        |           t;          j        |           d	S )z
    Definition of buffer used with FSCTL_TXFS_CREATE_MINIVERSION:
    typedef struct _TXFS_CREATE_MINIVERSION_INFO{
        USHORT StructureVersion;
        USHORT StructureLength;
        ULONG BaseVersion;
        USHORT MiniVersion;}
    HHLH0Lcftr   z&Demonstrating transactions on tempfilewzThis is original file.
z$Test creating miniversions of a file)DescriptionN)Transactions   This is first miniversion.
s   This is second miniversion!
)r   MiniVersionzversion:d   )structcalcsizewin32apiGetTempPathGetTempFileNameprintopenwriteclosewin32transactionCreateTransaction	win32fileCreateFileWwin32conGENERIC_READGENERIC_WRITEFILE_SHARE_READFILE_SHARE_WRITEOPEN_EXISTING	WriteFileDeviceIoControlwinioctlconFSCTL_TXFS_CREATE_MINIVERSIONunpackSetFilePointer
FILE_BEGINCloseReadFileCommitTransactionosunlink)buf_fmtbuf_sizetempdirtempfileftranshfilebuf
struct_ver
struct_lenbase_verver_1ver_2hfile_0hfile_1hfile_2s                   C:\Users\Dell Inspiron 16\Desktop\tws\AgrotaPowerBi\back-agrota-powerbi\mcp-client-agrota\venv\Lib\site-packages\win32/Demos/CreateFileTransacted_MiniVersion.pydemor;      s&    Gw''H"$$G'77:H	
2H===XsAGG&'''GGIII.:  E ! 66 8#<<		 	 	E >???

#{8$$ C /5mGS.I.I+J
HeUAx':;;;?@@@

#{8$$ C /5mGS.I.I+J
He	KKMMM # 8#<<	
 
 
G 
*h	 27C @ @AAAMMOOO# 8#<<	
 
 
G 
*eY/==>>>MMOOO# 8#<<	
 
 
G 
*eY/==>>>MMOOO &u---Ih    __main__z4These features are not supported by this filesystem.)__doc__r(   r   r   r   r   r   winerrorr    r;   __name__erroreERROR_NOT_SUPPORTEDr    r<   r:   <module>rE      s     
			                ] ] ]@ z?   :555EHIIII JIIIII	 s   
9 
A+A&&A+