WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Sponsors
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
Hard Drive Recovery
Wiring your own LAN
Personal menu
Welcome Guest
User:
Pass:
Register!
Resend Validation Email
 
Forum
 

Win32 Debug-API Problem, Failure in Debug-API Documentation?

Junihausen
Quote Post


New Member
*

Group: Members
Posts: 5
Member No.: 778
Joined: 11-November 04


Hi,
I'm writing right now on a programm which attaches and deattaches to processes as a debugger in a loop. I noticed a leak of handles, so I made a small test program based on Iczelions Win32 Debug API tutorial part 1 to isolate the problem.
It seems, that in difference to the documentation from MSDN, the process-handle and the thread-handle delivered with the CREATE_PROCESS_DEBUG_EVENT aren't closed by windows after receiving the EXIT_PROCESS_DEBUG_EVENT and continuing with ContinueDebugEvent.
I could close them myself after I got them with the Createprocess-event but I don't know if there are arising other problems from this. I mean my prog should run for a while.
Just like I mentioned, every source I studied about these two handles says, that I shouldn't close these because the windows api takes care of them but apparently it doesn't. I checked it with Process Explorer from Sysinternals.
Does anyone know anything about that? By the way, the system is Win98.

Thanks in advance
Volker

P.S: I could post my example code If you wish, but it's almost identical to Iczelions. I only added a line closing the file-handle, because you should do that, and a call to ContinueDebugEvent after the part for the EXIT_PROCESS-event.
PMEmail Poster
Top
QvasiModo
Quote Post


Just your regular village idiot
******

Group: Moderators
Posts: 462
Member No.: 7
Joined: 13-May 04


There is no problem in closing process handles. A handle is just a kernel object used to reference the process, so closing the handle does nothing to the process it refers to. Also, even if the process is dead, the handle may still be open (this is usefull for getting the exit code, etc.) so you shouldn't assume that the handle "closes itself".

Hope this helps! smile.gif
PMEmail Poster
Top
Junihausen
Quote Post


New Member
*

Group: Members
Posts: 5
Member No.: 778
Joined: 11-November 04


Yes thanks,

so I'll just close them right after I get them.
PMEmail Poster
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll

 

Sponsors
Computer Science

Internet
C/C++
Hardware & PC maintenance

HiEditor

General Discussions
Suggestions/Bug Reports
WinAsm Studio

General Discussions
Suggestions/Bug Reports
WinAsm Studio FAQ
Multilingual User Interface
Add-Ins
Assembly Programming

Main
Newbies
Projects
Custom Controls
Snippets
Announcements & Rules

Announcements

General

Online Degrees - Distance Learning
The Heap
Russian
Google