OpenFileCallBackStruct

Contains information about an open file operation.

Service:File System Monitoring
Defined In:fshooks.h

Structure

  typedef struct{
     int             slot;
     int             task;
     int             volume;
     int             dirBase;
     char           *pathString;
     int             pathComponentCount;
     int             nameSpace;
     unsigned long   attributeMatchBits;
     unsigned long   requestedAccessRights;
     int             dataStreamNumber;
     int            *fileHandle;
  } OpenFileCallBackStruct;
  

Fields

slot

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 name space
  • 1 — Macintosh name space
  • 2 — NFS name space
  • 3 — FTAM name space
  • 4 — LONG name space
  • 5 — NT name space
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 by the operation. For a list of possible values, see Section 30.8.8, Search Attributes for Traditional Volumes.

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
  • 9 Leave this file compressed
  • 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

The fileHandle parameter 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_.