27 |
#include <dirent.h> /* opendir, closedir, readdir */ |
#include <dirent.h> /* opendir, closedir, readdir */ |
28 |
#include <fnmatch.h> |
#include <fnmatch.h> |
29 |
#include <errno.h> /* errno */ |
#include <errno.h> /* errno */ |
30 |
|
#include <stdio.h> |
31 |
|
|
32 |
#include <utime.h> |
#include <utime.h> |
33 |
#include <time.h> /* ctime */ |
#include <time.h> /* ctime */ |
121 |
int f_namemax; |
int f_namemax; |
122 |
}; |
}; |
123 |
|
|
124 |
int dummy_statfs(struct dummy_statfs_t *buf) |
static int |
125 |
|
dummy_statfs(struct dummy_statfs_t *buf) |
126 |
{ |
{ |
127 |
buf->f_blocks=262144; |
buf->f_blocks = 262144; |
128 |
buf->f_bfree=131072; |
buf->f_bfree = 131072; |
129 |
buf->f_bsize=512; |
buf->f_bsize = 512; |
130 |
buf->f_namelen=255; |
buf->f_namelen = 255; |
131 |
buf->f_namemax=255; |
buf->f_namemax = 255; |
132 |
|
|
133 |
return 0; |
return 0; |
134 |
} |
} |
144 |
|
|
145 |
typedef struct |
typedef struct |
146 |
{ |
{ |
147 |
char name[256]; |
char name[PATH_MAX]; |
148 |
char label[256]; |
char label[PATH_MAX]; |
149 |
unsigned long serial; |
unsigned long serial; |
150 |
char type[256]; |
char type[PATH_MAX]; |
151 |
} FsInfoType; |
} FsInfoType; |
152 |
|
|
153 |
static NTSTATUS NotifyInfo(NTHANDLE handle, uint32 info_class, NOTIFY * p); |
static NTSTATUS NotifyInfo(NTHANDLE handle, uint32 info_class, NOTIFY * p); |
344 |
NTHANDLE handle; |
NTHANDLE handle; |
345 |
DIR *dirp; |
DIR *dirp; |
346 |
int flags, mode; |
int flags, mode; |
347 |
char path[256]; |
char path[PATH_MAX]; |
348 |
struct stat filestat; |
struct stat filestat; |
349 |
|
|
350 |
handle = 0; |
handle = 0; |
491 |
g_fileinfo[handle].device_id = device_id; |
g_fileinfo[handle].device_id = device_id; |
492 |
g_fileinfo[handle].flags_and_attributes = flags_and_attributes; |
g_fileinfo[handle].flags_and_attributes = flags_and_attributes; |
493 |
g_fileinfo[handle].accessmask = accessmask; |
g_fileinfo[handle].accessmask = accessmask; |
494 |
strncpy(g_fileinfo[handle].path, path, 255); |
strncpy(g_fileinfo[handle].path, path, PATH_MAX-1); |
495 |
g_fileinfo[handle].delete_on_close = False; |
g_fileinfo[handle].delete_on_close = False; |
496 |
g_notify_stamp = True; |
g_notify_stamp = True; |
497 |
|
|
698 |
disk_set_information(NTHANDLE handle, uint32 info_class, STREAM in, STREAM out) |
disk_set_information(NTHANDLE handle, uint32 info_class, STREAM in, STREAM out) |
699 |
{ |
{ |
700 |
uint32 length, file_attributes, ft_high, ft_low, delete_on_close; |
uint32 length, file_attributes, ft_high, ft_low, delete_on_close; |
701 |
char newname[256], fullpath[256]; |
char newname[PATH_MAX], fullpath[PATH_MAX]; |
702 |
struct fileinfo *pfinfo; |
struct fileinfo *pfinfo; |
703 |
int mode; |
int mode; |
704 |
struct stat filestat; |
struct stat filestat; |
1112 |
disk_query_directory(NTHANDLE handle, uint32 info_class, char *pattern, STREAM out) |
disk_query_directory(NTHANDLE handle, uint32 info_class, char *pattern, STREAM out) |
1113 |
{ |
{ |
1114 |
uint32 file_attributes, ft_low, ft_high; |
uint32 file_attributes, ft_low, ft_high; |
1115 |
char *dirname, fullpath[256]; |
char *dirname, fullpath[PATH_MAX]; |
1116 |
DIR *pdir; |
DIR *pdir; |
1117 |
struct dirent *pdirent; |
struct dirent *pdirent; |
1118 |
struct stat fstat; |
struct stat fstat; |
1130 |
/* If a search pattern is received, remember this pattern, and restart search */ |
/* If a search pattern is received, remember this pattern, and restart search */ |
1131 |
if (pattern[0] != 0) |
if (pattern[0] != 0) |
1132 |
{ |
{ |
1133 |
strncpy(pfinfo->pattern, 1 + strrchr(pattern, '/'), 64); |
strncpy(pfinfo->pattern, 1 + strrchr(pattern, '/'), PATH_MAX-1); |
1134 |
rewinddir(pdir); |
rewinddir(pdir); |
1135 |
} |
} |
1136 |
|
|