1  #define DELETE                           (0x00010000L)
  2  #define READ_CONTROL                     (0x00020000L)
  3  #define WRITE_DAC                        (0x00040000L)
  4  #define WRITE_OWNER                      (0x00080000L)
  5  #define SYNCHRONIZE                      (0x00100000L)
  6  
  7  #define STANDARD_RIGHTS_REQUIRED         (0x000F0000L)
  8  
  9  #define STANDARD_RIGHTS_READ             (READ_CONTROL)
 10  #define STANDARD_RIGHTS_WRITE            (READ_CONTROL)
 11  #define STANDARD_RIGHTS_EXECUTE          (READ_CONTROL)
 12  
 13  #define STANDARD_RIGHTS_ALL              (0x001F0000L)
 14  
 15  #define SPECIFIC_RIGHTS_ALL              (0x0000FFFFL)
 16  
 17  //
 18  // AccessSystemAcl access type
 19  //
 20  
 21  #define ACCESS_SYSTEM_SECURITY           (0x01000000L)
 22  
 23  //
 24  // MaximumAllowed access type
 25  //
 26  
 27  #define MAXIMUM_ALLOWED                  (0x02000000L)
 28  
 29  //
 30  //  These are the generic rights.
 31  //
 32  
 33  #define GENERIC_READ                     (0x80000000L)
 34  #define GENERIC_WRITE                    (0x40000000L)
 35  #define GENERIC_EXECUTE                  (0x20000000L)
 36  #define GENERIC_ALL                      (0x10000000L)
 37  
 38  //
 39  // Define access rights to files and directories
 40  //
 41  
 42  //
 43  // The FILE_READ_DATA and FILE_WRITE_DATA constants are also defined in
 44  // devioctl.h as FILE_READ_ACCESS and FILE_WRITE_ACCESS. The values for these
 45  // constants *MUST* always be in sync.
 46  // The values are redefined in devioctl.h because they must be available to
 47  // both DOS and NT.
 48  //
 49  
 50  #define FILE_READ_DATA            ( 0x0001 )    // file & pipe
 51  #define FILE_LIST_DIRECTORY       ( 0x0001 )    // directory
 52  
 53  #define FILE_WRITE_DATA           ( 0x0002 )    // file & pipe
 54  #define FILE_ADD_FILE             ( 0x0002 )    // directory
 55  
 56  #define FILE_APPEND_DATA          ( 0x0004 )    // file
 57  #define FILE_ADD_SUBDIRECTORY     ( 0x0004 )    // directory
 58  #define FILE_CREATE_PIPE_INSTANCE ( 0x0004 )    // named pipe
 59  
 60  
 61  #define FILE_READ_EA              ( 0x0008 )    // file & directory
 62  
 63  #define FILE_WRITE_EA             ( 0x0010 )    // file & directory
 64  
 65  #define FILE_EXECUTE              ( 0x0020 )    // file
 66  #define FILE_TRAVERSE             ( 0x0020 )    // directory
 67  
 68  #define FILE_DELETE_CHILD         ( 0x0040 )    // directory
 69  
 70  #define FILE_READ_ATTRIBUTES      ( 0x0080 )    // all
 71  
 72  #define FILE_WRITE_ATTRIBUTES     ( 0x0100 )    // all
 73  
 74  #define FILE_ALL_ACCESS (STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF)
 75  
 76  #define FILE_GENERIC_READ         (STANDARD_RIGHTS_READ     |\
 77                                     FILE_READ_DATA           |\
 78                                     FILE_READ_ATTRIBUTES     |\
 79                                     FILE_READ_EA             |\
 80                                     SYNCHRONIZE)
 81  
 82  
 83  #define FILE_GENERIC_WRITE        (STANDARD_RIGHTS_WRITE    |\
 84                                     FILE_WRITE_DATA          |\
 85                                     FILE_WRITE_ATTRIBUTES    |\
 86                                     FILE_WRITE_EA            |\
 87                                     FILE_APPEND_DATA         |\
 88                                     SYNCHRONIZE)
 89  
 90  
 91  #define FILE_GENERIC_EXECUTE      (STANDARD_RIGHTS_EXECUTE  |\
 92                                     FILE_READ_ATTRIBUTES     |\
 93                                     FILE_EXECUTE             |\
 94                                     SYNCHRONIZE)
 95  
 96  #define FILE_SHARE_READ                 0x00000001  
 97  #define FILE_SHARE_WRITE                0x00000002  
 98  #define FILE_SHARE_DELETE               0x00000004  
 99  #define FILE_ATTRIBUTE_READONLY             0x00000001  
100  #define FILE_ATTRIBUTE_HIDDEN               0x00000002  
101  #define FILE_ATTRIBUTE_SYSTEM               0x00000004  
102  #define FILE_ATTRIBUTE_DIRECTORY            0x00000010  
103  #define FILE_ATTRIBUTE_ARCHIVE              0x00000020  
104  #define FILE_ATTRIBUTE_DEVICE               0x00000040  
105  #define FILE_ATTRIBUTE_NORMAL               0x00000080  
106  #define FILE_ATTRIBUTE_TEMPORARY            0x00000100  
107  #define FILE_ATTRIBUTE_SPARSE_FILE          0x00000200  
108  #define FILE_ATTRIBUTE_REPARSE_POINT        0x00000400  
109  #define FILE_ATTRIBUTE_COMPRESSED           0x00000800  
110  #define FILE_ATTRIBUTE_OFFLINE              0x00001000  
111  #define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED  0x00002000  
112  #define FILE_ATTRIBUTE_ENCRYPTED            0x00004000  
113  #define FILE_NOTIFY_CHANGE_FILE_NAME    0x00000001   
114  #define FILE_NOTIFY_CHANGE_DIR_NAME     0x00000002   
115  #define FILE_NOTIFY_CHANGE_ATTRIBUTES   0x00000004   
116  #define FILE_NOTIFY_CHANGE_SIZE         0x00000008   
117  #define FILE_NOTIFY_CHANGE_LAST_WRITE   0x00000010   
118  #define FILE_NOTIFY_CHANGE_LAST_ACCESS  0x00000020   
119  #define FILE_NOTIFY_CHANGE_CREATION     0x00000040   
120  #define FILE_NOTIFY_CHANGE_SECURITY     0x00000100   
121  #define FILE_ACTION_ADDED                   0x00000001   
122  #define FILE_ACTION_REMOVED                 0x00000002   
123  #define FILE_ACTION_MODIFIED                0x00000003   
124  #define FILE_ACTION_RENAMED_OLD_NAME        0x00000004   
125  #define FILE_ACTION_RENAMED_NEW_NAME        0x00000005   
126  #define MAILSLOT_NO_MESSAGE             ((DWORD)-1) 
127  #define MAILSLOT_WAIT_FOREVER           ((DWORD)-1) 
128  #define FILE_CASE_SENSITIVE_SEARCH      0x00000001  
129  #define FILE_CASE_PRESERVED_NAMES       0x00000002  
130  #define FILE_UNICODE_ON_DISK            0x00000004  
131  #define FILE_PERSISTENT_ACLS            0x00000008  
132  #define FILE_FILE_COMPRESSION           0x00000010  
133  #define FILE_VOLUME_QUOTAS              0x00000020  
134  #define FILE_SUPPORTS_SPARSE_FILES      0x00000040  
135  #define FILE_SUPPORTS_REPARSE_POINTS    0x00000080  
136  #define FILE_SUPPORTS_REMOTE_STORAGE    0x00000100  
137  #define FILE_VOLUME_IS_COMPRESSED       0x00008000  
138  #define FILE_SUPPORTS_OBJECT_IDS        0x00010000  
139  #define FILE_SUPPORTS_ENCRYPTION        0x00020000  
140  #define FILE_NAMED_STREAMS              0x00040000  
141  #define FILE_READ_ONLY_VOLUME           0x00080000