aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/cifs/Makefile3
-rw-r--r--fs/cifs/cache.c2
-rw-r--r--fs/cifs/cifs_debug.c62
-rw-r--r--fs/cifs/cifs_dfs_ref.c7
-rw-r--r--fs/cifs/cifs_unicode.c60
-rw-r--r--fs/cifs/cifs_unicode.h6
-rw-r--r--fs/cifs/cifsacl.c27
-rw-r--r--fs/cifs/cifsencrypt.c52
-rw-r--r--fs/cifs/cifsfs.c24
-rw-r--r--fs/cifs/cifsglob.h192
-rw-r--r--fs/cifs/cifsproto.h253
-rw-r--r--fs/cifs/cifssmb.c365
-rw-r--r--fs/cifs/connect.c446
-rw-r--r--fs/cifs/dir.c51
-rw-r--r--fs/cifs/file.c193
-rw-r--r--fs/cifs/inode.c236
-rw-r--r--fs/cifs/ioctl.c6
-rw-r--r--fs/cifs/link.c44
-rw-r--r--fs/cifs/misc.c31
-rw-r--r--fs/cifs/nterr.c6
-rw-r--r--fs/cifs/nterr.h22
-rw-r--r--fs/cifs/ntlmssp.h10
-rw-r--r--fs/cifs/readdir.c31
-rw-r--r--fs/cifs/sess.c12
-rw-r--r--fs/cifs/smb1ops.c399
-rw-r--r--fs/cifs/smb2glob.h44
-rw-r--r--fs/cifs/smb2inode.c124
-rw-r--r--fs/cifs/smb2maperror.c2477
-rw-r--r--fs/cifs/smb2misc.c347
-rw-r--r--fs/cifs/smb2ops.c304
-rw-r--r--fs/cifs/smb2pdu.c1125
-rw-r--r--fs/cifs/smb2pdu.h577
-rw-r--r--fs/cifs/smb2proto.h78
-rw-r--r--fs/cifs/smb2status.h1782
-rw-r--r--fs/cifs/smb2transport.c172
-rw-r--r--fs/cifs/smbencrypt.c14
-rw-r--r--fs/cifs/transport.c95
-rw-r--r--fs/cifs/xattr.c24
38 files changed, 8555 insertions, 1148 deletions
diff --git a/fs/cifs/Makefile b/fs/cifs/Makefile
index 4b4127544349..feee94309271 100644
--- a/fs/cifs/Makefile
+++ b/fs/cifs/Makefile
@@ -16,4 +16,5 @@ cifs-$(CONFIG_CIFS_DFS_UPCALL) += dns_resolve.o cifs_dfs_ref.o
16 16
17cifs-$(CONFIG_CIFS_FSCACHE) += fscache.o cache.o 17cifs-$(CONFIG_CIFS_FSCACHE) += fscache.o cache.o
18 18
19cifs-$(CONFIG_CIFS_SMB2) += smb2ops.o 19cifs-$(CONFIG_CIFS_SMB2) += smb2ops.o smb2maperror.o smb2transport.o \
20 smb2misc.o smb2pdu.o smb2inode.o
diff --git a/fs/cifs/cache.c b/fs/cifs/cache.c
index 545509c3313b..282d6de7e410 100644
--- a/fs/cifs/cache.c
+++ b/fs/cifs/cache.c
@@ -152,7 +152,7 @@ static uint16_t cifs_super_get_key(const void *cookie_netfs_data, void *buffer,
152 152
153 sharename = extract_sharename(tcon->treeName); 153 sharename = extract_sharename(tcon->treeName);
154 if (IS_ERR(sharename)) { 154 if (IS_ERR(sharename)) {
155 cFYI(1, "%s: couldn't extract sharename\n", __func__); 155 cFYI(1, "%s: couldn't extract sharename", __func__);
156 sharename = NULL; 156 sharename = NULL;
157 return 0; 157 return 0;
158 } 158 }
diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index e8140528ca5c..d9ea6ede6a7a 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -65,7 +65,7 @@ void cifs_dump_detail(void *buf)
65 cERROR(1, "Cmd: %d Err: 0x%x Flags: 0x%x Flgs2: 0x%x Mid: %d Pid: %d", 65 cERROR(1, "Cmd: %d Err: 0x%x Flags: 0x%x Flgs2: 0x%x Mid: %d Pid: %d",
66 smb->Command, smb->Status.CifsError, 66 smb->Command, smb->Status.CifsError,
67 smb->Flags, smb->Flags2, smb->Mid, smb->Pid); 67 smb->Flags, smb->Flags2, smb->Mid, smb->Pid);
68 cERROR(1, "smb buf %p len %d", smb, smbCalcSize(smb)); 68 cERROR(1, "smb buf %p len %u", smb, smbCalcSize(smb));
69#endif /* CONFIG_CIFS_DEBUG2 */ 69#endif /* CONFIG_CIFS_DEBUG2 */
70} 70}
71 71
@@ -282,24 +282,8 @@ static ssize_t cifs_stats_proc_write(struct file *file,
282 struct cifs_tcon, 282 struct cifs_tcon,
283 tcon_list); 283 tcon_list);
284 atomic_set(&tcon->num_smbs_sent, 0); 284 atomic_set(&tcon->num_smbs_sent, 0);
285 atomic_set(&tcon->num_writes, 0); 285 if (server->ops->clear_stats)
286 atomic_set(&tcon->num_reads, 0); 286 server->ops->clear_stats(tcon);
287 atomic_set(&tcon->num_oplock_brks, 0);
288 atomic_set(&tcon->num_opens, 0);
289 atomic_set(&tcon->num_posixopens, 0);
290 atomic_set(&tcon->num_posixmkdirs, 0);
291 atomic_set(&tcon->num_closes, 0);
292 atomic_set(&tcon->num_deletes, 0);
293 atomic_set(&tcon->num_mkdirs, 0);
294 atomic_set(&tcon->num_rmdirs, 0);
295 atomic_set(&tcon->num_renames, 0);
296 atomic_set(&tcon->num_t2renames, 0);
297 atomic_set(&tcon->num_ffirst, 0);
298 atomic_set(&tcon->num_fnext, 0);
299 atomic_set(&tcon->num_fclose, 0);
300 atomic_set(&tcon->num_hardlinks, 0);
301 atomic_set(&tcon->num_symlinks, 0);
302 atomic_set(&tcon->num_locks, 0);
303 } 287 }
304 } 288 }
305 } 289 }
@@ -358,42 +342,10 @@ static int cifs_stats_proc_show(struct seq_file *m, void *v)
358 seq_printf(m, "\n%d) %s", i, tcon->treeName); 342 seq_printf(m, "\n%d) %s", i, tcon->treeName);
359 if (tcon->need_reconnect) 343 if (tcon->need_reconnect)
360 seq_puts(m, "\tDISCONNECTED "); 344 seq_puts(m, "\tDISCONNECTED ");
361 seq_printf(m, "\nSMBs: %d Oplock Breaks: %d", 345 seq_printf(m, "\nSMBs: %d",
362 atomic_read(&tcon->num_smbs_sent), 346 atomic_read(&tcon->num_smbs_sent));
363 atomic_read(&tcon->num_oplock_brks)); 347 if (server->ops->print_stats)
364 seq_printf(m, "\nReads: %d Bytes: %lld", 348 server->ops->print_stats(m, tcon);
365 atomic_read(&tcon->num_reads),
366 (long long)(tcon->bytes_read));
367 seq_printf(m, "\nWrites: %d Bytes: %lld",
368 atomic_read(&tcon->num_writes),
369 (long long)(tcon->bytes_written));
370 seq_printf(m, "\nFlushes: %d",
371 atomic_read(&tcon->num_flushes));
372 seq_printf(m, "\nLocks: %d HardLinks: %d "
373 "Symlinks: %d",
374 atomic_read(&tcon->num_locks),
375 atomic_read(&tcon->num_hardlinks),
376 atomic_read(&tcon->num_symlinks));
377 seq_printf(m, "\nOpens: %d Closes: %d "
378 "Deletes: %d",
379 atomic_read(&tcon->num_opens),
380 atomic_read(&tcon->num_closes),
381 atomic_read(&tcon->num_deletes));
382 seq_printf(m, "\nPosix Opens: %d "
383 "Posix Mkdirs: %d",
384 atomic_read(&tcon->num_posixopens),
385 atomic_read(&tcon->num_posixmkdirs));
386 seq_printf(m, "\nMkdirs: %d Rmdirs: %d",
387 atomic_read(&tcon->num_mkdirs),
388 atomic_read(&tcon->num_rmdirs));
389 seq_printf(m, "\nRenames: %d T2 Renames %d",
390 atomic_read(&tcon->num_renames),
391 atomic_read(&tcon->num_t2renames));
392 seq_printf(m, "\nFindFirst: %d FNext %d "
393 "FClose %d",
394 atomic_read(&tcon->num_ffirst),
395 atomic_read(&tcon->num_fnext),
396 atomic_read(&tcon->num_fclose));
397 } 349 }
398 } 350 }
399 } 351 }
diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c
index 6873bb634a97..ce5cbd717bfc 100644
--- a/fs/cifs/cifs_dfs_ref.c
+++ b/fs/cifs/cifs_dfs_ref.c
@@ -275,7 +275,8 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
275 struct cifs_sb_info *cifs_sb; 275 struct cifs_sb_info *cifs_sb;
276 struct cifs_ses *ses; 276 struct cifs_ses *ses;
277 char *full_path; 277 char *full_path;
278 int xid, i; 278 unsigned int xid;
279 int i;
279 int rc; 280 int rc;
280 struct vfsmount *mnt; 281 struct vfsmount *mnt;
281 struct tcon_link *tlink; 282 struct tcon_link *tlink;
@@ -302,11 +303,11 @@ static struct vfsmount *cifs_dfs_do_automount(struct dentry *mntpt)
302 } 303 }
303 ses = tlink_tcon(tlink)->ses; 304 ses = tlink_tcon(tlink)->ses;
304 305
305 xid = GetXid(); 306 xid = get_xid();
306 rc = get_dfs_path(xid, ses, full_path + 1, cifs_sb->local_nls, 307 rc = get_dfs_path(xid, ses, full_path + 1, cifs_sb->local_nls,
307 &num_referrals, &referrals, 308 &num_referrals, &referrals,
308 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); 309 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
309 FreeXid(xid); 310 free_xid(xid);
310 311
311 cifs_put_tlink(tlink); 312 cifs_put_tlink(tlink);
312 313
diff --git a/fs/cifs/cifs_unicode.c b/fs/cifs/cifs_unicode.c
index fbb9da951843..7dab9c04ad52 100644
--- a/fs/cifs/cifs_unicode.c
+++ b/fs/cifs/cifs_unicode.c
@@ -331,3 +331,63 @@ ctoUTF16_out:
331 return i; 331 return i;
332} 332}
333 333
334#ifdef CONFIG_CIFS_SMB2
335/*
336 * cifs_local_to_utf16_bytes - how long will a string be after conversion?
337 * @from - pointer to input string
338 * @maxbytes - don't go past this many bytes of input string
339 * @codepage - source codepage
340 *
341 * Walk a string and return the number of bytes that the string will
342 * be after being converted to the given charset, not including any null
343 * termination required. Don't walk past maxbytes in the source buffer.
344 */
345
346static int
347cifs_local_to_utf16_bytes(const char *from, int len,
348 const struct nls_table *codepage)
349{
350 int charlen;
351 int i;
352 wchar_t wchar_to;
353
354 for (i = 0; len && *from; i++, from += charlen, len -= charlen) {
355 charlen = codepage->char2uni(from, len, &wchar_to);
356 /* Failed conversion defaults to a question mark */
357 if (charlen < 1)
358 charlen = 1;
359 }
360 return 2 * i; /* UTF16 characters are two bytes */
361}
362
363/*
364 * cifs_strndup_to_utf16 - copy a string to wire format from the local codepage
365 * @src - source string
366 * @maxlen - don't walk past this many bytes in the source string
367 * @utf16_len - the length of the allocated string in bytes (including null)
368 * @cp - source codepage
369 * @remap - map special chars
370 *
371 * Take a string convert it from the local codepage to UTF16 and
372 * put it in a new buffer. Returns a pointer to the new string or NULL on
373 * error.
374 */
375__le16 *
376cifs_strndup_to_utf16(const char *src, const int maxlen, int *utf16_len,
377 const struct nls_table *cp, int remap)
378{
379 int len;
380 __le16 *dst;
381
382 len = cifs_local_to_utf16_bytes(src, maxlen, cp);
383 len += 2; /* NULL */
384 dst = kmalloc(len, GFP_KERNEL);
385 if (!dst) {
386 *utf16_len = 0;
387 return NULL;
388 }
389 cifsConvertToUTF16(dst, src, strlen(src), cp, remap);
390 *utf16_len = len;
391 return dst;
392}
393#endif /* CONFIG_CIFS_SMB2 */
diff --git a/fs/cifs/cifs_unicode.h b/fs/cifs/cifs_unicode.h
index a513a546700b..4fb097468e21 100644
--- a/fs/cifs/cifs_unicode.h
+++ b/fs/cifs/cifs_unicode.h
@@ -84,7 +84,11 @@ char *cifs_strndup_from_utf16(const char *src, const int maxlen,
84 const struct nls_table *codepage); 84 const struct nls_table *codepage);
85extern int cifsConvertToUTF16(__le16 *target, const char *source, int maxlen, 85extern int cifsConvertToUTF16(__le16 *target, const char *source, int maxlen,
86 const struct nls_table *cp, int mapChars); 86 const struct nls_table *cp, int mapChars);
87 87#ifdef CONFIG_CIFS_SMB2
88extern __le16 *cifs_strndup_to_utf16(const char *src, const int maxlen,
89 int *utf16_len, const struct nls_table *cp,
90 int remap);
91#endif /* CONFIG_CIFS_SMB2 */
88#endif 92#endif
89 93
90/* 94/*
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
index 3cc1b251ca08..05f4dc263a23 100644
--- a/fs/cifs/cifsacl.c
+++ b/fs/cifs/cifsacl.c
@@ -525,7 +525,7 @@ init_cifs_idmap(void)
525 struct key *keyring; 525 struct key *keyring;
526 int ret; 526 int ret;
527 527
528 cFYI(1, "Registering the %s key type\n", cifs_idmap_key_type.name); 528 cFYI(1, "Registering the %s key type", cifs_idmap_key_type.name);
529 529
530 /* create an override credential set with a special thread keyring in 530 /* create an override credential set with a special thread keyring in
531 * which requests are cached 531 * which requests are cached
@@ -572,7 +572,7 @@ init_cifs_idmap(void)
572 sidgidtree = RB_ROOT; 572 sidgidtree = RB_ROOT;
573 register_shrinker(&cifs_shrinker); 573 register_shrinker(&cifs_shrinker);
574 574
575 cFYI(1, "cifs idmap keyring: %d\n", key_serial(keyring)); 575 cFYI(1, "cifs idmap keyring: %d", key_serial(keyring));
576 return 0; 576 return 0;
577 577
578failed_put_key: 578failed_put_key:
@@ -589,7 +589,7 @@ exit_cifs_idmap(void)
589 unregister_key_type(&cifs_idmap_key_type); 589 unregister_key_type(&cifs_idmap_key_type);
590 put_cred(root_cred); 590 put_cred(root_cred);
591 unregister_shrinker(&cifs_shrinker); 591 unregister_shrinker(&cifs_shrinker);
592 cFYI(1, "Unregistered %s key type\n", cifs_idmap_key_type.name); 592 cFYI(1, "Unregistered %s key type", cifs_idmap_key_type.name);
593} 593}
594 594
595void 595void
@@ -1153,15 +1153,16 @@ static struct cifs_ntsd *get_cifs_acl_by_fid(struct cifs_sb_info *cifs_sb,
1153 __u16 fid, u32 *pacllen) 1153 __u16 fid, u32 *pacllen)
1154{ 1154{
1155 struct cifs_ntsd *pntsd = NULL; 1155 struct cifs_ntsd *pntsd = NULL;
1156 int xid, rc; 1156 unsigned int xid;
1157 int rc;
1157 struct tcon_link *tlink = cifs_sb_tlink(cifs_sb); 1158 struct tcon_link *tlink = cifs_sb_tlink(cifs_sb);
1158 1159
1159 if (IS_ERR(tlink)) 1160 if (IS_ERR(tlink))
1160 return ERR_CAST(tlink); 1161 return ERR_CAST(tlink);
1161 1162
1162 xid = GetXid(); 1163 xid = get_xid();
1163 rc = CIFSSMBGetCIFSACL(xid, tlink_tcon(tlink), fid, &pntsd, pacllen); 1164 rc = CIFSSMBGetCIFSACL(xid, tlink_tcon(tlink), fid, &pntsd, pacllen);
1164 FreeXid(xid); 1165 free_xid(xid);
1165 1166
1166 cifs_put_tlink(tlink); 1167 cifs_put_tlink(tlink);
1167 1168
@@ -1176,7 +1177,8 @@ static struct cifs_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb,
1176{ 1177{
1177 struct cifs_ntsd *pntsd = NULL; 1178 struct cifs_ntsd *pntsd = NULL;
1178 int oplock = 0; 1179 int oplock = 0;
1179 int xid, rc, create_options = 0; 1180 unsigned int xid;
1181 int rc, create_options = 0;
1180 __u16 fid; 1182 __u16 fid;
1181 struct cifs_tcon *tcon; 1183 struct cifs_tcon *tcon;
1182 struct tcon_link *tlink = cifs_sb_tlink(cifs_sb); 1184 struct tcon_link *tlink = cifs_sb_tlink(cifs_sb);
@@ -1185,7 +1187,7 @@ static struct cifs_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb,
1185 return ERR_CAST(tlink); 1187 return ERR_CAST(tlink);
1186 1188
1187 tcon = tlink_tcon(tlink); 1189 tcon = tlink_tcon(tlink);
1188 xid = GetXid(); 1190 xid = get_xid();
1189 1191
1190 if (backup_cred(cifs_sb)) 1192 if (backup_cred(cifs_sb))
1191 create_options |= CREATE_OPEN_BACKUP_INTENT; 1193 create_options |= CREATE_OPEN_BACKUP_INTENT;
@@ -1199,7 +1201,7 @@ static struct cifs_ntsd *get_cifs_acl_by_path(struct cifs_sb_info *cifs_sb,
1199 } 1201 }
1200 1202
1201 cifs_put_tlink(tlink); 1203 cifs_put_tlink(tlink);
1202 FreeXid(xid); 1204 free_xid(xid);
1203 1205
1204 cFYI(1, "%s: rc = %d ACL len %d", __func__, rc, *pacllen); 1206 cFYI(1, "%s: rc = %d ACL len %d", __func__, rc, *pacllen);
1205 if (rc) 1207 if (rc)
@@ -1230,7 +1232,8 @@ int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
1230 struct inode *inode, const char *path, int aclflag) 1232 struct inode *inode, const char *path, int aclflag)
1231{ 1233{
1232 int oplock = 0; 1234 int oplock = 0;
1233 int xid, rc, access_flags, create_options = 0; 1235 unsigned int xid;
1236 int rc, access_flags, create_options = 0;
1234 __u16 fid; 1237 __u16 fid;
1235 struct cifs_tcon *tcon; 1238 struct cifs_tcon *tcon;
1236 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 1239 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
@@ -1240,7 +1243,7 @@ int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
1240 return PTR_ERR(tlink); 1243 return PTR_ERR(tlink);
1241 1244
1242 tcon = tlink_tcon(tlink); 1245 tcon = tlink_tcon(tlink);
1243 xid = GetXid(); 1246 xid = get_xid();
1244 1247
1245 if (backup_cred(cifs_sb)) 1248 if (backup_cred(cifs_sb))
1246 create_options |= CREATE_OPEN_BACKUP_INTENT; 1249 create_options |= CREATE_OPEN_BACKUP_INTENT;
@@ -1263,7 +1266,7 @@ int set_cifs_acl(struct cifs_ntsd *pnntsd, __u32 acllen,
1263 1266
1264 CIFSSMBClose(xid, tcon, fid); 1267 CIFSSMBClose(xid, tcon, fid);
1265out: 1268out:
1266 FreeXid(xid); 1269 free_xid(xid);
1267 cifs_put_tlink(tlink); 1270 cifs_put_tlink(tlink);
1268 return rc; 1271 return rc;
1269} 1272}
diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c
index 63c460e503b6..6a0d741159f0 100644
--- a/fs/cifs/cifsencrypt.c
+++ b/fs/cifs/cifsencrypt.c
@@ -47,20 +47,20 @@ static int cifs_calc_signature(const struct kvec *iov, int n_vec,
47 return -EINVAL; 47 return -EINVAL;
48 48
49 if (!server->secmech.sdescmd5) { 49 if (!server->secmech.sdescmd5) {
50 cERROR(1, "%s: Can't generate signature\n", __func__); 50 cERROR(1, "%s: Can't generate signature", __func__);
51 return -1; 51 return -1;
52 } 52 }
53 53
54 rc = crypto_shash_init(&server->secmech.sdescmd5->shash); 54 rc = crypto_shash_init(&server->secmech.sdescmd5->shash);
55 if (rc) { 55 if (rc) {
56 cERROR(1, "%s: Could not init md5\n", __func__); 56 cERROR(1, "%s: Could not init md5", __func__);
57 return rc; 57 return rc;
58 } 58 }
59 59
60 rc = crypto_shash_update(&server->secmech.sdescmd5->shash, 60 rc = crypto_shash_update(&server->secmech.sdescmd5->shash,
61 server->session_key.response, server->session_key.len); 61 server->session_key.response, server->session_key.len);
62 if (rc) { 62 if (rc) {
63 cERROR(1, "%s: Could not update with response\n", __func__); 63 cERROR(1, "%s: Could not update with response", __func__);
64 return rc; 64 return rc;
65 } 65 }
66 66
@@ -85,7 +85,7 @@ static int cifs_calc_signature(const struct kvec *iov, int n_vec,
85 iov[i].iov_base, iov[i].iov_len); 85 iov[i].iov_base, iov[i].iov_len);
86 } 86 }
87 if (rc) { 87 if (rc) {
88 cERROR(1, "%s: Could not update with payload\n", 88 cERROR(1, "%s: Could not update with payload",
89 __func__); 89 __func__);
90 return rc; 90 return rc;
91 } 91 }
@@ -93,13 +93,13 @@ static int cifs_calc_signature(const struct kvec *iov, int n_vec,
93 93
94 rc = crypto_shash_final(&server->secmech.sdescmd5->shash, signature); 94 rc = crypto_shash_final(&server->secmech.sdescmd5->shash, signature);
95 if (rc) 95 if (rc)
96 cERROR(1, "%s: Could not generate md5 hash\n", __func__); 96 cERROR(1, "%s: Could not generate md5 hash", __func__);
97 97
98 return rc; 98 return rc;
99} 99}
100 100
101/* must be called with server->srv_mutex held */ 101/* must be called with server->srv_mutex held */
102int cifs_sign_smb2(struct kvec *iov, int n_vec, struct TCP_Server_Info *server, 102int cifs_sign_smbv(struct kvec *iov, int n_vec, struct TCP_Server_Info *server,
103 __u32 *pexpected_response_sequence_number) 103 __u32 *pexpected_response_sequence_number)
104{ 104{
105 int rc = 0; 105 int rc = 0;
@@ -143,7 +143,7 @@ int cifs_sign_smb(struct smb_hdr *cifs_pdu, struct TCP_Server_Info *server,
143 iov.iov_base = cifs_pdu; 143 iov.iov_base = cifs_pdu;
144 iov.iov_len = be32_to_cpu(cifs_pdu->smb_buf_length) + 4; 144 iov.iov_len = be32_to_cpu(cifs_pdu->smb_buf_length) + 4;
145 145
146 return cifs_sign_smb2(&iov, 1, server, 146 return cifs_sign_smbv(&iov, 1, server,
147 pexpected_response_sequence_number); 147 pexpected_response_sequence_number);
148} 148}
149 149
@@ -399,7 +399,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
399 wchar_t *server; 399 wchar_t *server;
400 400
401 if (!ses->server->secmech.sdeschmacmd5) { 401 if (!ses->server->secmech.sdeschmacmd5) {
402 cERROR(1, "calc_ntlmv2_hash: can't generate ntlmv2 hash\n"); 402 cERROR(1, "calc_ntlmv2_hash: can't generate ntlmv2 hash");
403 return -1; 403 return -1;
404 } 404 }
405 405
@@ -415,7 +415,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
415 415
416 rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash); 416 rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash);
417 if (rc) { 417 if (rc) {
418 cERROR(1, "calc_ntlmv2_hash: could not init hmacmd5\n"); 418 cERROR(1, "calc_ntlmv2_hash: could not init hmacmd5");
419 return rc; 419 return rc;
420 } 420 }
421 421
@@ -423,7 +423,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
423 len = ses->user_name ? strlen(ses->user_name) : 0; 423 len = ses->user_name ? strlen(ses->user_name) : 0;
424 user = kmalloc(2 + (len * 2), GFP_KERNEL); 424 user = kmalloc(2 + (len * 2), GFP_KERNEL);
425 if (user == NULL) { 425 if (user == NULL) {
426 cERROR(1, "calc_ntlmv2_hash: user mem alloc failure\n"); 426 cERROR(1, "calc_ntlmv2_hash: user mem alloc failure");
427 rc = -ENOMEM; 427 rc = -ENOMEM;
428 return rc; 428 return rc;
429 } 429 }
@@ -439,7 +439,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
439 (char *)user, 2 * len); 439 (char *)user, 2 * len);
440 kfree(user); 440 kfree(user);
441 if (rc) { 441 if (rc) {
442 cERROR(1, "%s: Could not update with user\n", __func__); 442 cERROR(1, "%s: Could not update with user", __func__);
443 return rc; 443 return rc;
444 } 444 }
445 445
@@ -460,7 +460,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
460 (char *)domain, 2 * len); 460 (char *)domain, 2 * len);
461 kfree(domain); 461 kfree(domain);
462 if (rc) { 462 if (rc) {
463 cERROR(1, "%s: Could not update with domain\n", 463 cERROR(1, "%s: Could not update with domain",
464 __func__); 464 __func__);
465 return rc; 465 return rc;
466 } 466 }
@@ -480,7 +480,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
480 (char *)server, 2 * len); 480 (char *)server, 2 * len);
481 kfree(server); 481 kfree(server);
482 if (rc) { 482 if (rc) {
483 cERROR(1, "%s: Could not update with server\n", 483 cERROR(1, "%s: Could not update with server",
484 __func__); 484 __func__);
485 return rc; 485 return rc;
486 } 486 }
@@ -489,7 +489,7 @@ static int calc_ntlmv2_hash(struct cifs_ses *ses, char *ntlmv2_hash,
489 rc = crypto_shash_final(&ses->server->secmech.sdeschmacmd5->shash, 489 rc = crypto_shash_final(&ses->server->secmech.sdeschmacmd5->shash,
490 ntlmv2_hash); 490 ntlmv2_hash);
491 if (rc) 491 if (rc)
492 cERROR(1, "%s: Could not generate md5 hash\n", __func__); 492 cERROR(1, "%s: Could not generate md5 hash", __func__);
493 493
494 return rc; 494 return rc;
495} 495}
@@ -501,7 +501,7 @@ CalcNTLMv2_response(const struct cifs_ses *ses, char *ntlmv2_hash)
501 unsigned int offset = CIFS_SESS_KEY_SIZE + 8; 501 unsigned int offset = CIFS_SESS_KEY_SIZE + 8;
502 502
503 if (!ses->server->secmech.sdeschmacmd5) { 503 if (!ses->server->secmech.sdeschmacmd5) {
504 cERROR(1, "calc_ntlmv2_hash: can't generate ntlmv2 hash\n"); 504 cERROR(1, "calc_ntlmv2_hash: can't generate ntlmv2 hash");
505 return -1; 505 return -1;
506 } 506 }
507 507
@@ -527,14 +527,14 @@ CalcNTLMv2_response(const struct cifs_ses *ses, char *ntlmv2_hash)
527 rc = crypto_shash_update(&ses->server->secmech.sdeschmacmd5->shash, 527 rc = crypto_shash_update(&ses->server->secmech.sdeschmacmd5->shash,
528 ses->auth_key.response + offset, ses->auth_key.len - offset); 528 ses->auth_key.response + offset, ses->auth_key.len - offset);
529 if (rc) { 529 if (rc) {
530 cERROR(1, "%s: Could not update with response\n", __func__); 530 cERROR(1, "%s: Could not update with response", __func__);
531 return rc; 531 return rc;
532 } 532 }
533 533
534 rc = crypto_shash_final(&ses->server->secmech.sdeschmacmd5->shash, 534 rc = crypto_shash_final(&ses->server->secmech.sdeschmacmd5->shash,
535 ses->auth_key.response + CIFS_SESS_KEY_SIZE); 535 ses->auth_key.response + CIFS_SESS_KEY_SIZE);
536 if (rc) 536 if (rc)
537 cERROR(1, "%s: Could not generate md5 hash\n", __func__); 537 cERROR(1, "%s: Could not generate md5 hash", __func__);
538 538
539 return rc; 539 return rc;
540} 540}
@@ -613,7 +613,7 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)
613 613
614 rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash); 614 rc = crypto_shash_init(&ses->server->secmech.sdeschmacmd5->shash);
615 if (rc) { 615 if (rc) {
616 cERROR(1, "%s: Could not init hmacmd5\n", __func__); 616 cERROR(1, "%s: Could not init hmacmd5", __func__);
617 goto setup_ntlmv2_rsp_ret; 617 goto setup_ntlmv2_rsp_ret;
618 } 618 }
619 619
@@ -621,14 +621,14 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)
621 ses->auth_key.response + CIFS_SESS_KEY_SIZE, 621 ses->auth_key.response + CIFS_SESS_KEY_SIZE,
622 CIFS_HMAC_MD5_HASH_SIZE); 622 CIFS_HMAC_MD5_HASH_SIZE);
623 if (rc) { 623 if (rc) {
624 cERROR(1, "%s: Could not update with response\n", __func__); 624 cERROR(1, "%s: Could not update with response", __func__);
625 goto setup_ntlmv2_rsp_ret; 625 goto setup_ntlmv2_rsp_ret;
626 } 626 }
627 627
628 rc = crypto_shash_final(&ses->server->secmech.sdeschmacmd5->shash, 628 rc = crypto_shash_final(&ses->server->secmech.sdeschmacmd5->shash,
629 ses->auth_key.response); 629 ses->auth_key.response);
630 if (rc) 630 if (rc)
631 cERROR(1, "%s: Could not generate md5 hash\n", __func__); 631 cERROR(1, "%s: Could not generate md5 hash", __func__);
632 632
633setup_ntlmv2_rsp_ret: 633setup_ntlmv2_rsp_ret:
634 kfree(tiblob); 634 kfree(tiblob);
@@ -650,7 +650,7 @@ calc_seckey(struct cifs_ses *ses)
650 tfm_arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC); 650 tfm_arc4 = crypto_alloc_blkcipher("ecb(arc4)", 0, CRYPTO_ALG_ASYNC);
651 if (IS_ERR(tfm_arc4)) { 651 if (IS_ERR(tfm_arc4)) {
652 rc = PTR_ERR(tfm_arc4); 652 rc = PTR_ERR(tfm_arc4);
653 cERROR(1, "could not allocate crypto API arc4\n"); 653 cERROR(1, "could not allocate crypto API arc4");
654 return rc; 654 return rc;
655 } 655 }
656 656
@@ -668,7 +668,7 @@ calc_seckey(struct cifs_ses *ses)
668 668
669 rc = crypto_blkcipher_encrypt(&desc, &sgout, &sgin, CIFS_CPHTXT_SIZE); 669 rc = crypto_blkcipher_encrypt(&desc, &sgout, &sgin, CIFS_CPHTXT_SIZE);
670 if (rc) { 670 if (rc) {
671 cERROR(1, "could not encrypt session key rc: %d\n", rc); 671 cERROR(1, "could not encrypt session key rc: %d", rc);
672 crypto_free_blkcipher(tfm_arc4); 672 crypto_free_blkcipher(tfm_arc4);
673 return rc; 673 return rc;
674 } 674 }
@@ -705,13 +705,13 @@ cifs_crypto_shash_allocate(struct TCP_Server_Info *server)
705 705
706 server->secmech.hmacmd5 = crypto_alloc_shash("hmac(md5)", 0, 0); 706 server->secmech.hmacmd5 = crypto_alloc_shash("hmac(md5)", 0, 0);
707 if (IS_ERR(server->secmech.hmacmd5)) { 707 if (IS_ERR(server->secmech.hmacmd5)) {
708 cERROR(1, "could not allocate crypto hmacmd5\n"); 708 cERROR(1, "could not allocate crypto hmacmd5");
709 return PTR_ERR(server->secmech.hmacmd5); 709 return PTR_ERR(server->secmech.hmacmd5);
710 } 710 }
711 711
712 server->secmech.md5 = crypto_alloc_shash("md5", 0, 0); 712 server->secmech.md5 = crypto_alloc_shash("md5", 0, 0);
713 if (IS_ERR(server->secmech.md5)) { 713 if (IS_ERR(server->secmech.md5)) {
714 cERROR(1, "could not allocate crypto md5\n"); 714 cERROR(1, "could not allocate crypto md5");
715 rc = PTR_ERR(server->secmech.md5); 715 rc = PTR_ERR(server->secmech.md5);
716 goto crypto_allocate_md5_fail; 716 goto crypto_allocate_md5_fail;
717 } 717 }
@@ -720,7 +720,7 @@ cifs_crypto_shash_allocate(struct TCP_Server_Info *server)
720 crypto_shash_descsize(server->secmech.hmacmd5); 720 crypto_shash_descsize(server->secmech.hmacmd5);
721 server->secmech.sdeschmacmd5 = kmalloc(size, GFP_KERNEL); 721 server->secmech.sdeschmacmd5 = kmalloc(size, GFP_KERNEL);
722 if (!server->secmech.sdeschmacmd5) { 722 if (!server->secmech.sdeschmacmd5) {
723 cERROR(1, "cifs_crypto_shash_allocate: can't alloc hmacmd5\n"); 723 cERROR(1, "cifs_crypto_shash_allocate: can't alloc hmacmd5");
724 rc = -ENOMEM; 724 rc = -ENOMEM;
725 goto crypto_allocate_hmacmd5_sdesc_fail; 725 goto crypto_allocate_hmacmd5_sdesc_fail;
726 } 726 }
@@ -732,7 +732,7 @@ cifs_crypto_shash_allocate(struct TCP_Server_Info *server)
732 crypto_shash_descsize(server->secmech.md5); 732 crypto_shash_descsize(server->secmech.md5);
733 server->secmech.sdescmd5 = kmalloc(size, GFP_KERNEL); 733 server->secmech.sdescmd5 = kmalloc(size, GFP_KERNEL);
734 if (!server->secmech.sdescmd5) { 734 if (!server->secmech.sdescmd5) {
735 cERROR(1, "cifs_crypto_shash_allocate: can't alloc md5\n"); 735 cERROR(1, "cifs_crypto_shash_allocate: can't alloc md5");
736 rc = -ENOMEM; 736 rc = -ENOMEM;
737 goto crypto_allocate_md5_sdesc_fail; 737 goto crypto_allocate_md5_sdesc_fail;
738 } 738 }
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index a7610cfedf0a..db8a404a51dd 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -48,6 +48,9 @@
48#include <linux/key-type.h> 48#include <linux/key-type.h>
49#include "cifs_spnego.h" 49#include "cifs_spnego.h"
50#include "fscache.h" 50#include "fscache.h"
51#ifdef CONFIG_CIFS_SMB2
52#include "smb2pdu.h"
53#endif
51#define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */ 54#define CIFS_MAGIC_NUMBER 0xFF534D42 /* the first four bytes of SMB PDUs */
52 55
53int cifsFYI = 0; 56int cifsFYI = 0;
@@ -158,9 +161,9 @@ cifs_statfs(struct dentry *dentry, struct kstatfs *buf)
158 struct cifs_sb_info *cifs_sb = CIFS_SB(sb); 161 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
159 struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb); 162 struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb);
160 int rc = -EOPNOTSUPP; 163 int rc = -EOPNOTSUPP;
161 int xid; 164 unsigned int xid;
162 165
163 xid = GetXid(); 166 xid = get_xid();
164 167
165 buf->f_type = CIFS_MAGIC_NUMBER; 168 buf->f_type = CIFS_MAGIC_NUMBER;
166 169
@@ -197,7 +200,7 @@ cifs_statfs(struct dentry *dentry, struct kstatfs *buf)
197 if (rc) 200 if (rc)
198 rc = SMBOldQFSInfo(xid, tcon, buf); 201 rc = SMBOldQFSInfo(xid, tcon, buf);
199 202
200 FreeXid(xid); 203 free_xid(xid);
201 return 0; 204 return 0;
202} 205}
203 206
@@ -546,8 +549,8 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb)
546 char *s, *p; 549 char *s, *p;
547 char sep; 550 char sep;
548 551
549 full_path = cifs_build_path_to_root(vol, cifs_sb, 552 full_path = build_path_to_root(vol, cifs_sb,
550 cifs_sb_master_tcon(cifs_sb)); 553 cifs_sb_master_tcon(cifs_sb));
551 if (full_path == NULL) 554 if (full_path == NULL)
552 return ERR_PTR(-ENOMEM); 555 return ERR_PTR(-ENOMEM);
553 556
@@ -980,6 +983,14 @@ cifs_destroy_inodecache(void)
980static int 983static int
981cifs_init_request_bufs(void) 984cifs_init_request_bufs(void)
982{ 985{
986 size_t max_hdr_size = MAX_CIFS_HDR_SIZE;
987#ifdef CONFIG_CIFS_SMB2
988 /*
989 * SMB2 maximum header size is bigger than CIFS one - no problems to
990 * allocate some more bytes for CIFS.
991 */
992 max_hdr_size = MAX_SMB2_HDR_SIZE;
993#endif
983 if (CIFSMaxBufSize < 8192) { 994 if (CIFSMaxBufSize < 8192) {
984 /* Buffer size can not be smaller than 2 * PATH_MAX since maximum 995 /* Buffer size can not be smaller than 2 * PATH_MAX since maximum
985 Unicode path name has to fit in any SMB/CIFS path based frames */ 996 Unicode path name has to fit in any SMB/CIFS path based frames */
@@ -991,8 +1002,7 @@ cifs_init_request_bufs(void)
991 } 1002 }
992/* cERROR(1, "CIFSMaxBufSize %d 0x%x",CIFSMaxBufSize,CIFSMaxBufSize); */ 1003/* cERROR(1, "CIFSMaxBufSize %d 0x%x",CIFSMaxBufSize,CIFSMaxBufSize); */
993 cifs_req_cachep = kmem_cache_create("cifs_request", 1004 cifs_req_cachep = kmem_cache_create("cifs_request",
994 CIFSMaxBufSize + 1005 CIFSMaxBufSize + max_hdr_size, 0,
995 MAX_CIFS_HDR_SIZE, 0,
996 SLAB_HWCACHE_ALIGN, NULL); 1006 SLAB_HWCACHE_ALIGN, NULL);
997 if (cifs_req_cachep == NULL) 1007 if (cifs_req_cachep == NULL)
998 return -ENOMEM; 1008 return -ENOMEM;
diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
index 6df0cbe1cbc9..497da5ce704c 100644
--- a/fs/cifs/cifsglob.h
+++ b/fs/cifs/cifsglob.h
@@ -22,11 +22,15 @@
22#include <linux/in.h> 22#include <linux/in.h>
23#include <linux/in6.h> 23#include <linux/in6.h>
24#include <linux/slab.h> 24#include <linux/slab.h>
25#include <linux/mempool.h>
25#include <linux/workqueue.h> 26#include <linux/workqueue.h>
26#include "cifs_fs_sb.h" 27#include "cifs_fs_sb.h"
27#include "cifsacl.h" 28#include "cifsacl.h"
28#include <crypto/internal/hash.h> 29#include <crypto/internal/hash.h>
29#include <linux/scatterlist.h> 30#include <linux/scatterlist.h>
31#ifdef CONFIG_CIFS_SMB2
32#include "smb2pdu.h"
33#endif
30 34
31/* 35/*
32 * The sizes of various internal tables and strings 36 * The sizes of various internal tables and strings
@@ -72,6 +76,9 @@
72/* (max path length + 1 for null) * 2 for unicode */ 76/* (max path length + 1 for null) * 2 for unicode */
73#define MAX_NAME 514 77#define MAX_NAME 514
74 78
79/* SMB echo "timeout" -- FIXME: tunable? */
80#define SMB_ECHO_INTERVAL (60 * HZ)
81
75#include "cifspdu.h" 82#include "cifspdu.h"
76 83
77#ifndef XATTR_DOS_ATTRIB 84#ifndef XATTR_DOS_ATTRIB
@@ -160,6 +167,10 @@ struct mid_q_entry;
160struct TCP_Server_Info; 167struct TCP_Server_Info;
161struct cifsFileInfo; 168struct cifsFileInfo;
162struct cifs_ses; 169struct cifs_ses;
170struct cifs_tcon;
171struct dfs_info3_param;
172struct cifs_fattr;
173struct smb_vol;
163 174
164struct smb_version_operations { 175struct smb_version_operations {
165 int (*send_cancel)(struct TCP_Server_Info *, void *, 176 int (*send_cancel)(struct TCP_Server_Info *, void *,
@@ -168,12 +179,17 @@ struct smb_version_operations {
168 /* setup request: allocate mid, sign message */ 179 /* setup request: allocate mid, sign message */
169 int (*setup_request)(struct cifs_ses *, struct kvec *, unsigned int, 180 int (*setup_request)(struct cifs_ses *, struct kvec *, unsigned int,
170 struct mid_q_entry **); 181 struct mid_q_entry **);
182 /* setup async request: allocate mid, sign message */
183 int (*setup_async_request)(struct TCP_Server_Info *, struct kvec *,
184 unsigned int, struct mid_q_entry **);
171 /* check response: verify signature, map error */ 185 /* check response: verify signature, map error */
172 int (*check_receive)(struct mid_q_entry *, struct TCP_Server_Info *, 186 int (*check_receive)(struct mid_q_entry *, struct TCP_Server_Info *,
173 bool); 187 bool);
174 void (*add_credits)(struct TCP_Server_Info *, const unsigned int); 188 void (*add_credits)(struct TCP_Server_Info *, const unsigned int,
189 const int);
175 void (*set_credits)(struct TCP_Server_Info *, const int); 190 void (*set_credits)(struct TCP_Server_Info *, const int);
176 int * (*get_credits_field)(struct TCP_Server_Info *); 191 int * (*get_credits_field)(struct TCP_Server_Info *, const int);
192 unsigned int (*get_credits)(struct mid_q_entry *);
177 __u64 (*get_next_mid)(struct TCP_Server_Info *); 193 __u64 (*get_next_mid)(struct TCP_Server_Info *);
178 /* data offset from read response message */ 194 /* data offset from read response message */
179 unsigned int (*read_data_offset)(char *); 195 unsigned int (*read_data_offset)(char *);
@@ -184,9 +200,52 @@ struct smb_version_operations {
184 /* find mid corresponding to the response message */ 200 /* find mid corresponding to the response message */
185 struct mid_q_entry * (*find_mid)(struct TCP_Server_Info *, char *); 201 struct mid_q_entry * (*find_mid)(struct TCP_Server_Info *, char *);
186 void (*dump_detail)(void *); 202 void (*dump_detail)(void *);
203 void (*clear_stats)(struct cifs_tcon *);
204 void (*print_stats)(struct seq_file *m, struct cifs_tcon *);
187 /* verify the message */ 205 /* verify the message */
188 int (*check_message)(char *, unsigned int); 206 int (*check_message)(char *, unsigned int);
189 bool (*is_oplock_break)(char *, struct TCP_Server_Info *); 207 bool (*is_oplock_break)(char *, struct TCP_Server_Info *);
208 /* process transaction2 response */
209 bool (*check_trans2)(struct mid_q_entry *, struct TCP_Server_Info *,
210 char *, int);
211 /* check if we need to negotiate */
212 bool (*need_neg)(struct TCP_Server_Info *);
213 /* negotiate to the server */
214 int (*negotiate)(const unsigned int, struct cifs_ses *);
215 /* setup smb sessionn */
216 int (*sess_setup)(const unsigned int, struct cifs_ses *,
217 const struct nls_table *);
218 /* close smb session */
219 int (*logoff)(const unsigned int, struct cifs_ses *);
220 /* connect to a server share */
221 int (*tree_connect)(const unsigned int, struct cifs_ses *, const char *,
222 struct cifs_tcon *, const struct nls_table *);
223 /* close tree connecion */
224 int (*tree_disconnect)(const unsigned int, struct cifs_tcon *);
225 /* get DFS referrals */
226 int (*get_dfs_refer)(const unsigned int, struct cifs_ses *,
227 const char *, struct dfs_info3_param **,
228 unsigned int *, const struct nls_table *, int);
229 /* informational QFS call */
230 void (*qfs_tcon)(const unsigned int, struct cifs_tcon *);
231 /* check if a path is accessible or not */
232 int (*is_path_accessible)(const unsigned int, struct cifs_tcon *,
233 struct cifs_sb_info *, const char *);
234 /* query path data from the server */
235 int (*query_path_info)(const unsigned int, struct cifs_tcon *,
236 struct cifs_sb_info *, const char *,
237 FILE_ALL_INFO *, bool *);
238 /* get server index number */
239 int (*get_srv_inum)(const unsigned int, struct cifs_tcon *,
240 struct cifs_sb_info *, const char *,
241 u64 *uniqueid, FILE_ALL_INFO *);
242 /* build a full path to the root of the mount */
243 char * (*build_path_to_root)(struct smb_vol *, struct cifs_sb_info *,
244 struct cifs_tcon *);
245 /* check if we can send an echo or nor */
246 bool (*can_echo)(struct TCP_Server_Info *);
247 /* send echo request */
248 int (*echo)(struct TCP_Server_Info *);
190}; 249};
191 250
192struct smb_version_values { 251struct smb_version_values {
@@ -198,6 +257,10 @@ struct smb_version_values {
198 size_t header_size; 257 size_t header_size;
199 size_t max_header_size; 258 size_t max_header_size;
200 size_t read_rsp_size; 259 size_t read_rsp_size;
260 __le16 lock_cmd;
261 unsigned int cap_unix;
262 unsigned int cap_nt_find;
263 unsigned int cap_large_files;
201}; 264};
202 265
203#define HEADER_SIZE(server) (server->vals->header_size) 266#define HEADER_SIZE(server) (server->vals->header_size)
@@ -291,6 +354,12 @@ get_rfc1002_length(void *buf)
291 return be32_to_cpu(*((__be32 *)buf)); 354 return be32_to_cpu(*((__be32 *)buf));
292} 355}
293 356
357static inline void
358inc_rfc1001_len(void *buf, int count)
359{
360 be32_add_cpu((__be32 *)buf, count);
361}
362
294struct TCP_Server_Info { 363struct TCP_Server_Info {
295 struct list_head tcp_ses_list; 364 struct list_head tcp_ses_list;
296 struct list_head smb_ses_list; 365 struct list_head smb_ses_list;
@@ -319,8 +388,13 @@ struct TCP_Server_Info {
319 struct mutex srv_mutex; 388 struct mutex srv_mutex;
320 struct task_struct *tsk; 389 struct task_struct *tsk;
321 char server_GUID[16]; 390 char server_GUID[16];
322 char sec_mode; 391 __u16 sec_mode;
323 bool session_estab; /* mark when very first sess is established */ 392 bool session_estab; /* mark when very first sess is established */
393#ifdef CONFIG_CIFS_SMB2
394 int echo_credits; /* echo reserved slots */
395 int oplock_credits; /* oplock break reserved slots */
396 bool echoes:1; /* enable echoes */
397#endif
324 u16 dialect; /* dialect index that server chose */ 398 u16 dialect; /* dialect index that server chose */
325 enum securityEnum secType; 399 enum securityEnum secType;
326 bool oplocks:1; /* enable oplocks */ 400 bool oplocks:1; /* enable oplocks */
@@ -337,7 +411,7 @@ struct TCP_Server_Info {
337 unsigned int max_vcs; /* maximum number of smb sessions, at least 411 unsigned int max_vcs; /* maximum number of smb sessions, at least
338 those that can be specified uniquely with 412 those that can be specified uniquely with
339 vcnumbers */ 413 vcnumbers */
340 int capabilities; /* allow selective disabling of caps by smb sess */ 414 unsigned int capabilities; /* selective disabling of caps by smb sess */
341 int timeAdj; /* Adjust for difference in server time zone in sec */ 415 int timeAdj; /* Adjust for difference in server time zone in sec */
342 __u64 CurrentMid; /* multiplex id - rotating counter */ 416 __u64 CurrentMid; /* multiplex id - rotating counter */
343 char cryptkey[CIFS_CRYPTO_KEY_SIZE]; /* used by ntlm, ntlmv2 etc */ 417 char cryptkey[CIFS_CRYPTO_KEY_SIZE]; /* used by ntlm, ntlmv2 etc */
@@ -366,6 +440,10 @@ struct TCP_Server_Info {
366 atomic_t in_send; /* requests trying to send */ 440 atomic_t in_send; /* requests trying to send */
367 atomic_t num_waiters; /* blocked waiting to get in sendrecv */ 441 atomic_t num_waiters; /* blocked waiting to get in sendrecv */
368#endif 442#endif
443#ifdef CONFIG_CIFS_SMB2
444 unsigned int max_read;
445 unsigned int max_write;
446#endif /* CONFIG_CIFS_SMB2 */
369}; 447};
370 448
371static inline unsigned int 449static inline unsigned int
@@ -389,9 +467,10 @@ has_credits(struct TCP_Server_Info *server, int *credits)
389} 467}
390 468
391static inline void 469static inline void
392add_credits(struct TCP_Server_Info *server, const unsigned int add) 470add_credits(struct TCP_Server_Info *server, const unsigned int add,
471 const int optype)
393{ 472{
394 server->ops->add_credits(server, add); 473 server->ops->add_credits(server, add, optype);
395} 474}
396 475
397static inline void 476static inline void
@@ -453,10 +532,10 @@ struct cifs_ses {
453 char *serverOS; /* name of operating system underlying server */ 532 char *serverOS; /* name of operating system underlying server */
454 char *serverNOS; /* name of network operating system of server */ 533 char *serverNOS; /* name of network operating system of server */
455 char *serverDomain; /* security realm of server */ 534 char *serverDomain; /* security realm of server */
456 int Suid; /* remote smb uid */ 535 __u64 Suid; /* remote smb uid */
457 uid_t linux_uid; /* overriding owner of files on the mount */ 536 uid_t linux_uid; /* overriding owner of files on the mount */
458 uid_t cred_uid; /* owner of credentials */ 537 uid_t cred_uid; /* owner of credentials */
459 int capabilities; 538 unsigned int capabilities;
460 char serverName[SERVER_NAME_LEN_WITH_NULL * 2]; /* BB make bigger for 539 char serverName[SERVER_NAME_LEN_WITH_NULL * 2]; /* BB make bigger for
461 TCP names - will ipv6 and sctp addresses fit? */ 540 TCP names - will ipv6 and sctp addresses fit? */
462 char *user_name; /* must not be null except during init of sess 541 char *user_name; /* must not be null except during init of sess
@@ -466,6 +545,9 @@ struct cifs_ses {
466 struct session_key auth_key; 545 struct session_key auth_key;
467 struct ntlmssp_auth *ntlmssp; /* ciphertext, flags, server challenge */ 546 struct ntlmssp_auth *ntlmssp; /* ciphertext, flags, server challenge */
468 bool need_reconnect:1; /* connection reset, uid now invalid */ 547 bool need_reconnect:1; /* connection reset, uid now invalid */
548#ifdef CONFIG_CIFS_SMB2
549 __u16 session_flags;
550#endif /* CONFIG_CIFS_SMB2 */
469}; 551};
470/* no more than one of the following three session flags may be set */ 552/* no more than one of the following three session flags may be set */
471#define CIFS_SES_NT4 1 553#define CIFS_SES_NT4 1
@@ -475,6 +557,13 @@ struct cifs_ses {
475 which do not negotiate NTLM or POSIX dialects, but instead 557 which do not negotiate NTLM or POSIX dialects, but instead
476 negotiate one of the older LANMAN dialects */ 558 negotiate one of the older LANMAN dialects */
477#define CIFS_SES_LANMAN 8 559#define CIFS_SES_LANMAN 8
560
561static inline bool
562cap_unix(struct cifs_ses *ses)
563{
564 return ses->server->vals->cap_unix & ses->capabilities;
565}
566
478/* 567/*
479 * there is one of these for each connection to a resource on a particular 568 * there is one of these for each connection to a resource on a particular
480 * session 569 * session
@@ -487,32 +576,42 @@ struct cifs_tcon {
487 char treeName[MAX_TREE_SIZE + 1]; /* UNC name of resource in ASCII */ 576 char treeName[MAX_TREE_SIZE + 1]; /* UNC name of resource in ASCII */
488 char *nativeFileSystem; 577 char *nativeFileSystem;
489 char *password; /* for share-level security */ 578 char *password; /* for share-level security */
490 __u16 tid; /* The 2 byte tree id */ 579 __u32 tid; /* The 4 byte tree id */
491 __u16 Flags; /* optional support bits */ 580 __u16 Flags; /* optional support bits */
492 enum statusEnum tidStatus; 581 enum statusEnum tidStatus;
493#ifdef CONFIG_CIFS_STATS 582#ifdef CONFIG_CIFS_STATS
494 atomic_t num_smbs_sent; 583 atomic_t num_smbs_sent;
495 atomic_t num_writes; 584 union {
496 atomic_t num_reads; 585 struct {
497 atomic_t num_flushes; 586 atomic_t num_writes;
498 atomic_t num_oplock_brks; 587 atomic_t num_reads;
499 atomic_t num_opens; 588 atomic_t num_flushes;
500 atomic_t num_closes; 589 atomic_t num_oplock_brks;
501 atomic_t num_deletes; 590 atomic_t num_opens;
502 atomic_t num_mkdirs; 591 atomic_t num_closes;
503 atomic_t num_posixopens; 592 atomic_t num_deletes;
504 atomic_t num_posixmkdirs; 593 atomic_t num_mkdirs;
505 atomic_t num_rmdirs; 594 atomic_t num_posixopens;
506 atomic_t num_renames; 595 atomic_t num_posixmkdirs;
507 atomic_t num_t2renames; 596 atomic_t num_rmdirs;
508 atomic_t num_ffirst; 597 atomic_t num_renames;
509 atomic_t num_fnext; 598 atomic_t num_t2renames;
510 atomic_t num_fclose; 599 atomic_t num_ffirst;
511 atomic_t num_hardlinks; 600 atomic_t num_fnext;
512 atomic_t num_symlinks; 601 atomic_t num_fclose;
513 atomic_t num_locks; 602 atomic_t num_hardlinks;
514 atomic_t num_acl_get; 603 atomic_t num_symlinks;
515 atomic_t num_acl_set; 604 atomic_t num_locks;
605 atomic_t num_acl_get;
606 atomic_t num_acl_set;
607 } cifs_stats;
608#ifdef CONFIG_CIFS_SMB2
609 struct {
610 atomic_t smb2_com_sent[NUMBER_OF_SMB2_COMMANDS];
611 atomic_t smb2_com_failed[NUMBER_OF_SMB2_COMMANDS];
612 } smb2_stats;
613#endif /* CONFIG_CIFS_SMB2 */
614 } stats;
516#ifdef CONFIG_CIFS_STATS2 615#ifdef CONFIG_CIFS_STATS2
517 unsigned long long time_writes; 616 unsigned long long time_writes;
518 unsigned long long time_reads; 617 unsigned long long time_reads;
@@ -543,6 +642,15 @@ struct cifs_tcon {
543 bool local_lease:1; /* check leases (only) on local system not remote */ 642 bool local_lease:1; /* check leases (only) on local system not remote */
544 bool broken_posix_open; /* e.g. Samba server versions < 3.3.2, 3.2.9 */ 643 bool broken_posix_open; /* e.g. Samba server versions < 3.3.2, 3.2.9 */
545 bool need_reconnect:1; /* connection reset, tid now invalid */ 644 bool need_reconnect:1; /* connection reset, tid now invalid */
645#ifdef CONFIG_CIFS_SMB2
646 bool print:1; /* set if connection to printer share */
647 bool bad_network_name:1; /* set if ret status STATUS_BAD_NETWORK_NAME */
648 __u32 capabilities;
649 __u32 share_flags;
650 __u32 maximal_access;
651 __u32 vol_serial_number;
652 __le64 vol_create_time;
653#endif /* CONFIG_CIFS_SMB2 */
546#ifdef CONFIG_CIFS_FSCACHE 654#ifdef CONFIG_CIFS_FSCACHE
547 u64 resource_id; /* server resource id */ 655 u64 resource_id; /* server resource id */
548 struct fscache_cookie *fscache; /* cookie for share */ 656 struct fscache_cookie *fscache; /* cookie for share */
@@ -657,13 +765,13 @@ struct cifs_io_parms {
657 * Take a reference on the file private data. Must be called with 765 * Take a reference on the file private data. Must be called with
658 * cifs_file_list_lock held. 766 * cifs_file_list_lock held.
659 */ 767 */
660static inline 768static inline void
661struct cifsFileInfo *cifsFileInfo_get(struct cifsFileInfo *cifs_file) 769cifsFileInfo_get_locked(struct cifsFileInfo *cifs_file)
662{ 770{
663 ++cifs_file->count; 771 ++cifs_file->count;
664 return cifs_file;
665} 772}
666 773
774struct cifsFileInfo *cifsFileInfo_get(struct cifsFileInfo *cifs_file);
667void cifsFileInfo_put(struct cifsFileInfo *cifs_file); 775void cifsFileInfo_put(struct cifsFileInfo *cifs_file);
668 776
669/* 777/*
@@ -734,6 +842,15 @@ convert_delimiter(char *path, char delim)
734 } 842 }
735} 843}
736 844
845static inline char *
846build_path_to_root(struct smb_vol *vol, struct cifs_sb_info *cifs_sb,
847 struct cifs_tcon *tcon)
848{
849 if (!vol->ops->build_path_to_root)
850 return NULL;
851 return vol->ops->build_path_to_root(vol, cifs_sb, tcon);
852}
853
737#ifdef CONFIG_CIFS_STATS 854#ifdef CONFIG_CIFS_STATS
738#define cifs_stats_inc atomic_inc 855#define cifs_stats_inc atomic_inc
739 856
@@ -791,6 +908,7 @@ typedef void (mid_callback_t)(struct mid_q_entry *mid);
791/* one of these for every pending CIFS request to the server */ 908/* one of these for every pending CIFS request to the server */
792struct mid_q_entry { 909struct mid_q_entry {
793 struct list_head qhead; /* mids waiting on reply from this server */ 910 struct list_head qhead; /* mids waiting on reply from this server */
911 struct TCP_Server_Info *server; /* server corresponding to this mid */
794 __u64 mid; /* multiplex id */ 912 __u64 mid; /* multiplex id */
795 __u32 pid; /* process id */ 913 __u32 pid; /* process id */
796 __u32 sequence_number; /* for CIFS signing */ 914 __u32 sequence_number; /* for CIFS signing */
@@ -954,6 +1072,12 @@ static inline void free_dfs_info_array(struct dfs_info3_param *param,
954#define CIFS_LARGE_BUF_OP 0x020 /* large request buffer */ 1072#define CIFS_LARGE_BUF_OP 0x020 /* large request buffer */
955#define CIFS_NO_RESP 0x040 /* no response buffer required */ 1073#define CIFS_NO_RESP 0x040 /* no response buffer required */
956 1074
1075/* Type of request operation */
1076#define CIFS_ECHO_OP 0x080 /* echo request */
1077#define CIFS_OBREAK_OP 0x0100 /* oplock break request */
1078#define CIFS_NEG_OP 0x0200 /* negotiate request */
1079#define CIFS_OP_MASK 0x0380 /* mask request type */
1080
957/* Security Flags: indicate type of session setup needed */ 1081/* Security Flags: indicate type of session setup needed */
958#define CIFSSEC_MAY_SIGN 0x00001 1082#define CIFSSEC_MAY_SIGN 0x00001
959#define CIFSSEC_MAY_NTLM 0x00002 1083#define CIFSSEC_MAY_NTLM 0x00002
@@ -1127,6 +1251,8 @@ void cifs_oplock_break(struct work_struct *work);
1127extern const struct slow_work_ops cifs_oplock_break_ops; 1251extern const struct slow_work_ops cifs_oplock_break_ops;
1128extern struct workqueue_struct *cifsiod_wq; 1252extern struct workqueue_struct *cifsiod_wq;
1129 1253
1254extern mempool_t *cifs_mid_poolp;
1255
1130/* Operations for different SMB versions */ 1256/* Operations for different SMB versions */
1131#define SMB1_VERSION_STRING "1.0" 1257#define SMB1_VERSION_STRING "1.0"
1132extern struct smb_version_operations smb1_operations; 1258extern struct smb_version_operations smb1_operations;
diff --git a/fs/cifs/cifsproto.h b/fs/cifs/cifsproto.h
index 0a6cbfe2761e..cf7fb185103c 100644
--- a/fs/cifs/cifsproto.h
+++ b/fs/cifs/cifsproto.h
@@ -37,29 +37,26 @@ extern struct smb_hdr *cifs_small_buf_get(void);
37extern void cifs_small_buf_release(void *); 37extern void cifs_small_buf_release(void *);
38extern int smb_send(struct TCP_Server_Info *, struct smb_hdr *, 38extern int smb_send(struct TCP_Server_Info *, struct smb_hdr *,
39 unsigned int /* length */); 39 unsigned int /* length */);
40extern unsigned int _GetXid(void); 40extern unsigned int _get_xid(void);
41extern void _FreeXid(unsigned int); 41extern void _free_xid(unsigned int);
42#define GetXid() \ 42#define get_xid() \
43({ \ 43({ \
44 int __xid = (int)_GetXid(); \ 44 unsigned int __xid = _get_xid(); \
45 cFYI(1, "CIFS VFS: in %s as Xid: %d with uid: %d", \ 45 cFYI(1, "CIFS VFS: in %s as Xid: %u with uid: %d", \
46 __func__, __xid, current_fsuid()); \ 46 __func__, __xid, current_fsuid()); \
47 __xid; \ 47 __xid; \
48}) 48})
49 49
50#define FreeXid(curr_xid) \ 50#define free_xid(curr_xid) \
51do { \ 51do { \
52 _FreeXid(curr_xid); \ 52 _free_xid(curr_xid); \
53 cFYI(1, "CIFS VFS: leaving %s (xid = %d) rc = %d", \ 53 cFYI(1, "CIFS VFS: leaving %s (xid = %u) rc = %d", \
54 __func__, curr_xid, (int)rc); \ 54 __func__, curr_xid, (int)rc); \
55} while (0) 55} while (0)
56extern int init_cifs_idmap(void); 56extern int init_cifs_idmap(void);
57extern void exit_cifs_idmap(void); 57extern void exit_cifs_idmap(void);
58extern void cifs_destroy_idmaptrees(void); 58extern void cifs_destroy_idmaptrees(void);
59extern char *build_path_from_dentry(struct dentry *); 59extern char *build_path_from_dentry(struct dentry *);
60extern char *cifs_build_path_to_root(struct smb_vol *vol,
61 struct cifs_sb_info *cifs_sb,
62 struct cifs_tcon *tcon);
63extern char *build_wildcard_path_from_dentry(struct dentry *direntry); 60extern char *build_wildcard_path_from_dentry(struct dentry *direntry);
64extern char *cifs_compose_mount_options(const char *sb_mountdata, 61extern char *cifs_compose_mount_options(const char *sb_mountdata,
65 const char *fullpath, const struct dfs_info3_param *ref, 62 const char *fullpath, const struct dfs_info3_param *ref,
@@ -68,18 +65,21 @@ extern char *cifs_compose_mount_options(const char *sb_mountdata,
68extern struct mid_q_entry *AllocMidQEntry(const struct smb_hdr *smb_buffer, 65extern struct mid_q_entry *AllocMidQEntry(const struct smb_hdr *smb_buffer,
69 struct TCP_Server_Info *server); 66 struct TCP_Server_Info *server);
70extern void DeleteMidQEntry(struct mid_q_entry *midEntry); 67extern void DeleteMidQEntry(struct mid_q_entry *midEntry);
68extern void cifs_wake_up_task(struct mid_q_entry *mid);
71extern int cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov, 69extern int cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov,
72 unsigned int nvec, mid_receive_t *receive, 70 unsigned int nvec, mid_receive_t *receive,
73 mid_callback_t *callback, void *cbdata, 71 mid_callback_t *callback, void *cbdata,
74 bool ignore_pend); 72 const int flags);
75extern int SendReceive(const unsigned int /* xid */ , struct cifs_ses *, 73extern int SendReceive(const unsigned int /* xid */ , struct cifs_ses *,
76 struct smb_hdr * /* input */ , 74 struct smb_hdr * /* input */ ,
77 struct smb_hdr * /* out */ , 75 struct smb_hdr * /* out */ ,
78 int * /* bytes returned */ , const int long_op); 76 int * /* bytes returned */ , const int);
79extern int SendReceiveNoRsp(const unsigned int xid, struct cifs_ses *ses, 77extern int SendReceiveNoRsp(const unsigned int xid, struct cifs_ses *ses,
80 char *in_buf, int flags); 78 char *in_buf, int flags);
81extern int cifs_setup_request(struct cifs_ses *, struct kvec *, unsigned int, 79extern int cifs_setup_request(struct cifs_ses *, struct kvec *, unsigned int,
82 struct mid_q_entry **); 80 struct mid_q_entry **);
81extern int cifs_setup_async_request(struct TCP_Server_Info *, struct kvec *,
82 unsigned int, struct mid_q_entry **);
83extern int cifs_check_receive(struct mid_q_entry *mid, 83extern int cifs_check_receive(struct mid_q_entry *mid,
84 struct TCP_Server_Info *server, bool log_error); 84 struct TCP_Server_Info *server, bool log_error);
85extern int SendReceive2(const unsigned int /* xid */ , struct cifs_ses *, 85extern int SendReceive2(const unsigned int /* xid */ , struct cifs_ses *,
@@ -90,6 +90,7 @@ extern int SendReceiveBlockingLock(const unsigned int xid,
90 struct smb_hdr *in_buf , 90 struct smb_hdr *in_buf ,
91 struct smb_hdr *out_buf, 91 struct smb_hdr *out_buf,
92 int *bytes_returned); 92 int *bytes_returned);
93extern int cifs_reconnect(struct TCP_Server_Info *server);
93extern int checkSMB(char *buf, unsigned int length); 94extern int checkSMB(char *buf, unsigned int length);
94extern bool is_valid_oplock_break(char *, struct TCP_Server_Info *); 95extern bool is_valid_oplock_break(char *, struct TCP_Server_Info *);
95extern bool backup_cred(struct cifs_sb_info *); 96extern bool backup_cred(struct cifs_sb_info *);
@@ -112,8 +113,8 @@ extern void header_assemble(struct smb_hdr *, char /* command */ ,
112extern int small_smb_init_no_tc(const int smb_cmd, const int wct, 113extern int small_smb_init_no_tc(const int smb_cmd, const int wct,
113 struct cifs_ses *ses, 114 struct cifs_ses *ses,
114 void **request_buf); 115 void **request_buf);
115extern int CIFS_SessSetup(unsigned int xid, struct cifs_ses *ses, 116extern int CIFS_SessSetup(const unsigned int xid, struct cifs_ses *ses,
116 const struct nls_table *nls_cp); 117 const struct nls_table *nls_cp);
117extern struct timespec cifs_NTtimeToUnix(__le64 utc_nanoseconds_since_1601); 118extern struct timespec cifs_NTtimeToUnix(__le64 utc_nanoseconds_since_1601);
118extern u64 cifs_UnixTimeToNT(struct timespec); 119extern u64 cifs_UnixTimeToNT(struct timespec);
119extern struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time, 120extern struct timespec cnvrtDosUnixTm(__le16 le_date, __le16 le_time,
@@ -123,10 +124,10 @@ extern void cifs_set_oplock_level(struct cifsInodeInfo *cinode, __u32 oplock);
123extern struct cifsFileInfo *cifs_new_fileinfo(__u16 fileHandle, 124extern struct cifsFileInfo *cifs_new_fileinfo(__u16 fileHandle,
124 struct file *file, struct tcon_link *tlink, 125 struct file *file, struct tcon_link *tlink,
125 __u32 oplock); 126 __u32 oplock);
126extern int cifs_posix_open(char *full_path, struct inode **pinode, 127extern int cifs_posix_open(char *full_path, struct inode **inode,
127 struct super_block *sb, 128 struct super_block *sb, int mode,
128 int mode, unsigned int f_flags, 129 unsigned int f_flags, __u32 *oplock, __u16 *netfid,
129 __u32 *poplock, __u16 *pnetfid, int xid); 130 unsigned int xid);
130void cifs_fill_uniqueid(struct super_block *sb, struct cifs_fattr *fattr); 131void cifs_fill_uniqueid(struct super_block *sb, struct cifs_fattr *fattr);
131extern void cifs_unix_basic_to_fattr(struct cifs_fattr *fattr, 132extern void cifs_unix_basic_to_fattr(struct cifs_fattr *fattr,
132 FILE_UNIX_BASIC_INFO *info, 133 FILE_UNIX_BASIC_INFO *info,
@@ -136,14 +137,13 @@ extern struct inode *cifs_iget(struct super_block *sb,
136 struct cifs_fattr *fattr); 137 struct cifs_fattr *fattr);
137 138
138extern int cifs_get_file_info(struct file *filp); 139extern int cifs_get_file_info(struct file *filp);
139extern int cifs_get_inode_info(struct inode **pinode, 140extern int cifs_get_inode_info(struct inode **inode, const char *full_path,
140 const unsigned char *search_path, 141 FILE_ALL_INFO *data, struct super_block *sb,
141 FILE_ALL_INFO *pfile_info, 142 int xid, const __u16 *fid);
142 struct super_block *sb, int xid, const __u16 *pfid);
143extern int cifs_get_file_info_unix(struct file *filp); 143extern int cifs_get_file_info_unix(struct file *filp);
144extern int cifs_get_inode_info_unix(struct inode **pinode, 144extern int cifs_get_inode_info_unix(struct inode **pinode,
145 const unsigned char *search_path, 145 const unsigned char *search_path,
146 struct super_block *sb, int xid); 146 struct super_block *sb, unsigned int xid);
147extern int cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb, 147extern int cifs_acl_to_fattr(struct cifs_sb_info *cifs_sb,
148 struct cifs_fattr *fattr, struct inode *inode, 148 struct cifs_fattr *fattr, struct inode *inode,
149 const char *path, const __u16 *pfid); 149 const char *path, const __u16 *pfid);
@@ -168,6 +168,7 @@ extern struct smb_vol *cifs_get_volume_info(char *mount_data,
168 const char *devname); 168 const char *devname);
169extern int cifs_mount(struct cifs_sb_info *, struct smb_vol *); 169extern int cifs_mount(struct cifs_sb_info *, struct smb_vol *);
170extern void cifs_umount(struct cifs_sb_info *); 170extern void cifs_umount(struct cifs_sb_info *);
171extern void cifs_mark_open_files_invalid(struct cifs_tcon *tcon);
171 172
172#if IS_ENABLED(CONFIG_CIFS_DFS_UPCALL) 173#if IS_ENABLED(CONFIG_CIFS_DFS_UPCALL)
173extern void cifs_dfs_release_automount_timer(void); 174extern void cifs_dfs_release_automount_timer(void);
@@ -178,98 +179,97 @@ extern void cifs_dfs_release_automount_timer(void);
178void cifs_proc_init(void); 179void cifs_proc_init(void);
179void cifs_proc_clean(void); 180void cifs_proc_clean(void);
180 181
181extern int cifs_negotiate_protocol(unsigned int xid, 182extern int cifs_negotiate_protocol(const unsigned int xid,
182 struct cifs_ses *ses); 183 struct cifs_ses *ses);
183extern int cifs_setup_session(unsigned int xid, struct cifs_ses *ses, 184extern int cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
184 struct nls_table *nls_info); 185 struct nls_table *nls_info);
185extern int CIFSSMBNegotiate(unsigned int xid, struct cifs_ses *ses); 186extern int CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses);
186 187
187extern int CIFSTCon(unsigned int xid, struct cifs_ses *ses, 188extern int CIFSTCon(const unsigned int xid, struct cifs_ses *ses,
188 const char *tree, struct cifs_tcon *tcon, 189 const char *tree, struct cifs_tcon *tcon,
189 const struct nls_table *); 190 const struct nls_table *);
190 191
191extern int CIFSFindFirst(const int xid, struct cifs_tcon *tcon, 192extern int CIFSFindFirst(const unsigned int xid, struct cifs_tcon *tcon,
192 const char *searchName, const struct nls_table *nls_codepage, 193 const char *searchName, const struct nls_table *nls_codepage,
193 __u16 *searchHandle, __u16 search_flags, 194 __u16 *searchHandle, __u16 search_flags,
194 struct cifs_search_info *psrch_inf, 195 struct cifs_search_info *psrch_inf,
195 int map, const char dirsep); 196 int map, const char dirsep);
196 197
197extern int CIFSFindNext(const int xid, struct cifs_tcon *tcon, 198extern int CIFSFindNext(const unsigned int xid, struct cifs_tcon *tcon,
198 __u16 searchHandle, __u16 search_flags, 199 __u16 searchHandle, __u16 search_flags,
199 struct cifs_search_info *psrch_inf); 200 struct cifs_search_info *psrch_inf);
200 201
201extern int CIFSFindClose(const int, struct cifs_tcon *tcon, 202extern int CIFSFindClose(const unsigned int xid, struct cifs_tcon *tcon,
202 const __u16 search_handle); 203 const __u16 search_handle);
203 204
204extern int CIFSSMBQFileInfo(const int xid, struct cifs_tcon *tcon, 205extern int CIFSSMBQFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
205 u16 netfid, FILE_ALL_INFO *pFindData); 206 u16 netfid, FILE_ALL_INFO *pFindData);
206extern int CIFSSMBQPathInfo(const int xid, struct cifs_tcon *tcon, 207extern int CIFSSMBQPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
207 const unsigned char *searchName, 208 const char *search_Name, FILE_ALL_INFO *data,
208 FILE_ALL_INFO *findData, 209 int legacy /* whether to use old info level */,
209 int legacy /* whether to use old info level */, 210 const struct nls_table *nls_codepage, int remap);
210 const struct nls_table *nls_codepage, int remap); 211extern int SMBQueryInformation(const unsigned int xid, struct cifs_tcon *tcon,
211extern int SMBQueryInformation(const int xid, struct cifs_tcon *tcon, 212 const char *search_name, FILE_ALL_INFO *data,
212 const unsigned char *searchName, 213 const struct nls_table *nls_codepage, int remap);
213 FILE_ALL_INFO *findData, 214
214 const struct nls_table *nls_codepage, int remap); 215extern int CIFSSMBUnixQFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
215
216extern int CIFSSMBUnixQFileInfo(const int xid, struct cifs_tcon *tcon,
217 u16 netfid, FILE_UNIX_BASIC_INFO *pFindData); 216 u16 netfid, FILE_UNIX_BASIC_INFO *pFindData);
218extern int CIFSSMBUnixQPathInfo(const int xid, 217extern int CIFSSMBUnixQPathInfo(const unsigned int xid,
219 struct cifs_tcon *tcon, 218 struct cifs_tcon *tcon,
220 const unsigned char *searchName, 219 const unsigned char *searchName,
221 FILE_UNIX_BASIC_INFO *pFindData, 220 FILE_UNIX_BASIC_INFO *pFindData,
222 const struct nls_table *nls_codepage, int remap); 221 const struct nls_table *nls_codepage, int remap);
223 222
224extern int CIFSGetDFSRefer(const int xid, struct cifs_ses *ses, 223extern int CIFSGetDFSRefer(const unsigned int xid, struct cifs_ses *ses,
225 const unsigned char *searchName, 224 const char *search_name,
226 struct dfs_info3_param **target_nodes, 225 struct dfs_info3_param **target_nodes,
227 unsigned int *number_of_nodes_in_array, 226 unsigned int *num_of_nodes,
228 const struct nls_table *nls_codepage, int remap); 227 const struct nls_table *nls_codepage, int remap);
229 228
230extern int get_dfs_path(int xid, struct cifs_ses *pSesInfo, 229extern int get_dfs_path(const unsigned int xid, struct cifs_ses *ses,
231 const char *old_path, 230 const char *old_path,
232 const struct nls_table *nls_codepage, 231 const struct nls_table *nls_codepage,
233 unsigned int *pnum_referrals, 232 unsigned int *num_referrals,
234 struct dfs_info3_param **preferrals, 233 struct dfs_info3_param **referrals, int remap);
235 int remap); 234extern void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon,
236extern void reset_cifs_unix_caps(int xid, struct cifs_tcon *tcon,
237 struct cifs_sb_info *cifs_sb, 235 struct cifs_sb_info *cifs_sb,
238 struct smb_vol *vol); 236 struct smb_vol *vol);
239extern int CIFSSMBQFSInfo(const int xid, struct cifs_tcon *tcon, 237extern int CIFSSMBQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
240 struct kstatfs *FSData); 238 struct kstatfs *FSData);
241extern int SMBOldQFSInfo(const int xid, struct cifs_tcon *tcon, 239extern int SMBOldQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
242 struct kstatfs *FSData); 240 struct kstatfs *FSData);
243extern int CIFSSMBSetFSUnixInfo(const int xid, struct cifs_tcon *tcon, 241extern int CIFSSMBSetFSUnixInfo(const unsigned int xid, struct cifs_tcon *tcon,
244 __u64 cap); 242 __u64 cap);
245 243
246extern int CIFSSMBQFSAttributeInfo(const int xid, 244extern int CIFSSMBQFSAttributeInfo(const unsigned int xid,
247 struct cifs_tcon *tcon); 245 struct cifs_tcon *tcon);
248extern int CIFSSMBQFSDeviceInfo(const int xid, struct cifs_tcon *tcon); 246extern int CIFSSMBQFSDeviceInfo(const unsigned int xid, struct cifs_tcon *tcon);
249extern int CIFSSMBQFSUnixInfo(const int xid, struct cifs_tcon *tcon); 247extern int CIFSSMBQFSUnixInfo(const unsigned int xid, struct cifs_tcon *tcon);
250extern int CIFSSMBQFSPosixInfo(const int xid, struct cifs_tcon *tcon, 248extern int CIFSSMBQFSPosixInfo(const unsigned int xid, struct cifs_tcon *tcon,
251 struct kstatfs *FSData); 249 struct kstatfs *FSData);
252 250
253extern int CIFSSMBSetPathInfo(const int xid, struct cifs_tcon *tcon, 251extern int CIFSSMBSetPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
254 const char *fileName, const FILE_BASIC_INFO *data, 252 const char *fileName, const FILE_BASIC_INFO *data,
255 const struct nls_table *nls_codepage, 253 const struct nls_table *nls_codepage,
256 int remap_special_chars); 254 int remap_special_chars);
257extern int CIFSSMBSetFileInfo(const int xid, struct cifs_tcon *tcon, 255extern int CIFSSMBSetFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
258 const FILE_BASIC_INFO *data, __u16 fid, 256 const FILE_BASIC_INFO *data, __u16 fid,
259 __u32 pid_of_opener); 257 __u32 pid_of_opener);
260extern int CIFSSMBSetFileDisposition(const int xid, struct cifs_tcon *tcon, 258extern int CIFSSMBSetFileDisposition(const unsigned int xid,
261 bool delete_file, __u16 fid, __u32 pid_of_opener); 259 struct cifs_tcon *tcon,
260 bool delete_file, __u16 fid,
261 __u32 pid_of_opener);
262#if 0 262#if 0
263extern int CIFSSMBSetAttrLegacy(int xid, struct cifs_tcon *tcon, 263extern int CIFSSMBSetAttrLegacy(unsigned int xid, struct cifs_tcon *tcon,
264 char *fileName, __u16 dos_attributes, 264 char *fileName, __u16 dos_attributes,
265 const struct nls_table *nls_codepage); 265 const struct nls_table *nls_codepage);
266#endif /* possibly unneeded function */ 266#endif /* possibly unneeded function */
267extern int CIFSSMBSetEOF(const int xid, struct cifs_tcon *tcon, 267extern int CIFSSMBSetEOF(const unsigned int xid, struct cifs_tcon *tcon,
268 const char *fileName, __u64 size, 268 const char *fileName, __u64 size,
269 bool setAllocationSizeFlag, 269 bool setAllocationSizeFlag,
270 const struct nls_table *nls_codepage, 270 const struct nls_table *nls_codepage,
271 int remap_special_chars); 271 int remap_special_chars);
272extern int CIFSSMBSetFileSize(const int xid, struct cifs_tcon *tcon, 272extern int CIFSSMBSetFileSize(const unsigned int xid, struct cifs_tcon *tcon,
273 __u64 size, __u16 fileHandle, __u32 opener_pid, 273 __u64 size, __u16 fileHandle, __u32 opener_pid,
274 bool AllocSizeFlag); 274 bool AllocSizeFlag);
275 275
@@ -283,114 +283,117 @@ struct cifs_unix_set_info_args {
283 dev_t device; 283 dev_t device;
284}; 284};
285 285
286extern int CIFSSMBUnixSetFileInfo(const int xid, struct cifs_tcon *tcon, 286extern int CIFSSMBUnixSetFileInfo(const unsigned int xid,
287 struct cifs_tcon *tcon,
287 const struct cifs_unix_set_info_args *args, 288 const struct cifs_unix_set_info_args *args,
288 u16 fid, u32 pid_of_opener); 289 u16 fid, u32 pid_of_opener);
289 290
290extern int CIFSSMBUnixSetPathInfo(const int xid, struct cifs_tcon *pTcon, 291extern int CIFSSMBUnixSetPathInfo(const unsigned int xid,
291 char *fileName, 292 struct cifs_tcon *tcon, char *file_name,
292 const struct cifs_unix_set_info_args *args, 293 const struct cifs_unix_set_info_args *args,
293 const struct nls_table *nls_codepage, 294 const struct nls_table *nls_codepage,
294 int remap_special_chars); 295 int remap_special_chars);
295 296
296extern int CIFSSMBMkDir(const int xid, struct cifs_tcon *tcon, 297extern int CIFSSMBMkDir(const unsigned int xid, struct cifs_tcon *tcon,
297 const char *newName, 298 const char *newName,
298 const struct nls_table *nls_codepage, 299 const struct nls_table *nls_codepage,
299 int remap_special_chars); 300 int remap_special_chars);
300extern int CIFSSMBRmDir(const int xid, struct cifs_tcon *tcon, 301extern int CIFSSMBRmDir(const unsigned int xid, struct cifs_tcon *tcon,
301 const char *name, const struct nls_table *nls_codepage, 302 const char *name, const struct nls_table *nls_codepage,
302 int remap_special_chars); 303 int remap_special_chars);
303extern int CIFSPOSIXDelFile(const int xid, struct cifs_tcon *tcon, 304extern int CIFSPOSIXDelFile(const unsigned int xid, struct cifs_tcon *tcon,
304 const char *name, __u16 type, 305 const char *name, __u16 type,
305 const struct nls_table *nls_codepage, 306 const struct nls_table *nls_codepage,
306 int remap_special_chars); 307 int remap_special_chars);
307extern int CIFSSMBDelFile(const int xid, struct cifs_tcon *tcon, 308extern int CIFSSMBDelFile(const unsigned int xid, struct cifs_tcon *tcon,
308 const char *name, 309 const char *name,
309 const struct nls_table *nls_codepage, 310 const struct nls_table *nls_codepage,
310 int remap_special_chars); 311 int remap_special_chars);
311extern int CIFSSMBRename(const int xid, struct cifs_tcon *tcon, 312extern int CIFSSMBRename(const unsigned int xid, struct cifs_tcon *tcon,
312 const char *fromName, const char *toName, 313 const char *fromName, const char *toName,
313 const struct nls_table *nls_codepage, 314 const struct nls_table *nls_codepage,
314 int remap_special_chars); 315 int remap_special_chars);
315extern int CIFSSMBRenameOpenFile(const int xid, struct cifs_tcon *pTcon, 316extern int CIFSSMBRenameOpenFile(const unsigned int xid, struct cifs_tcon *tcon,
316 int netfid, const char *target_name, 317 int netfid, const char *target_name,
317 const struct nls_table *nls_codepage, 318 const struct nls_table *nls_codepage,
318 int remap_special_chars); 319 int remap_special_chars);
319extern int CIFSCreateHardLink(const int xid, 320extern int CIFSCreateHardLink(const unsigned int xid,
320 struct cifs_tcon *tcon, 321 struct cifs_tcon *tcon,
321 const char *fromName, const char *toName, 322 const char *fromName, const char *toName,
322 const struct nls_table *nls_codepage, 323 const struct nls_table *nls_codepage,
323 int remap_special_chars); 324 int remap_special_chars);
324extern int CIFSUnixCreateHardLink(const int xid, 325extern int CIFSUnixCreateHardLink(const unsigned int xid,
325 struct cifs_tcon *tcon, 326 struct cifs_tcon *tcon,
326 const char *fromName, const char *toName, 327 const char *fromName, const char *toName,
327 const struct nls_table *nls_codepage, 328 const struct nls_table *nls_codepage,
328 int remap_special_chars); 329 int remap_special_chars);
329extern int CIFSUnixCreateSymLink(const int xid, 330extern int CIFSUnixCreateSymLink(const unsigned int xid,
330 struct cifs_tcon *tcon, 331 struct cifs_tcon *tcon,
331 const char *fromName, const char *toName, 332 const char *fromName, const char *toName,
332 const struct nls_table *nls_codepage); 333 const struct nls_table *nls_codepage);
333extern int CIFSSMBUnixQuerySymLink(const int xid, 334extern int CIFSSMBUnixQuerySymLink(const unsigned int xid,
334 struct cifs_tcon *tcon, 335 struct cifs_tcon *tcon,
335 const unsigned char *searchName, char **syminfo, 336 const unsigned char *searchName, char **syminfo,
336 const struct nls_table *nls_codepage); 337 const struct nls_table *nls_codepage);
337#ifdef CONFIG_CIFS_SYMLINK_EXPERIMENTAL 338#ifdef CONFIG_CIFS_SYMLINK_EXPERIMENTAL
338extern int CIFSSMBQueryReparseLinkInfo(const int xid, 339extern int CIFSSMBQueryReparseLinkInfo(const unsigned int xid,
339 struct cifs_tcon *tcon, 340 struct cifs_tcon *tcon,
340 const unsigned char *searchName, 341 const unsigned char *searchName,
341 char *symlinkinfo, const int buflen, __u16 fid, 342 char *symlinkinfo, const int buflen, __u16 fid,
342 const struct nls_table *nls_codepage); 343 const struct nls_table *nls_codepage);
343#endif /* temporarily unused until cifs_symlink fixed */ 344#endif /* temporarily unused until cifs_symlink fixed */
344extern int CIFSSMBOpen(const int xid, struct cifs_tcon *tcon, 345extern int CIFSSMBOpen(const unsigned int xid, struct cifs_tcon *tcon,
345 const char *fileName, const int disposition, 346 const char *fileName, const int disposition,
346 const int access_flags, const int omode, 347 const int access_flags, const int omode,
347 __u16 *netfid, int *pOplock, FILE_ALL_INFO *, 348 __u16 *netfid, int *pOplock, FILE_ALL_INFO *,
348 const struct nls_table *nls_codepage, int remap); 349 const struct nls_table *nls_codepage, int remap);
349extern int SMBLegacyOpen(const int xid, struct cifs_tcon *tcon, 350extern int SMBLegacyOpen(const unsigned int xid, struct cifs_tcon *tcon,
350 const char *fileName, const int disposition, 351 const char *fileName, const int disposition,
351 const int access_flags, const int omode, 352 const int access_flags, const int omode,
352 __u16 *netfid, int *pOplock, FILE_ALL_INFO *, 353 __u16 *netfid, int *pOplock, FILE_ALL_INFO *,
353 const struct nls_table *nls_codepage, int remap); 354 const struct nls_table *nls_codepage, int remap);
354extern int CIFSPOSIXCreate(const int xid, struct cifs_tcon *tcon, 355extern int CIFSPOSIXCreate(const unsigned int xid, struct cifs_tcon *tcon,
355 u32 posix_flags, __u64 mode, __u16 *netfid, 356 u32 posix_flags, __u64 mode, __u16 *netfid,
356 FILE_UNIX_BASIC_INFO *pRetData, 357 FILE_UNIX_BASIC_INFO *pRetData,
357 __u32 *pOplock, const char *name, 358 __u32 *pOplock, const char *name,
358 const struct nls_table *nls_codepage, int remap); 359 const struct nls_table *nls_codepage, int remap);
359extern int CIFSSMBClose(const int xid, struct cifs_tcon *tcon, 360extern int CIFSSMBClose(const unsigned int xid, struct cifs_tcon *tcon,
360 const int smb_file_id); 361 const int smb_file_id);
361 362
362extern int CIFSSMBFlush(const int xid, struct cifs_tcon *tcon, 363extern int CIFSSMBFlush(const unsigned int xid, struct cifs_tcon *tcon,
363 const int smb_file_id); 364 const int smb_file_id);
364 365
365extern int CIFSSMBRead(const int xid, struct cifs_io_parms *io_parms, 366extern int CIFSSMBRead(const unsigned int xid, struct cifs_io_parms *io_parms,
366 unsigned int *nbytes, char **buf, 367 unsigned int *nbytes, char **buf,
367 int *return_buf_type); 368 int *return_buf_type);
368extern int CIFSSMBWrite(const int xid, struct cifs_io_parms *io_parms, 369extern int CIFSSMBWrite(const unsigned int xid, struct cifs_io_parms *io_parms,
369 unsigned int *nbytes, const char *buf, 370 unsigned int *nbytes, const char *buf,
370 const char __user *ubuf, const int long_op); 371 const char __user *ubuf, const int long_op);
371extern int CIFSSMBWrite2(const int xid, struct cifs_io_parms *io_parms, 372extern int CIFSSMBWrite2(const unsigned int xid, struct cifs_io_parms *io_parms,
372 unsigned int *nbytes, struct kvec *iov, const int nvec, 373 unsigned int *nbytes, struct kvec *iov, const int nvec,
373 const int long_op); 374 const int long_op);
374extern int CIFSGetSrvInodeNumber(const int xid, struct cifs_tcon *tcon, 375extern int CIFSGetSrvInodeNumber(const unsigned int xid, struct cifs_tcon *tcon,
375 const unsigned char *searchName, __u64 *inode_number, 376 const char *search_name, __u64 *inode_number,
376 const struct nls_table *nls_codepage, 377 const struct nls_table *nls_codepage,
377 int remap_special_chars); 378 int remap);
378 379
379extern int cifs_lockv(const int xid, struct cifs_tcon *tcon, const __u16 netfid, 380extern int cifs_lockv(const unsigned int xid, struct cifs_tcon *tcon,
380 const __u8 lock_type, const __u32 num_unlock, 381 const __u16 netfid, const __u8 lock_type,
381 const __u32 num_lock, LOCKING_ANDX_RANGE *buf); 382 const __u32 num_unlock, const __u32 num_lock,
382extern int CIFSSMBLock(const int xid, struct cifs_tcon *tcon, 383 LOCKING_ANDX_RANGE *buf);
384extern int CIFSSMBLock(const unsigned int xid, struct cifs_tcon *tcon,
383 const __u16 netfid, const __u32 netpid, const __u64 len, 385 const __u16 netfid, const __u32 netpid, const __u64 len,
384 const __u64 offset, const __u32 numUnlock, 386 const __u64 offset, const __u32 numUnlock,
385 const __u32 numLock, const __u8 lockType, 387 const __u32 numLock, const __u8 lockType,
386 const bool waitFlag, const __u8 oplock_level); 388 const bool waitFlag, const __u8 oplock_level);
387extern int CIFSSMBPosixLock(const int xid, struct cifs_tcon *tcon, 389extern int CIFSSMBPosixLock(const unsigned int xid, struct cifs_tcon *tcon,
388 const __u16 smb_file_id, const __u32 netpid, 390 const __u16 smb_file_id, const __u32 netpid,
389 const int get_flag, const __u64 len, struct file_lock *, 391 const loff_t start_offset, const __u64 len,
390 const __u16 lock_type, const bool waitFlag); 392 struct file_lock *, const __u16 lock_type,
391extern int CIFSSMBTDis(const int xid, struct cifs_tcon *tcon); 393 const bool waitFlag);
394extern int CIFSSMBTDis(const unsigned int xid, struct cifs_tcon *tcon);
392extern int CIFSSMBEcho(struct TCP_Server_Info *server); 395extern int CIFSSMBEcho(struct TCP_Server_Info *server);
393extern int CIFSSMBLogoff(const int xid, struct cifs_ses *ses); 396extern int CIFSSMBLogoff(const unsigned int xid, struct cifs_ses *ses);
394 397
395extern struct cifs_ses *sesInfoAlloc(void); 398extern struct cifs_ses *sesInfoAlloc(void);
396extern void sesInfoFree(struct cifs_ses *); 399extern void sesInfoFree(struct cifs_ses *);
@@ -398,7 +401,7 @@ extern struct cifs_tcon *tconInfoAlloc(void);
398extern void tconInfoFree(struct cifs_tcon *); 401extern void tconInfoFree(struct cifs_tcon *);
399 402
400extern int cifs_sign_smb(struct smb_hdr *, struct TCP_Server_Info *, __u32 *); 403extern int cifs_sign_smb(struct smb_hdr *, struct TCP_Server_Info *, __u32 *);
401extern int cifs_sign_smb2(struct kvec *iov, int n_vec, struct TCP_Server_Info *, 404extern int cifs_sign_smbv(struct kvec *iov, int n_vec, struct TCP_Server_Info *,
402 __u32 *); 405 __u32 *);
403extern int cifs_verify_signature(struct kvec *iov, unsigned int nr_iov, 406extern int cifs_verify_signature(struct kvec *iov, unsigned int nr_iov,
404 struct TCP_Server_Info *server, 407 struct TCP_Server_Info *server,
@@ -416,46 +419,46 @@ extern int calc_lanman_hash(const char *password, const char *cryptkey,
416 bool encrypt, char *lnm_session_key); 419 bool encrypt, char *lnm_session_key);
417#endif /* CIFS_WEAK_PW_HASH */ 420#endif /* CIFS_WEAK_PW_HASH */
418#ifdef CONFIG_CIFS_DNOTIFY_EXPERIMENTAL /* unused temporarily */ 421#ifdef CONFIG_CIFS_DNOTIFY_EXPERIMENTAL /* unused temporarily */
419extern int CIFSSMBNotify(const int xid, struct cifs_tcon *tcon, 422extern int CIFSSMBNotify(const unsigned int xid, struct cifs_tcon *tcon,
420 const int notify_subdirs, const __u16 netfid, 423 const int notify_subdirs, const __u16 netfid,
421 __u32 filter, struct file *file, int multishot, 424 __u32 filter, struct file *file, int multishot,
422 const struct nls_table *nls_codepage); 425 const struct nls_table *nls_codepage);
423#endif /* was needed for dnotify, and will be needed for inotify when VFS fix */ 426#endif /* was needed for dnotify, and will be needed for inotify when VFS fix */
424extern int CIFSSMBCopy(int xid, 427extern int CIFSSMBCopy(unsigned int xid,
425 struct cifs_tcon *source_tcon, 428 struct cifs_tcon *source_tcon,
426 const char *fromName, 429 const char *fromName,
427 const __u16 target_tid, 430 const __u16 target_tid,
428 const char *toName, const int flags, 431 const char *toName, const int flags,
429 const struct nls_table *nls_codepage, 432 const struct nls_table *nls_codepage,
430 int remap_special_chars); 433 int remap_special_chars);
431extern ssize_t CIFSSMBQAllEAs(const int xid, struct cifs_tcon *tcon, 434extern ssize_t CIFSSMBQAllEAs(const unsigned int xid, struct cifs_tcon *tcon,
432 const unsigned char *searchName, 435 const unsigned char *searchName,
433 const unsigned char *ea_name, char *EAData, 436 const unsigned char *ea_name, char *EAData,
434 size_t bufsize, const struct nls_table *nls_codepage, 437 size_t bufsize, const struct nls_table *nls_codepage,
435 int remap_special_chars); 438 int remap_special_chars);
436extern int CIFSSMBSetEA(const int xid, struct cifs_tcon *tcon, 439extern int CIFSSMBSetEA(const unsigned int xid, struct cifs_tcon *tcon,
437 const char *fileName, const char *ea_name, 440 const char *fileName, const char *ea_name,
438 const void *ea_value, const __u16 ea_value_len, 441 const void *ea_value, const __u16 ea_value_len,
439 const struct nls_table *nls_codepage, int remap_special_chars); 442 const struct nls_table *nls_codepage, int remap_special_chars);
440extern int CIFSSMBGetCIFSACL(const int xid, struct cifs_tcon *tcon, 443extern int CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon,
441 __u16 fid, struct cifs_ntsd **acl_inf, __u32 *buflen); 444 __u16 fid, struct cifs_ntsd **acl_inf, __u32 *buflen);
442extern int CIFSSMBSetCIFSACL(const int, struct cifs_tcon *, __u16, 445extern int CIFSSMBSetCIFSACL(const unsigned int, struct cifs_tcon *, __u16,
443 struct cifs_ntsd *, __u32, int); 446 struct cifs_ntsd *, __u32, int);
444extern int CIFSSMBGetPosixACL(const int xid, struct cifs_tcon *tcon, 447extern int CIFSSMBGetPosixACL(const unsigned int xid, struct cifs_tcon *tcon,
445 const unsigned char *searchName, 448 const unsigned char *searchName,
446 char *acl_inf, const int buflen, const int acl_type, 449 char *acl_inf, const int buflen, const int acl_type,
447 const struct nls_table *nls_codepage, int remap_special_chars); 450 const struct nls_table *nls_codepage, int remap_special_chars);
448extern int CIFSSMBSetPosixACL(const int xid, struct cifs_tcon *tcon, 451extern int CIFSSMBSetPosixACL(const unsigned int xid, struct cifs_tcon *tcon,
449 const unsigned char *fileName, 452 const unsigned char *fileName,
450 const char *local_acl, const int buflen, const int acl_type, 453 const char *local_acl, const int buflen, const int acl_type,
451 const struct nls_table *nls_codepage, int remap_special_chars); 454 const struct nls_table *nls_codepage, int remap_special_chars);
452extern int CIFSGetExtAttr(const int xid, struct cifs_tcon *tcon, 455extern int CIFSGetExtAttr(const unsigned int xid, struct cifs_tcon *tcon,
453 const int netfid, __u64 *pExtAttrBits, __u64 *pMask); 456 const int netfid, __u64 *pExtAttrBits, __u64 *pMask);
454extern void cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb); 457extern void cifs_autodisable_serverino(struct cifs_sb_info *cifs_sb);
455extern bool CIFSCouldBeMFSymlink(const struct cifs_fattr *fattr); 458extern bool CIFSCouldBeMFSymlink(const struct cifs_fattr *fattr);
456extern int CIFSCheckMFSymlink(struct cifs_fattr *fattr, 459extern int CIFSCheckMFSymlink(struct cifs_fattr *fattr,
457 const unsigned char *path, 460 const unsigned char *path,
458 struct cifs_sb_info *cifs_sb, int xid); 461 struct cifs_sb_info *cifs_sb, unsigned int xid);
459extern int mdfour(unsigned char *, unsigned char *, int); 462extern int mdfour(unsigned char *, unsigned char *, int);
460extern int E_md4hash(const unsigned char *passwd, unsigned char *p16, 463extern int E_md4hash(const unsigned char *passwd, unsigned char *p16,
461 const struct nls_table *codepage); 464 const struct nls_table *codepage);
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
index 4ee522b3f66f..cabc7a01f5df 100644
--- a/fs/cifs/cifssmb.c
+++ b/fs/cifs/cifssmb.c
@@ -112,24 +112,29 @@ cifs_kmap_unlock(void)
112#define cifs_kmap_unlock() do { ; } while(0) 112#define cifs_kmap_unlock() do { ; } while(0)
113#endif /* CONFIG_HIGHMEM */ 113#endif /* CONFIG_HIGHMEM */
114 114
115/* Mark as invalid, all open files on tree connections since they 115/*
116 were closed when session to server was lost */ 116 * Mark as invalid, all open files on tree connections since they
117static void mark_open_files_invalid(struct cifs_tcon *pTcon) 117 * were closed when session to server was lost.
118 */
119void
120cifs_mark_open_files_invalid(struct cifs_tcon *tcon)
118{ 121{
119 struct cifsFileInfo *open_file = NULL; 122 struct cifsFileInfo *open_file = NULL;
120 struct list_head *tmp; 123 struct list_head *tmp;
121 struct list_head *tmp1; 124 struct list_head *tmp1;
122 125
123/* list all files open on tree connection and mark them invalid */ 126 /* list all files open on tree connection and mark them invalid */
124 spin_lock(&cifs_file_list_lock); 127 spin_lock(&cifs_file_list_lock);
125 list_for_each_safe(tmp, tmp1, &pTcon->openFileList) { 128 list_for_each_safe(tmp, tmp1, &tcon->openFileList) {
126 open_file = list_entry(tmp, struct cifsFileInfo, tlist); 129 open_file = list_entry(tmp, struct cifsFileInfo, tlist);
127 open_file->invalidHandle = true; 130 open_file->invalidHandle = true;
128 open_file->oplock_break_cancelled = true; 131 open_file->oplock_break_cancelled = true;
129 } 132 }
130 spin_unlock(&cifs_file_list_lock); 133 spin_unlock(&cifs_file_list_lock);
131 /* BB Add call to invalidate_inodes(sb) for all superblocks mounted 134 /*
132 to this tcon */ 135 * BB Add call to invalidate_inodes(sb) for all superblocks mounted
136 * to this tcon.
137 */
133} 138}
134 139
135/* reconnect the socket, tcon, and smb session if needed */ 140/* reconnect the socket, tcon, and smb session if needed */
@@ -209,7 +214,7 @@ cifs_reconnect_tcon(struct cifs_tcon *tcon, int smb_command)
209 goto out; 214 goto out;
210 } 215 }
211 216
212 mark_open_files_invalid(tcon); 217 cifs_mark_open_files_invalid(tcon);
213 rc = CIFSTCon(0, ses, tcon->treeName, tcon, nls_codepage); 218 rc = CIFSTCon(0, ses, tcon->treeName, tcon, nls_codepage);
214 mutex_unlock(&ses->session_mutex); 219 mutex_unlock(&ses->session_mutex);
215 cFYI(1, "reconnect tcon rc = %d", rc); 220 cFYI(1, "reconnect tcon rc = %d", rc);
@@ -388,15 +393,8 @@ vt2_err:
388 return -EINVAL; 393 return -EINVAL;
389} 394}
390 395
391static inline void inc_rfc1001_len(void *pSMB, int count)
392{
393 struct smb_hdr *hdr = (struct smb_hdr *)pSMB;
394
395 be32_add_cpu(&hdr->smb_buf_length, count);
396}
397
398int 396int
399CIFSSMBNegotiate(unsigned int xid, struct cifs_ses *ses) 397CIFSSMBNegotiate(const unsigned int xid, struct cifs_ses *ses)
400{ 398{
401 NEGOTIATE_REQ *pSMB; 399 NEGOTIATE_REQ *pSMB;
402 NEGOTIATE_RSP *pSMBr; 400 NEGOTIATE_RSP *pSMBr;
@@ -480,7 +478,7 @@ CIFSSMBNegotiate(unsigned int xid, struct cifs_ses *ses)
480 rc = -EOPNOTSUPP; 478 rc = -EOPNOTSUPP;
481 goto neg_err_exit; 479 goto neg_err_exit;
482 } 480 }
483 server->sec_mode = (__u8)le16_to_cpu(rsp->SecurityMode); 481 server->sec_mode = le16_to_cpu(rsp->SecurityMode);
484 server->maxReq = min_t(unsigned int, 482 server->maxReq = min_t(unsigned int,
485 le16_to_cpu(rsp->MaxMpxCount), 483 le16_to_cpu(rsp->MaxMpxCount),
486 cifs_max_pending); 484 cifs_max_pending);
@@ -694,7 +692,7 @@ neg_err_exit:
694} 692}
695 693
696int 694int
697CIFSSMBTDis(const int xid, struct cifs_tcon *tcon) 695CIFSSMBTDis(const unsigned int xid, struct cifs_tcon *tcon)
698{ 696{
699 struct smb_hdr *smb_buffer; 697 struct smb_hdr *smb_buffer;
700 int rc = 0; 698 int rc = 0;
@@ -744,7 +742,7 @@ cifs_echo_callback(struct mid_q_entry *mid)
744 struct TCP_Server_Info *server = mid->callback_data; 742 struct TCP_Server_Info *server = mid->callback_data;
745 743
746 DeleteMidQEntry(mid); 744 DeleteMidQEntry(mid);
747 add_credits(server, 1); 745 add_credits(server, 1, CIFS_ECHO_OP);
748} 746}
749 747
750int 748int
@@ -771,7 +769,7 @@ CIFSSMBEcho(struct TCP_Server_Info *server)
771 iov.iov_len = be32_to_cpu(smb->hdr.smb_buf_length) + 4; 769 iov.iov_len = be32_to_cpu(smb->hdr.smb_buf_length) + 4;
772 770
773 rc = cifs_call_async(server, &iov, 1, NULL, cifs_echo_callback, 771 rc = cifs_call_async(server, &iov, 1, NULL, cifs_echo_callback,
774 server, true); 772 server, CIFS_ASYNC_OP | CIFS_ECHO_OP);
775 if (rc) 773 if (rc)
776 cFYI(1, "Echo request failed: %d", rc); 774 cFYI(1, "Echo request failed: %d", rc);
777 775
@@ -781,7 +779,7 @@ CIFSSMBEcho(struct TCP_Server_Info *server)
781} 779}
782 780
783int 781int
784CIFSSMBLogoff(const int xid, struct cifs_ses *ses) 782CIFSSMBLogoff(const unsigned int xid, struct cifs_ses *ses)
785{ 783{
786 LOGOFF_ANDX_REQ *pSMB; 784 LOGOFF_ANDX_REQ *pSMB;
787 int rc = 0; 785 int rc = 0;
@@ -828,8 +826,9 @@ session_already_dead:
828} 826}
829 827
830int 828int
831CIFSPOSIXDelFile(const int xid, struct cifs_tcon *tcon, const char *fileName, 829CIFSPOSIXDelFile(const unsigned int xid, struct cifs_tcon *tcon,
832 __u16 type, const struct nls_table *nls_codepage, int remap) 830 const char *fileName, __u16 type,
831 const struct nls_table *nls_codepage, int remap)
833{ 832{
834 TRANSACTION2_SPI_REQ *pSMB = NULL; 833 TRANSACTION2_SPI_REQ *pSMB = NULL;
835 TRANSACTION2_SPI_RSP *pSMBr = NULL; 834 TRANSACTION2_SPI_RSP *pSMBr = NULL;
@@ -894,7 +893,7 @@ PsxDelete:
894 cFYI(1, "Posix delete returned %d", rc); 893 cFYI(1, "Posix delete returned %d", rc);
895 cifs_buf_release(pSMB); 894 cifs_buf_release(pSMB);
896 895
897 cifs_stats_inc(&tcon->num_deletes); 896 cifs_stats_inc(&tcon->stats.cifs_stats.num_deletes);
898 897
899 if (rc == -EAGAIN) 898 if (rc == -EAGAIN)
900 goto PsxDelete; 899 goto PsxDelete;
@@ -903,8 +902,9 @@ PsxDelete:
903} 902}
904 903
905int 904int
906CIFSSMBDelFile(const int xid, struct cifs_tcon *tcon, const char *fileName, 905CIFSSMBDelFile(const unsigned int xid, struct cifs_tcon *tcon,
907 const struct nls_table *nls_codepage, int remap) 906 const char *fileName, const struct nls_table *nls_codepage,
907 int remap)
908{ 908{
909 DELETE_FILE_REQ *pSMB = NULL; 909 DELETE_FILE_REQ *pSMB = NULL;
910 DELETE_FILE_RSP *pSMBr = NULL; 910 DELETE_FILE_RSP *pSMBr = NULL;
@@ -936,7 +936,7 @@ DelFileRetry:
936 pSMB->ByteCount = cpu_to_le16(name_len + 1); 936 pSMB->ByteCount = cpu_to_le16(name_len + 1);
937 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 937 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
938 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 938 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
939 cifs_stats_inc(&tcon->num_deletes); 939 cifs_stats_inc(&tcon->stats.cifs_stats.num_deletes);
940 if (rc) 940 if (rc)
941 cFYI(1, "Error in RMFile = %d", rc); 941 cFYI(1, "Error in RMFile = %d", rc);
942 942
@@ -948,8 +948,9 @@ DelFileRetry:
948} 948}
949 949
950int 950int
951CIFSSMBRmDir(const int xid, struct cifs_tcon *tcon, const char *dirName, 951CIFSSMBRmDir(const unsigned int xid, struct cifs_tcon *tcon,
952 const struct nls_table *nls_codepage, int remap) 952 const char *dirName, const struct nls_table *nls_codepage,
953 int remap)
953{ 954{
954 DELETE_DIRECTORY_REQ *pSMB = NULL; 955 DELETE_DIRECTORY_REQ *pSMB = NULL;
955 DELETE_DIRECTORY_RSP *pSMBr = NULL; 956 DELETE_DIRECTORY_RSP *pSMBr = NULL;
@@ -980,7 +981,7 @@ RmDirRetry:
980 pSMB->ByteCount = cpu_to_le16(name_len + 1); 981 pSMB->ByteCount = cpu_to_le16(name_len + 1);
981 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 982 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
982 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 983 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
983 cifs_stats_inc(&tcon->num_rmdirs); 984 cifs_stats_inc(&tcon->stats.cifs_stats.num_rmdirs);
984 if (rc) 985 if (rc)
985 cFYI(1, "Error in RMDir = %d", rc); 986 cFYI(1, "Error in RMDir = %d", rc);
986 987
@@ -991,7 +992,7 @@ RmDirRetry:
991} 992}
992 993
993int 994int
994CIFSSMBMkDir(const int xid, struct cifs_tcon *tcon, 995CIFSSMBMkDir(const unsigned int xid, struct cifs_tcon *tcon,
995 const char *name, const struct nls_table *nls_codepage, int remap) 996 const char *name, const struct nls_table *nls_codepage, int remap)
996{ 997{
997 int rc = 0; 998 int rc = 0;
@@ -1023,7 +1024,7 @@ MkDirRetry:
1023 pSMB->ByteCount = cpu_to_le16(name_len + 1); 1024 pSMB->ByteCount = cpu_to_le16(name_len + 1);
1024 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 1025 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
1025 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 1026 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
1026 cifs_stats_inc(&tcon->num_mkdirs); 1027 cifs_stats_inc(&tcon->stats.cifs_stats.num_mkdirs);
1027 if (rc) 1028 if (rc)
1028 cFYI(1, "Error in Mkdir = %d", rc); 1029 cFYI(1, "Error in Mkdir = %d", rc);
1029 1030
@@ -1034,10 +1035,11 @@ MkDirRetry:
1034} 1035}
1035 1036
1036int 1037int
1037CIFSPOSIXCreate(const int xid, struct cifs_tcon *tcon, __u32 posix_flags, 1038CIFSPOSIXCreate(const unsigned int xid, struct cifs_tcon *tcon,
1038 __u64 mode, __u16 *netfid, FILE_UNIX_BASIC_INFO *pRetData, 1039 __u32 posix_flags, __u64 mode, __u16 *netfid,
1039 __u32 *pOplock, const char *name, 1040 FILE_UNIX_BASIC_INFO *pRetData, __u32 *pOplock,
1040 const struct nls_table *nls_codepage, int remap) 1041 const char *name, const struct nls_table *nls_codepage,
1042 int remap)
1041{ 1043{
1042 TRANSACTION2_SPI_REQ *pSMB = NULL; 1044 TRANSACTION2_SPI_REQ *pSMB = NULL;
1043 TRANSACTION2_SPI_RSP *pSMBr = NULL; 1045 TRANSACTION2_SPI_RSP *pSMBr = NULL;
@@ -1145,9 +1147,9 @@ psx_create_err:
1145 cifs_buf_release(pSMB); 1147 cifs_buf_release(pSMB);
1146 1148
1147 if (posix_flags & SMB_O_DIRECTORY) 1149 if (posix_flags & SMB_O_DIRECTORY)
1148 cifs_stats_inc(&tcon->num_posixmkdirs); 1150 cifs_stats_inc(&tcon->stats.cifs_stats.num_posixmkdirs);
1149 else 1151 else
1150 cifs_stats_inc(&tcon->num_posixopens); 1152 cifs_stats_inc(&tcon->stats.cifs_stats.num_posixopens);
1151 1153
1152 if (rc == -EAGAIN) 1154 if (rc == -EAGAIN)
1153 goto PsxCreat; 1155 goto PsxCreat;
@@ -1200,7 +1202,7 @@ access_flags_to_smbopen_mode(const int access_flags)
1200} 1202}
1201 1203
1202int 1204int
1203SMBLegacyOpen(const int xid, struct cifs_tcon *tcon, 1205SMBLegacyOpen(const unsigned int xid, struct cifs_tcon *tcon,
1204 const char *fileName, const int openDisposition, 1206 const char *fileName, const int openDisposition,
1205 const int access_flags, const int create_options, __u16 *netfid, 1207 const int access_flags, const int create_options, __u16 *netfid,
1206 int *pOplock, FILE_ALL_INFO *pfile_info, 1208 int *pOplock, FILE_ALL_INFO *pfile_info,
@@ -1268,7 +1270,7 @@ OldOpenRetry:
1268 /* long_op set to 1 to allow for oplock break timeouts */ 1270 /* long_op set to 1 to allow for oplock break timeouts */
1269 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 1271 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
1270 (struct smb_hdr *)pSMBr, &bytes_returned, 0); 1272 (struct smb_hdr *)pSMBr, &bytes_returned, 0);
1271 cifs_stats_inc(&tcon->num_opens); 1273 cifs_stats_inc(&tcon->stats.cifs_stats.num_opens);
1272 if (rc) { 1274 if (rc) {
1273 cFYI(1, "Error in Open = %d", rc); 1275 cFYI(1, "Error in Open = %d", rc);
1274 } else { 1276 } else {
@@ -1307,7 +1309,7 @@ OldOpenRetry:
1307} 1309}
1308 1310
1309int 1311int
1310CIFSSMBOpen(const int xid, struct cifs_tcon *tcon, 1312CIFSSMBOpen(const unsigned int xid, struct cifs_tcon *tcon,
1311 const char *fileName, const int openDisposition, 1313 const char *fileName, const int openDisposition,
1312 const int access_flags, const int create_options, __u16 *netfid, 1314 const int access_flags, const int create_options, __u16 *netfid,
1313 int *pOplock, FILE_ALL_INFO *pfile_info, 1315 int *pOplock, FILE_ALL_INFO *pfile_info,
@@ -1381,7 +1383,7 @@ openRetry:
1381 /* long_op set to 1 to allow for oplock break timeouts */ 1383 /* long_op set to 1 to allow for oplock break timeouts */
1382 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 1384 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
1383 (struct smb_hdr *)pSMBr, &bytes_returned, 0); 1385 (struct smb_hdr *)pSMBr, &bytes_returned, 0);
1384 cifs_stats_inc(&tcon->num_opens); 1386 cifs_stats_inc(&tcon->stats.cifs_stats.num_opens);
1385 if (rc) { 1387 if (rc) {
1386 cFYI(1, "Error in Open = %d", rc); 1388 cFYI(1, "Error in Open = %d", rc);
1387 } else { 1389 } else {
@@ -1589,7 +1591,7 @@ cifs_readv_callback(struct mid_q_entry *mid)
1589 1591
1590 queue_work(cifsiod_wq, &rdata->work); 1592 queue_work(cifsiod_wq, &rdata->work);
1591 DeleteMidQEntry(mid); 1593 DeleteMidQEntry(mid);
1592 add_credits(server, 1); 1594 add_credits(server, 1, 0);
1593} 1595}
1594 1596
1595/* cifs_async_readv - send an async write, and set up mid to handle result */ 1597/* cifs_async_readv - send an async write, and set up mid to handle result */
@@ -1645,10 +1647,10 @@ cifs_async_readv(struct cifs_readdata *rdata)
1645 kref_get(&rdata->refcount); 1647 kref_get(&rdata->refcount);
1646 rc = cifs_call_async(tcon->ses->server, rdata->iov, 1, 1648 rc = cifs_call_async(tcon->ses->server, rdata->iov, 1,
1647 cifs_readv_receive, cifs_readv_callback, 1649 cifs_readv_receive, cifs_readv_callback,
1648 rdata, false); 1650 rdata, 0);
1649 1651
1650 if (rc == 0) 1652 if (rc == 0)
1651 cifs_stats_inc(&tcon->num_reads); 1653 cifs_stats_inc(&tcon->stats.cifs_stats.num_reads);
1652 else 1654 else
1653 kref_put(&rdata->refcount, cifs_readdata_release); 1655 kref_put(&rdata->refcount, cifs_readdata_release);
1654 1656
@@ -1657,8 +1659,8 @@ cifs_async_readv(struct cifs_readdata *rdata)
1657} 1659}
1658 1660
1659int 1661int
1660CIFSSMBRead(const int xid, struct cifs_io_parms *io_parms, unsigned int *nbytes, 1662CIFSSMBRead(const unsigned int xid, struct cifs_io_parms *io_parms,
1661 char **buf, int *pbuf_type) 1663 unsigned int *nbytes, char **buf, int *pbuf_type)
1662{ 1664{
1663 int rc = -EACCES; 1665 int rc = -EACCES;
1664 READ_REQ *pSMB = NULL; 1666 READ_REQ *pSMB = NULL;
@@ -1718,7 +1720,7 @@ CIFSSMBRead(const int xid, struct cifs_io_parms *io_parms, unsigned int *nbytes,
1718 iov[0].iov_len = be32_to_cpu(pSMB->hdr.smb_buf_length) + 4; 1720 iov[0].iov_len = be32_to_cpu(pSMB->hdr.smb_buf_length) + 4;
1719 rc = SendReceive2(xid, tcon->ses, iov, 1 /* num iovecs */, 1721 rc = SendReceive2(xid, tcon->ses, iov, 1 /* num iovecs */,
1720 &resp_buf_type, CIFS_LOG_ERROR); 1722 &resp_buf_type, CIFS_LOG_ERROR);
1721 cifs_stats_inc(&tcon->num_reads); 1723 cifs_stats_inc(&tcon->stats.cifs_stats.num_reads);
1722 pSMBr = (READ_RSP *)iov[0].iov_base; 1724 pSMBr = (READ_RSP *)iov[0].iov_base;
1723 if (rc) { 1725 if (rc) {
1724 cERROR(1, "Send error in read = %d", rc); 1726 cERROR(1, "Send error in read = %d", rc);
@@ -1769,7 +1771,7 @@ CIFSSMBRead(const int xid, struct cifs_io_parms *io_parms, unsigned int *nbytes,
1769 1771
1770 1772
1771int 1773int
1772CIFSSMBWrite(const int xid, struct cifs_io_parms *io_parms, 1774CIFSSMBWrite(const unsigned int xid, struct cifs_io_parms *io_parms,
1773 unsigned int *nbytes, const char *buf, 1775 unsigned int *nbytes, const char *buf,
1774 const char __user *ubuf, const int long_op) 1776 const char __user *ubuf, const int long_op)
1775{ 1777{
@@ -1870,7 +1872,7 @@ CIFSSMBWrite(const int xid, struct cifs_io_parms *io_parms,
1870 1872
1871 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 1873 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
1872 (struct smb_hdr *) pSMBr, &bytes_returned, long_op); 1874 (struct smb_hdr *) pSMBr, &bytes_returned, long_op);
1873 cifs_stats_inc(&tcon->num_writes); 1875 cifs_stats_inc(&tcon->stats.cifs_stats.num_writes);
1874 if (rc) { 1876 if (rc) {
1875 cFYI(1, "Send error in write = %d", rc); 1877 cFYI(1, "Send error in write = %d", rc);
1876 } else { 1878 } else {
@@ -2036,7 +2038,7 @@ cifs_writev_callback(struct mid_q_entry *mid)
2036 2038
2037 queue_work(cifsiod_wq, &wdata->work); 2039 queue_work(cifsiod_wq, &wdata->work);
2038 DeleteMidQEntry(mid); 2040 DeleteMidQEntry(mid);
2039 add_credits(tcon->ses->server, 1); 2041 add_credits(tcon->ses->server, 1, 0);
2040} 2042}
2041 2043
2042/* cifs_async_writev - send an async write, and set up mid to handle result */ 2044/* cifs_async_writev - send an async write, and set up mid to handle result */
@@ -2118,10 +2120,10 @@ cifs_async_writev(struct cifs_writedata *wdata)
2118 2120
2119 kref_get(&wdata->refcount); 2121 kref_get(&wdata->refcount);
2120 rc = cifs_call_async(tcon->ses->server, iov, wdata->nr_pages + 1, 2122 rc = cifs_call_async(tcon->ses->server, iov, wdata->nr_pages + 1,
2121 NULL, cifs_writev_callback, wdata, false); 2123 NULL, cifs_writev_callback, wdata, 0);
2122 2124
2123 if (rc == 0) 2125 if (rc == 0)
2124 cifs_stats_inc(&tcon->num_writes); 2126 cifs_stats_inc(&tcon->stats.cifs_stats.num_writes);
2125 else 2127 else
2126 kref_put(&wdata->refcount, cifs_writedata_release); 2128 kref_put(&wdata->refcount, cifs_writedata_release);
2127 2129
@@ -2136,7 +2138,7 @@ async_writev_out:
2136} 2138}
2137 2139
2138int 2140int
2139CIFSSMBWrite2(const int xid, struct cifs_io_parms *io_parms, 2141CIFSSMBWrite2(const unsigned int xid, struct cifs_io_parms *io_parms,
2140 unsigned int *nbytes, struct kvec *iov, int n_vec, 2142 unsigned int *nbytes, struct kvec *iov, int n_vec,
2141 const int long_op) 2143 const int long_op)
2142{ 2144{
@@ -2211,7 +2213,7 @@ CIFSSMBWrite2(const int xid, struct cifs_io_parms *io_parms,
2211 2213
2212 rc = SendReceive2(xid, tcon->ses, iov, n_vec + 1, &resp_buf_type, 2214 rc = SendReceive2(xid, tcon->ses, iov, n_vec + 1, &resp_buf_type,
2213 long_op); 2215 long_op);
2214 cifs_stats_inc(&tcon->num_writes); 2216 cifs_stats_inc(&tcon->stats.cifs_stats.num_writes);
2215 if (rc) { 2217 if (rc) {
2216 cFYI(1, "Send error Write2 = %d", rc); 2218 cFYI(1, "Send error Write2 = %d", rc);
2217 } else if (resp_buf_type == 0) { 2219 } else if (resp_buf_type == 0) {
@@ -2244,8 +2246,8 @@ CIFSSMBWrite2(const int xid, struct cifs_io_parms *io_parms,
2244 return rc; 2246 return rc;
2245} 2247}
2246 2248
2247int cifs_lockv(const int xid, struct cifs_tcon *tcon, const __u16 netfid, 2249int cifs_lockv(const unsigned int xid, struct cifs_tcon *tcon,
2248 const __u8 lock_type, const __u32 num_unlock, 2250 const __u16 netfid, const __u8 lock_type, const __u32 num_unlock,
2249 const __u32 num_lock, LOCKING_ANDX_RANGE *buf) 2251 const __u32 num_lock, LOCKING_ANDX_RANGE *buf)
2250{ 2252{
2251 int rc = 0; 2253 int rc = 0;
@@ -2277,7 +2279,7 @@ int cifs_lockv(const int xid, struct cifs_tcon *tcon, const __u16 netfid,
2277 iov[1].iov_base = (char *)buf; 2279 iov[1].iov_base = (char *)buf;
2278 iov[1].iov_len = (num_unlock + num_lock) * sizeof(LOCKING_ANDX_RANGE); 2280 iov[1].iov_len = (num_unlock + num_lock) * sizeof(LOCKING_ANDX_RANGE);
2279 2281
2280 cifs_stats_inc(&tcon->num_locks); 2282 cifs_stats_inc(&tcon->stats.cifs_stats.num_locks);
2281 rc = SendReceive2(xid, tcon->ses, iov, 2, &resp_buf_type, CIFS_NO_RESP); 2283 rc = SendReceive2(xid, tcon->ses, iov, 2, &resp_buf_type, CIFS_NO_RESP);
2282 if (rc) 2284 if (rc)
2283 cFYI(1, "Send error in cifs_lockv = %d", rc); 2285 cFYI(1, "Send error in cifs_lockv = %d", rc);
@@ -2286,7 +2288,7 @@ int cifs_lockv(const int xid, struct cifs_tcon *tcon, const __u16 netfid,
2286} 2288}
2287 2289
2288int 2290int
2289CIFSSMBLock(const int xid, struct cifs_tcon *tcon, 2291CIFSSMBLock(const unsigned int xid, struct cifs_tcon *tcon,
2290 const __u16 smb_file_id, const __u32 netpid, const __u64 len, 2292 const __u16 smb_file_id, const __u32 netpid, const __u64 len,
2291 const __u64 offset, const __u32 numUnlock, 2293 const __u64 offset, const __u32 numUnlock,
2292 const __u32 numLock, const __u8 lockType, 2294 const __u32 numLock, const __u8 lockType,
@@ -2296,7 +2298,7 @@ CIFSSMBLock(const int xid, struct cifs_tcon *tcon,
2296 LOCK_REQ *pSMB = NULL; 2298 LOCK_REQ *pSMB = NULL;
2297/* LOCK_RSP *pSMBr = NULL; */ /* No response data other than rc to parse */ 2299/* LOCK_RSP *pSMBr = NULL; */ /* No response data other than rc to parse */
2298 int bytes_returned; 2300 int bytes_returned;
2299 int timeout = 0; 2301 int flags = 0;
2300 __u16 count; 2302 __u16 count;
2301 2303
2302 cFYI(1, "CIFSSMBLock timeout %d numLock %d", (int)waitFlag, numLock); 2304 cFYI(1, "CIFSSMBLock timeout %d numLock %d", (int)waitFlag, numLock);
@@ -2306,10 +2308,11 @@ CIFSSMBLock(const int xid, struct cifs_tcon *tcon,
2306 return rc; 2308 return rc;
2307 2309
2308 if (lockType == LOCKING_ANDX_OPLOCK_RELEASE) { 2310 if (lockType == LOCKING_ANDX_OPLOCK_RELEASE) {
2309 timeout = CIFS_ASYNC_OP; /* no response expected */ 2311 /* no response expected */
2312 flags = CIFS_ASYNC_OP | CIFS_OBREAK_OP;
2310 pSMB->Timeout = 0; 2313 pSMB->Timeout = 0;
2311 } else if (waitFlag) { 2314 } else if (waitFlag) {
2312 timeout = CIFS_BLOCKING_OP; /* blocking operation, no timeout */ 2315 flags = CIFS_BLOCKING_OP; /* blocking operation, no timeout */
2313 pSMB->Timeout = cpu_to_le32(-1);/* blocking - do not time out */ 2316 pSMB->Timeout = cpu_to_le32(-1);/* blocking - do not time out */
2314 } else { 2317 } else {
2315 pSMB->Timeout = 0; 2318 pSMB->Timeout = 0;
@@ -2342,10 +2345,10 @@ CIFSSMBLock(const int xid, struct cifs_tcon *tcon,
2342 (struct smb_hdr *) pSMB, &bytes_returned); 2345 (struct smb_hdr *) pSMB, &bytes_returned);
2343 cifs_small_buf_release(pSMB); 2346 cifs_small_buf_release(pSMB);
2344 } else { 2347 } else {
2345 rc = SendReceiveNoRsp(xid, tcon->ses, (char *)pSMB, timeout); 2348 rc = SendReceiveNoRsp(xid, tcon->ses, (char *)pSMB, flags);
2346 /* SMB buffer freed by function above */ 2349 /* SMB buffer freed by function above */
2347 } 2350 }
2348 cifs_stats_inc(&tcon->num_locks); 2351 cifs_stats_inc(&tcon->stats.cifs_stats.num_locks);
2349 if (rc) 2352 if (rc)
2350 cFYI(1, "Send error in Lock = %d", rc); 2353 cFYI(1, "Send error in Lock = %d", rc);
2351 2354
@@ -2355,10 +2358,11 @@ CIFSSMBLock(const int xid, struct cifs_tcon *tcon,
2355} 2358}
2356 2359
2357int 2360int
2358CIFSSMBPosixLock(const int xid, struct cifs_tcon *tcon, 2361CIFSSMBPosixLock(const unsigned int xid, struct cifs_tcon *tcon,
2359 const __u16 smb_file_id, const __u32 netpid, const int get_flag, 2362 const __u16 smb_file_id, const __u32 netpid,
2360 const __u64 len, struct file_lock *pLockData, 2363 const loff_t start_offset, const __u64 len,
2361 const __u16 lock_type, const bool waitFlag) 2364 struct file_lock *pLockData, const __u16 lock_type,
2365 const bool waitFlag)
2362{ 2366{
2363 struct smb_com_transaction2_sfi_req *pSMB = NULL; 2367 struct smb_com_transaction2_sfi_req *pSMB = NULL;
2364 struct smb_com_transaction2_sfi_rsp *pSMBr = NULL; 2368 struct smb_com_transaction2_sfi_rsp *pSMBr = NULL;
@@ -2372,9 +2376,6 @@ CIFSSMBPosixLock(const int xid, struct cifs_tcon *tcon,
2372 2376
2373 cFYI(1, "Posix Lock"); 2377 cFYI(1, "Posix Lock");
2374 2378
2375 if (pLockData == NULL)
2376 return -EINVAL;
2377
2378 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB); 2379 rc = small_smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB);
2379 2380
2380 if (rc) 2381 if (rc)
@@ -2395,7 +2396,7 @@ CIFSSMBPosixLock(const int xid, struct cifs_tcon *tcon,
2395 pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB from sess */ 2396 pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB from sess */
2396 pSMB->SetupCount = 1; 2397 pSMB->SetupCount = 1;
2397 pSMB->Reserved3 = 0; 2398 pSMB->Reserved3 = 0;
2398 if (get_flag) 2399 if (pLockData)
2399 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_FILE_INFORMATION); 2400 pSMB->SubCommand = cpu_to_le16(TRANS2_QUERY_FILE_INFORMATION);
2400 else 2401 else
2401 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FILE_INFORMATION); 2402 pSMB->SubCommand = cpu_to_le16(TRANS2_SET_FILE_INFORMATION);
@@ -2417,7 +2418,7 @@ CIFSSMBPosixLock(const int xid, struct cifs_tcon *tcon,
2417 pSMB->Timeout = 0; 2418 pSMB->Timeout = 0;
2418 2419
2419 parm_data->pid = cpu_to_le32(netpid); 2420 parm_data->pid = cpu_to_le32(netpid);
2420 parm_data->start = cpu_to_le64(pLockData->fl_start); 2421 parm_data->start = cpu_to_le64(start_offset);
2421 parm_data->length = cpu_to_le64(len); /* normalize negative numbers */ 2422 parm_data->length = cpu_to_le64(len); /* normalize negative numbers */
2422 2423
2423 pSMB->DataOffset = cpu_to_le16(offset); 2424 pSMB->DataOffset = cpu_to_le16(offset);
@@ -2441,7 +2442,7 @@ CIFSSMBPosixLock(const int xid, struct cifs_tcon *tcon,
2441 2442
2442 if (rc) { 2443 if (rc) {
2443 cFYI(1, "Send error in Posix Lock = %d", rc); 2444 cFYI(1, "Send error in Posix Lock = %d", rc);
2444 } else if (get_flag) { 2445 } else if (pLockData) {
2445 /* lock structure can be returned on get */ 2446 /* lock structure can be returned on get */
2446 __u16 data_offset; 2447 __u16 data_offset;
2447 __u16 data_count; 2448 __u16 data_count;
@@ -2493,7 +2494,7 @@ plk_err_exit:
2493 2494
2494 2495
2495int 2496int
2496CIFSSMBClose(const int xid, struct cifs_tcon *tcon, int smb_file_id) 2497CIFSSMBClose(const unsigned int xid, struct cifs_tcon *tcon, int smb_file_id)
2497{ 2498{
2498 int rc = 0; 2499 int rc = 0;
2499 CLOSE_REQ *pSMB = NULL; 2500 CLOSE_REQ *pSMB = NULL;
@@ -2510,7 +2511,7 @@ CIFSSMBClose(const int xid, struct cifs_tcon *tcon, int smb_file_id)
2510 pSMB->LastWriteTime = 0xFFFFFFFF; 2511 pSMB->LastWriteTime = 0xFFFFFFFF;
2511 pSMB->ByteCount = 0; 2512 pSMB->ByteCount = 0;
2512 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); 2513 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0);
2513 cifs_stats_inc(&tcon->num_closes); 2514 cifs_stats_inc(&tcon->stats.cifs_stats.num_closes);
2514 if (rc) { 2515 if (rc) {
2515 if (rc != -EINTR) { 2516 if (rc != -EINTR) {
2516 /* EINTR is expected when user ctl-c to kill app */ 2517 /* EINTR is expected when user ctl-c to kill app */
@@ -2526,7 +2527,7 @@ CIFSSMBClose(const int xid, struct cifs_tcon *tcon, int smb_file_id)
2526} 2527}
2527 2528
2528int 2529int
2529CIFSSMBFlush(const int xid, struct cifs_tcon *tcon, int smb_file_id) 2530CIFSSMBFlush(const unsigned int xid, struct cifs_tcon *tcon, int smb_file_id)
2530{ 2531{
2531 int rc = 0; 2532 int rc = 0;
2532 FLUSH_REQ *pSMB = NULL; 2533 FLUSH_REQ *pSMB = NULL;
@@ -2539,7 +2540,7 @@ CIFSSMBFlush(const int xid, struct cifs_tcon *tcon, int smb_file_id)
2539 pSMB->FileID = (__u16) smb_file_id; 2540 pSMB->FileID = (__u16) smb_file_id;
2540 pSMB->ByteCount = 0; 2541 pSMB->ByteCount = 0;
2541 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0); 2542 rc = SendReceiveNoRsp(xid, tcon->ses, (char *) pSMB, 0);
2542 cifs_stats_inc(&tcon->num_flushes); 2543 cifs_stats_inc(&tcon->stats.cifs_stats.num_flushes);
2543 if (rc) 2544 if (rc)
2544 cERROR(1, "Send error in Flush = %d", rc); 2545 cERROR(1, "Send error in Flush = %d", rc);
2545 2546
@@ -2547,7 +2548,7 @@ CIFSSMBFlush(const int xid, struct cifs_tcon *tcon, int smb_file_id)
2547} 2548}
2548 2549
2549int 2550int
2550CIFSSMBRename(const int xid, struct cifs_tcon *tcon, 2551CIFSSMBRename(const unsigned int xid, struct cifs_tcon *tcon,
2551 const char *fromName, const char *toName, 2552 const char *fromName, const char *toName,
2552 const struct nls_table *nls_codepage, int remap) 2553 const struct nls_table *nls_codepage, int remap)
2553{ 2554{
@@ -2602,7 +2603,7 @@ renameRetry:
2602 2603
2603 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 2604 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
2604 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 2605 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
2605 cifs_stats_inc(&tcon->num_renames); 2606 cifs_stats_inc(&tcon->stats.cifs_stats.num_renames);
2606 if (rc) 2607 if (rc)
2607 cFYI(1, "Send error in rename = %d", rc); 2608 cFYI(1, "Send error in rename = %d", rc);
2608 2609
@@ -2614,7 +2615,7 @@ renameRetry:
2614 return rc; 2615 return rc;
2615} 2616}
2616 2617
2617int CIFSSMBRenameOpenFile(const int xid, struct cifs_tcon *pTcon, 2618int CIFSSMBRenameOpenFile(const unsigned int xid, struct cifs_tcon *pTcon,
2618 int netfid, const char *target_name, 2619 int netfid, const char *target_name,
2619 const struct nls_table *nls_codepage, int remap) 2620 const struct nls_table *nls_codepage, int remap)
2620{ 2621{
@@ -2683,7 +2684,7 @@ int CIFSSMBRenameOpenFile(const int xid, struct cifs_tcon *pTcon,
2683 pSMB->ByteCount = cpu_to_le16(byte_count); 2684 pSMB->ByteCount = cpu_to_le16(byte_count);
2684 rc = SendReceive(xid, pTcon->ses, (struct smb_hdr *) pSMB, 2685 rc = SendReceive(xid, pTcon->ses, (struct smb_hdr *) pSMB,
2685 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 2686 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
2686 cifs_stats_inc(&pTcon->num_t2renames); 2687 cifs_stats_inc(&pTcon->stats.cifs_stats.num_t2renames);
2687 if (rc) 2688 if (rc)
2688 cFYI(1, "Send error in Rename (by file handle) = %d", rc); 2689 cFYI(1, "Send error in Rename (by file handle) = %d", rc);
2689 2690
@@ -2696,9 +2697,9 @@ int CIFSSMBRenameOpenFile(const int xid, struct cifs_tcon *pTcon,
2696} 2697}
2697 2698
2698int 2699int
2699CIFSSMBCopy(const int xid, struct cifs_tcon *tcon, const char *fromName, 2700CIFSSMBCopy(const unsigned int xid, struct cifs_tcon *tcon,
2700 const __u16 target_tid, const char *toName, const int flags, 2701 const char *fromName, const __u16 target_tid, const char *toName,
2701 const struct nls_table *nls_codepage, int remap) 2702 const int flags, const struct nls_table *nls_codepage, int remap)
2702{ 2703{
2703 int rc = 0; 2704 int rc = 0;
2704 COPY_REQ *pSMB = NULL; 2705 COPY_REQ *pSMB = NULL;
@@ -2764,7 +2765,7 @@ copyRetry:
2764} 2765}
2765 2766
2766int 2767int
2767CIFSUnixCreateSymLink(const int xid, struct cifs_tcon *tcon, 2768CIFSUnixCreateSymLink(const unsigned int xid, struct cifs_tcon *tcon,
2768 const char *fromName, const char *toName, 2769 const char *fromName, const char *toName,
2769 const struct nls_table *nls_codepage) 2770 const struct nls_table *nls_codepage)
2770{ 2771{
@@ -2840,7 +2841,7 @@ createSymLinkRetry:
2840 pSMB->ByteCount = cpu_to_le16(byte_count); 2841 pSMB->ByteCount = cpu_to_le16(byte_count);
2841 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 2842 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
2842 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 2843 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
2843 cifs_stats_inc(&tcon->num_symlinks); 2844 cifs_stats_inc(&tcon->stats.cifs_stats.num_symlinks);
2844 if (rc) 2845 if (rc)
2845 cFYI(1, "Send error in SetPathInfo create symlink = %d", rc); 2846 cFYI(1, "Send error in SetPathInfo create symlink = %d", rc);
2846 2847
@@ -2853,7 +2854,7 @@ createSymLinkRetry:
2853} 2854}
2854 2855
2855int 2856int
2856CIFSUnixCreateHardLink(const int xid, struct cifs_tcon *tcon, 2857CIFSUnixCreateHardLink(const unsigned int xid, struct cifs_tcon *tcon,
2857 const char *fromName, const char *toName, 2858 const char *fromName, const char *toName,
2858 const struct nls_table *nls_codepage, int remap) 2859 const struct nls_table *nls_codepage, int remap)
2859{ 2860{
@@ -2926,7 +2927,7 @@ createHardLinkRetry:
2926 pSMB->ByteCount = cpu_to_le16(byte_count); 2927 pSMB->ByteCount = cpu_to_le16(byte_count);
2927 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 2928 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
2928 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 2929 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
2929 cifs_stats_inc(&tcon->num_hardlinks); 2930 cifs_stats_inc(&tcon->stats.cifs_stats.num_hardlinks);
2930 if (rc) 2931 if (rc)
2931 cFYI(1, "Send error in SetPathInfo (hard link) = %d", rc); 2932 cFYI(1, "Send error in SetPathInfo (hard link) = %d", rc);
2932 2933
@@ -2938,7 +2939,7 @@ createHardLinkRetry:
2938} 2939}
2939 2940
2940int 2941int
2941CIFSCreateHardLink(const int xid, struct cifs_tcon *tcon, 2942CIFSCreateHardLink(const unsigned int xid, struct cifs_tcon *tcon,
2942 const char *fromName, const char *toName, 2943 const char *fromName, const char *toName,
2943 const struct nls_table *nls_codepage, int remap) 2944 const struct nls_table *nls_codepage, int remap)
2944{ 2945{
@@ -2998,7 +2999,7 @@ winCreateHardLinkRetry:
2998 2999
2999 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3000 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3000 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 3001 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
3001 cifs_stats_inc(&tcon->num_hardlinks); 3002 cifs_stats_inc(&tcon->stats.cifs_stats.num_hardlinks);
3002 if (rc) 3003 if (rc)
3003 cFYI(1, "Send error in hard link (NT rename) = %d", rc); 3004 cFYI(1, "Send error in hard link (NT rename) = %d", rc);
3004 3005
@@ -3010,7 +3011,7 @@ winCreateHardLinkRetry:
3010} 3011}
3011 3012
3012int 3013int
3013CIFSSMBUnixQuerySymLink(const int xid, struct cifs_tcon *tcon, 3014CIFSSMBUnixQuerySymLink(const unsigned int xid, struct cifs_tcon *tcon,
3014 const unsigned char *searchName, char **symlinkinfo, 3015 const unsigned char *searchName, char **symlinkinfo,
3015 const struct nls_table *nls_codepage) 3016 const struct nls_table *nls_codepage)
3016{ 3017{
@@ -3115,7 +3116,7 @@ querySymLinkRetry:
3115 * it is not compiled in by default until callers fixed up and more tested. 3116 * it is not compiled in by default until callers fixed up and more tested.
3116 */ 3117 */
3117int 3118int
3118CIFSSMBQueryReparseLinkInfo(const int xid, struct cifs_tcon *tcon, 3119CIFSSMBQueryReparseLinkInfo(const unsigned int xid, struct cifs_tcon *tcon,
3119 const unsigned char *searchName, 3120 const unsigned char *searchName,
3120 char *symlinkinfo, const int buflen, __u16 fid, 3121 char *symlinkinfo, const int buflen, __u16 fid,
3121 const struct nls_table *nls_codepage) 3122 const struct nls_table *nls_codepage)
@@ -3352,7 +3353,7 @@ static __u16 ACL_to_cifs_posix(char *parm_data, const char *pACL,
3352} 3353}
3353 3354
3354int 3355int
3355CIFSSMBGetPosixACL(const int xid, struct cifs_tcon *tcon, 3356CIFSSMBGetPosixACL(const unsigned int xid, struct cifs_tcon *tcon,
3356 const unsigned char *searchName, 3357 const unsigned char *searchName,
3357 char *acl_inf, const int buflen, const int acl_type, 3358 char *acl_inf, const int buflen, const int acl_type,
3358 const struct nls_table *nls_codepage, int remap) 3359 const struct nls_table *nls_codepage, int remap)
@@ -3416,7 +3417,7 @@ queryAclRetry:
3416 3417
3417 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 3418 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
3418 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 3419 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
3419 cifs_stats_inc(&tcon->num_acl_get); 3420 cifs_stats_inc(&tcon->stats.cifs_stats.num_acl_get);
3420 if (rc) { 3421 if (rc) {
3421 cFYI(1, "Send error in Query POSIX ACL = %d", rc); 3422 cFYI(1, "Send error in Query POSIX ACL = %d", rc);
3422 } else { 3423 } else {
@@ -3441,7 +3442,7 @@ queryAclRetry:
3441} 3442}
3442 3443
3443int 3444int
3444CIFSSMBSetPosixACL(const int xid, struct cifs_tcon *tcon, 3445CIFSSMBSetPosixACL(const unsigned int xid, struct cifs_tcon *tcon,
3445 const unsigned char *fileName, 3446 const unsigned char *fileName,
3446 const char *local_acl, const int buflen, 3447 const char *local_acl, const int buflen,
3447 const int acl_type, 3448 const int acl_type,
@@ -3521,7 +3522,7 @@ setACLerrorExit:
3521 3522
3522/* BB fix tabs in this function FIXME BB */ 3523/* BB fix tabs in this function FIXME BB */
3523int 3524int
3524CIFSGetExtAttr(const int xid, struct cifs_tcon *tcon, 3525CIFSGetExtAttr(const unsigned int xid, struct cifs_tcon *tcon,
3525 const int netfid, __u64 *pExtAttrBits, __u64 *pMask) 3526 const int netfid, __u64 *pExtAttrBits, __u64 *pMask)
3526{ 3527{
3527 int rc = 0; 3528 int rc = 0;
@@ -3696,7 +3697,7 @@ validate_ntransact(char *buf, char **ppparm, char **ppdata,
3696 3697
3697/* Get Security Descriptor (by handle) from remote server for a file or dir */ 3698/* Get Security Descriptor (by handle) from remote server for a file or dir */
3698int 3699int
3699CIFSSMBGetCIFSACL(const int xid, struct cifs_tcon *tcon, __u16 fid, 3700CIFSSMBGetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
3700 struct cifs_ntsd **acl_inf, __u32 *pbuflen) 3701 struct cifs_ntsd **acl_inf, __u32 *pbuflen)
3701{ 3702{
3702 int rc = 0; 3703 int rc = 0;
@@ -3727,7 +3728,7 @@ CIFSSMBGetCIFSACL(const int xid, struct cifs_tcon *tcon, __u16 fid,
3727 3728
3728 rc = SendReceive2(xid, tcon->ses, iov, 1 /* num iovec */, &buf_type, 3729 rc = SendReceive2(xid, tcon->ses, iov, 1 /* num iovec */, &buf_type,
3729 0); 3730 0);
3730 cifs_stats_inc(&tcon->num_acl_get); 3731 cifs_stats_inc(&tcon->stats.cifs_stats.num_acl_get);
3731 if (rc) { 3732 if (rc) {
3732 cFYI(1, "Send error in QuerySecDesc = %d", rc); 3733 cFYI(1, "Send error in QuerySecDesc = %d", rc);
3733 } else { /* decode response */ 3734 } else { /* decode response */
@@ -3788,7 +3789,7 @@ qsec_out:
3788} 3789}
3789 3790
3790int 3791int
3791CIFSSMBSetCIFSACL(const int xid, struct cifs_tcon *tcon, __u16 fid, 3792CIFSSMBSetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
3792 struct cifs_ntsd *pntsd, __u32 acllen, int aclflag) 3793 struct cifs_ntsd *pntsd, __u32 acllen, int aclflag)
3793{ 3794{
3794 __u16 byte_count, param_count, data_count, param_offset, data_offset; 3795 __u16 byte_count, param_count, data_count, param_offset, data_offset;
@@ -3852,10 +3853,10 @@ setCifsAclRetry:
3852 3853
3853/* Legacy Query Path Information call for lookup to old servers such 3854/* Legacy Query Path Information call for lookup to old servers such
3854 as Win9x/WinME */ 3855 as Win9x/WinME */
3855int SMBQueryInformation(const int xid, struct cifs_tcon *tcon, 3856int
3856 const unsigned char *searchName, 3857SMBQueryInformation(const unsigned int xid, struct cifs_tcon *tcon,
3857 FILE_ALL_INFO *pFinfo, 3858 const char *search_name, FILE_ALL_INFO *data,
3858 const struct nls_table *nls_codepage, int remap) 3859 const struct nls_table *nls_codepage, int remap)
3859{ 3860{
3860 QUERY_INFORMATION_REQ *pSMB; 3861 QUERY_INFORMATION_REQ *pSMB;
3861 QUERY_INFORMATION_RSP *pSMBr; 3862 QUERY_INFORMATION_RSP *pSMBr;
@@ -3863,7 +3864,7 @@ int SMBQueryInformation(const int xid, struct cifs_tcon *tcon,
3863 int bytes_returned; 3864 int bytes_returned;
3864 int name_len; 3865 int name_len;
3865 3866
3866 cFYI(1, "In SMBQPath path %s", searchName); 3867 cFYI(1, "In SMBQPath path %s", search_name);
3867QInfRetry: 3868QInfRetry:
3868 rc = smb_init(SMB_COM_QUERY_INFORMATION, 0, tcon, (void **) &pSMB, 3869 rc = smb_init(SMB_COM_QUERY_INFORMATION, 0, tcon, (void **) &pSMB,
3869 (void **) &pSMBr); 3870 (void **) &pSMBr);
@@ -3873,14 +3874,14 @@ QInfRetry:
3873 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 3874 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
3874 name_len = 3875 name_len =
3875 cifsConvertToUTF16((__le16 *) pSMB->FileName, 3876 cifsConvertToUTF16((__le16 *) pSMB->FileName,
3876 searchName, PATH_MAX, nls_codepage, 3877 search_name, PATH_MAX, nls_codepage,
3877 remap); 3878 remap);
3878 name_len++; /* trailing null */ 3879 name_len++; /* trailing null */
3879 name_len *= 2; 3880 name_len *= 2;
3880 } else { 3881 } else {
3881 name_len = strnlen(searchName, PATH_MAX); 3882 name_len = strnlen(search_name, PATH_MAX);
3882 name_len++; /* trailing null */ 3883 name_len++; /* trailing null */
3883 strncpy(pSMB->FileName, searchName, name_len); 3884 strncpy(pSMB->FileName, search_name, name_len);
3884 } 3885 }
3885 pSMB->BufferFormat = 0x04; 3886 pSMB->BufferFormat = 0x04;
3886 name_len++; /* account for buffer type byte */ 3887 name_len++; /* account for buffer type byte */
@@ -3891,23 +3892,23 @@ QInfRetry:
3891 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 3892 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
3892 if (rc) { 3893 if (rc) {
3893 cFYI(1, "Send error in QueryInfo = %d", rc); 3894 cFYI(1, "Send error in QueryInfo = %d", rc);
3894 } else if (pFinfo) { 3895 } else if (data) {
3895 struct timespec ts; 3896 struct timespec ts;
3896 __u32 time = le32_to_cpu(pSMBr->last_write_time); 3897 __u32 time = le32_to_cpu(pSMBr->last_write_time);
3897 3898
3898 /* decode response */ 3899 /* decode response */
3899 /* BB FIXME - add time zone adjustment BB */ 3900 /* BB FIXME - add time zone adjustment BB */
3900 memset(pFinfo, 0, sizeof(FILE_ALL_INFO)); 3901 memset(data, 0, sizeof(FILE_ALL_INFO));
3901 ts.tv_nsec = 0; 3902 ts.tv_nsec = 0;
3902 ts.tv_sec = time; 3903 ts.tv_sec = time;
3903 /* decode time fields */ 3904 /* decode time fields */
3904 pFinfo->ChangeTime = cpu_to_le64(cifs_UnixTimeToNT(ts)); 3905 data->ChangeTime = cpu_to_le64(cifs_UnixTimeToNT(ts));
3905 pFinfo->LastWriteTime = pFinfo->ChangeTime; 3906 data->LastWriteTime = data->ChangeTime;
3906 pFinfo->LastAccessTime = 0; 3907 data->LastAccessTime = 0;
3907 pFinfo->AllocationSize = 3908 data->AllocationSize =
3908 cpu_to_le64(le32_to_cpu(pSMBr->size)); 3909 cpu_to_le64(le32_to_cpu(pSMBr->size));
3909 pFinfo->EndOfFile = pFinfo->AllocationSize; 3910 data->EndOfFile = data->AllocationSize;
3910 pFinfo->Attributes = 3911 data->Attributes =
3911 cpu_to_le32(le16_to_cpu(pSMBr->attr)); 3912 cpu_to_le32(le16_to_cpu(pSMBr->attr));
3912 } else 3913 } else
3913 rc = -EIO; /* bad buffer passed in */ 3914 rc = -EIO; /* bad buffer passed in */
@@ -3921,7 +3922,7 @@ QInfRetry:
3921} 3922}
3922 3923
3923int 3924int
3924CIFSSMBQFileInfo(const int xid, struct cifs_tcon *tcon, 3925CIFSSMBQFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
3925 u16 netfid, FILE_ALL_INFO *pFindData) 3926 u16 netfid, FILE_ALL_INFO *pFindData)
3926{ 3927{
3927 struct smb_t2_qfi_req *pSMB = NULL; 3928 struct smb_t2_qfi_req *pSMB = NULL;
@@ -3988,13 +3989,12 @@ QFileInfoRetry:
3988} 3989}
3989 3990
3990int 3991int
3991CIFSSMBQPathInfo(const int xid, struct cifs_tcon *tcon, 3992CIFSSMBQPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
3992 const unsigned char *searchName, 3993 const char *search_name, FILE_ALL_INFO *data,
3993 FILE_ALL_INFO *pFindData,
3994 int legacy /* old style infolevel */, 3994 int legacy /* old style infolevel */,
3995 const struct nls_table *nls_codepage, int remap) 3995 const struct nls_table *nls_codepage, int remap)
3996{ 3996{
3997/* level 263 SMB_QUERY_FILE_ALL_INFO */ 3997 /* level 263 SMB_QUERY_FILE_ALL_INFO */
3998 TRANSACTION2_QPI_REQ *pSMB = NULL; 3998 TRANSACTION2_QPI_REQ *pSMB = NULL;
3999 TRANSACTION2_QPI_RSP *pSMBr = NULL; 3999 TRANSACTION2_QPI_RSP *pSMBr = NULL;
4000 int rc = 0; 4000 int rc = 0;
@@ -4002,7 +4002,7 @@ CIFSSMBQPathInfo(const int xid, struct cifs_tcon *tcon,
4002 int name_len; 4002 int name_len;
4003 __u16 params, byte_count; 4003 __u16 params, byte_count;
4004 4004
4005/* cFYI(1, "In QPathInfo path %s", searchName); */ 4005 /* cFYI(1, "In QPathInfo path %s", search_name); */
4006QPathInfoRetry: 4006QPathInfoRetry:
4007 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB, 4007 rc = smb_init(SMB_COM_TRANSACTION2, 15, tcon, (void **) &pSMB,
4008 (void **) &pSMBr); 4008 (void **) &pSMBr);
@@ -4011,14 +4011,14 @@ QPathInfoRetry:
4011 4011
4012 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 4012 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
4013 name_len = 4013 name_len =
4014 cifsConvertToUTF16((__le16 *) pSMB->FileName, searchName, 4014 cifsConvertToUTF16((__le16 *) pSMB->FileName, search_name,
4015 PATH_MAX, nls_codepage, remap); 4015 PATH_MAX, nls_codepage, remap);
4016 name_len++; /* trailing null */ 4016 name_len++; /* trailing null */
4017 name_len *= 2; 4017 name_len *= 2;
4018 } else { /* BB improve the check for buffer overruns BB */ 4018 } else { /* BB improve the check for buffer overruns BB */
4019 name_len = strnlen(searchName, PATH_MAX); 4019 name_len = strnlen(search_name, PATH_MAX);
4020 name_len++; /* trailing null */ 4020 name_len++; /* trailing null */
4021 strncpy(pSMB->FileName, searchName, name_len); 4021 strncpy(pSMB->FileName, search_name, name_len);
4022 } 4022 }
4023 4023
4024 params = 2 /* level */ + 4 /* reserved */ + name_len /* includes NUL */; 4024 params = 2 /* level */ + 4 /* reserved */ + name_len /* includes NUL */;
@@ -4063,20 +4063,21 @@ QPathInfoRetry:
4063 else if (legacy && get_bcc(&pSMBr->hdr) < 24) 4063 else if (legacy && get_bcc(&pSMBr->hdr) < 24)
4064 rc = -EIO; /* 24 or 26 expected but we do not read 4064 rc = -EIO; /* 24 or 26 expected but we do not read
4065 last field */ 4065 last field */
4066 else if (pFindData) { 4066 else if (data) {
4067 int size; 4067 int size;
4068 __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset); 4068 __u16 data_offset = le16_to_cpu(pSMBr->t2.DataOffset);
4069 4069
4070 /* On legacy responses we do not read the last field, 4070 /*
4071 EAsize, fortunately since it varies by subdialect and 4071 * On legacy responses we do not read the last field,
4072 also note it differs on Set vs. Get, ie two bytes or 4 4072 * EAsize, fortunately since it varies by subdialect and
4073 bytes depending but we don't care here */ 4073 * also note it differs on Set vs Get, ie two bytes or 4
4074 * bytes depending but we don't care here.
4075 */
4074 if (legacy) 4076 if (legacy)
4075 size = sizeof(FILE_INFO_STANDARD); 4077 size = sizeof(FILE_INFO_STANDARD);
4076 else 4078 else
4077 size = sizeof(FILE_ALL_INFO); 4079 size = sizeof(FILE_ALL_INFO);
4078 memcpy((char *) pFindData, 4080 memcpy((char *) data, (char *) &pSMBr->hdr.Protocol +
4079 (char *) &pSMBr->hdr.Protocol +
4080 data_offset, size); 4081 data_offset, size);
4081 } else 4082 } else
4082 rc = -ENOMEM; 4083 rc = -ENOMEM;
@@ -4089,7 +4090,7 @@ QPathInfoRetry:
4089} 4090}
4090 4091
4091int 4092int
4092CIFSSMBUnixQFileInfo(const int xid, struct cifs_tcon *tcon, 4093CIFSSMBUnixQFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
4093 u16 netfid, FILE_UNIX_BASIC_INFO *pFindData) 4094 u16 netfid, FILE_UNIX_BASIC_INFO *pFindData)
4094{ 4095{
4095 struct smb_t2_qfi_req *pSMB = NULL; 4096 struct smb_t2_qfi_req *pSMB = NULL;
@@ -4137,7 +4138,7 @@ UnixQFileInfoRetry:
4137 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 4138 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4138 4139
4139 if (rc || get_bcc(&pSMBr->hdr) < sizeof(FILE_UNIX_BASIC_INFO)) { 4140 if (rc || get_bcc(&pSMBr->hdr) < sizeof(FILE_UNIX_BASIC_INFO)) {
4140 cERROR(1, "Malformed FILE_UNIX_BASIC_INFO response.\n" 4141 cERROR(1, "Malformed FILE_UNIX_BASIC_INFO response. "
4141 "Unix Extensions can be disabled on mount " 4142 "Unix Extensions can be disabled on mount "
4142 "by specifying the nosfu mount option."); 4143 "by specifying the nosfu mount option.");
4143 rc = -EIO; /* bad smb */ 4144 rc = -EIO; /* bad smb */
@@ -4158,7 +4159,7 @@ UnixQFileInfoRetry:
4158} 4159}
4159 4160
4160int 4161int
4161CIFSSMBUnixQPathInfo(const int xid, struct cifs_tcon *tcon, 4162CIFSSMBUnixQPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
4162 const unsigned char *searchName, 4163 const unsigned char *searchName,
4163 FILE_UNIX_BASIC_INFO *pFindData, 4164 FILE_UNIX_BASIC_INFO *pFindData,
4164 const struct nls_table *nls_codepage, int remap) 4165 const struct nls_table *nls_codepage, int remap)
@@ -4223,7 +4224,7 @@ UnixQPathInfoRetry:
4223 rc = validate_t2((struct smb_t2_rsp *)pSMBr); 4224 rc = validate_t2((struct smb_t2_rsp *)pSMBr);
4224 4225
4225 if (rc || get_bcc(&pSMBr->hdr) < sizeof(FILE_UNIX_BASIC_INFO)) { 4226 if (rc || get_bcc(&pSMBr->hdr) < sizeof(FILE_UNIX_BASIC_INFO)) {
4226 cERROR(1, "Malformed FILE_UNIX_BASIC_INFO response.\n" 4227 cERROR(1, "Malformed FILE_UNIX_BASIC_INFO response. "
4227 "Unix Extensions can be disabled on mount " 4228 "Unix Extensions can be disabled on mount "
4228 "by specifying the nosfu mount option."); 4229 "by specifying the nosfu mount option.");
4229 rc = -EIO; /* bad smb */ 4230 rc = -EIO; /* bad smb */
@@ -4244,7 +4245,7 @@ UnixQPathInfoRetry:
4244 4245
4245/* xid, tcon, searchName and codepage are input parms, rest are returned */ 4246/* xid, tcon, searchName and codepage are input parms, rest are returned */
4246int 4247int
4247CIFSFindFirst(const int xid, struct cifs_tcon *tcon, 4248CIFSFindFirst(const unsigned int xid, struct cifs_tcon *tcon,
4248 const char *searchName, 4249 const char *searchName,
4249 const struct nls_table *nls_codepage, 4250 const struct nls_table *nls_codepage,
4250 __u16 *pnetfid, __u16 search_flags, 4251 __u16 *pnetfid, __u16 search_flags,
@@ -4329,7 +4330,7 @@ findFirstRetry:
4329 4330
4330 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4331 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4331 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 4332 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
4332 cifs_stats_inc(&tcon->num_ffirst); 4333 cifs_stats_inc(&tcon->stats.cifs_stats.num_ffirst);
4333 4334
4334 if (rc) {/* BB add logic to retry regular search if Unix search 4335 if (rc) {/* BB add logic to retry regular search if Unix search
4335 rejected unexpectedly by server */ 4336 rejected unexpectedly by server */
@@ -4389,8 +4390,9 @@ findFirstRetry:
4389 return rc; 4390 return rc;
4390} 4391}
4391 4392
4392int CIFSFindNext(const int xid, struct cifs_tcon *tcon, __u16 searchHandle, 4393int CIFSFindNext(const unsigned int xid, struct cifs_tcon *tcon,
4393 __u16 search_flags, struct cifs_search_info *psrch_inf) 4394 __u16 searchHandle, __u16 search_flags,
4395 struct cifs_search_info *psrch_inf)
4394{ 4396{
4395 TRANSACTION2_FNEXT_REQ *pSMB = NULL; 4397 TRANSACTION2_FNEXT_REQ *pSMB = NULL;
4396 TRANSACTION2_FNEXT_RSP *pSMBr = NULL; 4398 TRANSACTION2_FNEXT_RSP *pSMBr = NULL;
@@ -4455,7 +4457,7 @@ int CIFSFindNext(const int xid, struct cifs_tcon *tcon, __u16 searchHandle,
4455 4457
4456 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 4458 rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB,
4457 (struct smb_hdr *) pSMBr, &bytes_returned, 0); 4459 (struct smb_hdr *) pSMBr, &bytes_returned, 0);
4458 cifs_stats_inc(&tcon->num_fnext); 4460 cifs_stats_inc(&tcon->stats.cifs_stats.num_fnext);
4459 if (rc) { 4461 if (rc) {
4460 if (rc == -EBADF) { 4462 if (rc == -EBADF) {
4461 psrch_inf->endOfSearch = true; 4463 psrch_inf->endOfSearch = true;
@@ -4524,7 +4526,7 @@ FNext2_err_exit:
4524} 4526}
4525 4527
4526int 4528int
4527CIFSFindClose(const int xid, struct cifs_tcon *tcon, 4529CIFSFindClose(const unsigned int xid, struct cifs_tcon *tcon,
4528 const __u16 searchHandle) 4530 const __u16 searchHandle)
4529{ 4531{
4530 int rc = 0; 4532 int rc = 0;
@@ -4546,7 +4548,7 @@ CIFSFindClose(const int xid, struct cifs_tcon *tcon,
4546 if (rc) 4548 if (rc)
4547 cERROR(1, "Send error in FindClose = %d", rc); 4549 cERROR(1, "Send error in FindClose = %d", rc);
4548 4550
4549 cifs_stats_inc(&tcon->num_fclose); 4551 cifs_stats_inc(&tcon->stats.cifs_stats.num_fclose);
4550 4552
4551 /* Since session is dead, search handle closed on server already */ 4553 /* Since session is dead, search handle closed on server already */
4552 if (rc == -EAGAIN) 4554 if (rc == -EAGAIN)
@@ -4556,9 +4558,8 @@ CIFSFindClose(const int xid, struct cifs_tcon *tcon,
4556} 4558}
4557 4559
4558int 4560int
4559CIFSGetSrvInodeNumber(const int xid, struct cifs_tcon *tcon, 4561CIFSGetSrvInodeNumber(const unsigned int xid, struct cifs_tcon *tcon,
4560 const unsigned char *searchName, 4562 const char *search_name, __u64 *inode_number,
4561 __u64 *inode_number,
4562 const struct nls_table *nls_codepage, int remap) 4563 const struct nls_table *nls_codepage, int remap)
4563{ 4564{
4564 int rc = 0; 4565 int rc = 0;
@@ -4567,7 +4568,7 @@ CIFSGetSrvInodeNumber(const int xid, struct cifs_tcon *tcon,
4567 int name_len, bytes_returned; 4568 int name_len, bytes_returned;
4568 __u16 params, byte_count; 4569 __u16 params, byte_count;
4569 4570
4570 cFYI(1, "In GetSrvInodeNum for %s", searchName); 4571 cFYI(1, "In GetSrvInodeNum for %s", search_name);
4571 if (tcon == NULL) 4572 if (tcon == NULL)
4572 return -ENODEV; 4573 return -ENODEV;
4573 4574
@@ -4580,14 +4581,14 @@ GetInodeNumberRetry:
4580 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 4581 if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) {
4581 name_len = 4582 name_len =
4582 cifsConvertToUTF16((__le16 *) pSMB->FileName, 4583 cifsConvertToUTF16((__le16 *) pSMB->FileName,
4583 searchName, PATH_MAX, nls_codepage, 4584 search_name, PATH_MAX, nls_codepage,
4584 remap); 4585 remap);
4585 name_len++; /* trailing null */ 4586 name_len++; /* trailing null */
4586 name_len *= 2; 4587 name_len *= 2;
4587 } else { /* BB improve the check for buffer overruns BB */ 4588 } else { /* BB improve the check for buffer overruns BB */
4588 name_len = strnlen(searchName, PATH_MAX); 4589 name_len = strnlen(search_name, PATH_MAX);
4589 name_len++; /* trailing null */ 4590 name_len++; /* trailing null */
4590 strncpy(pSMB->FileName, searchName, name_len); 4591 strncpy(pSMB->FileName, search_name, name_len);
4591 } 4592 }
4592 4593
4593 params = 2 /* level */ + 4 /* rsrvd */ + name_len /* incl null */ ; 4594 params = 2 /* level */ + 4 /* rsrvd */ + name_len /* incl null */ ;
@@ -4675,7 +4676,7 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr,
4675 4676
4676 if (*num_of_nodes < 1) { 4677 if (*num_of_nodes < 1) {
4677 cERROR(1, "num_referrals: must be at least > 0," 4678 cERROR(1, "num_referrals: must be at least > 0,"
4678 "but we get num_referrals = %d\n", *num_of_nodes); 4679 "but we get num_referrals = %d", *num_of_nodes);
4679 rc = -EINVAL; 4680 rc = -EINVAL;
4680 goto parse_DFS_referrals_exit; 4681 goto parse_DFS_referrals_exit;
4681 } 4682 }
@@ -4692,14 +4693,14 @@ parse_DFS_referrals(TRANSACTION2_GET_DFS_REFER_RSP *pSMBr,
4692 data_end = (char *)(&(pSMBr->PathConsumed)) + 4693 data_end = (char *)(&(pSMBr->PathConsumed)) +
4693 le16_to_cpu(pSMBr->t2.DataCount); 4694 le16_to_cpu(pSMBr->t2.DataCount);
4694 4695
4695 cFYI(1, "num_referrals: %d dfs flags: 0x%x ...\n", 4696 cFYI(1, "num_referrals: %d dfs flags: 0x%x ...",
4696 *num_of_nodes, 4697 *num_of_nodes,
4697 le32_to_cpu(pSMBr->DFSFlags)); 4698 le32_to_cpu(pSMBr->DFSFlags));
4698 4699
4699 *target_nodes = kzalloc(sizeof(struct dfs_info3_param) * 4700 *target_nodes = kzalloc(sizeof(struct dfs_info3_param) *
4700 *num_of_nodes, GFP_KERNEL); 4701 *num_of_nodes, GFP_KERNEL);
4701 if (*target_nodes == NULL) { 4702 if (*target_nodes == NULL) {
4702 cERROR(1, "Failed to allocate buffer for target_nodes\n"); 4703 cERROR(1, "Failed to allocate buffer for target_nodes");
4703 rc = -ENOMEM; 4704 rc = -ENOMEM;
4704 goto parse_DFS_referrals_exit; 4705 goto parse_DFS_referrals_exit;
4705 } 4706 }
@@ -4763,9 +4764,8 @@ parse_DFS_referrals_exit:
4763} 4764}
4764 4765
4765int 4766int
4766CIFSGetDFSRefer(const int xid, struct cifs_ses *ses, 4767CIFSGetDFSRefer(const unsigned int xid, struct cifs_ses *ses,
4767 const unsigned char *searchName, 4768 const char *search_name, struct dfs_info3_param **target_nodes,
4768 struct dfs_info3_param **target_nodes,
4769 unsigned int *num_of_nodes, 4769 unsigned int *num_of_nodes,
4770 const struct nls_table *nls_codepage, int remap) 4770 const struct nls_table *nls_codepage, int remap)
4771{ 4771{
@@ -4779,7 +4779,7 @@ CIFSGetDFSRefer(const int xid, struct cifs_ses *ses,
4779 *num_of_nodes = 0; 4779 *num_of_nodes = 0;
4780 *target_nodes = NULL; 4780 *target_nodes = NULL;
4781 4781
4782 cFYI(1, "In GetDFSRefer the path %s", searchName); 4782 cFYI(1, "In GetDFSRefer the path %s", search_name);
4783 if (ses == NULL) 4783 if (ses == NULL)
4784 return -ENODEV; 4784 return -ENODEV;
4785getDFSRetry: 4785getDFSRetry:
@@ -4802,14 +4802,14 @@ getDFSRetry:
4802 pSMB->hdr.Flags2 |= SMBFLG2_UNICODE; 4802 pSMB->hdr.Flags2 |= SMBFLG2_UNICODE;
4803 name_len = 4803 name_len =
4804 cifsConvertToUTF16((__le16 *) pSMB->RequestFileName, 4804 cifsConvertToUTF16((__le16 *) pSMB->RequestFileName,
4805 searchName, PATH_MAX, nls_codepage, 4805 search_name, PATH_MAX, nls_codepage,
4806 remap); 4806 remap);
4807 name_len++; /* trailing null */ 4807 name_len++; /* trailing null */
4808 name_len *= 2; 4808 name_len *= 2;
4809 } else { /* BB improve the check for buffer overruns BB */ 4809 } else { /* BB improve the check for buffer overruns BB */
4810 name_len = strnlen(searchName, PATH_MAX); 4810 name_len = strnlen(search_name, PATH_MAX);
4811 name_len++; /* trailing null */ 4811 name_len++; /* trailing null */
4812 strncpy(pSMB->RequestFileName, searchName, name_len); 4812 strncpy(pSMB->RequestFileName, search_name, name_len);
4813 } 4813 }
4814 4814
4815 if (ses->server) { 4815 if (ses->server) {
@@ -4865,7 +4865,7 @@ getDFSRetry:
4865 /* parse returned result into more usable form */ 4865 /* parse returned result into more usable form */
4866 rc = parse_DFS_referrals(pSMBr, num_of_nodes, 4866 rc = parse_DFS_referrals(pSMBr, num_of_nodes,
4867 target_nodes, nls_codepage, remap, 4867 target_nodes, nls_codepage, remap,
4868 searchName); 4868 search_name);
4869 4869
4870GetDFSRefExit: 4870GetDFSRefExit:
4871 cifs_buf_release(pSMB); 4871 cifs_buf_release(pSMB);
@@ -4878,7 +4878,8 @@ GetDFSRefExit:
4878 4878
4879/* Query File System Info such as free space to old servers such as Win 9x */ 4879/* Query File System Info such as free space to old servers such as Win 9x */
4880int 4880int
4881SMBOldQFSInfo(const int xid, struct cifs_tcon *tcon, struct kstatfs *FSData) 4881SMBOldQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
4882 struct kstatfs *FSData)
4882{ 4883{
4883/* level 0x01 SMB_QUERY_FILE_SYSTEM_INFO */ 4884/* level 0x01 SMB_QUERY_FILE_SYSTEM_INFO */
4884 TRANSACTION2_QFSI_REQ *pSMB = NULL; 4885 TRANSACTION2_QFSI_REQ *pSMB = NULL;
@@ -4957,7 +4958,8 @@ oldQFSInfoRetry:
4957} 4958}
4958 4959
4959int 4960int
4960CIFSSMBQFSInfo(const int xid, struct cifs_tcon *tcon, struct kstatfs *FSData) 4961CIFSSMBQFSInfo(const unsigned int xid, struct cifs_tcon *tcon,
4962 struct kstatfs *FSData)
4961{ 4963{
4962/* level 0x103 SMB_QUERY_FILE_SYSTEM_INFO */ 4964/* level 0x103 SMB_QUERY_FILE_SYSTEM_INFO */
4963 TRANSACTION2_QFSI_REQ *pSMB = NULL; 4965 TRANSACTION2_QFSI_REQ *pSMB = NULL;
@@ -5036,7 +5038,7 @@ QFSInfoRetry:
5036} 5038}
5037 5039
5038int 5040int
5039CIFSSMBQFSAttributeInfo(const int xid, struct cifs_tcon *tcon) 5041CIFSSMBQFSAttributeInfo(const unsigned int xid, struct cifs_tcon *tcon)
5040{ 5042{
5041/* level 0x105 SMB_QUERY_FILE_SYSTEM_INFO */ 5043/* level 0x105 SMB_QUERY_FILE_SYSTEM_INFO */
5042 TRANSACTION2_QFSI_REQ *pSMB = NULL; 5044 TRANSACTION2_QFSI_REQ *pSMB = NULL;
@@ -5106,7 +5108,7 @@ QFSAttributeRetry:
5106} 5108}
5107 5109
5108int 5110int
5109CIFSSMBQFSDeviceInfo(const int xid, struct cifs_tcon *tcon) 5111CIFSSMBQFSDeviceInfo(const unsigned int xid, struct cifs_tcon *tcon)
5110{ 5112{
5111/* level 0x104 SMB_QUERY_FILE_SYSTEM_INFO */ 5113/* level 0x104 SMB_QUERY_FILE_SYSTEM_INFO */
5112 TRANSACTION2_QFSI_REQ *pSMB = NULL; 5114 TRANSACTION2_QFSI_REQ *pSMB = NULL;
@@ -5177,7 +5179,7 @@ QFSDeviceRetry:
5177} 5179}
5178 5180
5179int 5181int
5180CIFSSMBQFSUnixInfo(const int xid, struct cifs_tcon *tcon) 5182CIFSSMBQFSUnixInfo(const unsigned int xid, struct cifs_tcon *tcon)
5181{ 5183{
5182/* level 0x200 SMB_QUERY_CIFS_UNIX_INFO */ 5184/* level 0x200 SMB_QUERY_CIFS_UNIX_INFO */
5183 TRANSACTION2_QFSI_REQ *pSMB = NULL; 5185 TRANSACTION2_QFSI_REQ *pSMB = NULL;
@@ -5247,7 +5249,7 @@ QFSUnixRetry:
5247} 5249}
5248 5250
5249int 5251int
5250CIFSSMBSetFSUnixInfo(const int xid, struct cifs_tcon *tcon, __u64 cap) 5252CIFSSMBSetFSUnixInfo(const unsigned int xid, struct cifs_tcon *tcon, __u64 cap)
5251{ 5253{
5252/* level 0x200 SMB_SET_CIFS_UNIX_INFO */ 5254/* level 0x200 SMB_SET_CIFS_UNIX_INFO */
5253 TRANSACTION2_SETFSI_REQ *pSMB = NULL; 5255 TRANSACTION2_SETFSI_REQ *pSMB = NULL;
@@ -5321,7 +5323,7 @@ SETFSUnixRetry:
5321 5323
5322 5324
5323int 5325int
5324CIFSSMBQFSPosixInfo(const int xid, struct cifs_tcon *tcon, 5326CIFSSMBQFSPosixInfo(const unsigned int xid, struct cifs_tcon *tcon,
5325 struct kstatfs *FSData) 5327 struct kstatfs *FSData)
5326{ 5328{
5327/* level 0x201 SMB_QUERY_CIFS_POSIX_INFO */ 5329/* level 0x201 SMB_QUERY_CIFS_POSIX_INFO */
@@ -5414,8 +5416,8 @@ QFSPosixRetry:
5414 in Samba which this routine can run into */ 5416 in Samba which this routine can run into */
5415 5417
5416int 5418int
5417CIFSSMBSetEOF(const int xid, struct cifs_tcon *tcon, const char *fileName, 5419CIFSSMBSetEOF(const unsigned int xid, struct cifs_tcon *tcon,
5418 __u64 size, bool SetAllocation, 5420 const char *fileName, __u64 size, bool SetAllocation,
5419 const struct nls_table *nls_codepage, int remap) 5421 const struct nls_table *nls_codepage, int remap)
5420{ 5422{
5421 struct smb_com_transaction2_spi_req *pSMB = NULL; 5423 struct smb_com_transaction2_spi_req *pSMB = NULL;
@@ -5503,7 +5505,7 @@ SetEOFRetry:
5503} 5505}
5504 5506
5505int 5507int
5506CIFSSMBSetFileSize(const int xid, struct cifs_tcon *tcon, __u64 size, 5508CIFSSMBSetFileSize(const unsigned int xid, struct cifs_tcon *tcon, __u64 size,
5507 __u16 fid, __u32 pid_of_opener, bool SetAllocation) 5509 __u16 fid, __u32 pid_of_opener, bool SetAllocation)
5508{ 5510{
5509 struct smb_com_transaction2_sfi_req *pSMB = NULL; 5511 struct smb_com_transaction2_sfi_req *pSMB = NULL;
@@ -5585,7 +5587,7 @@ CIFSSMBSetFileSize(const int xid, struct cifs_tcon *tcon, __u64 size,
5585 time and resort to the original setpathinfo level which takes the ancient 5587 time and resort to the original setpathinfo level which takes the ancient
5586 DOS time format with 2 second granularity */ 5588 DOS time format with 2 second granularity */
5587int 5589int
5588CIFSSMBSetFileInfo(const int xid, struct cifs_tcon *tcon, 5590CIFSSMBSetFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
5589 const FILE_BASIC_INFO *data, __u16 fid, __u32 pid_of_opener) 5591 const FILE_BASIC_INFO *data, __u16 fid, __u32 pid_of_opener)
5590{ 5592{
5591 struct smb_com_transaction2_sfi_req *pSMB = NULL; 5593 struct smb_com_transaction2_sfi_req *pSMB = NULL;
@@ -5648,7 +5650,7 @@ CIFSSMBSetFileInfo(const int xid, struct cifs_tcon *tcon,
5648} 5650}
5649 5651
5650int 5652int
5651CIFSSMBSetFileDisposition(const int xid, struct cifs_tcon *tcon, 5653CIFSSMBSetFileDisposition(const unsigned int xid, struct cifs_tcon *tcon,
5652 bool delete_file, __u16 fid, __u32 pid_of_opener) 5654 bool delete_file, __u16 fid, __u32 pid_of_opener)
5653{ 5655{
5654 struct smb_com_transaction2_sfi_req *pSMB = NULL; 5656 struct smb_com_transaction2_sfi_req *pSMB = NULL;
@@ -5704,7 +5706,7 @@ CIFSSMBSetFileDisposition(const int xid, struct cifs_tcon *tcon,
5704} 5706}
5705 5707
5706int 5708int
5707CIFSSMBSetPathInfo(const int xid, struct cifs_tcon *tcon, 5709CIFSSMBSetPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
5708 const char *fileName, const FILE_BASIC_INFO *data, 5710 const char *fileName, const FILE_BASIC_INFO *data,
5709 const struct nls_table *nls_codepage, int remap) 5711 const struct nls_table *nls_codepage, int remap)
5710{ 5712{
@@ -5788,7 +5790,7 @@ SetTimesRetry:
5788 handling it anyway and NT4 was what we thought it would be needed for 5790 handling it anyway and NT4 was what we thought it would be needed for
5789 Do not delete it until we prove whether needed for Win9x though */ 5791 Do not delete it until we prove whether needed for Win9x though */
5790int 5792int
5791CIFSSMBSetAttrLegacy(int xid, struct cifs_tcon *tcon, char *fileName, 5793CIFSSMBSetAttrLegacy(unsigned int xid, struct cifs_tcon *tcon, char *fileName,
5792 __u16 dos_attrs, const struct nls_table *nls_codepage) 5794 __u16 dos_attrs, const struct nls_table *nls_codepage)
5793{ 5795{
5794 SETATTR_REQ *pSMB = NULL; 5796 SETATTR_REQ *pSMB = NULL;
@@ -5876,7 +5878,7 @@ cifs_fill_unix_set_info(FILE_UNIX_BASIC_INFO *data_offset,
5876} 5878}
5877 5879
5878int 5880int
5879CIFSSMBUnixSetFileInfo(const int xid, struct cifs_tcon *tcon, 5881CIFSSMBUnixSetFileInfo(const unsigned int xid, struct cifs_tcon *tcon,
5880 const struct cifs_unix_set_info_args *args, 5882 const struct cifs_unix_set_info_args *args,
5881 u16 fid, u32 pid_of_opener) 5883 u16 fid, u32 pid_of_opener)
5882{ 5884{
@@ -5940,7 +5942,8 @@ CIFSSMBUnixSetFileInfo(const int xid, struct cifs_tcon *tcon,
5940} 5942}
5941 5943
5942int 5944int
5943CIFSSMBUnixSetPathInfo(const int xid, struct cifs_tcon *tcon, char *fileName, 5945CIFSSMBUnixSetPathInfo(const unsigned int xid, struct cifs_tcon *tcon,
5946 char *fileName,
5944 const struct cifs_unix_set_info_args *args, 5947 const struct cifs_unix_set_info_args *args,
5945 const struct nls_table *nls_codepage, int remap) 5948 const struct nls_table *nls_codepage, int remap)
5946{ 5949{
@@ -6027,7 +6030,7 @@ setPermsRetry:
6027 * the data isn't copied to it, but the length is returned. 6030 * the data isn't copied to it, but the length is returned.
6028 */ 6031 */
6029ssize_t 6032ssize_t
6030CIFSSMBQAllEAs(const int xid, struct cifs_tcon *tcon, 6033CIFSSMBQAllEAs(const unsigned int xid, struct cifs_tcon *tcon,
6031 const unsigned char *searchName, const unsigned char *ea_name, 6034 const unsigned char *searchName, const unsigned char *ea_name,
6032 char *EAData, size_t buf_size, 6035 char *EAData, size_t buf_size,
6033 const struct nls_table *nls_codepage, int remap) 6036 const struct nls_table *nls_codepage, int remap)
@@ -6210,8 +6213,8 @@ QAllEAsOut:
6210} 6213}
6211 6214
6212int 6215int
6213CIFSSMBSetEA(const int xid, struct cifs_tcon *tcon, const char *fileName, 6216CIFSSMBSetEA(const unsigned int xid, struct cifs_tcon *tcon,
6214 const char *ea_name, const void *ea_value, 6217 const char *fileName, const char *ea_name, const void *ea_value,
6215 const __u16 ea_value_len, const struct nls_table *nls_codepage, 6218 const __u16 ea_value_len, const struct nls_table *nls_codepage,
6216 int remap) 6219 int remap)
6217{ 6220{
@@ -6337,7 +6340,7 @@ SetEARetry:
6337 * incompatible for network fs clients, we could instead simply 6340 * incompatible for network fs clients, we could instead simply
6338 * expose this config flag by adding a future cifs (and smb2) notify ioctl. 6341 * expose this config flag by adding a future cifs (and smb2) notify ioctl.
6339 */ 6342 */
6340int CIFSSMBNotify(const int xid, struct cifs_tcon *tcon, 6343int CIFSSMBNotify(const unsigned int xid, struct cifs_tcon *tcon,
6341 const int notify_subdirs, const __u16 netfid, 6344 const int notify_subdirs, const __u16 netfid,
6342 __u32 filter, struct file *pfile, int multishot, 6345 __u32 filter, struct file *pfile, int multishot,
6343 const struct nls_table *nls_codepage) 6346 const struct nls_table *nls_codepage)
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 94b7788c3189..6df6fa14cba8 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -56,9 +56,6 @@
56#define CIFS_PORT 445 56#define CIFS_PORT 445
57#define RFC1001_PORT 139 57#define RFC1001_PORT 139
58 58
59/* SMB echo "timeout" -- FIXME: tunable? */
60#define SMB_ECHO_INTERVAL (60 * HZ)
61
62extern mempool_t *cifs_req_poolp; 59extern mempool_t *cifs_req_poolp;
63 60
64/* FIXME: should these be tunable? */ 61/* FIXME: should these be tunable? */
@@ -238,8 +235,8 @@ static const match_table_t cifs_mount_option_tokens = {
238enum { 235enum {
239 Opt_sec_krb5, Opt_sec_krb5i, Opt_sec_krb5p, 236 Opt_sec_krb5, Opt_sec_krb5i, Opt_sec_krb5p,
240 Opt_sec_ntlmsspi, Opt_sec_ntlmssp, 237 Opt_sec_ntlmsspi, Opt_sec_ntlmssp,
241 Opt_ntlm, Opt_sec_ntlmi, Opt_sec_ntlmv2i, 238 Opt_ntlm, Opt_sec_ntlmi, Opt_sec_ntlmv2,
242 Opt_sec_nontlm, Opt_sec_lanman, 239 Opt_sec_ntlmv2i, Opt_sec_lanman,
243 Opt_sec_none, 240 Opt_sec_none,
244 241
245 Opt_sec_err 242 Opt_sec_err
@@ -253,8 +250,9 @@ static const match_table_t cifs_secflavor_tokens = {
253 { Opt_sec_ntlmssp, "ntlmssp" }, 250 { Opt_sec_ntlmssp, "ntlmssp" },
254 { Opt_ntlm, "ntlm" }, 251 { Opt_ntlm, "ntlm" },
255 { Opt_sec_ntlmi, "ntlmi" }, 252 { Opt_sec_ntlmi, "ntlmi" },
253 { Opt_sec_ntlmv2, "nontlm" },
254 { Opt_sec_ntlmv2, "ntlmv2" },
256 { Opt_sec_ntlmv2i, "ntlmv2i" }, 255 { Opt_sec_ntlmv2i, "ntlmv2i" },
257 { Opt_sec_nontlm, "nontlm" },
258 { Opt_sec_lanman, "lanman" }, 256 { Opt_sec_lanman, "lanman" },
259 { Opt_sec_none, "none" }, 257 { Opt_sec_none, "none" },
260 258
@@ -296,7 +294,7 @@ static int cifs_setup_volume_info(struct smb_vol *volume_info, char *mount_data,
296 * reconnect tcp session 294 * reconnect tcp session
297 * wake up waiters on reconnection? - (not needed currently) 295 * wake up waiters on reconnection? - (not needed currently)
298 */ 296 */
299static int 297int
300cifs_reconnect(struct TCP_Server_Info *server) 298cifs_reconnect(struct TCP_Server_Info *server)
301{ 299{
302 int rc = 0; 300 int rc = 0;
@@ -316,6 +314,9 @@ cifs_reconnect(struct TCP_Server_Info *server)
316 server->tcpStatus = CifsNeedReconnect; 314 server->tcpStatus = CifsNeedReconnect;
317 spin_unlock(&GlobalMid_Lock); 315 spin_unlock(&GlobalMid_Lock);
318 server->maxBuf = 0; 316 server->maxBuf = 0;
317#ifdef CONFIG_CIFS_SMB2
318 server->max_read = 0;
319#endif
319 320
320 cFYI(1, "Reconnecting tcp session"); 321 cFYI(1, "Reconnecting tcp session");
321 322
@@ -394,143 +395,6 @@ cifs_reconnect(struct TCP_Server_Info *server)
394 return rc; 395 return rc;
395} 396}
396 397
397/*
398 return codes:
399 0 not a transact2, or all data present
400 >0 transact2 with that much data missing
401 -EINVAL = invalid transact2
402
403 */
404static int check2ndT2(char *buf)
405{
406 struct smb_hdr *pSMB = (struct smb_hdr *)buf;
407 struct smb_t2_rsp *pSMBt;
408 int remaining;
409 __u16 total_data_size, data_in_this_rsp;
410
411 if (pSMB->Command != SMB_COM_TRANSACTION2)
412 return 0;
413
414 /* check for plausible wct, bcc and t2 data and parm sizes */
415 /* check for parm and data offset going beyond end of smb */
416 if (pSMB->WordCount != 10) { /* coalesce_t2 depends on this */
417 cFYI(1, "invalid transact2 word count");
418 return -EINVAL;
419 }
420
421 pSMBt = (struct smb_t2_rsp *)pSMB;
422
423 total_data_size = get_unaligned_le16(&pSMBt->t2_rsp.TotalDataCount);
424 data_in_this_rsp = get_unaligned_le16(&pSMBt->t2_rsp.DataCount);
425
426 if (total_data_size == data_in_this_rsp)
427 return 0;
428 else if (total_data_size < data_in_this_rsp) {
429 cFYI(1, "total data %d smaller than data in frame %d",
430 total_data_size, data_in_this_rsp);
431 return -EINVAL;
432 }
433
434 remaining = total_data_size - data_in_this_rsp;
435
436 cFYI(1, "missing %d bytes from transact2, check next response",
437 remaining);
438 if (total_data_size > CIFSMaxBufSize) {
439 cERROR(1, "TotalDataSize %d is over maximum buffer %d",
440 total_data_size, CIFSMaxBufSize);
441 return -EINVAL;
442 }
443 return remaining;
444}
445
446static int coalesce_t2(char *second_buf, struct smb_hdr *target_hdr)
447{
448 struct smb_t2_rsp *pSMBs = (struct smb_t2_rsp *)second_buf;
449 struct smb_t2_rsp *pSMBt = (struct smb_t2_rsp *)target_hdr;
450 char *data_area_of_tgt;
451 char *data_area_of_src;
452 int remaining;
453 unsigned int byte_count, total_in_tgt;
454 __u16 tgt_total_cnt, src_total_cnt, total_in_src;
455
456 src_total_cnt = get_unaligned_le16(&pSMBs->t2_rsp.TotalDataCount);
457 tgt_total_cnt = get_unaligned_le16(&pSMBt->t2_rsp.TotalDataCount);
458
459 if (tgt_total_cnt != src_total_cnt)
460 cFYI(1, "total data count of primary and secondary t2 differ "
461 "source=%hu target=%hu", src_total_cnt, tgt_total_cnt);
462
463 total_in_tgt = get_unaligned_le16(&pSMBt->t2_rsp.DataCount);
464
465 remaining = tgt_total_cnt - total_in_tgt;
466
467 if (remaining < 0) {
468 cFYI(1, "Server sent too much data. tgt_total_cnt=%hu "
469 "total_in_tgt=%hu", tgt_total_cnt, total_in_tgt);
470 return -EPROTO;
471 }
472
473 if (remaining == 0) {
474 /* nothing to do, ignore */
475 cFYI(1, "no more data remains");
476 return 0;
477 }
478
479 total_in_src = get_unaligned_le16(&pSMBs->t2_rsp.DataCount);
480 if (remaining < total_in_src)
481 cFYI(1, "transact2 2nd response contains too much data");
482
483 /* find end of first SMB data area */
484 data_area_of_tgt = (char *)&pSMBt->hdr.Protocol +
485 get_unaligned_le16(&pSMBt->t2_rsp.DataOffset);
486
487 /* validate target area */
488 data_area_of_src = (char *)&pSMBs->hdr.Protocol +
489 get_unaligned_le16(&pSMBs->t2_rsp.DataOffset);
490
491 data_area_of_tgt += total_in_tgt;
492
493 total_in_tgt += total_in_src;
494 /* is the result too big for the field? */
495 if (total_in_tgt > USHRT_MAX) {
496 cFYI(1, "coalesced DataCount too large (%u)", total_in_tgt);
497 return -EPROTO;
498 }
499 put_unaligned_le16(total_in_tgt, &pSMBt->t2_rsp.DataCount);
500
501 /* fix up the BCC */
502 byte_count = get_bcc(target_hdr);
503 byte_count += total_in_src;
504 /* is the result too big for the field? */
505 if (byte_count > USHRT_MAX) {
506 cFYI(1, "coalesced BCC too large (%u)", byte_count);
507 return -EPROTO;
508 }
509 put_bcc(byte_count, target_hdr);
510
511 byte_count = be32_to_cpu(target_hdr->smb_buf_length);
512 byte_count += total_in_src;
513 /* don't allow buffer to overflow */
514 if (byte_count > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) {
515 cFYI(1, "coalesced BCC exceeds buffer size (%u)", byte_count);
516 return -ENOBUFS;
517 }
518 target_hdr->smb_buf_length = cpu_to_be32(byte_count);
519
520 /* copy second buffer into end of first buffer */
521 memcpy(data_area_of_tgt, data_area_of_src, total_in_src);
522
523 if (remaining != total_in_src) {
524 /* more responses to go */
525 cFYI(1, "waiting for more secondary responses");
526 return 1;
527 }
528
529 /* we are done */
530 cFYI(1, "found the last secondary response");
531 return 0;
532}
533
534static void 398static void
535cifs_echo_request(struct work_struct *work) 399cifs_echo_request(struct work_struct *work)
536{ 400{
@@ -539,15 +403,17 @@ cifs_echo_request(struct work_struct *work)
539 struct TCP_Server_Info, echo.work); 403 struct TCP_Server_Info, echo.work);
540 404
541 /* 405 /*
542 * We cannot send an echo until the NEGOTIATE_PROTOCOL request is 406 * We cannot send an echo if it is disabled or until the
543 * done, which is indicated by maxBuf != 0. Also, no need to ping if 407 * NEGOTIATE_PROTOCOL request is done, which is indicated by
544 * we got a response recently 408 * server->ops->need_neg() == true. Also, no need to ping if
409 * we got a response recently.
545 */ 410 */
546 if (server->maxBuf == 0 || 411 if (!server->ops->need_neg || server->ops->need_neg(server) ||
412 (server->ops->can_echo && !server->ops->can_echo(server)) ||
547 time_before(jiffies, server->lstrp + SMB_ECHO_INTERVAL - HZ)) 413 time_before(jiffies, server->lstrp + SMB_ECHO_INTERVAL - HZ))
548 goto requeue_echo; 414 goto requeue_echo;
549 415
550 rc = CIFSSMBEcho(server); 416 rc = server->ops->echo ? server->ops->echo(server) : -ENOSYS;
551 if (rc) 417 if (rc)
552 cFYI(1, "Unable to send echo request to server: %s", 418 cFYI(1, "Unable to send echo request to server: %s",
553 server->hostname); 419 server->hostname);
@@ -803,29 +669,9 @@ static void
803handle_mid(struct mid_q_entry *mid, struct TCP_Server_Info *server, 669handle_mid(struct mid_q_entry *mid, struct TCP_Server_Info *server,
804 char *buf, int malformed) 670 char *buf, int malformed)
805{ 671{
806 if (malformed == 0 && check2ndT2(buf) > 0) { 672 if (server->ops->check_trans2 &&
807 mid->multiRsp = true; 673 server->ops->check_trans2(mid, server, buf, malformed))
808 if (mid->resp_buf) {
809 /* merge response - fix up 1st*/
810 malformed = coalesce_t2(buf, mid->resp_buf);
811 if (malformed > 0)
812 return;
813
814 /* All parts received or packet is malformed. */
815 mid->multiEnd = true;
816 return dequeue_mid(mid, malformed);
817 }
818 if (!server->large_buf) {
819 /*FIXME: switch to already allocated largebuf?*/
820 cERROR(1, "1st trans2 resp needs bigbuf");
821 } else {
822 /* Have first buffer */
823 mid->resp_buf = buf;
824 mid->large_buf = true;
825 server->bigbuf = NULL;
826 }
827 return; 674 return;
828 }
829 mid->resp_buf = buf; 675 mid->resp_buf = buf;
830 mid->large_buf = server->large_buf; 676 mid->large_buf = server->large_buf;
831 /* Was previous buf put in mpx struct for multi-rsp? */ 677 /* Was previous buf put in mpx struct for multi-rsp? */
@@ -1167,7 +1013,7 @@ static int cifs_parse_security_flavors(char *value,
1167 case Opt_sec_ntlmi: 1013 case Opt_sec_ntlmi:
1168 vol->secFlg |= CIFSSEC_MAY_NTLM | CIFSSEC_MUST_SIGN; 1014 vol->secFlg |= CIFSSEC_MAY_NTLM | CIFSSEC_MUST_SIGN;
1169 break; 1015 break;
1170 case Opt_sec_nontlm: 1016 case Opt_sec_ntlmv2:
1171 vol->secFlg |= CIFSSEC_MAY_NTLMV2; 1017 vol->secFlg |= CIFSSEC_MAY_NTLMV2;
1172 break; 1018 break;
1173 case Opt_sec_ntlmv2i: 1019 case Opt_sec_ntlmv2i:
@@ -2409,10 +2255,10 @@ cifs_find_smb_ses(struct TCP_Server_Info *server, struct smb_vol *vol)
2409static void 2255static void
2410cifs_put_smb_ses(struct cifs_ses *ses) 2256cifs_put_smb_ses(struct cifs_ses *ses)
2411{ 2257{
2412 int xid; 2258 unsigned int xid;
2413 struct TCP_Server_Info *server = ses->server; 2259 struct TCP_Server_Info *server = ses->server;
2414 2260
2415 cFYI(1, "%s: ses_count=%d\n", __func__, ses->ses_count); 2261 cFYI(1, "%s: ses_count=%d", __func__, ses->ses_count);
2416 spin_lock(&cifs_tcp_ses_lock); 2262 spin_lock(&cifs_tcp_ses_lock);
2417 if (--ses->ses_count > 0) { 2263 if (--ses->ses_count > 0) {
2418 spin_unlock(&cifs_tcp_ses_lock); 2264 spin_unlock(&cifs_tcp_ses_lock);
@@ -2422,10 +2268,10 @@ cifs_put_smb_ses(struct cifs_ses *ses)
2422 list_del_init(&ses->smb_ses_list); 2268 list_del_init(&ses->smb_ses_list);
2423 spin_unlock(&cifs_tcp_ses_lock); 2269 spin_unlock(&cifs_tcp_ses_lock);
2424 2270
2425 if (ses->status == CifsGood) { 2271 if (ses->status == CifsGood && server->ops->logoff) {
2426 xid = GetXid(); 2272 xid = get_xid();
2427 CIFSSMBLogoff(xid, ses); 2273 server->ops->logoff(xid, ses);
2428 _FreeXid(xid); 2274 _free_xid(xid);
2429 } 2275 }
2430 sesInfoFree(ses); 2276 sesInfoFree(ses);
2431 cifs_put_tcp_session(server); 2277 cifs_put_tcp_session(server);
@@ -2562,12 +2408,13 @@ static bool warned_on_ntlm; /* globals init to false automatically */
2562static struct cifs_ses * 2408static struct cifs_ses *
2563cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info) 2409cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
2564{ 2410{
2565 int rc = -ENOMEM, xid; 2411 int rc = -ENOMEM;
2412 unsigned int xid;
2566 struct cifs_ses *ses; 2413 struct cifs_ses *ses;
2567 struct sockaddr_in *addr = (struct sockaddr_in *)&server->dstaddr; 2414 struct sockaddr_in *addr = (struct sockaddr_in *)&server->dstaddr;
2568 struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)&server->dstaddr; 2415 struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)&server->dstaddr;
2569 2416
2570 xid = GetXid(); 2417 xid = get_xid();
2571 2418
2572 ses = cifs_find_smb_ses(server, volume_info); 2419 ses = cifs_find_smb_ses(server, volume_info);
2573 if (ses) { 2420 if (ses) {
@@ -2579,7 +2426,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
2579 mutex_unlock(&ses->session_mutex); 2426 mutex_unlock(&ses->session_mutex);
2580 /* problem -- put our ses reference */ 2427 /* problem -- put our ses reference */
2581 cifs_put_smb_ses(ses); 2428 cifs_put_smb_ses(ses);
2582 FreeXid(xid); 2429 free_xid(xid);
2583 return ERR_PTR(rc); 2430 return ERR_PTR(rc);
2584 } 2431 }
2585 if (ses->need_reconnect) { 2432 if (ses->need_reconnect) {
@@ -2590,7 +2437,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
2590 mutex_unlock(&ses->session_mutex); 2437 mutex_unlock(&ses->session_mutex);
2591 /* problem -- put our reference */ 2438 /* problem -- put our reference */
2592 cifs_put_smb_ses(ses); 2439 cifs_put_smb_ses(ses);
2593 FreeXid(xid); 2440 free_xid(xid);
2594 return ERR_PTR(rc); 2441 return ERR_PTR(rc);
2595 } 2442 }
2596 } 2443 }
@@ -2598,7 +2445,7 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
2598 2445
2599 /* existing SMB ses has a server reference already */ 2446 /* existing SMB ses has a server reference already */
2600 cifs_put_tcp_session(server); 2447 cifs_put_tcp_session(server);
2601 FreeXid(xid); 2448 free_xid(xid);
2602 return ses; 2449 return ses;
2603 } 2450 }
2604 2451
@@ -2657,12 +2504,12 @@ cifs_get_smb_ses(struct TCP_Server_Info *server, struct smb_vol *volume_info)
2657 list_add(&ses->smb_ses_list, &server->smb_ses_list); 2504 list_add(&ses->smb_ses_list, &server->smb_ses_list);
2658 spin_unlock(&cifs_tcp_ses_lock); 2505 spin_unlock(&cifs_tcp_ses_lock);
2659 2506
2660 FreeXid(xid); 2507 free_xid(xid);
2661 return ses; 2508 return ses;
2662 2509
2663get_ses_fail: 2510get_ses_fail:
2664 sesInfoFree(ses); 2511 sesInfoFree(ses);
2665 FreeXid(xid); 2512 free_xid(xid);
2666 return ERR_PTR(rc); 2513 return ERR_PTR(rc);
2667} 2514}
2668 2515
@@ -2697,10 +2544,10 @@ cifs_find_tcon(struct cifs_ses *ses, const char *unc)
2697static void 2544static void
2698cifs_put_tcon(struct cifs_tcon *tcon) 2545cifs_put_tcon(struct cifs_tcon *tcon)
2699{ 2546{
2700 int xid; 2547 unsigned int xid;
2701 struct cifs_ses *ses = tcon->ses; 2548 struct cifs_ses *ses = tcon->ses;
2702 2549
2703 cFYI(1, "%s: tc_count=%d\n", __func__, tcon->tc_count); 2550 cFYI(1, "%s: tc_count=%d", __func__, tcon->tc_count);
2704 spin_lock(&cifs_tcp_ses_lock); 2551 spin_lock(&cifs_tcp_ses_lock);
2705 if (--tcon->tc_count > 0) { 2552 if (--tcon->tc_count > 0) {
2706 spin_unlock(&cifs_tcp_ses_lock); 2553 spin_unlock(&cifs_tcp_ses_lock);
@@ -2710,9 +2557,10 @@ cifs_put_tcon(struct cifs_tcon *tcon)
2710 list_del_init(&tcon->tcon_list); 2557 list_del_init(&tcon->tcon_list);
2711 spin_unlock(&cifs_tcp_ses_lock); 2558 spin_unlock(&cifs_tcp_ses_lock);
2712 2559
2713 xid = GetXid(); 2560 xid = get_xid();
2714 CIFSSMBTDis(xid, tcon); 2561 if (ses->server->ops->tree_disconnect)
2715 _FreeXid(xid); 2562 ses->server->ops->tree_disconnect(xid, tcon);
2563 _free_xid(xid);
2716 2564
2717 cifs_fscache_release_super_cookie(tcon); 2565 cifs_fscache_release_super_cookie(tcon);
2718 tconInfoFree(tcon); 2566 tconInfoFree(tcon);
@@ -2736,6 +2584,11 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb_vol *volume_info)
2736 return tcon; 2584 return tcon;
2737 } 2585 }
2738 2586
2587 if (!ses->server->ops->tree_connect) {
2588 rc = -ENOSYS;
2589 goto out_fail;
2590 }
2591
2739 tcon = tconInfoAlloc(); 2592 tcon = tconInfoAlloc();
2740 if (tcon == NULL) { 2593 if (tcon == NULL) {
2741 rc = -ENOMEM; 2594 rc = -ENOMEM;
@@ -2758,13 +2611,15 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb_vol *volume_info)
2758 goto out_fail; 2611 goto out_fail;
2759 } 2612 }
2760 2613
2761 /* BB Do we need to wrap session_mutex around 2614 /*
2762 * this TCon call and Unix SetFS as 2615 * BB Do we need to wrap session_mutex around this TCon call and Unix
2763 * we do on SessSetup and reconnect? */ 2616 * SetFS as we do on SessSetup and reconnect?
2764 xid = GetXid(); 2617 */
2765 rc = CIFSTCon(xid, ses, volume_info->UNC, tcon, volume_info->local_nls); 2618 xid = get_xid();
2766 FreeXid(xid); 2619 rc = ses->server->ops->tree_connect(xid, ses, volume_info->UNC, tcon,
2767 cFYI(1, "CIFS Tcon rc = %d", rc); 2620 volume_info->local_nls);
2621 free_xid(xid);
2622 cFYI(1, "Tcon rc = %d", rc);
2768 if (rc) 2623 if (rc)
2769 goto out_fail; 2624 goto out_fail;
2770 2625
@@ -2773,10 +2628,11 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb_vol *volume_info)
2773 cFYI(1, "DFS disabled (%d)", tcon->Flags); 2628 cFYI(1, "DFS disabled (%d)", tcon->Flags);
2774 } 2629 }
2775 tcon->seal = volume_info->seal; 2630 tcon->seal = volume_info->seal;
2776 /* we can have only one retry value for a connection 2631 /*
2777 to a share so for resources mounted more than once 2632 * We can have only one retry value for a connection to a share so for
2778 to the same server share the last value passed in 2633 * resources mounted more than once to the same server share the last
2779 for the retry flag is used */ 2634 * value passed in for the retry flag is used.
2635 */
2780 tcon->retry = volume_info->retry; 2636 tcon->retry = volume_info->retry;
2781 tcon->nocase = volume_info->nocase; 2637 tcon->nocase = volume_info->nocase;
2782 tcon->local_lease = volume_info->local_lease; 2638 tcon->local_lease = volume_info->local_lease;
@@ -2910,37 +2766,42 @@ out:
2910} 2766}
2911 2767
2912int 2768int
2913get_dfs_path(int xid, struct cifs_ses *pSesInfo, const char *old_path, 2769get_dfs_path(const unsigned int xid, struct cifs_ses *ses, const char *old_path,
2914 const struct nls_table *nls_codepage, unsigned int *pnum_referrals, 2770 const struct nls_table *nls_codepage, unsigned int *num_referrals,
2915 struct dfs_info3_param **preferrals, int remap) 2771 struct dfs_info3_param **referrals, int remap)
2916{ 2772{
2917 char *temp_unc; 2773 char *temp_unc;
2918 int rc = 0; 2774 int rc = 0;
2919 2775
2920 *pnum_referrals = 0; 2776 if (!ses->server->ops->tree_connect || !ses->server->ops->get_dfs_refer)
2921 *preferrals = NULL; 2777 return -ENOSYS;
2778
2779 *num_referrals = 0;
2780 *referrals = NULL;
2922 2781
2923 if (pSesInfo->ipc_tid == 0) { 2782 if (ses->ipc_tid == 0) {
2924 temp_unc = kmalloc(2 /* for slashes */ + 2783 temp_unc = kmalloc(2 /* for slashes */ +
2925 strnlen(pSesInfo->serverName, 2784 strnlen(ses->serverName, SERVER_NAME_LEN_WITH_NULL * 2)
2926 SERVER_NAME_LEN_WITH_NULL * 2) 2785 + 1 + 4 /* slash IPC$ */ + 2, GFP_KERNEL);
2927 + 1 + 4 /* slash IPC$ */ + 2,
2928 GFP_KERNEL);
2929 if (temp_unc == NULL) 2786 if (temp_unc == NULL)
2930 return -ENOMEM; 2787 return -ENOMEM;
2931 temp_unc[0] = '\\'; 2788 temp_unc[0] = '\\';
2932 temp_unc[1] = '\\'; 2789 temp_unc[1] = '\\';
2933 strcpy(temp_unc + 2, pSesInfo->serverName); 2790 strcpy(temp_unc + 2, ses->serverName);
2934 strcpy(temp_unc + 2 + strlen(pSesInfo->serverName), "\\IPC$"); 2791 strcpy(temp_unc + 2 + strlen(ses->serverName), "\\IPC$");
2935 rc = CIFSTCon(xid, pSesInfo, temp_unc, NULL, nls_codepage); 2792 rc = ses->server->ops->tree_connect(xid, ses, temp_unc, NULL,
2936 cFYI(1, "CIFS Tcon rc = %d ipc_tid = %d", rc, pSesInfo->ipc_tid); 2793 nls_codepage);
2794 cFYI(1, "Tcon rc = %d ipc_tid = %d", rc, ses->ipc_tid);
2937 kfree(temp_unc); 2795 kfree(temp_unc);
2938 } 2796 }
2939 if (rc == 0) 2797 if (rc == 0)
2940 rc = CIFSGetDFSRefer(xid, pSesInfo, old_path, preferrals, 2798 rc = ses->server->ops->get_dfs_refer(xid, ses, old_path,
2941 pnum_referrals, nls_codepage, remap); 2799 referrals, num_referrals,
2942 /* BB map targetUNCs to dfs_info3 structures, here or 2800 nls_codepage, remap);
2943 in CIFSGetDFSRefer BB */ 2801 /*
2802 * BB - map targetUNCs to dfs_info3 structures, here or in
2803 * ses->server->ops->get_dfs_refer.
2804 */
2944 2805
2945 return rc; 2806 return rc;
2946} 2807}
@@ -3009,11 +2870,11 @@ bind_socket(struct TCP_Server_Info *server)
3009 saddr6 = (struct sockaddr_in6 *)&server->srcaddr; 2870 saddr6 = (struct sockaddr_in6 *)&server->srcaddr;
3010 if (saddr6->sin6_family == AF_INET6) 2871 if (saddr6->sin6_family == AF_INET6)
3011 cERROR(1, "cifs: " 2872 cERROR(1, "cifs: "
3012 "Failed to bind to: %pI6c, error: %d\n", 2873 "Failed to bind to: %pI6c, error: %d",
3013 &saddr6->sin6_addr, rc); 2874 &saddr6->sin6_addr, rc);
3014 else 2875 else
3015 cERROR(1, "cifs: " 2876 cERROR(1, "cifs: "
3016 "Failed to bind to: %pI4, error: %d\n", 2877 "Failed to bind to: %pI4, error: %d",
3017 &saddr4->sin_addr.s_addr, rc); 2878 &saddr4->sin_addr.s_addr, rc);
3018 } 2879 }
3019 } 2880 }
@@ -3209,7 +3070,7 @@ ip_connect(struct TCP_Server_Info *server)
3209 return generic_ip_connect(server); 3070 return generic_ip_connect(server);
3210} 3071}
3211 3072
3212void reset_cifs_unix_caps(int xid, struct cifs_tcon *tcon, 3073void reset_cifs_unix_caps(unsigned int xid, struct cifs_tcon *tcon,
3213 struct cifs_sb_info *cifs_sb, struct smb_vol *vol_info) 3074 struct cifs_sb_info *cifs_sb, struct smb_vol *vol_info)
3214{ 3075{
3215 /* if we are reconnecting then should we check to see if 3076 /* if we are reconnecting then should we check to see if
@@ -3304,9 +3165,9 @@ void reset_cifs_unix_caps(int xid, struct cifs_tcon *tcon,
3304 cFYI(1, "resetting capabilities failed"); 3165 cFYI(1, "resetting capabilities failed");
3305 } else 3166 } else
3306 cERROR(1, "Negotiating Unix capabilities " 3167 cERROR(1, "Negotiating Unix capabilities "
3307 "with the server failed. Consider " 3168 "with the server failed. Consider "
3308 "mounting with the Unix Extensions\n" 3169 "mounting with the Unix Extensions "
3309 "disabled, if problems are found, " 3170 "disabled if problems are found "
3310 "by specifying the nounix mount " 3171 "by specifying the nounix mount "
3311 "option."); 3172 "option.");
3312 3173
@@ -3540,30 +3401,6 @@ cifs_negotiate_rsize(struct cifs_tcon *tcon, struct smb_vol *pvolume_info)
3540 return rsize; 3401 return rsize;
3541} 3402}
3542 3403
3543static int
3544is_path_accessible(int xid, struct cifs_tcon *tcon,
3545 struct cifs_sb_info *cifs_sb, const char *full_path)
3546{
3547 int rc;
3548 FILE_ALL_INFO *pfile_info;
3549
3550 pfile_info = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);
3551 if (pfile_info == NULL)
3552 return -ENOMEM;
3553
3554 rc = CIFSSMBQPathInfo(xid, tcon, full_path, pfile_info,
3555 0 /* not legacy */, cifs_sb->local_nls,
3556 cifs_sb->mnt_cifs_flags &
3557 CIFS_MOUNT_MAP_SPECIAL_CHR);
3558
3559 if (rc == -EOPNOTSUPP || rc == -EINVAL)
3560 rc = SMBQueryInformation(xid, tcon, full_path, pfile_info,
3561 cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
3562 CIFS_MOUNT_MAP_SPECIAL_CHR);
3563 kfree(pfile_info);
3564 return rc;
3565}
3566
3567static void 3404static void
3568cleanup_volume_info_contents(struct smb_vol *volume_info) 3405cleanup_volume_info_contents(struct smb_vol *volume_info)
3569{ 3406{
@@ -3627,7 +3464,7 @@ build_unc_path_to_root(const struct smb_vol *vol,
3627 * determine whether there were referrals. 3464 * determine whether there were referrals.
3628 */ 3465 */
3629static int 3466static int
3630expand_dfs_referral(int xid, struct cifs_ses *pSesInfo, 3467expand_dfs_referral(const unsigned int xid, struct cifs_ses *ses,
3631 struct smb_vol *volume_info, struct cifs_sb_info *cifs_sb, 3468 struct smb_vol *volume_info, struct cifs_sb_info *cifs_sb,
3632 int check_prefix) 3469 int check_prefix)
3633{ 3470{
@@ -3643,7 +3480,7 @@ expand_dfs_referral(int xid, struct cifs_ses *pSesInfo,
3643 /* For DFS paths, skip the first '\' of the UNC */ 3480 /* For DFS paths, skip the first '\' of the UNC */
3644 ref_path = check_prefix ? full_path + 1 : volume_info->UNC + 1; 3481 ref_path = check_prefix ? full_path + 1 : volume_info->UNC + 1;
3645 3482
3646 rc = get_dfs_path(xid, pSesInfo , ref_path, cifs_sb->local_nls, 3483 rc = get_dfs_path(xid, ses, ref_path, cifs_sb->local_nls,
3647 &num_referrals, &referrals, 3484 &num_referrals, &referrals,
3648 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); 3485 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
3649 3486
@@ -3737,10 +3574,10 @@ int
3737cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info) 3574cifs_mount(struct cifs_sb_info *cifs_sb, struct smb_vol *volume_info)
3738{ 3575{
3739 int rc; 3576 int rc;
3740 int xid; 3577 unsigned int xid;
3741 struct cifs_ses *pSesInfo; 3578 struct cifs_ses *ses;
3742 struct cifs_tcon *tcon; 3579 struct cifs_tcon *tcon;
3743 struct TCP_Server_Info *srvTcp; 3580 struct TCP_Server_Info *server;
3744 char *full_path; 3581 char *full_path;
3745 struct tcon_link *tlink; 3582 struct tcon_link *tlink;
3746#ifdef CONFIG_CIFS_DFS_UPCALL 3583#ifdef CONFIG_CIFS_DFS_UPCALL
@@ -3757,39 +3594,39 @@ try_mount_again:
3757 if (referral_walks_count) { 3594 if (referral_walks_count) {
3758 if (tcon) 3595 if (tcon)
3759 cifs_put_tcon(tcon); 3596 cifs_put_tcon(tcon);
3760 else if (pSesInfo) 3597 else if (ses)
3761 cifs_put_smb_ses(pSesInfo); 3598 cifs_put_smb_ses(ses);
3762 3599
3763 FreeXid(xid); 3600 free_xid(xid);
3764 } 3601 }
3765#endif 3602#endif
3766 rc = 0; 3603 rc = 0;
3767 tcon = NULL; 3604 tcon = NULL;
3768 pSesInfo = NULL; 3605 ses = NULL;
3769 srvTcp = NULL; 3606 server = NULL;
3770 full_path = NULL; 3607 full_path = NULL;
3771 tlink = NULL; 3608 tlink = NULL;
3772 3609
3773 xid = GetXid(); 3610 xid = get_xid();
3774 3611
3775 /* get a reference to a tcp session */ 3612 /* get a reference to a tcp session */
3776 srvTcp = cifs_get_tcp_session(volume_info); 3613 server = cifs_get_tcp_session(volume_info);
3777 if (IS_ERR(srvTcp)) { 3614 if (IS_ERR(server)) {
3778 rc = PTR_ERR(srvTcp); 3615 rc = PTR_ERR(server);
3779 bdi_destroy(&cifs_sb->bdi); 3616 bdi_destroy(&cifs_sb->bdi);
3780 goto out; 3617 goto out;
3781 } 3618 }
3782 3619
3783 /* get a reference to a SMB session */ 3620 /* get a reference to a SMB session */
3784 pSesInfo = cifs_get_smb_ses(srvTcp, volume_info); 3621 ses = cifs_get_smb_ses(server, volume_info);
3785 if (IS_ERR(pSesInfo)) { 3622 if (IS_ERR(ses)) {
3786 rc = PTR_ERR(pSesInfo); 3623 rc = PTR_ERR(ses);
3787 pSesInfo = NULL; 3624 ses = NULL;
3788 goto mount_fail_check; 3625 goto mount_fail_check;
3789 } 3626 }
3790 3627
3791 /* search for existing tcon to this server share */ 3628 /* search for existing tcon to this server share */
3792 tcon = cifs_get_tcon(pSesInfo, volume_info); 3629 tcon = cifs_get_tcon(ses, volume_info);
3793 if (IS_ERR(tcon)) { 3630 if (IS_ERR(tcon)) {
3794 rc = PTR_ERR(tcon); 3631 rc = PTR_ERR(tcon);
3795 tcon = NULL; 3632 tcon = NULL;
@@ -3797,7 +3634,7 @@ try_mount_again:
3797 } 3634 }
3798 3635
3799 /* tell server which Unix caps we support */ 3636 /* tell server which Unix caps we support */
3800 if (tcon->ses->capabilities & CAP_UNIX) { 3637 if (cap_unix(tcon->ses)) {
3801 /* reset of caps checks mount to see if unix extensions 3638 /* reset of caps checks mount to see if unix extensions
3802 disabled for just this mount */ 3639 disabled for just this mount */
3803 reset_cifs_unix_caps(xid, tcon, cifs_sb, volume_info); 3640 reset_cifs_unix_caps(xid, tcon, cifs_sb, volume_info);
@@ -3810,11 +3647,9 @@ try_mount_again:
3810 } else 3647 } else
3811 tcon->unix_ext = 0; /* server does not support them */ 3648 tcon->unix_ext = 0; /* server does not support them */
3812 3649
3813 /* do not care if following two calls succeed - informational */ 3650 /* do not care if a following call succeed - informational */
3814 if (!tcon->ipc) { 3651 if (!tcon->ipc && server->ops->qfs_tcon)
3815 CIFSSMBQFSDeviceInfo(xid, tcon); 3652 server->ops->qfs_tcon(xid, tcon);
3816 CIFSSMBQFSAttributeInfo(xid, tcon);
3817 }
3818 3653
3819 cifs_sb->wsize = cifs_negotiate_wsize(tcon, volume_info); 3654 cifs_sb->wsize = cifs_negotiate_wsize(tcon, volume_info);
3820 cifs_sb->rsize = cifs_negotiate_rsize(tcon, volume_info); 3655 cifs_sb->rsize = cifs_negotiate_rsize(tcon, volume_info);
@@ -3832,8 +3667,8 @@ remote_path_check:
3832 * Chase the referral if found, otherwise continue normally. 3667 * Chase the referral if found, otherwise continue normally.
3833 */ 3668 */
3834 if (referral_walks_count == 0) { 3669 if (referral_walks_count == 0) {
3835 int refrc = expand_dfs_referral(xid, pSesInfo, volume_info, 3670 int refrc = expand_dfs_referral(xid, ses, volume_info, cifs_sb,
3836 cifs_sb, false); 3671 false);
3837 if (!refrc) { 3672 if (!refrc) {
3838 referral_walks_count++; 3673 referral_walks_count++;
3839 goto try_mount_again; 3674 goto try_mount_again;
@@ -3843,13 +3678,18 @@ remote_path_check:
3843 3678
3844 /* check if a whole path is not remote */ 3679 /* check if a whole path is not remote */
3845 if (!rc && tcon) { 3680 if (!rc && tcon) {
3681 if (!server->ops->is_path_accessible) {
3682 rc = -ENOSYS;
3683 goto mount_fail_check;
3684 }
3846 /* build_path_to_root works only when we have a valid tcon */ 3685 /* build_path_to_root works only when we have a valid tcon */
3847 full_path = cifs_build_path_to_root(volume_info, cifs_sb, tcon); 3686 full_path = build_path_to_root(volume_info, cifs_sb, tcon);
3848 if (full_path == NULL) { 3687 if (full_path == NULL) {
3849 rc = -ENOMEM; 3688 rc = -ENOMEM;
3850 goto mount_fail_check; 3689 goto mount_fail_check;
3851 } 3690 }
3852 rc = is_path_accessible(xid, tcon, cifs_sb, full_path); 3691 rc = server->ops->is_path_accessible(xid, tcon, cifs_sb,
3692 full_path);
3853 if (rc != 0 && rc != -EREMOTE) { 3693 if (rc != 0 && rc != -EREMOTE) {
3854 kfree(full_path); 3694 kfree(full_path);
3855 goto mount_fail_check; 3695 goto mount_fail_check;
@@ -3871,8 +3711,7 @@ remote_path_check:
3871 goto mount_fail_check; 3711 goto mount_fail_check;
3872 } 3712 }
3873 3713
3874 rc = expand_dfs_referral(xid, pSesInfo, volume_info, cifs_sb, 3714 rc = expand_dfs_referral(xid, ses, volume_info, cifs_sb, true);
3875 true);
3876 3715
3877 if (!rc) { 3716 if (!rc) {
3878 referral_walks_count++; 3717 referral_walks_count++;
@@ -3894,7 +3733,7 @@ remote_path_check:
3894 goto mount_fail_check; 3733 goto mount_fail_check;
3895 } 3734 }
3896 3735
3897 tlink->tl_uid = pSesInfo->linux_uid; 3736 tlink->tl_uid = ses->linux_uid;
3898 tlink->tl_tcon = tcon; 3737 tlink->tl_tcon = tcon;
3899 tlink->tl_time = jiffies; 3738 tlink->tl_time = jiffies;
3900 set_bit(TCON_LINK_MASTER, &tlink->tl_flags); 3739 set_bit(TCON_LINK_MASTER, &tlink->tl_flags);
@@ -3915,15 +3754,15 @@ mount_fail_check:
3915 /* up accidentally freeing someone elses tcon struct */ 3754 /* up accidentally freeing someone elses tcon struct */
3916 if (tcon) 3755 if (tcon)
3917 cifs_put_tcon(tcon); 3756 cifs_put_tcon(tcon);
3918 else if (pSesInfo) 3757 else if (ses)
3919 cifs_put_smb_ses(pSesInfo); 3758 cifs_put_smb_ses(ses);
3920 else 3759 else
3921 cifs_put_tcp_session(srvTcp); 3760 cifs_put_tcp_session(server);
3922 bdi_destroy(&cifs_sb->bdi); 3761 bdi_destroy(&cifs_sb->bdi);
3923 } 3762 }
3924 3763
3925out: 3764out:
3926 FreeXid(xid); 3765 free_xid(xid);
3927 return rc; 3766 return rc;
3928} 3767}
3929 3768
@@ -3932,7 +3771,7 @@ out:
3932 * pointer may be NULL. 3771 * pointer may be NULL.
3933 */ 3772 */
3934int 3773int
3935CIFSTCon(unsigned int xid, struct cifs_ses *ses, 3774CIFSTCon(const unsigned int xid, struct cifs_ses *ses,
3936 const char *tree, struct cifs_tcon *tcon, 3775 const char *tree, struct cifs_tcon *tcon,
3937 const struct nls_table *nls_codepage) 3776 const struct nls_table *nls_codepage)
3938{ 3777{
@@ -4116,24 +3955,22 @@ cifs_umount(struct cifs_sb_info *cifs_sb)
4116 kfree(cifs_sb); 3955 kfree(cifs_sb);
4117} 3956}
4118 3957
4119int cifs_negotiate_protocol(unsigned int xid, struct cifs_ses *ses) 3958int
3959cifs_negotiate_protocol(const unsigned int xid, struct cifs_ses *ses)
4120{ 3960{
4121 int rc = 0; 3961 int rc = 0;
4122 struct TCP_Server_Info *server = ses->server; 3962 struct TCP_Server_Info *server = ses->server;
4123 3963
3964 if (!server->ops->need_neg || !server->ops->negotiate)
3965 return -ENOSYS;
3966
4124 /* only send once per connect */ 3967 /* only send once per connect */
4125 if (server->maxBuf != 0) 3968 if (!server->ops->need_neg(server))
4126 return 0; 3969 return 0;
4127 3970
4128 set_credits(server, 1); 3971 set_credits(server, 1);
4129 rc = CIFSSMBNegotiate(xid, ses); 3972
4130 if (rc == -EAGAIN) { 3973 rc = server->ops->negotiate(xid, ses);
4131 /* retry only once on 1st time connection */
4132 set_credits(server, 1);
4133 rc = CIFSSMBNegotiate(xid, ses);
4134 if (rc == -EAGAIN)
4135 rc = -EHOSTDOWN;
4136 }
4137 if (rc == 0) { 3974 if (rc == 0) {
4138 spin_lock(&GlobalMid_Lock); 3975 spin_lock(&GlobalMid_Lock);
4139 if (server->tcpStatus == CifsNeedNegotiate) 3976 if (server->tcpStatus == CifsNeedNegotiate)
@@ -4141,28 +3978,29 @@ int cifs_negotiate_protocol(unsigned int xid, struct cifs_ses *ses)
4141 else 3978 else
4142 rc = -EHOSTDOWN; 3979 rc = -EHOSTDOWN;
4143 spin_unlock(&GlobalMid_Lock); 3980 spin_unlock(&GlobalMid_Lock);
4144
4145 } 3981 }
4146 3982
4147 return rc; 3983 return rc;
4148} 3984}
4149 3985
4150 3986int
4151int cifs_setup_session(unsigned int xid, struct cifs_ses *ses, 3987cifs_setup_session(const unsigned int xid, struct cifs_ses *ses,
4152 struct nls_table *nls_info) 3988 struct nls_table *nls_info)
4153{ 3989{
4154 int rc = 0; 3990 int rc = -ENOSYS;
4155 struct TCP_Server_Info *server = ses->server; 3991 struct TCP_Server_Info *server = ses->server;
4156 3992
4157 ses->flags = 0; 3993 ses->flags = 0;
4158 ses->capabilities = server->capabilities; 3994 ses->capabilities = server->capabilities;
4159 if (linuxExtEnabled == 0) 3995 if (linuxExtEnabled == 0)
4160 ses->capabilities &= (~CAP_UNIX); 3996 ses->capabilities &= (~server->vals->cap_unix);
4161 3997
4162 cFYI(1, "Security Mode: 0x%x Capabilities: 0x%x TimeAdjust: %d", 3998 cFYI(1, "Security Mode: 0x%x Capabilities: 0x%x TimeAdjust: %d",
4163 server->sec_mode, server->capabilities, server->timeAdj); 3999 server->sec_mode, server->capabilities, server->timeAdj);
4164 4000
4165 rc = CIFS_SessSetup(xid, ses, nls_info); 4001 if (server->ops->sess_setup)
4002 rc = server->ops->sess_setup(xid, ses, nls_info);
4003
4166 if (rc) { 4004 if (rc) {
4167 cERROR(1, "Send error in SessSetup = %d", rc); 4005 cERROR(1, "Send error in SessSetup = %d", rc);
4168 } else { 4006 } else {
@@ -4262,7 +4100,7 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, uid_t fsuid)
4262 goto out; 4100 goto out;
4263 } 4101 }
4264 4102
4265 if (ses->capabilities & CAP_UNIX) 4103 if (cap_unix(ses))
4266 reset_cifs_unix_caps(0, tcon, NULL, vol_info); 4104 reset_cifs_unix_caps(0, tcon, NULL, vol_info);
4267out: 4105out:
4268 kfree(vol_info->username); 4106 kfree(vol_info->username);
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index a180265a10b5..cbe709ad6663 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -157,10 +157,10 @@ check_name(struct dentry *direntry)
157 157
158/* Inode operations in similar order to how they appear in Linux file fs.h */ 158/* Inode operations in similar order to how they appear in Linux file fs.h */
159 159
160static int cifs_do_create(struct inode *inode, struct dentry *direntry, 160static int
161 int xid, struct tcon_link *tlink, unsigned oflags, 161cifs_do_create(struct inode *inode, struct dentry *direntry, unsigned int xid,
162 umode_t mode, __u32 *oplock, __u16 *fileHandle, 162 struct tcon_link *tlink, unsigned oflags, umode_t mode,
163 int *created) 163 __u32 *oplock, __u16 *fileHandle, int *created)
164{ 164{
165 int rc = -ENOENT; 165 int rc = -ENOENT;
166 int create_options = CREATE_NOT_DIR; 166 int create_options = CREATE_NOT_DIR;
@@ -182,8 +182,7 @@ static int cifs_do_create(struct inode *inode, struct dentry *direntry,
182 goto out; 182 goto out;
183 } 183 }
184 184
185 if (tcon->unix_ext && (tcon->ses->capabilities & CAP_UNIX) && 185 if (tcon->unix_ext && cap_unix(tcon->ses) && !tcon->broken_posix_open &&
186 !tcon->broken_posix_open &&
187 (CIFS_UNIX_POSIX_PATH_OPS_CAP & 186 (CIFS_UNIX_POSIX_PATH_OPS_CAP &
188 le64_to_cpu(tcon->fsUnixInfo.Capability))) { 187 le64_to_cpu(tcon->fsUnixInfo.Capability))) {
189 rc = cifs_posix_open(full_path, &newinode, 188 rc = cifs_posix_open(full_path, &newinode,
@@ -382,12 +381,11 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
382 int *opened) 381 int *opened)
383{ 382{
384 int rc; 383 int rc;
385 int xid; 384 unsigned int xid;
386 struct tcon_link *tlink; 385 struct tcon_link *tlink;
387 struct cifs_tcon *tcon; 386 struct cifs_tcon *tcon;
388 __u16 fileHandle; 387 __u16 fileHandle;
389 __u32 oplock; 388 __u32 oplock;
390 struct file *filp;
391 struct cifsFileInfo *pfile_info; 389 struct cifsFileInfo *pfile_info;
392 390
393 /* Posix open is only called (at lookup time) for file create now. For 391 /* Posix open is only called (at lookup time) for file create now. For
@@ -412,15 +410,14 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
412 if (rc) 410 if (rc)
413 return rc; 411 return rc;
414 412
415 xid = GetXid(); 413 xid = get_xid();
416 414
417 cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p", 415 cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p",
418 inode, direntry->d_name.name, direntry); 416 inode, direntry->d_name.name, direntry);
419 417
420 tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb)); 418 tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb));
421 filp = ERR_CAST(tlink);
422 if (IS_ERR(tlink)) 419 if (IS_ERR(tlink))
423 goto free_xid; 420 goto out_free_xid;
424 421
425 tcon = tlink_tcon(tlink); 422 tcon = tlink_tcon(tlink);
426 423
@@ -436,17 +433,16 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
436 goto out; 433 goto out;
437 } 434 }
438 435
439 pfile_info = cifs_new_fileinfo(fileHandle, filp, tlink, oplock); 436 pfile_info = cifs_new_fileinfo(fileHandle, file, tlink, oplock);
440 if (pfile_info == NULL) { 437 if (pfile_info == NULL) {
441 CIFSSMBClose(xid, tcon, fileHandle); 438 CIFSSMBClose(xid, tcon, fileHandle);
442 fput(filp);
443 rc = -ENOMEM; 439 rc = -ENOMEM;
444 } 440 }
445 441
446out: 442out:
447 cifs_put_tlink(tlink); 443 cifs_put_tlink(tlink);
448free_xid: 444out_free_xid:
449 FreeXid(xid); 445 free_xid(xid);
450 return rc; 446 return rc;
451} 447}
452 448
@@ -454,7 +450,7 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode,
454 bool excl) 450 bool excl)
455{ 451{
456 int rc; 452 int rc;
457 int xid = GetXid(); 453 unsigned int xid = get_xid();
458 /* 454 /*
459 * BB below access is probably too much for mknod to request 455 * BB below access is probably too much for mknod to request
460 * but we have to do query and setpathinfo so requesting 456 * but we have to do query and setpathinfo so requesting
@@ -474,7 +470,7 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode,
474 tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb)); 470 tlink = cifs_sb_tlink(CIFS_SB(inode->i_sb));
475 rc = PTR_ERR(tlink); 471 rc = PTR_ERR(tlink);
476 if (IS_ERR(tlink)) 472 if (IS_ERR(tlink))
477 goto free_xid; 473 goto out_free_xid;
478 474
479 rc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode, 475 rc = cifs_do_create(inode, direntry, xid, tlink, oflags, mode,
480 &oplock, &fileHandle, &created); 476 &oplock, &fileHandle, &created);
@@ -482,9 +478,8 @@ int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode,
482 CIFSSMBClose(xid, tlink_tcon(tlink), fileHandle); 478 CIFSSMBClose(xid, tlink_tcon(tlink), fileHandle);
483 479
484 cifs_put_tlink(tlink); 480 cifs_put_tlink(tlink);
485free_xid: 481out_free_xid:
486 FreeXid(xid); 482 free_xid(xid);
487
488 return rc; 483 return rc;
489} 484}
490 485
@@ -492,7 +487,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
492 dev_t device_number) 487 dev_t device_number)
493{ 488{
494 int rc = -EPERM; 489 int rc = -EPERM;
495 int xid; 490 unsigned int xid;
496 int create_options = CREATE_NOT_DIR | CREATE_OPTION_SPECIAL; 491 int create_options = CREATE_NOT_DIR | CREATE_OPTION_SPECIAL;
497 struct cifs_sb_info *cifs_sb; 492 struct cifs_sb_info *cifs_sb;
498 struct tcon_link *tlink; 493 struct tcon_link *tlink;
@@ -516,7 +511,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
516 511
517 pTcon = tlink_tcon(tlink); 512 pTcon = tlink_tcon(tlink);
518 513
519 xid = GetXid(); 514 xid = get_xid();
520 515
521 full_path = build_path_from_dentry(direntry); 516 full_path = build_path_from_dentry(direntry);
522 if (full_path == NULL) { 517 if (full_path == NULL) {
@@ -564,7 +559,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
564 if (buf == NULL) { 559 if (buf == NULL) {
565 kfree(full_path); 560 kfree(full_path);
566 rc = -ENOMEM; 561 rc = -ENOMEM;
567 FreeXid(xid); 562 free_xid(xid);
568 return rc; 563 return rc;
569 } 564 }
570 565
@@ -614,7 +609,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, umode_t mode,
614mknod_out: 609mknod_out:
615 kfree(full_path); 610 kfree(full_path);
616 kfree(buf); 611 kfree(buf);
617 FreeXid(xid); 612 free_xid(xid);
618 cifs_put_tlink(tlink); 613 cifs_put_tlink(tlink);
619 return rc; 614 return rc;
620} 615}
@@ -623,7 +618,7 @@ struct dentry *
623cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, 618cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
624 unsigned int flags) 619 unsigned int flags)
625{ 620{
626 int xid; 621 unsigned int xid;
627 int rc = 0; /* to get around spurious gcc warning, set to zero here */ 622 int rc = 0; /* to get around spurious gcc warning, set to zero here */
628 struct cifs_sb_info *cifs_sb; 623 struct cifs_sb_info *cifs_sb;
629 struct tcon_link *tlink; 624 struct tcon_link *tlink;
@@ -631,7 +626,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
631 struct inode *newInode = NULL; 626 struct inode *newInode = NULL;
632 char *full_path = NULL; 627 char *full_path = NULL;
633 628
634 xid = GetXid(); 629 xid = get_xid();
635 630
636 cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p", 631 cFYI(1, "parent inode = 0x%p name is: %s and dentry = 0x%p",
637 parent_dir_inode, direntry->d_name.name, direntry); 632 parent_dir_inode, direntry->d_name.name, direntry);
@@ -641,7 +636,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
641 cifs_sb = CIFS_SB(parent_dir_inode->i_sb); 636 cifs_sb = CIFS_SB(parent_dir_inode->i_sb);
642 tlink = cifs_sb_tlink(cifs_sb); 637 tlink = cifs_sb_tlink(cifs_sb);
643 if (IS_ERR(tlink)) { 638 if (IS_ERR(tlink)) {
644 FreeXid(xid); 639 free_xid(xid);
645 return (struct dentry *)tlink; 640 return (struct dentry *)tlink;
646 } 641 }
647 pTcon = tlink_tcon(tlink); 642 pTcon = tlink_tcon(tlink);
@@ -695,7 +690,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
695lookup_out: 690lookup_out:
696 kfree(full_path); 691 kfree(full_path);
697 cifs_put_tlink(tlink); 692 cifs_put_tlink(tlink);
698 FreeXid(xid); 693 free_xid(xid);
699 return ERR_PTR(rc); 694 return ERR_PTR(rc);
700} 695}
701 696
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 513adbc211d7..9154192b0683 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -107,7 +107,7 @@ static inline int cifs_get_disposition(unsigned int flags)
107 107
108int cifs_posix_open(char *full_path, struct inode **pinode, 108int cifs_posix_open(char *full_path, struct inode **pinode,
109 struct super_block *sb, int mode, unsigned int f_flags, 109 struct super_block *sb, int mode, unsigned int f_flags,
110 __u32 *poplock, __u16 *pnetfid, int xid) 110 __u32 *poplock, __u16 *pnetfid, unsigned int xid)
111{ 111{
112 int rc; 112 int rc;
113 FILE_UNIX_BASIC_INFO *presp_data; 113 FILE_UNIX_BASIC_INFO *presp_data;
@@ -170,7 +170,7 @@ posix_open_ret:
170static int 170static int
171cifs_nt_open(char *full_path, struct inode *inode, struct cifs_sb_info *cifs_sb, 171cifs_nt_open(char *full_path, struct inode *inode, struct cifs_sb_info *cifs_sb,
172 struct cifs_tcon *tcon, unsigned int f_flags, __u32 *poplock, 172 struct cifs_tcon *tcon, unsigned int f_flags, __u32 *poplock,
173 __u16 *pnetfid, int xid) 173 __u16 *pnetfid, unsigned int xid)
174{ 174{
175 int rc; 175 int rc;
176 int desiredAccess; 176 int desiredAccess;
@@ -284,6 +284,15 @@ cifs_new_fileinfo(__u16 fileHandle, struct file *file,
284 284
285static void cifs_del_lock_waiters(struct cifsLockInfo *lock); 285static void cifs_del_lock_waiters(struct cifsLockInfo *lock);
286 286
287struct cifsFileInfo *
288cifsFileInfo_get(struct cifsFileInfo *cifs_file)
289{
290 spin_lock(&cifs_file_list_lock);
291 cifsFileInfo_get_locked(cifs_file);
292 spin_unlock(&cifs_file_list_lock);
293 return cifs_file;
294}
295
287/* 296/*
288 * Release a reference on the file private data. This may involve closing 297 * Release a reference on the file private data. This may involve closing
289 * the filehandle out on the server. Must be called without holding 298 * the filehandle out on the server. Must be called without holding
@@ -324,11 +333,11 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
324 cancel_work_sync(&cifs_file->oplock_break); 333 cancel_work_sync(&cifs_file->oplock_break);
325 334
326 if (!tcon->need_reconnect && !cifs_file->invalidHandle) { 335 if (!tcon->need_reconnect && !cifs_file->invalidHandle) {
327 int xid, rc; 336 unsigned int xid;
328 337 int rc;
329 xid = GetXid(); 338 xid = get_xid();
330 rc = CIFSSMBClose(xid, tcon, cifs_file->netfid); 339 rc = CIFSSMBClose(xid, tcon, cifs_file->netfid);
331 FreeXid(xid); 340 free_xid(xid);
332 } 341 }
333 342
334 /* Delete any outstanding lock records. We'll lose them when the file 343 /* Delete any outstanding lock records. We'll lose them when the file
@@ -350,7 +359,7 @@ void cifsFileInfo_put(struct cifsFileInfo *cifs_file)
350int cifs_open(struct inode *inode, struct file *file) 359int cifs_open(struct inode *inode, struct file *file)
351{ 360{
352 int rc = -EACCES; 361 int rc = -EACCES;
353 int xid; 362 unsigned int xid;
354 __u32 oplock; 363 __u32 oplock;
355 struct cifs_sb_info *cifs_sb; 364 struct cifs_sb_info *cifs_sb;
356 struct cifs_tcon *tcon; 365 struct cifs_tcon *tcon;
@@ -360,12 +369,12 @@ int cifs_open(struct inode *inode, struct file *file)
360 bool posix_open_ok = false; 369 bool posix_open_ok = false;
361 __u16 netfid; 370 __u16 netfid;
362 371
363 xid = GetXid(); 372 xid = get_xid();
364 373
365 cifs_sb = CIFS_SB(inode->i_sb); 374 cifs_sb = CIFS_SB(inode->i_sb);
366 tlink = cifs_sb_tlink(cifs_sb); 375 tlink = cifs_sb_tlink(cifs_sb);
367 if (IS_ERR(tlink)) { 376 if (IS_ERR(tlink)) {
368 FreeXid(xid); 377 free_xid(xid);
369 return PTR_ERR(tlink); 378 return PTR_ERR(tlink);
370 } 379 }
371 tcon = tlink_tcon(tlink); 380 tcon = tlink_tcon(tlink);
@@ -385,9 +394,8 @@ int cifs_open(struct inode *inode, struct file *file)
385 oplock = 0; 394 oplock = 0;
386 395
387 if (!tcon->broken_posix_open && tcon->unix_ext && 396 if (!tcon->broken_posix_open && tcon->unix_ext &&
388 (tcon->ses->capabilities & CAP_UNIX) && 397 cap_unix(tcon->ses) && (CIFS_UNIX_POSIX_PATH_OPS_CAP &
389 (CIFS_UNIX_POSIX_PATH_OPS_CAP & 398 le64_to_cpu(tcon->fsUnixInfo.Capability))) {
390 le64_to_cpu(tcon->fsUnixInfo.Capability))) {
391 /* can not refresh inode info since size could be stale */ 399 /* can not refresh inode info since size could be stale */
392 rc = cifs_posix_open(full_path, &inode, inode->i_sb, 400 rc = cifs_posix_open(full_path, &inode, inode->i_sb,
393 cifs_sb->mnt_file_mode /* ignored */, 401 cifs_sb->mnt_file_mode /* ignored */,
@@ -445,7 +453,7 @@ int cifs_open(struct inode *inode, struct file *file)
445 453
446out: 454out:
447 kfree(full_path); 455 kfree(full_path);
448 FreeXid(xid); 456 free_xid(xid);
449 cifs_put_tlink(tlink); 457 cifs_put_tlink(tlink);
450 return rc; 458 return rc;
451} 459}
@@ -464,7 +472,7 @@ static int cifs_relock_file(struct cifsFileInfo *cifsFile)
464static int cifs_reopen_file(struct cifsFileInfo *pCifsFile, bool can_flush) 472static int cifs_reopen_file(struct cifsFileInfo *pCifsFile, bool can_flush)
465{ 473{
466 int rc = -EACCES; 474 int rc = -EACCES;
467 int xid; 475 unsigned int xid;
468 __u32 oplock; 476 __u32 oplock;
469 struct cifs_sb_info *cifs_sb; 477 struct cifs_sb_info *cifs_sb;
470 struct cifs_tcon *tcon; 478 struct cifs_tcon *tcon;
@@ -476,12 +484,12 @@ static int cifs_reopen_file(struct cifsFileInfo *pCifsFile, bool can_flush)
476 int create_options = CREATE_NOT_DIR; 484 int create_options = CREATE_NOT_DIR;
477 __u16 netfid; 485 __u16 netfid;
478 486
479 xid = GetXid(); 487 xid = get_xid();
480 mutex_lock(&pCifsFile->fh_mutex); 488 mutex_lock(&pCifsFile->fh_mutex);
481 if (!pCifsFile->invalidHandle) { 489 if (!pCifsFile->invalidHandle) {
482 mutex_unlock(&pCifsFile->fh_mutex); 490 mutex_unlock(&pCifsFile->fh_mutex);
483 rc = 0; 491 rc = 0;
484 FreeXid(xid); 492 free_xid(xid);
485 return rc; 493 return rc;
486 } 494 }
487 495
@@ -497,7 +505,7 @@ static int cifs_reopen_file(struct cifsFileInfo *pCifsFile, bool can_flush)
497 if (full_path == NULL) { 505 if (full_path == NULL) {
498 rc = -ENOMEM; 506 rc = -ENOMEM;
499 mutex_unlock(&pCifsFile->fh_mutex); 507 mutex_unlock(&pCifsFile->fh_mutex);
500 FreeXid(xid); 508 free_xid(xid);
501 return rc; 509 return rc;
502 } 510 }
503 511
@@ -509,10 +517,9 @@ static int cifs_reopen_file(struct cifsFileInfo *pCifsFile, bool can_flush)
509 else 517 else
510 oplock = 0; 518 oplock = 0;
511 519
512 if (tcon->unix_ext && (tcon->ses->capabilities & CAP_UNIX) && 520 if (tcon->unix_ext && cap_unix(tcon->ses) &&
513 (CIFS_UNIX_POSIX_PATH_OPS_CAP & 521 (CIFS_UNIX_POSIX_PATH_OPS_CAP &
514 le64_to_cpu(tcon->fsUnixInfo.Capability))) { 522 le64_to_cpu(tcon->fsUnixInfo.Capability))) {
515
516 /* 523 /*
517 * O_CREAT, O_EXCL and O_TRUNC already had their effect on the 524 * O_CREAT, O_EXCL and O_TRUNC already had their effect on the
518 * original open. Must mask them off for a reopen. 525 * original open. Must mask them off for a reopen.
@@ -583,7 +590,7 @@ reopen_success:
583 590
584reopen_error_exit: 591reopen_error_exit:
585 kfree(full_path); 592 kfree(full_path);
586 FreeXid(xid); 593 free_xid(xid);
587 return rc; 594 return rc;
588} 595}
589 596
@@ -601,13 +608,13 @@ int cifs_close(struct inode *inode, struct file *file)
601int cifs_closedir(struct inode *inode, struct file *file) 608int cifs_closedir(struct inode *inode, struct file *file)
602{ 609{
603 int rc = 0; 610 int rc = 0;
604 int xid; 611 unsigned int xid;
605 struct cifsFileInfo *pCFileStruct = file->private_data; 612 struct cifsFileInfo *pCFileStruct = file->private_data;
606 char *ptmp; 613 char *ptmp;
607 614
608 cFYI(1, "Closedir inode = 0x%p", inode); 615 cFYI(1, "Closedir inode = 0x%p", inode);
609 616
610 xid = GetXid(); 617 xid = get_xid();
611 618
612 if (pCFileStruct) { 619 if (pCFileStruct) {
613 struct cifs_tcon *pTcon = tlink_tcon(pCFileStruct->tlink); 620 struct cifs_tcon *pTcon = tlink_tcon(pCFileStruct->tlink);
@@ -639,7 +646,7 @@ int cifs_closedir(struct inode *inode, struct file *file)
639 file->private_data = NULL; 646 file->private_data = NULL;
640 } 647 }
641 /* BB can we lock the filestruct while this is going on? */ 648 /* BB can we lock the filestruct while this is going on? */
642 FreeXid(xid); 649 free_xid(xid);
643 return rc; 650 return rc;
644} 651}
645 652
@@ -872,7 +879,8 @@ try_again:
872static int 879static int
873cifs_push_mandatory_locks(struct cifsFileInfo *cfile) 880cifs_push_mandatory_locks(struct cifsFileInfo *cfile)
874{ 881{
875 int xid, rc = 0, stored_rc; 882 unsigned int xid;
883 int rc = 0, stored_rc;
876 struct cifsLockInfo *li, *tmp; 884 struct cifsLockInfo *li, *tmp;
877 struct cifs_tcon *tcon; 885 struct cifs_tcon *tcon;
878 struct cifsInodeInfo *cinode = CIFS_I(cfile->dentry->d_inode); 886 struct cifsInodeInfo *cinode = CIFS_I(cfile->dentry->d_inode);
@@ -882,13 +890,13 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile)
882 LOCKING_ANDX_SHARED_LOCK | LOCKING_ANDX_LARGE_FILES}; 890 LOCKING_ANDX_SHARED_LOCK | LOCKING_ANDX_LARGE_FILES};
883 int i; 891 int i;
884 892
885 xid = GetXid(); 893 xid = get_xid();
886 tcon = tlink_tcon(cfile->tlink); 894 tcon = tlink_tcon(cfile->tlink);
887 895
888 mutex_lock(&cinode->lock_mutex); 896 mutex_lock(&cinode->lock_mutex);
889 if (!cinode->can_cache_brlcks) { 897 if (!cinode->can_cache_brlcks) {
890 mutex_unlock(&cinode->lock_mutex); 898 mutex_unlock(&cinode->lock_mutex);
891 FreeXid(xid); 899 free_xid(xid);
892 return rc; 900 return rc;
893 } 901 }
894 902
@@ -899,7 +907,7 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile)
899 max_buf = tcon->ses->server->maxBuf; 907 max_buf = tcon->ses->server->maxBuf;
900 if (!max_buf) { 908 if (!max_buf) {
901 mutex_unlock(&cinode->lock_mutex); 909 mutex_unlock(&cinode->lock_mutex);
902 FreeXid(xid); 910 free_xid(xid);
903 return -EINVAL; 911 return -EINVAL;
904 } 912 }
905 913
@@ -908,7 +916,7 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile)
908 buf = kzalloc(max_num * sizeof(LOCKING_ANDX_RANGE), GFP_KERNEL); 916 buf = kzalloc(max_num * sizeof(LOCKING_ANDX_RANGE), GFP_KERNEL);
909 if (!buf) { 917 if (!buf) {
910 mutex_unlock(&cinode->lock_mutex); 918 mutex_unlock(&cinode->lock_mutex);
911 FreeXid(xid); 919 free_xid(xid);
912 return rc; 920 return rc;
913 } 921 }
914 922
@@ -947,7 +955,7 @@ cifs_push_mandatory_locks(struct cifsFileInfo *cfile)
947 mutex_unlock(&cinode->lock_mutex); 955 mutex_unlock(&cinode->lock_mutex);
948 956
949 kfree(buf); 957 kfree(buf);
950 FreeXid(xid); 958 free_xid(xid);
951 return rc; 959 return rc;
952} 960}
953 961
@@ -977,12 +985,12 @@ cifs_push_posix_locks(struct cifsFileInfo *cfile)
977 struct lock_to_push *lck, *tmp; 985 struct lock_to_push *lck, *tmp;
978 __u64 length; 986 __u64 length;
979 987
980 xid = GetXid(); 988 xid = get_xid();
981 989
982 mutex_lock(&cinode->lock_mutex); 990 mutex_lock(&cinode->lock_mutex);
983 if (!cinode->can_cache_brlcks) { 991 if (!cinode->can_cache_brlcks) {
984 mutex_unlock(&cinode->lock_mutex); 992 mutex_unlock(&cinode->lock_mutex);
985 FreeXid(xid); 993 free_xid(xid);
986 return rc; 994 return rc;
987 } 995 }
988 996
@@ -1039,12 +1047,10 @@ cifs_push_posix_locks(struct cifsFileInfo *cfile)
1039 unlock_flocks(); 1047 unlock_flocks();
1040 1048
1041 list_for_each_entry_safe(lck, tmp, &locks_to_send, llist) { 1049 list_for_each_entry_safe(lck, tmp, &locks_to_send, llist) {
1042 struct file_lock tmp_lock;
1043 int stored_rc; 1050 int stored_rc;
1044 1051
1045 tmp_lock.fl_start = lck->offset;
1046 stored_rc = CIFSSMBPosixLock(xid, tcon, lck->netfid, lck->pid, 1052 stored_rc = CIFSSMBPosixLock(xid, tcon, lck->netfid, lck->pid,
1047 0, lck->length, &tmp_lock, 1053 lck->offset, lck->length, NULL,
1048 lck->type, 0); 1054 lck->type, 0);
1049 if (stored_rc) 1055 if (stored_rc)
1050 rc = stored_rc; 1056 rc = stored_rc;
@@ -1056,7 +1062,7 @@ out:
1056 cinode->can_cache_brlcks = false; 1062 cinode->can_cache_brlcks = false;
1057 mutex_unlock(&cinode->lock_mutex); 1063 mutex_unlock(&cinode->lock_mutex);
1058 1064
1059 FreeXid(xid); 1065 free_xid(xid);
1060 return rc; 1066 return rc;
1061err_out: 1067err_out:
1062 list_for_each_entry_safe(lck, tmp, &locks_to_send, llist) { 1068 list_for_each_entry_safe(lck, tmp, &locks_to_send, llist) {
@@ -1072,7 +1078,7 @@ cifs_push_locks(struct cifsFileInfo *cfile)
1072 struct cifs_sb_info *cifs_sb = CIFS_SB(cfile->dentry->d_sb); 1078 struct cifs_sb_info *cifs_sb = CIFS_SB(cfile->dentry->d_sb);
1073 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); 1079 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
1074 1080
1075 if ((tcon->ses->capabilities & CAP_UNIX) && 1081 if (cap_unix(tcon->ses) &&
1076 (CIFS_UNIX_FCNTL_CAP & le64_to_cpu(tcon->fsUnixInfo.Capability)) && 1082 (CIFS_UNIX_FCNTL_CAP & le64_to_cpu(tcon->fsUnixInfo.Capability)) &&
1077 ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOPOSIXBRL) == 0)) 1083 ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOPOSIXBRL) == 0))
1078 return cifs_push_posix_locks(cfile); 1084 return cifs_push_posix_locks(cfile);
@@ -1128,7 +1134,7 @@ cifs_read_flock(struct file_lock *flock, __u32 *type, int *lock, int *unlock,
1128} 1134}
1129 1135
1130static int 1136static int
1131cifs_mandatory_lock(int xid, struct cifsFileInfo *cfile, __u64 offset, 1137cifs_mandatory_lock(unsigned int xid, struct cifsFileInfo *cfile, __u64 offset,
1132 __u64 length, __u32 type, int lock, int unlock, bool wait) 1138 __u64 length, __u32 type, int lock, int unlock, bool wait)
1133{ 1139{
1134 return CIFSSMBLock(xid, tlink_tcon(cfile->tlink), cfile->netfid, 1140 return CIFSSMBLock(xid, tlink_tcon(cfile->tlink), cfile->netfid,
@@ -1138,7 +1144,7 @@ cifs_mandatory_lock(int xid, struct cifsFileInfo *cfile, __u64 offset,
1138 1144
1139static int 1145static int
1140cifs_getlk(struct file *file, struct file_lock *flock, __u32 type, 1146cifs_getlk(struct file *file, struct file_lock *flock, __u32 type,
1141 bool wait_flag, bool posix_lck, int xid) 1147 bool wait_flag, bool posix_lck, unsigned int xid)
1142{ 1148{
1143 int rc = 0; 1149 int rc = 0;
1144 __u64 length = 1 + flock->fl_end - flock->fl_start; 1150 __u64 length = 1 + flock->fl_end - flock->fl_start;
@@ -1159,7 +1165,7 @@ cifs_getlk(struct file *file, struct file_lock *flock, __u32 type,
1159 else 1165 else
1160 posix_lock_type = CIFS_WRLCK; 1166 posix_lock_type = CIFS_WRLCK;
1161 rc = CIFSSMBPosixLock(xid, tcon, netfid, current->tgid, 1167 rc = CIFSSMBPosixLock(xid, tcon, netfid, current->tgid,
1162 1 /* get */, length, flock, 1168 flock->fl_start, length, flock,
1163 posix_lock_type, wait_flag); 1169 posix_lock_type, wait_flag);
1164 return rc; 1170 return rc;
1165 } 1171 }
@@ -1223,7 +1229,8 @@ cifs_free_llist(struct list_head *llist)
1223} 1229}
1224 1230
1225static int 1231static int
1226cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, int xid) 1232cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock,
1233 unsigned int xid)
1227{ 1234{
1228 int rc = 0, stored_rc; 1235 int rc = 0, stored_rc;
1229 int types[] = {LOCKING_ANDX_LARGE_FILES, 1236 int types[] = {LOCKING_ANDX_LARGE_FILES,
@@ -1328,7 +1335,8 @@ cifs_unlock_range(struct cifsFileInfo *cfile, struct file_lock *flock, int xid)
1328 1335
1329static int 1336static int
1330cifs_setlk(struct file *file, struct file_lock *flock, __u32 type, 1337cifs_setlk(struct file *file, struct file_lock *flock, __u32 type,
1331 bool wait_flag, bool posix_lck, int lock, int unlock, int xid) 1338 bool wait_flag, bool posix_lck, int lock, int unlock,
1339 unsigned int xid)
1332{ 1340{
1333 int rc = 0; 1341 int rc = 0;
1334 __u64 length = 1 + flock->fl_end - flock->fl_start; 1342 __u64 length = 1 + flock->fl_end - flock->fl_start;
@@ -1353,7 +1361,7 @@ cifs_setlk(struct file *file, struct file_lock *flock, __u32 type,
1353 posix_lock_type = CIFS_UNLCK; 1361 posix_lock_type = CIFS_UNLCK;
1354 1362
1355 rc = CIFSSMBPosixLock(xid, tcon, netfid, current->tgid, 1363 rc = CIFSSMBPosixLock(xid, tcon, netfid, current->tgid,
1356 0 /* set */, length, flock, 1364 flock->fl_start, length, NULL,
1357 posix_lock_type, wait_flag); 1365 posix_lock_type, wait_flag);
1358 goto out; 1366 goto out;
1359 } 1367 }
@@ -1402,7 +1410,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *flock)
1402 __u32 type; 1410 __u32 type;
1403 1411
1404 rc = -EACCES; 1412 rc = -EACCES;
1405 xid = GetXid(); 1413 xid = get_xid();
1406 1414
1407 cFYI(1, "Lock parm: 0x%x flockflags: 0x%x flocktype: 0x%x start: %lld " 1415 cFYI(1, "Lock parm: 0x%x flockflags: 0x%x flocktype: 0x%x start: %lld "
1408 "end: %lld", cmd, flock->fl_flags, flock->fl_type, 1416 "end: %lld", cmd, flock->fl_flags, flock->fl_type,
@@ -1418,7 +1426,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *flock)
1418 netfid = cfile->netfid; 1426 netfid = cfile->netfid;
1419 cinode = CIFS_I(file->f_path.dentry->d_inode); 1427 cinode = CIFS_I(file->f_path.dentry->d_inode);
1420 1428
1421 if ((tcon->ses->capabilities & CAP_UNIX) && 1429 if (cap_unix(tcon->ses) &&
1422 (CIFS_UNIX_FCNTL_CAP & le64_to_cpu(tcon->fsUnixInfo.Capability)) && 1430 (CIFS_UNIX_FCNTL_CAP & le64_to_cpu(tcon->fsUnixInfo.Capability)) &&
1423 ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOPOSIXBRL) == 0)) 1431 ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOPOSIXBRL) == 0))
1424 posix_lck = true; 1432 posix_lck = true;
@@ -1428,7 +1436,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *flock)
1428 */ 1436 */
1429 if (IS_GETLK(cmd)) { 1437 if (IS_GETLK(cmd)) {
1430 rc = cifs_getlk(file, flock, type, wait_flag, posix_lck, xid); 1438 rc = cifs_getlk(file, flock, type, wait_flag, posix_lck, xid);
1431 FreeXid(xid); 1439 free_xid(xid);
1432 return rc; 1440 return rc;
1433 } 1441 }
1434 1442
@@ -1437,13 +1445,13 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *flock)
1437 * if no lock or unlock then nothing to do since we do not 1445 * if no lock or unlock then nothing to do since we do not
1438 * know what it is 1446 * know what it is
1439 */ 1447 */
1440 FreeXid(xid); 1448 free_xid(xid);
1441 return -EOPNOTSUPP; 1449 return -EOPNOTSUPP;
1442 } 1450 }
1443 1451
1444 rc = cifs_setlk(file, flock, type, wait_flag, posix_lck, lock, unlock, 1452 rc = cifs_setlk(file, flock, type, wait_flag, posix_lck, lock, unlock,
1445 xid); 1453 xid);
1446 FreeXid(xid); 1454 free_xid(xid);
1447 return rc; 1455 return rc;
1448} 1456}
1449 1457
@@ -1470,7 +1478,7 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file, __u32 pid,
1470 unsigned int total_written; 1478 unsigned int total_written;
1471 struct cifs_sb_info *cifs_sb; 1479 struct cifs_sb_info *cifs_sb;
1472 struct cifs_tcon *pTcon; 1480 struct cifs_tcon *pTcon;
1473 int xid; 1481 unsigned int xid;
1474 struct dentry *dentry = open_file->dentry; 1482 struct dentry *dentry = open_file->dentry;
1475 struct cifsInodeInfo *cifsi = CIFS_I(dentry->d_inode); 1483 struct cifsInodeInfo *cifsi = CIFS_I(dentry->d_inode);
1476 struct cifs_io_parms io_parms; 1484 struct cifs_io_parms io_parms;
@@ -1482,7 +1490,7 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file, __u32 pid,
1482 1490
1483 pTcon = tlink_tcon(open_file->tlink); 1491 pTcon = tlink_tcon(open_file->tlink);
1484 1492
1485 xid = GetXid(); 1493 xid = get_xid();
1486 1494
1487 for (total_written = 0; write_size > total_written; 1495 for (total_written = 0; write_size > total_written;
1488 total_written += bytes_written) { 1496 total_written += bytes_written) {
@@ -1518,7 +1526,7 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file, __u32 pid,
1518 if (total_written) 1526 if (total_written)
1519 break; 1527 break;
1520 else { 1528 else {
1521 FreeXid(xid); 1529 free_xid(xid);
1522 return rc; 1530 return rc;
1523 } 1531 }
1524 } else { 1532 } else {
@@ -1538,7 +1546,7 @@ static ssize_t cifs_write(struct cifsFileInfo *open_file, __u32 pid,
1538 spin_unlock(&dentry->d_inode->i_lock); 1546 spin_unlock(&dentry->d_inode->i_lock);
1539 } 1547 }
1540 mark_inode_dirty_sync(dentry->d_inode); 1548 mark_inode_dirty_sync(dentry->d_inode);
1541 FreeXid(xid); 1549 free_xid(xid);
1542 return total_written; 1550 return total_written;
1543} 1551}
1544 1552
@@ -1563,7 +1571,7 @@ struct cifsFileInfo *find_readable_file(struct cifsInodeInfo *cifs_inode,
1563 if (!open_file->invalidHandle) { 1571 if (!open_file->invalidHandle) {
1564 /* found a good file */ 1572 /* found a good file */
1565 /* lock it so it will not be closed on us */ 1573 /* lock it so it will not be closed on us */
1566 cifsFileInfo_get(open_file); 1574 cifsFileInfo_get_locked(open_file);
1567 spin_unlock(&cifs_file_list_lock); 1575 spin_unlock(&cifs_file_list_lock);
1568 return open_file; 1576 return open_file;
1569 } /* else might as well continue, and look for 1577 } /* else might as well continue, and look for
@@ -1615,7 +1623,7 @@ refind_writable:
1615 if (OPEN_FMODE(open_file->f_flags) & FMODE_WRITE) { 1623 if (OPEN_FMODE(open_file->f_flags) & FMODE_WRITE) {
1616 if (!open_file->invalidHandle) { 1624 if (!open_file->invalidHandle) {
1617 /* found a good writable file */ 1625 /* found a good writable file */
1618 cifsFileInfo_get(open_file); 1626 cifsFileInfo_get_locked(open_file);
1619 spin_unlock(&cifs_file_list_lock); 1627 spin_unlock(&cifs_file_list_lock);
1620 return open_file; 1628 return open_file;
1621 } else { 1629 } else {
@@ -1632,7 +1640,7 @@ refind_writable:
1632 1640
1633 if (inv_file) { 1641 if (inv_file) {
1634 any_available = false; 1642 any_available = false;
1635 cifsFileInfo_get(inv_file); 1643 cifsFileInfo_get_locked(inv_file);
1636 } 1644 }
1637 1645
1638 spin_unlock(&cifs_file_list_lock); 1646 spin_unlock(&cifs_file_list_lock);
@@ -1937,9 +1945,9 @@ static int
1937cifs_writepage_locked(struct page *page, struct writeback_control *wbc) 1945cifs_writepage_locked(struct page *page, struct writeback_control *wbc)
1938{ 1946{
1939 int rc; 1947 int rc;
1940 int xid; 1948 unsigned int xid;
1941 1949
1942 xid = GetXid(); 1950 xid = get_xid();
1943/* BB add check for wbc flags */ 1951/* BB add check for wbc flags */
1944 page_cache_get(page); 1952 page_cache_get(page);
1945 if (!PageUptodate(page)) 1953 if (!PageUptodate(page))
@@ -1968,7 +1976,7 @@ retry_write:
1968 SetPageUptodate(page); 1976 SetPageUptodate(page);
1969 end_page_writeback(page); 1977 end_page_writeback(page);
1970 page_cache_release(page); 1978 page_cache_release(page);
1971 FreeXid(xid); 1979 free_xid(xid);
1972 return rc; 1980 return rc;
1973} 1981}
1974 1982
@@ -2007,9 +2015,9 @@ static int cifs_write_end(struct file *file, struct address_space *mapping,
2007 if (!PageUptodate(page)) { 2015 if (!PageUptodate(page)) {
2008 char *page_data; 2016 char *page_data;
2009 unsigned offset = pos & (PAGE_CACHE_SIZE - 1); 2017 unsigned offset = pos & (PAGE_CACHE_SIZE - 1);
2010 int xid; 2018 unsigned int xid;
2011 2019
2012 xid = GetXid(); 2020 xid = get_xid();
2013 /* this is probably better than directly calling 2021 /* this is probably better than directly calling
2014 partialpage_write since in this function the file handle is 2022 partialpage_write since in this function the file handle is
2015 known which we might as well leverage */ 2023 known which we might as well leverage */
@@ -2020,7 +2028,7 @@ static int cifs_write_end(struct file *file, struct address_space *mapping,
2020 /* if (rc < 0) should we set writebehind rc? */ 2028 /* if (rc < 0) should we set writebehind rc? */
2021 kunmap(page); 2029 kunmap(page);
2022 2030
2023 FreeXid(xid); 2031 free_xid(xid);
2024 } else { 2032 } else {
2025 rc = copied; 2033 rc = copied;
2026 pos += copied; 2034 pos += copied;
@@ -2043,7 +2051,7 @@ static int cifs_write_end(struct file *file, struct address_space *mapping,
2043int cifs_strict_fsync(struct file *file, loff_t start, loff_t end, 2051int cifs_strict_fsync(struct file *file, loff_t start, loff_t end,
2044 int datasync) 2052 int datasync)
2045{ 2053{
2046 int xid; 2054 unsigned int xid;
2047 int rc = 0; 2055 int rc = 0;
2048 struct cifs_tcon *tcon; 2056 struct cifs_tcon *tcon;
2049 struct cifsFileInfo *smbfile = file->private_data; 2057 struct cifsFileInfo *smbfile = file->private_data;
@@ -2055,7 +2063,7 @@ int cifs_strict_fsync(struct file *file, loff_t start, loff_t end,
2055 return rc; 2063 return rc;
2056 mutex_lock(&inode->i_mutex); 2064 mutex_lock(&inode->i_mutex);
2057 2065
2058 xid = GetXid(); 2066 xid = get_xid();
2059 2067
2060 cFYI(1, "Sync file - name: %s datasync: 0x%x", 2068 cFYI(1, "Sync file - name: %s datasync: 0x%x",
2061 file->f_path.dentry->d_name.name, datasync); 2069 file->f_path.dentry->d_name.name, datasync);
@@ -2072,14 +2080,14 @@ int cifs_strict_fsync(struct file *file, loff_t start, loff_t end,
2072 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC)) 2080 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC))
2073 rc = CIFSSMBFlush(xid, tcon, smbfile->netfid); 2081 rc = CIFSSMBFlush(xid, tcon, smbfile->netfid);
2074 2082
2075 FreeXid(xid); 2083 free_xid(xid);
2076 mutex_unlock(&inode->i_mutex); 2084 mutex_unlock(&inode->i_mutex);
2077 return rc; 2085 return rc;
2078} 2086}
2079 2087
2080int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync) 2088int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
2081{ 2089{
2082 int xid; 2090 unsigned int xid;
2083 int rc = 0; 2091 int rc = 0;
2084 struct cifs_tcon *tcon; 2092 struct cifs_tcon *tcon;
2085 struct cifsFileInfo *smbfile = file->private_data; 2093 struct cifsFileInfo *smbfile = file->private_data;
@@ -2091,7 +2099,7 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
2091 return rc; 2099 return rc;
2092 mutex_lock(&inode->i_mutex); 2100 mutex_lock(&inode->i_mutex);
2093 2101
2094 xid = GetXid(); 2102 xid = get_xid();
2095 2103
2096 cFYI(1, "Sync file - name: %s datasync: 0x%x", 2104 cFYI(1, "Sync file - name: %s datasync: 0x%x",
2097 file->f_path.dentry->d_name.name, datasync); 2105 file->f_path.dentry->d_name.name, datasync);
@@ -2100,7 +2108,7 @@ int cifs_fsync(struct file *file, loff_t start, loff_t end, int datasync)
2100 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC)) 2108 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NOSSYNC))
2101 rc = CIFSSMBFlush(xid, tcon, smbfile->netfid); 2109 rc = CIFSSMBFlush(xid, tcon, smbfile->netfid);
2102 2110
2103 FreeXid(xid); 2111 free_xid(xid);
2104 mutex_unlock(&inode->i_mutex); 2112 mutex_unlock(&inode->i_mutex);
2105 return rc; 2113 return rc;
2106} 2114}
@@ -2744,15 +2752,15 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
2744 unsigned int current_read_size; 2752 unsigned int current_read_size;
2745 unsigned int rsize; 2753 unsigned int rsize;
2746 struct cifs_sb_info *cifs_sb; 2754 struct cifs_sb_info *cifs_sb;
2747 struct cifs_tcon *pTcon; 2755 struct cifs_tcon *tcon;
2748 int xid; 2756 unsigned int xid;
2749 char *current_offset; 2757 char *current_offset;
2750 struct cifsFileInfo *open_file; 2758 struct cifsFileInfo *open_file;
2751 struct cifs_io_parms io_parms; 2759 struct cifs_io_parms io_parms;
2752 int buf_type = CIFS_NO_BUFFER; 2760 int buf_type = CIFS_NO_BUFFER;
2753 __u32 pid; 2761 __u32 pid;
2754 2762
2755 xid = GetXid(); 2763 xid = get_xid();
2756 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); 2764 cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
2757 2765
2758 /* FIXME: set up handlers for larger reads and/or convert to async */ 2766 /* FIXME: set up handlers for larger reads and/or convert to async */
@@ -2760,11 +2768,11 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
2760 2768
2761 if (file->private_data == NULL) { 2769 if (file->private_data == NULL) {
2762 rc = -EBADF; 2770 rc = -EBADF;
2763 FreeXid(xid); 2771 free_xid(xid);
2764 return rc; 2772 return rc;
2765 } 2773 }
2766 open_file = file->private_data; 2774 open_file = file->private_data;
2767 pTcon = tlink_tcon(open_file->tlink); 2775 tcon = tlink_tcon(open_file->tlink);
2768 2776
2769 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD) 2777 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RWPIDFORWARD)
2770 pid = open_file->pid; 2778 pid = open_file->pid;
@@ -2778,11 +2786,12 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
2778 read_size > total_read; 2786 read_size > total_read;
2779 total_read += bytes_read, current_offset += bytes_read) { 2787 total_read += bytes_read, current_offset += bytes_read) {
2780 current_read_size = min_t(uint, read_size - total_read, rsize); 2788 current_read_size = min_t(uint, read_size - total_read, rsize);
2781 2789 /*
2782 /* For windows me and 9x we do not want to request more 2790 * For windows me and 9x we do not want to request more than it
2783 than it negotiated since it will refuse the read then */ 2791 * negotiated since it will refuse the read then.
2784 if ((pTcon->ses) && 2792 */
2785 !(pTcon->ses->capabilities & CAP_LARGE_FILES)) { 2793 if ((tcon->ses) && !(tcon->ses->capabilities &
2794 tcon->ses->server->vals->cap_large_files)) {
2786 current_read_size = min_t(uint, current_read_size, 2795 current_read_size = min_t(uint, current_read_size,
2787 CIFSMaxBufSize); 2796 CIFSMaxBufSize);
2788 } 2797 }
@@ -2795,7 +2804,7 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
2795 } 2804 }
2796 io_parms.netfid = open_file->netfid; 2805 io_parms.netfid = open_file->netfid;
2797 io_parms.pid = pid; 2806 io_parms.pid = pid;
2798 io_parms.tcon = pTcon; 2807 io_parms.tcon = tcon;
2799 io_parms.offset = *poffset; 2808 io_parms.offset = *poffset;
2800 io_parms.length = current_read_size; 2809 io_parms.length = current_read_size;
2801 rc = CIFSSMBRead(xid, &io_parms, &bytes_read, 2810 rc = CIFSSMBRead(xid, &io_parms, &bytes_read,
@@ -2805,15 +2814,15 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
2805 if (total_read) { 2814 if (total_read) {
2806 break; 2815 break;
2807 } else { 2816 } else {
2808 FreeXid(xid); 2817 free_xid(xid);
2809 return rc; 2818 return rc;
2810 } 2819 }
2811 } else { 2820 } else {
2812 cifs_stats_bytes_read(pTcon, total_read); 2821 cifs_stats_bytes_read(tcon, total_read);
2813 *poffset += bytes_read; 2822 *poffset += bytes_read;
2814 } 2823 }
2815 } 2824 }
2816 FreeXid(xid); 2825 free_xid(xid);
2817 return total_read; 2826 return total_read;
2818} 2827}
2819 2828
@@ -2840,7 +2849,7 @@ int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma)
2840 int rc, xid; 2849 int rc, xid;
2841 struct inode *inode = file->f_path.dentry->d_inode; 2850 struct inode *inode = file->f_path.dentry->d_inode;
2842 2851
2843 xid = GetXid(); 2852 xid = get_xid();
2844 2853
2845 if (!CIFS_I(inode)->clientCanCacheRead) { 2854 if (!CIFS_I(inode)->clientCanCacheRead) {
2846 rc = cifs_invalidate_mapping(inode); 2855 rc = cifs_invalidate_mapping(inode);
@@ -2851,7 +2860,7 @@ int cifs_file_strict_mmap(struct file *file, struct vm_area_struct *vma)
2851 rc = generic_file_mmap(file, vma); 2860 rc = generic_file_mmap(file, vma);
2852 if (rc == 0) 2861 if (rc == 0)
2853 vma->vm_ops = &cifs_file_vm_ops; 2862 vma->vm_ops = &cifs_file_vm_ops;
2854 FreeXid(xid); 2863 free_xid(xid);
2855 return rc; 2864 return rc;
2856} 2865}
2857 2866
@@ -2859,17 +2868,17 @@ int cifs_file_mmap(struct file *file, struct vm_area_struct *vma)
2859{ 2868{
2860 int rc, xid; 2869 int rc, xid;
2861 2870
2862 xid = GetXid(); 2871 xid = get_xid();
2863 rc = cifs_revalidate_file(file); 2872 rc = cifs_revalidate_file(file);
2864 if (rc) { 2873 if (rc) {
2865 cFYI(1, "Validation prior to mmap failed, error=%d", rc); 2874 cFYI(1, "Validation prior to mmap failed, error=%d", rc);
2866 FreeXid(xid); 2875 free_xid(xid);
2867 return rc; 2876 return rc;
2868 } 2877 }
2869 rc = generic_file_mmap(file, vma); 2878 rc = generic_file_mmap(file, vma);
2870 if (rc == 0) 2879 if (rc == 0)
2871 vma->vm_ops = &cifs_file_vm_ops; 2880 vma->vm_ops = &cifs_file_vm_ops;
2872 FreeXid(xid); 2881 free_xid(xid);
2873 return rc; 2882 return rc;
2874} 2883}
2875 2884
@@ -3082,8 +3091,6 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
3082 break; 3091 break;
3083 } 3092 }
3084 3093
3085 spin_lock(&cifs_file_list_lock);
3086 spin_unlock(&cifs_file_list_lock);
3087 rdata->cfile = cifsFileInfo_get(open_file); 3094 rdata->cfile = cifsFileInfo_get(open_file);
3088 rdata->mapping = mapping; 3095 rdata->mapping = mapping;
3089 rdata->offset = offset; 3096 rdata->offset = offset;
@@ -3159,24 +3166,24 @@ static int cifs_readpage(struct file *file, struct page *page)
3159{ 3166{
3160 loff_t offset = (loff_t)page->index << PAGE_CACHE_SHIFT; 3167 loff_t offset = (loff_t)page->index << PAGE_CACHE_SHIFT;
3161 int rc = -EACCES; 3168 int rc = -EACCES;
3162 int xid; 3169 unsigned int xid;
3163 3170
3164 xid = GetXid(); 3171 xid = get_xid();
3165 3172
3166 if (file->private_data == NULL) { 3173 if (file->private_data == NULL) {
3167 rc = -EBADF; 3174 rc = -EBADF;
3168 FreeXid(xid); 3175 free_xid(xid);
3169 return rc; 3176 return rc;
3170 } 3177 }
3171 3178
3172 cFYI(1, "readpage %p at offset %d 0x%x\n", 3179 cFYI(1, "readpage %p at offset %d 0x%x",
3173 page, (int)offset, (int)offset); 3180 page, (int)offset, (int)offset);
3174 3181
3175 rc = cifs_readpage_worker(file, page, &offset); 3182 rc = cifs_readpage_worker(file, page, &offset);
3176 3183
3177 unlock_page(page); 3184 unlock_page(page);
3178 3185
3179 FreeXid(xid); 3186 free_xid(xid);
3180 return rc; 3187 return rc;
3181} 3188}
3182 3189
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 8e8bb49112ff..35cb6a374a45 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -289,7 +289,7 @@ cifs_create_dfs_fattr(struct cifs_fattr *fattr, struct super_block *sb)
289int cifs_get_file_info_unix(struct file *filp) 289int cifs_get_file_info_unix(struct file *filp)
290{ 290{
291 int rc; 291 int rc;
292 int xid; 292 unsigned int xid;
293 FILE_UNIX_BASIC_INFO find_data; 293 FILE_UNIX_BASIC_INFO find_data;
294 struct cifs_fattr fattr; 294 struct cifs_fattr fattr;
295 struct inode *inode = filp->f_path.dentry->d_inode; 295 struct inode *inode = filp->f_path.dentry->d_inode;
@@ -297,7 +297,7 @@ int cifs_get_file_info_unix(struct file *filp)
297 struct cifsFileInfo *cfile = filp->private_data; 297 struct cifsFileInfo *cfile = filp->private_data;
298 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); 298 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
299 299
300 xid = GetXid(); 300 xid = get_xid();
301 rc = CIFSSMBUnixQFileInfo(xid, tcon, cfile->netfid, &find_data); 301 rc = CIFSSMBUnixQFileInfo(xid, tcon, cfile->netfid, &find_data);
302 if (!rc) { 302 if (!rc) {
303 cifs_unix_basic_to_fattr(&fattr, &find_data, cifs_sb); 303 cifs_unix_basic_to_fattr(&fattr, &find_data, cifs_sb);
@@ -307,13 +307,13 @@ int cifs_get_file_info_unix(struct file *filp)
307 } 307 }
308 308
309 cifs_fattr_to_inode(inode, &fattr); 309 cifs_fattr_to_inode(inode, &fattr);
310 FreeXid(xid); 310 free_xid(xid);
311 return rc; 311 return rc;
312} 312}
313 313
314int cifs_get_inode_info_unix(struct inode **pinode, 314int cifs_get_inode_info_unix(struct inode **pinode,
315 const unsigned char *full_path, 315 const unsigned char *full_path,
316 struct super_block *sb, int xid) 316 struct super_block *sb, unsigned int xid)
317{ 317{
318 int rc; 318 int rc;
319 FILE_UNIX_BASIC_INFO find_data; 319 FILE_UNIX_BASIC_INFO find_data;
@@ -367,7 +367,7 @@ int cifs_get_inode_info_unix(struct inode **pinode,
367 367
368static int 368static int
369cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path, 369cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path,
370 struct cifs_sb_info *cifs_sb, int xid) 370 struct cifs_sb_info *cifs_sb, unsigned int xid)
371{ 371{
372 int rc; 372 int rc;
373 int oplock = 0; 373 int oplock = 0;
@@ -466,7 +466,7 @@ cifs_sfu_type(struct cifs_fattr *fattr, const unsigned char *path,
466 * FIXME: Doesn't this clobber the type bit we got from cifs_sfu_type ? 466 * FIXME: Doesn't this clobber the type bit we got from cifs_sfu_type ?
467 */ 467 */
468static int cifs_sfu_mode(struct cifs_fattr *fattr, const unsigned char *path, 468static int cifs_sfu_mode(struct cifs_fattr *fattr, const unsigned char *path,
469 struct cifs_sb_info *cifs_sb, int xid) 469 struct cifs_sb_info *cifs_sb, unsigned int xid)
470{ 470{
471#ifdef CONFIG_CIFS_XATTR 471#ifdef CONFIG_CIFS_XATTR
472 ssize_t rc; 472 ssize_t rc;
@@ -557,7 +557,7 @@ cifs_all_info_to_fattr(struct cifs_fattr *fattr, FILE_ALL_INFO *info,
557int cifs_get_file_info(struct file *filp) 557int cifs_get_file_info(struct file *filp)
558{ 558{
559 int rc; 559 int rc;
560 int xid; 560 unsigned int xid;
561 FILE_ALL_INFO find_data; 561 FILE_ALL_INFO find_data;
562 struct cifs_fattr fattr; 562 struct cifs_fattr fattr;
563 struct inode *inode = filp->f_path.dentry->d_inode; 563 struct inode *inode = filp->f_path.dentry->d_inode;
@@ -565,7 +565,7 @@ int cifs_get_file_info(struct file *filp)
565 struct cifsFileInfo *cfile = filp->private_data; 565 struct cifsFileInfo *cfile = filp->private_data;
566 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink); 566 struct cifs_tcon *tcon = tlink_tcon(cfile->tlink);
567 567
568 xid = GetXid(); 568 xid = get_xid();
569 rc = CIFSSMBQFileInfo(xid, tcon, cfile->netfid, &find_data); 569 rc = CIFSSMBQFileInfo(xid, tcon, cfile->netfid, &find_data);
570 switch (rc) { 570 switch (rc) {
571 case 0: 571 case 0:
@@ -596,65 +596,58 @@ int cifs_get_file_info(struct file *filp)
596 fattr.cf_flags |= CIFS_FATTR_NEED_REVAL; 596 fattr.cf_flags |= CIFS_FATTR_NEED_REVAL;
597 cifs_fattr_to_inode(inode, &fattr); 597 cifs_fattr_to_inode(inode, &fattr);
598cgfi_exit: 598cgfi_exit:
599 FreeXid(xid); 599 free_xid(xid);
600 return rc; 600 return rc;
601} 601}
602 602
603int cifs_get_inode_info(struct inode **pinode, 603int
604 const unsigned char *full_path, FILE_ALL_INFO *pfindData, 604cifs_get_inode_info(struct inode **inode, const char *full_path,
605 struct super_block *sb, int xid, const __u16 *pfid) 605 FILE_ALL_INFO *data, struct super_block *sb, int xid,
606 const __u16 *fid)
606{ 607{
607 int rc = 0, tmprc; 608 int rc = 0, tmprc;
608 struct cifs_tcon *pTcon; 609 struct cifs_tcon *tcon;
610 struct TCP_Server_Info *server;
609 struct tcon_link *tlink; 611 struct tcon_link *tlink;
610 struct cifs_sb_info *cifs_sb = CIFS_SB(sb); 612 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
611 char *buf = NULL; 613 char *buf = NULL;
612 bool adjustTZ = false; 614 bool adjust_tz = false;
613 struct cifs_fattr fattr; 615 struct cifs_fattr fattr;
614 616
615 tlink = cifs_sb_tlink(cifs_sb); 617 tlink = cifs_sb_tlink(cifs_sb);
616 if (IS_ERR(tlink)) 618 if (IS_ERR(tlink))
617 return PTR_ERR(tlink); 619 return PTR_ERR(tlink);
618 pTcon = tlink_tcon(tlink); 620 tcon = tlink_tcon(tlink);
621 server = tcon->ses->server;
619 622
620 cFYI(1, "Getting info on %s", full_path); 623 cFYI(1, "Getting info on %s", full_path);
621 624
622 if ((pfindData == NULL) && (*pinode != NULL)) { 625 if ((data == NULL) && (*inode != NULL)) {
623 if (CIFS_I(*pinode)->clientCanCacheRead) { 626 if (CIFS_I(*inode)->clientCanCacheRead) {
624 cFYI(1, "No need to revalidate cached inode sizes"); 627 cFYI(1, "No need to revalidate cached inode sizes");
625 goto cgii_exit; 628 goto cgii_exit;
626 } 629 }
627 } 630 }
628 631
629 /* if file info not passed in then get it from server */ 632 /* if inode info is not passed, get it from server */
630 if (pfindData == NULL) { 633 if (data == NULL) {
634 if (!server->ops->query_path_info) {
635 rc = -ENOSYS;
636 goto cgii_exit;
637 }
631 buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL); 638 buf = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);
632 if (buf == NULL) { 639 if (buf == NULL) {
633 rc = -ENOMEM; 640 rc = -ENOMEM;
634 goto cgii_exit; 641 goto cgii_exit;
635 } 642 }
636 pfindData = (FILE_ALL_INFO *)buf; 643 data = (FILE_ALL_INFO *)buf;
637 644 rc = server->ops->query_path_info(xid, tcon, cifs_sb, full_path,
638 /* could do find first instead but this returns more info */ 645 data, &adjust_tz);
639 rc = CIFSSMBQPathInfo(xid, pTcon, full_path, pfindData,
640 0 /* not legacy */,
641 cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
642 CIFS_MOUNT_MAP_SPECIAL_CHR);
643 /* BB optimize code so we do not make the above call
644 when server claims no NT SMB support and the above call
645 failed at least once - set flag in tcon or mount */
646 if ((rc == -EOPNOTSUPP) || (rc == -EINVAL)) {
647 rc = SMBQueryInformation(xid, pTcon, full_path,
648 pfindData, cifs_sb->local_nls,
649 cifs_sb->mnt_cifs_flags &
650 CIFS_MOUNT_MAP_SPECIAL_CHR);
651 adjustTZ = true;
652 }
653 } 646 }
654 647
655 if (!rc) { 648 if (!rc) {
656 cifs_all_info_to_fattr(&fattr, (FILE_ALL_INFO *) pfindData, 649 cifs_all_info_to_fattr(&fattr, (FILE_ALL_INFO *)data, cifs_sb,
657 cifs_sb, adjustTZ); 650 adjust_tz);
658 } else if (rc == -EREMOTE) { 651 } else if (rc == -EREMOTE) {
659 cifs_create_dfs_fattr(&fattr, sb); 652 cifs_create_dfs_fattr(&fattr, sb);
660 rc = 0; 653 rc = 0;
@@ -668,28 +661,17 @@ int cifs_get_inode_info(struct inode **pinode,
668 * Is an i_ino of zero legal? Can we use that to check if the server 661 * Is an i_ino of zero legal? Can we use that to check if the server
669 * supports returning inode numbers? Are there other sanity checks we 662 * supports returning inode numbers? Are there other sanity checks we
670 * can use to ensure that the server is really filling in that field? 663 * can use to ensure that the server is really filling in that field?
671 *
672 * We can not use the IndexNumber field by default from Windows or
673 * Samba (in ALL_INFO buf) but we can request it explicitly. The SNIA
674 * CIFS spec claims that this value is unique within the scope of a
675 * share, and the windows docs hint that it's actually unique
676 * per-machine.
677 *
678 * There may be higher info levels that work but are there Windows
679 * server or network appliances for which IndexNumber field is not
680 * guaranteed unique?
681 */ 664 */
682 if (*pinode == NULL) { 665 if (*inode == NULL) {
683 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) { 666 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
684 int rc1 = 0; 667 if (server->ops->get_srv_inum)
685 668 tmprc = server->ops->get_srv_inum(xid, tcon,
686 rc1 = CIFSGetSrvInodeNumber(xid, pTcon, 669 cifs_sb, full_path, &fattr.cf_uniqueid,
687 full_path, &fattr.cf_uniqueid, 670 data);
688 cifs_sb->local_nls, 671 else
689 cifs_sb->mnt_cifs_flags & 672 tmprc = -ENOSYS;
690 CIFS_MOUNT_MAP_SPECIAL_CHR); 673 if (tmprc || !fattr.cf_uniqueid) {
691 if (rc1 || !fattr.cf_uniqueid) { 674 cFYI(1, "GetSrvInodeNum rc %d", tmprc);
692 cFYI(1, "GetSrvInodeNum rc %d", rc1);
693 fattr.cf_uniqueid = iunique(sb, ROOT_I); 675 fattr.cf_uniqueid = iunique(sb, ROOT_I);
694 cifs_autodisable_serverino(cifs_sb); 676 cifs_autodisable_serverino(cifs_sb);
695 } 677 }
@@ -697,7 +679,7 @@ int cifs_get_inode_info(struct inode **pinode,
697 fattr.cf_uniqueid = iunique(sb, ROOT_I); 679 fattr.cf_uniqueid = iunique(sb, ROOT_I);
698 } 680 }
699 } else { 681 } else {
700 fattr.cf_uniqueid = CIFS_I(*pinode)->uniqueid; 682 fattr.cf_uniqueid = CIFS_I(*inode)->uniqueid;
701 } 683 }
702 684
703 /* query for SFU type info if supported and needed */ 685 /* query for SFU type info if supported and needed */
@@ -711,8 +693,7 @@ int cifs_get_inode_info(struct inode **pinode,
711#ifdef CONFIG_CIFS_ACL 693#ifdef CONFIG_CIFS_ACL
712 /* fill in 0777 bits from ACL */ 694 /* fill in 0777 bits from ACL */
713 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) { 695 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL) {
714 rc = cifs_acl_to_fattr(cifs_sb, &fattr, *pinode, full_path, 696 rc = cifs_acl_to_fattr(cifs_sb, &fattr, *inode, full_path, fid);
715 pfid);
716 if (rc) { 697 if (rc) {
717 cFYI(1, "%s: Getting ACL failed with error: %d", 698 cFYI(1, "%s: Getting ACL failed with error: %d",
718 __func__, rc); 699 __func__, rc);
@@ -732,12 +713,12 @@ int cifs_get_inode_info(struct inode **pinode,
732 cFYI(1, "CIFSCheckMFSymlink: %d", tmprc); 713 cFYI(1, "CIFSCheckMFSymlink: %d", tmprc);
733 } 714 }
734 715
735 if (!*pinode) { 716 if (!*inode) {
736 *pinode = cifs_iget(sb, &fattr); 717 *inode = cifs_iget(sb, &fattr);
737 if (!*pinode) 718 if (!*inode)
738 rc = -ENOMEM; 719 rc = -ENOMEM;
739 } else { 720 } else {
740 cifs_fattr_to_inode(*pinode, &fattr); 721 cifs_fattr_to_inode(*inode, &fattr);
741 } 722 }
742 723
743cgii_exit: 724cgii_exit:
@@ -750,38 +731,6 @@ static const struct inode_operations cifs_ipc_inode_ops = {
750 .lookup = cifs_lookup, 731 .lookup = cifs_lookup,
751}; 732};
752 733
753char *cifs_build_path_to_root(struct smb_vol *vol, struct cifs_sb_info *cifs_sb,
754 struct cifs_tcon *tcon)
755{
756 int pplen = vol->prepath ? strlen(vol->prepath) : 0;
757 int dfsplen;
758 char *full_path = NULL;
759
760 /* if no prefix path, simply set path to the root of share to "" */
761 if (pplen == 0) {
762 full_path = kmalloc(1, GFP_KERNEL);
763 if (full_path)
764 full_path[0] = 0;
765 return full_path;
766 }
767
768 if (tcon->Flags & SMB_SHARE_IS_IN_DFS)
769 dfsplen = strnlen(tcon->treeName, MAX_TREE_SIZE + 1);
770 else
771 dfsplen = 0;
772
773 full_path = kmalloc(dfsplen + pplen + 1, GFP_KERNEL);
774 if (full_path == NULL)
775 return full_path;
776
777 if (dfsplen)
778 strncpy(full_path, tcon->treeName, dfsplen);
779 strncpy(full_path + dfsplen, vol->prepath, pplen);
780 convert_delimiter(full_path, CIFS_DIR_SEP(cifs_sb));
781 full_path[dfsplen + pplen] = 0; /* add trailing null */
782 return full_path;
783}
784
785static int 734static int
786cifs_find_inode(struct inode *inode, void *opaque) 735cifs_find_inode(struct inode *inode, void *opaque)
787{ 736{
@@ -886,13 +835,13 @@ retry_iget5_locked:
886/* gets root inode */ 835/* gets root inode */
887struct inode *cifs_root_iget(struct super_block *sb) 836struct inode *cifs_root_iget(struct super_block *sb)
888{ 837{
889 int xid; 838 unsigned int xid;
890 struct cifs_sb_info *cifs_sb = CIFS_SB(sb); 839 struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
891 struct inode *inode = NULL; 840 struct inode *inode = NULL;
892 long rc; 841 long rc;
893 struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb); 842 struct cifs_tcon *tcon = cifs_sb_master_tcon(cifs_sb);
894 843
895 xid = GetXid(); 844 xid = get_xid();
896 if (tcon->unix_ext) 845 if (tcon->unix_ext)
897 rc = cifs_get_inode_info_unix(&inode, "", sb, xid); 846 rc = cifs_get_inode_info_unix(&inode, "", sb, xid);
898 else 847 else
@@ -922,15 +871,15 @@ struct inode *cifs_root_iget(struct super_block *sb)
922 } 871 }
923 872
924out: 873out:
925 /* can not call macro FreeXid here since in a void func 874 /* can not call macro free_xid here since in a void func
926 * TODO: This is no longer true 875 * TODO: This is no longer true
927 */ 876 */
928 _FreeXid(xid); 877 _free_xid(xid);
929 return inode; 878 return inode;
930} 879}
931 880
932static int 881static int
933cifs_set_file_info(struct inode *inode, struct iattr *attrs, int xid, 882cifs_set_file_info(struct inode *inode, struct iattr *attrs, unsigned int xid,
934 char *full_path, __u32 dosattr) 883 char *full_path, __u32 dosattr)
935{ 884{
936 int rc; 885 int rc;
@@ -1051,7 +1000,8 @@ out:
1051 * anything else. 1000 * anything else.
1052 */ 1001 */
1053static int 1002static int
1054cifs_rename_pending_delete(char *full_path, struct dentry *dentry, int xid) 1003cifs_rename_pending_delete(char *full_path, struct dentry *dentry,
1004 unsigned int xid)
1055{ 1005{
1056 int oplock = 0; 1006 int oplock = 0;
1057 int rc; 1007 int rc;
@@ -1171,7 +1121,7 @@ undo_setattr:
1171int cifs_unlink(struct inode *dir, struct dentry *dentry) 1121int cifs_unlink(struct inode *dir, struct dentry *dentry)
1172{ 1122{
1173 int rc = 0; 1123 int rc = 0;
1174 int xid; 1124 unsigned int xid;
1175 char *full_path = NULL; 1125 char *full_path = NULL;
1176 struct inode *inode = dentry->d_inode; 1126 struct inode *inode = dentry->d_inode;
1177 struct cifsInodeInfo *cifs_inode; 1127 struct cifsInodeInfo *cifs_inode;
@@ -1189,7 +1139,7 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry)
1189 return PTR_ERR(tlink); 1139 return PTR_ERR(tlink);
1190 tcon = tlink_tcon(tlink); 1140 tcon = tlink_tcon(tlink);
1191 1141
1192 xid = GetXid(); 1142 xid = get_xid();
1193 1143
1194 /* Unlink can be called from rename so we can not take the 1144 /* Unlink can be called from rename so we can not take the
1195 * sb->s_vfs_rename_mutex here */ 1145 * sb->s_vfs_rename_mutex here */
@@ -1199,9 +1149,8 @@ int cifs_unlink(struct inode *dir, struct dentry *dentry)
1199 goto unlink_out; 1149 goto unlink_out;
1200 } 1150 }
1201 1151
1202 if ((tcon->ses->capabilities & CAP_UNIX) && 1152 if (cap_unix(tcon->ses) && (CIFS_UNIX_POSIX_PATH_OPS_CAP &
1203 (CIFS_UNIX_POSIX_PATH_OPS_CAP & 1153 le64_to_cpu(tcon->fsUnixInfo.Capability))) {
1204 le64_to_cpu(tcon->fsUnixInfo.Capability))) {
1205 rc = CIFSPOSIXDelFile(xid, tcon, full_path, 1154 rc = CIFSPOSIXDelFile(xid, tcon, full_path,
1206 SMB_POSIX_UNLINK_FILE_TARGET, cifs_sb->local_nls, 1155 SMB_POSIX_UNLINK_FILE_TARGET, cifs_sb->local_nls,
1207 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); 1156 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
@@ -1265,7 +1214,7 @@ out_reval:
1265unlink_out: 1214unlink_out:
1266 kfree(full_path); 1215 kfree(full_path);
1267 kfree(attrs); 1216 kfree(attrs);
1268 FreeXid(xid); 1217 free_xid(xid);
1269 cifs_put_tlink(tlink); 1218 cifs_put_tlink(tlink);
1270 return rc; 1219 return rc;
1271} 1220}
@@ -1273,10 +1222,10 @@ unlink_out:
1273int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode) 1222int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode)
1274{ 1223{
1275 int rc = 0, tmprc; 1224 int rc = 0, tmprc;
1276 int xid; 1225 unsigned int xid;
1277 struct cifs_sb_info *cifs_sb; 1226 struct cifs_sb_info *cifs_sb;
1278 struct tcon_link *tlink; 1227 struct tcon_link *tlink;
1279 struct cifs_tcon *pTcon; 1228 struct cifs_tcon *tcon;
1280 char *full_path = NULL; 1229 char *full_path = NULL;
1281 struct inode *newinode = NULL; 1230 struct inode *newinode = NULL;
1282 struct cifs_fattr fattr; 1231 struct cifs_fattr fattr;
@@ -1287,9 +1236,9 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode)
1287 tlink = cifs_sb_tlink(cifs_sb); 1236 tlink = cifs_sb_tlink(cifs_sb);
1288 if (IS_ERR(tlink)) 1237 if (IS_ERR(tlink))
1289 return PTR_ERR(tlink); 1238 return PTR_ERR(tlink);
1290 pTcon = tlink_tcon(tlink); 1239 tcon = tlink_tcon(tlink);
1291 1240
1292 xid = GetXid(); 1241 xid = get_xid();
1293 1242
1294 full_path = build_path_from_dentry(direntry); 1243 full_path = build_path_from_dentry(direntry);
1295 if (full_path == NULL) { 1244 if (full_path == NULL) {
@@ -1297,9 +1246,8 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode)
1297 goto mkdir_out; 1246 goto mkdir_out;
1298 } 1247 }
1299 1248
1300 if ((pTcon->ses->capabilities & CAP_UNIX) && 1249 if (cap_unix(tcon->ses) && (CIFS_UNIX_POSIX_PATH_OPS_CAP &
1301 (CIFS_UNIX_POSIX_PATH_OPS_CAP & 1250 le64_to_cpu(tcon->fsUnixInfo.Capability))) {
1302 le64_to_cpu(pTcon->fsUnixInfo.Capability))) {
1303 u32 oplock = 0; 1251 u32 oplock = 0;
1304 FILE_UNIX_BASIC_INFO *pInfo = 1252 FILE_UNIX_BASIC_INFO *pInfo =
1305 kzalloc(sizeof(FILE_UNIX_BASIC_INFO), GFP_KERNEL); 1253 kzalloc(sizeof(FILE_UNIX_BASIC_INFO), GFP_KERNEL);
@@ -1309,7 +1257,7 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode)
1309 } 1257 }
1310 1258
1311 mode &= ~current_umask(); 1259 mode &= ~current_umask();
1312 rc = CIFSPOSIXCreate(xid, pTcon, SMB_O_DIRECTORY | SMB_O_CREAT, 1260 rc = CIFSPOSIXCreate(xid, tcon, SMB_O_DIRECTORY | SMB_O_CREAT,
1313 mode, NULL /* netfid */, pInfo, &oplock, 1261 mode, NULL /* netfid */, pInfo, &oplock,
1314 full_path, cifs_sb->local_nls, 1262 full_path, cifs_sb->local_nls,
1315 cifs_sb->mnt_cifs_flags & 1263 cifs_sb->mnt_cifs_flags &
@@ -1353,14 +1301,14 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, umode_t mode)
1353 } 1301 }
1354mkdir_retry_old: 1302mkdir_retry_old:
1355 /* BB add setting the equivalent of mode via CreateX w/ACLs */ 1303 /* BB add setting the equivalent of mode via CreateX w/ACLs */
1356 rc = CIFSSMBMkDir(xid, pTcon, full_path, cifs_sb->local_nls, 1304 rc = CIFSSMBMkDir(xid, tcon, full_path, cifs_sb->local_nls,
1357 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR); 1305 cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
1358 if (rc) { 1306 if (rc) {
1359 cFYI(1, "cifs_mkdir returned 0x%x", rc); 1307 cFYI(1, "cifs_mkdir returned 0x%x", rc);
1360 d_drop(direntry); 1308 d_drop(direntry);
1361 } else { 1309 } else {
1362mkdir_get_info: 1310mkdir_get_info:
1363 if (pTcon->unix_ext) 1311 if (tcon->unix_ext)
1364 rc = cifs_get_inode_info_unix(&newinode, full_path, 1312 rc = cifs_get_inode_info_unix(&newinode, full_path,
1365 inode->i_sb, xid); 1313 inode->i_sb, xid);
1366 else 1314 else
@@ -1378,7 +1326,7 @@ mkdir_get_info:
1378 if (inode->i_mode & S_ISGID) 1326 if (inode->i_mode & S_ISGID)
1379 mode |= S_ISGID; 1327 mode |= S_ISGID;
1380 1328
1381 if (pTcon->unix_ext) { 1329 if (tcon->unix_ext) {
1382 struct cifs_unix_set_info_args args = { 1330 struct cifs_unix_set_info_args args = {
1383 .mode = mode, 1331 .mode = mode,
1384 .ctime = NO_CHANGE_64, 1332 .ctime = NO_CHANGE_64,
@@ -1396,7 +1344,7 @@ mkdir_get_info:
1396 args.uid = NO_CHANGE_64; 1344 args.uid = NO_CHANGE_64;
1397 args.gid = NO_CHANGE_64; 1345 args.gid = NO_CHANGE_64;
1398 } 1346 }
1399 CIFSSMBUnixSetPathInfo(xid, pTcon, full_path, &args, 1347 CIFSSMBUnixSetPathInfo(xid, tcon, full_path, &args,
1400 cifs_sb->local_nls, 1348 cifs_sb->local_nls,
1401 cifs_sb->mnt_cifs_flags & 1349 cifs_sb->mnt_cifs_flags &
1402 CIFS_MOUNT_MAP_SPECIAL_CHR); 1350 CIFS_MOUNT_MAP_SPECIAL_CHR);
@@ -1411,7 +1359,7 @@ mkdir_get_info:
1411 cifsInode = CIFS_I(newinode); 1359 cifsInode = CIFS_I(newinode);
1412 dosattrs = cifsInode->cifsAttrs|ATTR_READONLY; 1360 dosattrs = cifsInode->cifsAttrs|ATTR_READONLY;
1413 pInfo.Attributes = cpu_to_le32(dosattrs); 1361 pInfo.Attributes = cpu_to_le32(dosattrs);
1414 tmprc = CIFSSMBSetPathInfo(xid, pTcon, 1362 tmprc = CIFSSMBSetPathInfo(xid, tcon,
1415 full_path, &pInfo, 1363 full_path, &pInfo,
1416 cifs_sb->local_nls, 1364 cifs_sb->local_nls,
1417 cifs_sb->mnt_cifs_flags & 1365 cifs_sb->mnt_cifs_flags &
@@ -1446,7 +1394,7 @@ mkdir_out:
1446 */ 1394 */
1447 CIFS_I(inode)->time = 0; 1395 CIFS_I(inode)->time = 0;
1448 kfree(full_path); 1396 kfree(full_path);
1449 FreeXid(xid); 1397 free_xid(xid);
1450 cifs_put_tlink(tlink); 1398 cifs_put_tlink(tlink);
1451 return rc; 1399 return rc;
1452} 1400}
@@ -1454,7 +1402,7 @@ mkdir_out:
1454int cifs_rmdir(struct inode *inode, struct dentry *direntry) 1402int cifs_rmdir(struct inode *inode, struct dentry *direntry)
1455{ 1403{
1456 int rc = 0; 1404 int rc = 0;
1457 int xid; 1405 unsigned int xid;
1458 struct cifs_sb_info *cifs_sb; 1406 struct cifs_sb_info *cifs_sb;
1459 struct tcon_link *tlink; 1407 struct tcon_link *tlink;
1460 struct cifs_tcon *pTcon; 1408 struct cifs_tcon *pTcon;
@@ -1463,7 +1411,7 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry)
1463 1411
1464 cFYI(1, "cifs_rmdir, inode = 0x%p", inode); 1412 cFYI(1, "cifs_rmdir, inode = 0x%p", inode);
1465 1413
1466 xid = GetXid(); 1414 xid = get_xid();
1467 1415
1468 full_path = build_path_from_dentry(direntry); 1416 full_path = build_path_from_dentry(direntry);
1469 if (full_path == NULL) { 1417 if (full_path == NULL) {
@@ -1506,13 +1454,14 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry)
1506 1454
1507rmdir_exit: 1455rmdir_exit:
1508 kfree(full_path); 1456 kfree(full_path);
1509 FreeXid(xid); 1457 free_xid(xid);
1510 return rc; 1458 return rc;
1511} 1459}
1512 1460
1513static int 1461static int
1514cifs_do_rename(int xid, struct dentry *from_dentry, const char *fromPath, 1462cifs_do_rename(unsigned int xid, struct dentry *from_dentry,
1515 struct dentry *to_dentry, const char *toPath) 1463 const char *fromPath, struct dentry *to_dentry,
1464 const char *toPath)
1516{ 1465{
1517 struct cifs_sb_info *cifs_sb = CIFS_SB(from_dentry->d_sb); 1466 struct cifs_sb_info *cifs_sb = CIFS_SB(from_dentry->d_sb);
1518 struct tcon_link *tlink; 1467 struct tcon_link *tlink;
@@ -1571,7 +1520,8 @@ int cifs_rename(struct inode *source_dir, struct dentry *source_dentry,
1571 struct cifs_tcon *tcon; 1520 struct cifs_tcon *tcon;
1572 FILE_UNIX_BASIC_INFO *info_buf_source = NULL; 1521 FILE_UNIX_BASIC_INFO *info_buf_source = NULL;
1573 FILE_UNIX_BASIC_INFO *info_buf_target; 1522 FILE_UNIX_BASIC_INFO *info_buf_target;
1574 int xid, rc, tmprc; 1523 unsigned int xid;
1524 int rc, tmprc;
1575 1525
1576 cifs_sb = CIFS_SB(source_dir->i_sb); 1526 cifs_sb = CIFS_SB(source_dir->i_sb);
1577 tlink = cifs_sb_tlink(cifs_sb); 1527 tlink = cifs_sb_tlink(cifs_sb);
@@ -1579,7 +1529,7 @@ int cifs_rename(struct inode *source_dir, struct dentry *source_dentry,
1579 return PTR_ERR(tlink); 1529 return PTR_ERR(tlink);
1580 tcon = tlink_tcon(tlink); 1530 tcon = tlink_tcon(tlink);
1581 1531
1582 xid = GetXid(); 1532 xid = get_xid();
1583 1533
1584 /* 1534 /*
1585 * we already have the rename sem so we do not need to 1535 * we already have the rename sem so we do not need to
@@ -1652,7 +1602,7 @@ cifs_rename_exit:
1652 kfree(info_buf_source); 1602 kfree(info_buf_source);
1653 kfree(fromName); 1603 kfree(fromName);
1654 kfree(toName); 1604 kfree(toName);
1655 FreeXid(xid); 1605 free_xid(xid);
1656 cifs_put_tlink(tlink); 1606 cifs_put_tlink(tlink);
1657 return rc; 1607 return rc;
1658} 1608}
@@ -1727,7 +1677,7 @@ int cifs_revalidate_file_attr(struct file *filp)
1727 1677
1728int cifs_revalidate_dentry_attr(struct dentry *dentry) 1678int cifs_revalidate_dentry_attr(struct dentry *dentry)
1729{ 1679{
1730 int xid; 1680 unsigned int xid;
1731 int rc = 0; 1681 int rc = 0;
1732 struct inode *inode = dentry->d_inode; 1682 struct inode *inode = dentry->d_inode;
1733 struct super_block *sb = dentry->d_sb; 1683 struct super_block *sb = dentry->d_sb;
@@ -1739,7 +1689,7 @@ int cifs_revalidate_dentry_attr(struct dentry *dentry)
1739 if (!cifs_inode_needs_reval(inode)) 1689 if (!cifs_inode_needs_reval(inode))
1740 return rc; 1690 return rc;
1741 1691
1742 xid = GetXid(); 1692 xid = get_xid();
1743 1693
1744 /* can not safely grab the rename sem here if rename calls revalidate 1694 /* can not safely grab the rename sem here if rename calls revalidate
1745 since that would deadlock */ 1695 since that would deadlock */
@@ -1761,7 +1711,7 @@ int cifs_revalidate_dentry_attr(struct dentry *dentry)
1761 1711
1762out: 1712out:
1763 kfree(full_path); 1713 kfree(full_path);
1764 FreeXid(xid); 1714 free_xid(xid);
1765 return rc; 1715 return rc;
1766} 1716}
1767 1717
@@ -1869,7 +1819,7 @@ static void cifs_setsize(struct inode *inode, loff_t offset)
1869 1819
1870static int 1820static int
1871cifs_set_file_size(struct inode *inode, struct iattr *attrs, 1821cifs_set_file_size(struct inode *inode, struct iattr *attrs,
1872 int xid, char *full_path) 1822 unsigned int xid, char *full_path)
1873{ 1823{
1874 int rc; 1824 int rc;
1875 struct cifsFileInfo *open_file; 1825 struct cifsFileInfo *open_file;
@@ -1971,7 +1921,7 @@ static int
1971cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs) 1921cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs)
1972{ 1922{
1973 int rc; 1923 int rc;
1974 int xid; 1924 unsigned int xid;
1975 char *full_path = NULL; 1925 char *full_path = NULL;
1976 struct inode *inode = direntry->d_inode; 1926 struct inode *inode = direntry->d_inode;
1977 struct cifsInodeInfo *cifsInode = CIFS_I(inode); 1927 struct cifsInodeInfo *cifsInode = CIFS_I(inode);
@@ -1984,7 +1934,7 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs)
1984 cFYI(1, "setattr_unix on file %s attrs->ia_valid=0x%x", 1934 cFYI(1, "setattr_unix on file %s attrs->ia_valid=0x%x",
1985 direntry->d_name.name, attrs->ia_valid); 1935 direntry->d_name.name, attrs->ia_valid);
1986 1936
1987 xid = GetXid(); 1937 xid = get_xid();
1988 1938
1989 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM) 1939 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_PERM)
1990 attrs->ia_valid |= ATTR_FORCE; 1940 attrs->ia_valid |= ATTR_FORCE;
@@ -2104,14 +2054,14 @@ cifs_setattr_unix(struct dentry *direntry, struct iattr *attrs)
2104out: 2054out:
2105 kfree(args); 2055 kfree(args);
2106 kfree(full_path); 2056 kfree(full_path);
2107 FreeXid(xid); 2057 free_xid(xid);
2108 return rc; 2058 return rc;
2109} 2059}
2110 2060
2111static int 2061static int
2112cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs) 2062cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
2113{ 2063{
2114 int xid; 2064 unsigned int xid;
2115 uid_t uid = NO_CHANGE_32; 2065 uid_t uid = NO_CHANGE_32;
2116 gid_t gid = NO_CHANGE_32; 2066 gid_t gid = NO_CHANGE_32;
2117 struct inode *inode = direntry->d_inode; 2067 struct inode *inode = direntry->d_inode;
@@ -2122,7 +2072,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
2122 __u32 dosattr = 0; 2072 __u32 dosattr = 0;
2123 __u64 mode = NO_CHANGE_64; 2073 __u64 mode = NO_CHANGE_64;
2124 2074
2125 xid = GetXid(); 2075 xid = get_xid();
2126 2076
2127 cFYI(1, "setattr on file %s attrs->iavalid 0x%x", 2077 cFYI(1, "setattr on file %s attrs->iavalid 0x%x",
2128 direntry->d_name.name, attrs->ia_valid); 2078 direntry->d_name.name, attrs->ia_valid);
@@ -2132,14 +2082,14 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
2132 2082
2133 rc = inode_change_ok(inode, attrs); 2083 rc = inode_change_ok(inode, attrs);
2134 if (rc < 0) { 2084 if (rc < 0) {
2135 FreeXid(xid); 2085 free_xid(xid);
2136 return rc; 2086 return rc;
2137 } 2087 }
2138 2088
2139 full_path = build_path_from_dentry(direntry); 2089 full_path = build_path_from_dentry(direntry);
2140 if (full_path == NULL) { 2090 if (full_path == NULL) {
2141 rc = -ENOMEM; 2091 rc = -ENOMEM;
2142 FreeXid(xid); 2092 free_xid(xid);
2143 return rc; 2093 return rc;
2144 } 2094 }
2145 2095
@@ -2265,7 +2215,7 @@ cifs_setattr_nounix(struct dentry *direntry, struct iattr *attrs)
2265 2215
2266cifs_setattr_exit: 2216cifs_setattr_exit:
2267 kfree(full_path); 2217 kfree(full_path);
2268 FreeXid(xid); 2218 free_xid(xid);
2269 return rc; 2219 return rc;
2270} 2220}
2271 2221
diff --git a/fs/cifs/ioctl.c b/fs/cifs/ioctl.c
index 6d2667f0c98c..ae082a66de2f 100644
--- a/fs/cifs/ioctl.c
+++ b/fs/cifs/ioctl.c
@@ -34,7 +34,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
34{ 34{
35 struct inode *inode = filep->f_dentry->d_inode; 35 struct inode *inode = filep->f_dentry->d_inode;
36 int rc = -ENOTTY; /* strange error - but the precedent */ 36 int rc = -ENOTTY; /* strange error - but the precedent */
37 int xid; 37 unsigned int xid;
38 struct cifs_sb_info *cifs_sb; 38 struct cifs_sb_info *cifs_sb;
39#ifdef CONFIG_CIFS_POSIX 39#ifdef CONFIG_CIFS_POSIX
40 struct cifsFileInfo *pSMBFile = filep->private_data; 40 struct cifsFileInfo *pSMBFile = filep->private_data;
@@ -44,7 +44,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
44 __u64 caps; 44 __u64 caps;
45#endif /* CONFIG_CIFS_POSIX */ 45#endif /* CONFIG_CIFS_POSIX */
46 46
47 xid = GetXid(); 47 xid = get_xid();
48 48
49 cFYI(1, "ioctl file %p cmd %u arg %lu", filep, command, arg); 49 cFYI(1, "ioctl file %p cmd %u arg %lu", filep, command, arg);
50 50
@@ -105,6 +105,6 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
105 break; 105 break;
106 } 106 }
107 107
108 FreeXid(xid); 108 free_xid(xid);
109 return rc; 109 return rc;
110} 110}
diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index 6b0e06434391..09e4b3ae4564 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -56,14 +56,14 @@ symlink_hash(unsigned int link_len, const char *link_str, u8 *md5_hash)
56 md5 = crypto_alloc_shash("md5", 0, 0); 56 md5 = crypto_alloc_shash("md5", 0, 0);
57 if (IS_ERR(md5)) { 57 if (IS_ERR(md5)) {
58 rc = PTR_ERR(md5); 58 rc = PTR_ERR(md5);
59 cERROR(1, "%s: Crypto md5 allocation error %d\n", __func__, rc); 59 cERROR(1, "%s: Crypto md5 allocation error %d", __func__, rc);
60 return rc; 60 return rc;
61 } 61 }
62 size = sizeof(struct shash_desc) + crypto_shash_descsize(md5); 62 size = sizeof(struct shash_desc) + crypto_shash_descsize(md5);
63 sdescmd5 = kmalloc(size, GFP_KERNEL); 63 sdescmd5 = kmalloc(size, GFP_KERNEL);
64 if (!sdescmd5) { 64 if (!sdescmd5) {
65 rc = -ENOMEM; 65 rc = -ENOMEM;
66 cERROR(1, "%s: Memory allocation failure\n", __func__); 66 cERROR(1, "%s: Memory allocation failure", __func__);
67 goto symlink_hash_err; 67 goto symlink_hash_err;
68 } 68 }
69 sdescmd5->shash.tfm = md5; 69 sdescmd5->shash.tfm = md5;
@@ -71,17 +71,17 @@ symlink_hash(unsigned int link_len, const char *link_str, u8 *md5_hash)
71 71
72 rc = crypto_shash_init(&sdescmd5->shash); 72 rc = crypto_shash_init(&sdescmd5->shash);
73 if (rc) { 73 if (rc) {
74 cERROR(1, "%s: Could not init md5 shash\n", __func__); 74 cERROR(1, "%s: Could not init md5 shash", __func__);
75 goto symlink_hash_err; 75 goto symlink_hash_err;
76 } 76 }
77 rc = crypto_shash_update(&sdescmd5->shash, link_str, link_len); 77 rc = crypto_shash_update(&sdescmd5->shash, link_str, link_len);
78 if (rc) { 78 if (rc) {
79 cERROR(1, "%s: Could not update iwth link_str\n", __func__); 79 cERROR(1, "%s: Could not update iwth link_str", __func__);
80 goto symlink_hash_err; 80 goto symlink_hash_err;
81 } 81 }
82 rc = crypto_shash_final(&sdescmd5->shash, md5_hash); 82 rc = crypto_shash_final(&sdescmd5->shash, md5_hash);
83 if (rc) 83 if (rc)
84 cERROR(1, "%s: Could not generate md5 hash\n", __func__); 84 cERROR(1, "%s: Could not generate md5 hash", __func__);
85 85
86symlink_hash_err: 86symlink_hash_err:
87 crypto_free_shash(md5); 87 crypto_free_shash(md5);
@@ -115,7 +115,7 @@ CIFSParseMFSymlink(const u8 *buf,
115 115
116 rc = symlink_hash(link_len, link_str, md5_hash); 116 rc = symlink_hash(link_len, link_str, md5_hash);
117 if (rc) { 117 if (rc) {
118 cFYI(1, "%s: MD5 hash failure: %d\n", __func__, rc); 118 cFYI(1, "%s: MD5 hash failure: %d", __func__, rc);
119 return rc; 119 return rc;
120 } 120 }
121 121
@@ -154,7 +154,7 @@ CIFSFormatMFSymlink(u8 *buf, unsigned int buf_len, const char *link_str)
154 154
155 rc = symlink_hash(link_len, link_str, md5_hash); 155 rc = symlink_hash(link_len, link_str, md5_hash);
156 if (rc) { 156 if (rc) {
157 cFYI(1, "%s: MD5 hash failure: %d\n", __func__, rc); 157 cFYI(1, "%s: MD5 hash failure: %d", __func__, rc);
158 return rc; 158 return rc;
159 } 159 }
160 160
@@ -181,7 +181,7 @@ CIFSFormatMFSymlink(u8 *buf, unsigned int buf_len, const char *link_str)
181} 181}
182 182
183static int 183static int
184CIFSCreateMFSymLink(const int xid, struct cifs_tcon *tcon, 184CIFSCreateMFSymLink(const unsigned int xid, struct cifs_tcon *tcon,
185 const char *fromName, const char *toName, 185 const char *fromName, const char *toName,
186 struct cifs_sb_info *cifs_sb) 186 struct cifs_sb_info *cifs_sb)
187{ 187{
@@ -238,7 +238,7 @@ CIFSCreateMFSymLink(const int xid, struct cifs_tcon *tcon,
238} 238}
239 239
240static int 240static int
241CIFSQueryMFSymLink(const int xid, struct cifs_tcon *tcon, 241CIFSQueryMFSymLink(const unsigned int xid, struct cifs_tcon *tcon,
242 const unsigned char *searchName, char **symlinkinfo, 242 const unsigned char *searchName, char **symlinkinfo,
243 const struct nls_table *nls_codepage, int remap) 243 const struct nls_table *nls_codepage, int remap)
244{ 244{
@@ -307,7 +307,7 @@ CIFSCouldBeMFSymlink(const struct cifs_fattr *fattr)
307int 307int
308CIFSCheckMFSymlink(struct cifs_fattr *fattr, 308CIFSCheckMFSymlink(struct cifs_fattr *fattr,
309 const unsigned char *path, 309 const unsigned char *path,
310 struct cifs_sb_info *cifs_sb, int xid) 310 struct cifs_sb_info *cifs_sb, unsigned int xid)
311{ 311{
312 int rc; 312 int rc;
313 int oplock = 0; 313 int oplock = 0;
@@ -390,7 +390,7 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode,
390 struct dentry *direntry) 390 struct dentry *direntry)
391{ 391{
392 int rc = -EACCES; 392 int rc = -EACCES;
393 int xid; 393 unsigned int xid;
394 char *fromName = NULL; 394 char *fromName = NULL;
395 char *toName = NULL; 395 char *toName = NULL;
396 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 396 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
@@ -403,7 +403,7 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode,
403 return PTR_ERR(tlink); 403 return PTR_ERR(tlink);
404 pTcon = tlink_tcon(tlink); 404 pTcon = tlink_tcon(tlink);
405 405
406 xid = GetXid(); 406 xid = get_xid();
407 407
408 fromName = build_path_from_dentry(old_file); 408 fromName = build_path_from_dentry(old_file);
409 toName = build_path_from_dentry(direntry); 409 toName = build_path_from_dentry(direntry);
@@ -455,7 +455,7 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode,
455cifs_hl_exit: 455cifs_hl_exit:
456 kfree(fromName); 456 kfree(fromName);
457 kfree(toName); 457 kfree(toName);
458 FreeXid(xid); 458 free_xid(xid);
459 cifs_put_tlink(tlink); 459 cifs_put_tlink(tlink);
460 return rc; 460 return rc;
461} 461}
@@ -465,14 +465,14 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd)
465{ 465{
466 struct inode *inode = direntry->d_inode; 466 struct inode *inode = direntry->d_inode;
467 int rc = -ENOMEM; 467 int rc = -ENOMEM;
468 int xid; 468 unsigned int xid;
469 char *full_path = NULL; 469 char *full_path = NULL;
470 char *target_path = NULL; 470 char *target_path = NULL;
471 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 471 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
472 struct tcon_link *tlink = NULL; 472 struct tcon_link *tlink = NULL;
473 struct cifs_tcon *tcon; 473 struct cifs_tcon *tcon;
474 474
475 xid = GetXid(); 475 xid = get_xid();
476 476
477 tlink = cifs_sb_tlink(cifs_sb); 477 tlink = cifs_sb_tlink(cifs_sb);
478 if (IS_ERR(tlink)) { 478 if (IS_ERR(tlink)) {
@@ -495,8 +495,8 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd)
495 * but there doesn't seem to be any harm in allowing the client to 495 * but there doesn't seem to be any harm in allowing the client to
496 * read them. 496 * read them.
497 */ 497 */
498 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) 498 if (!(cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MF_SYMLINKS) &&
499 && !(tcon->ses->capabilities & CAP_UNIX)) { 499 !cap_unix(tcon->ses)) {
500 rc = -EACCES; 500 rc = -EACCES;
501 goto out; 501 goto out;
502 } 502 }
@@ -518,7 +518,7 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd)
518 cifs_sb->mnt_cifs_flags & 518 cifs_sb->mnt_cifs_flags &
519 CIFS_MOUNT_MAP_SPECIAL_CHR); 519 CIFS_MOUNT_MAP_SPECIAL_CHR);
520 520
521 if ((rc != 0) && (tcon->ses->capabilities & CAP_UNIX)) 521 if ((rc != 0) && cap_unix(tcon->ses))
522 rc = CIFSSMBUnixQuerySymLink(xid, tcon, full_path, &target_path, 522 rc = CIFSSMBUnixQuerySymLink(xid, tcon, full_path, &target_path,
523 cifs_sb->local_nls); 523 cifs_sb->local_nls);
524 524
@@ -529,7 +529,7 @@ out:
529 target_path = ERR_PTR(rc); 529 target_path = ERR_PTR(rc);
530 } 530 }
531 531
532 FreeXid(xid); 532 free_xid(xid);
533 if (tlink) 533 if (tlink)
534 cifs_put_tlink(tlink); 534 cifs_put_tlink(tlink);
535 nd_set_link(nd, target_path); 535 nd_set_link(nd, target_path);
@@ -540,14 +540,14 @@ int
540cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname) 540cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
541{ 541{
542 int rc = -EOPNOTSUPP; 542 int rc = -EOPNOTSUPP;
543 int xid; 543 unsigned int xid;
544 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 544 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
545 struct tcon_link *tlink; 545 struct tcon_link *tlink;
546 struct cifs_tcon *pTcon; 546 struct cifs_tcon *pTcon;
547 char *full_path = NULL; 547 char *full_path = NULL;
548 struct inode *newinode = NULL; 548 struct inode *newinode = NULL;
549 549
550 xid = GetXid(); 550 xid = get_xid();
551 551
552 tlink = cifs_sb_tlink(cifs_sb); 552 tlink = cifs_sb_tlink(cifs_sb);
553 if (IS_ERR(tlink)) { 553 if (IS_ERR(tlink)) {
@@ -594,7 +594,7 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
594symlink_exit: 594symlink_exit:
595 kfree(full_path); 595 kfree(full_path);
596 cifs_put_tlink(tlink); 596 cifs_put_tlink(tlink);
597 FreeXid(xid); 597 free_xid(xid);
598 return rc; 598 return rc;
599} 599}
600 600
diff --git a/fs/cifs/misc.c b/fs/cifs/misc.c
index 557506ae1e2a..ce41fee07e5b 100644
--- a/fs/cifs/misc.c
+++ b/fs/cifs/misc.c
@@ -29,6 +29,9 @@
29#include "smberr.h" 29#include "smberr.h"
30#include "nterr.h" 30#include "nterr.h"
31#include "cifs_unicode.h" 31#include "cifs_unicode.h"
32#ifdef CONFIG_CIFS_SMB2
33#include "smb2pdu.h"
34#endif
32 35
33extern mempool_t *cifs_sm_req_poolp; 36extern mempool_t *cifs_sm_req_poolp;
34extern mempool_t *cifs_req_poolp; 37extern mempool_t *cifs_req_poolp;
@@ -40,7 +43,7 @@ extern mempool_t *cifs_req_poolp;
40 since the cifs fs was mounted */ 43 since the cifs fs was mounted */
41 44
42unsigned int 45unsigned int
43_GetXid(void) 46_get_xid(void)
44{ 47{
45 unsigned int xid; 48 unsigned int xid;
46 49
@@ -58,7 +61,7 @@ _GetXid(void)
58} 61}
59 62
60void 63void
61_FreeXid(unsigned int xid) 64_free_xid(unsigned int xid)
62{ 65{
63 spin_lock(&GlobalMid_Lock); 66 spin_lock(&GlobalMid_Lock);
64 /* if (GlobalTotalActiveXid == 0) 67 /* if (GlobalTotalActiveXid == 0)
@@ -143,17 +146,27 @@ struct smb_hdr *
143cifs_buf_get(void) 146cifs_buf_get(void)
144{ 147{
145 struct smb_hdr *ret_buf = NULL; 148 struct smb_hdr *ret_buf = NULL;
146 149 size_t buf_size = sizeof(struct smb_hdr);
147/* We could use negotiated size instead of max_msgsize - 150
148 but it may be more efficient to always alloc same size 151#ifdef CONFIG_CIFS_SMB2
149 albeit slightly larger than necessary and maxbuffersize 152 /*
150 defaults to this and can not be bigger */ 153 * SMB2 header is bigger than CIFS one - no problems to clean some
154 * more bytes for CIFS.
155 */
156 buf_size = sizeof(struct smb2_hdr);
157#endif
158 /*
159 * We could use negotiated size instead of max_msgsize -
160 * but it may be more efficient to always alloc same size
161 * albeit slightly larger than necessary and maxbuffersize
162 * defaults to this and can not be bigger.
163 */
151 ret_buf = mempool_alloc(cifs_req_poolp, GFP_NOFS); 164 ret_buf = mempool_alloc(cifs_req_poolp, GFP_NOFS);
152 165
153 /* clear the first few header bytes */ 166 /* clear the first few header bytes */
154 /* for most paths, more is cleared in header_assemble */ 167 /* for most paths, more is cleared in header_assemble */
155 if (ret_buf) { 168 if (ret_buf) {
156 memset(ret_buf, 0, sizeof(struct smb_hdr) + 3); 169 memset(ret_buf, 0, buf_size + 3);
157 atomic_inc(&bufAllocCount); 170 atomic_inc(&bufAllocCount);
158#ifdef CONFIG_CIFS_STATS2 171#ifdef CONFIG_CIFS_STATS2
159 atomic_inc(&totBufAllocCount); 172 atomic_inc(&totBufAllocCount);
@@ -448,7 +461,7 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)
448 if (tcon->tid != buf->Tid) 461 if (tcon->tid != buf->Tid)
449 continue; 462 continue;
450 463
451 cifs_stats_inc(&tcon->num_oplock_brks); 464 cifs_stats_inc(&tcon->stats.cifs_stats.num_oplock_brks);
452 spin_lock(&cifs_file_list_lock); 465 spin_lock(&cifs_file_list_lock);
453 list_for_each(tmp2, &tcon->openFileList) { 466 list_for_each(tmp2, &tcon->openFileList) {
454 netfile = list_entry(tmp2, struct cifsFileInfo, 467 netfile = list_entry(tmp2, struct cifsFileInfo,
diff --git a/fs/cifs/nterr.c b/fs/cifs/nterr.c
index 819fd994b121..b6023c646123 100644
--- a/fs/cifs/nterr.c
+++ b/fs/cifs/nterr.c
@@ -31,7 +31,7 @@ const struct nt_err_code_struct nt_errs[] = {
31 {"NT_STATUS_INVALID_INFO_CLASS", NT_STATUS_INVALID_INFO_CLASS}, 31 {"NT_STATUS_INVALID_INFO_CLASS", NT_STATUS_INVALID_INFO_CLASS},
32 {"NT_STATUS_INFO_LENGTH_MISMATCH", NT_STATUS_INFO_LENGTH_MISMATCH}, 32 {"NT_STATUS_INFO_LENGTH_MISMATCH", NT_STATUS_INFO_LENGTH_MISMATCH},
33 {"NT_STATUS_ACCESS_VIOLATION", NT_STATUS_ACCESS_VIOLATION}, 33 {"NT_STATUS_ACCESS_VIOLATION", NT_STATUS_ACCESS_VIOLATION},
34 {"STATUS_BUFFER_OVERFLOW", STATUS_BUFFER_OVERFLOW}, 34 {"NT_STATUS_BUFFER_OVERFLOW", NT_STATUS_BUFFER_OVERFLOW},
35 {"NT_STATUS_IN_PAGE_ERROR", NT_STATUS_IN_PAGE_ERROR}, 35 {"NT_STATUS_IN_PAGE_ERROR", NT_STATUS_IN_PAGE_ERROR},
36 {"NT_STATUS_PAGEFILE_QUOTA", NT_STATUS_PAGEFILE_QUOTA}, 36 {"NT_STATUS_PAGEFILE_QUOTA", NT_STATUS_PAGEFILE_QUOTA},
37 {"NT_STATUS_INVALID_HANDLE", NT_STATUS_INVALID_HANDLE}, 37 {"NT_STATUS_INVALID_HANDLE", NT_STATUS_INVALID_HANDLE},
@@ -681,7 +681,7 @@ const struct nt_err_code_struct nt_errs[] = {
681 NT_STATUS_QUOTA_LIST_INCONSISTENT}, 681 NT_STATUS_QUOTA_LIST_INCONSISTENT},
682 {"NT_STATUS_FILE_IS_OFFLINE", NT_STATUS_FILE_IS_OFFLINE}, 682 {"NT_STATUS_FILE_IS_OFFLINE", NT_STATUS_FILE_IS_OFFLINE},
683 {"NT_STATUS_NO_MORE_ENTRIES", NT_STATUS_NO_MORE_ENTRIES}, 683 {"NT_STATUS_NO_MORE_ENTRIES", NT_STATUS_NO_MORE_ENTRIES},
684 {"STATUS_MORE_ENTRIES", STATUS_MORE_ENTRIES}, 684 {"NT_STATUS_MORE_ENTRIES", NT_STATUS_MORE_ENTRIES},
685 {"STATUS_SOME_UNMAPPED", STATUS_SOME_UNMAPPED}, 685 {"NT_STATUS_SOME_UNMAPPED", NT_STATUS_SOME_UNMAPPED},
686 {NULL, 0} 686 {NULL, 0}
687}; 687};
diff --git a/fs/cifs/nterr.h b/fs/cifs/nterr.h
index 257267367d41..7a0eae5ae7c9 100644
--- a/fs/cifs/nterr.h
+++ b/fs/cifs/nterr.h
@@ -35,18 +35,20 @@ struct nt_err_code_struct {
35extern const struct nt_err_code_struct nt_errs[]; 35extern const struct nt_err_code_struct nt_errs[];
36 36
37/* Win32 Status codes. */ 37/* Win32 Status codes. */
38#define STATUS_MORE_ENTRIES 0x0105 38#define NT_STATUS_MORE_ENTRIES 0x0105
39#define ERROR_INVALID_PARAMETER 0x0057 39#define NT_ERROR_INVALID_PARAMETER 0x0057
40#define ERROR_INSUFFICIENT_BUFFER 0x007a 40#define NT_ERROR_INSUFFICIENT_BUFFER 0x007a
41#define STATUS_1804 0x070c 41#define NT_STATUS_1804 0x070c
42#define STATUS_NOTIFY_ENUM_DIR 0x010c 42#define NT_STATUS_NOTIFY_ENUM_DIR 0x010c
43 43
44/* Win32 Error codes extracted using a loop in smbclient then printing a 44/*
45 netmon sniff to a file. */ 45 * Win32 Error codes extracted using a loop in smbclient then printing a netmon
46 * sniff to a file.
47 */
46 48
47#define NT_STATUS_OK 0x0000 49#define NT_STATUS_OK 0x0000
48#define STATUS_SOME_UNMAPPED 0x0107 50#define NT_STATUS_SOME_UNMAPPED 0x0107
49#define STATUS_BUFFER_OVERFLOW 0x80000005 51#define NT_STATUS_BUFFER_OVERFLOW 0x80000005
50#define NT_STATUS_NO_MORE_ENTRIES 0x8000001a 52#define NT_STATUS_NO_MORE_ENTRIES 0x8000001a
51#define NT_STATUS_MEDIA_CHANGED 0x8000001c 53#define NT_STATUS_MEDIA_CHANGED 0x8000001c
52#define NT_STATUS_END_OF_MEDIA 0x8000001e 54#define NT_STATUS_END_OF_MEDIA 0x8000001e
diff --git a/fs/cifs/ntlmssp.h b/fs/cifs/ntlmssp.h
index 5d52e4a3b1ed..848249fa120f 100644
--- a/fs/cifs/ntlmssp.h
+++ b/fs/cifs/ntlmssp.h
@@ -126,3 +126,13 @@ typedef struct _AUTHENTICATE_MESSAGE {
126 do not set the version is present flag */ 126 do not set the version is present flag */
127 char UserString[0]; 127 char UserString[0];
128} __attribute__((packed)) AUTHENTICATE_MESSAGE, *PAUTHENTICATE_MESSAGE; 128} __attribute__((packed)) AUTHENTICATE_MESSAGE, *PAUTHENTICATE_MESSAGE;
129
130/*
131 * Size of the session key (crypto key encrypted with the password
132 */
133
134int decode_ntlmssp_challenge(char *bcc_ptr, int blob_len, struct cifs_ses *ses);
135void build_ntlmssp_negotiate_blob(unsigned char *pbuffer, struct cifs_ses *ses);
136int build_ntlmssp_auth_blob(unsigned char *pbuffer, u16 *buflen,
137 struct cifs_ses *ses,
138 const struct nls_table *nls_cp);
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c
index a4217f02fab2..d87f82678bc7 100644
--- a/fs/cifs/readdir.c
+++ b/fs/cifs/readdir.c
@@ -193,7 +193,7 @@ cifs_std_info_to_fattr(struct cifs_fattr *fattr, FIND_FILE_STANDARD_INFO *info,
193 we try to do FindFirst on (NTFS) directory symlinks */ 193 we try to do FindFirst on (NTFS) directory symlinks */
194/* 194/*
195int get_symlink_reparse_path(char *full_path, struct cifs_sb_info *cifs_sb, 195int get_symlink_reparse_path(char *full_path, struct cifs_sb_info *cifs_sb,
196 int xid) 196 unsigned int xid)
197{ 197{
198 __u16 fid; 198 __u16 fid;
199 int len; 199 int len;
@@ -220,7 +220,7 @@ int get_symlink_reparse_path(char *full_path, struct cifs_sb_info *cifs_sb,
220} 220}
221 */ 221 */
222 222
223static int initiate_cifs_search(const int xid, struct file *file) 223static int initiate_cifs_search(const unsigned int xid, struct file *file)
224{ 224{
225 __u16 search_flags; 225 __u16 search_flags;
226 int rc = 0; 226 int rc = 0;
@@ -228,7 +228,7 @@ static int initiate_cifs_search(const int xid, struct file *file)
228 struct cifsFileInfo *cifsFile; 228 struct cifsFileInfo *cifsFile;
229 struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb); 229 struct cifs_sb_info *cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
230 struct tcon_link *tlink = NULL; 230 struct tcon_link *tlink = NULL;
231 struct cifs_tcon *pTcon; 231 struct cifs_tcon *tcon;
232 232
233 if (file->private_data == NULL) { 233 if (file->private_data == NULL) {
234 tlink = cifs_sb_tlink(cifs_sb); 234 tlink = cifs_sb_tlink(cifs_sb);
@@ -242,10 +242,10 @@ static int initiate_cifs_search(const int xid, struct file *file)
242 } 242 }
243 file->private_data = cifsFile; 243 file->private_data = cifsFile;
244 cifsFile->tlink = cifs_get_tlink(tlink); 244 cifsFile->tlink = cifs_get_tlink(tlink);
245 pTcon = tlink_tcon(tlink); 245 tcon = tlink_tcon(tlink);
246 } else { 246 } else {
247 cifsFile = file->private_data; 247 cifsFile = file->private_data;
248 pTcon = tlink_tcon(cifsFile->tlink); 248 tcon = tlink_tcon(cifsFile->tlink);
249 } 249 }
250 250
251 cifsFile->invalidHandle = true; 251 cifsFile->invalidHandle = true;
@@ -262,11 +262,11 @@ static int initiate_cifs_search(const int xid, struct file *file)
262ffirst_retry: 262ffirst_retry:
263 /* test for Unix extensions */ 263 /* test for Unix extensions */
264 /* but now check for them on the share/mount not on the SMB session */ 264 /* but now check for them on the share/mount not on the SMB session */
265/* if (pTcon->ses->capabilities & CAP_UNIX) { */ 265 /* if (cap_unix(tcon->ses) { */
266 if (pTcon->unix_ext) 266 if (tcon->unix_ext)
267 cifsFile->srch_inf.info_level = SMB_FIND_FILE_UNIX; 267 cifsFile->srch_inf.info_level = SMB_FIND_FILE_UNIX;
268 else if ((pTcon->ses->capabilities & 268 else if ((tcon->ses->capabilities &
269 (CAP_NT_SMBS | CAP_NT_FIND)) == 0) { 269 tcon->ses->server->vals->cap_nt_find) == 0) {
270 cifsFile->srch_inf.info_level = SMB_FIND_FILE_INFO_STANDARD; 270 cifsFile->srch_inf.info_level = SMB_FIND_FILE_INFO_STANDARD;
271 } else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) { 271 } else if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_SERVER_INUM) {
272 cifsFile->srch_inf.info_level = SMB_FIND_FILE_ID_FULL_DIR_INFO; 272 cifsFile->srch_inf.info_level = SMB_FIND_FILE_ID_FULL_DIR_INFO;
@@ -278,7 +278,7 @@ ffirst_retry:
278 if (backup_cred(cifs_sb)) 278 if (backup_cred(cifs_sb))
279 search_flags |= CIFS_SEARCH_BACKUP_SEARCH; 279 search_flags |= CIFS_SEARCH_BACKUP_SEARCH;
280 280
281 rc = CIFSFindFirst(xid, pTcon, full_path, cifs_sb->local_nls, 281 rc = CIFSFindFirst(xid, tcon, full_path, cifs_sb->local_nls,
282 &cifsFile->netfid, search_flags, &cifsFile->srch_inf, 282 &cifsFile->netfid, search_flags, &cifsFile->srch_inf,
283 cifs_sb->mnt_cifs_flags & 283 cifs_sb->mnt_cifs_flags &
284 CIFS_MOUNT_MAP_SPECIAL_CHR, CIFS_DIR_SEP(cifs_sb)); 284 CIFS_MOUNT_MAP_SPECIAL_CHR, CIFS_DIR_SEP(cifs_sb));
@@ -507,7 +507,7 @@ static int cifs_save_resume_key(const char *current_entry,
507 assume that they are located in the findfirst return buffer.*/ 507 assume that they are located in the findfirst return buffer.*/
508/* We start counting in the buffer with entry 2 and increment for every 508/* We start counting in the buffer with entry 2 and increment for every
509 entry (do not increment for . or .. entry) */ 509 entry (do not increment for . or .. entry) */
510static int find_cifs_entry(const int xid, struct cifs_tcon *pTcon, 510static int find_cifs_entry(const unsigned int xid, struct cifs_tcon *pTcon,
511 struct file *file, char **ppCurrentEntry, int *num_to_ret) 511 struct file *file, char **ppCurrentEntry, int *num_to_ret)
512{ 512{
513 __u16 search_flags; 513 __u16 search_flags;
@@ -721,7 +721,8 @@ static int cifs_filldir(char *find_entry, struct file *file, filldir_t filldir,
721int cifs_readdir(struct file *file, void *direntry, filldir_t filldir) 721int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
722{ 722{
723 int rc = 0; 723 int rc = 0;
724 int xid, i; 724 unsigned int xid;
725 int i;
725 struct cifs_tcon *pTcon; 726 struct cifs_tcon *pTcon;
726 struct cifsFileInfo *cifsFile = NULL; 727 struct cifsFileInfo *cifsFile = NULL;
727 char *current_entry; 728 char *current_entry;
@@ -730,7 +731,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
730 char *end_of_smb; 731 char *end_of_smb;
731 unsigned int max_len; 732 unsigned int max_len;
732 733
733 xid = GetXid(); 734 xid = get_xid();
734 735
735 /* 736 /*
736 * Ensure FindFirst doesn't fail before doing filldir() for '.' and 737 * Ensure FindFirst doesn't fail before doing filldir() for '.' and
@@ -768,7 +769,7 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
768 769
769 if (file->private_data == NULL) { 770 if (file->private_data == NULL) {
770 rc = -EINVAL; 771 rc = -EINVAL;
771 FreeXid(xid); 772 free_xid(xid);
772 return rc; 773 return rc;
773 } 774 }
774 cifsFile = file->private_data; 775 cifsFile = file->private_data;
@@ -840,6 +841,6 @@ int cifs_readdir(struct file *file, void *direntry, filldir_t filldir)
840 } /* end switch */ 841 } /* end switch */
841 842
842rddir2_exit: 843rddir2_exit:
843 FreeXid(xid); 844 free_xid(xid);
844 return rc; 845 return rc;
845} 846}
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index 551d0c2b9736..382c06d01b38 100644
--- a/fs/cifs/sess.c
+++ b/fs/cifs/sess.c
@@ -364,7 +364,7 @@ static int decode_ascii_ssetup(char **pbcc_area, __u16 bleft,
364 return rc; 364 return rc;
365} 365}
366 366
367static int decode_ntlmssp_challenge(char *bcc_ptr, int blob_len, 367int decode_ntlmssp_challenge(char *bcc_ptr, int blob_len,
368 struct cifs_ses *ses) 368 struct cifs_ses *ses)
369{ 369{
370 unsigned int tioffset; /* challenge message target info area */ 370 unsigned int tioffset; /* challenge message target info area */
@@ -415,7 +415,7 @@ static int decode_ntlmssp_challenge(char *bcc_ptr, int blob_len,
415 415
416/* We do not malloc the blob, it is passed in pbuffer, because 416/* We do not malloc the blob, it is passed in pbuffer, because
417 it is fixed size, and small, making this approach cleaner */ 417 it is fixed size, and small, making this approach cleaner */
418static void build_ntlmssp_negotiate_blob(unsigned char *pbuffer, 418void build_ntlmssp_negotiate_blob(unsigned char *pbuffer,
419 struct cifs_ses *ses) 419 struct cifs_ses *ses)
420{ 420{
421 NEGOTIATE_MESSAGE *sec_blob = (NEGOTIATE_MESSAGE *)pbuffer; 421 NEGOTIATE_MESSAGE *sec_blob = (NEGOTIATE_MESSAGE *)pbuffer;
@@ -451,7 +451,7 @@ static void build_ntlmssp_negotiate_blob(unsigned char *pbuffer,
451/* We do not malloc the blob, it is passed in pbuffer, because its 451/* We do not malloc the blob, it is passed in pbuffer, because its
452 maximum possible size is fixed and small, making this approach cleaner. 452 maximum possible size is fixed and small, making this approach cleaner.
453 This function returns the length of the data in the blob */ 453 This function returns the length of the data in the blob */
454static int build_ntlmssp_auth_blob(unsigned char *pbuffer, 454int build_ntlmssp_auth_blob(unsigned char *pbuffer,
455 u16 *buflen, 455 u16 *buflen,
456 struct cifs_ses *ses, 456 struct cifs_ses *ses,
457 const struct nls_table *nls_cp) 457 const struct nls_table *nls_cp)
@@ -556,7 +556,7 @@ setup_ntlmv2_ret:
556} 556}
557 557
558int 558int
559CIFS_SessSetup(unsigned int xid, struct cifs_ses *ses, 559CIFS_SessSetup(const unsigned int xid, struct cifs_ses *ses,
560 const struct nls_table *nls_cp) 560 const struct nls_table *nls_cp)
561{ 561{
562 int rc = 0; 562 int rc = 0;
@@ -898,7 +898,7 @@ ssetup_ntlmssp_authenticate:
898 if (action & GUEST_LOGIN) 898 if (action & GUEST_LOGIN)
899 cFYI(1, "Guest login"); /* BB mark SesInfo struct? */ 899 cFYI(1, "Guest login"); /* BB mark SesInfo struct? */
900 ses->Suid = smb_buf->Uid; /* UID left in wire format (le) */ 900 ses->Suid = smb_buf->Uid; /* UID left in wire format (le) */
901 cFYI(1, "UID = %d ", ses->Suid); 901 cFYI(1, "UID = %llu ", ses->Suid);
902 /* response can have either 3 or 4 word count - Samba sends 3 */ 902 /* response can have either 3 or 4 word count - Samba sends 3 */
903 /* and lanman response is 3 */ 903 /* and lanman response is 3 */
904 bytes_remaining = get_bcc(smb_buf); 904 bytes_remaining = get_bcc(smb_buf);
@@ -938,7 +938,7 @@ ssetup_ntlmssp_authenticate:
938 938
939ssetup_exit: 939ssetup_exit:
940 if (spnego_key) { 940 if (spnego_key) {
941 key_revoke(spnego_key); 941 key_invalidate(spnego_key);
942 key_put(spnego_key); 942 key_put(spnego_key);
943 } 943 }
944 kfree(str_area); 944 kfree(str_area);
diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
index 6dec38f5522d..c40356d24c5c 100644
--- a/fs/cifs/smb1ops.c
+++ b/fs/cifs/smb1ops.c
@@ -101,7 +101,8 @@ cifs_find_mid(struct TCP_Server_Info *server, char *buffer)
101} 101}
102 102
103static void 103static void
104cifs_add_credits(struct TCP_Server_Info *server, const unsigned int add) 104cifs_add_credits(struct TCP_Server_Info *server, const unsigned int add,
105 const int optype)
105{ 106{
106 spin_lock(&server->req_lock); 107 spin_lock(&server->req_lock);
107 server->credits += add; 108 server->credits += add;
@@ -120,11 +121,17 @@ cifs_set_credits(struct TCP_Server_Info *server, const int val)
120} 121}
121 122
122static int * 123static int *
123cifs_get_credits_field(struct TCP_Server_Info *server) 124cifs_get_credits_field(struct TCP_Server_Info *server, const int optype)
124{ 125{
125 return &server->credits; 126 return &server->credits;
126} 127}
127 128
129static unsigned int
130cifs_get_credits(struct mid_q_entry *mid)
131{
132 return 1;
133}
134
128/* 135/*
129 * Find a free multiplex id (SMB mid). Otherwise there could be 136 * Find a free multiplex id (SMB mid). Otherwise there could be
130 * mid collisions which might cause problems, demultiplexing the 137 * mid collisions which might cause problems, demultiplexing the
@@ -213,14 +220,382 @@ cifs_get_next_mid(struct TCP_Server_Info *server)
213 return mid; 220 return mid;
214} 221}
215 222
223/*
224 return codes:
225 0 not a transact2, or all data present
226 >0 transact2 with that much data missing
227 -EINVAL invalid transact2
228 */
229static int
230check2ndT2(char *buf)
231{
232 struct smb_hdr *pSMB = (struct smb_hdr *)buf;
233 struct smb_t2_rsp *pSMBt;
234 int remaining;
235 __u16 total_data_size, data_in_this_rsp;
236
237 if (pSMB->Command != SMB_COM_TRANSACTION2)
238 return 0;
239
240 /* check for plausible wct, bcc and t2 data and parm sizes */
241 /* check for parm and data offset going beyond end of smb */
242 if (pSMB->WordCount != 10) { /* coalesce_t2 depends on this */
243 cFYI(1, "invalid transact2 word count");
244 return -EINVAL;
245 }
246
247 pSMBt = (struct smb_t2_rsp *)pSMB;
248
249 total_data_size = get_unaligned_le16(&pSMBt->t2_rsp.TotalDataCount);
250 data_in_this_rsp = get_unaligned_le16(&pSMBt->t2_rsp.DataCount);
251
252 if (total_data_size == data_in_this_rsp)
253 return 0;
254 else if (total_data_size < data_in_this_rsp) {
255 cFYI(1, "total data %d smaller than data in frame %d",
256 total_data_size, data_in_this_rsp);
257 return -EINVAL;
258 }
259
260 remaining = total_data_size - data_in_this_rsp;
261
262 cFYI(1, "missing %d bytes from transact2, check next response",
263 remaining);
264 if (total_data_size > CIFSMaxBufSize) {
265 cERROR(1, "TotalDataSize %d is over maximum buffer %d",
266 total_data_size, CIFSMaxBufSize);
267 return -EINVAL;
268 }
269 return remaining;
270}
271
272static int
273coalesce_t2(char *second_buf, struct smb_hdr *target_hdr)
274{
275 struct smb_t2_rsp *pSMBs = (struct smb_t2_rsp *)second_buf;
276 struct smb_t2_rsp *pSMBt = (struct smb_t2_rsp *)target_hdr;
277 char *data_area_of_tgt;
278 char *data_area_of_src;
279 int remaining;
280 unsigned int byte_count, total_in_tgt;
281 __u16 tgt_total_cnt, src_total_cnt, total_in_src;
282
283 src_total_cnt = get_unaligned_le16(&pSMBs->t2_rsp.TotalDataCount);
284 tgt_total_cnt = get_unaligned_le16(&pSMBt->t2_rsp.TotalDataCount);
285
286 if (tgt_total_cnt != src_total_cnt)
287 cFYI(1, "total data count of primary and secondary t2 differ "
288 "source=%hu target=%hu", src_total_cnt, tgt_total_cnt);
289
290 total_in_tgt = get_unaligned_le16(&pSMBt->t2_rsp.DataCount);
291
292 remaining = tgt_total_cnt - total_in_tgt;
293
294 if (remaining < 0) {
295 cFYI(1, "Server sent too much data. tgt_total_cnt=%hu "
296 "total_in_tgt=%hu", tgt_total_cnt, total_in_tgt);
297 return -EPROTO;
298 }
299
300 if (remaining == 0) {
301 /* nothing to do, ignore */
302 cFYI(1, "no more data remains");
303 return 0;
304 }
305
306 total_in_src = get_unaligned_le16(&pSMBs->t2_rsp.DataCount);
307 if (remaining < total_in_src)
308 cFYI(1, "transact2 2nd response contains too much data");
309
310 /* find end of first SMB data area */
311 data_area_of_tgt = (char *)&pSMBt->hdr.Protocol +
312 get_unaligned_le16(&pSMBt->t2_rsp.DataOffset);
313
314 /* validate target area */
315 data_area_of_src = (char *)&pSMBs->hdr.Protocol +
316 get_unaligned_le16(&pSMBs->t2_rsp.DataOffset);
317
318 data_area_of_tgt += total_in_tgt;
319
320 total_in_tgt += total_in_src;
321 /* is the result too big for the field? */
322 if (total_in_tgt > USHRT_MAX) {
323 cFYI(1, "coalesced DataCount too large (%u)", total_in_tgt);
324 return -EPROTO;
325 }
326 put_unaligned_le16(total_in_tgt, &pSMBt->t2_rsp.DataCount);
327
328 /* fix up the BCC */
329 byte_count = get_bcc(target_hdr);
330 byte_count += total_in_src;
331 /* is the result too big for the field? */
332 if (byte_count > USHRT_MAX) {
333 cFYI(1, "coalesced BCC too large (%u)", byte_count);
334 return -EPROTO;
335 }
336 put_bcc(byte_count, target_hdr);
337
338 byte_count = be32_to_cpu(target_hdr->smb_buf_length);
339 byte_count += total_in_src;
340 /* don't allow buffer to overflow */
341 if (byte_count > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) {
342 cFYI(1, "coalesced BCC exceeds buffer size (%u)", byte_count);
343 return -ENOBUFS;
344 }
345 target_hdr->smb_buf_length = cpu_to_be32(byte_count);
346
347 /* copy second buffer into end of first buffer */
348 memcpy(data_area_of_tgt, data_area_of_src, total_in_src);
349
350 if (remaining != total_in_src) {
351 /* more responses to go */
352 cFYI(1, "waiting for more secondary responses");
353 return 1;
354 }
355
356 /* we are done */
357 cFYI(1, "found the last secondary response");
358 return 0;
359}
360
361static bool
362cifs_check_trans2(struct mid_q_entry *mid, struct TCP_Server_Info *server,
363 char *buf, int malformed)
364{
365 if (malformed)
366 return false;
367 if (check2ndT2(buf) <= 0)
368 return false;
369 mid->multiRsp = true;
370 if (mid->resp_buf) {
371 /* merge response - fix up 1st*/
372 malformed = coalesce_t2(buf, mid->resp_buf);
373 if (malformed > 0)
374 return true;
375 /* All parts received or packet is malformed. */
376 mid->multiEnd = true;
377 dequeue_mid(mid, malformed);
378 return true;
379 }
380 if (!server->large_buf) {
381 /*FIXME: switch to already allocated largebuf?*/
382 cERROR(1, "1st trans2 resp needs bigbuf");
383 } else {
384 /* Have first buffer */
385 mid->resp_buf = buf;
386 mid->large_buf = true;
387 server->bigbuf = NULL;
388 }
389 return true;
390}
391
392static bool
393cifs_need_neg(struct TCP_Server_Info *server)
394{
395 return server->maxBuf == 0;
396}
397
398static int
399cifs_negotiate(const unsigned int xid, struct cifs_ses *ses)
400{
401 int rc;
402 rc = CIFSSMBNegotiate(xid, ses);
403 if (rc == -EAGAIN) {
404 /* retry only once on 1st time connection */
405 set_credits(ses->server, 1);
406 rc = CIFSSMBNegotiate(xid, ses);
407 if (rc == -EAGAIN)
408 rc = -EHOSTDOWN;
409 }
410 return rc;
411}
412
413static void
414cifs_qfs_tcon(const unsigned int xid, struct cifs_tcon *tcon)
415{
416 CIFSSMBQFSDeviceInfo(xid, tcon);
417 CIFSSMBQFSAttributeInfo(xid, tcon);
418}
419
420static int
421cifs_is_path_accessible(const unsigned int xid, struct cifs_tcon *tcon,
422 struct cifs_sb_info *cifs_sb, const char *full_path)
423{
424 int rc;
425 FILE_ALL_INFO *file_info;
426
427 file_info = kmalloc(sizeof(FILE_ALL_INFO), GFP_KERNEL);
428 if (file_info == NULL)
429 return -ENOMEM;
430
431 rc = CIFSSMBQPathInfo(xid, tcon, full_path, file_info,
432 0 /* not legacy */, cifs_sb->local_nls,
433 cifs_sb->mnt_cifs_flags &
434 CIFS_MOUNT_MAP_SPECIAL_CHR);
435
436 if (rc == -EOPNOTSUPP || rc == -EINVAL)
437 rc = SMBQueryInformation(xid, tcon, full_path, file_info,
438 cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
439 CIFS_MOUNT_MAP_SPECIAL_CHR);
440 kfree(file_info);
441 return rc;
442}
443
444static int
445cifs_query_path_info(const unsigned int xid, struct cifs_tcon *tcon,
446 struct cifs_sb_info *cifs_sb, const char *full_path,
447 FILE_ALL_INFO *data, bool *adjustTZ)
448{
449 int rc;
450
451 /* could do find first instead but this returns more info */
452 rc = CIFSSMBQPathInfo(xid, tcon, full_path, data, 0 /* not legacy */,
453 cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
454 CIFS_MOUNT_MAP_SPECIAL_CHR);
455 /*
456 * BB optimize code so we do not make the above call when server claims
457 * no NT SMB support and the above call failed at least once - set flag
458 * in tcon or mount.
459 */
460 if ((rc == -EOPNOTSUPP) || (rc == -EINVAL)) {
461 rc = SMBQueryInformation(xid, tcon, full_path, data,
462 cifs_sb->local_nls,
463 cifs_sb->mnt_cifs_flags &
464 CIFS_MOUNT_MAP_SPECIAL_CHR);
465 *adjustTZ = true;
466 }
467 return rc;
468}
469
470static int
471cifs_get_srv_inum(const unsigned int xid, struct cifs_tcon *tcon,
472 struct cifs_sb_info *cifs_sb, const char *full_path,
473 u64 *uniqueid, FILE_ALL_INFO *data)
474{
475 /*
476 * We can not use the IndexNumber field by default from Windows or
477 * Samba (in ALL_INFO buf) but we can request it explicitly. The SNIA
478 * CIFS spec claims that this value is unique within the scope of a
479 * share, and the windows docs hint that it's actually unique
480 * per-machine.
481 *
482 * There may be higher info levels that work but are there Windows
483 * server or network appliances for which IndexNumber field is not
484 * guaranteed unique?
485 */
486 return CIFSGetSrvInodeNumber(xid, tcon, full_path, uniqueid,
487 cifs_sb->local_nls,
488 cifs_sb->mnt_cifs_flags &
489 CIFS_MOUNT_MAP_SPECIAL_CHR);
490}
491
492static char *
493cifs_build_path_to_root(struct smb_vol *vol, struct cifs_sb_info *cifs_sb,
494 struct cifs_tcon *tcon)
495{
496 int pplen = vol->prepath ? strlen(vol->prepath) : 0;
497 int dfsplen;
498 char *full_path = NULL;
499
500 /* if no prefix path, simply set path to the root of share to "" */
501 if (pplen == 0) {
502 full_path = kzalloc(1, GFP_KERNEL);
503 return full_path;
504 }
505
506 if (tcon->Flags & SMB_SHARE_IS_IN_DFS)
507 dfsplen = strnlen(tcon->treeName, MAX_TREE_SIZE + 1);
508 else
509 dfsplen = 0;
510
511 full_path = kmalloc(dfsplen + pplen + 1, GFP_KERNEL);
512 if (full_path == NULL)
513 return full_path;
514
515 if (dfsplen)
516 strncpy(full_path, tcon->treeName, dfsplen);
517 strncpy(full_path + dfsplen, vol->prepath, pplen);
518 convert_delimiter(full_path, CIFS_DIR_SEP(cifs_sb));
519 full_path[dfsplen + pplen] = 0; /* add trailing null */
520 return full_path;
521}
522
523static void
524cifs_clear_stats(struct cifs_tcon *tcon)
525{
526#ifdef CONFIG_CIFS_STATS
527 atomic_set(&tcon->stats.cifs_stats.num_writes, 0);
528 atomic_set(&tcon->stats.cifs_stats.num_reads, 0);
529 atomic_set(&tcon->stats.cifs_stats.num_flushes, 0);
530 atomic_set(&tcon->stats.cifs_stats.num_oplock_brks, 0);
531 atomic_set(&tcon->stats.cifs_stats.num_opens, 0);
532 atomic_set(&tcon->stats.cifs_stats.num_posixopens, 0);
533 atomic_set(&tcon->stats.cifs_stats.num_posixmkdirs, 0);
534 atomic_set(&tcon->stats.cifs_stats.num_closes, 0);
535 atomic_set(&tcon->stats.cifs_stats.num_deletes, 0);
536 atomic_set(&tcon->stats.cifs_stats.num_mkdirs, 0);
537 atomic_set(&tcon->stats.cifs_stats.num_rmdirs, 0);
538 atomic_set(&tcon->stats.cifs_stats.num_renames, 0);
539 atomic_set(&tcon->stats.cifs_stats.num_t2renames, 0);
540 atomic_set(&tcon->stats.cifs_stats.num_ffirst, 0);
541 atomic_set(&tcon->stats.cifs_stats.num_fnext, 0);
542 atomic_set(&tcon->stats.cifs_stats.num_fclose, 0);
543 atomic_set(&tcon->stats.cifs_stats.num_hardlinks, 0);
544 atomic_set(&tcon->stats.cifs_stats.num_symlinks, 0);
545 atomic_set(&tcon->stats.cifs_stats.num_locks, 0);
546 atomic_set(&tcon->stats.cifs_stats.num_acl_get, 0);
547 atomic_set(&tcon->stats.cifs_stats.num_acl_set, 0);
548#endif
549}
550
551static void
552cifs_print_stats(struct seq_file *m, struct cifs_tcon *tcon)
553{
554#ifdef CONFIG_CIFS_STATS
555 seq_printf(m, " Oplocks breaks: %d",
556 atomic_read(&tcon->stats.cifs_stats.num_oplock_brks));
557 seq_printf(m, "\nReads: %d Bytes: %llu",
558 atomic_read(&tcon->stats.cifs_stats.num_reads),
559 (long long)(tcon->bytes_read));
560 seq_printf(m, "\nWrites: %d Bytes: %llu",
561 atomic_read(&tcon->stats.cifs_stats.num_writes),
562 (long long)(tcon->bytes_written));
563 seq_printf(m, "\nFlushes: %d",
564 atomic_read(&tcon->stats.cifs_stats.num_flushes));
565 seq_printf(m, "\nLocks: %d HardLinks: %d Symlinks: %d",
566 atomic_read(&tcon->stats.cifs_stats.num_locks),
567 atomic_read(&tcon->stats.cifs_stats.num_hardlinks),
568 atomic_read(&tcon->stats.cifs_stats.num_symlinks));
569 seq_printf(m, "\nOpens: %d Closes: %d Deletes: %d",
570 atomic_read(&tcon->stats.cifs_stats.num_opens),
571 atomic_read(&tcon->stats.cifs_stats.num_closes),
572 atomic_read(&tcon->stats.cifs_stats.num_deletes));
573 seq_printf(m, "\nPosix Opens: %d Posix Mkdirs: %d",
574 atomic_read(&tcon->stats.cifs_stats.num_posixopens),
575 atomic_read(&tcon->stats.cifs_stats.num_posixmkdirs));
576 seq_printf(m, "\nMkdirs: %d Rmdirs: %d",
577 atomic_read(&tcon->stats.cifs_stats.num_mkdirs),
578 atomic_read(&tcon->stats.cifs_stats.num_rmdirs));
579 seq_printf(m, "\nRenames: %d T2 Renames %d",
580 atomic_read(&tcon->stats.cifs_stats.num_renames),
581 atomic_read(&tcon->stats.cifs_stats.num_t2renames));
582 seq_printf(m, "\nFindFirst: %d FNext %d FClose %d",
583 atomic_read(&tcon->stats.cifs_stats.num_ffirst),
584 atomic_read(&tcon->stats.cifs_stats.num_fnext),
585 atomic_read(&tcon->stats.cifs_stats.num_fclose));
586#endif
587}
588
216struct smb_version_operations smb1_operations = { 589struct smb_version_operations smb1_operations = {
217 .send_cancel = send_nt_cancel, 590 .send_cancel = send_nt_cancel,
218 .compare_fids = cifs_compare_fids, 591 .compare_fids = cifs_compare_fids,
219 .setup_request = cifs_setup_request, 592 .setup_request = cifs_setup_request,
593 .setup_async_request = cifs_setup_async_request,
220 .check_receive = cifs_check_receive, 594 .check_receive = cifs_check_receive,
221 .add_credits = cifs_add_credits, 595 .add_credits = cifs_add_credits,
222 .set_credits = cifs_set_credits, 596 .set_credits = cifs_set_credits,
223 .get_credits_field = cifs_get_credits_field, 597 .get_credits_field = cifs_get_credits_field,
598 .get_credits = cifs_get_credits,
224 .get_next_mid = cifs_get_next_mid, 599 .get_next_mid = cifs_get_next_mid,
225 .read_data_offset = cifs_read_data_offset, 600 .read_data_offset = cifs_read_data_offset,
226 .read_data_length = cifs_read_data_length, 601 .read_data_length = cifs_read_data_length,
@@ -228,7 +603,23 @@ struct smb_version_operations smb1_operations = {
228 .find_mid = cifs_find_mid, 603 .find_mid = cifs_find_mid,
229 .check_message = checkSMB, 604 .check_message = checkSMB,
230 .dump_detail = cifs_dump_detail, 605 .dump_detail = cifs_dump_detail,
606 .clear_stats = cifs_clear_stats,
607 .print_stats = cifs_print_stats,
231 .is_oplock_break = is_valid_oplock_break, 608 .is_oplock_break = is_valid_oplock_break,
609 .check_trans2 = cifs_check_trans2,
610 .need_neg = cifs_need_neg,
611 .negotiate = cifs_negotiate,
612 .sess_setup = CIFS_SessSetup,
613 .logoff = CIFSSMBLogoff,
614 .tree_connect = CIFSTCon,
615 .tree_disconnect = CIFSSMBTDis,
616 .get_dfs_refer = CIFSGetDFSRefer,
617 .qfs_tcon = cifs_qfs_tcon,
618 .is_path_accessible = cifs_is_path_accessible,
619 .query_path_info = cifs_query_path_info,
620 .get_srv_inum = cifs_get_srv_inum,
621 .build_path_to_root = cifs_build_path_to_root,
622 .echo = CIFSSMBEcho,
232}; 623};
233 624
234struct smb_version_values smb1_values = { 625struct smb_version_values smb1_values = {
@@ -240,4 +631,8 @@ struct smb_version_values smb1_values = {
240 .header_size = sizeof(struct smb_hdr), 631 .header_size = sizeof(struct smb_hdr),
241 .max_header_size = MAX_CIFS_HDR_SIZE, 632 .max_header_size = MAX_CIFS_HDR_SIZE,
242 .read_rsp_size = sizeof(READ_RSP), 633 .read_rsp_size = sizeof(READ_RSP),
634 .lock_cmd = cpu_to_le16(SMB_COM_LOCKING_ANDX),
635 .cap_unix = CAP_UNIX,
636 .cap_nt_find = CAP_NT_SMBS | CAP_NT_FIND,
637 .cap_large_files = CAP_LARGE_FILES,
243}; 638};
diff --git a/fs/cifs/smb2glob.h b/fs/cifs/smb2glob.h
new file mode 100644
index 000000000000..33c1d89090c0
--- /dev/null
+++ b/fs/cifs/smb2glob.h
@@ -0,0 +1,44 @@
1/*
2 * fs/cifs/smb2glob.h
3 *
4 * Definitions for various global variables and structures
5 *
6 * Copyright (C) International Business Machines Corp., 2002, 2011
7 * Etersoft, 2012
8 * Author(s): Steve French (sfrench@us.ibm.com)
9 * Jeremy Allison (jra@samba.org)
10 * Pavel Shilovsky (pshilovsky@samba.org) 2012
11 *
12 * This library is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License as published
14 * by the Free Software Foundation; either version 2.1 of the License, or
15 * (at your option) any later version.
16 *
17 * This library is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
20 * the GNU Lesser General Public License for more details.
21 *
22 */
23#ifndef _SMB2_GLOB_H
24#define _SMB2_GLOB_H
25
26/*
27 *****************************************************************
28 * Constants go here
29 *****************************************************************
30 */
31
32/*
33 * Identifiers for functions that use the open, operation, close pattern
34 * in smb2inode.c:smb2_open_op_close()
35 */
36#define SMB2_OP_SET_DELETE 1
37#define SMB2_OP_SET_INFO 2
38#define SMB2_OP_QUERY_INFO 3
39#define SMB2_OP_QUERY_DIR 4
40#define SMB2_OP_MKDIR 5
41#define SMB2_OP_RENAME 6
42#define SMB2_OP_DELETE 7
43
44#endif /* _SMB2_GLOB_H */
diff --git a/fs/cifs/smb2inode.c b/fs/cifs/smb2inode.c
new file mode 100644
index 000000000000..1ba5c405315c
--- /dev/null
+++ b/fs/cifs/smb2inode.c
@@ -0,0 +1,124 @@
1/*
2 * fs/cifs/smb2inode.c
3 *
4 * Copyright (C) International Business Machines Corp., 2002, 2011
5 * Etersoft, 2012
6 * Author(s): Pavel Shilovsky (pshilovsky@samba.org),
7 * Steve French (sfrench@us.ibm.com)
8 *
9 * This library is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as published
11 * by the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
17 * the GNU Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23#include <linux/fs.h>
24#include <linux/stat.h>
25#include <linux/slab.h>
26#include <linux/pagemap.h>
27#include <asm/div64.h>
28#include "cifsfs.h"
29#include "cifspdu.h"
30#include "cifsglob.h"
31#include "cifsproto.h"
32#include "cifs_debug.h"
33#include "cifs_fs_sb.h"
34#include "cifs_unicode.h"
35#include "fscache.h"
36#include "smb2glob.h"
37#include "smb2pdu.h"
38#include "smb2proto.h"
39
40static int
41smb2_open_op_close(const unsigned int xid, struct cifs_tcon *tcon,
42 struct cifs_sb_info *cifs_sb, const char *full_path,
43 __u32 desired_access, __u32 create_disposition,
44 __u32 file_attributes, __u32 create_options,
45 void *data, int command)
46{
47 int rc, tmprc = 0;
48 u64 persistent_fid, volatile_fid;
49 __le16 *utf16_path;
50
51 utf16_path = cifs_convert_path_to_utf16(full_path, cifs_sb);
52 if (!utf16_path)
53 return -ENOMEM;
54
55 rc = SMB2_open(xid, tcon, utf16_path, &persistent_fid, &volatile_fid,
56 desired_access, create_disposition, file_attributes,
57 create_options);
58 if (rc) {
59 kfree(utf16_path);
60 return rc;
61 }
62
63 switch (command) {
64 case SMB2_OP_DELETE:
65 break;
66 case SMB2_OP_QUERY_INFO:
67 tmprc = SMB2_query_info(xid, tcon, persistent_fid,
68 volatile_fid,
69 (struct smb2_file_all_info *)data);
70 break;
71 case SMB2_OP_MKDIR:
72 /*
73 * Directories are created through parameters in the
74 * SMB2_open() call.
75 */
76 break;
77 default:
78 cERROR(1, "Invalid command");
79 break;
80 }
81
82 rc = SMB2_close(xid, tcon, persistent_fid, volatile_fid);
83 if (tmprc)
84 rc = tmprc;
85 kfree(utf16_path);
86 return rc;
87}
88
89static void
90move_smb2_info_to_cifs(FILE_ALL_INFO *dst, struct smb2_file_all_info *src)
91{
92 memcpy(dst, src, (size_t)(&src->CurrentByteOffset) - (size_t)src);
93 dst->CurrentByteOffset = src->CurrentByteOffset;
94 dst->Mode = src->Mode;
95 dst->AlignmentRequirement = src->AlignmentRequirement;
96 dst->IndexNumber1 = 0; /* we don't use it */
97}
98
99int
100smb2_query_path_info(const unsigned int xid, struct cifs_tcon *tcon,
101 struct cifs_sb_info *cifs_sb, const char *full_path,
102 FILE_ALL_INFO *data, bool *adjust_tz)
103{
104 int rc;
105 struct smb2_file_all_info *smb2_data;
106
107 *adjust_tz = false;
108
109 smb2_data = kzalloc(sizeof(struct smb2_file_all_info) + MAX_NAME * 2,
110 GFP_KERNEL);
111 if (smb2_data == NULL)
112 return -ENOMEM;
113
114 rc = smb2_open_op_close(xid, tcon, cifs_sb, full_path,
115 FILE_READ_ATTRIBUTES, FILE_OPEN, 0, 0,
116 smb2_data, SMB2_OP_QUERY_INFO);
117 if (rc)
118 goto out;
119
120 move_smb2_info_to_cifs(data, smb2_data);
121out:
122 kfree(smb2_data);
123 return rc;
124}
diff --git a/fs/cifs/smb2maperror.c b/fs/cifs/smb2maperror.c
new file mode 100644
index 000000000000..be41478acc05
--- /dev/null
+++ b/fs/cifs/smb2maperror.c
@@ -0,0 +1,2477 @@
1/*
2 * fs/smb2/smb2maperror.c
3 *
4 * Functions which do error mapping of SMB2 status codes to POSIX errors
5 *
6 * Copyright (C) International Business Machines Corp., 2009
7 * Author(s): Steve French (sfrench@us.ibm.com)
8 *
9 * This library is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as published
11 * by the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
17 * the GNU Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23#include <linux/errno.h>
24#include "cifsglob.h"
25#include "cifs_debug.h"
26#include "smb2pdu.h"
27#include "smb2proto.h"
28#include "smb2status.h"
29
30struct status_to_posix_error {
31 __le32 smb2_status;
32 int posix_error;
33 char *status_string;
34};
35
36static const struct status_to_posix_error smb2_error_map_table[] = {
37 {STATUS_SUCCESS, 0, "STATUS_SUCCESS"},
38 {STATUS_WAIT_0, 0, "STATUS_WAIT_0"},
39 {STATUS_WAIT_1, -EIO, "STATUS_WAIT_1"},
40 {STATUS_WAIT_2, -EIO, "STATUS_WAIT_2"},
41 {STATUS_WAIT_3, -EIO, "STATUS_WAIT_3"},
42 {STATUS_WAIT_63, -EIO, "STATUS_WAIT_63"},
43 {STATUS_ABANDONED, -EIO, "STATUS_ABANDONED"},
44 {STATUS_ABANDONED_WAIT_0, -EIO, "STATUS_ABANDONED_WAIT_0"},
45 {STATUS_ABANDONED_WAIT_63, -EIO, "STATUS_ABANDONED_WAIT_63"},
46 {STATUS_USER_APC, -EIO, "STATUS_USER_APC"},
47 {STATUS_KERNEL_APC, -EIO, "STATUS_KERNEL_APC"},
48 {STATUS_ALERTED, -EIO, "STATUS_ALERTED"},
49 {STATUS_TIMEOUT, -ETIMEDOUT, "STATUS_TIMEOUT"},
50 {STATUS_PENDING, -EIO, "STATUS_PENDING"},
51 {STATUS_REPARSE, -EIO, "STATUS_REPARSE"},
52 {STATUS_MORE_ENTRIES, -EIO, "STATUS_MORE_ENTRIES"},
53 {STATUS_NOT_ALL_ASSIGNED, -EIO, "STATUS_NOT_ALL_ASSIGNED"},
54 {STATUS_SOME_NOT_MAPPED, -EIO, "STATUS_SOME_NOT_MAPPED"},
55 {STATUS_OPLOCK_BREAK_IN_PROGRESS, -EIO,
56 "STATUS_OPLOCK_BREAK_IN_PROGRESS"},
57 {STATUS_VOLUME_MOUNTED, -EIO, "STATUS_VOLUME_MOUNTED"},
58 {STATUS_RXACT_COMMITTED, -EIO, "STATUS_RXACT_COMMITTED"},
59 {STATUS_NOTIFY_CLEANUP, -EIO, "STATUS_NOTIFY_CLEANUP"},
60 {STATUS_NOTIFY_ENUM_DIR, -EIO, "STATUS_NOTIFY_ENUM_DIR"},
61 {STATUS_NO_QUOTAS_FOR_ACCOUNT, -EIO, "STATUS_NO_QUOTAS_FOR_ACCOUNT"},
62 {STATUS_PRIMARY_TRANSPORT_CONNECT_FAILED, -EIO,
63 "STATUS_PRIMARY_TRANSPORT_CONNECT_FAILED"},
64 {STATUS_PAGE_FAULT_TRANSITION, -EIO, "STATUS_PAGE_FAULT_TRANSITION"},
65 {STATUS_PAGE_FAULT_DEMAND_ZERO, -EIO, "STATUS_PAGE_FAULT_DEMAND_ZERO"},
66 {STATUS_PAGE_FAULT_COPY_ON_WRITE, -EIO,
67 "STATUS_PAGE_FAULT_COPY_ON_WRITE"},
68 {STATUS_PAGE_FAULT_GUARD_PAGE, -EIO, "STATUS_PAGE_FAULT_GUARD_PAGE"},
69 {STATUS_PAGE_FAULT_PAGING_FILE, -EIO, "STATUS_PAGE_FAULT_PAGING_FILE"},
70 {STATUS_CACHE_PAGE_LOCKED, -EIO, "STATUS_CACHE_PAGE_LOCKED"},
71 {STATUS_CRASH_DUMP, -EIO, "STATUS_CRASH_DUMP"},
72 {STATUS_BUFFER_ALL_ZEROS, -EIO, "STATUS_BUFFER_ALL_ZEROS"},
73 {STATUS_REPARSE_OBJECT, -EIO, "STATUS_REPARSE_OBJECT"},
74 {STATUS_RESOURCE_REQUIREMENTS_CHANGED, -EIO,
75 "STATUS_RESOURCE_REQUIREMENTS_CHANGED"},
76 {STATUS_TRANSLATION_COMPLETE, -EIO, "STATUS_TRANSLATION_COMPLETE"},
77 {STATUS_DS_MEMBERSHIP_EVALUATED_LOCALLY, -EIO,
78 "STATUS_DS_MEMBERSHIP_EVALUATED_LOCALLY"},
79 {STATUS_NOTHING_TO_TERMINATE, -EIO, "STATUS_NOTHING_TO_TERMINATE"},
80 {STATUS_PROCESS_NOT_IN_JOB, -EIO, "STATUS_PROCESS_NOT_IN_JOB"},
81 {STATUS_PROCESS_IN_JOB, -EIO, "STATUS_PROCESS_IN_JOB"},
82 {STATUS_VOLSNAP_HIBERNATE_READY, -EIO,
83 "STATUS_VOLSNAP_HIBERNATE_READY"},
84 {STATUS_FSFILTER_OP_COMPLETED_SUCCESSFULLY, -EIO,
85 "STATUS_FSFILTER_OP_COMPLETED_SUCCESSFULLY"},
86 {STATUS_INTERRUPT_VECTOR_ALREADY_CONNECTED, -EIO,
87 "STATUS_INTERRUPT_VECTOR_ALREADY_CONNECTED"},
88 {STATUS_INTERRUPT_STILL_CONNECTED, -EIO,
89 "STATUS_INTERRUPT_STILL_CONNECTED"},
90 {STATUS_PROCESS_CLONED, -EIO, "STATUS_PROCESS_CLONED"},
91 {STATUS_FILE_LOCKED_WITH_ONLY_READERS, -EIO,
92 "STATUS_FILE_LOCKED_WITH_ONLY_READERS"},
93 {STATUS_FILE_LOCKED_WITH_WRITERS, -EIO,
94 "STATUS_FILE_LOCKED_WITH_WRITERS"},
95 {STATUS_RESOURCEMANAGER_READ_ONLY, -EROFS,
96 "STATUS_RESOURCEMANAGER_READ_ONLY"},
97 {STATUS_WAIT_FOR_OPLOCK, -EIO, "STATUS_WAIT_FOR_OPLOCK"},
98 {DBG_EXCEPTION_HANDLED, -EIO, "DBG_EXCEPTION_HANDLED"},
99 {DBG_CONTINUE, -EIO, "DBG_CONTINUE"},
100 {STATUS_FLT_IO_COMPLETE, -EIO, "STATUS_FLT_IO_COMPLETE"},
101 {STATUS_OBJECT_NAME_EXISTS, -EIO, "STATUS_OBJECT_NAME_EXISTS"},
102 {STATUS_THREAD_WAS_SUSPENDED, -EIO, "STATUS_THREAD_WAS_SUSPENDED"},
103 {STATUS_WORKING_SET_LIMIT_RANGE, -EIO,
104 "STATUS_WORKING_SET_LIMIT_RANGE"},
105 {STATUS_IMAGE_NOT_AT_BASE, -EIO, "STATUS_IMAGE_NOT_AT_BASE"},
106 {STATUS_RXACT_STATE_CREATED, -EIO, "STATUS_RXACT_STATE_CREATED"},
107 {STATUS_SEGMENT_NOTIFICATION, -EIO, "STATUS_SEGMENT_NOTIFICATION"},
108 {STATUS_LOCAL_USER_SESSION_KEY, -EIO, "STATUS_LOCAL_USER_SESSION_KEY"},
109 {STATUS_BAD_CURRENT_DIRECTORY, -EIO, "STATUS_BAD_CURRENT_DIRECTORY"},
110 {STATUS_SERIAL_MORE_WRITES, -EIO, "STATUS_SERIAL_MORE_WRITES"},
111 {STATUS_REGISTRY_RECOVERED, -EIO, "STATUS_REGISTRY_RECOVERED"},
112 {STATUS_FT_READ_RECOVERY_FROM_BACKUP, -EIO,
113 "STATUS_FT_READ_RECOVERY_FROM_BACKUP"},
114 {STATUS_FT_WRITE_RECOVERY, -EIO, "STATUS_FT_WRITE_RECOVERY"},
115 {STATUS_SERIAL_COUNTER_TIMEOUT, -ETIMEDOUT,
116 "STATUS_SERIAL_COUNTER_TIMEOUT"},
117 {STATUS_NULL_LM_PASSWORD, -EIO, "STATUS_NULL_LM_PASSWORD"},
118 {STATUS_IMAGE_MACHINE_TYPE_MISMATCH, -EIO,
119 "STATUS_IMAGE_MACHINE_TYPE_MISMATCH"},
120 {STATUS_RECEIVE_PARTIAL, -EIO, "STATUS_RECEIVE_PARTIAL"},
121 {STATUS_RECEIVE_EXPEDITED, -EIO, "STATUS_RECEIVE_EXPEDITED"},
122 {STATUS_RECEIVE_PARTIAL_EXPEDITED, -EIO,
123 "STATUS_RECEIVE_PARTIAL_EXPEDITED"},
124 {STATUS_EVENT_DONE, -EIO, "STATUS_EVENT_DONE"},
125 {STATUS_EVENT_PENDING, -EIO, "STATUS_EVENT_PENDING"},
126 {STATUS_CHECKING_FILE_SYSTEM, -EIO, "STATUS_CHECKING_FILE_SYSTEM"},
127 {STATUS_FATAL_APP_EXIT, -EIO, "STATUS_FATAL_APP_EXIT"},
128 {STATUS_PREDEFINED_HANDLE, -EIO, "STATUS_PREDEFINED_HANDLE"},
129 {STATUS_WAS_UNLOCKED, -EIO, "STATUS_WAS_UNLOCKED"},
130 {STATUS_SERVICE_NOTIFICATION, -EIO, "STATUS_SERVICE_NOTIFICATION"},
131 {STATUS_WAS_LOCKED, -EIO, "STATUS_WAS_LOCKED"},
132 {STATUS_LOG_HARD_ERROR, -EIO, "STATUS_LOG_HARD_ERROR"},
133 {STATUS_ALREADY_WIN32, -EIO, "STATUS_ALREADY_WIN32"},
134 {STATUS_WX86_UNSIMULATE, -EIO, "STATUS_WX86_UNSIMULATE"},
135 {STATUS_WX86_CONTINUE, -EIO, "STATUS_WX86_CONTINUE"},
136 {STATUS_WX86_SINGLE_STEP, -EIO, "STATUS_WX86_SINGLE_STEP"},
137 {STATUS_WX86_BREAKPOINT, -EIO, "STATUS_WX86_BREAKPOINT"},
138 {STATUS_WX86_EXCEPTION_CONTINUE, -EIO,
139 "STATUS_WX86_EXCEPTION_CONTINUE"},
140 {STATUS_WX86_EXCEPTION_LASTCHANCE, -EIO,
141 "STATUS_WX86_EXCEPTION_LASTCHANCE"},
142 {STATUS_WX86_EXCEPTION_CHAIN, -EIO, "STATUS_WX86_EXCEPTION_CHAIN"},
143 {STATUS_IMAGE_MACHINE_TYPE_MISMATCH_EXE, -EIO,
144 "STATUS_IMAGE_MACHINE_TYPE_MISMATCH_EXE"},
145 {STATUS_NO_YIELD_PERFORMED, -EIO, "STATUS_NO_YIELD_PERFORMED"},
146 {STATUS_TIMER_RESUME_IGNORED, -EIO, "STATUS_TIMER_RESUME_IGNORED"},
147 {STATUS_ARBITRATION_UNHANDLED, -EIO, "STATUS_ARBITRATION_UNHANDLED"},
148 {STATUS_CARDBUS_NOT_SUPPORTED, -ENOSYS, "STATUS_CARDBUS_NOT_SUPPORTED"},
149 {STATUS_WX86_CREATEWX86TIB, -EIO, "STATUS_WX86_CREATEWX86TIB"},
150 {STATUS_MP_PROCESSOR_MISMATCH, -EIO, "STATUS_MP_PROCESSOR_MISMATCH"},
151 {STATUS_HIBERNATED, -EIO, "STATUS_HIBERNATED"},
152 {STATUS_RESUME_HIBERNATION, -EIO, "STATUS_RESUME_HIBERNATION"},
153 {STATUS_FIRMWARE_UPDATED, -EIO, "STATUS_FIRMWARE_UPDATED"},
154 {STATUS_DRIVERS_LEAKING_LOCKED_PAGES, -EIO,
155 "STATUS_DRIVERS_LEAKING_LOCKED_PAGES"},
156 {STATUS_MESSAGE_RETRIEVED, -EIO, "STATUS_MESSAGE_RETRIEVED"},
157 {STATUS_SYSTEM_POWERSTATE_TRANSITION, -EIO,
158 "STATUS_SYSTEM_POWERSTATE_TRANSITION"},
159 {STATUS_ALPC_CHECK_COMPLETION_LIST, -EIO,
160 "STATUS_ALPC_CHECK_COMPLETION_LIST"},
161 {STATUS_SYSTEM_POWERSTATE_COMPLEX_TRANSITION, -EIO,
162 "STATUS_SYSTEM_POWERSTATE_COMPLEX_TRANSITION"},
163 {STATUS_ACCESS_AUDIT_BY_POLICY, -EIO, "STATUS_ACCESS_AUDIT_BY_POLICY"},
164 {STATUS_ABANDON_HIBERFILE, -EIO, "STATUS_ABANDON_HIBERFILE"},
165 {STATUS_BIZRULES_NOT_ENABLED, -EIO, "STATUS_BIZRULES_NOT_ENABLED"},
166 {STATUS_WAKE_SYSTEM, -EIO, "STATUS_WAKE_SYSTEM"},
167 {STATUS_DS_SHUTTING_DOWN, -EIO, "STATUS_DS_SHUTTING_DOWN"},
168 {DBG_REPLY_LATER, -EIO, "DBG_REPLY_LATER"},
169 {DBG_UNABLE_TO_PROVIDE_HANDLE, -EIO, "DBG_UNABLE_TO_PROVIDE_HANDLE"},
170 {DBG_TERMINATE_THREAD, -EIO, "DBG_TERMINATE_THREAD"},
171 {DBG_TERMINATE_PROCESS, -EIO, "DBG_TERMINATE_PROCESS"},
172 {DBG_CONTROL_C, -EIO, "DBG_CONTROL_C"},
173 {DBG_PRINTEXCEPTION_C, -EIO, "DBG_PRINTEXCEPTION_C"},
174 {DBG_RIPEXCEPTION, -EIO, "DBG_RIPEXCEPTION"},
175 {DBG_CONTROL_BREAK, -EIO, "DBG_CONTROL_BREAK"},
176 {DBG_COMMAND_EXCEPTION, -EIO, "DBG_COMMAND_EXCEPTION"},
177 {RPC_NT_UUID_LOCAL_ONLY, -EIO, "RPC_NT_UUID_LOCAL_ONLY"},
178 {RPC_NT_SEND_INCOMPLETE, -EIO, "RPC_NT_SEND_INCOMPLETE"},
179 {STATUS_CTX_CDM_CONNECT, -EIO, "STATUS_CTX_CDM_CONNECT"},
180 {STATUS_CTX_CDM_DISCONNECT, -EIO, "STATUS_CTX_CDM_DISCONNECT"},
181 {STATUS_SXS_RELEASE_ACTIVATION_CONTEXT, -EIO,
182 "STATUS_SXS_RELEASE_ACTIVATION_CONTEXT"},
183 {STATUS_RECOVERY_NOT_NEEDED, -EIO, "STATUS_RECOVERY_NOT_NEEDED"},
184 {STATUS_RM_ALREADY_STARTED, -EIO, "STATUS_RM_ALREADY_STARTED"},
185 {STATUS_LOG_NO_RESTART, -EIO, "STATUS_LOG_NO_RESTART"},
186 {STATUS_VIDEO_DRIVER_DEBUG_REPORT_REQUEST, -EIO,
187 "STATUS_VIDEO_DRIVER_DEBUG_REPORT_REQUEST"},
188 {STATUS_GRAPHICS_PARTIAL_DATA_POPULATED, -EIO,
189 "STATUS_GRAPHICS_PARTIAL_DATA_POPULATED"},
190 {STATUS_GRAPHICS_DRIVER_MISMATCH, -EIO,
191 "STATUS_GRAPHICS_DRIVER_MISMATCH"},
192 {STATUS_GRAPHICS_MODE_NOT_PINNED, -EIO,
193 "STATUS_GRAPHICS_MODE_NOT_PINNED"},
194 {STATUS_GRAPHICS_NO_PREFERRED_MODE, -EIO,
195 "STATUS_GRAPHICS_NO_PREFERRED_MODE"},
196 {STATUS_GRAPHICS_DATASET_IS_EMPTY, -EIO,
197 "STATUS_GRAPHICS_DATASET_IS_EMPTY"},
198 {STATUS_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET, -EIO,
199 "STATUS_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET"},
200 {STATUS_GRAPHICS_PATH_CONTENT_GEOMETRY_TRANSFORMATION_NOT_PINNED, -EIO,
201 "STATUS_GRAPHICS_PATH_CONTENT_GEOMETRY_TRANSFORMATION_NOT_PINNED"},
202 {STATUS_GRAPHICS_UNKNOWN_CHILD_STATUS, -EIO,
203 "STATUS_GRAPHICS_UNKNOWN_CHILD_STATUS"},
204 {STATUS_GRAPHICS_LEADLINK_START_DEFERRED, -EIO,
205 "STATUS_GRAPHICS_LEADLINK_START_DEFERRED"},
206 {STATUS_GRAPHICS_POLLING_TOO_FREQUENTLY, -EIO,
207 "STATUS_GRAPHICS_POLLING_TOO_FREQUENTLY"},
208 {STATUS_GRAPHICS_START_DEFERRED, -EIO,
209 "STATUS_GRAPHICS_START_DEFERRED"},
210 {STATUS_NDIS_INDICATION_REQUIRED, -EIO,
211 "STATUS_NDIS_INDICATION_REQUIRED"},
212 {STATUS_GUARD_PAGE_VIOLATION, -EIO, "STATUS_GUARD_PAGE_VIOLATION"},
213 {STATUS_DATATYPE_MISALIGNMENT, -EIO, "STATUS_DATATYPE_MISALIGNMENT"},
214 {STATUS_BREAKPOINT, -EIO, "STATUS_BREAKPOINT"},
215 {STATUS_SINGLE_STEP, -EIO, "STATUS_SINGLE_STEP"},
216 {STATUS_BUFFER_OVERFLOW, -EIO, "STATUS_BUFFER_OVERFLOW"},
217 {STATUS_NO_MORE_FILES, -EIO, "STATUS_NO_MORE_FILES"},
218 {STATUS_WAKE_SYSTEM_DEBUGGER, -EIO, "STATUS_WAKE_SYSTEM_DEBUGGER"},
219 {STATUS_HANDLES_CLOSED, -EIO, "STATUS_HANDLES_CLOSED"},
220 {STATUS_NO_INHERITANCE, -EIO, "STATUS_NO_INHERITANCE"},
221 {STATUS_GUID_SUBSTITUTION_MADE, -EIO, "STATUS_GUID_SUBSTITUTION_MADE"},
222 {STATUS_PARTIAL_COPY, -EIO, "STATUS_PARTIAL_COPY"},
223 {STATUS_DEVICE_PAPER_EMPTY, -EIO, "STATUS_DEVICE_PAPER_EMPTY"},
224 {STATUS_DEVICE_POWERED_OFF, -EIO, "STATUS_DEVICE_POWERED_OFF"},
225 {STATUS_DEVICE_OFF_LINE, -EIO, "STATUS_DEVICE_OFF_LINE"},
226 {STATUS_DEVICE_BUSY, -EBUSY, "STATUS_DEVICE_BUSY"},
227 {STATUS_NO_MORE_EAS, -EIO, "STATUS_NO_MORE_EAS"},
228 {STATUS_INVALID_EA_NAME, -EINVAL, "STATUS_INVALID_EA_NAME"},
229 {STATUS_EA_LIST_INCONSISTENT, -EIO, "STATUS_EA_LIST_INCONSISTENT"},
230 {STATUS_INVALID_EA_FLAG, -EINVAL, "STATUS_INVALID_EA_FLAG"},
231 {STATUS_VERIFY_REQUIRED, -EIO, "STATUS_VERIFY_REQUIRED"},
232 {STATUS_EXTRANEOUS_INFORMATION, -EIO, "STATUS_EXTRANEOUS_INFORMATION"},
233 {STATUS_RXACT_COMMIT_NECESSARY, -EIO, "STATUS_RXACT_COMMIT_NECESSARY"},
234 {STATUS_NO_MORE_ENTRIES, -EIO, "STATUS_NO_MORE_ENTRIES"},
235 {STATUS_FILEMARK_DETECTED, -EIO, "STATUS_FILEMARK_DETECTED"},
236 {STATUS_MEDIA_CHANGED, -EIO, "STATUS_MEDIA_CHANGED"},
237 {STATUS_BUS_RESET, -EIO, "STATUS_BUS_RESET"},
238 {STATUS_END_OF_MEDIA, -EIO, "STATUS_END_OF_MEDIA"},
239 {STATUS_BEGINNING_OF_MEDIA, -EIO, "STATUS_BEGINNING_OF_MEDIA"},
240 {STATUS_MEDIA_CHECK, -EIO, "STATUS_MEDIA_CHECK"},
241 {STATUS_SETMARK_DETECTED, -EIO, "STATUS_SETMARK_DETECTED"},
242 {STATUS_NO_DATA_DETECTED, -EIO, "STATUS_NO_DATA_DETECTED"},
243 {STATUS_REDIRECTOR_HAS_OPEN_HANDLES, -EIO,
244 "STATUS_REDIRECTOR_HAS_OPEN_HANDLES"},
245 {STATUS_SERVER_HAS_OPEN_HANDLES, -EIO,
246 "STATUS_SERVER_HAS_OPEN_HANDLES"},
247 {STATUS_ALREADY_DISCONNECTED, -EIO, "STATUS_ALREADY_DISCONNECTED"},
248 {STATUS_LONGJUMP, -EIO, "STATUS_LONGJUMP"},
249 {STATUS_CLEANER_CARTRIDGE_INSTALLED, -EIO,
250 "STATUS_CLEANER_CARTRIDGE_INSTALLED"},
251 {STATUS_PLUGPLAY_QUERY_VETOED, -EIO, "STATUS_PLUGPLAY_QUERY_VETOED"},
252 {STATUS_UNWIND_CONSOLIDATE, -EIO, "STATUS_UNWIND_CONSOLIDATE"},
253 {STATUS_REGISTRY_HIVE_RECOVERED, -EIO,
254 "STATUS_REGISTRY_HIVE_RECOVERED"},
255 {STATUS_DLL_MIGHT_BE_INSECURE, -EIO, "STATUS_DLL_MIGHT_BE_INSECURE"},
256 {STATUS_DLL_MIGHT_BE_INCOMPATIBLE, -EIO,
257 "STATUS_DLL_MIGHT_BE_INCOMPATIBLE"},
258 {STATUS_STOPPED_ON_SYMLINK, -EOPNOTSUPP, "STATUS_STOPPED_ON_SYMLINK"},
259 {STATUS_DEVICE_REQUIRES_CLEANING, -EIO,
260 "STATUS_DEVICE_REQUIRES_CLEANING"},
261 {STATUS_DEVICE_DOOR_OPEN, -EIO, "STATUS_DEVICE_DOOR_OPEN"},
262 {STATUS_DATA_LOST_REPAIR, -EIO, "STATUS_DATA_LOST_REPAIR"},
263 {DBG_EXCEPTION_NOT_HANDLED, -EIO, "DBG_EXCEPTION_NOT_HANDLED"},
264 {STATUS_CLUSTER_NODE_ALREADY_UP, -EIO,
265 "STATUS_CLUSTER_NODE_ALREADY_UP"},
266 {STATUS_CLUSTER_NODE_ALREADY_DOWN, -EIO,
267 "STATUS_CLUSTER_NODE_ALREADY_DOWN"},
268 {STATUS_CLUSTER_NETWORK_ALREADY_ONLINE, -EIO,
269 "STATUS_CLUSTER_NETWORK_ALREADY_ONLINE"},
270 {STATUS_CLUSTER_NETWORK_ALREADY_OFFLINE, -EIO,
271 "STATUS_CLUSTER_NETWORK_ALREADY_OFFLINE"},
272 {STATUS_CLUSTER_NODE_ALREADY_MEMBER, -EIO,
273 "STATUS_CLUSTER_NODE_ALREADY_MEMBER"},
274 {STATUS_COULD_NOT_RESIZE_LOG, -EIO, "STATUS_COULD_NOT_RESIZE_LOG"},
275 {STATUS_NO_TXF_METADATA, -EIO, "STATUS_NO_TXF_METADATA"},
276 {STATUS_CANT_RECOVER_WITH_HANDLE_OPEN, -EIO,
277 "STATUS_CANT_RECOVER_WITH_HANDLE_OPEN"},
278 {STATUS_TXF_METADATA_ALREADY_PRESENT, -EIO,
279 "STATUS_TXF_METADATA_ALREADY_PRESENT"},
280 {STATUS_TRANSACTION_SCOPE_CALLBACKS_NOT_SET, -EIO,
281 "STATUS_TRANSACTION_SCOPE_CALLBACKS_NOT_SET"},
282 {STATUS_VIDEO_HUNG_DISPLAY_DRIVER_THREAD_RECOVERED, -EIO,
283 "STATUS_VIDEO_HUNG_DISPLAY_DRIVER_THREAD_RECOVERED"},
284 {STATUS_FLT_BUFFER_TOO_SMALL, -ENOBUFS, "STATUS_FLT_BUFFER_TOO_SMALL"},
285 {STATUS_FVE_PARTIAL_METADATA, -EIO, "STATUS_FVE_PARTIAL_METADATA"},
286 {STATUS_UNSUCCESSFUL, -EIO, "STATUS_UNSUCCESSFUL"},
287 {STATUS_NOT_IMPLEMENTED, -ENOSYS, "STATUS_NOT_IMPLEMENTED"},
288 {STATUS_INVALID_INFO_CLASS, -EIO, "STATUS_INVALID_INFO_CLASS"},
289 {STATUS_INFO_LENGTH_MISMATCH, -EIO, "STATUS_INFO_LENGTH_MISMATCH"},
290 {STATUS_ACCESS_VIOLATION, -EACCES, "STATUS_ACCESS_VIOLATION"},
291 {STATUS_IN_PAGE_ERROR, -EFAULT, "STATUS_IN_PAGE_ERROR"},
292 {STATUS_PAGEFILE_QUOTA, -EDQUOT, "STATUS_PAGEFILE_QUOTA"},
293 {STATUS_INVALID_HANDLE, -EBADF, "STATUS_INVALID_HANDLE"},
294 {STATUS_BAD_INITIAL_STACK, -EIO, "STATUS_BAD_INITIAL_STACK"},
295 {STATUS_BAD_INITIAL_PC, -EIO, "STATUS_BAD_INITIAL_PC"},
296 {STATUS_INVALID_CID, -EIO, "STATUS_INVALID_CID"},
297 {STATUS_TIMER_NOT_CANCELED, -EIO, "STATUS_TIMER_NOT_CANCELED"},
298 {STATUS_INVALID_PARAMETER, -EINVAL, "STATUS_INVALID_PARAMETER"},
299 {STATUS_NO_SUCH_DEVICE, -ENODEV, "STATUS_NO_SUCH_DEVICE"},
300 {STATUS_NO_SUCH_FILE, -ENOENT, "STATUS_NO_SUCH_FILE"},
301 {STATUS_INVALID_DEVICE_REQUEST, -EIO, "STATUS_INVALID_DEVICE_REQUEST"},
302 {STATUS_END_OF_FILE, -ENODATA, "STATUS_END_OF_FILE"},
303 {STATUS_WRONG_VOLUME, -EIO, "STATUS_WRONG_VOLUME"},
304 {STATUS_NO_MEDIA_IN_DEVICE, -EIO, "STATUS_NO_MEDIA_IN_DEVICE"},
305 {STATUS_UNRECOGNIZED_MEDIA, -EIO, "STATUS_UNRECOGNIZED_MEDIA"},
306 {STATUS_NONEXISTENT_SECTOR, -EIO, "STATUS_NONEXISTENT_SECTOR"},
307 {STATUS_MORE_PROCESSING_REQUIRED, -EIO,
308 "STATUS_MORE_PROCESSING_REQUIRED"},
309 {STATUS_NO_MEMORY, -ENOMEM, "STATUS_NO_MEMORY"},
310 {STATUS_CONFLICTING_ADDRESSES, -EADDRINUSE,
311 "STATUS_CONFLICTING_ADDRESSES"},
312 {STATUS_NOT_MAPPED_VIEW, -EIO, "STATUS_NOT_MAPPED_VIEW"},
313 {STATUS_UNABLE_TO_FREE_VM, -EIO, "STATUS_UNABLE_TO_FREE_VM"},
314 {STATUS_UNABLE_TO_DELETE_SECTION, -EIO,
315 "STATUS_UNABLE_TO_DELETE_SECTION"},
316 {STATUS_INVALID_SYSTEM_SERVICE, -EIO, "STATUS_INVALID_SYSTEM_SERVICE"},
317 {STATUS_ILLEGAL_INSTRUCTION, -EIO, "STATUS_ILLEGAL_INSTRUCTION"},
318 {STATUS_INVALID_LOCK_SEQUENCE, -EIO, "STATUS_INVALID_LOCK_SEQUENCE"},
319 {STATUS_INVALID_VIEW_SIZE, -EIO, "STATUS_INVALID_VIEW_SIZE"},
320 {STATUS_INVALID_FILE_FOR_SECTION, -EIO,
321 "STATUS_INVALID_FILE_FOR_SECTION"},
322 {STATUS_ALREADY_COMMITTED, -EIO, "STATUS_ALREADY_COMMITTED"},
323 {STATUS_ACCESS_DENIED, -EACCES, "STATUS_ACCESS_DENIED"},
324 {STATUS_BUFFER_TOO_SMALL, -EIO, "STATUS_BUFFER_TOO_SMALL"},
325 {STATUS_OBJECT_TYPE_MISMATCH, -EIO, "STATUS_OBJECT_TYPE_MISMATCH"},
326 {STATUS_NONCONTINUABLE_EXCEPTION, -EIO,
327 "STATUS_NONCONTINUABLE_EXCEPTION"},
328 {STATUS_INVALID_DISPOSITION, -EIO, "STATUS_INVALID_DISPOSITION"},
329 {STATUS_UNWIND, -EIO, "STATUS_UNWIND"},
330 {STATUS_BAD_STACK, -EIO, "STATUS_BAD_STACK"},
331 {STATUS_INVALID_UNWIND_TARGET, -EIO, "STATUS_INVALID_UNWIND_TARGET"},
332 {STATUS_NOT_LOCKED, -EIO, "STATUS_NOT_LOCKED"},
333 {STATUS_PARITY_ERROR, -EIO, "STATUS_PARITY_ERROR"},
334 {STATUS_UNABLE_TO_DECOMMIT_VM, -EIO, "STATUS_UNABLE_TO_DECOMMIT_VM"},
335 {STATUS_NOT_COMMITTED, -EIO, "STATUS_NOT_COMMITTED"},
336 {STATUS_INVALID_PORT_ATTRIBUTES, -EIO,
337 "STATUS_INVALID_PORT_ATTRIBUTES"},
338 {STATUS_PORT_MESSAGE_TOO_LONG, -EIO, "STATUS_PORT_MESSAGE_TOO_LONG"},
339 {STATUS_INVALID_PARAMETER_MIX, -EINVAL, "STATUS_INVALID_PARAMETER_MIX"},
340 {STATUS_INVALID_QUOTA_LOWER, -EIO, "STATUS_INVALID_QUOTA_LOWER"},
341 {STATUS_DISK_CORRUPT_ERROR, -EIO, "STATUS_DISK_CORRUPT_ERROR"},
342 {STATUS_OBJECT_NAME_INVALID, -ENOENT, "STATUS_OBJECT_NAME_INVALID"},
343 {STATUS_OBJECT_NAME_NOT_FOUND, -ENOENT, "STATUS_OBJECT_NAME_NOT_FOUND"},
344 {STATUS_OBJECT_NAME_COLLISION, -EEXIST, "STATUS_OBJECT_NAME_COLLISION"},
345 {STATUS_PORT_DISCONNECTED, -EIO, "STATUS_PORT_DISCONNECTED"},
346 {STATUS_DEVICE_ALREADY_ATTACHED, -EIO,
347 "STATUS_DEVICE_ALREADY_ATTACHED"},
348 {STATUS_OBJECT_PATH_INVALID, -ENOTDIR, "STATUS_OBJECT_PATH_INVALID"},
349 {STATUS_OBJECT_PATH_NOT_FOUND, -ENOENT, "STATUS_OBJECT_PATH_NOT_FOUND"},
350 {STATUS_OBJECT_PATH_SYNTAX_BAD, -EIO, "STATUS_OBJECT_PATH_SYNTAX_BAD"},
351 {STATUS_DATA_OVERRUN, -EIO, "STATUS_DATA_OVERRUN"},
352 {STATUS_DATA_LATE_ERROR, -EIO, "STATUS_DATA_LATE_ERROR"},
353 {STATUS_DATA_ERROR, -EIO, "STATUS_DATA_ERROR"},
354 {STATUS_CRC_ERROR, -EIO, "STATUS_CRC_ERROR"},
355 {STATUS_SECTION_TOO_BIG, -EIO, "STATUS_SECTION_TOO_BIG"},
356 {STATUS_PORT_CONNECTION_REFUSED, -ECONNREFUSED,
357 "STATUS_PORT_CONNECTION_REFUSED"},
358 {STATUS_INVALID_PORT_HANDLE, -EIO, "STATUS_INVALID_PORT_HANDLE"},
359 {STATUS_SHARING_VIOLATION, -EBUSY, "STATUS_SHARING_VIOLATION"},
360 {STATUS_QUOTA_EXCEEDED, -EDQUOT, "STATUS_QUOTA_EXCEEDED"},
361 {STATUS_INVALID_PAGE_PROTECTION, -EIO,
362 "STATUS_INVALID_PAGE_PROTECTION"},
363 {STATUS_MUTANT_NOT_OWNED, -EIO, "STATUS_MUTANT_NOT_OWNED"},
364 {STATUS_SEMAPHORE_LIMIT_EXCEEDED, -EIO,
365 "STATUS_SEMAPHORE_LIMIT_EXCEEDED"},
366 {STATUS_PORT_ALREADY_SET, -EIO, "STATUS_PORT_ALREADY_SET"},
367 {STATUS_SECTION_NOT_IMAGE, -EIO, "STATUS_SECTION_NOT_IMAGE"},
368 {STATUS_SUSPEND_COUNT_EXCEEDED, -EIO, "STATUS_SUSPEND_COUNT_EXCEEDED"},
369 {STATUS_THREAD_IS_TERMINATING, -EIO, "STATUS_THREAD_IS_TERMINATING"},
370 {STATUS_BAD_WORKING_SET_LIMIT, -EIO, "STATUS_BAD_WORKING_SET_LIMIT"},
371 {STATUS_INCOMPATIBLE_FILE_MAP, -EIO, "STATUS_INCOMPATIBLE_FILE_MAP"},
372 {STATUS_SECTION_PROTECTION, -EIO, "STATUS_SECTION_PROTECTION"},
373 {STATUS_EAS_NOT_SUPPORTED, -EOPNOTSUPP, "STATUS_EAS_NOT_SUPPORTED"},
374 {STATUS_EA_TOO_LARGE, -EIO, "STATUS_EA_TOO_LARGE"},
375 {STATUS_NONEXISTENT_EA_ENTRY, -EIO, "STATUS_NONEXISTENT_EA_ENTRY"},
376 {STATUS_NO_EAS_ON_FILE, -ENODATA, "STATUS_NO_EAS_ON_FILE"},
377 {STATUS_EA_CORRUPT_ERROR, -EIO, "STATUS_EA_CORRUPT_ERROR"},
378 {STATUS_FILE_LOCK_CONFLICT, -EIO, "STATUS_FILE_LOCK_CONFLICT"},
379 {STATUS_LOCK_NOT_GRANTED, -EIO, "STATUS_LOCK_NOT_GRANTED"},
380 {STATUS_DELETE_PENDING, -ENOENT, "STATUS_DELETE_PENDING"},
381 {STATUS_CTL_FILE_NOT_SUPPORTED, -ENOSYS,
382 "STATUS_CTL_FILE_NOT_SUPPORTED"},
383 {STATUS_UNKNOWN_REVISION, -EIO, "STATUS_UNKNOWN_REVISION"},
384 {STATUS_REVISION_MISMATCH, -EIO, "STATUS_REVISION_MISMATCH"},
385 {STATUS_INVALID_OWNER, -EIO, "STATUS_INVALID_OWNER"},
386 {STATUS_INVALID_PRIMARY_GROUP, -EIO, "STATUS_INVALID_PRIMARY_GROUP"},
387 {STATUS_NO_IMPERSONATION_TOKEN, -EIO, "STATUS_NO_IMPERSONATION_TOKEN"},
388 {STATUS_CANT_DISABLE_MANDATORY, -EIO, "STATUS_CANT_DISABLE_MANDATORY"},
389 {STATUS_NO_LOGON_SERVERS, -EIO, "STATUS_NO_LOGON_SERVERS"},
390 {STATUS_NO_SUCH_LOGON_SESSION, -EIO, "STATUS_NO_SUCH_LOGON_SESSION"},
391 {STATUS_NO_SUCH_PRIVILEGE, -EIO, "STATUS_NO_SUCH_PRIVILEGE"},
392 {STATUS_PRIVILEGE_NOT_HELD, -EIO, "STATUS_PRIVILEGE_NOT_HELD"},
393 {STATUS_INVALID_ACCOUNT_NAME, -EIO, "STATUS_INVALID_ACCOUNT_NAME"},
394 {STATUS_USER_EXISTS, -EIO, "STATUS_USER_EXISTS"},
395 {STATUS_NO_SUCH_USER, -EIO, "STATUS_NO_SUCH_USER"},
396 {STATUS_GROUP_EXISTS, -EIO, "STATUS_GROUP_EXISTS"},
397 {STATUS_NO_SUCH_GROUP, -EIO, "STATUS_NO_SUCH_GROUP"},
398 {STATUS_MEMBER_IN_GROUP, -EIO, "STATUS_MEMBER_IN_GROUP"},
399 {STATUS_MEMBER_NOT_IN_GROUP, -EIO, "STATUS_MEMBER_NOT_IN_GROUP"},
400 {STATUS_LAST_ADMIN, -EIO, "STATUS_LAST_ADMIN"},
401 {STATUS_WRONG_PASSWORD, -EACCES, "STATUS_WRONG_PASSWORD"},
402 {STATUS_ILL_FORMED_PASSWORD, -EINVAL, "STATUS_ILL_FORMED_PASSWORD"},
403 {STATUS_PASSWORD_RESTRICTION, -EACCES, "STATUS_PASSWORD_RESTRICTION"},
404 {STATUS_LOGON_FAILURE, -EACCES, "STATUS_LOGON_FAILURE"},
405 {STATUS_ACCOUNT_RESTRICTION, -EACCES, "STATUS_ACCOUNT_RESTRICTION"},
406 {STATUS_INVALID_LOGON_HOURS, -EACCES, "STATUS_INVALID_LOGON_HOURS"},
407 {STATUS_INVALID_WORKSTATION, -EACCES, "STATUS_INVALID_WORKSTATION"},
408 {STATUS_PASSWORD_EXPIRED, -EKEYEXPIRED, "STATUS_PASSWORD_EXPIRED"},
409 {STATUS_ACCOUNT_DISABLED, -EKEYREVOKED, "STATUS_ACCOUNT_DISABLED"},
410 {STATUS_NONE_MAPPED, -EIO, "STATUS_NONE_MAPPED"},
411 {STATUS_TOO_MANY_LUIDS_REQUESTED, -EIO,
412 "STATUS_TOO_MANY_LUIDS_REQUESTED"},
413 {STATUS_LUIDS_EXHAUSTED, -EIO, "STATUS_LUIDS_EXHAUSTED"},
414 {STATUS_INVALID_SUB_AUTHORITY, -EIO, "STATUS_INVALID_SUB_AUTHORITY"},
415 {STATUS_INVALID_ACL, -EIO, "STATUS_INVALID_ACL"},
416 {STATUS_INVALID_SID, -EIO, "STATUS_INVALID_SID"},
417 {STATUS_INVALID_SECURITY_DESCR, -EIO, "STATUS_INVALID_SECURITY_DESCR"},
418 {STATUS_PROCEDURE_NOT_FOUND, -EIO, "STATUS_PROCEDURE_NOT_FOUND"},
419 {STATUS_INVALID_IMAGE_FORMAT, -EIO, "STATUS_INVALID_IMAGE_FORMAT"},
420 {STATUS_NO_TOKEN, -EIO, "STATUS_NO_TOKEN"},
421 {STATUS_BAD_INHERITANCE_ACL, -EIO, "STATUS_BAD_INHERITANCE_ACL"},
422 {STATUS_RANGE_NOT_LOCKED, -EIO, "STATUS_RANGE_NOT_LOCKED"},
423 {STATUS_DISK_FULL, -ENOSPC, "STATUS_DISK_FULL"},
424 {STATUS_SERVER_DISABLED, -EIO, "STATUS_SERVER_DISABLED"},
425 {STATUS_SERVER_NOT_DISABLED, -EIO, "STATUS_SERVER_NOT_DISABLED"},
426 {STATUS_TOO_MANY_GUIDS_REQUESTED, -EIO,
427 "STATUS_TOO_MANY_GUIDS_REQUESTED"},
428 {STATUS_GUIDS_EXHAUSTED, -EIO, "STATUS_GUIDS_EXHAUSTED"},
429 {STATUS_INVALID_ID_AUTHORITY, -EIO, "STATUS_INVALID_ID_AUTHORITY"},
430 {STATUS_AGENTS_EXHAUSTED, -EIO, "STATUS_AGENTS_EXHAUSTED"},
431 {STATUS_INVALID_VOLUME_LABEL, -EIO, "STATUS_INVALID_VOLUME_LABEL"},
432 {STATUS_SECTION_NOT_EXTENDED, -EIO, "STATUS_SECTION_NOT_EXTENDED"},
433 {STATUS_NOT_MAPPED_DATA, -EIO, "STATUS_NOT_MAPPED_DATA"},
434 {STATUS_RESOURCE_DATA_NOT_FOUND, -EIO,
435 "STATUS_RESOURCE_DATA_NOT_FOUND"},
436 {STATUS_RESOURCE_TYPE_NOT_FOUND, -EIO,
437 "STATUS_RESOURCE_TYPE_NOT_FOUND"},
438 {STATUS_RESOURCE_NAME_NOT_FOUND, -EIO,
439 "STATUS_RESOURCE_NAME_NOT_FOUND"},
440 {STATUS_ARRAY_BOUNDS_EXCEEDED, -EIO, "STATUS_ARRAY_BOUNDS_EXCEEDED"},
441 {STATUS_FLOAT_DENORMAL_OPERAND, -EIO, "STATUS_FLOAT_DENORMAL_OPERAND"},
442 {STATUS_FLOAT_DIVIDE_BY_ZERO, -EIO, "STATUS_FLOAT_DIVIDE_BY_ZERO"},
443 {STATUS_FLOAT_INEXACT_RESULT, -EIO, "STATUS_FLOAT_INEXACT_RESULT"},
444 {STATUS_FLOAT_INVALID_OPERATION, -EIO,
445 "STATUS_FLOAT_INVALID_OPERATION"},
446 {STATUS_FLOAT_OVERFLOW, -EIO, "STATUS_FLOAT_OVERFLOW"},
447 {STATUS_FLOAT_STACK_CHECK, -EIO, "STATUS_FLOAT_STACK_CHECK"},
448 {STATUS_FLOAT_UNDERFLOW, -EIO, "STATUS_FLOAT_UNDERFLOW"},
449 {STATUS_INTEGER_DIVIDE_BY_ZERO, -EIO, "STATUS_INTEGER_DIVIDE_BY_ZERO"},
450 {STATUS_INTEGER_OVERFLOW, -EIO, "STATUS_INTEGER_OVERFLOW"},
451 {STATUS_PRIVILEGED_INSTRUCTION, -EIO, "STATUS_PRIVILEGED_INSTRUCTION"},
452 {STATUS_TOO_MANY_PAGING_FILES, -EIO, "STATUS_TOO_MANY_PAGING_FILES"},
453 {STATUS_FILE_INVALID, -EIO, "STATUS_FILE_INVALID"},
454 {STATUS_ALLOTTED_SPACE_EXCEEDED, -EIO,
455 "STATUS_ALLOTTED_SPACE_EXCEEDED"},
456 {STATUS_INSUFFICIENT_RESOURCES, -EIO, "STATUS_INSUFFICIENT_RESOURCES"},
457 {STATUS_DFS_EXIT_PATH_FOUND, -EIO, "STATUS_DFS_EXIT_PATH_FOUND"},
458 {STATUS_DEVICE_DATA_ERROR, -EIO, "STATUS_DEVICE_DATA_ERROR"},
459 {STATUS_DEVICE_NOT_CONNECTED, -EIO, "STATUS_DEVICE_NOT_CONNECTED"},
460 {STATUS_DEVICE_POWER_FAILURE, -EIO, "STATUS_DEVICE_POWER_FAILURE"},
461 {STATUS_FREE_VM_NOT_AT_BASE, -EIO, "STATUS_FREE_VM_NOT_AT_BASE"},
462 {STATUS_MEMORY_NOT_ALLOCATED, -EFAULT, "STATUS_MEMORY_NOT_ALLOCATED"},
463 {STATUS_WORKING_SET_QUOTA, -EIO, "STATUS_WORKING_SET_QUOTA"},
464 {STATUS_MEDIA_WRITE_PROTECTED, -EROFS, "STATUS_MEDIA_WRITE_PROTECTED"},
465 {STATUS_DEVICE_NOT_READY, -EIO, "STATUS_DEVICE_NOT_READY"},
466 {STATUS_INVALID_GROUP_ATTRIBUTES, -EIO,
467 "STATUS_INVALID_GROUP_ATTRIBUTES"},
468 {STATUS_BAD_IMPERSONATION_LEVEL, -EIO,
469 "STATUS_BAD_IMPERSONATION_LEVEL"},
470 {STATUS_CANT_OPEN_ANONYMOUS, -EIO, "STATUS_CANT_OPEN_ANONYMOUS"},
471 {STATUS_BAD_VALIDATION_CLASS, -EIO, "STATUS_BAD_VALIDATION_CLASS"},
472 {STATUS_BAD_TOKEN_TYPE, -EIO, "STATUS_BAD_TOKEN_TYPE"},
473 {STATUS_BAD_MASTER_BOOT_RECORD, -EIO, "STATUS_BAD_MASTER_BOOT_RECORD"},
474 {STATUS_INSTRUCTION_MISALIGNMENT, -EIO,
475 "STATUS_INSTRUCTION_MISALIGNMENT"},
476 {STATUS_INSTANCE_NOT_AVAILABLE, -EIO, "STATUS_INSTANCE_NOT_AVAILABLE"},
477 {STATUS_PIPE_NOT_AVAILABLE, -EIO, "STATUS_PIPE_NOT_AVAILABLE"},
478 {STATUS_INVALID_PIPE_STATE, -EIO, "STATUS_INVALID_PIPE_STATE"},
479 {STATUS_PIPE_BUSY, -EBUSY, "STATUS_PIPE_BUSY"},
480 {STATUS_ILLEGAL_FUNCTION, -EIO, "STATUS_ILLEGAL_FUNCTION"},
481 {STATUS_PIPE_DISCONNECTED, -EPIPE, "STATUS_PIPE_DISCONNECTED"},
482 {STATUS_PIPE_CLOSING, -EIO, "STATUS_PIPE_CLOSING"},
483 {STATUS_PIPE_CONNECTED, -EIO, "STATUS_PIPE_CONNECTED"},
484 {STATUS_PIPE_LISTENING, -EIO, "STATUS_PIPE_LISTENING"},
485 {STATUS_INVALID_READ_MODE, -EIO, "STATUS_INVALID_READ_MODE"},
486 {STATUS_IO_TIMEOUT, -ETIMEDOUT, "STATUS_IO_TIMEOUT"},
487 {STATUS_FILE_FORCED_CLOSED, -EIO, "STATUS_FILE_FORCED_CLOSED"},
488 {STATUS_PROFILING_NOT_STARTED, -EIO, "STATUS_PROFILING_NOT_STARTED"},
489 {STATUS_PROFILING_NOT_STOPPED, -EIO, "STATUS_PROFILING_NOT_STOPPED"},
490 {STATUS_COULD_NOT_INTERPRET, -EIO, "STATUS_COULD_NOT_INTERPRET"},
491 {STATUS_FILE_IS_A_DIRECTORY, -EISDIR, "STATUS_FILE_IS_A_DIRECTORY"},
492 {STATUS_NOT_SUPPORTED, -EOPNOTSUPP, "STATUS_NOT_SUPPORTED"},
493 {STATUS_REMOTE_NOT_LISTENING, -EHOSTDOWN,
494 "STATUS_REMOTE_NOT_LISTENING"},
495 {STATUS_DUPLICATE_NAME, -ENOTUNIQ, "STATUS_DUPLICATE_NAME"},
496 {STATUS_BAD_NETWORK_PATH, -EINVAL, "STATUS_BAD_NETWORK_PATH"},
497 {STATUS_NETWORK_BUSY, -EBUSY, "STATUS_NETWORK_BUSY"},
498 {STATUS_DEVICE_DOES_NOT_EXIST, -ENODEV, "STATUS_DEVICE_DOES_NOT_EXIST"},
499 {STATUS_TOO_MANY_COMMANDS, -EIO, "STATUS_TOO_MANY_COMMANDS"},
500 {STATUS_ADAPTER_HARDWARE_ERROR, -EIO, "STATUS_ADAPTER_HARDWARE_ERROR"},
501 {STATUS_INVALID_NETWORK_RESPONSE, -EIO,
502 "STATUS_INVALID_NETWORK_RESPONSE"},
503 {STATUS_UNEXPECTED_NETWORK_ERROR, -EIO,
504 "STATUS_UNEXPECTED_NETWORK_ERROR"},
505 {STATUS_BAD_REMOTE_ADAPTER, -EIO, "STATUS_BAD_REMOTE_ADAPTER"},
506 {STATUS_PRINT_QUEUE_FULL, -EIO, "STATUS_PRINT_QUEUE_FULL"},
507 {STATUS_NO_SPOOL_SPACE, -EIO, "STATUS_NO_SPOOL_SPACE"},
508 {STATUS_PRINT_CANCELLED, -EIO, "STATUS_PRINT_CANCELLED"},
509 {STATUS_NETWORK_NAME_DELETED, -EIO, "STATUS_NETWORK_NAME_DELETED"},
510 {STATUS_NETWORK_ACCESS_DENIED, -EACCES, "STATUS_NETWORK_ACCESS_DENIED"},
511 {STATUS_BAD_DEVICE_TYPE, -EIO, "STATUS_BAD_DEVICE_TYPE"},
512 {STATUS_BAD_NETWORK_NAME, -ENOENT, "STATUS_BAD_NETWORK_NAME"},
513 {STATUS_TOO_MANY_NAMES, -EIO, "STATUS_TOO_MANY_NAMES"},
514 {STATUS_TOO_MANY_SESSIONS, -EIO, "STATUS_TOO_MANY_SESSIONS"},
515 {STATUS_SHARING_PAUSED, -EIO, "STATUS_SHARING_PAUSED"},
516 {STATUS_REQUEST_NOT_ACCEPTED, -EIO, "STATUS_REQUEST_NOT_ACCEPTED"},
517 {STATUS_REDIRECTOR_PAUSED, -EIO, "STATUS_REDIRECTOR_PAUSED"},
518 {STATUS_NET_WRITE_FAULT, -EIO, "STATUS_NET_WRITE_FAULT"},
519 {STATUS_PROFILING_AT_LIMIT, -EIO, "STATUS_PROFILING_AT_LIMIT"},
520 {STATUS_NOT_SAME_DEVICE, -EXDEV, "STATUS_NOT_SAME_DEVICE"},
521 {STATUS_FILE_RENAMED, -EIO, "STATUS_FILE_RENAMED"},
522 {STATUS_VIRTUAL_CIRCUIT_CLOSED, -EIO, "STATUS_VIRTUAL_CIRCUIT_CLOSED"},
523 {STATUS_NO_SECURITY_ON_OBJECT, -EIO, "STATUS_NO_SECURITY_ON_OBJECT"},
524 {STATUS_CANT_WAIT, -EIO, "STATUS_CANT_WAIT"},
525 {STATUS_PIPE_EMPTY, -EIO, "STATUS_PIPE_EMPTY"},
526 {STATUS_CANT_ACCESS_DOMAIN_INFO, -EIO,
527 "STATUS_CANT_ACCESS_DOMAIN_INFO"},
528 {STATUS_CANT_TERMINATE_SELF, -EIO, "STATUS_CANT_TERMINATE_SELF"},
529 {STATUS_INVALID_SERVER_STATE, -EIO, "STATUS_INVALID_SERVER_STATE"},
530 {STATUS_INVALID_DOMAIN_STATE, -EIO, "STATUS_INVALID_DOMAIN_STATE"},
531 {STATUS_INVALID_DOMAIN_ROLE, -EIO, "STATUS_INVALID_DOMAIN_ROLE"},
532 {STATUS_NO_SUCH_DOMAIN, -EIO, "STATUS_NO_SUCH_DOMAIN"},
533 {STATUS_DOMAIN_EXISTS, -EIO, "STATUS_DOMAIN_EXISTS"},
534 {STATUS_DOMAIN_LIMIT_EXCEEDED, -EIO, "STATUS_DOMAIN_LIMIT_EXCEEDED"},
535 {STATUS_OPLOCK_NOT_GRANTED, -EIO, "STATUS_OPLOCK_NOT_GRANTED"},
536 {STATUS_INVALID_OPLOCK_PROTOCOL, -EIO,
537 "STATUS_INVALID_OPLOCK_PROTOCOL"},
538 {STATUS_INTERNAL_DB_CORRUPTION, -EIO, "STATUS_INTERNAL_DB_CORRUPTION"},
539 {STATUS_INTERNAL_ERROR, -EIO, "STATUS_INTERNAL_ERROR"},
540 {STATUS_GENERIC_NOT_MAPPED, -EIO, "STATUS_GENERIC_NOT_MAPPED"},
541 {STATUS_BAD_DESCRIPTOR_FORMAT, -EIO, "STATUS_BAD_DESCRIPTOR_FORMAT"},
542 {STATUS_INVALID_USER_BUFFER, -EIO, "STATUS_INVALID_USER_BUFFER"},
543 {STATUS_UNEXPECTED_IO_ERROR, -EIO, "STATUS_UNEXPECTED_IO_ERROR"},
544 {STATUS_UNEXPECTED_MM_CREATE_ERR, -EIO,
545 "STATUS_UNEXPECTED_MM_CREATE_ERR"},
546 {STATUS_UNEXPECTED_MM_MAP_ERROR, -EIO,
547 "STATUS_UNEXPECTED_MM_MAP_ERROR"},
548 {STATUS_UNEXPECTED_MM_EXTEND_ERR, -EIO,
549 "STATUS_UNEXPECTED_MM_EXTEND_ERR"},
550 {STATUS_NOT_LOGON_PROCESS, -EIO, "STATUS_NOT_LOGON_PROCESS"},
551 {STATUS_LOGON_SESSION_EXISTS, -EIO, "STATUS_LOGON_SESSION_EXISTS"},
552 {STATUS_INVALID_PARAMETER_1, -EINVAL, "STATUS_INVALID_PARAMETER_1"},
553 {STATUS_INVALID_PARAMETER_2, -EINVAL, "STATUS_INVALID_PARAMETER_2"},
554 {STATUS_INVALID_PARAMETER_3, -EINVAL, "STATUS_INVALID_PARAMETER_3"},
555 {STATUS_INVALID_PARAMETER_4, -EINVAL, "STATUS_INVALID_PARAMETER_4"},
556 {STATUS_INVALID_PARAMETER_5, -EINVAL, "STATUS_INVALID_PARAMETER_5"},
557 {STATUS_INVALID_PARAMETER_6, -EINVAL, "STATUS_INVALID_PARAMETER_6"},
558 {STATUS_INVALID_PARAMETER_7, -EINVAL, "STATUS_INVALID_PARAMETER_7"},
559 {STATUS_INVALID_PARAMETER_8, -EINVAL, "STATUS_INVALID_PARAMETER_8"},
560 {STATUS_INVALID_PARAMETER_9, -EINVAL, "STATUS_INVALID_PARAMETER_9"},
561 {STATUS_INVALID_PARAMETER_10, -EINVAL, "STATUS_INVALID_PARAMETER_10"},
562 {STATUS_INVALID_PARAMETER_11, -EINVAL, "STATUS_INVALID_PARAMETER_11"},
563 {STATUS_INVALID_PARAMETER_12, -EINVAL, "STATUS_INVALID_PARAMETER_12"},
564 {STATUS_REDIRECTOR_NOT_STARTED, -EIO, "STATUS_REDIRECTOR_NOT_STARTED"},
565 {STATUS_REDIRECTOR_STARTED, -EIO, "STATUS_REDIRECTOR_STARTED"},
566 {STATUS_STACK_OVERFLOW, -EIO, "STATUS_STACK_OVERFLOW"},
567 {STATUS_NO_SUCH_PACKAGE, -EIO, "STATUS_NO_SUCH_PACKAGE"},
568 {STATUS_BAD_FUNCTION_TABLE, -EIO, "STATUS_BAD_FUNCTION_TABLE"},
569 {STATUS_VARIABLE_NOT_FOUND, -EIO, "STATUS_VARIABLE_NOT_FOUND"},
570 {STATUS_DIRECTORY_NOT_EMPTY, -ENOTEMPTY, "STATUS_DIRECTORY_NOT_EMPTY"},
571 {STATUS_FILE_CORRUPT_ERROR, -EIO, "STATUS_FILE_CORRUPT_ERROR"},
572 {STATUS_NOT_A_DIRECTORY, -ENOTDIR, "STATUS_NOT_A_DIRECTORY"},
573 {STATUS_BAD_LOGON_SESSION_STATE, -EIO,
574 "STATUS_BAD_LOGON_SESSION_STATE"},
575 {STATUS_LOGON_SESSION_COLLISION, -EIO,
576 "STATUS_LOGON_SESSION_COLLISION"},
577 {STATUS_NAME_TOO_LONG, -ENAMETOOLONG, "STATUS_NAME_TOO_LONG"},
578 {STATUS_FILES_OPEN, -EIO, "STATUS_FILES_OPEN"},
579 {STATUS_CONNECTION_IN_USE, -EIO, "STATUS_CONNECTION_IN_USE"},
580 {STATUS_MESSAGE_NOT_FOUND, -EIO, "STATUS_MESSAGE_NOT_FOUND"},
581 {STATUS_PROCESS_IS_TERMINATING, -EIO, "STATUS_PROCESS_IS_TERMINATING"},
582 {STATUS_INVALID_LOGON_TYPE, -EIO, "STATUS_INVALID_LOGON_TYPE"},
583 {STATUS_NO_GUID_TRANSLATION, -EIO, "STATUS_NO_GUID_TRANSLATION"},
584 {STATUS_CANNOT_IMPERSONATE, -EIO, "STATUS_CANNOT_IMPERSONATE"},
585 {STATUS_IMAGE_ALREADY_LOADED, -EIO, "STATUS_IMAGE_ALREADY_LOADED"},
586 {STATUS_ABIOS_NOT_PRESENT, -EIO, "STATUS_ABIOS_NOT_PRESENT"},
587 {STATUS_ABIOS_LID_NOT_EXIST, -EIO, "STATUS_ABIOS_LID_NOT_EXIST"},
588 {STATUS_ABIOS_LID_ALREADY_OWNED, -EIO,
589 "STATUS_ABIOS_LID_ALREADY_OWNED"},
590 {STATUS_ABIOS_NOT_LID_OWNER, -EIO, "STATUS_ABIOS_NOT_LID_OWNER"},
591 {STATUS_ABIOS_INVALID_COMMAND, -EIO, "STATUS_ABIOS_INVALID_COMMAND"},
592 {STATUS_ABIOS_INVALID_LID, -EIO, "STATUS_ABIOS_INVALID_LID"},
593 {STATUS_ABIOS_SELECTOR_NOT_AVAILABLE, -EIO,
594 "STATUS_ABIOS_SELECTOR_NOT_AVAILABLE"},
595 {STATUS_ABIOS_INVALID_SELECTOR, -EIO, "STATUS_ABIOS_INVALID_SELECTOR"},
596 {STATUS_NO_LDT, -EIO, "STATUS_NO_LDT"},
597 {STATUS_INVALID_LDT_SIZE, -EIO, "STATUS_INVALID_LDT_SIZE"},
598 {STATUS_INVALID_LDT_OFFSET, -EIO, "STATUS_INVALID_LDT_OFFSET"},
599 {STATUS_INVALID_LDT_DESCRIPTOR, -EIO, "STATUS_INVALID_LDT_DESCRIPTOR"},
600 {STATUS_INVALID_IMAGE_NE_FORMAT, -EIO,
601 "STATUS_INVALID_IMAGE_NE_FORMAT"},
602 {STATUS_RXACT_INVALID_STATE, -EIO, "STATUS_RXACT_INVALID_STATE"},
603 {STATUS_RXACT_COMMIT_FAILURE, -EIO, "STATUS_RXACT_COMMIT_FAILURE"},
604 {STATUS_MAPPED_FILE_SIZE_ZERO, -EIO, "STATUS_MAPPED_FILE_SIZE_ZERO"},
605 {STATUS_TOO_MANY_OPENED_FILES, -EMFILE, "STATUS_TOO_MANY_OPENED_FILES"},
606 {STATUS_CANCELLED, -EIO, "STATUS_CANCELLED"},
607 {STATUS_CANNOT_DELETE, -EIO, "STATUS_CANNOT_DELETE"},
608 {STATUS_INVALID_COMPUTER_NAME, -EIO, "STATUS_INVALID_COMPUTER_NAME"},
609 {STATUS_FILE_DELETED, -EIO, "STATUS_FILE_DELETED"},
610 {STATUS_SPECIAL_ACCOUNT, -EIO, "STATUS_SPECIAL_ACCOUNT"},
611 {STATUS_SPECIAL_GROUP, -EIO, "STATUS_SPECIAL_GROUP"},
612 {STATUS_SPECIAL_USER, -EIO, "STATUS_SPECIAL_USER"},
613 {STATUS_MEMBERS_PRIMARY_GROUP, -EIO, "STATUS_MEMBERS_PRIMARY_GROUP"},
614 {STATUS_FILE_CLOSED, -EBADF, "STATUS_FILE_CLOSED"},
615 {STATUS_TOO_MANY_THREADS, -EIO, "STATUS_TOO_MANY_THREADS"},
616 {STATUS_THREAD_NOT_IN_PROCESS, -EIO, "STATUS_THREAD_NOT_IN_PROCESS"},
617 {STATUS_TOKEN_ALREADY_IN_USE, -EIO, "STATUS_TOKEN_ALREADY_IN_USE"},
618 {STATUS_PAGEFILE_QUOTA_EXCEEDED, -EDQUOT,
619 "STATUS_PAGEFILE_QUOTA_EXCEEDED"},
620 {STATUS_COMMITMENT_LIMIT, -EIO, "STATUS_COMMITMENT_LIMIT"},
621 {STATUS_INVALID_IMAGE_LE_FORMAT, -EIO,
622 "STATUS_INVALID_IMAGE_LE_FORMAT"},
623 {STATUS_INVALID_IMAGE_NOT_MZ, -EIO, "STATUS_INVALID_IMAGE_NOT_MZ"},
624 {STATUS_INVALID_IMAGE_PROTECT, -EIO, "STATUS_INVALID_IMAGE_PROTECT"},
625 {STATUS_INVALID_IMAGE_WIN_16, -EIO, "STATUS_INVALID_IMAGE_WIN_16"},
626 {STATUS_LOGON_SERVER_CONFLICT, -EIO, "STATUS_LOGON_SERVER_CONFLICT"},
627 {STATUS_TIME_DIFFERENCE_AT_DC, -EIO, "STATUS_TIME_DIFFERENCE_AT_DC"},
628 {STATUS_SYNCHRONIZATION_REQUIRED, -EIO,
629 "STATUS_SYNCHRONIZATION_REQUIRED"},
630 {STATUS_DLL_NOT_FOUND, -ENOENT, "STATUS_DLL_NOT_FOUND"},
631 {STATUS_OPEN_FAILED, -EIO, "STATUS_OPEN_FAILED"},
632 {STATUS_IO_PRIVILEGE_FAILED, -EIO, "STATUS_IO_PRIVILEGE_FAILED"},
633 {STATUS_ORDINAL_NOT_FOUND, -EIO, "STATUS_ORDINAL_NOT_FOUND"},
634 {STATUS_ENTRYPOINT_NOT_FOUND, -EIO, "STATUS_ENTRYPOINT_NOT_FOUND"},
635 {STATUS_CONTROL_C_EXIT, -EIO, "STATUS_CONTROL_C_EXIT"},
636 {STATUS_LOCAL_DISCONNECT, -EIO, "STATUS_LOCAL_DISCONNECT"},
637 {STATUS_REMOTE_DISCONNECT, -ESHUTDOWN, "STATUS_REMOTE_DISCONNECT"},
638 {STATUS_REMOTE_RESOURCES, -EIO, "STATUS_REMOTE_RESOURCES"},
639 {STATUS_LINK_FAILED, -EXDEV, "STATUS_LINK_FAILED"},
640 {STATUS_LINK_TIMEOUT, -ETIMEDOUT, "STATUS_LINK_TIMEOUT"},
641 {STATUS_INVALID_CONNECTION, -EIO, "STATUS_INVALID_CONNECTION"},
642 {STATUS_INVALID_ADDRESS, -EIO, "STATUS_INVALID_ADDRESS"},
643 {STATUS_DLL_INIT_FAILED, -EIO, "STATUS_DLL_INIT_FAILED"},
644 {STATUS_MISSING_SYSTEMFILE, -EIO, "STATUS_MISSING_SYSTEMFILE"},
645 {STATUS_UNHANDLED_EXCEPTION, -EIO, "STATUS_UNHANDLED_EXCEPTION"},
646 {STATUS_APP_INIT_FAILURE, -EIO, "STATUS_APP_INIT_FAILURE"},
647 {STATUS_PAGEFILE_CREATE_FAILED, -EIO, "STATUS_PAGEFILE_CREATE_FAILED"},
648 {STATUS_NO_PAGEFILE, -EIO, "STATUS_NO_PAGEFILE"},
649 {STATUS_INVALID_LEVEL, -EIO, "STATUS_INVALID_LEVEL"},
650 {STATUS_WRONG_PASSWORD_CORE, -EIO, "STATUS_WRONG_PASSWORD_CORE"},
651 {STATUS_ILLEGAL_FLOAT_CONTEXT, -EIO, "STATUS_ILLEGAL_FLOAT_CONTEXT"},
652 {STATUS_PIPE_BROKEN, -EPIPE, "STATUS_PIPE_BROKEN"},
653 {STATUS_REGISTRY_CORRUPT, -EIO, "STATUS_REGISTRY_CORRUPT"},
654 {STATUS_REGISTRY_IO_FAILED, -EIO, "STATUS_REGISTRY_IO_FAILED"},
655 {STATUS_NO_EVENT_PAIR, -EIO, "STATUS_NO_EVENT_PAIR"},
656 {STATUS_UNRECOGNIZED_VOLUME, -EIO, "STATUS_UNRECOGNIZED_VOLUME"},
657 {STATUS_SERIAL_NO_DEVICE_INITED, -EIO,
658 "STATUS_SERIAL_NO_DEVICE_INITED"},
659 {STATUS_NO_SUCH_ALIAS, -EIO, "STATUS_NO_SUCH_ALIAS"},
660 {STATUS_MEMBER_NOT_IN_ALIAS, -EIO, "STATUS_MEMBER_NOT_IN_ALIAS"},
661 {STATUS_MEMBER_IN_ALIAS, -EIO, "STATUS_MEMBER_IN_ALIAS"},
662 {STATUS_ALIAS_EXISTS, -EIO, "STATUS_ALIAS_EXISTS"},
663 {STATUS_LOGON_NOT_GRANTED, -EIO, "STATUS_LOGON_NOT_GRANTED"},
664 {STATUS_TOO_MANY_SECRETS, -EIO, "STATUS_TOO_MANY_SECRETS"},
665 {STATUS_SECRET_TOO_LONG, -EIO, "STATUS_SECRET_TOO_LONG"},
666 {STATUS_INTERNAL_DB_ERROR, -EIO, "STATUS_INTERNAL_DB_ERROR"},
667 {STATUS_FULLSCREEN_MODE, -EIO, "STATUS_FULLSCREEN_MODE"},
668 {STATUS_TOO_MANY_CONTEXT_IDS, -EIO, "STATUS_TOO_MANY_CONTEXT_IDS"},
669 {STATUS_LOGON_TYPE_NOT_GRANTED, -EIO, "STATUS_LOGON_TYPE_NOT_GRANTED"},
670 {STATUS_NOT_REGISTRY_FILE, -EIO, "STATUS_NOT_REGISTRY_FILE"},
671 {STATUS_NT_CROSS_ENCRYPTION_REQUIRED, -EIO,
672 "STATUS_NT_CROSS_ENCRYPTION_REQUIRED"},
673 {STATUS_DOMAIN_CTRLR_CONFIG_ERROR, -EIO,
674 "STATUS_DOMAIN_CTRLR_CONFIG_ERROR"},
675 {STATUS_FT_MISSING_MEMBER, -EIO, "STATUS_FT_MISSING_MEMBER"},
676 {STATUS_ILL_FORMED_SERVICE_ENTRY, -EIO,
677 "STATUS_ILL_FORMED_SERVICE_ENTRY"},
678 {STATUS_ILLEGAL_CHARACTER, -EIO, "STATUS_ILLEGAL_CHARACTER"},
679 {STATUS_UNMAPPABLE_CHARACTER, -EIO, "STATUS_UNMAPPABLE_CHARACTER"},
680 {STATUS_UNDEFINED_CHARACTER, -EIO, "STATUS_UNDEFINED_CHARACTER"},
681 {STATUS_FLOPPY_VOLUME, -EIO, "STATUS_FLOPPY_VOLUME"},
682 {STATUS_FLOPPY_ID_MARK_NOT_FOUND, -EIO,
683 "STATUS_FLOPPY_ID_MARK_NOT_FOUND"},
684 {STATUS_FLOPPY_WRONG_CYLINDER, -EIO, "STATUS_FLOPPY_WRONG_CYLINDER"},
685 {STATUS_FLOPPY_UNKNOWN_ERROR, -EIO, "STATUS_FLOPPY_UNKNOWN_ERROR"},
686 {STATUS_FLOPPY_BAD_REGISTERS, -EIO, "STATUS_FLOPPY_BAD_REGISTERS"},
687 {STATUS_DISK_RECALIBRATE_FAILED, -EIO,
688 "STATUS_DISK_RECALIBRATE_FAILED"},
689 {STATUS_DISK_OPERATION_FAILED, -EIO, "STATUS_DISK_OPERATION_FAILED"},
690 {STATUS_DISK_RESET_FAILED, -EIO, "STATUS_DISK_RESET_FAILED"},
691 {STATUS_SHARED_IRQ_BUSY, -EBUSY, "STATUS_SHARED_IRQ_BUSY"},
692 {STATUS_FT_ORPHANING, -EIO, "STATUS_FT_ORPHANING"},
693 {STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT, -EIO,
694 "STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT"},
695 {STATUS_PARTITION_FAILURE, -EIO, "STATUS_PARTITION_FAILURE"},
696 {STATUS_INVALID_BLOCK_LENGTH, -EIO, "STATUS_INVALID_BLOCK_LENGTH"},
697 {STATUS_DEVICE_NOT_PARTITIONED, -EIO, "STATUS_DEVICE_NOT_PARTITIONED"},
698 {STATUS_UNABLE_TO_LOCK_MEDIA, -EIO, "STATUS_UNABLE_TO_LOCK_MEDIA"},
699 {STATUS_UNABLE_TO_UNLOAD_MEDIA, -EIO, "STATUS_UNABLE_TO_UNLOAD_MEDIA"},
700 {STATUS_EOM_OVERFLOW, -EIO, "STATUS_EOM_OVERFLOW"},
701 {STATUS_NO_MEDIA, -EIO, "STATUS_NO_MEDIA"},
702 {STATUS_NO_SUCH_MEMBER, -EIO, "STATUS_NO_SUCH_MEMBER"},
703 {STATUS_INVALID_MEMBER, -EIO, "STATUS_INVALID_MEMBER"},
704 {STATUS_KEY_DELETED, -EIO, "STATUS_KEY_DELETED"},
705 {STATUS_NO_LOG_SPACE, -EIO, "STATUS_NO_LOG_SPACE"},
706 {STATUS_TOO_MANY_SIDS, -EIO, "STATUS_TOO_MANY_SIDS"},
707 {STATUS_LM_CROSS_ENCRYPTION_REQUIRED, -EIO,
708 "STATUS_LM_CROSS_ENCRYPTION_REQUIRED"},
709 {STATUS_KEY_HAS_CHILDREN, -EIO, "STATUS_KEY_HAS_CHILDREN"},
710 {STATUS_CHILD_MUST_BE_VOLATILE, -EIO, "STATUS_CHILD_MUST_BE_VOLATILE"},
711 {STATUS_DEVICE_CONFIGURATION_ERROR, -EIO,
712 "STATUS_DEVICE_CONFIGURATION_ERROR"},
713 {STATUS_DRIVER_INTERNAL_ERROR, -EIO, "STATUS_DRIVER_INTERNAL_ERROR"},
714 {STATUS_INVALID_DEVICE_STATE, -EIO, "STATUS_INVALID_DEVICE_STATE"},
715 {STATUS_IO_DEVICE_ERROR, -EIO, "STATUS_IO_DEVICE_ERROR"},
716 {STATUS_DEVICE_PROTOCOL_ERROR, -EIO, "STATUS_DEVICE_PROTOCOL_ERROR"},
717 {STATUS_BACKUP_CONTROLLER, -EIO, "STATUS_BACKUP_CONTROLLER"},
718 {STATUS_LOG_FILE_FULL, -EIO, "STATUS_LOG_FILE_FULL"},
719 {STATUS_TOO_LATE, -EIO, "STATUS_TOO_LATE"},
720 {STATUS_NO_TRUST_LSA_SECRET, -EIO, "STATUS_NO_TRUST_LSA_SECRET"},
721 {STATUS_NO_TRUST_SAM_ACCOUNT, -EIO, "STATUS_NO_TRUST_SAM_ACCOUNT"},
722 {STATUS_TRUSTED_DOMAIN_FAILURE, -EIO, "STATUS_TRUSTED_DOMAIN_FAILURE"},
723 {STATUS_TRUSTED_RELATIONSHIP_FAILURE, -EIO,
724 "STATUS_TRUSTED_RELATIONSHIP_FAILURE"},
725 {STATUS_EVENTLOG_FILE_CORRUPT, -EIO, "STATUS_EVENTLOG_FILE_CORRUPT"},
726 {STATUS_EVENTLOG_CANT_START, -EIO, "STATUS_EVENTLOG_CANT_START"},
727 {STATUS_TRUST_FAILURE, -EIO, "STATUS_TRUST_FAILURE"},
728 {STATUS_MUTANT_LIMIT_EXCEEDED, -EIO, "STATUS_MUTANT_LIMIT_EXCEEDED"},
729 {STATUS_NETLOGON_NOT_STARTED, -EIO, "STATUS_NETLOGON_NOT_STARTED"},
730 {STATUS_ACCOUNT_EXPIRED, -EKEYEXPIRED, "STATUS_ACCOUNT_EXPIRED"},
731 {STATUS_POSSIBLE_DEADLOCK, -EIO, "STATUS_POSSIBLE_DEADLOCK"},
732 {STATUS_NETWORK_CREDENTIAL_CONFLICT, -EIO,
733 "STATUS_NETWORK_CREDENTIAL_CONFLICT"},
734 {STATUS_REMOTE_SESSION_LIMIT, -EIO, "STATUS_REMOTE_SESSION_LIMIT"},
735 {STATUS_EVENTLOG_FILE_CHANGED, -EIO, "STATUS_EVENTLOG_FILE_CHANGED"},
736 {STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT, -EIO,
737 "STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT"},
738 {STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT, -EIO,
739 "STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT"},
740 {STATUS_NOLOGON_SERVER_TRUST_ACCOUNT, -EIO,
741 "STATUS_NOLOGON_SERVER_TRUST_ACCOUNT"},
742 {STATUS_DOMAIN_TRUST_INCONSISTENT, -EIO,
743 "STATUS_DOMAIN_TRUST_INCONSISTENT"},
744 {STATUS_FS_DRIVER_REQUIRED, -EIO, "STATUS_FS_DRIVER_REQUIRED"},
745 {STATUS_IMAGE_ALREADY_LOADED_AS_DLL, -EIO,
746 "STATUS_IMAGE_ALREADY_LOADED_AS_DLL"},
747 {STATUS_NETWORK_OPEN_RESTRICTION, -EIO,
748 "STATUS_NETWORK_OPEN_RESTRICTION"},
749 {STATUS_NO_USER_SESSION_KEY, -EIO, "STATUS_NO_USER_SESSION_KEY"},
750 {STATUS_USER_SESSION_DELETED, -EIO, "STATUS_USER_SESSION_DELETED"},
751 {STATUS_RESOURCE_LANG_NOT_FOUND, -EIO,
752 "STATUS_RESOURCE_LANG_NOT_FOUND"},
753 {STATUS_INSUFF_SERVER_RESOURCES, -EIO,
754 "STATUS_INSUFF_SERVER_RESOURCES"},
755 {STATUS_INVALID_BUFFER_SIZE, -EIO, "STATUS_INVALID_BUFFER_SIZE"},
756 {STATUS_INVALID_ADDRESS_COMPONENT, -EIO,
757 "STATUS_INVALID_ADDRESS_COMPONENT"},
758 {STATUS_INVALID_ADDRESS_WILDCARD, -EIO,
759 "STATUS_INVALID_ADDRESS_WILDCARD"},
760 {STATUS_TOO_MANY_ADDRESSES, -EIO, "STATUS_TOO_MANY_ADDRESSES"},
761 {STATUS_ADDRESS_ALREADY_EXISTS, -EADDRINUSE,
762 "STATUS_ADDRESS_ALREADY_EXISTS"},
763 {STATUS_ADDRESS_CLOSED, -EIO, "STATUS_ADDRESS_CLOSED"},
764 {STATUS_CONNECTION_DISCONNECTED, -ECONNABORTED,
765 "STATUS_CONNECTION_DISCONNECTED"},
766 {STATUS_CONNECTION_RESET, -ENETRESET, "STATUS_CONNECTION_RESET"},
767 {STATUS_TOO_MANY_NODES, -EIO, "STATUS_TOO_MANY_NODES"},
768 {STATUS_TRANSACTION_ABORTED, -EIO, "STATUS_TRANSACTION_ABORTED"},
769 {STATUS_TRANSACTION_TIMED_OUT, -EIO, "STATUS_TRANSACTION_TIMED_OUT"},
770 {STATUS_TRANSACTION_NO_RELEASE, -EIO, "STATUS_TRANSACTION_NO_RELEASE"},
771 {STATUS_TRANSACTION_NO_MATCH, -EIO, "STATUS_TRANSACTION_NO_MATCH"},
772 {STATUS_TRANSACTION_RESPONDED, -EIO, "STATUS_TRANSACTION_RESPONDED"},
773 {STATUS_TRANSACTION_INVALID_ID, -EIO, "STATUS_TRANSACTION_INVALID_ID"},
774 {STATUS_TRANSACTION_INVALID_TYPE, -EIO,
775 "STATUS_TRANSACTION_INVALID_TYPE"},
776 {STATUS_NOT_SERVER_SESSION, -EIO, "STATUS_NOT_SERVER_SESSION"},
777 {STATUS_NOT_CLIENT_SESSION, -EIO, "STATUS_NOT_CLIENT_SESSION"},
778 {STATUS_CANNOT_LOAD_REGISTRY_FILE, -EIO,
779 "STATUS_CANNOT_LOAD_REGISTRY_FILE"},
780 {STATUS_DEBUG_ATTACH_FAILED, -EIO, "STATUS_DEBUG_ATTACH_FAILED"},
781 {STATUS_SYSTEM_PROCESS_TERMINATED, -EIO,
782 "STATUS_SYSTEM_PROCESS_TERMINATED"},
783 {STATUS_DATA_NOT_ACCEPTED, -EIO, "STATUS_DATA_NOT_ACCEPTED"},
784 {STATUS_NO_BROWSER_SERVERS_FOUND, -EIO,
785 "STATUS_NO_BROWSER_SERVERS_FOUND"},
786 {STATUS_VDM_HARD_ERROR, -EIO, "STATUS_VDM_HARD_ERROR"},
787 {STATUS_DRIVER_CANCEL_TIMEOUT, -EIO, "STATUS_DRIVER_CANCEL_TIMEOUT"},
788 {STATUS_REPLY_MESSAGE_MISMATCH, -EIO, "STATUS_REPLY_MESSAGE_MISMATCH"},
789 {STATUS_MAPPED_ALIGNMENT, -EIO, "STATUS_MAPPED_ALIGNMENT"},
790 {STATUS_IMAGE_CHECKSUM_MISMATCH, -EIO,
791 "STATUS_IMAGE_CHECKSUM_MISMATCH"},
792 {STATUS_LOST_WRITEBEHIND_DATA, -EIO, "STATUS_LOST_WRITEBEHIND_DATA"},
793 {STATUS_CLIENT_SERVER_PARAMETERS_INVALID, -EIO,
794 "STATUS_CLIENT_SERVER_PARAMETERS_INVALID"},
795 {STATUS_PASSWORD_MUST_CHANGE, -EIO, "STATUS_PASSWORD_MUST_CHANGE"},
796 {STATUS_NOT_FOUND, -ENOENT, "STATUS_NOT_FOUND"},
797 {STATUS_NOT_TINY_STREAM, -EIO, "STATUS_NOT_TINY_STREAM"},
798 {STATUS_RECOVERY_FAILURE, -EIO, "STATUS_RECOVERY_FAILURE"},
799 {STATUS_STACK_OVERFLOW_READ, -EIO, "STATUS_STACK_OVERFLOW_READ"},
800 {STATUS_FAIL_CHECK, -EIO, "STATUS_FAIL_CHECK"},
801 {STATUS_DUPLICATE_OBJECTID, -EIO, "STATUS_DUPLICATE_OBJECTID"},
802 {STATUS_OBJECTID_EXISTS, -EIO, "STATUS_OBJECTID_EXISTS"},
803 {STATUS_CONVERT_TO_LARGE, -EIO, "STATUS_CONVERT_TO_LARGE"},
804 {STATUS_RETRY, -EAGAIN, "STATUS_RETRY"},
805 {STATUS_FOUND_OUT_OF_SCOPE, -EIO, "STATUS_FOUND_OUT_OF_SCOPE"},
806 {STATUS_ALLOCATE_BUCKET, -EIO, "STATUS_ALLOCATE_BUCKET"},
807 {STATUS_PROPSET_NOT_FOUND, -EIO, "STATUS_PROPSET_NOT_FOUND"},
808 {STATUS_MARSHALL_OVERFLOW, -EIO, "STATUS_MARSHALL_OVERFLOW"},
809 {STATUS_INVALID_VARIANT, -EIO, "STATUS_INVALID_VARIANT"},
810 {STATUS_DOMAIN_CONTROLLER_NOT_FOUND, -EIO,
811 "STATUS_DOMAIN_CONTROLLER_NOT_FOUND"},
812 {STATUS_ACCOUNT_LOCKED_OUT, -EIO, "STATUS_ACCOUNT_LOCKED_OUT"},
813 {STATUS_HANDLE_NOT_CLOSABLE, -EIO, "STATUS_HANDLE_NOT_CLOSABLE"},
814 {STATUS_CONNECTION_REFUSED, -EIO, "STATUS_CONNECTION_REFUSED"},
815 {STATUS_GRACEFUL_DISCONNECT, -EIO, "STATUS_GRACEFUL_DISCONNECT"},
816 {STATUS_ADDRESS_ALREADY_ASSOCIATED, -EIO,
817 "STATUS_ADDRESS_ALREADY_ASSOCIATED"},
818 {STATUS_ADDRESS_NOT_ASSOCIATED, -EIO, "STATUS_ADDRESS_NOT_ASSOCIATED"},
819 {STATUS_CONNECTION_INVALID, -EIO, "STATUS_CONNECTION_INVALID"},
820 {STATUS_CONNECTION_ACTIVE, -EIO, "STATUS_CONNECTION_ACTIVE"},
821 {STATUS_NETWORK_UNREACHABLE, -ENETUNREACH,
822 "STATUS_NETWORK_UNREACHABLE"},
823 {STATUS_HOST_UNREACHABLE, -EHOSTDOWN, "STATUS_HOST_UNREACHABLE"},
824 {STATUS_PROTOCOL_UNREACHABLE, -ENETUNREACH,
825 "STATUS_PROTOCOL_UNREACHABLE"},
826 {STATUS_PORT_UNREACHABLE, -ENETUNREACH, "STATUS_PORT_UNREACHABLE"},
827 {STATUS_REQUEST_ABORTED, -EIO, "STATUS_REQUEST_ABORTED"},
828 {STATUS_CONNECTION_ABORTED, -ECONNABORTED, "STATUS_CONNECTION_ABORTED"},
829 {STATUS_BAD_COMPRESSION_BUFFER, -EIO, "STATUS_BAD_COMPRESSION_BUFFER"},
830 {STATUS_USER_MAPPED_FILE, -EIO, "STATUS_USER_MAPPED_FILE"},
831 {STATUS_AUDIT_FAILED, -EIO, "STATUS_AUDIT_FAILED"},
832 {STATUS_TIMER_RESOLUTION_NOT_SET, -EIO,
833 "STATUS_TIMER_RESOLUTION_NOT_SET"},
834 {STATUS_CONNECTION_COUNT_LIMIT, -EIO, "STATUS_CONNECTION_COUNT_LIMIT"},
835 {STATUS_LOGIN_TIME_RESTRICTION, -EACCES,
836 "STATUS_LOGIN_TIME_RESTRICTION"},
837 {STATUS_LOGIN_WKSTA_RESTRICTION, -EACCES,
838 "STATUS_LOGIN_WKSTA_RESTRICTION"},
839 {STATUS_IMAGE_MP_UP_MISMATCH, -EIO, "STATUS_IMAGE_MP_UP_MISMATCH"},
840 {STATUS_INSUFFICIENT_LOGON_INFO, -EIO,
841 "STATUS_INSUFFICIENT_LOGON_INFO"},
842 {STATUS_BAD_DLL_ENTRYPOINT, -EIO, "STATUS_BAD_DLL_ENTRYPOINT"},
843 {STATUS_BAD_SERVICE_ENTRYPOINT, -EIO, "STATUS_BAD_SERVICE_ENTRYPOINT"},
844 {STATUS_LPC_REPLY_LOST, -EIO, "STATUS_LPC_REPLY_LOST"},
845 {STATUS_IP_ADDRESS_CONFLICT1, -EIO, "STATUS_IP_ADDRESS_CONFLICT1"},
846 {STATUS_IP_ADDRESS_CONFLICT2, -EIO, "STATUS_IP_ADDRESS_CONFLICT2"},
847 {STATUS_REGISTRY_QUOTA_LIMIT, -EDQUOT, "STATUS_REGISTRY_QUOTA_LIMIT"},
848 {STATUS_PATH_NOT_COVERED, -EREMOTE, "STATUS_PATH_NOT_COVERED"},
849 {STATUS_NO_CALLBACK_ACTIVE, -EIO, "STATUS_NO_CALLBACK_ACTIVE"},
850 {STATUS_LICENSE_QUOTA_EXCEEDED, -EACCES,
851 "STATUS_LICENSE_QUOTA_EXCEEDED"},
852 {STATUS_PWD_TOO_SHORT, -EIO, "STATUS_PWD_TOO_SHORT"},
853 {STATUS_PWD_TOO_RECENT, -EIO, "STATUS_PWD_TOO_RECENT"},
854 {STATUS_PWD_HISTORY_CONFLICT, -EIO, "STATUS_PWD_HISTORY_CONFLICT"},
855 {STATUS_PLUGPLAY_NO_DEVICE, -EIO, "STATUS_PLUGPLAY_NO_DEVICE"},
856 {STATUS_UNSUPPORTED_COMPRESSION, -EIO,
857 "STATUS_UNSUPPORTED_COMPRESSION"},
858 {STATUS_INVALID_HW_PROFILE, -EIO, "STATUS_INVALID_HW_PROFILE"},
859 {STATUS_INVALID_PLUGPLAY_DEVICE_PATH, -EIO,
860 "STATUS_INVALID_PLUGPLAY_DEVICE_PATH"},
861 {STATUS_DRIVER_ORDINAL_NOT_FOUND, -EIO,
862 "STATUS_DRIVER_ORDINAL_NOT_FOUND"},
863 {STATUS_DRIVER_ENTRYPOINT_NOT_FOUND, -EIO,
864 "STATUS_DRIVER_ENTRYPOINT_NOT_FOUND"},
865 {STATUS_RESOURCE_NOT_OWNED, -EIO, "STATUS_RESOURCE_NOT_OWNED"},
866 {STATUS_TOO_MANY_LINKS, -EMLINK, "STATUS_TOO_MANY_LINKS"},
867 {STATUS_QUOTA_LIST_INCONSISTENT, -EIO,
868 "STATUS_QUOTA_LIST_INCONSISTENT"},
869 {STATUS_FILE_IS_OFFLINE, -EIO, "STATUS_FILE_IS_OFFLINE"},
870 {STATUS_EVALUATION_EXPIRATION, -EIO, "STATUS_EVALUATION_EXPIRATION"},
871 {STATUS_ILLEGAL_DLL_RELOCATION, -EIO, "STATUS_ILLEGAL_DLL_RELOCATION"},
872 {STATUS_LICENSE_VIOLATION, -EIO, "STATUS_LICENSE_VIOLATION"},
873 {STATUS_DLL_INIT_FAILED_LOGOFF, -EIO, "STATUS_DLL_INIT_FAILED_LOGOFF"},
874 {STATUS_DRIVER_UNABLE_TO_LOAD, -EIO, "STATUS_DRIVER_UNABLE_TO_LOAD"},
875 {STATUS_DFS_UNAVAILABLE, -EIO, "STATUS_DFS_UNAVAILABLE"},
876 {STATUS_VOLUME_DISMOUNTED, -EIO, "STATUS_VOLUME_DISMOUNTED"},
877 {STATUS_WX86_INTERNAL_ERROR, -EIO, "STATUS_WX86_INTERNAL_ERROR"},
878 {STATUS_WX86_FLOAT_STACK_CHECK, -EIO, "STATUS_WX86_FLOAT_STACK_CHECK"},
879 {STATUS_VALIDATE_CONTINUE, -EIO, "STATUS_VALIDATE_CONTINUE"},
880 {STATUS_NO_MATCH, -EIO, "STATUS_NO_MATCH"},
881 {STATUS_NO_MORE_MATCHES, -EIO, "STATUS_NO_MORE_MATCHES"},
882 {STATUS_NOT_A_REPARSE_POINT, -EIO, "STATUS_NOT_A_REPARSE_POINT"},
883 {STATUS_IO_REPARSE_TAG_INVALID, -EIO, "STATUS_IO_REPARSE_TAG_INVALID"},
884 {STATUS_IO_REPARSE_TAG_MISMATCH, -EIO,
885 "STATUS_IO_REPARSE_TAG_MISMATCH"},
886 {STATUS_IO_REPARSE_DATA_INVALID, -EIO,
887 "STATUS_IO_REPARSE_DATA_INVALID"},
888 {STATUS_IO_REPARSE_TAG_NOT_HANDLED, -EIO,
889 "STATUS_IO_REPARSE_TAG_NOT_HANDLED"},
890 {STATUS_REPARSE_POINT_NOT_RESOLVED, -EIO,
891 "STATUS_REPARSE_POINT_NOT_RESOLVED"},
892 {STATUS_DIRECTORY_IS_A_REPARSE_POINT, -EIO,
893 "STATUS_DIRECTORY_IS_A_REPARSE_POINT"},
894 {STATUS_RANGE_LIST_CONFLICT, -EIO, "STATUS_RANGE_LIST_CONFLICT"},
895 {STATUS_SOURCE_ELEMENT_EMPTY, -EIO, "STATUS_SOURCE_ELEMENT_EMPTY"},
896 {STATUS_DESTINATION_ELEMENT_FULL, -EIO,
897 "STATUS_DESTINATION_ELEMENT_FULL"},
898 {STATUS_ILLEGAL_ELEMENT_ADDRESS, -EIO,
899 "STATUS_ILLEGAL_ELEMENT_ADDRESS"},
900 {STATUS_MAGAZINE_NOT_PRESENT, -EIO, "STATUS_MAGAZINE_NOT_PRESENT"},
901 {STATUS_REINITIALIZATION_NEEDED, -EIO,
902 "STATUS_REINITIALIZATION_NEEDED"},
903 {STATUS_ENCRYPTION_FAILED, -EIO, "STATUS_ENCRYPTION_FAILED"},
904 {STATUS_DECRYPTION_FAILED, -EIO, "STATUS_DECRYPTION_FAILED"},
905 {STATUS_RANGE_NOT_FOUND, -EIO, "STATUS_RANGE_NOT_FOUND"},
906 {STATUS_NO_RECOVERY_POLICY, -EIO, "STATUS_NO_RECOVERY_POLICY"},
907 {STATUS_NO_EFS, -EIO, "STATUS_NO_EFS"},
908 {STATUS_WRONG_EFS, -EIO, "STATUS_WRONG_EFS"},
909 {STATUS_NO_USER_KEYS, -EIO, "STATUS_NO_USER_KEYS"},
910 {STATUS_FILE_NOT_ENCRYPTED, -EIO, "STATUS_FILE_NOT_ENCRYPTED"},
911 {STATUS_NOT_EXPORT_FORMAT, -EIO, "STATUS_NOT_EXPORT_FORMAT"},
912 {STATUS_FILE_ENCRYPTED, -EIO, "STATUS_FILE_ENCRYPTED"},
913 {STATUS_WMI_GUID_NOT_FOUND, -EIO, "STATUS_WMI_GUID_NOT_FOUND"},
914 {STATUS_WMI_INSTANCE_NOT_FOUND, -EIO, "STATUS_WMI_INSTANCE_NOT_FOUND"},
915 {STATUS_WMI_ITEMID_NOT_FOUND, -EIO, "STATUS_WMI_ITEMID_NOT_FOUND"},
916 {STATUS_WMI_TRY_AGAIN, -EIO, "STATUS_WMI_TRY_AGAIN"},
917 {STATUS_SHARED_POLICY, -EIO, "STATUS_SHARED_POLICY"},
918 {STATUS_POLICY_OBJECT_NOT_FOUND, -EIO,
919 "STATUS_POLICY_OBJECT_NOT_FOUND"},
920 {STATUS_POLICY_ONLY_IN_DS, -EIO, "STATUS_POLICY_ONLY_IN_DS"},
921 {STATUS_VOLUME_NOT_UPGRADED, -EIO, "STATUS_VOLUME_NOT_UPGRADED"},
922 {STATUS_REMOTE_STORAGE_NOT_ACTIVE, -EIO,
923 "STATUS_REMOTE_STORAGE_NOT_ACTIVE"},
924 {STATUS_REMOTE_STORAGE_MEDIA_ERROR, -EIO,
925 "STATUS_REMOTE_STORAGE_MEDIA_ERROR"},
926 {STATUS_NO_TRACKING_SERVICE, -EIO, "STATUS_NO_TRACKING_SERVICE"},
927 {STATUS_SERVER_SID_MISMATCH, -EIO, "STATUS_SERVER_SID_MISMATCH"},
928 {STATUS_DS_NO_ATTRIBUTE_OR_VALUE, -EIO,
929 "STATUS_DS_NO_ATTRIBUTE_OR_VALUE"},
930 {STATUS_DS_INVALID_ATTRIBUTE_SYNTAX, -EIO,
931 "STATUS_DS_INVALID_ATTRIBUTE_SYNTAX"},
932 {STATUS_DS_ATTRIBUTE_TYPE_UNDEFINED, -EIO,
933 "STATUS_DS_ATTRIBUTE_TYPE_UNDEFINED"},
934 {STATUS_DS_ATTRIBUTE_OR_VALUE_EXISTS, -EIO,
935 "STATUS_DS_ATTRIBUTE_OR_VALUE_EXISTS"},
936 {STATUS_DS_BUSY, -EBUSY, "STATUS_DS_BUSY"},
937 {STATUS_DS_UNAVAILABLE, -EIO, "STATUS_DS_UNAVAILABLE"},
938 {STATUS_DS_NO_RIDS_ALLOCATED, -EIO, "STATUS_DS_NO_RIDS_ALLOCATED"},
939 {STATUS_DS_NO_MORE_RIDS, -EIO, "STATUS_DS_NO_MORE_RIDS"},
940 {STATUS_DS_INCORRECT_ROLE_OWNER, -EIO,
941 "STATUS_DS_INCORRECT_ROLE_OWNER"},
942 {STATUS_DS_RIDMGR_INIT_ERROR, -EIO, "STATUS_DS_RIDMGR_INIT_ERROR"},
943 {STATUS_DS_OBJ_CLASS_VIOLATION, -EIO, "STATUS_DS_OBJ_CLASS_VIOLATION"},
944 {STATUS_DS_CANT_ON_NON_LEAF, -EIO, "STATUS_DS_CANT_ON_NON_LEAF"},
945 {STATUS_DS_CANT_ON_RDN, -EIO, "STATUS_DS_CANT_ON_RDN"},
946 {STATUS_DS_CANT_MOD_OBJ_CLASS, -EIO, "STATUS_DS_CANT_MOD_OBJ_CLASS"},
947 {STATUS_DS_CROSS_DOM_MOVE_FAILED, -EIO,
948 "STATUS_DS_CROSS_DOM_MOVE_FAILED"},
949 {STATUS_DS_GC_NOT_AVAILABLE, -EIO, "STATUS_DS_GC_NOT_AVAILABLE"},
950 {STATUS_DIRECTORY_SERVICE_REQUIRED, -EIO,
951 "STATUS_DIRECTORY_SERVICE_REQUIRED"},
952 {STATUS_REPARSE_ATTRIBUTE_CONFLICT, -EIO,
953 "STATUS_REPARSE_ATTRIBUTE_CONFLICT"},
954 {STATUS_CANT_ENABLE_DENY_ONLY, -EIO, "STATUS_CANT_ENABLE_DENY_ONLY"},
955 {STATUS_FLOAT_MULTIPLE_FAULTS, -EIO, "STATUS_FLOAT_MULTIPLE_FAULTS"},
956 {STATUS_FLOAT_MULTIPLE_TRAPS, -EIO, "STATUS_FLOAT_MULTIPLE_TRAPS"},
957 {STATUS_DEVICE_REMOVED, -EIO, "STATUS_DEVICE_REMOVED"},
958 {STATUS_JOURNAL_DELETE_IN_PROGRESS, -EIO,
959 "STATUS_JOURNAL_DELETE_IN_PROGRESS"},
960 {STATUS_JOURNAL_NOT_ACTIVE, -EIO, "STATUS_JOURNAL_NOT_ACTIVE"},
961 {STATUS_NOINTERFACE, -EIO, "STATUS_NOINTERFACE"},
962 {STATUS_DS_ADMIN_LIMIT_EXCEEDED, -EIO,
963 "STATUS_DS_ADMIN_LIMIT_EXCEEDED"},
964 {STATUS_DRIVER_FAILED_SLEEP, -EIO, "STATUS_DRIVER_FAILED_SLEEP"},
965 {STATUS_MUTUAL_AUTHENTICATION_FAILED, -EIO,
966 "STATUS_MUTUAL_AUTHENTICATION_FAILED"},
967 {STATUS_CORRUPT_SYSTEM_FILE, -EIO, "STATUS_CORRUPT_SYSTEM_FILE"},
968 {STATUS_DATATYPE_MISALIGNMENT_ERROR, -EIO,
969 "STATUS_DATATYPE_MISALIGNMENT_ERROR"},
970 {STATUS_WMI_READ_ONLY, -EROFS, "STATUS_WMI_READ_ONLY"},
971 {STATUS_WMI_SET_FAILURE, -EIO, "STATUS_WMI_SET_FAILURE"},
972 {STATUS_COMMITMENT_MINIMUM, -EIO, "STATUS_COMMITMENT_MINIMUM"},
973 {STATUS_REG_NAT_CONSUMPTION, -EIO, "STATUS_REG_NAT_CONSUMPTION"},
974 {STATUS_TRANSPORT_FULL, -EIO, "STATUS_TRANSPORT_FULL"},
975 {STATUS_DS_SAM_INIT_FAILURE, -EIO, "STATUS_DS_SAM_INIT_FAILURE"},
976 {STATUS_ONLY_IF_CONNECTED, -EIO, "STATUS_ONLY_IF_CONNECTED"},
977 {STATUS_DS_SENSITIVE_GROUP_VIOLATION, -EIO,
978 "STATUS_DS_SENSITIVE_GROUP_VIOLATION"},
979 {STATUS_PNP_RESTART_ENUMERATION, -EIO,
980 "STATUS_PNP_RESTART_ENUMERATION"},
981 {STATUS_JOURNAL_ENTRY_DELETED, -EIO, "STATUS_JOURNAL_ENTRY_DELETED"},
982 {STATUS_DS_CANT_MOD_PRIMARYGROUPID, -EIO,
983 "STATUS_DS_CANT_MOD_PRIMARYGROUPID"},
984 {STATUS_SYSTEM_IMAGE_BAD_SIGNATURE, -EIO,
985 "STATUS_SYSTEM_IMAGE_BAD_SIGNATURE"},
986 {STATUS_PNP_REBOOT_REQUIRED, -EIO, "STATUS_PNP_REBOOT_REQUIRED"},
987 {STATUS_POWER_STATE_INVALID, -EIO, "STATUS_POWER_STATE_INVALID"},
988 {STATUS_DS_INVALID_GROUP_TYPE, -EIO, "STATUS_DS_INVALID_GROUP_TYPE"},
989 {STATUS_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN, -EIO,
990 "STATUS_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN"},
991 {STATUS_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN, -EIO,
992 "STATUS_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN"},
993 {STATUS_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER, -EIO,
994 "STATUS_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER"},
995 {STATUS_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER, -EIO,
996 "STATUS_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER"},
997 {STATUS_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER, -EIO,
998 "STATUS_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER"},
999 {STATUS_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER, -EIO,
1000 "STATUS_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER"},
1001 {STATUS_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER, -EIO,
1002 "STATUS_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER"},
1003 {STATUS_DS_HAVE_PRIMARY_MEMBERS, -EIO,
1004 "STATUS_DS_HAVE_PRIMARY_MEMBERS"},
1005 {STATUS_WMI_NOT_SUPPORTED, -EOPNOTSUPP, "STATUS_WMI_NOT_SUPPORTED"},
1006 {STATUS_INSUFFICIENT_POWER, -EIO, "STATUS_INSUFFICIENT_POWER"},
1007 {STATUS_SAM_NEED_BOOTKEY_PASSWORD, -EIO,
1008 "STATUS_SAM_NEED_BOOTKEY_PASSWORD"},
1009 {STATUS_SAM_NEED_BOOTKEY_FLOPPY, -EIO,
1010 "STATUS_SAM_NEED_BOOTKEY_FLOPPY"},
1011 {STATUS_DS_CANT_START, -EIO, "STATUS_DS_CANT_START"},
1012 {STATUS_DS_INIT_FAILURE, -EIO, "STATUS_DS_INIT_FAILURE"},
1013 {STATUS_SAM_INIT_FAILURE, -EIO, "STATUS_SAM_INIT_FAILURE"},
1014 {STATUS_DS_GC_REQUIRED, -EIO, "STATUS_DS_GC_REQUIRED"},
1015 {STATUS_DS_LOCAL_MEMBER_OF_LOCAL_ONLY, -EIO,
1016 "STATUS_DS_LOCAL_MEMBER_OF_LOCAL_ONLY"},
1017 {STATUS_DS_NO_FPO_IN_UNIVERSAL_GROUPS, -EIO,
1018 "STATUS_DS_NO_FPO_IN_UNIVERSAL_GROUPS"},
1019 {STATUS_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED, -EDQUOT,
1020 "STATUS_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED"},
1021 {STATUS_MULTIPLE_FAULT_VIOLATION, -EIO,
1022 "STATUS_MULTIPLE_FAULT_VIOLATION"},
1023 {STATUS_CURRENT_DOMAIN_NOT_ALLOWED, -EIO,
1024 "STATUS_CURRENT_DOMAIN_NOT_ALLOWED"},
1025 {STATUS_CANNOT_MAKE, -EIO, "STATUS_CANNOT_MAKE"},
1026 {STATUS_SYSTEM_SHUTDOWN, -EIO, "STATUS_SYSTEM_SHUTDOWN"},
1027 {STATUS_DS_INIT_FAILURE_CONSOLE, -EIO,
1028 "STATUS_DS_INIT_FAILURE_CONSOLE"},
1029 {STATUS_DS_SAM_INIT_FAILURE_CONSOLE, -EIO,
1030 "STATUS_DS_SAM_INIT_FAILURE_CONSOLE"},
1031 {STATUS_UNFINISHED_CONTEXT_DELETED, -EIO,
1032 "STATUS_UNFINISHED_CONTEXT_DELETED"},
1033 {STATUS_NO_TGT_REPLY, -EIO, "STATUS_NO_TGT_REPLY"},
1034 {STATUS_OBJECTID_NOT_FOUND, -EIO, "STATUS_OBJECTID_NOT_FOUND"},
1035 {STATUS_NO_IP_ADDRESSES, -EIO, "STATUS_NO_IP_ADDRESSES"},
1036 {STATUS_WRONG_CREDENTIAL_HANDLE, -EIO,
1037 "STATUS_WRONG_CREDENTIAL_HANDLE"},
1038 {STATUS_CRYPTO_SYSTEM_INVALID, -EIO, "STATUS_CRYPTO_SYSTEM_INVALID"},
1039 {STATUS_MAX_REFERRALS_EXCEEDED, -EIO, "STATUS_MAX_REFERRALS_EXCEEDED"},
1040 {STATUS_MUST_BE_KDC, -EIO, "STATUS_MUST_BE_KDC"},
1041 {STATUS_STRONG_CRYPTO_NOT_SUPPORTED, -EIO,
1042 "STATUS_STRONG_CRYPTO_NOT_SUPPORTED"},
1043 {STATUS_TOO_MANY_PRINCIPALS, -EIO, "STATUS_TOO_MANY_PRINCIPALS"},
1044 {STATUS_NO_PA_DATA, -EIO, "STATUS_NO_PA_DATA"},
1045 {STATUS_PKINIT_NAME_MISMATCH, -EIO, "STATUS_PKINIT_NAME_MISMATCH"},
1046 {STATUS_SMARTCARD_LOGON_REQUIRED, -EIO,
1047 "STATUS_SMARTCARD_LOGON_REQUIRED"},
1048 {STATUS_KDC_INVALID_REQUEST, -EIO, "STATUS_KDC_INVALID_REQUEST"},
1049 {STATUS_KDC_UNABLE_TO_REFER, -EIO, "STATUS_KDC_UNABLE_TO_REFER"},
1050 {STATUS_KDC_UNKNOWN_ETYPE, -EIO, "STATUS_KDC_UNKNOWN_ETYPE"},
1051 {STATUS_SHUTDOWN_IN_PROGRESS, -EIO, "STATUS_SHUTDOWN_IN_PROGRESS"},
1052 {STATUS_SERVER_SHUTDOWN_IN_PROGRESS, -EIO,
1053 "STATUS_SERVER_SHUTDOWN_IN_PROGRESS"},
1054 {STATUS_NOT_SUPPORTED_ON_SBS, -EOPNOTSUPP,
1055 "STATUS_NOT_SUPPORTED_ON_SBS"},
1056 {STATUS_WMI_GUID_DISCONNECTED, -EIO, "STATUS_WMI_GUID_DISCONNECTED"},
1057 {STATUS_WMI_ALREADY_DISABLED, -EIO, "STATUS_WMI_ALREADY_DISABLED"},
1058 {STATUS_WMI_ALREADY_ENABLED, -EIO, "STATUS_WMI_ALREADY_ENABLED"},
1059 {STATUS_MFT_TOO_FRAGMENTED, -EIO, "STATUS_MFT_TOO_FRAGMENTED"},
1060 {STATUS_COPY_PROTECTION_FAILURE, -EIO,
1061 "STATUS_COPY_PROTECTION_FAILURE"},
1062 {STATUS_CSS_AUTHENTICATION_FAILURE, -EIO,
1063 "STATUS_CSS_AUTHENTICATION_FAILURE"},
1064 {STATUS_CSS_KEY_NOT_PRESENT, -EIO, "STATUS_CSS_KEY_NOT_PRESENT"},
1065 {STATUS_CSS_KEY_NOT_ESTABLISHED, -EIO,
1066 "STATUS_CSS_KEY_NOT_ESTABLISHED"},
1067 {STATUS_CSS_SCRAMBLED_SECTOR, -EIO, "STATUS_CSS_SCRAMBLED_SECTOR"},
1068 {STATUS_CSS_REGION_MISMATCH, -EIO, "STATUS_CSS_REGION_MISMATCH"},
1069 {STATUS_CSS_RESETS_EXHAUSTED, -EIO, "STATUS_CSS_RESETS_EXHAUSTED"},
1070 {STATUS_PKINIT_FAILURE, -EIO, "STATUS_PKINIT_FAILURE"},
1071 {STATUS_SMARTCARD_SUBSYSTEM_FAILURE, -EIO,
1072 "STATUS_SMARTCARD_SUBSYSTEM_FAILURE"},
1073 {STATUS_NO_KERB_KEY, -EIO, "STATUS_NO_KERB_KEY"},
1074 {STATUS_HOST_DOWN, -EIO, "STATUS_HOST_DOWN"},
1075 {STATUS_UNSUPPORTED_PREAUTH, -EIO, "STATUS_UNSUPPORTED_PREAUTH"},
1076 {STATUS_EFS_ALG_BLOB_TOO_BIG, -EIO, "STATUS_EFS_ALG_BLOB_TOO_BIG"},
1077 {STATUS_PORT_NOT_SET, -EIO, "STATUS_PORT_NOT_SET"},
1078 {STATUS_DEBUGGER_INACTIVE, -EIO, "STATUS_DEBUGGER_INACTIVE"},
1079 {STATUS_DS_VERSION_CHECK_FAILURE, -EIO,
1080 "STATUS_DS_VERSION_CHECK_FAILURE"},
1081 {STATUS_AUDITING_DISABLED, -EIO, "STATUS_AUDITING_DISABLED"},
1082 {STATUS_PRENT4_MACHINE_ACCOUNT, -EIO, "STATUS_PRENT4_MACHINE_ACCOUNT"},
1083 {STATUS_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER, -EIO,
1084 "STATUS_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER"},
1085 {STATUS_INVALID_IMAGE_WIN_32, -EIO, "STATUS_INVALID_IMAGE_WIN_32"},
1086 {STATUS_INVALID_IMAGE_WIN_64, -EIO, "STATUS_INVALID_IMAGE_WIN_64"},
1087 {STATUS_BAD_BINDINGS, -EIO, "STATUS_BAD_BINDINGS"},
1088 {STATUS_NETWORK_SESSION_EXPIRED, -EIO,
1089 "STATUS_NETWORK_SESSION_EXPIRED"},
1090 {STATUS_APPHELP_BLOCK, -EIO, "STATUS_APPHELP_BLOCK"},
1091 {STATUS_ALL_SIDS_FILTERED, -EIO, "STATUS_ALL_SIDS_FILTERED"},
1092 {STATUS_NOT_SAFE_MODE_DRIVER, -EIO, "STATUS_NOT_SAFE_MODE_DRIVER"},
1093 {STATUS_ACCESS_DISABLED_BY_POLICY_DEFAULT, -EACCES,
1094 "STATUS_ACCESS_DISABLED_BY_POLICY_DEFAULT"},
1095 {STATUS_ACCESS_DISABLED_BY_POLICY_PATH, -EACCES,
1096 "STATUS_ACCESS_DISABLED_BY_POLICY_PATH"},
1097 {STATUS_ACCESS_DISABLED_BY_POLICY_PUBLISHER, -EACCES,
1098 "STATUS_ACCESS_DISABLED_BY_POLICY_PUBLISHER"},
1099 {STATUS_ACCESS_DISABLED_BY_POLICY_OTHER, -EACCES,
1100 "STATUS_ACCESS_DISABLED_BY_POLICY_OTHER"},
1101 {STATUS_FAILED_DRIVER_ENTRY, -EIO, "STATUS_FAILED_DRIVER_ENTRY"},
1102 {STATUS_DEVICE_ENUMERATION_ERROR, -EIO,
1103 "STATUS_DEVICE_ENUMERATION_ERROR"},
1104 {STATUS_MOUNT_POINT_NOT_RESOLVED, -EIO,
1105 "STATUS_MOUNT_POINT_NOT_RESOLVED"},
1106 {STATUS_INVALID_DEVICE_OBJECT_PARAMETER, -EIO,
1107 "STATUS_INVALID_DEVICE_OBJECT_PARAMETER"},
1108 {STATUS_MCA_OCCURED, -EIO, "STATUS_MCA_OCCURED"},
1109 {STATUS_DRIVER_BLOCKED_CRITICAL, -EIO,
1110 "STATUS_DRIVER_BLOCKED_CRITICAL"},
1111 {STATUS_DRIVER_BLOCKED, -EIO, "STATUS_DRIVER_BLOCKED"},
1112 {STATUS_DRIVER_DATABASE_ERROR, -EIO, "STATUS_DRIVER_DATABASE_ERROR"},
1113 {STATUS_SYSTEM_HIVE_TOO_LARGE, -EIO, "STATUS_SYSTEM_HIVE_TOO_LARGE"},
1114 {STATUS_INVALID_IMPORT_OF_NON_DLL, -EIO,
1115 "STATUS_INVALID_IMPORT_OF_NON_DLL"},
1116 {STATUS_NO_SECRETS, -EIO, "STATUS_NO_SECRETS"},
1117 {STATUS_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY, -EACCES,
1118 "STATUS_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY"},
1119 {STATUS_FAILED_STACK_SWITCH, -EIO, "STATUS_FAILED_STACK_SWITCH"},
1120 {STATUS_HEAP_CORRUPTION, -EIO, "STATUS_HEAP_CORRUPTION"},
1121 {STATUS_SMARTCARD_WRONG_PIN, -EIO, "STATUS_SMARTCARD_WRONG_PIN"},
1122 {STATUS_SMARTCARD_CARD_BLOCKED, -EIO, "STATUS_SMARTCARD_CARD_BLOCKED"},
1123 {STATUS_SMARTCARD_CARD_NOT_AUTHENTICATED, -EIO,
1124 "STATUS_SMARTCARD_CARD_NOT_AUTHENTICATED"},
1125 {STATUS_SMARTCARD_NO_CARD, -EIO, "STATUS_SMARTCARD_NO_CARD"},
1126 {STATUS_SMARTCARD_NO_KEY_CONTAINER, -EIO,
1127 "STATUS_SMARTCARD_NO_KEY_CONTAINER"},
1128 {STATUS_SMARTCARD_NO_CERTIFICATE, -EIO,
1129 "STATUS_SMARTCARD_NO_CERTIFICATE"},
1130 {STATUS_SMARTCARD_NO_KEYSET, -EIO, "STATUS_SMARTCARD_NO_KEYSET"},
1131 {STATUS_SMARTCARD_IO_ERROR, -EIO, "STATUS_SMARTCARD_IO_ERROR"},
1132 {STATUS_DOWNGRADE_DETECTED, -EIO, "STATUS_DOWNGRADE_DETECTED"},
1133 {STATUS_SMARTCARD_CERT_REVOKED, -EIO, "STATUS_SMARTCARD_CERT_REVOKED"},
1134 {STATUS_ISSUING_CA_UNTRUSTED, -EIO, "STATUS_ISSUING_CA_UNTRUSTED"},
1135 {STATUS_REVOCATION_OFFLINE_C, -EIO, "STATUS_REVOCATION_OFFLINE_C"},
1136 {STATUS_PKINIT_CLIENT_FAILURE, -EIO, "STATUS_PKINIT_CLIENT_FAILURE"},
1137 {STATUS_SMARTCARD_CERT_EXPIRED, -EIO, "STATUS_SMARTCARD_CERT_EXPIRED"},
1138 {STATUS_DRIVER_FAILED_PRIOR_UNLOAD, -EIO,
1139 "STATUS_DRIVER_FAILED_PRIOR_UNLOAD"},
1140 {STATUS_SMARTCARD_SILENT_CONTEXT, -EIO,
1141 "STATUS_SMARTCARD_SILENT_CONTEXT"},
1142 {STATUS_PER_USER_TRUST_QUOTA_EXCEEDED, -EDQUOT,
1143 "STATUS_PER_USER_TRUST_QUOTA_EXCEEDED"},
1144 {STATUS_ALL_USER_TRUST_QUOTA_EXCEEDED, -EDQUOT,
1145 "STATUS_ALL_USER_TRUST_QUOTA_EXCEEDED"},
1146 {STATUS_USER_DELETE_TRUST_QUOTA_EXCEEDED, -EDQUOT,
1147 "STATUS_USER_DELETE_TRUST_QUOTA_EXCEEDED"},
1148 {STATUS_DS_NAME_NOT_UNIQUE, -EIO, "STATUS_DS_NAME_NOT_UNIQUE"},
1149 {STATUS_DS_DUPLICATE_ID_FOUND, -EIO, "STATUS_DS_DUPLICATE_ID_FOUND"},
1150 {STATUS_DS_GROUP_CONVERSION_ERROR, -EIO,
1151 "STATUS_DS_GROUP_CONVERSION_ERROR"},
1152 {STATUS_VOLSNAP_PREPARE_HIBERNATE, -EIO,
1153 "STATUS_VOLSNAP_PREPARE_HIBERNATE"},
1154 {STATUS_USER2USER_REQUIRED, -EIO, "STATUS_USER2USER_REQUIRED"},
1155 {STATUS_STACK_BUFFER_OVERRUN, -EIO, "STATUS_STACK_BUFFER_OVERRUN"},
1156 {STATUS_NO_S4U_PROT_SUPPORT, -EIO, "STATUS_NO_S4U_PROT_SUPPORT"},
1157 {STATUS_CROSSREALM_DELEGATION_FAILURE, -EIO,
1158 "STATUS_CROSSREALM_DELEGATION_FAILURE"},
1159 {STATUS_REVOCATION_OFFLINE_KDC, -EIO, "STATUS_REVOCATION_OFFLINE_KDC"},
1160 {STATUS_ISSUING_CA_UNTRUSTED_KDC, -EIO,
1161 "STATUS_ISSUING_CA_UNTRUSTED_KDC"},
1162 {STATUS_KDC_CERT_EXPIRED, -EIO, "STATUS_KDC_CERT_EXPIRED"},
1163 {STATUS_KDC_CERT_REVOKED, -EIO, "STATUS_KDC_CERT_REVOKED"},
1164 {STATUS_PARAMETER_QUOTA_EXCEEDED, -EDQUOT,
1165 "STATUS_PARAMETER_QUOTA_EXCEEDED"},
1166 {STATUS_HIBERNATION_FAILURE, -EIO, "STATUS_HIBERNATION_FAILURE"},
1167 {STATUS_DELAY_LOAD_FAILED, -EIO, "STATUS_DELAY_LOAD_FAILED"},
1168 {STATUS_AUTHENTICATION_FIREWALL_FAILED, -EIO,
1169 "STATUS_AUTHENTICATION_FIREWALL_FAILED"},
1170 {STATUS_VDM_DISALLOWED, -EIO, "STATUS_VDM_DISALLOWED"},
1171 {STATUS_HUNG_DISPLAY_DRIVER_THREAD, -EIO,
1172 "STATUS_HUNG_DISPLAY_DRIVER_THREAD"},
1173 {STATUS_INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE, -EIO,
1174 "STATUS_INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE"},
1175 {STATUS_INVALID_CRUNTIME_PARAMETER, -EIO,
1176 "STATUS_INVALID_CRUNTIME_PARAMETER"},
1177 {STATUS_NTLM_BLOCKED, -EIO, "STATUS_NTLM_BLOCKED"},
1178 {STATUS_ASSERTION_FAILURE, -EIO, "STATUS_ASSERTION_FAILURE"},
1179 {STATUS_VERIFIER_STOP, -EIO, "STATUS_VERIFIER_STOP"},
1180 {STATUS_CALLBACK_POP_STACK, -EIO, "STATUS_CALLBACK_POP_STACK"},
1181 {STATUS_INCOMPATIBLE_DRIVER_BLOCKED, -EIO,
1182 "STATUS_INCOMPATIBLE_DRIVER_BLOCKED"},
1183 {STATUS_HIVE_UNLOADED, -EIO, "STATUS_HIVE_UNLOADED"},
1184 {STATUS_COMPRESSION_DISABLED, -EIO, "STATUS_COMPRESSION_DISABLED"},
1185 {STATUS_FILE_SYSTEM_LIMITATION, -EIO, "STATUS_FILE_SYSTEM_LIMITATION"},
1186 {STATUS_INVALID_IMAGE_HASH, -EIO, "STATUS_INVALID_IMAGE_HASH"},
1187 {STATUS_NOT_CAPABLE, -EIO, "STATUS_NOT_CAPABLE"},
1188 {STATUS_REQUEST_OUT_OF_SEQUENCE, -EIO,
1189 "STATUS_REQUEST_OUT_OF_SEQUENCE"},
1190 {STATUS_IMPLEMENTATION_LIMIT, -EIO, "STATUS_IMPLEMENTATION_LIMIT"},
1191 {STATUS_ELEVATION_REQUIRED, -EIO, "STATUS_ELEVATION_REQUIRED"},
1192 {STATUS_BEYOND_VDL, -EIO, "STATUS_BEYOND_VDL"},
1193 {STATUS_ENCOUNTERED_WRITE_IN_PROGRESS, -EIO,
1194 "STATUS_ENCOUNTERED_WRITE_IN_PROGRESS"},
1195 {STATUS_PTE_CHANGED, -EIO, "STATUS_PTE_CHANGED"},
1196 {STATUS_PURGE_FAILED, -EIO, "STATUS_PURGE_FAILED"},
1197 {STATUS_CRED_REQUIRES_CONFIRMATION, -EIO,
1198 "STATUS_CRED_REQUIRES_CONFIRMATION"},
1199 {STATUS_CS_ENCRYPTION_INVALID_SERVER_RESPONSE, -EIO,
1200 "STATUS_CS_ENCRYPTION_INVALID_SERVER_RESPONSE"},
1201 {STATUS_CS_ENCRYPTION_UNSUPPORTED_SERVER, -EIO,
1202 "STATUS_CS_ENCRYPTION_UNSUPPORTED_SERVER"},
1203 {STATUS_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE, -EIO,
1204 "STATUS_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE"},
1205 {STATUS_CS_ENCRYPTION_NEW_ENCRYPTED_FILE, -EIO,
1206 "STATUS_CS_ENCRYPTION_NEW_ENCRYPTED_FILE"},
1207 {STATUS_CS_ENCRYPTION_FILE_NOT_CSE, -EIO,
1208 "STATUS_CS_ENCRYPTION_FILE_NOT_CSE"},
1209 {STATUS_INVALID_LABEL, -EIO, "STATUS_INVALID_LABEL"},
1210 {STATUS_DRIVER_PROCESS_TERMINATED, -EIO,
1211 "STATUS_DRIVER_PROCESS_TERMINATED"},
1212 {STATUS_AMBIGUOUS_SYSTEM_DEVICE, -EIO,
1213 "STATUS_AMBIGUOUS_SYSTEM_DEVICE"},
1214 {STATUS_SYSTEM_DEVICE_NOT_FOUND, -EIO,
1215 "STATUS_SYSTEM_DEVICE_NOT_FOUND"},
1216 {STATUS_RESTART_BOOT_APPLICATION, -EIO,
1217 "STATUS_RESTART_BOOT_APPLICATION"},
1218 {STATUS_INVALID_TASK_NAME, -EIO, "STATUS_INVALID_TASK_NAME"},
1219 {STATUS_INVALID_TASK_INDEX, -EIO, "STATUS_INVALID_TASK_INDEX"},
1220 {STATUS_THREAD_ALREADY_IN_TASK, -EIO, "STATUS_THREAD_ALREADY_IN_TASK"},
1221 {STATUS_CALLBACK_BYPASS, -EIO, "STATUS_CALLBACK_BYPASS"},
1222 {STATUS_PORT_CLOSED, -EIO, "STATUS_PORT_CLOSED"},
1223 {STATUS_MESSAGE_LOST, -EIO, "STATUS_MESSAGE_LOST"},
1224 {STATUS_INVALID_MESSAGE, -EIO, "STATUS_INVALID_MESSAGE"},
1225 {STATUS_REQUEST_CANCELED, -EIO, "STATUS_REQUEST_CANCELED"},
1226 {STATUS_RECURSIVE_DISPATCH, -EIO, "STATUS_RECURSIVE_DISPATCH"},
1227 {STATUS_LPC_RECEIVE_BUFFER_EXPECTED, -EIO,
1228 "STATUS_LPC_RECEIVE_BUFFER_EXPECTED"},
1229 {STATUS_LPC_INVALID_CONNECTION_USAGE, -EIO,
1230 "STATUS_LPC_INVALID_CONNECTION_USAGE"},
1231 {STATUS_LPC_REQUESTS_NOT_ALLOWED, -EIO,
1232 "STATUS_LPC_REQUESTS_NOT_ALLOWED"},
1233 {STATUS_RESOURCE_IN_USE, -EIO, "STATUS_RESOURCE_IN_USE"},
1234 {STATUS_HARDWARE_MEMORY_ERROR, -EIO, "STATUS_HARDWARE_MEMORY_ERROR"},
1235 {STATUS_THREADPOOL_HANDLE_EXCEPTION, -EIO,
1236 "STATUS_THREADPOOL_HANDLE_EXCEPTION"},
1237 {STATUS_THREADPOOL_SET_EVENT_ON_COMPLETION_FAILED, -EIO,
1238 "STATUS_THREADPOOL_SET_EVENT_ON_COMPLETION_FAILED"},
1239 {STATUS_THREADPOOL_RELEASE_SEMAPHORE_ON_COMPLETION_FAILED, -EIO,
1240 "STATUS_THREADPOOL_RELEASE_SEMAPHORE_ON_COMPLETION_FAILED"},
1241 {STATUS_THREADPOOL_RELEASE_MUTEX_ON_COMPLETION_FAILED, -EIO,
1242 "STATUS_THREADPOOL_RELEASE_MUTEX_ON_COMPLETION_FAILED"},
1243 {STATUS_THREADPOOL_FREE_LIBRARY_ON_COMPLETION_FAILED, -EIO,
1244 "STATUS_THREADPOOL_FREE_LIBRARY_ON_COMPLETION_FAILED"},
1245 {STATUS_THREADPOOL_RELEASED_DURING_OPERATION, -EIO,
1246 "STATUS_THREADPOOL_RELEASED_DURING_OPERATION"},
1247 {STATUS_CALLBACK_RETURNED_WHILE_IMPERSONATING, -EIO,
1248 "STATUS_CALLBACK_RETURNED_WHILE_IMPERSONATING"},
1249 {STATUS_APC_RETURNED_WHILE_IMPERSONATING, -EIO,
1250 "STATUS_APC_RETURNED_WHILE_IMPERSONATING"},
1251 {STATUS_PROCESS_IS_PROTECTED, -EIO, "STATUS_PROCESS_IS_PROTECTED"},
1252 {STATUS_MCA_EXCEPTION, -EIO, "STATUS_MCA_EXCEPTION"},
1253 {STATUS_CERTIFICATE_MAPPING_NOT_UNIQUE, -EIO,
1254 "STATUS_CERTIFICATE_MAPPING_NOT_UNIQUE"},
1255 {STATUS_SYMLINK_CLASS_DISABLED, -EIO, "STATUS_SYMLINK_CLASS_DISABLED"},
1256 {STATUS_INVALID_IDN_NORMALIZATION, -EIO,
1257 "STATUS_INVALID_IDN_NORMALIZATION"},
1258 {STATUS_NO_UNICODE_TRANSLATION, -EIO, "STATUS_NO_UNICODE_TRANSLATION"},
1259 {STATUS_ALREADY_REGISTERED, -EIO, "STATUS_ALREADY_REGISTERED"},
1260 {STATUS_CONTEXT_MISMATCH, -EIO, "STATUS_CONTEXT_MISMATCH"},
1261 {STATUS_PORT_ALREADY_HAS_COMPLETION_LIST, -EIO,
1262 "STATUS_PORT_ALREADY_HAS_COMPLETION_LIST"},
1263 {STATUS_CALLBACK_RETURNED_THREAD_PRIORITY, -EIO,
1264 "STATUS_CALLBACK_RETURNED_THREAD_PRIORITY"},
1265 {STATUS_INVALID_THREAD, -EIO, "STATUS_INVALID_THREAD"},
1266 {STATUS_CALLBACK_RETURNED_TRANSACTION, -EIO,
1267 "STATUS_CALLBACK_RETURNED_TRANSACTION"},
1268 {STATUS_CALLBACK_RETURNED_LDR_LOCK, -EIO,
1269 "STATUS_CALLBACK_RETURNED_LDR_LOCK"},
1270 {STATUS_CALLBACK_RETURNED_LANG, -EIO, "STATUS_CALLBACK_RETURNED_LANG"},
1271 {STATUS_CALLBACK_RETURNED_PRI_BACK, -EIO,
1272 "STATUS_CALLBACK_RETURNED_PRI_BACK"},
1273 {STATUS_CALLBACK_RETURNED_THREAD_AFFINITY, -EIO,
1274 "STATUS_CALLBACK_RETURNED_THREAD_AFFINITY"},
1275 {STATUS_DISK_REPAIR_DISABLED, -EIO, "STATUS_DISK_REPAIR_DISABLED"},
1276 {STATUS_DS_DOMAIN_RENAME_IN_PROGRESS, -EIO,
1277 "STATUS_DS_DOMAIN_RENAME_IN_PROGRESS"},
1278 {STATUS_DISK_QUOTA_EXCEEDED, -EDQUOT, "STATUS_DISK_QUOTA_EXCEEDED"},
1279 {STATUS_CONTENT_BLOCKED, -EIO, "STATUS_CONTENT_BLOCKED"},
1280 {STATUS_BAD_CLUSTERS, -EIO, "STATUS_BAD_CLUSTERS"},
1281 {STATUS_VOLUME_DIRTY, -EIO, "STATUS_VOLUME_DIRTY"},
1282 {STATUS_FILE_CHECKED_OUT, -EIO, "STATUS_FILE_CHECKED_OUT"},
1283 {STATUS_CHECKOUT_REQUIRED, -EIO, "STATUS_CHECKOUT_REQUIRED"},
1284 {STATUS_BAD_FILE_TYPE, -EIO, "STATUS_BAD_FILE_TYPE"},
1285 {STATUS_FILE_TOO_LARGE, -EIO, "STATUS_FILE_TOO_LARGE"},
1286 {STATUS_FORMS_AUTH_REQUIRED, -EIO, "STATUS_FORMS_AUTH_REQUIRED"},
1287 {STATUS_VIRUS_INFECTED, -EIO, "STATUS_VIRUS_INFECTED"},
1288 {STATUS_VIRUS_DELETED, -EIO, "STATUS_VIRUS_DELETED"},
1289 {STATUS_BAD_MCFG_TABLE, -EIO, "STATUS_BAD_MCFG_TABLE"},
1290 {STATUS_WOW_ASSERTION, -EIO, "STATUS_WOW_ASSERTION"},
1291 {STATUS_INVALID_SIGNATURE, -EIO, "STATUS_INVALID_SIGNATURE"},
1292 {STATUS_HMAC_NOT_SUPPORTED, -EIO, "STATUS_HMAC_NOT_SUPPORTED"},
1293 {STATUS_IPSEC_QUEUE_OVERFLOW, -EIO, "STATUS_IPSEC_QUEUE_OVERFLOW"},
1294 {STATUS_ND_QUEUE_OVERFLOW, -EIO, "STATUS_ND_QUEUE_OVERFLOW"},
1295 {STATUS_HOPLIMIT_EXCEEDED, -EIO, "STATUS_HOPLIMIT_EXCEEDED"},
1296 {STATUS_PROTOCOL_NOT_SUPPORTED, -EOPNOTSUPP,
1297 "STATUS_PROTOCOL_NOT_SUPPORTED"},
1298 {STATUS_LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED, -EIO,
1299 "STATUS_LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED"},
1300 {STATUS_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR, -EIO,
1301 "STATUS_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR"},
1302 {STATUS_LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR, -EIO,
1303 "STATUS_LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR"},
1304 {STATUS_XML_PARSE_ERROR, -EIO, "STATUS_XML_PARSE_ERROR"},
1305 {STATUS_XMLDSIG_ERROR, -EIO, "STATUS_XMLDSIG_ERROR"},
1306 {STATUS_WRONG_COMPARTMENT, -EIO, "STATUS_WRONG_COMPARTMENT"},
1307 {STATUS_AUTHIP_FAILURE, -EIO, "STATUS_AUTHIP_FAILURE"},
1308 {DBG_NO_STATE_CHANGE, -EIO, "DBG_NO_STATE_CHANGE"},
1309 {DBG_APP_NOT_IDLE, -EIO, "DBG_APP_NOT_IDLE"},
1310 {RPC_NT_INVALID_STRING_BINDING, -EIO, "RPC_NT_INVALID_STRING_BINDING"},
1311 {RPC_NT_WRONG_KIND_OF_BINDING, -EIO, "RPC_NT_WRONG_KIND_OF_BINDING"},
1312 {RPC_NT_INVALID_BINDING, -EIO, "RPC_NT_INVALID_BINDING"},
1313 {RPC_NT_PROTSEQ_NOT_SUPPORTED, -EOPNOTSUPP,
1314 "RPC_NT_PROTSEQ_NOT_SUPPORTED"},
1315 {RPC_NT_INVALID_RPC_PROTSEQ, -EIO, "RPC_NT_INVALID_RPC_PROTSEQ"},
1316 {RPC_NT_INVALID_STRING_UUID, -EIO, "RPC_NT_INVALID_STRING_UUID"},
1317 {RPC_NT_INVALID_ENDPOINT_FORMAT, -EIO,
1318 "RPC_NT_INVALID_ENDPOINT_FORMAT"},
1319 {RPC_NT_INVALID_NET_ADDR, -EIO, "RPC_NT_INVALID_NET_ADDR"},
1320 {RPC_NT_NO_ENDPOINT_FOUND, -EIO, "RPC_NT_NO_ENDPOINT_FOUND"},
1321 {RPC_NT_INVALID_TIMEOUT, -EINVAL, "RPC_NT_INVALID_TIMEOUT"},
1322 {RPC_NT_OBJECT_NOT_FOUND, -ENOENT, "RPC_NT_OBJECT_NOT_FOUND"},
1323 {RPC_NT_ALREADY_REGISTERED, -EIO, "RPC_NT_ALREADY_REGISTERED"},
1324 {RPC_NT_TYPE_ALREADY_REGISTERED, -EIO,
1325 "RPC_NT_TYPE_ALREADY_REGISTERED"},
1326 {RPC_NT_ALREADY_LISTENING, -EIO, "RPC_NT_ALREADY_LISTENING"},
1327 {RPC_NT_NO_PROTSEQS_REGISTERED, -EIO, "RPC_NT_NO_PROTSEQS_REGISTERED"},
1328 {RPC_NT_NOT_LISTENING, -EIO, "RPC_NT_NOT_LISTENING"},
1329 {RPC_NT_UNKNOWN_MGR_TYPE, -EIO, "RPC_NT_UNKNOWN_MGR_TYPE"},
1330 {RPC_NT_UNKNOWN_IF, -EIO, "RPC_NT_UNKNOWN_IF"},
1331 {RPC_NT_NO_BINDINGS, -EIO, "RPC_NT_NO_BINDINGS"},
1332 {RPC_NT_NO_PROTSEQS, -EIO, "RPC_NT_NO_PROTSEQS"},
1333 {RPC_NT_CANT_CREATE_ENDPOINT, -EIO, "RPC_NT_CANT_CREATE_ENDPOINT"},
1334 {RPC_NT_OUT_OF_RESOURCES, -EIO, "RPC_NT_OUT_OF_RESOURCES"},
1335 {RPC_NT_SERVER_UNAVAILABLE, -EIO, "RPC_NT_SERVER_UNAVAILABLE"},
1336 {RPC_NT_SERVER_TOO_BUSY, -EBUSY, "RPC_NT_SERVER_TOO_BUSY"},
1337 {RPC_NT_INVALID_NETWORK_OPTIONS, -EIO,
1338 "RPC_NT_INVALID_NETWORK_OPTIONS"},
1339 {RPC_NT_NO_CALL_ACTIVE, -EIO, "RPC_NT_NO_CALL_ACTIVE"},
1340 {RPC_NT_CALL_FAILED, -EIO, "RPC_NT_CALL_FAILED"},
1341 {RPC_NT_CALL_FAILED_DNE, -EIO, "RPC_NT_CALL_FAILED_DNE"},
1342 {RPC_NT_PROTOCOL_ERROR, -EIO, "RPC_NT_PROTOCOL_ERROR"},
1343 {RPC_NT_UNSUPPORTED_TRANS_SYN, -EIO, "RPC_NT_UNSUPPORTED_TRANS_SYN"},
1344 {RPC_NT_UNSUPPORTED_TYPE, -EIO, "RPC_NT_UNSUPPORTED_TYPE"},
1345 {RPC_NT_INVALID_TAG, -EIO, "RPC_NT_INVALID_TAG"},
1346 {RPC_NT_INVALID_BOUND, -EIO, "RPC_NT_INVALID_BOUND"},
1347 {RPC_NT_NO_ENTRY_NAME, -EIO, "RPC_NT_NO_ENTRY_NAME"},
1348 {RPC_NT_INVALID_NAME_SYNTAX, -EIO, "RPC_NT_INVALID_NAME_SYNTAX"},
1349 {RPC_NT_UNSUPPORTED_NAME_SYNTAX, -EIO,
1350 "RPC_NT_UNSUPPORTED_NAME_SYNTAX"},
1351 {RPC_NT_UUID_NO_ADDRESS, -EIO, "RPC_NT_UUID_NO_ADDRESS"},
1352 {RPC_NT_DUPLICATE_ENDPOINT, -ENOTUNIQ, "RPC_NT_DUPLICATE_ENDPOINT"},
1353 {RPC_NT_UNKNOWN_AUTHN_TYPE, -EIO, "RPC_NT_UNKNOWN_AUTHN_TYPE"},
1354 {RPC_NT_MAX_CALLS_TOO_SMALL, -EIO, "RPC_NT_MAX_CALLS_TOO_SMALL"},
1355 {RPC_NT_STRING_TOO_LONG, -EIO, "RPC_NT_STRING_TOO_LONG"},
1356 {RPC_NT_PROTSEQ_NOT_FOUND, -EIO, "RPC_NT_PROTSEQ_NOT_FOUND"},
1357 {RPC_NT_PROCNUM_OUT_OF_RANGE, -EIO, "RPC_NT_PROCNUM_OUT_OF_RANGE"},
1358 {RPC_NT_BINDING_HAS_NO_AUTH, -EIO, "RPC_NT_BINDING_HAS_NO_AUTH"},
1359 {RPC_NT_UNKNOWN_AUTHN_SERVICE, -EIO, "RPC_NT_UNKNOWN_AUTHN_SERVICE"},
1360 {RPC_NT_UNKNOWN_AUTHN_LEVEL, -EIO, "RPC_NT_UNKNOWN_AUTHN_LEVEL"},
1361 {RPC_NT_INVALID_AUTH_IDENTITY, -EIO, "RPC_NT_INVALID_AUTH_IDENTITY"},
1362 {RPC_NT_UNKNOWN_AUTHZ_SERVICE, -EIO, "RPC_NT_UNKNOWN_AUTHZ_SERVICE"},
1363 {EPT_NT_INVALID_ENTRY, -EIO, "EPT_NT_INVALID_ENTRY"},
1364 {EPT_NT_CANT_PERFORM_OP, -EIO, "EPT_NT_CANT_PERFORM_OP"},
1365 {EPT_NT_NOT_REGISTERED, -EIO, "EPT_NT_NOT_REGISTERED"},
1366 {RPC_NT_NOTHING_TO_EXPORT, -EIO, "RPC_NT_NOTHING_TO_EXPORT"},
1367 {RPC_NT_INCOMPLETE_NAME, -EIO, "RPC_NT_INCOMPLETE_NAME"},
1368 {RPC_NT_INVALID_VERS_OPTION, -EIO, "RPC_NT_INVALID_VERS_OPTION"},
1369 {RPC_NT_NO_MORE_MEMBERS, -EIO, "RPC_NT_NO_MORE_MEMBERS"},
1370 {RPC_NT_NOT_ALL_OBJS_UNEXPORTED, -EIO,
1371 "RPC_NT_NOT_ALL_OBJS_UNEXPORTED"},
1372 {RPC_NT_INTERFACE_NOT_FOUND, -EIO, "RPC_NT_INTERFACE_NOT_FOUND"},
1373 {RPC_NT_ENTRY_ALREADY_EXISTS, -EIO, "RPC_NT_ENTRY_ALREADY_EXISTS"},
1374 {RPC_NT_ENTRY_NOT_FOUND, -EIO, "RPC_NT_ENTRY_NOT_FOUND"},
1375 {RPC_NT_NAME_SERVICE_UNAVAILABLE, -EIO,
1376 "RPC_NT_NAME_SERVICE_UNAVAILABLE"},
1377 {RPC_NT_INVALID_NAF_ID, -EIO, "RPC_NT_INVALID_NAF_ID"},
1378 {RPC_NT_CANNOT_SUPPORT, -EOPNOTSUPP, "RPC_NT_CANNOT_SUPPORT"},
1379 {RPC_NT_NO_CONTEXT_AVAILABLE, -EIO, "RPC_NT_NO_CONTEXT_AVAILABLE"},
1380 {RPC_NT_INTERNAL_ERROR, -EIO, "RPC_NT_INTERNAL_ERROR"},
1381 {RPC_NT_ZERO_DIVIDE, -EIO, "RPC_NT_ZERO_DIVIDE"},
1382 {RPC_NT_ADDRESS_ERROR, -EIO, "RPC_NT_ADDRESS_ERROR"},
1383 {RPC_NT_FP_DIV_ZERO, -EIO, "RPC_NT_FP_DIV_ZERO"},
1384 {RPC_NT_FP_UNDERFLOW, -EIO, "RPC_NT_FP_UNDERFLOW"},
1385 {RPC_NT_FP_OVERFLOW, -EIO, "RPC_NT_FP_OVERFLOW"},
1386 {RPC_NT_CALL_IN_PROGRESS, -EIO, "RPC_NT_CALL_IN_PROGRESS"},
1387 {RPC_NT_NO_MORE_BINDINGS, -EIO, "RPC_NT_NO_MORE_BINDINGS"},
1388 {RPC_NT_GROUP_MEMBER_NOT_FOUND, -EIO, "RPC_NT_GROUP_MEMBER_NOT_FOUND"},
1389 {EPT_NT_CANT_CREATE, -EIO, "EPT_NT_CANT_CREATE"},
1390 {RPC_NT_INVALID_OBJECT, -EIO, "RPC_NT_INVALID_OBJECT"},
1391 {RPC_NT_NO_INTERFACES, -EIO, "RPC_NT_NO_INTERFACES"},
1392 {RPC_NT_CALL_CANCELLED, -EIO, "RPC_NT_CALL_CANCELLED"},
1393 {RPC_NT_BINDING_INCOMPLETE, -EIO, "RPC_NT_BINDING_INCOMPLETE"},
1394 {RPC_NT_COMM_FAILURE, -EIO, "RPC_NT_COMM_FAILURE"},
1395 {RPC_NT_UNSUPPORTED_AUTHN_LEVEL, -EIO,
1396 "RPC_NT_UNSUPPORTED_AUTHN_LEVEL"},
1397 {RPC_NT_NO_PRINC_NAME, -EIO, "RPC_NT_NO_PRINC_NAME"},
1398 {RPC_NT_NOT_RPC_ERROR, -EIO, "RPC_NT_NOT_RPC_ERROR"},
1399 {RPC_NT_SEC_PKG_ERROR, -EIO, "RPC_NT_SEC_PKG_ERROR"},
1400 {RPC_NT_NOT_CANCELLED, -EIO, "RPC_NT_NOT_CANCELLED"},
1401 {RPC_NT_INVALID_ASYNC_HANDLE, -EIO, "RPC_NT_INVALID_ASYNC_HANDLE"},
1402 {RPC_NT_INVALID_ASYNC_CALL, -EIO, "RPC_NT_INVALID_ASYNC_CALL"},
1403 {RPC_NT_PROXY_ACCESS_DENIED, -EACCES, "RPC_NT_PROXY_ACCESS_DENIED"},
1404 {RPC_NT_NO_MORE_ENTRIES, -EIO, "RPC_NT_NO_MORE_ENTRIES"},
1405 {RPC_NT_SS_CHAR_TRANS_OPEN_FAIL, -EIO,
1406 "RPC_NT_SS_CHAR_TRANS_OPEN_FAIL"},
1407 {RPC_NT_SS_CHAR_TRANS_SHORT_FILE, -EIO,
1408 "RPC_NT_SS_CHAR_TRANS_SHORT_FILE"},
1409 {RPC_NT_SS_IN_NULL_CONTEXT, -EIO, "RPC_NT_SS_IN_NULL_CONTEXT"},
1410 {RPC_NT_SS_CONTEXT_MISMATCH, -EIO, "RPC_NT_SS_CONTEXT_MISMATCH"},
1411 {RPC_NT_SS_CONTEXT_DAMAGED, -EIO, "RPC_NT_SS_CONTEXT_DAMAGED"},
1412 {RPC_NT_SS_HANDLES_MISMATCH, -EIO, "RPC_NT_SS_HANDLES_MISMATCH"},
1413 {RPC_NT_SS_CANNOT_GET_CALL_HANDLE, -EIO,
1414 "RPC_NT_SS_CANNOT_GET_CALL_HANDLE"},
1415 {RPC_NT_NULL_REF_POINTER, -EIO, "RPC_NT_NULL_REF_POINTER"},
1416 {RPC_NT_ENUM_VALUE_OUT_OF_RANGE, -EIO,
1417 "RPC_NT_ENUM_VALUE_OUT_OF_RANGE"},
1418 {RPC_NT_BYTE_COUNT_TOO_SMALL, -EIO, "RPC_NT_BYTE_COUNT_TOO_SMALL"},
1419 {RPC_NT_BAD_STUB_DATA, -EIO, "RPC_NT_BAD_STUB_DATA"},
1420 {RPC_NT_INVALID_ES_ACTION, -EIO, "RPC_NT_INVALID_ES_ACTION"},
1421 {RPC_NT_WRONG_ES_VERSION, -EIO, "RPC_NT_WRONG_ES_VERSION"},
1422 {RPC_NT_WRONG_STUB_VERSION, -EIO, "RPC_NT_WRONG_STUB_VERSION"},
1423 {RPC_NT_INVALID_PIPE_OBJECT, -EIO, "RPC_NT_INVALID_PIPE_OBJECT"},
1424 {RPC_NT_INVALID_PIPE_OPERATION, -EIO, "RPC_NT_INVALID_PIPE_OPERATION"},
1425 {RPC_NT_WRONG_PIPE_VERSION, -EIO, "RPC_NT_WRONG_PIPE_VERSION"},
1426 {RPC_NT_PIPE_CLOSED, -EIO, "RPC_NT_PIPE_CLOSED"},
1427 {RPC_NT_PIPE_DISCIPLINE_ERROR, -EIO, "RPC_NT_PIPE_DISCIPLINE_ERROR"},
1428 {RPC_NT_PIPE_EMPTY, -EIO, "RPC_NT_PIPE_EMPTY"},
1429 {STATUS_PNP_BAD_MPS_TABLE, -EIO, "STATUS_PNP_BAD_MPS_TABLE"},
1430 {STATUS_PNP_TRANSLATION_FAILED, -EIO, "STATUS_PNP_TRANSLATION_FAILED"},
1431 {STATUS_PNP_IRQ_TRANSLATION_FAILED, -EIO,
1432 "STATUS_PNP_IRQ_TRANSLATION_FAILED"},
1433 {STATUS_PNP_INVALID_ID, -EIO, "STATUS_PNP_INVALID_ID"},
1434 {STATUS_IO_REISSUE_AS_CACHED, -EIO, "STATUS_IO_REISSUE_AS_CACHED"},
1435 {STATUS_CTX_WINSTATION_NAME_INVALID, -EIO,
1436 "STATUS_CTX_WINSTATION_NAME_INVALID"},
1437 {STATUS_CTX_INVALID_PD, -EIO, "STATUS_CTX_INVALID_PD"},
1438 {STATUS_CTX_PD_NOT_FOUND, -EIO, "STATUS_CTX_PD_NOT_FOUND"},
1439 {STATUS_CTX_CLOSE_PENDING, -EIO, "STATUS_CTX_CLOSE_PENDING"},
1440 {STATUS_CTX_NO_OUTBUF, -EIO, "STATUS_CTX_NO_OUTBUF"},
1441 {STATUS_CTX_MODEM_INF_NOT_FOUND, -EIO,
1442 "STATUS_CTX_MODEM_INF_NOT_FOUND"},
1443 {STATUS_CTX_INVALID_MODEMNAME, -EIO, "STATUS_CTX_INVALID_MODEMNAME"},
1444 {STATUS_CTX_RESPONSE_ERROR, -EIO, "STATUS_CTX_RESPONSE_ERROR"},
1445 {STATUS_CTX_MODEM_RESPONSE_TIMEOUT, -ETIMEDOUT,
1446 "STATUS_CTX_MODEM_RESPONSE_TIMEOUT"},
1447 {STATUS_CTX_MODEM_RESPONSE_NO_CARRIER, -EIO,
1448 "STATUS_CTX_MODEM_RESPONSE_NO_CARRIER"},
1449 {STATUS_CTX_MODEM_RESPONSE_NO_DIALTONE, -EIO,
1450 "STATUS_CTX_MODEM_RESPONSE_NO_DIALTONE"},
1451 {STATUS_CTX_MODEM_RESPONSE_BUSY, -EBUSY,
1452 "STATUS_CTX_MODEM_RESPONSE_BUSY"},
1453 {STATUS_CTX_MODEM_RESPONSE_VOICE, -EIO,
1454 "STATUS_CTX_MODEM_RESPONSE_VOICE"},
1455 {STATUS_CTX_TD_ERROR, -EIO, "STATUS_CTX_TD_ERROR"},
1456 {STATUS_CTX_LICENSE_CLIENT_INVALID, -EIO,
1457 "STATUS_CTX_LICENSE_CLIENT_INVALID"},
1458 {STATUS_CTX_LICENSE_NOT_AVAILABLE, -EIO,
1459 "STATUS_CTX_LICENSE_NOT_AVAILABLE"},
1460 {STATUS_CTX_LICENSE_EXPIRED, -EIO, "STATUS_CTX_LICENSE_EXPIRED"},
1461 {STATUS_CTX_WINSTATION_NOT_FOUND, -EIO,
1462 "STATUS_CTX_WINSTATION_NOT_FOUND"},
1463 {STATUS_CTX_WINSTATION_NAME_COLLISION, -EIO,
1464 "STATUS_CTX_WINSTATION_NAME_COLLISION"},
1465 {STATUS_CTX_WINSTATION_BUSY, -EBUSY, "STATUS_CTX_WINSTATION_BUSY"},
1466 {STATUS_CTX_BAD_VIDEO_MODE, -EIO, "STATUS_CTX_BAD_VIDEO_MODE"},
1467 {STATUS_CTX_GRAPHICS_INVALID, -EIO, "STATUS_CTX_GRAPHICS_INVALID"},
1468 {STATUS_CTX_NOT_CONSOLE, -EIO, "STATUS_CTX_NOT_CONSOLE"},
1469 {STATUS_CTX_CLIENT_QUERY_TIMEOUT, -EIO,
1470 "STATUS_CTX_CLIENT_QUERY_TIMEOUT"},
1471 {STATUS_CTX_CONSOLE_DISCONNECT, -EIO, "STATUS_CTX_CONSOLE_DISCONNECT"},
1472 {STATUS_CTX_CONSOLE_CONNECT, -EIO, "STATUS_CTX_CONSOLE_CONNECT"},
1473 {STATUS_CTX_SHADOW_DENIED, -EIO, "STATUS_CTX_SHADOW_DENIED"},
1474 {STATUS_CTX_WINSTATION_ACCESS_DENIED, -EACCES,
1475 "STATUS_CTX_WINSTATION_ACCESS_DENIED"},
1476 {STATUS_CTX_INVALID_WD, -EIO, "STATUS_CTX_INVALID_WD"},
1477 {STATUS_CTX_WD_NOT_FOUND, -EIO, "STATUS_CTX_WD_NOT_FOUND"},
1478 {STATUS_CTX_SHADOW_INVALID, -EIO, "STATUS_CTX_SHADOW_INVALID"},
1479 {STATUS_CTX_SHADOW_DISABLED, -EIO, "STATUS_CTX_SHADOW_DISABLED"},
1480 {STATUS_RDP_PROTOCOL_ERROR, -EIO, "STATUS_RDP_PROTOCOL_ERROR"},
1481 {STATUS_CTX_CLIENT_LICENSE_NOT_SET, -EIO,
1482 "STATUS_CTX_CLIENT_LICENSE_NOT_SET"},
1483 {STATUS_CTX_CLIENT_LICENSE_IN_USE, -EIO,
1484 "STATUS_CTX_CLIENT_LICENSE_IN_USE"},
1485 {STATUS_CTX_SHADOW_ENDED_BY_MODE_CHANGE, -EIO,
1486 "STATUS_CTX_SHADOW_ENDED_BY_MODE_CHANGE"},
1487 {STATUS_CTX_SHADOW_NOT_RUNNING, -EIO, "STATUS_CTX_SHADOW_NOT_RUNNING"},
1488 {STATUS_CTX_LOGON_DISABLED, -EIO, "STATUS_CTX_LOGON_DISABLED"},
1489 {STATUS_CTX_SECURITY_LAYER_ERROR, -EIO,
1490 "STATUS_CTX_SECURITY_LAYER_ERROR"},
1491 {STATUS_TS_INCOMPATIBLE_SESSIONS, -EIO,
1492 "STATUS_TS_INCOMPATIBLE_SESSIONS"},
1493 {STATUS_MUI_FILE_NOT_FOUND, -EIO, "STATUS_MUI_FILE_NOT_FOUND"},
1494 {STATUS_MUI_INVALID_FILE, -EIO, "STATUS_MUI_INVALID_FILE"},
1495 {STATUS_MUI_INVALID_RC_CONFIG, -EIO, "STATUS_MUI_INVALID_RC_CONFIG"},
1496 {STATUS_MUI_INVALID_LOCALE_NAME, -EIO,
1497 "STATUS_MUI_INVALID_LOCALE_NAME"},
1498 {STATUS_MUI_INVALID_ULTIMATEFALLBACK_NAME, -EIO,
1499 "STATUS_MUI_INVALID_ULTIMATEFALLBACK_NAME"},
1500 {STATUS_MUI_FILE_NOT_LOADED, -EIO, "STATUS_MUI_FILE_NOT_LOADED"},
1501 {STATUS_RESOURCE_ENUM_USER_STOP, -EIO,
1502 "STATUS_RESOURCE_ENUM_USER_STOP"},
1503 {STATUS_CLUSTER_INVALID_NODE, -EIO, "STATUS_CLUSTER_INVALID_NODE"},
1504 {STATUS_CLUSTER_NODE_EXISTS, -EIO, "STATUS_CLUSTER_NODE_EXISTS"},
1505 {STATUS_CLUSTER_JOIN_IN_PROGRESS, -EIO,
1506 "STATUS_CLUSTER_JOIN_IN_PROGRESS"},
1507 {STATUS_CLUSTER_NODE_NOT_FOUND, -EIO, "STATUS_CLUSTER_NODE_NOT_FOUND"},
1508 {STATUS_CLUSTER_LOCAL_NODE_NOT_FOUND, -EIO,
1509 "STATUS_CLUSTER_LOCAL_NODE_NOT_FOUND"},
1510 {STATUS_CLUSTER_NETWORK_EXISTS, -EIO, "STATUS_CLUSTER_NETWORK_EXISTS"},
1511 {STATUS_CLUSTER_NETWORK_NOT_FOUND, -EIO,
1512 "STATUS_CLUSTER_NETWORK_NOT_FOUND"},
1513 {STATUS_CLUSTER_NETINTERFACE_EXISTS, -EIO,
1514 "STATUS_CLUSTER_NETINTERFACE_EXISTS"},
1515 {STATUS_CLUSTER_NETINTERFACE_NOT_FOUND, -EIO,
1516 "STATUS_CLUSTER_NETINTERFACE_NOT_FOUND"},
1517 {STATUS_CLUSTER_INVALID_REQUEST, -EIO,
1518 "STATUS_CLUSTER_INVALID_REQUEST"},
1519 {STATUS_CLUSTER_INVALID_NETWORK_PROVIDER, -EIO,
1520 "STATUS_CLUSTER_INVALID_NETWORK_PROVIDER"},
1521 {STATUS_CLUSTER_NODE_DOWN, -EIO, "STATUS_CLUSTER_NODE_DOWN"},
1522 {STATUS_CLUSTER_NODE_UNREACHABLE, -EIO,
1523 "STATUS_CLUSTER_NODE_UNREACHABLE"},
1524 {STATUS_CLUSTER_NODE_NOT_MEMBER, -EIO,
1525 "STATUS_CLUSTER_NODE_NOT_MEMBER"},
1526 {STATUS_CLUSTER_JOIN_NOT_IN_PROGRESS, -EIO,
1527 "STATUS_CLUSTER_JOIN_NOT_IN_PROGRESS"},
1528 {STATUS_CLUSTER_INVALID_NETWORK, -EIO,
1529 "STATUS_CLUSTER_INVALID_NETWORK"},
1530 {STATUS_CLUSTER_NO_NET_ADAPTERS, -EIO,
1531 "STATUS_CLUSTER_NO_NET_ADAPTERS"},
1532 {STATUS_CLUSTER_NODE_UP, -EIO, "STATUS_CLUSTER_NODE_UP"},
1533 {STATUS_CLUSTER_NODE_PAUSED, -EIO, "STATUS_CLUSTER_NODE_PAUSED"},
1534 {STATUS_CLUSTER_NODE_NOT_PAUSED, -EIO,
1535 "STATUS_CLUSTER_NODE_NOT_PAUSED"},
1536 {STATUS_CLUSTER_NO_SECURITY_CONTEXT, -EIO,
1537 "STATUS_CLUSTER_NO_SECURITY_CONTEXT"},
1538 {STATUS_CLUSTER_NETWORK_NOT_INTERNAL, -EIO,
1539 "STATUS_CLUSTER_NETWORK_NOT_INTERNAL"},
1540 {STATUS_CLUSTER_POISONED, -EIO, "STATUS_CLUSTER_POISONED"},
1541 {STATUS_ACPI_INVALID_OPCODE, -EIO, "STATUS_ACPI_INVALID_OPCODE"},
1542 {STATUS_ACPI_STACK_OVERFLOW, -EIO, "STATUS_ACPI_STACK_OVERFLOW"},
1543 {STATUS_ACPI_ASSERT_FAILED, -EIO, "STATUS_ACPI_ASSERT_FAILED"},
1544 {STATUS_ACPI_INVALID_INDEX, -EIO, "STATUS_ACPI_INVALID_INDEX"},
1545 {STATUS_ACPI_INVALID_ARGUMENT, -EIO, "STATUS_ACPI_INVALID_ARGUMENT"},
1546 {STATUS_ACPI_FATAL, -EIO, "STATUS_ACPI_FATAL"},
1547 {STATUS_ACPI_INVALID_SUPERNAME, -EIO, "STATUS_ACPI_INVALID_SUPERNAME"},
1548 {STATUS_ACPI_INVALID_ARGTYPE, -EIO, "STATUS_ACPI_INVALID_ARGTYPE"},
1549 {STATUS_ACPI_INVALID_OBJTYPE, -EIO, "STATUS_ACPI_INVALID_OBJTYPE"},
1550 {STATUS_ACPI_INVALID_TARGETTYPE, -EIO,
1551 "STATUS_ACPI_INVALID_TARGETTYPE"},
1552 {STATUS_ACPI_INCORRECT_ARGUMENT_COUNT, -EIO,
1553 "STATUS_ACPI_INCORRECT_ARGUMENT_COUNT"},
1554 {STATUS_ACPI_ADDRESS_NOT_MAPPED, -EIO,
1555 "STATUS_ACPI_ADDRESS_NOT_MAPPED"},
1556 {STATUS_ACPI_INVALID_EVENTTYPE, -EIO, "STATUS_ACPI_INVALID_EVENTTYPE"},
1557 {STATUS_ACPI_HANDLER_COLLISION, -EIO, "STATUS_ACPI_HANDLER_COLLISION"},
1558 {STATUS_ACPI_INVALID_DATA, -EIO, "STATUS_ACPI_INVALID_DATA"},
1559 {STATUS_ACPI_INVALID_REGION, -EIO, "STATUS_ACPI_INVALID_REGION"},
1560 {STATUS_ACPI_INVALID_ACCESS_SIZE, -EIO,
1561 "STATUS_ACPI_INVALID_ACCESS_SIZE"},
1562 {STATUS_ACPI_ACQUIRE_GLOBAL_LOCK, -EIO,
1563 "STATUS_ACPI_ACQUIRE_GLOBAL_LOCK"},
1564 {STATUS_ACPI_ALREADY_INITIALIZED, -EIO,
1565 "STATUS_ACPI_ALREADY_INITIALIZED"},
1566 {STATUS_ACPI_NOT_INITIALIZED, -EIO, "STATUS_ACPI_NOT_INITIALIZED"},
1567 {STATUS_ACPI_INVALID_MUTEX_LEVEL, -EIO,
1568 "STATUS_ACPI_INVALID_MUTEX_LEVEL"},
1569 {STATUS_ACPI_MUTEX_NOT_OWNED, -EIO, "STATUS_ACPI_MUTEX_NOT_OWNED"},
1570 {STATUS_ACPI_MUTEX_NOT_OWNER, -EIO, "STATUS_ACPI_MUTEX_NOT_OWNER"},
1571 {STATUS_ACPI_RS_ACCESS, -EIO, "STATUS_ACPI_RS_ACCESS"},
1572 {STATUS_ACPI_INVALID_TABLE, -EIO, "STATUS_ACPI_INVALID_TABLE"},
1573 {STATUS_ACPI_REG_HANDLER_FAILED, -EIO,
1574 "STATUS_ACPI_REG_HANDLER_FAILED"},
1575 {STATUS_ACPI_POWER_REQUEST_FAILED, -EIO,
1576 "STATUS_ACPI_POWER_REQUEST_FAILED"},
1577 {STATUS_SXS_SECTION_NOT_FOUND, -EIO, "STATUS_SXS_SECTION_NOT_FOUND"},
1578 {STATUS_SXS_CANT_GEN_ACTCTX, -EIO, "STATUS_SXS_CANT_GEN_ACTCTX"},
1579 {STATUS_SXS_INVALID_ACTCTXDATA_FORMAT, -EIO,
1580 "STATUS_SXS_INVALID_ACTCTXDATA_FORMAT"},
1581 {STATUS_SXS_ASSEMBLY_NOT_FOUND, -EIO, "STATUS_SXS_ASSEMBLY_NOT_FOUND"},
1582 {STATUS_SXS_MANIFEST_FORMAT_ERROR, -EIO,
1583 "STATUS_SXS_MANIFEST_FORMAT_ERROR"},
1584 {STATUS_SXS_MANIFEST_PARSE_ERROR, -EIO,
1585 "STATUS_SXS_MANIFEST_PARSE_ERROR"},
1586 {STATUS_SXS_ACTIVATION_CONTEXT_DISABLED, -EIO,
1587 "STATUS_SXS_ACTIVATION_CONTEXT_DISABLED"},
1588 {STATUS_SXS_KEY_NOT_FOUND, -EIO, "STATUS_SXS_KEY_NOT_FOUND"},
1589 {STATUS_SXS_VERSION_CONFLICT, -EIO, "STATUS_SXS_VERSION_CONFLICT"},
1590 {STATUS_SXS_WRONG_SECTION_TYPE, -EIO, "STATUS_SXS_WRONG_SECTION_TYPE"},
1591 {STATUS_SXS_THREAD_QUERIES_DISABLED, -EIO,
1592 "STATUS_SXS_THREAD_QUERIES_DISABLED"},
1593 {STATUS_SXS_ASSEMBLY_MISSING, -EIO, "STATUS_SXS_ASSEMBLY_MISSING"},
1594 {STATUS_SXS_PROCESS_DEFAULT_ALREADY_SET, -EIO,
1595 "STATUS_SXS_PROCESS_DEFAULT_ALREADY_SET"},
1596 {STATUS_SXS_EARLY_DEACTIVATION, -EIO, "STATUS_SXS_EARLY_DEACTIVATION"},
1597 {STATUS_SXS_INVALID_DEACTIVATION, -EIO,
1598 "STATUS_SXS_INVALID_DEACTIVATION"},
1599 {STATUS_SXS_MULTIPLE_DEACTIVATION, -EIO,
1600 "STATUS_SXS_MULTIPLE_DEACTIVATION"},
1601 {STATUS_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY, -EIO,
1602 "STATUS_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY"},
1603 {STATUS_SXS_PROCESS_TERMINATION_REQUESTED, -EIO,
1604 "STATUS_SXS_PROCESS_TERMINATION_REQUESTED"},
1605 {STATUS_SXS_CORRUPT_ACTIVATION_STACK, -EIO,
1606 "STATUS_SXS_CORRUPT_ACTIVATION_STACK"},
1607 {STATUS_SXS_CORRUPTION, -EIO, "STATUS_SXS_CORRUPTION"},
1608 {STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE, -EIO,
1609 "STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE"},
1610 {STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME, -EIO,
1611 "STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME"},
1612 {STATUS_SXS_IDENTITY_DUPLICATE_ATTRIBUTE, -EIO,
1613 "STATUS_SXS_IDENTITY_DUPLICATE_ATTRIBUTE"},
1614 {STATUS_SXS_IDENTITY_PARSE_ERROR, -EIO,
1615 "STATUS_SXS_IDENTITY_PARSE_ERROR"},
1616 {STATUS_SXS_COMPONENT_STORE_CORRUPT, -EIO,
1617 "STATUS_SXS_COMPONENT_STORE_CORRUPT"},
1618 {STATUS_SXS_FILE_HASH_MISMATCH, -EIO, "STATUS_SXS_FILE_HASH_MISMATCH"},
1619 {STATUS_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT, -EIO,
1620 "STATUS_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT"},
1621 {STATUS_SXS_IDENTITIES_DIFFERENT, -EIO,
1622 "STATUS_SXS_IDENTITIES_DIFFERENT"},
1623 {STATUS_SXS_ASSEMBLY_IS_NOT_A_DEPLOYMENT, -EIO,
1624 "STATUS_SXS_ASSEMBLY_IS_NOT_A_DEPLOYMENT"},
1625 {STATUS_SXS_FILE_NOT_PART_OF_ASSEMBLY, -EIO,
1626 "STATUS_SXS_FILE_NOT_PART_OF_ASSEMBLY"},
1627 {STATUS_ADVANCED_INSTALLER_FAILED, -EIO,
1628 "STATUS_ADVANCED_INSTALLER_FAILED"},
1629 {STATUS_XML_ENCODING_MISMATCH, -EIO, "STATUS_XML_ENCODING_MISMATCH"},
1630 {STATUS_SXS_MANIFEST_TOO_BIG, -EIO, "STATUS_SXS_MANIFEST_TOO_BIG"},
1631 {STATUS_SXS_SETTING_NOT_REGISTERED, -EIO,
1632 "STATUS_SXS_SETTING_NOT_REGISTERED"},
1633 {STATUS_SXS_TRANSACTION_CLOSURE_INCOMPLETE, -EIO,
1634 "STATUS_SXS_TRANSACTION_CLOSURE_INCOMPLETE"},
1635 {STATUS_SMI_PRIMITIVE_INSTALLER_FAILED, -EIO,
1636 "STATUS_SMI_PRIMITIVE_INSTALLER_FAILED"},
1637 {STATUS_GENERIC_COMMAND_FAILED, -EIO, "STATUS_GENERIC_COMMAND_FAILED"},
1638 {STATUS_SXS_FILE_HASH_MISSING, -EIO, "STATUS_SXS_FILE_HASH_MISSING"},
1639 {STATUS_TRANSACTIONAL_CONFLICT, -EIO, "STATUS_TRANSACTIONAL_CONFLICT"},
1640 {STATUS_INVALID_TRANSACTION, -EIO, "STATUS_INVALID_TRANSACTION"},
1641 {STATUS_TRANSACTION_NOT_ACTIVE, -EIO, "STATUS_TRANSACTION_NOT_ACTIVE"},
1642 {STATUS_TM_INITIALIZATION_FAILED, -EIO,
1643 "STATUS_TM_INITIALIZATION_FAILED"},
1644 {STATUS_RM_NOT_ACTIVE, -EIO, "STATUS_RM_NOT_ACTIVE"},
1645 {STATUS_RM_METADATA_CORRUPT, -EIO, "STATUS_RM_METADATA_CORRUPT"},
1646 {STATUS_TRANSACTION_NOT_JOINED, -EIO, "STATUS_TRANSACTION_NOT_JOINED"},
1647 {STATUS_DIRECTORY_NOT_RM, -EIO, "STATUS_DIRECTORY_NOT_RM"},
1648 {STATUS_TRANSACTIONS_UNSUPPORTED_REMOTE, -EIO,
1649 "STATUS_TRANSACTIONS_UNSUPPORTED_REMOTE"},
1650 {STATUS_LOG_RESIZE_INVALID_SIZE, -EIO,
1651 "STATUS_LOG_RESIZE_INVALID_SIZE"},
1652 {STATUS_REMOTE_FILE_VERSION_MISMATCH, -EIO,
1653 "STATUS_REMOTE_FILE_VERSION_MISMATCH"},
1654 {STATUS_CRM_PROTOCOL_ALREADY_EXISTS, -EIO,
1655 "STATUS_CRM_PROTOCOL_ALREADY_EXISTS"},
1656 {STATUS_TRANSACTION_PROPAGATION_FAILED, -EIO,
1657 "STATUS_TRANSACTION_PROPAGATION_FAILED"},
1658 {STATUS_CRM_PROTOCOL_NOT_FOUND, -EIO, "STATUS_CRM_PROTOCOL_NOT_FOUND"},
1659 {STATUS_TRANSACTION_SUPERIOR_EXISTS, -EIO,
1660 "STATUS_TRANSACTION_SUPERIOR_EXISTS"},
1661 {STATUS_TRANSACTION_REQUEST_NOT_VALID, -EIO,
1662 "STATUS_TRANSACTION_REQUEST_NOT_VALID"},
1663 {STATUS_TRANSACTION_NOT_REQUESTED, -EIO,
1664 "STATUS_TRANSACTION_NOT_REQUESTED"},
1665 {STATUS_TRANSACTION_ALREADY_ABORTED, -EIO,
1666 "STATUS_TRANSACTION_ALREADY_ABORTED"},
1667 {STATUS_TRANSACTION_ALREADY_COMMITTED, -EIO,
1668 "STATUS_TRANSACTION_ALREADY_COMMITTED"},
1669 {STATUS_TRANSACTION_INVALID_MARSHALL_BUFFER, -EIO,
1670 "STATUS_TRANSACTION_INVALID_MARSHALL_BUFFER"},
1671 {STATUS_CURRENT_TRANSACTION_NOT_VALID, -EIO,
1672 "STATUS_CURRENT_TRANSACTION_NOT_VALID"},
1673 {STATUS_LOG_GROWTH_FAILED, -EIO, "STATUS_LOG_GROWTH_FAILED"},
1674 {STATUS_OBJECT_NO_LONGER_EXISTS, -EIO,
1675 "STATUS_OBJECT_NO_LONGER_EXISTS"},
1676 {STATUS_STREAM_MINIVERSION_NOT_FOUND, -EIO,
1677 "STATUS_STREAM_MINIVERSION_NOT_FOUND"},
1678 {STATUS_STREAM_MINIVERSION_NOT_VALID, -EIO,
1679 "STATUS_STREAM_MINIVERSION_NOT_VALID"},
1680 {STATUS_MINIVERSION_INACCESSIBLE_FROM_SPECIFIED_TRANSACTION, -EIO,
1681 "STATUS_MINIVERSION_INACCESSIBLE_FROM_SPECIFIED_TRANSACTION"},
1682 {STATUS_CANT_OPEN_MINIVERSION_WITH_MODIFY_INTENT, -EIO,
1683 "STATUS_CANT_OPEN_MINIVERSION_WITH_MODIFY_INTENT"},
1684 {STATUS_CANT_CREATE_MORE_STREAM_MINIVERSIONS, -EIO,
1685 "STATUS_CANT_CREATE_MORE_STREAM_MINIVERSIONS"},
1686 {STATUS_HANDLE_NO_LONGER_VALID, -EIO, "STATUS_HANDLE_NO_LONGER_VALID"},
1687 {STATUS_LOG_CORRUPTION_DETECTED, -EIO,
1688 "STATUS_LOG_CORRUPTION_DETECTED"},
1689 {STATUS_RM_DISCONNECTED, -EIO, "STATUS_RM_DISCONNECTED"},
1690 {STATUS_ENLISTMENT_NOT_SUPERIOR, -EIO,
1691 "STATUS_ENLISTMENT_NOT_SUPERIOR"},
1692 {STATUS_FILE_IDENTITY_NOT_PERSISTENT, -EIO,
1693 "STATUS_FILE_IDENTITY_NOT_PERSISTENT"},
1694 {STATUS_CANT_BREAK_TRANSACTIONAL_DEPENDENCY, -EIO,
1695 "STATUS_CANT_BREAK_TRANSACTIONAL_DEPENDENCY"},
1696 {STATUS_CANT_CROSS_RM_BOUNDARY, -EIO, "STATUS_CANT_CROSS_RM_BOUNDARY"},
1697 {STATUS_TXF_DIR_NOT_EMPTY, -EIO, "STATUS_TXF_DIR_NOT_EMPTY"},
1698 {STATUS_INDOUBT_TRANSACTIONS_EXIST, -EIO,
1699 "STATUS_INDOUBT_TRANSACTIONS_EXIST"},
1700 {STATUS_TM_VOLATILE, -EIO, "STATUS_TM_VOLATILE"},
1701 {STATUS_ROLLBACK_TIMER_EXPIRED, -EIO, "STATUS_ROLLBACK_TIMER_EXPIRED"},
1702 {STATUS_TXF_ATTRIBUTE_CORRUPT, -EIO, "STATUS_TXF_ATTRIBUTE_CORRUPT"},
1703 {STATUS_EFS_NOT_ALLOWED_IN_TRANSACTION, -EIO,
1704 "STATUS_EFS_NOT_ALLOWED_IN_TRANSACTION"},
1705 {STATUS_TRANSACTIONAL_OPEN_NOT_ALLOWED, -EIO,
1706 "STATUS_TRANSACTIONAL_OPEN_NOT_ALLOWED"},
1707 {STATUS_TRANSACTED_MAPPING_UNSUPPORTED_REMOTE, -EIO,
1708 "STATUS_TRANSACTED_MAPPING_UNSUPPORTED_REMOTE"},
1709 {STATUS_TRANSACTION_REQUIRED_PROMOTION, -EIO,
1710 "STATUS_TRANSACTION_REQUIRED_PROMOTION"},
1711 {STATUS_CANNOT_EXECUTE_FILE_IN_TRANSACTION, -EIO,
1712 "STATUS_CANNOT_EXECUTE_FILE_IN_TRANSACTION"},
1713 {STATUS_TRANSACTIONS_NOT_FROZEN, -EIO,
1714 "STATUS_TRANSACTIONS_NOT_FROZEN"},
1715 {STATUS_TRANSACTION_FREEZE_IN_PROGRESS, -EIO,
1716 "STATUS_TRANSACTION_FREEZE_IN_PROGRESS"},
1717 {STATUS_NOT_SNAPSHOT_VOLUME, -EIO, "STATUS_NOT_SNAPSHOT_VOLUME"},
1718 {STATUS_NO_SAVEPOINT_WITH_OPEN_FILES, -EIO,
1719 "STATUS_NO_SAVEPOINT_WITH_OPEN_FILES"},
1720 {STATUS_SPARSE_NOT_ALLOWED_IN_TRANSACTION, -EIO,
1721 "STATUS_SPARSE_NOT_ALLOWED_IN_TRANSACTION"},
1722 {STATUS_TM_IDENTITY_MISMATCH, -EIO, "STATUS_TM_IDENTITY_MISMATCH"},
1723 {STATUS_FLOATED_SECTION, -EIO, "STATUS_FLOATED_SECTION"},
1724 {STATUS_CANNOT_ACCEPT_TRANSACTED_WORK, -EIO,
1725 "STATUS_CANNOT_ACCEPT_TRANSACTED_WORK"},
1726 {STATUS_CANNOT_ABORT_TRANSACTIONS, -EIO,
1727 "STATUS_CANNOT_ABORT_TRANSACTIONS"},
1728 {STATUS_TRANSACTION_NOT_FOUND, -EIO, "STATUS_TRANSACTION_NOT_FOUND"},
1729 {STATUS_RESOURCEMANAGER_NOT_FOUND, -EIO,
1730 "STATUS_RESOURCEMANAGER_NOT_FOUND"},
1731 {STATUS_ENLISTMENT_NOT_FOUND, -EIO, "STATUS_ENLISTMENT_NOT_FOUND"},
1732 {STATUS_TRANSACTIONMANAGER_NOT_FOUND, -EIO,
1733 "STATUS_TRANSACTIONMANAGER_NOT_FOUND"},
1734 {STATUS_TRANSACTIONMANAGER_NOT_ONLINE, -EIO,
1735 "STATUS_TRANSACTIONMANAGER_NOT_ONLINE"},
1736 {STATUS_TRANSACTIONMANAGER_RECOVERY_NAME_COLLISION, -EIO,
1737 "STATUS_TRANSACTIONMANAGER_RECOVERY_NAME_COLLISION"},
1738 {STATUS_TRANSACTION_NOT_ROOT, -EIO, "STATUS_TRANSACTION_NOT_ROOT"},
1739 {STATUS_TRANSACTION_OBJECT_EXPIRED, -EIO,
1740 "STATUS_TRANSACTION_OBJECT_EXPIRED"},
1741 {STATUS_COMPRESSION_NOT_ALLOWED_IN_TRANSACTION, -EIO,
1742 "STATUS_COMPRESSION_NOT_ALLOWED_IN_TRANSACTION"},
1743 {STATUS_TRANSACTION_RESPONSE_NOT_ENLISTED, -EIO,
1744 "STATUS_TRANSACTION_RESPONSE_NOT_ENLISTED"},
1745 {STATUS_TRANSACTION_RECORD_TOO_LONG, -EIO,
1746 "STATUS_TRANSACTION_RECORD_TOO_LONG"},
1747 {STATUS_NO_LINK_TRACKING_IN_TRANSACTION, -EIO,
1748 "STATUS_NO_LINK_TRACKING_IN_TRANSACTION"},
1749 {STATUS_OPERATION_NOT_SUPPORTED_IN_TRANSACTION, -EOPNOTSUPP,
1750 "STATUS_OPERATION_NOT_SUPPORTED_IN_TRANSACTION"},
1751 {STATUS_TRANSACTION_INTEGRITY_VIOLATED, -EIO,
1752 "STATUS_TRANSACTION_INTEGRITY_VIOLATED"},
1753 {STATUS_LOG_SECTOR_INVALID, -EIO, "STATUS_LOG_SECTOR_INVALID"},
1754 {STATUS_LOG_SECTOR_PARITY_INVALID, -EIO,
1755 "STATUS_LOG_SECTOR_PARITY_INVALID"},
1756 {STATUS_LOG_SECTOR_REMAPPED, -EIO, "STATUS_LOG_SECTOR_REMAPPED"},
1757 {STATUS_LOG_BLOCK_INCOMPLETE, -EIO, "STATUS_LOG_BLOCK_INCOMPLETE"},
1758 {STATUS_LOG_INVALID_RANGE, -EIO, "STATUS_LOG_INVALID_RANGE"},
1759 {STATUS_LOG_BLOCKS_EXHAUSTED, -EIO, "STATUS_LOG_BLOCKS_EXHAUSTED"},
1760 {STATUS_LOG_READ_CONTEXT_INVALID, -EIO,
1761 "STATUS_LOG_READ_CONTEXT_INVALID"},
1762 {STATUS_LOG_RESTART_INVALID, -EIO, "STATUS_LOG_RESTART_INVALID"},
1763 {STATUS_LOG_BLOCK_VERSION, -EIO, "STATUS_LOG_BLOCK_VERSION"},
1764 {STATUS_LOG_BLOCK_INVALID, -EIO, "STATUS_LOG_BLOCK_INVALID"},
1765 {STATUS_LOG_READ_MODE_INVALID, -EIO, "STATUS_LOG_READ_MODE_INVALID"},
1766 {STATUS_LOG_METADATA_CORRUPT, -EIO, "STATUS_LOG_METADATA_CORRUPT"},
1767 {STATUS_LOG_METADATA_INVALID, -EIO, "STATUS_LOG_METADATA_INVALID"},
1768 {STATUS_LOG_METADATA_INCONSISTENT, -EIO,
1769 "STATUS_LOG_METADATA_INCONSISTENT"},
1770 {STATUS_LOG_RESERVATION_INVALID, -EIO,
1771 "STATUS_LOG_RESERVATION_INVALID"},
1772 {STATUS_LOG_CANT_DELETE, -EIO, "STATUS_LOG_CANT_DELETE"},
1773 {STATUS_LOG_CONTAINER_LIMIT_EXCEEDED, -EIO,
1774 "STATUS_LOG_CONTAINER_LIMIT_EXCEEDED"},
1775 {STATUS_LOG_START_OF_LOG, -EIO, "STATUS_LOG_START_OF_LOG"},
1776 {STATUS_LOG_POLICY_ALREADY_INSTALLED, -EIO,
1777 "STATUS_LOG_POLICY_ALREADY_INSTALLED"},
1778 {STATUS_LOG_POLICY_NOT_INSTALLED, -EIO,
1779 "STATUS_LOG_POLICY_NOT_INSTALLED"},
1780 {STATUS_LOG_POLICY_INVALID, -EIO, "STATUS_LOG_POLICY_INVALID"},
1781 {STATUS_LOG_POLICY_CONFLICT, -EIO, "STATUS_LOG_POLICY_CONFLICT"},
1782 {STATUS_LOG_PINNED_ARCHIVE_TAIL, -EIO,
1783 "STATUS_LOG_PINNED_ARCHIVE_TAIL"},
1784 {STATUS_LOG_RECORD_NONEXISTENT, -EIO, "STATUS_LOG_RECORD_NONEXISTENT"},
1785 {STATUS_LOG_RECORDS_RESERVED_INVALID, -EIO,
1786 "STATUS_LOG_RECORDS_RESERVED_INVALID"},
1787 {STATUS_LOG_SPACE_RESERVED_INVALID, -EIO,
1788 "STATUS_LOG_SPACE_RESERVED_INVALID"},
1789 {STATUS_LOG_TAIL_INVALID, -EIO, "STATUS_LOG_TAIL_INVALID"},
1790 {STATUS_LOG_FULL, -EIO, "STATUS_LOG_FULL"},
1791 {STATUS_LOG_MULTIPLEXED, -EIO, "STATUS_LOG_MULTIPLEXED"},
1792 {STATUS_LOG_DEDICATED, -EIO, "STATUS_LOG_DEDICATED"},
1793 {STATUS_LOG_ARCHIVE_NOT_IN_PROGRESS, -EIO,
1794 "STATUS_LOG_ARCHIVE_NOT_IN_PROGRESS"},
1795 {STATUS_LOG_ARCHIVE_IN_PROGRESS, -EIO,
1796 "STATUS_LOG_ARCHIVE_IN_PROGRESS"},
1797 {STATUS_LOG_EPHEMERAL, -EIO, "STATUS_LOG_EPHEMERAL"},
1798 {STATUS_LOG_NOT_ENOUGH_CONTAINERS, -EIO,
1799 "STATUS_LOG_NOT_ENOUGH_CONTAINERS"},
1800 {STATUS_LOG_CLIENT_ALREADY_REGISTERED, -EIO,
1801 "STATUS_LOG_CLIENT_ALREADY_REGISTERED"},
1802 {STATUS_LOG_CLIENT_NOT_REGISTERED, -EIO,
1803 "STATUS_LOG_CLIENT_NOT_REGISTERED"},
1804 {STATUS_LOG_FULL_HANDLER_IN_PROGRESS, -EIO,
1805 "STATUS_LOG_FULL_HANDLER_IN_PROGRESS"},
1806 {STATUS_LOG_CONTAINER_READ_FAILED, -EIO,
1807 "STATUS_LOG_CONTAINER_READ_FAILED"},
1808 {STATUS_LOG_CONTAINER_WRITE_FAILED, -EIO,
1809 "STATUS_LOG_CONTAINER_WRITE_FAILED"},
1810 {STATUS_LOG_CONTAINER_OPEN_FAILED, -EIO,
1811 "STATUS_LOG_CONTAINER_OPEN_FAILED"},
1812 {STATUS_LOG_CONTAINER_STATE_INVALID, -EIO,
1813 "STATUS_LOG_CONTAINER_STATE_INVALID"},
1814 {STATUS_LOG_STATE_INVALID, -EIO, "STATUS_LOG_STATE_INVALID"},
1815 {STATUS_LOG_PINNED, -EIO, "STATUS_LOG_PINNED"},
1816 {STATUS_LOG_METADATA_FLUSH_FAILED, -EIO,
1817 "STATUS_LOG_METADATA_FLUSH_FAILED"},
1818 {STATUS_LOG_INCONSISTENT_SECURITY, -EIO,
1819 "STATUS_LOG_INCONSISTENT_SECURITY"},
1820 {STATUS_LOG_APPENDED_FLUSH_FAILED, -EIO,
1821 "STATUS_LOG_APPENDED_FLUSH_FAILED"},
1822 {STATUS_LOG_PINNED_RESERVATION, -EIO, "STATUS_LOG_PINNED_RESERVATION"},
1823 {STATUS_VIDEO_HUNG_DISPLAY_DRIVER_THREAD, -EIO,
1824 "STATUS_VIDEO_HUNG_DISPLAY_DRIVER_THREAD"},
1825 {STATUS_FLT_NO_HANDLER_DEFINED, -EIO, "STATUS_FLT_NO_HANDLER_DEFINED"},
1826 {STATUS_FLT_CONTEXT_ALREADY_DEFINED, -EIO,
1827 "STATUS_FLT_CONTEXT_ALREADY_DEFINED"},
1828 {STATUS_FLT_INVALID_ASYNCHRONOUS_REQUEST, -EIO,
1829 "STATUS_FLT_INVALID_ASYNCHRONOUS_REQUEST"},
1830 {STATUS_FLT_DISALLOW_FAST_IO, -EIO, "STATUS_FLT_DISALLOW_FAST_IO"},
1831 {STATUS_FLT_INVALID_NAME_REQUEST, -EIO,
1832 "STATUS_FLT_INVALID_NAME_REQUEST"},
1833 {STATUS_FLT_NOT_SAFE_TO_POST_OPERATION, -EIO,
1834 "STATUS_FLT_NOT_SAFE_TO_POST_OPERATION"},
1835 {STATUS_FLT_NOT_INITIALIZED, -EIO, "STATUS_FLT_NOT_INITIALIZED"},
1836 {STATUS_FLT_FILTER_NOT_READY, -EIO, "STATUS_FLT_FILTER_NOT_READY"},
1837 {STATUS_FLT_POST_OPERATION_CLEANUP, -EIO,
1838 "STATUS_FLT_POST_OPERATION_CLEANUP"},
1839 {STATUS_FLT_INTERNAL_ERROR, -EIO, "STATUS_FLT_INTERNAL_ERROR"},
1840 {STATUS_FLT_DELETING_OBJECT, -EIO, "STATUS_FLT_DELETING_OBJECT"},
1841 {STATUS_FLT_MUST_BE_NONPAGED_POOL, -EIO,
1842 "STATUS_FLT_MUST_BE_NONPAGED_POOL"},
1843 {STATUS_FLT_DUPLICATE_ENTRY, -EIO, "STATUS_FLT_DUPLICATE_ENTRY"},
1844 {STATUS_FLT_CBDQ_DISABLED, -EIO, "STATUS_FLT_CBDQ_DISABLED"},
1845 {STATUS_FLT_DO_NOT_ATTACH, -EIO, "STATUS_FLT_DO_NOT_ATTACH"},
1846 {STATUS_FLT_DO_NOT_DETACH, -EIO, "STATUS_FLT_DO_NOT_DETACH"},
1847 {STATUS_FLT_INSTANCE_ALTITUDE_COLLISION, -EIO,
1848 "STATUS_FLT_INSTANCE_ALTITUDE_COLLISION"},
1849 {STATUS_FLT_INSTANCE_NAME_COLLISION, -EIO,
1850 "STATUS_FLT_INSTANCE_NAME_COLLISION"},
1851 {STATUS_FLT_FILTER_NOT_FOUND, -EIO, "STATUS_FLT_FILTER_NOT_FOUND"},
1852 {STATUS_FLT_VOLUME_NOT_FOUND, -EIO, "STATUS_FLT_VOLUME_NOT_FOUND"},
1853 {STATUS_FLT_INSTANCE_NOT_FOUND, -EIO, "STATUS_FLT_INSTANCE_NOT_FOUND"},
1854 {STATUS_FLT_CONTEXT_ALLOCATION_NOT_FOUND, -EIO,
1855 "STATUS_FLT_CONTEXT_ALLOCATION_NOT_FOUND"},
1856 {STATUS_FLT_INVALID_CONTEXT_REGISTRATION, -EIO,
1857 "STATUS_FLT_INVALID_CONTEXT_REGISTRATION"},
1858 {STATUS_FLT_NAME_CACHE_MISS, -EIO, "STATUS_FLT_NAME_CACHE_MISS"},
1859 {STATUS_FLT_NO_DEVICE_OBJECT, -EIO, "STATUS_FLT_NO_DEVICE_OBJECT"},
1860 {STATUS_FLT_VOLUME_ALREADY_MOUNTED, -EIO,
1861 "STATUS_FLT_VOLUME_ALREADY_MOUNTED"},
1862 {STATUS_FLT_ALREADY_ENLISTED, -EIO, "STATUS_FLT_ALREADY_ENLISTED"},
1863 {STATUS_FLT_CONTEXT_ALREADY_LINKED, -EIO,
1864 "STATUS_FLT_CONTEXT_ALREADY_LINKED"},
1865 {STATUS_FLT_NO_WAITER_FOR_REPLY, -EIO,
1866 "STATUS_FLT_NO_WAITER_FOR_REPLY"},
1867 {STATUS_MONITOR_NO_DESCRIPTOR, -EIO, "STATUS_MONITOR_NO_DESCRIPTOR"},
1868 {STATUS_MONITOR_UNKNOWN_DESCRIPTOR_FORMAT, -EIO,
1869 "STATUS_MONITOR_UNKNOWN_DESCRIPTOR_FORMAT"},
1870 {STATUS_MONITOR_INVALID_DESCRIPTOR_CHECKSUM, -EIO,
1871 "STATUS_MONITOR_INVALID_DESCRIPTOR_CHECKSUM"},
1872 {STATUS_MONITOR_INVALID_STANDARD_TIMING_BLOCK, -EIO,
1873 "STATUS_MONITOR_INVALID_STANDARD_TIMING_BLOCK"},
1874 {STATUS_MONITOR_WMI_DATABLOCK_REGISTRATION_FAILED, -EIO,
1875 "STATUS_MONITOR_WMI_DATABLOCK_REGISTRATION_FAILED"},
1876 {STATUS_MONITOR_INVALID_SERIAL_NUMBER_MONDSC_BLOCK, -EIO,
1877 "STATUS_MONITOR_INVALID_SERIAL_NUMBER_MONDSC_BLOCK"},
1878 {STATUS_MONITOR_INVALID_USER_FRIENDLY_MONDSC_BLOCK, -EIO,
1879 "STATUS_MONITOR_INVALID_USER_FRIENDLY_MONDSC_BLOCK"},
1880 {STATUS_MONITOR_NO_MORE_DESCRIPTOR_DATA, -EIO,
1881 "STATUS_MONITOR_NO_MORE_DESCRIPTOR_DATA"},
1882 {STATUS_MONITOR_INVALID_DETAILED_TIMING_BLOCK, -EIO,
1883 "STATUS_MONITOR_INVALID_DETAILED_TIMING_BLOCK"},
1884 {STATUS_GRAPHICS_NOT_EXCLUSIVE_MODE_OWNER, -EIO,
1885 "STATUS_GRAPHICS_NOT_EXCLUSIVE_MODE_OWNER"},
1886 {STATUS_GRAPHICS_INSUFFICIENT_DMA_BUFFER, -EIO,
1887 "STATUS_GRAPHICS_INSUFFICIENT_DMA_BUFFER"},
1888 {STATUS_GRAPHICS_INVALID_DISPLAY_ADAPTER, -EIO,
1889 "STATUS_GRAPHICS_INVALID_DISPLAY_ADAPTER"},
1890 {STATUS_GRAPHICS_ADAPTER_WAS_RESET, -EIO,
1891 "STATUS_GRAPHICS_ADAPTER_WAS_RESET"},
1892 {STATUS_GRAPHICS_INVALID_DRIVER_MODEL, -EIO,
1893 "STATUS_GRAPHICS_INVALID_DRIVER_MODEL"},
1894 {STATUS_GRAPHICS_PRESENT_MODE_CHANGED, -EIO,
1895 "STATUS_GRAPHICS_PRESENT_MODE_CHANGED"},
1896 {STATUS_GRAPHICS_PRESENT_OCCLUDED, -EIO,
1897 "STATUS_GRAPHICS_PRESENT_OCCLUDED"},
1898 {STATUS_GRAPHICS_PRESENT_DENIED, -EIO,
1899 "STATUS_GRAPHICS_PRESENT_DENIED"},
1900 {STATUS_GRAPHICS_CANNOTCOLORCONVERT, -EIO,
1901 "STATUS_GRAPHICS_CANNOTCOLORCONVERT"},
1902 {STATUS_GRAPHICS_NO_VIDEO_MEMORY, -EIO,
1903 "STATUS_GRAPHICS_NO_VIDEO_MEMORY"},
1904 {STATUS_GRAPHICS_CANT_LOCK_MEMORY, -EIO,
1905 "STATUS_GRAPHICS_CANT_LOCK_MEMORY"},
1906 {STATUS_GRAPHICS_ALLOCATION_BUSY, -EBUSY,
1907 "STATUS_GRAPHICS_ALLOCATION_BUSY"},
1908 {STATUS_GRAPHICS_TOO_MANY_REFERENCES, -EIO,
1909 "STATUS_GRAPHICS_TOO_MANY_REFERENCES"},
1910 {STATUS_GRAPHICS_TRY_AGAIN_LATER, -EIO,
1911 "STATUS_GRAPHICS_TRY_AGAIN_LATER"},
1912 {STATUS_GRAPHICS_TRY_AGAIN_NOW, -EIO, "STATUS_GRAPHICS_TRY_AGAIN_NOW"},
1913 {STATUS_GRAPHICS_ALLOCATION_INVALID, -EIO,
1914 "STATUS_GRAPHICS_ALLOCATION_INVALID"},
1915 {STATUS_GRAPHICS_UNSWIZZLING_APERTURE_UNAVAILABLE, -EIO,
1916 "STATUS_GRAPHICS_UNSWIZZLING_APERTURE_UNAVAILABLE"},
1917 {STATUS_GRAPHICS_UNSWIZZLING_APERTURE_UNSUPPORTED, -EIO,
1918 "STATUS_GRAPHICS_UNSWIZZLING_APERTURE_UNSUPPORTED"},
1919 {STATUS_GRAPHICS_CANT_EVICT_PINNED_ALLOCATION, -EIO,
1920 "STATUS_GRAPHICS_CANT_EVICT_PINNED_ALLOCATION"},
1921 {STATUS_GRAPHICS_INVALID_ALLOCATION_USAGE, -EIO,
1922 "STATUS_GRAPHICS_INVALID_ALLOCATION_USAGE"},
1923 {STATUS_GRAPHICS_CANT_RENDER_LOCKED_ALLOCATION, -EIO,
1924 "STATUS_GRAPHICS_CANT_RENDER_LOCKED_ALLOCATION"},
1925 {STATUS_GRAPHICS_ALLOCATION_CLOSED, -EIO,
1926 "STATUS_GRAPHICS_ALLOCATION_CLOSED"},
1927 {STATUS_GRAPHICS_INVALID_ALLOCATION_INSTANCE, -EIO,
1928 "STATUS_GRAPHICS_INVALID_ALLOCATION_INSTANCE"},
1929 {STATUS_GRAPHICS_INVALID_ALLOCATION_HANDLE, -EIO,
1930 "STATUS_GRAPHICS_INVALID_ALLOCATION_HANDLE"},
1931 {STATUS_GRAPHICS_WRONG_ALLOCATION_DEVICE, -EIO,
1932 "STATUS_GRAPHICS_WRONG_ALLOCATION_DEVICE"},
1933 {STATUS_GRAPHICS_ALLOCATION_CONTENT_LOST, -EIO,
1934 "STATUS_GRAPHICS_ALLOCATION_CONTENT_LOST"},
1935 {STATUS_GRAPHICS_GPU_EXCEPTION_ON_DEVICE, -EIO,
1936 "STATUS_GRAPHICS_GPU_EXCEPTION_ON_DEVICE"},
1937 {STATUS_GRAPHICS_INVALID_VIDPN_TOPOLOGY, -EIO,
1938 "STATUS_GRAPHICS_INVALID_VIDPN_TOPOLOGY"},
1939 {STATUS_GRAPHICS_VIDPN_TOPOLOGY_NOT_SUPPORTED, -EIO,
1940 "STATUS_GRAPHICS_VIDPN_TOPOLOGY_NOT_SUPPORTED"},
1941 {STATUS_GRAPHICS_VIDPN_TOPOLOGY_CURRENTLY_NOT_SUPPORTED, -EIO,
1942 "STATUS_GRAPHICS_VIDPN_TOPOLOGY_CURRENTLY_NOT_SUPPORTED"},
1943 {STATUS_GRAPHICS_INVALID_VIDPN, -EIO, "STATUS_GRAPHICS_INVALID_VIDPN"},
1944 {STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE, -EIO,
1945 "STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE"},
1946 {STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET, -EIO,
1947 "STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET"},
1948 {STATUS_GRAPHICS_VIDPN_MODALITY_NOT_SUPPORTED, -EIO,
1949 "STATUS_GRAPHICS_VIDPN_MODALITY_NOT_SUPPORTED"},
1950 {STATUS_GRAPHICS_INVALID_VIDPN_SOURCEMODESET, -EIO,
1951 "STATUS_GRAPHICS_INVALID_VIDPN_SOURCEMODESET"},
1952 {STATUS_GRAPHICS_INVALID_VIDPN_TARGETMODESET, -EIO,
1953 "STATUS_GRAPHICS_INVALID_VIDPN_TARGETMODESET"},
1954 {STATUS_GRAPHICS_INVALID_FREQUENCY, -EIO,
1955 "STATUS_GRAPHICS_INVALID_FREQUENCY"},
1956 {STATUS_GRAPHICS_INVALID_ACTIVE_REGION, -EIO,
1957 "STATUS_GRAPHICS_INVALID_ACTIVE_REGION"},
1958 {STATUS_GRAPHICS_INVALID_TOTAL_REGION, -EIO,
1959 "STATUS_GRAPHICS_INVALID_TOTAL_REGION"},
1960 {STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE_MODE, -EIO,
1961 "STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE_MODE"},
1962 {STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET_MODE, -EIO,
1963 "STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET_MODE"},
1964 {STATUS_GRAPHICS_PINNED_MODE_MUST_REMAIN_IN_SET, -EIO,
1965 "STATUS_GRAPHICS_PINNED_MODE_MUST_REMAIN_IN_SET"},
1966 {STATUS_GRAPHICS_PATH_ALREADY_IN_TOPOLOGY, -EIO,
1967 "STATUS_GRAPHICS_PATH_ALREADY_IN_TOPOLOGY"},
1968 {STATUS_GRAPHICS_MODE_ALREADY_IN_MODESET, -EIO,
1969 "STATUS_GRAPHICS_MODE_ALREADY_IN_MODESET"},
1970 {STATUS_GRAPHICS_INVALID_VIDEOPRESENTSOURCESET, -EIO,
1971 "STATUS_GRAPHICS_INVALID_VIDEOPRESENTSOURCESET"},
1972 {STATUS_GRAPHICS_INVALID_VIDEOPRESENTTARGETSET, -EIO,
1973 "STATUS_GRAPHICS_INVALID_VIDEOPRESENTTARGETSET"},
1974 {STATUS_GRAPHICS_SOURCE_ALREADY_IN_SET, -EIO,
1975 "STATUS_GRAPHICS_SOURCE_ALREADY_IN_SET"},
1976 {STATUS_GRAPHICS_TARGET_ALREADY_IN_SET, -EIO,
1977 "STATUS_GRAPHICS_TARGET_ALREADY_IN_SET"},
1978 {STATUS_GRAPHICS_INVALID_VIDPN_PRESENT_PATH, -EIO,
1979 "STATUS_GRAPHICS_INVALID_VIDPN_PRESENT_PATH"},
1980 {STATUS_GRAPHICS_NO_RECOMMENDED_VIDPN_TOPOLOGY, -EIO,
1981 "STATUS_GRAPHICS_NO_RECOMMENDED_VIDPN_TOPOLOGY"},
1982 {STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGESET, -EIO,
1983 "STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGESET"},
1984 {STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE, -EIO,
1985 "STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE"},
1986 {STATUS_GRAPHICS_FREQUENCYRANGE_NOT_IN_SET, -EIO,
1987 "STATUS_GRAPHICS_FREQUENCYRANGE_NOT_IN_SET"},
1988 {STATUS_GRAPHICS_FREQUENCYRANGE_ALREADY_IN_SET, -EIO,
1989 "STATUS_GRAPHICS_FREQUENCYRANGE_ALREADY_IN_SET"},
1990 {STATUS_GRAPHICS_STALE_MODESET, -EIO, "STATUS_GRAPHICS_STALE_MODESET"},
1991 {STATUS_GRAPHICS_INVALID_MONITOR_SOURCEMODESET, -EIO,
1992 "STATUS_GRAPHICS_INVALID_MONITOR_SOURCEMODESET"},
1993 {STATUS_GRAPHICS_INVALID_MONITOR_SOURCE_MODE, -EIO,
1994 "STATUS_GRAPHICS_INVALID_MONITOR_SOURCE_MODE"},
1995 {STATUS_GRAPHICS_NO_RECOMMENDED_FUNCTIONAL_VIDPN, -EIO,
1996 "STATUS_GRAPHICS_NO_RECOMMENDED_FUNCTIONAL_VIDPN"},
1997 {STATUS_GRAPHICS_MODE_ID_MUST_BE_UNIQUE, -EIO,
1998 "STATUS_GRAPHICS_MODE_ID_MUST_BE_UNIQUE"},
1999 {STATUS_GRAPHICS_EMPTY_ADAPTER_MONITOR_MODE_SUPPORT_INTERSECTION, -EIO,
2000 "STATUS_GRAPHICS_EMPTY_ADAPTER_MONITOR_MODE_SUPPORT_INTERSECTION"},
2001 {STATUS_GRAPHICS_VIDEO_PRESENT_TARGETS_LESS_THAN_SOURCES, -EIO,
2002 "STATUS_GRAPHICS_VIDEO_PRESENT_TARGETS_LESS_THAN_SOURCES"},
2003 {STATUS_GRAPHICS_PATH_NOT_IN_TOPOLOGY, -EIO,
2004 "STATUS_GRAPHICS_PATH_NOT_IN_TOPOLOGY"},
2005 {STATUS_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_SOURCE, -EIO,
2006 "STATUS_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_SOURCE"},
2007 {STATUS_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_TARGET, -EIO,
2008 "STATUS_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_TARGET"},
2009 {STATUS_GRAPHICS_INVALID_MONITORDESCRIPTORSET, -EIO,
2010 "STATUS_GRAPHICS_INVALID_MONITORDESCRIPTORSET"},
2011 {STATUS_GRAPHICS_INVALID_MONITORDESCRIPTOR, -EIO,
2012 "STATUS_GRAPHICS_INVALID_MONITORDESCRIPTOR"},
2013 {STATUS_GRAPHICS_MONITORDESCRIPTOR_NOT_IN_SET, -EIO,
2014 "STATUS_GRAPHICS_MONITORDESCRIPTOR_NOT_IN_SET"},
2015 {STATUS_GRAPHICS_MONITORDESCRIPTOR_ALREADY_IN_SET, -EIO,
2016 "STATUS_GRAPHICS_MONITORDESCRIPTOR_ALREADY_IN_SET"},
2017 {STATUS_GRAPHICS_MONITORDESCRIPTOR_ID_MUST_BE_UNIQUE, -EIO,
2018 "STATUS_GRAPHICS_MONITORDESCRIPTOR_ID_MUST_BE_UNIQUE"},
2019 {STATUS_GRAPHICS_INVALID_VIDPN_TARGET_SUBSET_TYPE, -EIO,
2020 "STATUS_GRAPHICS_INVALID_VIDPN_TARGET_SUBSET_TYPE"},
2021 {STATUS_GRAPHICS_RESOURCES_NOT_RELATED, -EIO,
2022 "STATUS_GRAPHICS_RESOURCES_NOT_RELATED"},
2023 {STATUS_GRAPHICS_SOURCE_ID_MUST_BE_UNIQUE, -EIO,
2024 "STATUS_GRAPHICS_SOURCE_ID_MUST_BE_UNIQUE"},
2025 {STATUS_GRAPHICS_TARGET_ID_MUST_BE_UNIQUE, -EIO,
2026 "STATUS_GRAPHICS_TARGET_ID_MUST_BE_UNIQUE"},
2027 {STATUS_GRAPHICS_NO_AVAILABLE_VIDPN_TARGET, -EIO,
2028 "STATUS_GRAPHICS_NO_AVAILABLE_VIDPN_TARGET"},
2029 {STATUS_GRAPHICS_MONITOR_COULD_NOT_BE_ASSOCIATED_WITH_ADAPTER, -EIO,
2030 "STATUS_GRAPHICS_MONITOR_COULD_NOT_BE_ASSOCIATED_WITH_ADAPTER"},
2031 {STATUS_GRAPHICS_NO_VIDPNMGR, -EIO, "STATUS_GRAPHICS_NO_VIDPNMGR"},
2032 {STATUS_GRAPHICS_NO_ACTIVE_VIDPN, -EIO,
2033 "STATUS_GRAPHICS_NO_ACTIVE_VIDPN"},
2034 {STATUS_GRAPHICS_STALE_VIDPN_TOPOLOGY, -EIO,
2035 "STATUS_GRAPHICS_STALE_VIDPN_TOPOLOGY"},
2036 {STATUS_GRAPHICS_MONITOR_NOT_CONNECTED, -EIO,
2037 "STATUS_GRAPHICS_MONITOR_NOT_CONNECTED"},
2038 {STATUS_GRAPHICS_SOURCE_NOT_IN_TOPOLOGY, -EIO,
2039 "STATUS_GRAPHICS_SOURCE_NOT_IN_TOPOLOGY"},
2040 {STATUS_GRAPHICS_INVALID_PRIMARYSURFACE_SIZE, -EIO,
2041 "STATUS_GRAPHICS_INVALID_PRIMARYSURFACE_SIZE"},
2042 {STATUS_GRAPHICS_INVALID_VISIBLEREGION_SIZE, -EIO,
2043 "STATUS_GRAPHICS_INVALID_VISIBLEREGION_SIZE"},
2044 {STATUS_GRAPHICS_INVALID_STRIDE, -EIO,
2045 "STATUS_GRAPHICS_INVALID_STRIDE"},
2046 {STATUS_GRAPHICS_INVALID_PIXELFORMAT, -EIO,
2047 "STATUS_GRAPHICS_INVALID_PIXELFORMAT"},
2048 {STATUS_GRAPHICS_INVALID_COLORBASIS, -EIO,
2049 "STATUS_GRAPHICS_INVALID_COLORBASIS"},
2050 {STATUS_GRAPHICS_INVALID_PIXELVALUEACCESSMODE, -EIO,
2051 "STATUS_GRAPHICS_INVALID_PIXELVALUEACCESSMODE"},
2052 {STATUS_GRAPHICS_TARGET_NOT_IN_TOPOLOGY, -EIO,
2053 "STATUS_GRAPHICS_TARGET_NOT_IN_TOPOLOGY"},
2054 {STATUS_GRAPHICS_NO_DISPLAY_MODE_MANAGEMENT_SUPPORT, -EIO,
2055 "STATUS_GRAPHICS_NO_DISPLAY_MODE_MANAGEMENT_SUPPORT"},
2056 {STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE, -EIO,
2057 "STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE"},
2058 {STATUS_GRAPHICS_CANT_ACCESS_ACTIVE_VIDPN, -EIO,
2059 "STATUS_GRAPHICS_CANT_ACCESS_ACTIVE_VIDPN"},
2060 {STATUS_GRAPHICS_INVALID_PATH_IMPORTANCE_ORDINAL, -EIO,
2061 "STATUS_GRAPHICS_INVALID_PATH_IMPORTANCE_ORDINAL"},
2062 {STATUS_GRAPHICS_INVALID_PATH_CONTENT_GEOMETRY_TRANSFORMATION, -EIO,
2063 "STATUS_GRAPHICS_INVALID_PATH_CONTENT_GEOMETRY_TRANSFORMATION"},
2064 {STATUS_GRAPHICS_PATH_CONTENT_GEOMETRY_TRANSFORMATION_NOT_SUPPORTED,
2065 -EIO,
2066 "STATUS_GRAPHICS_PATH_CONTENT_GEOMETRY_TRANSFORMATION_NOT_SUPPORTED"},
2067 {STATUS_GRAPHICS_INVALID_GAMMA_RAMP, -EIO,
2068 "STATUS_GRAPHICS_INVALID_GAMMA_RAMP"},
2069 {STATUS_GRAPHICS_GAMMA_RAMP_NOT_SUPPORTED, -EIO,
2070 "STATUS_GRAPHICS_GAMMA_RAMP_NOT_SUPPORTED"},
2071 {STATUS_GRAPHICS_MULTISAMPLING_NOT_SUPPORTED, -EIO,
2072 "STATUS_GRAPHICS_MULTISAMPLING_NOT_SUPPORTED"},
2073 {STATUS_GRAPHICS_MODE_NOT_IN_MODESET, -EIO,
2074 "STATUS_GRAPHICS_MODE_NOT_IN_MODESET"},
2075 {STATUS_GRAPHICS_INVALID_VIDPN_TOPOLOGY_RECOMMENDATION_REASON, -EIO,
2076 "STATUS_GRAPHICS_INVALID_VIDPN_TOPOLOGY_RECOMMENDATION_REASON"},
2077 {STATUS_GRAPHICS_INVALID_PATH_CONTENT_TYPE, -EIO,
2078 "STATUS_GRAPHICS_INVALID_PATH_CONTENT_TYPE"},
2079 {STATUS_GRAPHICS_INVALID_COPYPROTECTION_TYPE, -EIO,
2080 "STATUS_GRAPHICS_INVALID_COPYPROTECTION_TYPE"},
2081 {STATUS_GRAPHICS_UNASSIGNED_MODESET_ALREADY_EXISTS, -EIO,
2082 "STATUS_GRAPHICS_UNASSIGNED_MODESET_ALREADY_EXISTS"},
2083 {STATUS_GRAPHICS_INVALID_SCANLINE_ORDERING, -EIO,
2084 "STATUS_GRAPHICS_INVALID_SCANLINE_ORDERING"},
2085 {STATUS_GRAPHICS_TOPOLOGY_CHANGES_NOT_ALLOWED, -EIO,
2086 "STATUS_GRAPHICS_TOPOLOGY_CHANGES_NOT_ALLOWED"},
2087 {STATUS_GRAPHICS_NO_AVAILABLE_IMPORTANCE_ORDINALS, -EIO,
2088 "STATUS_GRAPHICS_NO_AVAILABLE_IMPORTANCE_ORDINALS"},
2089 {STATUS_GRAPHICS_INCOMPATIBLE_PRIVATE_FORMAT, -EIO,
2090 "STATUS_GRAPHICS_INCOMPATIBLE_PRIVATE_FORMAT"},
2091 {STATUS_GRAPHICS_INVALID_MODE_PRUNING_ALGORITHM, -EIO,
2092 "STATUS_GRAPHICS_INVALID_MODE_PRUNING_ALGORITHM"},
2093 {STATUS_GRAPHICS_INVALID_MONITOR_CAPABILITY_ORIGIN, -EIO,
2094 "STATUS_GRAPHICS_INVALID_MONITOR_CAPABILITY_ORIGIN"},
2095 {STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE_CONSTRAINT, -EIO,
2096 "STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE_CONSTRAINT"},
2097 {STATUS_GRAPHICS_MAX_NUM_PATHS_REACHED, -EIO,
2098 "STATUS_GRAPHICS_MAX_NUM_PATHS_REACHED"},
2099 {STATUS_GRAPHICS_CANCEL_VIDPN_TOPOLOGY_AUGMENTATION, -EIO,
2100 "STATUS_GRAPHICS_CANCEL_VIDPN_TOPOLOGY_AUGMENTATION"},
2101 {STATUS_GRAPHICS_INVALID_CLIENT_TYPE, -EIO,
2102 "STATUS_GRAPHICS_INVALID_CLIENT_TYPE"},
2103 {STATUS_GRAPHICS_CLIENTVIDPN_NOT_SET, -EIO,
2104 "STATUS_GRAPHICS_CLIENTVIDPN_NOT_SET"},
2105 {STATUS_GRAPHICS_SPECIFIED_CHILD_ALREADY_CONNECTED, -EIO,
2106 "STATUS_GRAPHICS_SPECIFIED_CHILD_ALREADY_CONNECTED"},
2107 {STATUS_GRAPHICS_CHILD_DESCRIPTOR_NOT_SUPPORTED, -EIO,
2108 "STATUS_GRAPHICS_CHILD_DESCRIPTOR_NOT_SUPPORTED"},
2109 {STATUS_GRAPHICS_NOT_A_LINKED_ADAPTER, -EIO,
2110 "STATUS_GRAPHICS_NOT_A_LINKED_ADAPTER"},
2111 {STATUS_GRAPHICS_LEADLINK_NOT_ENUMERATED, -EIO,
2112 "STATUS_GRAPHICS_LEADLINK_NOT_ENUMERATED"},
2113 {STATUS_GRAPHICS_CHAINLINKS_NOT_ENUMERATED, -EIO,
2114 "STATUS_GRAPHICS_CHAINLINKS_NOT_ENUMERATED"},
2115 {STATUS_GRAPHICS_ADAPTER_CHAIN_NOT_READY, -EIO,
2116 "STATUS_GRAPHICS_ADAPTER_CHAIN_NOT_READY"},
2117 {STATUS_GRAPHICS_CHAINLINKS_NOT_STARTED, -EIO,
2118 "STATUS_GRAPHICS_CHAINLINKS_NOT_STARTED"},
2119 {STATUS_GRAPHICS_CHAINLINKS_NOT_POWERED_ON, -EIO,
2120 "STATUS_GRAPHICS_CHAINLINKS_NOT_POWERED_ON"},
2121 {STATUS_GRAPHICS_INCONSISTENT_DEVICE_LINK_STATE, -EIO,
2122 "STATUS_GRAPHICS_INCONSISTENT_DEVICE_LINK_STATE"},
2123 {STATUS_GRAPHICS_NOT_POST_DEVICE_DRIVER, -EIO,
2124 "STATUS_GRAPHICS_NOT_POST_DEVICE_DRIVER"},
2125 {STATUS_GRAPHICS_ADAPTER_ACCESS_NOT_EXCLUDED, -EIO,
2126 "STATUS_GRAPHICS_ADAPTER_ACCESS_NOT_EXCLUDED"},
2127 {STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_DOES_NOT_HAVE_COPP_SEMANTICS,
2128 -EIO,
2129 "STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_DOES_NOT_HAVE_COPP_SEMANTICS"},
2130 {STATUS_GRAPHICS_OPM_INVALID_INFORMATION_REQUEST, -EIO,
2131 "STATUS_GRAPHICS_OPM_INVALID_INFORMATION_REQUEST"},
2132 {STATUS_GRAPHICS_OPM_DRIVER_INTERNAL_ERROR, -EIO,
2133 "STATUS_GRAPHICS_OPM_DRIVER_INTERNAL_ERROR"},
2134 {STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_DOES_NOT_HAVE_OPM_SEMANTICS, -EIO,
2135 "STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_DOES_NOT_HAVE_OPM_SEMANTICS"},
2136 {STATUS_GRAPHICS_OPM_SIGNALING_NOT_SUPPORTED, -EIO,
2137 "STATUS_GRAPHICS_OPM_SIGNALING_NOT_SUPPORTED"},
2138 {STATUS_GRAPHICS_OPM_INVALID_CONFIGURATION_REQUEST, -EIO,
2139 "STATUS_GRAPHICS_OPM_INVALID_CONFIGURATION_REQUEST"},
2140 {STATUS_GRAPHICS_OPM_NOT_SUPPORTED, -EIO,
2141 "STATUS_GRAPHICS_OPM_NOT_SUPPORTED"},
2142 {STATUS_GRAPHICS_COPP_NOT_SUPPORTED, -EIO,
2143 "STATUS_GRAPHICS_COPP_NOT_SUPPORTED"},
2144 {STATUS_GRAPHICS_UAB_NOT_SUPPORTED, -EIO,
2145 "STATUS_GRAPHICS_UAB_NOT_SUPPORTED"},
2146 {STATUS_GRAPHICS_OPM_INVALID_ENCRYPTED_PARAMETERS, -EIO,
2147 "STATUS_GRAPHICS_OPM_INVALID_ENCRYPTED_PARAMETERS"},
2148 {STATUS_GRAPHICS_OPM_PARAMETER_ARRAY_TOO_SMALL, -EIO,
2149 "STATUS_GRAPHICS_OPM_PARAMETER_ARRAY_TOO_SMALL"},
2150 {STATUS_GRAPHICS_OPM_NO_PROTECTED_OUTPUTS_EXIST, -EIO,
2151 "STATUS_GRAPHICS_OPM_NO_PROTECTED_OUTPUTS_EXIST"},
2152 {STATUS_GRAPHICS_PVP_NO_DISPLAY_DEVICE_CORRESPONDS_TO_NAME, -EIO,
2153 "STATUS_GRAPHICS_PVP_NO_DISPLAY_DEVICE_CORRESPONDS_TO_NAME"},
2154 {STATUS_GRAPHICS_PVP_DISPLAY_DEVICE_NOT_ATTACHED_TO_DESKTOP, -EIO,
2155 "STATUS_GRAPHICS_PVP_DISPLAY_DEVICE_NOT_ATTACHED_TO_DESKTOP"},
2156 {STATUS_GRAPHICS_PVP_MIRRORING_DEVICES_NOT_SUPPORTED, -EIO,
2157 "STATUS_GRAPHICS_PVP_MIRRORING_DEVICES_NOT_SUPPORTED"},
2158 {STATUS_GRAPHICS_OPM_INVALID_POINTER, -EIO,
2159 "STATUS_GRAPHICS_OPM_INVALID_POINTER"},
2160 {STATUS_GRAPHICS_OPM_INTERNAL_ERROR, -EIO,
2161 "STATUS_GRAPHICS_OPM_INTERNAL_ERROR"},
2162 {STATUS_GRAPHICS_OPM_INVALID_HANDLE, -EIO,
2163 "STATUS_GRAPHICS_OPM_INVALID_HANDLE"},
2164 {STATUS_GRAPHICS_PVP_NO_MONITORS_CORRESPOND_TO_DISPLAY_DEVICE, -EIO,
2165 "STATUS_GRAPHICS_PVP_NO_MONITORS_CORRESPOND_TO_DISPLAY_DEVICE"},
2166 {STATUS_GRAPHICS_PVP_INVALID_CERTIFICATE_LENGTH, -EIO,
2167 "STATUS_GRAPHICS_PVP_INVALID_CERTIFICATE_LENGTH"},
2168 {STATUS_GRAPHICS_OPM_SPANNING_MODE_ENABLED, -EIO,
2169 "STATUS_GRAPHICS_OPM_SPANNING_MODE_ENABLED"},
2170 {STATUS_GRAPHICS_OPM_THEATER_MODE_ENABLED, -EIO,
2171 "STATUS_GRAPHICS_OPM_THEATER_MODE_ENABLED"},
2172 {STATUS_GRAPHICS_PVP_HFS_FAILED, -EIO,
2173 "STATUS_GRAPHICS_PVP_HFS_FAILED"},
2174 {STATUS_GRAPHICS_OPM_INVALID_SRM, -EIO,
2175 "STATUS_GRAPHICS_OPM_INVALID_SRM"},
2176 {STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_HDCP, -EIO,
2177 "STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_HDCP"},
2178 {STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_ACP, -EIO,
2179 "STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_ACP"},
2180 {STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_CGMSA, -EIO,
2181 "STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_CGMSA"},
2182 {STATUS_GRAPHICS_OPM_HDCP_SRM_NEVER_SET, -EIO,
2183 "STATUS_GRAPHICS_OPM_HDCP_SRM_NEVER_SET"},
2184 {STATUS_GRAPHICS_OPM_RESOLUTION_TOO_HIGH, -EIO,
2185 "STATUS_GRAPHICS_OPM_RESOLUTION_TOO_HIGH"},
2186 {STATUS_GRAPHICS_OPM_ALL_HDCP_HARDWARE_ALREADY_IN_USE, -EIO,
2187 "STATUS_GRAPHICS_OPM_ALL_HDCP_HARDWARE_ALREADY_IN_USE"},
2188 {STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_NO_LONGER_EXISTS, -EIO,
2189 "STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_NO_LONGER_EXISTS"},
2190 {STATUS_GRAPHICS_OPM_SESSION_TYPE_CHANGE_IN_PROGRESS, -EIO,
2191 "STATUS_GRAPHICS_OPM_SESSION_TYPE_CHANGE_IN_PROGRESS"},
2192 {STATUS_GRAPHICS_I2C_NOT_SUPPORTED, -EIO,
2193 "STATUS_GRAPHICS_I2C_NOT_SUPPORTED"},
2194 {STATUS_GRAPHICS_I2C_DEVICE_DOES_NOT_EXIST, -EIO,
2195 "STATUS_GRAPHICS_I2C_DEVICE_DOES_NOT_EXIST"},
2196 {STATUS_GRAPHICS_I2C_ERROR_TRANSMITTING_DATA, -EIO,
2197 "STATUS_GRAPHICS_I2C_ERROR_TRANSMITTING_DATA"},
2198 {STATUS_GRAPHICS_I2C_ERROR_RECEIVING_DATA, -EIO,
2199 "STATUS_GRAPHICS_I2C_ERROR_RECEIVING_DATA"},
2200 {STATUS_GRAPHICS_DDCCI_VCP_NOT_SUPPORTED, -EIO,
2201 "STATUS_GRAPHICS_DDCCI_VCP_NOT_SUPPORTED"},
2202 {STATUS_GRAPHICS_DDCCI_INVALID_DATA, -EIO,
2203 "STATUS_GRAPHICS_DDCCI_INVALID_DATA"},
2204 {STATUS_GRAPHICS_DDCCI_MONITOR_RETURNED_INVALID_TIMING_STATUS_BYTE,
2205 -EIO,
2206 "STATUS_GRAPHICS_DDCCI_MONITOR_RETURNED_INVALID_TIMING_STATUS_BYTE"},
2207 {STATUS_GRAPHICS_DDCCI_INVALID_CAPABILITIES_STRING, -EIO,
2208 "STATUS_GRAPHICS_DDCCI_INVALID_CAPABILITIES_STRING"},
2209 {STATUS_GRAPHICS_MCA_INTERNAL_ERROR, -EIO,
2210 "STATUS_GRAPHICS_MCA_INTERNAL_ERROR"},
2211 {STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_COMMAND, -EIO,
2212 "STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_COMMAND"},
2213 {STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_LENGTH, -EIO,
2214 "STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_LENGTH"},
2215 {STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_CHECKSUM, -EIO,
2216 "STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_CHECKSUM"},
2217 {STATUS_GRAPHICS_INVALID_PHYSICAL_MONITOR_HANDLE, -EIO,
2218 "STATUS_GRAPHICS_INVALID_PHYSICAL_MONITOR_HANDLE"},
2219 {STATUS_GRAPHICS_MONITOR_NO_LONGER_EXISTS, -EIO,
2220 "STATUS_GRAPHICS_MONITOR_NO_LONGER_EXISTS"},
2221 {STATUS_GRAPHICS_ONLY_CONSOLE_SESSION_SUPPORTED, -EIO,
2222 "STATUS_GRAPHICS_ONLY_CONSOLE_SESSION_SUPPORTED"},
2223 {STATUS_GRAPHICS_NO_DISPLAY_DEVICE_CORRESPONDS_TO_NAME, -EIO,
2224 "STATUS_GRAPHICS_NO_DISPLAY_DEVICE_CORRESPONDS_TO_NAME"},
2225 {STATUS_GRAPHICS_DISPLAY_DEVICE_NOT_ATTACHED_TO_DESKTOP, -EIO,
2226 "STATUS_GRAPHICS_DISPLAY_DEVICE_NOT_ATTACHED_TO_DESKTOP"},
2227 {STATUS_GRAPHICS_MIRRORING_DEVICES_NOT_SUPPORTED, -EIO,
2228 "STATUS_GRAPHICS_MIRRORING_DEVICES_NOT_SUPPORTED"},
2229 {STATUS_GRAPHICS_INVALID_POINTER, -EIO,
2230 "STATUS_GRAPHICS_INVALID_POINTER"},
2231 {STATUS_GRAPHICS_NO_MONITORS_CORRESPOND_TO_DISPLAY_DEVICE, -EIO,
2232 "STATUS_GRAPHICS_NO_MONITORS_CORRESPOND_TO_DISPLAY_DEVICE"},
2233 {STATUS_GRAPHICS_PARAMETER_ARRAY_TOO_SMALL, -EIO,
2234 "STATUS_GRAPHICS_PARAMETER_ARRAY_TOO_SMALL"},
2235 {STATUS_GRAPHICS_INTERNAL_ERROR, -EIO,
2236 "STATUS_GRAPHICS_INTERNAL_ERROR"},
2237 {STATUS_GRAPHICS_SESSION_TYPE_CHANGE_IN_PROGRESS, -EIO,
2238 "STATUS_GRAPHICS_SESSION_TYPE_CHANGE_IN_PROGRESS"},
2239 {STATUS_FVE_LOCKED_VOLUME, -EIO, "STATUS_FVE_LOCKED_VOLUME"},
2240 {STATUS_FVE_NOT_ENCRYPTED, -EIO, "STATUS_FVE_NOT_ENCRYPTED"},
2241 {STATUS_FVE_BAD_INFORMATION, -EIO, "STATUS_FVE_BAD_INFORMATION"},
2242 {STATUS_FVE_TOO_SMALL, -EIO, "STATUS_FVE_TOO_SMALL"},
2243 {STATUS_FVE_FAILED_WRONG_FS, -EIO, "STATUS_FVE_FAILED_WRONG_FS"},
2244 {STATUS_FVE_FAILED_BAD_FS, -EIO, "STATUS_FVE_FAILED_BAD_FS"},
2245 {STATUS_FVE_FS_NOT_EXTENDED, -EIO, "STATUS_FVE_FS_NOT_EXTENDED"},
2246 {STATUS_FVE_FS_MOUNTED, -EIO, "STATUS_FVE_FS_MOUNTED"},
2247 {STATUS_FVE_NO_LICENSE, -EIO, "STATUS_FVE_NO_LICENSE"},
2248 {STATUS_FVE_ACTION_NOT_ALLOWED, -EIO, "STATUS_FVE_ACTION_NOT_ALLOWED"},
2249 {STATUS_FVE_BAD_DATA, -EIO, "STATUS_FVE_BAD_DATA"},
2250 {STATUS_FVE_VOLUME_NOT_BOUND, -EIO, "STATUS_FVE_VOLUME_NOT_BOUND"},
2251 {STATUS_FVE_NOT_DATA_VOLUME, -EIO, "STATUS_FVE_NOT_DATA_VOLUME"},
2252 {STATUS_FVE_CONV_READ_ERROR, -EIO, "STATUS_FVE_CONV_READ_ERROR"},
2253 {STATUS_FVE_CONV_WRITE_ERROR, -EIO, "STATUS_FVE_CONV_WRITE_ERROR"},
2254 {STATUS_FVE_OVERLAPPED_UPDATE, -EIO, "STATUS_FVE_OVERLAPPED_UPDATE"},
2255 {STATUS_FVE_FAILED_SECTOR_SIZE, -EIO, "STATUS_FVE_FAILED_SECTOR_SIZE"},
2256 {STATUS_FVE_FAILED_AUTHENTICATION, -EIO,
2257 "STATUS_FVE_FAILED_AUTHENTICATION"},
2258 {STATUS_FVE_NOT_OS_VOLUME, -EIO, "STATUS_FVE_NOT_OS_VOLUME"},
2259 {STATUS_FVE_KEYFILE_NOT_FOUND, -EIO, "STATUS_FVE_KEYFILE_NOT_FOUND"},
2260 {STATUS_FVE_KEYFILE_INVALID, -EIO, "STATUS_FVE_KEYFILE_INVALID"},
2261 {STATUS_FVE_KEYFILE_NO_VMK, -EIO, "STATUS_FVE_KEYFILE_NO_VMK"},
2262 {STATUS_FVE_TPM_DISABLED, -EIO, "STATUS_FVE_TPM_DISABLED"},
2263 {STATUS_FVE_TPM_SRK_AUTH_NOT_ZERO, -EIO,
2264 "STATUS_FVE_TPM_SRK_AUTH_NOT_ZERO"},
2265 {STATUS_FVE_TPM_INVALID_PCR, -EIO, "STATUS_FVE_TPM_INVALID_PCR"},
2266 {STATUS_FVE_TPM_NO_VMK, -EIO, "STATUS_FVE_TPM_NO_VMK"},
2267 {STATUS_FVE_PIN_INVALID, -EIO, "STATUS_FVE_PIN_INVALID"},
2268 {STATUS_FVE_AUTH_INVALID_APPLICATION, -EIO,
2269 "STATUS_FVE_AUTH_INVALID_APPLICATION"},
2270 {STATUS_FVE_AUTH_INVALID_CONFIG, -EIO,
2271 "STATUS_FVE_AUTH_INVALID_CONFIG"},
2272 {STATUS_FVE_DEBUGGER_ENABLED, -EIO, "STATUS_FVE_DEBUGGER_ENABLED"},
2273 {STATUS_FVE_DRY_RUN_FAILED, -EIO, "STATUS_FVE_DRY_RUN_FAILED"},
2274 {STATUS_FVE_BAD_METADATA_POINTER, -EIO,
2275 "STATUS_FVE_BAD_METADATA_POINTER"},
2276 {STATUS_FVE_OLD_METADATA_COPY, -EIO, "STATUS_FVE_OLD_METADATA_COPY"},
2277 {STATUS_FVE_REBOOT_REQUIRED, -EIO, "STATUS_FVE_REBOOT_REQUIRED"},
2278 {STATUS_FVE_RAW_ACCESS, -EIO, "STATUS_FVE_RAW_ACCESS"},
2279 {STATUS_FVE_RAW_BLOCKED, -EIO, "STATUS_FVE_RAW_BLOCKED"},
2280 {STATUS_FWP_CALLOUT_NOT_FOUND, -EIO, "STATUS_FWP_CALLOUT_NOT_FOUND"},
2281 {STATUS_FWP_CONDITION_NOT_FOUND, -EIO,
2282 "STATUS_FWP_CONDITION_NOT_FOUND"},
2283 {STATUS_FWP_FILTER_NOT_FOUND, -EIO, "STATUS_FWP_FILTER_NOT_FOUND"},
2284 {STATUS_FWP_LAYER_NOT_FOUND, -EIO, "STATUS_FWP_LAYER_NOT_FOUND"},
2285 {STATUS_FWP_PROVIDER_NOT_FOUND, -EIO, "STATUS_FWP_PROVIDER_NOT_FOUND"},
2286 {STATUS_FWP_PROVIDER_CONTEXT_NOT_FOUND, -EIO,
2287 "STATUS_FWP_PROVIDER_CONTEXT_NOT_FOUND"},
2288 {STATUS_FWP_SUBLAYER_NOT_FOUND, -EIO, "STATUS_FWP_SUBLAYER_NOT_FOUND"},
2289 {STATUS_FWP_NOT_FOUND, -EIO, "STATUS_FWP_NOT_FOUND"},
2290 {STATUS_FWP_ALREADY_EXISTS, -EIO, "STATUS_FWP_ALREADY_EXISTS"},
2291 {STATUS_FWP_IN_USE, -EIO, "STATUS_FWP_IN_USE"},
2292 {STATUS_FWP_DYNAMIC_SESSION_IN_PROGRESS, -EIO,
2293 "STATUS_FWP_DYNAMIC_SESSION_IN_PROGRESS"},
2294 {STATUS_FWP_WRONG_SESSION, -EIO, "STATUS_FWP_WRONG_SESSION"},
2295 {STATUS_FWP_NO_TXN_IN_PROGRESS, -EIO, "STATUS_FWP_NO_TXN_IN_PROGRESS"},
2296 {STATUS_FWP_TXN_IN_PROGRESS, -EIO, "STATUS_FWP_TXN_IN_PROGRESS"},
2297 {STATUS_FWP_TXN_ABORTED, -EIO, "STATUS_FWP_TXN_ABORTED"},
2298 {STATUS_FWP_SESSION_ABORTED, -EIO, "STATUS_FWP_SESSION_ABORTED"},
2299 {STATUS_FWP_INCOMPATIBLE_TXN, -EIO, "STATUS_FWP_INCOMPATIBLE_TXN"},
2300 {STATUS_FWP_TIMEOUT, -ETIMEDOUT, "STATUS_FWP_TIMEOUT"},
2301 {STATUS_FWP_NET_EVENTS_DISABLED, -EIO,
2302 "STATUS_FWP_NET_EVENTS_DISABLED"},
2303 {STATUS_FWP_INCOMPATIBLE_LAYER, -EIO, "STATUS_FWP_INCOMPATIBLE_LAYER"},
2304 {STATUS_FWP_KM_CLIENTS_ONLY, -EIO, "STATUS_FWP_KM_CLIENTS_ONLY"},
2305 {STATUS_FWP_LIFETIME_MISMATCH, -EIO, "STATUS_FWP_LIFETIME_MISMATCH"},
2306 {STATUS_FWP_BUILTIN_OBJECT, -EIO, "STATUS_FWP_BUILTIN_OBJECT"},
2307 {STATUS_FWP_TOO_MANY_BOOTTIME_FILTERS, -EIO,
2308 "STATUS_FWP_TOO_MANY_BOOTTIME_FILTERS"},
2309 {STATUS_FWP_TOO_MANY_CALLOUTS, -EIO, "STATUS_FWP_TOO_MANY_CALLOUTS"},
2310 {STATUS_FWP_NOTIFICATION_DROPPED, -EIO,
2311 "STATUS_FWP_NOTIFICATION_DROPPED"},
2312 {STATUS_FWP_TRAFFIC_MISMATCH, -EIO, "STATUS_FWP_TRAFFIC_MISMATCH"},
2313 {STATUS_FWP_INCOMPATIBLE_SA_STATE, -EIO,
2314 "STATUS_FWP_INCOMPATIBLE_SA_STATE"},
2315 {STATUS_FWP_NULL_POINTER, -EIO, "STATUS_FWP_NULL_POINTER"},
2316 {STATUS_FWP_INVALID_ENUMERATOR, -EIO, "STATUS_FWP_INVALID_ENUMERATOR"},
2317 {STATUS_FWP_INVALID_FLAGS, -EIO, "STATUS_FWP_INVALID_FLAGS"},
2318 {STATUS_FWP_INVALID_NET_MASK, -EIO, "STATUS_FWP_INVALID_NET_MASK"},
2319 {STATUS_FWP_INVALID_RANGE, -EIO, "STATUS_FWP_INVALID_RANGE"},
2320 {STATUS_FWP_INVALID_INTERVAL, -EIO, "STATUS_FWP_INVALID_INTERVAL"},
2321 {STATUS_FWP_ZERO_LENGTH_ARRAY, -EIO, "STATUS_FWP_ZERO_LENGTH_ARRAY"},
2322 {STATUS_FWP_NULL_DISPLAY_NAME, -EIO, "STATUS_FWP_NULL_DISPLAY_NAME"},
2323 {STATUS_FWP_INVALID_ACTION_TYPE, -EIO,
2324 "STATUS_FWP_INVALID_ACTION_TYPE"},
2325 {STATUS_FWP_INVALID_WEIGHT, -EIO, "STATUS_FWP_INVALID_WEIGHT"},
2326 {STATUS_FWP_MATCH_TYPE_MISMATCH, -EIO,
2327 "STATUS_FWP_MATCH_TYPE_MISMATCH"},
2328 {STATUS_FWP_TYPE_MISMATCH, -EIO, "STATUS_FWP_TYPE_MISMATCH"},
2329 {STATUS_FWP_OUT_OF_BOUNDS, -EIO, "STATUS_FWP_OUT_OF_BOUNDS"},
2330 {STATUS_FWP_RESERVED, -EIO, "STATUS_FWP_RESERVED"},
2331 {STATUS_FWP_DUPLICATE_CONDITION, -EIO,
2332 "STATUS_FWP_DUPLICATE_CONDITION"},
2333 {STATUS_FWP_DUPLICATE_KEYMOD, -EIO, "STATUS_FWP_DUPLICATE_KEYMOD"},
2334 {STATUS_FWP_ACTION_INCOMPATIBLE_WITH_LAYER, -EIO,
2335 "STATUS_FWP_ACTION_INCOMPATIBLE_WITH_LAYER"},
2336 {STATUS_FWP_ACTION_INCOMPATIBLE_WITH_SUBLAYER, -EIO,
2337 "STATUS_FWP_ACTION_INCOMPATIBLE_WITH_SUBLAYER"},
2338 {STATUS_FWP_CONTEXT_INCOMPATIBLE_WITH_LAYER, -EIO,
2339 "STATUS_FWP_CONTEXT_INCOMPATIBLE_WITH_LAYER"},
2340 {STATUS_FWP_CONTEXT_INCOMPATIBLE_WITH_CALLOUT, -EIO,
2341 "STATUS_FWP_CONTEXT_INCOMPATIBLE_WITH_CALLOUT"},
2342 {STATUS_FWP_INCOMPATIBLE_AUTH_METHOD, -EIO,
2343 "STATUS_FWP_INCOMPATIBLE_AUTH_METHOD"},
2344 {STATUS_FWP_INCOMPATIBLE_DH_GROUP, -EIO,
2345 "STATUS_FWP_INCOMPATIBLE_DH_GROUP"},
2346 {STATUS_FWP_EM_NOT_SUPPORTED, -EOPNOTSUPP,
2347 "STATUS_FWP_EM_NOT_SUPPORTED"},
2348 {STATUS_FWP_NEVER_MATCH, -EIO, "STATUS_FWP_NEVER_MATCH"},
2349 {STATUS_FWP_PROVIDER_CONTEXT_MISMATCH, -EIO,
2350 "STATUS_FWP_PROVIDER_CONTEXT_MISMATCH"},
2351 {STATUS_FWP_INVALID_PARAMETER, -EIO, "STATUS_FWP_INVALID_PARAMETER"},
2352 {STATUS_FWP_TOO_MANY_SUBLAYERS, -EIO, "STATUS_FWP_TOO_MANY_SUBLAYERS"},
2353 {STATUS_FWP_CALLOUT_NOTIFICATION_FAILED, -EIO,
2354 "STATUS_FWP_CALLOUT_NOTIFICATION_FAILED"},
2355 {STATUS_FWP_INCOMPATIBLE_AUTH_CONFIG, -EIO,
2356 "STATUS_FWP_INCOMPATIBLE_AUTH_CONFIG"},
2357 {STATUS_FWP_INCOMPATIBLE_CIPHER_CONFIG, -EIO,
2358 "STATUS_FWP_INCOMPATIBLE_CIPHER_CONFIG"},
2359 {STATUS_FWP_TCPIP_NOT_READY, -EIO, "STATUS_FWP_TCPIP_NOT_READY"},
2360 {STATUS_FWP_INJECT_HANDLE_CLOSING, -EIO,
2361 "STATUS_FWP_INJECT_HANDLE_CLOSING"},
2362 {STATUS_FWP_INJECT_HANDLE_STALE, -EIO,
2363 "STATUS_FWP_INJECT_HANDLE_STALE"},
2364 {STATUS_FWP_CANNOT_PEND, -EIO, "STATUS_FWP_CANNOT_PEND"},
2365 {STATUS_NDIS_CLOSING, -EIO, "STATUS_NDIS_CLOSING"},
2366 {STATUS_NDIS_BAD_VERSION, -EIO, "STATUS_NDIS_BAD_VERSION"},
2367 {STATUS_NDIS_BAD_CHARACTERISTICS, -EIO,
2368 "STATUS_NDIS_BAD_CHARACTERISTICS"},
2369 {STATUS_NDIS_ADAPTER_NOT_FOUND, -EIO, "STATUS_NDIS_ADAPTER_NOT_FOUND"},
2370 {STATUS_NDIS_OPEN_FAILED, -EIO, "STATUS_NDIS_OPEN_FAILED"},
2371 {STATUS_NDIS_DEVICE_FAILED, -EIO, "STATUS_NDIS_DEVICE_FAILED"},
2372 {STATUS_NDIS_MULTICAST_FULL, -EIO, "STATUS_NDIS_MULTICAST_FULL"},
2373 {STATUS_NDIS_MULTICAST_EXISTS, -EIO, "STATUS_NDIS_MULTICAST_EXISTS"},
2374 {STATUS_NDIS_MULTICAST_NOT_FOUND, -EIO,
2375 "STATUS_NDIS_MULTICAST_NOT_FOUND"},
2376 {STATUS_NDIS_REQUEST_ABORTED, -EIO, "STATUS_NDIS_REQUEST_ABORTED"},
2377 {STATUS_NDIS_RESET_IN_PROGRESS, -EIO, "STATUS_NDIS_RESET_IN_PROGRESS"},
2378 {STATUS_NDIS_INVALID_PACKET, -EIO, "STATUS_NDIS_INVALID_PACKET"},
2379 {STATUS_NDIS_INVALID_DEVICE_REQUEST, -EIO,
2380 "STATUS_NDIS_INVALID_DEVICE_REQUEST"},
2381 {STATUS_NDIS_ADAPTER_NOT_READY, -EIO, "STATUS_NDIS_ADAPTER_NOT_READY"},
2382 {STATUS_NDIS_INVALID_LENGTH, -EIO, "STATUS_NDIS_INVALID_LENGTH"},
2383 {STATUS_NDIS_INVALID_DATA, -EIO, "STATUS_NDIS_INVALID_DATA"},
2384 {STATUS_NDIS_BUFFER_TOO_SHORT, -ENOBUFS,
2385 "STATUS_NDIS_BUFFER_TOO_SHORT"},
2386 {STATUS_NDIS_INVALID_OID, -EIO, "STATUS_NDIS_INVALID_OID"},
2387 {STATUS_NDIS_ADAPTER_REMOVED, -EIO, "STATUS_NDIS_ADAPTER_REMOVED"},
2388 {STATUS_NDIS_UNSUPPORTED_MEDIA, -EIO, "STATUS_NDIS_UNSUPPORTED_MEDIA"},
2389 {STATUS_NDIS_GROUP_ADDRESS_IN_USE, -EIO,
2390 "STATUS_NDIS_GROUP_ADDRESS_IN_USE"},
2391 {STATUS_NDIS_FILE_NOT_FOUND, -EIO, "STATUS_NDIS_FILE_NOT_FOUND"},
2392 {STATUS_NDIS_ERROR_READING_FILE, -EIO,
2393 "STATUS_NDIS_ERROR_READING_FILE"},
2394 {STATUS_NDIS_ALREADY_MAPPED, -EIO, "STATUS_NDIS_ALREADY_MAPPED"},
2395 {STATUS_NDIS_RESOURCE_CONFLICT, -EIO, "STATUS_NDIS_RESOURCE_CONFLICT"},
2396 {STATUS_NDIS_MEDIA_DISCONNECTED, -EIO,
2397 "STATUS_NDIS_MEDIA_DISCONNECTED"},
2398 {STATUS_NDIS_INVALID_ADDRESS, -EIO, "STATUS_NDIS_INVALID_ADDRESS"},
2399 {STATUS_NDIS_PAUSED, -EIO, "STATUS_NDIS_PAUSED"},
2400 {STATUS_NDIS_INTERFACE_NOT_FOUND, -EIO,
2401 "STATUS_NDIS_INTERFACE_NOT_FOUND"},
2402 {STATUS_NDIS_UNSUPPORTED_REVISION, -EIO,
2403 "STATUS_NDIS_UNSUPPORTED_REVISION"},
2404 {STATUS_NDIS_INVALID_PORT, -EIO, "STATUS_NDIS_INVALID_PORT"},
2405 {STATUS_NDIS_INVALID_PORT_STATE, -EIO,
2406 "STATUS_NDIS_INVALID_PORT_STATE"},
2407 {STATUS_NDIS_LOW_POWER_STATE, -EIO, "STATUS_NDIS_LOW_POWER_STATE"},
2408 {STATUS_NDIS_NOT_SUPPORTED, -ENOSYS, "STATUS_NDIS_NOT_SUPPORTED"},
2409 {STATUS_NDIS_DOT11_AUTO_CONFIG_ENABLED, -EIO,
2410 "STATUS_NDIS_DOT11_AUTO_CONFIG_ENABLED"},
2411 {STATUS_NDIS_DOT11_MEDIA_IN_USE, -EIO,
2412 "STATUS_NDIS_DOT11_MEDIA_IN_USE"},
2413 {STATUS_NDIS_DOT11_POWER_STATE_INVALID, -EIO,
2414 "STATUS_NDIS_DOT11_POWER_STATE_INVALID"},
2415 {STATUS_IPSEC_BAD_SPI, -EIO, "STATUS_IPSEC_BAD_SPI"},
2416 {STATUS_IPSEC_SA_LIFETIME_EXPIRED, -EIO,
2417 "STATUS_IPSEC_SA_LIFETIME_EXPIRED"},
2418 {STATUS_IPSEC_WRONG_SA, -EIO, "STATUS_IPSEC_WRONG_SA"},
2419 {STATUS_IPSEC_REPLAY_CHECK_FAILED, -EIO,
2420 "STATUS_IPSEC_REPLAY_CHECK_FAILED"},
2421 {STATUS_IPSEC_INVALID_PACKET, -EIO, "STATUS_IPSEC_INVALID_PACKET"},
2422 {STATUS_IPSEC_INTEGRITY_CHECK_FAILED, -EIO,
2423 "STATUS_IPSEC_INTEGRITY_CHECK_FAILED"},
2424 {STATUS_IPSEC_CLEAR_TEXT_DROP, -EIO, "STATUS_IPSEC_CLEAR_TEXT_DROP"},
2425 {0, 0, NULL}
2426};
2427
2428/*****************************************************************************
2429 Print an error message from the status code
2430 *****************************************************************************/
2431static void
2432smb2_print_status(__le32 status)
2433{
2434 int idx = 0;
2435
2436 while (smb2_error_map_table[idx].status_string != NULL) {
2437 if ((smb2_error_map_table[idx].smb2_status) == status) {
2438 pr_notice("Status code returned 0x%08x %s\n", status,
2439 smb2_error_map_table[idx].status_string);
2440 }
2441 idx++;
2442 }
2443 return;
2444}
2445
2446int
2447map_smb2_to_linux_error(char *buf, bool log_err)
2448{
2449 struct smb2_hdr *hdr = (struct smb2_hdr *)buf;
2450 unsigned int i;
2451 int rc = -EIO;
2452 __le32 smb2err = hdr->Status;
2453
2454 if (smb2err == 0)
2455 return 0;
2456
2457 /* mask facility */
2458 if (log_err && (smb2err != (STATUS_MORE_PROCESSING_REQUIRED)))
2459 smb2_print_status(smb2err);
2460 else if (cifsFYI & CIFS_RC)
2461 smb2_print_status(smb2err);
2462
2463 for (i = 0; i < sizeof(smb2_error_map_table) /
2464 sizeof(struct status_to_posix_error); i++) {
2465 if (smb2_error_map_table[i].smb2_status == smb2err) {
2466 rc = smb2_error_map_table[i].posix_error;
2467 break;
2468 }
2469 }
2470
2471 /* on error mapping not found - return EIO */
2472
2473 cFYI(1, "Mapping SMB2 status code %d to POSIX err %d",
2474 smb2err, rc);
2475
2476 return rc;
2477}
diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c
new file mode 100644
index 000000000000..a4ff5d547554
--- /dev/null
+++ b/fs/cifs/smb2misc.c
@@ -0,0 +1,347 @@
1/*
2 * fs/cifs/smb2misc.c
3 *
4 * Copyright (C) International Business Machines Corp., 2002,2011
5 * Etersoft, 2012
6 * Author(s): Steve French (sfrench@us.ibm.com)
7 * Pavel Shilovsky (pshilovsky@samba.org) 2012
8 *
9 * This library is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as published
11 * by the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
17 * the GNU Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23#include <linux/ctype.h>
24#include "smb2pdu.h"
25#include "cifsglob.h"
26#include "cifsproto.h"
27#include "smb2proto.h"
28#include "cifs_debug.h"
29#include "cifs_unicode.h"
30#include "smb2status.h"
31
32static int
33check_smb2_hdr(struct smb2_hdr *hdr, __u64 mid)
34{
35 /*
36 * Make sure that this really is an SMB, that it is a response,
37 * and that the message ids match.
38 */
39 if ((*(__le32 *)hdr->ProtocolId == SMB2_PROTO_NUMBER) &&
40 (mid == hdr->MessageId)) {
41 if (hdr->Flags & SMB2_FLAGS_SERVER_TO_REDIR)
42 return 0;
43 else {
44 /* only one valid case where server sends us request */
45 if (hdr->Command == SMB2_OPLOCK_BREAK)
46 return 0;
47 else
48 cERROR(1, "Received Request not response");
49 }
50 } else { /* bad signature or mid */
51 if (*(__le32 *)hdr->ProtocolId != SMB2_PROTO_NUMBER)
52 cERROR(1, "Bad protocol string signature header %x",
53 *(unsigned int *) hdr->ProtocolId);
54 if (mid != hdr->MessageId)
55 cERROR(1, "Mids do not match");
56 }
57 cERROR(1, "Bad SMB detected. The Mid=%llu", hdr->MessageId);
58 return 1;
59}
60
61/*
62 * The following table defines the expected "StructureSize" of SMB2 responses
63 * in order by SMB2 command. This is similar to "wct" in SMB/CIFS responses.
64 *
65 * Note that commands are defined in smb2pdu.h in le16 but the array below is
66 * indexed by command in host byte order
67 */
68static const __le16 smb2_rsp_struct_sizes[NUMBER_OF_SMB2_COMMANDS] = {
69 /* SMB2_NEGOTIATE */ __constant_cpu_to_le16(65),
70 /* SMB2_SESSION_SETUP */ __constant_cpu_to_le16(9),
71 /* SMB2_LOGOFF */ __constant_cpu_to_le16(4),
72 /* SMB2_TREE_CONNECT */ __constant_cpu_to_le16(16),
73 /* SMB2_TREE_DISCONNECT */ __constant_cpu_to_le16(4),
74 /* SMB2_CREATE */ __constant_cpu_to_le16(89),
75 /* SMB2_CLOSE */ __constant_cpu_to_le16(60),
76 /* SMB2_FLUSH */ __constant_cpu_to_le16(4),
77 /* SMB2_READ */ __constant_cpu_to_le16(17),
78 /* SMB2_WRITE */ __constant_cpu_to_le16(17),
79 /* SMB2_LOCK */ __constant_cpu_to_le16(4),
80 /* SMB2_IOCTL */ __constant_cpu_to_le16(49),
81 /* BB CHECK this ... not listed in documentation */
82 /* SMB2_CANCEL */ __constant_cpu_to_le16(0),
83 /* SMB2_ECHO */ __constant_cpu_to_le16(4),
84 /* SMB2_QUERY_DIRECTORY */ __constant_cpu_to_le16(9),
85 /* SMB2_CHANGE_NOTIFY */ __constant_cpu_to_le16(9),
86 /* SMB2_QUERY_INFO */ __constant_cpu_to_le16(9),
87 /* SMB2_SET_INFO */ __constant_cpu_to_le16(2),
88 /* BB FIXME can also be 44 for lease break */
89 /* SMB2_OPLOCK_BREAK */ __constant_cpu_to_le16(24)
90};
91
92int
93smb2_check_message(char *buf, unsigned int length)
94{
95 struct smb2_hdr *hdr = (struct smb2_hdr *)buf;
96 struct smb2_pdu *pdu = (struct smb2_pdu *)hdr;
97 __u64 mid = hdr->MessageId;
98 __u32 len = get_rfc1002_length(buf);
99 __u32 clc_len; /* calculated length */
100 int command;
101
102 /* BB disable following printk later */
103 cFYI(1, "%s length: 0x%x, smb_buf_length: 0x%x", __func__, length, len);
104
105 /*
106 * Add function to do table lookup of StructureSize by command
107 * ie Validate the wct via smb2_struct_sizes table above
108 */
109
110 if (length < 2 + sizeof(struct smb2_hdr)) {
111 if ((length >= sizeof(struct smb2_hdr)) && (hdr->Status != 0)) {
112 pdu->StructureSize2 = 0;
113 /*
114 * As with SMB/CIFS, on some error cases servers may
115 * not return wct properly
116 */
117 return 0;
118 } else {
119 cERROR(1, "Length less than SMB header size");
120 }
121 return 1;
122 }
123 if (len > CIFSMaxBufSize + MAX_SMB2_HDR_SIZE - 4) {
124 cERROR(1, "SMB length greater than maximum, mid=%lld", mid);
125 return 1;
126 }
127
128 if (check_smb2_hdr(hdr, mid))
129 return 1;
130
131 if (hdr->StructureSize != SMB2_HEADER_SIZE) {
132 cERROR(1, "Illegal structure size %d",
133 le16_to_cpu(hdr->StructureSize));
134 return 1;
135 }
136
137 command = le16_to_cpu(hdr->Command);
138 if (command >= NUMBER_OF_SMB2_COMMANDS) {
139 cERROR(1, "Illegal SMB2 command %d", command);
140 return 1;
141 }
142
143 if (smb2_rsp_struct_sizes[command] != pdu->StructureSize2) {
144 if (hdr->Status == 0 ||
145 pdu->StructureSize2 != SMB2_ERROR_STRUCTURE_SIZE2) {
146 /* error packets have 9 byte structure size */
147 cERROR(1, "Illegal response size %u for command %d",
148 le16_to_cpu(pdu->StructureSize2), command);
149 return 1;
150 }
151 }
152
153 if (4 + len != length) {
154 cERROR(1, "Total length %u RFC1002 length %u mismatch mid %llu",
155 length, 4 + len, mid);
156 return 1;
157 }
158
159 clc_len = smb2_calc_size(hdr);
160
161 if (4 + len != clc_len) {
162 cFYI(1, "Calculated size %u length %u mismatch mid %llu",
163 clc_len, 4 + len, mid);
164 if (clc_len == 4 + len + 1) /* BB FIXME (fix samba) */
165 return 0; /* BB workaround Samba 3 bug SessSetup rsp */
166 return 1;
167 }
168 return 0;
169}
170
171/*
172 * The size of the variable area depends on the offset and length fields
173 * located in different fields for various SMB2 responses. SMB2 responses
174 * with no variable length info, show an offset of zero for the offset field.
175 */
176static const bool has_smb2_data_area[NUMBER_OF_SMB2_COMMANDS] = {
177 /* SMB2_NEGOTIATE */ true,
178 /* SMB2_SESSION_SETUP */ true,
179 /* SMB2_LOGOFF */ false,
180 /* SMB2_TREE_CONNECT */ false,
181 /* SMB2_TREE_DISCONNECT */ false,
182 /* SMB2_CREATE */ true,
183 /* SMB2_CLOSE */ false,
184 /* SMB2_FLUSH */ false,
185 /* SMB2_READ */ true,
186 /* SMB2_WRITE */ false,
187 /* SMB2_LOCK */ false,
188 /* SMB2_IOCTL */ true,
189 /* SMB2_CANCEL */ false, /* BB CHECK this not listed in documentation */
190 /* SMB2_ECHO */ false,
191 /* SMB2_QUERY_DIRECTORY */ true,
192 /* SMB2_CHANGE_NOTIFY */ true,
193 /* SMB2_QUERY_INFO */ true,
194 /* SMB2_SET_INFO */ false,
195 /* SMB2_OPLOCK_BREAK */ false
196};
197
198/*
199 * Returns the pointer to the beginning of the data area. Length of the data
200 * area and the offset to it (from the beginning of the smb are also returned.
201 */
202char *
203smb2_get_data_area_len(int *off, int *len, struct smb2_hdr *hdr)
204{
205 *off = 0;
206 *len = 0;
207
208 /* error responses do not have data area */
209 if (hdr->Status && hdr->Status != STATUS_MORE_PROCESSING_REQUIRED &&
210 (((struct smb2_err_rsp *)hdr)->StructureSize) ==
211 SMB2_ERROR_STRUCTURE_SIZE2)
212 return NULL;
213
214 /*
215 * Following commands have data areas so we have to get the location
216 * of the data buffer offset and data buffer length for the particular
217 * command.
218 */
219 switch (hdr->Command) {
220 case SMB2_NEGOTIATE:
221 *off = le16_to_cpu(
222 ((struct smb2_negotiate_rsp *)hdr)->SecurityBufferOffset);
223 *len = le16_to_cpu(
224 ((struct smb2_negotiate_rsp *)hdr)->SecurityBufferLength);
225 break;
226 case SMB2_SESSION_SETUP:
227 *off = le16_to_cpu(
228 ((struct smb2_sess_setup_rsp *)hdr)->SecurityBufferOffset);
229 *len = le16_to_cpu(
230 ((struct smb2_sess_setup_rsp *)hdr)->SecurityBufferLength);
231 break;
232 case SMB2_CREATE:
233 *off = le32_to_cpu(
234 ((struct smb2_create_rsp *)hdr)->CreateContextsOffset);
235 *len = le32_to_cpu(
236 ((struct smb2_create_rsp *)hdr)->CreateContextsLength);
237 break;
238 case SMB2_QUERY_INFO:
239 *off = le16_to_cpu(
240 ((struct smb2_query_info_rsp *)hdr)->OutputBufferOffset);
241 *len = le32_to_cpu(
242 ((struct smb2_query_info_rsp *)hdr)->OutputBufferLength);
243 break;
244 case SMB2_READ:
245 case SMB2_QUERY_DIRECTORY:
246 case SMB2_IOCTL:
247 case SMB2_CHANGE_NOTIFY:
248 default:
249 /* BB FIXME for unimplemented cases above */
250 cERROR(1, "no length check for command");
251 break;
252 }
253
254 /*
255 * Invalid length or offset probably means data area is invalid, but
256 * we have little choice but to ignore the data area in this case.
257 */
258 if (*off > 4096) {
259 cERROR(1, "offset %d too large, data area ignored", *off);
260 *len = 0;
261 *off = 0;
262 } else if (*off < 0) {
263 cERROR(1, "negative offset %d to data invalid ignore data area",
264 *off);
265 *off = 0;
266 *len = 0;
267 } else if (*len < 0) {
268 cERROR(1, "negative data length %d invalid, data area ignored",
269 *len);
270 *len = 0;
271 } else if (*len > 128 * 1024) {
272 cERROR(1, "data area larger than 128K: %d", *len);
273 *len = 0;
274 }
275
276 /* return pointer to beginning of data area, ie offset from SMB start */
277 if ((*off != 0) && (*len != 0))
278 return hdr->ProtocolId + *off;
279 else
280 return NULL;
281}
282
283/*
284 * Calculate the size of the SMB message based on the fixed header
285 * portion, the number of word parameters and the data portion of the message.
286 */
287unsigned int
288smb2_calc_size(struct smb2_hdr *hdr)
289{
290 struct smb2_pdu *pdu = (struct smb2_pdu *)hdr;
291 int offset; /* the offset from the beginning of SMB to data area */
292 int data_length; /* the length of the variable length data area */
293 /* Structure Size has already been checked to make sure it is 64 */
294 int len = 4 + le16_to_cpu(pdu->hdr.StructureSize);
295
296 /*
297 * StructureSize2, ie length of fixed parameter area has already
298 * been checked to make sure it is the correct length.
299 */
300 len += le16_to_cpu(pdu->StructureSize2);
301
302 if (has_smb2_data_area[le16_to_cpu(hdr->Command)] == false)
303 goto calc_size_exit;
304
305 smb2_get_data_area_len(&offset, &data_length, hdr);
306 cFYI(1, "SMB2 data length %d offset %d", data_length, offset);
307
308 if (data_length > 0) {
309 /*
310 * Check to make sure that data area begins after fixed area,
311 * Note that last byte of the fixed area is part of data area
312 * for some commands, typically those with odd StructureSize,
313 * so we must add one to the calculation (and 4 to account for
314 * the size of the RFC1001 hdr.
315 */
316 if (offset + 4 + 1 < len) {
317 cERROR(1, "data area offset %d overlaps SMB2 header %d",
318 offset + 4 + 1, len);
319 data_length = 0;
320 } else {
321 len = 4 + offset + data_length;
322 }
323 }
324calc_size_exit:
325 cFYI(1, "SMB2 len %d", len);
326 return len;
327}
328
329/* Note: caller must free return buffer */
330__le16 *
331cifs_convert_path_to_utf16(const char *from, struct cifs_sb_info *cifs_sb)
332{
333 int len;
334 const char *start_of_path;
335 __le16 *to;
336
337 /* Windows doesn't allow paths beginning with \ */
338 if (from[0] == '\\')
339 start_of_path = from + 1;
340 else
341 start_of_path = from;
342 to = cifs_strndup_to_utf16(start_of_path, PATH_MAX, &len,
343 cifs_sb->local_nls,
344 cifs_sb->mnt_cifs_flags &
345 CIFS_MOUNT_MAP_SPECIAL_CHR);
346 return to;
347}
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index f065e89756a1..410cf925ea26 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -18,10 +18,314 @@
18 */ 18 */
19 19
20#include "cifsglob.h" 20#include "cifsglob.h"
21#include "smb2pdu.h"
22#include "smb2proto.h"
23#include "cifsproto.h"
24#include "cifs_debug.h"
25
26static int
27change_conf(struct TCP_Server_Info *server)
28{
29 server->credits += server->echo_credits + server->oplock_credits;
30 server->oplock_credits = server->echo_credits = 0;
31 switch (server->credits) {
32 case 0:
33 return -1;
34 case 1:
35 server->echoes = false;
36 server->oplocks = false;
37 cERROR(1, "disabling echoes and oplocks");
38 break;
39 case 2:
40 server->echoes = true;
41 server->oplocks = false;
42 server->echo_credits = 1;
43 cFYI(1, "disabling oplocks");
44 break;
45 default:
46 server->echoes = true;
47 server->oplocks = true;
48 server->echo_credits = 1;
49 server->oplock_credits = 1;
50 }
51 server->credits -= server->echo_credits + server->oplock_credits;
52 return 0;
53}
54
55static void
56smb2_add_credits(struct TCP_Server_Info *server, const unsigned int add,
57 const int optype)
58{
59 int *val, rc = 0;
60 spin_lock(&server->req_lock);
61 val = server->ops->get_credits_field(server, optype);
62 *val += add;
63 server->in_flight--;
64 if (server->in_flight == 0 && (optype & CIFS_OP_MASK) != CIFS_NEG_OP)
65 rc = change_conf(server);
66 spin_unlock(&server->req_lock);
67 wake_up(&server->request_q);
68 if (rc)
69 cifs_reconnect(server);
70}
71
72static void
73smb2_set_credits(struct TCP_Server_Info *server, const int val)
74{
75 spin_lock(&server->req_lock);
76 server->credits = val;
77 spin_unlock(&server->req_lock);
78}
79
80static int *
81smb2_get_credits_field(struct TCP_Server_Info *server, const int optype)
82{
83 switch (optype) {
84 case CIFS_ECHO_OP:
85 return &server->echo_credits;
86 case CIFS_OBREAK_OP:
87 return &server->oplock_credits;
88 default:
89 return &server->credits;
90 }
91}
92
93static unsigned int
94smb2_get_credits(struct mid_q_entry *mid)
95{
96 return le16_to_cpu(((struct smb2_hdr *)mid->resp_buf)->CreditRequest);
97}
98
99static __u64
100smb2_get_next_mid(struct TCP_Server_Info *server)
101{
102 __u64 mid;
103 /* for SMB2 we need the current value */
104 spin_lock(&GlobalMid_Lock);
105 mid = server->CurrentMid++;
106 spin_unlock(&GlobalMid_Lock);
107 return mid;
108}
109
110static struct mid_q_entry *
111smb2_find_mid(struct TCP_Server_Info *server, char *buf)
112{
113 struct mid_q_entry *mid;
114 struct smb2_hdr *hdr = (struct smb2_hdr *)buf;
115
116 spin_lock(&GlobalMid_Lock);
117 list_for_each_entry(mid, &server->pending_mid_q, qhead) {
118 if ((mid->mid == hdr->MessageId) &&
119 (mid->mid_state == MID_REQUEST_SUBMITTED) &&
120 (mid->command == hdr->Command)) {
121 spin_unlock(&GlobalMid_Lock);
122 return mid;
123 }
124 }
125 spin_unlock(&GlobalMid_Lock);
126 return NULL;
127}
128
129static void
130smb2_dump_detail(void *buf)
131{
132#ifdef CONFIG_CIFS_DEBUG2
133 struct smb2_hdr *smb = (struct smb2_hdr *)buf;
134
135 cERROR(1, "Cmd: %d Err: 0x%x Flags: 0x%x Mid: %llu Pid: %d",
136 smb->Command, smb->Status, smb->Flags, smb->MessageId,
137 smb->ProcessId);
138 cERROR(1, "smb buf %p len %u", smb, smb2_calc_size(smb));
139#endif
140}
141
142static bool
143smb2_need_neg(struct TCP_Server_Info *server)
144{
145 return server->max_read == 0;
146}
147
148static int
149smb2_negotiate(const unsigned int xid, struct cifs_ses *ses)
150{
151 int rc;
152 ses->server->CurrentMid = 0;
153 rc = SMB2_negotiate(xid, ses);
154 /* BB we probably don't need to retry with modern servers */
155 if (rc == -EAGAIN)
156 rc = -EHOSTDOWN;
157 return rc;
158}
159
160static int
161smb2_is_path_accessible(const unsigned int xid, struct cifs_tcon *tcon,
162 struct cifs_sb_info *cifs_sb, const char *full_path)
163{
164 int rc;
165 __u64 persistent_fid, volatile_fid;
166 __le16 *utf16_path;
167
168 utf16_path = cifs_convert_path_to_utf16(full_path, cifs_sb);
169 if (!utf16_path)
170 return -ENOMEM;
171
172 rc = SMB2_open(xid, tcon, utf16_path, &persistent_fid, &volatile_fid,
173 FILE_READ_ATTRIBUTES, FILE_OPEN, 0, 0);
174 if (rc) {
175 kfree(utf16_path);
176 return rc;
177 }
178
179 rc = SMB2_close(xid, tcon, persistent_fid, volatile_fid);
180 kfree(utf16_path);
181 return rc;
182}
183
184static int
185smb2_get_srv_inum(const unsigned int xid, struct cifs_tcon *tcon,
186 struct cifs_sb_info *cifs_sb, const char *full_path,
187 u64 *uniqueid, FILE_ALL_INFO *data)
188{
189 *uniqueid = le64_to_cpu(data->IndexNumber);
190 return 0;
191}
192
193static char *
194smb2_build_path_to_root(struct smb_vol *vol, struct cifs_sb_info *cifs_sb,
195 struct cifs_tcon *tcon)
196{
197 int pplen = vol->prepath ? strlen(vol->prepath) : 0;
198 char *full_path = NULL;
199
200 /* if no prefix path, simply set path to the root of share to "" */
201 if (pplen == 0) {
202 full_path = kzalloc(2, GFP_KERNEL);
203 return full_path;
204 }
205
206 cERROR(1, "prefixpath is not supported for SMB2 now");
207 return NULL;
208}
209
210static bool
211smb2_can_echo(struct TCP_Server_Info *server)
212{
213 return server->echoes;
214}
215
216static void
217smb2_clear_stats(struct cifs_tcon *tcon)
218{
219#ifdef CONFIG_CIFS_STATS
220 int i;
221 for (i = 0; i < NUMBER_OF_SMB2_COMMANDS; i++) {
222 atomic_set(&tcon->stats.smb2_stats.smb2_com_sent[i], 0);
223 atomic_set(&tcon->stats.smb2_stats.smb2_com_failed[i], 0);
224 }
225#endif
226}
227
228static void
229smb2_print_stats(struct seq_file *m, struct cifs_tcon *tcon)
230{
231#ifdef CONFIG_CIFS_STATS
232 atomic_t *sent = tcon->stats.smb2_stats.smb2_com_sent;
233 atomic_t *failed = tcon->stats.smb2_stats.smb2_com_failed;
234 seq_printf(m, "\nNegotiates: %d sent %d failed",
235 atomic_read(&sent[SMB2_NEGOTIATE_HE]),
236 atomic_read(&failed[SMB2_NEGOTIATE_HE]));
237 seq_printf(m, "\nSessionSetups: %d sent %d failed",
238 atomic_read(&sent[SMB2_SESSION_SETUP_HE]),
239 atomic_read(&failed[SMB2_SESSION_SETUP_HE]));
240#define SMB2LOGOFF 0x0002 /* trivial request/resp */
241 seq_printf(m, "\nLogoffs: %d sent %d failed",
242 atomic_read(&sent[SMB2_LOGOFF_HE]),
243 atomic_read(&failed[SMB2_LOGOFF_HE]));
244 seq_printf(m, "\nTreeConnects: %d sent %d failed",
245 atomic_read(&sent[SMB2_TREE_CONNECT_HE]),
246 atomic_read(&failed[SMB2_TREE_CONNECT_HE]));
247 seq_printf(m, "\nTreeDisconnects: %d sent %d failed",
248 atomic_read(&sent[SMB2_TREE_DISCONNECT_HE]),
249 atomic_read(&failed[SMB2_TREE_DISCONNECT_HE]));
250 seq_printf(m, "\nCreates: %d sent %d failed",
251 atomic_read(&sent[SMB2_CREATE_HE]),
252 atomic_read(&failed[SMB2_CREATE_HE]));
253 seq_printf(m, "\nCloses: %d sent %d failed",
254 atomic_read(&sent[SMB2_CLOSE_HE]),
255 atomic_read(&failed[SMB2_CLOSE_HE]));
256 seq_printf(m, "\nFlushes: %d sent %d failed",
257 atomic_read(&sent[SMB2_FLUSH_HE]),
258 atomic_read(&failed[SMB2_FLUSH_HE]));
259 seq_printf(m, "\nReads: %d sent %d failed",
260 atomic_read(&sent[SMB2_READ_HE]),
261 atomic_read(&failed[SMB2_READ_HE]));
262 seq_printf(m, "\nWrites: %d sent %d failed",
263 atomic_read(&sent[SMB2_WRITE_HE]),
264 atomic_read(&failed[SMB2_WRITE_HE]));
265 seq_printf(m, "\nLocks: %d sent %d failed",
266 atomic_read(&sent[SMB2_LOCK_HE]),
267 atomic_read(&failed[SMB2_LOCK_HE]));
268 seq_printf(m, "\nIOCTLs: %d sent %d failed",
269 atomic_read(&sent[SMB2_IOCTL_HE]),
270 atomic_read(&failed[SMB2_IOCTL_HE]));
271 seq_printf(m, "\nCancels: %d sent %d failed",
272 atomic_read(&sent[SMB2_CANCEL_HE]),
273 atomic_read(&failed[SMB2_CANCEL_HE]));
274 seq_printf(m, "\nEchos: %d sent %d failed",
275 atomic_read(&sent[SMB2_ECHO_HE]),
276 atomic_read(&failed[SMB2_ECHO_HE]));
277 seq_printf(m, "\nQueryDirectories: %d sent %d failed",
278 atomic_read(&sent[SMB2_QUERY_DIRECTORY_HE]),
279 atomic_read(&failed[SMB2_QUERY_DIRECTORY_HE]));
280 seq_printf(m, "\nChangeNotifies: %d sent %d failed",
281 atomic_read(&sent[SMB2_CHANGE_NOTIFY_HE]),
282 atomic_read(&failed[SMB2_CHANGE_NOTIFY_HE]));
283 seq_printf(m, "\nQueryInfos: %d sent %d failed",
284 atomic_read(&sent[SMB2_QUERY_INFO_HE]),
285 atomic_read(&failed[SMB2_QUERY_INFO_HE]));
286 seq_printf(m, "\nSetInfos: %d sent %d failed",
287 atomic_read(&sent[SMB2_SET_INFO_HE]),
288 atomic_read(&failed[SMB2_SET_INFO_HE]));
289 seq_printf(m, "\nOplockBreaks: %d sent %d failed",
290 atomic_read(&sent[SMB2_OPLOCK_BREAK_HE]),
291 atomic_read(&failed[SMB2_OPLOCK_BREAK_HE]));
292#endif
293}
21 294
22struct smb_version_operations smb21_operations = { 295struct smb_version_operations smb21_operations = {
296 .setup_request = smb2_setup_request,
297 .setup_async_request = smb2_setup_async_request,
298 .check_receive = smb2_check_receive,
299 .add_credits = smb2_add_credits,
300 .set_credits = smb2_set_credits,
301 .get_credits_field = smb2_get_credits_field,
302 .get_credits = smb2_get_credits,
303 .get_next_mid = smb2_get_next_mid,
304 .find_mid = smb2_find_mid,
305 .check_message = smb2_check_message,
306 .dump_detail = smb2_dump_detail,
307 .clear_stats = smb2_clear_stats,
308 .print_stats = smb2_print_stats,
309 .need_neg = smb2_need_neg,
310 .negotiate = smb2_negotiate,
311 .sess_setup = SMB2_sess_setup,
312 .logoff = SMB2_logoff,
313 .tree_connect = SMB2_tcon,
314 .tree_disconnect = SMB2_tdis,
315 .is_path_accessible = smb2_is_path_accessible,
316 .can_echo = smb2_can_echo,
317 .echo = SMB2_echo,
318 .query_path_info = smb2_query_path_info,
319 .get_srv_inum = smb2_get_srv_inum,
320 .build_path_to_root = smb2_build_path_to_root,
23}; 321};
24 322
25struct smb_version_values smb21_values = { 323struct smb_version_values smb21_values = {
26 .version_string = SMB21_VERSION_STRING, 324 .version_string = SMB21_VERSION_STRING,
325 .header_size = sizeof(struct smb2_hdr),
326 .max_header_size = MAX_SMB2_HDR_SIZE,
327 .lock_cmd = SMB2_LOCK,
328 .cap_unix = 0,
329 .cap_nt_find = SMB2_NT_FIND,
330 .cap_large_files = SMB2_LARGE_FILES,
27}; 331};
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
new file mode 100644
index 000000000000..62b3f17d0613
--- /dev/null
+++ b/fs/cifs/smb2pdu.c
@@ -0,0 +1,1125 @@
1/*
2 * fs/cifs/smb2pdu.c
3 *
4 * Copyright (C) International Business Machines Corp., 2009, 2011
5 * Etersoft, 2012
6 * Author(s): Steve French (sfrench@us.ibm.com)
7 * Pavel Shilovsky (pshilovsky@samba.org) 2012
8 *
9 * Contains the routines for constructing the SMB2 PDUs themselves
10 *
11 * This library is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License as published
13 * by the Free Software Foundation; either version 2.1 of the License, or
14 * (at your option) any later version.
15 *
16 * This library is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
19 * the GNU Lesser General Public License for more details.
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * along with this library; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 */
25
26 /* SMB2 PDU handling routines here - except for leftovers (eg session setup) */
27 /* Note that there are handle based routines which must be */
28 /* treated slightly differently for reconnection purposes since we never */
29 /* want to reuse a stale file handle and only the caller knows the file info */
30
31#include <linux/fs.h>
32#include <linux/kernel.h>
33#include <linux/vfs.h>
34#include <linux/uaccess.h>
35#include <linux/xattr.h>
36#include "smb2pdu.h"
37#include "cifsglob.h"
38#include "cifsacl.h"
39#include "cifsproto.h"
40#include "smb2proto.h"
41#include "cifs_unicode.h"
42#include "cifs_debug.h"
43#include "ntlmssp.h"
44#include "smb2status.h"
45
46/*
47 * The following table defines the expected "StructureSize" of SMB2 requests
48 * in order by SMB2 command. This is similar to "wct" in SMB/CIFS requests.
49 *
50 * Note that commands are defined in smb2pdu.h in le16 but the array below is
51 * indexed by command in host byte order.
52 */
53static const int smb2_req_struct_sizes[NUMBER_OF_SMB2_COMMANDS] = {
54 /* SMB2_NEGOTIATE */ 36,
55 /* SMB2_SESSION_SETUP */ 25,
56 /* SMB2_LOGOFF */ 4,
57 /* SMB2_TREE_CONNECT */ 9,
58 /* SMB2_TREE_DISCONNECT */ 4,
59 /* SMB2_CREATE */ 57,
60 /* SMB2_CLOSE */ 24,
61 /* SMB2_FLUSH */ 24,
62 /* SMB2_READ */ 49,
63 /* SMB2_WRITE */ 49,
64 /* SMB2_LOCK */ 48,
65 /* SMB2_IOCTL */ 57,
66 /* SMB2_CANCEL */ 4,
67 /* SMB2_ECHO */ 4,
68 /* SMB2_QUERY_DIRECTORY */ 33,
69 /* SMB2_CHANGE_NOTIFY */ 32,
70 /* SMB2_QUERY_INFO */ 41,
71 /* SMB2_SET_INFO */ 33,
72 /* SMB2_OPLOCK_BREAK */ 24 /* BB this is 36 for LEASE_BREAK variant */
73};
74
75
76static void
77smb2_hdr_assemble(struct smb2_hdr *hdr, __le16 smb2_cmd /* command */ ,
78 const struct cifs_tcon *tcon)
79{
80 struct smb2_pdu *pdu = (struct smb2_pdu *)hdr;
81 char *temp = (char *)hdr;
82 /* lookup word count ie StructureSize from table */
83 __u16 parmsize = smb2_req_struct_sizes[le16_to_cpu(smb2_cmd)];
84
85 /*
86 * smaller than SMALL_BUFFER_SIZE but bigger than fixed area of
87 * largest operations (Create)
88 */
89 memset(temp, 0, 256);
90
91 /* Note this is only network field converted to big endian */
92 hdr->smb2_buf_length = cpu_to_be32(parmsize + sizeof(struct smb2_hdr)
93 - 4 /* RFC 1001 length field itself not counted */);
94
95 hdr->ProtocolId[0] = 0xFE;
96 hdr->ProtocolId[1] = 'S';
97 hdr->ProtocolId[2] = 'M';
98 hdr->ProtocolId[3] = 'B';
99 hdr->StructureSize = cpu_to_le16(64);
100 hdr->Command = smb2_cmd;
101 hdr->CreditRequest = cpu_to_le16(2); /* BB make this dynamic */
102 hdr->ProcessId = cpu_to_le32((__u16)current->tgid);
103
104 if (!tcon)
105 goto out;
106
107 hdr->TreeId = tcon->tid;
108 /* Uid is not converted */
109 if (tcon->ses)
110 hdr->SessionId = tcon->ses->Suid;
111 /* BB check following DFS flags BB */
112 /* BB do we have to add check for SHI1005_FLAGS_DFS_ROOT too? */
113 if (tcon->share_flags & SHI1005_FLAGS_DFS)
114 hdr->Flags |= SMB2_FLAGS_DFS_OPERATIONS;
115 /* BB how does SMB2 do case sensitive? */
116 /* if (tcon->nocase)
117 hdr->Flags |= SMBFLG_CASELESS; */
118 /* if (tcon->ses && tcon->ses->server &&
119 (tcon->ses->server->sec_mode & SECMODE_SIGN_REQUIRED))
120 hdr->Flags |= SMB2_FLAGS_SIGNED; */
121out:
122 pdu->StructureSize2 = cpu_to_le16(parmsize);
123 return;
124}
125
126static int
127smb2_reconnect(__le16 smb2_command, struct cifs_tcon *tcon)
128{
129 int rc = 0;
130 struct nls_table *nls_codepage;
131 struct cifs_ses *ses;
132 struct TCP_Server_Info *server;
133
134 /*
135 * SMB2s NegProt, SessSetup, Logoff do not have tcon yet so
136 * check for tcp and smb session status done differently
137 * for those three - in the calling routine.
138 */
139 if (tcon == NULL)
140 return rc;
141
142 if (smb2_command == SMB2_TREE_CONNECT)
143 return rc;
144
145 if (tcon->tidStatus == CifsExiting) {
146 /*
147 * only tree disconnect, open, and write,
148 * (and ulogoff which does not have tcon)
149 * are allowed as we start force umount.
150 */
151 if ((smb2_command != SMB2_WRITE) &&
152 (smb2_command != SMB2_CREATE) &&
153 (smb2_command != SMB2_TREE_DISCONNECT)) {
154 cFYI(1, "can not send cmd %d while umounting",
155 smb2_command);
156 return -ENODEV;
157 }
158 }
159 if ((!tcon->ses) || (tcon->ses->status == CifsExiting) ||
160 (!tcon->ses->server))
161 return -EIO;
162
163 ses = tcon->ses;
164 server = ses->server;
165
166 /*
167 * Give demultiplex thread up to 10 seconds to reconnect, should be
168 * greater than cifs socket timeout which is 7 seconds
169 */
170 while (server->tcpStatus == CifsNeedReconnect) {
171 /*
172 * Return to caller for TREE_DISCONNECT and LOGOFF and CLOSE
173 * here since they are implicitly done when session drops.
174 */
175 switch (smb2_command) {
176 /*
177 * BB Should we keep oplock break and add flush to exceptions?
178 */
179 case SMB2_TREE_DISCONNECT:
180 case SMB2_CANCEL:
181 case SMB2_CLOSE:
182 case SMB2_OPLOCK_BREAK:
183 return -EAGAIN;
184 }
185
186 wait_event_interruptible_timeout(server->response_q,
187 (server->tcpStatus != CifsNeedReconnect), 10 * HZ);
188
189 /* are we still trying to reconnect? */
190 if (server->tcpStatus != CifsNeedReconnect)
191 break;
192
193 /*
194 * on "soft" mounts we wait once. Hard mounts keep
195 * retrying until process is killed or server comes
196 * back on-line
197 */
198 if (!tcon->retry) {
199 cFYI(1, "gave up waiting on reconnect in smb_init");
200 return -EHOSTDOWN;
201 }
202 }
203
204 if (!tcon->ses->need_reconnect && !tcon->need_reconnect)
205 return rc;
206
207 nls_codepage = load_nls_default();
208
209 /*
210 * need to prevent multiple threads trying to simultaneously reconnect
211 * the same SMB session
212 */
213 mutex_lock(&tcon->ses->session_mutex);
214 rc = cifs_negotiate_protocol(0, tcon->ses);
215 if (!rc && tcon->ses->need_reconnect)
216 rc = cifs_setup_session(0, tcon->ses, nls_codepage);
217
218 if (rc || !tcon->need_reconnect) {
219 mutex_unlock(&tcon->ses->session_mutex);
220 goto out;
221 }
222
223 cifs_mark_open_files_invalid(tcon);
224 rc = SMB2_tcon(0, tcon->ses, tcon->treeName, tcon, nls_codepage);
225 mutex_unlock(&tcon->ses->session_mutex);
226 cFYI(1, "reconnect tcon rc = %d", rc);
227 if (rc)
228 goto out;
229 atomic_inc(&tconInfoReconnectCount);
230 /*
231 * BB FIXME add code to check if wsize needs update due to negotiated
232 * smb buffer size shrinking.
233 */
234out:
235 /*
236 * Check if handle based operation so we know whether we can continue
237 * or not without returning to caller to reset file handle.
238 */
239 /*
240 * BB Is flush done by server on drop of tcp session? Should we special
241 * case it and skip above?
242 */
243 switch (smb2_command) {
244 case SMB2_FLUSH:
245 case SMB2_READ:
246 case SMB2_WRITE:
247 case SMB2_LOCK:
248 case SMB2_IOCTL:
249 case SMB2_QUERY_DIRECTORY:
250 case SMB2_CHANGE_NOTIFY:
251 case SMB2_QUERY_INFO:
252 case SMB2_SET_INFO:
253 return -EAGAIN;
254 }
255 unload_nls(nls_codepage);
256 return rc;
257}
258
259/*
260 * Allocate and return pointer to an SMB request hdr, and set basic
261 * SMB information in the SMB header. If the return code is zero, this
262 * function must have filled in request_buf pointer.
263 */
264static int
265small_smb2_init(__le16 smb2_command, struct cifs_tcon *tcon,
266 void **request_buf)
267{
268 int rc = 0;
269
270 rc = smb2_reconnect(smb2_command, tcon);
271 if (rc)
272 return rc;
273
274 /* BB eventually switch this to SMB2 specific small buf size */
275 *request_buf = cifs_small_buf_get();
276 if (*request_buf == NULL) {
277 /* BB should we add a retry in here if not a writepage? */
278 return -ENOMEM;
279 }
280
281 smb2_hdr_assemble((struct smb2_hdr *) *request_buf, smb2_command, tcon);
282
283 if (tcon != NULL) {
284#ifdef CONFIG_CIFS_STATS2
285 uint16_t com_code = le16_to_cpu(smb2_command);
286 cifs_stats_inc(&tcon->stats.smb2_stats.smb2_com_sent[com_code]);
287#endif
288 cifs_stats_inc(&tcon->num_smbs_sent);
289 }
290
291 return rc;
292}
293
294static void
295free_rsp_buf(int resp_buftype, void *rsp)
296{
297 if (resp_buftype == CIFS_SMALL_BUFFER)
298 cifs_small_buf_release(rsp);
299 else if (resp_buftype == CIFS_LARGE_BUFFER)
300 cifs_buf_release(rsp);
301}
302
303#define SMB2_NUM_PROT 1
304
305#define SMB2_PROT 0
306#define SMB21_PROT 1
307#define BAD_PROT 0xFFFF
308
309#define SMB2_PROT_ID 0x0202
310#define SMB21_PROT_ID 0x0210
311#define BAD_PROT_ID 0xFFFF
312
313static struct {
314 int index;
315 __le16 name;
316} smb2protocols[] = {
317 {SMB2_PROT, cpu_to_le16(SMB2_PROT_ID)},
318 {SMB21_PROT, cpu_to_le16(SMB21_PROT_ID)},
319 {BAD_PROT, cpu_to_le16(BAD_PROT_ID)}
320};
321
322/*
323 *
324 * SMB2 Worker functions follow:
325 *
326 * The general structure of the worker functions is:
327 * 1) Call smb2_init (assembles SMB2 header)
328 * 2) Initialize SMB2 command specific fields in fixed length area of SMB
329 * 3) Call smb_sendrcv2 (sends request on socket and waits for response)
330 * 4) Decode SMB2 command specific fields in the fixed length area
331 * 5) Decode variable length data area (if any for this SMB2 command type)
332 * 6) Call free smb buffer
333 * 7) return
334 *
335 */
336
337int
338SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
339{
340 struct smb2_negotiate_req *req;
341 struct smb2_negotiate_rsp *rsp;
342 struct kvec iov[1];
343 int rc = 0;
344 int resp_buftype;
345 struct TCP_Server_Info *server;
346 unsigned int sec_flags;
347 u16 i;
348 u16 temp = 0;
349 int blob_offset, blob_length;
350 char *security_blob;
351 int flags = CIFS_NEG_OP;
352
353 cFYI(1, "Negotiate protocol");
354
355 if (ses->server)
356 server = ses->server;
357 else {
358 rc = -EIO;
359 return rc;
360 }
361
362 rc = small_smb2_init(SMB2_NEGOTIATE, NULL, (void **) &req);
363 if (rc)
364 return rc;
365
366 /* if any of auth flags (ie not sign or seal) are overriden use them */
367 if (ses->overrideSecFlg & (~(CIFSSEC_MUST_SIGN | CIFSSEC_MUST_SEAL)))
368 sec_flags = ses->overrideSecFlg; /* BB FIXME fix sign flags?*/
369 else /* if override flags set only sign/seal OR them with global auth */
370 sec_flags = global_secflags | ses->overrideSecFlg;
371
372 cFYI(1, "sec_flags 0x%x", sec_flags);
373
374 req->hdr.SessionId = 0;
375
376 for (i = 0; i < SMB2_NUM_PROT; i++)
377 req->Dialects[i] = smb2protocols[i].name;
378
379 req->DialectCount = cpu_to_le16(i);
380 inc_rfc1001_len(req, i * 2);
381
382 /* only one of SMB2 signing flags may be set in SMB2 request */
383 if ((sec_flags & CIFSSEC_MUST_SIGN) == CIFSSEC_MUST_SIGN)
384 temp = SMB2_NEGOTIATE_SIGNING_REQUIRED;
385 else if (sec_flags & CIFSSEC_MAY_SIGN) /* MAY_SIGN is a single flag */
386 temp = SMB2_NEGOTIATE_SIGNING_ENABLED;
387
388 req->SecurityMode = cpu_to_le16(temp);
389
390 req->Capabilities = cpu_to_le32(SMB2_GLOBAL_CAP_DFS);
391
392 iov[0].iov_base = (char *)req;
393 /* 4 for rfc1002 length field */
394 iov[0].iov_len = get_rfc1002_length(req) + 4;
395
396 rc = SendReceive2(xid, ses, iov, 1, &resp_buftype, flags);
397
398 rsp = (struct smb2_negotiate_rsp *)iov[0].iov_base;
399 /*
400 * No tcon so can't do
401 * cifs_stats_inc(&tcon->stats.smb2_stats.smb2_com_fail[SMB2...]);
402 */
403 if (rc != 0)
404 goto neg_exit;
405
406 if (rsp == NULL) {
407 rc = -EIO;
408 goto neg_exit;
409 }
410
411 cFYI(1, "mode 0x%x", rsp->SecurityMode);
412
413 if (rsp->DialectRevision == smb2protocols[SMB21_PROT].name)
414 cFYI(1, "negotiated smb2.1 dialect");
415 else if (rsp->DialectRevision == smb2protocols[SMB2_PROT].name)
416 cFYI(1, "negotiated smb2 dialect");
417 else {
418 cERROR(1, "Illegal dialect returned by server %d",
419 le16_to_cpu(rsp->DialectRevision));
420 rc = -EIO;
421 goto neg_exit;
422 }
423 server->dialect = le16_to_cpu(rsp->DialectRevision);
424
425 server->maxBuf = le32_to_cpu(rsp->MaxTransactSize);
426 server->max_read = le32_to_cpu(rsp->MaxReadSize);
427 server->max_write = le32_to_cpu(rsp->MaxWriteSize);
428 /* BB Do we need to validate the SecurityMode? */
429 server->sec_mode = le16_to_cpu(rsp->SecurityMode);
430 server->capabilities = le32_to_cpu(rsp->Capabilities);
431 /* Internal types */
432 server->capabilities |= SMB2_NT_FIND | SMB2_LARGE_FILES;
433
434 security_blob = smb2_get_data_area_len(&blob_offset, &blob_length,
435 &rsp->hdr);
436 if (blob_length == 0) {
437 cERROR(1, "missing security blob on negprot");
438 rc = -EIO;
439 goto neg_exit;
440 }
441#ifdef CONFIG_SMB2_ASN1 /* BB REMOVEME when updated asn1.c ready */
442 rc = decode_neg_token_init(security_blob, blob_length,
443 &server->sec_type);
444 if (rc == 1)
445 rc = 0;
446 else if (rc == 0) {
447 rc = -EIO;
448 goto neg_exit;
449 }
450#endif
451
452neg_exit:
453 free_rsp_buf(resp_buftype, rsp);
454 return rc;
455}
456
457int
458SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses,
459 const struct nls_table *nls_cp)
460{
461 struct smb2_sess_setup_req *req;
462 struct smb2_sess_setup_rsp *rsp = NULL;
463 struct kvec iov[2];
464 int rc = 0;
465 int resp_buftype;
466 __le32 phase = NtLmNegotiate; /* NTLMSSP, if needed, is multistage */
467 struct TCP_Server_Info *server;
468 unsigned int sec_flags;
469 u8 temp = 0;
470 u16 blob_length = 0;
471 char *security_blob;
472 char *ntlmssp_blob = NULL;
473 bool use_spnego = false; /* else use raw ntlmssp */
474
475 cFYI(1, "Session Setup");
476
477 if (ses->server)
478 server = ses->server;
479 else {
480 rc = -EIO;
481 return rc;
482 }
483
484 /*
485 * If memory allocation is successful, caller of this function
486 * frees it.
487 */
488 ses->ntlmssp = kmalloc(sizeof(struct ntlmssp_auth), GFP_KERNEL);
489 if (!ses->ntlmssp)
490 return -ENOMEM;
491
492 ses->server->secType = RawNTLMSSP;
493
494ssetup_ntlmssp_authenticate:
495 if (phase == NtLmChallenge)
496 phase = NtLmAuthenticate; /* if ntlmssp, now final phase */
497
498 rc = small_smb2_init(SMB2_SESSION_SETUP, NULL, (void **) &req);
499 if (rc)
500 return rc;
501
502 /* if any of auth flags (ie not sign or seal) are overriden use them */
503 if (ses->overrideSecFlg & (~(CIFSSEC_MUST_SIGN | CIFSSEC_MUST_SEAL)))
504 sec_flags = ses->overrideSecFlg; /* BB FIXME fix sign flags?*/
505 else /* if override flags set only sign/seal OR them with global auth */
506 sec_flags = global_secflags | ses->overrideSecFlg;
507
508 cFYI(1, "sec_flags 0x%x", sec_flags);
509
510 req->hdr.SessionId = 0; /* First session, not a reauthenticate */
511 req->VcNumber = 0; /* MBZ */
512 /* to enable echos and oplocks */
513 req->hdr.CreditRequest = cpu_to_le16(3);
514
515 /* only one of SMB2 signing flags may be set in SMB2 request */
516 if ((sec_flags & CIFSSEC_MUST_SIGN) == CIFSSEC_MUST_SIGN)
517 temp = SMB2_NEGOTIATE_SIGNING_REQUIRED;
518 else if (ses->server->sec_mode & SMB2_NEGOTIATE_SIGNING_REQUIRED)
519 temp = SMB2_NEGOTIATE_SIGNING_REQUIRED;
520 else if (sec_flags & CIFSSEC_MAY_SIGN) /* MAY_SIGN is a single flag */
521 temp = SMB2_NEGOTIATE_SIGNING_ENABLED;
522
523 req->SecurityMode = temp;
524 req->Capabilities = 0;
525 req->Channel = 0; /* MBZ */
526
527 iov[0].iov_base = (char *)req;
528 /* 4 for rfc1002 length field and 1 for pad */
529 iov[0].iov_len = get_rfc1002_length(req) + 4 - 1;
530 if (phase == NtLmNegotiate) {
531 ntlmssp_blob = kmalloc(sizeof(struct _NEGOTIATE_MESSAGE),
532 GFP_KERNEL);
533 if (ntlmssp_blob == NULL) {
534 rc = -ENOMEM;
535 goto ssetup_exit;
536 }
537 build_ntlmssp_negotiate_blob(ntlmssp_blob, ses);
538 if (use_spnego) {
539 /* blob_length = build_spnego_ntlmssp_blob(
540 &security_blob,
541 sizeof(struct _NEGOTIATE_MESSAGE),
542 ntlmssp_blob); */
543 /* BB eventually need to add this */
544 cERROR(1, "spnego not supported for SMB2 yet");
545 rc = -EOPNOTSUPP;
546 kfree(ntlmssp_blob);
547 goto ssetup_exit;
548 } else {
549 blob_length = sizeof(struct _NEGOTIATE_MESSAGE);
550 /* with raw NTLMSSP we don't encapsulate in SPNEGO */
551 security_blob = ntlmssp_blob;
552 }
553 } else if (phase == NtLmAuthenticate) {
554 req->hdr.SessionId = ses->Suid;
555 ntlmssp_blob = kzalloc(sizeof(struct _NEGOTIATE_MESSAGE) + 500,
556 GFP_KERNEL);
557 if (ntlmssp_blob == NULL) {
558 cERROR(1, "failed to malloc ntlmssp blob");
559 rc = -ENOMEM;
560 goto ssetup_exit;
561 }
562 rc = build_ntlmssp_auth_blob(ntlmssp_blob, &blob_length, ses,
563 nls_cp);
564 if (rc) {
565 cFYI(1, "build_ntlmssp_auth_blob failed %d", rc);
566 goto ssetup_exit; /* BB double check error handling */
567 }
568 if (use_spnego) {
569 /* blob_length = build_spnego_ntlmssp_blob(
570 &security_blob,
571 blob_length,
572 ntlmssp_blob); */
573 cERROR(1, "spnego not supported for SMB2 yet");
574 rc = -EOPNOTSUPP;
575 kfree(ntlmssp_blob);
576 goto ssetup_exit;
577 } else {
578 security_blob = ntlmssp_blob;
579 }
580 } else {
581 cERROR(1, "illegal ntlmssp phase");
582 rc = -EIO;
583 goto ssetup_exit;
584 }
585
586 /* Testing shows that buffer offset must be at location of Buffer[0] */
587 req->SecurityBufferOffset =
588 cpu_to_le16(sizeof(struct smb2_sess_setup_req) -
589 1 /* pad */ - 4 /* rfc1001 len */);
590 req->SecurityBufferLength = cpu_to_le16(blob_length);
591 iov[1].iov_base = security_blob;
592 iov[1].iov_len = blob_length;
593
594 inc_rfc1001_len(req, blob_length - 1 /* pad */);
595
596 /* BB add code to build os and lm fields */
597
598 rc = SendReceive2(xid, ses, iov, 2, &resp_buftype, CIFS_LOG_ERROR);
599
600 kfree(security_blob);
601 rsp = (struct smb2_sess_setup_rsp *)iov[0].iov_base;
602 if (rsp->hdr.Status == STATUS_MORE_PROCESSING_REQUIRED) {
603 if (phase != NtLmNegotiate) {
604 cERROR(1, "Unexpected more processing error");
605 goto ssetup_exit;
606 }
607 if (offsetof(struct smb2_sess_setup_rsp, Buffer) - 4 !=
608 le16_to_cpu(rsp->SecurityBufferOffset)) {
609 cERROR(1, "Invalid security buffer offset %d",
610 le16_to_cpu(rsp->SecurityBufferOffset));
611 rc = -EIO;
612 goto ssetup_exit;
613 }
614
615 /* NTLMSSP Negotiate sent now processing challenge (response) */
616 phase = NtLmChallenge; /* process ntlmssp challenge */
617 rc = 0; /* MORE_PROCESSING is not an error here but expected */
618 ses->Suid = rsp->hdr.SessionId;
619 rc = decode_ntlmssp_challenge(rsp->Buffer,
620 le16_to_cpu(rsp->SecurityBufferLength), ses);
621 }
622
623 /*
624 * BB eventually add code for SPNEGO decoding of NtlmChallenge blob,
625 * but at least the raw NTLMSSP case works.
626 */
627 /*
628 * No tcon so can't do
629 * cifs_stats_inc(&tcon->stats.smb2_stats.smb2_com_fail[SMB2...]);
630 */
631 if (rc != 0)
632 goto ssetup_exit;
633
634 if (rsp == NULL) {
635 rc = -EIO;
636 goto ssetup_exit;
637 }
638
639 ses->session_flags = le16_to_cpu(rsp->SessionFlags);
640ssetup_exit:
641 free_rsp_buf(resp_buftype, rsp);
642
643 /* if ntlmssp, and negotiate succeeded, proceed to authenticate phase */
644 if ((phase == NtLmChallenge) && (rc == 0))
645 goto ssetup_ntlmssp_authenticate;
646 return rc;
647}
648
649int
650SMB2_logoff(const unsigned int xid, struct cifs_ses *ses)
651{
652 struct smb2_logoff_req *req; /* response is also trivial struct */
653 int rc = 0;
654 struct TCP_Server_Info *server;
655
656 cFYI(1, "disconnect session %p", ses);
657
658 if (ses && (ses->server))
659 server = ses->server;
660 else
661 return -EIO;
662
663 rc = small_smb2_init(SMB2_LOGOFF, NULL, (void **) &req);
664 if (rc)
665 return rc;
666
667 /* since no tcon, smb2_init can not do this, so do here */
668 req->hdr.SessionId = ses->Suid;
669
670 rc = SendReceiveNoRsp(xid, ses, (char *) &req->hdr, 0);
671 /*
672 * No tcon so can't do
673 * cifs_stats_inc(&tcon->stats.smb2_stats.smb2_com_fail[SMB2...]);
674 */
675 return rc;
676}
677
678static inline void cifs_stats_fail_inc(struct cifs_tcon *tcon, uint16_t code)
679{
680 cifs_stats_inc(&tcon->stats.smb2_stats.smb2_com_failed[code]);
681}
682
683#define MAX_SHARENAME_LENGTH (255 /* server */ + 80 /* share */ + 1 /* NULL */)
684
685int
686SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
687 struct cifs_tcon *tcon, const struct nls_table *cp)
688{
689 struct smb2_tree_connect_req *req;
690 struct smb2_tree_connect_rsp *rsp = NULL;
691 struct kvec iov[2];
692 int rc = 0;
693 int resp_buftype;
694 int unc_path_len;
695 struct TCP_Server_Info *server;
696 __le16 *unc_path = NULL;
697
698 cFYI(1, "TCON");
699
700 if ((ses->server) && tree)
701 server = ses->server;
702 else
703 return -EIO;
704
705 if (tcon && tcon->bad_network_name)
706 return -ENOENT;
707
708 unc_path = kmalloc(MAX_SHARENAME_LENGTH * 2, GFP_KERNEL);
709 if (unc_path == NULL)
710 return -ENOMEM;
711
712 unc_path_len = cifs_strtoUTF16(unc_path, tree, strlen(tree), cp) + 1;
713 unc_path_len *= 2;
714 if (unc_path_len < 2) {
715 kfree(unc_path);
716 return -EINVAL;
717 }
718
719 rc = small_smb2_init(SMB2_TREE_CONNECT, tcon, (void **) &req);
720 if (rc) {
721 kfree(unc_path);
722 return rc;
723 }
724
725 if (tcon == NULL) {
726 /* since no tcon, smb2_init can not do this, so do here */
727 req->hdr.SessionId = ses->Suid;
728 /* if (ses->server->sec_mode & SECMODE_SIGN_REQUIRED)
729 req->hdr.Flags |= SMB2_FLAGS_SIGNED; */
730 }
731
732 iov[0].iov_base = (char *)req;
733 /* 4 for rfc1002 length field and 1 for pad */
734 iov[0].iov_len = get_rfc1002_length(req) + 4 - 1;
735
736 /* Testing shows that buffer offset must be at location of Buffer[0] */
737 req->PathOffset = cpu_to_le16(sizeof(struct smb2_tree_connect_req)
738 - 1 /* pad */ - 4 /* do not count rfc1001 len field */);
739 req->PathLength = cpu_to_le16(unc_path_len - 2);
740 iov[1].iov_base = unc_path;
741 iov[1].iov_len = unc_path_len;
742
743 inc_rfc1001_len(req, unc_path_len - 1 /* pad */);
744
745 rc = SendReceive2(xid, ses, iov, 2, &resp_buftype, 0);
746 rsp = (struct smb2_tree_connect_rsp *)iov[0].iov_base;
747
748 if (rc != 0) {
749 if (tcon) {
750 cifs_stats_fail_inc(tcon, SMB2_TREE_CONNECT_HE);
751 tcon->need_reconnect = true;
752 }
753 goto tcon_error_exit;
754 }
755
756 if (rsp == NULL) {
757 rc = -EIO;
758 goto tcon_exit;
759 }
760
761 if (tcon == NULL) {
762 ses->ipc_tid = rsp->hdr.TreeId;
763 goto tcon_exit;
764 }
765
766 if (rsp->ShareType & SMB2_SHARE_TYPE_DISK)
767 cFYI(1, "connection to disk share");
768 else if (rsp->ShareType & SMB2_SHARE_TYPE_PIPE) {
769 tcon->ipc = true;
770 cFYI(1, "connection to pipe share");
771 } else if (rsp->ShareType & SMB2_SHARE_TYPE_PRINT) {
772 tcon->print = true;
773 cFYI(1, "connection to printer");
774 } else {
775 cERROR(1, "unknown share type %d", rsp->ShareType);
776 rc = -EOPNOTSUPP;
777 goto tcon_error_exit;
778 }
779
780 tcon->share_flags = le32_to_cpu(rsp->ShareFlags);
781 tcon->maximal_access = le32_to_cpu(rsp->MaximalAccess);
782 tcon->tidStatus = CifsGood;
783 tcon->need_reconnect = false;
784 tcon->tid = rsp->hdr.TreeId;
785 strncpy(tcon->treeName, tree, MAX_TREE_SIZE);
786
787 if ((rsp->Capabilities & SMB2_SHARE_CAP_DFS) &&
788 ((tcon->share_flags & SHI1005_FLAGS_DFS) == 0))
789 cERROR(1, "DFS capability contradicts DFS flag");
790
791tcon_exit:
792 free_rsp_buf(resp_buftype, rsp);
793 kfree(unc_path);
794 return rc;
795
796tcon_error_exit:
797 if (rsp->hdr.Status == STATUS_BAD_NETWORK_NAME) {
798 cERROR(1, "BAD_NETWORK_NAME: %s", tree);
799 tcon->bad_network_name = true;
800 }
801 goto tcon_exit;
802}
803
804int
805SMB2_tdis(const unsigned int xid, struct cifs_tcon *tcon)
806{
807 struct smb2_tree_disconnect_req *req; /* response is trivial */
808 int rc = 0;
809 struct TCP_Server_Info *server;
810 struct cifs_ses *ses = tcon->ses;
811
812 cFYI(1, "Tree Disconnect");
813
814 if (ses && (ses->server))
815 server = ses->server;
816 else
817 return -EIO;
818
819 if ((tcon->need_reconnect) || (tcon->ses->need_reconnect))
820 return 0;
821
822 rc = small_smb2_init(SMB2_TREE_DISCONNECT, tcon, (void **) &req);
823 if (rc)
824 return rc;
825
826 rc = SendReceiveNoRsp(xid, ses, (char *)&req->hdr, 0);
827 if (rc)
828 cifs_stats_fail_inc(tcon, SMB2_TREE_DISCONNECT_HE);
829
830 return rc;
831}
832
833int
834SMB2_open(const unsigned int xid, struct cifs_tcon *tcon, __le16 *path,
835 u64 *persistent_fid, u64 *volatile_fid, __u32 desired_access,
836 __u32 create_disposition, __u32 file_attributes, __u32 create_options)
837{
838 struct smb2_create_req *req;
839 struct smb2_create_rsp *rsp;
840 struct TCP_Server_Info *server;
841 struct cifs_ses *ses = tcon->ses;
842 struct kvec iov[2];
843 int resp_buftype;
844 int uni_path_len;
845 int rc = 0;
846 int num_iovecs = 2;
847
848 cFYI(1, "create/open");
849
850 if (ses && (ses->server))
851 server = ses->server;
852 else
853 return -EIO;
854
855 rc = small_smb2_init(SMB2_CREATE, tcon, (void **) &req);
856 if (rc)
857 return rc;
858
859 if (enable_oplocks)
860 req->RequestedOplockLevel = SMB2_OPLOCK_LEVEL_BATCH;
861 else
862 req->RequestedOplockLevel = SMB2_OPLOCK_LEVEL_NONE;
863 req->ImpersonationLevel = IL_IMPERSONATION;
864 req->DesiredAccess = cpu_to_le32(desired_access);
865 /* File attributes ignored on open (used in create though) */
866 req->FileAttributes = cpu_to_le32(file_attributes);
867 req->ShareAccess = FILE_SHARE_ALL_LE;
868 req->CreateDisposition = cpu_to_le32(create_disposition);
869 req->CreateOptions = cpu_to_le32(create_options);
870 uni_path_len = (2 * UniStrnlen((wchar_t *)path, PATH_MAX)) + 2;
871 req->NameOffset = cpu_to_le16(sizeof(struct smb2_create_req)
872 - 1 /* pad */ - 4 /* do not count rfc1001 len field */);
873
874 iov[0].iov_base = (char *)req;
875 /* 4 for rfc1002 length field */
876 iov[0].iov_len = get_rfc1002_length(req) + 4;
877
878 /* MUST set path len (NameLength) to 0 opening root of share */
879 if (uni_path_len >= 4) {
880 req->NameLength = cpu_to_le16(uni_path_len - 2);
881 /* -1 since last byte is buf[0] which is sent below (path) */
882 iov[0].iov_len--;
883 iov[1].iov_len = uni_path_len;
884 iov[1].iov_base = path;
885 /*
886 * -1 since last byte is buf[0] which was counted in
887 * smb2_buf_len.
888 */
889 inc_rfc1001_len(req, uni_path_len - 1);
890 } else {
891 num_iovecs = 1;
892 req->NameLength = 0;
893 }
894
895 rc = SendReceive2(xid, ses, iov, num_iovecs, &resp_buftype, 0);
896 rsp = (struct smb2_create_rsp *)iov[0].iov_base;
897
898 if (rc != 0) {
899 cifs_stats_fail_inc(tcon, SMB2_CREATE_HE);
900 goto creat_exit;
901 }
902
903 if (rsp == NULL) {
904 rc = -EIO;
905 goto creat_exit;
906 }
907 *persistent_fid = rsp->PersistentFileId;
908 *volatile_fid = rsp->VolatileFileId;
909creat_exit:
910 free_rsp_buf(resp_buftype, rsp);
911 return rc;
912}
913
914int
915SMB2_close(const unsigned int xid, struct cifs_tcon *tcon,
916 u64 persistent_fid, u64 volatile_fid)
917{
918 struct smb2_close_req *req;
919 struct smb2_close_rsp *rsp;
920 struct TCP_Server_Info *server;
921 struct cifs_ses *ses = tcon->ses;
922 struct kvec iov[1];
923 int resp_buftype;
924 int rc = 0;
925
926 cFYI(1, "Close");
927
928 if (ses && (ses->server))
929 server = ses->server;
930 else
931 return -EIO;
932
933 rc = small_smb2_init(SMB2_CLOSE, tcon, (void **) &req);
934 if (rc)
935 return rc;
936
937 req->PersistentFileId = persistent_fid;
938 req->VolatileFileId = volatile_fid;
939
940 iov[0].iov_base = (char *)req;
941 /* 4 for rfc1002 length field */
942 iov[0].iov_len = get_rfc1002_length(req) + 4;
943
944 rc = SendReceive2(xid, ses, iov, 1, &resp_buftype, 0);
945 rsp = (struct smb2_close_rsp *)iov[0].iov_base;
946
947 if (rc != 0) {
948 if (tcon)
949 cifs_stats_fail_inc(tcon, SMB2_CLOSE_HE);
950 goto close_exit;
951 }
952
953 if (rsp == NULL) {
954 rc = -EIO;
955 goto close_exit;
956 }
957
958 /* BB FIXME - decode close response, update inode for caching */
959
960close_exit:
961 free_rsp_buf(resp_buftype, rsp);
962 return rc;
963}
964
965static int
966validate_buf(unsigned int offset, unsigned int buffer_length,
967 struct smb2_hdr *hdr, unsigned int min_buf_size)
968
969{
970 unsigned int smb_len = be32_to_cpu(hdr->smb2_buf_length);
971 char *end_of_smb = smb_len + 4 /* RFC1001 length field */ + (char *)hdr;
972 char *begin_of_buf = 4 /* RFC1001 len field */ + offset + (char *)hdr;
973 char *end_of_buf = begin_of_buf + buffer_length;
974
975
976 if (buffer_length < min_buf_size) {
977 cERROR(1, "buffer length %d smaller than minimum size %d",
978 buffer_length, min_buf_size);
979 return -EINVAL;
980 }
981
982 /* check if beyond RFC1001 maximum length */
983 if ((smb_len > 0x7FFFFF) || (buffer_length > 0x7FFFFF)) {
984 cERROR(1, "buffer length %d or smb length %d too large",
985 buffer_length, smb_len);
986 return -EINVAL;
987 }
988
989 if ((begin_of_buf > end_of_smb) || (end_of_buf > end_of_smb)) {
990 cERROR(1, "illegal server response, bad offset to data");
991 return -EINVAL;
992 }
993
994 return 0;
995}
996
997/*
998 * If SMB buffer fields are valid, copy into temporary buffer to hold result.
999 * Caller must free buffer.
1000 */
1001static int
1002validate_and_copy_buf(unsigned int offset, unsigned int buffer_length,
1003 struct smb2_hdr *hdr, unsigned int minbufsize,
1004 char *data)
1005
1006{
1007 char *begin_of_buf = 4 /* RFC1001 len field */ + offset + (char *)hdr;
1008 int rc;
1009
1010 if (!data)
1011 return -EINVAL;
1012
1013 rc = validate_buf(offset, buffer_length, hdr, minbufsize);
1014 if (rc)
1015 return rc;
1016
1017 memcpy(data, begin_of_buf, buffer_length);
1018
1019 return 0;
1020}
1021
1022int
1023SMB2_query_info(const unsigned int xid, struct cifs_tcon *tcon,
1024 u64 persistent_fid, u64 volatile_fid,
1025 struct smb2_file_all_info *data)
1026{
1027 struct smb2_query_info_req *req;
1028 struct smb2_query_info_rsp *rsp = NULL;
1029 struct kvec iov[2];
1030 int rc = 0;
1031 int resp_buftype;
1032 struct TCP_Server_Info *server;
1033 struct cifs_ses *ses = tcon->ses;
1034
1035 cFYI(1, "Query Info");
1036
1037 if (ses && (ses->server))
1038 server = ses->server;
1039 else
1040 return -EIO;
1041
1042 rc = small_smb2_init(SMB2_QUERY_INFO, tcon, (void **) &req);
1043 if (rc)
1044 return rc;
1045
1046 req->InfoType = SMB2_O_INFO_FILE;
1047 req->FileInfoClass = FILE_ALL_INFORMATION;
1048 req->PersistentFileId = persistent_fid;
1049 req->VolatileFileId = volatile_fid;
1050 /* 4 for rfc1002 length field and 1 for Buffer */
1051 req->InputBufferOffset =
1052 cpu_to_le16(sizeof(struct smb2_query_info_req) - 1 - 4);
1053 req->OutputBufferLength =
1054 cpu_to_le32(sizeof(struct smb2_file_all_info) + MAX_NAME * 2);
1055
1056 iov[0].iov_base = (char *)req;
1057 /* 4 for rfc1002 length field */
1058 iov[0].iov_len = get_rfc1002_length(req) + 4;
1059
1060 rc = SendReceive2(xid, ses, iov, 1, &resp_buftype, 0);
1061 if (rc) {
1062 cifs_stats_fail_inc(tcon, SMB2_QUERY_INFO_HE);
1063 goto qinf_exit;
1064 }
1065
1066 rsp = (struct smb2_query_info_rsp *)iov[0].iov_base;
1067
1068 rc = validate_and_copy_buf(le16_to_cpu(rsp->OutputBufferOffset),
1069 le32_to_cpu(rsp->OutputBufferLength),
1070 &rsp->hdr, sizeof(struct smb2_file_all_info),
1071 (char *)data);
1072
1073qinf_exit:
1074 free_rsp_buf(resp_buftype, rsp);
1075 return rc;
1076}
1077
1078/*
1079 * This is a no-op for now. We're not really interested in the reply, but
1080 * rather in the fact that the server sent one and that server->lstrp
1081 * gets updated.
1082 *
1083 * FIXME: maybe we should consider checking that the reply matches request?
1084 */
1085static void
1086smb2_echo_callback(struct mid_q_entry *mid)
1087{
1088 struct TCP_Server_Info *server = mid->callback_data;
1089 struct smb2_echo_rsp *smb2 = (struct smb2_echo_rsp *)mid->resp_buf;
1090 unsigned int credits_received = 1;
1091
1092 if (mid->mid_state == MID_RESPONSE_RECEIVED)
1093 credits_received = le16_to_cpu(smb2->hdr.CreditRequest);
1094
1095 DeleteMidQEntry(mid);
1096 add_credits(server, credits_received, CIFS_ECHO_OP);
1097}
1098
1099int
1100SMB2_echo(struct TCP_Server_Info *server)
1101{
1102 struct smb2_echo_req *req;
1103 int rc = 0;
1104 struct kvec iov;
1105
1106 cFYI(1, "In echo request");
1107
1108 rc = small_smb2_init(SMB2_ECHO, NULL, (void **)&req);
1109 if (rc)
1110 return rc;
1111
1112 req->hdr.CreditRequest = cpu_to_le16(1);
1113
1114 iov.iov_base = (char *)req;
1115 /* 4 for rfc1002 length field */
1116 iov.iov_len = get_rfc1002_length(req) + 4;
1117
1118 rc = cifs_call_async(server, &iov, 1, NULL, smb2_echo_callback, server,
1119 CIFS_ECHO_OP);
1120 if (rc)
1121 cFYI(1, "Echo request failed: %d", rc);
1122
1123 cifs_small_buf_release(req);
1124 return rc;
1125}
diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h
new file mode 100644
index 000000000000..f37a1b41b402
--- /dev/null
+++ b/fs/cifs/smb2pdu.h
@@ -0,0 +1,577 @@
1/*
2 * fs/cifs/smb2pdu.h
3 *
4 * Copyright (c) International Business Machines Corp., 2009, 2010
5 * Etersoft, 2012
6 * Author(s): Steve French (sfrench@us.ibm.com)
7 * Pavel Shilovsky (pshilovsky@samba.org) 2012
8 *
9 * This library is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as published
11 * by the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
17 * the GNU Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23
24#ifndef _SMB2PDU_H
25#define _SMB2PDU_H
26
27#include <net/sock.h>
28
29/*
30 * Note that, due to trying to use names similar to the protocol specifications,
31 * there are many mixed case field names in the structures below. Although
32 * this does not match typical Linux kernel style, it is necessary to be
33 * be able to match against the protocol specfication.
34 *
35 * SMB2 commands
36 * Some commands have minimal (wct=0,bcc=0), or uninteresting, responses
37 * (ie no useful data other than the SMB error code itself) and are marked such.
38 * Knowing this helps avoid response buffer allocations and copy in some cases.
39 */
40
41/* List of commands in host endian */
42#define SMB2_NEGOTIATE_HE 0x0000
43#define SMB2_SESSION_SETUP_HE 0x0001
44#define SMB2_LOGOFF_HE 0x0002 /* trivial request/resp */
45#define SMB2_TREE_CONNECT_HE 0x0003
46#define SMB2_TREE_DISCONNECT_HE 0x0004 /* trivial req/resp */
47#define SMB2_CREATE_HE 0x0005
48#define SMB2_CLOSE_HE 0x0006
49#define SMB2_FLUSH_HE 0x0007 /* trivial resp */
50#define SMB2_READ_HE 0x0008
51#define SMB2_WRITE_HE 0x0009
52#define SMB2_LOCK_HE 0x000A
53#define SMB2_IOCTL_HE 0x000B
54#define SMB2_CANCEL_HE 0x000C
55#define SMB2_ECHO_HE 0x000D
56#define SMB2_QUERY_DIRECTORY_HE 0x000E
57#define SMB2_CHANGE_NOTIFY_HE 0x000F
58#define SMB2_QUERY_INFO_HE 0x0010
59#define SMB2_SET_INFO_HE 0x0011
60#define SMB2_OPLOCK_BREAK_HE 0x0012
61
62/* The same list in little endian */
63#define SMB2_NEGOTIATE cpu_to_le16(SMB2_NEGOTIATE_HE)
64#define SMB2_SESSION_SETUP cpu_to_le16(SMB2_SESSION_SETUP_HE)
65#define SMB2_LOGOFF cpu_to_le16(SMB2_LOGOFF_HE)
66#define SMB2_TREE_CONNECT cpu_to_le16(SMB2_TREE_CONNECT_HE)
67#define SMB2_TREE_DISCONNECT cpu_to_le16(SMB2_TREE_DISCONNECT_HE)
68#define SMB2_CREATE cpu_to_le16(SMB2_CREATE_HE)
69#define SMB2_CLOSE cpu_to_le16(SMB2_CLOSE_HE)
70#define SMB2_FLUSH cpu_to_le16(SMB2_FLUSH_HE)
71#define SMB2_READ cpu_to_le16(SMB2_READ_HE)
72#define SMB2_WRITE cpu_to_le16(SMB2_WRITE_HE)
73#define SMB2_LOCK cpu_to_le16(SMB2_LOCK_HE)
74#define SMB2_IOCTL cpu_to_le16(SMB2_IOCTL_HE)
75#define SMB2_CANCEL cpu_to_le16(SMB2_CANCEL_HE)
76#define SMB2_ECHO cpu_to_le16(SMB2_ECHO_HE)
77#define SMB2_QUERY_DIRECTORY cpu_to_le16(SMB2_QUERY_DIRECTORY_HE)
78#define SMB2_CHANGE_NOTIFY cpu_to_le16(SMB2_CHANGE_NOTIFY_HE)
79#define SMB2_QUERY_INFO cpu_to_le16(SMB2_QUERY_INFO_HE)
80#define SMB2_SET_INFO cpu_to_le16(SMB2_SET_INFO_HE)
81#define SMB2_OPLOCK_BREAK cpu_to_le16(SMB2_OPLOCK_BREAK_HE)
82
83#define NUMBER_OF_SMB2_COMMANDS 0x0013
84
85/* BB FIXME - analyze following length BB */
86#define MAX_SMB2_HDR_SIZE 0x78 /* 4 len + 64 hdr + (2*24 wct) + 2 bct + 2 pad */
87
88#define SMB2_PROTO_NUMBER __constant_cpu_to_le32(0x424d53fe)
89
90#define SMB2_HEADER_SIZE __constant_le16_to_cpu(64)
91
92#define SMB2_ERROR_STRUCTURE_SIZE2 __constant_le16_to_cpu(9)
93
94/*
95 * SMB2 Header Definition
96 *
97 * "MBZ" : Must be Zero
98 * "BB" : BugBug, Something to check/review/analyze later
99 * "PDU" : "Protocol Data Unit" (ie a network "frame")
100 *
101 */
102struct smb2_hdr {
103 __be32 smb2_buf_length; /* big endian on wire */
104 /* length is only two or three bytes - with
105 one or two byte type preceding it that MBZ */
106 __u8 ProtocolId[4]; /* 0xFE 'S' 'M' 'B' */
107 __le16 StructureSize; /* 64 */
108 __le16 CreditCharge; /* MBZ */
109 __le32 Status; /* Error from server */
110 __le16 Command;
111 __le16 CreditRequest; /* CreditResponse */
112 __le32 Flags;
113 __le32 NextCommand;
114 __u64 MessageId; /* opaque - so can stay little endian */
115 __le32 ProcessId;
116 __u32 TreeId; /* opaque - so do not make little endian */
117 __u64 SessionId; /* opaque - so do not make little endian */
118 __u8 Signature[16];
119} __packed;
120
121struct smb2_pdu {
122 struct smb2_hdr hdr;
123 __le16 StructureSize2; /* size of wct area (varies, request specific) */
124} __packed;
125
126/*
127 * SMB2 flag definitions
128 */
129#define SMB2_FLAGS_SERVER_TO_REDIR __constant_cpu_to_le32(0x00000001)
130#define SMB2_FLAGS_ASYNC_COMMAND __constant_cpu_to_le32(0x00000002)
131#define SMB2_FLAGS_RELATED_OPERATIONS __constant_cpu_to_le32(0x00000004)
132#define SMB2_FLAGS_SIGNED __constant_cpu_to_le32(0x00000008)
133#define SMB2_FLAGS_DFS_OPERATIONS __constant_cpu_to_le32(0x10000000)
134
135/*
136 * Definitions for SMB2 Protocol Data Units (network frames)
137 *
138 * See MS-SMB2.PDF specification for protocol details.
139 * The Naming convention is the lower case version of the SMB2
140 * command code name for the struct. Note that structures must be packed.
141 *
142 */
143struct smb2_err_rsp {
144 struct smb2_hdr hdr;
145 __le16 StructureSize;
146 __le16 Reserved; /* MBZ */
147 __le32 ByteCount; /* even if zero, at least one byte follows */
148 __u8 ErrorData[1]; /* variable length */
149} __packed;
150
151struct smb2_negotiate_req {
152 struct smb2_hdr hdr;
153 __le16 StructureSize; /* Must be 36 */
154 __le16 DialectCount;
155 __le16 SecurityMode;
156 __le16 Reserved; /* MBZ */
157 __le32 Capabilities;
158 __u8 ClientGUID[16]; /* MBZ */
159 __le64 ClientStartTime; /* MBZ */
160 __le16 Dialects[2]; /* variable length */
161} __packed;
162
163/* SecurityMode flags */
164#define SMB2_NEGOTIATE_SIGNING_ENABLED 0x0001
165#define SMB2_NEGOTIATE_SIGNING_REQUIRED 0x0002
166/* Capabilities flags */
167#define SMB2_GLOBAL_CAP_DFS 0x00000001
168#define SMB2_GLOBAL_CAP_LEASING 0x00000002 /* Resp only New to SMB2.1 */
169#define SMB2_GLOBAL_CAP_LARGE_MTU 0X00000004 /* Resp only New to SMB2.1 */
170/* Internal types */
171#define SMB2_NT_FIND 0x00100000
172#define SMB2_LARGE_FILES 0x00200000
173
174struct smb2_negotiate_rsp {
175 struct smb2_hdr hdr;
176 __le16 StructureSize; /* Must be 65 */
177 __le16 SecurityMode;
178 __le16 DialectRevision;
179 __le16 Reserved; /* MBZ */
180 __u8 ServerGUID[16];
181 __le32 Capabilities;
182 __le32 MaxTransactSize;
183 __le32 MaxReadSize;
184 __le32 MaxWriteSize;
185 __le64 SystemTime; /* MBZ */
186 __le64 ServerStartTime;
187 __le16 SecurityBufferOffset;
188 __le16 SecurityBufferLength;
189 __le32 Reserved2; /* may be any value, ignore */
190 __u8 Buffer[1]; /* variable length GSS security buffer */
191} __packed;
192
193struct smb2_sess_setup_req {
194 struct smb2_hdr hdr;
195 __le16 StructureSize; /* Must be 25 */
196 __u8 VcNumber;
197 __u8 SecurityMode;
198 __le32 Capabilities;
199 __le32 Channel;
200 __le16 SecurityBufferOffset;
201 __le16 SecurityBufferLength;
202 __le64 PreviousSessionId;
203 __u8 Buffer[1]; /* variable length GSS security buffer */
204} __packed;
205
206/* Currently defined SessionFlags */
207#define SMB2_SESSION_FLAG_IS_GUEST 0x0001
208#define SMB2_SESSION_FLAG_IS_NULL 0x0002
209struct smb2_sess_setup_rsp {
210 struct smb2_hdr hdr;
211 __le16 StructureSize; /* Must be 9 */
212 __le16 SessionFlags;
213 __le16 SecurityBufferOffset;
214 __le16 SecurityBufferLength;
215 __u8 Buffer[1]; /* variable length GSS security buffer */
216} __packed;
217
218struct smb2_logoff_req {
219 struct smb2_hdr hdr;
220 __le16 StructureSize; /* Must be 4 */
221 __le16 Reserved;
222} __packed;
223
224struct smb2_logoff_rsp {
225 struct smb2_hdr hdr;
226 __le16 StructureSize; /* Must be 4 */
227 __le16 Reserved;
228} __packed;
229
230struct smb2_tree_connect_req {
231 struct smb2_hdr hdr;
232 __le16 StructureSize; /* Must be 9 */
233 __le16 Reserved;
234 __le16 PathOffset;
235 __le16 PathLength;
236 __u8 Buffer[1]; /* variable length */
237} __packed;
238
239struct smb2_tree_connect_rsp {
240 struct smb2_hdr hdr;
241 __le16 StructureSize; /* Must be 16 */
242 __u8 ShareType; /* see below */
243 __u8 Reserved;
244 __le32 ShareFlags; /* see below */
245 __le32 Capabilities; /* see below */
246 __le32 MaximalAccess;
247} __packed;
248
249/* Possible ShareType values */
250#define SMB2_SHARE_TYPE_DISK 0x01
251#define SMB2_SHARE_TYPE_PIPE 0x02
252#define SMB2_SHARE_TYPE_PRINT 0x03
253
254/*
255 * Possible ShareFlags - exactly one and only one of the first 4 caching flags
256 * must be set (any of the remaining, SHI1005, flags may be set individually
257 * or in combination.
258 */
259#define SMB2_SHAREFLAG_MANUAL_CACHING 0x00000000
260#define SMB2_SHAREFLAG_AUTO_CACHING 0x00000010
261#define SMB2_SHAREFLAG_VDO_CACHING 0x00000020
262#define SMB2_SHAREFLAG_NO_CACHING 0x00000030
263#define SHI1005_FLAGS_DFS 0x00000001
264#define SHI1005_FLAGS_DFS_ROOT 0x00000002
265#define SHI1005_FLAGS_RESTRICT_EXCLUSIVE_OPENS 0x00000100
266#define SHI1005_FLAGS_FORCE_SHARED_DELETE 0x00000200
267#define SHI1005_FLAGS_ALLOW_NAMESPACE_CACHING 0x00000400
268#define SHI1005_FLAGS_ACCESS_BASED_DIRECTORY_ENUM 0x00000800
269#define SHI1005_FLAGS_FORCE_LEVELII_OPLOCK 0x00001000
270#define SHI1005_FLAGS_ENABLE_HASH 0x00002000
271
272/* Possible share capabilities */
273#define SMB2_SHARE_CAP_DFS cpu_to_le32(0x00000008)
274
275struct smb2_tree_disconnect_req {
276 struct smb2_hdr hdr;
277 __le16 StructureSize; /* Must be 4 */
278 __le16 Reserved;
279} __packed;
280
281struct smb2_tree_disconnect_rsp {
282 struct smb2_hdr hdr;
283 __le16 StructureSize; /* Must be 4 */
284 __le16 Reserved;
285} __packed;
286
287/* File Attrubutes */
288#define FILE_ATTRIBUTE_READONLY 0x00000001
289#define FILE_ATTRIBUTE_HIDDEN 0x00000002
290#define FILE_ATTRIBUTE_SYSTEM 0x00000004
291#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
292#define FILE_ATTRIBUTE_ARCHIVE 0x00000020
293#define FILE_ATTRIBUTE_NORMAL 0x00000080
294#define FILE_ATTRIBUTE_TEMPORARY 0x00000100
295#define FILE_ATTRIBUTE_SPARSE_FILE 0x00000200
296#define FILE_ATTRIBUTE_REPARSE_POINT 0x00000400
297#define FILE_ATTRIBUTE_COMPRESSED 0x00000800
298#define FILE_ATTRIBUTE_OFFLINE 0x00001000
299#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED 0x00002000
300#define FILE_ATTRIBUTE_ENCRYPTED 0x00004000
301
302/* Oplock levels */
303#define SMB2_OPLOCK_LEVEL_NONE 0x00
304#define SMB2_OPLOCK_LEVEL_II 0x01
305#define SMB2_OPLOCK_LEVEL_EXCLUSIVE 0x08
306#define SMB2_OPLOCK_LEVEL_BATCH 0x09
307#define SMB2_OPLOCK_LEVEL_LEASE 0xFF
308
309/* Desired Access Flags */
310#define FILE_READ_DATA_LE cpu_to_le32(0x00000001)
311#define FILE_WRITE_DATA_LE cpu_to_le32(0x00000002)
312#define FILE_APPEND_DATA_LE cpu_to_le32(0x00000004)
313#define FILE_READ_EA_LE cpu_to_le32(0x00000008)
314#define FILE_WRITE_EA_LE cpu_to_le32(0x00000010)
315#define FILE_EXECUTE_LE cpu_to_le32(0x00000020)
316#define FILE_READ_ATTRIBUTES_LE cpu_to_le32(0x00000080)
317#define FILE_WRITE_ATTRIBUTES_LE cpu_to_le32(0x00000100)
318#define FILE_DELETE_LE cpu_to_le32(0x00010000)
319#define FILE_READ_CONTROL_LE cpu_to_le32(0x00020000)
320#define FILE_WRITE_DAC_LE cpu_to_le32(0x00040000)
321#define FILE_WRITE_OWNER_LE cpu_to_le32(0x00080000)
322#define FILE_SYNCHRONIZE_LE cpu_to_le32(0x00100000)
323#define FILE_ACCESS_SYSTEM_SECURITY_LE cpu_to_le32(0x01000000)
324#define FILE_MAXIMAL_ACCESS_LE cpu_to_le32(0x02000000)
325#define FILE_GENERIC_ALL_LE cpu_to_le32(0x10000000)
326#define FILE_GENERIC_EXECUTE_LE cpu_to_le32(0x20000000)
327#define FILE_GENERIC_WRITE_LE cpu_to_le32(0x40000000)
328#define FILE_GENERIC_READ_LE cpu_to_le32(0x80000000)
329
330/* ShareAccess Flags */
331#define FILE_SHARE_READ_LE cpu_to_le32(0x00000001)
332#define FILE_SHARE_WRITE_LE cpu_to_le32(0x00000002)
333#define FILE_SHARE_DELETE_LE cpu_to_le32(0x00000004)
334#define FILE_SHARE_ALL_LE cpu_to_le32(0x00000007)
335
336/* CreateDisposition Flags */
337#define FILE_SUPERSEDE_LE cpu_to_le32(0x00000000)
338#define FILE_OPEN_LE cpu_to_le32(0x00000001)
339#define FILE_CREATE_LE cpu_to_le32(0x00000002)
340#define FILE_OPEN_IF_LE cpu_to_le32(0x00000003)
341#define FILE_OVERWRITE_LE cpu_to_le32(0x00000004)
342#define FILE_OVERWRITE_IF_LE cpu_to_le32(0x00000005)
343
344/* CreateOptions Flags */
345#define FILE_DIRECTORY_FILE_LE cpu_to_le32(0x00000001)
346/* same as #define CREATE_NOT_FILE_LE cpu_to_le32(0x00000001) */
347#define FILE_WRITE_THROUGH_LE cpu_to_le32(0x00000002)
348#define FILE_SEQUENTIAL_ONLY_LE cpu_to_le32(0x00000004)
349#define FILE_NO_INTERMEDIATE_BUFFERRING_LE cpu_to_le32(0x00000008)
350#define FILE_SYNCHRONOUS_IO_ALERT_LE cpu_to_le32(0x00000010)
351#define FILE_SYNCHRONOUS_IO_NON_ALERT_LE cpu_to_le32(0x00000020)
352#define FILE_NON_DIRECTORY_FILE_LE cpu_to_le32(0x00000040)
353#define FILE_COMPLETE_IF_OPLOCKED_LE cpu_to_le32(0x00000100)
354#define FILE_NO_EA_KNOWLEDGE_LE cpu_to_le32(0x00000200)
355#define FILE_RANDOM_ACCESS_LE cpu_to_le32(0x00000800)
356#define FILE_DELETE_ON_CLOSE_LE cpu_to_le32(0x00001000)
357#define FILE_OPEN_BY_FILE_ID_LE cpu_to_le32(0x00002000)
358#define FILE_OPEN_FOR_BACKUP_INTENT_LE cpu_to_le32(0x00004000)
359#define FILE_NO_COMPRESSION_LE cpu_to_le32(0x00008000)
360#define FILE_RESERVE_OPFILTER_LE cpu_to_le32(0x00100000)
361#define FILE_OPEN_REPARSE_POINT_LE cpu_to_le32(0x00200000)
362#define FILE_OPEN_NO_RECALL_LE cpu_to_le32(0x00400000)
363#define FILE_OPEN_FOR_FREE_SPACE_QUERY_LE cpu_to_le32(0x00800000)
364
365#define FILE_READ_RIGHTS_LE (FILE_READ_DATA_LE | FILE_READ_EA_LE \
366 | FILE_READ_ATTRIBUTES_LE)
367#define FILE_WRITE_RIGHTS_LE (FILE_WRITE_DATA_LE | FILE_APPEND_DATA_LE \
368 | FILE_WRITE_EA_LE | FILE_WRITE_ATTRIBUTES_LE)
369#define FILE_EXEC_RIGHTS_LE (FILE_EXECUTE_LE)
370
371/* Impersonation Levels */
372#define IL_ANONYMOUS cpu_to_le32(0x00000000)
373#define IL_IDENTIFICATION cpu_to_le32(0x00000001)
374#define IL_IMPERSONATION cpu_to_le32(0x00000002)
375#define IL_DELEGATE cpu_to_le32(0x00000003)
376
377/* Create Context Values */
378#define SMB2_CREATE_EA_BUFFER "ExtA" /* extended attributes */
379#define SMB2_CREATE_SD_BUFFER "SecD" /* security descriptor */
380#define SMB2_CREATE_DURABLE_HANDLE_REQUEST "DHnQ"
381#define SMB2_CREATE_DURABLE_HANDLE_RECONNECT "DHnC"
382#define SMB2_CREATE_ALLOCATION_SIZE "AlSi"
383#define SMB2_CREATE_QUERY_MAXIMAL_ACCESS_REQUEST "MxAc"
384#define SMB2_CREATE_TIMEWARP_REQUEST "TWrp"
385#define SMB2_CREATE_QUERY_ON_DISK_ID "QFid"
386#define SMB2_CREATE_REQUEST_LEASE "RqLs"
387
388struct smb2_create_req {
389 struct smb2_hdr hdr;
390 __le16 StructureSize; /* Must be 57 */
391 __u8 SecurityFlags;
392 __u8 RequestedOplockLevel;
393 __le32 ImpersonationLevel;
394 __le64 SmbCreateFlags;
395 __le64 Reserved;
396 __le32 DesiredAccess;
397 __le32 FileAttributes;
398 __le32 ShareAccess;
399 __le32 CreateDisposition;
400 __le32 CreateOptions;
401 __le16 NameOffset;
402 __le16 NameLength;
403 __le32 CreateContextsOffset;
404 __le32 CreateContextsLength;
405 __u8 Buffer[1];
406} __packed;
407
408struct smb2_create_rsp {
409 struct smb2_hdr hdr;
410 __le16 StructureSize; /* Must be 89 */
411 __u8 OplockLevel;
412 __u8 Reserved;
413 __le32 CreateAction;
414 __le64 CreationTime;
415 __le64 LastAccessTime;
416 __le64 LastWriteTime;
417 __le64 ChangeTime;
418 __le64 AllocationSize;
419 __le64 EndofFile;
420 __le32 FileAttributes;
421 __le32 Reserved2;
422 __u64 PersistentFileId; /* opaque endianness */
423 __u64 VolatileFileId; /* opaque endianness */
424 __le32 CreateContextsOffset;
425 __le32 CreateContextsLength;
426 __u8 Buffer[1];
427} __packed;
428
429/* Currently defined values for close flags */
430#define SMB2_CLOSE_FLAG_POSTQUERY_ATTRIB cpu_to_le16(0x0001)
431struct smb2_close_req {
432 struct smb2_hdr hdr;
433 __le16 StructureSize; /* Must be 24 */
434 __le16 Flags;
435 __le32 Reserved;
436 __u64 PersistentFileId; /* opaque endianness */
437 __u64 VolatileFileId; /* opaque endianness */
438} __packed;
439
440struct smb2_close_rsp {
441 struct smb2_hdr hdr;
442 __le16 StructureSize; /* 60 */
443 __le16 Flags;
444 __le32 Reserved;
445 __le64 CreationTime;
446 __le64 LastAccessTime;
447 __le64 LastWriteTime;
448 __le64 ChangeTime;
449 __le64 AllocationSize; /* Beginning of FILE_STANDARD_INFO equivalent */
450 __le64 EndOfFile;
451 __le32 Attributes;
452} __packed;
453
454struct smb2_echo_req {
455 struct smb2_hdr hdr;
456 __le16 StructureSize; /* Must be 4 */
457 __u16 Reserved;
458} __packed;
459
460struct smb2_echo_rsp {
461 struct smb2_hdr hdr;
462 __le16 StructureSize; /* Must be 4 */
463 __u16 Reserved;
464} __packed;
465
466/* Possible InfoType values */
467#define SMB2_O_INFO_FILE 0x01
468#define SMB2_O_INFO_FILESYSTEM 0x02
469#define SMB2_O_INFO_SECURITY 0x03
470#define SMB2_O_INFO_QUOTA 0x04
471
472struct smb2_query_info_req {
473 struct smb2_hdr hdr;
474 __le16 StructureSize; /* Must be 41 */
475 __u8 InfoType;
476 __u8 FileInfoClass;
477 __le32 OutputBufferLength;
478 __le16 InputBufferOffset;
479 __u16 Reserved;
480 __le32 InputBufferLength;
481 __le32 AdditionalInformation;
482 __le32 Flags;
483 __u64 PersistentFileId; /* opaque endianness */
484 __u64 VolatileFileId; /* opaque endianness */
485 __u8 Buffer[1];
486} __packed;
487
488struct smb2_query_info_rsp {
489 struct smb2_hdr hdr;
490 __le16 StructureSize; /* Must be 9 */
491 __le16 OutputBufferOffset;
492 __le32 OutputBufferLength;
493 __u8 Buffer[1];
494} __packed;
495
496/*
497 * PDU infolevel structure definitions
498 * BB consider moving to a different header
499 */
500
501/* partial list of QUERY INFO levels */
502#define FILE_DIRECTORY_INFORMATION 1
503#define FILE_FULL_DIRECTORY_INFORMATION 2
504#define FILE_BOTH_DIRECTORY_INFORMATION 3
505#define FILE_BASIC_INFORMATION 4
506#define FILE_STANDARD_INFORMATION 5
507#define FILE_INTERNAL_INFORMATION 6
508#define FILE_EA_INFORMATION 7
509#define FILE_ACCESS_INFORMATION 8
510#define FILE_NAME_INFORMATION 9
511#define FILE_RENAME_INFORMATION 10
512#define FILE_LINK_INFORMATION 11
513#define FILE_NAMES_INFORMATION 12
514#define FILE_DISPOSITION_INFORMATION 13
515#define FILE_POSITION_INFORMATION 14
516#define FILE_FULL_EA_INFORMATION 15
517#define FILE_MODE_INFORMATION 16
518#define FILE_ALIGNMENT_INFORMATION 17
519#define FILE_ALL_INFORMATION 18
520#define FILE_ALLOCATION_INFORMATION 19
521#define FILE_END_OF_FILE_INFORMATION 20
522#define FILE_ALTERNATE_NAME_INFORMATION 21
523#define FILE_STREAM_INFORMATION 22
524#define FILE_PIPE_INFORMATION 23
525#define FILE_PIPE_LOCAL_INFORMATION 24
526#define FILE_PIPE_REMOTE_INFORMATION 25
527#define FILE_MAILSLOT_QUERY_INFORMATION 26
528#define FILE_MAILSLOT_SET_INFORMATION 27
529#define FILE_COMPRESSION_INFORMATION 28
530#define FILE_OBJECT_ID_INFORMATION 29
531/* Number 30 not defined in documents */
532#define FILE_MOVE_CLUSTER_INFORMATION 31
533#define FILE_QUOTA_INFORMATION 32
534#define FILE_REPARSE_POINT_INFORMATION 33
535#define FILE_NETWORK_OPEN_INFORMATION 34
536#define FILE_ATTRIBUTE_TAG_INFORMATION 35
537#define FILE_TRACKING_INFORMATION 36
538#define FILEID_BOTH_DIRECTORY_INFORMATION 37
539#define FILEID_FULL_DIRECTORY_INFORMATION 38
540#define FILE_VALID_DATA_LENGTH_INFORMATION 39
541#define FILE_SHORT_NAME_INFORMATION 40
542#define FILE_SFIO_RESERVE_INFORMATION 44
543#define FILE_SFIO_VOLUME_INFORMATION 45
544#define FILE_HARD_LINK_INFORMATION 46
545#define FILE_NORMALIZED_NAME_INFORMATION 48
546#define FILEID_GLOBAL_TX_DIRECTORY_INFORMATION 50
547#define FILE_STANDARD_LINK_INFORMATION 54
548
549/*
550 * This level 18, although with struct with same name is different from cifs
551 * level 0x107. Level 0x107 has an extra u64 between AccessFlags and
552 * CurrentByteOffset.
553 */
554struct smb2_file_all_info { /* data block encoding of response to level 18 */
555 __le64 CreationTime; /* Beginning of FILE_BASIC_INFO equivalent */
556 __le64 LastAccessTime;
557 __le64 LastWriteTime;
558 __le64 ChangeTime;
559 __le32 Attributes;
560 __u32 Pad1; /* End of FILE_BASIC_INFO_INFO equivalent */
561 __le64 AllocationSize; /* Beginning of FILE_STANDARD_INFO equivalent */
562 __le64 EndOfFile; /* size ie offset to first free byte in file */
563 __le32 NumberOfLinks; /* hard links */
564 __u8 DeletePending;
565 __u8 Directory;
566 __u16 Pad2; /* End of FILE_STANDARD_INFO equivalent */
567 __le64 IndexNumber;
568 __le32 EASize;
569 __le32 AccessFlags;
570 __le64 CurrentByteOffset;
571 __le32 Mode;
572 __le32 AlignmentRequirement;
573 __le32 FileNameLength;
574 char FileName[1];
575} __packed; /* level 18 Query */
576
577#endif /* _SMB2PDU_H */
diff --git a/fs/cifs/smb2proto.h b/fs/cifs/smb2proto.h
new file mode 100644
index 000000000000..902bbe2b5ad3
--- /dev/null
+++ b/fs/cifs/smb2proto.h
@@ -0,0 +1,78 @@
1/*
2 * fs/cifs/smb2proto.h
3 *
4 * Copyright (c) International Business Machines Corp., 2002, 2011
5 * Etersoft, 2012
6 * Author(s): Steve French (sfrench@us.ibm.com)
7 * Pavel Shilovsky (pshilovsky@samba.org) 2012
8 *
9 * This library is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as published
11 * by the Free Software Foundation; either version 2.1 of the License, or
12 * (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
17 * the GNU Lesser General Public License for more details.
18 *
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this library; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23#ifndef _SMB2PROTO_H
24#define _SMB2PROTO_H
25#include <linux/nls.h>
26#include <linux/key-type.h>
27
28struct statfs;
29
30/*
31 *****************************************************************
32 * All Prototypes
33 *****************************************************************
34 */
35extern int map_smb2_to_linux_error(char *buf, bool log_err);
36extern int smb2_check_message(char *buf, unsigned int length);
37extern unsigned int smb2_calc_size(struct smb2_hdr *hdr);
38extern char *smb2_get_data_area_len(int *off, int *len, struct smb2_hdr *hdr);
39extern __le16 *cifs_convert_path_to_utf16(const char *from,
40 struct cifs_sb_info *cifs_sb);
41
42extern int smb2_check_receive(struct mid_q_entry *mid,
43 struct TCP_Server_Info *server, bool log_error);
44extern int smb2_setup_request(struct cifs_ses *ses, struct kvec *iov,
45 unsigned int nvec, struct mid_q_entry **ret_mid);
46extern int smb2_setup_async_request(struct TCP_Server_Info *server,
47 struct kvec *iov, unsigned int nvec,
48 struct mid_q_entry **ret_mid);
49extern void smb2_echo_request(struct work_struct *work);
50
51extern int smb2_query_path_info(const unsigned int xid, struct cifs_tcon *tcon,
52 struct cifs_sb_info *cifs_sb,
53 const char *full_path, FILE_ALL_INFO *data,
54 bool *adjust_tz);
55/*
56 * SMB2 Worker functions - most of protocol specific implementation details
57 * are contained within these calls.
58 */
59extern int SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses);
60extern int SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses,
61 const struct nls_table *nls_cp);
62extern int SMB2_logoff(const unsigned int xid, struct cifs_ses *ses);
63extern int SMB2_tcon(const unsigned int xid, struct cifs_ses *ses,
64 const char *tree, struct cifs_tcon *tcon,
65 const struct nls_table *);
66extern int SMB2_tdis(const unsigned int xid, struct cifs_tcon *tcon);
67extern int SMB2_open(const unsigned int xid, struct cifs_tcon *tcon,
68 __le16 *path, u64 *persistent_fid, u64 *volatile_fid,
69 __u32 desired_access, __u32 create_disposition,
70 __u32 file_attributes, __u32 create_options);
71extern int SMB2_close(const unsigned int xid, struct cifs_tcon *tcon,
72 u64 persistent_file_id, u64 volatile_file_id);
73extern int SMB2_query_info(const unsigned int xid, struct cifs_tcon *tcon,
74 u64 persistent_file_id, u64 volatile_file_id,
75 struct smb2_file_all_info *data);
76extern int SMB2_echo(struct TCP_Server_Info *server);
77
78#endif /* _SMB2PROTO_H */
diff --git a/fs/cifs/smb2status.h b/fs/cifs/smb2status.h
new file mode 100644
index 000000000000..3d5f62150de4
--- /dev/null
+++ b/fs/cifs/smb2status.h
@@ -0,0 +1,1782 @@
1/*
2 * fs/cifs/smb2status.h
3 *
4 * SMB2 Status code (network error) definitions
5 * Definitions are from MS-ERREF
6 *
7 * Copyright (c) International Business Machines Corp., 2009,2011
8 * Author(s): Steve French (sfrench@us.ibm.com)
9 *
10 * This library is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as published
12 * by the Free Software Foundation; either version 2.1 of the License, or
13 * (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
18 * the GNU Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this library; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24
25/*
26 * 0 1 2 3 4 5 6 7 8 9 0 A B C D E F 0 1 2 3 4 5 6 7 8 9 A B C D E F
27 * SEV C N <-------Facility--------> <------Error Status Code------>
28 *
29 * C is set if "customer defined" error, N bit is reserved and MBZ
30 */
31
32#define STATUS_SEVERITY_SUCCESS __constant_cpu_to_le32(0x0000)
33#define STATUS_SEVERITY_INFORMATIONAL __constanst_cpu_to_le32(0x0001)
34#define STATUS_SEVERITY_WARNING __constanst_cpu_to_le32(0x0002)
35#define STATUS_SEVERITY_ERROR __constanst_cpu_to_le32(0x0003)
36
37struct ntstatus {
38 /* Facility is the high 12 bits of the following field */
39 __le32 Facility; /* low 2 bits Severity, next is Customer, then rsrvd */
40 __le32 Code;
41};
42
43#define STATUS_SUCCESS __constant_cpu_to_le32(0x00000000)
44#define STATUS_WAIT_0 __constant_cpu_to_le32(0x00000000)
45#define STATUS_WAIT_1 __constant_cpu_to_le32(0x00000001)
46#define STATUS_WAIT_2 __constant_cpu_to_le32(0x00000002)
47#define STATUS_WAIT_3 __constant_cpu_to_le32(0x00000003)
48#define STATUS_WAIT_63 __constant_cpu_to_le32(0x0000003F)
49#define STATUS_ABANDONED __constant_cpu_to_le32(0x00000080)
50#define STATUS_ABANDONED_WAIT_0 __constant_cpu_to_le32(0x00000080)
51#define STATUS_ABANDONED_WAIT_63 __constant_cpu_to_le32(0x000000BF)
52#define STATUS_USER_APC __constant_cpu_to_le32(0x000000C0)
53#define STATUS_KERNEL_APC __constant_cpu_to_le32(0x00000100)
54#define STATUS_ALERTED __constant_cpu_to_le32(0x00000101)
55#define STATUS_TIMEOUT __constant_cpu_to_le32(0x00000102)
56#define STATUS_PENDING __constant_cpu_to_le32(0x00000103)
57#define STATUS_REPARSE __constant_cpu_to_le32(0x00000104)
58#define STATUS_MORE_ENTRIES __constant_cpu_to_le32(0x00000105)
59#define STATUS_NOT_ALL_ASSIGNED __constant_cpu_to_le32(0x00000106)
60#define STATUS_SOME_NOT_MAPPED __constant_cpu_to_le32(0x00000107)
61#define STATUS_OPLOCK_BREAK_IN_PROGRESS __constant_cpu_to_le32(0x00000108)
62#define STATUS_VOLUME_MOUNTED __constant_cpu_to_le32(0x00000109)
63#define STATUS_RXACT_COMMITTED __constant_cpu_to_le32(0x0000010A)
64#define STATUS_NOTIFY_CLEANUP __constant_cpu_to_le32(0x0000010B)
65#define STATUS_NOTIFY_ENUM_DIR __constant_cpu_to_le32(0x0000010C)
66#define STATUS_NO_QUOTAS_FOR_ACCOUNT __constant_cpu_to_le32(0x0000010D)
67#define STATUS_PRIMARY_TRANSPORT_CONNECT_FAILED __constant_cpu_to_le32(0x0000010E)
68#define STATUS_PAGE_FAULT_TRANSITION __constant_cpu_to_le32(0x00000110)
69#define STATUS_PAGE_FAULT_DEMAND_ZERO __constant_cpu_to_le32(0x00000111)
70#define STATUS_PAGE_FAULT_COPY_ON_WRITE __constant_cpu_to_le32(0x00000112)
71#define STATUS_PAGE_FAULT_GUARD_PAGE __constant_cpu_to_le32(0x00000113)
72#define STATUS_PAGE_FAULT_PAGING_FILE __constant_cpu_to_le32(0x00000114)
73#define STATUS_CACHE_PAGE_LOCKED __constant_cpu_to_le32(0x00000115)
74#define STATUS_CRASH_DUMP __constant_cpu_to_le32(0x00000116)
75#define STATUS_BUFFER_ALL_ZEROS __constant_cpu_to_le32(0x00000117)
76#define STATUS_REPARSE_OBJECT __constant_cpu_to_le32(0x00000118)
77#define STATUS_RESOURCE_REQUIREMENTS_CHANGED __constant_cpu_to_le32(0x00000119)
78#define STATUS_TRANSLATION_COMPLETE __constant_cpu_to_le32(0x00000120)
79#define STATUS_DS_MEMBERSHIP_EVALUATED_LOCALLY __constant_cpu_to_le32(0x00000121)
80#define STATUS_NOTHING_TO_TERMINATE __constant_cpu_to_le32(0x00000122)
81#define STATUS_PROCESS_NOT_IN_JOB __constant_cpu_to_le32(0x00000123)
82#define STATUS_PROCESS_IN_JOB __constant_cpu_to_le32(0x00000124)
83#define STATUS_VOLSNAP_HIBERNATE_READY __constant_cpu_to_le32(0x00000125)
84#define STATUS_FSFILTER_OP_COMPLETED_SUCCESSFULLY __constant_cpu_to_le32(0x00000126)
85#define STATUS_INTERRUPT_VECTOR_ALREADY_CONNECTED __constant_cpu_to_le32(0x00000127)
86#define STATUS_INTERRUPT_STILL_CONNECTED __constant_cpu_to_le32(0x00000128)
87#define STATUS_PROCESS_CLONED __constant_cpu_to_le32(0x00000129)
88#define STATUS_FILE_LOCKED_WITH_ONLY_READERS __constant_cpu_to_le32(0x0000012A)
89#define STATUS_FILE_LOCKED_WITH_WRITERS __constant_cpu_to_le32(0x0000012B)
90#define STATUS_RESOURCEMANAGER_READ_ONLY __constant_cpu_to_le32(0x00000202)
91#define STATUS_WAIT_FOR_OPLOCK __constant_cpu_to_le32(0x00000367)
92#define DBG_EXCEPTION_HANDLED __constant_cpu_to_le32(0x00010001)
93#define DBG_CONTINUE __constant_cpu_to_le32(0x00010002)
94#define STATUS_FLT_IO_COMPLETE __constant_cpu_to_le32(0x001C0001)
95#define STATUS_OBJECT_NAME_EXISTS __constant_cpu_to_le32(0x40000000)
96#define STATUS_THREAD_WAS_SUSPENDED __constant_cpu_to_le32(0x40000001)
97#define STATUS_WORKING_SET_LIMIT_RANGE __constant_cpu_to_le32(0x40000002)
98#define STATUS_IMAGE_NOT_AT_BASE __constant_cpu_to_le32(0x40000003)
99#define STATUS_RXACT_STATE_CREATED __constant_cpu_to_le32(0x40000004)
100#define STATUS_SEGMENT_NOTIFICATION __constant_cpu_to_le32(0x40000005)
101#define STATUS_LOCAL_USER_SESSION_KEY __constant_cpu_to_le32(0x40000006)
102#define STATUS_BAD_CURRENT_DIRECTORY __constant_cpu_to_le32(0x40000007)
103#define STATUS_SERIAL_MORE_WRITES __constant_cpu_to_le32(0x40000008)
104#define STATUS_REGISTRY_RECOVERED __constant_cpu_to_le32(0x40000009)
105#define STATUS_FT_READ_RECOVERY_FROM_BACKUP __constant_cpu_to_le32(0x4000000A)
106#define STATUS_FT_WRITE_RECOVERY __constant_cpu_to_le32(0x4000000B)
107#define STATUS_SERIAL_COUNTER_TIMEOUT __constant_cpu_to_le32(0x4000000C)
108#define STATUS_NULL_LM_PASSWORD __constant_cpu_to_le32(0x4000000D)
109#define STATUS_IMAGE_MACHINE_TYPE_MISMATCH __constant_cpu_to_le32(0x4000000E)
110#define STATUS_RECEIVE_PARTIAL __constant_cpu_to_le32(0x4000000F)
111#define STATUS_RECEIVE_EXPEDITED __constant_cpu_to_le32(0x40000010)
112#define STATUS_RECEIVE_PARTIAL_EXPEDITED __constant_cpu_to_le32(0x40000011)
113#define STATUS_EVENT_DONE __constant_cpu_to_le32(0x40000012)
114#define STATUS_EVENT_PENDING __constant_cpu_to_le32(0x40000013)
115#define STATUS_CHECKING_FILE_SYSTEM __constant_cpu_to_le32(0x40000014)
116#define STATUS_FATAL_APP_EXIT __constant_cpu_to_le32(0x40000015)
117#define STATUS_PREDEFINED_HANDLE __constant_cpu_to_le32(0x40000016)
118#define STATUS_WAS_UNLOCKED __constant_cpu_to_le32(0x40000017)
119#define STATUS_SERVICE_NOTIFICATION __constant_cpu_to_le32(0x40000018)
120#define STATUS_WAS_LOCKED __constant_cpu_to_le32(0x40000019)
121#define STATUS_LOG_HARD_ERROR __constant_cpu_to_le32(0x4000001A)
122#define STATUS_ALREADY_WIN32 __constant_cpu_to_le32(0x4000001B)
123#define STATUS_WX86_UNSIMULATE __constant_cpu_to_le32(0x4000001C)
124#define STATUS_WX86_CONTINUE __constant_cpu_to_le32(0x4000001D)
125#define STATUS_WX86_SINGLE_STEP __constant_cpu_to_le32(0x4000001E)
126#define STATUS_WX86_BREAKPOINT __constant_cpu_to_le32(0x4000001F)
127#define STATUS_WX86_EXCEPTION_CONTINUE __constant_cpu_to_le32(0x40000020)
128#define STATUS_WX86_EXCEPTION_LASTCHANCE __constant_cpu_to_le32(0x40000021)
129#define STATUS_WX86_EXCEPTION_CHAIN __constant_cpu_to_le32(0x40000022)
130#define STATUS_IMAGE_MACHINE_TYPE_MISMATCH_EXE __constant_cpu_to_le32(0x40000023)
131#define STATUS_NO_YIELD_PERFORMED __constant_cpu_to_le32(0x40000024)
132#define STATUS_TIMER_RESUME_IGNORED __constant_cpu_to_le32(0x40000025)
133#define STATUS_ARBITRATION_UNHANDLED __constant_cpu_to_le32(0x40000026)
134#define STATUS_CARDBUS_NOT_SUPPORTED __constant_cpu_to_le32(0x40000027)
135#define STATUS_WX86_CREATEWX86TIB __constant_cpu_to_le32(0x40000028)
136#define STATUS_MP_PROCESSOR_MISMATCH __constant_cpu_to_le32(0x40000029)
137#define STATUS_HIBERNATED __constant_cpu_to_le32(0x4000002A)
138#define STATUS_RESUME_HIBERNATION __constant_cpu_to_le32(0x4000002B)
139#define STATUS_FIRMWARE_UPDATED __constant_cpu_to_le32(0x4000002C)
140#define STATUS_DRIVERS_LEAKING_LOCKED_PAGES __constant_cpu_to_le32(0x4000002D)
141#define STATUS_MESSAGE_RETRIEVED __constant_cpu_to_le32(0x4000002E)
142#define STATUS_SYSTEM_POWERSTATE_TRANSITION __constant_cpu_to_le32(0x4000002F)
143#define STATUS_ALPC_CHECK_COMPLETION_LIST __constant_cpu_to_le32(0x40000030)
144#define STATUS_SYSTEM_POWERSTATE_COMPLEX_TRANSITION __constant_cpu_to_le32(0x40000031)
145#define STATUS_ACCESS_AUDIT_BY_POLICY __constant_cpu_to_le32(0x40000032)
146#define STATUS_ABANDON_HIBERFILE __constant_cpu_to_le32(0x40000033)
147#define STATUS_BIZRULES_NOT_ENABLED __constant_cpu_to_le32(0x40000034)
148#define STATUS_WAKE_SYSTEM __constant_cpu_to_le32(0x40000294)
149#define STATUS_DS_SHUTTING_DOWN __constant_cpu_to_le32(0x40000370)
150#define DBG_REPLY_LATER __constant_cpu_to_le32(0x40010001)
151#define DBG_UNABLE_TO_PROVIDE_HANDLE __constant_cpu_to_le32(0x40010002)
152#define DBG_TERMINATE_THREAD __constant_cpu_to_le32(0x40010003)
153#define DBG_TERMINATE_PROCESS __constant_cpu_to_le32(0x40010004)
154#define DBG_CONTROL_C __constant_cpu_to_le32(0x40010005)
155#define DBG_PRINTEXCEPTION_C __constant_cpu_to_le32(0x40010006)
156#define DBG_RIPEXCEPTION __constant_cpu_to_le32(0x40010007)
157#define DBG_CONTROL_BREAK __constant_cpu_to_le32(0x40010008)
158#define DBG_COMMAND_EXCEPTION __constant_cpu_to_le32(0x40010009)
159#define RPC_NT_UUID_LOCAL_ONLY __constant_cpu_to_le32(0x40020056)
160#define RPC_NT_SEND_INCOMPLETE __constant_cpu_to_le32(0x400200AF)
161#define STATUS_CTX_CDM_CONNECT __constant_cpu_to_le32(0x400A0004)
162#define STATUS_CTX_CDM_DISCONNECT __constant_cpu_to_le32(0x400A0005)
163#define STATUS_SXS_RELEASE_ACTIVATION_CONTEXT __constant_cpu_to_le32(0x4015000D)
164#define STATUS_RECOVERY_NOT_NEEDED __constant_cpu_to_le32(0x40190034)
165#define STATUS_RM_ALREADY_STARTED __constant_cpu_to_le32(0x40190035)
166#define STATUS_LOG_NO_RESTART __constant_cpu_to_le32(0x401A000C)
167#define STATUS_VIDEO_DRIVER_DEBUG_REPORT_REQUEST __constant_cpu_to_le32(0x401B00EC)
168#define STATUS_GRAPHICS_PARTIAL_DATA_POPULATED __constant_cpu_to_le32(0x401E000A)
169#define STATUS_GRAPHICS_DRIVER_MISMATCH __constant_cpu_to_le32(0x401E0117)
170#define STATUS_GRAPHICS_MODE_NOT_PINNED __constant_cpu_to_le32(0x401E0307)
171#define STATUS_GRAPHICS_NO_PREFERRED_MODE __constant_cpu_to_le32(0x401E031E)
172#define STATUS_GRAPHICS_DATASET_IS_EMPTY __constant_cpu_to_le32(0x401E034B)
173#define STATUS_GRAPHICS_NO_MORE_ELEMENTS_IN_DATASET __constant_cpu_to_le32(0x401E034C)
174#define STATUS_GRAPHICS_PATH_CONTENT_GEOMETRY_TRANSFORMATION_NOT_PINNED __constant_cpu_to_le32(0x401E0351)
175#define STATUS_GRAPHICS_UNKNOWN_CHILD_STATUS __constant_cpu_to_le32(0x401E042F)
176#define STATUS_GRAPHICS_LEADLINK_START_DEFERRED __constant_cpu_to_le32(0x401E0437)
177#define STATUS_GRAPHICS_POLLING_TOO_FREQUENTLY __constant_cpu_to_le32(0x401E0439)
178#define STATUS_GRAPHICS_START_DEFERRED __constant_cpu_to_le32(0x401E043A)
179#define STATUS_NDIS_INDICATION_REQUIRED __constant_cpu_to_le32(0x40230001)
180#define STATUS_GUARD_PAGE_VIOLATION __constant_cpu_to_le32(0x80000001)
181#define STATUS_DATATYPE_MISALIGNMENT __constant_cpu_to_le32(0x80000002)
182#define STATUS_BREAKPOINT __constant_cpu_to_le32(0x80000003)
183#define STATUS_SINGLE_STEP __constant_cpu_to_le32(0x80000004)
184#define STATUS_BUFFER_OVERFLOW __constant_cpu_to_le32(0x80000005)
185#define STATUS_NO_MORE_FILES __constant_cpu_to_le32(0x80000006)
186#define STATUS_WAKE_SYSTEM_DEBUGGER __constant_cpu_to_le32(0x80000007)
187#define STATUS_HANDLES_CLOSED __constant_cpu_to_le32(0x8000000A)
188#define STATUS_NO_INHERITANCE __constant_cpu_to_le32(0x8000000B)
189#define STATUS_GUID_SUBSTITUTION_MADE __constant_cpu_to_le32(0x8000000C)
190#define STATUS_PARTIAL_COPY __constant_cpu_to_le32(0x8000000D)
191#define STATUS_DEVICE_PAPER_EMPTY __constant_cpu_to_le32(0x8000000E)
192#define STATUS_DEVICE_POWERED_OFF __constant_cpu_to_le32(0x8000000F)
193#define STATUS_DEVICE_OFF_LINE __constant_cpu_to_le32(0x80000010)
194#define STATUS_DEVICE_BUSY __constant_cpu_to_le32(0x80000011)
195#define STATUS_NO_MORE_EAS __constant_cpu_to_le32(0x80000012)
196#define STATUS_INVALID_EA_NAME __constant_cpu_to_le32(0x80000013)
197#define STATUS_EA_LIST_INCONSISTENT __constant_cpu_to_le32(0x80000014)
198#define STATUS_INVALID_EA_FLAG __constant_cpu_to_le32(0x80000015)
199#define STATUS_VERIFY_REQUIRED __constant_cpu_to_le32(0x80000016)
200#define STATUS_EXTRANEOUS_INFORMATION __constant_cpu_to_le32(0x80000017)
201#define STATUS_RXACT_COMMIT_NECESSARY __constant_cpu_to_le32(0x80000018)
202#define STATUS_NO_MORE_ENTRIES __constant_cpu_to_le32(0x8000001A)
203#define STATUS_FILEMARK_DETECTED __constant_cpu_to_le32(0x8000001B)
204#define STATUS_MEDIA_CHANGED __constant_cpu_to_le32(0x8000001C)
205#define STATUS_BUS_RESET __constant_cpu_to_le32(0x8000001D)
206#define STATUS_END_OF_MEDIA __constant_cpu_to_le32(0x8000001E)
207#define STATUS_BEGINNING_OF_MEDIA __constant_cpu_to_le32(0x8000001F)
208#define STATUS_MEDIA_CHECK __constant_cpu_to_le32(0x80000020)
209#define STATUS_SETMARK_DETECTED __constant_cpu_to_le32(0x80000021)
210#define STATUS_NO_DATA_DETECTED __constant_cpu_to_le32(0x80000022)
211#define STATUS_REDIRECTOR_HAS_OPEN_HANDLES __constant_cpu_to_le32(0x80000023)
212#define STATUS_SERVER_HAS_OPEN_HANDLES __constant_cpu_to_le32(0x80000024)
213#define STATUS_ALREADY_DISCONNECTED __constant_cpu_to_le32(0x80000025)
214#define STATUS_LONGJUMP __constant_cpu_to_le32(0x80000026)
215#define STATUS_CLEANER_CARTRIDGE_INSTALLED __constant_cpu_to_le32(0x80000027)
216#define STATUS_PLUGPLAY_QUERY_VETOED __constant_cpu_to_le32(0x80000028)
217#define STATUS_UNWIND_CONSOLIDATE __constant_cpu_to_le32(0x80000029)
218#define STATUS_REGISTRY_HIVE_RECOVERED __constant_cpu_to_le32(0x8000002A)
219#define STATUS_DLL_MIGHT_BE_INSECURE __constant_cpu_to_le32(0x8000002B)
220#define STATUS_DLL_MIGHT_BE_INCOMPATIBLE __constant_cpu_to_le32(0x8000002C)
221#define STATUS_STOPPED_ON_SYMLINK __constant_cpu_to_le32(0x8000002D)
222#define STATUS_DEVICE_REQUIRES_CLEANING __constant_cpu_to_le32(0x80000288)
223#define STATUS_DEVICE_DOOR_OPEN __constant_cpu_to_le32(0x80000289)
224#define STATUS_DATA_LOST_REPAIR __constant_cpu_to_le32(0x80000803)
225#define DBG_EXCEPTION_NOT_HANDLED __constant_cpu_to_le32(0x80010001)
226#define STATUS_CLUSTER_NODE_ALREADY_UP __constant_cpu_to_le32(0x80130001)
227#define STATUS_CLUSTER_NODE_ALREADY_DOWN __constant_cpu_to_le32(0x80130002)
228#define STATUS_CLUSTER_NETWORK_ALREADY_ONLINE __constant_cpu_to_le32(0x80130003)
229#define STATUS_CLUSTER_NETWORK_ALREADY_OFFLINE __constant_cpu_to_le32(0x80130004)
230#define STATUS_CLUSTER_NODE_ALREADY_MEMBER __constant_cpu_to_le32(0x80130005)
231#define STATUS_COULD_NOT_RESIZE_LOG __constant_cpu_to_le32(0x80190009)
232#define STATUS_NO_TXF_METADATA __constant_cpu_to_le32(0x80190029)
233#define STATUS_CANT_RECOVER_WITH_HANDLE_OPEN __constant_cpu_to_le32(0x80190031)
234#define STATUS_TXF_METADATA_ALREADY_PRESENT __constant_cpu_to_le32(0x80190041)
235#define STATUS_TRANSACTION_SCOPE_CALLBACKS_NOT_SET __constant_cpu_to_le32(0x80190042)
236#define STATUS_VIDEO_HUNG_DISPLAY_DRIVER_THREAD_RECOVERED __constant_cpu_to_le32(0x801B00EB)
237#define STATUS_FLT_BUFFER_TOO_SMALL __constant_cpu_to_le32(0x801C0001)
238#define STATUS_FVE_PARTIAL_METADATA __constant_cpu_to_le32(0x80210001)
239#define STATUS_UNSUCCESSFUL __constant_cpu_to_le32(0xC0000001)
240#define STATUS_NOT_IMPLEMENTED __constant_cpu_to_le32(0xC0000002)
241#define STATUS_INVALID_INFO_CLASS __constant_cpu_to_le32(0xC0000003)
242#define STATUS_INFO_LENGTH_MISMATCH __constant_cpu_to_le32(0xC0000004)
243#define STATUS_ACCESS_VIOLATION __constant_cpu_to_le32(0xC0000005)
244#define STATUS_IN_PAGE_ERROR __constant_cpu_to_le32(0xC0000006)
245#define STATUS_PAGEFILE_QUOTA __constant_cpu_to_le32(0xC0000007)
246#define STATUS_INVALID_HANDLE __constant_cpu_to_le32(0xC0000008)
247#define STATUS_BAD_INITIAL_STACK __constant_cpu_to_le32(0xC0000009)
248#define STATUS_BAD_INITIAL_PC __constant_cpu_to_le32(0xC000000A)
249#define STATUS_INVALID_CID __constant_cpu_to_le32(0xC000000B)
250#define STATUS_TIMER_NOT_CANCELED __constant_cpu_to_le32(0xC000000C)
251#define STATUS_INVALID_PARAMETER __constant_cpu_to_le32(0xC000000D)
252#define STATUS_NO_SUCH_DEVICE __constant_cpu_to_le32(0xC000000E)
253#define STATUS_NO_SUCH_FILE __constant_cpu_to_le32(0xC000000F)
254#define STATUS_INVALID_DEVICE_REQUEST __constant_cpu_to_le32(0xC0000010)
255#define STATUS_END_OF_FILE __constant_cpu_to_le32(0xC0000011)
256#define STATUS_WRONG_VOLUME __constant_cpu_to_le32(0xC0000012)
257#define STATUS_NO_MEDIA_IN_DEVICE __constant_cpu_to_le32(0xC0000013)
258#define STATUS_UNRECOGNIZED_MEDIA __constant_cpu_to_le32(0xC0000014)
259#define STATUS_NONEXISTENT_SECTOR __constant_cpu_to_le32(0xC0000015)
260#define STATUS_MORE_PROCESSING_REQUIRED __constant_cpu_to_le32(0xC0000016)
261#define STATUS_NO_MEMORY __constant_cpu_to_le32(0xC0000017)
262#define STATUS_CONFLICTING_ADDRESSES __constant_cpu_to_le32(0xC0000018)
263#define STATUS_NOT_MAPPED_VIEW __constant_cpu_to_le32(0xC0000019)
264#define STATUS_UNABLE_TO_FREE_VM __constant_cpu_to_le32(0xC000001A)
265#define STATUS_UNABLE_TO_DELETE_SECTION __constant_cpu_to_le32(0xC000001B)
266#define STATUS_INVALID_SYSTEM_SERVICE __constant_cpu_to_le32(0xC000001C)
267#define STATUS_ILLEGAL_INSTRUCTION __constant_cpu_to_le32(0xC000001D)
268#define STATUS_INVALID_LOCK_SEQUENCE __constant_cpu_to_le32(0xC000001E)
269#define STATUS_INVALID_VIEW_SIZE __constant_cpu_to_le32(0xC000001F)
270#define STATUS_INVALID_FILE_FOR_SECTION __constant_cpu_to_le32(0xC0000020)
271#define STATUS_ALREADY_COMMITTED __constant_cpu_to_le32(0xC0000021)
272#define STATUS_ACCESS_DENIED __constant_cpu_to_le32(0xC0000022)
273#define STATUS_BUFFER_TOO_SMALL __constant_cpu_to_le32(0xC0000023)
274#define STATUS_OBJECT_TYPE_MISMATCH __constant_cpu_to_le32(0xC0000024)
275#define STATUS_NONCONTINUABLE_EXCEPTION __constant_cpu_to_le32(0xC0000025)
276#define STATUS_INVALID_DISPOSITION __constant_cpu_to_le32(0xC0000026)
277#define STATUS_UNWIND __constant_cpu_to_le32(0xC0000027)
278#define STATUS_BAD_STACK __constant_cpu_to_le32(0xC0000028)
279#define STATUS_INVALID_UNWIND_TARGET __constant_cpu_to_le32(0xC0000029)
280#define STATUS_NOT_LOCKED __constant_cpu_to_le32(0xC000002A)
281#define STATUS_PARITY_ERROR __constant_cpu_to_le32(0xC000002B)
282#define STATUS_UNABLE_TO_DECOMMIT_VM __constant_cpu_to_le32(0xC000002C)
283#define STATUS_NOT_COMMITTED __constant_cpu_to_le32(0xC000002D)
284#define STATUS_INVALID_PORT_ATTRIBUTES __constant_cpu_to_le32(0xC000002E)
285#define STATUS_PORT_MESSAGE_TOO_LONG __constant_cpu_to_le32(0xC000002F)
286#define STATUS_INVALID_PARAMETER_MIX __constant_cpu_to_le32(0xC0000030)
287#define STATUS_INVALID_QUOTA_LOWER __constant_cpu_to_le32(0xC0000031)
288#define STATUS_DISK_CORRUPT_ERROR __constant_cpu_to_le32(0xC0000032)
289#define STATUS_OBJECT_NAME_INVALID __constant_cpu_to_le32(0xC0000033)
290#define STATUS_OBJECT_NAME_NOT_FOUND __constant_cpu_to_le32(0xC0000034)
291#define STATUS_OBJECT_NAME_COLLISION __constant_cpu_to_le32(0xC0000035)
292#define STATUS_PORT_DISCONNECTED __constant_cpu_to_le32(0xC0000037)
293#define STATUS_DEVICE_ALREADY_ATTACHED __constant_cpu_to_le32(0xC0000038)
294#define STATUS_OBJECT_PATH_INVALID __constant_cpu_to_le32(0xC0000039)
295#define STATUS_OBJECT_PATH_NOT_FOUND __constant_cpu_to_le32(0xC000003A)
296#define STATUS_OBJECT_PATH_SYNTAX_BAD __constant_cpu_to_le32(0xC000003B)
297#define STATUS_DATA_OVERRUN __constant_cpu_to_le32(0xC000003C)
298#define STATUS_DATA_LATE_ERROR __constant_cpu_to_le32(0xC000003D)
299#define STATUS_DATA_ERROR __constant_cpu_to_le32(0xC000003E)
300#define STATUS_CRC_ERROR __constant_cpu_to_le32(0xC000003F)
301#define STATUS_SECTION_TOO_BIG __constant_cpu_to_le32(0xC0000040)
302#define STATUS_PORT_CONNECTION_REFUSED __constant_cpu_to_le32(0xC0000041)
303#define STATUS_INVALID_PORT_HANDLE __constant_cpu_to_le32(0xC0000042)
304#define STATUS_SHARING_VIOLATION __constant_cpu_to_le32(0xC0000043)
305#define STATUS_QUOTA_EXCEEDED __constant_cpu_to_le32(0xC0000044)
306#define STATUS_INVALID_PAGE_PROTECTION __constant_cpu_to_le32(0xC0000045)
307#define STATUS_MUTANT_NOT_OWNED __constant_cpu_to_le32(0xC0000046)
308#define STATUS_SEMAPHORE_LIMIT_EXCEEDED __constant_cpu_to_le32(0xC0000047)
309#define STATUS_PORT_ALREADY_SET __constant_cpu_to_le32(0xC0000048)
310#define STATUS_SECTION_NOT_IMAGE __constant_cpu_to_le32(0xC0000049)
311#define STATUS_SUSPEND_COUNT_EXCEEDED __constant_cpu_to_le32(0xC000004A)
312#define STATUS_THREAD_IS_TERMINATING __constant_cpu_to_le32(0xC000004B)
313#define STATUS_BAD_WORKING_SET_LIMIT __constant_cpu_to_le32(0xC000004C)
314#define STATUS_INCOMPATIBLE_FILE_MAP __constant_cpu_to_le32(0xC000004D)
315#define STATUS_SECTION_PROTECTION __constant_cpu_to_le32(0xC000004E)
316#define STATUS_EAS_NOT_SUPPORTED __constant_cpu_to_le32(0xC000004F)
317#define STATUS_EA_TOO_LARGE __constant_cpu_to_le32(0xC0000050)
318#define STATUS_NONEXISTENT_EA_ENTRY __constant_cpu_to_le32(0xC0000051)
319#define STATUS_NO_EAS_ON_FILE __constant_cpu_to_le32(0xC0000052)
320#define STATUS_EA_CORRUPT_ERROR __constant_cpu_to_le32(0xC0000053)
321#define STATUS_FILE_LOCK_CONFLICT __constant_cpu_to_le32(0xC0000054)
322#define STATUS_LOCK_NOT_GRANTED __constant_cpu_to_le32(0xC0000055)
323#define STATUS_DELETE_PENDING __constant_cpu_to_le32(0xC0000056)
324#define STATUS_CTL_FILE_NOT_SUPPORTED __constant_cpu_to_le32(0xC0000057)
325#define STATUS_UNKNOWN_REVISION __constant_cpu_to_le32(0xC0000058)
326#define STATUS_REVISION_MISMATCH __constant_cpu_to_le32(0xC0000059)
327#define STATUS_INVALID_OWNER __constant_cpu_to_le32(0xC000005A)
328#define STATUS_INVALID_PRIMARY_GROUP __constant_cpu_to_le32(0xC000005B)
329#define STATUS_NO_IMPERSONATION_TOKEN __constant_cpu_to_le32(0xC000005C)
330#define STATUS_CANT_DISABLE_MANDATORY __constant_cpu_to_le32(0xC000005D)
331#define STATUS_NO_LOGON_SERVERS __constant_cpu_to_le32(0xC000005E)
332#define STATUS_NO_SUCH_LOGON_SESSION __constant_cpu_to_le32(0xC000005F)
333#define STATUS_NO_SUCH_PRIVILEGE __constant_cpu_to_le32(0xC0000060)
334#define STATUS_PRIVILEGE_NOT_HELD __constant_cpu_to_le32(0xC0000061)
335#define STATUS_INVALID_ACCOUNT_NAME __constant_cpu_to_le32(0xC0000062)
336#define STATUS_USER_EXISTS __constant_cpu_to_le32(0xC0000063)
337#define STATUS_NO_SUCH_USER __constant_cpu_to_le32(0xC0000064)
338#define STATUS_GROUP_EXISTS __constant_cpu_to_le32(0xC0000065)
339#define STATUS_NO_SUCH_GROUP __constant_cpu_to_le32(0xC0000066)
340#define STATUS_MEMBER_IN_GROUP __constant_cpu_to_le32(0xC0000067)
341#define STATUS_MEMBER_NOT_IN_GROUP __constant_cpu_to_le32(0xC0000068)
342#define STATUS_LAST_ADMIN __constant_cpu_to_le32(0xC0000069)
343#define STATUS_WRONG_PASSWORD __constant_cpu_to_le32(0xC000006A)
344#define STATUS_ILL_FORMED_PASSWORD __constant_cpu_to_le32(0xC000006B)
345#define STATUS_PASSWORD_RESTRICTION __constant_cpu_to_le32(0xC000006C)
346#define STATUS_LOGON_FAILURE __constant_cpu_to_le32(0xC000006D)
347#define STATUS_ACCOUNT_RESTRICTION __constant_cpu_to_le32(0xC000006E)
348#define STATUS_INVALID_LOGON_HOURS __constant_cpu_to_le32(0xC000006F)
349#define STATUS_INVALID_WORKSTATION __constant_cpu_to_le32(0xC0000070)
350#define STATUS_PASSWORD_EXPIRED __constant_cpu_to_le32(0xC0000071)
351#define STATUS_ACCOUNT_DISABLED __constant_cpu_to_le32(0xC0000072)
352#define STATUS_NONE_MAPPED __constant_cpu_to_le32(0xC0000073)
353#define STATUS_TOO_MANY_LUIDS_REQUESTED __constant_cpu_to_le32(0xC0000074)
354#define STATUS_LUIDS_EXHAUSTED __constant_cpu_to_le32(0xC0000075)
355#define STATUS_INVALID_SUB_AUTHORITY __constant_cpu_to_le32(0xC0000076)
356#define STATUS_INVALID_ACL __constant_cpu_to_le32(0xC0000077)
357#define STATUS_INVALID_SID __constant_cpu_to_le32(0xC0000078)
358#define STATUS_INVALID_SECURITY_DESCR __constant_cpu_to_le32(0xC0000079)
359#define STATUS_PROCEDURE_NOT_FOUND __constant_cpu_to_le32(0xC000007A)
360#define STATUS_INVALID_IMAGE_FORMAT __constant_cpu_to_le32(0xC000007B)
361#define STATUS_NO_TOKEN __constant_cpu_to_le32(0xC000007C)
362#define STATUS_BAD_INHERITANCE_ACL __constant_cpu_to_le32(0xC000007D)
363#define STATUS_RANGE_NOT_LOCKED __constant_cpu_to_le32(0xC000007E)
364#define STATUS_DISK_FULL __constant_cpu_to_le32(0xC000007F)
365#define STATUS_SERVER_DISABLED __constant_cpu_to_le32(0xC0000080)
366#define STATUS_SERVER_NOT_DISABLED __constant_cpu_to_le32(0xC0000081)
367#define STATUS_TOO_MANY_GUIDS_REQUESTED __constant_cpu_to_le32(0xC0000082)
368#define STATUS_GUIDS_EXHAUSTED __constant_cpu_to_le32(0xC0000083)
369#define STATUS_INVALID_ID_AUTHORITY __constant_cpu_to_le32(0xC0000084)
370#define STATUS_AGENTS_EXHAUSTED __constant_cpu_to_le32(0xC0000085)
371#define STATUS_INVALID_VOLUME_LABEL __constant_cpu_to_le32(0xC0000086)
372#define STATUS_SECTION_NOT_EXTENDED __constant_cpu_to_le32(0xC0000087)
373#define STATUS_NOT_MAPPED_DATA __constant_cpu_to_le32(0xC0000088)
374#define STATUS_RESOURCE_DATA_NOT_FOUND __constant_cpu_to_le32(0xC0000089)
375#define STATUS_RESOURCE_TYPE_NOT_FOUND __constant_cpu_to_le32(0xC000008A)
376#define STATUS_RESOURCE_NAME_NOT_FOUND __constant_cpu_to_le32(0xC000008B)
377#define STATUS_ARRAY_BOUNDS_EXCEEDED __constant_cpu_to_le32(0xC000008C)
378#define STATUS_FLOAT_DENORMAL_OPERAND __constant_cpu_to_le32(0xC000008D)
379#define STATUS_FLOAT_DIVIDE_BY_ZERO __constant_cpu_to_le32(0xC000008E)
380#define STATUS_FLOAT_INEXACT_RESULT __constant_cpu_to_le32(0xC000008F)
381#define STATUS_FLOAT_INVALID_OPERATION __constant_cpu_to_le32(0xC0000090)
382#define STATUS_FLOAT_OVERFLOW __constant_cpu_to_le32(0xC0000091)
383#define STATUS_FLOAT_STACK_CHECK __constant_cpu_to_le32(0xC0000092)
384#define STATUS_FLOAT_UNDERFLOW __constant_cpu_to_le32(0xC0000093)
385#define STATUS_INTEGER_DIVIDE_BY_ZERO __constant_cpu_to_le32(0xC0000094)
386#define STATUS_INTEGER_OVERFLOW __constant_cpu_to_le32(0xC0000095)
387#define STATUS_PRIVILEGED_INSTRUCTION __constant_cpu_to_le32(0xC0000096)
388#define STATUS_TOO_MANY_PAGING_FILES __constant_cpu_to_le32(0xC0000097)
389#define STATUS_FILE_INVALID __constant_cpu_to_le32(0xC0000098)
390#define STATUS_ALLOTTED_SPACE_EXCEEDED __constant_cpu_to_le32(0xC0000099)
391#define STATUS_INSUFFICIENT_RESOURCES __constant_cpu_to_le32(0xC000009A)
392#define STATUS_DFS_EXIT_PATH_FOUND __constant_cpu_to_le32(0xC000009B)
393#define STATUS_DEVICE_DATA_ERROR __constant_cpu_to_le32(0xC000009C)
394#define STATUS_DEVICE_NOT_CONNECTED __constant_cpu_to_le32(0xC000009D)
395#define STATUS_DEVICE_POWER_FAILURE __constant_cpu_to_le32(0xC000009E)
396#define STATUS_FREE_VM_NOT_AT_BASE __constant_cpu_to_le32(0xC000009F)
397#define STATUS_MEMORY_NOT_ALLOCATED __constant_cpu_to_le32(0xC00000A0)
398#define STATUS_WORKING_SET_QUOTA __constant_cpu_to_le32(0xC00000A1)
399#define STATUS_MEDIA_WRITE_PROTECTED __constant_cpu_to_le32(0xC00000A2)
400#define STATUS_DEVICE_NOT_READY __constant_cpu_to_le32(0xC00000A3)
401#define STATUS_INVALID_GROUP_ATTRIBUTES __constant_cpu_to_le32(0xC00000A4)
402#define STATUS_BAD_IMPERSONATION_LEVEL __constant_cpu_to_le32(0xC00000A5)
403#define STATUS_CANT_OPEN_ANONYMOUS __constant_cpu_to_le32(0xC00000A6)
404#define STATUS_BAD_VALIDATION_CLASS __constant_cpu_to_le32(0xC00000A7)
405#define STATUS_BAD_TOKEN_TYPE __constant_cpu_to_le32(0xC00000A8)
406#define STATUS_BAD_MASTER_BOOT_RECORD __constant_cpu_to_le32(0xC00000A9)
407#define STATUS_INSTRUCTION_MISALIGNMENT __constant_cpu_to_le32(0xC00000AA)
408#define STATUS_INSTANCE_NOT_AVAILABLE __constant_cpu_to_le32(0xC00000AB)
409#define STATUS_PIPE_NOT_AVAILABLE __constant_cpu_to_le32(0xC00000AC)
410#define STATUS_INVALID_PIPE_STATE __constant_cpu_to_le32(0xC00000AD)
411#define STATUS_PIPE_BUSY __constant_cpu_to_le32(0xC00000AE)
412#define STATUS_ILLEGAL_FUNCTION __constant_cpu_to_le32(0xC00000AF)
413#define STATUS_PIPE_DISCONNECTED __constant_cpu_to_le32(0xC00000B0)
414#define STATUS_PIPE_CLOSING __constant_cpu_to_le32(0xC00000B1)
415#define STATUS_PIPE_CONNECTED __constant_cpu_to_le32(0xC00000B2)
416#define STATUS_PIPE_LISTENING __constant_cpu_to_le32(0xC00000B3)
417#define STATUS_INVALID_READ_MODE __constant_cpu_to_le32(0xC00000B4)
418#define STATUS_IO_TIMEOUT __constant_cpu_to_le32(0xC00000B5)
419#define STATUS_FILE_FORCED_CLOSED __constant_cpu_to_le32(0xC00000B6)
420#define STATUS_PROFILING_NOT_STARTED __constant_cpu_to_le32(0xC00000B7)
421#define STATUS_PROFILING_NOT_STOPPED __constant_cpu_to_le32(0xC00000B8)
422#define STATUS_COULD_NOT_INTERPRET __constant_cpu_to_le32(0xC00000B9)
423#define STATUS_FILE_IS_A_DIRECTORY __constant_cpu_to_le32(0xC00000BA)
424#define STATUS_NOT_SUPPORTED __constant_cpu_to_le32(0xC00000BB)
425#define STATUS_REMOTE_NOT_LISTENING __constant_cpu_to_le32(0xC00000BC)
426#define STATUS_DUPLICATE_NAME __constant_cpu_to_le32(0xC00000BD)
427#define STATUS_BAD_NETWORK_PATH __constant_cpu_to_le32(0xC00000BE)
428#define STATUS_NETWORK_BUSY __constant_cpu_to_le32(0xC00000BF)
429#define STATUS_DEVICE_DOES_NOT_EXIST __constant_cpu_to_le32(0xC00000C0)
430#define STATUS_TOO_MANY_COMMANDS __constant_cpu_to_le32(0xC00000C1)
431#define STATUS_ADAPTER_HARDWARE_ERROR __constant_cpu_to_le32(0xC00000C2)
432#define STATUS_INVALID_NETWORK_RESPONSE __constant_cpu_to_le32(0xC00000C3)
433#define STATUS_UNEXPECTED_NETWORK_ERROR __constant_cpu_to_le32(0xC00000C4)
434#define STATUS_BAD_REMOTE_ADAPTER __constant_cpu_to_le32(0xC00000C5)
435#define STATUS_PRINT_QUEUE_FULL __constant_cpu_to_le32(0xC00000C6)
436#define STATUS_NO_SPOOL_SPACE __constant_cpu_to_le32(0xC00000C7)
437#define STATUS_PRINT_CANCELLED __constant_cpu_to_le32(0xC00000C8)
438#define STATUS_NETWORK_NAME_DELETED __constant_cpu_to_le32(0xC00000C9)
439#define STATUS_NETWORK_ACCESS_DENIED __constant_cpu_to_le32(0xC00000CA)
440#define STATUS_BAD_DEVICE_TYPE __constant_cpu_to_le32(0xC00000CB)
441#define STATUS_BAD_NETWORK_NAME __constant_cpu_to_le32(0xC00000CC)
442#define STATUS_TOO_MANY_NAMES __constant_cpu_to_le32(0xC00000CD)
443#define STATUS_TOO_MANY_SESSIONS __constant_cpu_to_le32(0xC00000CE)
444#define STATUS_SHARING_PAUSED __constant_cpu_to_le32(0xC00000CF)
445#define STATUS_REQUEST_NOT_ACCEPTED __constant_cpu_to_le32(0xC00000D0)
446#define STATUS_REDIRECTOR_PAUSED __constant_cpu_to_le32(0xC00000D1)
447#define STATUS_NET_WRITE_FAULT __constant_cpu_to_le32(0xC00000D2)
448#define STATUS_PROFILING_AT_LIMIT __constant_cpu_to_le32(0xC00000D3)
449#define STATUS_NOT_SAME_DEVICE __constant_cpu_to_le32(0xC00000D4)
450#define STATUS_FILE_RENAMED __constant_cpu_to_le32(0xC00000D5)
451#define STATUS_VIRTUAL_CIRCUIT_CLOSED __constant_cpu_to_le32(0xC00000D6)
452#define STATUS_NO_SECURITY_ON_OBJECT __constant_cpu_to_le32(0xC00000D7)
453#define STATUS_CANT_WAIT __constant_cpu_to_le32(0xC00000D8)
454#define STATUS_PIPE_EMPTY __constant_cpu_to_le32(0xC00000D9)
455#define STATUS_CANT_ACCESS_DOMAIN_INFO __constant_cpu_to_le32(0xC00000DA)
456#define STATUS_CANT_TERMINATE_SELF __constant_cpu_to_le32(0xC00000DB)
457#define STATUS_INVALID_SERVER_STATE __constant_cpu_to_le32(0xC00000DC)
458#define STATUS_INVALID_DOMAIN_STATE __constant_cpu_to_le32(0xC00000DD)
459#define STATUS_INVALID_DOMAIN_ROLE __constant_cpu_to_le32(0xC00000DE)
460#define STATUS_NO_SUCH_DOMAIN __constant_cpu_to_le32(0xC00000DF)
461#define STATUS_DOMAIN_EXISTS __constant_cpu_to_le32(0xC00000E0)
462#define STATUS_DOMAIN_LIMIT_EXCEEDED __constant_cpu_to_le32(0xC00000E1)
463#define STATUS_OPLOCK_NOT_GRANTED __constant_cpu_to_le32(0xC00000E2)
464#define STATUS_INVALID_OPLOCK_PROTOCOL __constant_cpu_to_le32(0xC00000E3)
465#define STATUS_INTERNAL_DB_CORRUPTION __constant_cpu_to_le32(0xC00000E4)
466#define STATUS_INTERNAL_ERROR __constant_cpu_to_le32(0xC00000E5)
467#define STATUS_GENERIC_NOT_MAPPED __constant_cpu_to_le32(0xC00000E6)
468#define STATUS_BAD_DESCRIPTOR_FORMAT __constant_cpu_to_le32(0xC00000E7)
469#define STATUS_INVALID_USER_BUFFER __constant_cpu_to_le32(0xC00000E8)
470#define STATUS_UNEXPECTED_IO_ERROR __constant_cpu_to_le32(0xC00000E9)
471#define STATUS_UNEXPECTED_MM_CREATE_ERR __constant_cpu_to_le32(0xC00000EA)
472#define STATUS_UNEXPECTED_MM_MAP_ERROR __constant_cpu_to_le32(0xC00000EB)
473#define STATUS_UNEXPECTED_MM_EXTEND_ERR __constant_cpu_to_le32(0xC00000EC)
474#define STATUS_NOT_LOGON_PROCESS __constant_cpu_to_le32(0xC00000ED)
475#define STATUS_LOGON_SESSION_EXISTS __constant_cpu_to_le32(0xC00000EE)
476#define STATUS_INVALID_PARAMETER_1 __constant_cpu_to_le32(0xC00000EF)
477#define STATUS_INVALID_PARAMETER_2 __constant_cpu_to_le32(0xC00000F0)
478#define STATUS_INVALID_PARAMETER_3 __constant_cpu_to_le32(0xC00000F1)
479#define STATUS_INVALID_PARAMETER_4 __constant_cpu_to_le32(0xC00000F2)
480#define STATUS_INVALID_PARAMETER_5 __constant_cpu_to_le32(0xC00000F3)
481#define STATUS_INVALID_PARAMETER_6 __constant_cpu_to_le32(0xC00000F4)
482#define STATUS_INVALID_PARAMETER_7 __constant_cpu_to_le32(0xC00000F5)
483#define STATUS_INVALID_PARAMETER_8 __constant_cpu_to_le32(0xC00000F6)
484#define STATUS_INVALID_PARAMETER_9 __constant_cpu_to_le32(0xC00000F7)
485#define STATUS_INVALID_PARAMETER_10 __constant_cpu_to_le32(0xC00000F8)
486#define STATUS_INVALID_PARAMETER_11 __constant_cpu_to_le32(0xC00000F9)
487#define STATUS_INVALID_PARAMETER_12 __constant_cpu_to_le32(0xC00000FA)
488#define STATUS_REDIRECTOR_NOT_STARTED __constant_cpu_to_le32(0xC00000FB)
489#define STATUS_REDIRECTOR_STARTED __constant_cpu_to_le32(0xC00000FC)
490#define STATUS_STACK_OVERFLOW __constant_cpu_to_le32(0xC00000FD)
491#define STATUS_NO_SUCH_PACKAGE __constant_cpu_to_le32(0xC00000FE)
492#define STATUS_BAD_FUNCTION_TABLE __constant_cpu_to_le32(0xC00000FF)
493#define STATUS_VARIABLE_NOT_FOUND __constant_cpu_to_le32(0xC0000100)
494#define STATUS_DIRECTORY_NOT_EMPTY __constant_cpu_to_le32(0xC0000101)
495#define STATUS_FILE_CORRUPT_ERROR __constant_cpu_to_le32(0xC0000102)
496#define STATUS_NOT_A_DIRECTORY __constant_cpu_to_le32(0xC0000103)
497#define STATUS_BAD_LOGON_SESSION_STATE __constant_cpu_to_le32(0xC0000104)
498#define STATUS_LOGON_SESSION_COLLISION __constant_cpu_to_le32(0xC0000105)
499#define STATUS_NAME_TOO_LONG __constant_cpu_to_le32(0xC0000106)
500#define STATUS_FILES_OPEN __constant_cpu_to_le32(0xC0000107)
501#define STATUS_CONNECTION_IN_USE __constant_cpu_to_le32(0xC0000108)
502#define STATUS_MESSAGE_NOT_FOUND __constant_cpu_to_le32(0xC0000109)
503#define STATUS_PROCESS_IS_TERMINATING __constant_cpu_to_le32(0xC000010A)
504#define STATUS_INVALID_LOGON_TYPE __constant_cpu_to_le32(0xC000010B)
505#define STATUS_NO_GUID_TRANSLATION __constant_cpu_to_le32(0xC000010C)
506#define STATUS_CANNOT_IMPERSONATE __constant_cpu_to_le32(0xC000010D)
507#define STATUS_IMAGE_ALREADY_LOADED __constant_cpu_to_le32(0xC000010E)
508#define STATUS_ABIOS_NOT_PRESENT __constant_cpu_to_le32(0xC000010F)
509#define STATUS_ABIOS_LID_NOT_EXIST __constant_cpu_to_le32(0xC0000110)
510#define STATUS_ABIOS_LID_ALREADY_OWNED __constant_cpu_to_le32(0xC0000111)
511#define STATUS_ABIOS_NOT_LID_OWNER __constant_cpu_to_le32(0xC0000112)
512#define STATUS_ABIOS_INVALID_COMMAND __constant_cpu_to_le32(0xC0000113)
513#define STATUS_ABIOS_INVALID_LID __constant_cpu_to_le32(0xC0000114)
514#define STATUS_ABIOS_SELECTOR_NOT_AVAILABLE __constant_cpu_to_le32(0xC0000115)
515#define STATUS_ABIOS_INVALID_SELECTOR __constant_cpu_to_le32(0xC0000116)
516#define STATUS_NO_LDT __constant_cpu_to_le32(0xC0000117)
517#define STATUS_INVALID_LDT_SIZE __constant_cpu_to_le32(0xC0000118)
518#define STATUS_INVALID_LDT_OFFSET __constant_cpu_to_le32(0xC0000119)
519#define STATUS_INVALID_LDT_DESCRIPTOR __constant_cpu_to_le32(0xC000011A)
520#define STATUS_INVALID_IMAGE_NE_FORMAT __constant_cpu_to_le32(0xC000011B)
521#define STATUS_RXACT_INVALID_STATE __constant_cpu_to_le32(0xC000011C)
522#define STATUS_RXACT_COMMIT_FAILURE __constant_cpu_to_le32(0xC000011D)
523#define STATUS_MAPPED_FILE_SIZE_ZERO __constant_cpu_to_le32(0xC000011E)
524#define STATUS_TOO_MANY_OPENED_FILES __constant_cpu_to_le32(0xC000011F)
525#define STATUS_CANCELLED __constant_cpu_to_le32(0xC0000120)
526#define STATUS_CANNOT_DELETE __constant_cpu_to_le32(0xC0000121)
527#define STATUS_INVALID_COMPUTER_NAME __constant_cpu_to_le32(0xC0000122)
528#define STATUS_FILE_DELETED __constant_cpu_to_le32(0xC0000123)
529#define STATUS_SPECIAL_ACCOUNT __constant_cpu_to_le32(0xC0000124)
530#define STATUS_SPECIAL_GROUP __constant_cpu_to_le32(0xC0000125)
531#define STATUS_SPECIAL_USER __constant_cpu_to_le32(0xC0000126)
532#define STATUS_MEMBERS_PRIMARY_GROUP __constant_cpu_to_le32(0xC0000127)
533#define STATUS_FILE_CLOSED __constant_cpu_to_le32(0xC0000128)
534#define STATUS_TOO_MANY_THREADS __constant_cpu_to_le32(0xC0000129)
535#define STATUS_THREAD_NOT_IN_PROCESS __constant_cpu_to_le32(0xC000012A)
536#define STATUS_TOKEN_ALREADY_IN_USE __constant_cpu_to_le32(0xC000012B)
537#define STATUS_PAGEFILE_QUOTA_EXCEEDED __constant_cpu_to_le32(0xC000012C)
538#define STATUS_COMMITMENT_LIMIT __constant_cpu_to_le32(0xC000012D)
539#define STATUS_INVALID_IMAGE_LE_FORMAT __constant_cpu_to_le32(0xC000012E)
540#define STATUS_INVALID_IMAGE_NOT_MZ __constant_cpu_to_le32(0xC000012F)
541#define STATUS_INVALID_IMAGE_PROTECT __constant_cpu_to_le32(0xC0000130)
542#define STATUS_INVALID_IMAGE_WIN_16 __constant_cpu_to_le32(0xC0000131)
543#define STATUS_LOGON_SERVER_CONFLICT __constant_cpu_to_le32(0xC0000132)
544#define STATUS_TIME_DIFFERENCE_AT_DC __constant_cpu_to_le32(0xC0000133)
545#define STATUS_SYNCHRONIZATION_REQUIRED __constant_cpu_to_le32(0xC0000134)
546#define STATUS_DLL_NOT_FOUND __constant_cpu_to_le32(0xC0000135)
547#define STATUS_OPEN_FAILED __constant_cpu_to_le32(0xC0000136)
548#define STATUS_IO_PRIVILEGE_FAILED __constant_cpu_to_le32(0xC0000137)
549#define STATUS_ORDINAL_NOT_FOUND __constant_cpu_to_le32(0xC0000138)
550#define STATUS_ENTRYPOINT_NOT_FOUND __constant_cpu_to_le32(0xC0000139)
551#define STATUS_CONTROL_C_EXIT __constant_cpu_to_le32(0xC000013A)
552#define STATUS_LOCAL_DISCONNECT __constant_cpu_to_le32(0xC000013B)
553#define STATUS_REMOTE_DISCONNECT __constant_cpu_to_le32(0xC000013C)
554#define STATUS_REMOTE_RESOURCES __constant_cpu_to_le32(0xC000013D)
555#define STATUS_LINK_FAILED __constant_cpu_to_le32(0xC000013E)
556#define STATUS_LINK_TIMEOUT __constant_cpu_to_le32(0xC000013F)
557#define STATUS_INVALID_CONNECTION __constant_cpu_to_le32(0xC0000140)
558#define STATUS_INVALID_ADDRESS __constant_cpu_to_le32(0xC0000141)
559#define STATUS_DLL_INIT_FAILED __constant_cpu_to_le32(0xC0000142)
560#define STATUS_MISSING_SYSTEMFILE __constant_cpu_to_le32(0xC0000143)
561#define STATUS_UNHANDLED_EXCEPTION __constant_cpu_to_le32(0xC0000144)
562#define STATUS_APP_INIT_FAILURE __constant_cpu_to_le32(0xC0000145)
563#define STATUS_PAGEFILE_CREATE_FAILED __constant_cpu_to_le32(0xC0000146)
564#define STATUS_NO_PAGEFILE __constant_cpu_to_le32(0xC0000147)
565#define STATUS_INVALID_LEVEL __constant_cpu_to_le32(0xC0000148)
566#define STATUS_WRONG_PASSWORD_CORE __constant_cpu_to_le32(0xC0000149)
567#define STATUS_ILLEGAL_FLOAT_CONTEXT __constant_cpu_to_le32(0xC000014A)
568#define STATUS_PIPE_BROKEN __constant_cpu_to_le32(0xC000014B)
569#define STATUS_REGISTRY_CORRUPT __constant_cpu_to_le32(0xC000014C)
570#define STATUS_REGISTRY_IO_FAILED __constant_cpu_to_le32(0xC000014D)
571#define STATUS_NO_EVENT_PAIR __constant_cpu_to_le32(0xC000014E)
572#define STATUS_UNRECOGNIZED_VOLUME __constant_cpu_to_le32(0xC000014F)
573#define STATUS_SERIAL_NO_DEVICE_INITED __constant_cpu_to_le32(0xC0000150)
574#define STATUS_NO_SUCH_ALIAS __constant_cpu_to_le32(0xC0000151)
575#define STATUS_MEMBER_NOT_IN_ALIAS __constant_cpu_to_le32(0xC0000152)
576#define STATUS_MEMBER_IN_ALIAS __constant_cpu_to_le32(0xC0000153)
577#define STATUS_ALIAS_EXISTS __constant_cpu_to_le32(0xC0000154)
578#define STATUS_LOGON_NOT_GRANTED __constant_cpu_to_le32(0xC0000155)
579#define STATUS_TOO_MANY_SECRETS __constant_cpu_to_le32(0xC0000156)
580#define STATUS_SECRET_TOO_LONG __constant_cpu_to_le32(0xC0000157)
581#define STATUS_INTERNAL_DB_ERROR __constant_cpu_to_le32(0xC0000158)
582#define STATUS_FULLSCREEN_MODE __constant_cpu_to_le32(0xC0000159)
583#define STATUS_TOO_MANY_CONTEXT_IDS __constant_cpu_to_le32(0xC000015A)
584#define STATUS_LOGON_TYPE_NOT_GRANTED __constant_cpu_to_le32(0xC000015B)
585#define STATUS_NOT_REGISTRY_FILE __constant_cpu_to_le32(0xC000015C)
586#define STATUS_NT_CROSS_ENCRYPTION_REQUIRED __constant_cpu_to_le32(0xC000015D)
587#define STATUS_DOMAIN_CTRLR_CONFIG_ERROR __constant_cpu_to_le32(0xC000015E)
588#define STATUS_FT_MISSING_MEMBER __constant_cpu_to_le32(0xC000015F)
589#define STATUS_ILL_FORMED_SERVICE_ENTRY __constant_cpu_to_le32(0xC0000160)
590#define STATUS_ILLEGAL_CHARACTER __constant_cpu_to_le32(0xC0000161)
591#define STATUS_UNMAPPABLE_CHARACTER __constant_cpu_to_le32(0xC0000162)
592#define STATUS_UNDEFINED_CHARACTER __constant_cpu_to_le32(0xC0000163)
593#define STATUS_FLOPPY_VOLUME __constant_cpu_to_le32(0xC0000164)
594#define STATUS_FLOPPY_ID_MARK_NOT_FOUND __constant_cpu_to_le32(0xC0000165)
595#define STATUS_FLOPPY_WRONG_CYLINDER __constant_cpu_to_le32(0xC0000166)
596#define STATUS_FLOPPY_UNKNOWN_ERROR __constant_cpu_to_le32(0xC0000167)
597#define STATUS_FLOPPY_BAD_REGISTERS __constant_cpu_to_le32(0xC0000168)
598#define STATUS_DISK_RECALIBRATE_FAILED __constant_cpu_to_le32(0xC0000169)
599#define STATUS_DISK_OPERATION_FAILED __constant_cpu_to_le32(0xC000016A)
600#define STATUS_DISK_RESET_FAILED __constant_cpu_to_le32(0xC000016B)
601#define STATUS_SHARED_IRQ_BUSY __constant_cpu_to_le32(0xC000016C)
602#define STATUS_FT_ORPHANING __constant_cpu_to_le32(0xC000016D)
603#define STATUS_BIOS_FAILED_TO_CONNECT_INTERRUPT __constant_cpu_to_le32(0xC000016E)
604#define STATUS_PARTITION_FAILURE __constant_cpu_to_le32(0xC0000172)
605#define STATUS_INVALID_BLOCK_LENGTH __constant_cpu_to_le32(0xC0000173)
606#define STATUS_DEVICE_NOT_PARTITIONED __constant_cpu_to_le32(0xC0000174)
607#define STATUS_UNABLE_TO_LOCK_MEDIA __constant_cpu_to_le32(0xC0000175)
608#define STATUS_UNABLE_TO_UNLOAD_MEDIA __constant_cpu_to_le32(0xC0000176)
609#define STATUS_EOM_OVERFLOW __constant_cpu_to_le32(0xC0000177)
610#define STATUS_NO_MEDIA __constant_cpu_to_le32(0xC0000178)
611#define STATUS_NO_SUCH_MEMBER __constant_cpu_to_le32(0xC000017A)
612#define STATUS_INVALID_MEMBER __constant_cpu_to_le32(0xC000017B)
613#define STATUS_KEY_DELETED __constant_cpu_to_le32(0xC000017C)
614#define STATUS_NO_LOG_SPACE __constant_cpu_to_le32(0xC000017D)
615#define STATUS_TOO_MANY_SIDS __constant_cpu_to_le32(0xC000017E)
616#define STATUS_LM_CROSS_ENCRYPTION_REQUIRED __constant_cpu_to_le32(0xC000017F)
617#define STATUS_KEY_HAS_CHILDREN __constant_cpu_to_le32(0xC0000180)
618#define STATUS_CHILD_MUST_BE_VOLATILE __constant_cpu_to_le32(0xC0000181)
619#define STATUS_DEVICE_CONFIGURATION_ERROR __constant_cpu_to_le32(0xC0000182)
620#define STATUS_DRIVER_INTERNAL_ERROR __constant_cpu_to_le32(0xC0000183)
621#define STATUS_INVALID_DEVICE_STATE __constant_cpu_to_le32(0xC0000184)
622#define STATUS_IO_DEVICE_ERROR __constant_cpu_to_le32(0xC0000185)
623#define STATUS_DEVICE_PROTOCOL_ERROR __constant_cpu_to_le32(0xC0000186)
624#define STATUS_BACKUP_CONTROLLER __constant_cpu_to_le32(0xC0000187)
625#define STATUS_LOG_FILE_FULL __constant_cpu_to_le32(0xC0000188)
626#define STATUS_TOO_LATE __constant_cpu_to_le32(0xC0000189)
627#define STATUS_NO_TRUST_LSA_SECRET __constant_cpu_to_le32(0xC000018A)
628#define STATUS_NO_TRUST_SAM_ACCOUNT __constant_cpu_to_le32(0xC000018B)
629#define STATUS_TRUSTED_DOMAIN_FAILURE __constant_cpu_to_le32(0xC000018C)
630#define STATUS_TRUSTED_RELATIONSHIP_FAILURE __constant_cpu_to_le32(0xC000018D)
631#define STATUS_EVENTLOG_FILE_CORRUPT __constant_cpu_to_le32(0xC000018E)
632#define STATUS_EVENTLOG_CANT_START __constant_cpu_to_le32(0xC000018F)
633#define STATUS_TRUST_FAILURE __constant_cpu_to_le32(0xC0000190)
634#define STATUS_MUTANT_LIMIT_EXCEEDED __constant_cpu_to_le32(0xC0000191)
635#define STATUS_NETLOGON_NOT_STARTED __constant_cpu_to_le32(0xC0000192)
636#define STATUS_ACCOUNT_EXPIRED __constant_cpu_to_le32(0xC0000193)
637#define STATUS_POSSIBLE_DEADLOCK __constant_cpu_to_le32(0xC0000194)
638#define STATUS_NETWORK_CREDENTIAL_CONFLICT __constant_cpu_to_le32(0xC0000195)
639#define STATUS_REMOTE_SESSION_LIMIT __constant_cpu_to_le32(0xC0000196)
640#define STATUS_EVENTLOG_FILE_CHANGED __constant_cpu_to_le32(0xC0000197)
641#define STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT __constant_cpu_to_le32(0xC0000198)
642#define STATUS_NOLOGON_WORKSTATION_TRUST_ACCOUNT __constant_cpu_to_le32(0xC0000199)
643#define STATUS_NOLOGON_SERVER_TRUST_ACCOUNT __constant_cpu_to_le32(0xC000019A)
644#define STATUS_DOMAIN_TRUST_INCONSISTENT __constant_cpu_to_le32(0xC000019B)
645#define STATUS_FS_DRIVER_REQUIRED __constant_cpu_to_le32(0xC000019C)
646#define STATUS_IMAGE_ALREADY_LOADED_AS_DLL __constant_cpu_to_le32(0xC000019D)
647#define STATUS_NETWORK_OPEN_RESTRICTION __constant_cpu_to_le32(0xC0000201)
648#define STATUS_NO_USER_SESSION_KEY __constant_cpu_to_le32(0xC0000202)
649#define STATUS_USER_SESSION_DELETED __constant_cpu_to_le32(0xC0000203)
650#define STATUS_RESOURCE_LANG_NOT_FOUND __constant_cpu_to_le32(0xC0000204)
651#define STATUS_INSUFF_SERVER_RESOURCES __constant_cpu_to_le32(0xC0000205)
652#define STATUS_INVALID_BUFFER_SIZE __constant_cpu_to_le32(0xC0000206)
653#define STATUS_INVALID_ADDRESS_COMPONENT __constant_cpu_to_le32(0xC0000207)
654#define STATUS_INVALID_ADDRESS_WILDCARD __constant_cpu_to_le32(0xC0000208)
655#define STATUS_TOO_MANY_ADDRESSES __constant_cpu_to_le32(0xC0000209)
656#define STATUS_ADDRESS_ALREADY_EXISTS __constant_cpu_to_le32(0xC000020A)
657#define STATUS_ADDRESS_CLOSED __constant_cpu_to_le32(0xC000020B)
658#define STATUS_CONNECTION_DISCONNECTED __constant_cpu_to_le32(0xC000020C)
659#define STATUS_CONNECTION_RESET __constant_cpu_to_le32(0xC000020D)
660#define STATUS_TOO_MANY_NODES __constant_cpu_to_le32(0xC000020E)
661#define STATUS_TRANSACTION_ABORTED __constant_cpu_to_le32(0xC000020F)
662#define STATUS_TRANSACTION_TIMED_OUT __constant_cpu_to_le32(0xC0000210)
663#define STATUS_TRANSACTION_NO_RELEASE __constant_cpu_to_le32(0xC0000211)
664#define STATUS_TRANSACTION_NO_MATCH __constant_cpu_to_le32(0xC0000212)
665#define STATUS_TRANSACTION_RESPONDED __constant_cpu_to_le32(0xC0000213)
666#define STATUS_TRANSACTION_INVALID_ID __constant_cpu_to_le32(0xC0000214)
667#define STATUS_TRANSACTION_INVALID_TYPE __constant_cpu_to_le32(0xC0000215)
668#define STATUS_NOT_SERVER_SESSION __constant_cpu_to_le32(0xC0000216)
669#define STATUS_NOT_CLIENT_SESSION __constant_cpu_to_le32(0xC0000217)
670#define STATUS_CANNOT_LOAD_REGISTRY_FILE __constant_cpu_to_le32(0xC0000218)
671#define STATUS_DEBUG_ATTACH_FAILED __constant_cpu_to_le32(0xC0000219)
672#define STATUS_SYSTEM_PROCESS_TERMINATED __constant_cpu_to_le32(0xC000021A)
673#define STATUS_DATA_NOT_ACCEPTED __constant_cpu_to_le32(0xC000021B)
674#define STATUS_NO_BROWSER_SERVERS_FOUND __constant_cpu_to_le32(0xC000021C)
675#define STATUS_VDM_HARD_ERROR __constant_cpu_to_le32(0xC000021D)
676#define STATUS_DRIVER_CANCEL_TIMEOUT __constant_cpu_to_le32(0xC000021E)
677#define STATUS_REPLY_MESSAGE_MISMATCH __constant_cpu_to_le32(0xC000021F)
678#define STATUS_MAPPED_ALIGNMENT __constant_cpu_to_le32(0xC0000220)
679#define STATUS_IMAGE_CHECKSUM_MISMATCH __constant_cpu_to_le32(0xC0000221)
680#define STATUS_LOST_WRITEBEHIND_DATA __constant_cpu_to_le32(0xC0000222)
681#define STATUS_CLIENT_SERVER_PARAMETERS_INVALID __constant_cpu_to_le32(0xC0000223)
682#define STATUS_PASSWORD_MUST_CHANGE __constant_cpu_to_le32(0xC0000224)
683#define STATUS_NOT_FOUND __constant_cpu_to_le32(0xC0000225)
684#define STATUS_NOT_TINY_STREAM __constant_cpu_to_le32(0xC0000226)
685#define STATUS_RECOVERY_FAILURE __constant_cpu_to_le32(0xC0000227)
686#define STATUS_STACK_OVERFLOW_READ __constant_cpu_to_le32(0xC0000228)
687#define STATUS_FAIL_CHECK __constant_cpu_to_le32(0xC0000229)
688#define STATUS_DUPLICATE_OBJECTID __constant_cpu_to_le32(0xC000022A)
689#define STATUS_OBJECTID_EXISTS __constant_cpu_to_le32(0xC000022B)
690#define STATUS_CONVERT_TO_LARGE __constant_cpu_to_le32(0xC000022C)
691#define STATUS_RETRY __constant_cpu_to_le32(0xC000022D)
692#define STATUS_FOUND_OUT_OF_SCOPE __constant_cpu_to_le32(0xC000022E)
693#define STATUS_ALLOCATE_BUCKET __constant_cpu_to_le32(0xC000022F)
694#define STATUS_PROPSET_NOT_FOUND __constant_cpu_to_le32(0xC0000230)
695#define STATUS_MARSHALL_OVERFLOW __constant_cpu_to_le32(0xC0000231)
696#define STATUS_INVALID_VARIANT __constant_cpu_to_le32(0xC0000232)
697#define STATUS_DOMAIN_CONTROLLER_NOT_FOUND __constant_cpu_to_le32(0xC0000233)
698#define STATUS_ACCOUNT_LOCKED_OUT __constant_cpu_to_le32(0xC0000234)
699#define STATUS_HANDLE_NOT_CLOSABLE __constant_cpu_to_le32(0xC0000235)
700#define STATUS_CONNECTION_REFUSED __constant_cpu_to_le32(0xC0000236)
701#define STATUS_GRACEFUL_DISCONNECT __constant_cpu_to_le32(0xC0000237)
702#define STATUS_ADDRESS_ALREADY_ASSOCIATED __constant_cpu_to_le32(0xC0000238)
703#define STATUS_ADDRESS_NOT_ASSOCIATED __constant_cpu_to_le32(0xC0000239)
704#define STATUS_CONNECTION_INVALID __constant_cpu_to_le32(0xC000023A)
705#define STATUS_CONNECTION_ACTIVE __constant_cpu_to_le32(0xC000023B)
706#define STATUS_NETWORK_UNREACHABLE __constant_cpu_to_le32(0xC000023C)
707#define STATUS_HOST_UNREACHABLE __constant_cpu_to_le32(0xC000023D)
708#define STATUS_PROTOCOL_UNREACHABLE __constant_cpu_to_le32(0xC000023E)
709#define STATUS_PORT_UNREACHABLE __constant_cpu_to_le32(0xC000023F)
710#define STATUS_REQUEST_ABORTED __constant_cpu_to_le32(0xC0000240)
711#define STATUS_CONNECTION_ABORTED __constant_cpu_to_le32(0xC0000241)
712#define STATUS_BAD_COMPRESSION_BUFFER __constant_cpu_to_le32(0xC0000242)
713#define STATUS_USER_MAPPED_FILE __constant_cpu_to_le32(0xC0000243)
714#define STATUS_AUDIT_FAILED __constant_cpu_to_le32(0xC0000244)
715#define STATUS_TIMER_RESOLUTION_NOT_SET __constant_cpu_to_le32(0xC0000245)
716#define STATUS_CONNECTION_COUNT_LIMIT __constant_cpu_to_le32(0xC0000246)
717#define STATUS_LOGIN_TIME_RESTRICTION __constant_cpu_to_le32(0xC0000247)
718#define STATUS_LOGIN_WKSTA_RESTRICTION __constant_cpu_to_le32(0xC0000248)
719#define STATUS_IMAGE_MP_UP_MISMATCH __constant_cpu_to_le32(0xC0000249)
720#define STATUS_INSUFFICIENT_LOGON_INFO __constant_cpu_to_le32(0xC0000250)
721#define STATUS_BAD_DLL_ENTRYPOINT __constant_cpu_to_le32(0xC0000251)
722#define STATUS_BAD_SERVICE_ENTRYPOINT __constant_cpu_to_le32(0xC0000252)
723#define STATUS_LPC_REPLY_LOST __constant_cpu_to_le32(0xC0000253)
724#define STATUS_IP_ADDRESS_CONFLICT1 __constant_cpu_to_le32(0xC0000254)
725#define STATUS_IP_ADDRESS_CONFLICT2 __constant_cpu_to_le32(0xC0000255)
726#define STATUS_REGISTRY_QUOTA_LIMIT __constant_cpu_to_le32(0xC0000256)
727#define STATUS_PATH_NOT_COVERED __constant_cpu_to_le32(0xC0000257)
728#define STATUS_NO_CALLBACK_ACTIVE __constant_cpu_to_le32(0xC0000258)
729#define STATUS_LICENSE_QUOTA_EXCEEDED __constant_cpu_to_le32(0xC0000259)
730#define STATUS_PWD_TOO_SHORT __constant_cpu_to_le32(0xC000025A)
731#define STATUS_PWD_TOO_RECENT __constant_cpu_to_le32(0xC000025B)
732#define STATUS_PWD_HISTORY_CONFLICT __constant_cpu_to_le32(0xC000025C)
733#define STATUS_PLUGPLAY_NO_DEVICE __constant_cpu_to_le32(0xC000025E)
734#define STATUS_UNSUPPORTED_COMPRESSION __constant_cpu_to_le32(0xC000025F)
735#define STATUS_INVALID_HW_PROFILE __constant_cpu_to_le32(0xC0000260)
736#define STATUS_INVALID_PLUGPLAY_DEVICE_PATH __constant_cpu_to_le32(0xC0000261)
737#define STATUS_DRIVER_ORDINAL_NOT_FOUND __constant_cpu_to_le32(0xC0000262)
738#define STATUS_DRIVER_ENTRYPOINT_NOT_FOUND __constant_cpu_to_le32(0xC0000263)
739#define STATUS_RESOURCE_NOT_OWNED __constant_cpu_to_le32(0xC0000264)
740#define STATUS_TOO_MANY_LINKS __constant_cpu_to_le32(0xC0000265)
741#define STATUS_QUOTA_LIST_INCONSISTENT __constant_cpu_to_le32(0xC0000266)
742#define STATUS_FILE_IS_OFFLINE __constant_cpu_to_le32(0xC0000267)
743#define STATUS_EVALUATION_EXPIRATION __constant_cpu_to_le32(0xC0000268)
744#define STATUS_ILLEGAL_DLL_RELOCATION __constant_cpu_to_le32(0xC0000269)
745#define STATUS_LICENSE_VIOLATION __constant_cpu_to_le32(0xC000026A)
746#define STATUS_DLL_INIT_FAILED_LOGOFF __constant_cpu_to_le32(0xC000026B)
747#define STATUS_DRIVER_UNABLE_TO_LOAD __constant_cpu_to_le32(0xC000026C)
748#define STATUS_DFS_UNAVAILABLE __constant_cpu_to_le32(0xC000026D)
749#define STATUS_VOLUME_DISMOUNTED __constant_cpu_to_le32(0xC000026E)
750#define STATUS_WX86_INTERNAL_ERROR __constant_cpu_to_le32(0xC000026F)
751#define STATUS_WX86_FLOAT_STACK_CHECK __constant_cpu_to_le32(0xC0000270)
752#define STATUS_VALIDATE_CONTINUE __constant_cpu_to_le32(0xC0000271)
753#define STATUS_NO_MATCH __constant_cpu_to_le32(0xC0000272)
754#define STATUS_NO_MORE_MATCHES __constant_cpu_to_le32(0xC0000273)
755#define STATUS_NOT_A_REPARSE_POINT __constant_cpu_to_le32(0xC0000275)
756#define STATUS_IO_REPARSE_TAG_INVALID __constant_cpu_to_le32(0xC0000276)
757#define STATUS_IO_REPARSE_TAG_MISMATCH __constant_cpu_to_le32(0xC0000277)
758#define STATUS_IO_REPARSE_DATA_INVALID __constant_cpu_to_le32(0xC0000278)
759#define STATUS_IO_REPARSE_TAG_NOT_HANDLED __constant_cpu_to_le32(0xC0000279)
760#define STATUS_REPARSE_POINT_NOT_RESOLVED __constant_cpu_to_le32(0xC0000280)
761#define STATUS_DIRECTORY_IS_A_REPARSE_POINT __constant_cpu_to_le32(0xC0000281)
762#define STATUS_RANGE_LIST_CONFLICT __constant_cpu_to_le32(0xC0000282)
763#define STATUS_SOURCE_ELEMENT_EMPTY __constant_cpu_to_le32(0xC0000283)
764#define STATUS_DESTINATION_ELEMENT_FULL __constant_cpu_to_le32(0xC0000284)
765#define STATUS_ILLEGAL_ELEMENT_ADDRESS __constant_cpu_to_le32(0xC0000285)
766#define STATUS_MAGAZINE_NOT_PRESENT __constant_cpu_to_le32(0xC0000286)
767#define STATUS_REINITIALIZATION_NEEDED __constant_cpu_to_le32(0xC0000287)
768#define STATUS_ENCRYPTION_FAILED __constant_cpu_to_le32(0xC000028A)
769#define STATUS_DECRYPTION_FAILED __constant_cpu_to_le32(0xC000028B)
770#define STATUS_RANGE_NOT_FOUND __constant_cpu_to_le32(0xC000028C)
771#define STATUS_NO_RECOVERY_POLICY __constant_cpu_to_le32(0xC000028D)
772#define STATUS_NO_EFS __constant_cpu_to_le32(0xC000028E)
773#define STATUS_WRONG_EFS __constant_cpu_to_le32(0xC000028F)
774#define STATUS_NO_USER_KEYS __constant_cpu_to_le32(0xC0000290)
775#define STATUS_FILE_NOT_ENCRYPTED __constant_cpu_to_le32(0xC0000291)
776#define STATUS_NOT_EXPORT_FORMAT __constant_cpu_to_le32(0xC0000292)
777#define STATUS_FILE_ENCRYPTED __constant_cpu_to_le32(0xC0000293)
778#define STATUS_WMI_GUID_NOT_FOUND __constant_cpu_to_le32(0xC0000295)
779#define STATUS_WMI_INSTANCE_NOT_FOUND __constant_cpu_to_le32(0xC0000296)
780#define STATUS_WMI_ITEMID_NOT_FOUND __constant_cpu_to_le32(0xC0000297)
781#define STATUS_WMI_TRY_AGAIN __constant_cpu_to_le32(0xC0000298)
782#define STATUS_SHARED_POLICY __constant_cpu_to_le32(0xC0000299)
783#define STATUS_POLICY_OBJECT_NOT_FOUND __constant_cpu_to_le32(0xC000029A)
784#define STATUS_POLICY_ONLY_IN_DS __constant_cpu_to_le32(0xC000029B)
785#define STATUS_VOLUME_NOT_UPGRADED __constant_cpu_to_le32(0xC000029C)
786#define STATUS_REMOTE_STORAGE_NOT_ACTIVE __constant_cpu_to_le32(0xC000029D)
787#define STATUS_REMOTE_STORAGE_MEDIA_ERROR __constant_cpu_to_le32(0xC000029E)
788#define STATUS_NO_TRACKING_SERVICE __constant_cpu_to_le32(0xC000029F)
789#define STATUS_SERVER_SID_MISMATCH __constant_cpu_to_le32(0xC00002A0)
790#define STATUS_DS_NO_ATTRIBUTE_OR_VALUE __constant_cpu_to_le32(0xC00002A1)
791#define STATUS_DS_INVALID_ATTRIBUTE_SYNTAX __constant_cpu_to_le32(0xC00002A2)
792#define STATUS_DS_ATTRIBUTE_TYPE_UNDEFINED __constant_cpu_to_le32(0xC00002A3)
793#define STATUS_DS_ATTRIBUTE_OR_VALUE_EXISTS __constant_cpu_to_le32(0xC00002A4)
794#define STATUS_DS_BUSY __constant_cpu_to_le32(0xC00002A5)
795#define STATUS_DS_UNAVAILABLE __constant_cpu_to_le32(0xC00002A6)
796#define STATUS_DS_NO_RIDS_ALLOCATED __constant_cpu_to_le32(0xC00002A7)
797#define STATUS_DS_NO_MORE_RIDS __constant_cpu_to_le32(0xC00002A8)
798#define STATUS_DS_INCORRECT_ROLE_OWNER __constant_cpu_to_le32(0xC00002A9)
799#define STATUS_DS_RIDMGR_INIT_ERROR __constant_cpu_to_le32(0xC00002AA)
800#define STATUS_DS_OBJ_CLASS_VIOLATION __constant_cpu_to_le32(0xC00002AB)
801#define STATUS_DS_CANT_ON_NON_LEAF __constant_cpu_to_le32(0xC00002AC)
802#define STATUS_DS_CANT_ON_RDN __constant_cpu_to_le32(0xC00002AD)
803#define STATUS_DS_CANT_MOD_OBJ_CLASS __constant_cpu_to_le32(0xC00002AE)
804#define STATUS_DS_CROSS_DOM_MOVE_FAILED __constant_cpu_to_le32(0xC00002AF)
805#define STATUS_DS_GC_NOT_AVAILABLE __constant_cpu_to_le32(0xC00002B0)
806#define STATUS_DIRECTORY_SERVICE_REQUIRED __constant_cpu_to_le32(0xC00002B1)
807#define STATUS_REPARSE_ATTRIBUTE_CONFLICT __constant_cpu_to_le32(0xC00002B2)
808#define STATUS_CANT_ENABLE_DENY_ONLY __constant_cpu_to_le32(0xC00002B3)
809#define STATUS_FLOAT_MULTIPLE_FAULTS __constant_cpu_to_le32(0xC00002B4)
810#define STATUS_FLOAT_MULTIPLE_TRAPS __constant_cpu_to_le32(0xC00002B5)
811#define STATUS_DEVICE_REMOVED __constant_cpu_to_le32(0xC00002B6)
812#define STATUS_JOURNAL_DELETE_IN_PROGRESS __constant_cpu_to_le32(0xC00002B7)
813#define STATUS_JOURNAL_NOT_ACTIVE __constant_cpu_to_le32(0xC00002B8)
814#define STATUS_NOINTERFACE __constant_cpu_to_le32(0xC00002B9)
815#define STATUS_DS_ADMIN_LIMIT_EXCEEDED __constant_cpu_to_le32(0xC00002C1)
816#define STATUS_DRIVER_FAILED_SLEEP __constant_cpu_to_le32(0xC00002C2)
817#define STATUS_MUTUAL_AUTHENTICATION_FAILED __constant_cpu_to_le32(0xC00002C3)
818#define STATUS_CORRUPT_SYSTEM_FILE __constant_cpu_to_le32(0xC00002C4)
819#define STATUS_DATATYPE_MISALIGNMENT_ERROR __constant_cpu_to_le32(0xC00002C5)
820#define STATUS_WMI_READ_ONLY __constant_cpu_to_le32(0xC00002C6)
821#define STATUS_WMI_SET_FAILURE __constant_cpu_to_le32(0xC00002C7)
822#define STATUS_COMMITMENT_MINIMUM __constant_cpu_to_le32(0xC00002C8)
823#define STATUS_REG_NAT_CONSUMPTION __constant_cpu_to_le32(0xC00002C9)
824#define STATUS_TRANSPORT_FULL __constant_cpu_to_le32(0xC00002CA)
825#define STATUS_DS_SAM_INIT_FAILURE __constant_cpu_to_le32(0xC00002CB)
826#define STATUS_ONLY_IF_CONNECTED __constant_cpu_to_le32(0xC00002CC)
827#define STATUS_DS_SENSITIVE_GROUP_VIOLATION __constant_cpu_to_le32(0xC00002CD)
828#define STATUS_PNP_RESTART_ENUMERATION __constant_cpu_to_le32(0xC00002CE)
829#define STATUS_JOURNAL_ENTRY_DELETED __constant_cpu_to_le32(0xC00002CF)
830#define STATUS_DS_CANT_MOD_PRIMARYGROUPID __constant_cpu_to_le32(0xC00002D0)
831#define STATUS_SYSTEM_IMAGE_BAD_SIGNATURE __constant_cpu_to_le32(0xC00002D1)
832#define STATUS_PNP_REBOOT_REQUIRED __constant_cpu_to_le32(0xC00002D2)
833#define STATUS_POWER_STATE_INVALID __constant_cpu_to_le32(0xC00002D3)
834#define STATUS_DS_INVALID_GROUP_TYPE __constant_cpu_to_le32(0xC00002D4)
835#define STATUS_DS_NO_NEST_GLOBALGROUP_IN_MIXEDDOMAIN __constant_cpu_to_le32(0xC00002D5)
836#define STATUS_DS_NO_NEST_LOCALGROUP_IN_MIXEDDOMAIN __constant_cpu_to_le32(0xC00002D6)
837#define STATUS_DS_GLOBAL_CANT_HAVE_LOCAL_MEMBER __constant_cpu_to_le32(0xC00002D7)
838#define STATUS_DS_GLOBAL_CANT_HAVE_UNIVERSAL_MEMBER __constant_cpu_to_le32(0xC00002D8)
839#define STATUS_DS_UNIVERSAL_CANT_HAVE_LOCAL_MEMBER __constant_cpu_to_le32(0xC00002D9)
840#define STATUS_DS_GLOBAL_CANT_HAVE_CROSSDOMAIN_MEMBER __constant_cpu_to_le32(0xC00002DA)
841#define STATUS_DS_LOCAL_CANT_HAVE_CROSSDOMAIN_LOCAL_MEMBER __constant_cpu_to_le32(0xC00002DB)
842#define STATUS_DS_HAVE_PRIMARY_MEMBERS __constant_cpu_to_le32(0xC00002DC)
843#define STATUS_WMI_NOT_SUPPORTED __constant_cpu_to_le32(0xC00002DD)
844#define STATUS_INSUFFICIENT_POWER __constant_cpu_to_le32(0xC00002DE)
845#define STATUS_SAM_NEED_BOOTKEY_PASSWORD __constant_cpu_to_le32(0xC00002DF)
846#define STATUS_SAM_NEED_BOOTKEY_FLOPPY __constant_cpu_to_le32(0xC00002E0)
847#define STATUS_DS_CANT_START __constant_cpu_to_le32(0xC00002E1)
848#define STATUS_DS_INIT_FAILURE __constant_cpu_to_le32(0xC00002E2)
849#define STATUS_SAM_INIT_FAILURE __constant_cpu_to_le32(0xC00002E3)
850#define STATUS_DS_GC_REQUIRED __constant_cpu_to_le32(0xC00002E4)
851#define STATUS_DS_LOCAL_MEMBER_OF_LOCAL_ONLY __constant_cpu_to_le32(0xC00002E5)
852#define STATUS_DS_NO_FPO_IN_UNIVERSAL_GROUPS __constant_cpu_to_le32(0xC00002E6)
853#define STATUS_DS_MACHINE_ACCOUNT_QUOTA_EXCEEDED __constant_cpu_to_le32(0xC00002E7)
854#define STATUS_MULTIPLE_FAULT_VIOLATION __constant_cpu_to_le32(0xC00002E8)
855#define STATUS_CURRENT_DOMAIN_NOT_ALLOWED __constant_cpu_to_le32(0xC00002E9)
856#define STATUS_CANNOT_MAKE __constant_cpu_to_le32(0xC00002EA)
857#define STATUS_SYSTEM_SHUTDOWN __constant_cpu_to_le32(0xC00002EB)
858#define STATUS_DS_INIT_FAILURE_CONSOLE __constant_cpu_to_le32(0xC00002EC)
859#define STATUS_DS_SAM_INIT_FAILURE_CONSOLE __constant_cpu_to_le32(0xC00002ED)
860#define STATUS_UNFINISHED_CONTEXT_DELETED __constant_cpu_to_le32(0xC00002EE)
861#define STATUS_NO_TGT_REPLY __constant_cpu_to_le32(0xC00002EF)
862#define STATUS_OBJECTID_NOT_FOUND __constant_cpu_to_le32(0xC00002F0)
863#define STATUS_NO_IP_ADDRESSES __constant_cpu_to_le32(0xC00002F1)
864#define STATUS_WRONG_CREDENTIAL_HANDLE __constant_cpu_to_le32(0xC00002F2)
865#define STATUS_CRYPTO_SYSTEM_INVALID __constant_cpu_to_le32(0xC00002F3)
866#define STATUS_MAX_REFERRALS_EXCEEDED __constant_cpu_to_le32(0xC00002F4)
867#define STATUS_MUST_BE_KDC __constant_cpu_to_le32(0xC00002F5)
868#define STATUS_STRONG_CRYPTO_NOT_SUPPORTED __constant_cpu_to_le32(0xC00002F6)
869#define STATUS_TOO_MANY_PRINCIPALS __constant_cpu_to_le32(0xC00002F7)
870#define STATUS_NO_PA_DATA __constant_cpu_to_le32(0xC00002F8)
871#define STATUS_PKINIT_NAME_MISMATCH __constant_cpu_to_le32(0xC00002F9)
872#define STATUS_SMARTCARD_LOGON_REQUIRED __constant_cpu_to_le32(0xC00002FA)
873#define STATUS_KDC_INVALID_REQUEST __constant_cpu_to_le32(0xC00002FB)
874#define STATUS_KDC_UNABLE_TO_REFER __constant_cpu_to_le32(0xC00002FC)
875#define STATUS_KDC_UNKNOWN_ETYPE __constant_cpu_to_le32(0xC00002FD)
876#define STATUS_SHUTDOWN_IN_PROGRESS __constant_cpu_to_le32(0xC00002FE)
877#define STATUS_SERVER_SHUTDOWN_IN_PROGRESS __constant_cpu_to_le32(0xC00002FF)
878#define STATUS_NOT_SUPPORTED_ON_SBS __constant_cpu_to_le32(0xC0000300)
879#define STATUS_WMI_GUID_DISCONNECTED __constant_cpu_to_le32(0xC0000301)
880#define STATUS_WMI_ALREADY_DISABLED __constant_cpu_to_le32(0xC0000302)
881#define STATUS_WMI_ALREADY_ENABLED __constant_cpu_to_le32(0xC0000303)
882#define STATUS_MFT_TOO_FRAGMENTED __constant_cpu_to_le32(0xC0000304)
883#define STATUS_COPY_PROTECTION_FAILURE __constant_cpu_to_le32(0xC0000305)
884#define STATUS_CSS_AUTHENTICATION_FAILURE __constant_cpu_to_le32(0xC0000306)
885#define STATUS_CSS_KEY_NOT_PRESENT __constant_cpu_to_le32(0xC0000307)
886#define STATUS_CSS_KEY_NOT_ESTABLISHED __constant_cpu_to_le32(0xC0000308)
887#define STATUS_CSS_SCRAMBLED_SECTOR __constant_cpu_to_le32(0xC0000309)
888#define STATUS_CSS_REGION_MISMATCH __constant_cpu_to_le32(0xC000030A)
889#define STATUS_CSS_RESETS_EXHAUSTED __constant_cpu_to_le32(0xC000030B)
890#define STATUS_PKINIT_FAILURE __constant_cpu_to_le32(0xC0000320)
891#define STATUS_SMARTCARD_SUBSYSTEM_FAILURE __constant_cpu_to_le32(0xC0000321)
892#define STATUS_NO_KERB_KEY __constant_cpu_to_le32(0xC0000322)
893#define STATUS_HOST_DOWN __constant_cpu_to_le32(0xC0000350)
894#define STATUS_UNSUPPORTED_PREAUTH __constant_cpu_to_le32(0xC0000351)
895#define STATUS_EFS_ALG_BLOB_TOO_BIG __constant_cpu_to_le32(0xC0000352)
896#define STATUS_PORT_NOT_SET __constant_cpu_to_le32(0xC0000353)
897#define STATUS_DEBUGGER_INACTIVE __constant_cpu_to_le32(0xC0000354)
898#define STATUS_DS_VERSION_CHECK_FAILURE __constant_cpu_to_le32(0xC0000355)
899#define STATUS_AUDITING_DISABLED __constant_cpu_to_le32(0xC0000356)
900#define STATUS_PRENT4_MACHINE_ACCOUNT __constant_cpu_to_le32(0xC0000357)
901#define STATUS_DS_AG_CANT_HAVE_UNIVERSAL_MEMBER __constant_cpu_to_le32(0xC0000358)
902#define STATUS_INVALID_IMAGE_WIN_32 __constant_cpu_to_le32(0xC0000359)
903#define STATUS_INVALID_IMAGE_WIN_64 __constant_cpu_to_le32(0xC000035A)
904#define STATUS_BAD_BINDINGS __constant_cpu_to_le32(0xC000035B)
905#define STATUS_NETWORK_SESSION_EXPIRED __constant_cpu_to_le32(0xC000035C)
906#define STATUS_APPHELP_BLOCK __constant_cpu_to_le32(0xC000035D)
907#define STATUS_ALL_SIDS_FILTERED __constant_cpu_to_le32(0xC000035E)
908#define STATUS_NOT_SAFE_MODE_DRIVER __constant_cpu_to_le32(0xC000035F)
909#define STATUS_ACCESS_DISABLED_BY_POLICY_DEFAULT __constant_cpu_to_le32(0xC0000361)
910#define STATUS_ACCESS_DISABLED_BY_POLICY_PATH __constant_cpu_to_le32(0xC0000362)
911#define STATUS_ACCESS_DISABLED_BY_POLICY_PUBLISHER __constant_cpu_to_le32(0xC0000363)
912#define STATUS_ACCESS_DISABLED_BY_POLICY_OTHER __constant_cpu_to_le32(0xC0000364)
913#define STATUS_FAILED_DRIVER_ENTRY __constant_cpu_to_le32(0xC0000365)
914#define STATUS_DEVICE_ENUMERATION_ERROR __constant_cpu_to_le32(0xC0000366)
915#define STATUS_MOUNT_POINT_NOT_RESOLVED __constant_cpu_to_le32(0xC0000368)
916#define STATUS_INVALID_DEVICE_OBJECT_PARAMETER __constant_cpu_to_le32(0xC0000369)
917#define STATUS_MCA_OCCURED __constant_cpu_to_le32(0xC000036A)
918#define STATUS_DRIVER_BLOCKED_CRITICAL __constant_cpu_to_le32(0xC000036B)
919#define STATUS_DRIVER_BLOCKED __constant_cpu_to_le32(0xC000036C)
920#define STATUS_DRIVER_DATABASE_ERROR __constant_cpu_to_le32(0xC000036D)
921#define STATUS_SYSTEM_HIVE_TOO_LARGE __constant_cpu_to_le32(0xC000036E)
922#define STATUS_INVALID_IMPORT_OF_NON_DLL __constant_cpu_to_le32(0xC000036F)
923#define STATUS_NO_SECRETS __constant_cpu_to_le32(0xC0000371)
924#define STATUS_ACCESS_DISABLED_NO_SAFER_UI_BY_POLICY __constant_cpu_to_le32(0xC0000372)
925#define STATUS_FAILED_STACK_SWITCH __constant_cpu_to_le32(0xC0000373)
926#define STATUS_HEAP_CORRUPTION __constant_cpu_to_le32(0xC0000374)
927#define STATUS_SMARTCARD_WRONG_PIN __constant_cpu_to_le32(0xC0000380)
928#define STATUS_SMARTCARD_CARD_BLOCKED __constant_cpu_to_le32(0xC0000381)
929#define STATUS_SMARTCARD_CARD_NOT_AUTHENTICATED __constant_cpu_to_le32(0xC0000382)
930#define STATUS_SMARTCARD_NO_CARD __constant_cpu_to_le32(0xC0000383)
931#define STATUS_SMARTCARD_NO_KEY_CONTAINER __constant_cpu_to_le32(0xC0000384)
932#define STATUS_SMARTCARD_NO_CERTIFICATE __constant_cpu_to_le32(0xC0000385)
933#define STATUS_SMARTCARD_NO_KEYSET __constant_cpu_to_le32(0xC0000386)
934#define STATUS_SMARTCARD_IO_ERROR __constant_cpu_to_le32(0xC0000387)
935#define STATUS_DOWNGRADE_DETECTED __constant_cpu_to_le32(0xC0000388)
936#define STATUS_SMARTCARD_CERT_REVOKED __constant_cpu_to_le32(0xC0000389)
937#define STATUS_ISSUING_CA_UNTRUSTED __constant_cpu_to_le32(0xC000038A)
938#define STATUS_REVOCATION_OFFLINE_C __constant_cpu_to_le32(0xC000038B)
939#define STATUS_PKINIT_CLIENT_FAILURE __constant_cpu_to_le32(0xC000038C)
940#define STATUS_SMARTCARD_CERT_EXPIRED __constant_cpu_to_le32(0xC000038D)
941#define STATUS_DRIVER_FAILED_PRIOR_UNLOAD __constant_cpu_to_le32(0xC000038E)
942#define STATUS_SMARTCARD_SILENT_CONTEXT __constant_cpu_to_le32(0xC000038F)
943#define STATUS_PER_USER_TRUST_QUOTA_EXCEEDED __constant_cpu_to_le32(0xC0000401)
944#define STATUS_ALL_USER_TRUST_QUOTA_EXCEEDED __constant_cpu_to_le32(0xC0000402)
945#define STATUS_USER_DELETE_TRUST_QUOTA_EXCEEDED __constant_cpu_to_le32(0xC0000403)
946#define STATUS_DS_NAME_NOT_UNIQUE __constant_cpu_to_le32(0xC0000404)
947#define STATUS_DS_DUPLICATE_ID_FOUND __constant_cpu_to_le32(0xC0000405)
948#define STATUS_DS_GROUP_CONVERSION_ERROR __constant_cpu_to_le32(0xC0000406)
949#define STATUS_VOLSNAP_PREPARE_HIBERNATE __constant_cpu_to_le32(0xC0000407)
950#define STATUS_USER2USER_REQUIRED __constant_cpu_to_le32(0xC0000408)
951#define STATUS_STACK_BUFFER_OVERRUN __constant_cpu_to_le32(0xC0000409)
952#define STATUS_NO_S4U_PROT_SUPPORT __constant_cpu_to_le32(0xC000040A)
953#define STATUS_CROSSREALM_DELEGATION_FAILURE __constant_cpu_to_le32(0xC000040B)
954#define STATUS_REVOCATION_OFFLINE_KDC __constant_cpu_to_le32(0xC000040C)
955#define STATUS_ISSUING_CA_UNTRUSTED_KDC __constant_cpu_to_le32(0xC000040D)
956#define STATUS_KDC_CERT_EXPIRED __constant_cpu_to_le32(0xC000040E)
957#define STATUS_KDC_CERT_REVOKED __constant_cpu_to_le32(0xC000040F)
958#define STATUS_PARAMETER_QUOTA_EXCEEDED __constant_cpu_to_le32(0xC0000410)
959#define STATUS_HIBERNATION_FAILURE __constant_cpu_to_le32(0xC0000411)
960#define STATUS_DELAY_LOAD_FAILED __constant_cpu_to_le32(0xC0000412)
961#define STATUS_AUTHENTICATION_FIREWALL_FAILED __constant_cpu_to_le32(0xC0000413)
962#define STATUS_VDM_DISALLOWED __constant_cpu_to_le32(0xC0000414)
963#define STATUS_HUNG_DISPLAY_DRIVER_THREAD __constant_cpu_to_le32(0xC0000415)
964#define STATUS_INSUFFICIENT_RESOURCE_FOR_SPECIFIED_SHARED_SECTION_SIZE __constant_cpu_to_le32(0xC0000416)
965#define STATUS_INVALID_CRUNTIME_PARAMETER __constant_cpu_to_le32(0xC0000417)
966#define STATUS_NTLM_BLOCKED __constant_cpu_to_le32(0xC0000418)
967#define STATUS_ASSERTION_FAILURE __constant_cpu_to_le32(0xC0000420)
968#define STATUS_VERIFIER_STOP __constant_cpu_to_le32(0xC0000421)
969#define STATUS_CALLBACK_POP_STACK __constant_cpu_to_le32(0xC0000423)
970#define STATUS_INCOMPATIBLE_DRIVER_BLOCKED __constant_cpu_to_le32(0xC0000424)
971#define STATUS_HIVE_UNLOADED __constant_cpu_to_le32(0xC0000425)
972#define STATUS_COMPRESSION_DISABLED __constant_cpu_to_le32(0xC0000426)
973#define STATUS_FILE_SYSTEM_LIMITATION __constant_cpu_to_le32(0xC0000427)
974#define STATUS_INVALID_IMAGE_HASH __constant_cpu_to_le32(0xC0000428)
975#define STATUS_NOT_CAPABLE __constant_cpu_to_le32(0xC0000429)
976#define STATUS_REQUEST_OUT_OF_SEQUENCE __constant_cpu_to_le32(0xC000042A)
977#define STATUS_IMPLEMENTATION_LIMIT __constant_cpu_to_le32(0xC000042B)
978#define STATUS_ELEVATION_REQUIRED __constant_cpu_to_le32(0xC000042C)
979#define STATUS_BEYOND_VDL __constant_cpu_to_le32(0xC0000432)
980#define STATUS_ENCOUNTERED_WRITE_IN_PROGRESS __constant_cpu_to_le32(0xC0000433)
981#define STATUS_PTE_CHANGED __constant_cpu_to_le32(0xC0000434)
982#define STATUS_PURGE_FAILED __constant_cpu_to_le32(0xC0000435)
983#define STATUS_CRED_REQUIRES_CONFIRMATION __constant_cpu_to_le32(0xC0000440)
984#define STATUS_CS_ENCRYPTION_INVALID_SERVER_RESPONSE __constant_cpu_to_le32(0xC0000441)
985#define STATUS_CS_ENCRYPTION_UNSUPPORTED_SERVER __constant_cpu_to_le32(0xC0000442)
986#define STATUS_CS_ENCRYPTION_EXISTING_ENCRYPTED_FILE __constant_cpu_to_le32(0xC0000443)
987#define STATUS_CS_ENCRYPTION_NEW_ENCRYPTED_FILE __constant_cpu_to_le32(0xC0000444)
988#define STATUS_CS_ENCRYPTION_FILE_NOT_CSE __constant_cpu_to_le32(0xC0000445)
989#define STATUS_INVALID_LABEL __constant_cpu_to_le32(0xC0000446)
990#define STATUS_DRIVER_PROCESS_TERMINATED __constant_cpu_to_le32(0xC0000450)
991#define STATUS_AMBIGUOUS_SYSTEM_DEVICE __constant_cpu_to_le32(0xC0000451)
992#define STATUS_SYSTEM_DEVICE_NOT_FOUND __constant_cpu_to_le32(0xC0000452)
993#define STATUS_RESTART_BOOT_APPLICATION __constant_cpu_to_le32(0xC0000453)
994#define STATUS_INVALID_TASK_NAME __constant_cpu_to_le32(0xC0000500)
995#define STATUS_INVALID_TASK_INDEX __constant_cpu_to_le32(0xC0000501)
996#define STATUS_THREAD_ALREADY_IN_TASK __constant_cpu_to_le32(0xC0000502)
997#define STATUS_CALLBACK_BYPASS __constant_cpu_to_le32(0xC0000503)
998#define STATUS_PORT_CLOSED __constant_cpu_to_le32(0xC0000700)
999#define STATUS_MESSAGE_LOST __constant_cpu_to_le32(0xC0000701)
1000#define STATUS_INVALID_MESSAGE __constant_cpu_to_le32(0xC0000702)
1001#define STATUS_REQUEST_CANCELED __constant_cpu_to_le32(0xC0000703)
1002#define STATUS_RECURSIVE_DISPATCH __constant_cpu_to_le32(0xC0000704)
1003#define STATUS_LPC_RECEIVE_BUFFER_EXPECTED __constant_cpu_to_le32(0xC0000705)
1004#define STATUS_LPC_INVALID_CONNECTION_USAGE __constant_cpu_to_le32(0xC0000706)
1005#define STATUS_LPC_REQUESTS_NOT_ALLOWED __constant_cpu_to_le32(0xC0000707)
1006#define STATUS_RESOURCE_IN_USE __constant_cpu_to_le32(0xC0000708)
1007#define STATUS_HARDWARE_MEMORY_ERROR __constant_cpu_to_le32(0xC0000709)
1008#define STATUS_THREADPOOL_HANDLE_EXCEPTION __constant_cpu_to_le32(0xC000070A)
1009#define STATUS_THREADPOOL_SET_EVENT_ON_COMPLETION_FAILED __constant_cpu_to_le32(0xC000070B)
1010#define STATUS_THREADPOOL_RELEASE_SEMAPHORE_ON_COMPLETION_FAILED __constant_cpu_to_le32(0xC000070C)
1011#define STATUS_THREADPOOL_RELEASE_MUTEX_ON_COMPLETION_FAILED __constant_cpu_to_le32(0xC000070D)
1012#define STATUS_THREADPOOL_FREE_LIBRARY_ON_COMPLETION_FAILED __constant_cpu_to_le32(0xC000070E)
1013#define STATUS_THREADPOOL_RELEASED_DURING_OPERATION __constant_cpu_to_le32(0xC000070F)
1014#define STATUS_CALLBACK_RETURNED_WHILE_IMPERSONATING __constant_cpu_to_le32(0xC0000710)
1015#define STATUS_APC_RETURNED_WHILE_IMPERSONATING __constant_cpu_to_le32(0xC0000711)
1016#define STATUS_PROCESS_IS_PROTECTED __constant_cpu_to_le32(0xC0000712)
1017#define STATUS_MCA_EXCEPTION __constant_cpu_to_le32(0xC0000713)
1018#define STATUS_CERTIFICATE_MAPPING_NOT_UNIQUE __constant_cpu_to_le32(0xC0000714)
1019#define STATUS_SYMLINK_CLASS_DISABLED __constant_cpu_to_le32(0xC0000715)
1020#define STATUS_INVALID_IDN_NORMALIZATION __constant_cpu_to_le32(0xC0000716)
1021#define STATUS_NO_UNICODE_TRANSLATION __constant_cpu_to_le32(0xC0000717)
1022#define STATUS_ALREADY_REGISTERED __constant_cpu_to_le32(0xC0000718)
1023#define STATUS_CONTEXT_MISMATCH __constant_cpu_to_le32(0xC0000719)
1024#define STATUS_PORT_ALREADY_HAS_COMPLETION_LIST __constant_cpu_to_le32(0xC000071A)
1025#define STATUS_CALLBACK_RETURNED_THREAD_PRIORITY __constant_cpu_to_le32(0xC000071B)
1026#define STATUS_INVALID_THREAD __constant_cpu_to_le32(0xC000071C)
1027#define STATUS_CALLBACK_RETURNED_TRANSACTION __constant_cpu_to_le32(0xC000071D)
1028#define STATUS_CALLBACK_RETURNED_LDR_LOCK __constant_cpu_to_le32(0xC000071E)
1029#define STATUS_CALLBACK_RETURNED_LANG __constant_cpu_to_le32(0xC000071F)
1030#define STATUS_CALLBACK_RETURNED_PRI_BACK __constant_cpu_to_le32(0xC0000720)
1031#define STATUS_CALLBACK_RETURNED_THREAD_AFFINITY __constant_cpu_to_le32(0xC0000721)
1032#define STATUS_DISK_REPAIR_DISABLED __constant_cpu_to_le32(0xC0000800)
1033#define STATUS_DS_DOMAIN_RENAME_IN_PROGRESS __constant_cpu_to_le32(0xC0000801)
1034#define STATUS_DISK_QUOTA_EXCEEDED __constant_cpu_to_le32(0xC0000802)
1035#define STATUS_CONTENT_BLOCKED __constant_cpu_to_le32(0xC0000804)
1036#define STATUS_BAD_CLUSTERS __constant_cpu_to_le32(0xC0000805)
1037#define STATUS_VOLUME_DIRTY __constant_cpu_to_le32(0xC0000806)
1038#define STATUS_FILE_CHECKED_OUT __constant_cpu_to_le32(0xC0000901)
1039#define STATUS_CHECKOUT_REQUIRED __constant_cpu_to_le32(0xC0000902)
1040#define STATUS_BAD_FILE_TYPE __constant_cpu_to_le32(0xC0000903)
1041#define STATUS_FILE_TOO_LARGE __constant_cpu_to_le32(0xC0000904)
1042#define STATUS_FORMS_AUTH_REQUIRED __constant_cpu_to_le32(0xC0000905)
1043#define STATUS_VIRUS_INFECTED __constant_cpu_to_le32(0xC0000906)
1044#define STATUS_VIRUS_DELETED __constant_cpu_to_le32(0xC0000907)
1045#define STATUS_BAD_MCFG_TABLE __constant_cpu_to_le32(0xC0000908)
1046#define STATUS_WOW_ASSERTION __constant_cpu_to_le32(0xC0009898)
1047#define STATUS_INVALID_SIGNATURE __constant_cpu_to_le32(0xC000A000)
1048#define STATUS_HMAC_NOT_SUPPORTED __constant_cpu_to_le32(0xC000A001)
1049#define STATUS_IPSEC_QUEUE_OVERFLOW __constant_cpu_to_le32(0xC000A010)
1050#define STATUS_ND_QUEUE_OVERFLOW __constant_cpu_to_le32(0xC000A011)
1051#define STATUS_HOPLIMIT_EXCEEDED __constant_cpu_to_le32(0xC000A012)
1052#define STATUS_PROTOCOL_NOT_SUPPORTED __constant_cpu_to_le32(0xC000A013)
1053#define STATUS_LOST_WRITEBEHIND_DATA_NETWORK_DISCONNECTED __constant_cpu_to_le32(0xC000A080)
1054#define STATUS_LOST_WRITEBEHIND_DATA_NETWORK_SERVER_ERROR __constant_cpu_to_le32(0xC000A081)
1055#define STATUS_LOST_WRITEBEHIND_DATA_LOCAL_DISK_ERROR __constant_cpu_to_le32(0xC000A082)
1056#define STATUS_XML_PARSE_ERROR __constant_cpu_to_le32(0xC000A083)
1057#define STATUS_XMLDSIG_ERROR __constant_cpu_to_le32(0xC000A084)
1058#define STATUS_WRONG_COMPARTMENT __constant_cpu_to_le32(0xC000A085)
1059#define STATUS_AUTHIP_FAILURE __constant_cpu_to_le32(0xC000A086)
1060#define DBG_NO_STATE_CHANGE __constant_cpu_to_le32(0xC0010001)
1061#define DBG_APP_NOT_IDLE __constant_cpu_to_le32(0xC0010002)
1062#define RPC_NT_INVALID_STRING_BINDING __constant_cpu_to_le32(0xC0020001)
1063#define RPC_NT_WRONG_KIND_OF_BINDING __constant_cpu_to_le32(0xC0020002)
1064#define RPC_NT_INVALID_BINDING __constant_cpu_to_le32(0xC0020003)
1065#define RPC_NT_PROTSEQ_NOT_SUPPORTED __constant_cpu_to_le32(0xC0020004)
1066#define RPC_NT_INVALID_RPC_PROTSEQ __constant_cpu_to_le32(0xC0020005)
1067#define RPC_NT_INVALID_STRING_UUID __constant_cpu_to_le32(0xC0020006)
1068#define RPC_NT_INVALID_ENDPOINT_FORMAT __constant_cpu_to_le32(0xC0020007)
1069#define RPC_NT_INVALID_NET_ADDR __constant_cpu_to_le32(0xC0020008)
1070#define RPC_NT_NO_ENDPOINT_FOUND __constant_cpu_to_le32(0xC0020009)
1071#define RPC_NT_INVALID_TIMEOUT __constant_cpu_to_le32(0xC002000A)
1072#define RPC_NT_OBJECT_NOT_FOUND __constant_cpu_to_le32(0xC002000B)
1073#define RPC_NT_ALREADY_REGISTERED __constant_cpu_to_le32(0xC002000C)
1074#define RPC_NT_TYPE_ALREADY_REGISTERED __constant_cpu_to_le32(0xC002000D)
1075#define RPC_NT_ALREADY_LISTENING __constant_cpu_to_le32(0xC002000E)
1076#define RPC_NT_NO_PROTSEQS_REGISTERED __constant_cpu_to_le32(0xC002000F)
1077#define RPC_NT_NOT_LISTENING __constant_cpu_to_le32(0xC0020010)
1078#define RPC_NT_UNKNOWN_MGR_TYPE __constant_cpu_to_le32(0xC0020011)
1079#define RPC_NT_UNKNOWN_IF __constant_cpu_to_le32(0xC0020012)
1080#define RPC_NT_NO_BINDINGS __constant_cpu_to_le32(0xC0020013)
1081#define RPC_NT_NO_PROTSEQS __constant_cpu_to_le32(0xC0020014)
1082#define RPC_NT_CANT_CREATE_ENDPOINT __constant_cpu_to_le32(0xC0020015)
1083#define RPC_NT_OUT_OF_RESOURCES __constant_cpu_to_le32(0xC0020016)
1084#define RPC_NT_SERVER_UNAVAILABLE __constant_cpu_to_le32(0xC0020017)
1085#define RPC_NT_SERVER_TOO_BUSY __constant_cpu_to_le32(0xC0020018)
1086#define RPC_NT_INVALID_NETWORK_OPTIONS __constant_cpu_to_le32(0xC0020019)
1087#define RPC_NT_NO_CALL_ACTIVE __constant_cpu_to_le32(0xC002001A)
1088#define RPC_NT_CALL_FAILED __constant_cpu_to_le32(0xC002001B)
1089#define RPC_NT_CALL_FAILED_DNE __constant_cpu_to_le32(0xC002001C)
1090#define RPC_NT_PROTOCOL_ERROR __constant_cpu_to_le32(0xC002001D)
1091#define RPC_NT_UNSUPPORTED_TRANS_SYN __constant_cpu_to_le32(0xC002001F)
1092#define RPC_NT_UNSUPPORTED_TYPE __constant_cpu_to_le32(0xC0020021)
1093#define RPC_NT_INVALID_TAG __constant_cpu_to_le32(0xC0020022)
1094#define RPC_NT_INVALID_BOUND __constant_cpu_to_le32(0xC0020023)
1095#define RPC_NT_NO_ENTRY_NAME __constant_cpu_to_le32(0xC0020024)
1096#define RPC_NT_INVALID_NAME_SYNTAX __constant_cpu_to_le32(0xC0020025)
1097#define RPC_NT_UNSUPPORTED_NAME_SYNTAX __constant_cpu_to_le32(0xC0020026)
1098#define RPC_NT_UUID_NO_ADDRESS __constant_cpu_to_le32(0xC0020028)
1099#define RPC_NT_DUPLICATE_ENDPOINT __constant_cpu_to_le32(0xC0020029)
1100#define RPC_NT_UNKNOWN_AUTHN_TYPE __constant_cpu_to_le32(0xC002002A)
1101#define RPC_NT_MAX_CALLS_TOO_SMALL __constant_cpu_to_le32(0xC002002B)
1102#define RPC_NT_STRING_TOO_LONG __constant_cpu_to_le32(0xC002002C)
1103#define RPC_NT_PROTSEQ_NOT_FOUND __constant_cpu_to_le32(0xC002002D)
1104#define RPC_NT_PROCNUM_OUT_OF_RANGE __constant_cpu_to_le32(0xC002002E)
1105#define RPC_NT_BINDING_HAS_NO_AUTH __constant_cpu_to_le32(0xC002002F)
1106#define RPC_NT_UNKNOWN_AUTHN_SERVICE __constant_cpu_to_le32(0xC0020030)
1107#define RPC_NT_UNKNOWN_AUTHN_LEVEL __constant_cpu_to_le32(0xC0020031)
1108#define RPC_NT_INVALID_AUTH_IDENTITY __constant_cpu_to_le32(0xC0020032)
1109#define RPC_NT_UNKNOWN_AUTHZ_SERVICE __constant_cpu_to_le32(0xC0020033)
1110#define EPT_NT_INVALID_ENTRY __constant_cpu_to_le32(0xC0020034)
1111#define EPT_NT_CANT_PERFORM_OP __constant_cpu_to_le32(0xC0020035)
1112#define EPT_NT_NOT_REGISTERED __constant_cpu_to_le32(0xC0020036)
1113#define RPC_NT_NOTHING_TO_EXPORT __constant_cpu_to_le32(0xC0020037)
1114#define RPC_NT_INCOMPLETE_NAME __constant_cpu_to_le32(0xC0020038)
1115#define RPC_NT_INVALID_VERS_OPTION __constant_cpu_to_le32(0xC0020039)
1116#define RPC_NT_NO_MORE_MEMBERS __constant_cpu_to_le32(0xC002003A)
1117#define RPC_NT_NOT_ALL_OBJS_UNEXPORTED __constant_cpu_to_le32(0xC002003B)
1118#define RPC_NT_INTERFACE_NOT_FOUND __constant_cpu_to_le32(0xC002003C)
1119#define RPC_NT_ENTRY_ALREADY_EXISTS __constant_cpu_to_le32(0xC002003D)
1120#define RPC_NT_ENTRY_NOT_FOUND __constant_cpu_to_le32(0xC002003E)
1121#define RPC_NT_NAME_SERVICE_UNAVAILABLE __constant_cpu_to_le32(0xC002003F)
1122#define RPC_NT_INVALID_NAF_ID __constant_cpu_to_le32(0xC0020040)
1123#define RPC_NT_CANNOT_SUPPORT __constant_cpu_to_le32(0xC0020041)
1124#define RPC_NT_NO_CONTEXT_AVAILABLE __constant_cpu_to_le32(0xC0020042)
1125#define RPC_NT_INTERNAL_ERROR __constant_cpu_to_le32(0xC0020043)
1126#define RPC_NT_ZERO_DIVIDE __constant_cpu_to_le32(0xC0020044)
1127#define RPC_NT_ADDRESS_ERROR __constant_cpu_to_le32(0xC0020045)
1128#define RPC_NT_FP_DIV_ZERO __constant_cpu_to_le32(0xC0020046)
1129#define RPC_NT_FP_UNDERFLOW __constant_cpu_to_le32(0xC0020047)
1130#define RPC_NT_FP_OVERFLOW __constant_cpu_to_le32(0xC0020048)
1131#define RPC_NT_CALL_IN_PROGRESS __constant_cpu_to_le32(0xC0020049)
1132#define RPC_NT_NO_MORE_BINDINGS __constant_cpu_to_le32(0xC002004A)
1133#define RPC_NT_GROUP_MEMBER_NOT_FOUND __constant_cpu_to_le32(0xC002004B)
1134#define EPT_NT_CANT_CREATE __constant_cpu_to_le32(0xC002004C)
1135#define RPC_NT_INVALID_OBJECT __constant_cpu_to_le32(0xC002004D)
1136#define RPC_NT_NO_INTERFACES __constant_cpu_to_le32(0xC002004F)
1137#define RPC_NT_CALL_CANCELLED __constant_cpu_to_le32(0xC0020050)
1138#define RPC_NT_BINDING_INCOMPLETE __constant_cpu_to_le32(0xC0020051)
1139#define RPC_NT_COMM_FAILURE __constant_cpu_to_le32(0xC0020052)
1140#define RPC_NT_UNSUPPORTED_AUTHN_LEVEL __constant_cpu_to_le32(0xC0020053)
1141#define RPC_NT_NO_PRINC_NAME __constant_cpu_to_le32(0xC0020054)
1142#define RPC_NT_NOT_RPC_ERROR __constant_cpu_to_le32(0xC0020055)
1143#define RPC_NT_SEC_PKG_ERROR __constant_cpu_to_le32(0xC0020057)
1144#define RPC_NT_NOT_CANCELLED __constant_cpu_to_le32(0xC0020058)
1145#define RPC_NT_INVALID_ASYNC_HANDLE __constant_cpu_to_le32(0xC0020062)
1146#define RPC_NT_INVALID_ASYNC_CALL __constant_cpu_to_le32(0xC0020063)
1147#define RPC_NT_PROXY_ACCESS_DENIED __constant_cpu_to_le32(0xC0020064)
1148#define RPC_NT_NO_MORE_ENTRIES __constant_cpu_to_le32(0xC0030001)
1149#define RPC_NT_SS_CHAR_TRANS_OPEN_FAIL __constant_cpu_to_le32(0xC0030002)
1150#define RPC_NT_SS_CHAR_TRANS_SHORT_FILE __constant_cpu_to_le32(0xC0030003)
1151#define RPC_NT_SS_IN_NULL_CONTEXT __constant_cpu_to_le32(0xC0030004)
1152#define RPC_NT_SS_CONTEXT_MISMATCH __constant_cpu_to_le32(0xC0030005)
1153#define RPC_NT_SS_CONTEXT_DAMAGED __constant_cpu_to_le32(0xC0030006)
1154#define RPC_NT_SS_HANDLES_MISMATCH __constant_cpu_to_le32(0xC0030007)
1155#define RPC_NT_SS_CANNOT_GET_CALL_HANDLE __constant_cpu_to_le32(0xC0030008)
1156#define RPC_NT_NULL_REF_POINTER __constant_cpu_to_le32(0xC0030009)
1157#define RPC_NT_ENUM_VALUE_OUT_OF_RANGE __constant_cpu_to_le32(0xC003000A)
1158#define RPC_NT_BYTE_COUNT_TOO_SMALL __constant_cpu_to_le32(0xC003000B)
1159#define RPC_NT_BAD_STUB_DATA __constant_cpu_to_le32(0xC003000C)
1160#define RPC_NT_INVALID_ES_ACTION __constant_cpu_to_le32(0xC0030059)
1161#define RPC_NT_WRONG_ES_VERSION __constant_cpu_to_le32(0xC003005A)
1162#define RPC_NT_WRONG_STUB_VERSION __constant_cpu_to_le32(0xC003005B)
1163#define RPC_NT_INVALID_PIPE_OBJECT __constant_cpu_to_le32(0xC003005C)
1164#define RPC_NT_INVALID_PIPE_OPERATION __constant_cpu_to_le32(0xC003005D)
1165#define RPC_NT_WRONG_PIPE_VERSION __constant_cpu_to_le32(0xC003005E)
1166#define RPC_NT_PIPE_CLOSED __constant_cpu_to_le32(0xC003005F)
1167#define RPC_NT_PIPE_DISCIPLINE_ERROR __constant_cpu_to_le32(0xC0030060)
1168#define RPC_NT_PIPE_EMPTY __constant_cpu_to_le32(0xC0030061)
1169#define STATUS_PNP_BAD_MPS_TABLE __constant_cpu_to_le32(0xC0040035)
1170#define STATUS_PNP_TRANSLATION_FAILED __constant_cpu_to_le32(0xC0040036)
1171#define STATUS_PNP_IRQ_TRANSLATION_FAILED __constant_cpu_to_le32(0xC0040037)
1172#define STATUS_PNP_INVALID_ID __constant_cpu_to_le32(0xC0040038)
1173#define STATUS_IO_REISSUE_AS_CACHED __constant_cpu_to_le32(0xC0040039)
1174#define STATUS_CTX_WINSTATION_NAME_INVALID __constant_cpu_to_le32(0xC00A0001)
1175#define STATUS_CTX_INVALID_PD __constant_cpu_to_le32(0xC00A0002)
1176#define STATUS_CTX_PD_NOT_FOUND __constant_cpu_to_le32(0xC00A0003)
1177#define STATUS_CTX_CLOSE_PENDING __constant_cpu_to_le32(0xC00A0006)
1178#define STATUS_CTX_NO_OUTBUF __constant_cpu_to_le32(0xC00A0007)
1179#define STATUS_CTX_MODEM_INF_NOT_FOUND __constant_cpu_to_le32(0xC00A0008)
1180#define STATUS_CTX_INVALID_MODEMNAME __constant_cpu_to_le32(0xC00A0009)
1181#define STATUS_CTX_RESPONSE_ERROR __constant_cpu_to_le32(0xC00A000A)
1182#define STATUS_CTX_MODEM_RESPONSE_TIMEOUT __constant_cpu_to_le32(0xC00A000B)
1183#define STATUS_CTX_MODEM_RESPONSE_NO_CARRIER __constant_cpu_to_le32(0xC00A000C)
1184#define STATUS_CTX_MODEM_RESPONSE_NO_DIALTONE __constant_cpu_to_le32(0xC00A000D)
1185#define STATUS_CTX_MODEM_RESPONSE_BUSY __constant_cpu_to_le32(0xC00A000E)
1186#define STATUS_CTX_MODEM_RESPONSE_VOICE __constant_cpu_to_le32(0xC00A000F)
1187#define STATUS_CTX_TD_ERROR __constant_cpu_to_le32(0xC00A0010)
1188#define STATUS_CTX_LICENSE_CLIENT_INVALID __constant_cpu_to_le32(0xC00A0012)
1189#define STATUS_CTX_LICENSE_NOT_AVAILABLE __constant_cpu_to_le32(0xC00A0013)
1190#define STATUS_CTX_LICENSE_EXPIRED __constant_cpu_to_le32(0xC00A0014)
1191#define STATUS_CTX_WINSTATION_NOT_FOUND __constant_cpu_to_le32(0xC00A0015)
1192#define STATUS_CTX_WINSTATION_NAME_COLLISION __constant_cpu_to_le32(0xC00A0016)
1193#define STATUS_CTX_WINSTATION_BUSY __constant_cpu_to_le32(0xC00A0017)
1194#define STATUS_CTX_BAD_VIDEO_MODE __constant_cpu_to_le32(0xC00A0018)
1195#define STATUS_CTX_GRAPHICS_INVALID __constant_cpu_to_le32(0xC00A0022)
1196#define STATUS_CTX_NOT_CONSOLE __constant_cpu_to_le32(0xC00A0024)
1197#define STATUS_CTX_CLIENT_QUERY_TIMEOUT __constant_cpu_to_le32(0xC00A0026)
1198#define STATUS_CTX_CONSOLE_DISCONNECT __constant_cpu_to_le32(0xC00A0027)
1199#define STATUS_CTX_CONSOLE_CONNECT __constant_cpu_to_le32(0xC00A0028)
1200#define STATUS_CTX_SHADOW_DENIED __constant_cpu_to_le32(0xC00A002A)
1201#define STATUS_CTX_WINSTATION_ACCESS_DENIED __constant_cpu_to_le32(0xC00A002B)
1202#define STATUS_CTX_INVALID_WD __constant_cpu_to_le32(0xC00A002E)
1203#define STATUS_CTX_WD_NOT_FOUND __constant_cpu_to_le32(0xC00A002F)
1204#define STATUS_CTX_SHADOW_INVALID __constant_cpu_to_le32(0xC00A0030)
1205#define STATUS_CTX_SHADOW_DISABLED __constant_cpu_to_le32(0xC00A0031)
1206#define STATUS_RDP_PROTOCOL_ERROR __constant_cpu_to_le32(0xC00A0032)
1207#define STATUS_CTX_CLIENT_LICENSE_NOT_SET __constant_cpu_to_le32(0xC00A0033)
1208#define STATUS_CTX_CLIENT_LICENSE_IN_USE __constant_cpu_to_le32(0xC00A0034)
1209#define STATUS_CTX_SHADOW_ENDED_BY_MODE_CHANGE __constant_cpu_to_le32(0xC00A0035)
1210#define STATUS_CTX_SHADOW_NOT_RUNNING __constant_cpu_to_le32(0xC00A0036)
1211#define STATUS_CTX_LOGON_DISABLED __constant_cpu_to_le32(0xC00A0037)
1212#define STATUS_CTX_SECURITY_LAYER_ERROR __constant_cpu_to_le32(0xC00A0038)
1213#define STATUS_TS_INCOMPATIBLE_SESSIONS __constant_cpu_to_le32(0xC00A0039)
1214#define STATUS_MUI_FILE_NOT_FOUND __constant_cpu_to_le32(0xC00B0001)
1215#define STATUS_MUI_INVALID_FILE __constant_cpu_to_le32(0xC00B0002)
1216#define STATUS_MUI_INVALID_RC_CONFIG __constant_cpu_to_le32(0xC00B0003)
1217#define STATUS_MUI_INVALID_LOCALE_NAME __constant_cpu_to_le32(0xC00B0004)
1218#define STATUS_MUI_INVALID_ULTIMATEFALLBACK_NAME __constant_cpu_to_le32(0xC00B0005)
1219#define STATUS_MUI_FILE_NOT_LOADED __constant_cpu_to_le32(0xC00B0006)
1220#define STATUS_RESOURCE_ENUM_USER_STOP __constant_cpu_to_le32(0xC00B0007)
1221#define STATUS_CLUSTER_INVALID_NODE __constant_cpu_to_le32(0xC0130001)
1222#define STATUS_CLUSTER_NODE_EXISTS __constant_cpu_to_le32(0xC0130002)
1223#define STATUS_CLUSTER_JOIN_IN_PROGRESS __constant_cpu_to_le32(0xC0130003)
1224#define STATUS_CLUSTER_NODE_NOT_FOUND __constant_cpu_to_le32(0xC0130004)
1225#define STATUS_CLUSTER_LOCAL_NODE_NOT_FOUND __constant_cpu_to_le32(0xC0130005)
1226#define STATUS_CLUSTER_NETWORK_EXISTS __constant_cpu_to_le32(0xC0130006)
1227#define STATUS_CLUSTER_NETWORK_NOT_FOUND __constant_cpu_to_le32(0xC0130007)
1228#define STATUS_CLUSTER_NETINTERFACE_EXISTS __constant_cpu_to_le32(0xC0130008)
1229#define STATUS_CLUSTER_NETINTERFACE_NOT_FOUND __constant_cpu_to_le32(0xC0130009)
1230#define STATUS_CLUSTER_INVALID_REQUEST __constant_cpu_to_le32(0xC013000A)
1231#define STATUS_CLUSTER_INVALID_NETWORK_PROVIDER __constant_cpu_to_le32(0xC013000B)
1232#define STATUS_CLUSTER_NODE_DOWN __constant_cpu_to_le32(0xC013000C)
1233#define STATUS_CLUSTER_NODE_UNREACHABLE __constant_cpu_to_le32(0xC013000D)
1234#define STATUS_CLUSTER_NODE_NOT_MEMBER __constant_cpu_to_le32(0xC013000E)
1235#define STATUS_CLUSTER_JOIN_NOT_IN_PROGRESS __constant_cpu_to_le32(0xC013000F)
1236#define STATUS_CLUSTER_INVALID_NETWORK __constant_cpu_to_le32(0xC0130010)
1237#define STATUS_CLUSTER_NO_NET_ADAPTERS __constant_cpu_to_le32(0xC0130011)
1238#define STATUS_CLUSTER_NODE_UP __constant_cpu_to_le32(0xC0130012)
1239#define STATUS_CLUSTER_NODE_PAUSED __constant_cpu_to_le32(0xC0130013)
1240#define STATUS_CLUSTER_NODE_NOT_PAUSED __constant_cpu_to_le32(0xC0130014)
1241#define STATUS_CLUSTER_NO_SECURITY_CONTEXT __constant_cpu_to_le32(0xC0130015)
1242#define STATUS_CLUSTER_NETWORK_NOT_INTERNAL __constant_cpu_to_le32(0xC0130016)
1243#define STATUS_CLUSTER_POISONED __constant_cpu_to_le32(0xC0130017)
1244#define STATUS_ACPI_INVALID_OPCODE __constant_cpu_to_le32(0xC0140001)
1245#define STATUS_ACPI_STACK_OVERFLOW __constant_cpu_to_le32(0xC0140002)
1246#define STATUS_ACPI_ASSERT_FAILED __constant_cpu_to_le32(0xC0140003)
1247#define STATUS_ACPI_INVALID_INDEX __constant_cpu_to_le32(0xC0140004)
1248#define STATUS_ACPI_INVALID_ARGUMENT __constant_cpu_to_le32(0xC0140005)
1249#define STATUS_ACPI_FATAL __constant_cpu_to_le32(0xC0140006)
1250#define STATUS_ACPI_INVALID_SUPERNAME __constant_cpu_to_le32(0xC0140007)
1251#define STATUS_ACPI_INVALID_ARGTYPE __constant_cpu_to_le32(0xC0140008)
1252#define STATUS_ACPI_INVALID_OBJTYPE __constant_cpu_to_le32(0xC0140009)
1253#define STATUS_ACPI_INVALID_TARGETTYPE __constant_cpu_to_le32(0xC014000A)
1254#define STATUS_ACPI_INCORRECT_ARGUMENT_COUNT __constant_cpu_to_le32(0xC014000B)
1255#define STATUS_ACPI_ADDRESS_NOT_MAPPED __constant_cpu_to_le32(0xC014000C)
1256#define STATUS_ACPI_INVALID_EVENTTYPE __constant_cpu_to_le32(0xC014000D)
1257#define STATUS_ACPI_HANDLER_COLLISION __constant_cpu_to_le32(0xC014000E)
1258#define STATUS_ACPI_INVALID_DATA __constant_cpu_to_le32(0xC014000F)
1259#define STATUS_ACPI_INVALID_REGION __constant_cpu_to_le32(0xC0140010)
1260#define STATUS_ACPI_INVALID_ACCESS_SIZE __constant_cpu_to_le32(0xC0140011)
1261#define STATUS_ACPI_ACQUIRE_GLOBAL_LOCK __constant_cpu_to_le32(0xC0140012)
1262#define STATUS_ACPI_ALREADY_INITIALIZED __constant_cpu_to_le32(0xC0140013)
1263#define STATUS_ACPI_NOT_INITIALIZED __constant_cpu_to_le32(0xC0140014)
1264#define STATUS_ACPI_INVALID_MUTEX_LEVEL __constant_cpu_to_le32(0xC0140015)
1265#define STATUS_ACPI_MUTEX_NOT_OWNED __constant_cpu_to_le32(0xC0140016)
1266#define STATUS_ACPI_MUTEX_NOT_OWNER __constant_cpu_to_le32(0xC0140017)
1267#define STATUS_ACPI_RS_ACCESS __constant_cpu_to_le32(0xC0140018)
1268#define STATUS_ACPI_INVALID_TABLE __constant_cpu_to_le32(0xC0140019)
1269#define STATUS_ACPI_REG_HANDLER_FAILED __constant_cpu_to_le32(0xC0140020)
1270#define STATUS_ACPI_POWER_REQUEST_FAILED __constant_cpu_to_le32(0xC0140021)
1271#define STATUS_SXS_SECTION_NOT_FOUND __constant_cpu_to_le32(0xC0150001)
1272#define STATUS_SXS_CANT_GEN_ACTCTX __constant_cpu_to_le32(0xC0150002)
1273#define STATUS_SXS_INVALID_ACTCTXDATA_FORMAT __constant_cpu_to_le32(0xC0150003)
1274#define STATUS_SXS_ASSEMBLY_NOT_FOUND __constant_cpu_to_le32(0xC0150004)
1275#define STATUS_SXS_MANIFEST_FORMAT_ERROR __constant_cpu_to_le32(0xC0150005)
1276#define STATUS_SXS_MANIFEST_PARSE_ERROR __constant_cpu_to_le32(0xC0150006)
1277#define STATUS_SXS_ACTIVATION_CONTEXT_DISABLED __constant_cpu_to_le32(0xC0150007)
1278#define STATUS_SXS_KEY_NOT_FOUND __constant_cpu_to_le32(0xC0150008)
1279#define STATUS_SXS_VERSION_CONFLICT __constant_cpu_to_le32(0xC0150009)
1280#define STATUS_SXS_WRONG_SECTION_TYPE __constant_cpu_to_le32(0xC015000A)
1281#define STATUS_SXS_THREAD_QUERIES_DISABLED __constant_cpu_to_le32(0xC015000B)
1282#define STATUS_SXS_ASSEMBLY_MISSING __constant_cpu_to_le32(0xC015000C)
1283#define STATUS_SXS_PROCESS_DEFAULT_ALREADY_SET __constant_cpu_to_le32(0xC015000E)
1284#define STATUS_SXS_EARLY_DEACTIVATION __constant_cpu_to_le32(0xC015000F)
1285#define STATUS_SXS_INVALID_DEACTIVATION __constant_cpu_to_le32(0xC0150010)
1286#define STATUS_SXS_MULTIPLE_DEACTIVATION __constant_cpu_to_le32(0xC0150011)
1287#define STATUS_SXS_SYSTEM_DEFAULT_ACTIVATION_CONTEXT_EMPTY __constant_cpu_to_le32(0xC0150012)
1288#define STATUS_SXS_PROCESS_TERMINATION_REQUESTED __constant_cpu_to_le32(0xC0150013)
1289#define STATUS_SXS_CORRUPT_ACTIVATION_STACK __constant_cpu_to_le32(0xC0150014)
1290#define STATUS_SXS_CORRUPTION __constant_cpu_to_le32(0xC0150015)
1291#define STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_VALUE __constant_cpu_to_le32(0xC0150016)
1292#define STATUS_SXS_INVALID_IDENTITY_ATTRIBUTE_NAME __constant_cpu_to_le32(0xC0150017)
1293#define STATUS_SXS_IDENTITY_DUPLICATE_ATTRIBUTE __constant_cpu_to_le32(0xC0150018)
1294#define STATUS_SXS_IDENTITY_PARSE_ERROR __constant_cpu_to_le32(0xC0150019)
1295#define STATUS_SXS_COMPONENT_STORE_CORRUPT __constant_cpu_to_le32(0xC015001A)
1296#define STATUS_SXS_FILE_HASH_MISMATCH __constant_cpu_to_le32(0xC015001B)
1297#define STATUS_SXS_MANIFEST_IDENTITY_SAME_BUT_CONTENTS_DIFFERENT __constant_cpu_to_le32(0xC015001C)
1298#define STATUS_SXS_IDENTITIES_DIFFERENT __constant_cpu_to_le32(0xC015001D)
1299#define STATUS_SXS_ASSEMBLY_IS_NOT_A_DEPLOYMENT __constant_cpu_to_le32(0xC015001E)
1300#define STATUS_SXS_FILE_NOT_PART_OF_ASSEMBLY __constant_cpu_to_le32(0xC015001F)
1301#define STATUS_ADVANCED_INSTALLER_FAILED __constant_cpu_to_le32(0xC0150020)
1302#define STATUS_XML_ENCODING_MISMATCH __constant_cpu_to_le32(0xC0150021)
1303#define STATUS_SXS_MANIFEST_TOO_BIG __constant_cpu_to_le32(0xC0150022)
1304#define STATUS_SXS_SETTING_NOT_REGISTERED __constant_cpu_to_le32(0xC0150023)
1305#define STATUS_SXS_TRANSACTION_CLOSURE_INCOMPLETE __constant_cpu_to_le32(0xC0150024)
1306#define STATUS_SMI_PRIMITIVE_INSTALLER_FAILED __constant_cpu_to_le32(0xC0150025)
1307#define STATUS_GENERIC_COMMAND_FAILED __constant_cpu_to_le32(0xC0150026)
1308#define STATUS_SXS_FILE_HASH_MISSING __constant_cpu_to_le32(0xC0150027)
1309#define STATUS_TRANSACTIONAL_CONFLICT __constant_cpu_to_le32(0xC0190001)
1310#define STATUS_INVALID_TRANSACTION __constant_cpu_to_le32(0xC0190002)
1311#define STATUS_TRANSACTION_NOT_ACTIVE __constant_cpu_to_le32(0xC0190003)
1312#define STATUS_TM_INITIALIZATION_FAILED __constant_cpu_to_le32(0xC0190004)
1313#define STATUS_RM_NOT_ACTIVE __constant_cpu_to_le32(0xC0190005)
1314#define STATUS_RM_METADATA_CORRUPT __constant_cpu_to_le32(0xC0190006)
1315#define STATUS_TRANSACTION_NOT_JOINED __constant_cpu_to_le32(0xC0190007)
1316#define STATUS_DIRECTORY_NOT_RM __constant_cpu_to_le32(0xC0190008)
1317#define STATUS_TRANSACTIONS_UNSUPPORTED_REMOTE __constant_cpu_to_le32(0xC019000A)
1318#define STATUS_LOG_RESIZE_INVALID_SIZE __constant_cpu_to_le32(0xC019000B)
1319#define STATUS_REMOTE_FILE_VERSION_MISMATCH __constant_cpu_to_le32(0xC019000C)
1320#define STATUS_CRM_PROTOCOL_ALREADY_EXISTS __constant_cpu_to_le32(0xC019000F)
1321#define STATUS_TRANSACTION_PROPAGATION_FAILED __constant_cpu_to_le32(0xC0190010)
1322#define STATUS_CRM_PROTOCOL_NOT_FOUND __constant_cpu_to_le32(0xC0190011)
1323#define STATUS_TRANSACTION_SUPERIOR_EXISTS __constant_cpu_to_le32(0xC0190012)
1324#define STATUS_TRANSACTION_REQUEST_NOT_VALID __constant_cpu_to_le32(0xC0190013)
1325#define STATUS_TRANSACTION_NOT_REQUESTED __constant_cpu_to_le32(0xC0190014)
1326#define STATUS_TRANSACTION_ALREADY_ABORTED __constant_cpu_to_le32(0xC0190015)
1327#define STATUS_TRANSACTION_ALREADY_COMMITTED __constant_cpu_to_le32(0xC0190016)
1328#define STATUS_TRANSACTION_INVALID_MARSHALL_BUFFER __constant_cpu_to_le32(0xC0190017)
1329#define STATUS_CURRENT_TRANSACTION_NOT_VALID __constant_cpu_to_le32(0xC0190018)
1330#define STATUS_LOG_GROWTH_FAILED __constant_cpu_to_le32(0xC0190019)
1331#define STATUS_OBJECT_NO_LONGER_EXISTS __constant_cpu_to_le32(0xC0190021)
1332#define STATUS_STREAM_MINIVERSION_NOT_FOUND __constant_cpu_to_le32(0xC0190022)
1333#define STATUS_STREAM_MINIVERSION_NOT_VALID __constant_cpu_to_le32(0xC0190023)
1334#define STATUS_MINIVERSION_INACCESSIBLE_FROM_SPECIFIED_TRANSACTION __constant_cpu_to_le32(0xC0190024)
1335#define STATUS_CANT_OPEN_MINIVERSION_WITH_MODIFY_INTENT __constant_cpu_to_le32(0xC0190025)
1336#define STATUS_CANT_CREATE_MORE_STREAM_MINIVERSIONS __constant_cpu_to_le32(0xC0190026)
1337#define STATUS_HANDLE_NO_LONGER_VALID __constant_cpu_to_le32(0xC0190028)
1338#define STATUS_LOG_CORRUPTION_DETECTED __constant_cpu_to_le32(0xC0190030)
1339#define STATUS_RM_DISCONNECTED __constant_cpu_to_le32(0xC0190032)
1340#define STATUS_ENLISTMENT_NOT_SUPERIOR __constant_cpu_to_le32(0xC0190033)
1341#define STATUS_FILE_IDENTITY_NOT_PERSISTENT __constant_cpu_to_le32(0xC0190036)
1342#define STATUS_CANT_BREAK_TRANSACTIONAL_DEPENDENCY __constant_cpu_to_le32(0xC0190037)
1343#define STATUS_CANT_CROSS_RM_BOUNDARY __constant_cpu_to_le32(0xC0190038)
1344#define STATUS_TXF_DIR_NOT_EMPTY __constant_cpu_to_le32(0xC0190039)
1345#define STATUS_INDOUBT_TRANSACTIONS_EXIST __constant_cpu_to_le32(0xC019003A)
1346#define STATUS_TM_VOLATILE __constant_cpu_to_le32(0xC019003B)
1347#define STATUS_ROLLBACK_TIMER_EXPIRED __constant_cpu_to_le32(0xC019003C)
1348#define STATUS_TXF_ATTRIBUTE_CORRUPT __constant_cpu_to_le32(0xC019003D)
1349#define STATUS_EFS_NOT_ALLOWED_IN_TRANSACTION __constant_cpu_to_le32(0xC019003E)
1350#define STATUS_TRANSACTIONAL_OPEN_NOT_ALLOWED __constant_cpu_to_le32(0xC019003F)
1351#define STATUS_TRANSACTED_MAPPING_UNSUPPORTED_REMOTE __constant_cpu_to_le32(0xC0190040)
1352#define STATUS_TRANSACTION_REQUIRED_PROMOTION __constant_cpu_to_le32(0xC0190043)
1353#define STATUS_CANNOT_EXECUTE_FILE_IN_TRANSACTION __constant_cpu_to_le32(0xC0190044)
1354#define STATUS_TRANSACTIONS_NOT_FROZEN __constant_cpu_to_le32(0xC0190045)
1355#define STATUS_TRANSACTION_FREEZE_IN_PROGRESS __constant_cpu_to_le32(0xC0190046)
1356#define STATUS_NOT_SNAPSHOT_VOLUME __constant_cpu_to_le32(0xC0190047)
1357#define STATUS_NO_SAVEPOINT_WITH_OPEN_FILES __constant_cpu_to_le32(0xC0190048)
1358#define STATUS_SPARSE_NOT_ALLOWED_IN_TRANSACTION __constant_cpu_to_le32(0xC0190049)
1359#define STATUS_TM_IDENTITY_MISMATCH __constant_cpu_to_le32(0xC019004A)
1360#define STATUS_FLOATED_SECTION __constant_cpu_to_le32(0xC019004B)
1361#define STATUS_CANNOT_ACCEPT_TRANSACTED_WORK __constant_cpu_to_le32(0xC019004C)
1362#define STATUS_CANNOT_ABORT_TRANSACTIONS __constant_cpu_to_le32(0xC019004D)
1363#define STATUS_TRANSACTION_NOT_FOUND __constant_cpu_to_le32(0xC019004E)
1364#define STATUS_RESOURCEMANAGER_NOT_FOUND __constant_cpu_to_le32(0xC019004F)
1365#define STATUS_ENLISTMENT_NOT_FOUND __constant_cpu_to_le32(0xC0190050)
1366#define STATUS_TRANSACTIONMANAGER_NOT_FOUND __constant_cpu_to_le32(0xC0190051)
1367#define STATUS_TRANSACTIONMANAGER_NOT_ONLINE __constant_cpu_to_le32(0xC0190052)
1368#define STATUS_TRANSACTIONMANAGER_RECOVERY_NAME_COLLISION __constant_cpu_to_le32(0xC0190053)
1369#define STATUS_TRANSACTION_NOT_ROOT __constant_cpu_to_le32(0xC0190054)
1370#define STATUS_TRANSACTION_OBJECT_EXPIRED __constant_cpu_to_le32(0xC0190055)
1371#define STATUS_COMPRESSION_NOT_ALLOWED_IN_TRANSACTION __constant_cpu_to_le32(0xC0190056)
1372#define STATUS_TRANSACTION_RESPONSE_NOT_ENLISTED __constant_cpu_to_le32(0xC0190057)
1373#define STATUS_TRANSACTION_RECORD_TOO_LONG __constant_cpu_to_le32(0xC0190058)
1374#define STATUS_NO_LINK_TRACKING_IN_TRANSACTION __constant_cpu_to_le32(0xC0190059)
1375#define STATUS_OPERATION_NOT_SUPPORTED_IN_TRANSACTION __constant_cpu_to_le32(0xC019005A)
1376#define STATUS_TRANSACTION_INTEGRITY_VIOLATED __constant_cpu_to_le32(0xC019005B)
1377#define STATUS_LOG_SECTOR_INVALID __constant_cpu_to_le32(0xC01A0001)
1378#define STATUS_LOG_SECTOR_PARITY_INVALID __constant_cpu_to_le32(0xC01A0002)
1379#define STATUS_LOG_SECTOR_REMAPPED __constant_cpu_to_le32(0xC01A0003)
1380#define STATUS_LOG_BLOCK_INCOMPLETE __constant_cpu_to_le32(0xC01A0004)
1381#define STATUS_LOG_INVALID_RANGE __constant_cpu_to_le32(0xC01A0005)
1382#define STATUS_LOG_BLOCKS_EXHAUSTED __constant_cpu_to_le32(0xC01A0006)
1383#define STATUS_LOG_READ_CONTEXT_INVALID __constant_cpu_to_le32(0xC01A0007)
1384#define STATUS_LOG_RESTART_INVALID __constant_cpu_to_le32(0xC01A0008)
1385#define STATUS_LOG_BLOCK_VERSION __constant_cpu_to_le32(0xC01A0009)
1386#define STATUS_LOG_BLOCK_INVALID __constant_cpu_to_le32(0xC01A000A)
1387#define STATUS_LOG_READ_MODE_INVALID __constant_cpu_to_le32(0xC01A000B)
1388#define STATUS_LOG_METADATA_CORRUPT __constant_cpu_to_le32(0xC01A000D)
1389#define STATUS_LOG_METADATA_INVALID __constant_cpu_to_le32(0xC01A000E)
1390#define STATUS_LOG_METADATA_INCONSISTENT __constant_cpu_to_le32(0xC01A000F)
1391#define STATUS_LOG_RESERVATION_INVALID __constant_cpu_to_le32(0xC01A0010)
1392#define STATUS_LOG_CANT_DELETE __constant_cpu_to_le32(0xC01A0011)
1393#define STATUS_LOG_CONTAINER_LIMIT_EXCEEDED __constant_cpu_to_le32(0xC01A0012)
1394#define STATUS_LOG_START_OF_LOG __constant_cpu_to_le32(0xC01A0013)
1395#define STATUS_LOG_POLICY_ALREADY_INSTALLED __constant_cpu_to_le32(0xC01A0014)
1396#define STATUS_LOG_POLICY_NOT_INSTALLED __constant_cpu_to_le32(0xC01A0015)
1397#define STATUS_LOG_POLICY_INVALID __constant_cpu_to_le32(0xC01A0016)
1398#define STATUS_LOG_POLICY_CONFLICT __constant_cpu_to_le32(0xC01A0017)
1399#define STATUS_LOG_PINNED_ARCHIVE_TAIL __constant_cpu_to_le32(0xC01A0018)
1400#define STATUS_LOG_RECORD_NONEXISTENT __constant_cpu_to_le32(0xC01A0019)
1401#define STATUS_LOG_RECORDS_RESERVED_INVALID __constant_cpu_to_le32(0xC01A001A)
1402#define STATUS_LOG_SPACE_RESERVED_INVALID __constant_cpu_to_le32(0xC01A001B)
1403#define STATUS_LOG_TAIL_INVALID __constant_cpu_to_le32(0xC01A001C)
1404#define STATUS_LOG_FULL __constant_cpu_to_le32(0xC01A001D)
1405#define STATUS_LOG_MULTIPLEXED __constant_cpu_to_le32(0xC01A001E)
1406#define STATUS_LOG_DEDICATED __constant_cpu_to_le32(0xC01A001F)
1407#define STATUS_LOG_ARCHIVE_NOT_IN_PROGRESS __constant_cpu_to_le32(0xC01A0020)
1408#define STATUS_LOG_ARCHIVE_IN_PROGRESS __constant_cpu_to_le32(0xC01A0021)
1409#define STATUS_LOG_EPHEMERAL __constant_cpu_to_le32(0xC01A0022)
1410#define STATUS_LOG_NOT_ENOUGH_CONTAINERS __constant_cpu_to_le32(0xC01A0023)
1411#define STATUS_LOG_CLIENT_ALREADY_REGISTERED __constant_cpu_to_le32(0xC01A0024)
1412#define STATUS_LOG_CLIENT_NOT_REGISTERED __constant_cpu_to_le32(0xC01A0025)
1413#define STATUS_LOG_FULL_HANDLER_IN_PROGRESS __constant_cpu_to_le32(0xC01A0026)
1414#define STATUS_LOG_CONTAINER_READ_FAILED __constant_cpu_to_le32(0xC01A0027)
1415#define STATUS_LOG_CONTAINER_WRITE_FAILED __constant_cpu_to_le32(0xC01A0028)
1416#define STATUS_LOG_CONTAINER_OPEN_FAILED __constant_cpu_to_le32(0xC01A0029)
1417#define STATUS_LOG_CONTAINER_STATE_INVALID __constant_cpu_to_le32(0xC01A002A)
1418#define STATUS_LOG_STATE_INVALID __constant_cpu_to_le32(0xC01A002B)
1419#define STATUS_LOG_PINNED __constant_cpu_to_le32(0xC01A002C)
1420#define STATUS_LOG_METADATA_FLUSH_FAILED __constant_cpu_to_le32(0xC01A002D)
1421#define STATUS_LOG_INCONSISTENT_SECURITY __constant_cpu_to_le32(0xC01A002E)
1422#define STATUS_LOG_APPENDED_FLUSH_FAILED __constant_cpu_to_le32(0xC01A002F)
1423#define STATUS_LOG_PINNED_RESERVATION __constant_cpu_to_le32(0xC01A0030)
1424#define STATUS_VIDEO_HUNG_DISPLAY_DRIVER_THREAD __constant_cpu_to_le32(0xC01B00EA)
1425#define STATUS_FLT_NO_HANDLER_DEFINED __constant_cpu_to_le32(0xC01C0001)
1426#define STATUS_FLT_CONTEXT_ALREADY_DEFINED __constant_cpu_to_le32(0xC01C0002)
1427#define STATUS_FLT_INVALID_ASYNCHRONOUS_REQUEST __constant_cpu_to_le32(0xC01C0003)
1428#define STATUS_FLT_DISALLOW_FAST_IO __constant_cpu_to_le32(0xC01C0004)
1429#define STATUS_FLT_INVALID_NAME_REQUEST __constant_cpu_to_le32(0xC01C0005)
1430#define STATUS_FLT_NOT_SAFE_TO_POST_OPERATION __constant_cpu_to_le32(0xC01C0006)
1431#define STATUS_FLT_NOT_INITIALIZED __constant_cpu_to_le32(0xC01C0007)
1432#define STATUS_FLT_FILTER_NOT_READY __constant_cpu_to_le32(0xC01C0008)
1433#define STATUS_FLT_POST_OPERATION_CLEANUP __constant_cpu_to_le32(0xC01C0009)
1434#define STATUS_FLT_INTERNAL_ERROR __constant_cpu_to_le32(0xC01C000A)
1435#define STATUS_FLT_DELETING_OBJECT __constant_cpu_to_le32(0xC01C000B)
1436#define STATUS_FLT_MUST_BE_NONPAGED_POOL __constant_cpu_to_le32(0xC01C000C)
1437#define STATUS_FLT_DUPLICATE_ENTRY __constant_cpu_to_le32(0xC01C000D)
1438#define STATUS_FLT_CBDQ_DISABLED __constant_cpu_to_le32(0xC01C000E)
1439#define STATUS_FLT_DO_NOT_ATTACH __constant_cpu_to_le32(0xC01C000F)
1440#define STATUS_FLT_DO_NOT_DETACH __constant_cpu_to_le32(0xC01C0010)
1441#define STATUS_FLT_INSTANCE_ALTITUDE_COLLISION __constant_cpu_to_le32(0xC01C0011)
1442#define STATUS_FLT_INSTANCE_NAME_COLLISION __constant_cpu_to_le32(0xC01C0012)
1443#define STATUS_FLT_FILTER_NOT_FOUND __constant_cpu_to_le32(0xC01C0013)
1444#define STATUS_FLT_VOLUME_NOT_FOUND __constant_cpu_to_le32(0xC01C0014)
1445#define STATUS_FLT_INSTANCE_NOT_FOUND __constant_cpu_to_le32(0xC01C0015)
1446#define STATUS_FLT_CONTEXT_ALLOCATION_NOT_FOUND __constant_cpu_to_le32(0xC01C0016)
1447#define STATUS_FLT_INVALID_CONTEXT_REGISTRATION __constant_cpu_to_le32(0xC01C0017)
1448#define STATUS_FLT_NAME_CACHE_MISS __constant_cpu_to_le32(0xC01C0018)
1449#define STATUS_FLT_NO_DEVICE_OBJECT __constant_cpu_to_le32(0xC01C0019)
1450#define STATUS_FLT_VOLUME_ALREADY_MOUNTED __constant_cpu_to_le32(0xC01C001A)
1451#define STATUS_FLT_ALREADY_ENLISTED __constant_cpu_to_le32(0xC01C001B)
1452#define STATUS_FLT_CONTEXT_ALREADY_LINKED __constant_cpu_to_le32(0xC01C001C)
1453#define STATUS_FLT_NO_WAITER_FOR_REPLY __constant_cpu_to_le32(0xC01C0020)
1454#define STATUS_MONITOR_NO_DESCRIPTOR __constant_cpu_to_le32(0xC01D0001)
1455#define STATUS_MONITOR_UNKNOWN_DESCRIPTOR_FORMAT __constant_cpu_to_le32(0xC01D0002)
1456#define STATUS_MONITOR_INVALID_DESCRIPTOR_CHECKSUM __constant_cpu_to_le32(0xC01D0003)
1457#define STATUS_MONITOR_INVALID_STANDARD_TIMING_BLOCK __constant_cpu_to_le32(0xC01D0004)
1458#define STATUS_MONITOR_WMI_DATABLOCK_REGISTRATION_FAILED __constant_cpu_to_le32(0xC01D0005)
1459#define STATUS_MONITOR_INVALID_SERIAL_NUMBER_MONDSC_BLOCK __constant_cpu_to_le32(0xC01D0006)
1460#define STATUS_MONITOR_INVALID_USER_FRIENDLY_MONDSC_BLOCK __constant_cpu_to_le32(0xC01D0007)
1461#define STATUS_MONITOR_NO_MORE_DESCRIPTOR_DATA __constant_cpu_to_le32(0xC01D0008)
1462#define STATUS_MONITOR_INVALID_DETAILED_TIMING_BLOCK __constant_cpu_to_le32(0xC01D0009)
1463#define STATUS_GRAPHICS_NOT_EXCLUSIVE_MODE_OWNER __constant_cpu_to_le32(0xC01E0000)
1464#define STATUS_GRAPHICS_INSUFFICIENT_DMA_BUFFER __constant_cpu_to_le32(0xC01E0001)
1465#define STATUS_GRAPHICS_INVALID_DISPLAY_ADAPTER __constant_cpu_to_le32(0xC01E0002)
1466#define STATUS_GRAPHICS_ADAPTER_WAS_RESET __constant_cpu_to_le32(0xC01E0003)
1467#define STATUS_GRAPHICS_INVALID_DRIVER_MODEL __constant_cpu_to_le32(0xC01E0004)
1468#define STATUS_GRAPHICS_PRESENT_MODE_CHANGED __constant_cpu_to_le32(0xC01E0005)
1469#define STATUS_GRAPHICS_PRESENT_OCCLUDED __constant_cpu_to_le32(0xC01E0006)
1470#define STATUS_GRAPHICS_PRESENT_DENIED __constant_cpu_to_le32(0xC01E0007)
1471#define STATUS_GRAPHICS_CANNOTCOLORCONVERT __constant_cpu_to_le32(0xC01E0008)
1472#define STATUS_GRAPHICS_NO_VIDEO_MEMORY __constant_cpu_to_le32(0xC01E0100)
1473#define STATUS_GRAPHICS_CANT_LOCK_MEMORY __constant_cpu_to_le32(0xC01E0101)
1474#define STATUS_GRAPHICS_ALLOCATION_BUSY __constant_cpu_to_le32(0xC01E0102)
1475#define STATUS_GRAPHICS_TOO_MANY_REFERENCES __constant_cpu_to_le32(0xC01E0103)
1476#define STATUS_GRAPHICS_TRY_AGAIN_LATER __constant_cpu_to_le32(0xC01E0104)
1477#define STATUS_GRAPHICS_TRY_AGAIN_NOW __constant_cpu_to_le32(0xC01E0105)
1478#define STATUS_GRAPHICS_ALLOCATION_INVALID __constant_cpu_to_le32(0xC01E0106)
1479#define STATUS_GRAPHICS_UNSWIZZLING_APERTURE_UNAVAILABLE __constant_cpu_to_le32(0xC01E0107)
1480#define STATUS_GRAPHICS_UNSWIZZLING_APERTURE_UNSUPPORTED __constant_cpu_to_le32(0xC01E0108)
1481#define STATUS_GRAPHICS_CANT_EVICT_PINNED_ALLOCATION __constant_cpu_to_le32(0xC01E0109)
1482#define STATUS_GRAPHICS_INVALID_ALLOCATION_USAGE __constant_cpu_to_le32(0xC01E0110)
1483#define STATUS_GRAPHICS_CANT_RENDER_LOCKED_ALLOCATION __constant_cpu_to_le32(0xC01E0111)
1484#define STATUS_GRAPHICS_ALLOCATION_CLOSED __constant_cpu_to_le32(0xC01E0112)
1485#define STATUS_GRAPHICS_INVALID_ALLOCATION_INSTANCE __constant_cpu_to_le32(0xC01E0113)
1486#define STATUS_GRAPHICS_INVALID_ALLOCATION_HANDLE __constant_cpu_to_le32(0xC01E0114)
1487#define STATUS_GRAPHICS_WRONG_ALLOCATION_DEVICE __constant_cpu_to_le32(0xC01E0115)
1488#define STATUS_GRAPHICS_ALLOCATION_CONTENT_LOST __constant_cpu_to_le32(0xC01E0116)
1489#define STATUS_GRAPHICS_GPU_EXCEPTION_ON_DEVICE __constant_cpu_to_le32(0xC01E0200)
1490#define STATUS_GRAPHICS_INVALID_VIDPN_TOPOLOGY __constant_cpu_to_le32(0xC01E0300)
1491#define STATUS_GRAPHICS_VIDPN_TOPOLOGY_NOT_SUPPORTED __constant_cpu_to_le32(0xC01E0301)
1492#define STATUS_GRAPHICS_VIDPN_TOPOLOGY_CURRENTLY_NOT_SUPPORTED __constant_cpu_to_le32(0xC01E0302)
1493#define STATUS_GRAPHICS_INVALID_VIDPN __constant_cpu_to_le32(0xC01E0303)
1494#define STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE __constant_cpu_to_le32(0xC01E0304)
1495#define STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET __constant_cpu_to_le32(0xC01E0305)
1496#define STATUS_GRAPHICS_VIDPN_MODALITY_NOT_SUPPORTED __constant_cpu_to_le32(0xC01E0306)
1497#define STATUS_GRAPHICS_INVALID_VIDPN_SOURCEMODESET __constant_cpu_to_le32(0xC01E0308)
1498#define STATUS_GRAPHICS_INVALID_VIDPN_TARGETMODESET __constant_cpu_to_le32(0xC01E0309)
1499#define STATUS_GRAPHICS_INVALID_FREQUENCY __constant_cpu_to_le32(0xC01E030A)
1500#define STATUS_GRAPHICS_INVALID_ACTIVE_REGION __constant_cpu_to_le32(0xC01E030B)
1501#define STATUS_GRAPHICS_INVALID_TOTAL_REGION __constant_cpu_to_le32(0xC01E030C)
1502#define STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_SOURCE_MODE __constant_cpu_to_le32(0xC01E0310)
1503#define STATUS_GRAPHICS_INVALID_VIDEO_PRESENT_TARGET_MODE __constant_cpu_to_le32(0xC01E0311)
1504#define STATUS_GRAPHICS_PINNED_MODE_MUST_REMAIN_IN_SET __constant_cpu_to_le32(0xC01E0312)
1505#define STATUS_GRAPHICS_PATH_ALREADY_IN_TOPOLOGY __constant_cpu_to_le32(0xC01E0313)
1506#define STATUS_GRAPHICS_MODE_ALREADY_IN_MODESET __constant_cpu_to_le32(0xC01E0314)
1507#define STATUS_GRAPHICS_INVALID_VIDEOPRESENTSOURCESET __constant_cpu_to_le32(0xC01E0315)
1508#define STATUS_GRAPHICS_INVALID_VIDEOPRESENTTARGETSET __constant_cpu_to_le32(0xC01E0316)
1509#define STATUS_GRAPHICS_SOURCE_ALREADY_IN_SET __constant_cpu_to_le32(0xC01E0317)
1510#define STATUS_GRAPHICS_TARGET_ALREADY_IN_SET __constant_cpu_to_le32(0xC01E0318)
1511#define STATUS_GRAPHICS_INVALID_VIDPN_PRESENT_PATH __constant_cpu_to_le32(0xC01E0319)
1512#define STATUS_GRAPHICS_NO_RECOMMENDED_VIDPN_TOPOLOGY __constant_cpu_to_le32(0xC01E031A)
1513#define STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGESET __constant_cpu_to_le32(0xC01E031B)
1514#define STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE __constant_cpu_to_le32(0xC01E031C)
1515#define STATUS_GRAPHICS_FREQUENCYRANGE_NOT_IN_SET __constant_cpu_to_le32(0xC01E031D)
1516#define STATUS_GRAPHICS_FREQUENCYRANGE_ALREADY_IN_SET __constant_cpu_to_le32(0xC01E031F)
1517#define STATUS_GRAPHICS_STALE_MODESET __constant_cpu_to_le32(0xC01E0320)
1518#define STATUS_GRAPHICS_INVALID_MONITOR_SOURCEMODESET __constant_cpu_to_le32(0xC01E0321)
1519#define STATUS_GRAPHICS_INVALID_MONITOR_SOURCE_MODE __constant_cpu_to_le32(0xC01E0322)
1520#define STATUS_GRAPHICS_NO_RECOMMENDED_FUNCTIONAL_VIDPN __constant_cpu_to_le32(0xC01E0323)
1521#define STATUS_GRAPHICS_MODE_ID_MUST_BE_UNIQUE __constant_cpu_to_le32(0xC01E0324)
1522#define STATUS_GRAPHICS_EMPTY_ADAPTER_MONITOR_MODE_SUPPORT_INTERSECTION __constant_cpu_to_le32(0xC01E0325)
1523#define STATUS_GRAPHICS_VIDEO_PRESENT_TARGETS_LESS_THAN_SOURCES __constant_cpu_to_le32(0xC01E0326)
1524#define STATUS_GRAPHICS_PATH_NOT_IN_TOPOLOGY __constant_cpu_to_le32(0xC01E0327)
1525#define STATUS_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_SOURCE __constant_cpu_to_le32(0xC01E0328)
1526#define STATUS_GRAPHICS_ADAPTER_MUST_HAVE_AT_LEAST_ONE_TARGET __constant_cpu_to_le32(0xC01E0329)
1527#define STATUS_GRAPHICS_INVALID_MONITORDESCRIPTORSET __constant_cpu_to_le32(0xC01E032A)
1528#define STATUS_GRAPHICS_INVALID_MONITORDESCRIPTOR __constant_cpu_to_le32(0xC01E032B)
1529#define STATUS_GRAPHICS_MONITORDESCRIPTOR_NOT_IN_SET __constant_cpu_to_le32(0xC01E032C)
1530#define STATUS_GRAPHICS_MONITORDESCRIPTOR_ALREADY_IN_SET __constant_cpu_to_le32(0xC01E032D)
1531#define STATUS_GRAPHICS_MONITORDESCRIPTOR_ID_MUST_BE_UNIQUE __constant_cpu_to_le32(0xC01E032E)
1532#define STATUS_GRAPHICS_INVALID_VIDPN_TARGET_SUBSET_TYPE __constant_cpu_to_le32(0xC01E032F)
1533#define STATUS_GRAPHICS_RESOURCES_NOT_RELATED __constant_cpu_to_le32(0xC01E0330)
1534#define STATUS_GRAPHICS_SOURCE_ID_MUST_BE_UNIQUE __constant_cpu_to_le32(0xC01E0331)
1535#define STATUS_GRAPHICS_TARGET_ID_MUST_BE_UNIQUE __constant_cpu_to_le32(0xC01E0332)
1536#define STATUS_GRAPHICS_NO_AVAILABLE_VIDPN_TARGET __constant_cpu_to_le32(0xC01E0333)
1537#define STATUS_GRAPHICS_MONITOR_COULD_NOT_BE_ASSOCIATED_WITH_ADAPTER __constant_cpu_to_le32(0xC01E0334)
1538#define STATUS_GRAPHICS_NO_VIDPNMGR __constant_cpu_to_le32(0xC01E0335)
1539#define STATUS_GRAPHICS_NO_ACTIVE_VIDPN __constant_cpu_to_le32(0xC01E0336)
1540#define STATUS_GRAPHICS_STALE_VIDPN_TOPOLOGY __constant_cpu_to_le32(0xC01E0337)
1541#define STATUS_GRAPHICS_MONITOR_NOT_CONNECTED __constant_cpu_to_le32(0xC01E0338)
1542#define STATUS_GRAPHICS_SOURCE_NOT_IN_TOPOLOGY __constant_cpu_to_le32(0xC01E0339)
1543#define STATUS_GRAPHICS_INVALID_PRIMARYSURFACE_SIZE __constant_cpu_to_le32(0xC01E033A)
1544#define STATUS_GRAPHICS_INVALID_VISIBLEREGION_SIZE __constant_cpu_to_le32(0xC01E033B)
1545#define STATUS_GRAPHICS_INVALID_STRIDE __constant_cpu_to_le32(0xC01E033C)
1546#define STATUS_GRAPHICS_INVALID_PIXELFORMAT __constant_cpu_to_le32(0xC01E033D)
1547#define STATUS_GRAPHICS_INVALID_COLORBASIS __constant_cpu_to_le32(0xC01E033E)
1548#define STATUS_GRAPHICS_INVALID_PIXELVALUEACCESSMODE __constant_cpu_to_le32(0xC01E033F)
1549#define STATUS_GRAPHICS_TARGET_NOT_IN_TOPOLOGY __constant_cpu_to_le32(0xC01E0340)
1550#define STATUS_GRAPHICS_NO_DISPLAY_MODE_MANAGEMENT_SUPPORT __constant_cpu_to_le32(0xC01E0341)
1551#define STATUS_GRAPHICS_VIDPN_SOURCE_IN_USE __constant_cpu_to_le32(0xC01E0342)
1552#define STATUS_GRAPHICS_CANT_ACCESS_ACTIVE_VIDPN __constant_cpu_to_le32(0xC01E0343)
1553#define STATUS_GRAPHICS_INVALID_PATH_IMPORTANCE_ORDINAL __constant_cpu_to_le32(0xC01E0344)
1554#define STATUS_GRAPHICS_INVALID_PATH_CONTENT_GEOMETRY_TRANSFORMATION __constant_cpu_to_le32(0xC01E0345)
1555#define STATUS_GRAPHICS_PATH_CONTENT_GEOMETRY_TRANSFORMATION_NOT_SUPPORTED __constant_cpu_to_le32(0xC01E0346)
1556#define STATUS_GRAPHICS_INVALID_GAMMA_RAMP __constant_cpu_to_le32(0xC01E0347)
1557#define STATUS_GRAPHICS_GAMMA_RAMP_NOT_SUPPORTED __constant_cpu_to_le32(0xC01E0348)
1558#define STATUS_GRAPHICS_MULTISAMPLING_NOT_SUPPORTED __constant_cpu_to_le32(0xC01E0349)
1559#define STATUS_GRAPHICS_MODE_NOT_IN_MODESET __constant_cpu_to_le32(0xC01E034A)
1560#define STATUS_GRAPHICS_INVALID_VIDPN_TOPOLOGY_RECOMMENDATION_REASON __constant_cpu_to_le32(0xC01E034D)
1561#define STATUS_GRAPHICS_INVALID_PATH_CONTENT_TYPE __constant_cpu_to_le32(0xC01E034E)
1562#define STATUS_GRAPHICS_INVALID_COPYPROTECTION_TYPE __constant_cpu_to_le32(0xC01E034F)
1563#define STATUS_GRAPHICS_UNASSIGNED_MODESET_ALREADY_EXISTS __constant_cpu_to_le32(0xC01E0350)
1564#define STATUS_GRAPHICS_INVALID_SCANLINE_ORDERING __constant_cpu_to_le32(0xC01E0352)
1565#define STATUS_GRAPHICS_TOPOLOGY_CHANGES_NOT_ALLOWED __constant_cpu_to_le32(0xC01E0353)
1566#define STATUS_GRAPHICS_NO_AVAILABLE_IMPORTANCE_ORDINALS __constant_cpu_to_le32(0xC01E0354)
1567#define STATUS_GRAPHICS_INCOMPATIBLE_PRIVATE_FORMAT __constant_cpu_to_le32(0xC01E0355)
1568#define STATUS_GRAPHICS_INVALID_MODE_PRUNING_ALGORITHM __constant_cpu_to_le32(0xC01E0356)
1569#define STATUS_GRAPHICS_INVALID_MONITOR_CAPABILITY_ORIGIN __constant_cpu_to_le32(0xC01E0357)
1570#define STATUS_GRAPHICS_INVALID_MONITOR_FREQUENCYRANGE_CONSTRAINT __constant_cpu_to_le32(0xC01E0358)
1571#define STATUS_GRAPHICS_MAX_NUM_PATHS_REACHED __constant_cpu_to_le32(0xC01E0359)
1572#define STATUS_GRAPHICS_CANCEL_VIDPN_TOPOLOGY_AUGMENTATION __constant_cpu_to_le32(0xC01E035A)
1573#define STATUS_GRAPHICS_INVALID_CLIENT_TYPE __constant_cpu_to_le32(0xC01E035B)
1574#define STATUS_GRAPHICS_CLIENTVIDPN_NOT_SET __constant_cpu_to_le32(0xC01E035C)
1575#define STATUS_GRAPHICS_SPECIFIED_CHILD_ALREADY_CONNECTED __constant_cpu_to_le32(0xC01E0400)
1576#define STATUS_GRAPHICS_CHILD_DESCRIPTOR_NOT_SUPPORTED __constant_cpu_to_le32(0xC01E0401)
1577#define STATUS_GRAPHICS_NOT_A_LINKED_ADAPTER __constant_cpu_to_le32(0xC01E0430)
1578#define STATUS_GRAPHICS_LEADLINK_NOT_ENUMERATED __constant_cpu_to_le32(0xC01E0431)
1579#define STATUS_GRAPHICS_CHAINLINKS_NOT_ENUMERATED __constant_cpu_to_le32(0xC01E0432)
1580#define STATUS_GRAPHICS_ADAPTER_CHAIN_NOT_READY __constant_cpu_to_le32(0xC01E0433)
1581#define STATUS_GRAPHICS_CHAINLINKS_NOT_STARTED __constant_cpu_to_le32(0xC01E0434)
1582#define STATUS_GRAPHICS_CHAINLINKS_NOT_POWERED_ON __constant_cpu_to_le32(0xC01E0435)
1583#define STATUS_GRAPHICS_INCONSISTENT_DEVICE_LINK_STATE __constant_cpu_to_le32(0xC01E0436)
1584#define STATUS_GRAPHICS_NOT_POST_DEVICE_DRIVER __constant_cpu_to_le32(0xC01E0438)
1585#define STATUS_GRAPHICS_ADAPTER_ACCESS_NOT_EXCLUDED __constant_cpu_to_le32(0xC01E043B)
1586#define STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_DOES_NOT_HAVE_COPP_SEMANTICS __constant_cpu_to_le32(0xC01E051C)
1587#define STATUS_GRAPHICS_OPM_INVALID_INFORMATION_REQUEST __constant_cpu_to_le32(0xC01E051D)
1588#define STATUS_GRAPHICS_OPM_DRIVER_INTERNAL_ERROR __constant_cpu_to_le32(0xC01E051E)
1589#define STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_DOES_NOT_HAVE_OPM_SEMANTICS __constant_cpu_to_le32(0xC01E051F)
1590#define STATUS_GRAPHICS_OPM_SIGNALING_NOT_SUPPORTED __constant_cpu_to_le32(0xC01E0520)
1591#define STATUS_GRAPHICS_OPM_INVALID_CONFIGURATION_REQUEST __constant_cpu_to_le32(0xC01E0521)
1592#define STATUS_GRAPHICS_OPM_NOT_SUPPORTED __constant_cpu_to_le32(0xC01E0500)
1593#define STATUS_GRAPHICS_COPP_NOT_SUPPORTED __constant_cpu_to_le32(0xC01E0501)
1594#define STATUS_GRAPHICS_UAB_NOT_SUPPORTED __constant_cpu_to_le32(0xC01E0502)
1595#define STATUS_GRAPHICS_OPM_INVALID_ENCRYPTED_PARAMETERS __constant_cpu_to_le32(0xC01E0503)
1596#define STATUS_GRAPHICS_OPM_PARAMETER_ARRAY_TOO_SMALL __constant_cpu_to_le32(0xC01E0504)
1597#define STATUS_GRAPHICS_OPM_NO_PROTECTED_OUTPUTS_EXIST __constant_cpu_to_le32(0xC01E0505)
1598#define STATUS_GRAPHICS_PVP_NO_DISPLAY_DEVICE_CORRESPONDS_TO_NAME __constant_cpu_to_le32(0xC01E0506)
1599#define STATUS_GRAPHICS_PVP_DISPLAY_DEVICE_NOT_ATTACHED_TO_DESKTOP __constant_cpu_to_le32(0xC01E0507)
1600#define STATUS_GRAPHICS_PVP_MIRRORING_DEVICES_NOT_SUPPORTED __constant_cpu_to_le32(0xC01E0508)
1601#define STATUS_GRAPHICS_OPM_INVALID_POINTER __constant_cpu_to_le32(0xC01E050A)
1602#define STATUS_GRAPHICS_OPM_INTERNAL_ERROR __constant_cpu_to_le32(0xC01E050B)
1603#define STATUS_GRAPHICS_OPM_INVALID_HANDLE __constant_cpu_to_le32(0xC01E050C)
1604#define STATUS_GRAPHICS_PVP_NO_MONITORS_CORRESPOND_TO_DISPLAY_DEVICE __constant_cpu_to_le32(0xC01E050D)
1605#define STATUS_GRAPHICS_PVP_INVALID_CERTIFICATE_LENGTH __constant_cpu_to_le32(0xC01E050E)
1606#define STATUS_GRAPHICS_OPM_SPANNING_MODE_ENABLED __constant_cpu_to_le32(0xC01E050F)
1607#define STATUS_GRAPHICS_OPM_THEATER_MODE_ENABLED __constant_cpu_to_le32(0xC01E0510)
1608#define STATUS_GRAPHICS_PVP_HFS_FAILED __constant_cpu_to_le32(0xC01E0511)
1609#define STATUS_GRAPHICS_OPM_INVALID_SRM __constant_cpu_to_le32(0xC01E0512)
1610#define STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_HDCP __constant_cpu_to_le32(0xC01E0513)
1611#define STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_ACP __constant_cpu_to_le32(0xC01E0514)
1612#define STATUS_GRAPHICS_OPM_OUTPUT_DOES_NOT_SUPPORT_CGMSA __constant_cpu_to_le32(0xC01E0515)
1613#define STATUS_GRAPHICS_OPM_HDCP_SRM_NEVER_SET __constant_cpu_to_le32(0xC01E0516)
1614#define STATUS_GRAPHICS_OPM_RESOLUTION_TOO_HIGH __constant_cpu_to_le32(0xC01E0517)
1615#define STATUS_GRAPHICS_OPM_ALL_HDCP_HARDWARE_ALREADY_IN_USE __constant_cpu_to_le32(0xC01E0518)
1616#define STATUS_GRAPHICS_OPM_PROTECTED_OUTPUT_NO_LONGER_EXISTS __constant_cpu_to_le32(0xC01E051A)
1617#define STATUS_GRAPHICS_OPM_SESSION_TYPE_CHANGE_IN_PROGRESS __constant_cpu_to_le32(0xC01E051B)
1618#define STATUS_GRAPHICS_I2C_NOT_SUPPORTED __constant_cpu_to_le32(0xC01E0580)
1619#define STATUS_GRAPHICS_I2C_DEVICE_DOES_NOT_EXIST __constant_cpu_to_le32(0xC01E0581)
1620#define STATUS_GRAPHICS_I2C_ERROR_TRANSMITTING_DATA __constant_cpu_to_le32(0xC01E0582)
1621#define STATUS_GRAPHICS_I2C_ERROR_RECEIVING_DATA __constant_cpu_to_le32(0xC01E0583)
1622#define STATUS_GRAPHICS_DDCCI_VCP_NOT_SUPPORTED __constant_cpu_to_le32(0xC01E0584)
1623#define STATUS_GRAPHICS_DDCCI_INVALID_DATA __constant_cpu_to_le32(0xC01E0585)
1624#define STATUS_GRAPHICS_DDCCI_MONITOR_RETURNED_INVALID_TIMING_STATUS_BYTE __constant_cpu_to_le32(0xC01E0586)
1625#define STATUS_GRAPHICS_DDCCI_INVALID_CAPABILITIES_STRING __constant_cpu_to_le32(0xC01E0587)
1626#define STATUS_GRAPHICS_MCA_INTERNAL_ERROR __constant_cpu_to_le32(0xC01E0588)
1627#define STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_COMMAND __constant_cpu_to_le32(0xC01E0589)
1628#define STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_LENGTH __constant_cpu_to_le32(0xC01E058A)
1629#define STATUS_GRAPHICS_DDCCI_INVALID_MESSAGE_CHECKSUM __constant_cpu_to_le32(0xC01E058B)
1630#define STATUS_GRAPHICS_INVALID_PHYSICAL_MONITOR_HANDLE __constant_cpu_to_le32(0xC01E058C)
1631#define STATUS_GRAPHICS_MONITOR_NO_LONGER_EXISTS __constant_cpu_to_le32(0xC01E058D)
1632#define STATUS_GRAPHICS_ONLY_CONSOLE_SESSION_SUPPORTED __constant_cpu_to_le32(0xC01E05E0)
1633#define STATUS_GRAPHICS_NO_DISPLAY_DEVICE_CORRESPONDS_TO_NAME __constant_cpu_to_le32(0xC01E05E1)
1634#define STATUS_GRAPHICS_DISPLAY_DEVICE_NOT_ATTACHED_TO_DESKTOP __constant_cpu_to_le32(0xC01E05E2)
1635#define STATUS_GRAPHICS_MIRRORING_DEVICES_NOT_SUPPORTED __constant_cpu_to_le32(0xC01E05E3)
1636#define STATUS_GRAPHICS_INVALID_POINTER __constant_cpu_to_le32(0xC01E05E4)
1637#define STATUS_GRAPHICS_NO_MONITORS_CORRESPOND_TO_DISPLAY_DEVICE __constant_cpu_to_le32(0xC01E05E5)
1638#define STATUS_GRAPHICS_PARAMETER_ARRAY_TOO_SMALL __constant_cpu_to_le32(0xC01E05E6)
1639#define STATUS_GRAPHICS_INTERNAL_ERROR __constant_cpu_to_le32(0xC01E05E7)
1640#define STATUS_GRAPHICS_SESSION_TYPE_CHANGE_IN_PROGRESS __constant_cpu_to_le32(0xC01E05E8)
1641#define STATUS_FVE_LOCKED_VOLUME __constant_cpu_to_le32(0xC0210000)
1642#define STATUS_FVE_NOT_ENCRYPTED __constant_cpu_to_le32(0xC0210001)
1643#define STATUS_FVE_BAD_INFORMATION __constant_cpu_to_le32(0xC0210002)
1644#define STATUS_FVE_TOO_SMALL __constant_cpu_to_le32(0xC0210003)
1645#define STATUS_FVE_FAILED_WRONG_FS __constant_cpu_to_le32(0xC0210004)
1646#define STATUS_FVE_FAILED_BAD_FS __constant_cpu_to_le32(0xC0210005)
1647#define STATUS_FVE_FS_NOT_EXTENDED __constant_cpu_to_le32(0xC0210006)
1648#define STATUS_FVE_FS_MOUNTED __constant_cpu_to_le32(0xC0210007)
1649#define STATUS_FVE_NO_LICENSE __constant_cpu_to_le32(0xC0210008)
1650#define STATUS_FVE_ACTION_NOT_ALLOWED __constant_cpu_to_le32(0xC0210009)
1651#define STATUS_FVE_BAD_DATA __constant_cpu_to_le32(0xC021000A)
1652#define STATUS_FVE_VOLUME_NOT_BOUND __constant_cpu_to_le32(0xC021000B)
1653#define STATUS_FVE_NOT_DATA_VOLUME __constant_cpu_to_le32(0xC021000C)
1654#define STATUS_FVE_CONV_READ_ERROR __constant_cpu_to_le32(0xC021000D)
1655#define STATUS_FVE_CONV_WRITE_ERROR __constant_cpu_to_le32(0xC021000E)
1656#define STATUS_FVE_OVERLAPPED_UPDATE __constant_cpu_to_le32(0xC021000F)
1657#define STATUS_FVE_FAILED_SECTOR_SIZE __constant_cpu_to_le32(0xC0210010)
1658#define STATUS_FVE_FAILED_AUTHENTICATION __constant_cpu_to_le32(0xC0210011)
1659#define STATUS_FVE_NOT_OS_VOLUME __constant_cpu_to_le32(0xC0210012)
1660#define STATUS_FVE_KEYFILE_NOT_FOUND __constant_cpu_to_le32(0xC0210013)
1661#define STATUS_FVE_KEYFILE_INVALID __constant_cpu_to_le32(0xC0210014)
1662#define STATUS_FVE_KEYFILE_NO_VMK __constant_cpu_to_le32(0xC0210015)
1663#define STATUS_FVE_TPM_DISABLED __constant_cpu_to_le32(0xC0210016)
1664#define STATUS_FVE_TPM_SRK_AUTH_NOT_ZERO __constant_cpu_to_le32(0xC0210017)
1665#define STATUS_FVE_TPM_INVALID_PCR __constant_cpu_to_le32(0xC0210018)
1666#define STATUS_FVE_TPM_NO_VMK __constant_cpu_to_le32(0xC0210019)
1667#define STATUS_FVE_PIN_INVALID __constant_cpu_to_le32(0xC021001A)
1668#define STATUS_FVE_AUTH_INVALID_APPLICATION __constant_cpu_to_le32(0xC021001B)
1669#define STATUS_FVE_AUTH_INVALID_CONFIG __constant_cpu_to_le32(0xC021001C)
1670#define STATUS_FVE_DEBUGGER_ENABLED __constant_cpu_to_le32(0xC021001D)
1671#define STATUS_FVE_DRY_RUN_FAILED __constant_cpu_to_le32(0xC021001E)
1672#define STATUS_FVE_BAD_METADATA_POINTER __constant_cpu_to_le32(0xC021001F)
1673#define STATUS_FVE_OLD_METADATA_COPY __constant_cpu_to_le32(0xC0210020)
1674#define STATUS_FVE_REBOOT_REQUIRED __constant_cpu_to_le32(0xC0210021)
1675#define STATUS_FVE_RAW_ACCESS __constant_cpu_to_le32(0xC0210022)
1676#define STATUS_FVE_RAW_BLOCKED __constant_cpu_to_le32(0xC0210023)
1677#define STATUS_FWP_CALLOUT_NOT_FOUND __constant_cpu_to_le32(0xC0220001)
1678#define STATUS_FWP_CONDITION_NOT_FOUND __constant_cpu_to_le32(0xC0220002)
1679#define STATUS_FWP_FILTER_NOT_FOUND __constant_cpu_to_le32(0xC0220003)
1680#define STATUS_FWP_LAYER_NOT_FOUND __constant_cpu_to_le32(0xC0220004)
1681#define STATUS_FWP_PROVIDER_NOT_FOUND __constant_cpu_to_le32(0xC0220005)
1682#define STATUS_FWP_PROVIDER_CONTEXT_NOT_FOUND __constant_cpu_to_le32(0xC0220006)
1683#define STATUS_FWP_SUBLAYER_NOT_FOUND __constant_cpu_to_le32(0xC0220007)
1684#define STATUS_FWP_NOT_FOUND __constant_cpu_to_le32(0xC0220008)
1685#define STATUS_FWP_ALREADY_EXISTS __constant_cpu_to_le32(0xC0220009)
1686#define STATUS_FWP_IN_USE __constant_cpu_to_le32(0xC022000A)
1687#define STATUS_FWP_DYNAMIC_SESSION_IN_PROGRESS __constant_cpu_to_le32(0xC022000B)
1688#define STATUS_FWP_WRONG_SESSION __constant_cpu_to_le32(0xC022000C)
1689#define STATUS_FWP_NO_TXN_IN_PROGRESS __constant_cpu_to_le32(0xC022000D)
1690#define STATUS_FWP_TXN_IN_PROGRESS __constant_cpu_to_le32(0xC022000E)
1691#define STATUS_FWP_TXN_ABORTED __constant_cpu_to_le32(0xC022000F)
1692#define STATUS_FWP_SESSION_ABORTED __constant_cpu_to_le32(0xC0220010)
1693#define STATUS_FWP_INCOMPATIBLE_TXN __constant_cpu_to_le32(0xC0220011)
1694#define STATUS_FWP_TIMEOUT __constant_cpu_to_le32(0xC0220012)
1695#define STATUS_FWP_NET_EVENTS_DISABLED __constant_cpu_to_le32(0xC0220013)
1696#define STATUS_FWP_INCOMPATIBLE_LAYER __constant_cpu_to_le32(0xC0220014)
1697#define STATUS_FWP_KM_CLIENTS_ONLY __constant_cpu_to_le32(0xC0220015)
1698#define STATUS_FWP_LIFETIME_MISMATCH __constant_cpu_to_le32(0xC0220016)
1699#define STATUS_FWP_BUILTIN_OBJECT __constant_cpu_to_le32(0xC0220017)
1700#define STATUS_FWP_TOO_MANY_BOOTTIME_FILTERS __constant_cpu_to_le32(0xC0220018)
1701#define STATUS_FWP_TOO_MANY_CALLOUTS __constant_cpu_to_le32(0xC0220018)
1702#define STATUS_FWP_NOTIFICATION_DROPPED __constant_cpu_to_le32(0xC0220019)
1703#define STATUS_FWP_TRAFFIC_MISMATCH __constant_cpu_to_le32(0xC022001A)
1704#define STATUS_FWP_INCOMPATIBLE_SA_STATE __constant_cpu_to_le32(0xC022001B)
1705#define STATUS_FWP_NULL_POINTER __constant_cpu_to_le32(0xC022001C)
1706#define STATUS_FWP_INVALID_ENUMERATOR __constant_cpu_to_le32(0xC022001D)
1707#define STATUS_FWP_INVALID_FLAGS __constant_cpu_to_le32(0xC022001E)
1708#define STATUS_FWP_INVALID_NET_MASK __constant_cpu_to_le32(0xC022001F)
1709#define STATUS_FWP_INVALID_RANGE __constant_cpu_to_le32(0xC0220020)
1710#define STATUS_FWP_INVALID_INTERVAL __constant_cpu_to_le32(0xC0220021)
1711#define STATUS_FWP_ZERO_LENGTH_ARRAY __constant_cpu_to_le32(0xC0220022)
1712#define STATUS_FWP_NULL_DISPLAY_NAME __constant_cpu_to_le32(0xC0220023)
1713#define STATUS_FWP_INVALID_ACTION_TYPE __constant_cpu_to_le32(0xC0220024)
1714#define STATUS_FWP_INVALID_WEIGHT __constant_cpu_to_le32(0xC0220025)
1715#define STATUS_FWP_MATCH_TYPE_MISMATCH __constant_cpu_to_le32(0xC0220026)
1716#define STATUS_FWP_TYPE_MISMATCH __constant_cpu_to_le32(0xC0220027)
1717#define STATUS_FWP_OUT_OF_BOUNDS __constant_cpu_to_le32(0xC0220028)
1718#define STATUS_FWP_RESERVED __constant_cpu_to_le32(0xC0220029)
1719#define STATUS_FWP_DUPLICATE_CONDITION __constant_cpu_to_le32(0xC022002A)
1720#define STATUS_FWP_DUPLICATE_KEYMOD __constant_cpu_to_le32(0xC022002B)
1721#define STATUS_FWP_ACTION_INCOMPATIBLE_WITH_LAYER __constant_cpu_to_le32(0xC022002C)
1722#define STATUS_FWP_ACTION_INCOMPATIBLE_WITH_SUBLAYER __constant_cpu_to_le32(0xC022002D)
1723#define STATUS_FWP_CONTEXT_INCOMPATIBLE_WITH_LAYER __constant_cpu_to_le32(0xC022002E)
1724#define STATUS_FWP_CONTEXT_INCOMPATIBLE_WITH_CALLOUT __constant_cpu_to_le32(0xC022002F)
1725#define STATUS_FWP_INCOMPATIBLE_AUTH_METHOD __constant_cpu_to_le32(0xC0220030)
1726#define STATUS_FWP_INCOMPATIBLE_DH_GROUP __constant_cpu_to_le32(0xC0220031)
1727#define STATUS_FWP_EM_NOT_SUPPORTED __constant_cpu_to_le32(0xC0220032)
1728#define STATUS_FWP_NEVER_MATCH __constant_cpu_to_le32(0xC0220033)
1729#define STATUS_FWP_PROVIDER_CONTEXT_MISMATCH __constant_cpu_to_le32(0xC0220034)
1730#define STATUS_FWP_INVALID_PARAMETER __constant_cpu_to_le32(0xC0220035)
1731#define STATUS_FWP_TOO_MANY_SUBLAYERS __constant_cpu_to_le32(0xC0220036)
1732#define STATUS_FWP_CALLOUT_NOTIFICATION_FAILED __constant_cpu_to_le32(0xC0220037)
1733#define STATUS_FWP_INCOMPATIBLE_AUTH_CONFIG __constant_cpu_to_le32(0xC0220038)
1734#define STATUS_FWP_INCOMPATIBLE_CIPHER_CONFIG __constant_cpu_to_le32(0xC0220039)
1735#define STATUS_FWP_TCPIP_NOT_READY __constant_cpu_to_le32(0xC0220100)
1736#define STATUS_FWP_INJECT_HANDLE_CLOSING __constant_cpu_to_le32(0xC0220101)
1737#define STATUS_FWP_INJECT_HANDLE_STALE __constant_cpu_to_le32(0xC0220102)
1738#define STATUS_FWP_CANNOT_PEND __constant_cpu_to_le32(0xC0220103)
1739#define STATUS_NDIS_CLOSING __constant_cpu_to_le32(0xC0230002)
1740#define STATUS_NDIS_BAD_VERSION __constant_cpu_to_le32(0xC0230004)
1741#define STATUS_NDIS_BAD_CHARACTERISTICS __constant_cpu_to_le32(0xC0230005)
1742#define STATUS_NDIS_ADAPTER_NOT_FOUND __constant_cpu_to_le32(0xC0230006)
1743#define STATUS_NDIS_OPEN_FAILED __constant_cpu_to_le32(0xC0230007)
1744#define STATUS_NDIS_DEVICE_FAILED __constant_cpu_to_le32(0xC0230008)
1745#define STATUS_NDIS_MULTICAST_FULL __constant_cpu_to_le32(0xC0230009)
1746#define STATUS_NDIS_MULTICAST_EXISTS __constant_cpu_to_le32(0xC023000A)
1747#define STATUS_NDIS_MULTICAST_NOT_FOUND __constant_cpu_to_le32(0xC023000B)
1748#define STATUS_NDIS_REQUEST_ABORTED __constant_cpu_to_le32(0xC023000C)
1749#define STATUS_NDIS_RESET_IN_PROGRESS __constant_cpu_to_le32(0xC023000D)
1750#define STATUS_NDIS_INVALID_PACKET __constant_cpu_to_le32(0xC023000F)
1751#define STATUS_NDIS_INVALID_DEVICE_REQUEST __constant_cpu_to_le32(0xC0230010)
1752#define STATUS_NDIS_ADAPTER_NOT_READY __constant_cpu_to_le32(0xC0230011)
1753#define STATUS_NDIS_INVALID_LENGTH __constant_cpu_to_le32(0xC0230014)
1754#define STATUS_NDIS_INVALID_DATA __constant_cpu_to_le32(0xC0230015)
1755#define STATUS_NDIS_BUFFER_TOO_SHORT __constant_cpu_to_le32(0xC0230016)
1756#define STATUS_NDIS_INVALID_OID __constant_cpu_to_le32(0xC0230017)
1757#define STATUS_NDIS_ADAPTER_REMOVED __constant_cpu_to_le32(0xC0230018)
1758#define STATUS_NDIS_UNSUPPORTED_MEDIA __constant_cpu_to_le32(0xC0230019)
1759#define STATUS_NDIS_GROUP_ADDRESS_IN_USE __constant_cpu_to_le32(0xC023001A)
1760#define STATUS_NDIS_FILE_NOT_FOUND __constant_cpu_to_le32(0xC023001B)
1761#define STATUS_NDIS_ERROR_READING_FILE __constant_cpu_to_le32(0xC023001C)
1762#define STATUS_NDIS_ALREADY_MAPPED __constant_cpu_to_le32(0xC023001D)
1763#define STATUS_NDIS_RESOURCE_CONFLICT __constant_cpu_to_le32(0xC023001E)
1764#define STATUS_NDIS_MEDIA_DISCONNECTED __constant_cpu_to_le32(0xC023001F)
1765#define STATUS_NDIS_INVALID_ADDRESS __constant_cpu_to_le32(0xC0230022)
1766#define STATUS_NDIS_PAUSED __constant_cpu_to_le32(0xC023002A)
1767#define STATUS_NDIS_INTERFACE_NOT_FOUND __constant_cpu_to_le32(0xC023002B)
1768#define STATUS_NDIS_UNSUPPORTED_REVISION __constant_cpu_to_le32(0xC023002C)
1769#define STATUS_NDIS_INVALID_PORT __constant_cpu_to_le32(0xC023002D)
1770#define STATUS_NDIS_INVALID_PORT_STATE __constant_cpu_to_le32(0xC023002E)
1771#define STATUS_NDIS_LOW_POWER_STATE __constant_cpu_to_le32(0xC023002F)
1772#define STATUS_NDIS_NOT_SUPPORTED __constant_cpu_to_le32(0xC02300BB)
1773#define STATUS_NDIS_DOT11_AUTO_CONFIG_ENABLED __constant_cpu_to_le32(0xC0232000)
1774#define STATUS_NDIS_DOT11_MEDIA_IN_USE __constant_cpu_to_le32(0xC0232001)
1775#define STATUS_NDIS_DOT11_POWER_STATE_INVALID __constant_cpu_to_le32(0xC0232002)
1776#define STATUS_IPSEC_BAD_SPI __constant_cpu_to_le32(0xC0360001)
1777#define STATUS_IPSEC_SA_LIFETIME_EXPIRED __constant_cpu_to_le32(0xC0360002)
1778#define STATUS_IPSEC_WRONG_SA __constant_cpu_to_le32(0xC0360003)
1779#define STATUS_IPSEC_REPLAY_CHECK_FAILED __constant_cpu_to_le32(0xC0360004)
1780#define STATUS_IPSEC_INVALID_PACKET __constant_cpu_to_le32(0xC0360005)
1781#define STATUS_IPSEC_INTEGRITY_CHECK_FAILED __constant_cpu_to_le32(0xC0360006)
1782#define STATUS_IPSEC_CLEAR_TEXT_DROP __constant_cpu_to_le32(0xC0360007)
diff --git a/fs/cifs/smb2transport.c b/fs/cifs/smb2transport.c
new file mode 100644
index 000000000000..31f5d420b3ea
--- /dev/null
+++ b/fs/cifs/smb2transport.c
@@ -0,0 +1,172 @@
1/*
2 * fs/cifs/smb2transport.c
3 *
4 * Copyright (C) International Business Machines Corp., 2002, 2011
5 * Etersoft, 2012
6 * Author(s): Steve French (sfrench@us.ibm.com)
7 * Jeremy Allison (jra@samba.org) 2006
8 * Pavel Shilovsky (pshilovsky@samba.org) 2012
9 *
10 * This library is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU Lesser General Public License as published
12 * by the Free Software Foundation; either version 2.1 of the License, or
13 * (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
18 * the GNU Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public License
21 * along with this library; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 */
24
25#include <linux/fs.h>
26#include <linux/list.h>
27#include <linux/wait.h>
28#include <linux/net.h>
29#include <linux/delay.h>
30#include <linux/uaccess.h>
31#include <asm/processor.h>
32#include <linux/mempool.h>
33#include "smb2pdu.h"
34#include "cifsglob.h"
35#include "cifsproto.h"
36#include "smb2proto.h"
37#include "cifs_debug.h"
38#include "smb2status.h"
39
40/*
41 * Set message id for the request. Should be called after wait_for_free_request
42 * and when srv_mutex is held.
43 */
44static inline void
45smb2_seq_num_into_buf(struct TCP_Server_Info *server, struct smb2_hdr *hdr)
46{
47 hdr->MessageId = get_next_mid(server);
48}
49
50static struct mid_q_entry *
51smb2_mid_entry_alloc(const struct smb2_hdr *smb_buffer,
52 struct TCP_Server_Info *server)
53{
54 struct mid_q_entry *temp;
55
56 if (server == NULL) {
57 cERROR(1, "Null TCP session in smb2_mid_entry_alloc");
58 return NULL;
59 }
60
61 temp = mempool_alloc(cifs_mid_poolp, GFP_NOFS);
62 if (temp == NULL)
63 return temp;
64 else {
65 memset(temp, 0, sizeof(struct mid_q_entry));
66 temp->mid = smb_buffer->MessageId; /* always LE */
67 temp->pid = current->pid;
68 temp->command = smb_buffer->Command; /* Always LE */
69 temp->when_alloc = jiffies;
70 temp->server = server;
71
72 /*
73 * The default is for the mid to be synchronous, so the
74 * default callback just wakes up the current task.
75 */
76 temp->callback = cifs_wake_up_task;
77 temp->callback_data = current;
78 }
79
80 atomic_inc(&midCount);
81 temp->mid_state = MID_REQUEST_ALLOCATED;
82 return temp;
83}
84
85static int
86smb2_get_mid_entry(struct cifs_ses *ses, struct smb2_hdr *buf,
87 struct mid_q_entry **mid)
88{
89 if (ses->server->tcpStatus == CifsExiting)
90 return -ENOENT;
91
92 if (ses->server->tcpStatus == CifsNeedReconnect) {
93 cFYI(1, "tcp session dead - return to caller to retry");
94 return -EAGAIN;
95 }
96
97 if (ses->status != CifsGood) {
98 /* check if SMB2 session is bad because we are setting it up */
99 if ((buf->Command != SMB2_SESSION_SETUP) &&
100 (buf->Command != SMB2_NEGOTIATE))
101 return -EAGAIN;
102 /* else ok - we are setting up session */
103 }
104 *mid = smb2_mid_entry_alloc(buf, ses->server);
105 if (*mid == NULL)
106 return -ENOMEM;
107 spin_lock(&GlobalMid_Lock);
108 list_add_tail(&(*mid)->qhead, &ses->server->pending_mid_q);
109 spin_unlock(&GlobalMid_Lock);
110 return 0;
111}
112
113int
114smb2_check_receive(struct mid_q_entry *mid, struct TCP_Server_Info *server,
115 bool log_error)
116{
117 unsigned int len = get_rfc1002_length(mid->resp_buf);
118
119 dump_smb(mid->resp_buf, min_t(u32, 80, len));
120 /* convert the length into a more usable form */
121 /* BB - uncomment with SMB2 signing implementation */
122 /* if ((len > 24) &&
123 (server->sec_mode & (SECMODE_SIGN_REQUIRED|SECMODE_SIGN_ENABLED))) {
124 if (smb2_verify_signature(mid->resp_buf, server))
125 cERROR(1, "Unexpected SMB signature");
126 } */
127
128 return map_smb2_to_linux_error(mid->resp_buf, log_error);
129}
130
131int
132smb2_setup_request(struct cifs_ses *ses, struct kvec *iov,
133 unsigned int nvec, struct mid_q_entry **ret_mid)
134{
135 int rc;
136 struct smb2_hdr *hdr = (struct smb2_hdr *)iov[0].iov_base;
137 struct mid_q_entry *mid;
138
139 smb2_seq_num_into_buf(ses->server, hdr);
140
141 rc = smb2_get_mid_entry(ses, hdr, &mid);
142 if (rc)
143 return rc;
144 /* rc = smb2_sign_smb2(iov, nvec, ses->server);
145 if (rc)
146 delete_mid(mid); */
147 *ret_mid = mid;
148 return rc;
149}
150
151int
152smb2_setup_async_request(struct TCP_Server_Info *server, struct kvec *iov,
153 unsigned int nvec, struct mid_q_entry **ret_mid)
154{
155 int rc = 0;
156 struct smb2_hdr *hdr = (struct smb2_hdr *)iov[0].iov_base;
157 struct mid_q_entry *mid;
158
159 smb2_seq_num_into_buf(server, hdr);
160
161 mid = smb2_mid_entry_alloc(hdr, server);
162 if (mid == NULL)
163 return -ENOMEM;
164
165 /* rc = smb2_sign_smb2(iov, nvec, server);
166 if (rc) {
167 DeleteMidQEntry(mid);
168 return rc;
169 }*/
170 *ret_mid = mid;
171 return rc;
172}
diff --git a/fs/cifs/smbencrypt.c b/fs/cifs/smbencrypt.c
index d5cd9aa7eacc..a0a58fbe2c10 100644
--- a/fs/cifs/smbencrypt.c
+++ b/fs/cifs/smbencrypt.c
@@ -78,7 +78,7 @@ smbhash(unsigned char *out, const unsigned char *in, unsigned char *key)
78 tfm_des = crypto_alloc_blkcipher("ecb(des)", 0, CRYPTO_ALG_ASYNC); 78 tfm_des = crypto_alloc_blkcipher("ecb(des)", 0, CRYPTO_ALG_ASYNC);
79 if (IS_ERR(tfm_des)) { 79 if (IS_ERR(tfm_des)) {
80 rc = PTR_ERR(tfm_des); 80 rc = PTR_ERR(tfm_des);
81 cERROR(1, "could not allocate des crypto API\n"); 81 cERROR(1, "could not allocate des crypto API");
82 goto smbhash_err; 82 goto smbhash_err;
83 } 83 }
84 84
@@ -91,7 +91,7 @@ smbhash(unsigned char *out, const unsigned char *in, unsigned char *key)
91 91
92 rc = crypto_blkcipher_encrypt(&desc, &sgout, &sgin, 8); 92 rc = crypto_blkcipher_encrypt(&desc, &sgout, &sgin, 8);
93 if (rc) 93 if (rc)
94 cERROR(1, "could not encrypt crypt key rc: %d\n", rc); 94 cERROR(1, "could not encrypt crypt key rc: %d", rc);
95 95
96 crypto_free_blkcipher(tfm_des); 96 crypto_free_blkcipher(tfm_des);
97smbhash_err: 97smbhash_err:
@@ -139,14 +139,14 @@ mdfour(unsigned char *md4_hash, unsigned char *link_str, int link_len)
139 md4 = crypto_alloc_shash("md4", 0, 0); 139 md4 = crypto_alloc_shash("md4", 0, 0);
140 if (IS_ERR(md4)) { 140 if (IS_ERR(md4)) {
141 rc = PTR_ERR(md4); 141 rc = PTR_ERR(md4);
142 cERROR(1, "%s: Crypto md4 allocation error %d\n", __func__, rc); 142 cERROR(1, "%s: Crypto md4 allocation error %d", __func__, rc);
143 return rc; 143 return rc;
144 } 144 }
145 size = sizeof(struct shash_desc) + crypto_shash_descsize(md4); 145 size = sizeof(struct shash_desc) + crypto_shash_descsize(md4);
146 sdescmd4 = kmalloc(size, GFP_KERNEL); 146 sdescmd4 = kmalloc(size, GFP_KERNEL);
147 if (!sdescmd4) { 147 if (!sdescmd4) {
148 rc = -ENOMEM; 148 rc = -ENOMEM;
149 cERROR(1, "%s: Memory allocation failure\n", __func__); 149 cERROR(1, "%s: Memory allocation failure", __func__);
150 goto mdfour_err; 150 goto mdfour_err;
151 } 151 }
152 sdescmd4->shash.tfm = md4; 152 sdescmd4->shash.tfm = md4;
@@ -154,17 +154,17 @@ mdfour(unsigned char *md4_hash, unsigned char *link_str, int link_len)
154 154
155 rc = crypto_shash_init(&sdescmd4->shash); 155 rc = crypto_shash_init(&sdescmd4->shash);
156 if (rc) { 156 if (rc) {
157 cERROR(1, "%s: Could not init md4 shash\n", __func__); 157 cERROR(1, "%s: Could not init md4 shash", __func__);
158 goto mdfour_err; 158 goto mdfour_err;
159 } 159 }
160 rc = crypto_shash_update(&sdescmd4->shash, link_str, link_len); 160 rc = crypto_shash_update(&sdescmd4->shash, link_str, link_len);
161 if (rc) { 161 if (rc) {
162 cERROR(1, "%s: Could not update with link_str\n", __func__); 162 cERROR(1, "%s: Could not update with link_str", __func__);
163 goto mdfour_err; 163 goto mdfour_err;
164 } 164 }
165 rc = crypto_shash_final(&sdescmd4->shash, md4_hash); 165 rc = crypto_shash_final(&sdescmd4->shash, md4_hash);
166 if (rc) 166 if (rc)
167 cERROR(1, "%s: Could not genereate md4 hash\n", __func__); 167 cERROR(1, "%s: Could not genereate md4 hash", __func__);
168 168
169mdfour_err: 169mdfour_err:
170 crypto_free_shash(md4); 170 crypto_free_shash(md4);
diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index f25d4ea14be4..83867ef348df 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -35,10 +35,8 @@
35#include "cifsproto.h" 35#include "cifsproto.h"
36#include "cifs_debug.h" 36#include "cifs_debug.h"
37 37
38extern mempool_t *cifs_mid_poolp; 38void
39 39cifs_wake_up_task(struct mid_q_entry *mid)
40static void
41wake_up_task(struct mid_q_entry *mid)
42{ 40{
43 wake_up_process(mid->callback_data); 41 wake_up_process(mid->callback_data);
44} 42}
@@ -65,12 +63,13 @@ AllocMidQEntry(const struct smb_hdr *smb_buffer, struct TCP_Server_Info *server)
65 /* do_gettimeofday(&temp->when_sent);*/ /* easier to use jiffies */ 63 /* do_gettimeofday(&temp->when_sent);*/ /* easier to use jiffies */
66 /* when mid allocated can be before when sent */ 64 /* when mid allocated can be before when sent */
67 temp->when_alloc = jiffies; 65 temp->when_alloc = jiffies;
66 temp->server = server;
68 67
69 /* 68 /*
70 * The default is for the mid to be synchronous, so the 69 * The default is for the mid to be synchronous, so the
71 * default callback just wakes up the current task. 70 * default callback just wakes up the current task.
72 */ 71 */
73 temp->callback = wake_up_task; 72 temp->callback = cifs_wake_up_task;
74 temp->callback_data = current; 73 temp->callback_data = current;
75 } 74 }
76 75
@@ -83,6 +82,7 @@ void
83DeleteMidQEntry(struct mid_q_entry *midEntry) 82DeleteMidQEntry(struct mid_q_entry *midEntry)
84{ 83{
85#ifdef CONFIG_CIFS_STATS2 84#ifdef CONFIG_CIFS_STATS2
85 __le16 command = midEntry->server->vals->lock_cmd;
86 unsigned long now; 86 unsigned long now;
87#endif 87#endif
88 midEntry->mid_state = MID_FREE; 88 midEntry->mid_state = MID_FREE;
@@ -96,8 +96,7 @@ DeleteMidQEntry(struct mid_q_entry *midEntry)
96 /* commands taking longer than one second are indications that 96 /* commands taking longer than one second are indications that
97 something is wrong, unless it is quite a slow link or server */ 97 something is wrong, unless it is quite a slow link or server */
98 if ((now - midEntry->when_alloc) > HZ) { 98 if ((now - midEntry->when_alloc) > HZ) {
99 if ((cifsFYI & CIFS_TIMER) && 99 if ((cifsFYI & CIFS_TIMER) && (midEntry->command != command)) {
100 (midEntry->command != cpu_to_le16(SMB_COM_LOCKING_ANDX))) {
101 printk(KERN_DEBUG " CIFS slow rsp: cmd %d mid %llu", 100 printk(KERN_DEBUG " CIFS slow rsp: cmd %d mid %llu",
102 midEntry->command, midEntry->mid); 101 midEntry->command, midEntry->mid);
103 printk(" A: 0x%lx S: 0x%lx R: 0x%lx\n", 102 printk(" A: 0x%lx S: 0x%lx R: 0x%lx\n",
@@ -126,7 +125,6 @@ smb_sendv(struct TCP_Server_Info *server, struct kvec *iov, int n_vec)
126 int rc = 0; 125 int rc = 0;
127 int i = 0; 126 int i = 0;
128 struct msghdr smb_msg; 127 struct msghdr smb_msg;
129 __be32 *buf_len = (__be32 *)(iov[0].iov_base);
130 unsigned int len = iov[0].iov_len; 128 unsigned int len = iov[0].iov_len;
131 unsigned int total_len; 129 unsigned int total_len;
132 int first_vec = 0; 130 int first_vec = 0;
@@ -235,9 +233,6 @@ smb_sendv(struct TCP_Server_Info *server, struct kvec *iov, int n_vec)
235 else 233 else
236 rc = 0; 234 rc = 0;
237 235
238 /* Don't want to modify the buffer as a side effect of this call. */
239 *buf_len = cpu_to_be32(smb_buf_length);
240
241 return rc; 236 return rc;
242} 237}
243 238
@@ -254,13 +249,13 @@ smb_send(struct TCP_Server_Info *server, struct smb_hdr *smb_buffer,
254} 249}
255 250
256static int 251static int
257wait_for_free_credits(struct TCP_Server_Info *server, const int optype, 252wait_for_free_credits(struct TCP_Server_Info *server, const int timeout,
258 int *credits) 253 int *credits)
259{ 254{
260 int rc; 255 int rc;
261 256
262 spin_lock(&server->req_lock); 257 spin_lock(&server->req_lock);
263 if (optype == CIFS_ASYNC_OP) { 258 if (timeout == CIFS_ASYNC_OP) {
264 /* oplock breaks must not be held up */ 259 /* oplock breaks must not be held up */
265 server->in_flight++; 260 server->in_flight++;
266 *credits -= 1; 261 *credits -= 1;
@@ -290,7 +285,7 @@ wait_for_free_credits(struct TCP_Server_Info *server, const int optype,
290 */ 285 */
291 286
292 /* update # of requests on the wire to server */ 287 /* update # of requests on the wire to server */
293 if (optype != CIFS_BLOCKING_OP) { 288 if (timeout != CIFS_BLOCKING_OP) {
294 *credits -= 1; 289 *credits -= 1;
295 server->in_flight++; 290 server->in_flight++;
296 } 291 }
@@ -302,10 +297,11 @@ wait_for_free_credits(struct TCP_Server_Info *server, const int optype,
302} 297}
303 298
304static int 299static int
305wait_for_free_request(struct TCP_Server_Info *server, const int optype) 300wait_for_free_request(struct TCP_Server_Info *server, const int timeout,
301 const int optype)
306{ 302{
307 return wait_for_free_credits(server, optype, 303 return wait_for_free_credits(server, timeout,
308 server->ops->get_credits_field(server)); 304 server->ops->get_credits_field(server, optype));
309} 305}
310 306
311static int allocate_mid(struct cifs_ses *ses, struct smb_hdr *in_buf, 307static int allocate_mid(struct cifs_ses *ses, struct smb_hdr *in_buf,
@@ -349,7 +345,7 @@ wait_for_response(struct TCP_Server_Info *server, struct mid_q_entry *midQ)
349 return 0; 345 return 0;
350} 346}
351 347
352static int 348int
353cifs_setup_async_request(struct TCP_Server_Info *server, struct kvec *iov, 349cifs_setup_async_request(struct TCP_Server_Info *server, struct kvec *iov,
354 unsigned int nvec, struct mid_q_entry **ret_mid) 350 unsigned int nvec, struct mid_q_entry **ret_mid)
355{ 351{
@@ -365,7 +361,7 @@ cifs_setup_async_request(struct TCP_Server_Info *server, struct kvec *iov,
365 if (mid == NULL) 361 if (mid == NULL)
366 return -ENOMEM; 362 return -ENOMEM;
367 363
368 rc = cifs_sign_smb2(iov, nvec, server, &mid->sequence_number); 364 rc = cifs_sign_smbv(iov, nvec, server, &mid->sequence_number);
369 if (rc) { 365 if (rc) {
370 DeleteMidQEntry(mid); 366 DeleteMidQEntry(mid);
371 return rc; 367 return rc;
@@ -382,20 +378,23 @@ cifs_setup_async_request(struct TCP_Server_Info *server, struct kvec *iov,
382int 378int
383cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov, 379cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov,
384 unsigned int nvec, mid_receive_t *receive, 380 unsigned int nvec, mid_receive_t *receive,
385 mid_callback_t *callback, void *cbdata, bool ignore_pend) 381 mid_callback_t *callback, void *cbdata, const int flags)
386{ 382{
387 int rc; 383 int rc, timeout, optype;
388 struct mid_q_entry *mid; 384 struct mid_q_entry *mid;
389 385
390 rc = wait_for_free_request(server, ignore_pend ? CIFS_ASYNC_OP : 0); 386 timeout = flags & CIFS_TIMEOUT_MASK;
387 optype = flags & CIFS_OP_MASK;
388
389 rc = wait_for_free_request(server, timeout, optype);
391 if (rc) 390 if (rc)
392 return rc; 391 return rc;
393 392
394 mutex_lock(&server->srv_mutex); 393 mutex_lock(&server->srv_mutex);
395 rc = cifs_setup_async_request(server, iov, nvec, &mid); 394 rc = server->ops->setup_async_request(server, iov, nvec, &mid);
396 if (rc) { 395 if (rc) {
397 mutex_unlock(&server->srv_mutex); 396 mutex_unlock(&server->srv_mutex);
398 add_credits(server, 1); 397 add_credits(server, 1, optype);
399 wake_up(&server->request_q); 398 wake_up(&server->request_q);
400 return rc; 399 return rc;
401 } 400 }
@@ -421,7 +420,7 @@ cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov,
421 return 0; 420 return 0;
422 421
423 delete_mid(mid); 422 delete_mid(mid);
424 add_credits(server, 1); 423 add_credits(server, 1, optype);
425 wake_up(&server->request_q); 424 wake_up(&server->request_q);
426 return rc; 425 return rc;
427} 426}
@@ -528,7 +527,7 @@ cifs_setup_request(struct cifs_ses *ses, struct kvec *iov,
528 rc = allocate_mid(ses, hdr, &mid); 527 rc = allocate_mid(ses, hdr, &mid);
529 if (rc) 528 if (rc)
530 return rc; 529 return rc;
531 rc = cifs_sign_smb2(iov, nvec, ses->server, &mid->sequence_number); 530 rc = cifs_sign_smbv(iov, nvec, ses->server, &mid->sequence_number);
532 if (rc) 531 if (rc)
533 delete_mid(mid); 532 delete_mid(mid);
534 *ret_mid = mid; 533 *ret_mid = mid;
@@ -537,17 +536,19 @@ cifs_setup_request(struct cifs_ses *ses, struct kvec *iov,
537 536
538int 537int
539SendReceive2(const unsigned int xid, struct cifs_ses *ses, 538SendReceive2(const unsigned int xid, struct cifs_ses *ses,
540 struct kvec *iov, int n_vec, int *pRespBufType /* ret */, 539 struct kvec *iov, int n_vec, int *resp_buf_type /* ret */,
541 const int flags) 540 const int flags)
542{ 541{
543 int rc = 0; 542 int rc = 0;
544 int long_op; 543 int timeout, optype;
545 struct mid_q_entry *midQ; 544 struct mid_q_entry *midQ;
546 char *buf = iov[0].iov_base; 545 char *buf = iov[0].iov_base;
546 unsigned int credits = 1;
547 547
548 long_op = flags & CIFS_TIMEOUT_MASK; 548 timeout = flags & CIFS_TIMEOUT_MASK;
549 optype = flags & CIFS_OP_MASK;
549 550
550 *pRespBufType = CIFS_NO_BUFFER; /* no response buf yet */ 551 *resp_buf_type = CIFS_NO_BUFFER; /* no response buf yet */
551 552
552 if ((ses == NULL) || (ses->server == NULL)) { 553 if ((ses == NULL) || (ses->server == NULL)) {
553 cifs_small_buf_release(buf); 554 cifs_small_buf_release(buf);
@@ -566,7 +567,7 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses,
566 * use ses->maxReq. 567 * use ses->maxReq.
567 */ 568 */
568 569
569 rc = wait_for_free_request(ses->server, long_op); 570 rc = wait_for_free_request(ses->server, timeout, optype);
570 if (rc) { 571 if (rc) {
571 cifs_small_buf_release(buf); 572 cifs_small_buf_release(buf);
572 return rc; 573 return rc;
@@ -585,7 +586,7 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses,
585 mutex_unlock(&ses->server->srv_mutex); 586 mutex_unlock(&ses->server->srv_mutex);
586 cifs_small_buf_release(buf); 587 cifs_small_buf_release(buf);
587 /* Update # of requests on wire to server */ 588 /* Update # of requests on wire to server */
588 add_credits(ses->server, 1); 589 add_credits(ses->server, 1, optype);
589 return rc; 590 return rc;
590 } 591 }
591 592
@@ -602,7 +603,7 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses,
602 goto out; 603 goto out;
603 } 604 }
604 605
605 if (long_op == CIFS_ASYNC_OP) { 606 if (timeout == CIFS_ASYNC_OP) {
606 cifs_small_buf_release(buf); 607 cifs_small_buf_release(buf);
607 goto out; 608 goto out;
608 } 609 }
@@ -615,7 +616,7 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses,
615 midQ->callback = DeleteMidQEntry; 616 midQ->callback = DeleteMidQEntry;
616 spin_unlock(&GlobalMid_Lock); 617 spin_unlock(&GlobalMid_Lock);
617 cifs_small_buf_release(buf); 618 cifs_small_buf_release(buf);
618 add_credits(ses->server, 1); 619 add_credits(ses->server, 1, optype);
619 return rc; 620 return rc;
620 } 621 }
621 spin_unlock(&GlobalMid_Lock); 622 spin_unlock(&GlobalMid_Lock);
@@ -625,7 +626,7 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses,
625 626
626 rc = cifs_sync_mid_result(midQ, ses->server); 627 rc = cifs_sync_mid_result(midQ, ses->server);
627 if (rc != 0) { 628 if (rc != 0) {
628 add_credits(ses->server, 1); 629 add_credits(ses->server, 1, optype);
629 return rc; 630 return rc;
630 } 631 }
631 632
@@ -639,9 +640,11 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses,
639 iov[0].iov_base = buf; 640 iov[0].iov_base = buf;
640 iov[0].iov_len = get_rfc1002_length(buf) + 4; 641 iov[0].iov_len = get_rfc1002_length(buf) + 4;
641 if (midQ->large_buf) 642 if (midQ->large_buf)
642 *pRespBufType = CIFS_LARGE_BUFFER; 643 *resp_buf_type = CIFS_LARGE_BUFFER;
643 else 644 else
644 *pRespBufType = CIFS_SMALL_BUFFER; 645 *resp_buf_type = CIFS_SMALL_BUFFER;
646
647 credits = ses->server->ops->get_credits(midQ);
645 648
646 rc = ses->server->ops->check_receive(midQ, ses->server, 649 rc = ses->server->ops->check_receive(midQ, ses->server,
647 flags & CIFS_LOG_ERROR); 650 flags & CIFS_LOG_ERROR);
@@ -651,7 +654,7 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses,
651 midQ->resp_buf = NULL; 654 midQ->resp_buf = NULL;
652out: 655out:
653 delete_mid(midQ); 656 delete_mid(midQ);
654 add_credits(ses->server, 1); 657 add_credits(ses->server, credits, optype);
655 658
656 return rc; 659 return rc;
657} 660}
@@ -659,7 +662,7 @@ out:
659int 662int
660SendReceive(const unsigned int xid, struct cifs_ses *ses, 663SendReceive(const unsigned int xid, struct cifs_ses *ses,
661 struct smb_hdr *in_buf, struct smb_hdr *out_buf, 664 struct smb_hdr *in_buf, struct smb_hdr *out_buf,
662 int *pbytes_returned, const int long_op) 665 int *pbytes_returned, const int timeout)
663{ 666{
664 int rc = 0; 667 int rc = 0;
665 struct mid_q_entry *midQ; 668 struct mid_q_entry *midQ;
@@ -687,7 +690,7 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
687 return -EIO; 690 return -EIO;
688 } 691 }
689 692
690 rc = wait_for_free_request(ses->server, long_op); 693 rc = wait_for_free_request(ses->server, timeout, 0);
691 if (rc) 694 if (rc)
692 return rc; 695 return rc;
693 696
@@ -701,7 +704,7 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
701 if (rc) { 704 if (rc) {
702 mutex_unlock(&ses->server->srv_mutex); 705 mutex_unlock(&ses->server->srv_mutex);
703 /* Update # of requests on wire to server */ 706 /* Update # of requests on wire to server */
704 add_credits(ses->server, 1); 707 add_credits(ses->server, 1, 0);
705 return rc; 708 return rc;
706 } 709 }
707 710
@@ -722,7 +725,7 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
722 if (rc < 0) 725 if (rc < 0)
723 goto out; 726 goto out;
724 727
725 if (long_op == CIFS_ASYNC_OP) 728 if (timeout == CIFS_ASYNC_OP)
726 goto out; 729 goto out;
727 730
728 rc = wait_for_response(ses->server, midQ); 731 rc = wait_for_response(ses->server, midQ);
@@ -733,7 +736,7 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
733 /* no longer considered to be "in-flight" */ 736 /* no longer considered to be "in-flight" */
734 midQ->callback = DeleteMidQEntry; 737 midQ->callback = DeleteMidQEntry;
735 spin_unlock(&GlobalMid_Lock); 738 spin_unlock(&GlobalMid_Lock);
736 add_credits(ses->server, 1); 739 add_credits(ses->server, 1, 0);
737 return rc; 740 return rc;
738 } 741 }
739 spin_unlock(&GlobalMid_Lock); 742 spin_unlock(&GlobalMid_Lock);
@@ -741,7 +744,7 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
741 744
742 rc = cifs_sync_mid_result(midQ, ses->server); 745 rc = cifs_sync_mid_result(midQ, ses->server);
743 if (rc != 0) { 746 if (rc != 0) {
744 add_credits(ses->server, 1); 747 add_credits(ses->server, 1, 0);
745 return rc; 748 return rc;
746 } 749 }
747 750
@@ -757,7 +760,7 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses,
757 rc = cifs_check_receive(midQ, ses->server, 0); 760 rc = cifs_check_receive(midQ, ses->server, 0);
758out: 761out:
759 delete_mid(midQ); 762 delete_mid(midQ);
760 add_credits(ses->server, 1); 763 add_credits(ses->server, 1, 0);
761 764
762 return rc; 765 return rc;
763} 766}
@@ -822,7 +825,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon,
822 return -EIO; 825 return -EIO;
823 } 826 }
824 827
825 rc = wait_for_free_request(ses->server, CIFS_BLOCKING_OP); 828 rc = wait_for_free_request(ses->server, CIFS_BLOCKING_OP, 0);
826 if (rc) 829 if (rc)
827 return rc; 830 return rc;
828 831
diff --git a/fs/cifs/xattr.c b/fs/cifs/xattr.c
index 10d92cf57ab6..5142f2c60278 100644
--- a/fs/cifs/xattr.c
+++ b/fs/cifs/xattr.c
@@ -39,7 +39,7 @@ int cifs_removexattr(struct dentry *direntry, const char *ea_name)
39{ 39{
40 int rc = -EOPNOTSUPP; 40 int rc = -EOPNOTSUPP;
41#ifdef CONFIG_CIFS_XATTR 41#ifdef CONFIG_CIFS_XATTR
42 int xid; 42 unsigned int xid;
43 struct cifs_sb_info *cifs_sb; 43 struct cifs_sb_info *cifs_sb;
44 struct tcon_link *tlink; 44 struct tcon_link *tlink;
45 struct cifs_tcon *pTcon; 45 struct cifs_tcon *pTcon;
@@ -60,7 +60,7 @@ int cifs_removexattr(struct dentry *direntry, const char *ea_name)
60 return PTR_ERR(tlink); 60 return PTR_ERR(tlink);
61 pTcon = tlink_tcon(tlink); 61 pTcon = tlink_tcon(tlink);
62 62
63 xid = GetXid(); 63 xid = get_xid();
64 64
65 full_path = build_path_from_dentry(direntry); 65 full_path = build_path_from_dentry(direntry);
66 if (full_path == NULL) { 66 if (full_path == NULL) {
@@ -88,7 +88,7 @@ int cifs_removexattr(struct dentry *direntry, const char *ea_name)
88 } 88 }
89remove_ea_exit: 89remove_ea_exit:
90 kfree(full_path); 90 kfree(full_path);
91 FreeXid(xid); 91 free_xid(xid);
92 cifs_put_tlink(tlink); 92 cifs_put_tlink(tlink);
93#endif 93#endif
94 return rc; 94 return rc;
@@ -99,7 +99,7 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
99{ 99{
100 int rc = -EOPNOTSUPP; 100 int rc = -EOPNOTSUPP;
101#ifdef CONFIG_CIFS_XATTR 101#ifdef CONFIG_CIFS_XATTR
102 int xid; 102 unsigned int xid;
103 struct cifs_sb_info *cifs_sb; 103 struct cifs_sb_info *cifs_sb;
104 struct tcon_link *tlink; 104 struct tcon_link *tlink;
105 struct cifs_tcon *pTcon; 105 struct cifs_tcon *pTcon;
@@ -120,7 +120,7 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
120 return PTR_ERR(tlink); 120 return PTR_ERR(tlink);
121 pTcon = tlink_tcon(tlink); 121 pTcon = tlink_tcon(tlink);
122 122
123 xid = GetXid(); 123 xid = get_xid();
124 124
125 full_path = build_path_from_dentry(direntry); 125 full_path = build_path_from_dentry(direntry);
126 if (full_path == NULL) { 126 if (full_path == NULL) {
@@ -221,7 +221,7 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
221 221
222set_ea_exit: 222set_ea_exit:
223 kfree(full_path); 223 kfree(full_path);
224 FreeXid(xid); 224 free_xid(xid);
225 cifs_put_tlink(tlink); 225 cifs_put_tlink(tlink);
226#endif 226#endif
227 return rc; 227 return rc;
@@ -232,7 +232,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
232{ 232{
233 ssize_t rc = -EOPNOTSUPP; 233 ssize_t rc = -EOPNOTSUPP;
234#ifdef CONFIG_CIFS_XATTR 234#ifdef CONFIG_CIFS_XATTR
235 int xid; 235 unsigned int xid;
236 struct cifs_sb_info *cifs_sb; 236 struct cifs_sb_info *cifs_sb;
237 struct tcon_link *tlink; 237 struct tcon_link *tlink;
238 struct cifs_tcon *pTcon; 238 struct cifs_tcon *pTcon;
@@ -253,7 +253,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
253 return PTR_ERR(tlink); 253 return PTR_ERR(tlink);
254 pTcon = tlink_tcon(tlink); 254 pTcon = tlink_tcon(tlink);
255 255
256 xid = GetXid(); 256 xid = get_xid();
257 257
258 full_path = build_path_from_dentry(direntry); 258 full_path = build_path_from_dentry(direntry);
259 if (full_path == NULL) { 259 if (full_path == NULL) {
@@ -355,7 +355,7 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
355 355
356get_ea_exit: 356get_ea_exit:
357 kfree(full_path); 357 kfree(full_path);
358 FreeXid(xid); 358 free_xid(xid);
359 cifs_put_tlink(tlink); 359 cifs_put_tlink(tlink);
360#endif 360#endif
361 return rc; 361 return rc;
@@ -365,7 +365,7 @@ ssize_t cifs_listxattr(struct dentry *direntry, char *data, size_t buf_size)
365{ 365{
366 ssize_t rc = -EOPNOTSUPP; 366 ssize_t rc = -EOPNOTSUPP;
367#ifdef CONFIG_CIFS_XATTR 367#ifdef CONFIG_CIFS_XATTR
368 int xid; 368 unsigned int xid;
369 struct cifs_sb_info *cifs_sb; 369 struct cifs_sb_info *cifs_sb;
370 struct tcon_link *tlink; 370 struct tcon_link *tlink;
371 struct cifs_tcon *pTcon; 371 struct cifs_tcon *pTcon;
@@ -389,7 +389,7 @@ ssize_t cifs_listxattr(struct dentry *direntry, char *data, size_t buf_size)
389 return PTR_ERR(tlink); 389 return PTR_ERR(tlink);
390 pTcon = tlink_tcon(tlink); 390 pTcon = tlink_tcon(tlink);
391 391
392 xid = GetXid(); 392 xid = get_xid();
393 393
394 full_path = build_path_from_dentry(direntry); 394 full_path = build_path_from_dentry(direntry);
395 if (full_path == NULL) { 395 if (full_path == NULL) {
@@ -409,7 +409,7 @@ ssize_t cifs_listxattr(struct dentry *direntry, char *data, size_t buf_size)
409 409
410list_ea_exit: 410list_ea_exit:
411 kfree(full_path); 411 kfree(full_path);
412 FreeXid(xid); 412 free_xid(xid);
413 cifs_put_tlink(tlink); 413 cifs_put_tlink(tlink);
414#endif 414#endif
415 return rc; 415 return rc;