Changeset 593 for trunk/src/kernel32


Ignore:
Timestamp:
Aug 20, 1999, 12:10:03 AM (26 years ago)
Author:
sandervl
Message:

* empty log message *

File:
1 edited

Legend:

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

    r550 r593  
    1 /* $Id: wprocess.cpp,v 1.22 1999-08-18 17:18:01 sandervl Exp $ */
     1/* $Id: wprocess.cpp,v 1.23 1999-08-19 22:10:03 sandervl Exp $ */
    22
    33/*
     
    215215  }
    216216
    217   //SvL: Use 0 instead of the real instance handle (for resource lookup)
    218217  Win32Exe *winexe;
    219218
    220   winexe = new Win32Exe(0, NameTableId, Win32TableId);
     219  winexe = new Win32Exe(hinstance, NameTableId, Win32TableId);
    221220
    222221  if(winexe) {
     
    227226
    228227        winexe->setVersionId(VersionResId);
    229         winexe->setOS2InstanceHandle(hinstance);
    230228        winexe->setEntryPoint((ULONG)EntryPoint);
    231229        winexe->setTLSAddress(TlsAddress);
     
    562560
    563561  dprintf(("GetModuleFileName %X", hinstModule));
    564   if(hinstModule == 0 || hinstModule == -1 || (WinExe && hinstModule == WinExe->getOS2InstanceHandle())) {
    565     module = (Win32Image *)WinExe;
     562  if(hinstModule == 0 || hinstModule == -1 || (WinExe && hinstModule == WinExe->getInstanceHandle())) {
     563        module = (Win32Image *)WinExe;
    566564  }
    567565  else {
    568     module = (Win32Image *)Win32Dll::findModule(hinstModule);
     566        module = (Win32Image *)Win32Dll::findModule(hinstModule);
    569567  }
    570568
    571569  if(module) {
    572     fpath = module->getFullPath();
     570        fpath = module->getFullPath();
    573571  }
    574572  if(fpath) {
    575     //SvL: 13-9-98: +1
    576     rc = min(strlen(fpath)+1, cchPath);
    577     strncpy(lpszPath, fpath, rc);
     573        //SvL: 13-9-98: +1
     574        rc = min(strlen(fpath)+1, cchPath);
     575        strncpy(lpszPath, fpath, rc);
    578576  }
    579577  else  rc = O32_GetModuleFileName(hinstModule, lpszPath, cchPath);
     
    745743  hinstance = OS2QueryModuleHandle(modname);
    746744  if(hinstance == 0) {
    747     dprintf(("GetVersionStruct can't find handle for %s\n", modname));
    748     return(FALSE);
    749   }
    750   if(WinExe && WinExe->getOS2InstanceHandle() == hinstance) {
    751     winimage = (Win32Image *)WinExe;
     745        dprintf(("GetVersionStruct can't find handle for %s\n", modname));
     746        return(FALSE);
     747  }
     748  if(WinExe && WinExe->getInstanceHandle() == hinstance) {
     749        winimage = (Win32Image *)WinExe;
    752750  }
    753751  else {
    754     winimage = (Win32Image *)Win32Dll::findModule(hinstance);
    755     if(winimage == NULL) {
    756         dprintf(("GetVersionStruct can't find Win32Image for %s\n", modname));
    757         return(FALSE);
    758     }
     752        winimage = (Win32Image *)Win32Dll::findModule(hinstance);
     753        if(winimage == NULL) {
     754                dprintf(("GetVersionStruct can't find Win32Image for %s\n", modname));
     755                return(FALSE);
     756        }
    759757  }
    760758  if(winimage->getVersionId() == -1) {
     
    778776  }
    779777
    780   if(WinExe && WinExe->getOS2InstanceHandle() == hinstance) {
    781     winimage = (Win32Image *)WinExe;
     778  if(WinExe && WinExe->getInstanceHandle() == hinstance) {
     779        winimage = (Win32Image *)WinExe;
    782780  }
    783781  else {
    784     winimage = (Win32Image *)Win32Dll::findModule(hinstance);
    785     if(winimage == NULL) {
    786         dprintf(("GetVersionSize can't find Win32Image for %s\n", modname));
    787         return(FALSE);
    788     }
     782        winimage = (Win32Image *)Win32Dll::findModule(hinstance);
     783        if(winimage == NULL) {
     784                dprintf(("GetVersionSize can't find Win32Image for %s\n", modname));
     785                return(FALSE);
     786        }
    789787  }
    790788  if(winimage->getVersionId() == -1) {
    791     dprintf(("GetVersionSize: %s has no version resource!\n", modname));
    792     return(FALSE);
     789        dprintf(("GetVersionSize: %s has no version resource!\n", modname));
     790        return(FALSE);
    793791  }
    794792  ULONG size = OS2GetResourceSize(hinstance, winimage->getVersionId());
Note: See TracChangeset for help on using the changeset viewer.