Blame include/ntapi/nt_mount.h

dd89bb
#ifndef _NT_MOUNT_H_
dd89bb
#define _NT_MOUNT_H_
dd89bb
dd89bb
#include <psxtypes/psxtypes.h>
dd89bb
#include "nt_ioctl.h"
dd89bb
#include "nt_statfs.h"
dd89bb
dd89bb
/* hash mark */
dd89bb
/* {'\\','D','e','v','i','c','e','\\'} */
dd89bb
#define __DEVICE_PATH_PREFIX_LEN	(8 * sizeof(wchar16_t))
dd89bb
#define __DEVICE_PATH_PREFIX_HASH	(0xDA6FA40B)
dd89bb
dd89bb
/* {'\\','?','?','\\','V','o','l','u','m','e','{'} */
dd89bb
#define __VOLUME_PATH_PREFIX_LEN	(11 * sizeof(wchar16_t))
dd89bb
#define __VOLUME_PATH_PREFIX_HASH	(0xFEBA8529)
dd89bb
dd89bb
/* {'\\','D','o','s','D','e','v','i','c','e','s'} */
dd89bb
#define __DOS_DEVICES_PREFIX_LEN	(11 * sizeof(wchar16_t))
dd89bb
#define __DOS_DEVICES_PREFIX_HASH	(0x565D0514)
dd89bb
dd89bb
dd89bb
typedef enum _nt_mount_moint_type {
dd89bb
	NT_MOUNT_POINT_NONE,
dd89bb
	NT_MOUNT_POINT_DEVICE,
dd89bb
	NT_MOUNT_POINT_VOLUME,
dd89bb
	NT_MOUNT_POINT_DIRECTORY
dd89bb
} nt_mount_moint_type;
dd89bb
dd89bb
/* reparse tag values */
dd89bb
#define NT_IO_REPARSE_TAG_RESERVED_ZERO		(0x00000000)
dd89bb
#define NT_IO_REPARSE_TAG_RESERVED_ONE		(0x00000001)
dd89bb
#define NT_IO_REPARSE_TAG_MOUNT_POINT		(0xA0000003)
dd89bb
#define NT_IO_REPARSE_TAG_HSM			(0xC0000004)
dd89bb
#define NT_IO_REPARSE_TAG_HSM2			(0x80000006)
dd89bb
#define NT_IO_REPARSE_TAG_DRIVER_EXTENDER	(0x80000005)
dd89bb
#define NT_IO_REPARSE_TAG_SIS			(0x80000007)
dd89bb
#define NT_IO_REPARSE_TAG_DFS			(0x8000000A)
dd89bb
#define NT_IO_REPARSE_TAG_DFSR			(0x80000012)
dd89bb
#define NT_IO_REPARSE_TAG_FILTER_MANAGER	(0x8000000B)
dd89bb
#define NT_IO_REPARSE_TAG_SYMLINK		(0xA000000C)
dd89bb
dd89bb
dd89bb
typedef struct _nt_mount_dev_name {
dd89bb
	uint16_t	name_length;
dd89bb
	wchar16_t	name[];
dd89bb
} nt_mount_dev_name;
dd89bb
dd89bb
dd89bb
typedef struct _nt_mount_mgr_mount_point {
dd89bb
	uint32_t 	symlink_name_offset;
dd89bb
	uint16_t	symlink_name_length;
dd89bb
	uint32_t	unique_id_offset;
dd89bb
	uint16_t	unique_id_length;
dd89bb
	uint32_t	device_name_offset;
dd89bb
	uint16_t	device_name_length;
dd89bb
} nt_mount_mgr_mount_point, nt_mount_point;
dd89bb
dd89bb
dd89bb
typedef struct _nt_mount_mgr_mount_point_param {
dd89bb
	uint32_t 	symlink_name_offset;
dd89bb
	uint16_t	symlink_name_length;
dd89bb
	uint32_t	unique_id_offset;
dd89bb
	uint16_t	unique_id_length;
dd89bb
	uint32_t	device_name_offset;
dd89bb
	uint16_t	device_name_length;
dd89bb
	uint16_t	mount_points_offset;
dd89bb
	wchar16_t	device_name[];
dd89bb
} nt_mount_mgr_mount_point_param, nt_mount_point_param;
dd89bb
dd89bb
dd89bb
typedef struct _nt_mount_mgr_mount_points {
dd89bb
	uint32_t			size;
dd89bb
	uint32_t			number;
dd89bb
	nt_mount_mgr_mount_point	mount_points[];
dd89bb
} nt_mount_mgr_mount_points, nt_mount_points;
dd89bb
dd89bb
dd89bb
typedef struct _nt_mount_point_reparse_buffer {
dd89bb
	uint32_t	reparse_tag;
dd89bb
	uint16_t	reparse_data_length;
dd89bb
	uint16_t	reserved;
dd89bb
	uint16_t	substitute_name_offset;
dd89bb
	uint16_t	substitute_name_length;
dd89bb
	uint16_t	print_name_offset;
dd89bb
	uint16_t	print_name_length;
dd89bb
	uintptr_t	path_buffer[];
dd89bb
} _nt_mount_point_reparse_buffer, nt_mprb;
dd89bb
dd89bb
dd89bb
typedef struct _nt_dos_devices_name {
dd89bb
	wchar16_t	dos_devices_prefix[11];
dd89bb
	wchar16_t	slash;
dd89bb
	wchar16_t	letter;
dd89bb
	wchar16_t	colon;
dd89bb
} nt_dos_devices_name;
dd89bb
dd89bb
dd89bb
typedef int32_t __stdcall	ntapi_tt_get_dos_drive_device_handle(
dd89bb
	__out	void **			hdevice,
dd89bb
	__in	wchar16_t *		drive_letter);
dd89bb
dd89bb
dd89bb
typedef int32_t __stdcall	ntapi_tt_get_dos_drive_root_handle(
dd89bb
	__out	void **			hroot,
dd89bb
	__in	wchar16_t *		drive_letter);
dd89bb
dd89bb
dd89bb
typedef int32_t __stdcall	ntapi_tt_get_dos_drive_device_name(
dd89bb
	__in	void *			hdevice		__optional,
dd89bb
	__in	wchar16_t *		drive_letter	__optional,
dd89bb
	__out	nt_mount_dev_name *	buffer,
dd89bb
	__in	uint32_t		buffer_size);
dd89bb
dd89bb
dd89bb
typedef int32_t __stdcall	ntapi_tt_get_dos_drive_mount_points(
dd89bb
	__in	void *			hdevice		__optional,
dd89bb
	__in	wchar16_t *		drive_letter	__optional,
dd89bb
	__in	nt_mount_dev_name *	dev_name	__optional,
dd89bb
	__out	void *			buffer,
dd89bb
	__in	uint32_t		buffer_size);
dd89bb
dd89bb
dd89bb
typedef int32_t __stdcall	ntapi_tt_dev_mount_points_to_statfs(
dd89bb
	__in		nt_mount_points *	mount_points,
dd89bb
	__in_out	nt_statfs *		statfs);
dd89bb
dd89bb
dd89bb
typedef int32_t __stdcall	ntapi_tt_get_dos_drive_letter_from_device(
dd89bb
	__in	void *			hdevice		__optional,
dd89bb
	__out	wchar16_t *		drive_letter,
dd89bb
	__in	nt_mount_dev_name *	dev_name	__optional,
dd89bb
	__out	void *			buffer,
dd89bb
	__in	uint32_t		buffer_size);
dd89bb
dd89bb
#endif