Changeset 13506


Ignore:
Timestamp:
Feb 27, 2000, 3:17:06 AM (25 years ago)
Author:
bird
Message:

Moved parts from pe2lx.cpp/h to ModuleBase.cpp/h.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • TabularUnified tags/trunk/src/win32k/ldr/ModuleBase.cpp

    r13082 r13506  
    1 /* $Id: ModuleBase.cpp,v 1.2 2000-01-22 18:21:01 bird Exp $
     1/* $Id: ModuleBase.cpp,v 1.3 2000-02-27 02:17:06 bird Exp $
    22 *
    33 * ModuleBase - Implementetation.
    44 *
    5  * Copyright (c) 1999 knut st. osmundsen
     5 * Copyright (c) 1999-2000 knut st. osmundsen (knut.stange.osmundsen@pmsc.no)
    66 *
    77 * Project Odin Software License can be found in LICENSE.TXT
     
    250250
    251251
    252 
     252#ifndef RING0
     253/**
     254 *
     255 * @returns   OS/2 return code. (NO_ERROR on success...)
     256 * @param     hFile     Handle to file. (RING0: Handle to SystemFileNumber (SFN).)
     257 * @param     ulOffset  Offset in the file to start reading at.
     258 * @param     pvBuffer  Pointer to output buffer.
     259 * @param     cbToRead  Count of bytes to read.
     260 * @sketch    Set Change filepointer to ulOffset.
     261 *            Read cbToRead into pvBufer.
     262 * @status    completely tested.
     263 * @author    knut st. osmundsen
     264 * @remark
     265 */
     266APIRET ReadAt(SFN hFile, ULONG ulOffset, PVOID pvBuffer, ULONG cbToRead)
     267{
     268    ULONG cbRead, ulMoved;
     269    APIRET rc;
     270
     271    rc = DosSetFilePtr(hFile, ulOffset, FILE_BEGIN, &ulMoved);
     272    if (rc == NO_ERROR)
     273        rc = DosRead(hFile, pvBuffer, cbToRead, &cbRead);
     274    else
     275        printErr(("DosSetFilePtr(hfile, %#8x(%d),..) failed with rc = %d.",
     276                  ulOffset, ulOffset, rc));
     277
     278    return rc;
     279}
     280#endif
     281
Note: See TracChangeset for help on using the changeset viewer.