Changeset 593 for trunk/src/kernel32
- Timestamp:
- Aug 20, 1999, 12:10:03 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/wprocess.cpp
r550 r593 1 /* $Id: wprocess.cpp,v 1.2 2 1999-08-18 17:18:01sandervl Exp $ */1 /* $Id: wprocess.cpp,v 1.23 1999-08-19 22:10:03 sandervl Exp $ */ 2 2 3 3 /* … … 215 215 } 216 216 217 //SvL: Use 0 instead of the real instance handle (for resource lookup)218 217 Win32Exe *winexe; 219 218 220 winexe = new Win32Exe( 0, NameTableId, Win32TableId);219 winexe = new Win32Exe(hinstance, NameTableId, Win32TableId); 221 220 222 221 if(winexe) { … … 227 226 228 227 winexe->setVersionId(VersionResId); 229 winexe->setOS2InstanceHandle(hinstance);230 228 winexe->setEntryPoint((ULONG)EntryPoint); 231 229 winexe->setTLSAddress(TlsAddress); … … 562 560 563 561 dprintf(("GetModuleFileName %X", hinstModule)); 564 if(hinstModule == 0 || hinstModule == -1 || (WinExe && hinstModule == WinExe->get OS2InstanceHandle())) {565 module = (Win32Image *)WinExe;562 if(hinstModule == 0 || hinstModule == -1 || (WinExe && hinstModule == WinExe->getInstanceHandle())) { 563 module = (Win32Image *)WinExe; 566 564 } 567 565 else { 568 module = (Win32Image *)Win32Dll::findModule(hinstModule);566 module = (Win32Image *)Win32Dll::findModule(hinstModule); 569 567 } 570 568 571 569 if(module) { 572 fpath = module->getFullPath();570 fpath = module->getFullPath(); 573 571 } 574 572 if(fpath) { 575 //SvL: 13-9-98: +1576 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); 578 576 } 579 577 else rc = O32_GetModuleFileName(hinstModule, lpszPath, cchPath); … … 745 743 hinstance = OS2QueryModuleHandle(modname); 746 744 if(hinstance == 0) { 747 dprintf(("GetVersionStruct can't find handle for %s\n", modname));748 return(FALSE);749 } 750 if(WinExe && WinExe->get OS2InstanceHandle() == 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; 752 750 } 753 751 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 } 759 757 } 760 758 if(winimage->getVersionId() == -1) { … … 778 776 } 779 777 780 if(WinExe && WinExe->get OS2InstanceHandle() == hinstance) {781 winimage = (Win32Image *)WinExe;778 if(WinExe && WinExe->getInstanceHandle() == hinstance) { 779 winimage = (Win32Image *)WinExe; 782 780 } 783 781 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 } 789 787 } 790 788 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); 793 791 } 794 792 ULONG size = OS2GetResourceSize(hinstance, winimage->getVersionId());
Note:
See TracChangeset
for help on using the changeset viewer.