aboutsummaryrefslogtreecommitdiff
path: root/src/ca/XmlConfig.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ca/XmlConfig.cpp')
-rw-r--r--src/ca/XmlConfig.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/ca/XmlConfig.cpp b/src/ca/XmlConfig.cpp
index 8c60979d..afd3dafb 100644
--- a/src/ca/XmlConfig.cpp
+++ b/src/ca/XmlConfig.cpp
@@ -588,8 +588,9 @@ extern "C" UINT __stdcall ExecXmlConfig(
588 HRESULT hrOpenFailure = S_OK; 588 HRESULT hrOpenFailure = S_OK;
589 UINT er = ERROR_SUCCESS; 589 UINT er = ERROR_SUCCESS;
590 590
591 BOOL fIsWow64Process = FALSE; 591#ifndef _WIN64
592 BOOL fIsFSRedirectDisabled = FALSE; 592 BOOL fIsFSRedirectDisabled = FALSE;
593#endif
593 BOOL fPreserveDate = FALSE; 594 BOOL fPreserveDate = FALSE;
594 595
595 LPWSTR pwzCustomActionData = NULL; 596 LPWSTR pwzCustomActionData = NULL;
@@ -635,10 +636,12 @@ extern "C" UINT __stdcall ExecXmlConfig(
635 hr = WcaReadIntegerFromCaData(&pwz, (int*) &xa); 636 hr = WcaReadIntegerFromCaData(&pwz, (int*) &xa);
636 ExitOnFailure(hr, "failed to process CustomActionData"); 637 ExitOnFailure(hr, "failed to process CustomActionData");
637 638
639#ifndef _WIN64
638 // Initialize the Wow64 API - store the result in fWow64APIPresent 640 // Initialize the Wow64 API - store the result in fWow64APIPresent
639 // If it fails, this doesn't warrant an error yet, because we only need the Wow64 API in some cases 641 // If it fails, this doesn't warrant an error yet, because we only need the Wow64 API in some cases
640 WcaInitializeWow64(); 642 WcaInitializeWow64();
641 fIsWow64Process = WcaIsWow64Process(); 643 BOOL fIsWow64Process = WcaIsWow64Process();
644#endif
642 645
643 if (xaOpenFile != xa && xaOpenFilex64 != xa) 646 if (xaOpenFile != xa && xaOpenFilex64 != xa)
644 { 647 {
@@ -657,6 +660,7 @@ extern "C" UINT __stdcall ExecXmlConfig(
657 // Open the file 660 // Open the file
658 ReleaseNullObject(pixd); 661 ReleaseNullObject(pixd);
659 662
663#ifndef _WIN64
660 if (xaOpenFilex64 == xa) 664 if (xaOpenFilex64 == xa)
661 { 665 {
662 if (!fIsWow64Process) 666 if (!fIsWow64Process)
@@ -670,6 +674,7 @@ extern "C" UINT __stdcall ExecXmlConfig(
670 674
671 fIsFSRedirectDisabled = TRUE; 675 fIsFSRedirectDisabled = TRUE;
672 } 676 }
677#endif
673 678
674 hr = XmlLoadDocumentFromFileEx(pwzFile, XML_LOAD_PRESERVE_WHITESPACE, &pixd); 679 hr = XmlLoadDocumentFromFileEx(pwzFile, XML_LOAD_PRESERVE_WHITESPACE, &pixd);
675 if (FAILED(hr)) 680 if (FAILED(hr))
@@ -945,15 +950,18 @@ extern "C" UINT __stdcall ExecXmlConfig(
945 ExitOnFailure(hr, "failed to set modified time of file : %ls", pwzFile); 950 ExitOnFailure(hr, "failed to set modified time of file : %ls", pwzFile);
946 } 951 }
947 952
953#ifndef _WIN64
948 if (fIsFSRedirectDisabled) 954 if (fIsFSRedirectDisabled)
949 { 955 {
950 fIsFSRedirectDisabled = FALSE; 956 fIsFSRedirectDisabled = FALSE;
951 WcaRevertWow64FSRedirection(); 957 WcaRevertWow64FSRedirection();
952 } 958 }
959#endif
953 } 960 }
954 } 961 }
955 962
956LExit: 963LExit:
964#ifndef _WIN64
957 // Make sure we revert FS Redirection if necessary before exiting 965 // Make sure we revert FS Redirection if necessary before exiting
958 if (fIsFSRedirectDisabled) 966 if (fIsFSRedirectDisabled)
959 { 967 {
@@ -961,6 +969,7 @@ LExit:
961 WcaRevertWow64FSRedirection(); 969 WcaRevertWow64FSRedirection();
962 } 970 }
963 WcaFinalizeWow64(); 971 WcaFinalizeWow64();
972#endif
964 973
965 ReleaseStr(pwzCustomActionData); 974 ReleaseStr(pwzCustomActionData);
966 ReleaseStr(pwzData); 975 ReleaseStr(pwzData);
@@ -1001,7 +1010,9 @@ extern "C" UINT __stdcall ExecXmlConfigRollback(
1001 UINT er = ERROR_SUCCESS; 1010 UINT er = ERROR_SUCCESS;
1002 1011
1003 int iIs64Bit; 1012 int iIs64Bit;
1013#ifndef _WIN64
1004 BOOL fIs64Bit = FALSE; 1014 BOOL fIs64Bit = FALSE;
1015#endif
1005 1016
1006 LPWSTR pwzCustomActionData = NULL; 1017 LPWSTR pwzCustomActionData = NULL;
1007 LPWSTR pwz = NULL; 1018 LPWSTR pwz = NULL;
@@ -1035,6 +1046,7 @@ extern "C" UINT __stdcall ExecXmlConfigRollback(
1035 hr = WcaReadStreamFromCaData(&pwz, &pbData, &cbData); 1046 hr = WcaReadStreamFromCaData(&pwz, &pbData, &cbData);
1036 ExitOnFailure(hr, "failed to read file contents from custom action data"); 1047 ExitOnFailure(hr, "failed to read file contents from custom action data");
1037 1048
1049#ifndef _WIN64
1038 fIs64Bit = (BOOL)iIs64Bit; 1050 fIs64Bit = (BOOL)iIs64Bit;
1039 1051
1040 if (fIs64Bit) 1052 if (fIs64Bit)
@@ -1055,6 +1067,7 @@ extern "C" UINT __stdcall ExecXmlConfigRollback(
1055 hr = WcaDisableWow64FSRedirection(); 1067 hr = WcaDisableWow64FSRedirection();
1056 ExitOnFailure(hr, "Custom action was told to rollback a 64-bit component, but was unable to Disable Filesystem Redirection through the Wow64 API."); 1068 ExitOnFailure(hr, "Custom action was told to rollback a 64-bit component, but was unable to Disable Filesystem Redirection through the Wow64 API.");
1057 } 1069 }
1070#endif
1058 1071
1059 hr = FileGetTime(pwzFileName, NULL, NULL, &ft); 1072 hr = FileGetTime(pwzFileName, NULL, NULL, &ft);
1060 ExitOnFailure(hr, "Failed to get modified date of file %ls.", pwzFileName); 1073 ExitOnFailure(hr, "Failed to get modified date of file %ls.", pwzFileName);
@@ -1082,11 +1095,13 @@ LExit:
1082 1095
1083 ReleaseFile(hFile); 1096 ReleaseFile(hFile);
1084 1097
1098#ifndef _WIN64
1085 if (fIs64Bit) 1099 if (fIs64Bit)
1086 { 1100 {
1087 WcaRevertWow64FSRedirection(); 1101 WcaRevertWow64FSRedirection();
1088 WcaFinalizeWow64(); 1102 WcaFinalizeWow64();
1089 } 1103 }
1104#endif
1090 1105
1091 ReleaseMem(pbData); 1106 ReleaseMem(pbData);
1092 1107