Link to home
Start Free TrialLog in
Avatar of toannds
toannds

asked on

From which DLL I must import Win32 LAN Manager Functions?

Hello,

I use Borland C++ 5.0. My 32-bit programm uses some LAN Manager Functions. It couldn't start. I receive a system message box that my program use a missing function in NETAPI32.DLL . After browsing WINDOWS\SYSTEM directory I learned that NETAPI32.DLL has a size about 4096 bytes and it doesn't export any function!

In Online Support (http://support.microsoft.com) I found that in Windows 95 we must import functions from SRVAPI.DLL . And again, I learned SRVAPI.DLL doesn't export any function!

I also found in Windows\System directory NETAPI.DLL but this is 16-bit DLL. I couldn't change my project to 16-bit b/c header file lm.h is only for 32-bit applications.

Please tell me from which DLL I must import so I can use Win-32 LAN Manager Functions under Windows 95? And if I want to use NETAPI.DLL (16-bit) what I have do in case of header file lm.h only for 32-bit applications?

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of chensu
chensu
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of toannds
toannds

ASKER

Chensu, my LAN use Windows 95 only. I check all PC of my LAN and see that:

SRVAPI.DLLs have the same size 13312 bytes and export nothing.
NETAPI32.DLLs have the same size 4096 bytes and export one function: netbios

I don't understand why our system works well! I see "My Computer" can share my disk to other PCs so maybe it and other applications use LAN Manager Functions reside in another DLLs?. I really want to know where they are (LAN Manager functions). Don't laugh at my stupid thinking.

Do you have any idea?
Thanks.
Do you have the import libraries (srvapi.lib and netapi32.lib)? If so, just use them and test your program.
Avatar of toannds

ASKER

Chensu, I view the import32.lib and see that it already contains LAN Manager Functions.

I created SRVAPI.LIB, NETAPI32.LIB by IMPLIB.EXE and linked them to my program. Compiling is successful but help nothing. I think SRVAPI.DLL, NETAPI32.DLL didn't contain any LAN Manager Functions so linker used what it found in IMPORT32.LIB without any warning or error.

Thanks.
Avatar of toannds

ASKER

Chensu, I have installed VC++ 5.0. I add SRVAPI.LIB into my project and now I receive a link error:

unresolve reference NetShareSetInfo

I view SRVAPI.LIB and see NetShareSetInfo there! I couldn't understand why I can use NetShareGetInfo and others but not NetShareSetInfo although they're imported from the same DLL.

The function prototype of NetShareSetInfo in svrapi.h is different from the one in lmshare.h. For Windows 95, you have to include svrapi.h.
Avatar of toannds

ASKER

Chensu, thank you very much! Although I have some other troubles but my program's on the right way. I can not understand why QuickView and implib.exe (from Borland C++) doesn't see any export function of svrapi.dll ?

You may use Depends.exe that comes with the Platform SDK to see the exported functions.