Old 28th April 2009, 13:55   #1
820815
Junior Member
 
Join Date: Apr 2009
Location: St. Petersburg, Russia
Posts: 25
get process info

How can I get "I/O Write Bytes" info for process?
820815 is offline   Reply With Quote
Old 29th April 2009, 00:28   #2
Static_VoiD
Junior Member
 
Join Date: Apr 2009
Location: Lensk, Yakutia
Posts: 16
Send a message via ICQ to Static_VoiD
Oh, man. You can read some manual on this at MSDN.
Them use System plugin to call the DLL and function required.
Static_VoiD is offline   Reply With Quote
Old 29th April 2009, 16:33   #3
820815
Junior Member
 
Join Date: Apr 2009
Location: St. Petersburg, Russia
Posts: 25
MSDN

If I could understand what is written there, I would not have to ask here
820815 is offline   Reply With Quote
Old 25th August 2010, 00:29   #4
820815
Junior Member
 
Join Date: Apr 2009
Location: St. Petersburg, Russia
Posts: 25
So... http://msdn.microsoft.com/en-us/libr...(v=VS.85).aspx

System::Call 'kernel32::OpenProcess(i 1040, i 0, i $PID)i .r0'

System::Alloc 48 ;6 counters * 8 bytes?
Pop $1

System::Call 'kernel32::ProcessGetIOCounters(i r0, p r1)' ???
820815 is offline   Reply With Quote
Old 25th August 2010, 04:04   #5
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
hmmm... good question - seems like it should work (except that 'p' is incorrect... that's the online docs vs included docs mismatch thing.. you'd want 'i')...

...except that it doesn't seem to. Perhaps the struct size isn't quite right - but doesn't seem to be anything wrong with it...

PHP Code:
OutFile "test.exe"

!define PROCESS_QUERY_INFORMATION 0x0400
!define PROCESS_VM_READ 0x0010

Section
    System
::Call "kernel32::GetCurrentProcessId(v)i.r0"
    
System::Call "kernel32::OpenProcess(i${PROCESS_QUERY_INFORMATION}|${PROCESS_VM_READ}, i0, ir0) i.r1 ? e"
    
Pop $7


    System
::Call "*(l, l, l, l, l, l) i.r2"

    
System::Call "kernel32::GetProcessIoCounters(ir1, i.r2) i.r5 ? e"
    
Pop $6
    System
::Call "*$2(l.R1, l.R2, l.R3, l.R4, l.R5, l.R6)"
    
MessageBox MB_OK "GetCurrentProcessId: $0$\nGetOpenProcess: $1$\nBuffer: $2$\nGetProcessIoCounters result: $5$\nGetLastError: $6$\n$\n[$R1][$R2][$R3][$R4][$R5][$R6]"
    
System::Free $2
SectionEnd 
PHP Code:
---------------------------
Name Setup
---------------------------
GetCurrentProcessId5420
GetOpenProcess
248
Buffer
<--- should remain pointer to struct address
GetProcessIoCounters result
<--- should be non-zero
GetLastError
998

[0][0][0][0][0][0]
---------------------------
OK   
--------------------------- 
No idea.. some System plugin wizard will hopefully step in %)
Animaether is offline   Reply With Quote
Old 25th August 2010, 06:51   #6
gringoloco023
Member
 
Join Date: Nov 2009
Posts: 52
Dot

At least the following line should have a dot less on the second parameter. (it's a buffer 'out' so one has to supply the buffer handle)
PHP Code:
System::Call "kernel32::GetProcessIoCounters(ir1, ir2) i.r5 ? e" 
Results:
PHP Code:
GetCurrentProcessId700
GetOpenProcess
204
Buffer
1371680
GetProcessIoCounters result
1
GetLastError
80

[82][3][2529][66090][11408][98746
I'm not sure what I'm exactly looking for, so it's a bit hard to confirm the shape of IO_COUNTERS Structure to be right
gringoloco023 is offline   Reply With Quote
Old 25th August 2010, 11:30   #7
Animaether
Major Dude
 
Join Date: Jun 2001
Posts: 1,173
Quote:
Originally Posted by gringoloco023 View Post
At least the following line should have a dot less on the second parameter. (it's a buffer 'out' so one has to supply the buffer handle)
PHP Code:
System::Call "kernel32::GetProcessIoCounters(ir1, ir2) i.r5 ? e" 
Oh pish. Go figure.. I correlated the __out type as out in the System syntax, and not in.

Quote:
Originally Posted by gringoloco23 View Post
I'm not sure what I'm exactly looking for, so it's a bit hard to confirm the shape of IO_COUNTERS Structure to be right
Open up Task Manager, add the IO columns if needed, compare to those

so, corrected code without the debuggery bits...
PHP Code:
OutFile "test.exe"

!define PROCESS_QUERY_INFORMATION 0x0400
!define PROCESS_VM_READ 0x0010

Section
    System
::Call "kernel32::GetCurrentProcessId(v)i.r0"
    
System::Call "kernel32::OpenProcess(i${PROCESS_QUERY_INFORMATION}|${PROCESS_VM_READ}, i0, ir0) i.r1"

    
System::Call "*(l, l, l, l, l, l) i.r2"

    
System::Call "kernel32::GetProcessIoCounters(ir1, ir2)"

    
System::Call "*$2(l.R1, l.R2, l.R3, l.R4, l.R5, l.R6)"

    
MessageBox MB_OK "PID: $0$\n$\nI/O Reads: $R1$\nI/O Writes: $R2$\nI/O Other: $R3$\nI/O Read Bytes: $R4$\nI/O Write Bytes: $R5$\nI/O Other Bytes: $R6"
    
System::Free $2
SectionEnd 
PHP Code:
---------------------------
Name Setup
---------------------------
PID3460

I
/O Reads75
I
/O Writes3
I
/O Other505
I
/O Read Bytes66122
I
/O Write Bytes11408
I
/O Other Bytes157458
---------------------------
OK   
--------------------------- 
Animaether is offline   Reply With Quote
Old 25th August 2010, 16:29   #8
820815
Junior Member
 
Join Date: Apr 2009
Location: St. Petersburg, Russia
Posts: 25
Thank you!
820815 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump