Share via


INetCfgLock::IsWriteLocked method

The IsWriteLocked method indicates whether network configuration is currently locked and, when it is, returns the name of the client that currently controls network configuration.

Syntax

HRESULT IsWriteLocked(
  [out] LPWSTR *ppszwClientDescription
);

Parameters

  • ppszwClientDescription [out]
    Pointer to a buffer that receives a constant null-terminated string of 16-bit Unicode characters. If the operating system previously granted the lock on network configuration, this parameter points to the name of the client that currently controls network configuration. If the operating system has not granted the lock on network configuration, this parameter points to a NULL value.

Return value

Returns zero (S_OK) if successful, indicating that the operating system granted the lock to another client, and returns S_FALSE if the operating system has not granted the lock to any clients. Otherwise, returns NETCFG_* codes that are defined in Netcfgx.h.

Remarks

If a call to IsWriteLocked returns the name of the client that already has control of network configuration at ppszwClientDescription, IsWriteLocked allocates the memory required to store the string that contains the name. After applications finish with the name, they must call the COM CoTaskMemFree function to release the memory. For more information about CoTaskMemFree, see the Microsoft Windows SDK.

Requirements

Target platform

Desktop

Header

Netcfgx.h (include Netcfgx.h)

 

 

Send comments about this topic to Microsoft