summaryrefslogtreecommitdiff
path: root/src/test/burn/TestData/PrereqBaTests/ReplaceConfig/ReplaceConfig.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/burn/TestData/PrereqBaTests/ReplaceConfig/ReplaceConfig.cpp')
-rw-r--r--src/test/burn/TestData/PrereqBaTests/ReplaceConfig/ReplaceConfig.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/test/burn/TestData/PrereqBaTests/ReplaceConfig/ReplaceConfig.cpp b/src/test/burn/TestData/PrereqBaTests/ReplaceConfig/ReplaceConfig.cpp
new file mode 100644
index 00000000..1fa71bc2
--- /dev/null
+++ b/src/test/burn/TestData/PrereqBaTests/ReplaceConfig/ReplaceConfig.cpp
@@ -0,0 +1,33 @@
1// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information.
2
3#include "precomp.h"
4
5int __cdecl wmain(
6 __in int argc,
7 __in LPWSTR argv[]
8 )
9{
10 HRESULT hr = S_OK;
11 DWORD dwExitCode = 0;
12 LPCWSTR wzDestinationFile = argc > 1 ? argv[1] : NULL;
13 LPCWSTR wzGoodFile = argc > 2 ? argv[2] : NULL;
14 LPCWSTR wzBadFile = argc > 3 ? argv[3] : NULL;
15
16 if (argc != 4)
17 {
18 ExitWithRootFailure(hr, E_INVALIDARG, "Invalid args");
19 }
20
21 if (!::MoveFileW(wzDestinationFile, wzBadFile))
22 {
23 ExitWithLastError(hr, "Failed to move bad file");
24 }
25
26 if (!::MoveFileW(wzGoodFile, wzDestinationFile))
27 {
28 ExitWithLastError(hr, "Failed to move good file");
29 }
30
31LExit:
32 return FAILED(hr) ? (int)hr : (int)dwExitCode;
33}