Ignore:
Timestamp:
Aug 19, 1999, 12:25:27 PM (26 years ago)
Author:
sandervl
Message:

PE loader resource fixes + ConvertNameId bugfix

File:
1 edited

Legend:

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

    r550 r571  
    1 /* $Id: nameid.cpp,v 1.6 1999-08-18 17:18:00 sandervl Exp $ */
     1/* $Id: nameid.cpp,v 1.7 1999-08-19 10:25:27 sandervl Exp $ */
    22
    33/*
     
    3030int SYSTEM EXPORT ConvertNameId(ULONG hmod, char *name)
    3131{
    32  HMODULE   hmodule;
    3332 Win32Dll *module;
    3433
    3534  dprintf(("Convert %s in mod %X to id\n", name, hmod ));
    3635
    37   hmodule = GetOS2ModuleHandle(hmod);
    38   if(  hmodule == 0
    39     || hmodule == -1
    40     || hmodule == OS2iGetModuleHandleA( NULL ) )
     36  if(hmod == 0 || hmod == -1 || hmod == WinExe->getInstanceHandle() )
    4137  {
    4238    return WinExe->convertNameId(name);
    4339  }
    4440
    45   module = Win32Dll::findModule(hmodule);
     41  module = Win32Dll::findModule(hmod);
    4642  if(module == 0)
    4743  {
     
    7066//******************************************************************************
    7167//******************************************************************************
    72 ULONG GetOS2ModuleHandle(ULONG hmod)
    73 {
    74  APIRET  rc;
    75  char    modname[128];
    76  HMODULE hmodule;
    77 
    78   if(hmod == 0 || hmod == -1) {
    79         return(0);
    80   }
    81 
    82   if(Win32QueryModuleName(hmod, modname, sizeof(modname)) == 0) {
    83         dprintf(("Can't determine handle of dll %X\n", hmod));
    84         return(0);
    85   }
    86   rc = DosQueryModuleHandle(modname, &hmodule);
    87   if(rc) {
    88         dprintf(("Can't determine handle of dll %s\n", modname));
    89         return(0);
    90   }
    91   return(hmodule);
    92 }
    93 /******************************************************************************/
    94 /******************************************************************************/
Note: See TracChangeset for help on using the changeset viewer.