Changeset 3074 for trunk/src


Ignore:
Timestamp:
Mar 10, 2000, 5:12:03 PM (25 years ago)
Author:
sandervl
Message:

file handle + registry changes

Location:
trunk/src/kernel32
Files:
8 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/KERNEL32.DEF

    r3059 r3074  
    1 ; $Id: KERNEL32.DEF,v 1.73 2000-03-09 19:03:19 sandervl Exp $
     1; $Id: KERNEL32.DEF,v 1.74 2000-03-10 16:11:59 sandervl Exp $
    22
    33;Created by BLAST for IBM's compiler
     
    134134
    135135;;Not supported; just present
     136     _CommonUnimpStub@0                                           @17
    136137     LoadLibrary16              = _LoadLibrary16@4                @35
    137138     FreeLibrary16              = _FreeLibrary16@4                @36
    138139     GetProcAddress16           = _GetProcAddress16@8             @37
     140     ReleaseThunkLock           = _ReleaseThunkLock@4             @48
     141     RestoreThunkLock           = _RestoreThunkLock@4             @49
     142     _ConfirmWin16Lock          = __ConfirmWin16Lock@0            @96
    139143
    140144;;     WrongComctl32@0 @36
     
    206210     CreateEventA               = _CreateEventA@16                 @156
    207211     CreateEventW               = _CreateEventW@16                 @157
    208      CreateFiber                = _CreateFiber@12                  @48    ;NT
     212     CreateFiber                = _CreateFiber@12                  @1048    ;NT
    209213     CreateFileA                = _CreateFileA@28                  @158
    210214     CreateFileW                = _CreateFileW@28                  @161
     
    463467     GetProcessAffinityMask     = _GetProcessAffinityMask@12  @373
    464468     GetProcessDword            = _GetProcessDword@8          @18
    465 ;    GetProcessFlags            = _GetProcessFlags@??         @374      ;W95
     469     GetProcessFlags            = _GetProcessFlags@4          @374      ;W95
    466470     GetProcessHeap             = _GetProcessHeap@0           @375
    467471     GetProcessHeaps            = _GetProcessHeaps@8          @376
  • trunk/src/kernel32/heapshared.cpp

    r2802 r3074  
    1 /* $Id: heapshared.cpp,v 1.4 2000-02-16 14:23:58 sandervl Exp $ */
     1/* $Id: heapshared.cpp,v 1.5 2000-03-10 16:11:58 sandervl Exp $ */
    22/*
    33 * Shared heap functions for OS/2
     
    4242
    4343  if(pSharedMem == NULL) {
    44         dprintf(("KERNEL32: InitializeSharedHeap"));
     44        dprintf(("KERNEL32: InitializeSharedHeap %x", &sharedHeap));
    4545        rc = DosAllocSharedMem(&pSharedMem, NULL, MAX_HEAPSIZE, PAG_READ|PAG_WRITE|OBJ_GETTABLE);
    4646        if(rc != 0) {
  • trunk/src/kernel32/initsystem.cpp

    r3005 r3074  
    1 /* $Id: initsystem.cpp,v 1.7 2000-03-04 19:52:36 sandervl Exp $ */
     1/* $Id: initsystem.cpp,v 1.8 2000-03-10 16:11:59 sandervl Exp $ */
    22/*
    33 * Odin system initialization (registry & directories)
     
    2727#include "dbglocal.h"
    2828
     29#define DDRAW_CLASSID           "{D7B70EE0-4340-11CF-B063-0020AFC2CD35}"
     30#define DDRAW_DEFAULT           "DirectDraw Object"
     31#define DDRAW_CLIPPER_CLASSID   "{593817A0-7DB3-11CF-A2DE-00AA00B93356}"
     32#define DDRAW_CLIPPER_DEFAULT   "DirectDraw Clipper Object"
     33#define DDRAW_DLL               "ddraw.dll"
     34#define DSOUND_CLASSID          "{47D4D946-62E8-11cf-93BC-444553540000}"
     35#define DSOUND_DEFAULT          "DirectSound Object"
     36#define DSOUND_DLL              "dsound.dll"
     37#define COM_CLASS_ID            "CLSID"
     38#define COM_INPROCSERVER        "InprocServer32"
     39#define COM_THREADMODEL         "ThreadingModel"
     40#define THREAD_BOTH             "Both"
     41#define INITREG_ERROR           "InitRegistry: Unable to register system information"
     42
    2943BOOL InitRegistry();
    3044
     
    4862BOOL InitRegistry()
    4963{
    50  HKEY hkey;
     64 HKEY hkey, hkey1;
    5165 char *buf;
    5266 DWORD val;
     
    159173//   }
    160174   RegCloseKey(hkey);
     175
     176   //Now the Ddraw & dsound registry keys:
     177   //HKEY_CLASSES_ROOT\DirectDraw = DirectDraw Object
     178   //HKEY_CLASSES_ROOT\DirectDraw\CLSID = {D7B70EE0-4340-11CF-B063-0020AFC2CD35}
     179   //HKEY_CLASSES_ROOT\CLSID\{D7B70EE0-4340-11CF-B063-0020AFC2CD35} = DirectDraw Object
     180   //HKEY_CLASSES_ROOT\CLSID\{D7B70EE0-4340-11CF-B063-0020AFC2CD35}\InprocServer32 = ddraw.dll
     181   if(RegCreateKeyA(HKEY_CLASSES_ROOT,"DirectDraw",&hkey)!=ERROR_SUCCESS) {
     182        goto initreg_error;
     183   }
     184   RegSetValueExA(hkey, "", 0, REG_SZ, (LPBYTE)DDRAW_DEFAULT, sizeof(DDRAW_DEFAULT));
     185   if(RegCreateKeyA(hkey,COM_CLASS_ID,&hkey1)!=ERROR_SUCCESS) {
     186        RegCloseKey(hkey);
     187        goto initreg_error;
     188   }
     189   RegSetValueExA(hkey1,"",0,REG_SZ, (LPBYTE)DDRAW_CLASSID, sizeof(DDRAW_CLASSID));
     190   RegCloseKey(hkey1);
     191   RegCloseKey(hkey);
     192
     193   if(RegCreateKeyA(HKEY_CLASSES_ROOT, COM_CLASS_ID"\\"DDRAW_CLASSID ,&hkey)!=ERROR_SUCCESS) {
     194        goto initreg_error;
     195   }
     196   RegSetValueExA(hkey,"",0,REG_SZ, (LPBYTE)DDRAW_DEFAULT, sizeof(DDRAW_DEFAULT));
     197   if(RegCreateKeyA(hkey,COM_INPROCSERVER, &hkey1)!=ERROR_SUCCESS) {
     198        RegCloseKey(hkey);
     199        goto initreg_error;
     200   }
     201   RegSetValueExA(hkey1,"",0,REG_SZ, (LPBYTE)DDRAW_DLL, sizeof(DDRAW_DLL));
     202   RegSetValueExA(hkey1, COM_THREADMODEL, 0,REG_SZ, (LPBYTE)THREAD_BOTH, sizeof(THREAD_BOTH));
     203   RegCloseKey(hkey1);
     204   RegCloseKey(hkey);
     205
     206   //HKEY_CLASSES_ROOT\DirectDrawClipper = DirectDraw Clipper Object
     207   //HKEY_CLASSES_ROOT\DirectDrawClipper\CLSID = {593817A0-7DB3-11CF-A2DE-00AA00B93356}
     208   //HKEY_CLASSES_ROOT\CLSID\{593817A0-7DB3-11CF-A2DE-00AA00B93356} = DirectDraw Clipper Object
     209   //HKEY_CLASSES_ROOT\CLSID\{593817A0-7DB3-11CF-A2DE-00AA00B93356}\InprocServer32 = ddraw.dll
     210   if(RegCreateKeyA(HKEY_CLASSES_ROOT,"DirectDrawClipper",&hkey)!=ERROR_SUCCESS) {
     211        goto initreg_error;
     212   }
     213   RegSetValueExA(hkey,"",0,REG_SZ, (LPBYTE)DDRAW_CLIPPER_DEFAULT, sizeof(DDRAW_CLIPPER_DEFAULT));
     214   if(RegCreateKeyA(hkey,COM_CLASS_ID,&hkey1)!=ERROR_SUCCESS) {
     215        RegCloseKey(hkey);
     216        goto initreg_error;
     217   }
     218   RegSetValueExA(hkey1,"",0,REG_SZ, (LPBYTE)DDRAW_CLIPPER_CLASSID, sizeof(DDRAW_CLIPPER_CLASSID));
     219   RegCloseKey(hkey1);
     220   RegCloseKey(hkey);
     221
     222   if(RegCreateKeyA(HKEY_CLASSES_ROOT, COM_CLASS_ID"\\"DDRAW_CLIPPER_CLASSID,&hkey)!=ERROR_SUCCESS) {
     223        goto initreg_error;
     224   }
     225   RegSetValueExA(hkey,"",0,REG_SZ, (LPBYTE)DDRAW_CLIPPER_DEFAULT, sizeof(DDRAW_CLIPPER_DEFAULT));
     226   if(RegCreateKeyA(hkey,COM_INPROCSERVER, &hkey1)!=ERROR_SUCCESS) {
     227        RegCloseKey(hkey);
     228        goto initreg_error;
     229   }
     230   RegSetValueExA(hkey1,"",0,REG_SZ, (LPBYTE)DDRAW_DLL, sizeof(DDRAW_DLL));
     231   RegSetValueExA(hkey1, COM_THREADMODEL, 0,REG_SZ, (LPBYTE)THREAD_BOTH, sizeof(THREAD_BOTH));
     232   RegCloseKey(hkey1);
     233   RegCloseKey(hkey);
     234
     235   //HKEY_CLASSES_ROOT\DirectSound = DirectSound Object
     236   //HKEY_CLASSES_ROOT\DirectSound\CLSID = {47D4D946-62E8-11cf-93BC-444553540000}
     237   //HKEY_CLASSES_ROOT\CLSID\{47D4D946-62E8-11cf-93BC-444553540000} = DirectSound Object
     238   //HKEY_CLASSES_ROOT\CLSID\{47D4D946-62E8-11cf-93BC-444553540000}\InprocServer32 = dsound.dll
     239   if(RegCreateKeyA(HKEY_CLASSES_ROOT,"DirectSound",&hkey)!=ERROR_SUCCESS) {
     240        goto initreg_error;
     241   }
     242   RegSetValueExA(hkey,"",0,REG_SZ, (LPBYTE)DSOUND_DEFAULT, sizeof(DSOUND_DEFAULT));
     243   if(RegCreateKeyA(hkey,COM_CLASS_ID,&hkey1)!=ERROR_SUCCESS) {
     244        RegCloseKey(hkey);
     245        goto initreg_error;
     246   }
     247   RegSetValueExA(hkey1,"",0,REG_SZ, (LPBYTE)DSOUND_CLASSID, sizeof(DSOUND_CLASSID));
     248   RegCloseKey(hkey1);
     249   RegCloseKey(hkey);
     250
     251   if(RegCreateKeyA(HKEY_CLASSES_ROOT, COM_CLASS_ID"\\"DSOUND_CLASSID ,&hkey)!=ERROR_SUCCESS) {
     252        goto initreg_error;
     253   }
     254   RegSetValueExA(hkey,"",0,REG_SZ, (LPBYTE)DSOUND_DEFAULT, sizeof(DSOUND_DEFAULT));
     255   if(RegCreateKeyA(hkey,COM_INPROCSERVER, &hkey1)!=ERROR_SUCCESS) {
     256        RegCloseKey(hkey);
     257        goto initreg_error;
     258   }
     259   RegSetValueExA(hkey1,"",0,REG_SZ, (LPBYTE)DSOUND_DLL, sizeof(DSOUND_DLL));
     260   RegSetValueExA(hkey1, COM_THREADMODEL, 0,REG_SZ, (LPBYTE)THREAD_BOTH, sizeof(THREAD_BOTH));
     261   RegCloseKey(hkey1);
     262   RegCloseKey(hkey);
    161263   return TRUE;
     264
     265initreg_error:
     266   dprintf((INITREG_ERROR));
     267   return FALSE;
    162268}
    163269//******************************************************************************
  • trunk/src/kernel32/initterm.cpp

    r3059 r3074  
    1 /* $Id: initterm.cpp,v 1.37 2000-03-09 19:03:18 sandervl Exp $ */
     1/* $Id: initterm.cpp,v 1.38 2000-03-10 16:11:59 sandervl Exp $ */
    22
    33/*
     
    5050#include "initsystem.h"
    5151#include <exitlist.h>
     52#include "oslibdos.h"
    5253#define DBG_LOCALLOG    DBG_initterm
    5354#include "dbglocal.h"
     
    156157                flAllocMem = 0;        // no high memory support
    157158
     159            OSLibDosSetInitialMaxFileHandles(ODIN_DEFAULT_MAX_FILEHANDLES);
     160
    158161            InitializeTIB(TRUE);
    159162            //SvL: Do it here instead of during the exe object creation
  • trunk/src/kernel32/oslibdos.cpp

    r2984 r3074  
    1 /* $Id: oslibdos.cpp,v 1.21 2000-03-03 11:15:58 sandervl Exp $ */
     1/* $Id: oslibdos.cpp,v 1.22 2000-03-10 16:12:00 sandervl Exp $ */
    22/*
    33 * Wrappers for OS/2 Dos* API
     
    238238{
    239239  return DosClose(hFile);
     240}
     241//******************************************************************************
     242//******************************************************************************
     243DWORD OSLibDosChangeMaxFileHandles()
     244{
     245 ULONG  CurMaxFH;
     246 LONG   ReqCount = 0;
     247 APIRET rc;
     248
     249        rc = DosSetRelMaxFH(&ReqCount, &CurMaxFH);
     250        if(rc) {
     251                dprintf(("DosSetRelMaxFH returned %d", rc));
     252                return rc;
     253        }
     254        if(ReqCount + ODIN_INCREMENT_MAX_FILEHANDLES > CurMaxFH) {
     255                ReqCount = CurMaxFH + ODIN_INCREMENT_MAX_FILEHANDLES;
     256                rc = DosSetRelMaxFH(&ReqCount, &CurMaxFH);
     257                if(rc) {
     258                        dprintf(("DosSetRelMaxFH returned %d", rc));
     259                        return rc;
     260                }
     261        }
     262        return 0;
     263}
     264//******************************************************************************
     265//******************************************************************************
     266DWORD OSLibDosSetInitialMaxFileHandles(DWORD maxhandles)
     267{
     268 ULONG  CurMaxFH;
     269 LONG   ReqCount = 0;
     270 APIRET rc;
     271
     272        rc = DosSetRelMaxFH(&ReqCount, &CurMaxFH);
     273        if(rc) {
     274                dprintf(("DosSetRelMaxFH returned %d", rc));
     275                return rc;
     276        }
     277        if(CurMaxFH < maxhandles) {
     278                rc = DosSetMaxFH(maxhandles);
     279                if(rc) {
     280                        dprintf(("DosSetMaxFH returned %d", rc));
     281                        return rc;
     282                }
     283        }
     284        return 0;
    240285}
    241286//******************************************************************************
  • trunk/src/kernel32/oslibdos.h

    r2311 r3074  
    1 /* $Id: oslibdos.h,v 1.11 2000-01-03 21:36:11 sandervl Exp $ */
     1/* $Id: oslibdos.h,v 1.12 2000-03-10 16:12:00 sandervl Exp $ */
    22
    33/*
     
    2121DWORD OSLibDosAllocSharedMem(LPVOID *lplpMemAddr, DWORD size, DWORD flags, LPSTR name);
    2222DWORD OSLibDosGetNamedSharedMem(LPVOID *lplpMemAddr, LPSTR name);
     23DWORD OSLibDosChangeMaxFileHandles();
     24
     25#define ODIN_INCREMENT_MAX_FILEHANDLES  64
     26#define ODIN_DEFAULT_MAX_FILEHANDLES    256
     27DWORD OSLibDosSetInitialMaxFileHandles(DWORD maxhandles);
    2328
    2429BOOL OSLibDosGetFileAttributesEx(LPSTR pszName, ULONG ulDummy, PVOID pBuffer);
  • trunk/src/kernel32/process.cpp

    r2802 r3074  
    1 /* $Id: process.cpp,v 1.5 2000-02-16 14:23:11 sandervl Exp $ */
     1/* $Id: process.cpp,v 1.6 2000-03-10 16:12:00 sandervl Exp $ */
    22
    33/*
     
    250250    }
    251251    return TRUE;
     252}
     253
     254/***********************************************************************
     255 *           GetProcessFlags    (KERNEL32)
     256 */
     257DWORD WINAPI GetProcessFlags( DWORD processid )
     258{
     259//    PDB *pdb = PROCESS_IdToPDB( processid );
     260//    if (!pdb) return 0;
     261//    return pdb->flags;
     262    dprintf(("STUB: GetProcessFlags %x", processid));
     263    return 0;
    252264}
    253265
  • trunk/src/kernel32/stubs.cpp

    r2803 r3074  
    1 /* $Id: stubs.cpp,v 1.19 2000-02-16 14:25:45 sandervl Exp $ */
     1/* $Id: stubs.cpp,v 1.20 2000-03-10 16:12:00 sandervl Exp $ */
    22
    33/*
     
    181181 *****************************************************************************/
    182182
     183void WIN32API CommonUnimpStub()
     184{
     185  dprintf(("STUB: KERNEL32.17!!"));
     186}
    183187
    184188/*****************************************************************************
  • trunk/src/kernel32/thunk.cpp

    r2802 r3074  
    1 /* $Id: thunk.cpp,v 1.4 2000-02-16 14:23:12 sandervl Exp $ */
     1/* $Id: thunk.cpp,v 1.5 2000-03-10 16:12:01 sandervl Exp $ */
    22
    33/*
     
    2424#define DBG_LOCALLOG    DBG_thunk
    2525#include "dbglocal.h"
     26
     27/************************************************************************
     28 *           _ConfirmWin16Lock    (KERNEL32.96)
     29 */
     30DWORD WINAPI _ConfirmWin16Lock(void)
     31{
     32        dprintf(("STUB: _ConfirmWin16Lock"));
     33        return 0;
     34}
     35
     36/************************************************************************
     37 *           ReleaseThunkLock    (KERNEL32.48)
     38 */
     39VOID WINAPI ReleaseThunkLock(DWORD *mutex_count)
     40{
     41        dprintf(("STUB: ReleaseThunkLock"));
     42}
     43
     44/************************************************************************
     45 *           RestoreThunkLock    (KERNEL32.49)
     46 */
     47VOID WINAPI RestoreThunkLock(DWORD mutex_count)
     48{
     49        dprintf(("STUB: RestoreThunkLock"));
     50}
    2651
    2752//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.