def new_junction_reparse_buffer(path=None):
if path is None:<EOL><INDENT>substnamebufferchars = <NUM_LIT><EOL><DEDENT>else:<EOL><INDENT>substnamebufferchars = len(path) + <NUM_LIT:1><EOL><DEDENT>class REPARSE_DATA_BUFFER(ctypes.Structure):<EOL><INDENT>_fields_ = [("<STR_LIT>", ctypes.c_ulong),<EOL>("<STR_LIT>", ctypes.c_ushort),<EOL>("<STR_LIT>", ctypes.c_ushort),<EOL>("<STR_LIT>", ctypes.c_ushort),<EOL>("<STR_LIT>", ctypes.c_ushort),<EOL>("<STR_LIT>", ctypes.c_ushort),<EOL>("<STR_LIT>", ctypes.c_ushort),<EOL>("<STR_LIT>", ctypes.c_wchar * substnamebufferchars),<EOL>("<STR_LIT>", ctypes.c_wchar * <NUM_LIT:1>)]<EOL><DEDENT>numpathbytes = (substnamebufferchars - <NUM_LIT:1>) * sizeof(ctypes.c_wchar)<EOL>buffersize = (numpathbytes + (sizeof(ctypes.c_wchar) * <NUM_LIT:2>) + <EOL>(sizeof(ctypes.c_ushort) * <NUM_LIT:4>))<EOL>if path is None:<EOL><INDENT>buffer = REPARSE_DATA_BUFFER()<EOL>buffer.ReparseTag = IO_REPARSE_TAG_MOUNT_POINT<EOL><DEDENT>else:<EOL><INDENT>buffer = REPARSE_DATA_BUFFER(<EOL>IO_REPARSE_TAG_MOUNT_POINT,<EOL>buffersize,<EOL><NUM_LIT:0>,<EOL><NUM_LIT:0>, numpathbytes,<EOL>numpathbytes + <NUM_LIT:2>, <NUM_LIT:0>,<EOL>path,<EOL>"<STR_LIT>")<EOL><DEDENT>return (buffer, buffersize + REPARSE_DATA_BUFFER.SubstituteNameOffset.offset)<EOL>
Given a path, return a pair containing a new REPARSE_DATA_BUFFER and the
length of the buffer (not necessarily the same as sizeof due to packing
issues).
If no path is provided, the maximum length is assumed.