## Virtual Device Driver Reference for OS/2

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

### VDHOpen

Select an item:

    Format
    Parameters
    Return Codes
    Purpose
    Glossary

This function opens a file or device and returns a handle. The handle can be used with VDHRead, VDHWrite, VDHSeek, VDHClose,and VDHDevIOCtl. The parameters and error return codes are the same as those found in the DosOpen API. Refer to the OS/2 Control Program Programming Reference for a complete descriptions of each DosOpen API parameter.

    #include mvdm.h

    PSZ          FileName;       /*  Pointer to the name of the file or device to open */

    PHFILE       FileHandle;     /*  Where the system returns the file handle */

    PULONG       ActionTaken;    /*  Where a description of the action taken is returned */

    ULONG        FileSize;       /*  The new file's logical size (EOD) in bytes */

    ULONG        FileAttribute;  /*  File attribute bits used on file creation */

    ULONG        OpenFLag;       /*  Specifies action taken, based on whether file exists */

    ULONG        OpenMode;       /*  Describes the mode of the Open function */

    PVDH_EOAP    EABuf;          /*  Address of a VDH_EAOP structure or NULL */

    BOOL         rc;

    rc = VDHOpen(FileName, FileHandle, ActionTaken,

           FileSize, FileAttribute, OpenFLag,

           OpenMode, EABuf);