## Virtual Device Driver Reference for OS/2

[prev][next][parent][TOC]

### VDHOpen - Parameters

FileName (PSZ) Pointer to the ASCIIZ string containing the name of the device or file to open.

FileHandle (PHFILE) Where the system returns the file handle.

ActionTaken (PULONG) Where the system returns a description of the action taken as a result of this function call.

FileSize (ULONG) The new file's logical size (EOD) in bytes.

FileAttribute (ULONG) File attribute bits used on file creation.

OpenFLag (ULONG) Specifies the action taken depending on whether the file exists.

Possible actions are:

VDHOPEN_FILE_EXISTED File existed
VDHOPEN_FILE_CREATED File created
VDHOPEN_FILE_TRUNCATED File replaced

OpenMode (ULONG) Describes the mode of the Open function.

EABuf (PVDH_EOAP) Address of a VDH_EAOP structure, or NULL.

rc (BOOL) - returns

Success If the function is successful, it returns a nonzero value.

Failure If the function fails, it returns 0 (zero). If the function fails, VDHGetError should be called to determine the nature of the problem. VDHGetError can return the following errors:

ERROR_DISK_FULL
ERROR_OPEN_FAILED
ERROR_FILE_NOT_FOUND
ERROR_INVALID_PARAMETER
ERROR_PATH_NOT_FOUND
ERROR_ACCESS_DENIED
ERROR_DRIVE_LOCKED
ERROR_NOT_DOS_DISK
ERROR_SHARING_BUFFER_EXCEEDED
ERROR_SHARING_VIOLATION
ERROR_INVALID_ACCESS
ERROR_CANNOT_MAKE
ERROR_TOO_MANY_OPEN_FILES
ERROR_NOT_ENOUGH_MEMORY

If the function is called at other than DOS session-task time, or if the pszFileName pointer is invalid, a system halt occurs.