Platform SDK: Network Management |
The NetFileGetInfo function retrieves information about a particular opening of a server resource.
Only members of the Administrators or Account Operators local group can successfully execute the NetFileGetInfo function.
NET_API_STATUS NetFileGetInfo( LPWSTR servername, DWORD fileid, DWORD level, LPBYTE *bufptr );
Value | Meaning |
---|---|
2 | Return the file identification number. The bufptr parameter is a pointer to a FILE_INFO_2 structure. |
3 | Return the file identification number and other information about the file. The bufptr parameter is a pointer to a FILE_INFO_3 structure. |
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. |
ERROR_INVALID_LEVEL | The value specified for the level parameter is invalid. |
ERROR_NOT_ENOUGH_MEMORY | Insufficient memory is available. |
NERR_BufTooSmall | The supplied buffer is too small. |
You can call the NetFileEnum function to retrieve information about multiple files open on a server.
If you are programming for Active Directory, you may be able to call certain Active Directory Service Interface (ADSI) methods to achieve the same functionality you can achieve by calling NetFileGetInfo. For more information, see IADsResource and IADsFileServiceOperations.
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.
Network Management Overview, Network Management Functions, NetFile Functions, FILE_INFO_2, FILE_INFO_3, NetFileEnum