forked from kofemann/ms-nfs41-client
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathoptions.h
More file actions
92 lines (77 loc) · 3.08 KB
/
options.h
File metadata and controls
92 lines (77 loc) · 3.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
/* Copyright (c) 2010, 2011
* The Regents of the University of Michigan
* All Rights Reserved
*
* Olga Kornievskaia <aglo@umich.edu>
* Casey Bodley <cbodley@umich.edu>
*
* Permission is granted to use, copy and redistribute this software
* for noncommercial education and research purposes, so long as no
* fee is charged, and so long as the name of the University of Michigan
* is not used in any advertising or publicity pertaining to the use
* or distribution of this software without specific, written prior
* authorization. Permission to modify or otherwise create derivative
* works of this software is not granted.
*
* This software is provided as is, without representation or warranty
* of any kind either express or implied, including without limitation
* the implied warranties of merchantability, fitness for a particular
* purpose, or noninfringement. The Regents of the University of
* Michigan shall not be liable for any damages, including special,
* indirect, incidental, or consequential damages, with respect to any
* claim arising out of or in connection with the use of the software,
* even if it has been or is hereafter advised of the possibility of
* such damages.
*/
#ifndef __NFS41_MOUNT_OPTIONS_H__
#define __NFS41_MOUNT_OPTIONS_H__
#define MOUNT_OPTION_BUFFER_SECRET ('n4')
/* MOUNT_OPTION_BUFFER
* Buffer passed to the network provider via NETRESOURCE.lpComment.
* To avoid interpreting a normal comment string as mount options, a
* NULL and secret number are expected at the front. */
typedef struct _MOUNT_OPTION_BUFFER {
USHORT Zero; /* = 0 */
USHORT Secret; /* = 'n4' */
ULONG Length;
CHAR Buffer[1];
} MOUNT_OPTION_BUFFER, *PMOUNT_OPTION_BUFFER;
#ifndef FILE_FULL_EA_INFORMATION
/* from wdm.h
* couldn't find a definition outside of the ddk -cbodley */
typedef struct _FILE_FULL_EA_INFORMATION {
ULONG NextEntryOffset;
UCHAR Flags;
UCHAR EaNameLength;
USHORT EaValueLength;
CHAR EaName[1];
} FILE_FULL_EA_INFORMATION, *PFILE_FULL_EA_INFORMATION;
#endif
/* MOUNT_OPTION_LIST
* Used internally to encapsulate the formation of the
* extended attribute buffer for mount options. */
typedef struct _MOUNT_OPTION_LIST {
PMOUNT_OPTION_BUFFER Buffer;
ULONG Remaining;
PFILE_FULL_EA_INFORMATION Current;
} MOUNT_OPTION_LIST, *PMOUNT_OPTION_LIST;
/* allocate space for 8 full attributes, but limit options by
* space rather than count. */
#define MAX_OPTION_EA_SIZE ( 8 * \
(sizeof(FILE_FULL_EA_INFORMATION) + MAX_PATH) )
#define MAX_OPTION_BUFFER_SIZE ( sizeof(MOUNT_OPTION_BUFFER) + \
MAX_OPTION_EA_SIZE - 1 )
/* options.c */
DWORD InitializeMountOptions(
IN OUT PMOUNT_OPTION_LIST Options,
IN ULONG BufferSize);
void FreeMountOptions(
IN OUT PMOUNT_OPTION_LIST Options);
BOOL ParseMountOptions(
IN LPTSTR Arg,
IN OUT PMOUNT_OPTION_LIST Options);
BOOL InsertOption(
IN LPCTSTR Name,
IN LPCTSTR Value,
IN OUT PMOUNT_OPTION_LIST Options);
#endif /* !__NFS41_MOUNT_OPTIONS_H__ */