Changeset 1410 for trunk/src/kernel32/wprocess.cpp
- Timestamp:
- Oct 23, 1999, 2:34:48 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/wprocess.cpp
r1403 r1410 1 /* $Id: wprocess.cpp,v 1. 39 1999-10-22 18:07:24sandervl Exp $ */1 /* $Id: wprocess.cpp,v 1.40 1999-10-23 12:34:48 sandervl Exp $ */ 2 2 3 3 /* … … 24 24 #include <winexebase.h> 25 25 #include <windllpeldr.h> 26 #include <winfakepeldr.h> 26 27 27 28 #ifdef __IBMCPP__ … … 605 606 if(lpszCommandLine) { 606 607 cmdline = (char *)malloc(strlen(lpszImageName)+strlen(lpszCommandLine) + 16); 607 sprintf(cmdline, " %s %s", lpszImageName, lpszCommandLine);608 sprintf(cmdline, "PE.EXE %s %s", lpszImageName, lpszCommandLine); 608 609 fAllocStr = TRUE; 609 610 } 610 else cmdline = (char *)lpszImageName; 611 else { 612 cmdline = (char *)malloc(strlen(lpszImageName) + 16); 613 sprintf(cmdline, "PE.EXE %s", lpszImageName); 614 fAllocStr = TRUE; 615 } 611 616 } 612 else cmdline = (char *)lpszCommandLine; 613 617 else { 618 cmdline = (char *)malloc(strlen(lpszCommandLine) + 16); 619 sprintf(cmdline, "PE.EXE %s", lpszCommandLine); 620 fAllocStr = TRUE; 621 } 614 622 dprintf(("KERNEL32: CreateProcess %s\n", cmdline)); 615 623 rc = O32_CreateProcess("PE.EXE", (LPCSTR)cmdline, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10); 616 624 if(fAllocStr) 617 free(cmdline);625 free(cmdline); 618 626 619 627 dprintf(("KERNEL32: CreateProcess returned %d\n", rc)); … … 674 682 { 675 683 Win32ImageBase *winimage; 684 Win32PeLdrRsrcImg *rsrcimg; 676 685 677 686 dprintf(("GetVersionStruct")); … … 681 690 else { 682 691 winimage = (Win32ImageBase *)Win32DllBase::findModule(modname); 683 if(winimage == NULL) { 684 dprintf(("GetVersionStruct can't find Win32Image for %s\n", modname)); 685 return(FALSE); 692 if(winimage == NULL) 693 { 694 if(Win32ImageBase::isPEImage(modname) == FALSE) 695 { 696 HINSTANCE hInstance; 697 698 //must be an LX dll, just load it (app will probably load it anyway) 699 hInstance = LoadLibraryA(modname); 700 if(hInstance == 0) 701 return 0; 702 winimage = (Win32ImageBase *)Win32DllBase::findModule(hInstance); 703 if(winimage) { 704 return winimage->getVersionStruct(verstruct, bufLength); 705 } 706 return 0; 707 } 708 //SvL: Try to load it 709 rsrcimg = new Win32PeLdrRsrcImg(modname); 710 if(rsrcimg == NULL) 711 return 0; 712 713 rsrcimg->init(0); 714 if(rsrcimg->getError() != NO_ERROR) 715 { 716 dprintf(("GetVersionStruct can't load %s\n", modname)); 717 delete rsrcimg; 718 return(FALSE); 719 } 720 BOOL rc = rsrcimg->getVersionStruct(verstruct, bufLength); 721 delete rsrcimg; 722 return rc; 686 723 } 687 724 } … … 693 730 { 694 731 Win32ImageBase *winimage; 732 Win32PeLdrRsrcImg *rsrcimg; 695 733 696 734 dprintf(("GetVersionSize of %s\n", modname)); … … 701 739 else { 702 740 winimage = (Win32ImageBase *)Win32DllBase::findModule(modname); 703 if(winimage == NULL) { 704 dprintf(("GetVersionSize can't find Win32Image for %s\n", modname)); 705 return(FALSE); 741 if(winimage == NULL) 742 { 743 if(Win32ImageBase::isPEImage(modname) == FALSE) 744 { 745 HINSTANCE hInstance; 746 747 //must be an LX dll, just load it (app will probably load it anyway) 748 hInstance = LoadLibraryA(modname); 749 if(hInstance == 0) 750 return 0; 751 winimage = (Win32ImageBase *)Win32DllBase::findModule(hInstance); 752 if(winimage) { 753 return winimage->getVersionSize(); 754 } 755 return 0; 756 } 757 758 //SvL: Try to load it 759 rsrcimg = new Win32PeLdrRsrcImg(modname); 760 if(rsrcimg == NULL) 761 return 0; 762 763 rsrcimg->init(0); 764 if(rsrcimg->getError() != NO_ERROR) 765 { 766 dprintf(("GetVersionSize can't load %s\n", modname)); 767 delete rsrcimg; 768 return(FALSE); 769 } 770 rsrcimg->init(0); 771 int size = rsrcimg->getVersionSize(); 772 delete rsrcimg; 773 return size; 706 774 } 707 775 }
Note:
See TracChangeset
for help on using the changeset viewer.