OpenFileCallBackStruct

Contains information about an open file operation

Service:File System Monitoring
Defined In:nwfshook.h

Structure

   typedef struct {  
      LONG   connection;  
      LONG   task;  
      LONG   volume;  
      LONG   dirBase;  
      BYTE  *pathString;  
      LONG   pathComponentCount;  
      LONG   nameSpace;  
      LONG   attributeMatchBits;  
      LONG   requestedAccessRights;  
      LONG   dataStreamNumber;  
      LONG  *fileHandle;
   } OpenFileCallBackStruct;
   

Fields

connection

Contains the connection number of the entity requesting the operation.

task

Contains the task number of the entity requesting the operation.

volume

Contains the number of the volume that the directory entry is on.

dirBase

Contains the directory base (directory number) of the file or directory.

pathString

Contains the NetWare-internal path string of the file or directory. The value is this field is valid for the callback routine. Once the routine is called, the value is no longer valid. If you need this information outside of your callback routine, you need to copy and save the information.

pathComponentCount

Contains the number of components in the path.

nameSpace

Contains the name space of the file or directory:

  • 0 DOS
  • 1 MACINTOSH
  • 2 NFS
  • 3 FTAM
  • 4 LONG
  • 5 NT
attributeMatchBits

Contains a bit mask of the file attributes that are affected by this operation. That is, entries that have file attributes matching this bit mask are affected. For more about the file attributes mask, see File Attributes. The bits of the first byte are defined as follows:

  • 0 Read Only
  • 1 Hidden
  • 2 System
  • 3 Execute Only
  • 4 Subdirectory
  • 5 Archive
  • 6 Undefined
  • 7 Share
requestedAccessRights

Indicates how the entry is to be opened, such as Read Only, Read Write, Compatibility mode, and so on. The bits in this mask are defined as follows:

  • 0 Read only mode
  • 1 Write only mode
  • 2 Deny read mode
  • 3 Deny write mode
  • 4 Compatibility mode
  • 6 File write through mode
  • 8 Enable I/O on compressed data (NetWare 4.x)
  • 9 Leave this file compressed (NetWare 4.x)
  • 12 Always read ahead
  • 13 Never read ahead
dataStreamNumber

Contains a number identifying the data stream type of the file or directory:

  • 0 Primary Data Stream (DOS)
  • 1 Macintosh Resource Fork
  • 2 FRAM Extra Data Fork
fileHandle

Points to the file handle.

Remarks

fileHandle is not valid in the _PRE_ open. If the file was successfully opened or created by the file system, it should be valid in the _POST_ open.

All other fields are valid in the _PRE_ open because they are fields that must be specified by the client to open the file. (Of course, the client does not specify the file handle.) You can get a pretty good idea as to which fields are valid by looking at the coordinating request/reply NCP structures.

Generally, items found in the request NCP structures are provided by the client and will be valid in the _PRE_ hook. Items to be returned to the client are not valid until the _POST_.