- Timestamp:
- Nov 30, 1999, 8:40:27 PM (26 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/Fileio.cpp
r1853 r1893 1 /* $Id: Fileio.cpp,v 1.1 6 1999-11-27 00:05:39sandervl Exp $ */1 /* $Id: Fileio.cpp,v 1.17 1999-11-30 19:40:25 sandervl Exp $ */ 2 2 3 3 /* … … 77 77 WIN32_FIND_DATAA *, arg2) 78 78 { 79 dprintf(("FindFirstFileA %s", arg1)); 79 80 return O32_FindFirstFile(arg1, arg2); 80 81 } -
trunk/src/kernel32/KERNEL32.CPP
r1885 r1893 1 /* $Id: KERNEL32.CPP,v 1.3 5 1999-11-30 14:15:53sandervl Exp $ */1 /* $Id: KERNEL32.CPP,v 1.36 1999-11-30 19:40:26 sandervl Exp $ */ 2 2 3 3 /* … … 794 794 //****************************************************************************** 795 795 796 797 798 796 /*********************************************************************** 799 797 * RtlFillMemory (KERNEL32.441) … … 849 847 } 850 848 851 852 849 //****************************************************************************** 853 850 /*KSO Thu 21.05.1998*/ -
trunk/src/kernel32/process.cpp
r1885 r1893 1 /* $Id: process.cpp,v 1. 1 1999-11-30 14:16:16 sandervl Exp $ */1 /* $Id: process.cpp,v 1.2 1999-11-30 19:40:26 sandervl Exp $ */ 2 2 3 3 /* … … 28 28 #include <wprocess.h> 29 29 #include <win\task.h> 30 #include <winimagebase.h> 30 31 31 32 #define SHUTDOWN_NORETRY 1 … … 36 37 static PDB *PROCESS_First = &ProcessPDB; 37 38 39 /*********************************************************************** 40 * PROCESS_IdToPDB 41 * 42 * Convert a process id to a PDB, making sure it is valid. 43 */ 44 PDB *PROCESS_IdToPDB( DWORD id ) 45 { 46 PDB *pdb; 47 48 if (!id) return PROCESS_Current(); 49 pdb = PROCESS_First; 50 while (pdb) 51 { 52 if ((DWORD)pdb->server_pid == id) return pdb; 53 pdb = pdb->next; 54 } 55 SetLastError( ERROR_INVALID_PARAMETER ); 56 return NULL; 57 } 38 58 //****************************************************************************** 39 59 //****************************************************************************** … … 72 92 } 73 93 //****************************************************************************** 74 //Should retrieve this from the exe...75 94 //****************************************************************************** 76 95 DWORD WIN32API GetProcessVersion(DWORD Processid) 77 96 { 78 dprintf(("KERNEL32: OS2GetProcessVersion not correctly implemented!!\n")); 79 return(WIN32OS2_VERSION); 97 Win32ImageBase *image; 98 PDB *process = PROCESS_IdToPDB( Processid ); 99 DWORD version; 100 101 if(process == NULL) { 102 dprintf(("GetProcessVersion: can't find process (%d)", Processid)); 103 return 0; 104 } 105 image = Win32ImageBase::findModule(process->hInstance); 106 if(image) { 107 version = image->getVersion(); 108 dprintf(("GetProcessVersion of %x = %x", Processid, version)); 109 return version; 110 } 111 dprintf(("GetProcessVersion: can't find module %x (%d)", process->hInstance, Processid)); 112 return 0; 80 113 } 81 114 /*********************************************************************** … … 237 270 if (maxset) *maxset = 32*1024*1024; 238 271 return TRUE; 239 }240 /***********************************************************************241 * PROCESS_IdToPDB242 *243 * Convert a process id to a PDB, making sure it is valid.244 */245 PDB *PROCESS_IdToPDB( DWORD id )246 {247 PDB *pdb;248 249 if (!id) return PROCESS_Current();250 pdb = PROCESS_First;251 while (pdb)252 {253 if ((DWORD)pdb->server_pid == id) return pdb;254 pdb = pdb->next;255 }256 SetLastError( ERROR_INVALID_PARAMETER );257 return NULL;258 272 } 259 273 /*********************************************************************** -
trunk/src/kernel32/winimagebase.cpp
r1872 r1893 1 /* $Id: winimagebase.cpp,v 1. 5 1999-11-29 00:04:06 birdExp $ */1 /* $Id: winimagebase.cpp,v 1.6 1999-11-30 19:40:26 sandervl Exp $ */ 2 2 3 3 /* … … 97 97 } 98 98 //****************************************************************************** 99 //Returns required OS version for this image 100 //****************************************************************************** 101 ULONG Win32ImageBase::getVersion() 102 { 103 dprintf(("Win32ImageBase::getVersion: NOT IMPLEMENTED!")); 104 return 0x40000; //NT 4 105 } 106 //****************************************************************************** 99 107 //****************************************************************************** 100 108 BOOL Win32ImageBase::isPEImage(char *szFileName) -
trunk/src/kernel32/winimagepeldr.cpp
r1889 r1893 1 /* $Id: winimagepeldr.cpp,v 1.2 0 1999-11-30 15:06:55sandervl Exp $ */1 /* $Id: winimagepeldr.cpp,v 1.21 1999-11-30 19:40:26 sandervl Exp $ */ 2 2 3 3 /* … … 46 46 #include "oslibdos.h" 47 47 #include "mmap.h" 48 #include <wprocess.h> 48 49 49 50 char szErrorTitle[] = "Odin"; … … 273 274 fout << "Image Size : " << oh.SizeOfImage << endl; 274 275 fout << "Header Size : " << oh.SizeOfHeaders << endl; 276 fout << "MajorImageVersion : " << oh.MajorImageVersion << endl; 277 fout << "MinorImageVersion : " << oh.MinorImageVersion << endl; 275 278 276 279 //get header page … … 479 482 //SvL: Use pointer to image header as module handle now. Some apps needs this 480 483 hinstance = (HINSTANCE)realBaseAddress; 484 485 //SvL: Set instance handle in process database structure 486 SetPDBInstance(hinstance); 481 487 482 488 //PH: get pResDir pointer correct first, since processImports may … … 1492 1498 } 1493 1499 //****************************************************************************** 1500 //Returns required OS version for this image 1501 //****************************************************************************** 1502 ULONG Win32PeLdrImage::getVersion() 1503 { 1504 return (oh.MajorOperatingSystemVersion << 16) | oh.MinorOperatingSystemVersion; 1505 } 1506 //****************************************************************************** 1494 1507 //****************************************************************************** 1495 1508 ULONG MissingApi() -
trunk/src/kernel32/wprocess.cpp
r1885 r1893 1 /* $Id: wprocess.cpp,v 1.5 2 1999-11-30 14:15:56sandervl Exp $ */1 /* $Id: wprocess.cpp,v 1.53 1999-11-30 19:40:27 sandervl Exp $ */ 2 2 3 3 /* … … 157 157 ProcessPDB.next = NULL; 158 158 ProcessPDB.winver = 0xffff; /* to be determined */ 159 ProcessPDB.server_pid = (void *)GetCurrentProcessId(); 160 161 /* Initialize the critical section */ 162 InitializeCriticalSection( &ProcessPDB.crit_section ); 159 163 } 160 164 dprintf(("InitializeTIB setup TEB with selector %x", tibsel)); … … 190 194 *TIBFlatPtr = 0; 191 195 return; 196 } 197 /******************************************************************************/ 198 /******************************************************************************/ 199 void SetPDBInstance(HINSTANCE hInstance) 200 { 201 ProcessPDB.hInstance = hInstance; 192 202 } 193 203 /******************************************************************************/
Note:
See TracChangeset
for help on using the changeset viewer.