Changeset 3461 for trunk/src/kernel32/initsystem.cpp
- Timestamp:
- Apr 29, 2000, 8:26:59 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kernel32/initsystem.cpp
r3074 r3461 1 /* $Id: initsystem.cpp,v 1. 8 2000-03-10 16:11:59sandervl Exp $ */1 /* $Id: initsystem.cpp,v 1.9 2000-04-29 18:26:58 sandervl Exp $ */ 2 2 /* 3 3 * Odin system initialization (registry & directories) 4 4 * 5 * Called from the WarpIn install program to create the desktop directories and 6 * to setup the registry 7 * 8 * InitSystemAndRegistry creates: 9 * - WINDOWSDIR\SYSTEM 10 * - WINDOWSDIR\AppData 11 * - WINDOWSDIR\Cache 12 * - WINDOWSDIR\Cookies 13 * - WINDOWSDIR\Desktop 14 * - WINDOWSDIR\Favorites 15 * - WINDOWSDIR\Fonts 16 * - WINDOWSDIR\History 17 * - WINDOWSDIR\NetHood 18 * - WINDOWSDIR\My Documents 19 * - WINDOWSDIR\PrintHood 20 * - WINDOWSDIR\Recent 21 * - WINDOWSDIR\SendTo 22 * - WINDOWSDIR\Start Menu 23 * - WINDOWSDIR\Start Menu\Programs 24 * - WINDOWSDIR\Start Menu\Programs\Startup 25 * - WINDOWSDIR\ShellNew 26 * - and a minimal system registry 5 27 * 6 28 * NOTE: Most of this has to be moved into the Odin install program!!!!! … … 20 42 #include "debugtools.h" 21 43 #include "cpuhlp.h" 22 #include "initsystem.h"44 #include <odininst.h> 23 45 #include "directory.h" 24 46 #include <versionos2.h> … … 41 63 #define INITREG_ERROR "InitRegistry: Unable to register system information" 42 64 43 BOOL InitRegistry(); 44 45 //****************************************************************************** 46 //****************************************************************************** 47 BOOL InitSystemEnvironment(ULONG nrCPUs) 48 { 49 InitSystemInfo(nrCPUs); 50 return InitRegistry(); 51 } 65 //****************************************************************************** 66 //****************************************************************************** 52 67 //****************************************************************************** 53 68 //[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Windows] … … 60 75 BYTE ShutdownTime[] = {0x44,0x5e,0xf2,0xbb,0x84,0x41,0xbf,0x01}; 61 76 //****************************************************************************** 62 BOOL Init Registry()77 BOOL InitSystemAndRegistry() 63 78 { 64 79 HKEY hkey, hkey1; … … 127 142 // if(RegOpenKeyA(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", &hkey) != ERROR_SUCCESS) 128 143 // { 144 //SYSTEM dir 145 strcpy(shellpath, InternalGetWindowsDirectoryA()); 146 strcat(shellpath, "\\SYSTEM"); 147 CreateDirectoryA(shellpath, NULL); 148 149 //AppData 150 strcpy(shellpath, InternalGetWindowsDirectoryA()); 151 strcat(shellpath, "\\Application Data"); 152 CreateDirectoryA(shellpath, NULL); 153 RegSetValueExA(hkey,"AppData",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 154 //Cache 155 strcpy(shellpath, InternalGetWindowsDirectoryA()); 156 strcat(shellpath, "\\Temporary Internet Files"); 157 CreateDirectoryA(shellpath, NULL); 158 RegSetValueExA(hkey,"Cache",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 159 //Cookies 160 strcpy(shellpath, InternalGetWindowsDirectoryA()); 161 strcat(shellpath, "\\Cookies"); 162 CreateDirectoryA(shellpath, NULL); 163 RegSetValueExA(hkey,"Cookies",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 164 //Desktop 165 strcpy(shellpath, InternalGetWindowsDirectoryA()); 166 strcat(shellpath, "\\Desktop"); 167 CreateDirectoryA(shellpath, NULL); 168 RegSetValueExA(hkey,"Desktop",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 169 //Favorites 129 170 strcpy(shellpath, InternalGetWindowsDirectoryA()); 130 171 strcat(shellpath, "\\Favorites"); 131 172 CreateDirectoryA(shellpath, NULL); 132 173 RegSetValueExA(hkey,"Favorites",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 133 strcpy(shellpath, InternalGetWindowsDirectoryA()); 134 strcat(shellpath, "\\Programs\\Startup"); 174 //Fonts 175 strcpy(shellpath, InternalGetWindowsDirectoryA()); 176 strcat(shellpath, "\\Fonts"); 177 CreateDirectoryA(shellpath, NULL); 178 RegSetValueExA(hkey,"Fonts",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 179 //History 180 strcpy(shellpath, InternalGetWindowsDirectoryA()); 181 strcat(shellpath, "\\History"); 182 CreateDirectoryA(shellpath, NULL); 183 RegSetValueExA(hkey,"History",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 184 //NetHood 185 strcpy(shellpath, InternalGetWindowsDirectoryA()); 186 strcat(shellpath, "\\NetHood"); 187 CreateDirectoryA(shellpath, NULL); 188 RegSetValueExA(hkey,"NetHood",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 189 //Personal 190 strcpy(shellpath, InternalGetWindowsDirectoryA()); 191 strcat(shellpath, "\\My Documents"); 192 CreateDirectoryA(shellpath, NULL); 193 RegSetValueExA(hkey,"Personal",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 194 //PrintHood 195 strcpy(shellpath, InternalGetWindowsDirectoryA()); 196 strcat(shellpath, "\\PrintHood"); 197 CreateDirectoryA(shellpath, NULL); 198 RegSetValueExA(hkey,"PrintHood",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 199 //Recent 200 strcpy(shellpath, InternalGetWindowsDirectoryA()); 201 strcat(shellpath, "\\Recent"); 202 CreateDirectoryA(shellpath, NULL); 203 RegSetValueExA(hkey,"Recent",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 204 //SendTo 205 strcpy(shellpath, InternalGetWindowsDirectoryA()); 206 strcat(shellpath, "\\SendTo"); 207 CreateDirectoryA(shellpath, NULL); 208 RegSetValueExA(hkey,"SendTo",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 209 //Start Menu 210 strcpy(shellpath, InternalGetWindowsDirectoryA()); 211 strcat(shellpath, "\\Start Menu"); 212 CreateDirectoryA(shellpath, NULL); 213 RegSetValueExA(hkey,"Start Menu",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 214 //Programs 215 strcpy(shellpath, InternalGetWindowsDirectoryA()); 216 strcat(shellpath, "\\Start Menu\\Programs"); 217 CreateDirectoryA(shellpath, NULL); 218 RegSetValueExA(hkey,"Programs",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 219 //Startup 220 strcat(shellpath, "\\Startup"); 135 221 CreateDirectoryA(shellpath, NULL); 136 222 RegSetValueExA(hkey,"Startup",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 137 strcpy(shellpath, InternalGetWindowsDirectoryA()); 138 strcat(shellpath, "\\Desktop"); 139 CreateDirectoryA(shellpath, NULL); 140 RegSetValueExA(hkey,"Desktop",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 141 strcpy(shellpath, InternalGetWindowsDirectoryA()); 142 strcat(shellpath, "\\Start Menu\\Programs"); 143 CreateDirectoryA(shellpath, NULL); 144 RegSetValueExA(hkey,"Programs",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 145 strcpy(shellpath, InternalGetWindowsDirectoryA()); 146 strcat(shellpath, "\\Fonts"); 147 CreateDirectoryA(shellpath, NULL); 148 RegSetValueExA(hkey,"Fonts",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 149 strcpy(shellpath, InternalGetWindowsDirectoryA()); 150 strcat(shellpath, "\\SendTo"); 151 CreateDirectoryA(shellpath, NULL); 152 RegSetValueExA(hkey,"SendTo",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 153 strcpy(shellpath, InternalGetWindowsDirectoryA()); 154 strcat(shellpath, "\\Start Menu"); 155 CreateDirectoryA(shellpath, NULL); 156 RegSetValueExA(hkey,"Start Menu",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 223 //ShellNew 157 224 strcpy(shellpath, InternalGetWindowsDirectoryA()); 158 225 strcat(shellpath, "\\ShellNew"); 159 226 CreateDirectoryA(shellpath, NULL); 160 227 RegSetValueExA(hkey,"Templates",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1); 161 strcpy(shellpath, InternalGetWindowsDirectoryA());162 strcat(shellpath, "\\Recent");163 CreateDirectoryA(shellpath, NULL);164 RegSetValueExA(hkey,"Recent",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);165 strcpy(shellpath, InternalGetWindowsDirectoryA());166 strcat(shellpath, "\\NetHood");167 CreateDirectoryA(shellpath, NULL);168 RegSetValueExA(hkey,"NetHood",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);169 strcpy(shellpath, InternalGetWindowsDirectoryA());170 strcat(shellpath, "\\My Documents");171 CreateDirectoryA(shellpath, NULL);172 RegSetValueExA(hkey,"Personal",0,REG_SZ, (LPBYTE)shellpath, strlen(shellpath)+1);173 228 // } 174 229 RegCloseKey(hkey);
Note:
See TracChangeset
for help on using the changeset viewer.