Ignore:
Timestamp:
Jul 21, 1999, 1:45:21 PM (26 years ago)
Author:
sandervl
Message:

EB's LoadResource/LockResource fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/resource.cpp

    r100 r356  
    1 /* $Id: resource.cpp,v 1.6 1999-06-10 20:48:01 phaller Exp $ */
     1/* $Id: resource.cpp,v 1.7 1999-07-21 11:45:21 sandervl Exp $ */
    22
    3 /*
    4  *
    5  * Project Odin Software License can be found in LICENSE.TXT
    6  *
    7  */
    83/*
    94 * Misc resource procedures
     
    116 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl)
    127 * Copyright 1998 Patrick Haller
     8 *
     9 *
     10 * Project Odin Software License can be found in LICENSE.TXT
    1311 *
    1412 */
     
    6563PVOID WIN32API LockResource(HGLOBAL hRes)
    6664{
    67   Win32Resource *res = (Win32Resource *)hRes;
    68 
    69   dprintf(("LockResource %X\n", hRes));
    70 
    71   /* @@@PH */
    72   if (res == NULL)
    73     return (NULL);
    74   else
    75     return res->lockResource();
     65    return (PVOID)hRes;
    7666}
    7767//******************************************************************************
     68//hRes == returned by FindResource(Ex)
    7869//******************************************************************************
    7970HGLOBAL WIN32API LoadResource(HINSTANCE hModule, HRSRC hRes)
    8071{
    81     return (HGLOBAL)hRes;
     72  Win32Resource *res = (Win32Resource *)hRes;
     73
     74  dprintf(("LoadResource %x %X\n", hModule, hRes));
     75
     76  /* @@@PH */
     77  if (HIWORD(res) == NULL) {
     78        dprintf(("LoadResource %x: invalid hRes %x", hModule, hRes));
     79        return 0;
     80  }
     81  else  return (HGLOBAL)res->lockResource();
    8282}
    8383//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.