Changeset 36900 in vbox for trunk/src/VBox/Main/src-server/win
- Timestamp:
- Apr 29, 2011 5:00:37 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/src-server/win/svcmain.cpp
r35722 r36900 5 5 6 6 /* 7 * Copyright (C) 2006-20 07Oracle Corporation7 * Copyright (C) 2006-2011 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 31 31 #include <VBox/err.h> 32 32 #include <iprt/initterm.h> 33 #include <iprt/path.h> 33 34 34 35 #include <atlbase.h> … … 151 152 HINSTANCE /*hPrevInstance*/, LPTSTR lpCmdLine, int /*nShowCmd*/) 152 153 { 154 lpCmdLine = GetCommandLine(); /* this line necessary for _ATL_MIN_CRT */ 155 156 /* Need to parse the command line before initializing the VBox runtime. */ 157 TCHAR szTokens[] = _T("-/"); 158 LPCTSTR lpszToken = FindOneOf(lpCmdLine, szTokens); 159 while (lpszToken != NULL) 160 { 161 if (WordCmpI(lpszToken, _T("Embedding")) == 0) 162 { 163 /* %HOMEDRIVE%%HOMEPATH% */ 164 wchar_t wszHome[RTPATH_MAX]; 165 DWORD cEnv = GetEnvironmentVariable(L"HOMEDRIVE", &wszHome[0], RTPATH_MAX); 166 if (cEnv && cEnv < RTPATH_MAX) 167 { 168 DWORD cwc = cEnv; /* doesn't include NUL */ 169 cEnv = GetEnvironmentVariable(L"HOMEPATH", &wszHome[cEnv], RTPATH_MAX - cwc); 170 if (cEnv && cEnv < RTPATH_MAX - cwc) 171 { 172 /* If this fails there is nothing we can do. Ignore. */ 173 SetCurrentDirectory(wszHome); 174 } 175 } 176 } 177 178 lpszToken = FindOneOf(lpszToken, szTokens); 179 } 180 153 181 /* 154 182 * Initialize the VBox runtime without loading … … 157 185 RTR3Init(); 158 186 159 lpCmdLine = GetCommandLine(); /* this line necessary for _ATL_MIN_CRT */160 161 187 HRESULT hRes = com::Initialize(); 162 188 … … 164 190 _Module.Init(ObjectMap, hInstance, &LIBID_VirtualBox); 165 191 _Module.dwThreadID = GetCurrentThreadId(); 166 TCHAR szTokens[] = _T("-/");167 192 168 193 int nRet = 0; 169 194 BOOL bRun = TRUE; 170 LPCTSTRlpszToken = FindOneOf(lpCmdLine, szTokens);195 lpszToken = FindOneOf(lpCmdLine, szTokens); 171 196 while (lpszToken != NULL) 172 197 {
Note:
See TracChangeset
for help on using the changeset viewer.