Jump to content

Enumerating network resources *SOLVED*

Recommended Posts

I am new to DLLStruct functions. Here is what is not working:

#include <WinNet.au3>
;~ Local $tResource = DllStructCreate($tagNETRESOURCE)
Local $hEnum
;                           all currently connected, all resources, all resource types
Local $b = _WinNet_OpenEnum ( 0, 0, 0, 0, $hEnum)
Local $iCount= -1
Local $ret = DllStructCreate($tagNETRESOURCE)
Local $siz = DllStructGetSize($ret)
MsgBox(0,'siz',$siz&'   '&@error)
While True
    $b = _WinNet_EnumResource($hEnum,$iCount,$ret,$siz)
    MsgBox(0,'','b  '&$b&'  siz  '&$siz&'   iCount  '&$iCount)
    MsgBox(0,'enum',DllStructGetData($ret,'LocalName')&'   '&DllStructGetData($ret,'RemoteName'))
    If $b<>True Then Exit

The Help says that _WinNetEnumResource() returns either True or False. In my case, It returns 234, Error more data.

For pBuffer ($ret) the help says "The buffer must be large enough to hold the structures plus the strings to which their members point.". How do I do this?

As I first atempt, I am trying grabbing one resource at a time.

Edited by c.haslam


CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...