PLC
asked on
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
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
ASKER
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?
Is there anybody who has ever done this on win95?
Not yet. At least not this API. But if your show me your sources (please not too long... :-), I'll find a bug perhaps.
BTW: 87 is ERROR_INVALID_PARAMETER...
ASKER
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; UNCCLientN ame:PWideC har;
Usernaam:PWideChar;Level:D Word;lpInf o:Pointer;
Maxlen:DWORD;EntriesRead:P DWORD;Tota lentries:P DWord;
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:P Dword;
begin
maxlen:=1000; Entriesread:=0;Totalentrie s:=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(NetResu lt[0].lpUs er)
end;
end;
tnx
Function NetSessionEnum(ServerName:
Usernaam:PWideChar;Level:D
Maxlen:DWORD;EntriesRead:P
hEnum:PDWord):DWORD stdcall;
function NetSessionEnum; external 'svrapi.dll' name 'NetSessionEnum';
procedure TForm1.Button2Click(Sender
var hEnum:PDWord;
Result:Integer;
NetRes:PInfo;
NetResult:Array[0..200] of SESSION_INFO_10;
maxlen:DWord;
entriesread,totalentries:P
begin
maxlen:=1000; Entriesread:=0;Totalentrie
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(NetResu
end;
end;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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
I'll try this now. Anyway, for bearing with me I think you deserve to get the points.
tnx
Patrick
Regards, Madshi.