Microsoft Win32 API calls
supported by
Network Appliance filers

          

The following Win32 API calls are supported on Network Appliance filers running CIFS. This list is Network Appliance confidential. Third parties may not share it with other 3rd parties.

Caution: While we have attempted to be complete here, this is almost certainly a partial listing. There is no one-to-one relationship between Win32 APIs and the calls the filer sees on the wire from the client, so it is difficult to enumerate for sure all the APIs that work. The best way to tell if a routine not mentioned here is supported is to add a call to it into previously working code, and see if the call succeeds or not. Please send any needed corrections you may discover to sdk-feedback@netapp.com.

The authoritative source of information for every routine mentioned herein is the MSDN article(s) pertaining to that routine. Failure of the filer to obey the semantics given in Microsoft's documentation is nearly always a bug, and should be reported as such.

Note: Win32 and Windows are trademarks of Microsoft Corporation.


File I/O calls

 

Win32 routines Native Win32 calls
  CreateFile Open (or create) a file
  CreateFileForMapping Open a file for memory mapping. This call looks to the server like CreateFile(); the client does the memory mapping. There are numerous other routines related to memory mapping not listed here.
     CloseHandle Close a stream
  CopyFile Copy a file
  CopyFileEx Extended copy
  CreateDirectory Create a directory
  CreateDirectoryEx Extended directory create
  DeleteFile Delete a file
  FlushFileBuffers Flush a file's memory buffers to disk
  GetDiskFreeSpace Get info about a logical drive, which might possibly be a network drive mounted on a remote server
  GetDiskFreeSpaceEx  
  GetFileAttributes Get file attributes
  GetFileAttributesEx  
  GetFileInformationByHandle Get info about a file from its HANDLE
  GetFileSecurity Get NT file permissions (ACEs on an ACL, i.e. Access Control Entries on an Access Control List)
  GetFileSize Size of file
  GetFileSizeEx  
  LockFile Lock a range or all of a file
  LockFileEx  
  MoveFile Move a file from one place to another, swapping pointers if possible and copying if necessary
  MoveFileEx  
  MoveFileWithProgress The client actually does the progress indication based on the write size and what GetFileSize() says the amount to be written is
  ReadDirectoryChangesW Set change-notify status on a directory
  ReadFile Read part or all of a file
  ReadFileEx  
  ReadFileScatter  
  RemoveDirectory Remove an empty directory
  ReplaceFile Replace one file with another, possibly backing up the replaced file first
  SetFileAttributes File setattr
  SetFileSecurity Set NT file permissions (ACEs on an ACL, i.e. Access Control Entries on an Access Control List)
  SetFileShortName Set the DOS 8.3 name of a file
  UnlockFile Unlock a byte range or whole file lock
  UnlockFileEx  
  WriteFile Write to a file
  WriteFileEx  
  WriteFileGather  

 

FILE* routines ANSI calls FILE*s "streams". These are not the same thing as NTFS streams, though an NTFS stream may be opened as an ANSI stream by using <filename>:<streamname> notation.
  fopen _tfopen _wfopen Open (or create) a file
  freopen _tfreopen _wfreopen Reassign a file pointer
     fclose _tfclose _wfclose Close a stream
  _fcloseall     Close all open streams
    _tfdopen _wfdopen Associate a stream with a file that was previously opened for low-level I/O
  fsetpos     Set the stream-position indicator
  fread     Read data from a stream (an ANSI stream, a FILE*, not an NTFS stream)
  fwrite     Write data to a stream
  fgetc _fgettc fgetwc Get a character from a stream
  fputc _fputtc fputwc Put a character to a stream
  fgets _fgetts fgetws Get a string from a stream
  rewind     Reset the file pointer to the beginning of the file
  fprintf _ftprintf fwprintf Formatted print to file
  vfprintf _vftprintf vfwprintf Formatted print to file using varargs list
  fflush     Flush stream buffers to file
  _flushall     Flush all open streams
  fseek     Set file pointer to a specified position
  _fdopen _tfdopen _wfdopen Associate a stream with a file previously opened for low-level I/O
  _popen _tpopen _wpopen Open a pipe
  _sopen _tsopen _wsopen Open a file for sharing
  _fsopen _tfsopen _wfsopen Open a stream for sharing

 

Filehandle routines    
     _creat _tcreat _wcreat Create a file
  _read     Read from a file
     _write     Write to a file
  _close     Close a file
  _lseek     Seek to a specified offset
  _lseeki64     Seek to a 64-bit offset
  _tell     Get current file offset
  _telli64     Get offset as a 64-bit integer (__int64)
  _filelength     Get length of file
  _filelengthi64     Get length of file as 64-bit integer
  _fstat     Get stat info about file
  _fstat64     ""
  _fstati64     ""
  _chsize     Truncate file, or extend and pad with zeroes

 

File management routines  
  _mkdir _tmkdir _wmkdir Create a directory
  _rmdir _trmdir _wrmdir Remove a directory
     rename _trename _wrename Rename a file or directory
  _unlink _tunlink _wunlink Delete a file
  remove _tremove _wremove Delete a file
  _stat _tstat _wstat Get file stats
  _stat64 _tstat64 _wstat64 ""
  _stati64 _tstati64 _wstati64 ""
  _access _taccess _waccess Set POSIX file perms
  _chmod _tchmod _wchmod Set POSIX file perms

 

Search routines  
  FindFirstFile     Find a file using a possibly wildcarded pattern
  FindFirstFileEx     Search on attributes as well as filename
     FindNextFile     Continue a file search
  FindClose     Release buffers used by FindFirst and FindNext
  _findfirst _tfindfirst _wfindfirst Similar to FindFirstFile
  _findfirst64 _tfindfirst64 _wfindfirst64 64-bit version
  _findfirsti64 _tfindfirsti64 _wfindfirsti64 yet another 64-bit version
  _findnext _tfindnext _wfindnext Similar to FindNextFile
  _findnext64 _tfindnext64 _wfindnext64 64-bit version
  _findnexti64 _tfindnexti64 _wfindnexti64 yet another 64-bit version
  _findclose     Similar to FindClose

 

Miscellaneous routines  
        _pipe     Set up a pair of pipes for reading and writing (used prior to forking)
  _getdiskfree     Get freespace info for a logical drive

 

Obsolete routines These routines are used for backward compatibility with Win16 clients
        _hread, _hwrite, _lclose, _lcreat, _lfind, _llseek, _lopen, _lread, _lwrite, OpenFile

LSA calls

    LsaClose   see Microsoft documentation
    LsaOpenPolicy    
    LsaQueryInformationPolicy    
    LsaEnumerateTrustedDomains    
    LsaLookupNames    
    LsaLookupSids    
    LsaEnumerateAccountRights    
    LsaOpenPolicy    
    LsaGetUserName    
    LsaLookupNames2 ONTAP 7g  

Print Spooling calls

 

OpenPrinter The filer simply returns NULL here, signifying that it doesn't have any printers

Network management calls

 

       NetConnectionEnum
    NetFileEnum
    NetFileGetInfo  
    NetFileClose
    NetSessionEnum
    NetSessionDel
    NetShareAdd
    NetShareEnum
    NetShareGetInfo
    NetShareSetInfo
    NetShareDel
    NetServerGetInfo
    NetServerSetInfo
    NetServerDiskEnum
    NetServerTransportAdd
    NetServerTransportEnum
    NetServerTransportDel
    NetRemoteTOD
    NetValidateName

Local groups

     NetLocalGroupEnum
  NetLocalGroupGetInfo
  NetLocalGroupGetMembers
  NetLocalGroupAddMembers
  NetLocalGroupDelMembers
  NetLocalGroupSetMembers
  NetLocalGroupAdd
  NetLocalGroupDel

Local users (a maximum of 99 local users are permitted).

     NetQueryDisplayInformation    Note: this call works only for users, not for machines or groups
  NetUserGetInfo Information level 0 only
  NetUserGetGroups  

Service Manager calls

The filer supports the Service Manager just enough to tell Windows systems that no services are running.

  CloseServiceHandle
    OpenSCManager
    OpenService

Workstation calls

 

  NetWkstaGetInfo      levels 101, 102 in DOT 6.2, level 100 only in prior releases

Registry Manipulation routines

 

    RegOpenKeyEx    
    RegCloseKey     
    RegCreateKey    
    RegDeleteKey    
    RegDeleteValue  
    RegEnumKey   
    RegEnumValue    
    RegFlushKey     
    RegGetKeySecurity     
    RegLoadKey   
    RegOpenKey
    RegQueryInfoKey 
    RegQueryValue   
    RegReplaceKey   
    RegRestoreKey   
    RegSaveKey   
    RegSetKeySecurity  
    RegSetValue     
    RegUnLoadKey    
    RegGetVersion