Changeset 6401 for trunk/src/kernel32
- Timestamp:
- Jul 29, 2001, 9:02:35 PM (24 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/KERNEL32.DEF
r6397 r6401 1 ; $Id: KERNEL32.DEF,v 1.11 7 2001-07-28 18:03:36sandervl Exp $1 ; $Id: KERNEL32.DEF,v 1.118 2001-07-29 19:00:30 sandervl Exp $ 2 2 3 3 ;Basis is Windows95 KERNEL32 … … 1182 1182 _DestroyTIB@0 @2011 NONAME 1183 1183 _GetProcessTIBSel@0 @2012 NONAME 1184 1185 _SetRegistryRootKey@8 @2013 NONAME 1186 _SetCustomBuildName@4 @2014 NONAME 1184 1187 1185 1188 strcmpiW @2020 NONAME -
trunk/src/kernel32/initkernel32.cpp
r6399 r6401 62 62 extern "C" { 63 63 //Win32 resource table (produced by wrc) 64 extern DWORD _Resource_PEResTab;64 extern DWORD kernel32_PEResTab; 65 65 } 66 66 … … 139 139 140 140 PROFILE_LoadOdinIni(); 141 dllHandle = RegisterLxDll(hModule, 0, (PVOID)& _Resource_PEResTab);141 dllHandle = RegisterLxDll(hModule, 0, (PVOID)&kernel32_PEResTab); 142 142 if (dllHandle == 0) 143 143 return 0UL; … … 241 241 HMODULE hModule; 242 242 243 //DosQueryModuleHandle("WGSS50", &hModule);244 //O32__DLL_InitTerm(hModule, 0);243 DosQueryModuleHandle("WGSS50", &hModule); 244 O32__DLL_InitTerm(hModule, 0); 245 245 DosQueryModuleHandle("KERNEL32", &hModule); 246 246 return inittermKernel32(hModule, 0); -
trunk/src/kernel32/kernel32.mak
r6375 r6401 1 # $Id: kernel32.mak,v 1. 8 2001-07-20 15:33:30sandervl Exp $1 # $Id: kernel32.mak,v 1.9 2001-07-29 19:00:31 sandervl Exp $ 2 2 3 3 # … … 6 6 # kernel32.dll makefile 7 7 # 8 WRC_PREFIX_RESOURCE=1 8 9 9 10 # … … 20 21 # Overrides. 21 22 # 22 ##CDEFINES = $(CDEFINES) -DTEST_BUILTIN 23 # 24 # Overrides. 25 # 26 !ifndef WAT 27 RCFLAGS = $(RCFLAGS) -p $(TARGET) 28 !else 29 RCFLAGS += -p $(TARGET) 30 !endif 23 31 24 32 … … 139 147 LIBS = \ 140 148 $(ODIN32_LIB)/$(ODINCRT).lib \ 141 ##$(ODIN32_LIB)\wgss.lib \ 142 $(ODIN32_LIB)\PMWINX.LIB \ 149 $(ODIN32_LIB)\wgss50.LIB \ 143 150 $(ODIN32_LIB)\LIBULS.LIB \ 144 151 $(ODIN32_LIB)\LIBCONV.LIB \ -
trunk/src/kernel32/kernel32lib.mak
r6375 r6401 1 # $Id: kernel32lib.mak,v 1. 1 2001-07-20 15:33:30sandervl Exp $1 # $Id: kernel32lib.mak,v 1.2 2001-07-29 19:00:31 sandervl Exp $ 2 2 3 3 # … … 14 14 EXETARGET = 1 15 15 PUBLICLIB = 1 16 16 WRC_PREFIX_RESOURCE=1 17 17 18 18 # -
trunk/src/kernel32/registry.cpp
r6346 r6401 1 /* $Id: registry.cpp,v 1.1 1 2001-07-16 09:25:16sandervl Exp $ */1 /* $Id: registry.cpp,v 1.12 2001-07-29 19:00:31 sandervl Exp $ */ 2 2 3 3 /* … … 50 50 51 51 52 static HKEY hKeyClassesRoot = HKEY_CLASSES_ROOT_O32; 53 static HKEY hKeyCurrentUser = HKEY_CURRENT_USER_O32; 54 static HKEY hKeyLocalMachine = HKEY_LOCAL_MACHINE_O32; 55 static HKEY hKeyUsers = HKEY_USERS_O32; 56 52 57 /***************************************************************************** 53 58 * Name : Convert Key … … 64 69 static HKEY ConvertKey(HKEY winkey) 65 70 { 66 switch(( int)winkey)71 switch((DWORD)winkey) 67 72 { 68 case HKEY_CLASSES_ROOT: return HKEY_CLASSES_ROOT_O32;69 case HKEY_CURRENT_USER: return HKEY_CURRENT_USER_O32;70 case HKEY_LOCAL_MACHINE: return HKEY_LOCAL_MACHINE_O32;71 case HKEY_USERS: return HKEY_USERS_O32;73 case HKEY_CLASSES_ROOT: return hKeyClassesRoot; 74 case HKEY_CURRENT_USER: return hKeyCurrentUser; 75 case HKEY_LOCAL_MACHINE: return hKeyLocalMachine; 76 case HKEY_USERS: return hKeyUsers; 72 77 } 73 78 return(winkey); 74 79 } 75 80 81 void WIN32API SetRegistryRootKey(HKEY hRootkey, HKEY hKey) 82 { 83 switch((DWORD)hRootkey) 84 { 85 case HKEY_CLASSES_ROOT: 86 hKeyClassesRoot = hKey; 87 break; 88 case HKEY_CURRENT_USER: 89 hKeyCurrentUser = hKey; 90 break; 91 case HKEY_LOCAL_MACHINE: 92 hKeyLocalMachine = hKey; 93 break; 94 case HKEY_USERS: 95 hKeyUsers = hKey; 96 break; 97 } 98 } 76 99 77 100 /***************************************************************************** -
trunk/src/kernel32/windlllx.cpp
r6015 r6401 1 /* $Id: windlllx.cpp,v 1.2 0 2001-06-15 09:42:48 birdExp $ */1 /* $Id: windlllx.cpp,v 1.21 2001-07-29 19:00:32 sandervl Exp $ */ 2 2 3 3 /* … … 40 40 #include "dbglocal.h" 41 41 42 char *lpszCustomDllName = NULL; 43 44 //****************************************************************************** 45 //****************************************************************************** 46 void WIN32API SetCustomBuildName(char *lpszName) 47 { 48 lpszCustomDllName = lpszName; 49 } 42 50 //****************************************************************************** 43 51 //Create LX Dll object and send process attach message … … 65 73 char szFileName[CCHMAXPATH], szErrName[CCHMAXPATH]; 66 74 67 if(OSLibGetDllName(hInstance, szFileName, sizeof(szFileName)) == FALSE) { 68 dprintf(("ERROR: RegisterLxDll: OSLibGetDllName %x failed!!", hInstance)); 69 return 0; 70 } 71 dprintf(("RegisterLxDll %x %s", hInstance, szFileName)); 72 //Make sure DosLoadModule is called at least once for a dll (to make sure 73 //OS/2 doesn't unload the dll when it's still needed) 74 rc = DosLoadModule(szErrName, sizeof(szErrName), szFileName, &hInstance); 75 if(rc != 0) { 76 dprintf(("ERROR: RegisterLxDll: DosLoadModule %s failed (rc=%d)!!", szFileName, rc)); 77 return 0; 78 } 79 75 if(!lpszCustomDllName) { 76 if(OSLibGetDllName(hInstance, szFileName, sizeof(szFileName)) == FALSE) { 77 dprintf(("ERROR: RegisterLxDll: OSLibGetDllName %x failed!!", hInstance)); 78 return 0; 79 } 80 dprintf(("RegisterLxDll %x %s", hInstance, szFileName)); 81 //Make sure DosLoadModule is called at least once for a dll (to make sure 82 //OS/2 doesn't unload the dll when it's still needed) 83 rc = DosLoadModule(szErrName, sizeof(szErrName), szFileName, &hInstance); 84 if(rc != 0) { 85 dprintf(("ERROR: RegisterLxDll: DosLoadModule %s failed (rc=%d)!!", szFileName, rc)); 86 return 0; 87 } 88 } 80 89 windll = new Win32LxDll(hInstance, EntryPoint, pResData, MajorImageVersion, 81 90 MinorImageVersion, Subsystem); 82 91 if(windll == NULL) { 83 dprintf(("RegisterLxDll: windll == NULL!!!"));84 return 0;92 dprintf(("RegisterLxDll: windll == NULL!!!")); 93 return 0; 85 94 } 86 95 if(!fPeLoader) { 87 windll->AddRef();88 89 if(windll->attachProcess() == 0)90 return 0;91 92 return windll->getInstanceHandle();96 windll->AddRef(); 97 98 if(windll->attachProcess() == 0) 99 return 0; 100 101 return windll->getInstanceHandle(); 93 102 } 94 103 IMAGE_DOS_HEADER doshdr; … … 105 114 rc = DosQueryHeaderInfo(hInstance, 0, &doshdr, sizeof(IMAGE_DOS_HEADER), QHINF_READFILE); 106 115 if(rc) { 107 goto hdrerror;116 goto hdrerror; 108 117 } 109 118 rc = DosQueryHeaderInfo(hInstance, doshdr.e_lfanew, &lxhdr, sizeof(e32_exe), QHINF_READFILE); 110 119 if(rc) { 111 goto hdrerror;120 goto hdrerror; 112 121 } 113 122 offset = doshdr.e_lfanew + lxhdr.e32_impmod; 114 123 for(i=0;i<lxhdr.e32_impmodcnt;i++) { 115 rc = DosQueryHeaderInfo(hInstance, offset, &modsize, 1, QHINF_READFILE); 116 if(rc) { 117 goto hdrerror; 118 } 119 rc = DosQueryHeaderInfo(hInstance, offset+1, &modulename, min(modsize, sizeof(modulename)), QHINF_READFILE); 120 if(rc) { 121 goto hdrerror; 122 } 123 modulename[modsize] = 0; 124 windlldep = Win32DllBase::findModule(modulename, TRUE); 125 if(windlldep && strcmp(windlldep->getModuleName(), windll->getModuleName())) { 126 dprintf(("RegisterLxDll: Add dependency %s -> %s", windll->getModuleName(), modulename)); 127 windll->addDependency(windlldep); 128 } 129 else dprintf(("HARMLESS WARNING: Can't find dll %s referenced by %s", modulename, windll->getModuleName())); 130 offset += modsize + 1; 124 rc = DosQueryHeaderInfo(hInstance, offset, &modsize, 1, QHINF_READFILE); 125 if(rc) { 126 goto hdrerror; 127 } 128 rc = DosQueryHeaderInfo(hInstance, offset+1, &modulename, min(modsize, sizeof(modulename)), QHINF_READFILE); 129 if(rc) { 130 goto hdrerror; 131 } 132 modulename[modsize] = 0; 133 windlldep = Win32DllBase::findModule(modulename, TRUE); 134 if(windlldep && strcmp(windlldep->getModuleName(), windll->getModuleName())) { 135 dprintf(("RegisterLxDll: Add dependency %s -> %s", windll->getModuleName(), modulename)); 136 windll->addDependency(windlldep); 137 } 138 else dprintf(("HARMLESS WARNING: Can't find dll %s referenced by %s", modulename, windll->getModuleName())); 139 140 offset += modsize + 1; 131 141 } 132 142 return windll->getInstanceHandle(); -
trunk/src/kernel32/winimagelx.cpp
r3993 r6401 1 /* $Id: winimagelx.cpp,v 1. 9 2000-08-11 10:56:19sandervl Exp $ */1 /* $Id: winimagelx.cpp,v 1.10 2001-07-29 19:00:32 sandervl Exp $ */ 2 2 3 3 /* … … 42 42 #include "dbglocal.h" 43 43 44 extern char *lpszCustomDllName; //windlllx.cpp 45 44 46 static BYTE dosHeader[] = { 45 47 0x4D, 0x5A, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x0B, 0x00, … … 66 68 { 67 69 APIRET rc; 70 char *name; 68 71 69 72 szFileName[0] = 0; 70 73 71 char *name = OSLibGetDllName(hinstance); 74 if(lpszCustomDllName) { 75 name = lpszCustomDllName; 76 } 77 else name = OSLibGetDllName(hinstance); 78 72 79 strcpy(szFileName, name); 73 80 strupr(szFileName);
Note:
See TracChangeset
for help on using the changeset viewer.