Bug in WaitForSingleObject()

  • Thread starter Thread starter Dallas Clarke
  • Start date Start date
D

Dallas Clarke

Hello MS,

I have found a problem with "WaitForSingleObject()" when it returns
WAIT_ABANDONED, it uncontrollably writes into my heap memory, corrupting it.
So when some code as:-

if(scanMemory() == NO_ERROR){
if((error = WaitForSingleObject(mutex)) == WAIT_OBJECT_O || error ==
WAIT_ABANDONED){
if(scanMemory() == NO_ERROR){
....
}
else MessageBox("Have error in memory after scan memory 2");
}
else MessageBox("Unable to get Mutex");
}
else MessageBox("Have error in memory after scan memory 1");


I get the message "Have error in memory after scan memory 2". Can you please
get someone to have another look at this function.


Cheers,
Dallas Clarke

BSc (CS) LLB UNSW
Project Leader
Ekky Software


Homepage: http://www.ekkySoftware.com
Email: (e-mail address removed)
 
----- Dallas Clarke wrote: ----


Hello MS

I have found a problem with "WaitForSingleObject()" when it return
WAIT_ABANDONED, it uncontrollably writes into my heap memory, corrupting it
So when some code as:

if(scanMemory() == NO_ERROR)
if((error = WaitForSingleObject(mutex)) == WAIT_OBJECT_O || error =
WAIT_ABANDONED)
if(scanMemory() == NO_ERROR)
...

else MessageBox("Have error in memory after scan memory 2")

else MessageBox("Unable to get Mutex")

else MessageBox("Have error in memory after scan memory 1")


I get the message "Have error in memory after scan memory 2". Can you pleas
get someone to have another look at this function


Cheers
Dallas Clark

BSc (CS) LLB UNS
Project Leade
Ekky Softwar


Homepage: http://www.ekkySoftware.co
Email: (e-mail address removed)
 
Back
Top