| 1 | # WslcImportSessionImageFromFile |
| 2 | |
| 3 | ```c |
| 4 | STDAPI WslcImportSessionImageFromFile( |
| 5 | _In_ WslcSession session, _In_z_ PCSTR imageName, _In_z_ PCWSTR path, _In_opt_ const WslcImportImageOptions* options, _Outptr_opt_result_z_ PWSTR* errorMessage); |
| 6 | ``` |
| 7 | |
| 8 | | Parameter | Type | Direction | |
| 9 | |---|---|---| |
| 10 | | `session` | `WslcSession` | in | |
| 11 | | `imageName` | `PCSTR` | in | |
| 12 | | `path` | `PCWSTR` | in | |
| 13 | | `options` | `const WslcImportImageOptions*` | in, optional | |
| 14 | | `errorMessage` | `PWSTR*` | out, optional | |
| 15 | |
| 16 | Return value: `HRESULT`. |
| 17 | |
| 18 | Example: |
| 19 | |
| 20 | ```c |
| 21 | WslcImportImageOptions importOptions = { 0 }; |
| 22 | HRESULT hr = WslcImportSessionImageFromFile( |
| 23 | session, |
| 24 | "demo/imported:latest", |
| 25 | L"C:\\images\\demo-import.tar", |
| 26 | &importOptions, |
| 27 | NULL); |
| 28 | ``` |