nt.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. win32/nt.h - Zip 3
  3. Copyright (c) 1990-2003 Info-ZIP. All rights reserved.
  4. See the accompanying file LICENSE, version 2003-May-08 or later
  5. (the contents of which are also included in zip.h) for terms of use.
  6. If, for some reason, both of these files are missing, the Info-ZIP license
  7. also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html
  8. */
  9. #ifndef _NT_ZIP_H
  10. #define _NT_ZIP_H
  11. /* central header for EF_NTSD "SD" extra field */
  12. #define EF_NTSD_MAX_VER_SUPPORT (0)
  13. /* describes maximum ver# we know how to handle */
  14. typedef struct
  15. {
  16. USHORT nID;
  17. USHORT nSize;
  18. ULONG lSize;
  19. }
  20. EF_NTSD_C_HEADER, *PEF_NTSD_C_HEADER;
  21. #define EF_NTSD_C_LEN (sizeof(EF_NTSD_C_HEADER))
  22. /* local header for EF_NTSD "SD" extra field */
  23. #pragma pack(1) /* bytes following structure immediately follow BYTE Version */
  24. typedef struct
  25. {
  26. USHORT nID; /* tag for this extra block type */
  27. USHORT nSize; /* total data size for this block */
  28. ULONG lSize; /* uncompressed security descriptor data size */
  29. BYTE Version; /* Version of uncompressed security descriptor data format */
  30. }
  31. IZ_PACKED EF_NTSD_L_HEADER, *PEF_NTSD_L_HEADER;
  32. #pragma pack()
  33. /* ...followed by... */
  34. /* SHORT CType; compression type */
  35. /* ULONG EACRC; CRC value for uncompressed security descriptor data */
  36. /* <var.> Variable length data */
  37. #define EF_NTSD_L_LEN (EF_NTSD_C_LEN + sizeof(BYTE))
  38. /* avoid alignment size computation */
  39. #define NTSD_BUFFERSIZE (1024) /* threshold to cause malloc() */
  40. #define OVERRIDE_BACKUP 1 /* we have SeBackupPrivilege on remote */
  41. #define OVERRIDE_RESTORE 2 /* we have SeRestorePrivilege on remote */
  42. #define OVERRIDE_SACL 4 /* we have SeSystemSecurityPrivilege on remote */
  43. typedef struct {
  44. BOOL bValid; /* are our contents valid? */
  45. BOOL bProcessDefer; /* process deferred entry yet? */
  46. BOOL bUsePrivileges; /* use privilege overrides? */
  47. DWORD dwFileSystemFlags; /* describes target file system */
  48. BOOL bRemote; /* is volume remote? */
  49. DWORD dwRemotePrivileges; /* relevant only on remote volumes */
  50. DWORD dwFileAttributes;
  51. char RootPath[MAX_PATH+1]; /* path to network / filesystem */
  52. } VOLUMECAPS, *PVOLUMECAPS, *LPVOLUMECAPS;
  53. BOOL SecurityGet(char *resource, PVOLUMECAPS VolumeCaps, unsigned char *buffer,
  54. DWORD *cbBuffer);
  55. BOOL ZipGetVolumeCaps(char *rootpath, char *name, PVOLUMECAPS VolumeCaps);
  56. #endif /* _NT_ZIP_H */