Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 09-05-2004, 00:27
Teerayoot Teerayoot is offline
Friend
 
Join Date: Mar 2004
Location: ประเทศไทย
Posts: 82
Rept. Given: 0
Rept. Rcvd 3 Times in 2 Posts
Thanks Given: 1
Thanks Rcvd at 16 Times in 8 Posts
Teerayoot Reputation: 3
ZwTerminateProcess

*From "Window Nt Native API Reference"
Quote:
ZwTerminateProcess terminates a process and the threads that it contains.
NTSYSAPI
NTSTATUS
NTAPI
ZwTerminateProcess(
IN HANDLE ProcessHandle OPTIONAL,
IN NTSTATUS ExitStatus
);
////////////////////////////////////////////////////////

I try to using this function but the process do not terminate ,here is my code snippet

//// Global ////
Quote:
#define NTSTATUS ULONG
typedef
NTSYSAPI
NTSTATUS
NTAPI
(*ZwTerminateProcess)(
IN HANDLE ProcessHandle OPTIONAL,
IN NTSTATUS ExitStatus
);
ZwTerminateProcess fZwTerminateProcess;
//// Use ////
Quote:
fZwTerminateProcess = (ZwTerminateProcess)GetProcAddress(GetModuleHandleA("ntdll.dll"),"ZwTerminateProcess");
fZwTerminateProcess(NULL,1);
All compiling made sucessfull ,but when the process do not terminate.
Do i make somethings wrong?
Reply With Quote
  #2  
Old 09-05-2004, 01:48
omega_red
 
Posts: n/a
You should read carefully. If the process handle is 0, this function terminates all threads of current process, except current thread.
Reply With Quote
  #3  
Old 09-05-2004, 02:15
Teerayoot Teerayoot is offline
Friend
 
Join Date: Mar 2004
Location: ประเทศไทย
Posts: 82
Rept. Given: 0
Rept. Rcvd 3 Times in 2 Posts
Thanks Given: 1
Thanks Rcvd at 16 Times in 8 Posts
Teerayoot Reputation: 3
Quote:
Originally Posted by omega_red
You should read carefully. If the process handle is 0, this function terminates all threads of current process, except current thread.
except current thread Where u got that message??


As it stated
ZwTerminateProcess terminates a process and the threads that it contains.

Quote:
Parameters
ProcessHandle
A handle to a process object.The handle must grant PROCESS_TERMINATE access. If this
value is zero, the current process is terminated.

I try pass NULL(0) as parameter as want to terminate current process ,but it do nothing.
Reply With Quote
  #4  
Old 09-05-2004, 02:30
omega_red
 
Posts: n/a
Strange, that was citation from the book you've mentioned (actually, a polish translation). My edition is from year 2000.
Reply With Quote
  #5  
Old 09-05-2004, 02:45
Teerayoot Teerayoot is offline
Friend
 
Join Date: Mar 2004
Location: ประเทศไทย
Posts: 82
Rept. Given: 0
Rept. Rcvd 3 Times in 2 Posts
Thanks Given: 1
Thanks Rcvd at 16 Times in 8 Posts
Teerayoot Reputation: 3
Windows NT2000 Native API Reference - Gary Nebbett

Gary NebbettWho is he?He make me crazy!


I don't know the date publish ,i'm just download from internet.
Reply With Quote
  #6  
Old 09-05-2004, 03:05
lifewire
 
Posts: n/a
that citate is in my book neither. (english edition)
Reply With Quote
  #7  
Old 09-05-2004, 03:20
omega_red
 
Posts: n/a
This is quote from my paper version:

Quote:
Original title: "Windows NT/2000 Native API reference", Gary Nebbett, ISBN: 83-7197-508-2.
Authorized translation from the English language edition published by MTP
Copyright (c) 2000

Polish language edition published by Helion
Copyright (c) 2001
Description of ZwTerminateProcess is the same as yours, except this little difference mentioned above.
Reply With Quote
Reply

Thread Tools
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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Delphi/Native API] ZwTerminateProcess without declaration from UserMode Agmcz Source Code 3 07-25-2018 04:48


All times are GMT +8. The time now is 00:44.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( 1998 - 2024 )