Platform SDK: Network Management

NetFileClose2

Windows 95/98: The NetFileClose2 function forces a resource to close. This function can be used when an error prevents closure by any other means.

Windows NT/2000: This function is not supported on Windows NT/Windows 2000. Use the NetFileClose function instead.

Security Requirements

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

extern API_FUNCTION
 NetFileClose2(
  const char FAR * pszServer, 
  unsigned long ulFileId      
);

Parameters

pszServer
[in] Pointer to an ASCIIZ 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.
ulFileId
[in] Specifies the file identifier of the resource instance to close. You can retrieve this value by calling the NetFileEnum function.

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.
NERR_NetNotStarted The workstation driver is not installed.
NERR_ServerNotStarted The Server service is not started.
NERR_RemoteErr A remote API error occurred.
NERR_FileIdNotFound There is not an open file with the specified identification number.

Remarks

The NetFileClose2 function supports file handles that are larger than 64 kilobytes.

Requirements

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

See Also

Network Management Overview, Network Management Functions, NetFile Functions, NetFileEnum