Changeset 9828 for trunk/src/kernel32/wprocess.cpp
- Timestamp:
- Feb 20, 2003, 10:47:01 AM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/wprocess.cpp
r9802 r9828 1 /* $Id: wprocess.cpp,v 1.18 0 2003-02-13 17:16:50sandervl Exp $ */1 /* $Id: wprocess.cpp,v 1.181 2003-02-20 09:47:01 sandervl Exp $ */ 2 2 3 3 /* … … 51 51 #include <win\ntddk.h> 52 52 53 #include <custombuild.h> 54 53 55 #define DBG_LOCALLOG DBG_wprocess 54 56 #include "dbglocal.h" … … 88 90 static TEB *threadList = 0; 89 91 static VMutex threadListMutex; 92 93 /** 94 * LoadLibraryExA callback for LX Dlls, it's call only on the initial load. 95 * Maintained by ODIN_SetLxDllLoadCallback(). 96 * Note! Because of some hacks it may also be called from Win32LxDll::Release(). 97 */ 98 PFNLXDLLLOAD pfnLxDllLoadCallback = NULL; 90 99 91 100 … … 451 460 //****************************************************************************** 452 461 // ODIN_SetTIBSwitch: override TIB switching 453 // 462 // 454 463 // Parameters: 455 464 // BOOL fSwitchTIB … … 743 752 fDisableLXDllLoading = TRUE; 744 753 } 754 755 756 /** 757 * Custombuild API for registering a callback for LX Dll loading thru LoadLibrary*(). 758 * @returns Success indicator. 759 * @param pfn Pointer to callback. 760 * NULL if callback is deregistered. 761 */ 762 BOOL WIN32API ODIN_SetLxDllLoadCallback(PFNLXDLLLOAD pfn) 763 { 764 pfnLxDllLoadCallback = pfn; 765 return TRUE; 766 } 767 745 768 746 769 /** … … 942 965 * Try load the executable using LoadLibrary 943 966 * IF successfully loaded THEN 944 * IF LX dll and is using the PE Loader THEN 945 * Set Load library. 946 * Inc reference count. 967 * Try find registered/pe2lx object. 968 * IF callback Then 969 * If callback give green light Then 970 * Find registered lx object. 971 * Else 972 * Unload it if loaded. 973 * Endif 947 974 * Endif 948 * Inc dynamic reference count. 949 * RETURN successfully. 975 * IF module object found Then 976 * IF LX dll and is using the PE Loader THEN 977 * Set Load library. 978 * Inc reference count. 979 * Endif 980 * Inc dynamic reference count. 981 * RETURN successfully. 982 * Else 983 * fail. 984 * Endif 950 985 * Endif 951 986 * Endif … … 959 994 /* OS/2 dll, system dll, converted dll or win32k took care of it. */ 960 995 pModule = Win32DllBase::findModuleByOS2Handle(hDll); 996 /* Custombuild customizing may take care of it too. */ 997 if (pfnLxDllLoadCallback) 998 { 999 /* If callback says yes, continue load it, else fail. */ 1000 if (pfnLxDllLoadCallback(hDll, pModule ? pModule->getInstanceHandle() : NULL)) 1001 pModule = Win32DllBase::findModuleByOS2Handle(hDll); 1002 else if (pModule) 1003 { 1004 pModule->Release(); 1005 pModule = NULL; 1006 } 1007 } 961 1008 if (pModule) 962 1009 { … … 1835 1882 #endif 1836 1883 1837 if(bInheritHandles && lpStartupInfo->dwFlags & STARTF_USESTDHANDLES) 1884 if(bInheritHandles && lpStartupInfo->dwFlags & STARTF_USESTDHANDLES) 1838 1885 { 1839 1886 //Translate standard handles if the child needs to inherit them … … 1845 1892 retcode |= HMHandleTranslateToOS2(lpStartupInfo->hStdError, &startinfo.hStdError); 1846 1893 1847 if(retcode) { 1894 if(retcode) { 1848 1895 SetLastError(ERROR_INVALID_HANDLE); 1849 1896 return FALSE; … … 2321 2368 //****************************************************************************** 2322 2369 // ODIN_SetProcAddress: Override a dll export 2323 // 2370 // 2324 2371 // Parameters: 2325 2372 // HMODULE hModule Module handle … … 2331 2378 // 2332 2379 //****************************************************************************** 2333 FARPROC WIN32API ODIN_SetProcAddress(HMODULE hModule, LPCSTR lpszProc, 2380 FARPROC WIN32API ODIN_SetProcAddress(HMODULE hModule, LPCSTR lpszProc, 2334 2381 FARPROC pfnNewProc) 2335 2382 {
Note:
See TracChangeset
for help on using the changeset viewer.