1
0

Build changes

This commit is contained in:
Scott E. Graves
2017-03-23 22:20:22 -05:00
parent cf660fd7e6
commit 85e3138fec
48 changed files with 15 additions and 6608 deletions

View File

@@ -1,5 +0,0 @@
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,11
[InternetShortcut]
IDList=
URL=https://github.com/dokan-dev/dokany/blob/master/README.md

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,50 +0,0 @@
[Version]
Signature = "$Windows NT$"
Class = DiskDrive
ClassGuid = {4d36e967-e325-11ce-bfc1-08002be10318}
Provider = %Dokan%
DriverVer=01/23/2017,1.0.2.0
CatalogFile = %DriverName%.cat
DriverPackageType = FileSystem
[DestinationDirs]
DefaultDestDir = 12
DokanFileSystem.DriverFiles = 12
[DefaultInstall]
OptionDesc = %ServiceDesc%
CopyFiles = DokanFileSystem.DriverFiles
[DefaultInstall.Services]
AddService = %ServiceName%,,DokanFileSystem.Service
[DefaultUninstall]
DelFiles = DokanFileSystem.DriverFiles
[DefaultUninstall.Services]
DelService = %ServiceName%,0x200
[SourceDisksNames]
1 = %Disk1%
[SourceDisksFiles]
dokan1.sys = 1
[DokanFileSystem.DriverFiles]
%DriverName%.sys
[DokanFileSystem.Service]
DisplayName = %ServiceName%
Description = %ServiceDesc%
ServiceBinary = %12%\%DriverName%.sys
ServiceType = 2 ; SERVICE_FILE_SYSTEM_DRIVER
StartType = 1 ; SERVICE_SYSTEM_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
LoadOrderGroup = "File System"
[Strings]
Dokan = "Dokan"
DriverName = "dokan1"
Disk1 = "Dokan installation media"
ServiceDesc = "Dokan kernel-mode file system driver."
ServiceName = "dokan1"

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,877 +0,0 @@
/*
Dokan : user-mode file system library for Windows
Copyright (C) 2015 - 2017 Adrien J. <liryna.stark@gmail.com> and Maxime C. <maxime@islog.com>
Copyright (C) 2007 - 2011 Hiroki Asakawa <info@dokan-dev.net>
http://dokan-dev.github.io
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your option) any
later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef DOKAN_H_
#define DOKAN_H_
/** Do not include NTSTATUS. Fix duplicate preprocessor definitions */
#define WIN32_NO_STATUS
#include <windows.h>
#undef WIN32_NO_STATUS
#include <ntstatus.h>
#include "fileinfo.h"
#include "public.h"
#ifdef _EXPORTING
/** Export dokan API see also dokan.def for export */
#define DOKANAPI __stdcall
#else
/** Import dokan API */
#define DOKANAPI __declspec(dllimport) __stdcall
#endif
/** Change calling convention to standard call */
#define DOKAN_CALLBACK __stdcall
#ifdef __cplusplus
extern "C" {
#endif
/** @file */
/**
* \defgroup Dokan Dokan
* \brief Dokan Library const and methodes
*/
/** @{ */
/** The current Dokan version (ver 1.0.0). \ref DOKAN_OPTIONS.Version */
#define DOKAN_VERSION 100
/** Minimum Dokan version (ver 1.0.0) accepted. */
#define DOKAN_MINIMUM_COMPATIBLE_VERSION 100
/** Maximum number of dokan instances.*/
#define DOKAN_MAX_INSTANCES 32
/** Driver file name including the DOKAN_MAJOR_API_VERSION */
#define DOKAN_DRIVER_NAME L"dokan" DOKAN_MAJOR_API_VERSION L".sys"
/** Network provider name including the DOKAN_MAJOR_API_VERSION */
#define DOKAN_NP_NAME L"Dokan" DOKAN_MAJOR_API_VERSION
/** @} */
/**
* \defgroup DOKAN_OPTION DOKAN_OPTION
* \brief All DOKAN_OPTION flags used in DOKAN_OPTIONS.Options
* \see DOKAN_FILE_INFO
*/
/** @{ */
/** Enable ouput debug message */
#define DOKAN_OPTION_DEBUG 1
/** Enable ouput debug message to stderr */
#define DOKAN_OPTION_STDERR 2
/** Use alternate stream */
#define DOKAN_OPTION_ALT_STREAM 4
/** Enable mount drive as write-protected */
#define DOKAN_OPTION_WRITE_PROTECT 8
/** Use network drive - Dokan network provider need to be installed */
#define DOKAN_OPTION_NETWORK 16
/** Use removable drive */
#define DOKAN_OPTION_REMOVABLE 32
/** Use mount manager */
#define DOKAN_OPTION_MOUNT_MANAGER 64
/** Mount the drive on current session only */
#define DOKAN_OPTION_CURRENT_SESSION 128
/** Enable Lockfile/Unlockfile operations. Otherwise Dokan will take care of it */
#define DOKAN_OPTION_FILELOCK_USER_MODE 256
/** @} */
/**
* \struct DOKAN_OPTIONS
* \brief Dokan mount options used to describe dokan device behavior.
* \see DokanMain
*/
typedef struct _DOKAN_OPTIONS {
/** Version of the dokan features requested (version "123" is equal to Dokan version 1.2.3). */
USHORT Version;
/** Number of threads to be used internally by Dokan library. More thread will handle more event at the same time. */
USHORT ThreadCount;
/** Features enable for the mount. See \ref DOKAN_OPTION. */
ULONG Options;
/** FileSystem can store anything here. */
ULONG64 GlobalContext;
/** Mount point. Can be "M:\" (drive letter) or "C:\mount\dokan" (path in NTFS). */
LPCWSTR MountPoint;
/**
* UNC Name for the Network Redirector
* \see <a href="https://msdn.microsoft.com/en-us/library/windows/hardware/ff556761(v=vs.85).aspx">Support for UNC Naming</a>
*/
LPCWSTR UNCName;
/** Max timeout in milliseconds of each request before Dokan give up. */
ULONG Timeout;
/** Allocation Unit Size of the volume. This will behave on the file size. */
ULONG AllocationUnitSize;
/** Sector Size of the volume. This will behave on the file size. */
ULONG SectorSize;
} DOKAN_OPTIONS, *PDOKAN_OPTIONS;
/**
* \struct DOKAN_FILE_INFO
* \brief Dokan file information on the current operation.
*/
typedef struct _DOKAN_FILE_INFO {
/**
* Context that can be used to carry information between operation.
* The Context can carry whatever type like \c HANDLE, struct, int,
* internal reference that will help the implementation understand the request context of the event.
*/
ULONG64 Context;
/** Reserved. Used internally by Dokan library. Never modify. */
ULONG64 DokanContext;
/** A pointer to DOKAN_OPTIONS which was passed to DokanMain. */
PDOKAN_OPTIONS DokanOptions;
/**
* Process id for the thread that originally requested a given I/O operation.
*/
ULONG ProcessId;
/**
* Requesting a directory file.
* Must be set in \ref DOKAN_OPERATIONS.ZwCreateFile if the file appear to be a folder.
*/
UCHAR IsDirectory;
/** Flag if the file has to be delete during DOKAN_OPERATIONS.Cleanup event. */
UCHAR DeleteOnClose;
/** Read or write is paging IO. */
UCHAR PagingIo;
/** Read or write is synchronous IO. */
UCHAR SynchronousIo;
/** Read or write directly from data source without cache */
UCHAR Nocache;
/** If \c TRUE, write to the current end of file instead of using the Offset parameter. */
UCHAR WriteToEndOfFile;
} DOKAN_FILE_INFO, *PDOKAN_FILE_INFO;
/**
* \brief FillFindData Used to add an entry in FindFiles operation
* \return 1 if buffer is full, otherwise 0 (currently it never returns 1)
*/
typedef int(WINAPI *PFillFindData)(PWIN32_FIND_DATAW, PDOKAN_FILE_INFO);
/**
* \brief FillFindStreamData Used to add an entry in FindStreams
* \return 1 if buffer is full, otherwise 0 (currently it never returns 1)
*/
typedef int(WINAPI *PFillFindStreamData)(PWIN32_FIND_STREAM_DATA,
PDOKAN_FILE_INFO);
// clang-format off
/**
* \struct DOKAN_OPERATIONS
* \brief Dokan API callbacks interface
*
* DOKAN_OPERATIONS is a struct of callbacks that describe all Dokan API operation
* that will be called when Windows access to the filesystem.
*
* If an error occurs, return NTSTATUS (https://support.microsoft.com/en-us/kb/113996).
* Win32 Error can be converted to \c NTSTATUS with \ref DokanNtStatusFromWin32
*
* All this callbacks can be set to \c NULL or return \c STATUS_NOT_IMPLEMENTED
* if you dont want to support one of them. Be aware that returning such value to important callbacks
* such as DOKAN_OPERATIONS.ZwCreateFile / DOKAN_OPERATIONS.ReadFile / ... would make the filesystem not working or unstable.
*/
typedef struct _DOKAN_OPERATIONS {
/**
* \brief CreateFile Dokan API callback
*
* CreateFile is called each time a request is made on a file system object.
*
* In case \c OPEN_ALWAYS & \c CREATE_ALWAYS are opening successfully a already
* existing file, you have to return \c STATUS_OBJECT_NAME_COLLISION instead of \c STATUS_SUCCESS .
* This will inform Dokan that the file has been opened and not created during the request.
*
* If the file is a directory, CreateFile is also called.
* In this case, CreateFile should return \c STATUS_SUCCESS when that directory
* can be opened and DOKAN_FILE_INFO.IsDirectory has to be set to \c TRUE.
*
* DOKAN_FILE_INFO.Context can be use to store Data (like \c HANDLE)
* that can be retrieved in all other request related to the Context
*
* \param FileName File path requested by the Kernel on the FileSystem.
* \param SecurityContext SecurityContext, see https://msdn.microsoft.com/en-us/library/windows/hardware/ff550613(v=vs.85).aspx
* \param DesiredAccess Specifies an <a href="https://msdn.microsoft.com/en-us/library/windows/hardware/ff540466(v=vs.85).aspx">ACCESS_MASK</a> value that determines the requested access to the object.
* \param FileAttributes Specifies one or more FILE_ATTRIBUTE_XXX flags, which represent the file attributes to set if you create or overwrite a file.
* \param ShareAccess Type of share access, which is specified as zero or any combination of FILE_SHARE_* flags.
* \param CreateDisposition Specifies the action to perform if the file does or does not exist.
* \param CreateOptions Specifies the options to apply when the driver creates or opens the file.
* \param DokanFileInfo Information about the file or directory.
* \return \c STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
* \see <a href="https://msdn.microsoft.com/en-us/library/windows/hardware/ff566424(v=vs.85).aspx">See ZwCreateFile for more information about the parameters of this callback (MSDN).</a>
* \see DokanMapKernelToUserCreateFileFlags
* \see DokanMapStandardToGenericAccess
*/
NTSTATUS(DOKAN_CALLBACK *ZwCreateFile)(LPCWSTR FileName,
PDOKAN_IO_SECURITY_CONTEXT SecurityContext,
ACCESS_MASK DesiredAccess,
ULONG FileAttributes,
ULONG ShareAccess,
ULONG CreateDisposition,
ULONG CreateOptions,
PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief Cleanup Dokan API callback
*
* Cleanup request before \ref CloseFile is called.
*
* When DOKAN_FILE_INFO.DeleteOnClose is \c TRUE, you must delete the file in Cleanup.
* See DeleteFile documentation for explanation.
*
* \param FileName File path requested by the Kernel on the FileSystem.
* \param DokanFileInfo Information about the file or directory.
* \see DeleteFile
* \see DeleteDirectory
*/
void(DOKAN_CALLBACK *Cleanup)(LPCWSTR FileName,
PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief CloseFile Dokan API callback
*
* Clean remaining Context
*
* CloseFile is called at the end of the life of the context.
* Remainings in \ref DOKAN_FILE_INFO.Context has to be cleared before return.
*
* \param FileName File path requested by the Kernel on the FileSystem.
* \param DokanFileInfo Information about the file or directory.
*/
void(DOKAN_CALLBACK *CloseFile)(LPCWSTR FileName,
PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief ReadFile Dokan API callback
*
* ReadFile callback on the file previously opened in DOKAN_OPERATIONS.ZwCreateFile.
* It can be called by different thread at the same time.
* Therefor the read/context has to be thread safe.
*
* \param FileName File path requested by the Kernel on the FileSystem.
* \param Buffer Read buffer that has to be fill with the read result.
* \param BufferLength Buffer length and also the read size to proceed.
* \param ReadLength Total data size that has been read.
* \param Offset Offset from where the read has to be proceed.
* \param DokanFileInfo Information about the file or directory.
* \return \c STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
* \see WriteFile
*/
NTSTATUS(DOKAN_CALLBACK *ReadFile)(LPCWSTR FileName,
LPVOID Buffer,
DWORD BufferLength,
LPDWORD ReadLength,
LONGLONG Offset,
PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief WriteFile Dokan API callback
*
* WriteFile callback on the file previously opened in DOKAN_OPERATIONS.ZwCreateFile
* It can be called by different thread at the same time.
* Therefor the write/context has to be thread safe.
*
* \param FileName File path requested by the Kernel on the FileSystem.
* \param Buffer Data that has to be written.
* \param NumberOfBytesToWrite Buffer length and also the write size to proceed.
* \param NumberOfBytesWritten Total byte that has been write.
* \param Offset Offset from where the write has to be proceed.
* \param DokanFileInfo Information about the file or directory.
* \return \c STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
* \see ReadFile
*/
NTSTATUS(DOKAN_CALLBACK *WriteFile)(LPCWSTR FileName,
LPCVOID Buffer,
DWORD NumberOfBytesToWrite,
LPDWORD NumberOfBytesWritten,
LONGLONG Offset,
PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief FlushFileBuffers Dokan API callback
*
* Clears buffers for this context and causes any buffered data to be written to the file.
*
* \param FileName File path requested by the Kernel on the FileSystem.
* \param DokanFileInfo Information about the file or directory.
* \return \c STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
*/
NTSTATUS(DOKAN_CALLBACK *FlushFileBuffers)(LPCWSTR FileName,
PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief GetFileInformation Dokan API callback
*
* Get specific informations on a file.
*
* \param FileName File path requested by the Kernel on the FileSystem.
* \param Buffer BY_HANDLE_FILE_INFORMATION struct to fill.
* \param DokanFileInfo Information about the file or directory.
* \return \c STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
*/
NTSTATUS(DOKAN_CALLBACK *GetFileInformation)(LPCWSTR FileName,
LPBY_HANDLE_FILE_INFORMATION Buffer,
PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief FindFiles Dokan API callback
*
* List all files in the path requested
* \ref DOKAN_OPERATIONS.FindFilesWithPattern is checking first. If it is not implemented or
* returns \c STATUS_NOT_IMPLEMENTED, then FindFiles is called, if implemented.
*
* \param FileName File path requested by the Kernel on the FileSystem.
* \param FillFindData Callback that has to be called with PWIN32_FIND_DATAW that contain file information.
* \param DokanFileInfo Information about the file or directory.
* \return \c STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
* \see FindFilesWithPattern
*/
NTSTATUS(DOKAN_CALLBACK *FindFiles)(LPCWSTR FileName,
PFillFindData FillFindData,
PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief FindFilesWithPattern Dokan API callback
*
* Same as \ref DOKAN_OPERATIONS.FindFiles but with a search pattern.
*
* \param PathName Path requested by the Kernel on the FileSystem.
* \param SearchPattern Search pattern.
* \param FillFindData Callback that has to be called with PWIN32_FIND_DATAW that contain file information.
* \param DokanFileInfo Information about the file or directory.
* \return \c STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
* \see FindFiles
*/
NTSTATUS(DOKAN_CALLBACK *FindFilesWithPattern)(LPCWSTR PathName,
LPCWSTR SearchPattern,
PFillFindData FillFindData,
PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief SetFileAttributes Dokan API callback
*
* Set file attributes on a specific file
*
* \param FileName File path requested by the Kernel on the FileSystem.
* \param FileAttributes FileAttributes to set on file.
* \param DokanFileInfo Information about the file or directory.
* \return \c STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
*/
NTSTATUS(DOKAN_CALLBACK *SetFileAttributes)(LPCWSTR FileName,
DWORD FileAttributes,
PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief SetFileTime Dokan API callback
*
* Set file attributes on a specific file
*
* \param FileName File path requested by the Kernel on the FileSystem.
* \param CreationTime Creation FILETIME.
* \param LastAccessTime LastAccess FILETIME.
* \param LastWriteTime LastWrite FILETIME.
* \param DokanFileInfo Information about the file or directory.
* \return \c STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
*/
NTSTATUS(DOKAN_CALLBACK *SetFileTime)(LPCWSTR FileName,
CONST FILETIME *CreationTime,
CONST FILETIME *LastAccessTime,
CONST FILETIME *LastWriteTime,
PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief DeleteFile Dokan API callback
*
* Check if it is possible to delete a file.
*
* DeleteFile will also be called with DOKAN_FILE_INFO.DeleteOnClose set to \c FALSE
* to notify the driver when the file is no longer requested to be deleted.
*
* You should not delete the file in DeleteFile, but instead
* you must only check whether you can delete the file or not,
* and return \c STATUS_SUCCESS (when you can delete it) or appropriate error
* codes such as \c STATUS_ACCESS_DENIED or \c STATUS_OBJECT_NAME_NOT_FOUND.
*
* When you return \c STATUS_SUCCESS, you get a Cleanup call afterwards with
* DOKAN_FILE_INFO.DeleteOnClose set to \c TRUE and only then you have to actually
* delete the file being closed
*
* \param FileName File path requested by the Kernel on the FileSystem.
* \param DokanFileInfo Information about the file or directory.
* \return \c STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
* \see DeleteDirectory
* \see Cleanup
*/
NTSTATUS(DOKAN_CALLBACK *DeleteFile)(LPCWSTR FileName,
PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief DeleteDirectory Dokan API callback
*
* Check if it is possible to delete a directory.
*
* DeleteDirectory will also be called with DOKAN_FILE_INFO.DeleteOnClose set to \c FALSE
* to notify the driver when the file is no longer requested to be deleted.
*
* You should not delete the Directory in DeleteDirectory, but instead
* you must only check whether you can delete the file or not,
* and return \c STATUS_SUCCESS (when you can delete it) or appropriate error
* codes such as \c STATUS_ACCESS_DENIED, \c STATUS_OBJECT_PATH_NOT_FOUND,
* or \c STATUS_DIRECTORY_NOT_EMPTY.
*
* When you return \c STATUS_SUCCESS, you get a Cleanup call afterwards with
* DOKAN_FILE_INFO.DeleteOnClose set to \c TRUE and only then you have to actually
* delete the file being closed
*
* \param FileName File path requested by the Kernel on the FileSystem.
* \param DokanFileInfo Information about the file or directory.
* \return \c STATUS_SUCCESS on success or \c NTSTATUS appropriate to the request result.
* \ref DeleteFile
* \ref Cleanup
*/
NTSTATUS(DOKAN_CALLBACK *DeleteDirectory)(LPCWSTR FileName,
PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief MoveFile Dokan API callback
*
* Move a file or directory to his new destination
*
* \param FileName Path to the file to move.
* \param NewFileName Path for the new location of the file
* \param ReplaceIfExisting Can replace or not if destination already exist.
* \param DokanFileInfo Information about the file or directory.
* \return \c STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
*/
NTSTATUS(DOKAN_CALLBACK *MoveFile)(LPCWSTR FileName,
LPCWSTR NewFileName,
BOOL ReplaceIfExisting,
PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief SetEndOfFile Dokan API callback
*
* SetEndOfFile is used to truncate or extend a file (physical file size).
*
* \param FileName File path requested by the Kernel on the FileSystem.
* \param ByteOffset File length to set.
* \param DokanFileInfo Information about the file or directory.
* \return \c STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
*/
NTSTATUS(DOKAN_CALLBACK *SetEndOfFile)(LPCWSTR FileName,
LONGLONG ByteOffset,
PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief SetAllocationSize Dokan API callback
*
* SetAllocationSize is used to truncate or extend a file.
*
* \param FileName File path requested by the Kernel on the FileSystem.
* \param AllocSize File length to set.
* \param DokanFileInfo Information about the file or directory.
* \return \c STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
*/
NTSTATUS(DOKAN_CALLBACK *SetAllocationSize)(LPCWSTR FileName,
LONGLONG AllocSize,
PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief LockFile Dokan API callback
*
* Lock file at a specific offset and data length.
* This is only used if \ref DOKAN_OPTION_FILELOCK_USER_MODE is enabled.
*
* \param FileName File path requested by the Kernel on the FileSystem.
* \param ByteOffset Offset from where the lock has to be proceed.
* \param Length Data length to lock.
* \param DokanFileInfo Information about the file or directory.
* \return \c STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
* \see UnlockFile
*/
NTSTATUS(DOKAN_CALLBACK *LockFile)(LPCWSTR FileName,
LONGLONG ByteOffset,
LONGLONG Length,
PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief UnlockFile Dokan API callback
*
* Unlock file at a specific offset and data length.
* This is only used if \ref DOKAN_OPTION_FILELOCK_USER_MODE is enabled.
*
* \param FileName File path requested by the Kernel on the FileSystem.
* \param ByteOffset Offset from where the lock has to be proceed.
* \param Length Data length to lock.
* \param DokanFileInfo Information about the file or directory.
* \return \c STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
* \see LockFile
*/
NTSTATUS(DOKAN_CALLBACK *UnlockFile)(LPCWSTR FileName,
LONGLONG ByteOffset,
LONGLONG Length,
PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief GetDiskFreeSpace Dokan API callback
*
* Retrieves information about the amount of space that is available on a disk volume, which is the total amount of space,
* the total amount of free space, and the total amount of free space available to the user that is associated with the calling thread.
*
* Neither GetDiskFreeSpace nor \ref GetVolumeInformation
* save the DOKAN_FILE_INFO.Context.
* Before these methods are called, \ref ZwCreateFile may not be called.
* (ditto \ref CloseFile and \ref Cleanup)
*
* \param FreeBytesAvailable Amount of available space.
* \param TotalNumberOfBytes Total size of storage space
* \param TotalNumberOfFreeBytes Amount of free space
* \param DokanFileInfo Information about the file or directory.
* \return \c STATUS_SUCCESS on success or \c NTSTATUS appropriate to the request result.
* \see <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa364937(v=vs.85).aspx"> GetDiskFreeSpaceEx function (MSDN)</a>
* \see GetVolumeInformation
*/
NTSTATUS(DOKAN_CALLBACK *GetDiskFreeSpace)(PULONGLONG FreeBytesAvailable,
PULONGLONG TotalNumberOfBytes,
PULONGLONG TotalNumberOfFreeBytes,
PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief GetVolumeInformation Dokan API callback
*
* Retrieves information about the file system and volume associated with the specified root directory.
*
* Neither GetVolumeInformation nor GetDiskFreeSpace
* save the \ref DOKAN_FILE_INFO#Context.
* Before these methods are called, \ref ZwCreateFile may not be called.
* (ditto \ref CloseFile and \ref Cleanup)
*
* \c FILE_READ_ONLY_VOLUME is automatically added to the
* FileSystemFlags if \ref DOKAN_OPTION_WRITE_PROTECT was
* specified in DOKAN_OPTIONS when the volume was mounted.
*
* \param VolumeNameBuffer A pointer to a buffer that receives the name of a specified volume.
* \param VolumeNameSize The length of a volume name buffer.
* \param VolumeSerialNumber A pointer to a variable that receives the volume serial number.
* \param MaximumComponentLength A pointer to a variable that receives the maximum length.
* \param FileSystemFlags A pointer to a variable that receives flags associated with the specified file system.
* \param FileSystemNameBuffer A pointer to a buffer that receives the name of the file system.
* \param FileSystemNameSize The length of the file system name buffer.
* \param DokanFileInfo Information about the file or directory.
* \return \c STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
* \see <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa364993(v=vs.85).aspx"> GetVolumeInformation function (MSDN)</a>
* \see GetDiskFreeSpace
*/
NTSTATUS(DOKAN_CALLBACK *GetVolumeInformation)(LPWSTR VolumeNameBuffer,
DWORD VolumeNameSize,
LPDWORD VolumeSerialNumber,
LPDWORD MaximumComponentLength,
LPDWORD FileSystemFlags,
LPWSTR FileSystemNameBuffer,
DWORD FileSystemNameSize,
PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief Mounted Dokan API callback
*
* Is called when Dokan succeed to mount the volume.
*
* \param DokanFileInfo Information about the file or directory.
* \return \c STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
* \see Unmounted
*/
NTSTATUS(DOKAN_CALLBACK *Mounted)(PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief Unmounted Dokan API callback
*
* Is called when Dokan is unmounting the volume.
*
* \param DokanFileInfo Information about the file or directory.
* \return \c STATUS_SUCCESS on success or \c NTSTATUS appropriate to the request result.
* \see Unmounted
*/
NTSTATUS(DOKAN_CALLBACK *Unmounted)(PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief GetFileSecurity Dokan API callback
*
* Get specified information about the security of a file or directory.
*
* Return \c STATUS_BUFFER_OVERFLOW if buffer size is too small.
*
* \since Supported since version 0.6.0. You must specify the version in \ref DOKAN_OPTIONS.Version.
* \param FileName File path requested by the Kernel on the FileSystem.
* \param SecurityInformation A SECURITY_INFORMATION value that identifies the security information being requested.
* \param SecurityDescriptor A pointer to a buffer that receives a copy of the security descriptor of the requested file.
* \param BufferLength Specifies the size, in bytes, of the buffer.
* \param LengthNeeded A pointer to the variable that receives the number of bytes necessary to store the complete security descriptor.
* \param DokanFileInfo Information about the file or directory.
* \return \c STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
* \see SetFileSecurity
* \see <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa446639(v=vs.85).aspx">GetFileSecurity function (MSDN)</a>
*/
NTSTATUS(DOKAN_CALLBACK *GetFileSecurity)(LPCWSTR FileName,
PSECURITY_INFORMATION SecurityInformation,
PSECURITY_DESCRIPTOR SecurityDescriptor,
ULONG BufferLength,
PULONG LengthNeeded,
PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief SetFileSecurity Dokan API callback
*
* Sets the security of a file or directory object.
*
* \since Supported since version 0.6.0. You must specify the version in \ref DOKAN_OPTIONS.Version.
* \param FileName File path requested by the Kernel on the FileSystem.
* \param SecurityInformation Structure that identifies the contents of the security descriptor pointed by \a SecurityDescriptor param.
* \param SecurityDescriptor A pointer to a SECURITY_DESCRIPTOR structure.
* \param BufferLength Specifies the size, in bytes, of the buffer.
* \param DokanFileInfo Information about the file or directory.
* \return \c STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
* \see GetFileSecurity
* \see <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa379577(v=vs.85).aspx">SetFileSecurity function (MSDN)</a>
*/
NTSTATUS(DOKAN_CALLBACK *SetFileSecurity)(LPCWSTR FileName,
PSECURITY_INFORMATION SecurityInformation,
PSECURITY_DESCRIPTOR SecurityDescriptor,
ULONG BufferLength,
PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief FindStreams Dokan API callback
*
* Retrieve all NTFS Streams informations on the file.
* This is only called if \ref DOKAN_OPTION_ALT_STREAM is enabled.
*
* \since Supported since version 0.8.0. You must specify the version in \ref DOKAN_OPTIONS.Version.
* \param FileName File path requested by the Kernel on the FileSystem.
* \param FillFindStreamData Callback that has to be called with PWIN32_FIND_STREAM_DATA that contain stream information.
* \param DokanFileInfo Information about the file or directory.
* \return \c STATUS_SUCCESS on success or NTSTATUS appropriate to the request result.
*/
NTSTATUS(DOKAN_CALLBACK *FindStreams)(LPCWSTR FileName,
PFillFindStreamData FillFindStreamData,
PDOKAN_FILE_INFO DokanFileInfo);
} DOKAN_OPERATIONS, *PDOKAN_OPERATIONS;
// clang-format on
/**
* \struct DOKAN_CONTROL
* \brief Dokan Control
*/
typedef struct _DOKAN_CONTROL {
/** File System Type */
ULONG Type;
/** Mount point. Can be "M:\" (drive letter) or "C:\mount\dokan" (path in NTFS) */
WCHAR MountPoint[MAX_PATH];
/** UNC name used for network volume */
WCHAR UNCName[64];
/** Disk Device Name */
WCHAR DeviceName[64];
/** Volume Device Object */
PVOID DeviceObject;
} DOKAN_CONTROL, *PDOKAN_CONTROL;
/**
* \defgroup DokanMainResult DokanMainResult
* \brief \ref DokanMain returns error codes
*/
/** @{ */
/** Dokan mount succeed. */
#define DOKAN_SUCCESS 0
/** Dokan mount error. */
#define DOKAN_ERROR -1
/** Dokan mount failed - Bad drive letter. */
#define DOKAN_DRIVE_LETTER_ERROR -2
/** Dokan mount failed - Can't install driver. */
#define DOKAN_DRIVER_INSTALL_ERROR -3
/** Dokan mount failed - Driver answer that something is wrong. */
#define DOKAN_START_ERROR -4
/**
* Dokan mount failed.
* Can't assign a drive letter or mount point.
* Probably already used by another volume.
*/
#define DOKAN_MOUNT_ERROR -5
/**
* Dokan mount failed.
* Mount point is invalid.
*/
#define DOKAN_MOUNT_POINT_ERROR -6
/**
* Dokan mount failed.
* Requested an incompatible version.
*/
#define DOKAN_VERSION_ERROR -7
/** @} */
/**
* \defgroup Dokan Dokan
*/
/** @{ */
/**
* \brief Mount a new Dokan Volume.
*
* This function block until the device is unmount.
* If the mount fail, it will directly return \ref DokanMainResult error.
*
* \param DokanOptions a \ref DOKAN_OPTIONS that describe the mount.
* \param DokanOperations Instance of \ref DOKAN_OPERATIONS that will be called for each request made by the kernel.
* \return \ref DokanMainResult status.
*/
int DOKANAPI DokanMain(PDOKAN_OPTIONS DokanOptions,
PDOKAN_OPERATIONS DokanOperations);
/**
* \brief Unmount a dokan device from a driver letter.
*
* \param DriveLetter Dokan driver letter to unmount.
* \return \c TRUE if device was unmount or False in case of failure or device not found.
*/
BOOL DOKANAPI DokanUnmount(WCHAR DriveLetter);
/**
* \brief Unmount a dokan device from a mount point
*
* \param MountPoint Mount point to unmount ("Z", "Z:", "Z:\", "Z:\MyMountPoint").
* \return \c TRUE if device was unmount or False in case of failure or device not found.
*/
BOOL DOKANAPI DokanRemoveMountPoint(LPCWSTR MountPoint);
/**
* \brief Unmount a dokan device from a mount point
*
* Same as \ref DokanRemoveMountPoint
* If Safe is \c TRUE, will broadcast to all desktop and Shell
* Safe should not be used during DLL_PROCESS_DETACH
*
* \see DokanRemoveMountPoint
*
* \param MountPoint Mount point to unmount ("Z", "Z:", "Z:\", "Z:\MyMountPoint").
* \param Safe Process is not in DLL_PROCESS_DETACH state.
* \return True if device was unmount or False in case of failure or device not found.
*/
BOOL DOKANAPI DokanRemoveMountPointEx(LPCWSTR MountPoint, BOOL Safe);
/**
* \brief Checks whether Name can match Expression
*
* \param Expression Expression can contain wildcard characters (? and *)
* \param Name Name to check
* \param IgnoreCase Case sensitive or not
* \return result if name match the expression
*/
BOOL DOKANAPI DokanIsNameInExpression(LPCWSTR Expression, LPCWSTR Name,
BOOL IgnoreCase);
/**
* \brief Get the version of Dokan.
* The returned ULONG is the version number without the dots.
* \return The version of Dokan
*/
ULONG DOKANAPI DokanVersion();
/**
* \brief Get the version of the Dokan driver.
* The returned ULONG is the version number without the dots.
* \return The version of Dokan driver.
*/
ULONG DOKANAPI DokanDriverVersion();
/**
* \brief Extends the time out of the current IO operation in driver.
*
* \param Timeout Extended time in milliseconds requested.
* \param DokanFileInfo \ref DOKAN_FILE_INFO of the operation to extend.
* \return If the operation was successful.
*/
BOOL DOKANAPI DokanResetTimeout(ULONG Timeout, PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief Get the handle to Access Token.
*
* This method needs be called in <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx">CreateFile</a> callback.
* The caller must call <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/ms724211(v=vs.85).aspx">CloseHandle</a>
* for the returned handle.
*
* \param DokanFileInfo \ref DOKAN_FILE_INFO of the operation to extend.
* \return A handle to the account token for the user on whose behalf the code is running.
*/
HANDLE DOKANAPI DokanOpenRequestorToken(PDOKAN_FILE_INFO DokanFileInfo);
/**
* \brief Get active Dokan mount points.
*
* \param list Allocate array of DOKAN_CONTROL.
* \param length Number of \ref DOKAN_CONTROL instance in list.
* \param uncOnly Get only instances that have UNC Name.
* \param nbRead Number of instances successfully retrieved.
* \return List retrieved or not.
*/
BOOL DOKANAPI DokanGetMountPointList(PDOKAN_CONTROL list, ULONG length,
BOOL uncOnly, PULONG nbRead);
/**
* \brief Convert \ref DOKAN_OPERATIONS.ZwCreateFile parameters to <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx">CreateFile</a> parameters.
*
* \param FileAttributes FileAttributes from \ref DOKAN_OPERATIONS.ZwCreateFile.
* \param CreateOptions CreateOptions from \ref DOKAN_OPERATIONS.ZwCreateFile.
* \param CreateDisposition CreateDisposition from \ref DOKAN_OPERATIONS.ZwCreateFile.
* \param outFileAttributesAndFlags New <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx">CreateFile</a> dwFlagsAndAttributes.
* \param outCreationDisposition New <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx">CreateFile</a> dwCreationDisposition.
* \see <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx">CreateFile function (MSDN)</a>
*/
void DOKANAPI DokanMapKernelToUserCreateFileFlags(
ULONG FileAttributes, ULONG CreateOptions, ULONG CreateDisposition,
DWORD *outFileAttributesAndFlags, DWORD *outCreationDisposition);
/**
* \brief Convert IRP_MJ_CREATE DesiredAccess to generic rights.
*
* \param DesiredAccess Standard rights to convert
* \return New DesiredAccess with generic rights.
* \see <a href="https://msdn.microsoft.com/windows/hardware/drivers/ifs/access-mask">Access Mask (MSDN)</a>
*/
ACCESS_MASK DOKANAPI DokanMapStandardToGenericAccess(ACCESS_MASK DesiredAccess);
/**
* \brief Convert WIN32 error to NTSTATUS
*
* https://support.microsoft.com/en-us/kb/113996
*
* \param Error Win32 Error to convert
* \return NTSTATUS associate to the ERROR.
*/
NTSTATUS DOKANAPI DokanNtStatusFromWin32(DWORD Error);
/** @} */
#ifdef __cplusplus
}
#endif
#endif // DOKAN_H_

File diff suppressed because it is too large Load Diff

View File

@@ -1,372 +0,0 @@
/*
Dokan : user-mode file system library for Windows
Copyright (C) 2015 - 2017 Adrien J. <liryna.stark@gmail.com> and Maxime C. <maxime@islog.com>
Copyright (C) 2007 - 2011 Hiroki Asakawa <info@dokan-dev.net>
http://dokan-dev.github.io
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License as published by the Free
Software Foundation; either version 3 of the License, or (at your option) any
later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef PUBLIC_H_
#define PUBLIC_H_
#ifndef DOKAN_MAJOR_API_VERSION
#define DOKAN_MAJOR_API_VERSION L"1"
#endif
#define DOKAN_DRIVER_VERSION 0x0000190
#define EVENT_CONTEXT_MAX_SIZE (1024 * 32)
#define IOCTL_TEST \
CTL_CODE(FILE_DEVICE_UNKNOWN, 0x800, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_SET_DEBUG_MODE \
CTL_CODE(FILE_DEVICE_UNKNOWN, 0x801, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_EVENT_WAIT \
CTL_CODE(FILE_DEVICE_UNKNOWN, 0x802, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_EVENT_INFO \
CTL_CODE(FILE_DEVICE_UNKNOWN, 0x803, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_EVENT_RELEASE \
CTL_CODE(FILE_DEVICE_UNKNOWN, 0x804, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_EVENT_START \
CTL_CODE(FILE_DEVICE_UNKNOWN, 0x805, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_EVENT_WRITE \
CTL_CODE(FILE_DEVICE_UNKNOWN, 0x806, METHOD_OUT_DIRECT, FILE_ANY_ACCESS)
#define IOCTL_KEEPALIVE \
CTL_CODE(FILE_DEVICE_UNKNOWN, 0x809, METHOD_NEITHER, FILE_ANY_ACCESS)
#define IOCTL_SERVICE_WAIT \
CTL_CODE(FILE_DEVICE_UNKNOWN, 0x80A, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_RESET_TIMEOUT \
CTL_CODE(FILE_DEVICE_UNKNOWN, 0x80B, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_GET_ACCESS_TOKEN \
CTL_CODE(FILE_DEVICE_UNKNOWN, 0x80C, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define IOCTL_EVENT_MOUNTPOINT_LIST \
CTL_CODE(FILE_DEVICE_UNKNOWN, 0x80D, METHOD_BUFFERED, FILE_ANY_ACCESS)
#define DRIVER_FUNC_INSTALL 0x01
#define DRIVER_FUNC_REMOVE 0x02
#define DOKAN_MOUNTED 1
#define DOKAN_USED 2
#define DOKAN_START_FAILED 3
#define DOKAN_DEVICE_MAX 10
#define DOKAN_DEFAULT_SECTOR_SIZE 512
#define DOKAN_DEFAULT_ALLOCATION_UNIT_SIZE 512
#define DOKAN_DEFAULT_DISK_SIZE 1024 * 1024 * 1024
// used in CCB->Flags and FCB->Flags
#define DOKAN_FILE_DIRECTORY 1
#define DOKAN_FILE_DELETED 2
#define DOKAN_FILE_OPENED 4
#define DOKAN_DIR_MATCH_ALL 8
#define DOKAN_DELETE_ON_CLOSE 16
#define DOKAN_PAGING_IO 32
#define DOKAN_SYNCHRONOUS_IO 64
#define DOKAN_WRITE_TO_END_OF_FILE 128
#define DOKAN_NOCACHE 256
// used in DOKAN_START->DeviceType
#define DOKAN_DISK_FILE_SYSTEM 0
#define DOKAN_NETWORK_FILE_SYSTEM 1
/*
* This structure is used for copying UNICODE_STRING from the kernel mode driver
* into the user mode driver.
* https://msdn.microsoft.com/en-us/library/windows/hardware/ff564879(v=vs.85).aspx
*/
typedef struct _DOKAN_UNICODE_STRING_INTERMEDIATE {
USHORT Length;
USHORT MaximumLength;
WCHAR Buffer[1];
} DOKAN_UNICODE_STRING_INTERMEDIATE, *PDOKAN_UNICODE_STRING_INTERMEDIATE;
/*
* This structure is used for copying ACCESS_STATE from the kernel mode driver
* into the user mode driver.
* https://msdn.microsoft.com/en-us/library/windows/hardware/ff538840(v=vs.85).aspx
*/
typedef struct _DOKAN_ACCESS_STATE_INTERMEDIATE {
BOOLEAN SecurityEvaluated;
BOOLEAN GenerateAudit;
BOOLEAN GenerateOnClose;
BOOLEAN AuditPrivileges;
ULONG Flags;
ACCESS_MASK RemainingDesiredAccess;
ACCESS_MASK PreviouslyGrantedAccess;
ACCESS_MASK OriginalDesiredAccess;
// Offset from the beginning of this structure to a SECURITY_DESCRIPTOR
// if 0 that means there is no security descriptor
ULONG SecurityDescriptorOffset;
// Offset from the beginning of this structure to a
// DOKAN_UNICODE_STRING_INTERMEDIATE
ULONG UnicodeStringObjectNameOffset;
// Offset from the beginning of this structure to a
// DOKAN_UNICODE_STRING_INTERMEDIATE
ULONG UnicodeStringObjectTypeOffset;
} DOKAN_ACCESS_STATE_INTERMEDIATE, *PDOKAN_ACCESS_STATE_INTERMEDIATE;
typedef struct _DOKAN_ACCESS_STATE {
BOOLEAN SecurityEvaluated;
BOOLEAN GenerateAudit;
BOOLEAN GenerateOnClose;
BOOLEAN AuditPrivileges;
ULONG Flags;
ACCESS_MASK RemainingDesiredAccess;
ACCESS_MASK PreviouslyGrantedAccess;
ACCESS_MASK OriginalDesiredAccess;
PSECURITY_DESCRIPTOR SecurityDescriptor;
UNICODE_STRING ObjectName;
UNICODE_STRING ObjectType;
} DOKAN_ACCESS_STATE, *PDOKAN_ACCESS_STATE;
/*
* This structure is used for copying IO_SECURITY_CONTEXT from the kernel mode
* driver into the user mode driver.
* https://msdn.microsoft.com/en-us/library/windows/hardware/ff550613(v=vs.85).aspx
*/
typedef struct _DOKAN_IO_SECURITY_CONTEXT_INTERMEDIATE {
DOKAN_ACCESS_STATE_INTERMEDIATE AccessState;
ACCESS_MASK DesiredAccess;
} DOKAN_IO_SECURITY_CONTEXT_INTERMEDIATE,
*PDOKAN_IO_SECURITY_CONTEXT_INTERMEDIATE;
typedef struct _DOKAN_IO_SECURITY_CONTEXT {
DOKAN_ACCESS_STATE AccessState;
ACCESS_MASK DesiredAccess;
} DOKAN_IO_SECURITY_CONTEXT, *PDOKAN_IO_SECURITY_CONTEXT;
typedef struct _CREATE_CONTEXT {
DOKAN_IO_SECURITY_CONTEXT_INTERMEDIATE SecurityContext;
ULONG FileAttributes;
ULONG CreateOptions;
ULONG ShareAccess;
ULONG FileNameLength;
// Offset from the beginning of this structure to the string
ULONG FileNameOffset;
} CREATE_CONTEXT, *PCREATE_CONTEXT;
typedef struct _CLEANUP_CONTEXT {
ULONG FileNameLength;
WCHAR FileName[1];
} CLEANUP_CONTEXT, *PCLEANUP_CONTEXT;
typedef struct _CLOSE_CONTEXT {
ULONG FileNameLength;
WCHAR FileName[1];
} CLOSE_CONTEXT, *PCLOSE_CONTEXT;
typedef struct _DIRECTORY_CONTEXT {
ULONG FileInformationClass;
ULONG FileIndex;
ULONG BufferLength;
ULONG DirectoryNameLength;
ULONG SearchPatternLength;
ULONG SearchPatternOffset;
WCHAR DirectoryName[1];
WCHAR SearchPatternBase[1];
} DIRECTORY_CONTEXT, *PDIRECTORY_CONTEXT;
typedef struct _READ_CONTEXT {
LARGE_INTEGER ByteOffset;
ULONG BufferLength;
ULONG FileNameLength;
WCHAR FileName[1];
} READ_CONTEXT, *PREAD_CONTEXT;
typedef struct _WRITE_CONTEXT {
LARGE_INTEGER ByteOffset;
ULONG BufferLength;
ULONG BufferOffset;
ULONG RequestLength;
ULONG FileNameLength;
WCHAR FileName[2];
// "2" means to keep last null of contents to write
} WRITE_CONTEXT, *PWRITE_CONTEXT;
typedef struct _FILEINFO_CONTEXT {
ULONG FileInformationClass;
ULONG BufferLength;
ULONG FileNameLength;
WCHAR FileName[1];
} FILEINFO_CONTEXT, *PFILEINFO_CONTEXT;
typedef struct _SETFILE_CONTEXT {
ULONG FileInformationClass;
ULONG BufferLength;
ULONG BufferOffset;
ULONG FileNameLength;
WCHAR FileName[1];
} SETFILE_CONTEXT, *PSETFILE_CONTEXT;
typedef struct _VOLUME_CONTEXT {
ULONG FsInformationClass;
ULONG BufferLength;
} VOLUME_CONTEXT, *PVOLUME_CONTEXT;
typedef struct _LOCK_CONTEXT {
LARGE_INTEGER ByteOffset;
LARGE_INTEGER Length;
ULONG Key;
ULONG FileNameLength;
WCHAR FileName[1];
} LOCK_CONTEXT, *PLOCK_CONTEXT;
typedef struct _FLUSH_CONTEXT {
ULONG FileNameLength;
WCHAR FileName[1];
} FLUSH_CONTEXT, *PFLUSH_CONTEXT;
typedef struct _UNMOUNT_CONTEXT {
WCHAR DeviceName[64];
ULONG Option;
} UNMOUNT_CONTEXT, *PUNMOUNT_CONTEXT;
typedef struct _SECURITY_CONTEXT {
SECURITY_INFORMATION SecurityInformation;
ULONG BufferLength;
ULONG FileNameLength;
WCHAR FileName[1];
} SECURITY_CONTEXT, *PSECURITY_CONTEXT;
typedef struct _SET_SECURITY_CONTEXT {
SECURITY_INFORMATION SecurityInformation;
ULONG BufferLength;
ULONG BufferOffset;
ULONG FileNameLength;
WCHAR FileName[1];
} SET_SECURITY_CONTEXT, *PSET_SECURITY_CONTEXT;
typedef struct _EVENT_CONTEXT {
ULONG Length;
ULONG MountId;
ULONG SerialNumber;
ULONG ProcessId;
UCHAR MajorFunction;
UCHAR MinorFunction;
ULONG Flags;
ULONG FileFlags;
ULONG64 Context;
union {
DIRECTORY_CONTEXT Directory;
READ_CONTEXT Read;
WRITE_CONTEXT Write;
FILEINFO_CONTEXT File;
CREATE_CONTEXT Create;
CLOSE_CONTEXT Close;
SETFILE_CONTEXT SetFile;
CLEANUP_CONTEXT Cleanup;
LOCK_CONTEXT Lock;
VOLUME_CONTEXT Volume;
FLUSH_CONTEXT Flush;
UNMOUNT_CONTEXT Unmount;
SECURITY_CONTEXT Security;
SET_SECURITY_CONTEXT SetSecurity;
} Operation;
} EVENT_CONTEXT, *PEVENT_CONTEXT;
#define WRITE_MAX_SIZE \
(EVENT_CONTEXT_MAX_SIZE - sizeof(EVENT_CONTEXT) - 256 * sizeof(WCHAR))
typedef struct _EVENT_INFORMATION {
ULONG SerialNumber;
NTSTATUS Status;
ULONG Flags;
union {
struct {
ULONG Index;
} Directory;
struct {
ULONG Flags;
ULONG Information;
} Create;
struct {
LARGE_INTEGER CurrentByteOffset;
} Read;
struct {
LARGE_INTEGER CurrentByteOffset;
} Write;
struct {
UCHAR DeleteOnClose;
} Delete;
struct {
ULONG Timeout;
} ResetTimeout;
struct {
HANDLE Handle;
} AccessToken;
} Operation;
ULONG64 Context;
ULONG BufferLength;
UCHAR Buffer[8];
} EVENT_INFORMATION, *PEVENT_INFORMATION;
#define DOKAN_EVENT_ALTERNATIVE_STREAM_ON 1
#define DOKAN_EVENT_WRITE_PROTECT 2
#define DOKAN_EVENT_REMOVABLE 4
#define DOKAN_EVENT_MOUNT_MANAGER 8
#define DOKAN_EVENT_CURRENT_SESSION 16
#define DOKAN_EVENT_FILELOCK_USER_MODE 32
typedef struct _EVENT_DRIVER_INFO {
ULONG DriverVersion;
ULONG Status;
ULONG DeviceNumber;
ULONG MountId;
WCHAR DeviceName[64];
} EVENT_DRIVER_INFO, *PEVENT_DRIVER_INFO;
typedef struct _EVENT_START {
ULONG UserVersion;
ULONG DeviceType;
ULONG Flags;
WCHAR MountPoint[260];
WCHAR UNCName[64];
ULONG IrpTimeout;
} EVENT_START, *PEVENT_START;
typedef struct _DOKAN_RENAME_INFORMATION {
BOOLEAN ReplaceIfExists;
ULONG FileNameLength;
WCHAR FileName[1];
} DOKAN_RENAME_INFORMATION, *PDOKAN_RENAME_INFORMATION;
typedef struct _DOKAN_LINK_INFORMATION {
BOOLEAN ReplaceIfExists;
ULONG FileNameLength;
WCHAR FileName[1];
} DOKAN_LINK_INFORMATION, *PDOKAN_LINK_INFORMATION;
#endif // PUBLIC_H_

View File

@@ -1,9 +0,0 @@
/*
This header is for compatibility with older software using FUSE.
Please use 'pkg-config --cflags fuse' to set include path. The
correct usage is still '#include <fuse.h>', not '#include
<fuse/fuse.h>'.
*/
#include "fuse/fuse.h"

View File

@@ -1,853 +0,0 @@
/*
FUSE: Filesystem in Userspace
Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
This program can be distributed under the terms of the GNU LGPLv2.
See the file COPYING.LIB.
*/
#ifndef FUSE_H_
#define FUSE_H_
/* Include Windows compatibility stuff early*/
#ifdef _WIN32
#include "fuse_win.h"
typedef struct _FILETIME FILETIME;
#else
#define FUSE_OFF_T off_t
#define FUSE_STAT stat
#endif
/* Add semaphore fix for Cygwin. TODO: think of a better workaround? */
#ifdef __CYGWIN__
#ifndef NO_CYGWIN_SEM_FIX
#include "fuse_sem_fix.h"
#endif
#endif
/** @file
*
* This file defines the library interface of FUSE
*
* IMPORTANT: you should define FUSE_USE_VERSION before including this
* header. To use the newest API define it to 26 (recommended for any
* new application), to use the old API define it to 21 (default) 22
* or 25, to use the even older 1.X API define it to 11.
* NOTE: Windows port always uses the latest FUSE version.
*/
#ifndef FUSE_USE_VERSION
#define FUSE_USE_VERSION 27
#endif
#include "fuse_common.h"
#include <fcntl.h>
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#if defined(__CYGWIN__) || defined(__MINGW32__)
#include <utime.h>
#endif
#if defined(__CYGWIN__)
#include <sys/statvfs.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* ----------------------------------------------------------- *
* Basic FUSE API *
* ----------------------------------------------------------- */
/** Handle for a FUSE filesystem */
struct fuse;
/** Structure containing a raw command */
struct fuse_cmd;
/** Function to add an entry in a readdir() operation
*
* @param buf the buffer passed to the readdir() operation
* @param name the file name of the directory entry
* @param stbuf file attributes, can be NULL
* @param off offset of the next entry or zero
* @return 1 if buffer is full, zero otherwise
*/
typedef int (*fuse_fill_dir_t) (void *buf, const char *name,
const struct FUSE_STAT *stbuf, FUSE_OFF_T off);
/* Used by deprecated getdir() method */
typedef struct fuse_dirhandle *fuse_dirh_t;
typedef int (*fuse_dirfil_t) (fuse_dirh_t h, const char *name, int type,
ino_t ino);
/**
* The file system operations:
*
* Most of these should work very similarly to the well known UNIX
* file system operations.
*
* All methods are optional, but some are essential for a useful
* filesystem (e.g. getattr). Open, flush, release, fsync, opendir,
* releasedir, fsyncdir, access, create, ftruncate, fgetattr, lock,
* init and destroy are special purpose methods, without which a full
* featured filesystem can still be implemented.
*/
struct fuse_operations {
/** Get file attributes.
*
* Similar to stat(). The 'st_dev' and 'st_blksize' fields are
* ignored. The 'st_ino' field is ignored except if the 'use_ino'
* mount option is given.
*/
int (*getattr) (const char *, struct FUSE_STAT *);
/** Read the target of a symbolic link
*
* The buffer should be filled with a null terminated string. The
* buffer size argument includes the space for the terminating
* null character. If the linkname is too long to fit in the
* buffer, it should be truncated. The return value should be 0
* for success.
*/
int (*readlink) (const char *, char *, size_t);
/* Deprecated, use readdir() instead */
int (*getdir) (const char *, fuse_dirh_t, fuse_dirfil_t);
/** Create a file node
*
* This is called for creation of all non-directory, non-symlink
* nodes. If the filesystem defines a create() method, then for
* regular files that will be called instead.
*/
int (*mknod) (const char *, mode_t, dev_t);
/** Create a directory */
int (*mkdir) (const char *, mode_t);
/** Remove a file */
int (*unlink) (const char *);
/** Remove a directory */
int (*rmdir) (const char *);
/** Create a symbolic link */
int (*symlink) (const char *, const char *);
/** Rename a file */
int (*rename) (const char *, const char *);
/** Create a hard link to a file */
int (*link) (const char *, const char *);
/** Change the permission bits of a file */
int (*chmod) (const char *, mode_t);
/** Change the owner and group of a file */
int (*chown) (const char *, uid_t, gid_t);
/** Change the size of a file */
int (*truncate) (const char *, FUSE_OFF_T);
/** Change the access and/or modification times of a file
*
* Deprecated, use utimens() instead.
*/
int (*utime) (const char *, struct utimbuf *);
/** File open operation
*
* No creation, or truncation flags (O_CREAT, O_EXCL, O_TRUNC)
* will be passed to open(). Open should check if the operation
* is permitted for the given flags. Optionally open may also
* return an arbitrary filehandle in the fuse_file_info structure,
* which will be passed to all file operations.
*
* Changed in version 2.2
*/
int (*open) (const char *, struct fuse_file_info *);
/** Read data from an open file
*
* Read should return exactly the number of bytes requested except
* on EOF or error, otherwise the rest of the data will be
* substituted with zeroes. An exception to this is when the
* 'direct_io' mount option is specified, in which case the return
* value of the read system call will reflect the return value of
* this operation.
*
* Changed in version 2.2
*/
int (*read) (const char *, char *, size_t, FUSE_OFF_T,
struct fuse_file_info *);
/** Write data to an open file
*
* Write should return exactly the number of bytes requested
* except on error. An exception to this is when the 'direct_io'
* mount option is specified (see read operation).
*
* Changed in version 2.2
*/
int (*write) (const char *, const char *, size_t, FUSE_OFF_T,
struct fuse_file_info *);
/** Get file system statistics
*
* The 'f_frsize', 'f_favail', 'f_fsid' and 'f_flag' fields are ignored
*
* Replaced 'struct statfs' parameter with 'struct statvfs' in
* version 2.5
*/
int (*statfs) (const char *, struct statvfs *);
/** Possibly flush cached data
*
* BIG NOTE: This is not equivalent to fsync(). It's not a
* request to sync dirty data.
*
* Flush is called on each close() of a file descriptor. So if a
* filesystem wants to return write errors in close() and the file
* has cached dirty data, this is a good place to write back data
* and return any errors. Since many applications ignore close()
* errors this is not always useful.
*
* NOTE: The flush() method may be called more than once for each
* open(). This happens if more than one file descriptor refers
* to an opened file due to dup(), dup2() or fork() calls. It is
* not possible to determine if a flush is final, so each flush
* should be treated equally. Multiple write-flush sequences are
* relatively rare, so this shouldn't be a problem.
*
* Filesystems shouldn't assume that flush will always be called
* after some writes, or that if will be called at all.
*
* Changed in version 2.2
*/
int (*flush) (const char *, struct fuse_file_info *);
/** Release an open file
*
* Release is called when there are no more references to an open
* file: all file descriptors are closed and all memory mappings
* are unmapped.
*
* For every open() call there will be exactly one release() call
* with the same flags and file descriptor. It is possible to
* have a file opened more than once, in which case only the last
* release will mean, that no more reads/writes will happen on the
* file. The return value of release is ignored.
*
* Changed in version 2.2
*/
int (*release) (const char *, struct fuse_file_info *);
/** Synchronize file contents
*
* If the datasync parameter is non-zero, then only the user data
* should be flushed, not the meta data.
*
* Changed in version 2.2
*/
int (*fsync) (const char *, int, struct fuse_file_info *);
/** Set extended attributes */
int (*setxattr) (const char *, const char *, const char *, size_t, int);
/** Get extended attributes */
int (*getxattr) (const char *, const char *, char *, size_t);
/** List extended attributes */
int (*listxattr) (const char *, char *, size_t);
/** Remove extended attributes */
int (*removexattr) (const char *, const char *);
/** Open directory
*
* This method should check if the open operation is permitted for
* this directory
*
* Introduced in version 2.3
*/
int (*opendir) (const char *, struct fuse_file_info *);
/** Read directory
*
* This supersedes the old getdir() interface. New applications
* should use this.
*
* The filesystem may choose between two modes of operation:
*
* 1) The readdir implementation ignores the offset parameter, and
* passes zero to the filler function's offset. The filler
* function will not return '1' (unless an error happens), so the
* whole directory is read in a single readdir operation. This
* works just like the old getdir() method.
*
* 2) The readdir implementation keeps track of the offsets of the
* directory entries. It uses the offset parameter and always
* passes non-zero offset to the filler function. When the buffer
* is full (or an error happens) the filler function will return
* '1'.
*
* Introduced in version 2.3
*/
int (*readdir) (const char *, void *, fuse_fill_dir_t, FUSE_OFF_T,
struct fuse_file_info *);
/** Release directory
*
* Introduced in version 2.3
*/
int (*releasedir) (const char *, struct fuse_file_info *);
/** Synchronize directory contents
*
* If the datasync parameter is non-zero, then only the user data
* should be flushed, not the meta data
*
* Introduced in version 2.3
*/
int (*fsyncdir) (const char *, int, struct fuse_file_info *);
/**
* Initialize filesystem
*
* The return value will passed in the private_data field of
* fuse_context to all file operations and as a parameter to the
* destroy() method.
*
* Introduced in version 2.3
* Changed in version 2.6
*/
void *(*init) (struct fuse_conn_info *conn);
/**
* Clean up filesystem
*
* Called on filesystem exit.
*
* Introduced in version 2.3
*/
void (*destroy) (void *);
/**
* Check file access permissions
*
* This will be called for the access() system call. If the
* 'default_permissions' mount option is given, this method is not
* called.
*
* This method is not called under Linux kernel versions 2.4.x
*
* Introduced in version 2.5
*/
int (*access) (const char *, int);
/**
* Create and open a file
*
* If the file does not exist, first create it with the specified
* mode, and then open it.
*
* If this method is not implemented or under Linux kernel
* versions earlier than 2.6.15, the mknod() and open() methods
* will be called instead.
*
* Introduced in version 2.5
*/
int (*create) (const char *, mode_t, struct fuse_file_info *);
/**
* Change the size of an open file
*
* This method is called instead of the truncate() method if the
* truncation was invoked from an ftruncate() system call.
*
* If this method is not implemented or under Linux kernel
* versions earlier than 2.6.15, the truncate() method will be
* called instead.
*
* Introduced in version 2.5
*/
int (*ftruncate) (const char *, FUSE_OFF_T, struct fuse_file_info *);
/**
* Get attributes from an open file
*
* This method is called instead of the getattr() method if the
* file information is available.
*
* Currently this is only called after the create() method if that
* is implemented (see above). Later it may be called for
* invocations of fstat() too.
*
* Introduced in version 2.5
*/
int (*fgetattr) (const char *, struct FUSE_STAT *, struct fuse_file_info *);
/**
* Perform POSIX file locking operation
*
* The cmd argument will be either F_GETLK, F_SETLK or F_SETLKW.
*
* For the meaning of fields in 'struct flock' see the man page
* for fcntl(2). The l_whence field will always be set to
* SEEK_SET.
*
* For checking lock ownership, the 'fuse_file_info->owner'
* argument must be used.
*
* For F_GETLK operation, the library will first check currently
* held locks, and if a conflicting lock is found it will return
* information without calling this method. This ensures, that
* for local locks the l_pid field is correctly filled in. The
* results may not be accurate in case of race conditions and in
* the presence of hard links, but it's unlikly that an
* application would rely on accurate GETLK results in these
* cases. If a conflicting lock is not found, this method will be
* called, and the filesystem may fill out l_pid by a meaningful
* value, or it may leave this field zero.
*
* For F_SETLK and F_SETLKW the l_pid field will be set to the pid
* of the process performing the locking operation.
*
* Note: if this method is not implemented, the kernel will still
* allow file locking to work locally. Hence it is only
* interesting for network filesystems and similar.
*
* Introduced in version 2.6
*/
int (*lock) (const char *, struct fuse_file_info *, int cmd,
struct flock *);
/**
* Change the access and modification times of a file with
* nanosecond resolution
*
* Introduced in version 2.6
*/
int (*utimens) (const char *, const struct timespec tv[2]);
/**
* Map block index within file to block index within device
*
* Note: This makes sense only for block device backed filesystems
* mounted with the 'blkdev' option
*
* Introduced in version 2.6
*/
int (*bmap) (const char *, size_t blocksize, uint64_t *idx);
#ifdef _WIN32
/* these to support extented windows calls */
uint32_t (*win_get_attributes) (const char *fn);
int (*win_set_attributes) (const char *fn, uint32_t attr);
int (*win_set_times) (const char *fn, struct fuse_file_info *, const FILETIME *create, const FILETIME *access, const FILETIME *modified);
#endif
};
/** Extra context that may be needed by some filesystems
*
* The uid, gid and pid fields are not filled in case of a writepage
* operation.
*/
struct fuse_context {
/** Pointer to the fuse object */
struct fuse *fuse;
/** User ID of the calling process */
uid_t uid;
/** Group ID of the calling process */
gid_t gid;
/** Thread ID of the calling process */
pid_t pid;
/** Private filesystem data */
void *private_data;
};
/**
* Main function of FUSE.
*
* This is for the lazy. This is all that has to be called from the
* main() function.
*
* This function does the following:
* - parses command line options (-d -s and -h)
* - passes relevant mount options to the fuse_mount()
* - installs signal handlers for INT, HUP, TERM and PIPE
* - registers an exit handler to unmount the filesystem on program exit
* - creates a fuse handle
* - registers the operations
* - calls either the single-threaded or the multi-threaded event loop
*
* Note: this is currently implemented as a macro.
*
* @param argc the argument counter passed to the main() function
* @param argv the argument vector passed to the main() function
* @param op the file system operation
* @param user_data user data supplied in the context during the init() method
* @return 0 on success, nonzero on failure
*/
/*
int fuse_main(int argc, char *argv[], const struct fuse_operations *op,
void *user_data);
*/
#define fuse_main(argc, argv, op, user_data) \
fuse_main_real(argc, argv, op, sizeof(*(op)), user_data)
/* ----------------------------------------------------------- *
* More detailed API *
* ----------------------------------------------------------- */
/**
* Create a new FUSE filesystem.
*
* @param ch the communication channel
* @param args argument vector
* @param op the filesystem operations
* @param op_size the size of the fuse_operations structure
* @param user_data user data supplied in the context during the init() method
* @return the created FUSE handle
*/
struct fuse *fuse_new(struct fuse_chan *ch, struct fuse_args *args,
const struct fuse_operations *op, size_t op_size,
void *user_data);
/**
* Destroy the FUSE handle.
*
* The communication channel attached to the handle is also destroyed.
*
* NOTE: This function does not unmount the filesystem. If this is
* needed, call fuse_unmount() before calling this function.
*
* @param f the FUSE handle
*/
void fuse_destroy(struct fuse *f);
/**
* FUSE event loop.
*
* Requests from the kernel are processed, and the appropriate
* operations are called.
*
* @param f the FUSE handle
* @return 0 if no error occurred, -1 otherwise
*/
int fuse_loop(struct fuse *f);
/**
* Exit from event loop
*
* @param f the FUSE handle
*/
void fuse_exit(struct fuse *f);
/**
* FUSE event loop with multiple threads
*
* Requests from the kernel are processed, and the appropriate
* operations are called. Request are processed in parallel by
* distributing them between multiple threads.
*
* Calling this function requires the pthreads library to be linked to
* the application.
*
* @param f the FUSE handle
* @return 0 if no error occurred, -1 otherwise
*/
int fuse_loop_mt(struct fuse *f);
/**
* Get the current context
*
* The context is only valid for the duration of a filesystem
* operation, and thus must not be stored and used later.
*
* @return the context
*/
struct fuse_context *fuse_get_context(void);
/**
* Check if a request has already been interrupted
*
* @return 1 if the request has been interrupted, 0 otherwise
*/
int fuse_interrupted(void);
/**
* Obsolete, doesn't do anything
*
* @return -EINVAL
*/
int fuse_invalidate(struct fuse *f, const char *path);
/* Deprecated, don't use */
int fuse_is_lib_option(const char *opt);
/**
* The real main function
*
* Do not call this directly, use fuse_main()
*/
int fuse_main_real(int argc, char *argv[], const struct fuse_operations *op,
size_t op_size, void *user_data);
/*
* Stacking API
*/
/**
* Fuse filesystem object
*
* This is opaque object represents a filesystem layer
*/
struct fuse_fs;
/*
* These functions call the relevant filesystem operation, and return
* the result.
*
* If the operation is not defined, they return -ENOSYS, with the
* exception of fuse_fs_open, fuse_fs_release, fuse_fs_opendir,
* fuse_fs_releasedir and fuse_fs_statfs, which return 0.
*/
int fuse_fs_getattr(struct fuse_fs *fs, const char *path, struct FUSE_STAT *buf);
int fuse_fs_fgetattr(struct fuse_fs *fs, const char *path, struct FUSE_STAT *buf,
struct fuse_file_info *fi);
int fuse_fs_rename(struct fuse_fs *fs, const char *oldpath,
const char *newpath);
int fuse_fs_unlink(struct fuse_fs *fs, const char *path);
int fuse_fs_rmdir(struct fuse_fs *fs, const char *path);
int fuse_fs_symlink(struct fuse_fs *fs, const char *linkname,
const char *path);
int fuse_fs_link(struct fuse_fs *fs, const char *oldpath, const char *newpath);
int fuse_fs_release(struct fuse_fs *fs, const char *path,
struct fuse_file_info *fi);
int fuse_fs_open(struct fuse_fs *fs, const char *path,
struct fuse_file_info *fi);
int fuse_fs_read(struct fuse_fs *fs, const char *path, char *buf, size_t size,
FUSE_OFF_T off, struct fuse_file_info *fi);
int fuse_fs_write(struct fuse_fs *fs, const char *path, const char *buf,
size_t size, FUSE_OFF_T off, struct fuse_file_info *fi);
int fuse_fs_fsync(struct fuse_fs *fs, const char *path, int datasync,
struct fuse_file_info *fi);
int fuse_fs_flush(struct fuse_fs *fs, const char *path,
struct fuse_file_info *fi);
int fuse_fs_statfs(struct fuse_fs *fs, const char *path, struct statvfs *buf);
int fuse_fs_opendir(struct fuse_fs *fs, const char *path,
struct fuse_file_info *fi);
int fuse_fs_readdir(struct fuse_fs *fs, const char *path, void *buf,
fuse_fill_dir_t filler, FUSE_OFF_T off,
struct fuse_file_info *fi);
int fuse_fs_fsyncdir(struct fuse_fs *fs, const char *path, int datasync,
struct fuse_file_info *fi);
int fuse_fs_releasedir(struct fuse_fs *fs, const char *path,
struct fuse_file_info *fi);
int fuse_fs_create(struct fuse_fs *fs, const char *path, mode_t mode,
struct fuse_file_info *fi);
int fuse_fs_lock(struct fuse_fs *fs, const char *path,
struct fuse_file_info *fi, int cmd, struct flock *lock);
int fuse_fs_chmod(struct fuse_fs *fs, const char *path, mode_t mode);
int fuse_fs_chown(struct fuse_fs *fs, const char *path, uid_t uid, gid_t gid);
int fuse_fs_truncate(struct fuse_fs *fs, const char *path, FUSE_OFF_T size);
int fuse_fs_ftruncate(struct fuse_fs *fs, const char *path, FUSE_OFF_T size,
struct fuse_file_info *fi);
int fuse_fs_utimens(struct fuse_fs *fs, const char *path,
const struct timespec tv[2]);
int fuse_fs_access(struct fuse_fs *fs, const char *path, int mask);
int fuse_fs_readlink(struct fuse_fs *fs, const char *path, char *buf,
size_t len);
int fuse_fs_mknod(struct fuse_fs *fs, const char *path, mode_t mode,
dev_t rdev);
int fuse_fs_mkdir(struct fuse_fs *fs, const char *path, mode_t mode);
int fuse_fs_setxattr(struct fuse_fs *fs, const char *path, const char *name,
const char *value, size_t size, int flags);
int fuse_fs_getxattr(struct fuse_fs *fs, const char *path, const char *name,
char *value, size_t size);
int fuse_fs_listxattr(struct fuse_fs *fs, const char *path, char *list,
size_t size);
int fuse_fs_removexattr(struct fuse_fs *fs, const char *path,
const char *name);
int fuse_fs_bmap(struct fuse_fs *fs, const char *path, size_t blocksize,
uint64_t *idx);
void fuse_fs_init(struct fuse_fs *fs, struct fuse_conn_info *conn);
void fuse_fs_destroy(struct fuse_fs *fs);
/**
* Create a new fuse filesystem object
*
* This is usually called from the factory of a fuse module to create
* a new instance of a filesystem.
*
* @param op the filesystem operations
* @param op_size the size of the fuse_operations structure
* @param user_data user data supplied in the context during the init() method
* @return a new filesystem object
*/
struct fuse_fs *fuse_fs_new(const struct fuse_operations *op, size_t op_size,
void *user_data);
/**
* Filesystem module
*
* Filesystem modules are registered with the FUSE_REGISTER_MODULE()
* macro.
*
* If the "-omodules=modname:..." option is present, filesystem
* objects are created and pushed onto the stack with the 'factory'
* function.
*/
struct fuse_module {
/**
* Name of filesystem
*/
const char *name;
/**
* Factory for creating filesystem objects
*
* The function may use and remove options from 'args' that belong
* to this module.
*
* For now the 'fs' vector always contains exactly one filesystem.
* This is the filesystem which will be below the newly created
* filesystem in the stack.
*
* @param args the command line arguments
* @param fs NULL terminated filesystem object vector
* @return the new filesystem object
*/
struct fuse_fs *(*factory)(struct fuse_args *args,
struct fuse_fs *fs[]);
struct fuse_module *next;
struct fusemod_so *so;
int ctr;
};
/**
* Register a filesystem module
*
* This function is used by FUSE_REGISTER_MODULE and there's usually
* no need to call it directly
*/
void fuse_register_module(struct fuse_module *mod);
/**
* Register filesystem module
*
* For the parameters, see description of the fields in 'struct
* fuse_module'
*/
#define FUSE_REGISTER_MODULE(name_, factory_) \
static __attribute__((constructor)) void name_ ## _register(void) \
{ \
static struct fuse_module mod = \
{ #name_, factory_, NULL, NULL, 0 }; \
fuse_register_module(&mod); \
}
/* ----------------------------------------------------------- *
* Advanced API for event handling, don't worry about this... *
* ----------------------------------------------------------- */
/* NOTE: the following functions are deprecated, and will be removed
from the 3.0 API. Use the lowlevel session functions instead */
/** Function type used to process commands */
typedef void (*fuse_processor_t)(struct fuse *, struct fuse_cmd *, void *);
/** This is the part of fuse_main() before the event loop */
struct fuse *fuse_setup(int argc, char *argv[],
const struct fuse_operations *op, size_t op_size,
char **mountpoint, int *multithreaded,
void *user_data);
/** This is the part of fuse_main() after the event loop */
void fuse_teardown(struct fuse *fuse, char *mountpoint);
/** Read a single command. If none are read, return NULL */
struct fuse_cmd *fuse_read_cmd(struct fuse *f);
/** Process a single command */
void fuse_process_cmd(struct fuse *f, struct fuse_cmd *cmd);
/** Multi threaded event loop, which calls the custom command
processor function */
int fuse_loop_mt_proc(struct fuse *f, fuse_processor_t proc, void *data);
/** Return the exited flag, which indicates if fuse_exit() has been
called */
int fuse_exited(struct fuse *f);
/** This function is obsolete and implemented as a no-op */
void fuse_set_getcontext_func(struct fuse_context *(*func)(void));
/** Get session from fuse object */
struct fuse_session *fuse_get_session(struct fuse *f);
/* ----------------------------------------------------------- *
* Compatibility stuff *
* ----------------------------------------------------------- */
#if FUSE_USE_VERSION < 26
# include "fuse_compat.h"
# undef fuse_main
# if FUSE_USE_VERSION == 25
# define fuse_main(argc, argv, op) \
fuse_main_real_compat25(argc, argv, op, sizeof(*(op)))
# define fuse_new fuse_new_compat25
# define fuse_setup fuse_setup_compat25
# define fuse_teardown fuse_teardown_compat22
# define fuse_operations fuse_operations_compat25
# elif FUSE_USE_VERSION == 22
# define fuse_main(argc, argv, op) \
fuse_main_real_compat22(argc, argv, op, sizeof(*(op)))
# define fuse_new fuse_new_compat22
# define fuse_setup fuse_setup_compat22
# define fuse_teardown fuse_teardown_compat22
# define fuse_operations fuse_operations_compat22
# define fuse_file_info fuse_file_info_compat
# elif FUSE_USE_VERSION == 24
# error Compatibility with high-level API version 24 not supported
# else
# define fuse_dirfil_t fuse_dirfil_t_compat
# define __fuse_read_cmd fuse_read_cmd
# define __fuse_process_cmd fuse_process_cmd
# define __fuse_loop_mt fuse_loop_mt_proc
# if FUSE_USE_VERSION == 21
# define fuse_operations fuse_operations_compat2
# define fuse_main fuse_main_compat2
# define fuse_new fuse_new_compat2
# define __fuse_setup fuse_setup_compat2
# define __fuse_teardown fuse_teardown_compat22
# define __fuse_exited fuse_exited
# define __fuse_set_getcontext_func fuse_set_getcontext_func
# else
# define fuse_statfs fuse_statfs_compat1
# define fuse_operations fuse_operations_compat1
# define fuse_main fuse_main_compat1
# define fuse_new fuse_new_compat1
# define FUSE_DEBUG FUSE_DEBUG_COMPAT1
# endif
# endif
#endif
#ifdef __cplusplus
}
#endif
#endif /* FUSE_H_ */

View File

@@ -1,249 +0,0 @@
/*
FUSE: Filesystem in Userspace
Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
This program can be distributed under the terms of the GNU LGPLv2.
See the file COPYING.LIB.
*/
/** @file */
#if !defined(FUSE_H_) && !defined(FUSE_LOWLEVEL_H_)
#error "Never include <fuse_common.h> directly; use <fuse.h> or <fuse_lowlevel.h> instead."
#endif
#ifndef FUSE_COMMON_H_
#define FUSE_COMMON_H_
#include "fuse_opt.h"
#ifndef _MSC_VER
#include <stdint.h>
#endif
/** Major version of FUSE library interface */
#define FUSE_MAJOR_VERSION 2
/** Minor version of FUSE library interface */
#define FUSE_MINOR_VERSION 7
#define FUSE_MAKE_VERSION(maj, min) ((maj) * 10 + (min))
#define FUSE_VERSION FUSE_MAKE_VERSION(FUSE_MAJOR_VERSION, FUSE_MINOR_VERSION)
/* This interface uses 64 bit off_t, except on Windows where it's
possible to use 32-bit filelengths for compatibility with MSVC CRT */
#ifndef _MSC_VER
/* This interface uses 64 bit off_t */
#if _FILE_OFFSET_BITS != 64
#error Please add -D_FILE_OFFSET_BITS=64 to your compile flags!
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
/**
* Information about open files
*
* Changed in version 2.5
*/
struct fuse_file_info {
/** Open flags. Available in open() and release() */
int flags;
/** Old file handle, don't use */
unsigned long fh_old;
/** In case of a write operation indicates if this was caused by a
writepage */
int writepage;
/** Can be filled in by open, to use direct I/O on this file.
Introduced in version 2.4 */
unsigned int direct_io : 1;
/** Can be filled in by open, to indicate, that cached file data
need not be invalidated. Introduced in version 2.4 */
unsigned int keep_cache : 1;
/** Indicates a flush operation. Set in flush operation, also
maybe set in highlevel lock operation and lowlevel release
operation. Introduced in version 2.6 */
unsigned int flush : 1;
/** Padding. Do not use*/
unsigned int padding : 29;
/** File handle. May be filled in by filesystem in open().
Available in all other file operations */
uint64_t fh;
/** Lock owner id. Available in locking operations and flush */
uint64_t lock_owner;
};
/**
* Connection information, passed to the ->init() method
*
* Some of the elements are read-write, these can be changed to
* indicate the value requested by the filesystem. The requested
* value must usually be smaller than the indicated value.
*/
struct fuse_conn_info {
/**
* Major version of the protocol (read-only)
*/
unsigned proto_major;
/**
* Minor version of the protocol (read-only)
*/
unsigned proto_minor;
/**
* Is asynchronous read supported (read-write)
*/
unsigned async_read;
/**
* Maximum size of the write buffer
*/
unsigned max_write;
/**
* Maximum readahead
*/
unsigned max_readahead;
/**
* For future use.
*/
unsigned reserved[27];
};
struct fuse_session;
struct fuse_chan;
/**
* Create a FUSE mountpoint
*
* Returns a control file descriptor suitable for passing to
* fuse_new()
*
* @param mountpoint the mount point path
* @param args argument vector
* @return the communication channel on success, NULL on failure
*/
struct fuse_chan *fuse_mount(const char *mountpoint, struct fuse_args *args);
/**
* Umount a FUSE mountpoint
*
* @param mountpoint the mount point path
* @param ch the communication channel
*/
void fuse_unmount(const char *mountpoint, struct fuse_chan *ch);
/**
* Parse common options
*
* The following options are parsed:
*
* '-f' foreground
* '-d' '-odebug' foreground, but keep the debug option
* '-s' single threaded
* '-h' '--help' help
* '-ho' help without header
* '-ofsname=..' file system name, if not present, then set to the program
* name
*
* All parameters may be NULL
*
* @param args argument vector
* @param mountpoint the returned mountpoint, should be freed after use
* @param multithreaded set to 1 unless the '-s' option is present
* @param foreground set to 1 if one of the relevant options is present
* @return 0 on success, -1 on failure
*/
int fuse_parse_cmdline(struct fuse_args *args, char **mountpoint,
int *multithreaded, int *foreground);
/**
* Go into the background
*
* @param foreground if true, stay in the foreground
* @return 0 on success, -1 on failure
*/
int fuse_daemonize(int foreground);
/**
* Get the version of the library
*
* @return the version
*/
int fuse_version(void);
/* ----------------------------------------------------------- *
* Signal handling *
* ----------------------------------------------------------- */
/**
* Exit session on HUP, TERM and INT signals and ignore PIPE signal
*
* Stores session in a global variable. May only be called once per
* process until fuse_remove_signal_handlers() is called.
*
* @param se the session to exit
* @return 0 on success, -1 on failure
*/
int fuse_set_signal_handlers(struct fuse_session *se);
/**
* Restore default signal handlers
*
* Resets global session. After this fuse_set_signal_handlers() may
* be called again.
*
* @param se the same session as given in fuse_set_signal_handlers()
*/
void fuse_remove_signal_handlers(struct fuse_session *se);
/* ----------------------------------------------------------- *
* Compatibility stuff *
* ----------------------------------------------------------- */
#if FUSE_USE_VERSION < 26
# ifdef __FreeBSD__
# if FUSE_USE_VERSION < 25
# error On FreeBSD API version 25 or greater must be used
# endif
# endif
# include "fuse_common_compat.h"
# undef FUSE_MINOR_VERSION
# undef fuse_main
# define fuse_unmount fuse_unmount_compat22
# if FUSE_USE_VERSION == 25
# define FUSE_MINOR_VERSION 5
# define fuse_mount fuse_mount_compat25
# elif FUSE_USE_VERSION == 24 || FUSE_USE_VERSION == 22
# define FUSE_MINOR_VERSION 4
# define fuse_mount fuse_mount_compat22
# elif FUSE_USE_VERSION == 21
# define FUSE_MINOR_VERSION 1
# define fuse_mount fuse_mount_compat22
# elif FUSE_USE_VERSION == 11
# warning Compatibility with API version 11 is deprecated
# undef FUSE_MAJOR_VERSION
# define FUSE_MAJOR_VERSION 1
# define FUSE_MINOR_VERSION 1
# define fuse_mount fuse_mount_compat1
# else
# error Compatibility with API version other than 21, 22, 24, 25 and 11 not supported
# endif
#endif
#ifdef __cplusplus
}
#endif
#endif /* FUSE_COMMON_H_ */

View File

@@ -1,267 +0,0 @@
/*
FUSE: Filesystem in Userspace
Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
This program can be distributed under the terms of the GNU LGPLv2.
See the file COPYING.LIB.
*/
#ifndef FUSE_OPT_H_
#define FUSE_OPT_H_
/** @file
*
* This file defines the option parsing interface of FUSE
*/
#ifdef _MSC_VER
#define STRDUP _strdup
#else
#define STRDUP strdup
#endif
#ifdef __cplusplus
extern "C" {
#endif
/**
* Option description
*
* This structure describes a single option, and and action associated
* with it, in case it matches.
*
* More than one such match may occur, in which case the action for
* each match is executed.
*
* There are three possible actions in case of a match:
*
* i) An integer (int or unsigned) variable determined by 'offset' is
* set to 'value'
*
* ii) The processing function is called, with 'value' as the key
*
* iii) An integer (any) or string (char *) variable determined by
* 'offset' is set to the value of an option parameter
*
* 'offset' should normally be either set to
*
* - 'offsetof(struct foo, member)' actions i) and iii)
*
* - -1 action ii)
*
* The 'offsetof()' macro is defined in the <stddef.h> header.
*
* The template determines which options match, and also have an
* effect on the action. Normally the action is either i) or ii), but
* if a format is present in the template, then action iii) is
* performed.
*
* The types of templates are:
*
* 1) "-x", "-foo", "--foo", "--foo-bar", etc. These match only
* themselves. Invalid values are "--" and anything beginning
* with "-o"
*
* 2) "foo", "foo-bar", etc. These match "-ofoo", "-ofoo-bar" or
* the relevant option in a comma separated option list
*
* 3) "bar=", "--foo=", etc. These are variations of 1) and 2)
* which have a parameter
*
* 4) "bar=%s", "--foo=%lu", etc. Same matching as above but perform
* action iii).
*
* 5) "-x ", etc. Matches either "-xparam" or "-x param" as
* two separate arguments
*
* 6) "-x %s", etc. Combination of 4) and 5)
*
* If the format is "%s", memory is allocated for the string unlike
* with scanf().
*/
struct fuse_opt {
/** Matching template and optional parameter formatting */
const char *templ;
/**
* Offset of variable within 'data' parameter of fuse_opt_parse()
* or -1
*/
unsigned long offset;
/**
* Value to set the variable to, or to be passed as 'key' to the
* processing function. Ignored if template has a format
*/
int value;
};
/**
* Key option. In case of a match, the processing function will be
* called with the specified key.
*/
#define FUSE_OPT_KEY(templ, key) { templ, (unsigned long)(-1), key }
/**
* Last option. An array of 'struct fuse_opt' must end with a NULL
* template value
*/
#define FUSE_OPT_END { NULL }
/**
* Argument list
*/
struct fuse_args {
/** Argument count */
int argc;
/** Argument vector. NULL terminated */
char **argv;
/** Is 'argv' allocated? */
int allocated;
};
/**
* Initializer for 'struct fuse_args'
*/
#define FUSE_ARGS_INIT(argc, argv) { argc, argv, 0 }
/**
* Key value passed to the processing function if an option did not
* match any template
*/
#define FUSE_OPT_KEY_OPT -1
/**
* Key value passed to the processing function for all non-options
*
* Non-options are the arguments beginning with a charater other than
* '-' or all arguments after the special '--' option
*/
#define FUSE_OPT_KEY_NONOPT -2
/**
* Special key value for options to keep
*
* Argument is not passed to processing function, but behave as if the
* processing function returned 1
*/
#define FUSE_OPT_KEY_KEEP -3
/**
* Special key value for options to discard
*
* Argument is not passed to processing function, but behave as if the
* processing function returned zero
*/
#define FUSE_OPT_KEY_DISCARD -4
/**
* Processing function
*
* This function is called if
* - option did not match any 'struct fuse_opt'
* - argument is a non-option
* - option did match and offset was set to -1
*
* The 'arg' parameter will always contain the whole argument or
* option including the parameter if exists. A two-argument option
* ("-x foo") is always converted to single arguemnt option of the
* form "-xfoo" before this function is called.
*
* Options of the form '-ofoo' are passed to this function without the
* '-o' prefix.
*
* The return value of this function determines whether this argument
* is to be inserted into the output argument vector, or discarded.
*
* @param data is the user data passed to the fuse_opt_parse() function
* @param arg is the whole argument or option
* @param key determines why the processing function was called
* @param outargs the current output argument list
* @return -1 on error, 0 if arg is to be discarded, 1 if arg should be kept
*/
typedef int (*fuse_opt_proc_t)(void *data, const char *arg, int key,
struct fuse_args *outargs);
/**
* Option parsing function
*
* If 'args' was returned from a previous call to fuse_opt_parse() or
* it was constructed from
*
* A NULL 'args' is equivalent to an empty argument vector
*
* A NULL 'opts' is equivalent to an 'opts' array containing a single
* end marker
*
* A NULL 'proc' is equivalent to a processing function always
* returning '1'
*
* @param args is the input and output argument list
* @param data is the user data
* @param opts is the option description array
* @param proc is the processing function
* @return -1 on error, 0 on success
*/
int fuse_opt_parse(struct fuse_args *args, void *data,
const struct fuse_opt opts[], fuse_opt_proc_t proc);
/**
* Add an option to a comma separated option list
*
* @param opts is a pointer to an option list, may point to a NULL value
* @param opt is the option to add
* @return -1 on allocation error, 0 on success
*/
int fuse_opt_add_opt(char **opts, const char *opt);
/**
* Add an argument to a NULL terminated argument vector
*
* @param args is the structure containing the current argument list
* @param arg is the new argument to add
* @return -1 on allocation error, 0 on success
*/
int fuse_opt_add_arg(struct fuse_args *args, const char *arg);
/**
* Add an argument at the specified position in a NULL terminated
* argument vector
*
* Adds the argument to the N-th position. This is useful for adding
* options at the beggining of the array which must not come after the
* special '--' option.
*
* @param args is the structure containing the current argument list
* @param pos is the position at which to add the argument
* @param arg is the new argument to add
* @return -1 on allocation error, 0 on success
*/
int fuse_opt_insert_arg(struct fuse_args *args, int pos, const char *arg);
/**
* Free the contents of argument list
*
* The structure itself is not freed
*
* @param args is the structure containing the argument list
*/
void fuse_opt_free_args(struct fuse_args *args);
/**
* Check if an option matches
*
* @param opts is the option description array
* @param opt is the option to match
* @return 1 if a match is found, 0 if not
*/
int fuse_opt_match(const struct fuse_opt opts[], const char *opt);
#ifdef __cplusplus
}
#endif
#endif /* FUSE_OPT_H_ */

View File

@@ -1,27 +0,0 @@
#ifndef FUSE_SEM_FIX_H_
#define FUSE_SEM_FIX_H_
#ifdef __CYGWIN__
#include <semaphore.h>
#ifdef __cplusplus
extern "C" {
#endif
int my_sem_init(sem_t *sem, int pshared, int initial);
int my_sem_destroy(sem_t *sem);
int my_sem_post (sem_t * sem);
int my_sem_wait (sem_t * sem);
#define sem_init my_sem_init
#define sem_destroy my_sem_destroy
#define sem_wait my_sem_wait
#define sem_post my_sem_post
#ifdef __cplusplus
};
#endif
#endif
#endif //FUSE_SEM_FIX_H_

View File

@@ -1,221 +0,0 @@
/* ----------------------------------------------------------- *
* Win32 helper functions *
* Compilation on MSVC requires /Zc:wchar_t compiler option *
* ----------------------------------------------------------- */
#ifndef FUSE_WIN_H_
#define FUSE_WIN_H_
#include <time.h>
#include <sys/types.h>
#ifdef _MSC_VER
#define WIN32_NO_STATUS
#include <windows.h>
#undef WIN32_NO_STATUS
#endif
/** Only use the latest version on Windows */
#ifndef FUSE_USE_VERSION
#define FUSE_USE_VERSION 27
#endif
#ifndef DEFAULT_FUSE_VOLUME_NAME
#define DEFAULT_FUSE_VOLUME_NAME "DOKAN"
#endif
#ifndef DEFAULT_FUSE_FILESYSTEM_NAME
#define DEFAULT_FUSE_FILESYSTEM_NAME "Dokan user-level file system"
#endif
#ifdef __cplusplus
extern "C" {
#endif
int ntstatus_error_to_errno(int win_res);
int errno_to_ntstatus_error(int err);
//This stuff is useful only on Windows in MSVC
#ifdef _MSC_VER
char** convert_args(int argc, wchar_t* argv[]);
void free_converted_args(int argc, char **argv);
#endif
#ifdef __cplusplus
};
#endif
extern wchar_t* Dokan_filesystem_name;
extern wchar_t* Dokan_volume_name;
/////////////////////////////////////////////////////////////////////
////// Type definitions for MINGW32
/////////////////////////////////////////////////////////////////////
#if defined(__MINGW32__) && !defined(UID_GID_DEF)
typedef unsigned int gid_t;
typedef unsigned int uid_t;
#endif
#if !defined(HAVE_STRUCT_TIMESPEC) && !defined(__CYGWIN__) && !defined(_TIMESPEC_DEFINED) && defined(_CRT_NO_TIME_T) /* win32 pthread.h time.h defines it */
/* POSIX.1b structure for a time value. This is like a `struct timeval' but
has nanoseconds instead of microseconds. */
#define HAVE_STRUCT_TIMESPEC 1
#define _TIMESPEC_DEFINED
struct timespec
{
time_t tv_sec; /* Seconds. */
long int tv_nsec; /* Nanoseconds. */
};
#endif
#if defined(__MINGW32__)
/** Use 64 bit offsets */
#define __USE_FILE_OFFSET64
//Block sizes
typedef unsigned __int64 fsfilcnt64_t;
typedef unsigned __int64 fsblkcnt64_t;
typedef struct timespec timestruc_t;
typedef unsigned short nlink_t;
typedef unsigned __int64 uint64_t;
typedef unsigned int blksize_t;
typedef unsigned __int64 blkcnt_t;
/** Transplanted from <sys/statvfs.h>*/
struct statvfs
{
unsigned long int f_bsize;
unsigned long int f_frsize;
fsblkcnt64_t f_blocks;
fsblkcnt64_t f_bfree;
fsblkcnt64_t f_bavail;
fsfilcnt64_t f_files;
fsfilcnt64_t f_ffree;
fsfilcnt64_t f_favail;
unsigned long int f_fsid;
unsigned long int f_flag;
unsigned long int f_namemax;
};
struct flock {
short l_type;
short l_whence;
off_t l_start;
off_t l_len;
pid_t l_pid;
};
#endif
/////////////////////////////////////////////////////////////////////
////// Type definitions for MSVC
/////////////////////////////////////////////////////////////////////
#if defined(_MSC_VER)
//UNIX compatibility
typedef struct timespec timestruc_t;
typedef unsigned int mode_t;
typedef unsigned short nlink_t;
typedef unsigned int pid_t;
typedef unsigned int gid_t;
typedef unsigned int uid_t;
typedef unsigned int blksize_t;
typedef unsigned __int64 blkcnt_t;
typedef unsigned int uint32_t;
typedef unsigned __int64 uint64_t;
typedef __int64 int64_t;
//OCTAL constants!
#define S_IFLNK 0120000
#define S_ISLNK(m) (((m)&S_IFMT) == S_IFLNK)
/** Use 64 bit offsets */
#define __USE_FILE_OFFSET64
//Block sizes
typedef unsigned __int64 fsfilcnt64_t;
typedef unsigned __int64 fsblkcnt64_t;
/** Transplanted from <sys/statvfs.h>*/
struct statvfs
{
unsigned long int f_bsize;
unsigned long int f_frsize;
fsblkcnt64_t f_blocks;
fsblkcnt64_t f_bfree;
fsblkcnt64_t f_bavail;
fsfilcnt64_t f_files;
fsfilcnt64_t f_ffree;
fsfilcnt64_t f_favail;
unsigned long int f_fsid;
unsigned long int f_flag;
unsigned long int f_namemax;
};
struct flock {
short l_type;
short l_whence;
__int64 l_start;
__int64 l_len;
pid_t l_pid;
};
#endif
//We have a choice between CRT-compatible 32-bit off_t definition
//and a custom 64-bit definition
#define WIDE_OFF_T 1
#ifndef WIDE_OFF_T
#define FUSE_OFF_T off_t
#define FUSE_STAT stat
#else
#define FUSE_OFF_T __int64
// #define FUSE_STAT _stati64
// use stat from cygwin instead for having more members and
// being more compatible
// stat ported from cygwin sys/stat.h
struct stat64_cygwin
{
dev_t st_dev;
uint64_t st_ino;
mode_t st_mode;
nlink_t st_nlink;
uid_t st_uid;
gid_t st_gid;
dev_t st_rdev;
FUSE_OFF_T st_size;
timestruc_t st_atim;
timestruc_t st_mtim;
timestruc_t st_ctim;
blksize_t st_blksize;
blkcnt_t st_blocks;
timestruc_t st_birthtim;
};
/* The following breaks struct stat definiton in native Windows stats.h
* So whenever referencing st_atime|st_ctime|st_mtime, replacing is needed.
*/
/*
#define st_atime st_atim.tv_sec
#define st_ctime st_ctim.tv_sec
#define st_mtime st_mtim.tv_sec
*/
#define FUSE_STAT stat64_cygwin
#if 0
struct stat64 {
dev_t st_dev;
ino_t st_ino;
unsigned short st_mode;
short st_nlink;
short st_uid;
short st_gid;
dev_t st_rdev;
FUSE_OFF_T st_size;
time_t st_atime;
time_t st_mtime;
time_t st_ctime;
};
#endif
#endif
#define F_WRLCK 1
#define F_UNLCK 2
#define F_SETLK 6
#endif // FUSE_WIN_H_

View File

@@ -1,64 +0,0 @@
#ifndef UTILS_H_
#define UTILS_H_
#ifdef __cplusplus
#include <string>
#endif
#include <sys/stat.h>
#include "fuse.h"
#ifdef __cplusplus
extern "C" {
#endif
void utf8_to_wchar_buf_old(const char *src, wchar_t *res, int maxlen);
void utf8_to_wchar_buf(const char *src, wchar_t *res, int maxlen);
FILETIME unixTimeToFiletime(time_t t);
time_t filetimeToUnixTime(const FILETIME *ft);
bool is_filetime_set(const FILETIME *ft);
#ifdef __cplusplus
}
std::string wchar_to_utf8_cstr(const wchar_t *str);
std::string unixify(const std::string &str);
std::string extract_file_name(const std::string &str);
std::string extract_dir_name(const std::string &str);
template<class T> void convertStatlikeBuf(const struct FUSE_STAT *stbuf, const std::string &name,
T * find_data)
{
if (stbuf==nullptr) return;
if ((stbuf->st_mode&S_IFDIR)==S_IFDIR)
find_data->dwFileAttributes=FILE_ATTRIBUTE_DIRECTORY;
else
find_data->dwFileAttributes=FILE_ATTRIBUTE_NORMAL;
#ifndef WIDE_OFF_T
find_data->nFileSizeLow=stbuf->st_size;
#else
//Support 64 sizes
find_data->nFileSizeLow=static_cast<DWORD>(stbuf->st_size);
find_data->nFileSizeHigh=stbuf->st_size>>32;
#endif
if (stbuf->st_ctim.tv_sec!=0)
find_data->ftCreationTime=unixTimeToFiletime(stbuf->st_ctim.tv_sec);
if (stbuf->st_atim.tv_sec!=0)
find_data->ftLastAccessTime=unixTimeToFiletime(stbuf->st_atim.tv_sec);
if (stbuf->st_mtim.tv_sec!=0)
find_data->ftLastWriteTime=unixTimeToFiletime(stbuf->st_mtim.tv_sec);
//Partial support for read-only files - currently done for a files without write permission only
if (!(stbuf->st_mode&0222))
find_data->dwFileAttributes|=FILE_ATTRIBUTE_READONLY;
//TODO: add full support for read-only files - try to derive it from file's owner?
std::string fname=extract_file_name(name);
if (!fname.empty() && fname.at(0)=='.') //UNIX hidden files
find_data->dwFileAttributes|=FILE_ATTRIBUTE_HIDDEN;
}
#endif // __cplusplus
#endif // UTILS_H_

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,165 +0,0 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View File

@@ -1,20 +0,0 @@
Copyright (C) 2015 - 2017 Adrien J. <liryna.stark@gmail.com> and Maxime C. <maxime@islog.com>
Copyright (C) 2007 - 2011 Hiroki Asakawa <info@dokan-dev.net>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

View File

@@ -1,424 +0,0 @@
/*
FUSE: Filesystem in Userspace
Copyright (C) 2001-2007 Miklos Szeredi <miklos@szeredi.hu>
Copyright (C) 2011 Sebastian Pipping <sebastian@pipping.org>
This program can be distributed under the terms of the GNU GPL.
See the file COPYING.
*/
/** @file
* @tableofcontents
*
* fusexmp.c - FUSE: Filesystem in Userspace
*
* \section section_compile compiling this example
*
* gcc -Wall fusexmp.c `pkg-config fuse3 --cflags --libs` -o fusexmp
*
* \section section_source the complete source
* \include fusexmp.c
*/
#define FUSE_USE_VERSION 30
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#ifdef linux
/* For pread()/pwrite()/utimensat() */
#define _XOPEN_SOURCE 700
#endif
#include <fuse.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/stat.h>
#include <dirent.h>
#include <errno.h>
#include <sys/time.h>
#ifdef HAVE_SETXATTR
#include <sys/xattr.h>
#endif
static int xmp_getattr(const char *path, struct stat *stbuf)
{
int res;
res = lstat(path, stbuf);
if (res == -1)
return -errno;
return 0;
}
static int xmp_access(const char *path, int mask)
{
int res;
res = access(path, mask);
if (res == -1)
return -errno;
return 0;
}
static int xmp_readlink(const char *path, char *buf, size_t size)
{
int res;
res = readlink(path, buf, size - 1);
if (res == -1)
return -errno;
buf[res] = '\0';
return 0;
}
static int xmp_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
off_t offset, struct fuse_file_info *fi)
{
DIR *dp;
struct dirent *de;
(void) offset;
(void) fi;
dp = opendir(path);
if (dp == NULL)
return -errno;
while ((de = readdir(dp)) != NULL) {
struct stat st;
memset(&st, 0, sizeof(st));
st.st_ino = de->d_ino;
st.st_mode = de->d_type << 12;
if (filler(buf, de->d_name, &st, 0))
break;
}
closedir(dp);
return 0;
}
static int xmp_mknod(const char *path, mode_t mode, dev_t rdev)
{
int res;
/* On Linux this could just be 'mknod(path, mode, rdev)' but this
is more portable */
if (S_ISREG(mode)) {
res = open(path, O_CREAT | O_EXCL | O_WRONLY, mode);
if (res >= 0)
res = close(res);
} else if (S_ISFIFO(mode))
res = mkfifo(path, mode);
else
res = mknod(path, mode, rdev);
if (res == -1)
return -errno;
return 0;
}
static int xmp_mkdir(const char *path, mode_t mode)
{
int res;
res = mkdir(path, mode);
if (res == -1)
return -errno;
return 0;
}
static int xmp_unlink(const char *path)
{
int res;
res = unlink(path);
if (res == -1)
return -errno;
return 0;
}
static int xmp_rmdir(const char *path)
{
int res;
res = rmdir(path);
if (res == -1)
return -errno;
return 0;
}
static int xmp_symlink(const char *from, const char *to)
{
int res;
res = symlink(from, to);
if (res == -1)
return -errno;
return 0;
}
static int xmp_rename(const char *from, const char *to)
{
int res;
res = rename(from, to);
if (res == -1)
return -errno;
return 0;
}
static int xmp_link(const char *from, const char *to)
{
int res;
res = link(from, to);
if (res == -1)
return -errno;
return 0;
}
static int xmp_chmod(const char *path, mode_t mode)
{
int res;
res = chmod(path, mode);
if (res == -1)
return -errno;
return 0;
}
static int xmp_chown(const char *path, uid_t uid, gid_t gid)
{
int res;
res = lchown(path, uid, gid);
if (res == -1)
return -errno;
return 0;
}
static int xmp_truncate(const char *path, off_t size)
{
int res;
res = truncate(path, size);
if (res == -1)
return -errno;
return 0;
}
#ifdef HAVE_UTIMENSAT
static int xmp_utimens(const char *path, const struct timespec ts[2])
{
int res;
/* don't use utime/utimes since they follow symlinks */
res = utimensat(0, path, ts, AT_SYMLINK_NOFOLLOW);
if (res == -1)
return -errno;
return 0;
}
#endif
static int xmp_open(const char *path, struct fuse_file_info *fi)
{
int res;
res = open(path, fi->flags);
if (res == -1)
return -errno;
close(res);
return 0;
}
static int xmp_read(const char *path, char *buf, size_t size, off_t offset,
struct fuse_file_info *fi)
{
int fd;
int res;
(void) fi;
fd = open(path, O_RDONLY);
if (fd == -1)
return -errno;
res = pread(fd, buf, size, offset);
if (res == -1)
res = -errno;
close(fd);
return res;
}
static int xmp_write(const char *path, const char *buf, size_t size,
off_t offset, struct fuse_file_info *fi)
{
int fd;
int res;
(void) fi;
fd = open(path, O_WRONLY);
if (fd == -1)
return -errno;
res = pwrite(fd, buf, size, offset);
if (res == -1)
res = -errno;
close(fd);
return res;
}
static int xmp_statfs(const char *path, struct statvfs *stbuf)
{
int res;
res = statvfs(path, stbuf);
if (res == -1)
return -errno;
return 0;
}
static int xmp_release(const char *path, struct fuse_file_info *fi)
{
/* Just a stub. This method is optional and can safely be left
unimplemented */
(void) path;
(void) fi;
return 0;
}
static int xmp_fsync(const char *path, int isdatasync,
struct fuse_file_info *fi)
{
/* Just a stub. This method is optional and can safely be left
unimplemented */
(void) path;
(void) isdatasync;
(void) fi;
return 0;
}
#ifdef HAVE_POSIX_FALLOCATE
static int xmp_fallocate(const char *path, int mode,
off_t offset, off_t length, struct fuse_file_info *fi)
{
int fd;
int res;
(void) fi;
if (mode)
return -EOPNOTSUPP;
fd = open(path, O_WRONLY);
if (fd == -1)
return -errno;
res = -posix_fallocate(fd, offset, length);
close(fd);
return res;
}
#endif
#ifdef HAVE_SETXATTR
/* xattr operations are optional and can safely be left unimplemented */
static int xmp_setxattr(const char *path, const char *name, const char *value,
size_t size, int flags)
{
int res = lsetxattr(path, name, value, size, flags);
if (res == -1)
return -errno;
return 0;
}
static int xmp_getxattr(const char *path, const char *name, char *value,
size_t size)
{
int res = lgetxattr(path, name, value, size);
if (res == -1)
return -errno;
return res;
}
static int xmp_listxattr(const char *path, char *list, size_t size)
{
int res = llistxattr(path, list, size);
if (res == -1)
return -errno;
return res;
}
static int xmp_removexattr(const char *path, const char *name)
{
int res = lremovexattr(path, name);
if (res == -1)
return -errno;
return 0;
}
#endif /* HAVE_SETXATTR */
static struct fuse_operations xmp_oper = {
.getattr = xmp_getattr,
.access = xmp_access,
.readlink = xmp_readlink,
.readdir = xmp_readdir,
.mknod = xmp_mknod,
.mkdir = xmp_mkdir,
.symlink = xmp_symlink,
.unlink = xmp_unlink,
.rmdir = xmp_rmdir,
.rename = xmp_rename,
.link = xmp_link,
.chmod = xmp_chmod,
.chown = xmp_chown,
.truncate = xmp_truncate,
#ifdef HAVE_UTIMENSAT
.utimens = xmp_utimens,
#endif
.open = xmp_open,
.read = xmp_read,
.write = xmp_write,
.statfs = xmp_statfs,
.release = xmp_release,
.fsync = xmp_fsync,
#ifdef HAVE_POSIX_FALLOCATE
.fallocate = xmp_fallocate,
#endif
#ifdef HAVE_SETXATTR
.setxattr = xmp_setxattr,
.getxattr = xmp_getxattr,
.listxattr = xmp_listxattr,
.removexattr = xmp_removexattr,
#endif
};
int main(int argc, char *argv[])
{
umask(0);
return fuse_main(argc, argv, &xmp_oper, NULL);
}

View File

@@ -1,28 +0,0 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "dokan_mirror", "dokan_mirror.vcxproj", "{DADCBCAD-4429-422E-9FA9-D8E538D0EF94}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DADCBCAD-4429-422E-9FA9-D8E538D0EF94}.Debug|x64.ActiveCfg = Debug|x64
{DADCBCAD-4429-422E-9FA9-D8E538D0EF94}.Debug|x64.Build.0 = Debug|x64
{DADCBCAD-4429-422E-9FA9-D8E538D0EF94}.Debug|x86.ActiveCfg = Debug|Win32
{DADCBCAD-4429-422E-9FA9-D8E538D0EF94}.Debug|x86.Build.0 = Debug|Win32
{DADCBCAD-4429-422E-9FA9-D8E538D0EF94}.Release|x64.ActiveCfg = Release|x64
{DADCBCAD-4429-422E-9FA9-D8E538D0EF94}.Release|x64.Build.0 = Release|x64
{DADCBCAD-4429-422E-9FA9-D8E538D0EF94}.Release|x86.ActiveCfg = Release|Win32
{DADCBCAD-4429-422E-9FA9-D8E538D0EF94}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@@ -1,179 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{DADCBCAD-4429-422E-9FA9-D8E538D0EF94}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>mirror</RootNamespace>
<WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<TargetName>mirror</TargetName>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<TargetName>mirror</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<TargetName>mirror</TargetName>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<TargetName>mirror</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalIncludeDirectories>../../sys;</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>../debug</AdditionalLibraryDirectories>
<UACExecutionLevel>AsInvoker</UACExecutionLevel>
<AdditionalDependencies>ntdll.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
<AdditionalIncludeDirectories>../../sys;</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>../debug</AdditionalLibraryDirectories>
<UACExecutionLevel>AsInvoker</UACExecutionLevel>
<AdditionalDependencies>ntdll.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../../sys;</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<UACExecutionLevel>AsInvoker</UACExecutionLevel>
<AdditionalDependencies>ntdll.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../../sys;</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<UACExecutionLevel>AsInvoker</UACExecutionLevel>
<AdditionalDependencies>ntdll.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="mirror.c" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\dokan\dokan.vcxproj">
<Project>{f25ba22f-2ab8-4859-9b89-8fe1e774b472}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.