Index: trunk/src/kernel32/KERNEL32.CPP
===================================================================
--- trunk/src/kernel32/KERNEL32.CPP	(revision 1884)
+++ trunk/src/kernel32/KERNEL32.CPP	(revision 1885)
@@ -1,8 +1,8 @@
-/* $Id: KERNEL32.CPP,v 1.34 1999-11-24 19:31:22 sandervl Exp $ */
+/* $Id: KERNEL32.CPP,v 1.35 1999-11-30 14:15:53 sandervl Exp $ */
 
 /*
  * Win32 compatibility file functions for OS/2
  *
- * Copyright 1998 Sander van Leeuven
+ * Copyright 1998 Sander van Leeuwen
  * Copyright 1998 Patrick Haller
  * Copyright 1998 Peter Fitzsimmons
@@ -375,34 +375,4 @@
     return(rc);
 }
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API GetExitCodeProcess(HANDLE arg1, LPDWORD  arg2)
-{
-    dprintf(("KERNEL32:  GetExitCodeProcess\n"));
-    return O32_GetExitCodeProcess(arg1, arg2);
-}
-//******************************************************************************
-//******************************************************************************
-HANDLE WIN32API GetCurrentProcess(void)
-{
-    dprintf2(("KERNEL32:  GetCurrentProcess\n"));
-    return O32_GetCurrentProcess();
-}
-//******************************************************************************
-//******************************************************************************
-DWORD WIN32API GetCurrentProcessId(void)
-{
-    dprintf2(("KERNEL32:  GetCurrentProcessId\n"));
-    return O32_GetCurrentProcessId();
-}
-//******************************************************************************
-//******************************************************************************
-BOOL WIN32API TerminateProcess( HANDLE arg1, DWORD arg2)
-{
-    dprintf(("KERNEL32:  TerminateProcess\n"));
-    return O32_TerminateProcess(arg1, arg2);
-}
-//******************************************************************************
-//******************************************************************************
 VOID WIN32API Sleep(DWORD arg1)
 {
@@ -540,11 +510,4 @@
 
     return O32_MulDiv(arg1, arg2, arg3);
-}
-//******************************************************************************
-//******************************************************************************
-HANDLE WIN32API OpenProcess(DWORD arg1, BOOL arg2, DWORD arg3)
-{
-    dprintf(("KERNEL32:  OS2OpenProcess\n"));
-    return O32_OpenProcess(arg1, arg2, arg3);
 }
 //******************************************************************************
@@ -734,12 +697,4 @@
 }
 //******************************************************************************
-//Should retrieve this from the exe...
-//******************************************************************************
-DWORD WIN32API GetProcessVersion(DWORD Processid)
-{
-  dprintf(("KERNEL32:  OS2GetProcessVersion not correctly implemented!!\n"));
-  return(WIN32OS2_VERSION);
-}
-//******************************************************************************
 //******************************************************************************
 LONG WIN32API GetVersion()
@@ -772,30 +727,5 @@
 }
 //******************************************************************************
-//Obsolete
-//******************************************************************************
-DWORD WIN32API GetProcessHeaps(DWORD NumberOfHeaps, PHANDLE ProcessHeaps)
-{
-  dprintf(("KERNEL32:  GetProcessHeaps, Not implemented\n"));
-  return(0);
-}
-//******************************************************************************
-//WINE
-//******************************************************************************
-BOOL WIN32API GetProcessAffinityMask(HANDLE  hProcess,
-                                        LPDWORD lpProcessAffinityMask,
-                                        LPDWORD lpSystemAffinityMask)
-{
-        /* It is definitely important for a process to know on what processor
-           it is running :-) */
-        if(lpProcessAffinityMask)
-                *lpProcessAffinityMask=1;
-        if(lpSystemAffinityMask)
-                *lpSystemAffinityMask=1;
-        return TRUE;
-}
-//******************************************************************************
-//******************************************************************************
-
-
+//******************************************************************************
 BOOL WIN32API FlushInstructionCache(     /*PLF Mon  98-02-09 23:56:49 : STUB STUB STUB STUB STUB */
     HANDLE hProcess,    /* process with cache to flush  */
Index: trunk/src/kernel32/KERNEL32.DEF
===================================================================
--- trunk/src/kernel32/KERNEL32.DEF	(revision 1884)
+++ trunk/src/kernel32/KERNEL32.DEF	(revision 1885)
@@ -1,3 +1,3 @@
-; $Id: KERNEL32.DEF,v 1.52 1999-11-23 19:31:34 sandervl Exp $
+; $Id: KERNEL32.DEF,v 1.53 1999-11-30 14:15:53 sandervl Exp $
 
 ;Created by BLAST for IBM's compiler
@@ -464,8 +464,9 @@
      GetProcAddress             = _GetProcAddress@8           @372
      GetProcessAffinityMask     = _GetProcessAffinityMask@12  @373
+     GetProcessDword            = _GetProcessDword@8          @885
 ;    GetProcessFlags            = _GetProcessFlags@??         @374      ;W95
      GetProcessHeap             = _GetProcessHeap@0           @375
      GetProcessHeaps            = _GetProcessHeaps@8          @376
-;    GetProcessPriorityBoost    = _GetProcessPriorityBoost@??           ;NT
+;     GetProcessPriorityBoost    = _GetProcessPriorityBoost@??           ;NT
      GetProcessShutdownParameters  = _GetProcessShutdownParameters@8 @377
      GetProcessTimes            = _GetProcessTimes@20         @378
@@ -794,6 +795,7 @@
     SetNamedPipeHandleState    = _SetNamedPipeHandleState@16 @659
     SetPriorityClass           = _SetPriorityClass@8         @660
-;   SetProcessAffinityMask     = _SetProcessAffinityMask@??             ;NT
-;   SetProcessPriorityBoost    = _SetPriorityBoost@??                   ;NT
+    SetProcessAffinityMask     = _SetProcessAffinityMask@8   @862
+    SetProcessDword            = _SetProcessDword@12         @884
+    SetProcessPriorityBoost    = _SetProcessPriorityBoost@8  @863
     SetProcessShutdownParameters  = _SetProcessShutdownParameters@8 @661
     SetProcessWorkingSetSize   = _SetProcessWorkingSetSize@12 @662
Index: trunk/src/kernel32/makefile
===================================================================
--- trunk/src/kernel32/makefile	(revision 1884)
+++ trunk/src/kernel32/makefile	(revision 1885)
@@ -1,3 +1,3 @@
-# $Id: makefile,v 1.64 1999-11-29 00:04:05 bird Exp $
+# $Id: makefile,v 1.65 1999-11-30 14:15:54 sandervl Exp $
 
 #
@@ -43,5 +43,5 @@
 pefile.OBJ winimgres.OBJ wintls.obj async.OBJ fileio.obj \
 atom.obj disk.obj directory.obj cvtbitmap.obj hmmmap.obj winfakepeldr.obj \
-cvtaccel.obj cvticon.obj cvticongrp.obj oslibexcept.obj cpu.obj \
+cvtaccel.obj cvticon.obj cvticongrp.obj oslibexcept.obj cpu.obj process.obj \
 cvtcursor.obj cvtcursorgrp.obj stubs.obj interlock.obj toolhelp.obj
 
@@ -93,4 +93,8 @@
     $(PDWIN32_INCLUDE)\unicode.h \
     $(PDWIN32_INCLUDE)\heap.h \
+    $(PDWIN32_INCLUDE)\wprocess.h
+
+process.obj: process.cpp \
+    $(PDWIN32_INCLUDE)\misc.h \
     $(PDWIN32_INCLUDE)\wprocess.h
 
Index: trunk/src/kernel32/process.cpp
===================================================================
--- trunk/src/kernel32/process.cpp	(revision 1885)
+++ trunk/src/kernel32/process.cpp	(revision 1885)
@@ -0,0 +1,379 @@
+/* $Id: process.cpp,v 1.1 1999-11-30 14:16:16 sandervl Exp $ */
+
+/*
+ * Win32 process functions for OS/2
+ *
+ * Copyright 1999 Sander van Leeuwen (OS/2 Port)
+ *
+ * TODO: Not done yet! (setting up process structures)
+ *
+ * Based on Wine code (scheduler\process.c)
+ *
+ * Copyright 1996, 1998 Alexandre Julliard
+ *
+ * Project Odin Software License can be found in LICENSE.TXT
+ *
+ */
+#include <odin.h>
+#include <odinwrap.h>
+#include <os2sel.h>
+
+#include <os2win.h>
+#include <winnt.h>
+#include <winnls.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <misc.h>
+#include <wprocess.h>
+#include <win\task.h>
+
+#define SHUTDOWN_NORETRY 1
+
+static unsigned int shutdown_noretry = 0;
+static unsigned int shutdown_priority = 0x280L;
+static        DWORD ProcessAffinityMask = 1;
+static PDB *PROCESS_First = &ProcessPDB;
+
+//******************************************************************************
+//******************************************************************************
+HANDLE WIN32API OpenProcess(DWORD arg1, BOOL arg2, DWORD arg3)
+{
+    dprintf(("KERNEL32:  OS2OpenProcess\n"));
+    return O32_OpenProcess(arg1, arg2, arg3);
+}
+//******************************************************************************
+//******************************************************************************
+BOOL WIN32API GetExitCodeProcess(HANDLE arg1, LPDWORD  arg2)
+{
+    dprintf(("KERNEL32:  GetExitCodeProcess\n"));
+    return O32_GetExitCodeProcess(arg1, arg2);
+}
+//******************************************************************************
+//******************************************************************************
+HANDLE WIN32API GetCurrentProcess(void)
+{
+    dprintf2(("KERNEL32:  GetCurrentProcess\n"));
+    return O32_GetCurrentProcess();
+}
+//******************************************************************************
+//******************************************************************************
+DWORD WIN32API GetCurrentProcessId(void)
+{
+    dprintf2(("KERNEL32:  GetCurrentProcessId\n"));
+    return O32_GetCurrentProcessId();
+}
+//******************************************************************************
+//******************************************************************************
+BOOL WIN32API TerminateProcess( HANDLE arg1, DWORD arg2)
+{
+    dprintf(("KERNEL32:  TerminateProcess\n"));
+    return O32_TerminateProcess(arg1, arg2);
+}
+//******************************************************************************
+//Should retrieve this from the exe...
+//******************************************************************************
+DWORD WIN32API GetProcessVersion(DWORD Processid)
+{
+  dprintf(("KERNEL32:  OS2GetProcessVersion not correctly implemented!!\n"));
+  return(WIN32OS2_VERSION);
+}
+/***********************************************************************
+ *          SetProcessAffinityMask   (KERNEL32.662)
+ */
+BOOL WINAPI SetProcessAffinityMask( HANDLE hProcess, DWORD affmask )
+{
+    ProcessAffinityMask = affmask;
+    return TRUE;
+}
+//******************************************************************************
+//******************************************************************************
+BOOL WIN32API GetProcessAffinityMask(HANDLE  hProcess,
+                                     LPDWORD lpProcessAffinityMask,
+                                     LPDWORD lpSystemAffinityMask)
+{
+    /* It is definitely important for a process to know on what processor
+       it is running :-) */
+    if(lpProcessAffinityMask)
+    	*lpProcessAffinityMask=ProcessAffinityMask;
+    if(lpSystemAffinityMask)
+        *lpSystemAffinityMask=1;
+    return TRUE;
+}
+/***********************************************************************
+ * GetProcessHeaps [KERNEL32.376]
+ */
+DWORD WINAPI GetProcessHeaps(DWORD nrofheaps,HANDLE *heaps) 
+{
+    dprintf(("GetProcessHeaps: (%ld,%p), incomplete implementation.\n",nrofheaps,heaps));
+
+    if (nrofheaps) {
+	heaps[0] = GetProcessHeap();
+	/* ... probably SystemHeap too ? */
+	return 1;
+    }
+    /* number of available heaps */
+    return 1;
+}
+/***********************************************************************
+ *           RegisterServiceProcess             (KERNEL, KERNEL32)
+ *
+ * A service process calls this function to ensure that it continues to run
+ * even after a user logged off.
+ */
+DWORD WINAPI RegisterServiceProcess(DWORD dwProcessId, DWORD dwType)
+{
+    dprintf(("RegisterServiceProcess %x %x", dwProcessId, dwType));
+    /* I don't think that Wine needs to do anything in that function */
+    return 1; /* success */
+}
+/***********************************************************************
+ * Name      : BOOL SetProcessShutdownParameters
+ * Purpose   : The SetProcessShutdownParameters function sets shutdown parameters
+ *             for the currently calling process. This function sets a shutdown
+ *             order for a process relative to the other processes in the system.
+ * Parameters: DWORD dwLevel  shutdown priority
+ *             DWORD dwFlags  shutdown flags
+ * Variables :
+ * Result    : TRUE / FALSE
+ * Remark    :
+ *
+ *           SetProcessShutdownParameters    (KERNEL32)
+ *
+ * CHANGED - James Sutherland (JamesSutherland@gmx.de)
+ * Now tracks changes made (but does not act on these changes)
+ * NOTE: the definition for SHUTDOWN_NORETRY was done on guesswork.
+ * It really shouldn't be here, but I'll move it when it's been checked!
+ */
+BOOL WINAPI SetProcessShutdownParameters(DWORD level,DWORD flags)
+{
+    if (flags & SHUTDOWN_NORETRY)
+      shutdown_noretry = 1;
+    else
+      shutdown_noretry = 0;
+    if (level > 0x100L && level < 0x3FFL)
+      shutdown_priority = level;
+    else
+      {
+	dprintf(("SetProcessShutdownParameters: invalid priority level 0x%08lx\n", level));
+	return FALSE;
+      }
+    return TRUE;
+}
+/***********************************************************************
+ * GetProcessShutdownParameters                 (KERNEL32)
+ * Name      : BOOL GetProcessShutdownParameters
+ * Purpose   : The GetProcessShutdownParameters function retrieves shutdown
+ *             parameters for the currently calling process.
+ * Parameters: LPDWORD lpdwLevel
+ *             LPDWORD lpdwFlags
+ * Variables :
+ * Result    : TRUE / FALSE
+ * Remark    :
+ *
+ */
+BOOL WINAPI GetProcessShutdownParameters( LPDWORD lpdwLevel,
+	  		 	          LPDWORD lpdwFlags )
+{
+    dprintf(("GetProcessShutdownParameters"));
+    (*lpdwLevel) = shutdown_priority;
+    (*lpdwFlags) = (shutdown_noretry * SHUTDOWN_NORETRY);
+    return TRUE;
+}
+/***********************************************************************
+ *           SetProcessPriorityBoost    (KERNEL32)
+ */
+BOOL WINAPI SetProcessPriorityBoost(HANDLE hprocess,BOOL disableboost)
+{
+    dprintf(("SetProcessPriorityBoost: (%d,%d): stub\n",hprocess,disableboost));
+    /* Say we can do it. I doubt the program will notice that we don't. */
+    return TRUE;
+}
+/***********************************************************************
+ *		SetProcessWorkingSetSize	[KERNEL32.662]
+ * Sets the min/max working set sizes for a specified process.
+ *
+ * PARAMS
+ *    hProcess [I] Handle to the process of interest
+ *    minset   [I] Specifies minimum working set size
+ *    maxset   [I] Specifies maximum working set size
+ *
+ * RETURNS  STD
+ */
+BOOL WINAPI SetProcessWorkingSetSize(HANDLE hProcess,DWORD minset,
+                                       DWORD maxset)
+{
+    dprintf(("SetProcessWorkingSetSize (0x%08x,%ld,%ld): stub - harmless\n",hProcess,minset,maxset));
+    if(( minset == -1) && (maxset == -1)) {
+        /* Trim the working set to zero */
+        /* Swap the process out of physical RAM */
+    }
+    return TRUE;
+}
+
+/***********************************************************************
+ *           GetProcessWorkingSetSize    (KERNEL32)
+ * Name      : BOOL SetProcessWorkingSetSize
+ * Purpose   : The SetProcessWorkingSetSize function sets the minimum and
+ *             maximum working set sizes for a specified process.
+ *             The working set of a process is the set of memory pages currently
+ *             visible to the process in physical RAM memory. These pages are
+ *             resident and available for an application to use without triggering
+ *             a page fault. The size of the working set of a process is specified
+ *             in bytes. The minimum and maximum working set sizes affect the
+ *             virtual memory paging behavior of a process.
+ * Parameters: HANDLE hProcess                open handle to the process of interest
+ *             DWORD  dwMinimumWorkingSetSize specifies minimum working set size
+ *             DWORD  dwMaximumWorkingSetSize specifies maximum working set size
+ * Variables :
+ * Result    : TRUE / FALSE
+ */
+BOOL WINAPI GetProcessWorkingSetSize(HANDLE hProcess,LPDWORD minset,
+                                     LPDWORD maxset)
+{
+	dprintf(("GetProcessWorkingSetSize 0x%08x,%p,%p): stub\n",hProcess,minset,maxset));
+	/* 32 MB working set size */
+	if (minset) *minset = 32*1024*1024;
+	if (maxset) *maxset = 32*1024*1024;
+	return TRUE;
+}
+/***********************************************************************
+ *           PROCESS_IdToPDB
+ *
+ * Convert a process id to a PDB, making sure it is valid.
+ */
+PDB *PROCESS_IdToPDB( DWORD id )
+{
+    PDB *pdb;
+
+    if (!id) return PROCESS_Current();
+    pdb = PROCESS_First;
+    while (pdb)
+    {
+        if ((DWORD)pdb->server_pid == id) return pdb;
+        pdb = pdb->next;
+    }
+    SetLastError( ERROR_INVALID_PARAMETER );
+    return NULL;
+}
+/***********************************************************************
+ *           GetProcessDword    (KERNEL32.18) (KERNEL.485)
+ * 'Of course you cannot directly access Windows internal structures'
+ */
+DWORD WINAPI GetProcessDword( DWORD dwProcessID, INT offset )
+{
+    PDB *process = PROCESS_IdToPDB( dwProcessID );
+    TDB *pTask;
+    DWORD x, y;
+
+    dprintf(("GetProcessDword: (%ld, %d)\n", dwProcessID, offset ));
+    if ( !process ) return 0;
+
+    switch ( offset ) 
+    {
+    case GPD_APP_COMPAT_FLAGS:
+        pTask = (TDB *)GlobalLock( process->task );
+        return pTask? pTask->compat_flags : 0;
+
+    case GPD_LOAD_DONE_EVENT:
+        return process->load_done_evt;
+
+    case GPD_HINSTANCE16:
+        pTask = (TDB *)GlobalLock( process->task );
+        return pTask? pTask->hInstance : 0;
+
+    case GPD_WINDOWS_VERSION:
+        pTask = (TDB *)GlobalLock( process->task );
+        return pTask? pTask->version : 0;
+
+    case GPD_THDB:
+        if ( process != PROCESS_Current() ) return 0;
+        return (DWORD)GetThreadTHDB();
+
+    case GPD_PDB:
+        return (DWORD)process;
+
+    case GPD_STARTF_SHELLDATA: /* return stdoutput handle from startupinfo ??? */
+        return process->env_db->startup_info->hStdOutput;
+
+    case GPD_STARTF_HOTKEY: /* return stdinput handle from startupinfo ??? */
+        return process->env_db->startup_info->hStdInput;
+
+    case GPD_STARTF_SHOWWINDOW:
+        return process->env_db->startup_info->wShowWindow;
+
+    case GPD_STARTF_SIZE:
+        x = process->env_db->startup_info->dwXSize;
+        if ( x == CW_USEDEFAULT ) x = CW_USEDEFAULT16;
+        y = process->env_db->startup_info->dwYSize;
+        if ( y == CW_USEDEFAULT ) y = CW_USEDEFAULT16;
+        return MAKELONG( x, y );
+
+    case GPD_STARTF_POSITION:
+        x = process->env_db->startup_info->dwX;
+        if ( x == CW_USEDEFAULT ) x = CW_USEDEFAULT16;
+        y = process->env_db->startup_info->dwY;
+        if ( y == CW_USEDEFAULT ) y = CW_USEDEFAULT16;
+        return MAKELONG( x, y );
+
+    case GPD_STARTF_FLAGS:
+        return process->env_db->startup_info->dwFlags;
+
+    case GPD_PARENT:
+	if(process->parent)
+        	return (DWORD)process->parent->server_pid;
+	return 0;
+
+    case GPD_FLAGS:
+        return process->flags;
+
+    case GPD_USERDATA:
+        return process->process_dword;
+
+    default:
+        dprintf(("GetProcessDword: Unknown offset %d\n", offset ));
+        return 0;
+    }
+}
+
+/***********************************************************************
+ *           SetProcessDword    (KERNEL.484)
+ * 'Of course you cannot directly access Windows internal structures'
+ */
+void WINAPI SetProcessDword( DWORD dwProcessID, INT offset, DWORD value )
+{
+    PDB *process = PROCESS_IdToPDB( dwProcessID );
+
+    dprintf(("SetProcessDword: (%ld, %d)\n", dwProcessID, offset));
+    if ( !process ) return;
+
+    switch ( offset ) 
+    {
+    case GPD_APP_COMPAT_FLAGS:
+    case GPD_LOAD_DONE_EVENT:
+    case GPD_HINSTANCE16:
+    case GPD_WINDOWS_VERSION:
+    case GPD_THDB:
+    case GPD_PDB:
+    case GPD_STARTF_SHELLDATA:
+    case GPD_STARTF_HOTKEY:
+    case GPD_STARTF_SHOWWINDOW:
+    case GPD_STARTF_SIZE:
+    case GPD_STARTF_POSITION:
+    case GPD_STARTF_FLAGS:
+    case GPD_PARENT:
+    case GPD_FLAGS:
+        dprintf(("SetProcessDword: Not allowed to modify offset %d\n", offset ));
+        break;
+
+    case GPD_USERDATA:
+        process->process_dword = value; 
+        break;
+
+    default:
+        dprintf(("SetProcessDword: Unknown offset %d\n", offset));
+        break;
+    }
+}
+//******************************************************************************
+//******************************************************************************
Index: trunk/src/kernel32/resource.cpp
===================================================================
--- trunk/src/kernel32/resource.cpp	(revision 1884)
+++ trunk/src/kernel32/resource.cpp	(revision 1885)
@@ -1,3 +1,3 @@
-/* $Id: resource.cpp,v 1.11 1999-11-29 20:43:01 sandervl Exp $ */
+/* $Id: resource.cpp,v 1.12 1999-11-30 14:15:54 sandervl Exp $ */
 
 /*
@@ -26,9 +26,9 @@
  Win32ImageBase *module;
 
-    dprintf(("FindResourceA %X", hModule));
     module = Win32ImageBase::findModule(hModule);
-    if(module == NULL)
-      return(NULL);
-
+    if(module == NULL) {
+	  dprintf(("FindResourceA Module %X not found (%x %d)", hModule, lpszName, lpszType));
+          return(NULL);
+    }
     return module->findResourceA(lpszName, (LPSTR)lpszType);
 }
@@ -40,8 +40,9 @@
  Win32ImageBase *module;
 
-    dprintf(("FindResourceW %X", hModule));
     module = Win32ImageBase::findModule(hModule);
-    if(module == NULL)
-        return(NULL);
+    if(module == NULL) {
+	  dprintf(("FindResourceW Module %X not found (%x %d)", hModule, lpszName, lpszType));
+          return(NULL);
+    }
 
     return module->findResourceW((LPWSTR)lpszName, (LPWSTR)lpszType);
Index: trunk/src/kernel32/stubs.cpp
===================================================================
--- trunk/src/kernel32/stubs.cpp	(revision 1884)
+++ trunk/src/kernel32/stubs.cpp	(revision 1885)
@@ -1,3 +1,3 @@
-/* $Id: stubs.cpp,v 1.9 1999-11-29 20:43:01 sandervl Exp $ */
+/* $Id: stubs.cpp,v 1.10 1999-11-30 14:15:54 sandervl Exp $ */
 
 /*
@@ -2136,32 +2136,4 @@
 }
 
-
-
-/*****************************************************************************
- * Name      : BOOL GetProcessShutdownParameters
- * Purpose   : The GetProcessShutdownParameters function retrieves shutdown
- *             parameters for the currently calling process.
- * Parameters: LPDWORD lpdwLevel
- *             LPDWORD lpdwFlags
- * Variables :
- * Result    : TRUE / FALSE
- * Remark    :
- * Status    : UNTESTED STUB
- *
- * Author    : Patrick Haller [Mon, 1998/06/15 08:00]
- *****************************************************************************/
-
-BOOL WIN32API GetProcessShutdownParameters(LPDWORD lpdwLevel,
-                                              LPDWORD lpdwFlags)
-{
-  dprintf(("Kernel32: GetProcessShutdownParameters(%08xh,%08xh) not implemented.\n",
-           lpdwLevel,
-           lpdwFlags));
-
-  return (FALSE);
-}
-
-
-
 /*****************************************************************************
  * Name      : BOOL GetProcessTimes
@@ -2196,35 +2168,4 @@
 }
 
-
-/*****************************************************************************
- * Name      : BOOL GetProcessWorkingSetSize
- * Purpose   : The GetProcessWorkingSetSize function obtains the minimum and
- *             maximum working set sizes of a specified process.
- * Parameters: HANDLE  hProcess                open handle to the process of interest
- *             LPDWORD lpMinimumWorkingSetSize points to variable to receive minimum working set size
- *             LPDWORD lpMaximumWorkingSetSize points to variable to receive maximum working set size
- * Variables :
- * Result    : TRUE / FALSE
- * Remark    :
- * Status    : UNTESTED STUB
- *
- * Author    : Patrick Haller [Mon, 1998/06/15 08:00]
- *****************************************************************************/
-
-BOOL WIN32API GetProcessWorkingSetSize(HANDLE  hProcess,
-                                          LPDWORD lpMinimumWorkingSetSize,
-                                          LPDWORD lpMaximumWorkingSetSize)
-{
-  dprintf(("Kernel32: GetProcessWorkingSetSize(%08xh,%08xh,%08xh) not implemented - dummy values, TRUE.\n",
-           hProcess,
-           lpMinimumWorkingSetSize,
-           lpMaximumWorkingSetSize));
-
-  /* PH: we're returning dummy values here */
-  *lpMinimumWorkingSetSize =   512 * 1024; /* 512k */
-  *lpMaximumWorkingSetSize = 65536 * 1024; /* 64M  */
-
-  return (TRUE);
-}
 
 
@@ -2796,65 +2737,4 @@
 }
 
-
-/*****************************************************************************
- * Name      : BOOL SetProcessShutdownParameters
- * Purpose   : The SetProcessShutdownParameters function sets shutdown parameters
- *             for the currently calling process. This function sets a shutdown
- *             order for a process relative to the other processes in the system.
- * Parameters: DWORD dwLevel  shutdown priority
- *             DWORD dwFlags  shutdown flags
- * Variables :
- * Result    : TRUE / FALSE
- * Remark    :
- * Status    : UNTESTED STUB
- *
- * Author    : Patrick Haller [Mon, 1998/06/15 08:00]
- *****************************************************************************/
-
-BOOL WIN32API SetProcessShutdownParameters(DWORD dwLevel,
-                                              DWORD dwFlags)
-{
-  dprintf(("KERNEL32: SetProcessShutdownParameters(%08xh,%08xh) not implemented.\n",
-           dwLevel,
-           dwFlags));
-
-  return (FALSE);
-}
-
-
-/*****************************************************************************
- * Name      : BOOL SetProcessWorkingSetSize
- * Purpose   : The SetProcessWorkingSetSize function sets the minimum and
- *             maximum working set sizes for a specified process.
- *             The working set of a process is the set of memory pages currently
- *             visible to the process in physical RAM memory. These pages are
- *             resident and available for an application to use without triggering
- *             a page fault. The size of the working set of a process is specified
- *             in bytes. The minimum and maximum working set sizes affect the
- *             virtual memory paging behavior of a process.
- * Parameters: HANDLE hProcess                open handle to the process of interest
- *             DWORD  dwMinimumWorkingSetSize specifies minimum working set size
- *             DWORD  dwMaximumWorkingSetSize specifies maximum working set size
- * Variables :
- * Result    : TRUE / FALSE
- * Remark    :
- * Status    : UNTESTED STUB
- *
- * Author    : Patrick Haller [Mon, 1998/06/15 08:00]
- *****************************************************************************/
-
-BOOL WIN32API SetProcessWorkingSetSize(HANDLE hProcess,
-                                          DWORD  dwMinimumWorkingSetSize,
-                                          DWORD  dwMaximumWorkingSetSize)
-{
-  dprintf(("KERNEL32: SetProcessWorkingSetSize(%08xh,%08xh,%08xh) not implemented.\n",
-           hProcess,
-           dwMinimumWorkingSetSize,
-           dwMaximumWorkingSetSize));
-
-  return (FALSE);
-}
-
-
 /*****************************************************************************
  * Name      : BOOL SetSystemPowerState
Index: trunk/src/kernel32/virtual.cpp
===================================================================
--- trunk/src/kernel32/virtual.cpp	(revision 1884)
+++ trunk/src/kernel32/virtual.cpp	(revision 1885)
@@ -1,3 +1,3 @@
-/* $Id: virtual.cpp,v 1.23 1999-11-22 20:35:52 sandervl Exp $ */
+/* $Id: virtual.cpp,v 1.24 1999-11-30 14:15:55 sandervl Exp $ */
 
 /*
@@ -454,4 +454,5 @@
 {
   DWORD rc;
+  DWORD  cb = cbSize;
   ULONG  pageFlags = 0;
   int npages;
@@ -460,5 +461,5 @@
         return(FALSE);
 
-  rc = OSLibDosQueryMem(lpvAddress, &cbSize, &pageFlags);
+  rc = OSLibDosQueryMem(lpvAddress, &cb, &pageFlags);
   if(rc) {
         dprintf(("DosQueryMem returned %d\n", rc));
@@ -502,9 +503,9 @@
   npages = (cbSize >> 12);
 
-  if( (cbSize & 0xFFF) + offset > 0 ) {
+  cb = (cbSize & 0xFFF) + offset; // !!! added, some optimization :)
+  if( cb > 0 ) { // changed
 	npages++;
   }
-
-  if( (cbSize & 0xFFF) + offset >= 4096 ) {
+  if( cb > 4096 ) { // changed, note '>' sign ( not '>=' ) 4096 is exactly one page
 	npages++;
   }
Index: trunk/src/kernel32/winimgres.cpp
===================================================================
--- trunk/src/kernel32/winimgres.cpp	(revision 1884)
+++ trunk/src/kernel32/winimgres.cpp	(revision 1885)
@@ -1,3 +1,3 @@
-/* $Id: winimgres.cpp,v 1.28 1999-11-29 20:43:02 sandervl Exp $ */
+/* $Id: winimgres.cpp,v 1.29 1999-11-30 14:15:55 sandervl Exp $ */
 
 /*
@@ -267,4 +267,8 @@
         return 0;
     }
+    if(HIWORD(id)) {
+            dprintf(("FindResource %s: resource %s (type %d, lang %d)", szModule, id, type, lang));
+    }
+    else    dprintf(("FindResource %s: resource %d (type %d, lang %d)", szModule, id, type, lang));
     //ulRVAResourceSection contains the relative virtual address (relative to the start of the image)
     //for the resource section (images loaded by the pe.exe and pe2lx/win32k)
Index: trunk/src/kernel32/winres.cpp
===================================================================
--- trunk/src/kernel32/winres.cpp	(revision 1884)
+++ trunk/src/kernel32/winres.cpp	(revision 1885)
@@ -1,3 +1,3 @@
-/* $Id: winres.cpp,v 1.21 1999-10-26 11:15:33 sandervl Exp $ */
+/* $Id: winres.cpp,v 1.22 1999-11-30 14:15:55 sandervl Exp $ */
 
 /*
@@ -115,5 +115,5 @@
 PVOID Win32Resource::lockResource()
 {
-  dprintf(("Win32Resource::lockResource %d\n", id));
+  dprintf(("Win32Resource::lockResource %d %x\n", id, winresdata));
 
   if(winresdata)
Index: trunk/src/kernel32/wprocess.cpp
===================================================================
--- trunk/src/kernel32/wprocess.cpp	(revision 1884)
+++ trunk/src/kernel32/wprocess.cpp	(revision 1885)
@@ -1,3 +1,3 @@
-/* $Id: wprocess.cpp,v 1.51 1999-11-26 00:05:20 sandervl Exp $ */
+/* $Id: wprocess.cpp,v 1.52 1999-11-30 14:15:56 sandervl Exp $ */
 
 /*
@@ -146,4 +146,15 @@
         //TLS in executable always TLS index 0?
    	ProcessTIBSel = tibsel;
+    	ProcessPDB.exit_code       = 0x103; /* STILL_ACTIVE */
+    	ProcessPDB.threads         = 1;
+    	ProcessPDB.running_threads = 1;
+    	ProcessPDB.ring0_threads   = 1;
+    	ProcessPDB.system_heap     = GetProcessHeap();
+    	ProcessPDB.parent          = 0;
+    	ProcessPDB.group           = &ProcessPDB;
+    	ProcessPDB.priority        = 8;  /* Normal */
+    	ProcessPDB.heap            = ProcessPDB.system_heap;  /* will be changed later on */
+    	ProcessPDB.next            = NULL;
+    	ProcessPDB.winver          = 0xffff; /* to be determined */
    }
    dprintf(("InitializeTIB setup TEB with selector %x", tibsel));
@@ -822,25 +833,4 @@
 }
 //******************************************************************************
-//******************************************************************************
-
-
-/***********************************************************************
- *           RegisterServiceProcess             (KERNEL, KERNEL32)
- *
- * A service process calls this function to ensure that it continues to run
- * even after a user logged off.
- */
-DWORD WIN32API RegisterServiceProcess(DWORD dwProcessId,
-                                      DWORD dwType)
-{
-  dprintf(("KERNEL32: RegisterServiceProcess(%08xh,%08xh) not implemented.\n",
-           dwProcessId,
-           dwType));
-
-  /* I don't think that Wine needs to do anything in that function */
-  return 1; /* success */
-}
-
-//******************************************************************************
 //TODO:What does this do exactly??
 //******************************************************************************
@@ -865,3 +855,4 @@
   }
 }
-
+//******************************************************************************
+//******************************************************************************
