Logo Search packages:      
Sourcecode: virtualbox-ose version File versions

static int krdrFileDestroy ( PKRDR  pRdr  )  [static]

Destroy the file provider instance.

Returns:
0 on success, OS specific error code on failure. On failure, the file provider instance will be in an indeterminate state - don't touch it!
Parameters:
pRdr The file provider instance.

Definition at line 1115 of file kRdrFile.cpp.

References KRDRFILE::File, NULL, and KRDRFILE::pvMapping.

{
    PKRDRFILE    pRdrFile = (PKRDRFILE)pRdr;
    int          rc;

#if K_OS == K_OS_DARWIN \
 || K_OS == K_OS_FREEBSD \
 || K_OS == K_OS_LINUX \
 || K_OS == K_OS_NETBSD \
 || K_OS == K_OS_OPENBSD \
 || K_OS == K_OS_SOLARIS
    rc = kHlpSys_close(pRdrFile->File);

#elif K_OS == K_OS_OS2
    rc = DosClose(pRdrFile->File);

#elif K_OS == K_OS_WINDOWS
    rc = 0;
    if (!CloseHandle(pRdrFile->File))
        rc = GetLastError();

#else
# error "port me"
#endif

    if (pRdrFile->pvMapping)
    {
        kHlpFree(pRdrFile->pvMapping);
        pRdrFile->pvMapping = NULL;
    }

    kHlpFree(pRdr);
    return rc;
}


Generated by  Doxygen 1.6.0   Back to index