Platform SDK: Network Management

NetFileClose

The NetFileClose function forces a resource to close. This function can be used when an error prevents closure by any other means. You should use NetFileClose with caution because it does not write data cached on the client system to the file before closing the file.

Security Requirements

Only members of the Administrators or Account Operators local group can successfully execute the NetFileClose function.

NET_API_STATUS NetFileClose(
  LPWSTR servername,     
  DWORD fileid          
);

Parameters

servername
[in] Pointer to a Unicode string specifying the name of the remote server on which the function is to execute. The string must begin with \\. If this parameter is NULL, the local computer is used.
fileid
[in] Specifies the file identifier of the opened resource instance to close.

Return Values

If the function succeeds, the return value is NERR_Success.

If the function fails, the return value can be one of the following error codes.

Value Meaning
ERROR_ACCESS_DENIED The user does not have access to the requested information.
ERROR_FILE_NOT_FOUND The file was not found.

Requirements

  Windows NT/2000: Requires Windows NT 3.1 or later.
  Windows 95/98: Unsupported.
  Header: Declared in Lmshare.h; include Lm.h.
  Library: Use Netapi32.lib.

See Also

Network Management Overview, Network Management Functions, NetFile Functions