win32net: NetShareEnum Doesn't Work on Win9x Targets?

DaveMoore djmoore at uh.edu
Tue Jan 30 21:55:56 EST 2001


I'm working with the Win32 API NetShareEnum function under
ActivePython 2.02, on a mixed 9x/NT/2K network.

When I invoke NetShareEnum("\\NTServer",shrLevel,resShare,prefLen),
I get the list of shared resources I expect. However, when I do the
same with NetShareEnum("\\Win98Srv",shrLevel,resShare,prefLen), I get
the error, "(87, 'NetShareEnum', 'The parameter is incorrect.')"

On checking the Microsoft SDK docs, I find that the calling parameters
are different for Win9x servers. I had thought this wouldn't affect
me, because my workstation is WinNT, but apparently the call is
actually executed on the remoter server.

The PythonWin32 Extensions doc mentions an "Alternative Parameter"
that allows you to specify which server the command runs on, but does
not say how to invoke the alternative form of the command. No, just
adding another parameter to the list doesn't work.

Perhaps I should be using WNetOpenEnum etc.? Unfortunately, the help
doc says there's a bug associated with that. How bad is the bug? 

Also, the WNet functions apparently don't return some of the
information I'm looking for. Plus, I have to say, the WNet stuff seems
a lot more complicated to use.

Thanks again.

-- 
Dave Moore == djmoore at uh.edu == I speak for me.



More information about the Python-list mailing list