- Timestamp:
- Aug 17, 1999, 6:35:30 PM (26 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/HandleManager.cpp
r461 r529 1 /* $Id: HandleManager.cpp,v 1. 8 1999-08-09 22:10:07phaller Exp $ */1 /* $Id: HandleManager.cpp,v 1.9 1999-08-17 16:35:08 phaller Exp $ */ 2 2 3 3 /* … … 46 46 #include <stdlib.h> 47 47 #include <string.h> 48 #include <odincrt.h>49 48 50 49 #include "unicode.h" … … 310 309 311 310 /* create handle manager instance for Open32 handles */ 312 ODIN_FS_BEGIN313 311 HMGlobals.pHMOpen32 = new HMDeviceOpen32Class("\\\\.\\"); 314 312 HMGlobals.pHMEvent = new HMDeviceEventClass("\\\\EVENT\\"); 315 313 HMGlobals.pHMMutex = new HMDeviceMutexClass("\\\\MUTEX\\"); 316 314 HMGlobals.pHMSemaphore = new HMDeviceSemaphoreClass("\\\\SEM\\"); 317 ODIN_FS_END318 315 } 319 316 return (NO_ERROR); … … 337 334 /* @@@PH we could deallocate the device list here */ 338 335 339 ODIN_FS_BEGIN340 336 delete HMGlobals.pHMOpen32; 341 337 delete HMGlobals.pHMEvent; 342 338 delete HMGlobals.pHMMutex; 343 339 delete HMGlobals.pHMSemaphore; 344 ODIN_FS_END345 340 346 341 return (NO_ERROR); -
trunk/src/kernel32/KERNEL32.CPP
r462 r529 1 /* $Id: KERNEL32.CPP,v 1.1 2 1999-08-09 22:38:01phaller Exp $ */1 /* $Id: KERNEL32.CPP,v 1.13 1999-08-17 16:35:09 phaller Exp $ */ 2 2 3 3 /* … … 26 26 #include <stdlib.h> 27 27 #include <string.h> 28 #include <odincrt.h>28 //#include <odincrt.h> 29 29 30 30 #include "misc.h" -
trunk/src/kernel32/heap.cpp
r469 r529 1 /* $Id: heap.cpp,v 1.1 1 1999-08-10 12:43:22phaller Exp $ */1 /* $Id: heap.cpp,v 1.12 1999-08-17 16:35:09 phaller Exp $ */ 2 2 3 3 /* … … 16 16 #define _WIN32 17 17 #include "os2heap.h" 18 #include <odincrt.h>19 18 #include <heap.h> 20 19 … … 67 66 return(NULL); 68 67 69 ODIN_FS_BEGIN70 68 curheap = new OS2Heap(hHeap, flOptions, dwInitialSize, dwMaximumSize); 71 ODIN_FS_END72 69 73 70 if(curheap == NULL) … … 80 77 { 81 78 O32_HeapDestroy(hHeap); 82 ODIN_delete(curheap);79 delete(curheap); 83 80 return(NULL); 84 81 } … … 95 92 96 93 O32_HeapDestroy(curheap->getHeapHandle()); 97 ODIN_delete(curheap);94 delete curheap; 98 95 return(TRUE); 99 96 } … … 157 154 hHeap = O32_HeapCreate(HEAP_GENERATE_EXCEPTIONS, 1, 0x4000); 158 155 159 ODIN_FS_BEGIN160 156 OS2ProcessHeap = new OS2Heap(hHeap, HEAP_GENERATE_EXCEPTIONS, 0x4000, 0); 161 ODIN_FS_END162 157 163 158 if(OS2ProcessHeap == NULL) { -
trunk/src/kernel32/initterm.cpp
r511 r529 1 /* $Id: initterm.cpp,v 1. 9 1999-08-16 16:55:32 sandervlExp $ */1 /* $Id: initterm.cpp,v 1.10 1999-08-17 16:35:09 phaller Exp $ */ 2 2 3 3 /* … … 28 28 #define INCL_DOSMISC 29 29 #define INCL_DOSPROCESS 30 #include <os2wrap.h> 30 #include <os2wrap.h> //Odin32 OS/2 api wrappers 31 31 #include <stdlib.h> 32 32 #include <stdio.h> … … 35 35 #include <wprocess.h> 36 36 #include "handlemanager.h" 37 #include "profile.h" 37 38 38 39 /*-------------------------------------------------------------------*/ … … 106 107 else flAllocMem = 0; // no high memory support 107 108 108 109 110 111 109 InitializeTIB(TRUE); 110 //SvL: Do it here instead of during the exe object creation 111 //(std handles can be used in win32 dll initialization routines 112 HMInitialize(); /* store standard handles within HandleManager */ 112 113 break; 113 114 case 1 : … … 127 128 { 128 129 dprintf(("kernel32 exit %d\n", ulReason)); 130 WriteOutProfiles(); 129 131 _ctordtorTerm(); 130 132 DestroyTIB(); -
trunk/src/kernel32/os2heap.cpp
r461 r529 1 /* $Id: os2heap.cpp,v 1. 6 1999-08-09 22:10:08phaller Exp $ */1 /* $Id: os2heap.cpp,v 1.7 1999-08-17 16:35:09 phaller Exp $ */ 2 2 3 3 /* … … 17 17 #include <stdlib.h> 18 18 #include <string.h> 19 #include <odincrt.h>20 19 21 20 #include "win32type.h" … … 54 53 if(!(flOptions & HEAP_NO_SERIALIZE)) 55 54 { 56 ODIN_FS_BEGIN57 55 hmutex = new VMutex(); 58 ODIN_FS_END59 56 dassert(hmutex, ("ERROR: new VMutex\n")); 60 57 } … … 94 91 { 95 92 hmutex->leave(); 96 ODIN_delete(hmutex);93 delete hmutex; 97 94 } 98 95 -
trunk/src/kernel32/profile.cpp
r436 r529 1 /* $Id: profile.cpp,v 1. 8 1999-08-06 12:14:12phaller Exp $ */1 /* $Id: profile.cpp,v 1.9 1999-08-17 16:35:10 phaller Exp $ */ 2 2 3 3 /* … … 10 10 * Copyright 1998 Sander van Leeuwen (sandervl@xs4all.nl) 11 11 * Copyright 1998 Patrick Haller 12 * Copyright 1999 Christoph Bratschi 12 13 */ 13 14 … … 63 64 BOOL changed; 64 65 PROFILESECTION *section; 65 char *filename; 66 char *filename; //first open name 67 char *fullname; //name with path 66 68 time_t mtime; 67 69 } PROFILE; … … 79 81 80 82 #define PROFILE_MAX_LINE_LEN 1024 83 #define WINININAME "WIN.INI" 81 84 82 85 /* Wine profile name in $HOME directory; must begin with slash */ … … 91 94 #define WINE_INI_GLOBAL ETCDIR "/wine.conf" 92 95 93 static LPCWSTR wininiW = NULL; 96 static LPCWSTR wininiW = NULL; //CB: never freed 94 97 95 98 static CRITICAL_SECTION PROFILE_CritSect; … … 398 401 399 402 // try to open file 400 file = fopen(CurProfile->f ilename, "w");403 file = fopen(CurProfile->fullname, "w"); 401 404 if (!file) 402 405 { 403 dprintf(("Kernel32:Profile:could not save profile file %s\n", CurProfile->f ilename));406 dprintf(("Kernel32:Profile:could not save profile file %s\n", CurProfile->fullname)); 404 407 return FALSE; 405 408 } 406 409 407 dprintf(("Kernel32:Profile:Saving %s\n", CurProfile->f ilename ));410 dprintf(("Kernel32:Profile:Saving %s\n", CurProfile->fullname )); 408 411 PROFILE_Save( file, CurProfile->section ); 409 412 fclose( file ); 410 413 CurProfile->changed = FALSE; 411 if(!stat(CurProfile->f ilename,&buf))414 if(!stat(CurProfile->fullname,&buf)) 412 415 CurProfile->mtime=buf.st_mtime; 413 416 return TRUE; … … 425 428 PROFILE_Free( CurProfile->section ); 426 429 if (CurProfile->filename) HeapFree( SystemHeap, 0, CurProfile->filename ); 430 if (CurProfile->fullname) HeapFree(SystemHeap,0,CurProfile->fullname); 427 431 CurProfile->changed = FALSE; 428 432 CurProfile->section = NULL; 429 433 CurProfile->filename = NULL; 434 CurProfile->fullname = NULL; 430 435 CurProfile->mtime = 0; 431 436 } … … 439 444 static BOOL PROFILE_Open( LPCSTR filename ) 440 445 { 441 char buffer[MAX_PATHNAME_LEN];442 446 FILE *file = NULL; 443 447 int i,j; 444 448 struct stat buf; 445 449 PROFILE *tempProfile; 450 451 if (!filename || filename[0] == 0) return FALSE; 446 452 447 453 /* First time around */ … … 454 460 MRUProfile[i]->section=NULL; 455 461 MRUProfile[i]->filename=NULL; 462 MRUProfile[i]->fullname=NULL; 456 463 MRUProfile[i]->mtime=0; 457 464 } … … 459 466 /* Check for a match */ 460 467 461 if (!strchr( filename, '/' ) &&462 !strchr( filename, '\\' ) &&463 !strchr( filename, ':' ))464 {465 GetWindowsDirectoryA( buffer, sizeof(buffer) );466 strcat( buffer, "\\" );467 strcat( buffer, filename );468 }469 470 468 for(i=0;i<N_CACHED_PROFILES;i++) 471 469 { 472 if ( (MRUProfile[i]->filename && !strcmp( filename, MRUProfile[i]->filename)))470 if (MRUProfile[i]->filename && (!strcmp(filename,MRUProfile[i]->filename) || !strcmp(filename,MRUProfile[i]->fullname))) 473 471 { 474 472 if(i) … … 480 478 CurProfile=tempProfile; 481 479 } 482 if(!stat(CurProfile->f ilename,&buf) && CurProfile->mtime==buf.st_mtime)480 if(!stat(CurProfile->fullname,&buf) && CurProfile->mtime==buf.st_mtime) 483 481 dprintf(("Kernel32:Profile:(%s): already opened (mru=%d)\n", 484 482 filename, i )); … … 504 502 if(CurProfile->filename) PROFILE_ReleaseFile(); 505 503 506 CurProfile->filename = HEAP_strdupA( SystemHeap, 0, filename ); 507 508 file = fopen( filename, "r" ); 504 CurProfile->filename = HEAP_strdupA(SystemHeap,0,filename); 505 506 /* check for path */ 507 508 if (!strchr( filename,'/') || 509 !strchr( filename,'\\') || 510 !strchr( filename,':')) 511 { 512 char fullname[MAX_PATHNAME_LEN]; 513 514 GetWindowsDirectoryA(fullname,sizeof(fullname)); 515 strcat(fullname,"\\"); 516 strcat(fullname,filename); 517 CurProfile->fullname = HEAP_strdupA(SystemHeap,0,fullname); 518 } else CurProfile->fullname = HEAP_strdupA(SystemHeap,0,filename); 519 520 file = fopen(CurProfile->fullname,"r"); 509 521 if (file) 510 522 { 511 523 dprintf(("Kernel32:Profile:(%s): found it in %s\n", 512 filename, filename ));524 filename, CurProfile->fullname )); 513 525 514 526 CurProfile->section = PROFILE_Load( file ); 515 527 fclose( file ); 516 if(!stat(CurProfile->f ilename,&buf))528 if(!stat(CurProfile->fullname,&buf)) 517 529 CurProfile->mtime=buf.st_mtime; 518 530 } … … 520 532 { 521 533 /* Does not exist yet, we will create it in PROFILE_FlushFile */ 522 dprintf(("Kernel32:Profile:profile file %s not found\n", filename ));534 dprintf(("Kernel32:Profile:profile file %s not found\n", CurProfile->fullname )); 523 535 } 524 536 return TRUE; … … 966 978 UINT WINAPI GetProfileIntA( LPCSTR section, LPCSTR entry, INT def_val ) 967 979 { 968 return GetPrivateProfileIntA( section, entry, def_val, "win.ini");980 return GetPrivateProfileIntA( section, entry, def_val, WINININAME ); 969 981 } 970 982 … … 974 986 UINT WINAPI GetProfileIntW( LPCWSTR section, LPCWSTR entry, INT def_val ) 975 987 { 976 if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, "win.ini");988 if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, WINININAME ); 977 989 return GetPrivateProfileIntW( section, entry, def_val, wininiW ); 978 990 } … … 985 997 { 986 998 return GetPrivateProfileStringA( section, entry, def_val, 987 buffer, len, "win.ini");999 buffer, len, WINININAME ); 988 1000 } 989 1001 … … 994 1006 LPCWSTR def_val, LPWSTR buffer, UINT len ) 995 1007 { 996 if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, "win.ini");1008 if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, WINININAME ); 997 1009 return GetPrivateProfileStringW( section, entry, def_val, 998 1010 buffer, len, wininiW ); … … 1005 1017 LPCSTR string ) 1006 1018 { 1007 return WritePrivateProfileStringA( section, entry, string, "win.ini");1019 return WritePrivateProfileStringA( section, entry, string, WINININAME ); 1008 1020 } 1009 1021 … … 1014 1026 LPCWSTR string ) 1015 1027 { 1016 if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, "win.ini");1028 if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, WINININAME ); 1017 1029 return WritePrivateProfileStringW( section, entry, string, wininiW ); 1018 1030 } … … 1062 1074 1063 1075 if (!filename) 1064 filename = "win.ini";1076 filename = WINININAME; 1065 1077 1066 1078 EnterCriticalSection( &PROFILE_CritSect ); … … 1145 1157 INT WINAPI GetProfileSectionA( LPCSTR section, LPSTR buffer, DWORD len ) 1146 1158 { 1147 return GetPrivateProfileSectionA( section, buffer, len, "win.ini");1159 return GetPrivateProfileSectionA( section, buffer, len, WINININAME ); 1148 1160 } 1149 1161 … … 1153 1165 INT WINAPI GetProfileSectionW( LPCWSTR section, LPWSTR buffer, DWORD len ) 1154 1166 { 1155 if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, "win.ini");1167 if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, WINININAME ); 1156 1168 return GetPrivateProfileSectionW( section, buffer, len, wininiW ); 1157 1169 } … … 1233 1245 1234 1246 { 1235 return WritePrivateProfileSectionA( section, keys_n_values, "win.ini");1247 return WritePrivateProfileSectionA( section, keys_n_values, WINININAME); 1236 1248 } 1237 1249 … … 1241 1253 BOOL WINAPI WriteProfileSectionW( LPCWSTR section, LPCWSTR keys_n_values) 1242 1254 { 1243 if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, "win.ini");1255 if (!wininiW) wininiW = HEAP_strdupAtoW( SystemHeap, 0, WINININAME); 1244 1256 1245 1257 return (WritePrivateProfileSectionW (section,keys_n_values, wininiW)); … … 1375 1387 return ret; 1376 1388 } 1389 1390 /*********************************************************************** 1391 * WriteOutProfiles (KERNEL.315) 1392 * CB: original: 16 bit function 1393 * here: necessary to save open ini files 1394 */ 1395 void WINAPI WriteOutProfiles(void) 1396 { 1397 PROFILE *lastCurProfile; 1398 INT x; 1399 1400 EnterCriticalSection(&PROFILE_CritSect); 1401 PROFILE_FlushFile(); //flash current 1402 lastCurProfile = CurProfile; 1403 for(x = 1;x < N_CACHED_PROFILES;x++) 1404 { 1405 if (MRUProfile[x]->filename) 1406 { 1407 CurProfile = MRUProfile[x]; 1408 PROFILE_FlushFile(); 1409 } 1410 } 1411 CurProfile = lastCurProfile; 1412 LeaveCriticalSection(&PROFILE_CritSect); 1413 } 1414 -
trunk/src/kernel32/thread.cpp
r461 r529 1 /* $Id: thread.cpp,v 1. 8 1999-08-09 22:10:08phaller Exp $ */1 /* $Id: thread.cpp,v 1.9 1999-08-17 16:35:10 phaller Exp $ */ 2 2 3 3 /* … … 12 12 #include <os2win.h> 13 13 #include <stdarg.h> 14 #include <odincrt.h>14 //#include <odincrt.h> 15 15 #include "thread.h" 16 16 #include "except.h" … … 32 32 Win32Thread *winthread; 33 33 34 ODIN_FS_BEGIN35 34 winthread = new Win32Thread(lpStartAddr, lpvThreadParm, fdwCreate); 36 ODIN_FS_END37 35 38 36 if(winthread == 0) … … 162 160 DWORD rc; 163 161 164 ODIN_delete(me)//only called once162 delete(me); //only called once 165 163 166 164 dprintf(("Win32ThreadProc %d\n", GetCurrentThreadId())); -
trunk/src/kernel32/winimage.cpp
r484 r529 1 /* $Id: winimage.cpp,v 1. 7 1999-08-11 22:27:56phaller Exp $ */1 /* $Id: winimage.cpp,v 1.8 1999-08-17 16:35:10 phaller Exp $ */ 2 2 3 3 /* … … 24 24 #include <string.h> 25 25 #include <stdlib.h> 26 27 #include <odincrt.h>28 26 29 27 //#include <iostream.h> … … 146 144 { 147 145 res = winres->next; 148 ODIN_delete(winres);146 delete winres; 149 147 winres = res; 150 148 } … … 983 981 if(WinDll == NULL) 984 982 { //not found, so load it 985 ODIN_FS_BEGIN986 983 WinDll = new Win32Dll(pszCurModule); 987 ODIN_FS_END988 984 989 985 if(WinDll == NULL) { -
trunk/src/kernel32/winimgres.cpp
r464 r529 1 /* $Id: winimgres.cpp,v 1. 5 1999-08-09 22:55:11 phaller Exp $ */1 /* $Id: winimgres.cpp,v 1.6 1999-08-17 16:35:11 phaller Exp $ */ 2 2 3 3 /* … … 16 16 #include <stdlib.h> 17 17 #include <string.h> 18 #include <odincrt.h>19 18 20 19 #include "misc.h" … … 161 160 unicodestr += *unicodestr; 162 161 } 163 ODIN_FS_BEGIN 162 164 163 res = new Win32Resource(this, id, NTRT_STRING, (ULONG)*unicodestr, (char *)unicodestr); 165 ODIN_FS_END166 164 if(res == NULL) { 167 165 dprintf(("new Win32Resource failed!\n")); … … 170 168 } 171 169 else 172 ODIN_FS_BEGIN173 170 res = new Win32Resource(this, id, type, pData->Size, resdata); 174 ODIN_FS_END175 171 176 172 return res; … … 307 303 if(hres) 308 304 { 309 ODIN_FS_BEGIN310 305 res = new Win32Resource(this, hres, (ULONG)lpszName, (ULONG)szType); 311 ODIN_FS_END312 306 } 313 307 … … 316 310 if(hres) 317 311 { 318 ODIN_FS_BEGIN319 312 res = new Win32Resource(this, hres, (ULONG)lpszName, (ULONG)szType); 320 ODIN_FS_END321 313 } 322 314 else dprintf(("FindResourceA can't find string %d\n", (int)lpszName)); … … 408 400 if(hres) 409 401 { 410 ODIN_FS_BEGIN411 402 res = new Win32Resource(this, hres, (ULONG)lpszName, (ULONG)szType); 412 ODIN_FS_END413 403 } 414 404 … … 417 407 if(hres) 418 408 { 419 ODIN_FS_BEGIN420 409 res = new Win32Resource(this, hres, (ULONG)lpszName, (ULONG)szType); 421 ODIN_FS_END422 410 } 423 411 else dprintf(("FindResourceW can't find string %d\n", (int)lpszName)); -
trunk/src/kernel32/wprocess.cpp
r484 r529 1 /* $Id: wprocess.cpp,v 1.1 8 1999-08-11 22:27:56phaller Exp $ */1 /* $Id: wprocess.cpp,v 1.19 1999-08-17 16:35:11 phaller Exp $ */ 2 2 3 3 /* … … 14 14 #include <stdlib.h> 15 15 #include <string.h> 16 #include <odincrt.h>17 16 #include <odinwrap.h> 18 17 … … 43 42 extern "C" ULONG QueryExceptionChain(); 44 43 45 46 ODINDEBUGCHANNEL(KERNEL32-WPROCESS)47 44 48 45 //****************************************************************************** … … 211 208 { 212 209 if(WinExe != NULL) //should never happen 213 ODIN_delete(WinExe);210 delete WinExe; 214 211 215 212 … … 223 220 Win32Exe *winexe; 224 221 225 ODIN_FS_BEGIN226 222 winexe = new Win32Exe(0, NameTableId, Win32TableId); 227 ODIN_FS_END228 223 229 224 if(winexe) { … … 288 283 else { 289 284 //converted win32 dll loaded by OS/2 loader 290 ODIN_FS_BEGIN291 285 winmod = new Win32Dll(hinstance, NameTableId, Win32TableId, pfnDllEntry); 292 ODIN_FS_END293 286 if(winmod == NULL) { 294 287 eprintf(("Failed to allocate module object!\n")); … … 328 321 329 322 if(WinExe) { 330 ODIN_delete(WinExe);323 delete WinExe; 331 324 WinExe = NULL; 332 325 } … … 400 393 } 401 394 402 ODIN_FS_BEGIN403 395 module = new Win32Dll((char *)lpszLibFile); 404 ODIN_FS_END405 396 if(module == NULL) 406 397 return(0); … … 409 400 if(module->getError() != NO_ERROR) { 410 401 dprintf(("LoadLibary %s failed (::init)\n", lpszLibFile)); 411 ODIN_delete(module);402 delete module; 412 403 return(0); 413 404 } 414 405 if(module->attachProcess() == FALSE) { 415 406 dprintf(("LoadLibary %s failed (::attachProcess)\n", lpszLibFile)); 416 ODIN_delete(module);407 delete module; 417 408 return(0); 418 409 } … … 425 416 426 417 427 ODINFUNCTION1(HINSTANCE,LoadLibraryA,LPCTSTR,lpszLibFile) 428 //HINSTANCE WIN32API LoadLibraryA(LPCTSTR lpszLibFile) 418 HINSTANCE WIN32API LoadLibraryA(LPCTSTR lpszLibFile) 429 419 { 430 420 HINSTANCE hDll; … … 474 464 } 475 465 476 ODIN_FS_BEGIN477 466 module = new Win32Dll((char *)lpszLibFile); 478 ODIN_FS_END479 480 467 if(module == NULL) 481 468 return(0); … … 484 471 if(module->getError() != NO_ERROR) { 485 472 dprintf(("LoadLibary %s failed (::init)\n", lpszLibFile)); 486 ODIN_delete(module);473 delete module; 487 474 return(0); 488 475 } … … 492 479 if(module->attachProcess() == FALSE) { 493 480 dprintf(("LoadLibary %s failed (::attachProcess)\n", lpszLibFile)); 494 ODIN_delete(module);481 delete module; 495 482 return(0); 496 483 }
Note:
See TracChangeset
for help on using the changeset viewer.