Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Who has the file opened in NT 4.0
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00161537
Message ID:
00161743
Views:
22
>I will look it up Ed!

I think the one you want to look at is NetFileEnum() with a level of 3, which returns FILE_INFO_3 structures. The prototype for the API call should look like:
DECLARE INTEGER NetFileEnum IN NETAPI32.DLL ;
   STRING lpServerName, ;
   STRING lpBasePath, ;
   STRING lpUserName, ;
   INTEGER dwLevel, ;
   STRING lpBuffer, ;
   INTEGER dwPrefMaxSize, ;
   INTEGER @ lpdwEntriesRead, ;
   INTEGER @ lpdwTotalEntries, ;
   INTEGER @ lphResumeRetrieveHandle
From a Win95 box, use IN SVRAPI.DLL instead.

You'll have to spin through file entries for a specific system (lpServerName is the name of the machine to examine; passing an integer 0 examines the list for the local system) for a specific path prefix (lpBasePath should be should be a fully-qualified path on the server in its local notation; passing an integer 0 gets all files for all paths on the specified machine) for a specific user (lpUserName is the name of the user (user-level access control) or computer (share-level access control) you want to examine, passing an integer 0 retrieves data for all users/computers). Level 3 gets FILE_INFO_3 structures, that show path, user and type of file access; interpreting this requires a wrapper of some sort, or the use of API calls to retrieve strings based on pointers like lstrcopy() or RtlMoveMemory(), since there are embedded pointers to strings in the structure. It's an enumeration, so you have to call it repeatedly (lpdwTotalEntries times) using the value returned in lphResumeRetrieveHandle from the previous call to get the next entry in the enumeration (start the first call with a lphResumeRetrieveHandle value of 0, and make certain to pass it by reference, since you'll need the returned value on subsequent calls.

I do not have working VFP code to use this directly; I've used a wrapper .DLL in the past to access this API call.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform