ReactOS 0.4.15-dev-5896-g3f5bcf5
util.c
Go to the documentation of this file.
1/* NFSv4.1 client for Windows
2 * Copyright 2012 The Regents of the University of Michigan
3 *
4 * Olga Kornievskaia <aglo@umich.edu>
5 * Casey Bodley <cbodley@umich.edu>
6 *
7 * This library is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License as published by
9 * the Free Software Foundation; either version 2.1 of the License, or (at
10 * your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful, but
13 * without any warranty; without even the implied warranty of merchantability
14 * or fitness for a particular purpose. See the GNU Lesser General Public
15 * License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public License
18 * along with this library; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 */
21
22#include <windows.h>
23#include <strsafe.h>
24#include <stdio.h>
25#include <stdlib.h>
26#include <wincrypt.h> /* for Crypt*() functions */
27
28#include "daemon_debug.h"
29#include "util.h"
30#include "nfs41_ops.h"
31
32
33int safe_read(unsigned char **pos, uint32_t *remaining, void *dest, uint32_t dest_len)
34{
35 if (*remaining < dest_len)
37
38 CopyMemory(dest, *pos, dest_len);
39 *pos += dest_len;
40 *remaining -= dest_len;
41 return 0;
42}
43
44int safe_write(unsigned char **pos, uint32_t *remaining, void *src, uint32_t src_len)
45{
46 if (*remaining < src_len)
48
49 CopyMemory(*pos, src, src_len);
50 *pos += src_len;
51 *remaining -= src_len;
52 return 0;
53}
54
55int get_name(unsigned char **pos, uint32_t *remaining, const char **out_name)
56{
57 int status;
58 USHORT len;
59
60 status = safe_read(pos, remaining, &len, sizeof(USHORT));
61 if (status) goto out;
62 if (*remaining < len) {
64 goto out;
65 }
66 *out_name = (const char*)*pos;
67 *pos += len;
68 *remaining -= len;
69out:
70 return status;
71}
72
73const char* strip_path(
74 IN const char *path,
75 OUT uint32_t *len_out)
76{
77 const char *name = strrchr(path, '\\');
78 name = name ? name + 1 : path;
79 if (len_out)
80 *len_out = (uint32_t)strlen(name);
81 return name;
82}
83
86 IN const nfs41_fh *fh)
87{
88 const uint32_t maxresponse = session->fore_chan_attrs.ca_maxresponsesize;
89 return (uint32_t)min(fh->superblock->maxread, maxresponse - READ_OVERHEAD);
90}
91
94 IN const nfs41_fh *fh)
95{
96 const uint32_t maxrequest = session->fore_chan_attrs.ca_maxrequestsize;
97 return (uint32_t)min(fh->superblock->maxwrite, maxrequest - WRITE_OVERHEAD);
98}
99
101 IN nfs41_write_verf *verf,
102 IN OUT enum stable_how4 *stable)
103{
104 if (verf->committed != UNSTABLE4) {
105 *stable = verf->committed;
106 dprintf(3, "verify_write: committed to stable storage\n");
107 return 1;
108 }
109
110 if (*stable != UNSTABLE4) {
111 memcpy(verf->expected, verf->verf, NFS4_VERIFIER_SIZE);
112 *stable = UNSTABLE4;
113 dprintf(3, "verify_write: first unstable write, saving verifier\n");
114 return 1;
115 }
116
117 if (memcmp(verf->expected, verf->verf, NFS4_VERIFIER_SIZE) == 0) {
118 dprintf(3, "verify_write: verifier matches expected\n");
119 return 1;
120 }
121
122 dprintf(2, "verify_write: verifier changed; writes have been lost!\n");
123 return 0;
124}
125
127 IN nfs41_write_verf *verf)
128{
129 if (memcmp(verf->expected, verf->verf, NFS4_VERIFIER_SIZE) == 0) {
130 dprintf(3, "verify_commit: verifier matches expected\n");
131 return 1;
132 }
133 dprintf(2, "verify_commit: verifier changed; writes have been lost!\n");
134 return 0;
135}
136
138 IN const nfs41_file_info *info)
139{
140 ULONG attrs = 0;
141 if (info->type == NF4DIR)
143 else if (info->type == NF4LNK) {
145 if (info->symlink_dir)
147 } else if (info->type != NF4REG)
148 dprintf(1, "unhandled file type %d, defaulting to NF4REG\n",
149 info->type);
150
151 if (info->mode == 0444) /* XXX: 0444 for READONLY */
153
154 if (info->hidden) attrs |= FILE_ATTRIBUTE_HIDDEN;
155 if (info->system) attrs |= FILE_ATTRIBUTE_SYSTEM;
156 if (info->archive) attrs |= FILE_ATTRIBUTE_ARCHIVE;
157
158 // FILE_ATTRIBUTE_NORMAL attribute is only set if no other attributes are present.
159 // all other override this value.
160 return attrs ? attrs : FILE_ATTRIBUTE_NORMAL;
161}
162
164 IN const nfs41_file_info *info,
165 OUT PFILE_BASIC_INFO basic_out)
166{
167 nfs_time_to_file_time(&info->time_create, &basic_out->CreationTime);
168 nfs_time_to_file_time(&info->time_access, &basic_out->LastAccessTime);
169 nfs_time_to_file_time(&info->time_modify, &basic_out->LastWriteTime);
170 /* XXX: was using 'change' attr, but that wasn't giving a time */
171 nfs_time_to_file_time(&info->time_modify, &basic_out->ChangeTime);
172 basic_out->FileAttributes = nfs_file_info_to_attributes(info);
173}
174
176 IN const nfs41_file_info *info,
177 OUT PFILE_STANDARD_INFO std_out)
178{
180
181 std_out->AllocationSize.QuadPart =
182 std_out->EndOfFile.QuadPart = (LONGLONG)info->size;
183 std_out->NumberOfLinks = info->numlinks;
184 std_out->DeletePending = FALSE;
185 std_out->Directory = FileAttributes & FILE_ATTRIBUTE_DIRECTORY ?
186 TRUE : FALSE;
187}
188
190 IN const nfs41_file_info *info,
192{
193
194 nfs_time_to_file_time(&info->time_create, &net_out->CreationTime);
195 nfs_time_to_file_time(&info->time_access, &net_out->LastAccessTime);
196 nfs_time_to_file_time(&info->time_modify, &net_out->LastWriteTime);
197 /* XXX: was using 'change' attr, but that wasn't giving a time */
198 nfs_time_to_file_time(&info->time_modify, &net_out->ChangeTime);
199 net_out->AllocationSize.QuadPart =
200 net_out->EndOfFile.QuadPart = (LONGLONG)info->size;
201 net_out->FileAttributes = nfs_file_info_to_attributes(info);
202}
203
205 OUT PLARGE_INTEGER file_time)
206{
208}
209
211 OUT nfstime4 *nfs_time)
212{
213 LARGE_INTEGER file_time;
214 get_file_time(&file_time);
215 file_time_to_nfs_time(&file_time, nfs_time);
216}
217
219 IN const multi_addr4 *addrs,
220 IN const netaddr4 *addr,
221 OUT OPTIONAL uint32_t *index_out)
222{
223 uint32_t i;
224 for (i = 0; i < addrs->count; i++) {
225 const netaddr4 *saddr = &addrs->arr[i];
226 if (!strncmp(saddr->netid, addr->netid, NFS41_NETWORK_ID_LEN) &&
227 !strncmp(saddr->uaddr, addr->uaddr, NFS41_UNIVERSAL_ADDR_LEN)) {
228 if (index_out) *index_out = i;
229 return 1;
230 }
231 }
232 return 0;
233}
234
235int nfs_to_windows_error(int status, int default_error)
236{
237 /* make sure this is actually an nfs error */
238 if (status < 0 || (status > 70 && status < 10001) || status > 10087) {
239 eprintf("nfs_to_windows_error called with non-nfs "
240 "error code %d; returning the error as is\n", status);
241 return status;
242 }
243
244 switch (status) {
245 case NFS4_OK: return NO_ERROR;
250 case NFS4ERR_EXIST: return ERROR_FILE_EXISTS;
254 case NFS4ERR_NOSPC: return ERROR_DISK_FULL;
268
269 case NFS4ERR_BADCHAR:
271
272 case NFS4ERR_NOTDIR:
273 case NFS4ERR_ISDIR:
274 case NFS4ERR_SYMLINK:
276
277 case NFS4ERR_EXPIRED:
282
284
285 default:
286 dprintf(1, "nfs error %s not mapped to windows error; "
287 "returning default error %d\n",
288 nfs_error_string(status), default_error);
289 return default_error;
290 }
291}
292
294{
295 switch (status) {
296 case NFS4ERR_BADCHAR:
302 }
303}
304
306 IN const char *path,
307 IN const char *path_end,
308 OUT nfs41_component *component)
309{
310 const char *component_end;
311 component->name = next_non_delimiter(path, path_end);
312 component_end = next_delimiter(component->name, path_end);
313 component->len = (unsigned short)(component_end - component->name);
314 return component->len > 0;
315}
316
318 IN const char *path,
319 IN const char *path_end,
320 OUT nfs41_component *component)
321{
322 const char *component_end = prev_delimiter(path_end, path);
323 component->name = prev_non_delimiter(component_end, path);
324 component->name = prev_delimiter(component->name, path);
325 component->name = next_non_delimiter(component->name, component_end);
326 component->len = (unsigned short)(component_end - component->name);
327 return component->len > 0;
328}
329
331 IN const char *path,
332 IN const char *path_end)
333{
334 path = next_delimiter(path, path_end);
335 return next_non_delimiter(path, path_end) == path_end;
336}
337
340 IN const nfs41_abs_path *src)
341{
342 dst->len = src->len;
343 StringCchCopyNA(dst->path, NFS41_MAX_PATH_LEN, src->path, dst->len);
344}
345
349{
350 file->path = path;
351 last_component(path->path, path->path + path->len, &file->name);
352}
353
356 IN const nfs41_fh *src)
357{
358 dst->fileid = src->fileid;
359 dst->superblock = src->superblock;
360 dst->len = src->len;
361 memcpy(dst->fh, src->fh, dst->len);
362}
363
366 IN const nfs41_path_fh *src)
367{
368 dst->path = src->path;
369 if (dst->path) {
370 const size_t name_start = src->name.name - src->path->path;
371 dst->name.name = dst->path->path + name_start;
372 dst->name.len = src->name.len;
373 } else {
374 dst->name.name = NULL;
375 dst->name.len = 0;
376 }
377 fh_copy(&dst->fh, &src->fh);
378}
379
382 IN const nfs41_fh *fh,
383 OUT nfs41_component *silly)
384{
389 const char *end = path->path + NFS41_MAX_PATH_LEN;
390 const unsigned short extra_len = 2 + 16; //md5 is 16
392 unsigned char fhmd5[17] = { 0 };
393 char *tmp;
394 int status = NO_ERROR, i;
395
396 if (path->len + extra_len >= NFS41_MAX_PATH_LEN) {
398 goto out;
399 }
400
401 /* set up the md5 hash generator */
405 eprintf("CryptAcquireContext() failed with %d\n", status);
406 goto out;
407 }
408 if (!CryptCreateHash(context, CALG_MD5, 0, 0, &hash)) {
410 eprintf("CryptCreateHash() failed with %d\n", status);
411 goto out_context;
412 }
413
414 if (!CryptHashData(hash, (const BYTE*)fh->fh, (DWORD)fh->len, 0)) {
416 eprintf("CryptHashData() failed with %d\n", status);
417 goto out_hash;
418 }
419
420 /* extract the hash buffer */
421 buffer = (PBYTE)fhmd5;
422 length = 16;
425 eprintf("CryptGetHashParam(val) failed with %d\n", status);
426 goto out_hash;
427 }
428
429 last_component(path->path, path->path + path->len, silly);
430 StringCchCopyNA(name, NFS41_MAX_COMPONENT_LEN+1, silly->name, silly->len);
431
432 tmp = (char*)silly->name;
433 StringCchPrintf(tmp, end - tmp, ".%s.", name);
434 tmp += silly->len + 2;
435
436 for (i = 0; i < 16; i++, tmp++)
437 StringCchPrintf(tmp, end - tmp, "%x", fhmd5[i]);
438
439 path->len = path->len + extra_len;
440 silly->len = silly->len + extra_len;
441
442out_hash:
444out_context:
446out:
447 return status;
448}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
void path_fh_init(OUT nfs41_path_fh *file, IN nfs41_abs_path *path)
Definition: util.c:346
bool_t is_last_component(IN const char *path, IN const char *path_end)
Definition: util.c:330
void nfs_to_standard_info(IN const nfs41_file_info *info, OUT PFILE_STANDARD_INFO std_out)
Definition: util.c:175
ULONG nfs_file_info_to_attributes(IN const nfs41_file_info *info)
Definition: util.c:137
bool_t last_component(IN const char *path, IN const char *path_end, OUT nfs41_component *component)
Definition: util.c:317
void get_nfs_time(OUT nfstime4 *nfs_time)
Definition: util.c:210
void nfs_to_network_openinfo(IN const nfs41_file_info *info, OUT PFILE_NETWORK_OPEN_INFORMATION net_out)
Definition: util.c:189
void get_file_time(OUT PLARGE_INTEGER file_time)
Definition: util.c:204
void nfs_to_basic_info(IN const nfs41_file_info *info, OUT PFILE_BASIC_INFO basic_out)
Definition: util.c:163
int safe_write(unsigned char **pos, uint32_t *remaining, void *src, uint32_t src_len)
Definition: util.c:44
void fh_copy(OUT nfs41_fh *dst, IN const nfs41_fh *src)
Definition: util.c:354
int map_symlink_errors(int status)
Definition: util.c:293
void abs_path_copy(OUT nfs41_abs_path *dst, IN const nfs41_abs_path *src)
Definition: util.c:338
int safe_read(unsigned char **pos, uint32_t *remaining, void *dest, uint32_t dest_len)
Definition: util.c:33
void path_fh_copy(OUT nfs41_path_fh *dst, IN const nfs41_path_fh *src)
Definition: util.c:364
int nfs_to_windows_error(int status, int default_error)
Definition: util.c:235
uint32_t max_read_size(IN const nfs41_session *session, IN const nfs41_fh *fh)
Definition: util.c:84
int get_name(unsigned char **pos, uint32_t *remaining, const char **out_name)
Definition: util.c:55
bool_t next_component(IN const char *path, IN const char *path_end, OUT nfs41_component *component)
Definition: util.c:305
const char * strip_path(IN const char *path, OUT uint32_t *len_out)
Definition: util.c:73
bool_t verify_write(IN nfs41_write_verf *verf, IN OUT enum stable_how4 *stable)
Definition: util.c:100
bool_t verify_commit(IN nfs41_write_verf *verf)
Definition: util.c:126
int create_silly_rename(IN nfs41_abs_path *path, IN const nfs41_fh *fh, OUT nfs41_component *silly)
Definition: util.c:380
uint32_t max_write_size(IN const nfs41_session *session, IN const nfs41_fh *fh)
Definition: util.c:92
bool_t multi_addr_find(IN const multi_addr4 *addrs, IN const netaddr4 *addr, OUT OPTIONAL uint32_t *index_out)
Definition: util.c:218
__inline const char * prev_non_delimiter(const char *pos, const char *start)
Definition: util.h:241
static __inline void nfs_time_to_file_time(IN const nfstime4 *nfs_time, OUT PLARGE_INTEGER file_time)
Definition: util.h:125
__inline const char * next_non_delimiter(const char *pos, const char *end)
Definition: util.h:232
__inline const char * next_delimiter(const char *pos, const char *end)
Definition: util.h:214
static __inline void file_time_to_nfs_time(IN const PLARGE_INTEGER file_time, OUT nfstime4 *nfs_time)
Definition: util.h:116
__inline const char * prev_delimiter(const char *pos, const char *start)
Definition: util.h:223
void eprintf(LPCSTR format,...)
Definition: daemon_debug.c:86
const char * nfs_error_string(int status)
Definition: daemon_debug.c:370
#define NO_ERROR
Definition: dderror.h:5
#define NULL
Definition: types.h:112
int32_t bool_t
Definition: types.h:101
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
UINT32 uint32_t
Definition: types.h:75
BOOL WINAPI CryptCreateHash(HCRYPTPROV hProv, ALG_ID Algid, HCRYPTKEY hKey, DWORD dwFlags, HCRYPTHASH *phHash)
Definition: crypt.c:740
BOOL WINAPI CryptGetHashParam(HCRYPTHASH hHash, DWORD dwParam, BYTE *pbData, DWORD *pdwDataLen, DWORD dwFlags)
Definition: crypt.c:1610
BOOL WINAPI CryptDestroyHash(HCRYPTHASH hHash)
Definition: crypt.c:890
BOOL WINAPI CryptReleaseContext(HCRYPTPROV hProv, DWORD dwFlags)
Definition: crypt.c:648
BOOL WINAPI CryptHashData(HCRYPTHASH hHash, const BYTE *pbData, DWORD dwDataLen, DWORD dwFlags)
Definition: crypt.c:1771
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define ERROR_NOT_SUPPORTED
Definition: compat.h:100
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:137
#define ERROR_ACCESS_DENIED
Definition: compat.h:97
#define ERROR_INVALID_NAME
Definition: compat.h:103
VOID WINAPI GetSystemTimeAsFileTime(OUT PFILETIME lpFileTime)
Definition: time.c:128
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
Definition: typeof.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
_Must_inspect_result_ _In_opt_ PFLT_INSTANCE _Out_ PHANDLE _In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Out_ PIO_STATUS_BLOCK _In_opt_ PLARGE_INTEGER _In_ ULONG FileAttributes
Definition: fltkernel.h:1236
GLuint GLuint end
Definition: gl.h:1545
GLenum src
Definition: glext.h:6340
GLuint buffer
Definition: glext.h:5915
GLenum GLenum dst
Definition: glext.h:6340
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLenum const GLvoid * addr
Definition: glext.h:9621
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
static char * dest
Definition: rtl.c:135
#define min(a, b)
Definition: monoChain.cc:55
#define NFS41_MAX_PATH_LEN
Definition: nfs41_const.h:46
#define READ_OVERHEAD
Definition: nfs41_const.h:68
@ NF4REG
Definition: nfs41_const.h:294
@ NF4DIR
Definition: nfs41_const.h:295
@ NF4LNK
Definition: nfs41_const.h:298
#define NFS41_UNIVERSAL_ADDR_LEN
Definition: nfs41_const.h:53
#define WRITE_OVERHEAD
Definition: nfs41_const.h:75
#define NFS41_MAX_COMPONENT_LEN
Definition: nfs41_const.h:45
#define NFS4_VERIFIER_SIZE
Definition: nfs41_const.h:30
#define NFS41_NETWORK_ID_LEN
Definition: nfs41_const.h:56
@ NFS4ERR_OPENMODE
Definition: nfs41_const.h:145
@ NFS4ERR_BAD_STATEID
Definition: nfs41_const.h:132
@ NFS4ERR_ROFS
Definition: nfs41_const.h:101
@ NFS4ERR_SHARE_DENIED
Definition: nfs41_const.h:120
@ NFS4ERR_TOOSMALL
Definition: nfs41_const.h:110
@ NFS4ERR_NAMETOOLONG
Definition: nfs41_const.h:103
@ NFS4ERR_NOTEMPTY
Definition: nfs41_const.h:104
@ NFS4ERR_EXIST
Definition: nfs41_const.h:93
@ NFS4ERR_NOTDIR
Definition: nfs41_const.h:96
@ NFS4ERR_FBIG
Definition: nfs41_const.h:99
@ NFS4ERR_BADNAME
Definition: nfs41_const.h:148
@ NFS4ERR_ADMIN_REVOKED
Definition: nfs41_const.h:154
@ NFS4ERR_NOSPC
Definition: nfs41_const.h:100
@ NFS4ERR_NOFILEHANDLE
Definition: nfs41_const.h:127
@ NFS4ERR_EXPIRED
Definition: nfs41_const.h:116
@ NFS4ERR_XDEV
Definition: nfs41_const.h:94
@ NFS4ERR_MLINK
Definition: nfs41_const.h:102
@ NFS4ERR_LOCK_NOTSUPP
Definition: nfs41_const.h:150
@ NFS4ERR_ISDIR
Definition: nfs41_const.h:97
@ NFS4ERR_ACCESS
Definition: nfs41_const.h:92
@ NFS4ERR_WRONGSEC
Definition: nfs41_const.h:121
@ NFS4ERR_DENIED
Definition: nfs41_const.h:115
@ NFS4ERR_PERM
Definition: nfs41_const.h:88
@ NFS4ERR_LOCKED
Definition: nfs41_const.h:117
@ NFS4ERR_WRONG_TYPE
Definition: nfs41_const.h:192
@ NFS4ERR_NOENT
Definition: nfs41_const.h:89
@ NFS4_OK
Definition: nfs41_const.h:87
@ NFS4ERR_LOCK_RANGE
Definition: nfs41_const.h:135
@ NFS4ERR_INVAL
Definition: nfs41_const.h:98
@ NFS4ERR_IO
Definition: nfs41_const.h:90
@ NFS4ERR_SYMLINK
Definition: nfs41_const.h:136
@ NFS4ERR_OLD_STATEID
Definition: nfs41_const.h:131
@ NFS4ERR_STALE
Definition: nfs41_const.h:106
@ NFS4ERR_ATTRNOTSUPP
Definition: nfs41_const.h:139
@ NFS4ERR_BADCHAR
Definition: nfs41_const.h:147
stable_how4
Definition: nfs41_ops.h:835
@ UNSTABLE4
Definition: nfs41_ops.h:836
#define uint32_t
Definition: nsiface.idl:61
#define FILE_ATTRIBUTE_READONLY
Definition: nt_native.h:702
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703
#define FILE_ATTRIBUTE_SYSTEM
Definition: nt_native.h:704
#define FILE_ATTRIBUTE_ARCHIVE
Definition: nt_native.h:706
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define FILE_ATTRIBUTE_REPARSE_POINT
Definition: ntifs_ex.h:381
BYTE * PBYTE
Definition: pedump.c:66
unsigned short USHORT
Definition: pedump.c:61
#define dprintf
Definition: regdump.c:33
static FILE * out
Definition: regtests2xml.c:44
_Check_return_ _CRTIMP _CONST_RETURN char *__cdecl strrchr(_In_z_ const char *_Str, _In_ int _Ch)
PULONG MinorVersion OPTIONAL
Definition: CrossNt.h:68
#define StringCchPrintf
Definition: strsafe.h:517
STRSAFEAPI StringCchCopyNA(STRSAFE_LPSTR pszDest, size_t cchDest, STRSAFE_LPCSTR pszSrc, size_t cchToCopy)
Definition: strsafe.h:230
char netid[NFS41_NETWORK_ID_LEN+1]
Definition: nfs41_types.h:86
char uaddr[NFS41_UNIVERSAL_ADDR_LEN+1]
Definition: nfs41_types.h:87
Definition: http.c:7252
char * name
Definition: compiler.c:66
Definition: fci.c:127
WCHAR * path
Definition: filesystem.c:122
char name[1]
Definition: fci.c:135
Definition: _hash_fun.h:40
Definition: name.c:39
Definition: ps.c:97
int64_t LONGLONG
Definition: typedefs.h:68
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
#define OUT
Definition: typedefs.h:40
DWORD WINAPI GetLastError(void)
Definition: except.c:1040
#define CopyMemory
Definition: winbase.h:1668
#define PROV_RSA_FULL
Definition: wincrypt.h:2039
#define CRYPT_VERIFYCONTEXT
Definition: wincrypt.h:2069
ULONG_PTR HCRYPTPROV
Definition: wincrypt.h:46
#define CALG_MD5
Definition: wincrypt.h:1805
ULONG_PTR HCRYPTHASH
Definition: wincrypt.h:50
#define CryptAcquireContext
Definition: wincrypt.h:4164
#define HP_HASHVAL
Definition: wincrypt.h:2183
#define ERROR_BUFFER_OVERFLOW
Definition: winerror.h:185
#define ERROR_NET_WRITE_FAULT
Definition: winerror.h:172
#define ERROR_SHARING_VIOLATION
Definition: winerror.h:135
#define ERROR_NOT_EMPTY
Definition: winerror.h:1251
#define ERROR_DISK_FULL
Definition: winerror.h:186
#define ERROR_NOT_LOCKED
Definition: winerror.h:230
#define ERROR_TOO_MANY_LINKS
Definition: winerror.h:671
#define ERROR_FILE_EXISTS
Definition: winerror.h:165
#define ERROR_FILE_TOO_LARGE
Definition: winerror.h:278
#define ERROR_LOCK_VIOLATION
Definition: winerror.h:136
#define ERROR_BAD_NET_RESP
Definition: winerror.h:150
#define ERROR_NOT_SAME_DEVICE
Definition: winerror.h:120
#define ERROR_FILE_INVALID
Definition: winerror.h:585
#define ERROR_FILENAME_EXCED_RANGE
Definition: winerror.h:263
#define ERROR_LOCK_FAILED
Definition: winerror.h:236
#define ERROR_ATOMIC_LOCKS_NOT_SUPPORTED
Definition: winerror.h:240
#define ERROR_NOT_A_REPARSE_POINT
Definition: winerror.h:1288
#define ERROR_NETWORK_ACCESS_DENIED
Definition: winerror.h:157
#define ERROR_INVALID_REPARSE_DATA
Definition: winerror.h:1290
#define ERROR_NETNAME_DELETED
Definition: winerror.h:156
unsigned char BYTE
Definition: xxhash.c:193