| suv2@mail.ru 2005-09-26, 6:55 pm |
| > Do the DOS sessions close down cleanly between iterations??
Yes
> What/How many (DOS) processes are running on your customers machine
> when it fails??
1 process, wich call swpruncmd
> The programm fails after NN hours continuous job.
> When you say 'program' here do you mean your app or the utility??
My app.
> How long is 'NN'??
It depends only on quantity of calls "swpruncmd". User can (by own
action) exhaust this limit for 1 hour or for 8 hours
> Could the utility be hung and it's causing your app to fail??
No!!! Last call of utility is cuccess, then my app causing GPF
> Can you show us the relevant application code??
> - not the test stuff, including the surrounding 10-20 lines of code
#define Default(X,V) if(X == NIL,X := V,)
func msNetUsers(lReread)
// run "net view" and analyze output
// return domain user array
local i,A,F,Start,MaxSpace,Comment
static Users
Default(lReread,.F.)
if !(Users == NIL .or. lReread)
ret Users
end
F:= GetTmpFName("*.txt")
PushScreen()
swpruncmd("net view>"+F)
PopScreen()
A := ftoa(F) // file to array
FErase(F)
Start := ascan(A,"\\") ; i := Start ; Users:={}
while i <= len(A) .and. A[i] = "\\"
aadd(Users,substr(A[i],3))
++i
end
MaxSpace := 0
for i:=1 to len(Users)
Start := at(" ",Users[i])
if Start > MaxSpace
MaxSpace := Start
end
next
for i:=1 to len(Users)
if (Start := FirstNotChar(" ",Users[i],at(" ",Users[i]))) # 0
Comment := "("+alltrim(substr(Users[i],Start))+")"
else
Comment := ""
end
Users[i] := padr(substr(Users[i],1,at("
",Users[i])-1),MaxSpace)+Comment
next
ret Users
func msNetPrinters(lReread)
// Make *.bat with "net view \\user" for each domain user and analyze
output
// return shared printers array
local i,U,Bat:={},F,BatF
static Printers
Default(lReread,.F.)
if !(Printers == NIL .or. lReread)
ret aclone(Printers)
end
U := msNetUsers(lReread)
F := getTmpFName("*.txt")
aadd(Bat,"@echo off")
for i:=1 to len(U)
aadd(Bat,"echo Query printer from user:"+U[i])
aadd(Bat,"echo.")
aadd(Bat,"echo =="+U[i]+">"+if(i==1,"",">")+F)
aadd(Bat,"net view \\"+stoken(U[i],1)+">>"+F)
next
BatF := getTmpFname("*.bat")
atof(Bat,BatF) // arrayto file
PushScreen()
swpruncmd(BatF)
PopScreen()
FErase(BatF)
Printers := ScanNetView(F,"Print") // analyze output
FErase(F)
ret aclone(Printers)
> - have you tried using/setting ALL the parameters of the swpruncmd()
This is not necessarily
> Does this utility run multiple times at all??
I have not understood the question.
> - can you have 2 or more DOS sessions running the utility at the same time
No
> Can you tell us what the utility does??
I call diffirent external progs. For example NET.EXE with different
params.
I repeat: GPF occurs not only with swpruncmd("NET.EXE")
It occurs after strictly certain number of calls of ANY external prog.
For example:
for i:=1 to 200
swpruncmd("dir")
next
This cause GPF ALLWAYS after 157 calls on certain computers.
> Can you include it's functionality into your app??
No.
|