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