C++ BUG ? OR:How to prevent NetShareGetInfo from using LsaLookupNa

G

Guest

Hi everybody!

In my VC++7 project (VS 2003), I make use of the NetShareGetInfo - API which
is in NETAPI32.DLL. Acording to the MSDN library, the NetShareGetInfo API is
supported for all Windows versions from Win95 to 2003 Server.
In Stdafx.h I defined _WIN32_WINNT as 0x0400, which should make the target
platform of the executable Windows NT4 or later.
When I compile an link the exe, the linker produces a binary that has a
dependency on LsaLookupNames2 from ADVAPI32.dll.
However, the LsaLookupNames2 API is only supported on WinXP and 2003Server,
which of course results in a loader error whenever I want to execute the
binary on Win2000, for example.
I am using the latest Platform SDK, but I also tried to use the SDK version
that ships with VisualStudio 2003.
Is there any resolution to this? How can I use VS2003 to compile and link an
exe that calls NetShareGetInfo in a way than it will run on Win2000?

Thanks for any hint!
Markus
 
A

Alon Fliess

=?Utf-8?B?TWFya3VzIEdlaWdlcg==?= said:
Hi everybody!

In my VC++7 project (VS 2003), I make use of the NetShareGetInfo - API which
is in NETAPI32.DLL. Acording to the MSDN library, the NetShareGetInfo API is
supported for all Windows versions from Win95 to 2003 Server.
In Stdafx.h I defined _WIN32_WINNT as 0x0400, which should make the target
platform of the executable Windows NT4 or later.
When I compile an link the exe, the linker produces a binary that has a
dependency on LsaLookupNames2 from ADVAPI32.dll.
However, the LsaLookupNames2 API is only supported on WinXP and 2003Server,
which of course results in a loader error whenever I want to execute the
binary on Win2000, for example.
I am using the latest Platform SDK, but I also tried to use the SDK version
that ships with VisualStudio 2003.
Is there any resolution to this? How can I use VS2003 to compile and link an
exe that calls NetShareGetInfo in a way than it will run on Win2000?

Thanks for any hint!
Markus

Hi

Can you provide the source code that shows how you use the API?

Alon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top