Blob Blame History Raw
#ifndef _NT_AFL_H_
#define _NT_AFL_H_

#include "nt_abi.h"
#include "nt_object.h"

/* advisory file locking command bits */
#define NT_AFL_CMD_LOCK_NONE	(0x0000)
#define NT_AFL_CMD_LOCK_READ	(0x0001)
#define NT_AFL_CMD_LOCK_WRITE	(0x0002)
#define NT_AFL_CMD_LOCK_PROBE	(0x0400)
#define NT_AFL_CMD_LOCK_NOWAIT	(0x0800)

/* advisory file locking info info */
typedef struct __attr_ptr_size_aligned__ _nt_afl_info {
	void *		hport;
	void *		hevent;
	void *		apc_routine;
	void *		apc_context;
	nt_guid		afldev;
	void *		l_hfile;
	int64_t		l_fileid;
	int64_t		l_start;
	int64_t		l_len;
	int32_t		l_pid;
	uint32_t	l_cmd;
	nt_iosb		ntiosb;
	nt_iosb *	riosb;
} nt_afl_info;

/* advisory file locking operation */
typedef struct __attr_ptr_size_aligned__ _nt_afl_op {
	void *		l_hfile;
	int64_t		l_fileid;
	int64_t		l_start;
	int64_t		l_len;
	uint32_t	l_pid;
	uint32_t	l_cmd;
} nt_afl_op;

/* advisory file locking client interfaces */
typedef int32_t	__stdcall ntapi_afl_create(
	__in	void *			hport,
	__out	nt_afl_info *		afl,
	__in	nt_oa *			oa,
	__out	nt_iosb *		iosb);


typedef int32_t	__stdcall ntapi_afl_open(
	__in	void *			hport,
	__out	nt_afl_info *		afl,
	__in	nt_oa *			oa,
	__out	nt_iosb *		iosb);


typedef int32_t	__stdcall ntapi_afl_fcntl(
	__in	nt_afl_info *		afl,
	__in	void *			hevent			__optional,
	__in	nt_io_apc_routine *	apc_routine		__optional,
	__in	void *			apc_context		__optional,
	__out	nt_iosb *		iosb,
	__in	uint32_t		afl_control_code,
	__in	void *			input_buffer		__optional,
	__in	uint32_t		input_buffer_length,
	__out	void *			output_buffer		__optional,
	__in	uint32_t		output_buffer_length);


typedef int32_t	__stdcall ntapi_afl_ioctl(
	__in	nt_afl_info *		afl,
	__in	void *			hevent			__optional,
	__in	nt_io_apc_routine *	apc_routine		__optional,
	__in	void *			apc_context		__optional,
	__out	nt_iosb *		iosb,
	__in	uint32_t		afl_control_code,
	__in	void *			input_buffer		__optional,
	__in	uint32_t		input_buffer_length,
	__out	void *			output_buffer		__optional,
	__in	uint32_t		output_buffer_length);


typedef int32_t	__stdcall ntapi_afl_query(
	__in	nt_afl_info *		afl,
	__out	nt_io_status_block *	iosb,
	__out	void *			afl_info,
	__in	uint32_t		afl_info_length,
	__in	int32_t			afl_ctl_cmd);


typedef int32_t	__stdcall ntapi_afl_set(
	__in	nt_afl_info *		afl,
	__out	nt_io_status_block *	iosb,
	__in	void *			afl_info,
	__in	uint32_t		afl_info_length,
	__in	int32_t			afl_ctl_cmd);


typedef int32_t	__stdcall ntapi_afl_cancel(
	__in	nt_afl_info *		afl,
	__out	nt_iosb *		iosb);


typedef int32_t	__stdcall ntapi_afl_free(
	__in	nt_afl_info *		afl,
	__out	nt_iosb *		iosb);


#endif