BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

'ntdll.dll' problem

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
mustafa korkmaz
Guest





PostPosted: Sat Aug 19, 2006 12:41 am    Post subject: 'ntdll.dll' problem Reply with quote



procedure TMyManagerThread.addlist(obje: tobject);
begin
EnterCriticalSection( listkritik );
try
try
Managerlist.Add( obje );
except on e:exception do
begin
.......
end;
end;
finally
LeaveCriticalSection( listkritik );
end;
end;




procedure TfrTCPServer.myProc( Athread: TIdPeerThread );
var MyClass : TMyclass;
begin
.....
MyClass := TMyclass.create;
MyClass.no := 123;
..............
try
ManagerThreads[ Tperson( Athread.data ).roomNumber ].addlist( MyClass );
except on e: exception do
begin
ExceptionLoga( e.Message ); //---------->Access violation at address 7C82F350 in module 'ntdll.dll'. Write of address 31333176
end;
end;

What may be source of the problem? Why ntdll.dll?
This program runs on win2003 server. I use Delhi 5.
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Sat Aug 19, 2006 12:56 am    Post subject: Re: 'ntdll.dll' problem Reply with quote



"mustafa korkmaz" <sekendizpasa (AT) yahoo (DOT) com> wrote in message
news:44e617e4$1 (AT) newsgroups (DOT) borland.com...

Quote:
procedure TMyManagerThread.addlist(obje: tobject);
begin
EnterCriticalSection( listkritik );
try
try
Managerlist.Add( obje );
except on e:exception do
begin
.......
end;
end;
finally
LeaveCriticalSection( listkritik );
end;
end;

FYI, you can simplify that by using a TThreadList instead.

Quote:
ManagerThreads[ Tperson( Athread.data ).roomNumber ].addlist(
MyClass );


You did not show where ManagerThreads is allocated and filled in, how the
roomNumber is assigned, or where listkritik is instantiated. A problem in
any of those operations can cause unexpected problems later on.

Quote:
What may be source of the problem?

There is not enough details yet to diagnose that.

Quote:
Why ntdll.dll?

Because you did something that ultimately ended up calling an API function
inside of the DLL that then accessed invalid memory, throwing the exception.


Gambit
Back to top
Martin James
Guest





PostPosted: Sat Aug 19, 2006 1:01 am    Post subject: Re: 'ntdll.dll' problem Reply with quote



Quote:


procedure TfrTCPServer.myProc( Athread: TIdPeerThread );
var MyClass : TMyclass;
begin
.....
MyClass := TMyclass.create;
MyClass.no := 123;
..............
try
ManagerThreads[ Tperson( Athread.data ).roomNumber ].addlist( MyClass );
except on e: exception do
begin
ExceptionLoga( e.Message ); //---------->Access violation at address 7C82F350 in module 'ntdll.dll'. Write of address 31333176
end;
end;

What may be source of the problem?

Illegal index?


Why ntdll.dll?

...because the CS call is illegal?

First, break up that complex thingy!

procedure TfrTCPServer.myProc( Athread: TIdPeerThread );
var MyClass : TMyclass;
thisPerson:TPerson;
theirRoomNumber:integer;
begin
.....
MyClass := TMyclass.create;
MyClass.no := 123;
..............
try
thisPerson:=Tperson(Athread.data);
theirRoomNumber:=thisPerson.roomNumber;
ManagerThreads[theirRoomNumber].addlist( MyClass );
except on e: exception do
begin
ExceptionLoga( e.Message );
end;
end;

Rgds,
Martin

PS. You have a manager thread for every room??
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Sat Aug 19, 2006 2:27 am    Post subject: Re: 'ntdll.dll' problem Reply with quote

"Martin James" <nospam (AT) dial (DOT) pipex.com> wrote in message
news:44e61c99$1 (AT) newsgroups (DOT) borland.com...

Quote:
ManagerThreads[theirRoomNumber].addlist( MyClass );

var
theManager: TMyManagerThread

theManager := ManagerThreads[theirRoomNumber];
theManager.addlist( MyClass );


Gambit
Back to top
Martin James
Guest





PostPosted: Sat Aug 19, 2006 4:19 am    Post subject: Re: 'ntdll.dll' problem Reply with quote

Quote:

var
theManager: TMyManagerThread

theManager := ManagerThreads[theirRoomNumber];
theManager.addlist( MyClass );


Yes! Even more of the same <g>

Rgds,
Martin
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.