OpenAFS
OpenAFS distributed network file system
/cygdrive/c/src/openafs/openafs.git/repo/src/WINNT/afsrdr/common/AFSUserStructs.h
00001 /*
00002  * Copyright (c) 2008-2011 Kernel Drivers, LLC.
00003  * Copyright (c) 2009-2011 Your File System, Inc.
00004  * All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions
00008  * are met:
00009  *
00010  * - Redistributions of source code must retain the above copyright notice,
00011  *   this list of conditions and the following disclaimer.
00012  * - Redistributions in binary form must reproduce the above copyright
00013  *   notice,
00014  *   this list of conditions and the following disclaimer in the
00015  *   documentation
00016  *   and/or other materials provided with the distribution.
00017  * - Neither the name of Kernel Drivers, LLC nor the names of its
00018  *   contributors may be
00019  *   used to endorse or promote products derived from this software without
00020  *   specific prior written permission from Kernel Drivers, LLC
00021  *   and Your File System, Inc.
00022  *
00023  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00024  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
00025  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
00026  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
00027  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00028  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00029  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00030  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00031  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00032  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00033  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00034  */
00035 
00036 #ifndef _AFS_USER_STRUCT_H
00037 #define _AFS_USER_STRUCT_H
00038 
00039 typedef struct _AFS_FILE_ID
00040 {
00041 
00042     ULONG    Hash;
00043 
00044     ULONG    Cell;
00045 
00046     ULONG    Volume;
00047 
00048     ULONG    Vnode;
00049 
00050     ULONG    Unique;
00051 
00052 } AFSFileID;
00053 
00054 //
00055 // This control structure is the request block passed to the filter. The filter will populate the structure
00056 // when it requires a request to be handled by the service.
00057 //
00058 
00059 typedef struct _AFS_COMM_REQUEST_BLOCK
00060 {
00061 
00062     AFSFileID       FileId;             /* Initialize unused elements to 0 */
00063 
00064     ULONG           RequestType;
00065 
00066     ULONG           RequestIndex;    /* Must return to caller */
00067 
00068     ULONG           RequestFlags;    /* AFS_REQUEST_FLAG_xxxx */
00069 
00070     ULONG           NameLength;      // Length of the name in bytes
00071 
00072     ULONG           DataOffset;       // This offset is from the end of the structure, including the name
00073 
00074     ULONG           DataLength;
00075 
00076     GUID            AuthGroup;      // Length: sizeof(GUID) */
00077 
00078     ULONG           ResultBufferLength;    /* Do not exceed this length in response */
00079 
00080     LONG            QueueCount;     // Current outstanding requests in the queue
00081 
00082     WCHAR           Name[ 1];
00083 
00084 } AFSCommRequest;
00085 
00086 
00087 //
00088 // This is the result block passed back to the redirector after a request has been handled
00089 //
00090 
00091 typedef struct _AFS_COMM_RESULT_BLOCK
00092 {
00093 
00094     ULONG           RequestIndex;        /* Must match the AFSCommRequest value */
00095 
00096     ULONG           ResultStatus;        /* NTSTATUS_xxx */
00097 
00098     ULONG           ResultBufferLength;    /* Not to exceed AFSCommRequest ResultBufferLength */
00099 
00100     ULONG           Reserved;           /* To ease Quad Alignment */
00101 
00102     char            ResultData[ 1];
00103 
00104 } AFSCommResult;
00105 
00106 //
00107 // Control block passed to IOCTL_AFS_INITIALIZE_REDIRECTOR_DEVICE
00108 //
00109 
00110 #define AFS_REDIR_INIT_FLAG_HIDE_DOT_FILES          0x00000001
00111 #define AFS_REDIR_INIT_NO_PAGING_FILE               0x00000002
00112 #define AFS_REDIR_INIT_FLAG_DISABLE_SHORTNAMES      0x00000004
00113 
00114 typedef struct _AFS_REDIR_INIT_INFO_CB
00115 {
00116 
00117     ULONG       Flags;
00118 
00119     ULONG       MaximumChunkLength;     // Maximum RPC length issued so we should limit
00120                                         // requests for data to this length
00121 
00122     AFSFileID   GlobalFileId;           // AFS FID of the Global root.afs volume
00123 
00124     LARGE_INTEGER  ExtentCount;         // Number of extents in the current data cache
00125 
00126     ULONG       CacheBlockSize;         // Size, in bytes, of the current cache block
00127 
00128     ULONG       MaxPathLinkCount;       // Number of symlinks / mountpoints that may
00129                                         // be cross during the evaluation of any path
00130 
00131     ULONG       NameArrayLength;        // Number of components that should be allocated
00132                                         // in each name array chunk.  Name arrays are
00133                                         // dynamic and will be increased in size as
00134                                         // needed by this amount
00135 
00136     LARGE_INTEGER MemoryCacheOffset;    // The offset in the afsd_service process memory
00137                                         // space at which the extents are allocated
00138     LARGE_INTEGER MemoryCacheLength;    // and the length of the allocated region
00139 
00140     ULONG       DumpFileLocationOffset; // Offset from the beginning of this structure to
00141                                         // the start of the directory where dump files
00142                                         // are to be stored. The path must be fully
00143                                         // qualified such as C:\Windows\Temp
00144 
00145     ULONG       DumpFileLocationLength; // Length, in bytes, of the DumpFileLocation path
00146 
00147     ULONG       CacheFileNameLength;    // size, in bytes, of the cache file name
00148 
00149     WCHAR       CacheFileName[ 1];      // Fully qualified cache file name in the form
00150                                         // C:\OPenAFSDir\CacheFile.dat
00151 
00152 } AFSRedirectorInitInfo;
00153 
00154 //
00155 // Directory query CB
00156 //
00157 
00158 typedef struct _AFS_DIR_QUERY_CB
00159 {
00160 
00161     ULONG_PTR        EnumHandle;  // If this is 0 then it is a new query,
00162                                   // otherwise it is the FileIndex of the last
00163                                   // entry processed.
00164 
00165 } AFSDirQueryCB;
00166 
00167 //
00168 // Directory enumeration control block
00169 // Entries are aligned on a QuadWord boundary
00170 //
00171 
00172 typedef struct _AFS_DIR_ENUM_ENTRY
00173 {
00174 
00175     AFSFileID       FileId;
00176 
00177     ULONG           FileIndex;          /* Incremented  */
00178 
00179     LARGE_INTEGER   Expiration;         /* FILETIME */
00180 
00181     LARGE_INTEGER   DataVersion;
00182 
00183     ULONG           FileType;           /* File, Dir, MountPoint, Symlink */
00184 
00185     LARGE_INTEGER   CreationTime;       /* FILETIME */
00186 
00187     LARGE_INTEGER   LastAccessTime;     /* FILETIME */
00188 
00189     LARGE_INTEGER   LastWriteTime;      /* FILETIME */
00190 
00191     LARGE_INTEGER   ChangeTime;         /* FILETIME */
00192 
00193     LARGE_INTEGER   EndOfFile;
00194 
00195     LARGE_INTEGER   AllocationSize;
00196 
00197     ULONG           FileAttributes;     /* NTFS FILE_ATTRIBUTE_xxxx see below */
00198 
00199     ULONG           FileNameLength;
00200 
00201     ULONG           EaSize;
00202 
00203     ULONG           Links;
00204 
00205     ULONG           FileNameOffset;     /* From beginning of this structure */
00206 
00207     ULONG           TargetNameOffset;   /* From beginning of this structure */
00208 
00209     ULONG           TargetNameLength;
00210 
00211     AFSFileID       TargetFileId;       /* Target fid for mp's and symlinks */
00212 
00213     CCHAR           ShortNameLength;
00214 
00215     WCHAR           ShortName[12];
00216 
00217     ULONG           NTStatus;           /* Error code during enumeration */
00218 
00219     /* Long Filename and Target (Symlink and MountPoint only) to follow without NULs */
00220 
00221 } AFSDirEnumEntry;
00222 
00223 
00224 typedef struct _AFS_DIR_ENUM_RESP
00225 {
00226 
00227     ULONG_PTR       EnumHandle;
00228 
00229     LARGE_INTEGER   SnapshotDataVersion; /* DV at time Name/FID list was generated */
00230 
00231     LARGE_INTEGER   CurrentDataVersion;   /* DV at time this header was constructed */
00232 
00233     AFSDirEnumEntry Entry[ 1];     /* Each entry is Quad aligned */
00234 
00235 } AFSDirEnumResp;
00236 
00237 //
00238 // Volume information CB passed in the create request
00239 //
00240 
00241 typedef struct _AFS_VOLUME_INFORMATION
00242 {
00243 
00244     LARGE_INTEGER   TotalAllocationUnits;       /* Volume Max Blocks (Partition or Quota) */
00245 
00246     LARGE_INTEGER   AvailableAllocationUnits;   /* Volume Blocks Avail (Partition or Quota) */
00247 
00248     LARGE_INTEGER   VolumeCreationTime;         /* AFS Last Update - Not Creation */
00249 
00250     ULONG           Characteristics;            /* FILE_READ_ONLY_DEVICE (if readonly)
00251                                                  * FILE_REMOTE_DEVICE (always)
00252                                                  */
00253 
00254     ULONG           FileSystemAttributes;       /* FILE_CASE_PRESERVED_NAMES (always)
00255                                                    FILE_UNICODE_ON_DISK      (always) */
00256 
00257     ULONG           SectorsPerAllocationUnit;   /* = 1 */
00258 
00259     ULONG           BytesPerSector;             /* = 1024 */
00260 
00261     ULONG           CellID;                     /* AFS Cell ID */
00262 
00263     ULONG           VolumeID;                   /* AFS Volume ID */
00264 
00265     ULONG           VolumeLabelLength;
00266 
00267     WCHAR           VolumeLabel[128];            /* Volume:Cell */
00268 
00269 } AFSVolumeInfoCB;
00270 
00271 
00272 //
00273 // Volume size information CB passed used to satisfy
00274 // FileFsFullSizeInformation and FileFsSizeInformation
00275 //
00276 
00277 typedef struct _AFS_VOLUME_SIZE_INFORMATION
00278 {
00279 
00280     LARGE_INTEGER   TotalAllocationUnits;       /* Max Blocks (Quota or Partition) */
00281 
00282     LARGE_INTEGER   AvailableAllocationUnits;   /* Blocks Avail (Quota or Partition) */
00283 
00284     ULONG           SectorsPerAllocationUnit;   /* = 1 */
00285 
00286     ULONG           BytesPerSector;             /* = 1024 */
00287 
00288 } AFSVolumeSizeInfoCB;
00289 
00290 //
00291 // File create CB
00292 //
00293 
00294 typedef struct _AFS_FILE_CREATE_CB
00295 {
00296 
00297     AFSFileID       ParentId;
00298 
00299     LARGE_INTEGER   AllocationSize;
00300 
00301     ULONG           FileAttributes;
00302 
00303     ULONG           EaSize;
00304 
00305     char            EaBuffer[ 1];
00306 
00307 } AFSFileCreateCB;
00308 
00309 typedef struct _AFS_FILE_CREATE_RESULT_CB
00310 {
00311 
00312     LARGE_INTEGER   ParentDataVersion;
00313 
00314     AFSDirEnumEntry DirEnum;
00315 
00316 } AFSFileCreateResultCB;
00317 
00318 //
00319 // File open CB
00320 //
00321 
00322 typedef struct _AFS_FILE_OPEN_CB
00323 {
00324 
00325     AFSFileID       ParentId;
00326 
00327     ULONG           DesiredAccess;
00328 
00329     ULONG           ShareAccess;
00330 
00331     ULONGLONG       ProcessId;
00332 
00333     ULONGLONG       Identifier;
00334 
00335 } AFSFileOpenCB;
00336 
00337 typedef struct _AFS_FILE_OPEN_RESULT_CB
00338 {
00339 
00340     ULONG           GrantedAccess;
00341 
00342     ULONG           FileAccess;
00343 
00344 } AFSFileOpenResultCB;
00345 
00346 typedef struct _AFS_FILE_ACCESS_RELEASE_CB
00347 {
00348 
00349     ULONG           FileAccess;
00350 
00351     ULONGLONG       ProcessId;
00352 
00353     ULONGLONG       Identifier;
00354 
00355 } AFSFileAccessReleaseCB;
00356 
00357 //
00358 // IO Interace control blocks for extent processing when performing
00359 // queries via the AFS_REQUEST_TYPE_REQUEST_FILE_EXTENTS or synchronous
00360 // results from the service
00361 //
00362 
00363 typedef struct _AFS_FILE_EXTENT_CB
00364 {
00365 
00366     ULONG           Flags;
00367 
00368     ULONG           Length;
00369 
00370     LARGE_INTEGER   FileOffset;
00371 
00372     LARGE_INTEGER   CacheOffset;
00373 
00374     UCHAR           MD5[16];
00375 
00376     ULONG           DirtyOffset;
00377 
00378     ULONG           DirtyLength;
00379 
00380 } AFSFileExtentCB;
00381 
00382 typedef struct _AFS_REQUEST_EXTENTS_CB
00383 {
00384 
00385     ULONG           Flags;
00386 
00387     LARGE_INTEGER   ByteOffset;
00388 
00389     ULONG           Length;
00390 
00391 } AFSRequestExtentsCB;
00392 
00393 //
00394 // Extent processing when the file system calls the service to
00395 // release extents through the AFS_REQUEST_TYPE_RELEASE_FILE_EXTENTS interface
00396 //
00397 
00398 typedef struct _AFS_RELEASE_EXTENTS_CB
00399 {
00400 
00401     ULONG           Flags;
00402 
00403     ULONG           ExtentCount;
00404 
00405     LARGE_INTEGER   LastAccessTime;
00406 
00407     LARGE_INTEGER   LastWriteTime;
00408 
00409     LARGE_INTEGER   ChangeTime;
00410 
00411     LARGE_INTEGER   CreateTime;
00412 
00413     LARGE_INTEGER   AllocationSize;
00414 
00415     AFSFileExtentCB FileExtents[ 1];
00416 
00417 } AFSReleaseExtentsCB;
00418 
00419 //
00420 // This is the control structure used when the service passes the extent
00421 // information via the IOCTL_AFS_SET_FILE_EXTENTS interface
00422 //
00423 
00424 typedef struct _AFS_SET_FILE_EXTENTS_CB
00425 {
00426 
00427     AFSFileID       FileId;
00428 
00429     ULONG           ExtentCount;
00430 
00431     ULONG           ResultStatus;
00432 
00433     AFSFileExtentCB FileExtents[ 1];
00434 
00435 } AFSSetFileExtentsCB;
00436 
00437 //
00438 // This is the control structure used when the service passes the extent
00439 // information via the IOCTL_AFS_RELEASE_FILE_EXTENTS interface
00440 //
00441 
00442 #define AFS_RELEASE_EXTENTS_FLAGS_RELEASE_ALL       0x00000001
00443 
00444 typedef struct _AFS_RELEASE_FILE_EXTENTS_CB
00445 {
00446 
00447     ULONG           Flags;
00448 
00449     AFSFileID       FileId;
00450 
00451     ULONG           ExtentCount;
00452 
00453     LARGE_INTEGER   HeldExtentCount;
00454 
00455     AFSFileExtentCB FileExtents[ 1];
00456 
00457 } AFSReleaseFileExtentsCB;
00458 
00459 //
00460 // These are the control structures that the filesystem returns from a
00461 // IOCTL_AFS_RELEASE_FILE_EXTENTS
00462 //
00463 
00464 typedef struct _AFS_RELEASE_FILE_EXTENTS_RESULT_FILE_CB
00465 {
00466     AFSFileID       FileId;
00467 
00468     ULONG           Flags;
00469 
00470     GUID            AuthGroup; /* Length: sizeof(GUID) */
00471 
00472     ULONG           ExtentCount;
00473 
00474     LARGE_INTEGER   LastAccessTime;
00475 
00476     LARGE_INTEGER   LastWriteTime;
00477 
00478     LARGE_INTEGER   ChangeTime;
00479 
00480     LARGE_INTEGER   CreateTime;
00481 
00482     LARGE_INTEGER   AllocationSize;
00483 
00484     AFSFileExtentCB FileExtents[ 1];
00485 
00486 } AFSReleaseFileExtentsResultFileCB;
00487 
00488 typedef struct _AFS_RELEASE_FILE_EXTENTS_RESULT_CB
00489 {
00490     ULONG           SerialNumber;
00491 
00492     ULONG           Flags;
00493 
00494     ULONG           FileCount;
00495 
00496     AFSReleaseFileExtentsResultFileCB Files[ 1];
00497 
00498 } AFSReleaseFileExtentsResultCB;
00499 
00500 
00501 typedef struct _AFS_EXTENT_FAILURE_CB
00502 {
00503 
00504     AFSFileID       FileId;
00505 
00506     ULONG           FailureStatus;
00507 
00508     GUID            AuthGroup;      // Length: sizeof(GUID) */
00509 
00510 } AFSExtentFailureCB;
00511 
00512 //
00513 // File update CB
00514 //
00515 
00516 typedef struct _AFS_FILE_UPDATE_CB
00517 {
00518 
00519     AFSFileID       ParentId;
00520 
00521     LARGE_INTEGER   LastAccessTime;
00522 
00523     LARGE_INTEGER   LastWriteTime;
00524 
00525     LARGE_INTEGER   ChangeTime;
00526 
00527     LARGE_INTEGER   CreateTime;
00528 
00529     LARGE_INTEGER   AllocationSize;
00530 
00531     ULONG           FileAttributes;
00532 
00533     ULONG           EaSize;
00534 
00535     char            EaBuffer[ 1];
00536 
00537 } AFSFileUpdateCB;
00538 
00539 //
00540 // File update CB result
00541 //
00542 
00543 typedef struct _AFS_FILE_UPDATE_RESULT_CB
00544 {
00545 
00546     LARGE_INTEGER   ParentDataVersion;
00547 
00548     AFSDirEnumEntry DirEnum;
00549 
00550 } AFSFileUpdateResultCB;
00551 
00552 //
00553 // File delete CB
00554 //
00555 
00556 typedef struct _AFS_FILE_DELETE_CB
00557 {
00558 
00559     AFSFileID       ParentId;        /* Must be directory */
00560 
00561     ULONGLONG       ProcessId;
00562 
00563                                      /* File Name and FileID in Common Request Block */
00564 
00565 } AFSFileDeleteCB;
00566 
00567 typedef struct _AFS_FILE_DELETE_RESULT_CB
00568 {
00569 
00570     LARGE_INTEGER   ParentDataVersion;
00571 
00572 } AFSFileDeleteResultCB;
00573 
00574 //
00575 // File rename CB
00576 //
00577 
00578 typedef struct _AFS_FILE_RENAME_CB
00579 {
00580 
00581     AFSFileID       SourceParentId;        /* Must be directory */
00582 
00583     AFSFileID       TargetParentId;        /* Must be directory */
00584 
00585                                            /* Source Name and FileID in Common Request Block */
00586 
00587     USHORT          TargetNameLength;
00588 
00589     WCHAR           TargetName[ 1];
00590 
00591 } AFSFileRenameCB;
00592 
00593 typedef struct _AFS_FILE_RENAME_RESULT_CB
00594 {
00595 
00596     LARGE_INTEGER   SourceParentDataVersion;
00597 
00598     LARGE_INTEGER   TargetParentDataVersion;
00599 
00600     AFSDirEnumEntry DirEnum;
00601 
00602 } AFSFileRenameResultCB;
00603 
00604 
00605 //
00606 // Control structures for AFS_REQUEST_TYPE_EVAL_TARGET_BY_ID
00607 // and AFS_REQUEST_TYPE_EVAL_TARGET_BY_NAME
00608 //
00609 // The response to these requests is a AFSDirEnumEntry
00610 //
00611 
00612 typedef struct _AFS_FILE_EVAL_TARGET_CB
00613 {
00614 
00615     AFSFileID       ParentId;
00616 
00617 } AFSEvalTargetCB;
00618 
00619 
00620 typedef struct _AFS_FILE_EVAL_RESULT_CB
00621 {
00622 
00623     LARGE_INTEGER   ParentDataVersion;
00624 
00625     AFSDirEnumEntry DirEnum;
00626 
00627 } AFSFileEvalResultCB;
00628 
00629 
00630 //
00631 // Control structure for read and write requests through the PIOCtl interface
00632 //
00633 // CommRequest FileId field contains the active directory
00634 
00635 typedef struct _AFS_PIOCTL_IO_CB
00636 {
00637     ULONG       RequestId;
00638 
00639     AFSFileID   RootId;
00640 
00641     ULONG       BufferLength;
00642 
00643     void        *MappedBuffer;
00644 
00645 } AFSPIOCtlIORequestCB;
00646 
00647 //
00648 // The returned information for the IO Request
00649 //
00650 
00651 typedef struct _AFS_PIOCTL_IO_RESULT_CB
00652 {
00653 
00654     ULONG       BytesProcessed;
00655 
00656 } AFSPIOCtlIOResultCB;
00657 
00658 
00659 //
00660 // Control structure for open and close requests through the PIOCtl interface
00661 //
00662 // CommRequest FileId field contains the active directory
00663 //
00664 // There is no return structure.
00665 //
00666 typedef struct _AFS_PIOCTL_OPEN_CLOSE_CB
00667 {
00668 
00669     ULONG       RequestId;
00670 
00671     AFSFileID   RootId;
00672 
00673 } AFSPIOCtlOpenCloseRequestCB;
00674 
00675 //
00676 // Cache invalidation control block
00677 //
00678 
00679 typedef struct _AFS_INVALIDATE_CACHE_CB
00680 {
00681 
00682     AFSFileID   FileID;
00683 
00684     ULONG       FileType;
00685 
00686     BOOLEAN     WholeVolume;
00687 
00688     ULONG       Reason;
00689 
00690 } AFSInvalidateCacheCB;
00691 
00692 //
00693 // Network Status Control Block
00694 //
00695 
00696 typedef struct _AFS_NETWORK_STATUS_CB
00697 {
00698 
00699     BOOLEAN     Online;
00700 
00701 } AFSNetworkStatusCB;
00702 
00703 //
00704 // Volume Status Control Block
00705 //
00706 
00707 typedef struct _AFS_VOLUME_STATUS_CB
00708 {
00709 
00710     AFSFileID   FileID;         // only cell and volume fields are set
00711 
00712     BOOLEAN     Online;
00713 
00714 } AFSVolumeStatusCB;
00715 
00716 
00717 typedef struct _AFS_SYSNAME
00718 {
00719 
00720     ULONG       Length;         /* bytes */
00721 
00722     WCHAR       String[AFS_MAX_SYSNAME_LENGTH];
00723 
00724 } AFSSysName;
00725 
00726 //
00727 // SysName Notification Control Block
00728 //   Sent as the buffer with IOCTL_AFS_SYSNAME_NOTIFICATION
00729 //   There is no response
00730 //
00731 
00732 typedef struct _AFS_SYSNAME_NOTIFICATION_CB
00733 {
00734 
00735     ULONG       Architecture;
00736 
00737     ULONG       NumberOfNames;
00738 
00739     AFSSysName  SysNames[1];
00740 
00741 } AFSSysNameNotificationCB;
00742 
00743 
00744 //
00745 // File System Status Query Control Block
00746 //   Received as a response to IOCTL_AFS_STATUS_REQUEST
00747 //
00748 typedef struct _AFS_DRIVER_STATUS_RESPONSE_CB
00749 {
00750 
00751     ULONG       Status;         // bit flags - see below
00752 
00753 } AFSDriverStatusRespCB;
00754 
00755 // Bit flags
00756 #define AFS_DRIVER_STATUS_READY         0
00757 #define AFS_DRIVER_STATUS_NOT_READY     1
00758 #define AFS_DRIVER_STATUS_NO_SERVICE    2
00759 
00760 //
00761 // Byte Range Lock Request
00762 //
00763 typedef struct _AFS_BYTE_RANGE_LOCK_REQUEST
00764 {
00765     ULONG               LockType;
00766 
00767     LARGE_INTEGER       Offset;
00768 
00769     LARGE_INTEGER       Length;
00770 
00771 } AFSByteRangeLockRequest;
00772 
00773 #define AFS_BYTE_RANGE_LOCK_TYPE_SHARED 0
00774 #define AFS_BYTE_RANGE_LOCK_TYPE_EXCL   1
00775 
00776 
00777 //
00778 // Byte Range Lock Request Control Block
00779 //
00780 // Set ProcessId and FileId in the Comm Request Block
00781 //
00782 typedef struct _AFS_BYTE_RANGE_LOCK_REQUEST_CB
00783 {
00784 
00785     ULONG                       Count;
00786 
00787     ULONGLONG                   ProcessId;
00788 
00789     AFSByteRangeLockRequest     Request[1];
00790 
00791 } AFSByteRangeLockRequestCB;
00792 
00793 //
00794 // Byte Range Lock Result
00795 //
00796 typedef struct _AFS_BYTE_RANGE_LOCK_RESULT
00797 {
00798 
00799     ULONG               LockType;
00800 
00801     LARGE_INTEGER       Offset;
00802 
00803     LARGE_INTEGER       Length;
00804 
00805     ULONG               Status;
00806 
00807 } AFSByteRangeLockResult;
00808 
00809 //
00810 // Byte Range Lock Results Control Block
00811 //
00812 
00813 typedef struct _AFS_BYTE_RANGE_LOCK_RESULT_CB
00814 {
00815 
00816     AFSFileID                   FileId;
00817 
00818     ULONG                       Count;
00819 
00820     AFSByteRangeLockResult      Result[1];
00821 
00822 } AFSByteRangeLockResultCB;
00823 
00824 //
00825 // Set Byte Range Lock Results Control Block
00826 //
00827 
00828 typedef struct _AFS_SET_BYTE_RANGE_LOCK_RESULT_CB
00829 {
00830 
00831     ULONG                       SerialNumber;
00832 
00833     AFSFileID                   FileId;
00834 
00835     ULONG                       Count;
00836 
00837     AFSByteRangeLockResult      Result[1];
00838 
00839 } AFSSetByteRangeLockResultCB;
00840 
00841 
00842 //
00843 // Byte Range Unlock Request Control Block
00844 //
00845 
00846 typedef struct _AFS_BYTE_RANGE_UNLOCK_CB
00847 {
00848 
00849     ULONG                       Count;
00850 
00851     ULONGLONG                   ProcessId;
00852 
00853     AFSByteRangeLockRequest     Request[1];
00854 
00855 } AFSByteRangeUnlockRequestCB;
00856 
00857 
00858 //
00859 // Byte Range Unlock Request Control Block
00860 //
00861 
00862 typedef struct _AFS_BYTE_RANGE_UNLOCK_RESULT_CB
00863 {
00864 
00865     ULONG                       Count;
00866 
00867     AFSByteRangeLockResult      Result[1];
00868 
00869 } AFSByteRangeUnlockResultCB;
00870 
00871 
00872 //
00873 // Control structure for read and write requests through the PIPE interface
00874 //
00875 // CommRequest FileId field contains the active directory
00876 
00877 typedef struct _AFS_PIPE_IO_CB
00878 {
00879     ULONG       RequestId;
00880 
00881     AFSFileID   RootId;
00882 
00883     ULONG       BufferLength;
00884 
00885 } AFSPipeIORequestCB;   // For read requests the buffer is mapped in the request cb block.
00886                         // For write requests, the buffer immediately follows this structure
00887 
00888 //
00889 // The returned information for the Pipe IO Request. Note that this is
00890 // only returned in the write request. Read request info is returned in
00891 // the request cb
00892 //
00893 
00894 typedef struct _AFS_PIPE_IO_RESULT_CB
00895 {
00896 
00897     ULONG       BytesProcessed;
00898 
00899 } AFSPipeIOResultCB;
00900 
00901 //
00902 // Control structure for set and query info requests through the PIPE interface
00903 //
00904 
00905 typedef struct _AFS_PIPE_INFO_CB
00906 {
00907 
00908     ULONG       RequestId;
00909 
00910     AFSFileID   RootId;
00911 
00912     ULONG       InformationClass;
00913 
00914     ULONG       BufferLength;
00915 
00916 } AFSPipeInfoRequestCB;   // For query info requests the buffer is mapped in the request cb block.
00917                           // For set info requests, the buffer immediately follows this structure
00918 
00919 //
00920 // Control structure for open and close requests through the Pipe interface
00921 //
00922 // CommRequest FileId field contains the active directory
00923 //
00924 // There is no return structure.
00925 //
00926 typedef struct _AFS_PIPE_OPEN_CLOSE_CB
00927 {
00928 
00929     ULONG       RequestId;
00930 
00931     AFSFileID   RootId;
00932 
00933 } AFSPipeOpenCloseRequestCB;
00934 
00935 
00936 //
00937 // Hold Fid Request Control Block
00938 //
00939 
00940 typedef struct _AFS_HOLD_FID_REQUEST_CB
00941 {
00942 
00943     ULONG                       Count;
00944 
00945     AFSFileID                   FileID[ 1];
00946 
00947 } AFSHoldFidRequestCB;
00948 
00949 
00950 typedef struct _AFS_FID_RESULT
00951 {
00952 
00953     AFSFileID                   FileID;
00954 
00955     ULONG                       Status;
00956 
00957 } AFSFidResult;
00958 
00959 typedef struct _AFS_HOLD_FID_RESULT_CB
00960 {
00961 
00962     ULONG                       Count;
00963 
00964     AFSFidResult                Result[ 1];
00965 
00966 } AFSHoldFidResultCB;
00967 
00968 
00969 //
00970 // Release Fid Request Control Block
00971 //
00972 
00973 typedef struct _AFS_RELEASE_FID_REQUEST_CB
00974 {
00975 
00976     ULONG                       Count;
00977 
00978     AFSFileID                   FileID[ 1];
00979 
00980 } AFSReleaseFidRequestCB;
00981 
00982 typedef struct _AFS_RELEASE_FID_RESULT_CB
00983 {
00984 
00985     ULONG                       Count;
00986 
00987     AFSFidResult                Result[ 1];
00988 
00989 } AFSReleaseFidResultCB;
00990 
00991 
00992 //
00993 // File cleanup CB
00994 //
00995 
00996 typedef struct _AFS_FILE_CLEANUP_CB
00997 {
00998 
00999     AFSFileID       ParentId;
01000 
01001     LARGE_INTEGER   LastAccessTime;
01002 
01003     LARGE_INTEGER   LastWriteTime;
01004 
01005     LARGE_INTEGER   ChangeTime;
01006 
01007     LARGE_INTEGER   CreateTime;
01008 
01009     LARGE_INTEGER   AllocationSize;
01010 
01011     ULONG           FileAttributes;
01012 
01013     ULONGLONG       ProcessId;
01014 
01015     ULONG           FileAccess;
01016 
01017     ULONGLONG       Identifier;
01018 
01019 } AFSFileCleanupCB;
01020 
01021 typedef struct _AFS_FILE_CLEANUP_RESULT_CB
01022 {
01023 
01024     LARGE_INTEGER   ParentDataVersion;
01025 
01026 } AFSFileCleanupResultCB;
01027 
01028 
01029 //
01030 // Trace configuration cb
01031 //
01032 
01033 typedef struct _AFS_DEBUG_TRACE_CONFIG_CB
01034 {
01035 
01036     ULONG       TraceLevel;
01037 
01038     ULONG       Subsystem;
01039 
01040     ULONG       TraceBufferLength;
01041 
01042     ULONG       DebugFlags;
01043 
01044 } AFSTraceConfigCB;
01045 
01046 //
01047 // Object Status Information request
01048 //
01049 
01050 typedef struct _AFS_REDIR_GET_OBJECT_STATUS_CB
01051 {
01052 
01053     AFSFileID       FileID;
01054 
01055     USHORT          FileNameLength;
01056 
01057     WCHAR           FileName[ 1];
01058 
01059 } AFSGetStatusInfoCB;
01060 
01061 typedef struct _AFS_REDIR_OBJECT_STATUS_CB
01062 {
01063 
01064     AFSFileID               FileId;
01065 
01066     AFSFileID               TargetFileId;
01067 
01068     LARGE_INTEGER           Expiration;         /* FILETIME */
01069 
01070     LARGE_INTEGER           DataVersion;
01071 
01072     ULONG                   FileType;           /* File, Dir, MountPoint, Symlink */
01073 
01074     ULONG                   ObjectFlags;
01075 
01076     LARGE_INTEGER           CreationTime;       /* FILETIME */
01077 
01078     LARGE_INTEGER           LastAccessTime;     /* FILETIME */
01079 
01080     LARGE_INTEGER           LastWriteTime;      /* FILETIME */
01081 
01082     LARGE_INTEGER           ChangeTime;         /* FILETIME */
01083 
01084     ULONG                   FileAttributes;     /* NTFS FILE_ATTRIBUTE_xxxx see below */
01085 
01086     LARGE_INTEGER           EndOfFile;
01087 
01088     LARGE_INTEGER           AllocationSize;
01089 
01090     ULONG                   EaSize;
01091 
01092     ULONG                   Links;
01093 
01094 } AFSStatusInfoCB;
01095 
01096 //
01097 // Auth Group (Process and Thread) Processing
01098 //
01099 // afsredir.sys implements a set of generic Authentication Group
01100 // operations that can be executed by processes.  The model supports
01101 // one or more authentication groups per process.  A process may switch
01102 // the active AuthGroup for any thread to any other AuthGroup the process
01103 // is a member of.  However, processes cannot assign itself to an
01104 // AuthGroup that it is not presently a member of.  A process can reset
01105 // its AuthGroup to the SID-AuthGroup or can create a new AuthGroup that
01106 // has not previously been used.
01107 //
01108 //  IOCTL_AFS_AUTHGROUP_CREATE_AND_SET
01109 //      Creates a new AuthGroup and either activates it for
01110 //      the process or the current thread.  If set as the
01111 //      new process AuthGroup, the prior AuthGroup list is
01112 //      cleared.
01113 //
01114 //  IOCTL_AFS_AUTHGROUP_QUERY
01115 //      Returns a list of the AuthGroup GUIDS associated
01116 //      with the current process, the current process GUID,
01117 //      and the current thread GUID.
01118 //
01119 //  IOCTL_AFS_AUTHGROUP_SET
01120 //      Permits the current AuthGroup for the process or
01121 //      thread to be set to the specified GUID.  The GUID
01122 //      must be in the list of current values for the process.
01123 //
01124 //  IOCTL_AFS_AUTHGROUP_RESET
01125 //      Resets the current AuthGroup for the process or
01126 //      thread to the SID-AuthGroup
01127 //
01128 //  IOCTL_AFS_AUTHGROUP_SID_CREATE
01129 //      Given a SID as input, assigns a new AuthGroup GUID.
01130 //      (May only be executed by LOCAL_SYSTEM or the active SID)
01131 //
01132 //  IOCTL_AFS_AUTHGROUP_SID_QUERY
01133 //      Given a SID as input, returns the associated AuthGroup GUID.
01134 //
01135 //  IOCTL_AFS_AUTHGROUP_LOGON_CREATE
01136 //      Given a logon Session as input, assigns a new AuthGroup GUID.
01137 //      (May only be executed by LOCAL_SYSTEM.)
01138 //
01139 // New processes inherit only the active AuthGroup at the time of process
01140 // creation.  Either that of the active thread (if set) or the process.
01141 // All of the other AuthGroups associated with a parent process are
01142 // off-limits.
01143 //
01144 
01145 //
01146 // Auth Group processing flags
01147 //
01148 
01149 #define AFS_PAG_FLAGS_SET_AS_ACTIVE         0x00000001 // If set, the newly created authgroup is set to the active group
01150 #define AFS_PAG_FLAGS_THREAD_AUTH_GROUP     0x00000002 // If set, the request is targeted for the thread not the process
01151 
01152 typedef struct _AFS_AUTH_GROUP_REQUEST
01153 {
01154 
01155     USHORT              SIDLength; // If zero the SID of the caller is used
01156 
01157     ULONG               SessionId; // If -1 the session id of the caller is used
01158 
01159     ULONG               Flags;
01160 
01161     GUID                AuthGroup; // The auth group for certain requests
01162 
01163     WCHAR               SIDString[ 1];
01164 
01165 } AFSAuthGroupRequestCB;
01166 
01167 //
01168 // Reparse tag AFS Specific information buffer
01169 //
01170 
01171 #define OPENAFS_SUBTAG_MOUNTPOINT 1
01172 #define OPENAFS_SUBTAG_SYMLINK    2
01173 #define OPENAFS_SUBTAG_UNC        3
01174 
01175 #define OPENAFS_MOUNTPOINT_TYPE_NORMAL   L'#'
01176 #define OPENAFS_MOUNTPOINT_TYPE_RW       L'%'
01177 
01178 typedef struct _AFS_REPARSE_TAG_INFORMATION
01179 {
01180 
01181     ULONG SubTag;
01182 
01183     union
01184     {
01185         struct
01186         {
01187             ULONG  Type;
01188             USHORT MountPointCellLength;
01189             USHORT MountPointVolumeLength;
01190             WCHAR  Buffer[1];
01191         } AFSMountPoint;
01192 
01193         struct
01194         {
01195             BOOLEAN RelativeLink;
01196             USHORT  SymLinkTargetLength;
01197             WCHAR   Buffer[1];
01198         } AFSSymLink;
01199 
01200         struct
01201         {
01202             USHORT UNCTargetLength;
01203             WCHAR  Buffer[1];
01204         } UNCReferral;
01205     };
01206 
01207 } AFSReparseTagInfo;
01208 
01209 #endif /* _AFS_USER_STRUCT_H */
01210 
 All Data Structures Files Functions Variables