diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ca/snisslcert.cpp | 52 | ||||
| -rw-r--r-- | src/ca/wixhttpca.cpp | 46 | ||||
| -rw-r--r-- | src/test/WixToolsetTest.Http/HttpExtensionFixture.cs | 10 | ||||
| -rw-r--r-- | src/wixext/HttpTableDefinitions.cs | 12 |
4 files changed, 60 insertions, 60 deletions
diff --git a/src/ca/snisslcert.cpp b/src/ca/snisslcert.cpp index 466ef0b9..3a7336af 100644 --- a/src/ca/snisslcert.cpp +++ b/src/ca/snisslcert.cpp | |||
| @@ -85,8 +85,8 @@ static void SetSniSslCertSetKey( | |||
| 85 | 85 | ||
| 86 | 86 | ||
| 87 | LPCWSTR vcsWixHttpSniSslCertQuery = | 87 | LPCWSTR vcsWixHttpSniSslCertQuery = |
| 88 | L"SELECT `WixHttpSniSslCert`.`WixHttpSniSslCert`, `WixHttpSniSslCert`.`Host`, `WixHttpSniSslCert`.`Port`, `WixHttpSniSslCert`.`Thumbprint`, `WixHttpSniSslCert`.`AppId`, `WixHttpSniSslCert`.`Store`, `WixHttpSniSslCert`.`HandleExisting`, `WixHttpSniSslCert`.`Component_` " | 88 | L"SELECT `Wix4HttpSniSslCert`.`Wix4HttpSniSslCert`, `Wix4HttpSniSslCert`.`Host`, `Wix4HttpSniSslCert`.`Port`, `Wix4HttpSniSslCert`.`Thumbprint`, `Wix4HttpSniSslCert`.`AppId`, `Wix4HttpSniSslCert`.`Store`, `Wix4HttpSniSslCert`.`HandleExisting`, `Wix4HttpSniSslCert`.`Component_` " |
| 89 | L"FROM `WixHttpSniSslCert`"; | 89 | L"FROM `Wix4HttpSniSslCert`"; |
| 90 | enum eWixHttpSniSslCertQuery { hurqId = 1, hurqHost, hurqPort, hurqCertificateThumbprint, hurqAppId, hurqCertificateStore, hurqHandleExisting, hurqComponent }; | 90 | enum eWixHttpSniSslCertQuery { hurqId = 1, hurqHost, hurqPort, hurqCertificateThumbprint, hurqAppId, hurqCertificateStore, hurqHandleExisting, hurqComponent }; |
| 91 | 91 | ||
| 92 | /****************************************************************** | 92 | /****************************************************************** |
| @@ -320,17 +320,17 @@ static UINT SchedHttpSniSslCerts( | |||
| 320 | HTTP_SERVICE_CONFIG_SSL_SNI_SET* pExistingSniSslSet = NULL; | 320 | HTTP_SERVICE_CONFIG_SSL_SNI_SET* pExistingSniSslSet = NULL; |
| 321 | 321 | ||
| 322 | // Anything to do? | 322 | // Anything to do? |
| 323 | hr = WcaTableExists(L"WixHttpSniSslCert"); | 323 | hr = WcaTableExists(L"Wix4HttpSniSslCert"); |
| 324 | ExitOnFailure(hr, "Failed to check if the WixHttpSniSslCert table exists"); | 324 | ExitOnFailure(hr, "Failed to check if the Wix4HttpSniSslCert table exists"); |
| 325 | if (S_FALSE == hr) | 325 | if (S_FALSE == hr) |
| 326 | { | 326 | { |
| 327 | WcaLog(LOGMSG_STANDARD, "WixHttpSniSslCert table doesn't exist, so there are no URL reservations to configure"); | 327 | WcaLog(LOGMSG_STANDARD, "Wix4HttpSniSslCert table doesn't exist, so there are no URL reservations to configure"); |
| 328 | ExitFunction(); | 328 | ExitFunction(); |
| 329 | } | 329 | } |
| 330 | 330 | ||
| 331 | // Query and loop through all the SNI SSL certificates. | 331 | // Query and loop through all the SNI SSL certificates. |
| 332 | hr = WcaOpenExecuteView(vcsWixHttpSniSslCertQuery, &hView); | 332 | hr = WcaOpenExecuteView(vcsWixHttpSniSslCertQuery, &hView); |
| 333 | ExitOnFailure(hr, "Failed to open view on the WixHttpSniSslCert table"); | 333 | ExitOnFailure(hr, "Failed to open view on the Wix4HttpSniSslCert table"); |
| 334 | 334 | ||
| 335 | hr = HRESULT_FROM_WIN32(::HttpInitialize(HTTPAPI_VERSION_1, HTTP_INITIALIZE_CONFIG, NULL)); | 335 | hr = HRESULT_FROM_WIN32(::HttpInitialize(HTTPAPI_VERSION_1, HTTP_INITIALIZE_CONFIG, NULL)); |
| 336 | ExitOnFailure(hr, "Failed to initialize HTTP Server configuration"); | 336 | ExitOnFailure(hr, "Failed to initialize HTTP Server configuration"); |
| @@ -340,66 +340,66 @@ static UINT SchedHttpSniSslCerts( | |||
| 340 | while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) | 340 | while (S_OK == (hr = WcaFetchRecord(hView, &hRec))) |
| 341 | { | 341 | { |
| 342 | hr = WcaGetRecordString(hRec, hurqId, &sczId); | 342 | hr = WcaGetRecordString(hRec, hurqId, &sczId); |
| 343 | ExitOnFailure(hr, "Failed to get WixHttpSniSslCert.WixHttpSniSslCert"); | 343 | ExitOnFailure(hr, "Failed to get Wix4HttpSniSslCert.Wix4HttpSniSslCert"); |
| 344 | 344 | ||
| 345 | hr = WcaGetRecordString(hRec, hurqComponent, &sczComponent); | 345 | hr = WcaGetRecordString(hRec, hurqComponent, &sczComponent); |
| 346 | ExitOnFailure(hr, "Failed to get WixHttpSniSslCert.Component_"); | 346 | ExitOnFailure(hr, "Failed to get Wix4HttpSniSslCert.Component_"); |
| 347 | 347 | ||
| 348 | // Figure out what we're doing for this reservation, treating reinstall the same as install. | 348 | // Figure out what we're doing for this reservation, treating reinstall the same as install. |
| 349 | todoComponent = WcaGetComponentToDo(sczComponent); | 349 | todoComponent = WcaGetComponentToDo(sczComponent); |
| 350 | if ((WCA_TODO_REINSTALL == todoComponent ? WCA_TODO_INSTALL : todoComponent) != todoSched) | 350 | if ((WCA_TODO_REINSTALL == todoComponent ? WCA_TODO_INSTALL : todoComponent) != todoSched) |
| 351 | { | 351 | { |
| 352 | WcaLog(LOGMSG_STANDARD, "Component '%ls' action state (%d) doesn't match request (%d) for WixHttpSniSslCert '%ls'", sczComponent, todoComponent, todoSched, sczId); | 352 | WcaLog(LOGMSG_STANDARD, "Component '%ls' action state (%d) doesn't match request (%d) for Wix4HttpSniSslCert '%ls'", sczComponent, todoComponent, todoSched, sczId); |
| 353 | continue; | 353 | continue; |
| 354 | } | 354 | } |
| 355 | 355 | ||
| 356 | hr = WcaGetRecordFormattedString(hRec, hurqHost, &sczHost); | 356 | hr = WcaGetRecordFormattedString(hRec, hurqHost, &sczHost); |
| 357 | ExitOnFailure(hr, "Failed to get WixHttpSniSslCert.Host"); | 357 | ExitOnFailure(hr, "Failed to get Wix4HttpSniSslCert.Host"); |
| 358 | 358 | ||
| 359 | hr = WcaGetRecordFormattedInteger(hRec, hurqPort, &iPort); | 359 | hr = WcaGetRecordFormattedInteger(hRec, hurqPort, &iPort); |
| 360 | ExitOnFailure(hr, "Failed to get WixHttpSniSslCert.Port"); | 360 | ExitOnFailure(hr, "Failed to get Wix4HttpSniSslCert.Port"); |
| 361 | 361 | ||
| 362 | hr = WcaGetRecordFormattedString(hRec, hurqCertificateThumbprint, &sczCertificateThumbprint); | 362 | hr = WcaGetRecordFormattedString(hRec, hurqCertificateThumbprint, &sczCertificateThumbprint); |
| 363 | ExitOnFailure(hr, "Failed to get WixHttpSniSslCert.CertificateThumbprint"); | 363 | ExitOnFailure(hr, "Failed to get Wix4HttpSniSslCert.CertificateThumbprint"); |
| 364 | 364 | ||
| 365 | if (!sczHost || !*sczHost) | 365 | if (!sczHost || !*sczHost) |
| 366 | { | 366 | { |
| 367 | hr = E_INVALIDARG; | 367 | hr = E_INVALIDARG; |
| 368 | ExitOnFailure(hr, "Require a Host value for WixHttpSniSslCert '%ls'", sczId); | 368 | ExitOnFailure(hr, "Require a Host value for Wix4HttpSniSslCert '%ls'", sczId); |
| 369 | } | 369 | } |
| 370 | 370 | ||
| 371 | if (!iPort) | 371 | if (!iPort) |
| 372 | { | 372 | { |
| 373 | hr = E_INVALIDARG; | 373 | hr = E_INVALIDARG; |
| 374 | ExitOnFailure(hr, "Require a Port value for WixHttpSniSslCert '%ls'", sczId); | 374 | ExitOnFailure(hr, "Require a Port value for Wix4HttpSniSslCert '%ls'", sczId); |
| 375 | } | 375 | } |
| 376 | 376 | ||
| 377 | if (!sczCertificateThumbprint || !*sczCertificateThumbprint) | 377 | if (!sczCertificateThumbprint || !*sczCertificateThumbprint) |
| 378 | { | 378 | { |
| 379 | hr = E_INVALIDARG; | 379 | hr = E_INVALIDARG; |
| 380 | ExitOnFailure(hr, "Require a CertificateThumbprint value for WixHttpSniSslCert '%ls'", sczId); | 380 | ExitOnFailure(hr, "Require a CertificateThumbprint value for Wix4HttpSniSslCert '%ls'", sczId); |
| 381 | } | 381 | } |
| 382 | 382 | ||
| 383 | hr = WcaGetRecordFormattedString(hRec, hurqAppId, &sczAppId); | 383 | hr = WcaGetRecordFormattedString(hRec, hurqAppId, &sczAppId); |
| 384 | ExitOnFailure(hr, "Failed to get AppId for WixHttpSniSslCert '%ls'", sczId); | 384 | ExitOnFailure(hr, "Failed to get AppId for Wix4HttpSniSslCert '%ls'", sczId); |
| 385 | 385 | ||
| 386 | hr = WcaGetRecordFormattedString(hRec, hurqCertificateStore, &sczCertificateStore); | 386 | hr = WcaGetRecordFormattedString(hRec, hurqCertificateStore, &sczCertificateStore); |
| 387 | ExitOnFailure(hr, "Failed to get CertificateStore for WixHttpSniSslCert '%ls'", sczId); | 387 | ExitOnFailure(hr, "Failed to get CertificateStore for Wix4HttpSniSslCert '%ls'", sczId); |
| 388 | 388 | ||
| 389 | hr = WcaGetRecordInteger(hRec, hurqHandleExisting, &iHandleExisting); | 389 | hr = WcaGetRecordInteger(hRec, hurqHandleExisting, &iHandleExisting); |
| 390 | ExitOnFailure(hr, "Failed to get HandleExisting for WixHttpSniSslCert '%ls'", sczId); | 390 | ExitOnFailure(hr, "Failed to get HandleExisting for Wix4HttpSniSslCert '%ls'", sczId); |
| 391 | 391 | ||
| 392 | hr = GetSniSslCert(sczHost, iPort, &pExistingSniSslSet); | 392 | hr = GetSniSslCert(sczHost, iPort, &pExistingSniSslSet); |
| 393 | ExitOnFailure(hr, "Failed to get the existing SNI SSL certificate for WixHttpSniSslCert '%ls'", sczId); | 393 | ExitOnFailure(hr, "Failed to get the existing SNI SSL certificate for Wix4HttpSniSslCert '%ls'", sczId); |
| 394 | 394 | ||
| 395 | hr = EnsureAppId(&sczAppId, pExistingSniSslSet); | 395 | hr = EnsureAppId(&sczAppId, pExistingSniSslSet); |
| 396 | ExitOnFailure(hr, "Failed to ensure AppId for WixHttpSniSslCert '%ls'", sczId); | 396 | ExitOnFailure(hr, "Failed to ensure AppId for Wix4HttpSniSslCert '%ls'", sczId); |
| 397 | 397 | ||
| 398 | hr = WriteExistingSniSslCert(todoComponent, sczId, sczHost, iPort, iHandleExisting, pExistingSniSslSet, &sczRollbackCustomActionData); | 398 | hr = WriteExistingSniSslCert(todoComponent, sczId, sczHost, iPort, iHandleExisting, pExistingSniSslSet, &sczRollbackCustomActionData); |
| 399 | ExitOnFailure(hr, "Failed to write rollback custom action data for WixHttpSniSslCert '%ls'", sczId); | 399 | ExitOnFailure(hr, "Failed to write rollback custom action data for Wix4HttpSniSslCert '%ls'", sczId); |
| 400 | 400 | ||
| 401 | hr = WriteSniSslCert(todoComponent, sczId, sczHost, iPort, iHandleExisting, sczCertificateThumbprint, sczAppId, sczCertificateStore, &sczCustomActionData); | 401 | hr = WriteSniSslCert(todoComponent, sczId, sczHost, iPort, iHandleExisting, sczCertificateThumbprint, sczAppId, sczCertificateStore, &sczCustomActionData); |
| 402 | ExitOnFailure(hr, "Failed to write custom action data for WixHttpSniSslCert '%ls'", sczId); | 402 | ExitOnFailure(hr, "Failed to write custom action data for Wix4HttpSniSslCert '%ls'", sczId); |
| 403 | ++cCertificates; | 403 | ++cCertificates; |
| 404 | 404 | ||
| 405 | ReleaseNullMem(pExistingSniSslSet); | 405 | ReleaseNullMem(pExistingSniSslSet); |
| @@ -410,7 +410,7 @@ static UINT SchedHttpSniSslCerts( | |||
| 410 | { | 410 | { |
| 411 | hr = S_OK; | 411 | hr = S_OK; |
| 412 | } | 412 | } |
| 413 | ExitOnFailure(hr, "Failure occurred while processing WixHttpSniSslCert table"); | 413 | ExitOnFailure(hr, "Failure occurred while processing Wix4HttpSniSslCert table"); |
| 414 | 414 | ||
| 415 | // Schedule ExecHttpSniSslCerts if there's anything to do. | 415 | // Schedule ExecHttpSniSslCerts if there's anything to do. |
| 416 | if (cCertificates) | 416 | if (cCertificates) |
| @@ -475,16 +475,16 @@ static HRESULT WriteExistingSniSslCert( | |||
| 475 | if (pSniSslSet) | 475 | if (pSniSslSet) |
| 476 | { | 476 | { |
| 477 | hr = StrAllocHexEncode(reinterpret_cast<BYTE*>(pSniSslSet->ParamDesc.pSslHash), pSniSslSet->ParamDesc.SslHashLength, &sczCertificateThumbprint); | 477 | hr = StrAllocHexEncode(reinterpret_cast<BYTE*>(pSniSslSet->ParamDesc.pSslHash), pSniSslSet->ParamDesc.SslHashLength, &sczCertificateThumbprint); |
| 478 | ExitOnFailure(hr, "Failed to convert existing certificate thumbprint to hex for WixHttpSniSslCert '%ls'", wzId); | 478 | ExitOnFailure(hr, "Failed to convert existing certificate thumbprint to hex for Wix4HttpSniSslCert '%ls'", wzId); |
| 479 | 479 | ||
| 480 | hr = StringFromGuid(pSniSslSet->ParamDesc.AppId, &sczAppId); | 480 | hr = StringFromGuid(pSniSslSet->ParamDesc.AppId, &sczAppId); |
| 481 | ExitOnFailure(hr, "Failed to copy existing AppId for WixHttpSniSslCert '%ls'", wzId); | 481 | ExitOnFailure(hr, "Failed to copy existing AppId for Wix4HttpSniSslCert '%ls'", wzId); |
| 482 | 482 | ||
| 483 | wzCertificateStore = pSniSslSet->ParamDesc.pSslCertStoreName; | 483 | wzCertificateStore = pSniSslSet->ParamDesc.pSslCertStoreName; |
| 484 | } | 484 | } |
| 485 | 485 | ||
| 486 | hr = WriteSniSslCert(action, wzId, wzHost, iPort, iHandleExisting, sczCertificateThumbprint ? sczCertificateThumbprint : L"", sczAppId ? sczAppId : L"", wzCertificateStore ? wzCertificateStore : L"", psczCustomActionData); | 486 | hr = WriteSniSslCert(action, wzId, wzHost, iPort, iHandleExisting, sczCertificateThumbprint ? sczCertificateThumbprint : L"", sczAppId ? sczAppId : L"", wzCertificateStore ? wzCertificateStore : L"", psczCustomActionData); |
| 487 | ExitOnFailure(hr, "Failed to write custom action data for WixHttpSniSslCert '%ls'", wzId); | 487 | ExitOnFailure(hr, "Failed to write custom action data for Wix4HttpSniSslCert '%ls'", wzId); |
| 488 | 488 | ||
| 489 | LExit: | 489 | LExit: |
| 490 | ReleaseStr(sczAppId); | 490 | ReleaseStr(sczAppId); |
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) |
diff --git a/src/test/WixToolsetTest.Http/HttpExtensionFixture.cs b/src/test/WixToolsetTest.Http/HttpExtensionFixture.cs index 1d350bdf..40b49327 100644 --- a/src/test/WixToolsetTest.Http/HttpExtensionFixture.cs +++ b/src/test/WixToolsetTest.Http/HttpExtensionFixture.cs | |||
| @@ -15,7 +15,7 @@ namespace WixToolsetTest.Http | |||
| 15 | var folder = TestData.Get("TestData", "SniSsl"); | 15 | var folder = TestData.Get("TestData", "SniSsl"); |
| 16 | var build = new Builder(folder, typeof(HttpExtensionFactory), new[] { folder }); | 16 | var build = new Builder(folder, typeof(HttpExtensionFactory), new[] { folder }); |
| 17 | 17 | ||
| 18 | var results = build.BuildAndQuery(Build, "CustomAction", "WixHttpSniSslCert"); | 18 | var results = build.BuildAndQuery(Build, "CustomAction", "Wix4HttpSniSslCert"); |
| 19 | WixAssert.CompareLineByLine(new[] | 19 | WixAssert.CompareLineByLine(new[] |
| 20 | { | 20 | { |
| 21 | "CustomAction:Wix4ExecHttpSniSslCertsInstall_X86\t3073\tWix4HttpCA_X86\tExecHttpSniSslCerts\t", | 21 | "CustomAction:Wix4ExecHttpSniSslCertsInstall_X86\t3073\tWix4HttpCA_X86\tExecHttpSniSslCerts\t", |
| @@ -24,7 +24,7 @@ namespace WixToolsetTest.Http | |||
| 24 | "CustomAction:Wix4RollbackHttpSniSslCertsUninstall_X86\t3329\tWix4HttpCA_X86\tExecHttpSniSslCerts\t", | 24 | "CustomAction:Wix4RollbackHttpSniSslCertsUninstall_X86\t3329\tWix4HttpCA_X86\tExecHttpSniSslCerts\t", |
| 25 | "CustomAction:Wix4SchedHttpSniSslCertsInstall_X86\t1\tWix4HttpCA_X86\tSchedHttpSniSslCertsInstall\t", | 25 | "CustomAction:Wix4SchedHttpSniSslCertsInstall_X86\t1\tWix4HttpCA_X86\tSchedHttpSniSslCertsInstall\t", |
| 26 | "CustomAction:Wix4SchedHttpSniSslCertsUninstall_X86\t1\tWix4HttpCA_X86\tSchedHttpSniSslCertsUninstall\t", | 26 | "CustomAction:Wix4SchedHttpSniSslCertsUninstall_X86\t1\tWix4HttpCA_X86\tSchedHttpSniSslCertsUninstall\t", |
| 27 | "WixHttpSniSslCert:sslC9YX6_H7UL_WGBx4DoDGI.Sj.D0\texample.com\t8080\t[SOME_THUMBPRINT]\t\t\t2\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo", | 27 | "Wix4HttpSniSslCert:sslC9YX6_H7UL_WGBx4DoDGI.Sj.D0\texample.com\t8080\t[SOME_THUMBPRINT]\t\t\t2\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo", |
| 28 | }, results); | 28 | }, results); |
| 29 | } | 29 | } |
| 30 | 30 | ||
| @@ -34,7 +34,7 @@ namespace WixToolsetTest.Http | |||
| 34 | var folder = TestData.Get(@"TestData\UsingUrlReservation"); | 34 | var folder = TestData.Get(@"TestData\UsingUrlReservation"); |
| 35 | var build = new Builder(folder, typeof(HttpExtensionFactory), new[] { folder }); | 35 | var build = new Builder(folder, typeof(HttpExtensionFactory), new[] { folder }); |
| 36 | 36 | ||
| 37 | var results = build.BuildAndQuery(Build, "CustomAction", "WixHttpUrlAce", "WixHttpUrlReservation"); | 37 | var results = build.BuildAndQuery(Build, "CustomAction", "Wix4HttpUrlAce", "Wix4HttpUrlReservation"); |
| 38 | WixAssert.CompareLineByLine(new[] | 38 | WixAssert.CompareLineByLine(new[] |
| 39 | { | 39 | { |
| 40 | "CustomAction:Wix4ExecHttpUrlReservationsInstall_X86\t3073\tWix4HttpCA_X86\tExecHttpUrlReservations\t", | 40 | "CustomAction:Wix4ExecHttpUrlReservationsInstall_X86\t3073\tWix4HttpCA_X86\tExecHttpUrlReservations\t", |
| @@ -43,8 +43,8 @@ namespace WixToolsetTest.Http | |||
| 43 | "CustomAction:Wix4RollbackHttpUrlReservationsUninstall_X86\t3329\tWix4HttpCA_X86\tExecHttpUrlReservations\t", | 43 | "CustomAction:Wix4RollbackHttpUrlReservationsUninstall_X86\t3329\tWix4HttpCA_X86\tExecHttpUrlReservations\t", |
| 44 | "CustomAction:Wix4SchedHttpUrlReservationsInstall_X86\t1\tWix4HttpCA_X86\tSchedHttpUrlReservationsInstall\t", | 44 | "CustomAction:Wix4SchedHttpUrlReservationsInstall_X86\t1\tWix4HttpCA_X86\tSchedHttpUrlReservationsInstall\t", |
| 45 | "CustomAction:Wix4SchedHttpUrlReservationsUninstall_X86\t1\tWix4HttpCA_X86\tSchedHttpUrlReservationsUninstall\t", | 45 | "CustomAction:Wix4SchedHttpUrlReservationsUninstall_X86\t1\tWix4HttpCA_X86\tSchedHttpUrlReservationsUninstall\t", |
| 46 | "WixHttpUrlAce:aceu5os2gQoblRmzwjt85LQf997uD4\turlO23FkY2xzEY54lY6E6sXFW6glXc\tNT SERVICE\\TestService\t268435456", | 46 | "Wix4HttpUrlAce:aceu5os2gQoblRmzwjt85LQf997uD4\turlO23FkY2xzEY54lY6E6sXFW6glXc\tNT SERVICE\\TestService\t268435456", |
| 47 | "WixHttpUrlReservation:urlO23FkY2xzEY54lY6E6sXFW6glXc\t0\t\thttp://+:80/vroot/\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo", | 47 | "Wix4HttpUrlReservation:urlO23FkY2xzEY54lY6E6sXFW6glXc\t0\t\thttp://+:80/vroot/\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo", |
| 48 | }, results); | 48 | }, results); |
| 49 | } | 49 | } |
| 50 | 50 | ||
diff --git a/src/wixext/HttpTableDefinitions.cs b/src/wixext/HttpTableDefinitions.cs index 83cd565a..431b9a33 100644 --- a/src/wixext/HttpTableDefinitions.cs +++ b/src/wixext/HttpTableDefinitions.cs | |||
| @@ -7,11 +7,11 @@ namespace WixToolset.Http | |||
| 7 | public static class HttpTableDefinitions | 7 | public static class HttpTableDefinitions |
| 8 | { | 8 | { |
| 9 | public static readonly TableDefinition WixHttpSniSslCert = new TableDefinition( | 9 | public static readonly TableDefinition WixHttpSniSslCert = new TableDefinition( |
| 10 | "WixHttpSniSslCert", | 10 | "Wix4HttpSniSslCert", |
| 11 | HttpSymbolDefinitions.WixHttpSniSslCert, | 11 | HttpSymbolDefinitions.WixHttpSniSslCert, |
| 12 | new[] | 12 | new[] |
| 13 | { | 13 | { |
| 14 | new ColumnDefinition("WixHttpSniSslCert", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "The non-localized primary key for the table.", modularizeType: ColumnModularizeType.Column), | 14 | new ColumnDefinition("Wix4HttpSniSslCert", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "The non-localized primary key for the table.", modularizeType: ColumnModularizeType.Column), |
| 15 | new ColumnDefinition("Host", ColumnType.String, 0, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "Host for the SNI SSL certificate.", modularizeType: ColumnModularizeType.Property), | 15 | new ColumnDefinition("Host", ColumnType.String, 0, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "Host for the SNI SSL certificate.", modularizeType: ColumnModularizeType.Property), |
| 16 | new ColumnDefinition("Port", ColumnType.String, 0, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "Port for the SNI SSL certificate.", modularizeType: ColumnModularizeType.Property), | 16 | new ColumnDefinition("Port", ColumnType.String, 0, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "Port for the SNI SSL certificate.", modularizeType: ColumnModularizeType.Property), |
| 17 | new ColumnDefinition("Thumbprint", ColumnType.String, 0, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "humbprint of the SNI SSL certificate to find.", modularizeType: ColumnModularizeType.Property), | 17 | new ColumnDefinition("Thumbprint", ColumnType.String, 0, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "humbprint of the SNI SSL certificate to find.", modularizeType: ColumnModularizeType.Property), |
| @@ -24,11 +24,11 @@ namespace WixToolset.Http | |||
| 24 | ); | 24 | ); |
| 25 | 25 | ||
| 26 | public static readonly TableDefinition WixHttpUrlReservation = new TableDefinition( | 26 | public static readonly TableDefinition WixHttpUrlReservation = new TableDefinition( |
| 27 | "WixHttpUrlReservation", | 27 | "Wix4HttpUrlReservation", |
| 28 | HttpSymbolDefinitions.WixHttpUrlReservation, | 28 | HttpSymbolDefinitions.WixHttpUrlReservation, |
| 29 | new[] | 29 | new[] |
| 30 | { | 30 | { |
| 31 | new ColumnDefinition("WixHttpUrlReservation", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "The non-localized primary key for the table.", modularizeType: ColumnModularizeType.Column), | 31 | new ColumnDefinition("Wix4HttpUrlReservation", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "The non-localized primary key for the table.", modularizeType: ColumnModularizeType.Column), |
| 32 | new ColumnDefinition("HandleExisting", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 0, maxValue: 2, description: "The behavior when trying to install a URL reservation and it already exists."), | 32 | new ColumnDefinition("HandleExisting", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 0, maxValue: 2, description: "The behavior when trying to install a URL reservation and it already exists."), |
| 33 | new ColumnDefinition("Sddl", ColumnType.String, 0, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "Security descriptor for the URL reservation.", modularizeType: ColumnModularizeType.Property), | 33 | new ColumnDefinition("Sddl", ColumnType.String, 0, primaryKey: false, nullable: true, ColumnCategory.Formatted, description: "Security descriptor for the URL reservation.", modularizeType: ColumnModularizeType.Property), |
| 34 | new ColumnDefinition("Url", ColumnType.String, 0, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "URL to be reserved.", modularizeType: ColumnModularizeType.Property), | 34 | new ColumnDefinition("Url", ColumnType.String, 0, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "URL to be reserved.", modularizeType: ColumnModularizeType.Property), |
| @@ -38,11 +38,11 @@ namespace WixToolset.Http | |||
| 38 | ); | 38 | ); |
| 39 | 39 | ||
| 40 | public static readonly TableDefinition WixHttpUrlAce = new TableDefinition( | 40 | public static readonly TableDefinition WixHttpUrlAce = new TableDefinition( |
| 41 | "WixHttpUrlAce", | 41 | "Wix4HttpUrlAce", |
| 42 | HttpSymbolDefinitions.WixHttpUrlAce, | 42 | HttpSymbolDefinitions.WixHttpUrlAce, |
| 43 | new[] | 43 | new[] |
| 44 | { | 44 | { |
| 45 | new ColumnDefinition("WixHttpUrlAce", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "The non-localized primary key for the table.", modularizeType: ColumnModularizeType.Column), | 45 | new ColumnDefinition("Wix4HttpUrlAce", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "The non-localized primary key for the table.", modularizeType: ColumnModularizeType.Column), |
| 46 | new ColumnDefinition("WixHttpUrlReservation_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "WixHttpUrlReservation", keyColumn: 1, description: "Foreign key into the WixHttpUrlReservation table.", modularizeType: ColumnModularizeType.Column), | 46 | new ColumnDefinition("WixHttpUrlReservation_", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "WixHttpUrlReservation", keyColumn: 1, description: "Foreign key into the WixHttpUrlReservation table.", modularizeType: ColumnModularizeType.Column), |
| 47 | new ColumnDefinition("SecurityPrincipal", ColumnType.String, 0, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "The security principal for this ACE.", modularizeType: ColumnModularizeType.Property), | 47 | new ColumnDefinition("SecurityPrincipal", ColumnType.String, 0, primaryKey: false, nullable: false, ColumnCategory.Formatted, description: "The security principal for this ACE.", modularizeType: ColumnModularizeType.Property), |
| 48 | new ColumnDefinition("Rights", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 0, maxValue: 1073741824, description: "The rights for this ACE."), | 48 | new ColumnDefinition("Rights", ColumnType.Number, 4, primaryKey: false, nullable: false, ColumnCategory.Unknown, minValue: 0, maxValue: 1073741824, description: "The rights for this ACE."), |
