calling NetShareEnum win32api with ctypes

Tim Golden mail at
Thu Aug 28 10:26:54 CEST 2008

taghi wrote:
> I wrote this code in python 2.5:
> from ctypes import *

... snip ...

> netapi32=cdll.LoadLibrary('netapi32.dll')

This is your problem: netapi32 is a windows
DLL and needs to be attached as such:

  netapi32 = windll.LoadLibrary ("netapi32.dll")

or, more simply:

  netapi32 = windll.netapi32

But see my other post re this function in pywin32


More information about the Python-list mailing list