Something wrong with @PID

May 20, 2008
11,400
99
Syracuse, NY, USA
In debugging a GUI app, heartbeat.exe, I successfully used the "TASKEND /F %@pid[heartbeat.exe]" many times (in the same instance of TCC). Then, for no apparent reason,
Code:
l:\projects\heartbeat\release> taskend /f %@pid[heartbeat.exe]
Cannot end process #9448 [audiodg]

For emphasis:
Code:
l:\projects\heartbeat\release> tasklist
    0  [System Process]
**** SNIP ****
9552  conhost
7132  vcpkgsrv
25952* tcc              13.04  [25952]  l:\projects\heartbeat\release
54660  conhost
9448  audiodg
17444  heartbeat
27836  taskmgr          Windows Task Manager
 
l:\projects\heartbeat\release> echo %@pid[heartbeat.exe]
9448

Later (same TCC session) when audiodg.exe had stopped and was restarted with a new PID, things started working correctly again.

I have no clue how to try to debug this except to try, appropriately, to kill the task which follows audiodg.exe in the TASKLIST. I'll keep my eyes open.
 
May 20, 2008
11,400
99
Syracuse, NY, USA
It was easy enough to do with v14 ... exactly the same thing. Here it is with v14 and another app.
Code:
l:\projects\heartbeat\release> tasklist
    0  [System Process]
**** SNIP ****
42968* tcc              14.03  [42968]  l:\projects\heartbeat\release
35988  conhost
40516  audiodg
56232  vcpkgsrv
10176  firefox          Something wrong with @PID | Take Command Windows command processor - Mozilla Firefox
3652  heartbeat
 
l:\projects\heartbeat\release> taskend /f %@pid[vcpkgsrv.exe]
Cannot end process #40516 [audiodg]
 
May 20, 2008
11,400
99
Syracuse, NY, USA
Here's another showing @PID getting it wrong.
Code:
l:\projects\heartbeat\release> ver
 
TCC  14.03.53  Windows 7 [Version 6.1.7601]
 
l:\projects\heartbeat\release> tasklist | grep audiodg
  564  audiodg
 
l:\projects\heartbeat\release> echo %@pid[audiodg.exe]
0
 
l:\projects\heartbeat\release> echo %@isapp[audiodg.exe]  (plugin)
564
 
l:\projects\heartbeat\release> tasklist | grep audiodg
  564  audiodg
 
Aug 2, 2011
258
4
Berlin, Germany
WAD -- you don't have the necessary rights to query that process.
What do you mean with necessary rights? Isn't "run as admin" enough?
Code:
(system)  C:\...\TCMD14x64 >ver
 
TCC  14.03.52 x64  Windows 7 [Version 6.1.7601]
 
(system)  C:\...\TCMD14x64 >echo %_elevated
1
 
(system)  C:\...\TCMD14x64 >tasklist | findstr /i audiodg
4860  audiodg
 
(system)  C:\...\TCMD14x64 >echo %@pid[audiodg]
0
 
(system)  C:\...\TCMD14x64 >echo %@pid[audiodg.exe]
0
So I have a result which I don't understand, too.
 
May 20, 2008
11,400
99
Syracuse, NY, USA
I've tried for two days and have been unable to make it fail.
WAD -- you don't have the necessary rights to query that process.
If you have a reproducible failcase (with something other than "audiodg", which you can't access) I'll take another look.
Did you read my first post carefully. I wasn't trying to access audiodg.exe. I tried to end a task to which I do have access and @PID returned the wrong PID; simple as that. I doubt I can give you something **you** can readily reproduce because I have no control over how your (or my) system assigns PIDs. And it would seem, the problem **requires** audiodg.exe.

l:\projects\heartbeat\release> taskend /f %@pid[heartbeat.exe]
Cannot end process #9448 [audiodg]

l:\projects\heartbeat\release> tasklist
0 [System Process]
**** SNIP ****
9552 conhost
7132 vcpkgsrv
25952* tcc 13.04 [25952] l:\projects\heartbeat\release
54660 conhost
9448 audiodg
17444 heartbeat
27836 taskmgr Windows Task Manager

l:\projects\heartbeat\release> echo %@pid[heartbeat.exe]
9448
 
May 20, 2008
11,400
99
Syracuse, NY, USA
FWIW, on Win7/32, elevated or not, I cannot open audiodg's PID with PROCESS_QUERY_INFORMATION but I can open it with PROCESS_QUERY_LIMITED_INFORMATION.

That audiodg (run by LOCAL_SERVICE) can be opened with PROCESS_QUERY_LIMITED_INFORMATION when **not elevated** is different from the behavior of all other processes not running as the logged-on user.

That may explain Frank's anomaly but I don't think it will help with @PID returning the wrong PID.
 

rconn

Administrator
Staff member
May 14, 2008
12,345
150
Did you read my first post carefully. I wasn't trying to access audiodg.exe. I tried to end a task to which I do have access and @PID returned the wrong PID; simple as that. I doubt I can give you something **you** can readily reproduce because I have no control over how your (or my) system assigns PIDs. And it would seem, the problem **requires** audiodg.exe.

Yes, I read your first post carefully; I do have "audiodg", and (as I said) I am completely unable to reproduce your problem with @PID returning the wrong process ID.

The only way that could happen is if the Windows API involved is returning the wrong information.
 
Similar threads
Thread starter Title Forum Replies Date
vefatica @EXECSTR ... TCSTART ... something's wrong! Support 7
vefatica Something got very slow (very recently) Support 1
L How to? Shebang, nice idea but am I missing something? Support 4
P Can't do something to a file and then delete it? Support 6
vefatica Something is hosed in build 74 Support 10
M Hotkey-mechanism, for doing something with the current command-line Support 4
M Yet another strange something re something called "@TCONVERT" Support 8
M Is this a restriction I wasn't aware of or something new (that maybe shouldn't be there)? Support 16
vefatica Append something entered to a file? Support 12
M Something that does not seem possible... Support 2
JohnQSmith New online help file wrong logo Support 7
R History window wrong size, can't remember size change Support 12
mfarah Fixed The DATE command produces the wrong error message. Support 1
MikeBaas @regsetenv complains "wrong parameter" Support 14
mikea How to? TCC registered to wrong 'entity' Support 5
T @replace -- what is wrong here Support 2
vefatica Fixed KEYSTACK /i with repeat count sends wrong keys Support 7
C ZIP/U compares wrong timestamp Support 13
vefatica @WORDS, often wrong Support 0
vefatica gcd() ... wrong answer, lcm() hangs Support 5
D What is wrong with this code? Support 7
vefatica WAD DIR /HL still gets names wrong Support 16
H Fixed DIR /G returns wrong sizes Support 2
M Another "What is wrong?" Support 8
M What is wrong with this command? Support 4
vefatica Updater says wrong version Support 1
CWBillow Wrong icons keep sticking Support 6
M How to? What am I doing wrong/not understanding? Support 10
C News link wrong Support 1
M What am I doing wrong? Support 12
M What am I doing wrong here? Support 2
C Forum column headings wrong? Support 4
gschizas Installation folder for TCMD x64 15.1 is wrong Support 5
Dan Glynhampton Documentation v15 help: ECHOXERR Help Page Title is Wrong Support 0
M What am I doing wrong in this (very simple!) code? Support 3
J zip wrong central directory signature Support 12
S Fixed _DO_FILES and _DO_DIRS wrong Support 0
B Downloading Updates - Error: Wrong file size?? Support 3
vefatica What's wrong here? Support 2
vefatica Wrong startup file? Support 1
M How to? Missing closing quote: What am I doing wrong???? Support 7
gschizas (minor) Help topic "Colors, Color Names and Codes" is wrong Support 0
T Wrong prompt in Windows command console Support 3
M Where am I going wrong with ALIAS??? Support 7
G Wrong File Size Support 8
vefatica Updating v10: error wrong file size Support 2
S Wrong .INI file used by TCC Support 2
K_Meinhard Wrong sender adress Support 0
vefatica Help for @PID Support 2
vefatica @PID and system processes? Support 3

Similar threads