INFO: Windows 95 Support for Net Function Calls

ID: Q125700

The information in this article applies to:

SUMMARY

Windows 95 supports a subset of Net function calls. This is a list of the supported functions:

  NetAccessAdd
  NetAccessCheck
  NetAccessDel
  NetAccessEnum
  NetAccessGetInfo
  NetAccessGetUserPerms
  NetAccessSetInfo
  NetConnectionEnum
  NetFileClose2
  NetFileEnum
  NetSecurityGetInfo
  NetServerGetInfo
  NetServerSetInfo
  NetSessionDel
  NetSessionEnum
  NetSessionGetInfo
  NetShareAdd
  NetShareDel
  NetShareEnum
  NetShareGetInfo
  NetShareSetInfo

Windows 95 support for these functions differs from Windows NT in two ways. First, because Windows 95 doesn't support Unicode, these functions require ANSI strings. Second, Windows 95 exports the Net functions from SVRAPI.DLL instead of NETAPI32.DLL. If an attempt is made to run a native Windows NT application on Windows 95, the following error will result:

  "The <application> file is linked to missing export NETAPI32.DLL
   <Net...API>"

To handle these differences, applications targeted to both Windows NT and Windows 95 should do the following:

1. Avoid importing Net functions from NETAPI32.DLL at link time.

   Instead, applications should do a run time version check and
   dynamically link to NETAPI32.DLL for Windows NT or SVRAPI.DLL for
   Windows 95.

   For additional information on version checking, please see the following
   article in the Microsoft Knowledge Base:

      ARTICLE-ID:Q92395
      TITLE     :Determining System Version from a Win32-based Application

2. Make sure the application doesn't depend on the presence of unsupported
   API's.

3. When calling Net functions, pass strings using a character set
   appropriate for the host operating system. Use Unicode strings for
   Windows NT and ANSI strings for Windows 95.

If you are only targeting Windows 95 and wish to use SVRAPI.DLL, SVRAPI.H and SVRAPI.LIB are included in the Windows 95 DDK. NOTE: The formal parameter lists for the Net function calls may be slightly different between the header files for Windows NT and Windows 95.

Additional query words:

Keywords          : kbnetwork kbAPI kbSDKPlatform kbWinOS95 kbNetAPI kbGrpNet 
Platform          : WINDOWS
Issue type        : kbinfo

Last Reviewed: August 6, 1998