Edit

HcnCreateGuestNetworkService

Description

Creates a guest network service.

Syntax

HRESULT
WINAPI
HcnCreateGuestNetworkService(
    _In_ REFGUID Id,
    _In_ PCWSTR Settings,
    _Out_ PHCN_GUESTNETWORKSERVICE GuestNetworkService,
    _Outptr_opt_ PWSTR* ErrorRecord
    );

Parameters

Id

Id for the new guest network service.

Settings

JSON document specifying the settings of the guest network service.

GuestNetworkService

Receives a handle to the newly created guest network service. It is the responsibility of the caller to release the handle using HcnCloseGuestNetworkService once it is no longer in use.

ErrorRecord

Receives a JSON document with extended errorCode information. The caller must release the buffer using CoTaskMemFree.

Return Values

The function returns HRESULT.

Requirements

Parameter Description
Minimum supported client Windows 10, version 1809
Minimum supported server Windows Server 2019
Target Platform Windows
Header ComputeNetwork.h
Library ComputeNetwork.lib
Dll ComputeNetwork.dll