Hi folks!
I am trying to enumerate all network resources by using the WNetOpenEnum API call. I have read through all the MSDN documentation for this function, however when I call the function, I always have a return value of 87 which according to WNetGetLastError means that the "Parameter is incorrect". In my case, the fourth parameter NETRESOURCE is NULL which it is allowed.
I would appreciate any suggestions:
#DEFINE RESOURCE_CONNECTED 1
#DEFINE RESOURCE_GLOBALNET 2
#DEFINE RESOURCE_REMEMBERED 3
#DEFINE RESOURCE_RECENT 4
#DEFINE RESOURCE_CONTEXT 5
#DEFINE RESOURCETYPE_ANY 0
#DEFINE RESOURCETYPE_DISK 1
#DEFINE RESOURCETYPE_PRINT 2
#DEFINE RESOURCETYPE_RESERVED 8
m.lnEnumHandle = 0
DECLARE INTEGER WNetOpenEnum IN MPR.DLL ;
INTEGER @nScope,;
INTEGER @nType,;
INTEGER @nUsage,;
STRING @cNetResouce,;
INTEGER @nHandle
m.lnError = WNetOpenEnum( ;
RESOURCE_GLOBALNET,;
RESOURCETYPE_ANY,;
0,;
NULL,;
@lnEnumHandle )
IF m.lnError == 0 && Successfull
...
ENDIF
Thanks in advance