implement getattr for FileNetworkOpenInformation
This commit is contained in:
parent
f4071450c0
commit
4c8c263b49
6 changed files with 41 additions and 0 deletions
|
|
@ -204,6 +204,16 @@ typedef struct _FILE_GET_EA_INFORMATION {
|
||||||
CHAR EaName[1];
|
CHAR EaName[1];
|
||||||
} FILE_GET_EA_INFORMATION, *PFILE_GET_EA_INFORMATION;
|
} FILE_GET_EA_INFORMATION, *PFILE_GET_EA_INFORMATION;
|
||||||
|
|
||||||
|
typedef struct _FILE_NETWORK_OPEN_INFORMATION {
|
||||||
|
LARGE_INTEGER CreationTime;
|
||||||
|
LARGE_INTEGER LastAccessTime;
|
||||||
|
LARGE_INTEGER LastWriteTime;
|
||||||
|
LARGE_INTEGER ChangeTime;
|
||||||
|
LARGE_INTEGER AllocationSize;
|
||||||
|
LARGE_INTEGER EndOfFile;
|
||||||
|
ULONG FileAttributes;
|
||||||
|
} FILE_NETWORK_OPEN_INFORMATION, *PFILE_NETWORK_OPEN_INFORMATION;
|
||||||
|
|
||||||
/* wdm.h */
|
/* wdm.h */
|
||||||
typedef enum _FSINFOCLASS {
|
typedef enum _FSINFOCLASS {
|
||||||
FileFsVolumeInformation = 1,
|
FileFsVolumeInformation = 1,
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,9 @@ static int handle_getattr(nfs41_upcall *upcall)
|
||||||
case FileInternalInformation:
|
case FileInternalInformation:
|
||||||
args->intr_info.IndexNumber.QuadPart = info.fileid;
|
args->intr_info.IndexNumber.QuadPart = info.fileid;
|
||||||
break;
|
break;
|
||||||
|
case FileNetworkOpenInformation:
|
||||||
|
nfs_to_network_openinfo(&info, &args->network_info);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
eprintf("unhandled file query class %d\n", args->query_class);
|
eprintf("unhandled file query class %d\n", args->query_class);
|
||||||
status = ERROR_INVALID_PARAMETER;
|
status = ERROR_INVALID_PARAMETER;
|
||||||
|
|
@ -156,6 +159,13 @@ static int marshall_getattr(unsigned char *buffer, uint32_t *length, nfs41_upcal
|
||||||
status = safe_write(&buffer, length, &args->intr_info, info_len);
|
status = safe_write(&buffer, length, &args->intr_info, info_len);
|
||||||
if (status) goto out;
|
if (status) goto out;
|
||||||
break;
|
break;
|
||||||
|
case FileNetworkOpenInformation:
|
||||||
|
info_len = sizeof(args->network_info);
|
||||||
|
status = safe_write(&buffer, length, &info_len, sizeof(info_len));
|
||||||
|
if (status) goto out;
|
||||||
|
status = safe_write(&buffer, length, &args->network_info, info_len);
|
||||||
|
if (status) goto out;
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
eprintf("unknown file query class %d\n", args->query_class);
|
eprintf("unknown file query class %d\n", args->query_class);
|
||||||
status = 103;
|
status = 103;
|
||||||
|
|
|
||||||
|
|
@ -90,6 +90,7 @@ typedef struct __getattr_upcall_args {
|
||||||
FILE_STANDARD_INFO std_info;
|
FILE_STANDARD_INFO std_info;
|
||||||
FILE_ATTRIBUTE_TAG_INFO tag_info;
|
FILE_ATTRIBUTE_TAG_INFO tag_info;
|
||||||
FILE_INTERNAL_INFORMATION intr_info;
|
FILE_INTERNAL_INFORMATION intr_info;
|
||||||
|
FILE_NETWORK_OPEN_INFORMATION network_info;
|
||||||
int query_class;
|
int query_class;
|
||||||
int buf_len;
|
int buf_len;
|
||||||
int query_reply_len;
|
int query_reply_len;
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,21 @@ void nfs_to_standard_info(
|
||||||
TRUE : FALSE;
|
TRUE : FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void nfs_to_network_openinfo(
|
||||||
|
IN const nfs41_file_info *info,
|
||||||
|
OUT PFILE_NETWORK_OPEN_INFORMATION net_out)
|
||||||
|
{
|
||||||
|
|
||||||
|
nfs_time_to_file_time(&info->time_create, &net_out->CreationTime);
|
||||||
|
nfs_time_to_file_time(&info->time_access, &net_out->LastAccessTime);
|
||||||
|
nfs_time_to_file_time(&info->time_modify, &net_out->LastWriteTime);
|
||||||
|
/* XXX: was using 'change' attr, but that wasn't giving a time */
|
||||||
|
nfs_time_to_file_time(&info->time_modify, &net_out->ChangeTime);
|
||||||
|
net_out->AllocationSize.QuadPart =
|
||||||
|
net_out->EndOfFile.QuadPart = (LONGLONG)info->size;
|
||||||
|
net_out->FileAttributes = nfs_file_info_to_attributes(info);
|
||||||
|
}
|
||||||
|
|
||||||
void get_file_time(
|
void get_file_time(
|
||||||
OUT PLARGE_INTEGER file_time)
|
OUT PLARGE_INTEGER file_time)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,7 @@
|
||||||
#define __NFS41_DAEMON_UTIL_H__
|
#define __NFS41_DAEMON_UTIL_H__
|
||||||
|
|
||||||
#include "nfs41_types.h"
|
#include "nfs41_types.h"
|
||||||
|
#include "from_kernel.h"
|
||||||
|
|
||||||
extern DWORD NFS41D_VERSION;
|
extern DWORD NFS41D_VERSION;
|
||||||
struct __nfs41_session;
|
struct __nfs41_session;
|
||||||
|
|
@ -102,6 +103,9 @@ void nfs_to_basic_info(
|
||||||
void nfs_to_standard_info(
|
void nfs_to_standard_info(
|
||||||
IN const nfs41_file_info *info,
|
IN const nfs41_file_info *info,
|
||||||
OUT PFILE_STANDARD_INFO std_out);
|
OUT PFILE_STANDARD_INFO std_out);
|
||||||
|
void nfs_to_network_openinfo(
|
||||||
|
IN const nfs41_file_info *info,
|
||||||
|
OUT PFILE_NETWORK_OPEN_INFORMATION std_out);
|
||||||
|
|
||||||
/* http://msdn.microsoft.com/en-us/library/ms724290%28VS.85%29.aspx:
|
/* http://msdn.microsoft.com/en-us/library/ms724290%28VS.85%29.aspx:
|
||||||
* A file time is a 64-bit value that represents the number of
|
* A file time is a 64-bit value that represents the number of
|
||||||
|
|
|
||||||
|
|
@ -5044,6 +5044,7 @@ NTSTATUS nfs41_QueryFileInformation(
|
||||||
case FileStandardInformation:
|
case FileStandardInformation:
|
||||||
case FileInternalInformation:
|
case FileInternalInformation:
|
||||||
case FileAttributeTagInformation:
|
case FileAttributeTagInformation:
|
||||||
|
case FileNetworkOpenInformation:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
print_error("nfs41_QueryFileInformation: unhandled class %d\n", InfoClass);
|
print_error("nfs41_QueryFileInformation: unhandled class %d\n", InfoClass);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue