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.

Syntax


NET_API_STATUS NetFileClose(
  _In_ LMSTR servername,
  _In_ DWORD fileid
);

Parameters

servername [in]

Pointer to a string that specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this parameter is NULL, the local computer is used.

This string is Unicode if _WIN32_WINNT or FORCE_UNICODE is defined.

fileid [in]

Specifies the file identifier of the opened resource instance to close.

Return value

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.

Return codeDescription
ERROR_ACCESS_DENIED

The user does not have access to the requested information.

ERROR_FILE_NOT_FOUND

The file was not found.

 

Remarks

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

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Lmshare.h (include Lm.h)

Library

Netapi32.lib

DLL

Netapi32.dll

See also

Network Management Overview
Network Management Functions
NetFile Functions

 

 

Community Additions

ADD
Show: