Listing hidden shares on win95/98 machines

Listing hidden shares on win95/98 machines

Post by Dan » Wed, 11 Oct 2000 04:00:00



I have code now that will use WNetEnumResource to lists shares and
printers on a machine.   I just added NetShareEnum, which will list
hidden resources on NT machines.

So how do I list hidden resources/shares on 95/98 machines?

Also, if you are reading this, what d I have to do:

NetShareEnum( (char *) L"\\\\SERVER", ....)
  when one would think that
NetShareEnum( L"\\\\SERVER", .... )
  would work.  It tells me it can't convert from unsigned short [8] to
char *.

And if all it wants is a char *, then how come
NetShareEnum("\\\\SERVER",....)
doesn't work?  (On win2k)

 
 
 

Listing hidden shares on win95/98 machines

Post by Felix Kasza [MVP » Wed, 11 Oct 2000 04:00:00


Dan,

 > So how do I list hidden resources/shares on 95/98 machines?

With NetShareEnum().

 > NetShareEnum( (char *) L"\\\\SERVER", ....)
 >   when one would think that
 > NetShareEnum( L"\\\\SERVER", .... ) would work.

Net*() APIs on NT are always Unicode. No exceptions. Older header files
had a bug (they declared strings as derivatives of the ambient character
size), but newer ones fix that by explicitly requiring LPCWSTR &c.

Win9x APIs listed in svrapi.h are ANSI, always.

Win9x APIs from rlocal32.dll and radmin32.dll (see
http://www.veryComputer.com/) are ANSI, too; note that the
APIs in that group have an "A" suffix if they use strings:
NetSomeFunction() but NetFunctionWithStringsA().

--

Cheers,
Felix.

If you post a reply, kindly refrain from emailing it, too.
Please consider migrating to microsoft.public.platformsdk.*
where the MS folks plan on* around. See you there!

 
 
 

1. NetShareAdd - creating a remote share on a Windows 98 machine from Windows 2000

Hi,

How can you create a remote share on a Windows 98 machine using NetShareAdd
on a Windows 2000 machine logged in as Administrator? I've tried
unsuccessfully many times.

Windows NT/2000 - SHARE_INFO_2 and SHARE_INFO_502 structures used with
NetApi32.dll
NET_API_STATUS NetShareAdd(LPWSTR servername, DWORD level, LPBYTE buf,
LPDWORD parm_err);

Windows 95/98/ME - SHARE_INFO_50 structure used with SvrApi.dll
Extern API_FUNCTION NetShareAdd(const char FAR * pszServer, short sLevel,
const char FAR * pbBuffer, unsigned short cbBuffer);

Thanks in advance,
Brett

2. c++ class for zapredraw

3. How do you get the Domain/Workgroup name from a Win95/98/NT Machine?

4. QUAKE once again...

5. Users listing on client machine (W95/98)

6. Privacy with family use

7. Fonts changing when creating image files from Visio

8. win95/98 shared arena

9. Adding a Share to Win95/98

10. How to get Application List in Winnt and Win95/98

11. List of users on win95/98

12. How do you Use WNetOpenEnum, WNetEnumResource to listing a particular Machine's network shares?