Users on a shared resource

I want to find out who is using a shared resource on my Windows95 machine.
Something similar to the net watcher application delivered with Windows 95.
This seams to be a lot easier with NT than on win95.
Anybody know how I can find out which user is using which files on a shared resource?
Tnx
PLCAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

MadshiCommented:
Perhaps NetFileEnum helps? But watch out - like all net APIs this API has different parameters under win9x than it has under winNT. Normally you find only the parameters for winNT. Look in the "svrapi.h" for the win9x headers.

Regards, Madshi.
0
PLCAuthor Commented:
Netfileenum is definitely the api that I need. Only trouble is that by now I got plenty of comments, info, examples from all kinds of sources on how to use and on NT it works fine, on win95 all I get is error 87.
Is there anybody who has ever done this on win95?
0
MadshiCommented:
Not yet. At least not this API. But if your show me your sources (please not too long... :-), I'll find a bug perhaps.
0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

MadshiCommented:
BTW: 87 is ERROR_INVALID_PARAMETER...
0
PLCAuthor Commented:
Oops seem to have deleted that code, probably in frustration :-); but this gave the same problem, so probably the same error.
tnx

Function NetSessionEnum(ServerName:PWideChar;UNCCLientName:PWideChar;
                        Usernaam:PWideChar;Level:DWord;lpInfo:Pointer;
                        Maxlen:DWORD;EntriesRead:PDWORD;Totalentries:PDWord;
                        hEnum:PDWord):DWORD stdcall;
function NetSessionEnum; external 'svrapi.dll' name 'NetSessionEnum';

procedure TForm1.Button2Click(Sender: TObject);
var hEnum:PDWord;
    Result:Integer;
    NetRes:PInfo;
    NetResult:Array[0..200] of SESSION_INFO_10;
    maxlen:DWord;
    entriesread,totalentries:PDword;
begin
maxlen:=1000; Entriesread:=0;Totalentries:=0;    
NetRes:=Addr(NetResult);
Result:=0;
While Result=0 do
begin
 Result:=NetSessionEnum(nil,
                       nil,
                       nil,
                       10,
                       Netres,
                       Maxlen,
                       EntriesRead,
                       Totalentries,
                       hEnum);
 if Result=0
    then listbox1.Items.Add(NetResult[0].lpUser)
end;
end;
0
MadshiCommented:
Heyhey, read my first comment again. You're using COMPLETELY wrong parameters - namely the NT ones. The win9x parameters are differently.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
PLCAuthor Commented:
Quite, somebody gave me the wrong declarations to work from. Checked the file now myself, stupid me.
I'll try this now. Anyway, for bearing with me I think you deserve to get the points.
tnx
Patrick
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.