Changeset 95834 in vbox
- Timestamp:
- Jul 26, 2022 2:46:59 PM (3 years ago)
- svn:sync-xref-src-repo-rev:
- 152557
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 3 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/Makefile.kmk
r95832 r95834 2305 2305 RuntimeGuestR3_SOURCES.win += \ 2306 2306 common/compiler/vcc/loadcfg-vcc.c \ 2307 common/compiler/vcc/tlsdir-vcc.c \ 2308 common/compiler/vcc/initializers-c-cpp-vcc.cpp \ 2307 2309 common/compiler/vcc/stacksup-vcc.cpp \ 2308 2310 r3/win/nocrt-startup-exe-win.cpp \ -
trunk/src/VBox/Runtime/common/compiler/vcc/loadcfg-vcc.c
r95832 r95834 1 1 /* $Id$ */ 2 2 /** @file 3 * IPRT - No-CRT- PE/Windows Load Configuration.3 * IPRT - Visual C++ Compiler - PE/Windows Load Configuration. 4 4 * 5 5 * @note This is a C file and not C++ because the compiler generates fixups … … 35 35 #include <iprt/formats/pecoff.h> 36 36 37 #include "internal/compiler-vcc.h" 38 37 39 38 40 /********************************************************************************************************************************* … … 64 66 #endif 65 67 66 extern RT_CONCAT(IMAGE_LOAD_CONFIG_DIRECTORY, ARCH_BITS) const _load_config_used;67 68 68 69 69 /** … … 77 77 * the machinactions we include here for the 2019 (14.29.30139.0) linker. 78 78 */ 79 const IMAGE_LOAD_CONFIG_DIRECTORY64_load_config_used =79 RT_CONCAT(IMAGE_LOAD_CONFIG_DIRECTORY, ARCH_BITS) const _load_config_used = 80 80 { 81 81 /* .Size = */ sizeof(_load_config_used), -
trunk/src/VBox/Runtime/r3/win/nocrt-startup-exe-win.cpp
r95818 r95834 45 45 # include <iprt/nocrt/stdlib.h> 46 46 #endif 47 48 #include "internal/compiler-vcc.h" 47 49 48 50 … … 158 160 } 159 161 } 162 163 rtVccInitializersRunTerm(); 160 164 } 161 165 #else … … 203 207 initProcExecPath(); 204 208 205 /*206 * Get and convert the command line to argc/argv format.207 */208 209 RTEXITCODE rcExit; 209 UNICODE_STRING const *pCmdLine = pPeb->ProcessParameters ? &pPeb->ProcessParameters->CommandLine : NULL; 210 if (pCmdLine) 211 { 212 char *pszCmdLine = NULL; 213 int rc = RTUtf16ToUtf8Ex(pCmdLine->Buffer, pCmdLine->Length / sizeof(WCHAR), &pszCmdLine, 0, NULL); 214 if (RT_SUCCESS(rc)) 215 { 216 char **papszArgv; 217 int cArgs = 0; 218 rc = RTGetOptArgvFromString(&papszArgv, &cArgs, pszCmdLine, 219 RTGETOPTARGV_CNV_MODIFY_INPUT | RTGETOPTARGV_CNV_QUOTE_MS_CRT, NULL); 210 #ifdef IPRT_NO_CRT 211 AssertCompile(sizeof(rcExit) == sizeof(int)); 212 rcExit = (RTEXITCODE)rtVccInitializersRunInit(); 213 if (rcExit == RTEXITCODE_SUCCESS) 214 #endif 215 { 216 /* 217 * Get and convert the command line to argc/argv format. 218 */ 219 UNICODE_STRING const *pCmdLine = pPeb->ProcessParameters ? &pPeb->ProcessParameters->CommandLine : NULL; 220 if (pCmdLine) 221 { 222 char *pszCmdLine = NULL; 223 int rc = RTUtf16ToUtf8Ex(pCmdLine->Buffer, pCmdLine->Length / sizeof(WCHAR), &pszCmdLine, 0, NULL); 220 224 if (RT_SUCCESS(rc)) 221 225 { 222 /* 223 * Call the main function. 224 */ 225 AssertCompile(sizeof(rcExit) == sizeof(int)); 226 rcExit = (RTEXITCODE)main(cArgs, papszArgv, NULL /*envp*/); 226 char **papszArgv; 227 int cArgs = 0; 228 rc = RTGetOptArgvFromString(&papszArgv, &cArgs, pszCmdLine, 229 RTGETOPTARGV_CNV_MODIFY_INPUT | RTGETOPTARGV_CNV_QUOTE_MS_CRT, NULL); 230 if (RT_SUCCESS(rc)) 231 { 232 /* 233 * Call the main function. 234 */ 235 AssertCompile(sizeof(rcExit) == sizeof(int)); 236 rcExit = (RTEXITCODE)main(cArgs, papszArgv, NULL /*envp*/); 237 } 238 else 239 rcExit = RTMsgErrorExitFailure("Error parsing command line: %Rrc\n", rc); 227 240 } 228 241 else 229 rcExit = RTMsgErrorExitFailure(" Error parsing command line: %Rrc\n", rc);242 rcExit = RTMsgErrorExitFailure("Failed to convert command line to UTF-8: %Rrc\n", rc); 230 243 } 231 244 else 232 rcExit = RTMsgErrorExitFailure("Failed to convert command line to UTF-8: %Rrc\n", rc); 233 } 245 rcExit = RTMsgErrorExitFailure("No command line\n"); 246 rtTerminateProcess(rcExit, true /*fDoAtExit*/); 247 } 248 #ifdef IPRT_NO_CRT 234 249 else 235 rcExit = RTMsgErrorExitFailure("No command line\n"); 236 237 rtTerminateProcess(rcExit, true /*fDoAtExit*/); 238 } 239 250 { 251 RTMsgError("A C static initializor failed (%d)\n", rcExit); 252 rtTerminateProcess(rcExit, false /*fDoAtExit*/); 253 } 254 #endif 255 } 256
Note:
See TracChangeset
for help on using the changeset viewer.