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

file handle + registry changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.