Changeset 1885 for trunk/src/kernel32
- Timestamp:
- Nov 30, 1999, 3:19:03 PM (26 years ago)
- Location:
- trunk/src/kernel32
- Files:
-
- 1 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/KERNEL32.CPP
r1833 r1885 1 /* $Id: KERNEL32.CPP,v 1.3 4 1999-11-24 19:31:22sandervl Exp $ */1 /* $Id: KERNEL32.CPP,v 1.35 1999-11-30 14:15:53 sandervl Exp $ */ 2 2 3 3 /* 4 4 * Win32 compatibility file functions for OS/2 5 5 * 6 * Copyright 1998 Sander van Leeu ven6 * Copyright 1998 Sander van Leeuwen 7 7 * Copyright 1998 Patrick Haller 8 8 * Copyright 1998 Peter Fitzsimmons … … 375 375 return(rc); 376 376 } 377 //******************************************************************************378 //******************************************************************************379 BOOL WIN32API GetExitCodeProcess(HANDLE arg1, LPDWORD arg2)380 {381 dprintf(("KERNEL32: GetExitCodeProcess\n"));382 return O32_GetExitCodeProcess(arg1, arg2);383 }384 //******************************************************************************385 //******************************************************************************386 HANDLE WIN32API GetCurrentProcess(void)387 {388 dprintf2(("KERNEL32: GetCurrentProcess\n"));389 return O32_GetCurrentProcess();390 }391 //******************************************************************************392 //******************************************************************************393 DWORD WIN32API GetCurrentProcessId(void)394 {395 dprintf2(("KERNEL32: GetCurrentProcessId\n"));396 return O32_GetCurrentProcessId();397 }398 //******************************************************************************399 //******************************************************************************400 BOOL WIN32API TerminateProcess( HANDLE arg1, DWORD arg2)401 {402 dprintf(("KERNEL32: TerminateProcess\n"));403 return O32_TerminateProcess(arg1, arg2);404 }405 //******************************************************************************406 //******************************************************************************407 377 VOID WIN32API Sleep(DWORD arg1) 408 378 { … … 540 510 541 511 return O32_MulDiv(arg1, arg2, arg3); 542 }543 //******************************************************************************544 //******************************************************************************545 HANDLE WIN32API OpenProcess(DWORD arg1, BOOL arg2, DWORD arg3)546 {547 dprintf(("KERNEL32: OS2OpenProcess\n"));548 return O32_OpenProcess(arg1, arg2, arg3);549 512 } 550 513 //****************************************************************************** … … 734 697 } 735 698 //****************************************************************************** 736 //Should retrieve this from the exe...737 //******************************************************************************738 DWORD WIN32API GetProcessVersion(DWORD Processid)739 {740 dprintf(("KERNEL32: OS2GetProcessVersion not correctly implemented!!\n"));741 return(WIN32OS2_VERSION);742 }743 //******************************************************************************744 699 //****************************************************************************** 745 700 LONG WIN32API GetVersion() … … 772 727 } 773 728 //****************************************************************************** 774 //Obsolete 775 //****************************************************************************** 776 DWORD WIN32API GetProcessHeaps(DWORD NumberOfHeaps, PHANDLE ProcessHeaps) 777 { 778 dprintf(("KERNEL32: GetProcessHeaps, Not implemented\n")); 779 return(0); 780 } 781 //****************************************************************************** 782 //WINE 783 //****************************************************************************** 784 BOOL WIN32API GetProcessAffinityMask(HANDLE hProcess, 785 LPDWORD lpProcessAffinityMask, 786 LPDWORD lpSystemAffinityMask) 787 { 788 /* It is definitely important for a process to know on what processor 789 it is running :-) */ 790 if(lpProcessAffinityMask) 791 *lpProcessAffinityMask=1; 792 if(lpSystemAffinityMask) 793 *lpSystemAffinityMask=1; 794 return TRUE; 795 } 796 //****************************************************************************** 797 //****************************************************************************** 798 799 729 //****************************************************************************** 800 730 BOOL WIN32API FlushInstructionCache( /*PLF Mon 98-02-09 23:56:49 : STUB STUB STUB STUB STUB */ 801 731 HANDLE hProcess, /* process with cache to flush */ -
trunk/src/kernel32/KERNEL32.DEF
r1815 r1885 1 ; $Id: KERNEL32.DEF,v 1.5 2 1999-11-23 19:31:34sandervl Exp $1 ; $Id: KERNEL32.DEF,v 1.53 1999-11-30 14:15:53 sandervl Exp $ 2 2 3 3 ;Created by BLAST for IBM's compiler … … 464 464 GetProcAddress = _GetProcAddress@8 @372 465 465 GetProcessAffinityMask = _GetProcessAffinityMask@12 @373 466 GetProcessDword = _GetProcessDword@8 @885 466 467 ; GetProcessFlags = _GetProcessFlags@?? @374 ;W95 467 468 GetProcessHeap = _GetProcessHeap@0 @375 468 469 GetProcessHeaps = _GetProcessHeaps@8 @376 469 ; GetProcessPriorityBoost = _GetProcessPriorityBoost@?? ;NT470 ; GetProcessPriorityBoost = _GetProcessPriorityBoost@?? ;NT 470 471 GetProcessShutdownParameters = _GetProcessShutdownParameters@8 @377 471 472 GetProcessTimes = _GetProcessTimes@20 @378 … … 794 795 SetNamedPipeHandleState = _SetNamedPipeHandleState@16 @659 795 796 SetPriorityClass = _SetPriorityClass@8 @660 796 ; SetProcessAffinityMask = _SetProcessAffinityMask@?? ;NT 797 ; SetProcessPriorityBoost = _SetPriorityBoost@?? ;NT 797 SetProcessAffinityMask = _SetProcessAffinityMask@8 @862 798 SetProcessDword = _SetProcessDword@12 @884 799 SetProcessPriorityBoost = _SetProcessPriorityBoost@8 @863 798 800 SetProcessShutdownParameters = _SetProcessShutdownParameters@8 @661 799 801 SetProcessWorkingSetSize = _SetProcessWorkingSetSize@12 @662 -
trunk/src/kernel32/makefile
r1872 r1885 1 # $Id: makefile,v 1.6 4 1999-11-29 00:04:05 birdExp $1 # $Id: makefile,v 1.65 1999-11-30 14:15:54 sandervl Exp $ 2 2 3 3 # … … 43 43 pefile.OBJ winimgres.OBJ wintls.obj async.OBJ fileio.obj \ 44 44 atom.obj disk.obj directory.obj cvtbitmap.obj hmmmap.obj winfakepeldr.obj \ 45 cvtaccel.obj cvticon.obj cvticongrp.obj oslibexcept.obj cpu.obj \45 cvtaccel.obj cvticon.obj cvticongrp.obj oslibexcept.obj cpu.obj process.obj \ 46 46 cvtcursor.obj cvtcursorgrp.obj stubs.obj interlock.obj toolhelp.obj 47 47 … … 93 93 $(PDWIN32_INCLUDE)\unicode.h \ 94 94 $(PDWIN32_INCLUDE)\heap.h \ 95 $(PDWIN32_INCLUDE)\wprocess.h 96 97 process.obj: process.cpp \ 98 $(PDWIN32_INCLUDE)\misc.h \ 95 99 $(PDWIN32_INCLUDE)\wprocess.h 96 100 -
trunk/src/kernel32/resource.cpp
r1879 r1885 1 /* $Id: resource.cpp,v 1.1 1 1999-11-29 20:43:01sandervl Exp $ */1 /* $Id: resource.cpp,v 1.12 1999-11-30 14:15:54 sandervl Exp $ */ 2 2 3 3 /* … … 26 26 Win32ImageBase *module; 27 27 28 dprintf(("FindResourceA %X", hModule));29 28 module = Win32ImageBase::findModule(hModule); 30 if(module == NULL) 31 return(NULL); 32 29 if(module == NULL) { 30 dprintf(("FindResourceA Module %X not found (%x %d)", hModule, lpszName, lpszType)); 31 return(NULL); 32 } 33 33 return module->findResourceA(lpszName, (LPSTR)lpszType); 34 34 } … … 40 40 Win32ImageBase *module; 41 41 42 dprintf(("FindResourceW %X", hModule));43 42 module = Win32ImageBase::findModule(hModule); 44 if(module == NULL) 45 return(NULL); 43 if(module == NULL) { 44 dprintf(("FindResourceW Module %X not found (%x %d)", hModule, lpszName, lpszType)); 45 return(NULL); 46 } 46 47 47 48 return module->findResourceW((LPWSTR)lpszName, (LPWSTR)lpszType); -
trunk/src/kernel32/stubs.cpp
r1879 r1885 1 /* $Id: stubs.cpp,v 1. 9 1999-11-29 20:43:01sandervl Exp $ */1 /* $Id: stubs.cpp,v 1.10 1999-11-30 14:15:54 sandervl Exp $ */ 2 2 3 3 /* … … 2136 2136 } 2137 2137 2138 2139 2140 /*****************************************************************************2141 * Name : BOOL GetProcessShutdownParameters2142 * Purpose : The GetProcessShutdownParameters function retrieves shutdown2143 * parameters for the currently calling process.2144 * Parameters: LPDWORD lpdwLevel2145 * LPDWORD lpdwFlags2146 * Variables :2147 * Result : TRUE / FALSE2148 * Remark :2149 * Status : UNTESTED STUB2150 *2151 * Author : Patrick Haller [Mon, 1998/06/15 08:00]2152 *****************************************************************************/2153 2154 BOOL WIN32API GetProcessShutdownParameters(LPDWORD lpdwLevel,2155 LPDWORD lpdwFlags)2156 {2157 dprintf(("Kernel32: GetProcessShutdownParameters(%08xh,%08xh) not implemented.\n",2158 lpdwLevel,2159 lpdwFlags));2160 2161 return (FALSE);2162 }2163 2164 2165 2166 2138 /***************************************************************************** 2167 2139 * Name : BOOL GetProcessTimes … … 2196 2168 } 2197 2169 2198 2199 /*****************************************************************************2200 * Name : BOOL GetProcessWorkingSetSize2201 * Purpose : The GetProcessWorkingSetSize function obtains the minimum and2202 * maximum working set sizes of a specified process.2203 * Parameters: HANDLE hProcess open handle to the process of interest2204 * LPDWORD lpMinimumWorkingSetSize points to variable to receive minimum working set size2205 * LPDWORD lpMaximumWorkingSetSize points to variable to receive maximum working set size2206 * Variables :2207 * Result : TRUE / FALSE2208 * Remark :2209 * Status : UNTESTED STUB2210 *2211 * Author : Patrick Haller [Mon, 1998/06/15 08:00]2212 *****************************************************************************/2213 2214 BOOL WIN32API GetProcessWorkingSetSize(HANDLE hProcess,2215 LPDWORD lpMinimumWorkingSetSize,2216 LPDWORD lpMaximumWorkingSetSize)2217 {2218 dprintf(("Kernel32: GetProcessWorkingSetSize(%08xh,%08xh,%08xh) not implemented - dummy values, TRUE.\n",2219 hProcess,2220 lpMinimumWorkingSetSize,2221 lpMaximumWorkingSetSize));2222 2223 /* PH: we're returning dummy values here */2224 *lpMinimumWorkingSetSize = 512 * 1024; /* 512k */2225 *lpMaximumWorkingSetSize = 65536 * 1024; /* 64M */2226 2227 return (TRUE);2228 }2229 2170 2230 2171 … … 2796 2737 } 2797 2738 2798 2799 /*****************************************************************************2800 * Name : BOOL SetProcessShutdownParameters2801 * Purpose : The SetProcessShutdownParameters function sets shutdown parameters2802 * for the currently calling process. This function sets a shutdown2803 * order for a process relative to the other processes in the system.2804 * Parameters: DWORD dwLevel shutdown priority2805 * DWORD dwFlags shutdown flags2806 * Variables :2807 * Result : TRUE / FALSE2808 * Remark :2809 * Status : UNTESTED STUB2810 *2811 * Author : Patrick Haller [Mon, 1998/06/15 08:00]2812 *****************************************************************************/2813 2814 BOOL WIN32API SetProcessShutdownParameters(DWORD dwLevel,2815 DWORD dwFlags)2816 {2817 dprintf(("KERNEL32: SetProcessShutdownParameters(%08xh,%08xh) not implemented.\n",2818 dwLevel,2819 dwFlags));2820 2821 return (FALSE);2822 }2823 2824 2825 /*****************************************************************************2826 * Name : BOOL SetProcessWorkingSetSize2827 * Purpose : The SetProcessWorkingSetSize function sets the minimum and2828 * maximum working set sizes for a specified process.2829 * The working set of a process is the set of memory pages currently2830 * visible to the process in physical RAM memory. These pages are2831 * resident and available for an application to use without triggering2832 * a page fault. The size of the working set of a process is specified2833 * in bytes. The minimum and maximum working set sizes affect the2834 * virtual memory paging behavior of a process.2835 * Parameters: HANDLE hProcess open handle to the process of interest2836 * DWORD dwMinimumWorkingSetSize specifies minimum working set size2837 * DWORD dwMaximumWorkingSetSize specifies maximum working set size2838 * Variables :2839 * Result : TRUE / FALSE2840 * Remark :2841 * Status : UNTESTED STUB2842 *2843 * Author : Patrick Haller [Mon, 1998/06/15 08:00]2844 *****************************************************************************/2845 2846 BOOL WIN32API SetProcessWorkingSetSize(HANDLE hProcess,2847 DWORD dwMinimumWorkingSetSize,2848 DWORD dwMaximumWorkingSetSize)2849 {2850 dprintf(("KERNEL32: SetProcessWorkingSetSize(%08xh,%08xh,%08xh) not implemented.\n",2851 hProcess,2852 dwMinimumWorkingSetSize,2853 dwMaximumWorkingSetSize));2854 2855 return (FALSE);2856 }2857 2858 2859 2739 /***************************************************************************** 2860 2740 * Name : BOOL SetSystemPowerState -
trunk/src/kernel32/virtual.cpp
r1811 r1885 1 /* $Id: virtual.cpp,v 1.2 3 1999-11-22 20:35:52sandervl Exp $ */1 /* $Id: virtual.cpp,v 1.24 1999-11-30 14:15:55 sandervl Exp $ */ 2 2 3 3 /* … … 454 454 { 455 455 DWORD rc; 456 DWORD cb = cbSize; 456 457 ULONG pageFlags = 0; 457 458 int npages; … … 460 461 return(FALSE); 461 462 462 rc = OSLibDosQueryMem(lpvAddress, &cb Size, &pageFlags);463 rc = OSLibDosQueryMem(lpvAddress, &cb, &pageFlags); 463 464 if(rc) { 464 465 dprintf(("DosQueryMem returned %d\n", rc)); … … 502 503 npages = (cbSize >> 12); 503 504 504 if( (cbSize & 0xFFF) + offset > 0 ) { 505 cb = (cbSize & 0xFFF) + offset; // !!! added, some optimization :) 506 if( cb > 0 ) { // changed 505 507 npages++; 506 508 } 507 508 if( (cbSize & 0xFFF) + offset >= 4096 ) { 509 if( cb > 4096 ) { // changed, note '>' sign ( not '>=' ) 4096 is exactly one page 509 510 npages++; 510 511 } -
trunk/src/kernel32/winimgres.cpp
r1879 r1885 1 /* $Id: winimgres.cpp,v 1.2 8 1999-11-29 20:43:02sandervl Exp $ */1 /* $Id: winimgres.cpp,v 1.29 1999-11-30 14:15:55 sandervl Exp $ */ 2 2 3 3 /* … … 267 267 return 0; 268 268 } 269 if(HIWORD(id)) { 270 dprintf(("FindResource %s: resource %s (type %d, lang %d)", szModule, id, type, lang)); 271 } 272 else dprintf(("FindResource %s: resource %d (type %d, lang %d)", szModule, id, type, lang)); 269 273 //ulRVAResourceSection contains the relative virtual address (relative to the start of the image) 270 274 //for the resource section (images loaded by the pe.exe and pe2lx/win32k) -
trunk/src/kernel32/winres.cpp
r1454 r1885 1 /* $Id: winres.cpp,v 1.2 1 1999-10-26 11:15:33sandervl Exp $ */1 /* $Id: winres.cpp,v 1.22 1999-11-30 14:15:55 sandervl Exp $ */ 2 2 3 3 /* … … 115 115 PVOID Win32Resource::lockResource() 116 116 { 117 dprintf(("Win32Resource::lockResource %d \n", id));117 dprintf(("Win32Resource::lockResource %d %x\n", id, winresdata)); 118 118 119 119 if(winresdata) -
trunk/src/kernel32/wprocess.cpp
r1844 r1885 1 /* $Id: wprocess.cpp,v 1.5 1 1999-11-26 00:05:20sandervl Exp $ */1 /* $Id: wprocess.cpp,v 1.52 1999-11-30 14:15:56 sandervl Exp $ */ 2 2 3 3 /* … … 146 146 //TLS in executable always TLS index 0? 147 147 ProcessTIBSel = tibsel; 148 ProcessPDB.exit_code = 0x103; /* STILL_ACTIVE */ 149 ProcessPDB.threads = 1; 150 ProcessPDB.running_threads = 1; 151 ProcessPDB.ring0_threads = 1; 152 ProcessPDB.system_heap = GetProcessHeap(); 153 ProcessPDB.parent = 0; 154 ProcessPDB.group = &ProcessPDB; 155 ProcessPDB.priority = 8; /* Normal */ 156 ProcessPDB.heap = ProcessPDB.system_heap; /* will be changed later on */ 157 ProcessPDB.next = NULL; 158 ProcessPDB.winver = 0xffff; /* to be determined */ 148 159 } 149 160 dprintf(("InitializeTIB setup TEB with selector %x", tibsel)); … … 822 833 } 823 834 //****************************************************************************** 824 //******************************************************************************825 826 827 /***********************************************************************828 * RegisterServiceProcess (KERNEL, KERNEL32)829 *830 * A service process calls this function to ensure that it continues to run831 * even after a user logged off.832 */833 DWORD WIN32API RegisterServiceProcess(DWORD dwProcessId,834 DWORD dwType)835 {836 dprintf(("KERNEL32: RegisterServiceProcess(%08xh,%08xh) not implemented.\n",837 dwProcessId,838 dwType));839 840 /* I don't think that Wine needs to do anything in that function */841 return 1; /* success */842 }843 844 //******************************************************************************845 835 //TODO:What does this do exactly?? 846 836 //****************************************************************************** … … 865 855 } 866 856 } 867 857 //****************************************************************************** 858 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.