0x0010 - File System Object

The module offers access to the local file system via Service Transfer Objects, which enable the browsing of directories and access to files.

0x8nn0 – Module Header

SubIndex

Type

Name

Value

Type

Access

00

VAR

Len

 

UNSIGNED16

read-only

01

VAR

Address

0x0010 00nn

UNSIGNED32

read-only

02

VAR

Type

FSO

VISIBLE STRING

read-only

03

VAR

Name

FSO

VISIBLE STRING

read-only

04

VAR

Dev type

0x0010 2710

UNSIGNED32

read-only

0xBnn0 - Dir Service Transfer

This object returns all files and subdirectories of a given directory path (e.g. for browsing directories).

The path specification can contain placeholders, e.g. '*' or '?'. If the string ends with a placeholder, a Dot (.) or the directory name, the user must have access rights to the main directory and all subdirectories of the path.

InputData

Type

Name

UNSIGNED32

cbsRootDir

VISIBLE STRING

sRootDir

OutputData

Type

Name

UNSIGNED32

Version = 0

UNSIGNED32

cbData

UNSIGNED32

cDirs

UNSIGNED32

cFiles

UNSIGNED32

nOffsFirstDir //Offset of the first DirectoryInfo structure

UNSIGNED32

nOffsFirstFile //Offset of the first FileInfo structure

DirectoryInfo

Type

Name

UNSIGNED32

nOffsetNextDir

UNSIGNED32

cchName

Char[cchName]

szName

FileInfo

Type

Name

UNSIGNED32

nOffsetNextFile

SIGNED64

Filesize

UNSIGNED32

FileAttributes

UNSIGNED32

cchFilename

Char[cchFilename]

szName

0xBnn1 – GetFile Service Transfer

Service Transfer Objects for reading from and writing to a file

0x0010 - File System Object 1:

This function provides output data. Please avoid parallel accesses by other clients, as this can lead to overwriting of the output data.

Reading from and writing to large files can take place via multiple calls. The file is initially opened by specifying a file name, then specifying the Continuation Handle that is returned with tFileResponse. The maximum size of a data segment is defined by the parameter cbMaxRead.

Either a file name or a Continuation Handle must always be specified. If both are specified simultaneously or if none is specified, this leads to the return value E_INVALIDDATA.

InputData

Type

Name

Meaning

UNSIGNED32

cbFilename

Length of the file name in characters

UNSIGNED32

Continuation handle

The Continuation Handle returned by GetFile OutputData must be specified for subsequent read accesses.

UNSIGNED32

cbMaxRead

Maximum size of the return value. This is the number of bytes that are to be read, plus the size of the OutputData structure. The value must always be larger than the size of the OutputData structure.

Char[cbFilename]

Filename

Path and file name to be opened for reading

OutputData

Type

Name

Meaning

UNSIGNED32

cbData

Number of bytes that were read

UNSIGNED32

Continuation handle

If data still remain to be read, this Continuation Handle is used for subsequent read accesses

UNSIGNED32

bFinished

Indicates whether more data can still be read from the file. "True" = reading of the data is complete and no further data are available.

0 = false; anything else = true

BYTE[cbData]

data

Memory area for the data to be read

0xBnn2 - WriteFile Service Transfer

0x0010 - File System Object 2:

This function provides output data. Please avoid parallel accesses by other clients, as this can lead to overwriting of the output data.

InputData

Type

Name

Meaning

UNSIGNED32

cbFilename

Length of the file name in characters

UNSIGNED32

Continuation handle

The Continuation Handle returned by WriteFile OutputData must be specified for subsequent write accesses.

UNSIGNED32

cbData

Number of bytes which are to be written

UNSIGNED32

bWriteCompleted

Indicates the completion of the file access. If ! =0, the file is closed after the final access.

Char[cbFilename]

Filename

File name

BYTE[cbData]

data

Data that is to be written

OutputData

Type

Name

Meaning

UNSIGNED32

Continuation handle

Continuation Handle for writing further data to the file

0xBnn3 - CopyFile Service Transfer

Copy or move the source file to the target

InputData

Type

Name

Meaning

UNSIGNED32

cbSrc

Length of the source file name

UNSIGNED32

cbDst

Length of the target file name

UNSIGNED32

Flags

One or more of the following flags:
0x00000001 = copy file.
(If the flag is not set, the file is moved.)0x00000002 = overwrite existing file

Char[cbSource]

Source Filename

Complete path to the source file

Char[cbDst]

Destination Filename

Complete path to the destination file

0xBnn4 - DeleteFile Service Transfer

Delete file or directory.

InputData

Type

Name

Meaning

UNSIGNED32

cbFilename

Length of the file name

UNSIGNED32

bRecurse

Delete an entire directory incl. subdirectories (= recursive)

0 = false; anything else = true

Char[cbFilename]

Filename

Path to the file or directory

0xBnn5 - mkdir Service Transfer

Create a new directory

InputData

Type

Name

Meaning

UNSIGNED32

cbFilename

Length of the directory name

UNSIGNED32

bRecurse

Create directories recursively

0 = false; anything else = true

char[cbFilename]

Filename

Name of the new directory