- Timestamp:
- Nov 9, 1999, 3:19:47 PM (26 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/KERNEL32.DEF
r1605 r1663 1 ; $Id: KERNEL32.DEF,v 1.4 8 1999-11-05 09:16:56sandervl Exp $1 ; $Id: KERNEL32.DEF,v 1.49 1999-11-09 14:19:45 sandervl Exp $ 2 2 3 3 ;Created by BLAST for IBM's compiler … … 1025 1025 LocalToWideChar = _LocalToWideChar@12 @1250 1026 1026 1027 VIRTUAL_MapFileA =_VIRTUAL_MapFileA@8 @12511028 VIRTUAL_MapFileW =_VIRTUAL_MapFileW@8 @12521027 _VIRTUAL_MapFileA@8 @1251 1028 _VIRTUAL_MapFileW@8 @1252 1029 1029 1030 1030 OS2SetExceptionHandler @1253 … … 1033 1033 ; Odin ini management 1034 1034 1035 PROFILE_GetOdinIniString =_PROFILE_GetOdinIniString@20 @12641036 PROFILE_SetOdinIniString =_PROFILE_SetOdinIniString@12 @12651037 PROFILE_GetOdinIniInt =_PROFILE_GetOdinIniInt@12 @12661038 PROFILE_SetOdinIniInt =_PROFILE_SetOdinIniInt@12 @12671039 PROFILE_GetOdinIniBool =_PROFILE_GetOdinIniBool@12 @12681040 PROFILE_SetOdinIniBool =_PROFILE_SetOdinIniBool@12 @12691041 PROFILE_SaveOdinIni =_PROFILE_SaveOdinIni@0 @12701035 _PROFILE_GetOdinIniString@20 @1264 1036 _PROFILE_SetOdinIniString@12 @1265 1037 _PROFILE_GetOdinIniInt@12 @1266 1038 _PROFILE_SetOdinIniInt@12 @1267 1039 _PROFILE_GetOdinIniBool@12 @1268 1040 _PROFILE_SetOdinIniBool@12 @1269 1041 _PROFILE_SaveOdinIni@0 @1270 1042 1042 1043 1043 ;shared memory allocation -
trunk/src/kernel32/heapstring.cpp
r1605 r1663 1 /* $Id: heapstring.cpp,v 1.1 7 1999-11-05 09:16:57sandervl Exp $ */1 /* $Id: heapstring.cpp,v 1.18 1999-11-09 14:19:46 sandervl Exp $ */ 2 2 3 3 /* … … 539 539 } 540 540 541 uni_chars_left = unilen-1; //elements 541 //SvL: Determine length of unicode string 542 uni_chars_left = UniStrlen((UniChar*)ustring)+1; 543 uni_chars_left = min(uni_chars_left, unilen); 544 unilen = uni_chars_left; 545 542 546 out_bytes_left = uni_chars_left; //size in bytes == elements 543 547 in_buf = (UniChar*)ustring; … … 625 629 //in_bytes_left = asciilen-1; //buffer size in bytes 626 630 627 in_bytes_left = asciilen; //buffer size in bytes 631 //SvL: Determine length of ascii string 632 in_bytes_left = strlen(in_buf)+1; 633 in_bytes_left = min(in_bytes_left, asciilen); //buffer size in bytes 634 628 635 out_buf = (UniChar*)unicode; 629 636 … … 637 644 //@@@PH what's this? 638 645 //unicode[asciilen-1-in_bytes_left] = 0; 639 640 //if (rc != ULS_SUCCESS && in_bytes_left > 0) //CB: never the case during my tests641 // dprintf(("KERNEL32: AsciiToUnicode failed, %d bytes left!\n",in_bytes_left));642 646 643 647 //@@@PH what's this? -
trunk/src/kernel32/initterm.cpp
r1640 r1663 1 /* $Id: initterm.cpp,v 1.2 2 1999-11-08 15:45:19sandervl Exp $ */1 /* $Id: initterm.cpp,v 1.23 1999-11-09 14:19:46 sandervl Exp $ */ 2 2 3 3 /* … … 108 108 return 0UL; 109 109 110 PROFILE_LoadOdinIni(); 110 111 if(RegisterLxDll(hModule, 0, 0) == FALSE) 111 112 return 0UL; … … 131 132 //(std handles can be used in win32 dll initialization routines 132 133 HMInitialize(); /* store standard handles within HandleManager */ 133 PROFILE_LoadOdinIni();134 134 InitDirectories(); 135 135 break; -
trunk/src/kernel32/makefile
r1641 r1663 1 # $Id: makefile,v 1.5 3 1999-11-08 20:53:24sandervl Exp $1 # $Id: makefile,v 1.54 1999-11-09 14:19:46 sandervl Exp $ 2 2 3 3 # … … 334 334 pefile.OBJ: pefile.cpp $(PDWIN32_INCLUDE)\pefile.h $(PDWIN32_INCLUDE)\winres.h 335 335 336 winimagebase.obj: winimagebase.cpp $(PDWIN32_INCLUDE)\winimagebase.h 337 winimagepe2lx.obj: winimagepe2lx.cpp $(PDWIN32_INCLUDE)\winimagebase.h $(PDWIN32_INCLUDE)\winimagepe2lx.h 338 winimagepeldr.obj: winimagepeldr.cpp $(PDWIN32_INCLUDE)\winimagebase.h $(PDWIN32_INCLUDE)\winimagepeldr.h 336 winimagebase.obj: winimagebase.cpp $(PDWIN32_INCLUDE)\winimagebase.h $(PDWIN32_INCLUDE)\windllbase.h 337 winimagepe2lx.obj: winimagepe2lx.cpp $(PDWIN32_INCLUDE)\winimagebase.h $(PDWIN32_INCLUDE)\winimagepe2lx.h $(PDWIN32_INCLUDE)\windllbase.h 338 winimagepeldr.obj: winimagepeldr.cpp $(PDWIN32_INCLUDE)\winimagebase.h $(PDWIN32_INCLUDE)\winimagepeldr.h $(PDWIN32_INCLUDE)\windllbase.h 339 339 winimagelx.obj: winimagelx.cpp $(PDWIN32_INCLUDE)\winimagebase.h $(PDWIN32_INCLUDE)\winimagelx.h 340 windllbase.obj: windllbase.cpp $(PDWIN32_INCLUDE)\windllbase.h $(PDWIN32_INCLUDE)\winimagebase.h 340 windllbase.obj: windllbase.cpp $(PDWIN32_INCLUDE)\windllbase.h $(PDWIN32_INCLUDE)\winimagebase.h profile.h 341 341 windllpe2lx.obj: windllpe2lx.cpp $(PDWIN32_INCLUDE)\windllbase.h $(PDWIN32_INCLUDE)\windllpe2lx.h \ 342 342 $(PDWIN32_INCLUDE)\winimagepe2lx.h $(PDWIN32_INCLUDE)\winimagebase.h -
trunk/src/kernel32/profile.cpp
r1370 r1663 1 /* $Id: profile.cpp,v 1. 19 1999-10-20 08:09:05sandervl Exp $ */1 /* $Id: profile.cpp,v 1.20 1999-11-09 14:19:46 sandervl Exp $ */ 2 2 3 3 /* … … 29 29 #include "winnls.h" 30 30 31 #include "profile.h" 31 32 32 33 ODINDEBUGCHANNEL(PROFILE) … … 80 81 /* ODIN.INI profile content */ 81 82 BOOL OdinProfileChanged = FALSE; 82 static PROFILESECTION *PROFILE_OdinProfile ;83 static PROFILESECTION *PROFILE_OdinProfile = NULL; 83 84 84 85 #define PROFILE_MAX_LINE_LEN 1024 85 86 #define WINININAME "WIN.INI" 86 87 /* Odin profile name in KERNEL32.DLL directory */88 #define ODINININAME "ODIN.INI"89 87 90 88 /* Odin profile: the profile file being used */ … … 699 697 LPCSTR,key_name, 700 698 LPCSTR,def, 701 LP CSTR,buffer,702 int,len)699 LPSTR,buffer, 700 UINT,len) 703 701 { 704 702 int ret; -
trunk/src/kernel32/profile.h
r1370 r1663 1 /* $Id: profile.h,v 1. 3 1999-10-20 08:09:05sandervl Exp $ */1 /* $Id: profile.h,v 1.4 1999-11-09 14:19:46 sandervl Exp $ */ 2 2 /* 3 3 * Profile header for initterm … … 9 9 #define __PROFILE_H__ 10 10 11 #include <odinwrap.h> 12 13 /* Odin profile name in KERNEL32.DLL directory */ 14 #define ODINININAME "ODIN.INI" 15 11 16 void WINAPI WriteOutProfiles(void); 12 voidWINAPI PROFILE_LoadOdinIni(void);17 int WINAPI PROFILE_LoadOdinIni(void); 13 18 19 INT ODIN_EXTERN(GetPrivateProfileStringA)(LPCSTR section, LPCSTR entry, 20 LPCSTR def_val, LPSTR buffer, 21 UINT len, LPCSTR filename); 22 23 int ODIN_EXTERN(PROFILE_GetOdinIniString)(LPCSTR section, LPCSTR entry, 24 LPCSTR def_val, LPSTR buffer, 25 UINT len); 14 26 #endif -
trunk/src/kernel32/windllbase.cpp
r1134 r1663 1 /* $Id: windllbase.cpp,v 1. 2 1999-10-04 22:25:02 phallerExp $ */1 /* $Id: windllbase.cpp,v 1.3 1999-11-09 14:19:47 sandervl Exp $ */ 2 2 3 3 /* … … 33 33 #include "oslibmisc.h" 34 34 #include "oslibdos.h" 35 #include "profile.h" 35 36 36 37 VMutex dlllistmutex; //protects linked lists of heaps … … 266 267 delete Win32DllBase::head; 267 268 } 269 } 270 //****************************************************************************** 271 //rename dll if necessary: 272 // Win32 to OS/2 : (i.e. OLE32 -> OLE32OS2) 273 // or 274 // OS/2 to Win32 : (i.e. OLE32OS2 -> OLE32) 275 //****************************************************************************** 276 void Win32DllBase::renameDll(char *dllname, BOOL fWinToOS2) 277 { 278 char modname[CCHMAXPATH]; 279 char renameddll[CCHMAXPATH]; 280 char *namestart; 281 char *sectionname; 282 283 if(fWinToOS2) { 284 sectionname = DLLRENAMEWIN_SECTION; 285 } 286 else { 287 sectionname = DLLRENAMEOS2_SECTION; 288 } 289 namestart = OSLibStripPath(dllname); 290 strcpy(modname, namestart); 291 char *dot = strrchr(modname, '.'); 292 if(dot) 293 *dot = 0; 294 strupr(modname); 295 if(ODIN_PROFILE_GetOdinIniString(sectionname, modname, "", renameddll, 296 sizeof(renameddll)-1) > 1) 297 { 298 if(namestart == dllname) { 299 strcpy(dllname, renameddll); 300 } 301 else { 302 *namestart = 0; 303 strcat(dllname, renameddll); 304 } 305 strcat(dllname, ".dll"); 306 } 307 return; 268 308 } 269 309 //****************************************************************************** -
trunk/src/kernel32/winimagebase.cpp
r1475 r1663 1 /* $Id: winimagebase.cpp,v 1. 3 1999-10-27 10:35:42sandervl Exp $ */1 /* $Id: winimagebase.cpp,v 1.4 1999-11-09 14:19:47 sandervl Exp $ */ 2 2 3 3 /* … … 56 56 strcpy(szFileName, name); 57 57 strupr(szFileName); 58 59 //rename dll (os/2 -> win32) if necessary (i.e. OLE32OS2 -> OLE32) 60 Win32DllBase::renameDll(szFileName, FALSE); 58 61 59 62 name = strrchr(szFileName, '\\')+1; -
trunk/src/kernel32/winimagepeldr.cpp
r1579 r1663 1 /* $Id: winimagepeldr.cpp,v 1.1 0 1999-11-03 20:18:22sandervl Exp $ */1 /* $Id: winimagepeldr.cpp,v 1.11 1999-11-09 14:19:47 sandervl Exp $ */ 2 2 3 3 /* … … 1060 1060 if(WinDll == NULL) 1061 1061 { //not found, so load it 1062 if(isPEImage(pszCurModule) == FALSE) 1062 char modname[CCHMAXPATH]; 1063 1064 strcpy(modname, pszCurModule); 1065 //rename dll if necessary (i.e. OLE32 -> OLE32OS2) 1066 Win32DllBase::renameDll(modname); 1067 1068 if(isPEImage(modname) == FALSE) 1063 1069 {//LX image, so let OS/2 do all the work for us 1064 1070 APIRET rc; 1065 1071 char szModuleFailure[CCHMAXPATH] = ""; 1066 char szModuleName[CCHMAXPATH];1067 1072 ULONG hInstanceNewDll; 1068 1073 1069 strcpy(szModuleName, pszCurModule); 1070 char *dot = strchr(szModuleName, '.'); 1074 char *dot = strchr(modname, '.'); 1071 1075 if(dot) { 1072 1076 *dot = 0; 1073 1077 } 1074 strcat( szModuleName, ".DLL");1075 rc = DosLoadModule(szModuleFailure, sizeof(szModuleFailure), szModuleName, (HMODULE *)&hInstanceNewDll);1078 strcat(modname, ".DLL"); 1079 rc = DosLoadModule(szModuleFailure, sizeof(szModuleFailure), modname, (HMODULE *)&hInstanceNewDll); 1076 1080 if(rc) { 1077 1081 dprintf(("DosLoadModule returned %X for %s\n", rc, szModuleFailure)); … … 1087 1091 } 1088 1092 else { 1089 WinDll = new Win32PeLdrDll( pszCurModule, this);1093 WinDll = new Win32PeLdrDll(modname, this); 1090 1094 1091 1095 if(WinDll == NULL) { -
trunk/src/kernel32/wprocess.cpp
r1618 r1663 1 /* $Id: wprocess.cpp,v 1.4 4 1999-11-05 14:06:44sandervl Exp $ */1 /* $Id: wprocess.cpp,v 1.45 1999-11-09 14:19:47 sandervl Exp $ */ 2 2 3 3 /* … … 311 311 } 312 312 313 hDll = O32_LoadLibrary(lpszLibFile); 313 strcpy(modname, lpszLibFile); 314 strupr(modname); 315 //rename dll if necessary (i.e. OLE32 -> OLE32OS2) 316 Win32DllBase::renameDll(modname); 317 318 hDll = O32_LoadLibrary(modname); 314 319 dprintf(("KERNEL32: iLoadLibraryA %s returned %X (%d)\n", 315 320 lpszLibFile, … … 321 326 } 322 327 323 strcpy(modname, lpszLibFile);324 strupr(modname);325 328 if(!strstr(modname, ".")) { 326 329 strcat(modname,".DLL"); … … 696 699 //Retrieve the version 697 700 //****************************************************************************** 698 BOOL SYSTEM GetVersionStruct(char * modname, char *verstruct, ULONG bufLength)701 BOOL SYSTEM GetVersionStruct(char *lpszModName, char *verstruct, ULONG bufLength) 699 702 { 700 703 Win32ImageBase *winimage; 701 704 Win32PeLdrRsrcImg *rsrcimg; 702 705 703 dprintf(("GetVersionStruct "));704 if(WinExe && !stricmp(WinExe->getFullPath(), modname)) {706 dprintf(("GetVersionStruct of module %s", lpszModName)); 707 if(WinExe && !stricmp(WinExe->getFullPath(), lpszModName)) { 705 708 winimage = (Win32ImageBase *)WinExe; 706 709 } 707 710 else { 708 winimage = (Win32ImageBase *)Win32DllBase::findModule( modname);711 winimage = (Win32ImageBase *)Win32DllBase::findModule(lpszModName); 709 712 if(winimage == NULL) 710 713 { 714 char modname[CCHMAXPATH]; 715 716 strcpy(modname, lpszModName); 717 //rename dll if necessary (i.e. OLE32 -> OLE32OS2) 718 Win32DllBase::renameDll(modname); 719 711 720 if(Win32ImageBase::isPEImage(modname) == FALSE) 712 721 { … … 744 753 //****************************************************************************** 745 754 //****************************************************************************** 746 ULONG SYSTEM GetVersionSize(char * modname)755 ULONG SYSTEM GetVersionSize(char *lpszModName) 747 756 { 748 757 Win32ImageBase *winimage; 749 758 Win32PeLdrRsrcImg *rsrcimg; 750 759 751 dprintf(("GetVersionSize of %s\n", modname));752 753 if(WinExe && !stricmp(WinExe->getFullPath(), modname)) {760 dprintf(("GetVersionSize of %s\n", lpszModName)); 761 762 if(WinExe && !stricmp(WinExe->getFullPath(), lpszModName)) { 754 763 winimage = (Win32ImageBase *)WinExe; 755 764 } 756 765 else { 757 winimage = (Win32ImageBase *)Win32DllBase::findModule( modname);766 winimage = (Win32ImageBase *)Win32DllBase::findModule(lpszModName); 758 767 if(winimage == NULL) 759 768 { 769 char modname[CCHMAXPATH]; 770 771 strcpy(modname, lpszModName); 772 //rename dll if necessary (i.e. OLE32 -> OLE32OS2) 773 Win32DllBase::renameDll(modname); 774 760 775 if(Win32ImageBase::isPEImage(modname) == FALSE) 761 776 {
Note:
See TracChangeset
for help on using the changeset viewer.