| 1 | # WslcSetContainerSettingsPortMappings |
| 2 | |
| 3 | ```c |
| 4 | STDAPI WslcSetContainerSettingsPortMappings( |
| 5 | _In_ WslcContainerSettings* containerSettings, |
| 6 | _In_reads_opt_(portMappingCount) const WslcContainerPortMapping* portMappings, |
| 7 | _In_ uint32_t portMappingCount); |
| 8 | ``` |
| 9 | |
| 10 | | Parameter | Type | Direction | |
| 11 | |---|---|---| |
| 12 | | `containerSettings` | `WslcContainerSettings*` | in | |
| 13 | | `portMappings` | `const WslcContainerPortMapping*` | in, optional | |
| 14 | | `portMappingCount` | `uint32_t` | in | |
| 15 | |
| 16 | Return value: `HRESULT`. |
| 17 | |
| 18 | Example: |
| 19 | |
| 20 | ```c |
| 21 | WslcContainerPortMapping portMappings[1] = { 0 }; |
| 22 | portMappings[0].windowsPort = (uint16_t)8080; |
| 23 | portMappings[0].containerPort = (uint16_t)80; |
| 24 | portMappings[0].protocol = WSLC_PORT_PROTOCOL_TCP; |
| 25 | portMappings[0].windowsAddress = NULL; |
| 26 | |
| 27 | HRESULT hr = WslcSetContainerSettingsPortMappings( |
| 28 | &containerSettings, |
| 29 | portMappings, |
| 30 | (uint32_t)_countof(portMappings)); |
| 31 | ``` |