FS_SearchFile


FS_SearchFile(
 PIOREQ pir
 )

All DOS find first and find next operations are performed through FS_SearchFile. This routine handles the INT 21h functions: 11h, 12h, 4Eh, and 4Fh.

ir_ppath

Supplies a pointer to the canonicalized unicode pathname to search for. This is passed in only for a SEARCH_FIRST operation and is set to NULL on find next requests. Wildcards are allowed on the pathname.

ir_rh

Supplies handle to disk volume or network resource where the pathname is to be searched for.

ir_flags

Supplies the operation to perform.

Search Operation Values:

Value

Meaning

SEARCH_FIRST

Do a FindFirst operation on the path passed in.

SEARCH_NEXT

Do a FindNext operation on the path passed in on the SEARCH_FIRST operation.


ir_attr

Supplies wildcard search attributes. This is supplied only for SEARCH_FIRST requests.

Search Attribute Values:

Any combination of the following attributes may be specified, causing those files to be included with normal files in the search.

Value

Meaning

FILE_ATTRIBUTE_HIDDEN

Include hidden file in search.

FILE_ATTRIBUTE_SYSTEM

Include system file in search.

FILE_ATTRIBUTE_DIRECTORY

Include subdirectories in search.

The following attribute will only be specified by itself. It will not be combined with any of the other attributes.

FILE_ATTRIBUTE_VOLUMELABEL

Search for volume label only.


ir_uFname

Pointer to the case-preserved filename component in unicode.

ir_upath

Pointer to the unparsed user pathname in unicode.

ir_data

Supplies a pointer to the search info structure that is described below.

ir_user

Supplies user id for this request.

ir_pid

Supplies process id for this request.

ir_error

Returns status of the operation ( 0 if no error, errorcode otherwise ).

ir_data

Returns the information about the find in the search info structure. The contents of the supplied structure is the same as the info returned on a path based Int 21h search function. On a successful return the search info structure returns information required for a find next request that is filled in by the FSD. This information is stored in the users address space and is passed back on find next requests.


Search Info Structure:

Value

Meaning

se_key

Search key structure which contains information pertinent to the search operation that is in progress.

Search Key Structure:

Value

Meaning

sk_drive

Drive value. This field is set by the IFS manager and will be overwritten. The FSD should not change this field.

sk_pattern[11]

Returns filename pattern being searched for. This field is set and used by the FSD to continue the search operation. The filename must be stored in the FCB 8.3 format.

sk_attr

Search attributes. This field is set and used by the FSD to continue searches.

sk_localFSD[4]

Returns local FSD continuation fields. These bytes should be used to save the information required to continue the search operation. The typical values saved are those used to locate the directory and the last entry with in the directory.

sk_netFSD[2]

Returns remote FSD continuation fields. These bytes should be used to save the information required to continue the search operation by network FSDs.

sk_ifsmgr[2]

Reserved for use by the IFS manager.


se_attrib

Returns attributes of matched file.


Return Attribute Values:

Any combination of the following attributes may be returned.

Value

Meaning

FILE_ATTRIBUTE_READONLY

Read-Only file.

FILE_ATTRIBUTE_HIDDEN

Hidden file.

FILE_ATTRIBUTE_SYSTEM

System file.

FILE_ATTRIBUTE_DIRECTORY

Subdirectory.

FILE_ATTRIBUTE_ARCHIVE

Archive file.

This attribute cannot be returned in combination with other attributes.

FILE_ATTRIBUTE_VOLUMELABEL

Volume label.


se_time

Returns DOS file time of matched file. This field is set by the FSD.

se_date

Returns DOS file date of matched file. This field is set by the FSD.

se_size

Returns size of matched file. This field is set by the FSD.

se_name[13]

Returns filename of matched file. This field is set by the FSD to the matching filename found by the search. The filename must be stored as an 8.3 format ASCIIZ string.


ir_firstclus

Returns first cluster of the file. This field is needed only for FCB-based search operations and is updated separately by the IFS. This field is valid only for FAT-based filesystems. A zero value should be returned by non-FAT-based FSDs.