calling NetShareEnum win32api with ctypes

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Thu Aug 28 04:33:54 EDT 2008


En Thu, 28 Aug 2008 02:01:23 -0300, taghi <eghlim84 at gmail.com> escribi�:

> I want to call NetShareEnum, a function from netapi32.dll
> NetShareEnum has this definition:
> [...]
> netapi32=cdll.LoadLibrary('netapi32.dll')
> netapi32.NetShareEnum(cname, level, byref(bufptr), prefmaxlen,
> byref(entriesread), byref(totalentries), byref(resume))
>
> but I get this error:
> Traceback (most recent call last):
>   File "<pyshell#12>", line 1, in <module>
>     s.NetShareEnum(name, level, byref(bufptr), prefmaxlen,
> entriesread, totalentries, resume)
> ValueError: Procedure called with not enough arguments (28 bytes
> missing) or wrong calling convention

Try with netapi32=windll.netapi32 instead

-- 
Gabriel Genellina




More information about the Python-list mailing list