diff options
Diffstat (limited to 'src/ca/wixhttpca.cpp')
-rw-r--r-- | src/ca/wixhttpca.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/src/ca/wixhttpca.cpp b/src/ca/wixhttpca.cpp index 0355f718..8c846ffc 100644 --- a/src/ca/wixhttpca.cpp +++ b/src/ca/wixhttpca.cpp | |||
@@ -30,14 +30,14 @@ HTTPAPI_VERSION vcHttpVersion = HTTPAPI_VERSION_1; | |||
30 | ULONG vcHttpFlags = HTTP_INITIALIZE_CONFIG; | 30 | ULONG vcHttpFlags = HTTP_INITIALIZE_CONFIG; |
31 | 31 | ||
32 | LPCWSTR vcsHttpUrlReservationQuery = | 32 | LPCWSTR vcsHttpUrlReservationQuery = |
33 | L"SELECT `WixHttpUrlReservation`.`WixHttpUrlReservation`, `WixHttpUrlReservation`.`HandleExisting`, `WixHttpUrlReservation`.`Sddl`, `WixHttpUrlReservation`.`Url`, `WixHttpUrlReservation`.`Component_` " | 33 | L"SELECT `Wix4HttpUrlReservation`.`Wix4HttpUrlReservation`, `Wix4HttpUrlReservation`.`HandleExisting`, `Wix4HttpUrlReservation`.`Sddl`, `Wix4HttpUrlReservation`.`Url`, `Wix4HttpUrlReservation`.`Component_` " |
34 | L"FROM `WixHttpUrlReservation`"; | 34 | L"FROM `Wix4HttpUrlReservation`"; |
35 | enum eHttpUrlReservationQuery { hurqId = 1, hurqHandleExisting, hurqSDDL, hurqUrl, hurqComponent }; | 35 | enum eHttpUrlReservationQuery { hurqId = 1, hurqHandleExisting, hurqSDDL, hurqUrl, hurqComponent }; |
36 | 36 | ||
37 | LPCWSTR vcsHttpUrlAceQuery = | 37 | LPCWSTR vcsHttpUrlAceQuery = |
38 | L"SELECT `WixHttpUrlAce`.`SecurityPrincipal`, `WixHttpUrlAce`.`Rights` " | 38 | L"SELECT `Wix4HttpUrlAce`.`SecurityPrincipal`, `Wix4HttpUrlAce`.`Rights` " |
39 | L"FROM `WixHttpUrlAce` " | 39 | L"FROM `Wix4HttpUrlAce` " |
40 | L"WHERE `WixHttpUrlAce`.`WixHttpUrlReservation_`=?"; | 40 | L"WHERE `Wix4HttpUrlAce`.`Wix4HttpUrlReservation_`=?"; |
41 | enum eHttpUrlAceQuery { huaqSecurityPrincipal = 1, huaqRights }; | 41 | enum eHttpUrlAceQuery { huaqSecurityPrincipal = 1, huaqRights }; |
42 | 42 | ||
43 | /****************************************************************** | 43 | /****************************************************************** |
@@ -80,21 +80,21 @@ static UINT SchedHttpUrlReservations( | |||
80 | ExitOnFailure(hr, "Failed to initialize."); | 80 | ExitOnFailure(hr, "Failed to initialize."); |
81 | 81 | ||
82 | // Anything to do? | 82 | // Anything to do? |
83 | hr = WcaTableExists(L"WixHttpUrlReservation"); | 83 | hr = WcaTableExists(L"Wix4HttpUrlReservation"); |
84 | ExitOnFailure(hr, "Failed to check if the WixHttpUrlReservation table exists."); | 84 | ExitOnFailure(hr, "Failed to check if the Wix4HttpUrlReservation table exists."); |
85 | if (S_FALSE == hr) | 85 | if (S_FALSE == hr) |
86 | { | 86 | { |
87 | WcaLog(LOGMSG_STANDARD, "WixHttpUrlReservation table doesn't exist, so there are no URL reservations to configure."); | 87 | WcaLog(LOGMSG_STANDARD, "Wix4HttpUrlReservation table doesn't exist, so there are no URL reservations to configure."); |
88 | ExitFunction(); | 88 | ExitFunction(); |
89 | } | 89 | } |
90 | 90 | ||
91 | hr = WcaTableExists(L"WixHttpUrlAce"); | 91 | hr = WcaTableExists(L"Wix4HttpUrlAce"); |
92 | ExitOnFailure(hr, "Failed to check if the WixHttpUrlAce table exists."); | 92 | ExitOnFailure(hr, "Failed to check if the Wix4HttpUrlAce table exists."); |
93 | fAceTableExists = S_OK == hr; | 93 | fAceTableExists = S_OK == hr; |
94 | 94 | ||
95 | // Query and loop through all the URL reservations. | 95 | // Query and loop through all the URL reservations. |
96 | hr = WcaOpenExecuteView(vcsHttpUrlReservationQuery, &hView); | 96 | hr = WcaOpenExecuteView(vcsHttpUrlReservationQuery, &hView); |
97 | ExitOnFailure(hr, "Failed to open view on the WixHttpUrlReservation table."); | 97 | ExitOnFailure(hr, "Failed to open view on the Wix4HttpUrlReservation table."); |
98 | 98 | ||
99 | hr = HRESULT_FROM_WIN32(::HttpInitialize(vcHttpVersion, vcHttpFlags, NULL)); | 99 | hr = HRESULT_FROM_WIN32(::HttpInitialize(vcHttpVersion, vcHttpFlags, NULL)); |
100 | ExitOnFailure(hr, "Failed to initialize HTTP Server configuration."); | 100 | ExitOnFailure(hr, "Failed to initialize HTTP Server configuration."); |
@@ -104,10 +104,10 @@ static UINT SchedHttpUrlReservations( | |||
104 | while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) | 104 | while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) |
105 | { | 105 | { |
106 | hr = WcaGetRecordString(hRec, hurqId, &sczId); | 106 | hr = WcaGetRecordString(hRec, hurqId, &sczId); |
107 | ExitOnFailure(hr, "Failed to get WixHttpUrlReservation.WixHttpUrlReservation"); | 107 | ExitOnFailure(hr, "Failed to get Wix4HttpUrlReservation.Wix4HttpUrlReservation"); |
108 | 108 | ||
109 | hr = WcaGetRecordString(hRec, hurqComponent, &sczComponent); | 109 | hr = WcaGetRecordString(hRec, hurqComponent, &sczComponent); |
110 | ExitOnFailure(hr, "Failed to get WixHttpUrlReservation.Component_"); | 110 | ExitOnFailure(hr, "Failed to get Wix4HttpUrlReservation.Component_"); |
111 | 111 | ||
112 | // Figure out what we're doing for this reservation, treating reinstall the same as install. | 112 | // Figure out what we're doing for this reservation, treating reinstall the same as install. |
113 | todoComponent = WcaGetComponentToDo(sczComponent); | 113 | todoComponent = WcaGetComponentToDo(sczComponent); |
@@ -118,10 +118,10 @@ static UINT SchedHttpUrlReservations( | |||
118 | } | 118 | } |
119 | 119 | ||
120 | hr = WcaGetRecordFormattedString(hRec, hurqUrl, &sczUrl); | 120 | hr = WcaGetRecordFormattedString(hRec, hurqUrl, &sczUrl); |
121 | ExitOnFailure(hr, "Failed to get WixHttpUrlReservation.Url"); | 121 | ExitOnFailure(hr, "Failed to get Wix4HttpUrlReservation.Url"); |
122 | 122 | ||
123 | hr = WcaGetRecordInteger(hRec, hurqHandleExisting, &iHandleExisting); | 123 | hr = WcaGetRecordInteger(hRec, hurqHandleExisting, &iHandleExisting); |
124 | ExitOnFailure(hr, "Failed to get WixHttpUrlReservation.HandleExisting"); | 124 | ExitOnFailure(hr, "Failed to get Wix4HttpUrlReservation.HandleExisting"); |
125 | 125 | ||
126 | if (::MsiRecordIsNull(hRec, hurqSDDL)) | 126 | if (::MsiRecordIsNull(hRec, hurqSDDL)) |
127 | { | 127 | { |
@@ -133,20 +133,20 @@ static UINT SchedHttpUrlReservations( | |||
133 | { | 133 | { |
134 | hQueryReq = ::MsiCreateRecord(1); | 134 | hQueryReq = ::MsiCreateRecord(1); |
135 | hr = WcaSetRecordString(hQueryReq, 1, sczId); | 135 | hr = WcaSetRecordString(hQueryReq, 1, sczId); |
136 | ExitOnFailure(hr, "Failed to create record for querying WixHttpUrlAce table for reservation %ls", sczId); | 136 | ExitOnFailure(hr, "Failed to create record for querying Wix4HttpUrlAce table for reservation %ls", sczId); |
137 | 137 | ||
138 | hr = WcaOpenView(vcsHttpUrlAceQuery, &hAceView); | 138 | hr = WcaOpenView(vcsHttpUrlAceQuery, &hAceView); |
139 | ExitOnFailure(hr, "Failed to open view on WixHttpUrlAce table for reservation %ls", sczId); | 139 | ExitOnFailure(hr, "Failed to open view on Wix4HttpUrlAce table for reservation %ls", sczId); |
140 | hr = WcaExecuteView(hAceView, hQueryReq); | 140 | hr = WcaExecuteView(hAceView, hQueryReq); |
141 | ExitOnFailure(hr, "Failed to execute view on WixHttpUrlAce table for reservation %ls", sczId); | 141 | ExitOnFailure(hr, "Failed to execute view on Wix4HttpUrlAce table for reservation %ls", sczId); |
142 | 142 | ||
143 | while (S_OK == (hr = WcaFetchRecord(hAceView, &hRec))) | 143 | while (S_OK == (hr = WcaFetchRecord(hAceView, &hRec))) |
144 | { | 144 | { |
145 | hr = WcaGetRecordFormattedString(hRec, huaqSecurityPrincipal, &sczSecurityPrincipal); | 145 | hr = WcaGetRecordFormattedString(hRec, huaqSecurityPrincipal, &sczSecurityPrincipal); |
146 | ExitOnFailure(hr, "Failed to get WixHttpUrlAce.SecurityPrincipal"); | 146 | ExitOnFailure(hr, "Failed to get Wix4HttpUrlAce.SecurityPrincipal"); |
147 | 147 | ||
148 | hr = WcaGetRecordInteger(hRec, huaqRights, &iRights); | 148 | hr = WcaGetRecordInteger(hRec, huaqRights, &iRights); |
149 | ExitOnFailure(hr, "Failed to get WixHttpUrlAce.Rights"); | 149 | ExitOnFailure(hr, "Failed to get Wix4HttpUrlAce.Rights"); |
150 | 150 | ||
151 | hr = AppendUrlAce(sczSecurityPrincipal, iRights, &sczSDDL); | 151 | hr = AppendUrlAce(sczSecurityPrincipal, iRights, &sczSDDL); |
152 | ExitOnFailure(hr, "Failed to append URL ACE."); | 152 | ExitOnFailure(hr, "Failed to append URL ACE."); |
@@ -156,13 +156,13 @@ static UINT SchedHttpUrlReservations( | |||
156 | { | 156 | { |
157 | hr = S_OK; | 157 | hr = S_OK; |
158 | } | 158 | } |
159 | ExitOnFailure(hr, "Failed to enumerate selected rows from WixHttpUrlAce table."); | 159 | ExitOnFailure(hr, "Failed to enumerate selected rows from Wix4HttpUrlAce table."); |
160 | } | 160 | } |
161 | } | 161 | } |
162 | else | 162 | else |
163 | { | 163 | { |
164 | hr = WcaGetRecordFormattedString(hRec, hurqSDDL, &sczSDDL); | 164 | hr = WcaGetRecordFormattedString(hRec, hurqSDDL, &sczSDDL); |
165 | ExitOnFailure(hr, "Failed to get WixHttpUrlReservation.SDDL"); | 165 | ExitOnFailure(hr, "Failed to get Wix4HttpUrlReservation.SDDL"); |
166 | } | 166 | } |
167 | 167 | ||
168 | hr = GetUrlReservation(sczUrl, &sczExistingSDDL); | 168 | hr = GetUrlReservation(sczUrl, &sczExistingSDDL); |
@@ -181,7 +181,7 @@ static UINT SchedHttpUrlReservations( | |||
181 | { | 181 | { |
182 | hr = S_OK; | 182 | hr = S_OK; |
183 | } | 183 | } |
184 | ExitOnFailure(hr, "Failure occurred while processing WixHttpUrlReservation table."); | 184 | ExitOnFailure(hr, "Failure occurred while processing Wix4HttpUrlReservation table."); |
185 | 185 | ||
186 | // Schedule ExecHttpUrlReservations if there's anything to do. | 186 | // Schedule ExecHttpUrlReservations if there's anything to do. |
187 | if (cUrlReservations) | 187 | if (cUrlReservations) |