diff options
| author | Sean Hall <r.sean.hall@gmail.com> | 2018-12-16 21:19:24 -0600 |
|---|---|---|
| committer | Sean Hall <r.sean.hall@gmail.com> | 2018-12-16 21:20:40 -0600 |
| commit | 95a5a8f9efef02ddcec5b3f69be99a00d71a802a (patch) | |
| tree | f0a92b8e8e37e17af6053db11f1b8a7a532cd12c /src/ca/scamimemap7.cpp | |
| parent | aec6e9a4b21accd2e8aeb2cb36ad1cdc8f308f79 (diff) | |
| download | wix-95a5a8f9efef02ddcec5b3f69be99a00d71a802a.tar.gz wix-95a5a8f9efef02ddcec5b3f69be99a00d71a802a.tar.bz2 wix-95a5a8f9efef02ddcec5b3f69be99a00d71a802a.zip | |
Import implementation of IisCA from old repo's scasched/scaexec.
Diffstat (limited to 'src/ca/scamimemap7.cpp')
| -rw-r--r-- | src/ca/scamimemap7.cpp | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/src/ca/scamimemap7.cpp b/src/ca/scamimemap7.cpp new file mode 100644 index 00000000..f6689720 --- /dev/null +++ b/src/ca/scamimemap7.cpp | |||
| @@ -0,0 +1,68 @@ | |||
| 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 | |||
| 5 | // prototypes | ||
| 6 | HRESULT ScaWriteMimeMap7( | ||
| 7 | __in_z LPCWSTR wzWebName, | ||
| 8 | __in_z LPCWSTR wzRootOfWeb, | ||
| 9 | SCA_MIMEMAP* psmmList | ||
| 10 | ) | ||
| 11 | { | ||
| 12 | HRESULT hr = S_OK; | ||
| 13 | SCA_MIMEMAP* psmm; | ||
| 14 | |||
| 15 | //create the mimemap list for this vdir application | ||
| 16 | //all go to same web/root location tag | ||
| 17 | hr = ScaWriteConfigID(IIS_MIMEMAP_BEGIN); | ||
| 18 | ExitOnFailure(hr, "Failed to write mimemap begin id"); | ||
| 19 | hr = ScaWriteConfigString(wzWebName); //site name key | ||
| 20 | ExitOnFailure(hr, "Failed to write mimemap web key"); | ||
| 21 | hr = ScaWriteConfigString(wzRootOfWeb); //app path key | ||
| 22 | ExitOnFailure(hr, "Failed to write mimemap app key"); | ||
| 23 | |||
| 24 | psmm = psmmList; | ||
| 25 | |||
| 26 | while (psmm) | ||
| 27 | { | ||
| 28 | //create the Extension for this vdir application | ||
| 29 | hr = ScaWriteConfigID(IIS_MIMEMAP); | ||
| 30 | ExitOnFailure(hr, "Failed to write mimemap id"); | ||
| 31 | |||
| 32 | if (*psmm->wzExtension) | ||
| 33 | { | ||
| 34 | hr = ScaWriteConfigString(psmm->wzExtension); | ||
| 35 | } | ||
| 36 | else // blank means "*" (all) | ||
| 37 | { | ||
| 38 | hr = ScaWriteConfigString(L"*"); | ||
| 39 | } | ||
| 40 | ExitOnFailure(hr, "Failed to write mimemap extension"); | ||
| 41 | |||
| 42 | hr = ScaWriteConfigString(psmm->wzMimeType); | ||
| 43 | ExitOnFailure(hr, "Failed to write mimemap type"); | ||
| 44 | |||
| 45 | psmm = psmm->psmmNext; | ||
| 46 | } | ||
| 47 | |||
| 48 | hr = ScaWriteConfigID(IIS_MIMEMAP_END); | ||
| 49 | ExitOnFailure(hr, "Failed to write mimemap end id"); | ||
| 50 | |||
| 51 | LExit: | ||
| 52 | return hr; | ||
| 53 | } | ||
| 54 | |||
| 55 | |||
| 56 | //static HRESULT AddMimeMapToList(SCA_MIMEMAP** ppsmmList) | ||
| 57 | //{ | ||
| 58 | // HRESULT hr = S_OK; | ||
| 59 | // | ||
| 60 | // SCA_MIMEMAP* psmm = static_cast<SCA_MIMEMAP*>(MemAlloc(sizeof(SCA_MIMEMAP), TRUE)); | ||
| 61 | // ExitOnNull(psmm, hr, E_OUTOFMEMORY, "failed to allocate memory for new mime map list element"); | ||
| 62 | // | ||
| 63 | // psmm->psmmNext = *ppsmmList; | ||
| 64 | // *ppsmmList = psmm; | ||
| 65 | // | ||
| 66 | //LExit: | ||
| 67 | // return hr; | ||
| 68 | //} | ||
