Changeset 550 for trunk/src/kernel32/wprocess.cpp
- Timestamp:
- Aug 18, 1999, 7:18:01 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/wprocess.cpp
r544 r550 1 /* $Id: wprocess.cpp,v 1.2 1 1999-08-18 12:24:17sandervl Exp $ */1 /* $Id: wprocess.cpp,v 1.22 1999-08-18 17:18:01 sandervl Exp $ */ 2 2 3 3 /* … … 440 440 return hDll; 441 441 } 442 443 444 442 //****************************************************************************** 445 443 //****************************************************************************** … … 452 450 hDll = O32_LoadLibrary(lpszLibFile); 453 451 if(hDll) { 454 return hDll; //converted dll or win32k took care of it452 return hDll; //converted dll or win32k took care of it 455 453 } 456 454 … … 597 595 if(rc) AsciiToUnicode(asciifilename, lpFileName); 598 596 free(asciifilename); 597 return(rc); 598 } 599 //****************************************************************************** 600 //NOTE: GetModuleHandleA does NOT support files with multiple dots (i.e. 601 // very.weird.exe) 602 //****************************************************************************** 603 HANDLE WIN32API GetModuleHandleA(LPCTSTR lpszModule) 604 { 605 HANDLE hMod; 606 Win32Dll *windll; 607 char szModule[CCHMAXPATH]; 608 BOOL fDllModule = FALSE; 609 610 if(lpszModule == NULL) { 611 hMod = WinExe->getInstanceHandle(); 612 } 613 else { 614 strcpy(szModule, StripPath((char *)lpszModule)); 615 strupr(szModule); 616 if(strstr(szModule, ".DLL")) { 617 fDllModule = TRUE; 618 } 619 else { 620 if(!strstr(szModule, ".")) { 621 //if there's no extension or trainling dot, we 622 //assume it's a dll (see Win32 SDK docs) 623 fDllModule = TRUE; 624 } 625 } 626 char *dot = strstr(szModule, "."); 627 if(dot) 628 *dot = 0; 629 630 if(!fDllModule && !strcmpi(lpszModule, WinExe->getModuleName())) { 631 hMod = WinExe->getInstanceHandle(); 632 } 633 else { 634 windll = Win32Dll::findModule(szModule); 635 if(windll) { 636 hMod = windll->getInstanceHandle(); 637 } 638 else hMod = OS2iGetModuleHandleA( (PSZ) lpszModule); 639 } 640 } 641 642 eprintf(("KERNEL32: GetModuleHandle %s returned %X\n", lpszModule, hMod)); 643 return(hMod); 644 } 645 //****************************************************************************** 646 //****************************************************************************** 647 HMODULE WIN32API GetModuleHandleW(LPCWSTR arg1) 648 { 649 HMODULE rc; 650 char *astring; 651 652 astring = UnicodeToAsciiString((LPWSTR)arg1); 653 rc = GetModuleHandleA(astring); 654 dprintf(("KERNEL32: OS2GetModuleHandleW %s returned %X\n", astring, rc)); 655 FreeAsciiString(astring); 599 656 return(rc); 600 657 }
Note:
See TracChangeset
for help on using the changeset viewer.