35#if (defined(HAVE_DIRFD) || (HAVE_DECL_DIRFD == 1))
36#define DIRFD(a) (dirfd(a))
38#define DIRFD(a) ((a)->DIR_FD_MEMBER_NAME)
43#if (defined(HAVE_MNTENT_H) && defined(HAVE_SETMNTENT))
45#define MNTENT_PATH "/etc/mtab"
53#ifdef HAVE_SYS_STATVFS_H
54#include <sys/statvfs.h>
57#ifdef HAVE_SYS_STATFS_H
58#include <sys/statfs.h>
61#ifdef HAVE_SYS_PARAM_H
65#ifdef HAVE_SYS_MOUNT_H
71#ifdef STAT_STATFS3_OSF1
72#define STATFS_FN(path, buf) (statfs(path,buf,sizeof(buf)))
73#define STATFS_T statfs
78#define STATFS_FN(path, buf) (statvfs(path,buf))
79#define STATFS_T statvfs
84#define STATFS_FN(path, buf) (statvfs64(path,buf))
85#define STATFS_T statvfs64
89#if (defined(STAT_STATFS2_FS_DATA) || defined(STAT_STATFS2_BSIZE) || defined(STAT_STATFS2_FSIZE))
90#define STATFS_FN(path, buf) (statfs(path,buf))
91#define STATFS_T statfs
96#define STATFS_FN(path, buf) (statfs(path,buf,sizeof(buf),0))
97#define STATFS_T statfs
101#if ((defined(USE_STATFS) && defined(HAVE_STRUCT_STATFS_F_NAMEMAX)) || (defined(USE_STATVFS) && defined(HAVE_STRUCT_STATVFS_F_NAMEMAX)))
102#define F_NAMELEN(buf) ((buf).f_namemax)
105#if ((defined(USE_STATFS) && defined(HAVE_STRUCT_STATFS_F_NAMELEN)) || (defined(USE_STATVFS) && defined(HAVE_STRUCT_STATVFS_F_NAMELEN)))
106#define F_NAMELEN(buf) ((buf).f_namelen)
110#define F_NAMELEN(buf) (255)
127 buf->f_blocks = 262144;
128 buf->f_bfree = 131072;
130 buf->f_namelen = 255;
131 buf->f_namemax = 255;
136#define STATFS_T dummy_statfs_t
137#define STATFS_FN(path,buf) (dummy_statfs(buf))
168 unsigned long long ticks;
170 ticks = (seconds + 11644473600LL) * 10000000;
172 *high = (
uint32) (ticks >> 32);
179 unsigned long long ticks;
182 ticks = low + (((
unsigned long long) high) << 32);
184 ticks -= 11644473600LL;
199 static const char zero = 0;
321 This->rdpdr_device[*
id].name);
324 strcpy(
This->rdpdr_device[*
id].local_path, pos2);
343 struct stat filestat;
354 switch (create_disposition)
474 if (
handle >= MAX_OPEN_FILES)
476 error(
"Maximum number of open files (%s) reached. Increase MAX_OPEN_FILES!\n",
487 This->fileinfo[
handle].flags_and_attributes = flags_and_attributes;
488 This->fileinfo[
handle].accessmask = accessmask;
614 uint32 file_attributes, ft_high, ft_low;
615 struct stat filestat;
637 if (!file_attributes)
695 uint32 length, file_attributes, ft_high, ft_low, delete_on_close;
699 struct stat filestat;
700 time_t write_time, change_time, access_time, mod_time;
710 write_time = change_time = access_time = 0;
722 if (ft_low || ft_high)
728 if (ft_low || ft_high)
734 if (ft_low || ft_high)
748 if (write_time || change_time)
749 mod_time =
MIN(write_time, change_time);
751 mod_time = write_time ? write_time : change_time;
757 if (access_time || write_time || change_time)
760 printf(
"FileBasicInformation access time %s",
762 printf(
"FileBasicInformation modification time %s",
769 if (!file_attributes)
781 printf(
"FileBasicInformation set access mode 0%o",
mode);
827 if (delete_on_close ||
849 if (stat_fs.f_bfree * stat_fs.f_bsize <
length)
939 p->modify_time =
buf.st_mtime;
940 p->status_time =
buf.st_ctime;
963 p->total_time += (
buf.st_mtime +
buf.st_ctime);
989 fdfs = setmntent(MNTENT_PATH,
"r");
993 while ((
e = getmntent(fdfs)))
999 if (
strstr(
e->mnt_opts,
"vfat") ||
strstr(
e->mnt_opts,
"iso9660"))
1004 unsigned char buf[512];
1006 if (
strstr(
e->mnt_opts,
"vfat"))
1012 (
buf[42] << 24) + (
buf[41] << 16) +
1013 (
buf[40] << 8) +
buf[39];
1015 info.label[10] =
'\0';
1021 info.label[32] =
'\0';
1109 uint32 file_attributes, ft_low, ft_high;
1119 file_attributes = 0;
1164 if (
pdirent->d_name[0] ==
'.')
1166 if (!file_attributes)
int strcmp(const char *String1, const char *String2)
char * strstr(char *String1, char *String2)
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
ACPI_SIZE strlen(const char *String)
char * strcpy(char *DstString, const char *SrcString)
char * strncpy(char *DstString, const char *SrcString, ACPI_SIZE Count)
#define FILE_DIRECTORY_FILE
#define FILE_NON_DIRECTORY_FILE
#define RDPDR_MAX_DEVICES
#define FILE_COMPLETE_IF_OPLOCKED
#define FILE_DELETE_ON_CLOSE
#define out_uint32_le(s, v)
#define in_uint32_le(s, v)
RD_BOOL str_startswith(const char *s, const char *prefix)
void convert_to_unix_filename(char *filename)
RD_BOOL rdpdr_abort_io(uint32 fd, uint32 major, RD_NTSTATUS status)
char * next_arg(char *src, char needle)
void rdp_in_unistr(STREAM s, int in_len, char **string, uint32 *str_size)
void unimpl(char *format,...)
void rdp_out_unistr(STREAM s, char *string, int len)
#define FILE_ATTRIBUTE_NORMAL
@ FileEndOfFileInformation
@ FileObjectIdInformation
@ FileAllocationInformation
@ FileDispositionInformation
@ FileBothDirectoryInformation
@ FileFsControlInformation
@ FileFsDeviceInformation
@ FileFsAttributeInformation
@ FileFsVolumeInformation
@ FileFsMaximumInformation
GLuint GLuint GLsizei GLenum type
GLuint GLuint GLsizei count
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
int __cdecl closedir(DIR *)
DIR *__cdecl opendir(const char *)
void __cdecl rewinddir(DIR *)
struct dirent *__cdecl readdir(DIR *)
_CRTIMP void __cdecl perror(_In_opt_z_ const char *_ErrMsg)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
int ftruncate(int, off_t)
__cdecl __MINGW_NOTHROW char * dirname(char *)
#define memcpy(s1, s2, n)
static void seconds_since_1970_to_filetime(time_t seconds, uint32 *high, uint32 *low)
NTSTATUS disk_set_information(RDPCLIENT *This, NTHANDLE handle, uint32 info_class, STREAM in, STREAM out)
static int ftruncate_growable(int fd, off_t length)
NTSTATUS disk_query_directory(RDPCLIENT *This, NTHANDLE handle, uint32 info_class, char *pattern, STREAM out)
static NTSTATUS disk_write(RDPCLIENT *This, NTHANDLE handle, uint8 *data, uint32 length, uint32 offset, uint32 *result)
static NTSTATUS disk_close(RDPCLIENT *This, NTHANDLE handle)
static time_t get_create_time(struct stat *st)
NTSTATUS disk_check_notify(RDPCLIENT *This, NTHANDLE handle)
NTSTATUS disk_create_notify(RDPCLIENT *This, NTHANDLE handle, uint32 info_class)
static time_t convert_1970_to_filetime(uint32 high, uint32 low)
static NTSTATUS disk_create(RDPCLIENT *This, uint32 device_id, uint32 accessmask, uint32 sharemode, uint32 create_disposition, uint32 flags_and_attributes, char *filename, NTHANDLE *phandle)
static FsInfoType * FsVolumeInfo(char *fpath)
static NTSTATUS disk_read(RDPCLIENT *This, NTHANDLE handle, uint8 *data, uint32 length, uint32 offset, uint32 *result)
static NTSTATUS disk_device_control(RDPCLIENT *This, NTHANDLE handle, uint32 request, STREAM in, STREAM out)
static int dummy_statfs(struct dummy_statfs_t *buf)
#define STATFS_FN(path, buf)
static int open_weak_exclusive(const char *pathname, int flags, mode_t mode)
NTSTATUS disk_query_volume_information(RDPCLIENT *This, NTHANDLE handle, uint32 info_class, STREAM out)
NTSTATUS disk_query_information(RDPCLIENT *This, NTHANDLE handle, uint32 info_class, STREAM out)
int disk_enum_devices(RDPCLIENT *This, uint32 *id, char *optarg)
#define TRUNCATE_EXISTING
#define FS_CASE_SENSITIVE
#define FS_CASE_IS_PRESERVED
#define sprintf(buf, format,...)
static const WCHAR label[]
static PIO_STATUS_BLOCK void ULONG FS_INFORMATION_CLASS info_class
#define FILE_ATTRIBUTE_READONLY
#define FILE_ATTRIBUTE_HIDDEN
#define FILE_ATTRIBUTE_DIRECTORY
#define FileFsFullSizeInformation
#define FileFsObjectIdInformation
#define STATUS_INVALID_HANDLE
#define STATUS_NOT_IMPLEMENTED
#define STATUS_NOTIFY_ENUM_DIR
#define FileStandardInformation
_Check_return_ int __cdecl rename(_In_z_ const char *_OldFilename, _In_z_ const char *_NewFilename)
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
structure for maintaining informations about one notification icon
#define STATUS_INVALID_DEVICE_REQUEST
#define STATUS_FILE_IS_A_DIRECTORY
#define STATUS_ACCESS_DENIED
#define STATUS_INVALID_PARAMETER
#define STATUS_NO_SUCH_FILE
#define STATUS_OBJECT_NAME_COLLISION
#define STATUS_NO_MORE_FILES